diff --git a/.vpython b/.vpython index c892a49..960e12e4 100644 --- a/.vpython +++ b/.vpython
@@ -381,3 +381,16 @@ platform: "macosx_10_6_intel" > > + +# Used by: +# //third_party/blink/tools/blinkpy/web_tests/port/server_process.py +wheel: < + name: "infra/python/wheels/pywin32/${vpython_platform}" + version: "version:224" + match_tag: < + platform: "win32" + > + match_tag: < + platform: "win_amd64" + > +>
diff --git a/BUILD.gn b/BUILD.gn index b79e2fb..47062b1 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -342,7 +342,6 @@ "//tools/android/errorprone_plugin:errorprone_plugin_java", "//tools/android/kerberos/SpnegoAuthenticator:spnego_authenticator_apk", "//ui/android:ui_junit_tests", - "//weblayer/shell/android:weblayer_demo_apk", "//weblayer/shell/android:weblayer_shell_apk", ] deps -= [ @@ -992,24 +991,6 @@ } # https://www.chromium.org/developers/testing/webkit-layout-tests - - # The _exparchive at the end of the name indicates to the isolate recipe - # that the isolate should be archived separately using the `exparchive` - # command, rather than as part of the normal `batcharchive` command. - group("blink_web_tests_exparchive") { - testonly = true - deps = [ - ":blink_web_tests", - ] - data_deps = [ - ":blink_web_tests", - ] - } - - # This target contains only a small subset of the web tests, - # and is useful for testing with the regular isolate mechanism. - # To run the full web test suite you need to use - # :blink_web_tests_exparchive, above, instead. generate_wrapper("blink_web_tests") { testonly = true wrapper_script = "${root_build_dir}/bin/run_blink_web_tests"
diff --git a/DEPS b/DEPS index b16c1827..0bd941d 100644 --- a/DEPS +++ b/DEPS
@@ -171,11 +171,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'd0a404e84d4708a5e38ab653f221bace98778553', + 'skia_revision': 'ff82e15d014a954a24b8df3615858d5d37748240', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '2ab3f107117066da55af42d2f6a51b05065e64e0', + 'v8_revision': '4812325d6c2c0de1cf44e7b1669e23b86eacfd52', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -183,7 +183,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': '6b652b335259295d90702fff9f3b34988eef36f7', + 'angle_revision': '76763cb90a431b7fa3a9dcfefe6b71436a8e48a1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -234,7 +234,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': '59c3eac206653d3e057f3262328e8212a3993d52', + 'catapult_revision': '4b1db19bd4262b8289266d0e753d6d4f247bf94d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -464,7 +464,7 @@ 'packages': [ { 'package': 'chromium/chrome/test/data/password/captured_sites', - 'version': 'q_mI3rtAXvNUW_X3zxca3VcUVdHkgwRqhfTLHt9H7rIC', + 'version': 'MuT6UWjyB52nWFDuu4RCv4o_vMPIZdI4P2m2YsC66fAC', } ], 'condition': 'checkout_chromium_password_manager_test_dependencies', @@ -765,7 +765,7 @@ Var('chromium_git') + '/angle/angle.git' + '@' + Var('angle_revision'), 'src/third_party/dav1d/libdav1d': - Var('chromium_git') + '/external/github.com/videolan/dav1d.git' + '@' + '62fcd0cb19d2fe46af7541d8185de86d45d58697', + Var('chromium_git') + '/external/github.com/videolan/dav1d.git' + '@' + 'fc54119cc0aeae96184bb4d18a2aef4c69f1a0fd', 'src/third_party/dawn': Var('dawn_git') + '/dawn.git' + '@' + Var('dawn_revision'), @@ -874,7 +874,7 @@ # Build tools for Chrome OS. Note: This depends on third_party/pyelftools. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '47bbd64428c2cbbaa671e5fc2f01680754ec351e', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'd2bf146955463365f602f91bbe728cbaac82301c', 'condition': 'checkout_linux', }, @@ -899,7 +899,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '86244d69136428f214950605d82533229b18098e', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'b96466297216f5b7c1df73df7771e6234e64552d', 'src/third_party/devtools-node-modules': Var('chromium_git') + '/external/github.com/ChromeDevTools/devtools-node-modules' + '@' + Var('devtools_node_modules_revision'), @@ -937,7 +937,7 @@ }, 'src/third_party/ffmpeg': - Var('chromium_git') + '/chromium/third_party/ffmpeg.git' + '@' + 'd7ba23c23434eb938c6fcae4fe77ca1e2a2fbeff', + Var('chromium_git') + '/chromium/third_party/ffmpeg.git' + '@' + '83304c4e5287d20407dff656545e6dddd73566f8', 'src/third_party/flac': Var('chromium_git') + '/chromium/deps/flac.git' + '@' + 'af862024c8c8fa0ae07ced05e89013d881b00596', @@ -957,7 +957,7 @@ 'packages': [ { 'package': 'fuchsia/sdk/core/linux-arm64', - 'version': 'J4QyYSv0T-30YSgD6d34XHRpck2ckNh-4MMhsRYj4zoC' + 'version': 'xbqDSJKkLORclZW8h9et17dVsOjaxurf7RElMu0fGvUC', }, ], 'condition': 'host_os == "linux" and checkout_fuchsia and checkout_fuchsia_for_arm64_host', @@ -1308,7 +1308,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '88d9a552a4b7624e314c2e4dc7c26faa853c73d3', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '512f209de9b5955d62b26e675dff7762688397d2', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1509,7 +1509,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '2701c130839edbeb226735b0775966b6423d9e83', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '67ac9e8ecb897864e37230e941558bbd380b1f52', + Var('webrtc_git') + '/src.git' + '@' + 'e95fc85cb76d6bec8b06300774efc97309b5947a', # Wuffs' canonical repository is at github.com/google/wuffs, but we use # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file. @@ -1576,7 +1576,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@c8e6dcb29585c1440650d9d560321add117a6c4f', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@2c615017d3a8799b52588c5e4e7312332cb03b6b', 'condition': 'checkout_src_internal', },
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 871bc6e1..a2e82e32 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -68,7 +68,9 @@ 'You might be calling functions intended only for testing from\n' 'production code. It is OK to ignore this warning if you know what\n' 'you are doing, as the heuristics used to detect the situation are\n' - 'not perfect. The commit queue will not block on this warning.') + 'not perfect. The commit queue will not block on this warning,\n' + 'however the android-binary-size trybot will block if the method\n' + 'exists in the release apk.') _INCLUDE_ORDER_WARNING = ( @@ -498,6 +500,16 @@ False, (), ), + ( + r'/\busing namespace ', + ( + 'Using directives ("using namespace x") are banned by the Google Style', + 'Guide ( http://google.github.io/styleguide/cppguide.html#Namespaces ).', + 'Explicitly qualify symbols or use using declarations ("using x::foo").', + ), + True, + [_THIRD_PARTY_EXCEPT_BLINK], # Don't warn in third_party folders. + ), # Make sure that gtest's FRIEND_TEST() macro is not used; the # FRIEND_TEST_ALL_PREFIXES() macro from base/gtest_prod_util.h should be # used instead since that allows for FLAKY_ and DISABLED_ prefixes.
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py index 209560f9..f307519 100755 --- a/PRESUBMIT_test.py +++ b/PRESUBMIT_test.py
@@ -1918,6 +1918,20 @@ class BannedTypeCheckTest(unittest.TestCase): + def testBannedCppFunctions(self): + input_api = MockInputApi() + input_api.files = [ + MockFile('some/cpp/problematic/file.cc', + ['using namespace std;']), + MockFile('some/cpp/ok/file.cc', + ['using std::string;']), + ] + + errors = PRESUBMIT._CheckNoBannedFunctions(input_api, MockOutputApi()) + self.assertEqual(1, len(errors)) + self.assertTrue('some/cpp/problematic/file.c' in errors[0].message) + self.assertTrue('some/cpp/ok/file.cc' not in errors[0].message) + def testBannedIosObjcFunctions(self): input_api = MockInputApi() input_api.files = [
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwPageLoadMetricsTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwPageLoadMetricsTest.java index da074331..64e44654 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwPageLoadMetricsTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwPageLoadMetricsTest.java
@@ -6,7 +6,9 @@ import static org.junit.Assert.assertEquals; +import android.os.SystemClock; import android.support.test.filters.SmallTest; +import android.view.KeyEvent; import org.junit.After; import org.junit.Before; @@ -14,11 +16,15 @@ import org.junit.Test; import org.chromium.android_webview.AwContents; +import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.MetricsUtils; import org.chromium.blink.mojom.WebFeature; +import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.net.test.util.TestWebServer; +import java.util.concurrent.Callable; + /** * Integration test for PageLoadMetrics. */ @@ -52,13 +58,13 @@ mTestContainerView.getAwContents(), mContentsClient.getOnPageFinishedHelper(), url); } - @Test - @SmallTest - @Feature({"AndroidWebView"}) /** * This test doesn't intent to cover all UseCounter metrics, and just test WebView integration * works */ + @Test + @SmallTest + @Feature({"AndroidWebView"}) public void testUseCounterMetrics() throws Throwable { final String data = "<html><head></head><body><form></form></body></html>"; final String url = mWebServer.setResponse(MAIN_FRAME_FILE, data, null); @@ -71,4 +77,77 @@ assertEquals(1, delta.getDelta()); assertEquals(1, form.getDelta()); } + + /** + * This test covers WebView heartbeat metrics from CorePageLoadMetrics. + */ + @Test + @SmallTest + @Feature({"AndroidWebView"}) + public void testHeartbeatMetrics() throws Throwable { + final String data = "<html><head></head><body><p>Hello World</p></body></html>"; + final String url = mWebServer.setResponse(MAIN_FRAME_FILE, data, null); + int navigationToFirstPaint = RecordHistogram.getHistogramTotalCountForTesting( + "PageLoad.PaintTiming.NavigationToFirstPaint"); + int navigationToFirstContentfulPaint = RecordHistogram.getHistogramTotalCountForTesting( + "PageLoad.PaintTiming.NavigationToFirstContentfulPaint"); + int navigationToLargestContentfulPaint = RecordHistogram.getHistogramTotalCountForTesting( + "PageLoad.PaintTiming.NavigationToLargestContentfulPaint"); + loadUrlSync(url); + AwActivityTestRule.pollInstrumentationThread( + () -> (1 + navigationToFirstPaint + == RecordHistogram.getHistogramTotalCountForTesting( + "PageLoad.PaintTiming.NavigationToFirstPaint"))); + AwActivityTestRule.pollInstrumentationThread( + () -> (1 + navigationToFirstContentfulPaint + == RecordHistogram.getHistogramTotalCountForTesting( + "PageLoad.PaintTiming.NavigationToFirstContentfulPaint"))); + // Flush NavigationToLargestContentfulPaint. + loadUrlSync("about:blank"); + AwActivityTestRule.pollInstrumentationThread( + () -> (1 + navigationToLargestContentfulPaint + == RecordHistogram.getHistogramTotalCountForTesting( + "PageLoad.PaintTiming.NavigationToLargestContentfulPaint"))); + } + + /** + * This test covers WebView heartbeat metrics FirstInputDelay4. + */ + @Test + @SmallTest + @Feature({"AndroidWebView"}) + public void testFirstInputDelay4() throws Throwable { + final String data = "<html><head></head><body><input type='text' id='text1'></body></html>"; + final String url = mWebServer.setResponse(MAIN_FRAME_FILE, data, null); + int firstInputDelay4 = RecordHistogram.getHistogramTotalCountForTesting( + "PageLoad.InteractiveTiming.FirstInputDelay4"); + loadUrlSync(url); + executeJavaScriptAndWaitForResult("document.getElementById('text1').select();"); + dispatchDownAndUpKeyEvents(KeyEvent.KEYCODE_A); + AwActivityTestRule.pollInstrumentationThread( + () -> (1 + firstInputDelay4 + == RecordHistogram.getHistogramTotalCountForTesting( + "PageLoad.InteractiveTiming.FirstInputDelay4"))); + } + + private String executeJavaScriptAndWaitForResult(String code) throws Throwable { + return mRule.executeJavaScriptAndWaitForResult( + mTestContainerView.getAwContents(), mContentsClient, code); + } + + private void dispatchDownAndUpKeyEvents(final int code) throws Throwable { + dispatchKeyEvent(new KeyEvent(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), + KeyEvent.ACTION_DOWN, code, 0)); + dispatchKeyEvent(new KeyEvent(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), + KeyEvent.ACTION_UP, code, 0)); + } + + private boolean dispatchKeyEvent(final KeyEvent event) throws Throwable { + return TestThreadUtils.runOnUiThreadBlocking(new Callable<Boolean>() { + @Override + public Boolean call() { + return mTestContainerView.dispatchKeyEvent(event); + } + }); + } }
diff --git a/ash/app_list/app_list_controller_impl.cc b/ash/app_list/app_list_controller_impl.cc index cd201a1..f6081b4 100644 --- a/ash/app_list/app_list_controller_impl.cc +++ b/ash/app_list/app_list_controller_impl.cc
@@ -131,6 +131,10 @@ return false; } +void LogAppListShowSource(AppListShowSource show_source) { + UMA_HISTOGRAM_ENUMERATION(kAppListToggleMethodHistogram, show_source); +} + } // namespace AppListControllerImpl::AppListControllerImpl() @@ -474,8 +478,10 @@ return; } - // Show the app list after signing in in tablet mode. - Show(GetDisplayIdToShowAppListOn(), AppListShowSource::kTabletMode, + // Show the app list after signing in in tablet mode. For metrics, the app + // list is not considered shown since the browser window is shown over app + // list upon login. + Show(GetDisplayIdToShowAppListOn(), base::nullopt /* no AppListShowSource */, base::TimeTicks()); // The app list is not dismissed before switching user, suggestion chips will @@ -530,9 +536,10 @@ } void AppListControllerImpl::Show(int64_t display_id, - AppListShowSource show_source, + base::Optional<AppListShowSource> show_source, base::TimeTicks event_time_stamp) { - UMA_HISTOGRAM_ENUMERATION(kAppListToggleMethodHistogram, show_source); + if (show_source.has_value()) + LogAppListShowSource(show_source.value()); presenter_.Show(display_id, event_time_stamp); @@ -571,9 +578,8 @@ ash::ShelfAction action = presenter_.ToggleAppList(display_id, show_source, event_time_stamp); UpdateExpandArrowVisibility(); - if (action == SHELF_ACTION_APP_LIST_SHOWN) { - UMA_HISTOGRAM_ENUMERATION(kAppListToggleMethodHistogram, show_source); - } + if (action == SHELF_ACTION_APP_LIST_SHOWN) + LogAppListShowSource(show_source); return action; } @@ -787,7 +793,13 @@ void AppListControllerImpl::ShowHomeScreenView() { DCHECK(IsTabletMode()); - Show(GetDisplayIdToShowAppListOn(), kTabletMode, base::TimeTicks()); + // App list is only considered shown for metrics if there are currently no + // other visible windows shown over the app list after the tablet transition. + base::Optional<AppListShowSource> show_source; + if (!HasVisibleWindows()) + show_source = kTabletMode; + + Show(GetDisplayIdToShowAppListOn(), show_source, base::TimeTicks()); } aura::Window* AppListControllerImpl::GetHomeScreenWindow() { @@ -851,9 +863,12 @@ bool handled = Shell::Get()->home_screen_controller()->GoHome(display_id); // Perform the "back" action for the app list. - if (!handled) + if (!handled) { Back(); + return ash::SHELF_ACTION_APP_LIST_BACK; + } + LogAppListShowSource(show_source); return ash::SHELF_ACTION_APP_LIST_SHOWN; }
diff --git a/ash/app_list/app_list_controller_impl.h b/ash/app_list/app_list_controller_impl.h index 26826b9..2c72466 100644 --- a/ash/app_list/app_list_controller_impl.h +++ b/ash/app_list/app_list_controller_impl.h
@@ -146,7 +146,7 @@ // Methods used in ash: bool GetTargetVisibility() const; void Show(int64_t display_id, - AppListShowSource show_source, + base::Optional<AppListShowSource> show_source, base::TimeTicks event_time_stamp); void UpdateYPositionAndOpacity(int y_position_in_screen, float background_opacity);
diff --git a/ash/app_list/app_list_controller_impl_unittest.cc b/ash/app_list/app_list_controller_impl_unittest.cc index 0baefc18..01ab350 100644 --- a/ash/app_list/app_list_controller_impl_unittest.cc +++ b/ash/app_list/app_list_controller_impl_unittest.cc
@@ -405,16 +405,24 @@ // expand view arrow. (see https://crbug.com/906858) TEST_F(AppListControllerImplTest, EnterFullScreenModeAfterTappingNearExpandArrow) { + // The bounds for the tap target of the expand arrow button, taken from + // expand_arrow_view.cc |kTapTargetWidth| and |kTapTargetHeight|. + constexpr int tapping_width = 156; + constexpr int tapping_height = 72; + ShowAppListNow(); ASSERT_EQ(ash::AppListViewState::kPeeking, GetAppListView()->app_list_state()); // Get in screen bounds of arrow - const gfx::Rect expand_arrow = GetAppListView() - ->app_list_main_view() - ->contents_view() - ->expand_arrow_view() - ->GetBoundsInScreen(); + gfx::Rect expand_arrow = GetAppListView() + ->app_list_main_view() + ->contents_view() + ->expand_arrow_view() + ->GetBoundsInScreen(); + const int horizontal_padding = (tapping_width - expand_arrow.width()) / 2; + const int vertical_padding = (tapping_height - expand_arrow.height()) / 2; + expand_arrow.Inset(-horizontal_padding, -vertical_padding); // Tap expand arrow icon and check that full screen apps view is entered. ui::test::EventGenerator* event_generator = GetEventGenerator(); @@ -426,14 +434,15 @@ DismissAppListNow(); base::RunLoop().RunUntilIdle(); - // Re-enter peeking mode and test that tapping near (but not directly on) - // the expand arrow icon still brings up full app list view. + // Re-enter peeking mode and test that tapping on one of the bounds of the + // tap target for the expand arrow icon still brings up full app list + // view. ShowAppListNow(); ASSERT_EQ(ash::AppListViewState::kPeeking, GetAppListView()->app_list_state()); - event_generator->GestureTapAt( - gfx::Point(expand_arrow.top_right().x(), expand_arrow.top_right().y())); + event_generator->GestureTapAt(gfx::Point(expand_arrow.top_right().x() - 1, + expand_arrow.top_right().y() + 1)); ASSERT_EQ(ash::AppListViewState::kFullscreenAllApps, GetAppListView()->app_list_state());
diff --git a/ash/app_list/app_list_metrics_unittest.cc b/ash/app_list/app_list_metrics_unittest.cc index b5c2a79..3f5ed37c 100644 --- a/ash/app_list/app_list_metrics_unittest.cc +++ b/ash/app_list/app_list_metrics_unittest.cc
@@ -6,6 +6,7 @@ #include <vector> #include "ash/app_list/app_list_controller_impl.h" +#include "ash/app_list/app_list_metrics.h" #include "ash/app_list/model/search/search_model.h" #include "ash/app_list/test/app_list_test_helper.h" #include "ash/app_list/test/app_list_test_model.h" @@ -22,9 +23,11 @@ #include "ash/public/cpp/app_list/app_list_types.h" #include "ash/public/cpp/shelf_item_delegate.h" #include "ash/public/cpp/shelf_model.h" +#include "ash/shelf/home_button.h" #include "ash/shelf/shelf.h" #include "ash/shelf/shelf_view.h" #include "ash/shelf/shelf_view_test_api.h" +#include "ash/shelf/shelf_widget.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" @@ -494,4 +497,76 @@ 1 /* Number of times launched from search box */); } +class AppListShowSourceMetricTest : public AshTestBase { + public: + AppListShowSourceMetricTest() = default; + ~AppListShowSourceMetricTest() override = default; + + protected: + void ClickHomeButton() { + HomeButton* home_button = + GetPrimaryShelf()->shelf_widget()->GetHomeButton(); + gfx::Point center = home_button->GetCenterPoint(); + views::View::ConvertPointToScreen(home_button, ¢er); + GetEventGenerator()->MoveMouseTo(center); + GetEventGenerator()->ClickLeftButton(); + } + + DISALLOW_COPY_AND_ASSIGN(AppListShowSourceMetricTest); +}; + +// In tablet mode, test that AppListShowSource metric is only recorded when +// pressing home button when not already home. Any presses on the home button +// when already home should do nothing. +TEST_F(AppListShowSourceMetricTest, TabletInAppToHome) { + base::HistogramTester histogram_tester; + + std::unique_ptr<views::Widget> widget = CreateTestWidget(); + Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true); + + ClickHomeButton(); + histogram_tester.ExpectBucketCount( + kAppListToggleMethodHistogram, kShelfButton, + 1 /* Number of times app list is shown with a shelf button */); + histogram_tester.ExpectBucketCount( + kAppListToggleMethodHistogram, kTabletMode, + 0 /* Number of times app list is shown by tablet mode transition */); + + GetAppListTestHelper()->CheckVisibility(true); + + // Ensure that any subsequent clicks while already at home do not count as + // showing the app list. + ClickHomeButton(); + histogram_tester.ExpectBucketCount( + kAppListToggleMethodHistogram, kShelfButton, + 1 /* Number of times app list shown with a shelf button */); + histogram_tester.ExpectTotalCount(kAppListToggleMethodHistogram, 1); +} + +// Ensure that app list is not recorded as shown when going to tablet mode with +// a window open. +TEST_F(AppListShowSourceMetricTest, TabletModeWithWindowOpen) { + base::HistogramTester histogram_tester; + + std::unique_ptr<views::Widget> widget = CreateTestWidget(); + Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true); + GetAppListTestHelper()->CheckVisibility(false); + + // Ensure that no AppListShowSource metric was recoreded. + histogram_tester.ExpectTotalCount(kAppListToggleMethodHistogram, 0); +} + +// Ensure that app list is recorded as shown when going to tablet mode with no +// other windows open. +TEST_F(AppListShowSourceMetricTest, TabletModeWithNoWindowOpen) { + base::HistogramTester histogram_tester; + + Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true); + GetAppListTestHelper()->CheckVisibility(true); + + histogram_tester.ExpectBucketCount( + kAppListToggleMethodHistogram, kTabletMode, + 1 /* Number of times app list shown after entering tablet mode */); +} + } // namespace ash
diff --git a/ash/app_list/views/expand_arrow_view.cc b/ash/app_list/views/expand_arrow_view.cc index 1d2702a0..7a680cf 100644 --- a/ash/app_list/views/expand_arrow_view.cc +++ b/ash/app_list/views/expand_arrow_view.cc
@@ -81,6 +81,10 @@ constexpr SkColor kFocusRingColor = gfx::kGoogleBlue300; constexpr int kFocusRingWidth = 2; +// THe bounds for the tap target of the expand arrow button. +constexpr int kTapTargetWidth = 156; +constexpr int kTapTargetHeight = 72; + } // namespace ExpandArrowView::ExpandArrowView(ContentsView* contents_view, @@ -392,10 +396,10 @@ gfx::Rect button_bounds = GetLocalBounds(); // Increase clickable area for the button from // (kTileWidth x height) to - // (3 * height - width). - int horizontal_padding = - button_bounds.width() - (button_bounds.height() * 1.5); - button_bounds.Inset(gfx::Insets(0, horizontal_padding)); + // (kTapTargetWidth x kTapTargetHeight). + const int horizontal_padding = (kTapTargetWidth - button_bounds.width()) / 2; + const int vertical_padding = (kTapTargetHeight - button_bounds.height()) / 2; + button_bounds.Inset(-horizontal_padding, -vertical_padding); return button_bounds.Intersects(rect); }
diff --git a/ash/components/shortcut_viewer/keyboard_shortcut_viewer_metadata.cc b/ash/components/shortcut_viewer/keyboard_shortcut_viewer_metadata.cc index 56b99f0..4b7ec86 100644 --- a/ash/components/shortcut_viewer/keyboard_shortcut_viewer_metadata.cc +++ b/ash/components/shortcut_viewer/keyboard_shortcut_viewer_metadata.cc
@@ -1380,6 +1380,13 @@ {}, // |shortcut_key_codes| {ui::VKEY_LMENU, ui::VKEY_UNKNOWN, ui::VKEY_E, ui::VKEY_F}}, + + {// |categories| + {ShortcutCategory::kPopular}, + IDS_KSV_DESCRIPTION_OPEN_GOOGLE_ASSISTANT, + IDS_KSV_SHORTCUT_ONE_MODIFIER_ONE_KEY, + // |accelerator_ids| + {{ui::VKEY_A, ui::EF_COMMAND_DOWN}}}, }); static bool is_initialized = false;
diff --git a/ash/components/shortcut_viewer/views/keyboard_shortcut_view.cc b/ash/components/shortcut_viewer/views/keyboard_shortcut_view.cc index 4406832..9a88c2a 100644 --- a/ash/components/shortcut_viewer/views/keyboard_shortcut_view.cc +++ b/ash/components/shortcut_viewer/views/keyboard_shortcut_view.cc
@@ -6,6 +6,7 @@ #include <algorithm> #include <memory> +#include <string> #include <utility> #include "ash/components/shortcut_viewer/keyboard_shortcut_viewer_metadata.h" @@ -34,6 +35,7 @@ #include "ui/base/default_style.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/chromeos/events/keyboard_layout_util.h" #include "ui/chromeos/search_box/search_box_view_base.h" #include "ui/events/event_constants.h" #include "ui/gfx/paint_vector_icon.h" @@ -134,7 +136,8 @@ } // Returns true if the given |item| should be excluded from the view, since -// certain shortcuts can be associated with a disabled feature behind a flag. +// certain shortcuts can be associated with a disabled feature behind a flag, +// or specific device property, e.g. keyboard layout. bool ShouldExcludeItem(const KeyboardShortcutItem& item) { switch (item.description_message_id) { case IDS_KSV_DESCRIPTION_DESKS_NEW_DESK: @@ -144,6 +147,8 @@ case IDS_KSV_DESCRIPTION_DESKS_MOVE_ACTIVE_ITEM_LEFT_DESK: case IDS_KSV_DESCRIPTION_DESKS_MOVE_ACTIVE_ITEM_RIGHT_DESK: return !ash::features::IsVirtualDesksEnabled(); + case IDS_KSV_DESCRIPTION_OPEN_GOOGLE_ASSISTANT: + return ui::DeviceKeyboardHasAssistantKey(); } return false;
diff --git a/ash/components/shortcut_viewer_strings.grdp b/ash/components/shortcut_viewer_strings.grdp index a2ba290..db6aa4d0 100644 --- a/ash/components/shortcut_viewer_strings.grdp +++ b/ash/components/shortcut_viewer_strings.grdp
@@ -651,4 +651,7 @@ <message name="IDS_KSV_DESCRIPTION_DESKS_MOVE_ACTIVE_ITEM_RIGHT_DESK" desc="Description of the command in keyboard shortcut viewer."> Move active window to the desk on the right </message> + <message name="IDS_KSV_DESCRIPTION_OPEN_GOOGLE_ASSISTANT" desc="Description of the command in keyboard shortcut viewer."> + Open Google Assistant + </message> </grit-part>
diff --git a/ash/public/cpp/shelf_types.h b/ash/public/cpp/shelf_types.h index cfa93ba7..b72f5a3 100644 --- a/ash/public/cpp/shelf_types.h +++ b/ash/public/cpp/shelf_types.h
@@ -123,6 +123,9 @@ // The app list launcher menu was dismissed. SHELF_ACTION_APP_LIST_DISMISSED, + + // The back action was performed on the app list. + SHELF_ACTION_APP_LIST_BACK, }; // The type of a shelf item.
diff --git a/ash/shelf/shelf_button_pressed_metric_tracker.cc b/ash/shelf/shelf_button_pressed_metric_tracker.cc index 1b5b37b..5287695 100644 --- a/ash/shelf/shelf_button_pressed_metric_tracker.cc +++ b/ash/shelf/shelf_button_pressed_metric_tracker.cc
@@ -63,6 +63,7 @@ case SHELF_ACTION_NONE: case SHELF_ACTION_APP_LIST_SHOWN: case SHELF_ACTION_APP_LIST_DISMISSED: + case SHELF_ACTION_APP_LIST_BACK: break; case SHELF_ACTION_NEW_WINDOW_CREATED: Shell::Get()->metrics()->RecordUserMetricsAction(
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc index 96be5e46..b6f8e90 100644 --- a/ash/shelf/shelf_layout_manager.cc +++ b/ash/shelf/shelf_layout_manager.cc
@@ -766,6 +766,7 @@ case SHELF_ACTION_NONE: case SHELF_ACTION_APP_LIST_SHOWN: case SHELF_ACTION_APP_LIST_DISMISSED: + case SHELF_ACTION_APP_LIST_BACK: case SHELF_ACTION_WINDOW_MINIMIZED: break; case SHELF_ACTION_NEW_WINDOW_CREATED: @@ -2352,6 +2353,12 @@ return; } + // If the start location is above the shelf (e.g., on the extended hotseat), + // do not allow the drag. + const gfx::Rect shelf_bounds = GetVisibleShelfBounds(); + if (event_in_screen.location().y() < shelf_bounds.y()) + return; + aura::Window* window = GetWindowForDragToHomeOrOverview(event_in_screen.location()); if (!window)
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index 9f709d2..65b2175 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -3905,6 +3905,24 @@ EndScroll(/*is_fling=*/false, 0.f); } +TEST_F(ShelfLayoutManagerWindowDraggingTest, NoOpIfDragStartsAboveShelf) { + std::unique_ptr<aura::Window> window = + AshTestBase::CreateTestWindow(gfx::Rect(0, 0, 400, 400)); + wm::ActivateWindow(window.get()); + + Shelf* shelf = GetPrimaryShelf(); + shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); + SwipeUpOnShelf(); + EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState()); + EXPECT_EQ(HotseatState::kExtended, GetShelfLayoutManager()->hotseat_state()); + + gfx::Rect hotseat_bounds = + GetShelfWidget()->hotseat_widget()->GetWindowBoundsInScreen(); + StartScroll(hotseat_bounds.CenterPoint()); + EXPECT_FALSE(GetShelfLayoutManager()->window_drag_controller_for_testing()); + EndScroll(/*is_fling=*/false, 0.f); +} + class ShelfLayoutManagerKeyboardTest : public AshTestBase { public: ShelfLayoutManagerKeyboardTest() = default;
diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc index 8289828..b3695d0 100644 --- a/ash/shelf/shelf_widget.cc +++ b/ash/shelf/shelf_widget.cc
@@ -283,12 +283,15 @@ return; } drag_handle_->SetVisible(true); - drag_handle_->SetX((shelf_widget_->GetClientAreaBoundsInScreen().width() - - kDragHandleSize.width()) / - 2); - drag_handle_->SetY((shelf_widget_->GetClientAreaBoundsInScreen().height() - - kDragHandleSize.height()) / - 2); + + const int x = (shelf_widget_->GetClientAreaBoundsInScreen().width() - + kDragHandleSize.width()) / + 2; + const int y = (shelf_widget_->GetClientAreaBoundsInScreen().height() - + kDragHandleSize.height()) / + 2; + drag_handle_->SetBounds(x, y, kDragHandleSize.width(), + kDragHandleSize.height()); } void ShelfWidget::DelegateView::OnBoundsChanged(const gfx::Rect& old_bounds) { @@ -581,6 +584,12 @@ login_shelf_view()->SetVisible(!show_hotseat); delegate_view_->SetLayoutManager( show_hotseat ? nullptr : std::make_unique<views::FillLayout>()); + + // When FillLayout is no longer the layout manager, ensure the correct size + // for the drag handle is set. + if (show_hotseat) + delegate_view_->UpdateDragHandle(); + ShowIfHidden(); } login_shelf_view_->UpdateAfterSessionChange();
diff --git a/ash/system/message_center/unified_message_center_bubble.cc b/ash/system/message_center/unified_message_center_bubble.cc index 6030a43..9b30585b 100644 --- a/ash/system/message_center/unified_message_center_bubble.cc +++ b/ash/system/message_center/unified_message_center_bubble.cc
@@ -7,6 +7,8 @@ #include <memory> #include "ash/shelf/shelf.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" #include "ash/system/message_center/unified_message_center_view.h" #include "ash/system/tray/tray_bubble_view.h" #include "ash/system/tray/tray_constants.h" @@ -14,13 +16,55 @@ #include "ash/system/unified/unified_system_tray.h" #include "ash/system/unified/unified_system_tray_bubble.h" #include "ash/system/unified/unified_system_tray_view.h" +#include "ui/compositor/paint_recorder.h" #include "ui/views/focus/focus_search.h" #include "ui/views/widget/widget.h" namespace ash { +// We need to draw a custom inner border for the message center in a separate +// layer so we can properly clip ARC notifications. Each ARC notification is +// contained in its own Window with its own layer, and the border needs to be +// drawn on top of them all. +class UnifiedMessageCenterBubble::Border : public ui::LayerDelegate { + public: + Border() : layer_(ui::LAYER_TEXTURED) { + layer_.set_delegate(this); + layer_.SetFillsBoundsOpaquely(false); + } + + ~Border() override = default; + + ui::Layer* layer() { return &layer_; } + + private: + // ui::LayerDelegate: + void OnPaintLayer(const ui::PaintContext& context) override { + gfx::Rect bounds = layer()->bounds(); + ui::PaintRecorder recorder(context, bounds.size()); + gfx::Canvas* canvas = recorder.canvas(); + + // Draw a solid rounded rect as the inner border. + cc::PaintFlags flags; + flags.setColor(AshColorProvider::Get()->GetContentLayerColor( + AshColorProvider::ContentLayerType::kSeparator, + AshColorProvider::AshColorMode::kLight)); + flags.setStyle(cc::PaintFlags::kStroke_Style); + flags.setStrokeWidth(canvas->image_scale()); + flags.setAntiAlias(true); + canvas->DrawRoundRect(bounds, kUnifiedTrayCornerRadius, flags); + } + + void OnDeviceScaleFactorChanged(float old_device_scale_factor, + float new_device_scale_factor) override {} + + ui::Layer layer_; + + DISALLOW_COPY_AND_ASSIGN(Border); +}; + UnifiedMessageCenterBubble::UnifiedMessageCenterBubble(UnifiedSystemTray* tray) - : tray_(tray) { + : tray_(tray), border_(std::make_unique<Border>()) { TrayBubbleView::InitParams init_params; init_params.delegate = tray; // Anchor within the overlay container. @@ -54,6 +98,12 @@ tray->tray_event_filter()->AddBubble(this); tray->bubble()->unified_view()->AddObserver(this); + ui::Layer* widget_layer = bubble_widget_->GetLayer(); + int radius = kUnifiedTrayCornerRadius; + widget_layer->SetRoundedCornerRadius({radius, radius, radius, radius}); + widget_layer->SetIsFastRoundedCorner(true); + widget_layer->Add(border_->layer()); + UpdatePosition(); } @@ -95,14 +145,14 @@ // achieve the padding, but that enlarges the layer bounds and breaks rounded // corner clipping for ARC notifications. This approach only modifies the // position of the layer. - gfx::Rect resting_bounds = tray_->shelf()->GetSystemTrayAnchorRect(); - resting_bounds.set_x(resting_bounds.x() - kUnifiedMenuPadding); - resting_bounds.set_y( - resting_bounds.y() - tray_->bubble()->GetCurrentTrayHeight() - - kUnifiedMenuPadding - kUnifiedMessageCenterBubbleSpacing); + gfx::Rect anchor_rect = tray_->shelf()->GetSystemTrayAnchorRect(); + anchor_rect.set_x(anchor_rect.x() - kUnifiedMenuPadding); + anchor_rect.set_y(anchor_rect.y() - tray_->bubble()->GetCurrentTrayHeight() - + kUnifiedMenuPadding - kUnifiedMessageCenterBubbleSpacing); + bubble_view_->ChangeAnchorRect(anchor_rect); - bubble_widget_->SetBounds(resting_bounds); - bubble_view_->ChangeAnchorRect(resting_bounds); + bubble_widget_->GetLayer()->StackAtTop(border_->layer()); + border_->layer()->SetBounds(message_center_view_->GetContentsBounds()); } void UnifiedMessageCenterBubble::FocusEntered(bool reverse) {
diff --git a/ash/system/message_center/unified_message_center_bubble.h b/ash/system/message_center/unified_message_center_bubble.h index 0ce1082..0f359ea 100644 --- a/ash/system/message_center/unified_message_center_bubble.h +++ b/ash/system/message_center/unified_message_center_bubble.h
@@ -69,7 +69,10 @@ } private: + class Border; + UnifiedSystemTray* const tray_; + std::unique_ptr<Border> border_; views::Widget* bubble_widget_ = nullptr; TrayBubbleView* bubble_view_ = nullptr;
diff --git a/ash/system/message_center/unified_message_center_view.cc b/ash/system/message_center/unified_message_center_view.cc index ef3f09b..bd7b3543 100644 --- a/ash/system/message_center/unified_message_center_view.cc +++ b/ash/system/message_center/unified_message_center_view.cc
@@ -97,6 +97,9 @@ scroller_->SetVerticalScrollBar(base::WrapUnique(scroll_bar_)); scroller_->SetDrawOverflowIndicator(false); AddChildView(scroller_); + + notification_bar_->Update(message_list_view_->GetTotalNotificationCount(), + GetStackedNotifications()); } UnifiedMessageCenterView::~UnifiedMessageCenterView() {
diff --git a/ash/system/message_center/unified_message_center_view_unittest.cc b/ash/system/message_center/unified_message_center_view_unittest.cc index e96f72d..e8ae0d3 100644 --- a/ash/system/message_center/unified_message_center_view_unittest.cc +++ b/ash/system/message_center/unified_message_center_view_unittest.cc
@@ -249,17 +249,16 @@ // The message center should autoscroll to the bottom of the list (with some // padding) after adding a new notification. auto id_to_remove = AddNotification(); + int spacing = features::IsUnifiedMessageCenterRefactorEnabled() + ? 0 + : kUnifiedNotificationCenterSpacing; int scroll_position = GetScroller()->GetVisibleRect().y(); - EXPECT_EQ(GetMessageListView()->height() - GetScroller()->height() + - kUnifiedNotificationCenterSpacing, + EXPECT_EQ(GetMessageListView()->height() - GetScroller()->height() + spacing, scroll_position); // Remove the last notification. MessageCenter::Get()->RemoveNotification(id_to_remove, true /* by_user */); - - // The scroll position should not change before sliding the notification out - // and instead should wait until the animation finishes. - EXPECT_EQ(scroll_position, GetScroller()->GetVisibleRect().y()); + scroll_position = GetScroller()->GetVisibleRect().y(); // The scroll position should be reduced by the height of the removed // notification after collapsing. @@ -268,8 +267,7 @@ GetScroller()->GetVisibleRect().y()); // Check that the list is still scrolled to the bottom (with some padding). - EXPECT_EQ(GetMessageListView()->height() - GetScroller()->height() + - kUnifiedNotificationCenterSpacing, + EXPECT_EQ(GetMessageListView()->height() - GetScroller()->height() + spacing, GetScroller()->GetVisibleRect().y()); } @@ -370,9 +368,11 @@ EXPECT_LT(GetMessageListView()->bounds().height(), message_center_view()->bounds().height()); - EXPECT_EQ(kUnifiedNotificationCenterSpacing, - message_center_view()->bounds().bottom() - - GetMessageViewVisibleBounds(1).bottom()); + if (!features::IsUnifiedMessageCenterRefactorEnabled()) { + EXPECT_EQ(kUnifiedNotificationCenterSpacing, + message_center_view()->bounds().bottom() - + GetMessageViewVisibleBounds(1).bottom()); + } } TEST_F(UnifiedMessageCenterViewTest, InitialPositionMaxOut) { @@ -385,9 +385,11 @@ EXPECT_GT(GetMessageListView()->bounds().height(), message_center_view()->bounds().height()); - EXPECT_EQ(kUnifiedNotificationCenterSpacing, - message_center_view()->bounds().bottom() - - GetMessageViewVisibleBounds(5).bottom()); + if (!features::IsUnifiedMessageCenterRefactorEnabled()) { + EXPECT_EQ(kUnifiedNotificationCenterSpacing, + message_center_view()->bounds().bottom() - + GetMessageViewVisibleBounds(5).bottom()); + } } TEST_F(UnifiedMessageCenterViewTest, InitialPositionWithLargeNotification) { @@ -481,21 +483,16 @@ EXPECT_FALSE(GetStackingCounterLabel()->GetVisible()); EXPECT_TRUE(GetStackingCounterClearAllButton()->GetVisible()); - gfx::Rect previous_bounds = GetMessageViewVisibleBounds(2); - - // Scrolling past a notification should make the counter label visible. - const int scroll_amount = GetMessageViewVisibleBounds(0).height() + 1; + // Scrolling past 5 notifications should make the counter label visible. + const int scroll_amount = (GetMessageViewVisibleBounds(0).height() * 5) + 1; GetScroller()->ScrollToPosition(GetScrollBar(), scroll_amount); message_center_view()->OnMessageCenterScrolled(); EXPECT_TRUE(GetStackingCounterLabel()->GetVisible()); - // The offset change matches with the scroll amount. - EXPECT_EQ(previous_bounds - gfx::Vector2d(0, scroll_amount), - GetMessageViewVisibleBounds(2)); - // Scrolling back a tiny bit to reveal the notification should make the + // Scrolling back to the top should make the // counter label invisible again. - GetScroller()->ScrollToPosition(GetScrollBar(), scroll_amount - 2); + GetScroller()->ScrollToPosition(GetScrollBar(), 0); message_center_view()->OnMessageCenterScrolled(); EXPECT_TRUE(GetStackingCounter()->GetVisible()); EXPECT_FALSE(GetStackingCounterLabel()->GetVisible()); @@ -525,9 +522,12 @@ // The MessageCenterView should be tall enough to contain the bar, two // notifications, and extra padding. - EXPECT_EQ(kStackedNotificationBarHeight + GetMessageListView()->height() + - kUnifiedNotificationCenterSpacing, - message_center_view()->height()); + int spacing = features::IsUnifiedMessageCenterRefactorEnabled() + ? 0 + : kUnifiedNotificationCenterSpacing; + EXPECT_EQ( + kStackedNotificationBarHeight + GetMessageListView()->height() + spacing, + message_center_view()->height()); // Dismiss until there is only 1 notification left. The bar should be // hidden after an animation. @@ -556,30 +556,33 @@ // Open the message center at the top of the notification list so the stacking // bar is hidden by default. std::string id = AddNotification(); - for (size_t i = 0; i < 20; ++i) + for (size_t i = 0; i < 30; ++i) AddNotification(); model()->SetTargetNotification(id); CreateMessageCenterView(); EXPECT_FALSE(GetStackingCounterLabel()->GetVisible()); - // Scroll past one notification to show the stacking bar. - int scroll_amount = GetMessageViewVisibleBounds(0).height() + 1; + // Scroll past 5 notifications so the count label becomes visible + int scroll_amount = (GetMessageViewVisibleBounds(0).height() * 5) + 1; GetScroller()->ScrollToPosition(GetScrollBar(), scroll_amount); message_center_view()->OnMessageCenterScrolled(); EXPECT_TRUE(GetStackingCounterLabel()->GetVisible()); int label_width = GetStackingCounterLabel()->bounds().width(); EXPECT_GT(label_width, 0); - // Scroll past 10 more notifications so the label width must be expanded to + // Scroll past 14 notifications so the label width must be expanded to // contain longer 2-digit label. - scroll_amount = (GetMessageViewVisibleBounds(0).height() * 11) + 1; + scroll_amount = (GetMessageViewVisibleBounds(0).height() * 14) + 1; GetScroller()->ScrollToPosition(GetScrollBar(), scroll_amount); message_center_view()->OnMessageCenterScrolled(); EXPECT_GT(GetStackingCounterLabel()->bounds().width(), label_width); } TEST_F(UnifiedMessageCenterViewTest, RectBelowScroll) { + if (features::IsUnifiedMessageCenterRefactorEnabled()) + return; + for (size_t i = 0; i < 6; ++i) AddNotification(); CreateMessageCenterView(); @@ -599,6 +602,9 @@ TEST_F(UnifiedMessageCenterViewTest, RectBelowScrollWithTargetingFirstNotification) { + if (features::IsUnifiedMessageCenterRefactorEnabled()) + return; + std::vector<std::string> ids; for (size_t i = 0; i < 10; ++i) ids.push_back(AddNotification()); @@ -619,6 +625,9 @@ } TEST_F(UnifiedMessageCenterViewTest, RectBelowScrollWithTargetingNotification) { + if (features::IsUnifiedMessageCenterRefactorEnabled()) + return; + std::vector<std::string> ids; for (size_t i = 0; i < 10; ++i) ids.push_back(AddNotification()); @@ -656,6 +665,8 @@ TEST_F(UnifiedMessageCenterViewTest, RectBelowScrollWithTargetingInvalidNotification) { + if (features::IsUnifiedMessageCenterRefactorEnabled()) + return; std::vector<std::string> ids; for (size_t i = 0; i < 10; ++i) ids.push_back(AddNotification());
diff --git a/ash/wm/overview/overview_controller.cc b/ash/wm/overview/overview_controller.cc index 54aa200..a15d498 100644 --- a/ash/wm/overview/overview_controller.cc +++ b/ash/wm/overview/overview_controller.cc
@@ -464,7 +464,6 @@ } else { DCHECK(CanEnterOverview()); TRACE_EVENT_ASYNC_BEGIN0("ui", "OverviewController::EnterOverview", this); - LOG(ERROR) << "Will start, overview session " << overview_session(); for (auto& observer : observers_) observer.OnOverviewModeWillStart();
diff --git a/ash/wm/toplevel_window_event_handler.cc b/ash/wm/toplevel_window_event_handler.cc index afba5d9..184ad152 100644 --- a/ash/wm/toplevel_window_event_handler.cc +++ b/ash/wm/toplevel_window_event_handler.cc
@@ -280,6 +280,12 @@ void ToplevelWindowEventHandler::OnDisplayMetricsChanged( const display::Display& display, uint32_t metrics) { + // Cancel the left edge swipe back during screen rotation. + if (metrics & DISPLAY_METRIC_ROTATION) { + back_gesture_affordance_.reset(); + going_back_started_ = false; + } + if (!window_resizer_ || !(metrics & DISPLAY_METRIC_ROTATION)) return;
diff --git a/ash/wm/toplevel_window_event_handler_unittest.cc b/ash/wm/toplevel_window_event_handler_unittest.cc index a7db7c0..8e3a3d44 100644 --- a/ash/wm/toplevel_window_event_handler_unittest.cc +++ b/ash/wm/toplevel_window_event_handler_unittest.cc
@@ -1197,6 +1197,43 @@ GetAppListTestHelper()->CheckState(AppListViewState::kFullscreenAllApps); } +TEST_F(ToplevelWindowEventHandlerBackGestureTest, CancelOnScreenRotation) { + UpdateDisplay("807x407"); + int64_t display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); + display::DisplayManager* display_manager = Shell::Get()->display_manager(); + display::test::ScopedSetInternalDisplayId set_internal(display_manager, + display_id); + ScreenOrientationControllerTestApi test_api( + Shell::Get()->screen_orientation_controller()); + ui::TestAcceleratorTarget target_back_press, target_back_release; + RegisterBackPressAndRelease(&target_back_press, &target_back_release); + + // Set the screen orientation to LANDSCAPE_PRIMARY. + test_api.SetDisplayRotation(display::Display::ROTATE_0, + display::Display::RotationSource::ACTIVE); + EXPECT_EQ(test_api.GetCurrentOrientation(), + OrientationLockType::kLandscapePrimary); + + gfx::Point start(0, 100); + gfx::Point update_and_end(200, 100); + SendGestureEvent(start, 0, 0, ui::ET_GESTURE_SCROLL_BEGIN); + SendGestureEvent(update_and_end, update_and_end.x() - start.x(), 0, + ui::ET_GESTURE_SCROLL_UPDATE); + // Rotate the screen by 270 degree during drag. + test_api.SetDisplayRotation(display::Display::ROTATE_270, + display::Display::RotationSource::ACTIVE); + EXPECT_EQ(test_api.GetCurrentOrientation(), + OrientationLockType::kPortraitPrimary); + SendGestureEvent(update_and_end, + ToplevelWindowEventHandler::kFlingVelocityForGoingBack + 10, + 0, ui::ET_SCROLL_FLING_START); + // Left edge swipe back should be cancelled due to screen rotation, so the + // fling event with velocity larger than |kFlingVelocityForGoingBack| above + // will not trigger actual going back. + EXPECT_EQ(0, target_back_press.accelerator_count()); + EXPECT_EQ(0, target_back_release.accelerator_count()); +} + namespace { void SendMouseReleaseAndReleaseCapture(ui::test::EventGenerator* generator,
diff --git a/base/BUILD.gn b/base/BUILD.gn index 602f1bd..90b44a47 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -622,8 +622,6 @@ "profiler/stack_buffer.h", "profiler/stack_copier.cc", "profiler/stack_copier.h", - "profiler/stack_copier_signal.cc", - "profiler/stack_copier_signal.h", "profiler/stack_copier_suspend.cc", "profiler/stack_copier_suspend.h", "profiler/stack_sampler.cc", @@ -1204,6 +1202,16 @@ "threading/thread_local_storage_posix.cc", "timer/hi_res_timer_manager_posix.cc", ] + + if (!is_nacl && !is_mac && !is_ios) { + sources += [ + "profiler/stack_copier_signal.cc", + "profiler/stack_copier_signal.h", + "profiler/stack_sampler_posix.cc", + "profiler/thread_delegate_posix.cc", + "profiler/thread_delegate_posix.h", + ] + } } if (!is_nacl) { @@ -1222,14 +1230,6 @@ if (is_posix) { sources += [ "base_paths_posix.h" ] - - if (!is_mac && !is_ios) { - sources += [ - "profiler/stack_sampler_posix.cc", - "profiler/thread_delegate_posix.cc", - "profiler/thread_delegate_posix.h", - ] - } } if (is_linux) { @@ -2905,6 +2905,9 @@ "posix/unix_domain_socket_unittest.cc", "task/thread_pool/task_tracker_posix_unittest.cc", ] + if (!is_nacl && !is_mac && !is_ios) { + sources += [ "profiler/stack_copier_signal_unittest.cc" ] + } } # Allow more direct string conversions on platforms with native utf8
diff --git a/base/profiler/register_context.h b/base/profiler/register_context.h index 7dd86ff8..cf573be 100644 --- a/base/profiler/register_context.h +++ b/base/profiler/register_context.h
@@ -10,7 +10,6 @@ #define BASE_PROFILER_REGISTER_CONTEXT_H_ #include <cstdint> -#include <type_traits> #include "build/build_config.h" @@ -25,13 +24,14 @@ namespace base { // Helper function to account for the fact that platform-specific register state -// types may be unsigned and of the same size as uintptr_t, but not of the same -// type -- e.g. unsigned int vs. unsigned long on 32-bit Windows and unsigned -// long vs. unsigned long long on Mac. +// types may be of the same size as uintptr_t, but not of the same type or +// signedness -- e.g. unsigned int vs. unsigned long on 32-bit Windows, unsigned +// long vs. unsigned long long on Mac, long long vs. unsigned long long on +// Linux. template <typename T> uintptr_t& AsUintPtr(T* value) { - static_assert(std::is_unsigned<T>::value && sizeof(T) == sizeof(uintptr_t), - "register state type must be equivalent to uintptr_t"); + static_assert(sizeof(T) == sizeof(uintptr_t), + "register state type must be of equivalent size to uintptr_t"); return *reinterpret_cast<uintptr_t*>(value); } @@ -86,12 +86,12 @@ return AsUintPtr(&context->__rip); } -#elif (defined(OS_ANDROID) || defined(OS_LINUX)) && \ - defined(ARCH_CPU_ARM_FAMILY) && \ - defined(ARCH_CPU_32_BITS) // #if defined(OS_WIN) +#elif defined(OS_ANDROID) || defined(OS_LINUX) // #if defined(OS_WIN) using RegisterContext = mcontext_t; +#if defined(ARCH_CPU_ARM_FAMILY) && defined(ARCH_CPU_32_BITS) + inline uintptr_t& RegisterContextStackPointer(mcontext_t* context) { return AsUintPtr(&context->arm_sp); } @@ -104,6 +104,55 @@ return AsUintPtr(&context->arm_ip); } +#elif defined(ARCH_CPU_ARM_FAMILY) && defined(ARCH_CPU_64_BITS) + +inline uintptr_t& RegisterContextStackPointer(mcontext_t* context) { + return AsUintPtr(&context->sp); +} + +inline uintptr_t& RegisterContextFramePointer(mcontext_t* context) { + // r29 is the FP register on 64-bit ARM per the Procedure Call Standard, + // section 5.1.1. + return AsUintPtr(&context->regs[29]); +} + +inline uintptr_t& RegisterContextInstructionPointer(mcontext_t* context) { + return AsUintPtr(&context->pc); +} + +#elif defined(ARCH_CPU_X86_64) // #if defined(ARCH_CPU_ARM_FAMILY) && + // defined(ARCH_CPU_32_BITS) + +inline uintptr_t& RegisterContextStackPointer(mcontext_t* context) { + return AsUintPtr(&context->gregs[REG_RSP]); +} + +inline uintptr_t& RegisterContextFramePointer(mcontext_t* context) { + return AsUintPtr(&context->gregs[REG_RBP]); +} + +inline uintptr_t& RegisterContextInstructionPointer(mcontext_t* context) { + return AsUintPtr(&context->gregs[REG_RIP]); +} + +#else // #if defined(ARCH_CPU_ARM_FAMILY) && defined(ARCH_CPU_32_BITS) + +// Placeholders for other POSIX platforms that just return the first +// three register slots in the context. +inline uintptr_t& RegisterContextStackPointer(mcontext_t* context) { + return *reinterpret_cast<uintptr_t*>(context); +} + +inline uintptr_t& RegisterContextFramePointer(mcontext_t* context) { + return *(reinterpret_cast<uintptr_t*>(context) + 1); +} + +inline uintptr_t& RegisterContextInstructionPointer(mcontext_t* context) { + return *(reinterpret_cast<uintptr_t*>(context) + 2); +} + +#endif // #if defined(ARCH_CPU_ARM_FAMILY) && defined(ARCH_CPU_32_BITS) + #else // #if defined(OS_WIN) // Placeholders for other platforms.
diff --git a/base/profiler/stack_buffer.h b/base/profiler/stack_buffer.h index e678aa2..0893928 100644 --- a/base/profiler/stack_buffer.h +++ b/base/profiler/stack_buffer.h
@@ -40,14 +40,15 @@ ~(kPlatformStackAlignment - 1)); } + // Size in bytes. size_t size() const { return size_; } private: // The buffer to store the stack. const std::unique_ptr<uint8_t[]> buffer_; - // The size of the requested buffer allocation. The actual allocation is - // larger to accommodate alignment requirements. + // The size in bytes of the requested buffer allocation. The actual allocation + // is larger to accommodate alignment requirements. const size_t size_; DISALLOW_COPY_AND_ASSIGN(StackBuffer);
diff --git a/base/profiler/stack_copier_signal.cc b/base/profiler/stack_copier_signal.cc index ae858701..77f3480a9 100644 --- a/base/profiler/stack_copier_signal.cc +++ b/base/profiler/stack_copier_signal.cc
@@ -4,13 +4,169 @@ #include "base/profiler/stack_copier_signal.h" +#include <linux/futex.h> +#include <signal.h> +#include <sys/ucontext.h> +#include <syscall.h> + +#include <atomic> + #include "base/profiler/metadata_recorder.h" +#include "base/profiler/register_context.h" #include "base/profiler/sample_metadata.h" #include "base/profiler/stack_buffer.h" #include "base/profiler/suspendable_thread_delegate.h" +#include "base/trace_event/trace_event.h" +#include "build/build_config.h" namespace base { +namespace { + +// Waitable event implementation with futex and without DCHECK(s), since signal +// handlers cannot allocate memory or use pthread api. +class AsyncSafeWaitableEvent { + public: + AsyncSafeWaitableEvent() { futex_.store(0, std::memory_order_release); } + ~AsyncSafeWaitableEvent() {} + + bool Wait() { + // futex() can wake up spuriously if this memory address was previously used + // for a pthread mutex. So, also check the condition. + while (true) { + int res = + syscall(SYS_futex, futex_int_ptr(), FUTEX_WAIT | FUTEX_PRIVATE_FLAG, + 0, nullptr, nullptr, 0); + if (futex_.load(std::memory_order_acquire) != 0) + return true; + if (res != 0) + return false; + } + } + + void Signal() { + futex_.store(1, std::memory_order_release); + syscall(SYS_futex, futex_int_ptr(), FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1, + nullptr, nullptr, 0); + } + + private: + // Provides a pointer to the atomic's storage. std::atomic_int has standard + // layout so its address can be used for the pointer as long as it only + // contains the int. + int* futex_int_ptr() { + static_assert(sizeof(futex_) == sizeof(int), + "Expected std::atomic_int to be the same size as int"); + return reinterpret_cast<int*>(&futex_); + } + + std::atomic_int futex_{0}; +}; + +// Scoped signal event that calls Signal on the AsyncSafeWaitableEvent at +// destructor. +class ScopedEventSignaller { + public: + ScopedEventSignaller(AsyncSafeWaitableEvent* event) : event_(event) {} + ~ScopedEventSignaller() { event_->Signal(); } + + private: + AsyncSafeWaitableEvent* event_; +}; + +// Struct to store the arguments to the signal handler. +struct HandlerParams { + uintptr_t stack_base_address; + + // The event is signalled when signal handler is done executing. + AsyncSafeWaitableEvent* event; + + // Return values: + // Successfully copied the stack segment. + bool* success; + // The thread context of the leaf function. + mcontext_t* context; + // Buffer to copy the stack segment. + StackBuffer* stack_buffer; + const uint8_t** stack_copy_bottom; +}; + +// Pointer to the parameters to be "passed" to the CopyStackSignalHandler() from +// the sampling thread to the sampled (stopped) thread. This value is set just +// before sending the signal to the thread and reset when the handler is done. +std::atomic<HandlerParams*> g_handler_params; + +// CopyStackSignalHandler is invoked on the stopped thread and records the +// thread's stack and register context at the time the signal was received. This +// function may only call reentrant code. +void CopyStackSignalHandler(int n, siginfo_t* siginfo, void* sigcontext) { + HandlerParams* params = g_handler_params.load(std::memory_order_acquire); + ScopedEventSignaller e(params->event); + *params->success = false; + + const ucontext_t* ucontext = static_cast<ucontext_t*>(sigcontext); + memcpy(params->context, &ucontext->uc_mcontext, sizeof(mcontext_t)); + + const uintptr_t bottom = RegisterContextStackPointer(params->context); + const uintptr_t top = params->stack_base_address; + if ((top - bottom) > params->stack_buffer->size()) { + // The stack exceeds the size of the allocated buffer. The buffer is sized + // such that this shouldn't happen under typical execution so we can safely + // punt in this situation. + return; + } + + *params->stack_copy_bottom = + StackCopierSignal::CopyStackContentsAndRewritePointers( + reinterpret_cast<uint8_t*>(bottom), reinterpret_cast<uintptr_t*>(top), + StackBuffer::kPlatformStackAlignment, params->stack_buffer->buffer()); + + // TODO(https://crbug.com/988579): Record metadata while the thread is + // suspended. + *params->success = true; +} + +// Sets the global handler params for the signal handler function. +class ScopedSetSignalHandlerParams { + public: + ScopedSetSignalHandlerParams(HandlerParams* params) { + g_handler_params.store(params, std::memory_order_release); + } + + ~ScopedSetSignalHandlerParams() { + g_handler_params.store(nullptr, std::memory_order_release); + } +}; + +class ScopedSigaction { + public: + ScopedSigaction(int signal, + struct sigaction* action, + struct sigaction* original_action) + : signal_(signal), + action_(action), + original_action_(original_action), + succeeded_(sigaction(signal, action, original_action) == 0) {} + + bool succeeded() const { return succeeded_; } + + ~ScopedSigaction() { + if (!succeeded_) + return; + + bool reset_succeeded = sigaction(signal_, original_action_, action_) == 0; + DCHECK(reset_succeeded); + } + + private: + const int signal_; + struct sigaction* const action_; + struct sigaction* const original_action_; + const bool succeeded_; +}; + +} // namespace + StackCopierSignal::StackCopierSignal( std::unique_ptr<ThreadDelegate> thread_delegate) : thread_delegate_(std::move(thread_delegate)) {} @@ -21,8 +177,57 @@ uintptr_t* stack_top, ProfileBuilder* profile_builder, RegisterContext* thread_context) { - // TODO(wittman): Implement signal-based stack copying. - return false; + AsyncSafeWaitableEvent wait_event; + bool copied = false; + const uint8_t* stack_copy_bottom = nullptr; + const uintptr_t stack_base_address = thread_delegate_->GetStackBaseAddress(); + HandlerParams params = {stack_base_address, &wait_event, &copied, + thread_context, stack_buffer, &stack_copy_bottom}; + { + ScopedSetSignalHandlerParams scoped_handler_params(¶ms); + + // Set the signal handler for the thread to the stack copy function. + struct sigaction action; + struct sigaction original_action; + memset(&action, 0, sizeof(action)); + action.sa_sigaction = CopyStackSignalHandler; + action.sa_flags = SA_RESTART | SA_SIGINFO; + sigemptyset(&action.sa_mask); + TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("cpu_profiler.debug"), + "StackCopierSignal copy stack"); + // SIGURG is chosen here because we observe no crashes with this signal and + // neither Chrome or the AOSP sets up a special handler for this signal. + ScopedSigaction scoped_sigaction(SIGURG, &action, &original_action); + if (!scoped_sigaction.succeeded()) + return false; + + if (syscall(SYS_tgkill, getpid(), thread_delegate_->GetThreadId(), + SIGURG) != 0) { + NOTREACHED(); + return false; + } + bool finished_waiting = wait_event.Wait(); + TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("cpu_profiler.debug"), + "StackCopierSignal copy stack"); + if (!finished_waiting) { + NOTREACHED(); + return false; + } + } + + const uintptr_t bottom = RegisterContextStackPointer(params.context); + for (uintptr_t* reg : + thread_delegate_->GetRegistersToRewrite(thread_context)) { + *reg = StackCopierSignal::RewritePointerIfInOriginalStack( + reinterpret_cast<uint8_t*>(bottom), + reinterpret_cast<uintptr_t*>(stack_base_address), stack_copy_bottom, + *reg); + } + + *stack_top = reinterpret_cast<uintptr_t>(stack_copy_bottom) + + (stack_base_address - bottom); + + return copied; } } // namespace base
diff --git a/base/profiler/stack_copier_signal.h b/base/profiler/stack_copier_signal.h index 14f4896..75583ae 100644 --- a/base/profiler/stack_copier_signal.h +++ b/base/profiler/stack_copier_signal.h
@@ -27,6 +27,8 @@ ProfileBuilder* profile_builder, RegisterContext* thread_context) override; + using StackCopier::CopyStackContentsAndRewritePointers; + private: std::unique_ptr<ThreadDelegate> thread_delegate_; };
diff --git a/base/profiler/stack_copier_signal_unittest.cc b/base/profiler/stack_copier_signal_unittest.cc new file mode 100644 index 0000000..a426560e --- /dev/null +++ b/base/profiler/stack_copier_signal_unittest.cc
@@ -0,0 +1,163 @@ +// Copyright 2019 The Chromium 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 <string.h> +#include <algorithm> +#include <utility> + +#include "base/profiler/profile_builder.h" +#include "base/profiler/sampling_profiler_thread_token.h" +#include "base/profiler/stack_buffer.h" +#include "base/profiler/stack_copier_signal.h" +#include "base/profiler/thread_delegate_posix.h" +#include "base/stl_util.h" +#include "base/synchronization/waitable_event.h" +#include "base/threading/platform_thread.h" +#include "base/threading/simple_thread.h" +#include "build/build_config.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace base { + +namespace { + +class TestProfileBuilder : public ProfileBuilder { + public: + TestProfileBuilder() = default; + + TestProfileBuilder(const TestProfileBuilder&) = delete; + TestProfileBuilder& operator=(const TestProfileBuilder&) = delete; + + // ProfileBuilder + ModuleCache* GetModuleCache() override { return nullptr; } + + void RecordMetadata( + base::ProfileBuilder::MetadataProvider* metadata_provider) override {} + + void OnSampleCompleted(std::vector<Frame> frames) override {} + void OnProfileCompleted(TimeDelta profile_duration, + TimeDelta sampling_period) override {} + + private: +}; + +// Values to write to the stack and look for in the copy. +static const uint32_t kStackSentinels[] = {0xf312ecd9, 0x1fcd7f19, 0xe69e617d, + 0x8245f94f}; + +class TargetThread : public SimpleThread { + public: + TargetThread() + : SimpleThread("target", Options()), + started_(WaitableEvent::ResetPolicy::MANUAL, + WaitableEvent::InitialState::NOT_SIGNALED), + copy_finished_(WaitableEvent::ResetPolicy::MANUAL, + WaitableEvent::InitialState::NOT_SIGNALED) {} + + void Run() override { + thread_token_ = GetSamplingProfilerCurrentThreadToken(); + + // Copy the sentinel values onto the stack. Volatile to defeat compiler + // optimizations. + volatile uint32_t sentinels[size(kStackSentinels)]; + for (size_t i = 0; i < size(kStackSentinels); ++i) + sentinels[i] = kStackSentinels[i]; + + started_.Signal(); + copy_finished_.Wait(); + } + + SamplingProfilerThreadToken GetThreadToken() { + started_.Wait(); + return thread_token_; + } + + void NotifyCopyFinished() { copy_finished_.Signal(); } + + private: + WaitableEvent started_; + WaitableEvent copy_finished_; + SamplingProfilerThreadToken thread_token_; +}; + +} // namespace + +// ASAN moves local variables outside of the stack extents, which breaks the +// sentinels. TSAN hangs on the AsyncSafeWaitableEvent FUTEX_WAIT call. +#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) +#define MAYBE_CopyStack DISABLED_CopyStack +#else +#define MAYBE_CopyStack CopyStack +#endif +TEST(StackCopierSignalTest, MAYBE_CopyStack) { + StackBuffer stack_buffer(/* buffer_size = */ 1 << 20); + memset(stack_buffer.buffer(), 0, stack_buffer.size()); + uintptr_t stack_top = 0; + TestProfileBuilder profiler_builder; + RegisterContext context; + + StackCopierSignal copier(std::make_unique<ThreadDelegatePosix>( + GetSamplingProfilerCurrentThreadToken())); + + // Copy the sentinel values onto the stack. Volatile to defeat compiler + // optimizations. + volatile uint32_t sentinels[size(kStackSentinels)]; + for (size_t i = 0; i < size(kStackSentinels); ++i) + sentinels[i] = kStackSentinels[i]; + + bool result = + copier.CopyStack(&stack_buffer, &stack_top, &profiler_builder, &context); + ASSERT_TRUE(result); + + uint32_t* const end = reinterpret_cast<uint32_t*>(stack_top); + uint32_t* const sentinel_location = std::find_if( + reinterpret_cast<uint32_t*>(RegisterContextStackPointer(&context)), end, + [](const uint32_t& location) { + return memcmp(&location, &kStackSentinels[0], + sizeof(kStackSentinels)) == 0; + }); + EXPECT_NE(end, sentinel_location); +} + +// ASAN moves local variables outside of the stack extents, which breaks the +// sentinels. TSAN hangs on the AsyncSafeWaitableEvent FUTEX_WAIT call. +// TODO(wittman): Understand why this test fails on 64-bit Android and fix. +#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) || \ + (defined(OS_ANDROID) && defined(ARCH_CPU_64_BITS)) +#define MAYBE_CopyStackFromOtherThread DISABLED_CopyStackFromOtherThread +#else +#define MAYBE_CopyStackFromOtherThread CopyStackFromOtherThread +#endif +TEST(StackCopierSignalTest, MAYBE_CopyStackFromOtherThread) { + StackBuffer stack_buffer(/* buffer_size = */ 1 << 20); + memset(stack_buffer.buffer(), 0, stack_buffer.size()); + uintptr_t stack_top = 0; + TestProfileBuilder profiler_builder; + RegisterContext context{}; + + TargetThread target_thread; + target_thread.Start(); + const SamplingProfilerThreadToken thread_token = + target_thread.GetThreadToken(); + + StackCopierSignal copier(std::make_unique<ThreadDelegatePosix>(thread_token)); + + bool result = + copier.CopyStack(&stack_buffer, &stack_top, &profiler_builder, &context); + ASSERT_TRUE(result); + + target_thread.NotifyCopyFinished(); + target_thread.Join(); + + uint32_t* const end = reinterpret_cast<uint32_t*>(stack_top); + uint32_t* const sentinel_location = std::find_if( + reinterpret_cast<uint32_t*>(RegisterContextStackPointer(&context)), end, + [](const uint32_t& location) { + return memcmp(&location, &kStackSentinels[0], + sizeof(kStackSentinels)) == 0; + }); + EXPECT_NE(end, sentinel_location); +} + +} // namespace base
diff --git a/base/profiler/stack_copier_suspend_unittest.cc b/base/profiler/stack_copier_suspend_unittest.cc index 9115d57..0ac56126 100644 --- a/base/profiler/stack_copier_suspend_unittest.cc +++ b/base/profiler/stack_copier_suspend_unittest.cc
@@ -117,7 +117,7 @@ std::make_unique<StackBuffer>(stack.size() * sizeof(uintptr_t)); uintptr_t stack_top = 0; TestProfileBuilder profile_builder; - RegisterContext register_context = {0}; + RegisterContext register_context{}; stack_copier_suspend.CopyStack(stack_buffer.get(), &stack_top, &profile_builder, ®ister_context); @@ -139,7 +139,7 @@ stack_buffer->buffer()[0] = 100; uintptr_t stack_top = 0; TestProfileBuilder profile_builder; - RegisterContext register_context = {0}; + RegisterContext register_context{}; stack_copier_suspend.CopyStack(stack_buffer.get(), &stack_top, &profile_builder, ®ister_context); @@ -164,7 +164,7 @@ std::make_unique<StackBuffer>(stack.size() * sizeof(uintptr_t)); uintptr_t stack_top = 0; TestProfileBuilder profile_builder; - RegisterContext register_context = {0}; + RegisterContext register_context{}; stack_copier_suspend.CopyStack(stack_buffer.get(), &stack_top, &profile_builder, ®ister_context); @@ -180,7 +180,7 @@ TEST(StackCopierSuspendTest, RewriteRegisters) { std::vector<uintptr_t> stack = {0, 1, 2}; - RegisterContext register_context = {0}; + RegisterContext register_context{}; RegisterContextFramePointer(®ister_context) = reinterpret_cast<uintptr_t>(&stack[1]); StackCopierSuspend stack_copier_suspend(
diff --git a/base/profiler/thread_delegate_posix.cc b/base/profiler/thread_delegate_posix.cc index eb5faa98..3182e60 100644 --- a/base/profiler/thread_delegate_posix.cc +++ b/base/profiler/thread_delegate_posix.cc
@@ -6,6 +6,7 @@ #include "base/process/process_handle.h" #include "base/profiler/thread_delegate_posix.h" +#include "base/stl_util.h" #include "build/build_config.h" @@ -76,6 +77,30 @@ // arm_lr and arm_pc do not require rewriting because they contain // addresses of executable code, not addresses in the stack. }; +#elif defined(ARCH_CPU_ARM_FAMILY) && \ + defined(ARCH_CPU_64_BITS) // #if defined(ARCH_CPU_ARM_FAMILY) && + // defined(ARCH_CPU_32_BITS) + std::vector<uintptr_t*> registers; + registers.reserve(12); + // Return the set of callee-save registers per the ARM 64-bit Procedure Call + // Standard section 5.1.1, plus the stack pointer. + registers.push_back(reinterpret_cast<uintptr_t*>(&thread_context->sp)); + for (size_t i = 19; i <= 29; ++i) + registers.push_back(reinterpret_cast<uintptr_t*>(&thread_context->regs[i])); + return registers; +#elif defined(ARCH_CPU_X86_64) // #if defined(ARCH_CPU_ARM_FAMILY) && + // defined(ARCH_CPU_32_BITS) + return { + // Return the set of callee-save registers per the x86-64 System V ABI + // section 3.2.1, plus the stack pointer. + reinterpret_cast<uintptr_t*>(&thread_context->gregs[REG_RBP]), + reinterpret_cast<uintptr_t*>(&thread_context->gregs[REG_RBX]), + reinterpret_cast<uintptr_t*>(&thread_context->gregs[REG_R12]), + reinterpret_cast<uintptr_t*>(&thread_context->gregs[REG_R13]), + reinterpret_cast<uintptr_t*>(&thread_context->gregs[REG_R14]), + reinterpret_cast<uintptr_t*>(&thread_context->gregs[REG_R15]), + reinterpret_cast<uintptr_t*>(&thread_context->gregs[REG_RSP]), + }; #else // #if defined(ARCH_CPU_ARM_FAMILY) && defined(ARCH_CPU_32_BITS) // Unimplemented for other architectures. return {};
diff --git a/base/task/thread_pool/service_thread.cc b/base/task/thread_pool/service_thread.cc index 400fbb05..a7e1d21 100644 --- a/base/task/thread_pool/service_thread.cc +++ b/base/task/thread_pool/service_thread.cc
@@ -71,39 +71,27 @@ if (!task_tracker_) return; - static constexpr TaskTraits kReportedTraits[] = { - {ThreadPool(), TaskPriority::BEST_EFFORT}, - {ThreadPool(), TaskPriority::BEST_EFFORT, MayBlock()}, - {ThreadPool(), TaskPriority::USER_VISIBLE}, - {ThreadPool(), TaskPriority::USER_VISIBLE, MayBlock()}, - {ThreadPool(), TaskPriority::USER_BLOCKING}, - {ThreadPool(), TaskPriority::USER_BLOCKING, MayBlock()}}; - - // Only record latency for one set of TaskTraits per report to avoid bias in - // the order in which tasks are posted (should we record all at once) as well - // as to avoid spinning up many worker threads to process this report if the + // Only record latency for one TaskPriority per report to avoid bias in the + // order in which tasks are posted (should we record all at once) as well as + // to avoid spinning up many worker threads to process this report if the // thread pool is currently idle (each thread group keeps at least one idle // thread so a single task isn't an issue). // Invoke RandInt() out-of-line to ensure it's obtained before // TimeTicks::Now(). - const TaskTraits& profiled_traits = - kReportedTraits[RandInt(0, base::size(kReportedTraits) - 1)]; + const TaskPriority profiled_priority = static_cast<TaskPriority>( + RandInt(static_cast<int>(TaskPriority::LOWEST), + static_cast<int>(TaskPriority::HIGHEST))); // Post through the static API to time the full stack. Use a new Now() for // every set of traits in case PostTask() itself is slow. // Bonus: this approach also includes the overhead of BindOnce() in the // reported latency. - // TODO(jessemckenna): pass |profiled_traits| directly to - // RecordHeartbeatLatencyAndTasksRunWhileQueuingHistograms() once compiler - // error on NaCl is fixed - TaskPriority task_priority = profiled_traits.priority(); - bool may_block = profiled_traits.may_block(); base::PostTask( - FROM_HERE, profiled_traits, + FROM_HERE, {base::ThreadPool(), profiled_priority}, BindOnce( &TaskTracker::RecordHeartbeatLatencyAndTasksRunWhileQueuingHistograms, - Unretained(task_tracker_), task_priority, may_block, TimeTicks::Now(), + Unretained(task_tracker_), profiled_priority, TimeTicks::Now(), task_tracker_->GetNumTasksRun())); }
diff --git a/base/task/thread_pool/service_thread_unittest.cc b/base/task/thread_pool/service_thread_unittest.cc index ce09845..7b3d3c2 100644 --- a/base/task/thread_pool/service_thread_unittest.cc +++ b/base/task/thread_pool/service_thread_unittest.cc
@@ -65,15 +65,9 @@ "ThreadPool.HeartbeatLatencyMicroseconds.Test." "UserBlockingTaskPriority", "ThreadPool.HeartbeatLatencyMicroseconds.Test." - "UserBlockingTaskPriority_MayBlock", - "ThreadPool.HeartbeatLatencyMicroseconds.Test." "UserVisibleTaskPriority", "ThreadPool.HeartbeatLatencyMicroseconds.Test." - "UserVisibleTaskPriority_MayBlock", - "ThreadPool.HeartbeatLatencyMicroseconds.Test." - "BackgroundTaskPriority", - "ThreadPool.HeartbeatLatencyMicroseconds.Test." - "BackgroundTaskPriority_MayBlock"}; + "BackgroundTaskPriority"}; // Each report hits a single histogram above (randomly selected). But 1000 // reports should touch all histograms at least once the vast majority of the
diff --git a/base/task/thread_pool/task_tracker.cc b/base/task/thread_pool/task_tracker.cc index a94912c..a324d21 100644 --- a/base/task/thread_pool/task_tracker.cc +++ b/base/task/thread_pool/task_tracker.cc
@@ -83,8 +83,11 @@ StringPiece histogram_label, StringPiece task_type_suffix) { DCHECK(!histogram_name.empty()); - DCHECK(!histogram_label.empty()); DCHECK(!task_type_suffix.empty()); + + if (histogram_label.empty()) + return nullptr; + // Mimics the UMA_HISTOGRAM_HIGH_RESOLUTION_CUSTOM_TIMES macro. The minimums // and maximums were chosen to place the 1ms mark at around the 70% range // coverage for buckets giving us good info for tasks that have a latency @@ -104,8 +107,11 @@ StringPiece histogram_label, StringPiece task_type_suffix) { DCHECK(!histogram_name.empty()); - DCHECK(!histogram_label.empty()); DCHECK(!task_type_suffix.empty()); + + if (histogram_label.empty()) + return nullptr; + // Mimics the UMA_HISTOGRAM_CUSTOM_COUNTS macro. const std::string histogram = JoinString( {"ThreadPool", histogram_name, histogram_label, task_type_suffix}, "."); @@ -116,18 +122,12 @@ HistogramBase::kUmaTargetedHistogramFlag); } -// Returns a histogram stored in a 2D array indexed by task priority and -// whether it may block. +// Returns a histogram stored in an array indexed by task priority. // TODO(jessemckenna): use the STATIC_HISTOGRAM_POINTER_GROUP macro from // histogram_macros.h instead. -HistogramBase* GetHistogramForTaskTraits( - TaskTraits task_traits, - HistogramBase* const (*histograms)[2]) { - return histograms[static_cast<int>(task_traits.priority())] - [task_traits.may_block() || - task_traits.with_base_sync_primitives() - ? 1 - : 0]; +HistogramBase* GetHistogramForTaskPriority(TaskPriority task_priority, + HistogramBase* const histograms[3]) { + return histograms[static_cast<int>(task_priority)]; } bool HasLogBestEffortTasksSwitch() { @@ -317,76 +317,42 @@ // TODO(jessemckenna): Write a helper function to avoid code duplication below. TaskTracker::TaskTracker(StringPiece histogram_label) - : has_log_best_effort_tasks_switch_(HasLogBestEffortTasksSwitch()), + : histogram_label_(histogram_label), + has_log_best_effort_tasks_switch_(HasLogBestEffortTasksSwitch()), state_(new State), can_run_policy_(CanRunPolicy::kAll), flush_cv_(flush_lock_.CreateConditionVariable()), shutdown_lock_(&flush_lock_), - task_latency_histograms_{ - {GetLatencyHistogram("TaskLatencyMicroseconds", - histogram_label, - "BackgroundTaskPriority"), - GetLatencyHistogram("TaskLatencyMicroseconds", - histogram_label, - "BackgroundTaskPriority_MayBlock")}, - {GetLatencyHistogram("TaskLatencyMicroseconds", - histogram_label, - "UserVisibleTaskPriority"), - GetLatencyHistogram("TaskLatencyMicroseconds", - histogram_label, - "UserVisibleTaskPriority_MayBlock")}, - {GetLatencyHistogram("TaskLatencyMicroseconds", - histogram_label, - "UserBlockingTaskPriority"), - GetLatencyHistogram("TaskLatencyMicroseconds", - histogram_label, - "UserBlockingTaskPriority_MayBlock")}}, + task_latency_histograms_{GetLatencyHistogram("TaskLatencyMicroseconds", + histogram_label, + "BackgroundTaskPriority"), + GetLatencyHistogram("TaskLatencyMicroseconds", + histogram_label, + "UserVisibleTaskPriority"), + GetLatencyHistogram("TaskLatencyMicroseconds", + histogram_label, + "UserBlockingTaskPriority")}, heartbeat_latency_histograms_{ - {GetLatencyHistogram("HeartbeatLatencyMicroseconds", - histogram_label, - "BackgroundTaskPriority"), - GetLatencyHistogram("HeartbeatLatencyMicroseconds", - histogram_label, - "BackgroundTaskPriority_MayBlock")}, - {GetLatencyHistogram("HeartbeatLatencyMicroseconds", - histogram_label, - "UserVisibleTaskPriority"), - GetLatencyHistogram("HeartbeatLatencyMicroseconds", - histogram_label, - "UserVisibleTaskPriority_MayBlock")}, - {GetLatencyHistogram("HeartbeatLatencyMicroseconds", - histogram_label, - "UserBlockingTaskPriority"), - GetLatencyHistogram("HeartbeatLatencyMicroseconds", - histogram_label, - "UserBlockingTaskPriority_MayBlock")}}, + GetLatencyHistogram("HeartbeatLatencyMicroseconds", + histogram_label, + "BackgroundTaskPriority"), + GetLatencyHistogram("HeartbeatLatencyMicroseconds", + histogram_label, + "UserVisibleTaskPriority"), + GetLatencyHistogram("HeartbeatLatencyMicroseconds", + histogram_label, + "UserBlockingTaskPriority")}, num_tasks_run_while_queuing_histograms_{ - {GetCountHistogram("NumTasksRunWhileQueuing", - histogram_label, - "BackgroundTaskPriority"), - GetCountHistogram("NumTasksRunWhileQueuing", - histogram_label, - "BackgroundTaskPriority_MayBlock")}, - {GetCountHistogram("NumTasksRunWhileQueuing", - histogram_label, - "UserVisibleTaskPriority"), - GetCountHistogram("NumTasksRunWhileQueuing", - histogram_label, - "UserVisibleTaskPriority_MayBlock")}, - {GetCountHistogram("NumTasksRunWhileQueuing", - histogram_label, - "UserBlockingTaskPriority"), - GetCountHistogram("NumTasksRunWhileQueuing", - histogram_label, - "UserBlockingTaskPriority_MayBlock")}}, - tracked_ref_factory_(this) { - // Confirm that all |task_latency_histograms_| have been initialized above. - for (TaskPriorityType i = 0; i < kNumTaskPriorities; ++i) { - for (uint8_t j = 0; j < kNumBlockingModes; ++j) { - DCHECK(task_latency_histograms_[i][j]); - } - } -} + GetCountHistogram("NumTasksRunWhileQueuing", + histogram_label, + "BackgroundTaskPriority"), + GetCountHistogram("NumTasksRunWhileQueuing", + histogram_label, + "UserVisibleTaskPriority"), + GetCountHistogram("NumTasksRunWhileQueuing", + histogram_label, + "UserBlockingTaskPriority")}, + tracked_ref_factory_(this) {} TaskTracker::~TaskTracker() = default; @@ -563,36 +529,28 @@ return shutdown_event_ && shutdown_event_->IsSignaled(); } -void TaskTracker::RecordLatencyHistogram( - LatencyHistogramType latency_histogram_type, - TaskTraits task_traits, - TimeTicks posted_time) const { - const TimeDelta task_latency = TimeTicks::Now() - posted_time; +void TaskTracker::RecordLatencyHistogram(TaskPriority priority, + TimeTicks posted_time) const { + if (histogram_label_.empty()) + return; - DCHECK(latency_histogram_type == LatencyHistogramType::TASK_LATENCY || - latency_histogram_type == LatencyHistogramType::HEARTBEAT_LATENCY); - const auto& histograms = - latency_histogram_type == LatencyHistogramType::TASK_LATENCY - ? task_latency_histograms_ - : heartbeat_latency_histograms_; - GetHistogramForTaskTraits(task_traits, histograms) + const TimeDelta task_latency = TimeTicks::Now() - posted_time; + GetHistogramForTaskPriority(priority, task_latency_histograms_) ->AddTimeMicrosecondsGranularity(task_latency); } void TaskTracker::RecordHeartbeatLatencyAndTasksRunWhileQueuingHistograms( - TaskPriority task_priority, - bool may_block, + TaskPriority priority, TimeTicks posted_time, int num_tasks_run_when_posted) const { - TaskTraits task_traits{ThreadPool()}; - if (may_block) - task_traits = TaskTraits(ThreadPool(), task_priority, MayBlock()); - else - task_traits = TaskTraits(ThreadPool(), task_priority); - RecordLatencyHistogram(LatencyHistogramType::HEARTBEAT_LATENCY, task_traits, - posted_time); - GetHistogramForTaskTraits(task_traits, - num_tasks_run_while_queuing_histograms_) + if (histogram_label_.empty()) + return; + + const TimeDelta task_latency = TimeTicks::Now() - posted_time; + GetHistogramForTaskPriority(priority, heartbeat_latency_histograms_) + ->AddTimeMicrosecondsGranularity(task_latency); + + GetHistogramForTaskPriority(priority, num_tasks_run_while_queuing_histograms_) ->Add(GetNumTasksRun() - num_tasks_run_when_posted); } @@ -608,8 +566,7 @@ TaskSource* task_source, const TaskTraits& traits) { DCHECK(task_source); - RecordLatencyHistogram(LatencyHistogramType::TASK_LATENCY, traits, - task.queue_time); + RecordLatencyHistogram(traits.priority(), task.queue_time); const auto environment = task_source->GetExecutionEnvironment();
diff --git a/base/task/thread_pool/task_tracker.h b/base/task/thread_pool/task_tracker.h index bb5296b..ab19ad3 100644 --- a/base/task/thread_pool/task_tracker.h +++ b/base/task/thread_pool/task_tracker.h
@@ -31,7 +31,6 @@ namespace base { class ConditionVariable; -class HistogramBase; namespace internal { @@ -54,7 +53,8 @@ // and records metrics and trace events. This class is thread-safe. class BASE_EXPORT TaskTracker { public: - // |histogram_label| is used as a suffix for histograms, it must not be empty. + // |histogram_label| is used to label histograms. No histograms are recorded + // if it is empty. TaskTracker(StringPiece histogram_label); virtual ~TaskTracker(); @@ -131,26 +131,15 @@ // no tasks are blocking shutdown). bool IsShutdownComplete() const; - enum class LatencyHistogramType { - // Records the latency of each individual task posted through TaskTracker. - TASK_LATENCY, - // Records the latency of heartbeat tasks which are independent of current - // workload. These avoid a bias towards TASK_LATENCY reporting that high- - // priority tasks are "slower" than regular tasks because high-priority - // tasks tend to be correlated with heavy workloads. - HEARTBEAT_LATENCY, - }; - // Records two histograms // 1. ThreadPool.[label].HeartbeatLatencyMicroseconds.[suffix]: // Now() - posted_time // 2. ThreadPool.[label].NumTasksRunWhileQueuing.[suffix]: // GetNumTasksRun() - num_tasks_run_when_posted. // [label] is the histogram label provided to the constructor. - // [suffix] is derived from |task_priority| and |may_block|. + // [suffix] is derived from |task_priority|. void RecordHeartbeatLatencyAndTasksRunWhileQueuingHistograms( TaskPriority task_priority, - bool may_block, TimeTicks posted_time, int num_tasks_run_when_posted) const; @@ -213,10 +202,9 @@ // manner. void CallFlushCallbackForTesting(); - // Records |Now() - posted_time| to the appropriate |latency_histogram_type| - // based on |task_traits|. - void RecordLatencyHistogram(LatencyHistogramType latency_histogram_type, - TaskTraits task_traits, + // Records |Now() - posted_time| to the + // ThreadPool.TaskLatencyMicroseconds.[label].[priority] histogram. + void RecordLatencyHistogram(TaskPriority priority, TimeTicks posted_time) const; void IncrementNumTasksRun(); @@ -230,6 +218,9 @@ TaskAnnotator task_annotator_; + // Suffix for histograms recorded by this TaskTracker. + const std::string histogram_label_; + // Indicates whether logging information about TaskPriority::BEST_EFFORT tasks // was enabled with a command line switch. const bool has_log_best_effort_tasks_switch_; @@ -279,22 +270,17 @@ // ThreadPool.TaskLatencyMicroseconds.*, // ThreadPool.HeartbeatLatencyMicroseconds.*, and - // ThreadPool.NumTasksRunWhileQueuing.* histograms. The first index is - // a TaskPriority. The second index is 0 for non-blocking tasks, 1 for - // blocking tasks. Intentionally leaked. + // ThreadPool.NumTasksRunWhileQueuing.* histograms. The index is a + // TaskPriority. Intentionally leaked. // TODO(scheduler-dev): Consider using STATIC_HISTOGRAM_POINTER_GROUP for // these. using TaskPriorityType = std::underlying_type<TaskPriority>::type; static constexpr TaskPriorityType kNumTaskPriorities = static_cast<TaskPriorityType>(TaskPriority::HIGHEST) + 1; - static constexpr uint8_t kNumBlockingModes = 2; - HistogramBase* const task_latency_histograms_[kNumTaskPriorities] - [kNumBlockingModes]; - HistogramBase* const heartbeat_latency_histograms_[kNumTaskPriorities] - [kNumBlockingModes]; + HistogramBase* const task_latency_histograms_[kNumTaskPriorities]; + HistogramBase* const heartbeat_latency_histograms_[kNumTaskPriorities]; HistogramBase* const - num_tasks_run_while_queuing_histograms_[kNumTaskPriorities] - [kNumBlockingModes]; + num_tasks_run_while_queuing_histograms_[kNumTaskPriorities]; // Ensures all state (e.g. dangling cleaned up workers) is coalesced before // destroying the TaskTracker (e.g. in test environments).
diff --git a/base/task/thread_pool/task_tracker_unittest.cc b/base/task/thread_pool/task_tracker_unittest.cc index fa231c9b..a3ba41c 100644 --- a/base/task/thread_pool/task_tracker_unittest.cc +++ b/base/task/thread_pool/task_tracker_unittest.cc
@@ -19,7 +19,6 @@ #include "base/memory/ref_counted.h" #include "base/metrics/histogram_base.h" #include "base/metrics/histogram_samples.h" -#include "base/metrics/statistics_recorder.h" #include "base/sequence_token.h" #include "base/sequenced_task_runner.h" #include "base/single_thread_task_runner.h" @@ -37,6 +36,7 @@ #include "base/threading/scoped_blocking_call.h" #include "base/threading/sequenced_task_runner_handle.h" #include "base/threading/simple_thread.h" +#include "base/threading/thread_restrictions.h" #include "base/threading/thread_task_runner_handle.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -1244,8 +1244,6 @@ // Verify that ThreadPool.TaskLatency.* histograms are correctly recorded // when a task runs. TEST(ThreadPoolTaskTrackerHistogramTest, TaskLatency) { - auto statistics_recorder = StatisticsRecorder::CreateTemporaryForTesting(); - TaskTracker tracker("Test"); struct { @@ -1257,28 +1255,28 @@ "BackgroundTaskPriority"}, {{ThreadPool(), MayBlock(), TaskPriority::BEST_EFFORT}, "ThreadPool.TaskLatencyMicroseconds.Test." - "BackgroundTaskPriority_MayBlock"}, + "BackgroundTaskPriority"}, {{ThreadPool(), WithBaseSyncPrimitives(), TaskPriority::BEST_EFFORT}, "ThreadPool.TaskLatencyMicroseconds.Test." - "BackgroundTaskPriority_MayBlock"}, + "BackgroundTaskPriority"}, {{ThreadPool(), TaskPriority::USER_VISIBLE}, "ThreadPool.TaskLatencyMicroseconds.Test." "UserVisibleTaskPriority"}, {{ThreadPool(), MayBlock(), TaskPriority::USER_VISIBLE}, "ThreadPool.TaskLatencyMicroseconds.Test." - "UserVisibleTaskPriority_MayBlock"}, + "UserVisibleTaskPriority"}, {{ThreadPool(), WithBaseSyncPrimitives(), TaskPriority::USER_VISIBLE}, "ThreadPool.TaskLatencyMicroseconds.Test." - "UserVisibleTaskPriority_MayBlock"}, + "UserVisibleTaskPriority"}, {{ThreadPool(), TaskPriority::USER_BLOCKING}, "ThreadPool.TaskLatencyMicroseconds.Test." "UserBlockingTaskPriority"}, {{ThreadPool(), MayBlock(), TaskPriority::USER_BLOCKING}, "ThreadPool.TaskLatencyMicroseconds.Test." - "UserBlockingTaskPriority_MayBlock"}, + "UserBlockingTaskPriority"}, {{ThreadPool(), WithBaseSyncPrimitives(), TaskPriority::USER_BLOCKING}, "ThreadPool.TaskLatencyMicroseconds.Test." - "UserBlockingTaskPriority_MayBlock"}}; + "UserBlockingTaskPriority"}}; for (const auto& test : kTests) { Task task(FROM_HERE, DoNothing(), TimeDelta());
diff --git a/base/task/thread_pool/thread_group_impl.cc b/base/task/thread_pool/thread_group_impl.cc index b3a7c6a..0c17b47d 100644 --- a/base/task/thread_pool/thread_group_impl.cc +++ b/base/task/thread_pool/thread_group_impl.cc
@@ -323,40 +323,57 @@ priority_hint_(priority_hint), idle_workers_stack_cv_for_testing_(lock_.CreateConditionVariable()), // Mimics the UMA_HISTOGRAM_LONG_TIMES macro. - detach_duration_histogram_(Histogram::FactoryTimeGet( - JoinString({kDetachDurationHistogramPrefix, histogram_label}, ""), - TimeDelta::FromMilliseconds(1), - TimeDelta::FromHours(1), - 50, - HistogramBase::kUmaTargetedHistogramFlag)), + detach_duration_histogram_( + histogram_label.empty() + ? nullptr + : Histogram::FactoryTimeGet( + JoinString( + {kDetachDurationHistogramPrefix, histogram_label}, + ""), + TimeDelta::FromMilliseconds(1), + TimeDelta::FromHours(1), + 50, + HistogramBase::kUmaTargetedHistogramFlag)), // Mimics the UMA_HISTOGRAM_COUNTS_1000 macro. When a worker runs more // than 1000 tasks before detaching, there is no need to know the exact // number of tasks that ran. - num_tasks_before_detach_histogram_(Histogram::FactoryGet( - JoinString({kNumTasksBeforeDetachHistogramPrefix, histogram_label}, - ""), - 1, - 1000, - 50, - HistogramBase::kUmaTargetedHistogramFlag)), + num_tasks_before_detach_histogram_( + histogram_label.empty() + ? nullptr + : Histogram::FactoryGet( + JoinString( + {kNumTasksBeforeDetachHistogramPrefix, histogram_label}, + ""), + 1, + 1000, + 50, + HistogramBase::kUmaTargetedHistogramFlag)), // Mimics the UMA_HISTOGRAM_COUNTS_100 macro. A ThreadGroup is // expected to run between zero and a few tens of workers. // When it runs more than 100 worker, there is no need to know the exact // number of workers that ran. - num_workers_histogram_(Histogram::FactoryGet( - JoinString({kNumWorkersHistogramPrefix, histogram_label}, ""), - 1, - 100, - 50, - HistogramBase::kUmaTargetedHistogramFlag)), - num_active_workers_histogram_(Histogram::FactoryGet( - JoinString({kNumActiveWorkersHistogramPrefix, histogram_label}, ""), - 1, - 100, - 50, - HistogramBase::kUmaTargetedHistogramFlag)), + num_workers_histogram_( + histogram_label.empty() + ? nullptr + : Histogram::FactoryGet( + JoinString({kNumWorkersHistogramPrefix, histogram_label}, + ""), + 1, + 100, + 50, + HistogramBase::kUmaTargetedHistogramFlag)), + num_active_workers_histogram_( + histogram_label.empty() + ? nullptr + : Histogram::FactoryGet( + JoinString( + {kNumActiveWorkersHistogramPrefix, histogram_label}, + ""), + 1, + 100, + 50, + HistogramBase::kUmaTargetedHistogramFlag)), tracked_ref_factory_(this) { - DCHECK(!histogram_label.empty()); DCHECK(!thread_group_label_.empty()); } @@ -510,10 +527,13 @@ void ThreadGroupImpl::ReportHeartbeatMetrics() const { CheckedAutoLock auto_lock(lock_); - num_workers_histogram_->Add(workers_.size()); - - num_active_workers_histogram_->Add(workers_.size() - - idle_workers_stack_.Size()); + if (num_workers_histogram_) { + num_workers_histogram_->Add(workers_.size()); + } + if (num_active_workers_histogram_) { + num_active_workers_histogram_->Add(workers_.size() - + idle_workers_stack_.Size()); + } } ThreadGroupImpl::WorkerThreadDelegateImpl::WorkerThreadDelegateImpl( @@ -692,8 +712,10 @@ DCHECK(!outer_->join_for_testing_started_); DCHECK_CALLED_ON_VALID_THREAD(worker_thread_checker_); - outer_->num_tasks_before_detach_histogram_->Add( - worker_only().num_tasks_since_last_detach); + if (outer_->num_tasks_before_detach_histogram_) { + outer_->num_tasks_before_detach_histogram_->Add( + worker_only().num_tasks_since_last_detach); + } outer_->cleanup_timestamps_.push(subtle::TimeTicksNowIgnoringOverride()); worker->Cleanup(); outer_->idle_workers_stack_.Remove(worker); @@ -943,8 +965,10 @@ DCHECK_LE(workers_.size(), max_tasks_); if (!cleanup_timestamps_.empty()) { - detach_duration_histogram_->AddTime(subtle::TimeTicksNowIgnoringOverride() - - cleanup_timestamps_.top()); + if (detach_duration_histogram_) { + detach_duration_histogram_->AddTime( + subtle::TimeTicksNowIgnoringOverride() - cleanup_timestamps_.top()); + } cleanup_timestamps_.pop(); }
diff --git a/base/task/thread_pool/thread_pool_impl.cc b/base/task/thread_pool/thread_pool_impl.cc index 3814f62..ed3d5de 100644 --- a/base/task/thread_pool/thread_pool_impl.cc +++ b/base/task/thread_pool/thread_pool_impl.cc
@@ -83,20 +83,23 @@ &delayed_task_manager_), has_disable_best_effort_switch_(HasDisableBestEffortTasksSwitch()), tracked_ref_factory_(this) { - DCHECK(!histogram_label.empty()); - foreground_thread_group_ = std::make_unique<ThreadGroupImpl>( - JoinString( - {histogram_label, kForegroundPoolEnvironmentParams.name_suffix}, "."), + histogram_label.empty() + ? std::string() + : JoinString( + {histogram_label, kForegroundPoolEnvironmentParams.name_suffix}, + "."), kForegroundPoolEnvironmentParams.name_suffix, kForegroundPoolEnvironmentParams.priority_hint, task_tracker_->GetTrackedRef(), tracked_ref_factory_.GetTrackedRef()); if (CanUseBackgroundPriorityForWorkerThread()) { background_thread_group_ = std::make_unique<ThreadGroupImpl>( - JoinString( - {histogram_label, kBackgroundPoolEnvironmentParams.name_suffix}, - "."), + histogram_label.empty() + ? std::string() + : JoinString({histogram_label, + kBackgroundPoolEnvironmentParams.name_suffix}, + "."), kBackgroundPoolEnvironmentParams.name_suffix, kBackgroundPoolEnvironmentParams.priority_hint, task_tracker_->GetTrackedRef(), tracked_ref_factory_.GetTrackedRef());
diff --git a/base/task/thread_pool/thread_pool_impl.h b/base/task/thread_pool/thread_pool_impl.h index bbdd2ff..43fe766 100644 --- a/base/task/thread_pool/thread_pool_impl.h +++ b/base/task/thread_pool/thread_pool_impl.h
@@ -60,8 +60,8 @@ TaskTracker; #endif - // Creates a ThreadPoolImpl with a production TaskTracker. - //|histogram_label| is used to label histograms, it must not be empty. + // Creates a ThreadPoolImpl with a production TaskTracker. |histogram_label| + // is used to label histograms. No histograms are recorded if it is empty. explicit ThreadPoolImpl(StringPiece histogram_label); // For testing only. Creates a ThreadPoolImpl with a custom TaskTracker.
diff --git a/base/test/android/javatests/src/org/chromium/base/test/BaseChromiumAndroidJUnitRunner.java b/base/test/android/javatests/src/org/chromium/base/test/BaseChromiumAndroidJUnitRunner.java index 28cd379..a2282ff 100644 --- a/base/test/android/javatests/src/org/chromium/base/test/BaseChromiumAndroidJUnitRunner.java +++ b/base/test/android/javatests/src/org/chromium/base/test/BaseChromiumAndroidJUnitRunner.java
@@ -31,7 +31,6 @@ import org.chromium.base.multidex.ChromiumMultiDexInstaller; import org.chromium.base.test.util.InMemorySharedPreferencesContext; -import java.io.File; import java.io.IOException; import java.lang.reflect.Field; import java.util.ArrayList; @@ -220,19 +219,7 @@ Class.forName("org.chromium.incrementalinstall.BootstrapApplication"); DexFile[] incrementalInstallDexes = (DexFile[]) bootstrapClass.getDeclaredField("sIncrementalDexFiles").get(null); - // The incremental install dex files contain directory paths in their names. e.g.: - // third_party.android_deps.com_android_support_gridlayout_v7_java__classes.dex.jar - // Skipping application and system dex files speeds up test listing 12s -> 6s on my - // Pixel 1 running Q. - for (DexFile dexFile : incrementalInstallDexes) { - if (dexFile.getName().startsWith("/system")) { - continue; - } - String baseName = new File(dexFile.getName()).getName(); - if (baseName.contains("test") || baseName.contains("Test")) { - dexFiles.add(dexFile); - } - } + dexFiles.addAll(Arrays.asList(incrementalInstallDexes)); } catch (Exception e) { // Not an incremental apk. if (BuildConfig.IS_MULTIDEX_ENABLED
diff --git a/base/test/task_environment.cc b/base/test/task_environment.cc index 0b9eca1..393ecb6 100644 --- a/base/test/task_environment.cc +++ b/base/test/task_environment.cc
@@ -445,7 +445,7 @@ auto task_tracker = std::make_unique<TestTaskTracker>(); task_tracker_ = task_tracker.get(); auto thread_pool = std::make_unique<internal::ThreadPoolImpl>( - "TaskEnvironment", std::move(task_tracker)); + std::string(), std::move(task_tracker)); if (mock_time_domain_) mock_time_domain_->SetThreadPool(thread_pool.get(), task_tracker_); ThreadPoolInstance::Set(std::move(thread_pool)); @@ -718,7 +718,7 @@ } TaskEnvironment::TestTaskTracker::TestTaskTracker() - : internal::ThreadPoolImpl::TaskTrackerImpl("TaskEnvironment"), + : internal::ThreadPoolImpl::TaskTrackerImpl(std::string()), can_run_tasks_cv_(&lock_), task_completed_(&lock_) {}
diff --git a/base/trace_event/memory_infra_background_whitelist.cc b/base/trace_event/memory_infra_background_whitelist.cc index 4c88b5ca..9a093b3 100644 --- a/base/trace_event/memory_infra_background_whitelist.cc +++ b/base/trace_event/memory_infra_background_whitelist.cc
@@ -33,6 +33,8 @@ "DownloadService", "gpu::BufferManager", "gpu::RenderbufferManager", + "gpu::ServiceDiscardableManager", + "gpu::ServiceTransferCache", "gpu::SharedImageStub", "gpu::TextureManager", "GrShaderCache", @@ -99,11 +101,15 @@ "extensions/value_store/Extensions.Database.Value.Restore/0x?", "font_caches/font_platform_data_cache", "font_caches/shape_caches", + "gpu/discardable_cache/cache_0x?", + "gpu/discardable_cache/avg_image_size/cache_0x?", "gpu/gl/buffers/context_group_0x?", "gpu/gl/renderbuffers/context_group_0x?", "gpu/gl/textures/context_group_0x?", "gpu/gr_shader_cache/cache_0x?", "gpu/shared_images/client_0x?", + "gpu/transfer_cache/cache_0x?", + "gpu/transfer_cache/avg_image_size/cache_0x?", "history/delta_file_service/leveldb_0x?", "history/usage_reports_buffer/leveldb_0x?", "java_heap",
diff --git a/build/OWNERS b/build/OWNERS index 815173e..86c821fb 100644 --- a/build/OWNERS +++ b/build/OWNERS
@@ -19,6 +19,8 @@ per-file package_mac_toolchain.py=justincohen@chromium.org per-file whitespace_file.txt=* per-file OWNERS.status=* +per-file OWNERS.setnoparent=set noparent +per-file OWNERS.setnoparent=file://ENG_REVIEW_OWNERS # gn-dev is probably a better team here, but the tooling won't let us # have more than one team per component, and infra-dev is a catch-all
diff --git a/build/OWNERS.setnoparent b/build/OWNERS.setnoparent new file mode 100644 index 0000000..e3426f2 --- /dev/null +++ b/build/OWNERS.setnoparent
@@ -0,0 +1,28 @@ +# List of OWNERS files that can be used together with "set noparent". See +# docs/code_reviews.md#owners-file-details for more details. + +# Overall project governance. +file://ENG_REVIEW_OWNERS + +# Third-party dependency review, see //docs/adding_to_third_party.md +file://third_party/OWNERS + +# Security reviews +file://chromeos/SECURITY_OWNERS +file://ipc/SECURITY_OWNERS +file://sandbox/linux/OWNERS +file://sandbox/mac/OWNERS +file://sandbox/OWNERS +file://sandbox/win/OWNERS +file://third_party/blink/SECURITY_OWNERS + +# Privacy reviews +file://tools/metrics/ukm/PRIVACY_OWNERS +file://base/metrics/OWNERS + +# Blink API owners are responsible for decisions about what APIs Blink should +# expose to the open web. +file://third_party/blink/API_OWNERS + +# Extension API related files. +file://extensions/common/api/API_OWNERS
diff --git a/build/android/incremental_install/java/org/chromium/incrementalinstall/BootstrapApplication.java b/build/android/incremental_install/java/org/chromium/incrementalinstall/BootstrapApplication.java index 228d60c9..5b38242 100644 --- a/build/android/incremental_install/java/org/chromium/incrementalinstall/BootstrapApplication.java +++ b/build/android/incremental_install/java/org/chromium/incrementalinstall/BootstrapApplication.java
@@ -101,10 +101,10 @@ } mClassLoaderPatcher.importNativeLibs(instLibDir); - sIncrementalDexFiles = mClassLoaderPatcher.loadDexFiles(instDexDir); + sIncrementalDexFiles = mClassLoaderPatcher.loadDexFiles(instDexDir, instPackageName); if (instPackageNameDiffers) { mClassLoaderPatcher.importNativeLibs(appLibDir); - mClassLoaderPatcher.loadDexFiles(appDexDir); + mClassLoaderPatcher.loadDexFiles(appDexDir, appPackageName); } if (isFirstRun && mClassLoaderPatcher.mIsPrimaryProcess) {
diff --git a/build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java b/build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java index 9c172f01..b6d752247 100644 --- a/build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java +++ b/build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java
@@ -46,26 +46,68 @@ * Loads all dex files within |dexDir| into the app's ClassLoader. */ @SuppressLint({ - "SetWorldReadable", "SetWorldWritable", + "SetWorldReadable", + "SetWorldWritable", }) - DexFile[] loadDexFiles(File dexDir) throws ReflectiveOperationException, IOException { + DexFile[] loadDexFiles(File dexDir, String packageName) + throws ReflectiveOperationException, IOException { Log.i(TAG, "Installing dex files from: " + dexDir); - // The optimized dex files will be owned by this process' user. - // Store them within the app's data dir rather than on /data/local/tmp - // so that they are still deleted (by the OS) when we uninstall - // (even on a non-rooted device). - File incrementalDexesDir = new File(mAppFilesSubDir, "optimized-dexes"); - File isolatedDexesDir = new File(mAppFilesSubDir, "isolated-dexes"); - File optimizedDir; + File optimizedDir = null; + boolean isAtLeastOreo = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O; - // In O, optimizedDirectory is ignored, and the files are always put in an "oat" - // directory that is a sibling to the dex files themselves. SELinux policies - // prevent using odex files from /data/local/tmp, so we must first copy them - // into the app's data directory in order to get the odex files to live there. - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - safeCopyAllFiles(dexDir, incrementalDexesDir); - dexDir = incrementalDexesDir; + if (isAtLeastOreo) { + // In O, optimizedDirectory is ignored, and the files are always put in an "oat" + // directory that is a sibling to the dex files themselves. SELinux policies + // prevent using odex files from /data/local/tmp, so we must first copy them + // into the app's data directory in order to get the odex files to live there. + // Use a package-name subdirectory to prevent name collisions when apk-under-test is + // used. + File newDexDir = new File(mAppFilesSubDir, packageName + "-dexes"); + if (mIsPrimaryProcess) { + safeCopyAllFiles(dexDir, newDexDir); + } + dexDir = newDexDir; + } else { + // The optimized dex files will be owned by this process' user. + // Store them within the app's data dir rather than on /data/local/tmp + // so that they are still deleted (by the OS) when we uninstall + // (even on a non-rooted device). + File incrementalDexesDir = new File(mAppFilesSubDir, "optimized-dexes"); + File isolatedDexesDir = new File(mAppFilesSubDir, "isolated-dexes"); + + if (mIsPrimaryProcess) { + ensureAppFilesSubDirExists(); + // Allows isolated processes to access the same files. + incrementalDexesDir.mkdir(); + incrementalDexesDir.setReadable(true, false); + incrementalDexesDir.setExecutable(true, false); + // Create a directory for isolated processes to create directories in. + isolatedDexesDir.mkdir(); + isolatedDexesDir.setWritable(true, false); + isolatedDexesDir.setExecutable(true, false); + + optimizedDir = incrementalDexesDir; + } else { + // There is a UID check of the directory in dalvik.system.DexFile(): + // https://android.googlesource.com/platform/libcore/+/45e0260/dalvik/src/main/java/dalvik/system/DexFile.java#101 + // Rather than have each isolated process run DexOpt though, we use + // symlinks within the directory to point at the browser process' + // optimized dex files. + optimizedDir = new File(isolatedDexesDir, "isolated-" + mProcessUid); + optimizedDir.mkdir(); + // Always wipe it out and re-create for simplicity. + Log.i(TAG, "Creating dex file symlinks for isolated process"); + for (File f : optimizedDir.listFiles()) { + f.delete(); + } + for (File f : incrementalDexesDir.listFiles()) { + String to = "../../" + incrementalDexesDir.getName() + "/" + f.getName(); + File from = new File(optimizedDir, f.getName()); + createSymlink(to, from); + } + } + Log.i(TAG, "Code cache dir: " + optimizedDir); } // Ignore "oat" directory. @@ -75,39 +117,6 @@ throw new FileNotFoundException("Dex dir does not exist: " + dexDir); } - if (mIsPrimaryProcess) { - ensureAppFilesSubDirExists(); - // Allows isolated processes to access the same files. - incrementalDexesDir.mkdir(); - incrementalDexesDir.setReadable(true, false); - incrementalDexesDir.setExecutable(true, false); - // Create a directory for isolated processes to create directories in. - isolatedDexesDir.mkdir(); - isolatedDexesDir.setWritable(true, false); - isolatedDexesDir.setExecutable(true, false); - - optimizedDir = incrementalDexesDir; - } else { - // There is a UID check of the directory in dalvik.system.DexFile(): - // https://android.googlesource.com/platform/libcore/+/45e0260/dalvik/src/main/java/dalvik/system/DexFile.java#101 - // Rather than have each isolated process run DexOpt though, we use - // symlinks within the directory to point at the browser process' - // optimized dex files. - optimizedDir = new File(isolatedDexesDir, "isolated-" + mProcessUid); - optimizedDir.mkdir(); - // Always wipe it out and re-create for simplicity. - Log.i(TAG, "Creating dex file symlinks for isolated process"); - for (File f : optimizedDir.listFiles()) { - f.delete(); - } - for (File f : incrementalDexesDir.listFiles()) { - String to = "../../" + incrementalDexesDir.getName() + "/" + f.getName(); - File from = new File(optimizedDir, f.getName()); - createSymlink(to, from); - } - } - - Log.i(TAG, "Code cache dir: " + optimizedDir); Log.i(TAG, "Loading " + dexFilesArr.length + " dex files"); Object dexPathList = Reflect.getField(mClassLoader, "pathList"); @@ -115,9 +124,11 @@ dexElements = addDexElements(dexFilesArr, optimizedDir, dexElements); Reflect.setField(dexPathList, "dexElements", dexElements); - DexFile[] ret = new DexFile[dexElements.length]; + // Return the list of new DexFile instances for the .jars in dexPathList. + DexFile[] ret = new DexFile[dexFilesArr.length]; + int startIndex = dexElements.length - dexFilesArr.length; for (int i = 0; i < ret.length; ++i) { - ret[i] = (DexFile) Reflect.getField(dexElements[i], "dexFile"); + ret[i] = (DexFile) Reflect.getField(dexElements[startIndex + i], "dexFile"); } return ret; }
diff --git a/build/config/android/config.gni b/build/config/android/config.gni index e36fa8c8..04c8d29 100644 --- a/build/config/android/config.gni +++ b/build/config/android/config.gni
@@ -216,9 +216,6 @@ trichrome_shared_assets = android_sdk_release == "q" } - # TODO(agrieve): Remove once unused downstream. - incremental_apk_by_default = incremental_install - if (notouch_build && defined(extra_keymappings)) { keycode_conversion_data_android_path = extra_keymappings }
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni index 5013d21..eda23c3 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni
@@ -3234,7 +3234,7 @@ if (_proguard_enabled) { args += [ "--show-proguard-warning" ] } - if (_native_libs_deps != []) { + if (defined(_native_libs_file_arg)) { args += [ "--native-libs=$_native_libs_file_arg" ] deps += [ _native_libs_file_arg_dep ] }
diff --git a/build/config/fuchsia/config.gni b/build/config/fuchsia/config.gni index a0610819..4e507441 100644 --- a/build/config/fuchsia/config.gni +++ b/build/config/fuchsia/config.gni
@@ -5,8 +5,12 @@ assert(current_os == "fuchsia") declare_args() { - # Path to Fuchsia SDK. + # Paths to Fuchsia SDKs. fuchsia_sdk = "//third_party/fuchsia-sdk/sdk" + + # TODO(steveroe): Make linux-x64 and linux-arm64 sdk paths match + # when the linux-arm64 sdk is retrieved from GCS. + fuchsia_arm64_sdk = "//third_party/fuchsia-sdk-arm64" } # Compute the arch-specific path to packages' dynamic library dependencies. @@ -18,9 +22,10 @@ assert(false, "No libraries available for architecture: $current_cpu") } -# Compute the qemu path. +# Compute the emulator paths. aemu_root = "//third_party/aemu-${host_os}-${host_cpu}" qemu_root = "//third_party/qemu-${host_os}-${host_cpu}" +qemu_arm64_root = "//third_party/qemu-${host_os}-arm64" # Compute the path to the arch-specific boot image directory. boot_image_root = "${fuchsia_sdk}/../images/${target_cpu}"
diff --git a/build/config/fuchsia/generate_runner_scripts.gni b/build/config/fuchsia/generate_runner_scripts.gni index bef39a5f..5e2f5b2 100644 --- a/build/config/fuchsia/generate_runner_scripts.gni +++ b/build/config/fuchsia/generate_runner_scripts.gni
@@ -85,8 +85,6 @@ _manifest_path, "//build/fuchsia/", "//build/util/lib/", - "//third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer", - "${qemu_root}/", "${fuchsia_sdk}/tools/fvm", "${fuchsia_sdk}/tools/pm", "${fuchsia_sdk}/tools/symbolize", @@ -101,6 +99,20 @@ data += [ "${aemu_root}/" ] } + if (host_os == "linux" && host_cpu == "x64" && target_cpu == "arm64") { + data += [ + # Host tools for qemu on arm64 test bots. + "${qemu_arm64_root}/", + "${fuchsia_arm64_sdk}/", + ] + } else { + data += [ + # Host tools for qemu on x64 test bots. + "//third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer", + "${qemu_root}/", + ] + } + executable_args = [] package_paths = [ rebase_path(_package_path, root_build_dir) ]
diff --git a/build/fuchsia/fidlgen_js/test/fidlgen_js_unittest.cc b/build/fuchsia/fidlgen_js/test/fidlgen_js_unittest.cc index b3b958d..5cd2394a 100644 --- a/build/fuchsia/fidlgen_js/test/fidlgen_js_unittest.cc +++ b/build/fuchsia/fidlgen_js/test/fidlgen_js_unittest.cc
@@ -77,7 +77,7 @@ using FidlGenJsTest = gin::V8Test; -TEST_F(FidlGenJsTest, BasicJSSetup) { +TEST_F(FidlGenJsTest, DISABLED_BasicJSSetup) { v8::Isolate* isolate = instance_->isolate(); std::string source = "log('this is a log'); this.stuff = 'HAI';"; @@ -541,7 +541,7 @@ DISALLOW_COPY_AND_ASSIGN(TestolaImpl); }; -TEST_F(FidlGenJsTest, RawReceiveFidlMessage) { +TEST_F(FidlGenJsTest, DISABLED_RawReceiveFidlMessage) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -574,7 +574,7 @@ EXPECT_TRUE(testola_impl.was_do_something_called()); } -TEST_F(FidlGenJsTest, RawReceiveFidlMessageWithSimpleArg) { +TEST_F(FidlGenJsTest, DISABLED_RawReceiveFidlMessageWithSimpleArg) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -608,7 +608,7 @@ EXPECT_EQ(testola_impl.received_int(), 12345); } -TEST_F(FidlGenJsTest, RawReceiveFidlMessageWithStringArg) { +TEST_F(FidlGenJsTest, DISABLED_RawReceiveFidlMessageWithStringArg) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -640,7 +640,7 @@ EXPECT_EQ(testola_impl.received_msg(), "Ça c'est a ä½ å¥½ from deep in JS"); } -TEST_F(FidlGenJsTest, RawReceiveFidlMessageWithMultipleArgs) { +TEST_F(FidlGenJsTest, DISABLED_RawReceiveFidlMessageWithMultipleArgs) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -677,7 +677,7 @@ EXPECT_EQ(testola_impl.various_stuff()[2], 123456u); } -TEST_F(FidlGenJsTest, RawWithResponse) { +TEST_F(FidlGenJsTest, DISABLED_RawWithResponse) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -709,7 +709,7 @@ EXPECT_EQ(sum_result, 72 + 99); } -TEST_F(FidlGenJsTest, NoResponseBeforeTearDown) { +TEST_F(FidlGenJsTest, DISABLED_NoResponseBeforeTearDown) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -750,7 +750,7 @@ EXPECT_FALSE(helper.Get<bool>("excepted")); } -TEST_F(FidlGenJsTest, RawReceiveFidlStructMessage) { +TEST_F(FidlGenJsTest, DISABLED_RawReceiveFidlStructMessage) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -782,7 +782,7 @@ EXPECT_EQ(received_struct.u32, 0u); } -TEST_F(FidlGenJsTest, RawReceiveFidlNestedStructsAndRespond) { +TEST_F(FidlGenJsTest, DISABLED_RawReceiveFidlNestedStructsAndRespond) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -861,7 +861,7 @@ EXPECT_EQ(result_vblorp[3], static_cast<int>(fidljstest::Blorp::ALPHA)); } -TEST_F(FidlGenJsTest, HandlePassing) { +TEST_F(FidlGenJsTest, DISABLED_HandlePassing) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -909,7 +909,7 @@ EXPECT_NE(GetKoidForHandle(*zx::process::self()), ZX_KOID_INVALID); } -TEST_F(FidlGenJsTest, UnionSend) { +TEST_F(FidlGenJsTest, DISABLED_UnionSend) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -944,7 +944,7 @@ EXPECT_TRUE(testola_impl.did_receive_union()); } -TEST_F(FidlGenJsTest, UnionReceive) { +TEST_F(FidlGenJsTest, DISABLED_UnionReceive) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -990,7 +990,7 @@ EXPECT_EQ(helper.Get<uint32_t>("result_optional_num"), 987654u); } -TEST_F(FidlGenJsTest, VariousDefaults) { +TEST_F(FidlGenJsTest, DISABLED_VariousDefaults) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -1033,7 +1033,7 @@ EXPECT_EQ(helper.Get<std::string>("result_string_in_struct"), "stuff"); } -TEST_F(FidlGenJsTest, VectorOfStrings) { +TEST_F(FidlGenJsTest, DISABLED_VectorOfStrings) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -1056,7 +1056,7 @@ EXPECT_TRUE(testola_impl.did_get_vectors_of_string()); } -TEST_F(FidlGenJsTest, VectorOfStringsTooLongString) { +TEST_F(FidlGenJsTest, DISABLED_VectorOfStringsTooLongString) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -1079,7 +1079,7 @@ EXPECT_FALSE(testola_impl.did_get_vectors_of_string()); } -TEST_F(FidlGenJsTest, VectorOfStruct) { +TEST_F(FidlGenJsTest, DISABLED_VectorOfStruct) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -1111,7 +1111,7 @@ EXPECT_EQ(helper.Get<int>("result_1"), 258); } -TEST_F(FidlGenJsTest, VectorsOfPrimitives) { +TEST_F(FidlGenJsTest, DISABLED_VectorsOfPrimitives) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -1272,7 +1272,7 @@ EXPECT_EQ(result_v_float64[10], 76.f); } -TEST_F(FidlGenJsTest, VectorOfHandle) { +TEST_F(FidlGenJsTest, DISABLED_VectorOfHandle) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate); @@ -1328,7 +1328,7 @@ EXPECT_EQ(zx_handle_close(result_vmo1), ZX_OK); } -TEST_F(FidlGenJsTest, RequestInterface) { +TEST_F(FidlGenJsTest, DISABLED_RequestInterface) { v8::Isolate* isolate = instance_->isolate(); BindingsSetupHelper helper(isolate);
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1 index 0216322..3e1dc48a 100644 --- a/build/fuchsia/linux.sdk.sha1 +++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@ -8898631625795234640 \ No newline at end of file +8898602225687559504 \ No newline at end of file
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1 index c40ceb49..9132509 100644 --- a/build/fuchsia/mac.sdk.sha1 +++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@ -8898629996090287488 \ No newline at end of file +8898604320697656560 \ No newline at end of file
diff --git a/build/toolchain/clang_code_coverage_wrapper.py b/build/toolchain/clang_code_coverage_wrapper.py index 36a5e9aa..d8ccdd7 100755 --- a/build/toolchain/clang_code_coverage_wrapper.py +++ b/build/toolchain/clang_code_coverage_wrapper.py
@@ -65,6 +65,10 @@ # If no target OS is defined, or one is defined that doesn't have a specific # entry, use _DEFAULT_COVERAGE_EXCLUSION_LIST. _COVERAGE_EXCLUSION_LIST_MAP = { + 'android': [ + # This file caused webview native library failed on arm64. + '../../device/gamepad/dualshock4_controller.cc', + ], 'linux': [ # These files caused a static initializer to be generated, which # shouldn't.
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 9068881..4fc4d7014 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -295,6 +295,7 @@ "//chrome/browser/android/thin_webview:java", "//chrome/browser/download/android:java", "//chrome/browser/image_fetcher:java", + "//chrome/browser/notifications/chime/android:java", "//chrome/browser/share/android:java_resources", "//chrome/browser/ui/android/styles:java", "//chrome/browser/ui/android/widget:java", @@ -546,6 +547,7 @@ "//chrome/android/features/keyboard_accessory:jni_headers", "//chrome/android/features/media_router:jni_headers", "//chrome/android/public/profiles:jni_headers", + "//chrome/browser/download/android:jni_headers", "//chrome/browser/image_fetcher:jni_headers", "//chrome/browser/touch_to_fill/android:jni_headers", "//chrome/browser/util:jni_headers", @@ -2050,6 +2052,7 @@ "//chrome/android/features/media_router:test_java", "//chrome/android/webapk/libs/runtime_library:runtime_library_javatests", "//chrome/android/webapk/shell_apk:shell_apk_javatests", + "//chrome/browser/download/android:download_java_tests", "//chrome/browser/profiling_host:profiling_host_javatests", "//chrome/browser/subresource_filter:subresource_filter_javatests", "//chrome/browser/touch_to_fill/android:test_java", @@ -2585,7 +2588,6 @@ "java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerTabUtils.java", "java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerUIUtils.java", "java/src/org/chromium/chrome/browser/download/DownloadController.java", - "java/src/org/chromium/chrome/browser/download/DownloadInfo.java", "java/src/org/chromium/chrome/browser/download/DownloadItem.java", "java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java", "java/src/org/chromium/chrome/browser/download/DownloadManagerBridge.java", @@ -2612,6 +2614,7 @@ "java/src/org/chromium/chrome/browser/feedback/ScreenshotTask.java", "java/src/org/chromium/chrome/browser/feedback/SystemInfoFeedbackSource.java", "java/src/org/chromium/chrome/browser/findinpage/FindInPageBridge.java", + "java/src/org/chromium/chrome/browser/flags/FeatureUtilities.java", "java/src/org/chromium/chrome/browser/gesturenav/CompositorNavigationGlow.java", "java/src/org/chromium/chrome/browser/history/BrowsingHistoryBridge.java", "java/src/org/chromium/chrome/browser/history/HistoryDeletionBridge.java", @@ -2783,7 +2786,6 @@ "java/src/org/chromium/chrome/browser/translate/TranslateBridge.java", "java/src/org/chromium/chrome/browser/usage_stats/NotificationSuspender.java", "java/src/org/chromium/chrome/browser/usage_stats/UsageStatsBridge.java", - "java/src/org/chromium/chrome/browser/util/FeatureUtilities.java", "java/src/org/chromium/chrome/browser/webapps/WebApkHandlerDelegate.java", "java/src/org/chromium/chrome/browser/webapps/WebApkInstallService.java", "java/src/org/chromium/chrome/browser/webapps/WebApkInstaller.java",
diff --git a/chrome/android/DEPS b/chrome/android/DEPS index da0a5417..fea6bc5f 100644 --- a/chrome/android/DEPS +++ b/chrome/android/DEPS
@@ -1,4 +1,5 @@ include_rules = [ + "+chrome/browser/notifications", "+components/content_capture", "+components/download", "+components/favicon_base",
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni index c913dbd7..8dec413 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni
@@ -495,7 +495,6 @@ "java/src/org/chromium/chrome/browser/download/DownloadForegroundService.java", "java/src/org/chromium/chrome/browser/download/DownloadForegroundServiceManager.java", "java/src/org/chromium/chrome/browser/download/DownloadForegroundServiceObservers.java", - "java/src/org/chromium/chrome/browser/download/DownloadInfo.java", "java/src/org/chromium/chrome/browser/download/DownloadInfoBarController.java", "java/src/org/chromium/chrome/browser/download/DownloadItem.java", "java/src/org/chromium/chrome/browser/download/DownloadLocationCustomView.java", @@ -713,6 +712,7 @@ "java/src/org/chromium/chrome/browser/firstrun/TabbedModeFirstRunActivity.java", "java/src/org/chromium/chrome/browser/firstrun/ToSAckedReceiver.java", "java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java", + "java/src/org/chromium/chrome/browser/flags/FeatureUtilities.java", "java/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegate.java", "java/src/org/chromium/chrome/browser/fullscreen/ChromeFullscreenManager.java", "java/src/org/chromium/chrome/browser/fullscreen/ComposedBrowserControlsVisibilityDelegate.java", @@ -1717,6 +1717,7 @@ "java/src/org/chromium/chrome/browser/usage_stats/UsageStatsMetricsReporter.java", "java/src/org/chromium/chrome/browser/usage_stats/UsageStatsService.java", "java/src/org/chromium/chrome/browser/usage_stats/WebsiteEvent.java", + "java/src/org/chromium/chrome/browser/util/FeatureUtilities.java", "java/src/org/chromium/chrome/browser/ui/ImmersiveModeManager.java", "java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java", "java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java", @@ -1724,7 +1725,6 @@ "java/src/org/chromium/chrome/browser/ui/tablet/emptybackground/EmptyBackgroundViewWrapper.java", "java/src/org/chromium/chrome/browser/ui/tablet/emptybackground/incognitotoggle/IncognitoToggleButton.java", "java/src/org/chromium/chrome/browser/ui/tablet/emptybackground/incognitotoggle/IncognitoToggleButtonTablet.java", - "java/src/org/chromium/chrome/browser/util/FeatureUtilities.java", "java/src/org/chromium/chrome/browser/vr/ArDelegate.java", "java/src/org/chromium/chrome/browser/vr/ArDelegateProvider.java", "java/src/org/chromium/chrome/browser/webapps/ActivateWebApkActivity.java",
diff --git a/chrome/android/features/start_surface/internal/BUILD.gn b/chrome/android/features/start_surface/internal/BUILD.gn index e11e29e6..284b230 100644 --- a/chrome/android/features/start_surface/internal/BUILD.gn +++ b/chrome/android/features/start_surface/internal/BUILD.gn
@@ -123,4 +123,11 @@ } else { java_files += [ "dummy/java/src/org/chromium/chrome/features/start_surface/ExploreSurfaceCoordinator.java" ] } + + if (!is_java_debug) { + if (!defined(proguard_configs)) { + proguard_configs = [] + } + proguard_configs += [ "proguard.flags" ] + } }
diff --git a/chrome/android/features/start_surface/internal/java/src/org/chromium/chrome/features/start_surface/StartSurfaceCoordinator.java b/chrome/android/features/start_surface/internal/java/src/org/chromium/chrome/features/start_surface/StartSurfaceCoordinator.java index 99760e8b..e19cfe4 100644 --- a/chrome/android/features/start_surface/internal/java/src/org/chromium/chrome/features/start_surface/StartSurfaceCoordinator.java +++ b/chrome/android/features/start_surface/internal/java/src/org/chromium/chrome/features/start_surface/StartSurfaceCoordinator.java
@@ -10,11 +10,11 @@ import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeFeatureList; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.tasks.TasksSurface; import org.chromium.chrome.browser.tasks.TasksSurfaceProperties; import org.chromium.chrome.browser.tasks.tab_management.TabManagementModuleProvider; import org.chromium.chrome.browser.tasks.tab_management.TabSwitcher; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.features.start_surface.StartSurfaceMediator.SurfaceMode; import org.chromium.chrome.start_surface.R; import org.chromium.ui.modelutil.PropertyKey;
diff --git a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceLayoutPerfTest.java b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceLayoutPerfTest.java index c9b159a..88489abb 100644 --- a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceLayoutPerfTest.java +++ b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceLayoutPerfTest.java
@@ -35,10 +35,10 @@ import org.chromium.chrome.browser.compositor.animation.CompositorAnimator; import org.chromium.chrome.browser.compositor.layouts.Layout; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabFeatureUtilities; import org.chromium.chrome.browser.tabmodel.TabSelectionType; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.tab_ui.R; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
diff --git a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceLayoutTest.java b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceLayoutTest.java index 59517f2..346a01d5 100644 --- a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceLayoutTest.java +++ b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceLayoutTest.java
@@ -51,12 +51,12 @@ import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.compositor.layouts.Layout; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabFeatureUtilities; import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabSelectionType; import org.chromium.chrome.browser.tasks.tab_management.TabSwitcher; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.tab_ui.R; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
diff --git a/chrome/android/features/start_surface/internal/proguard.flags b/chrome/android/features/start_surface/internal/proguard.flags new file mode 100644 index 0000000..8e4789c7 --- /dev/null +++ b/chrome/android/features/start_surface/internal/proguard.flags
@@ -0,0 +1,15 @@ +# Copyright 2019 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# To fix crbug/1017396. This is because AppBarLayout$ScrollingViewBehavior +# is instantiated via java.lang.reflect.Constructor in CoordinatorLayout.java. +# Note that AppBarLayout$Behavior is needed to keep the scrolling behavior. +-keep class android.support.design.widget.AppBarLayout$Behavior { + public <init>(android.content.Context, android.util.AttributeSet); + public <init>(); +} +-keep class android.support.design.widget.AppBarLayout$ScrollingViewBehavior { + public <init>(android.content.Context, android.util.AttributeSet); + public <init>(); +}
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/pseudotab/PseudoTab.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/pseudotab/PseudoTab.java index cf4a25b1..6072e772 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/pseudotab/PseudoTab.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/pseudotab/PseudoTab.java
@@ -7,11 +7,11 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabList; import org.chromium.chrome.browser.tabmodel.TabModelFilter; import org.chromium.chrome.browser.tabmodel.TabModelFilterProvider; -import org.chromium.chrome.browser.util.FeatureUtilities; import java.lang.ref.WeakReference; import java.util.ArrayList;
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridItemTouchHelperCallback.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridItemTouchHelperCallback.java index d8fc124..f4164e1 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridItemTouchHelperCallback.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridItemTouchHelperCallback.java
@@ -13,6 +13,7 @@ import org.chromium.base.VisibleForTesting; import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.EmptyTabModelFilter; @@ -21,7 +22,6 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilter; import org.chromium.chrome.browser.tasks.tab_groups.TabGroupUtils; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.components.feature_engagement.EventConstants; import org.chromium.components.feature_engagement.Tracker; import org.chromium.ui.modelutil.SimpleRecyclerViewAdapter;
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridViewBinder.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridViewBinder.java index 61763b4c..3796bda 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridViewBinder.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridViewBinder.java
@@ -22,7 +22,7 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.Callback; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.tab_ui.R; import org.chromium.ui.modelutil.PropertyKey; import org.chromium.ui.modelutil.PropertyModel;
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiCoordinator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiCoordinator.java index db6262cd..8e0e5cf 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiCoordinator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiCoordinator.java
@@ -15,6 +15,7 @@ import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.ThemeColorProvider; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.lifecycle.PauseResumeWithNativeObserver; import org.chromium.chrome.browser.metrics.UmaSessionStats; @@ -24,7 +25,6 @@ import org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilter; import org.chromium.chrome.browser.tasks.tab_groups.TabGroupUtils; import org.chromium.chrome.browser.toolbar.bottom.BottomControlsCoordinator; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.modelutil.PropertyModel; import java.util.List;
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiMediator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiMediator.java index 7289b5e1..2af23e90 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiMediator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiMediator.java
@@ -12,6 +12,7 @@ import org.chromium.chrome.browser.ThemeColorProvider; import org.chromium.chrome.browser.compositor.layouts.EmptyOverviewModeObserver; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.EmptyTabModelObserver; import org.chromium.chrome.browser.tabmodel.EmptyTabModelSelectorObserver; @@ -26,7 +27,6 @@ import org.chromium.chrome.browser.tasks.tab_groups.EmptyTabGroupModelFilterObserver; import org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilter; import org.chromium.chrome.browser.toolbar.bottom.BottomControlsCoordinator; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.UrlConstants; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.ui.modelutil.PropertyModel;
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediator.java index 09aec22d..6954ba33 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediator.java
@@ -27,6 +27,7 @@ import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; import org.chromium.chrome.browser.native_page.NativePageFactory; import org.chromium.chrome.browser.profiles.Profile; @@ -48,7 +49,6 @@ import org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilter; import org.chromium.chrome.browser.tasks.tab_groups.TabGroupUtils; import org.chromium.chrome.browser.tasks.tab_management.TabProperties.UiType; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.widget.selection.SelectionDelegate; import org.chromium.chrome.tab_ui.R; import org.chromium.components.feature_engagement.FeatureConstants;
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherCoordinator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherCoordinator.java index dd394710..ea48c0c3 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherCoordinator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherCoordinator.java
@@ -22,6 +22,7 @@ import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.MenuOrKeyboardActionController; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.lifecycle.Destroyable; @@ -30,7 +31,6 @@ import org.chromium.chrome.browser.tabmodel.TabCreatorManager; import org.chromium.chrome.browser.tabmodel.TabList; import org.chromium.chrome.browser.tabmodel.TabModelSelector; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.tab_ui.R; import org.chromium.ui.modelutil.PropertyModel; import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediator.java index 8fe07d6..27248ac1 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediator.java
@@ -27,6 +27,7 @@ import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.compositor.layouts.LayoutManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.fullscreen.FullscreenManager; import org.chromium.chrome.browser.tab.Tab; @@ -44,7 +45,6 @@ import org.chromium.chrome.browser.tabmodel.TabSelectionType; import org.chromium.chrome.browser.tasks.ReturnToChromeExperimentsUtil; import org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilter; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.UrlConstants; import org.chromium.chrome.tab_ui.R; import org.chromium.content_public.browser.LoadUrlParams;
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabListContainerViewBinderTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabListContainerViewBinderTest.java index 69666488..7c7facb3 100644 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabListContainerViewBinderTest.java +++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabListContainerViewBinderTest.java
@@ -28,7 +28,7 @@ import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.DisabledTest; import org.chromium.chrome.browser.ChromeFeatureList; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.tab_ui.R; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ui.DummyUiActivity;
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMultiWindowTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMultiWindowTest.java index 7496849..9ec7971a 100644 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMultiWindowTest.java +++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMultiWindowTest.java
@@ -36,8 +36,8 @@ import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.compositor.layouts.Layout; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.toolbar.IncognitoToggleTabLayout; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.features.start_surface.StartSurfaceLayout; import org.chromium.chrome.tab_ui.R; import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/pseudotab/PseudoTabUnitTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/pseudotab/PseudoTabUnitTest.java index c135d5b..7b5025a 100644 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/pseudotab/PseudoTabUnitTest.java +++ b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/pseudotab/PseudoTabUnitTest.java
@@ -20,11 +20,11 @@ import org.mockito.MockitoAnnotations; import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabList; import org.chromium.chrome.browser.tabmodel.TabModelFilter; import org.chromium.chrome.browser.tabmodel.TabModelFilterProvider; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.test.util.browser.Features; import java.util.ArrayList;
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGridItemTouchHelperCallbackUnitTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGridItemTouchHelperCallbackUnitTest.java index c7840c2..9c4bc15 100644 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGridItemTouchHelperCallbackUnitTest.java +++ b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabGridItemTouchHelperCallbackUnitTest.java
@@ -36,6 +36,7 @@ import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.EmptyTabModelFilter; @@ -43,7 +44,6 @@ import org.chromium.chrome.browser.tabmodel.TabModelFilterProvider; import org.chromium.chrome.browser.tabmodel.TabModelSelectorImpl; import org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilter; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.test.util.browser.Features; import org.chromium.components.feature_engagement.EventConstants; import org.chromium.components.feature_engagement.Tracker;
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediatorUnitTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediatorUnitTest.java index d6db552..b43dd77 100644 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediatorUnitTest.java +++ b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediatorUnitTest.java
@@ -63,6 +63,7 @@ import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; import org.chromium.chrome.browser.favicon.FaviconHelper; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tab.Tab; @@ -75,7 +76,6 @@ import org.chromium.chrome.browser.tabmodel.TabModelObserver; import org.chromium.chrome.browser.tabmodel.TabModelSelectorImpl; import org.chromium.chrome.browser.tasks.tab_groups.TabGroupModelFilter; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.test.util.browser.Features; import org.chromium.components.feature_engagement.EventConstants; import org.chromium.components.feature_engagement.Tracker;
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediatorUnitTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediatorUnitTest.java index d93954f..6e5baf0f 100644 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediatorUnitTest.java +++ b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediatorUnitTest.java
@@ -47,6 +47,7 @@ import org.chromium.chrome.browser.compositor.CompositorViewHolder; import org.chromium.chrome.browser.compositor.layouts.Layout; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabModel; @@ -56,7 +57,6 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelectorImpl; import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver; import org.chromium.chrome.browser.tabmodel.TabSelectionType; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.test.util.browser.Features; import org.chromium.chrome.test.util.browser.Features.DisableFeatures; import org.chromium.chrome.test.util.browser.Features.EnableFeatures;
diff --git a/chrome/android/features/vr/java/src/org/chromium/chrome/browser/vr/VrShell.java b/chrome/android/features/vr/java/src/org/chromium/chrome/browser/vr/VrShell.java index ab75989..57bbe2a 100644 --- a/chrome/android/features/vr/java/src/org/chromium/chrome/browser/vr/VrShell.java +++ b/chrome/android/features/vr/java/src/org/chromium/chrome/browser/vr/VrShell.java
@@ -38,6 +38,7 @@ import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.compositor.CompositorView; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.page_info.PageInfoController; import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.Tab; @@ -54,7 +55,6 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver; import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabObserver; import org.chromium.chrome.browser.toolbar.NewTabButton; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.vr.keyboard.VrInputMethodManagerWrapper; import org.chromium.content_public.browser.ImeAdapter; import org.chromium.content_public.browser.LoadUrlParams;
diff --git a/chrome/android/java/monochrome_public_bundle.proguard_flags.expected b/chrome/android/java/monochrome_public_bundle.proguard_flags.expected index 30f34e1..c2402ea 100644 --- a/chrome/android/java/monochrome_public_bundle.proguard_flags.expected +++ b/chrome/android/java/monochrome_public_bundle.proguard_flags.expected
@@ -272,6 +272,25 @@ } ################################################################################ +# ../../chrome/android/features/start_surface/internal/proguard.flags +################################################################################ +# Copyright 2019 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# To fix crbug/1017396. This is because AppBarLayout$ScrollingViewBehavior +# is instantiated via java.lang.reflect.Constructor in CoordinatorLayout.java. +# Note that AppBarLayout$Behavior is needed to keep the scrolling behavior. +-keep class android.support.design.widget.AppBarLayout$Behavior { + public <init>(android.content.Context, android.util.AttributeSet); + public <init>(); +} +-keep class android.support.design.widget.AppBarLayout$ScrollingViewBehavior { + public <init>(android.content.Context, android.util.AttributeSet); + public <init>(); +} + +################################################################################ # ../../chrome/android/java/proguard.flags ################################################################################ # Copyright 2016 The Chromium Authors. All rights reserved.
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 7478f89..be899bdc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -89,6 +89,7 @@ import org.chromium.chrome.browser.download.items.OfflineContentAggregatorNotificationBridgeUiFactory; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; import org.chromium.chrome.browser.firstrun.ForcedSigninProcessor; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.gsa.ContextReporter; import org.chromium.chrome.browser.gsa.GSAAccountChangeListener; @@ -149,7 +150,6 @@ import org.chromium.chrome.browser.ui.system.StatusBarColorController; import org.chromium.chrome.browser.ui.widget.textbubble.TextBubble; import org.chromium.chrome.browser.util.AccessibilityUtil; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.MathUtils; import org.chromium.chrome.browser.vr.ArDelegate; import org.chromium.chrome.browser.vr.ArDelegateProvider;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivitySessionTracker.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivitySessionTracker.java index 443e07d..cc9bbdb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivitySessionTracker.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivitySessionTracker.java
@@ -24,16 +24,17 @@ import org.chromium.chrome.browser.accessibility.FontSizePrefs; import org.chromium.chrome.browser.browsing_data.BrowsingDataType; import org.chromium.chrome.browser.browsing_data.TimePeriod; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.metrics.UmaUtils; import org.chromium.chrome.browser.metrics.VariationsSession; import org.chromium.chrome.browser.notifications.NotificationPlatformBridge; +import org.chromium.chrome.browser.notifications.chime.ChimeSession; import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations; import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.preferences.privacy.BrowsingDataBridge; import org.chromium.chrome.browser.profiles.ProfileManagerUtils; import org.chromium.chrome.browser.share.ShareHelper; import org.chromium.chrome.browser.tabmodel.TabModelSelector; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.base.ResourceBundle; import java.util.Locale; @@ -138,6 +139,7 @@ updateAcceptLanguages(); mVariationsSession.start(); mPowerBroadcastReceiver.onForegroundSessionStart(); + ChimeSession.start(); // Track the ratio of Chrome startups that are caused by notification clicks. // TODO(johnme): Add other reasons (and switch to recordEnumeratedHistogram).
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java index 59d3633..fa2f938 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java
@@ -38,9 +38,9 @@ import org.chromium.chrome.browser.dependency_injection.ChromeAppModule; import org.chromium.chrome.browser.dependency_injection.DaggerChromeAppComponent; import org.chromium.chrome.browser.dependency_injection.ModuleFactoryOverrides; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.metrics.UmaUtils; import org.chromium.chrome.browser.night_mode.SystemNightModeMonitor; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.vr.OnExitVrRequestListener; import org.chromium.chrome.browser.vr.VrModuleProvider; import org.chromium.components.embedder_support.application.FontPreloadingWorkaround;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java index 50a2a8c..4d552f54 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -80,6 +80,7 @@ import org.chromium.chrome.browser.feed.FeedProcessScopeFactory; import org.chromium.chrome.browser.firstrun.FirstRunSignInProcessor; import org.chromium.chrome.browser.firstrun.FirstRunStatus; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.fullscreen.ComposedBrowserControlsVisibilityDelegate; import org.chromium.chrome.browser.gesturenav.NavigationSheet; import org.chromium.chrome.browser.gesturenav.TabbedSheetDelegate; @@ -150,7 +151,6 @@ import org.chromium.chrome.browser.ui.RootUiCoordinator; import org.chromium.chrome.browser.usage_stats.UsageStatsService; import org.chromium.chrome.browser.util.AccessibilityUtil; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.IntentUtils; import org.chromium.chrome.browser.util.UrlConstants; import org.chromium.chrome.browser.vr.VrModuleProvider;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java index 4d2248b2..99869e34 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuPropertiesDelegateImpl.java
@@ -33,6 +33,7 @@ import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.device.DeviceClassManager; import org.chromium.chrome.browser.download.DownloadUtils; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.multiwindow.MultiWindowModeStateDispatcher; import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper; import org.chromium.chrome.browser.preferences.ManagedPreferencesUtils; @@ -42,7 +43,6 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.toolbar.ToolbarManager; import org.chromium.chrome.browser.translate.TranslateUtils; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.UrlConstants; import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; import org.chromium.ui.base.DeviceFormFactor;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChrome.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChrome.java index cb7fa69..9a0944e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChrome.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChrome.java
@@ -15,7 +15,6 @@ import org.chromium.chrome.browser.accessibility_tab_switcher.OverviewListLayout; import org.chromium.chrome.browser.compositor.TitleCache; import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChangeReason; -import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior.OverviewModeObserver; import org.chromium.chrome.browser.compositor.layouts.components.LayoutTab; import org.chromium.chrome.browser.compositor.layouts.components.VirtualView; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; @@ -27,6 +26,7 @@ import org.chromium.chrome.browser.compositor.overlays.strip.StripLayoutHelperManager; import org.chromium.chrome.browser.contextualsearch.ContextualSearchManagementDelegate; import org.chromium.chrome.browser.device.DeviceClassManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.fullscreen.FullscreenManager; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabCreatorManager; @@ -37,7 +37,6 @@ import org.chromium.chrome.browser.tasks.tab_management.TabManagementModuleProvider; import org.chromium.chrome.browser.toolbar.ToolbarManager; import org.chromium.chrome.browser.util.AccessibilityUtil; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.features.start_surface.StartSurface; import org.chromium.ui.resources.dynamics.DynamicResourceLoader;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TabContentManager.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TabContentManager.java index 9b11061..f93a36d9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TabContentManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/content/TabContentManager.java
@@ -29,12 +29,12 @@ import org.chromium.base.task.AsyncTask; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeSwitches; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.native_page.FrozenNativePage; import org.chromium.chrome.browser.native_page.NativePage; import org.chromium.chrome.browser.tab.SadTab; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.usage_stats.SuspendedTab; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.base.DeviceFormFactor; import org.chromium.ui.display.DisplayAndroid;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayoutBase.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayoutBase.java index 629c2cd..dd8635d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayoutBase.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayoutBase.java
@@ -40,6 +40,7 @@ import org.chromium.chrome.browser.compositor.layouts.phone.stack.StackTab; import org.chromium.chrome.browser.compositor.scene_layer.SceneLayer; import org.chromium.chrome.browser.compositor.scene_layer.TabListSceneLayer; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.partnercustomizations.HomepageManager; import org.chromium.chrome.browser.tab.Tab; @@ -47,7 +48,6 @@ import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabModelObserver; import org.chromium.chrome.browser.tabmodel.TabModelUtils; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.MathUtils; import org.chromium.ui.UiUtils; import org.chromium.ui.base.LocalizationUtils;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java index d82809ad2..5d17b9b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabListSceneLayer.java
@@ -18,11 +18,11 @@ import org.chromium.chrome.browser.compositor.layouts.Layout; import org.chromium.chrome.browser.compositor.layouts.components.LayoutTab; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.ui.styles.ChromeColors; import org.chromium.chrome.browser.util.ColorUtils; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.resources.ResourceManager; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItem.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItem.java index ba1f4b1..5aba403 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItem.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItem.java
@@ -15,8 +15,8 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.chrome.R; import org.chromium.chrome.browser.DefaultBrowserInfo; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.text.SpanApplier; import org.chromium.ui.text.SpanApplier.SpanInfo; @@ -74,7 +74,7 @@ /** * Mapping from {@link Item} to the ID found in the ids.xml. */ - private final static int[] MENU_IDS = { + private static final int[] MENU_IDS = { R.id.contextmenu_open_in_new_chrome_tab, // Item.OPEN_IN_NEW_CHROME_TAB R.id.contextmenu_open_in_chrome_incognito_tab, // Item.OPEN_IN_CHROME_INCOGNITO_TAB R.id.contextmenu_open_in_browser_id, // Item.OPEN_IN_BROWSER_ID @@ -103,7 +103,7 @@ /** * Mapping from {@link Item} to the ID of the string that describes the action of the item. */ - private final static int[] STRING_IDS = { + private static final int[] STRING_IDS = { R.string.contextmenu_open_in_new_chrome_tab, // Item.OPEN_IN_NEW_CHROME_TAB: R.string.contextmenu_open_in_chrome_incognito_tab, // Item.OPEN_IN_CHROME_INCOGNITO_TAB: 0, // Item.OPEN_IN_BROWSER_ID is not handled by this mapping.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabNightModeStateController.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabNightModeStateController.java index 0c71ad4..c1309ad3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabNightModeStateController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabNightModeStateController.java
@@ -12,13 +12,13 @@ import androidx.browser.customtabs.CustomTabsIntent; import org.chromium.base.ObserverList; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.lifecycle.Destroyable; import org.chromium.chrome.browser.night_mode.NightModeStateProvider; import org.chromium.chrome.browser.night_mode.NightModeUtils; import org.chromium.chrome.browser.night_mode.PowerSavingModeMonitor; import org.chromium.chrome.browser.night_mode.SystemNightModeMonitor; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.IntentUtils; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java index b33badf..7d73ec9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java
@@ -11,7 +11,6 @@ import android.os.Environment; import android.text.TextUtils; import android.util.Pair; -import android.webkit.MimeTypeMap; import android.webkit.URLUtil; import org.chromium.base.Log; @@ -26,8 +25,6 @@ import org.chromium.ui.base.WindowAndroid; import java.io.File; -import java.util.Arrays; -import java.util.HashSet; /** * Chrome implementation of the ContentViewDownloadDelegate interface. @@ -42,13 +39,6 @@ private static final String TAG = "Download"; private static final Class<ChromeDownloadDelegate> USER_DATA_KEY = ChromeDownloadDelegate.class; - - // Mime types that Android can't handle when tries to open the file. Chrome may deduct a better - // mime type based on file extension. - private static final HashSet<String> GENERIC_MIME_TYPES = new HashSet<String>(Arrays.asList( - "text/plain", "application/octet-stream", "binary/octet-stream", "octet/stream", - "application/download", "application/force-download", "application/unknown")); - private Tab mTab; public static ChromeDownloadDelegate from(Tab tab) { @@ -81,8 +71,8 @@ protected void onDownloadStartNoStream(final DownloadInfo downloadInfo) { final String fileName = downloadInfo.getFileName(); assert !TextUtils.isEmpty(fileName); - final String newMimeType = - remapGenericMimeType(downloadInfo.getMimeType(), downloadInfo.getUrl(), fileName); + final String newMimeType = MimeUtils.remapGenericMimeType( + downloadInfo.getMimeType(), downloadInfo.getUrl(), fileName); new AsyncTask<Pair<String, File>>() { @Override protected Pair<String, File> doInBackground() { @@ -194,53 +184,6 @@ } /** - * If the given MIME type is null, or one of the "generic" types (text/plain - * or application/octet-stream) map it to a type that Android can deal with. - * If the given type is not generic, return it unchanged. - * - * We have to implement this ourselves as - * MimeTypeMap.remapGenericMimeType() is not public. - * See http://crbug.com/407829. - * - * @param mimeType MIME type provided by the server. - * @param url URL of the data being loaded. - * @param filename file name obtained from content disposition header - * @return The MIME type that should be used for this data. - */ - static String remapGenericMimeType(String mimeType, String url, String filename) { - // If we have one of "generic" MIME types, try to deduce - // the right MIME type from the file extension (if any): - if (mimeType == null || mimeType.isEmpty() || GENERIC_MIME_TYPES.contains(mimeType)) { - String extension = getFileExtension(url, filename); - String newMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); - if (newMimeType != null) { - mimeType = newMimeType; - } else if (extension.equals("dm")) { - mimeType = OMADownloadHandler.OMA_DRM_MESSAGE_MIME; - } else if (extension.equals("dd")) { - mimeType = OMADownloadHandler.OMA_DOWNLOAD_DESCRIPTOR_MIME; - } - } - return mimeType; - } - - /** - * Retrieve the file extension from a given file name or url. - * - * @param url URL to extract the extension. - * @param filename File name to extract the extension. - * @return If extension can be extracted from file name, use that. Or otherwise, use the - * extension extracted from the url. - */ - static String getFileExtension(String url, String filename) { - if (!TextUtils.isEmpty(filename)) { - int index = filename.lastIndexOf("."); - if (index > 0) return filename.substring(index + 1); - } - return MimeTypeMap.getFileExtensionFromUrl(url); - } - - /** * For certain download types(OMA for example), android DownloadManager should * handle them. Call this function to intercept those downloads. * @@ -256,7 +199,7 @@ String path = uri.getPath(); if (!OMADownloadHandler.isOMAFile(path)) return false; if (mTab == null) return true; - String fileName = URLUtil.guessFileName(url, null, OMADownloadHandler.OMA_DRM_MESSAGE_MIME); + String fileName = URLUtil.guessFileName(url, null, MimeUtils.OMA_DRM_MESSAGE_MIME); final DownloadInfo downloadInfo = new DownloadInfo.Builder().setUrl(url).setFileName(fileName).build(); WindowAndroid window = mTab.getWindowAndroid();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadBroadcastManager.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadBroadcastManager.java index 419eb616..9b75132 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadBroadcastManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadBroadcastManager.java
@@ -36,10 +36,10 @@ import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.download.DownloadNotificationUmaHelper.UmaDownloadResumption; import org.chromium.chrome.browser.download.items.OfflineContentAggregatorNotificationBridgeUiFactory; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.init.BrowserParts; import org.chromium.chrome.browser.init.ChromeBrowserInitializer; import org.chromium.chrome.browser.init.EmptyBrowserParts; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.IntentUtils; import org.chromium.components.offline_items_collection.ContentId; import org.chromium.components.offline_items_collection.LegacyHelpers;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadController.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadController.java index 7e1cb76..5d8c0b0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadController.java
@@ -18,10 +18,10 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeFeatureList; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.permissions.AndroidPermissionRequester; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabModelSelector; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.components.download.DownloadCollectionBridge; import org.chromium.content_public.browser.BrowserStartupController; import org.chromium.content_public.browser.WebContents;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfoBarController.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfoBarController.java index 69fc9a0..41db8600 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfoBarController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfoBarController.java
@@ -23,6 +23,7 @@ import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.DeviceConditions; import org.chromium.chrome.browser.download.items.OfflineContentAggregatorFactory; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.infobar.DownloadProgressInfoBar; import org.chromium.chrome.browser.infobar.IPHInfoBarSupport; import org.chromium.chrome.browser.infobar.InfoBar; @@ -31,7 +32,6 @@ import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.toolbar.ToolbarButtonInProductHelpController; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet; import org.chromium.components.download.DownloadState; import org.chromium.components.feature_engagement.FeatureConstants; @@ -281,7 +281,7 @@ public void onDownloadItemUpdated(DownloadItem downloadItem) { if (mUseNewDownloadPath) return; - OfflineItem offlineItem = DownloadInfo.createOfflineItem(downloadItem.getDownloadInfo()); + OfflineItem offlineItem = DownloadItem.createOfflineItem(downloadItem); if (!isVisibleToUser(offlineItem)) return; if (downloadItem.getDownloadInfo().state() == DownloadState.COMPLETE) { @@ -320,8 +320,7 @@ if (result) { onItemRemoved(downloadItem.getContentId()); } else { - computeNextStepForUpdate( - DownloadInfo.createOfflineItem(downloadItem.getDownloadInfo())); + computeNextStepForUpdate(DownloadItem.createOfflineItem(downloadItem)); } }); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java index 9508c61..1db883e8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadItem.java
@@ -6,9 +6,12 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.components.download.DownloadState; +import org.chromium.components.download.ResumeMode; import org.chromium.components.offline_items_collection.ContentId; import org.chromium.components.offline_items_collection.OfflineItem; import org.chromium.components.offline_items_collection.OfflineItem.Progress; +import org.chromium.components.offline_items_collection.OfflineItemFilter; +import org.chromium.components.offline_items_collection.OfflineItemState; /** * A generic class representing a download item. The item can be either downloaded through the @@ -150,11 +153,93 @@ * @return A {@link OfflineItem} containing the relevant fields from {@code item}. */ public static OfflineItem createOfflineItem(DownloadItem item) { - OfflineItem offlineItem = DownloadInfo.createOfflineItem(item.getDownloadInfo()); + OfflineItem offlineItem = new OfflineItem(); + DownloadInfo downloadInfo = item.getDownloadInfo(); + offlineItem.id = downloadInfo.getContentId(); + offlineItem.filePath = downloadInfo.getFilePath(); + offlineItem.title = downloadInfo.getFileName(); + offlineItem.description = downloadInfo.getDescription(); + offlineItem.isTransient = downloadInfo.getIsTransient(); + offlineItem.isAccelerated = downloadInfo.getIsParallelDownload(); + offlineItem.isSuggested = false; + offlineItem.totalSizeBytes = downloadInfo.getBytesTotalSize(); + offlineItem.receivedBytes = downloadInfo.getBytesReceived(); + offlineItem.isResumable = downloadInfo.isResumable(); + offlineItem.pageUrl = downloadInfo.getUrl(); + offlineItem.originalUrl = downloadInfo.getOriginalUrl(); + offlineItem.isOffTheRecord = downloadInfo.isOffTheRecord(); + offlineItem.mimeType = downloadInfo.getMimeType(); + offlineItem.progress = downloadInfo.getProgress(); + offlineItem.timeRemainingMs = downloadInfo.getTimeRemainingInMillis(); + offlineItem.isDangerous = downloadInfo.getIsDangerous(); + offlineItem.pendingState = downloadInfo.getPendingState(); + offlineItem.failState = downloadInfo.getFailState(); + offlineItem.promoteOrigin = downloadInfo.getShouldPromoteOrigin(); + offlineItem.lastAccessedTimeMs = downloadInfo.getLastAccessTime(); offlineItem.creationTimeMs = item.getStartTime(); offlineItem.completionTimeMs = item.getEndTime(); offlineItem.externallyRemoved = item.hasBeenExternallyRemoved(); offlineItem.canRename = item.getDownloadInfo().state() == DownloadState.COMPLETE; + switch (downloadInfo.state()) { + case DownloadState.IN_PROGRESS: + offlineItem.state = downloadInfo.isPaused() ? OfflineItemState.PAUSED + : OfflineItemState.IN_PROGRESS; + break; + case DownloadState.COMPLETE: + offlineItem.state = downloadInfo.getBytesReceived() == 0 + ? OfflineItemState.FAILED + : OfflineItemState.COMPLETE; + break; + case DownloadState.CANCELLED: + offlineItem.state = OfflineItemState.CANCELLED; + break; + case DownloadState.INTERRUPTED: + @ResumeMode + int resumeMode = DownloadUtils.getResumeMode( + downloadInfo.getUrl(), downloadInfo.getFailState()); + if (resumeMode == ResumeMode.INVALID || resumeMode == ResumeMode.USER_RESTART) { + // Fail but can restart from the beginning. The UI should let the user to retry. + offlineItem.state = OfflineItemState.INTERRUPTED; + } + // TODO(xingliu): isDownloadPaused and isDownloadPending rely on isAutoResumable + // is set correctly in {@link DownloadSharedPreferenceEntry}. The states of + // notification UI and download home currently may not match. Also pending is + // related to Java side auto resumption on good network condition. + else if (downloadInfo.isPaused()) { + offlineItem.state = OfflineItemState.PAUSED; + } else if (DownloadUtils.isDownloadPending(item)) { + offlineItem.state = OfflineItemState.PENDING; + } else { + // Unknown failure state. + offlineItem.state = OfflineItemState.FAILED; + } + break; + default: + assert false; + } + + switch (DownloadFilter.fromMimeType(downloadInfo.getMimeType())) { + case DownloadFilter.Type.PAGE: + offlineItem.filter = OfflineItemFilter.PAGE; + break; + case DownloadFilter.Type.VIDEO: + offlineItem.filter = OfflineItemFilter.VIDEO; + break; + case DownloadFilter.Type.AUDIO: + offlineItem.filter = OfflineItemFilter.AUDIO; + break; + case DownloadFilter.Type.IMAGE: + offlineItem.filter = OfflineItemFilter.IMAGE; + break; + case DownloadFilter.Type.DOCUMENT: + offlineItem.filter = OfflineItemFilter.DOCUMENT; + break; + case DownloadFilter.Type.OTHER: + default: + offlineItem.filter = OfflineItemFilter.OTHER; + break; + } + return offlineItem; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerBridge.java index 20e317b..f212b1a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerBridge.java
@@ -285,7 +285,7 @@ String originalMimeType, String filePath, long fileSizeBytes, String originalUrl, String referrer, String downloadGuid, long callbackId) { final String mimeType = - DownloadUtils.remapGenericMimeType(originalMimeType, originalUrl, fileName); + MimeUtils.remapGenericMimeType(originalMimeType, originalUrl, fileName); AsyncTask<Pair<Long, Boolean>> task = new AsyncTask<Pair<Long, Boolean>>() { @Override protected Pair<Long, Boolean> doInBackground() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java index 9b066ead..ba698a2d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
@@ -43,13 +43,13 @@ import org.chromium.chrome.browser.download.items.OfflineContentAggregatorFactory; import org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.media.MediaViewerUtils; import org.chromium.chrome.browser.preferences.Pref; import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.profiles.ProfileManager; import org.chromium.chrome.browser.util.ConversionUtils; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.components.download.DownloadState; import org.chromium.components.feature_engagement.EventConstants; import org.chromium.components.feature_engagement.Tracker; @@ -362,7 +362,7 @@ if (downloadInfo.getBytesReceived() == 0) { status = DownloadStatus.FAILED; } else { - mimeType = DownloadUtils.remapGenericMimeType( + mimeType = MimeUtils.remapGenericMimeType( mimeType, downloadInfo.getOriginalUrl(), downloadInfo.getFileName()); } DownloadInfo newInfo = @@ -605,8 +605,7 @@ if (success) item.setSystemDownloadId(systemDownloadId); } boolean canResolve = success - && (DownloadUtils.isOMADownloadDescription( - item.getDownloadInfo().getMimeType()) + && (MimeUtils.isOMADownloadDescription(item.getDownloadInfo().getMimeType()) || canResolveDownloadItem(item, isSupportedMimeType)); return Pair.create(success, canResolve); } @@ -653,7 +652,7 @@ * @param download A download item. */ private void handleAutoOpenAfterDownload(DownloadItem download) { - if (DownloadUtils.isOMADownloadDescription(download.getDownloadInfo().getMimeType())) { + if (MimeUtils.isOMADownloadDescription(download.getDownloadInfo().getMimeType())) { mOMADownloadHandler.handleOMADownload( download.getDownloadInfo(), download.getSystemDownloadId()); return; @@ -937,7 +936,7 @@ public static boolean canResolveDownload( String filePath, String mimeType, long systemDownloadId) { assert !ThreadUtils.runningOnUiThread(); - if (DownloadUtils.isOMADownloadDescription(mimeType)) return true; + if (MimeUtils.isOMADownloadDescription(mimeType)) return true; Intent intent = getLaunchIntentForDownload(filePath, systemDownloadId, DownloadManagerService.isSupportedMimeType(mimeType), null, null, mimeType); @@ -1396,9 +1395,7 @@ handleAutoOpenAfterDownload(item); } else { getInfoBarController(item.getDownloadInfo().isOffTheRecord()) - .onItemUpdated(DownloadInfo.createOfflineItem( - item.getDownloadInfo()), - null); + .onItemUpdated(DownloadItem.createOfflineItem(item), null); } } }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); @@ -1822,7 +1819,7 @@ public Boolean doInBackground() { DownloadInfo info = downloadItem.getDownloadInfo(); boolean isSupportedMimeType = isSupportedMimeType(info.getMimeType()); - boolean canResolve = DownloadUtils.isOMADownloadDescription(info.getMimeType()) + boolean canResolve = MimeUtils.isOMADownloadDescription(info.getMimeType()) || canResolveDownloadItem(downloadItem, isSupportedMimeType); return canResolve && DownloadUtils.shouldAutoOpenDownload(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java index 15ff152..1801ccce5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
@@ -29,11 +29,11 @@ import org.chromium.base.VisibleForTesting; import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.chrome.R; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.notifications.NotificationManagerProxy; import org.chromium.chrome.browser.notifications.NotificationManagerProxyImpl; import org.chromium.chrome.browser.notifications.NotificationUmaTracker; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.components.offline_items_collection.ContentId; import org.chromium.components.offline_items_collection.FailState; import org.chromium.components.offline_items_collection.LegacyHelpers;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadResumptionBackgroundTask.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadResumptionBackgroundTask.java index 7ae936b..939f237 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadResumptionBackgroundTask.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadResumptionBackgroundTask.java
@@ -8,7 +8,7 @@ import android.os.Handler; import org.chromium.chrome.browser.background_task_scheduler.NativeBackgroundTask; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.components.background_task_scheduler.TaskParameters; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadResumptionScheduler.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadResumptionScheduler.java index 2fcc322..696fdee 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadResumptionScheduler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadResumptionScheduler.java
@@ -8,7 +8,7 @@ import android.text.format.DateUtils; import org.chromium.base.ContextUtils; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.components.background_task_scheduler.BackgroundTaskSchedulerFactory; import org.chromium.components.background_task_scheduler.TaskIds; import org.chromium.components.background_task_scheduler.TaskInfo;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java index 078afd0..dfa52be 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java
@@ -108,19 +108,17 @@ R.string.download_ui_kb, R.string.download_ui_mb, R.string.download_ui_gb}; // Set will be more expensive to initialize, so use an ArrayList here. - private static final List<String> MIME_TYPES_TO_OPEN = - new ArrayList<String>(Arrays.asList(OMADownloadHandler.OMA_DOWNLOAD_DESCRIPTOR_MIME, - "application/pdf", "application/x-x509-ca-cert", "application/x-x509-user-cert", - "application/x-x509-server-cert", "application/x-pkcs12", - "application/application/x-pem-file", "application/pkix-cert", - "application/x-wifi-config")); + private static final List<String> MIME_TYPES_TO_OPEN = new ArrayList<String>(Arrays.asList( + MimeUtils.OMA_DOWNLOAD_DESCRIPTOR_MIME, "application/pdf", "application/x-x509-ca-cert", + "application/x-x509-user-cert", "application/x-x509-server-cert", + "application/x-pkcs12", "application/application/x-pem-file", "application/pkix-cert", + "application/x-wifi-config")); private static final String TAG = "download"; private static final String DEFAULT_MIME_TYPE = "*/*"; private static final String MIME_TYPE_DELIMITER = "/"; private static final String MIME_TYPE_SHARING_URL = "text/plain"; - private static final String UNKNOWN_MIME_TYPE = "application/unknown"; private static final String EXTRA_IS_OFF_THE_RECORD = "org.chromium.chrome.browser.download.IS_OFF_THE_RECORD"; @@ -391,32 +389,6 @@ return uri != null ? uri.toString() : new String(); } - /** - * If the given MIME type is null, or one of the "generic" types (text/plain - * or application/octet-stream) map it to a type that Android can deal with. - * If the given type is not generic, return it unchanged. - * See {@code ChromeDownloadDelegate#remapGenericMimeType}. - * - * @param mimeType MIME type provided by the server. - * @param url URL of the data being loaded. - * @param filename file name obtained from content disposition header - * @return The MIME type that should be used for this data. - */ - @CalledByNative - public static String remapGenericMimeType(String mimeType, String url, String filename) { - if (TextUtils.isEmpty(mimeType)) mimeType = UNKNOWN_MIME_TYPE; - return ChromeDownloadDelegate.remapGenericMimeType(mimeType, url, filename); - } - - /** - * Returns true if the download is for OMA download description file. - * - * @param mimeType The mime type of the download. - * @return true if the downloaded is OMA download description, or false otherwise. - */ - public static boolean isOMADownloadDescription(String mimeType) { - return OMADownloadHandler.OMA_DOWNLOAD_DESCRIPTOR_MIME.equalsIgnoreCase(mimeType); - } /** * Determines if the download should be immediately opened after
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/OMADownloadHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/download/OMADownloadHandler.java index aa3a21a..033819fe 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/OMADownloadHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/OMADownloadHandler.java
@@ -91,12 +91,6 @@ private static final String TAG = "OMADownloadHandler"; private static final String PENDING_OMA_DOWNLOADS = "PendingOMADownloads"; - // MIME types for OMA downloads. - public static final String OMA_DOWNLOAD_DESCRIPTOR_MIME = "application/vnd.oma.dd+xml"; - public static final String OMA_DRM_MESSAGE_MIME = "application/vnd.oma.drm.message"; - public static final String OMA_DRM_CONTENT_MIME = "application/vnd.oma.drm.content"; - public static final String OMA_DRM_RIGHTS_MIME = "application/vnd.oma.drm.rights+wbxml"; - // Valid download descriptor attributes. protected static final String OMA_TYPE = "type"; protected static final String OMA_SIZE = "size"; @@ -209,8 +203,8 @@ */ String getDrmType() { for (String type : mTypes) { - if (type.equalsIgnoreCase(OMA_DRM_MESSAGE_MIME) - || type.equalsIgnoreCase(OMA_DRM_CONTENT_MIME)) { + if (type.equalsIgnoreCase(MimeUtils.OMA_DRM_MESSAGE_MIME) + || type.equalsIgnoreCase(MimeUtils.OMA_DRM_CONTENT_MIME)) { return type; } } @@ -608,10 +602,10 @@ Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.parse(omaInfo.getValue(OMA_OBJECT_URI)); for (String type : omaInfo.getTypes()) { - if (!type.equalsIgnoreCase(OMA_DRM_MESSAGE_MIME) - && !type.equalsIgnoreCase(OMA_DRM_CONTENT_MIME) - && !type.equalsIgnoreCase(OMA_DOWNLOAD_DESCRIPTOR_MIME) - && !type.equalsIgnoreCase(OMA_DRM_RIGHTS_MIME)) { + if (!type.equalsIgnoreCase(MimeUtils.OMA_DRM_MESSAGE_MIME) + && !type.equalsIgnoreCase(MimeUtils.OMA_DRM_CONTENT_MIME) + && !type.equalsIgnoreCase(MimeUtils.OMA_DOWNLOAD_DESCRIPTOR_MIME) + && !type.equalsIgnoreCase(MimeUtils.OMA_DRM_RIGHTS_MIME)) { intent.setDataAndType(uri, type); if (!PackageManagerUtils .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY) @@ -878,7 +872,7 @@ DownloadManagerService.getDownloadManagerService().getInfoBarController( downloadItem.getDownloadInfo().isOffTheRecord()); if (infobarController == null) return; - OfflineItem offlineItem = DownloadInfo.createOfflineItem(downloadItem.getDownloadInfo()); + OfflineItem offlineItem = DownloadItem.createOfflineItem(downloadItem); offlineItem.id.namespace = LegacyHelpers.LEGACY_ANDROID_DOWNLOAD_NAMESPACE; if (downloadStatus == DownloadManagerService.DownloadStatus.COMPLETE) { offlineItem.state = OfflineItemState.COMPLETE;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/service/DownloadBackgroundTask.java b/chrome/android/java/src/org/chromium/chrome/browser/download/service/DownloadBackgroundTask.java index 759dcda3..b2336798 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/service/DownloadBackgroundTask.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/service/DownloadBackgroundTask.java
@@ -11,8 +11,8 @@ import org.chromium.base.annotations.NativeMethods; import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.chrome.browser.background_task_scheduler.NativeBackgroundTask; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.profiles.ProfileKey; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.components.background_task_scheduler.TaskParameters; import org.chromium.components.download.DownloadTaskType; import org.chromium.components.download.internal.BatteryStatusListenerAndroid;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/feedback/DuetFeedbackSource.java b/chrome/android/java/src/org/chromium/chrome/browser/feedback/DuetFeedbackSource.java index a0530e9..80b2ac3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/feedback/DuetFeedbackSource.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/feedback/DuetFeedbackSource.java
@@ -4,7 +4,7 @@ package org.chromium.chrome.browser.feedback; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; import java.util.HashMap; import java.util.Map;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/flags/FeatureUtilities.java b/chrome/android/java/src/org/chromium/chrome/browser/flags/FeatureUtilities.java new file mode 100644 index 0000000..83f74ff --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/flags/FeatureUtilities.java
@@ -0,0 +1,728 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.flags; + +import android.content.Intent; +import android.content.pm.ResolveInfo; +import android.os.Build; +import android.speech.RecognizerIntent; + +import androidx.annotation.Nullable; + +import org.chromium.base.BuildInfo; +import org.chromium.base.CommandLine; +import org.chromium.base.ContextUtils; +import org.chromium.base.FieldTrialList; +import org.chromium.base.PackageManagerUtils; +import org.chromium.base.SysUtils; +import org.chromium.base.ThreadUtils; +import org.chromium.base.VisibleForTesting; +import org.chromium.base.annotations.CalledByNative; +import org.chromium.base.annotations.NativeMethods; +import org.chromium.base.library_loader.LibraryLoader; +import org.chromium.chrome.browser.ChromeFeatureList; +import org.chromium.chrome.browser.ChromeSwitches; +import org.chromium.chrome.browser.device.DeviceClassManager; +import org.chromium.chrome.browser.firstrun.FirstRunUtils; +import org.chromium.chrome.browser.preferences.ChromePreferenceManager; +import org.chromium.chrome.browser.tasks.tab_management.TabManagementModuleProvider; +import org.chromium.ui.base.DeviceFormFactor; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * A utility {@code class} meant to help determine whether or not certain features are supported by + * this device. + * + * This utility class also contains support for cached feature flags that must take effect on + * startup before native is initialized but are set via native code. The caching is done in + * {@link android.content.SharedPreferences}, which is available in Java immediately. + * + * When adding a new cached flag, it is common practice to use a static Boolean in this file to + * track whether the feature is enabled. A static method that returns the static Boolean can + * then be added to this file allowing client code to query whether the feature is enabled. The + * first time the method is called, the static Boolean should be set to the corresponding shared + * preference. After native is initialized, the shared preference will be updated to reflect the + * native flag value (e.g. the actual experimental feature flag value). + * + * When using a cached flag, the static Boolean should be the source of truth for whether the + * feature is turned on for the current session. As such, always rely on the static Boolean + * when determining whether the corresponding experimental behavior should be enabled. When + * querying whether a cached feature is enabled from native, an @CalledByNative method can be + * exposed in this file to allow feature_utilities.cc to retrieve the cached value. + * + * For cached flags that are queried before native is initialized, when a new experiment + * configuration is received the metrics reporting system will record metrics as if the + * experiment is enabled despite the experimental behavior not yet taking effect. This will be + * remedied on the next process restart, when the static Boolean is reset to the newly cached + * value in shared preferences. + */ +public class FeatureUtilities { + /** + * Key for whether DownloadResumptionBackgroundTask should load native in service manager only + * mode. + * Default value is false. + */ + private static final String SERVICE_MANAGER_FOR_DOWNLOAD_RESUMPTION_KEY = + "service_manager_for_download_resumption"; + + /** + * Key for whether PrefetchBackgroundTask should load native in service manager only mode. + * Default value is false. + */ + private static final String SERVICE_MANAGER_FOR_BACKGROUND_PREFETCH_KEY = + "service_manager_for_background_prefetch"; + + private static final String INTEREST_FEED_CONTENT_SUGGESTIONS_KEY = + "interest_feed_content_suggestions"; + + /** + * Whether or not the download auto-resumption is enabled in native. + * Default value is true. + */ + private static final String DOWNLOAD_AUTO_RESUMPTION_IN_NATIVE_KEY = + "download_auto_resumption_in_native"; + + /** + * Whether or not the bottom toolbar is enabled. + * Default value is false. + */ + private static final String BOTTOM_TOOLBAR_ENABLED_KEY = "bottom_toolbar_enabled"; + + /** + * Whether or not the adaptive toolbar is enabled. + * Default value is true. + */ + private static final String ADAPTIVE_TOOLBAR_ENABLED_KEY = "adaptive_toolbar_enabled"; + + /** + * Whether or not the labeled bottom toolbar is enabled. + * Default value is false. + */ + private static final String LABELED_BOTTOM_TOOLBAR_ENABLED_KEY = + "labeled_bottom_toolbar_enabled"; + + /** + * Whether or not night mode is available. + * Default value is false. + */ + private static final String NIGHT_MODE_AVAILABLE_KEY = "night_mode_available"; + + /** + * Whether or not night mode should set "light" as the default option. + * Default value is false. + */ + private static final String NIGHT_MODE_DEFAULT_TO_LIGHT = "night_mode_default_to_light"; + + /** + * Whether or not night mode is available for custom tabs. + * Default value is false. + */ + private static final String NIGHT_MODE_CCT_AVAILABLE_KEY = "night_mode_cct_available"; + + /** + * Whether or not command line on non-rooted devices is enabled. + * Default value is false. + */ + private static final String COMMAND_LINE_ON_NON_ROOTED_ENABLED_KEY = + "command_line_on_non_rooted_enabled"; + + /** + * Whether or not the start surface is enabled. + * Default value is false. + */ + private static final String START_SURFACE_ENABLED_KEY = "start_surface_enabled"; + + /** + * Whether or not the grid tab switcher is enabled. + * Default value is false. + */ + private static final String GRID_TAB_SWITCHER_ENABLED_KEY = "grid_tab_switcher_enabled"; + + /** + * Whether or not the tab group is enabled. + * Default value is false. + */ + private static final String TAB_GROUPS_ANDROID_ENABLED_KEY = "tab_group_android_enabled"; + + /** + * Whether or not bootstrap tasks should be prioritized (i.e. bootstrap task prioritization + * experiment is enabled). Default value is true. + */ + private static final String PRIORITIZE_BOOTSTRAP_TASKS_KEY = "prioritize_bootstrap_tasks"; + + /** + * Whether warming up network service is enabled. + * Default value is false. + */ + private static final String NETWORK_SERVICE_WARM_UP_ENABLED_KEY = + "network_service_warm_up_enabled"; + + /** + * Key to cache whether immersive ui mode is enabled. + */ + private static final String IMMERSIVE_UI_MODE_ENABLED = "immersive_ui_mode_enabled"; + + /** + * Key to cache whether + * {@link ChromeFeatureList#SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT} is enabled. + */ + private static final String SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT = + "swap_pixel_format_to_fix_convert_from_translucent"; + + /** + * Whether or not we should directly open the dialer when a click to call notification is + * received. Default value is false. + */ + private static final String CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY = + "click_to_call_open_dialer_directly"; + + private static Map<String, Boolean> sFlags = new HashMap<>(); + private static Boolean sHasRecognitionIntentHandler; + private static String sReachedCodeProfilerTrialGroup; + + /** + * Determines whether or not the {@link RecognizerIntent#ACTION_WEB_SEARCH} {@link Intent} + * is handled by any {@link android.app.Activity}s in the system. The result will be cached for + * future calls. Passing {@code false} to {@code useCachedValue} will force it to re-query any + * {@link android.app.Activity}s that can process the {@link Intent}. + * @param useCachedValue Whether or not to use the cached value from a previous result. + * @return {@code true} if recognition is supported. {@code false} otherwise. + */ + public static boolean isRecognitionIntentPresent(boolean useCachedValue) { + ThreadUtils.assertOnUiThread(); + if (sHasRecognitionIntentHandler == null || !useCachedValue) { + List<ResolveInfo> activities = PackageManagerUtils.queryIntentActivities( + new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); + sHasRecognitionIntentHandler = !activities.isEmpty(); + } + + return sHasRecognitionIntentHandler; + } + + /** + * Records the current custom tab visibility state with native-side feature utilities. + * @param visible Whether a custom tab is visible. + */ + public static void setCustomTabVisible(boolean visible) { + FeatureUtilitiesJni.get().setCustomTabVisible(visible); + } + + /** + * Records whether the activity is in multi-window mode with native-side feature utilities. + * @param isInMultiWindowMode Whether the activity is in Android N multi-window mode. + */ + public static void setIsInMultiWindowMode(boolean isInMultiWindowMode) { + FeatureUtilitiesJni.get().setIsInMultiWindowMode(isInMultiWindowMode); + } + + /** + * Caches flags that must take effect on startup but are set via native code. + */ + public static void cacheNativeFlags() { + cacheCommandLineOnNonRootedEnabled(); + FirstRunUtils.cacheFirstRunPrefs(); + cacheBottomToolbarEnabled(); + cacheAdaptiveToolbarEnabled(); + cacheLabeledBottomToolbarEnabled(); + cacheNightModeAvailable(); + cacheNightModeDefaultToLight(); + cacheNightModeForCustomTabsAvailable(); + cacheDownloadAutoResumptionEnabledInNative(); + cachePrioritizeBootstrapTasks(); + cacheFeedEnabled(); + cacheNetworkServiceWarmUpEnabled(); + cacheImmersiveUiModeEnabled(); + cacheSwapPixelFormatToFixConvertFromTranslucentEnabled(); + cacheReachedCodeProfilerTrialGroup(); + cacheStartSurfaceEnabled(); + cacheClickToCallOpenDialerDirectlyEnabled(); + + if (isHighEndPhone()) cacheGridTabSwitcherEnabled(); + if (isHighEndPhone()) cacheTabGroupsAndroidEnabled(); + + // Propagate REACHED_CODE_PROFILER feature value to LibraryLoader. This can't be done in + // LibraryLoader itself because it lives in //base and can't depend on ChromeFeatureList. + LibraryLoader.setReachedCodeProfilerEnabledOnNextRuns( + ChromeFeatureList.isEnabled(ChromeFeatureList.REACHED_CODE_PROFILER)); + } + + /** + * Caches flags that are enabled in ServiceManager only mode and must take effect on startup but + * are set via native code. This function needs to be called in ServiceManager only mode to mark + * these field trials as active, otherwise histogram data recorded in ServiceManager only mode + * won't be tagged with their corresponding field trial experiments. + */ + public static void cacheNativeFlagsForServiceManagerOnlyMode() { + // TODO(crbug.com/995355): Move other related flags from {@link cacheNativeFlags} to here. + cacheServiceManagerForDownloadResumption(); + cacheServiceManagerForBackgroundPrefetch(); + } + + /** + * @return True if tab model merging for Android N+ is enabled. + */ + public static boolean isTabModelMergingEnabled() { + if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_TAB_MERGING_FOR_TESTING)) { + return false; + } + return Build.VERSION.SDK_INT > Build.VERSION_CODES.M; + } + + private static void cacheServiceManagerForDownloadResumption() { + cacheFlag(SERVICE_MANAGER_FOR_DOWNLOAD_RESUMPTION_KEY, + ChromeFeatureList.SERVICE_MANAGER_FOR_DOWNLOAD); + } + + /** + * @return if DownloadResumptionBackgroundTask should load native in service manager only mode. + */ + public static boolean isServiceManagerForDownloadResumptionEnabled() { + return isFlagEnabled(SERVICE_MANAGER_FOR_DOWNLOAD_RESUMPTION_KEY, false); + } + + public static void cacheServiceManagerForBackgroundPrefetch() { + cacheFlag(SERVICE_MANAGER_FOR_BACKGROUND_PREFETCH_KEY, + ChromeFeatureList.SERVICE_MANAGER_FOR_BACKGROUND_PREFETCH); + } + + /** + * @return if PrefetchBackgroundTask should load native in service manager only mode. + */ + public static boolean isServiceManagerForBackgroundPrefetchEnabled() { + return isFlagEnabled(SERVICE_MANAGER_FOR_BACKGROUND_PREFETCH_KEY, false) && isFeedEnabled(); + } + + /** + * Cache the value of the flag whether or not to use Feed so it can be checked in Java before + * native is loaded. + */ + public static void cacheFeedEnabled() { + cacheFlag(INTEREST_FEED_CONTENT_SUGGESTIONS_KEY, + ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS); + } + + /** + * @return Whether or not the Feed is enabled (based on the cached value in SharedPrefs). + */ + public static boolean isFeedEnabled() { + return isFlagEnabled(INTEREST_FEED_CONTENT_SUGGESTIONS_KEY, false); + } + + /** + * @return Whether or not the download auto-resumptions should be enabled in native. + */ + @CalledByNative + public static boolean isDownloadAutoResumptionEnabledInNative() { + return isFlagEnabled(DOWNLOAD_AUTO_RESUMPTION_IN_NATIVE_KEY, true); + } + + /** + * Cache whether or not the bottom toolbar is enabled so on next startup, the value can + * be made available immediately. + */ + public static void cacheBottomToolbarEnabled() { + cacheFlag(BOTTOM_TOOLBAR_ENABLED_KEY, ChromeFeatureList.CHROME_DUET); + } + + /** + * Cache whether or not the adaptive toolbar is enabled so on next startup, the value can + * be made available immediately. + */ + public static void cacheAdaptiveToolbarEnabled() { + cacheFlag(ADAPTIVE_TOOLBAR_ENABLED_KEY, ChromeFeatureList.CHROME_DUET_ADAPTIVE); + } + + /** + * Cache whether or not the labeled bottom toolbar is enabled so on next startup, the value can + * be made available immediately. + */ + public static void cacheLabeledBottomToolbarEnabled() { + cacheFlag(LABELED_BOTTOM_TOOLBAR_ENABLED_KEY, ChromeFeatureList.CHROME_DUET_LABELED); + } + + /** + * Cache whether or not download auto-resumptions are enabled in native so on next startup, the + * value can be made available immediately. + */ + private static void cacheDownloadAutoResumptionEnabledInNative() { + cacheFlag(DOWNLOAD_AUTO_RESUMPTION_IN_NATIVE_KEY, + ChromeFeatureList.DOWNLOADS_AUTO_RESUMPTION_NATIVE); + } + + @VisibleForTesting + public static void setDownloadAutoResumptionEnabledInNativeForTesting(Boolean value) { + sFlags.put(DOWNLOAD_AUTO_RESUMPTION_IN_NATIVE_KEY, value); + } + + /** + * @return Whether or not the bottom toolbar is enabled. + */ + public static boolean isBottomToolbarEnabled() { + // TODO(crbug.com/944228): TabGroupsAndroid and ChromeDuet are incompatible for now. + return isFlagEnabled(BOTTOM_TOOLBAR_ENABLED_KEY, false) + && !DeviceFormFactor.isNonMultiDisplayContextOnTablet( + ContextUtils.getApplicationContext()) + && !isTabGroupsAndroidEnabled(); + } + + /** + * Set whether the bottom toolbar is enabled for tests. Reset to null at the end of tests. + */ + @VisibleForTesting + public static void setIsBottomToolbarEnabledForTesting(Boolean enabled) { + sFlags.put(BOTTOM_TOOLBAR_ENABLED_KEY, enabled); + } + + /** + * @return Whether or not the adaptive toolbar is enabled. + */ + public static boolean isAdaptiveToolbarEnabled() { + return isFlagEnabled(ADAPTIVE_TOOLBAR_ENABLED_KEY, true) && isBottomToolbarEnabled() + && !isGridTabSwitcherEnabled(); + } + + /** + * @return Whether or not the labeled bottom toolbar is enabled. + */ + public static boolean isLabeledBottomToolbarEnabled() { + return isFlagEnabled(LABELED_BOTTOM_TOOLBAR_ENABLED_KEY, false) && isBottomToolbarEnabled(); + } + + /** + * Cache whether or not night mode is available (i.e. night mode experiment is enabled) so on + * next startup, the value can be made available immediately. + */ + public static void cacheNightModeAvailable() { + boolean available = ChromeFeatureList.isEnabled(ChromeFeatureList.ANDROID_NIGHT_MODE) + || (BuildInfo.isAtLeastQ() + && ChromeFeatureList.isEnabled(ChromeFeatureList.ANDROID_NIGHT_MODE_FOR_Q)); + ChromePreferenceManager.getInstance().writeBoolean(NIGHT_MODE_AVAILABLE_KEY, available); + } + + /** + * @return Whether or not night mode experiment is enabled (i.e. night mode experiment is + * enabled). + */ + public static boolean isNightModeAvailable() { + return isFlagEnabled(NIGHT_MODE_AVAILABLE_KEY, false); + } + + /** + * Toggles whether the night mode experiment is enabled for testing. Should be reset back to + * null after the test has finished. + */ + @VisibleForTesting + public static void setNightModeAvailableForTesting(@Nullable Boolean available) { + sFlags.put(NIGHT_MODE_AVAILABLE_KEY, available); + } + + /** + * Cache whether or not to default to the light theme when the night mode feature is enabled. + */ + public static void cacheNightModeDefaultToLight() { + // Do not cache on Q (where defaulting to light theme does not apply) or if night mode is + // not enabled. + if (BuildInfo.isAtLeastQ() + || !ChromeFeatureList.isEnabled(ChromeFeatureList.ANDROID_NIGHT_MODE)) { + return; + } + + String lightModeDefaultParam = "default_light_theme"; + boolean lightModeAsDefault = ChromeFeatureList.getFieldTrialParamByFeatureAsBoolean( + ChromeFeatureList.ANDROID_NIGHT_MODE, lightModeDefaultParam, false); + + ChromePreferenceManager.getInstance().writeBoolean( + NIGHT_MODE_DEFAULT_TO_LIGHT, lightModeAsDefault); + } + + /** + * @return Whether or not to default to the light theme when the night mode feature is enabled. + */ + public static boolean isNightModeDefaultToLight() { + if (BuildInfo.isAtLeastQ()) { + return false; + } + return isFlagEnabled(NIGHT_MODE_DEFAULT_TO_LIGHT, false); + } + + /** + * Toggles whether the night mode experiment is enabled for testing. Should be reset back to + * null after the test has finished. + */ + @VisibleForTesting + public static void setNightModeDefaultToLightForTesting(@Nullable Boolean available) { + sFlags.put(NIGHT_MODE_DEFAULT_TO_LIGHT, available); + } + + /** + * Cache whether or not night mode is available for custom tabs (i.e. night mode experiment is + * enabled), so the value is immediately available on next start-up. + */ + public static void cacheNightModeForCustomTabsAvailable() { + cacheFlag(NIGHT_MODE_CCT_AVAILABLE_KEY, ChromeFeatureList.ANDROID_NIGHT_MODE_CCT); + } + + /** + * @return Whether or not night mode experiment is enabled (i.e. night mode experiment is + * enabled) for custom tabs. + */ + public static boolean isNightModeForCustomTabsAvailable() { + return isFlagEnabled(NIGHT_MODE_CCT_AVAILABLE_KEY, true); + } + + /** + * Toggles whether the night mode for custom tabs experiment is enabled. Must only be used for + * testing. Should be reset back to NULL after the test has finished. + */ + public static void setNightModeForCustomTabsAvailableForTesting(Boolean available) { + sFlags.put(NIGHT_MODE_CCT_AVAILABLE_KEY, available); + } + + /** + * Cache whether or not command line is enabled on non-rooted devices. + */ + private static void cacheCommandLineOnNonRootedEnabled() { + cacheFlag(COMMAND_LINE_ON_NON_ROOTED_ENABLED_KEY, + ChromeFeatureList.COMMAND_LINE_ON_NON_ROOTED); + } + + public static boolean isCommandLineOnNonRootedEnabled() { + return isFlagEnabled(COMMAND_LINE_ON_NON_ROOTED_ENABLED_KEY, false); + } + + /** + * @return Whether or not the download progress infobar is enabled. + */ + public static boolean isDownloadProgressInfoBarEnabled() { + return ChromeFeatureList.isEnabled(ChromeFeatureList.DOWNLOAD_PROGRESS_INFOBAR); + } + + private static void cacheStartSurfaceEnabled() { + cacheFlag(START_SURFACE_ENABLED_KEY, ChromeFeatureList.START_SURFACE_ANDROID); + } + + /** + * @return Whether the Start Surface is enabled. + */ + public static boolean isStartSurfaceEnabled() { + return isFlagEnabled(START_SURFACE_ENABLED_KEY, false); + } + + private static void cacheGridTabSwitcherEnabled() { + ChromePreferenceManager.getInstance().writeBoolean(GRID_TAB_SWITCHER_ENABLED_KEY, + !DeviceClassManager.enableAccessibilityLayout() + && ChromeFeatureList.isEnabled(ChromeFeatureList.TAB_GRID_LAYOUT_ANDROID) + && TabManagementModuleProvider.getDelegate() != null); + } + + /** + * @return Whether the Grid Tab Switcher UI is enabled and available for use. + */ + public static boolean isGridTabSwitcherEnabled() { + // TODO(yusufo): AccessibilityLayout check should not be here and the flow should support + // changing that setting while Chrome is alive. + // Having Tab Groups implies Grid Tab Switcher. + return isFlagEnabled(GRID_TAB_SWITCHER_ENABLED_KEY, false) || isTabGroupsAndroidEnabled(); + } + + /** + * Toggles whether the Grid Tab Switcher is enabled for testing. Should be reset back to + * null after the test has finished. + */ + @VisibleForTesting + public static void setGridTabSwitcherEnabledForTesting(@Nullable Boolean enabled) { + sFlags.put(GRID_TAB_SWITCHER_ENABLED_KEY, enabled); + } + + private static void cacheTabGroupsAndroidEnabled() { + ChromePreferenceManager.getInstance().writeBoolean(TAB_GROUPS_ANDROID_ENABLED_KEY, + !DeviceClassManager.enableAccessibilityLayout() + && ChromeFeatureList.isEnabled(ChromeFeatureList.TAB_GROUPS_ANDROID) + && TabManagementModuleProvider.getDelegate() != null && isHighEndPhone()); + } + + /** + * @return Whether the tab group feature is enabled and available for use. + */ + public static boolean isTabGroupsAndroidEnabled() { + return isFlagEnabled(TAB_GROUPS_ANDROID_ENABLED_KEY, false); + } + + /** + * Toggles whether the Tab Group is enabled for testing. Should be reset back to null after the + * test has finished. + */ + @VisibleForTesting + public static void setTabGroupsAndroidEnabledForTesting(@Nullable Boolean available) { + sFlags.put(TAB_GROUPS_ANDROID_ENABLED_KEY, available); + } + + /** + * Toggles whether the StartSurface is enabled for testing. Should be reset back to null after + * the test has finished. + */ + @VisibleForTesting + public static void setStartSurfaceEnabledForTesting(@Nullable Boolean isEnabled) { + sFlags.put(START_SURFACE_ENABLED_KEY, isEnabled); + } + + private static boolean isHighEndPhone() { + return !SysUtils.isLowEndDevice() + && !DeviceFormFactor.isNonMultiDisplayContextOnTablet( + ContextUtils.getApplicationContext()); + } + + /** + * @return Whether the tab group ui improvement feature is enabled and available for use. + */ + public static boolean isTabGroupsAndroidUiImprovementsEnabled() { + return isTabGroupsAndroidEnabled() + && ChromeFeatureList.isEnabled( + ChromeFeatureList.TAB_GROUPS_UI_IMPROVEMENTS_ANDROID); + } + + /** + * @return Whether this device is running Android Go. This is assumed when we're running Android + * O or later and we're on a low-end device. + */ + public static boolean isAndroidGo() { + return SysUtils.isLowEndDevice() + && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O; + } + + /** + * Cache whether or not bootstrap tasks should be prioritized so on next startup, the value + * can be made available immediately. + */ + public static void cachePrioritizeBootstrapTasks() { + cacheFlag(PRIORITIZE_BOOTSTRAP_TASKS_KEY, ChromeFeatureList.PRIORITIZE_BOOTSTRAP_TASKS); + } + + /** + * @return Whether or not bootstrap tasks should be prioritized (i.e. bootstrap task + * prioritization experiment is enabled). + */ + public static boolean shouldPrioritizeBootstrapTasks() { + return isFlagEnabled(PRIORITIZE_BOOTSTRAP_TASKS_KEY, true); + } + + /** + * Cache whether warming up network service process is enabled, so that the value + * can be made available immediately on next start up. + */ + private static void cacheNetworkServiceWarmUpEnabled() { + ChromePreferenceManager.getInstance().writeBoolean(NETWORK_SERVICE_WARM_UP_ENABLED_KEY, + FeatureUtilitiesJni.get().isNetworkServiceWarmUpEnabled()); + } + + /** + * @return whether warming up network service is enabled. + */ + public static boolean isNetworkServiceWarmUpEnabled() { + return isFlagEnabled(NETWORK_SERVICE_WARM_UP_ENABLED_KEY, false); + } + + private static void cacheImmersiveUiModeEnabled() { + cacheFlag(IMMERSIVE_UI_MODE_ENABLED, ChromeFeatureList.IMMERSIVE_UI_MODE); + } + + /** + * @return Whether immersive ui mode is enabled. + */ + public static boolean isImmersiveUiModeEnabled() { + return isFlagEnabled(IMMERSIVE_UI_MODE_ENABLED, false); + } + + /** + * Returns whether to use {@link Window#setFormat()} to undo opacity change caused by + * {@link Activity#convertFromTranslucent()}. + */ + public static boolean isSwapPixelFormatToFixConvertFromTranslucentEnabled() { + return ChromePreferenceManager.getInstance().readBoolean( + SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT, true); + } + + public static void cacheSwapPixelFormatToFixConvertFromTranslucentEnabled() { + cacheFlag(SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT, + ChromeFeatureList.SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT); + } + + /** + * Cache the value of the flag whether or not to directly open the dialer for click to call. + */ + public static void cacheClickToCallOpenDialerDirectlyEnabled() { + cacheFlag(CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY, + ChromeFeatureList.CLICK_TO_CALL_OPEN_DIALER_DIRECTLY); + } + + /** + * @return Whether or not we should directly open dialer for click to call (based on the cached + * value in SharedPrefs). + */ + public static boolean isClickToCallOpenDialerDirectlyEnabled() { + return isFlagEnabled(CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY, false); + } + + /** + * Toggles whether experiment for opening dialer directly in click to call is enabled for + * testing. Should be reset back to null after the test has finished. + */ + @VisibleForTesting + public static void setIsClickToCallOpenDialerDirectlyEnabledForTesting( + @Nullable Boolean isEnabled) { + sFlags.put(CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY, isEnabled); + } + + /** + * Caches the trial group of the reached code profiler feature to be using on next startup. + */ + private static void cacheReachedCodeProfilerTrialGroup() { + // Make sure that the existing value is saved in a static variable before overwriting it. + if (sReachedCodeProfilerTrialGroup == null) { + getReachedCodeProfilerTrialGroup(); + } + + ChromePreferenceManager.getInstance().writeString( + ChromePreferenceManager.REACHED_CODE_PROFILER_GROUP_KEY, + FieldTrialList.findFullName(ChromeFeatureList.REACHED_CODE_PROFILER)); + } + + /** + * @return The trial group of the reached code profiler. + */ + @CalledByNative + public static String getReachedCodeProfilerTrialGroup() { + if (sReachedCodeProfilerTrialGroup == null) { + sReachedCodeProfilerTrialGroup = ChromePreferenceManager.getInstance().readString( + ChromePreferenceManager.REACHED_CODE_PROFILER_GROUP_KEY, ""); + } + + return sReachedCodeProfilerTrialGroup; + } + + private static void cacheFlag(String preferenceName, String featureName) { + ChromePreferenceManager.getInstance().writeBoolean( + preferenceName, ChromeFeatureList.isEnabled(featureName)); + } + + private static boolean isFlagEnabled(String preferenceName, boolean defaultValue) { + Boolean flag = sFlags.get(preferenceName); + if (flag == null) { + flag = ChromePreferenceManager.getInstance().readBoolean(preferenceName, defaultValue); + sFlags.put(preferenceName, flag); + } + return flag; + } + + @NativeMethods + interface Natives { + void setCustomTabVisible(boolean visible); + void setIsInMultiWindowMode(boolean isInMultiWindowMode); + boolean isNetworkServiceWarmUpEnabled(); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/flags/OWNERS b/chrome/android/java/src/org/chromium/chrome/browser/flags/OWNERS new file mode 100644 index 0000000..80e2a22 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/flags/OWNERS
@@ -0,0 +1,7 @@ +dtrainor@chromium.org +hnakashima@chromium.org +twellington@chromium.org + +# TEAM: clank-modularization@chromium.org +# COMPONENT: UI>Browser>Mobile +# OS: Android
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitTaskRunner.java b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitTaskRunner.java index bb6eb91..6e67f1fe 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitTaskRunner.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitTaskRunner.java
@@ -16,7 +16,7 @@ import org.chromium.base.task.TaskTraits; import org.chromium.chrome.browser.ChromeActivitySessionTracker; import org.chromium.chrome.browser.ChromeVersionInfo; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.components.variations.firstrun.VariationsSeedFetcher; import org.chromium.content_public.browser.ChildProcessLauncherHelper; import org.chromium.content_public.browser.UiThreadTaskTraits;
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 e2ca44c8..aed1a0c 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,8 +35,8 @@ import org.chromium.chrome.browser.FileProviderHelper; import org.chromium.chrome.browser.crash.LogcatExtractionRunnable; import org.chromium.chrome.browser.download.DownloadManagerService; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.services.GoogleServicesManager; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.webapps.ActivityAssigner; import org.chromium.chrome.browser.webapps.ChromeWebApkHost; import org.chromium.components.background_task_scheduler.BackgroundTaskSchedulerExternalUma;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java index 53288cf..ded7bc6d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
@@ -49,6 +49,7 @@ import org.chromium.chrome.browser.download.DownloadController; import org.chromium.chrome.browser.download.DownloadManagerService; import org.chromium.chrome.browser.firstrun.ForcedSigninProcessor; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.history.HistoryDeletionBridge; import org.chromium.chrome.browser.identity.UniqueIdentificationGeneratorFactory; import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator; @@ -76,7 +77,6 @@ import org.chromium.chrome.browser.sharing.shared_clipboard.SharedClipboardShareActivity; import org.chromium.chrome.browser.sync.SyncController; import org.chromium.chrome.browser.util.ConversionUtils; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.webapps.WebApkVersionManager; import org.chromium.chrome.browser.webapps.WebappRegistry; import org.chromium.components.background_task_scheduler.BackgroundTaskSchedulerFactory;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/MediaViewerUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/media/MediaViewerUtils.java index ff13677..6cd16f0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/media/MediaViewerUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/MediaViewerUtils.java
@@ -31,7 +31,7 @@ import org.chromium.chrome.browser.browserservices.BrowserServicesIntentDataProvider.CustomTabsUiType; import org.chromium.chrome.browser.customtabs.CustomTabIntentDataProvider; import org.chromium.chrome.browser.document.ChromeLauncherActivity; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; import java.util.Locale;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceManager.java b/chrome/android/java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceManager.java index 878b82e..4c6b1f3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/multiwindow/MultiInstanceManager.java
@@ -21,6 +21,7 @@ import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.MenuOrKeyboardActionController; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.lifecycle.Destroyable; import org.chromium.chrome.browser.lifecycle.NativeInitObserver; @@ -29,7 +30,6 @@ import org.chromium.chrome.browser.tab_activity_glue.ReparentingTask; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.util.AndroidTaskUtils; -import org.chromium.chrome.browser.util.FeatureUtilities; import java.util.List;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/ContextMenuManager.java b/chrome/android/java/src/org/chromium/chrome/browser/native_page/ContextMenuManager.java index 121535e..64df5aa 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/native_page/ContextMenuManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/native_page/ContextMenuManager.java
@@ -15,8 +15,8 @@ import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.R; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.base.WindowAndroid.OnCloseContextMenuListener; import org.chromium.ui.mojom.WindowOpenDisposition;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateProviderHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateProviderHolder.java index 600a9a6..c4dc8dda 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateProviderHolder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateProviderHolder.java
@@ -12,8 +12,8 @@ import org.chromium.base.VisibleForTesting; import org.chromium.chrome.browser.ChromeBaseAppCompatActivity; import org.chromium.chrome.browser.ChromeSwitches; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.preferences.ChromePreferenceManager; -import org.chromium.chrome.browser.util.FeatureUtilities; /** * Holds an instance of {@link NightModeStateProvider} that provides night mode state for the entire
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/night_mode/NightModeUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/night_mode/NightModeUtils.java index 3152fad..0b50706 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/night_mode/NightModeUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/night_mode/NightModeUtils.java
@@ -17,9 +17,9 @@ import org.chromium.base.VisibleForTesting; import org.chromium.chrome.browser.ChromeBaseAppCompatActivity; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.preferences.ChromePreferenceManager; import org.chromium.chrome.browser.preferences.themes.ThemePreferences; -import org.chromium.chrome.browser.util.FeatureUtilities; /** * Helper methods for supporting night mode.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java index 8d67b6f3..d13603a49 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java
@@ -31,13 +31,13 @@ import org.chromium.chrome.browser.download.DownloadNotifier; import org.chromium.chrome.browser.download.DownloadSharedPreferenceEntry; import org.chromium.chrome.browser.download.DownloadSharedPreferenceHelper; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.offlinepages.OfflinePageOrigin; import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabLaunchType; import org.chromium.chrome.browser.tabmodel.document.AsyncTabCreationParams; import org.chromium.chrome.browser.tabmodel.document.TabDelegate; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.components.offline_items_collection.ContentId; import org.chromium.components.offline_items_collection.LaunchLocation; import org.chromium.components.offline_items_collection.LegacyHelpers;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java index 071a7e6..eeaeb9f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageNotificationBridge.java
@@ -14,8 +14,8 @@ import org.chromium.chrome.browser.download.DownloadSharedPreferenceEntry; import org.chromium.chrome.browser.download.DownloadSharedPreferenceHelper; import org.chromium.chrome.browser.download.items.OfflineContentAggregatorFactory; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.offlinepages.OfflinePageOrigin; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.components.offline_items_collection.ContentId; import org.chromium.components.offline_items_collection.FailState; import org.chromium.components.offline_items_collection.LegacyHelpers;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java index 44155a0..e5d8502 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java
@@ -13,7 +13,7 @@ import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.DeviceConditions; import org.chromium.chrome.browser.background_task_scheduler.NativeBackgroundTask; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.components.background_task_scheduler.TaskIds; import org.chromium.components.background_task_scheduler.TaskParameters; import org.chromium.net.ConnectionType;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarVoiceRecognitionHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarVoiceRecognitionHandler.java index e585e55..bc030c2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarVoiceRecognitionHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarVoiceRecognitionHandler.java
@@ -17,11 +17,11 @@ import org.chromium.base.metrics.CachedMetrics; import org.chromium.chrome.R; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.omnibox.suggestions.AutocompleteCoordinator; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.toolbar.ToolbarDataProvider; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.content_public.browser.NavigationHandle; import org.chromium.content_public.browser.RenderFrameHost; import org.chromium.content_public.browser.WebContents;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java index 45da5a0da..46cb141a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java
@@ -15,6 +15,7 @@ import org.chromium.payments.mojom.PaymentItem; import org.chromium.payments.mojom.PaymentMethodChangeResponse; import org.chromium.payments.mojom.PaymentMethodData; +import org.chromium.payments.mojom.PaymentRequestDetailsUpdate; import java.util.List; import java.util.Map; @@ -197,10 +198,15 @@ InstrumentDetailsCallback callback); /** - * Update the payment information in response to payment method change event. + * Update the payment information in response to payment method, shipping address, or shipping + * option change events. * - * @param response The merchant's response to the payment method change event. + * @param response The merchant's response to the payment method, shipping address, or shipping + * option change events. */ + public void updateWith(PaymentRequestDetailsUpdate response) {} + + // TODO(sahel): Remove this stub after updating clank code. crbug.com/984694 public void updateWith(PaymentMethodChangeResponse response) {} /** Called when the merchant ignored the payment method change event. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java index 99b201c928..948d35a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -1189,13 +1189,7 @@ mPaymentHandlerUi = new PaymentHandlerCoordinator(); ChromeActivity chromeActivity = ChromeActivity.fromWebContents(mWebContents); if (chromeActivity == null) return false; - return mPaymentHandlerUi.show( - chromeActivity, this::onPaymentHandlerUiDismissed, url, mIsIncognito); - } - - private void onPaymentHandlerUiDismissed() { - ensureHideAndResetPaymentHandlerUi(); - ServiceWorkerPaymentAppBridge.onClosingPaymentAppWindow(mWebContents); + return mPaymentHandlerUi.show(chromeActivity, url, mIsIncognito); } @Override @@ -1247,7 +1241,7 @@ // Todo(sahel): handlesShipping must be true when the payment handler is responsible for // handling shipping. crbug.com/984694 mInvokedPaymentInstrument.updateWith( - PaymentDetailsConverter.convertToPaymentMethodChangeResponse( + PaymentDetailsConverter.convertToPaymentRequestDetailsUpdate( details, false /* handlesShipping */, this /* methodChecker */)); return; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentApp.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentApp.java index 08bb0cbd..12a94ccd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentApp.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentApp.java
@@ -15,8 +15,8 @@ import org.chromium.content_public.browser.WebContents; import org.chromium.payments.mojom.PaymentDetailsModifier; import org.chromium.payments.mojom.PaymentItem; -import org.chromium.payments.mojom.PaymentMethodChangeResponse; import org.chromium.payments.mojom.PaymentMethodData; +import org.chromium.payments.mojom.PaymentRequestDetailsUpdate; import java.net.URI; import java.util.Arrays; @@ -51,7 +51,9 @@ private final URI mSwUri; private final boolean mUseCache; - /** The endpoint for payment handler communication, such as the change-payment-method event. */ + /* The endpoint for payment handler communication, such as the + * change-[payment-method|shipping-address|shipping-option] events. + */ private PaymentHandlerHost mPaymentHandlerHost; /** @@ -373,7 +375,7 @@ } @Override - public void updateWith(PaymentMethodChangeResponse response) { + public void updateWith(PaymentRequestDetailsUpdate response) { assert isChangingPaymentMethod(); mPaymentHandlerHost.updateWith(response); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentAppBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentAppBridge.java index 2f79108..bfd381e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentAppBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ServiceWorkerPaymentAppBridge.java
@@ -45,7 +45,7 @@ private static boolean sCanMakePaymentForTesting; /** The interface for checking whether there is an installed SW payment app. */ - static public interface HasServiceWorkerPaymentAppsCallback { + public static interface HasServiceWorkerPaymentAppsCallback { /** * Called to return checking result. * @@ -55,7 +55,7 @@ } /** The interface for getting all installed SW payment apps' information. */ - static public interface GetServiceWorkerPaymentAppsInfoCallback { + public static interface GetServiceWorkerPaymentAppsInfoCallback { /** * Called to return installed SW payment apps' information. * @@ -272,21 +272,28 @@ // Notify closing payment app window so as to abort payment if unsecure. WebContents webContents = tab.getWebContents(); if (!SslValidityChecker.isValidPageInPaymentHandlerWindow(webContents)) { - ServiceWorkerPaymentAppBridgeJni.get().onClosingPaymentAppWindow(webContents, - PaymentEventResponseType.PAYMENT_HANDLER_INSECURE_NAVIGATION); + onClosingPaymentAppWindowForInsecureNavigation(webContents); } } @Override public void onDidAttachInterstitialPage(Tab tab) { - ServiceWorkerPaymentAppBridgeJni.get().onClosingPaymentAppWindow( - tab.getWebContents(), - PaymentEventResponseType.PAYMENT_HANDLER_INSECURE_NAVIGATION); + onClosingPaymentAppWindowForInsecureNavigation(tab.getWebContents()); } }); } /** + * Notify closing the opened payment app window for insecure navigation. + * + * @param webContents The web contents in the opened window. + */ + public static void onClosingPaymentAppWindowForInsecureNavigation(WebContents webContents) { + ServiceWorkerPaymentAppBridgeJni.get().onClosingPaymentAppWindow( + webContents, PaymentEventResponseType.PAYMENT_HANDLER_INSECURE_NAVIGATION); + } + + /** * Notify closing the opened payment app window. * * @param webContents The web contents in the opened window.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerCoordinator.java index cb442cc2..412ce8a2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerCoordinator.java
@@ -26,16 +26,6 @@ */ public class PaymentHandlerCoordinator { private Runnable mHider; - private WebContents mWebContents; - - /** Observer for the dismissal of the payment-handler UI. */ - public interface DismissObserver { - /** - * Called after the user has dismissed the payment-handler UI by swiping it down or tapping - * on the scrim behind the UI. - */ - void onDismissed(); - } /** Constructs the payment-handler component coordinator. */ public PaymentHandlerCoordinator() { @@ -46,37 +36,38 @@ * Shows the payment-handler UI. * * @param chromeActivity The activity where the UI should be shown. - * @param dismissObserver The observer to be notified when the user has dismissed the UI. * @param url The url of the payment handler app, i.e., that of * "PaymentRequestEvent.openWindow(url)". * @param isIncognito Whether the tab is in incognito mode. * @return Whether the payment-handler UI was shown. Can be false if the UI was suppressed. */ - public boolean show(ChromeActivity activity, DismissObserver dismissObserver, URI url, - boolean isIncognito) { + public boolean show(ChromeActivity activity, URI url, boolean isIncognito) { assert mHider == null : "Already showing payment-handler UI"; - PropertyModel model = new PropertyModel.Builder(PaymentHandlerProperties.ALL_KEYS).build(); - PaymentHandlerMediator mediator = - new PaymentHandlerMediator(model, this::hide, dismissObserver); - BottomSheetController bottomSheetController = activity.getBottomSheetController(); - bottomSheetController.getBottomSheet().addObserver(mediator); - mWebContents = WebContentsFactory.createWebContents(isIncognito, /*initiallyHidden=*/false); - ContentView webContentView = ContentView.createContentView(activity, mWebContents); - mWebContents.initialize(ChromeVersionInfo.getProductVersion(), + WebContents webContents = + WebContentsFactory.createWebContents(isIncognito, /*initiallyHidden=*/false); + ContentView webContentView = ContentView.createContentView(activity, webContents); + webContents.initialize(ChromeVersionInfo.getProductVersion(), ViewAndroidDelegate.createBasicDelegate(webContentView), webContentView, activity.getWindowAndroid(), WebContents.createDefaultInternalsHolder()); - mWebContents.getNavigationController().loadUrl(new LoadUrlParams(url.toString())); + webContents.getNavigationController().loadUrl(new LoadUrlParams(url.toString())); + + PropertyModel model = new PropertyModel.Builder(PaymentHandlerProperties.ALL_KEYS).build(); + PaymentHandlerMediator mediator = + new PaymentHandlerMediator(model, this::hide, webContents); + BottomSheetController bottomSheetController = activity.getBottomSheetController(); + bottomSheetController.getBottomSheet().addObserver(mediator); + webContents.addObserver(mediator); PaymentHandlerView view = new PaymentHandlerView( - activity, bottomSheetController.getBottomSheet(), mWebContents, webContentView); + activity, bottomSheetController.getBottomSheet(), webContents, webContentView); PropertyModelChangeProcessor changeProcessor = PropertyModelChangeProcessor.create(model, view, PaymentHandlerViewBinder::bind); mHider = () -> { changeProcessor.destroy(); bottomSheetController.getBottomSheet().removeObserver(mediator); bottomSheetController.hideContent(/*content=*/view, /*animate=*/true); - mWebContents.destroy(); + webContents.destroy(); }; boolean result = bottomSheetController.requestShowContent(view, /*animate=*/true); if (result) bottomSheetController.expandSheet();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerMediator.java index 42f2a63..5fd5e35 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerMediator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerMediator.java
@@ -4,34 +4,59 @@ package org.chromium.chrome.browser.payments.handler; -import org.chromium.chrome.browser.payments.handler.PaymentHandlerCoordinator.DismissObserver; +import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChangeReason; +import org.chromium.chrome.browser.payments.ServiceWorkerPaymentAppBridge; +import org.chromium.chrome.browser.payments.SslValidityChecker; +import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet.BottomSheetContent; import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet.SheetState; -import org.chromium.chrome.browser.widget.bottomsheet.EmptyBottomSheetObserver; +import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetObserver; +import org.chromium.content_public.browser.WebContents; +import org.chromium.content_public.browser.WebContentsObserver; import org.chromium.ui.modelutil.PropertyModel; /** * PaymentHandler mediator, which is responsible for receiving events from the view and notifies the * backend (the coordinator). */ -/* package */ class PaymentHandlerMediator extends EmptyBottomSheetObserver { +/* package */ class PaymentHandlerMediator + extends WebContentsObserver implements BottomSheetObserver { private final PropertyModel mModel; private final Runnable mHider; - private final DismissObserver mDismissObserver; + /** + * Build a new mediator that handle events from outside the payment handler component. + * @param model The {@link PaymentHandlerProperties} that holds all the view state for the + * payment handler component. + * @param hider The callback to clean up {@link PaymentHandlerCoordinator} when the sheet is + * hidden. + * @param webContents The web-contents that loads the payment app. + */ /* package */ PaymentHandlerMediator( - PropertyModel model, Runnable hider, DismissObserver dismissObserver) { + PropertyModel model, Runnable hider, WebContents webContents) { + super(webContents); mModel = model; mHider = hider; - mDismissObserver = dismissObserver; } - // EmptyBottomSheetObserver: + /** + * Hide the bottom-sheet if weak-ref of web-contents refers to null. + * @return Return true if the sheet is hidden. + */ + private boolean hideSheetIfWebContentsNotExist() { + if (mWebContents != null) return false; + // TODO(maxlg): how to inform the service worker when the web-contents is missing. + mHider.run(); + return true; + } + + // BottomSheetObserver: @Override public void onSheetStateChanged(@SheetState int newState) { + if (hideSheetIfWebContentsNotExist()) return; switch (newState) { case SheetState.HIDDEN: + ServiceWorkerPaymentAppBridge.onClosingPaymentAppWindow(mWebContents.get()); mHider.run(); - mDismissObserver.onDismissed(); break; } } @@ -40,4 +65,50 @@ public void onSheetOffsetChanged(float heightFraction, float offsetPx) { mModel.set(PaymentHandlerProperties.BOTTOM_SHEET_HEIGHT_FRACTION, heightFraction); } + + @Override + public void onSheetOpened(@StateChangeReason int reason) {} + + @Override + public void onSheetClosed(@StateChangeReason int reason) { + // This is invoked when the sheet returns to the peek state, but Payment Handler doesn't + // have a peek state. + } + + @Override + public void onLoadUrl(String url) {} + + @Override + public void onSheetFullyPeeked() {} + + @Override + public void onSheetContentChanged(BottomSheetContent newContent) {} + + // WebContentsObserver: + @Override + public void didFinishLoad(long frameId, String validatedUrl, boolean isMainFrame) { + if (hideSheetIfWebContentsNotExist()) return; + if (!SslValidityChecker.isValidPageInPaymentHandlerWindow(mWebContents.get())) { + ServiceWorkerPaymentAppBridge.onClosingPaymentAppWindowForInsecureNavigation( + mWebContents.get()); + mHider.run(); + } + } + + @Override + public void didAttachInterstitialPage() { + if (hideSheetIfWebContentsNotExist()) return; + ServiceWorkerPaymentAppBridge.onClosingPaymentAppWindowForInsecureNavigation( + mWebContents.get()); + mHider.run(); + } + + @Override + public void didFailLoad( + boolean isMainFrame, int errorCode, String description, String failingUrl) { + if (hideSheetIfWebContentsNotExist()) return; + // TODO(crbug.com/1017926): Respond to service worker with the net error. + ServiceWorkerPaymentAppBridge.onClosingPaymentAppWindow(mWebContents.get()); + mHider.run(); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/HomepagePreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/HomepagePreferences.java index 4c24b4a2..9394a05 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/HomepagePreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/HomepagePreferences.java
@@ -10,8 +10,8 @@ import org.chromium.base.VisibleForTesting; import org.chromium.chrome.R; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.partnercustomizations.HomepageManager; -import org.chromium.chrome.browser.util.FeatureUtilities; /** * Fragment that allows the user to configure homepage related preferences.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java index 374daeb..606d193 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
@@ -17,6 +17,7 @@ import org.chromium.base.VisibleForTesting; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeFeatureList; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; import org.chromium.chrome.browser.night_mode.NightModeUtils; import org.chromium.chrome.browser.offlinepages.prefetch.PrefetchConfiguration; @@ -31,7 +32,6 @@ import org.chromium.chrome.browser.signin.IdentityServicesProvider; import org.chromium.chrome.browser.signin.SigninManager; import org.chromium.chrome.browser.sync.ProfileSyncService; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.components.search_engines.TemplateUrl; import org.chromium.components.search_engines.TemplateUrlService;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sharing/click_to_call/ClickToCallMessageHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/sharing/click_to_call/ClickToCallMessageHandler.java index e7d495b5..94c43bb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/sharing/click_to_call/ClickToCallMessageHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/sharing/click_to_call/ClickToCallMessageHandler.java
@@ -19,11 +19,11 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.chrome.R; import org.chromium.chrome.browser.DeviceConditions; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.notifications.NotificationConstants; import org.chromium.chrome.browser.notifications.NotificationUmaTracker; import org.chromium.chrome.browser.notifications.PendingIntentProvider; import org.chromium.chrome.browser.sharing.SharingNotificationUtil; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.IntentUtils; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java index 24aa5a0..24e51715 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java
@@ -24,12 +24,12 @@ import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior.OverviewModeObserver; import org.chromium.chrome.browser.device.DeviceClassManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.tabmodel.EmptyTabModelSelectorObserver; import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver; import org.chromium.chrome.browser.ui.ImmersiveModeManager; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.vr.VrModeObserver; import org.chromium.chrome.browser.vr.VrModuleProvider; import org.chromium.ui.UiUtils;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelFilterProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelFilterProvider.java index a826bf9..cb5aa79 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelFilterProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelFilterProvider.java
@@ -4,9 +4,9 @@ package org.chromium.chrome.browser.tabmodel; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.tasks.tab_management.TabManagementDelegate; import org.chromium.chrome.browser.tasks.tab_management.TabManagementModuleProvider; -import org.chromium.chrome.browser.util.FeatureUtilities; import java.util.ArrayList; import java.util.Collections; @@ -59,8 +59,9 @@ */ public TabModelFilter getTabModelFilter(boolean isIncognito) { for (int i = 0; i < mTabModelFilterList.size(); i++) { - if (mTabModelFilterList.get(i).isIncognito() == isIncognito) + if (mTabModelFilterList.get(i).isIncognito() == isIncognito) { return mTabModelFilterList.get(i); + } } return null; } @@ -72,8 +73,9 @@ */ public TabModelFilter getCurrentTabModelFilter() { for (int i = 0; i < mTabModelFilterList.size(); i++) { - if (mTabModelFilterList.get(i).isCurrentlySelectedFilter()) + if (mTabModelFilterList.get(i).isCurrentlySelectedFilter()) { return mTabModelFilterList.get(i); + } } return null; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java index c099316..1596c78 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java
@@ -8,13 +8,13 @@ import org.chromium.base.TraceEvent; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.ntp.RecentlyClosedBridge; import org.chromium.chrome.browser.partnercustomizations.HomepageManager; import org.chromium.chrome.browser.tab.InterceptNavigationDelegateImpl; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabState; import org.chromium.chrome.browser.tabmodel.TabCreatorManager.TabCreator; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.MathUtils; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.WebContents;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManager.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManager.java index b22a3d98..c8f07c14 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManager.java
@@ -14,8 +14,8 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.VisibleForTesting; import org.chromium.base.annotations.VerifiesOnN; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.base.WindowAndroid; import java.util.ArrayList;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabbedModeTabPersistencePolicy.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabbedModeTabPersistencePolicy.java index e238fe5d..bf8c0e77 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabbedModeTabPersistencePolicy.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabbedModeTabPersistencePolicy.java
@@ -23,8 +23,8 @@ import org.chromium.base.task.BackgroundOnlyAsyncTask; import org.chromium.base.task.TaskRunner; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.tab.TabState; -import org.chromium.chrome.browser.util.FeatureUtilities; import java.io.BufferedInputStream; import java.io.DataInputStream;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeExperimentsUtil.java b/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeExperimentsUtil.java index 119b01d8..c2d36567 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeExperimentsUtil.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeExperimentsUtil.java
@@ -11,10 +11,10 @@ import org.chromium.base.metrics.RecordUserAction; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeFeatureList; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.locale.LocaleManager; import org.chromium.chrome.browser.tabmodel.TabLaunchType; import org.chromium.chrome.browser.tabmodel.TabModel; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.ui.base.PageTransition;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/AppThemeColorProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/AppThemeColorProvider.java index 5a5fabc..a0326839 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/AppThemeColorProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/AppThemeColorProvider.java
@@ -12,9 +12,9 @@ import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior.OverviewModeObserver; import org.chromium.chrome.browser.device.DeviceClassManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.toolbar.IncognitoStateProvider.IncognitoStateObserver; import org.chromium.chrome.browser.ui.styles.ChromeColors; -import org.chromium.chrome.browser.util.FeatureUtilities; /** A ThemeColorProvider for the app theme (incognito or standard theming). */ public class AppThemeColorProvider extends ThemeColorProvider implements IncognitoStateObserver {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/HomeButton.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/HomeButton.java index 2ebfd33..7e21cb8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/HomeButton.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/HomeButton.java
@@ -23,10 +23,10 @@ import org.chromium.chrome.browser.ActivityTabProvider.ActivityTabTabObserver; import org.chromium.chrome.browser.ThemeColorProvider; import org.chromium.chrome.browser.ThemeColorProvider.TintObserver; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.ntp.NewTabPage; import org.chromium.chrome.browser.partnercustomizations.HomepageManager; import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.widget.ChromeImageButton; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/MenuButton.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/MenuButton.java index ff879f5..b53f775 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/MenuButton.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/MenuButton.java
@@ -26,11 +26,11 @@ import org.chromium.chrome.browser.ThemeColorProvider; import org.chromium.chrome.browser.ThemeColorProvider.TintObserver; import org.chromium.chrome.browser.appmenu.AppMenuButtonHelper; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper; import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper.MenuButtonState; import org.chromium.chrome.browser.ui.widget.animation.Interpolators; import org.chromium.chrome.browser.ui.widget.highlight.PulseDrawable; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.interpolators.BakedBezierInterpolator; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/NewTabButton.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/NewTabButton.java index 98d401531..e744d22 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/NewTabButton.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/NewTabButton.java
@@ -17,8 +17,8 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.device.DeviceClassManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.toolbar.IncognitoStateProvider.IncognitoStateObserver; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.base.DeviceFormFactor; import org.chromium.ui.widget.ChromeImageButton; import org.chromium.ui.widget.Toast;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/TabSwitcherButtonView.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/TabSwitcherButtonView.java index 817f67c..1b43405 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/TabSwitcherButtonView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/TabSwitcherButtonView.java
@@ -13,7 +13,7 @@ import android.widget.TextView; import org.chromium.chrome.R; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; /** * The Button used for switching tabs. Currently this class is only being used for the bottom
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarButtonInProductHelpController.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarButtonInProductHelpController.java index 23276f5..b57556c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarButtonInProductHelpController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarButtonInProductHelpController.java
@@ -18,13 +18,13 @@ import org.chromium.chrome.browser.appmenu.AppMenuHandler; import org.chromium.chrome.browser.datareduction.DataReductionSavingsMilestonePromo; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.lifecycle.Destroyable; import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.ui.widget.highlight.ViewHighlighter; import org.chromium.chrome.browser.ui.widget.textbubble.TextBubble; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.components.feature_engagement.EventConstants; import org.chromium.components.feature_engagement.FeatureConstants; import org.chromium.components.feature_engagement.Tracker;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java index e266650..95bdd6c0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java
@@ -56,6 +56,7 @@ import org.chromium.chrome.browser.feature_engagement.TrackerFactory; import org.chromium.chrome.browser.findinpage.FindToolbarManager; import org.chromium.chrome.browser.findinpage.FindToolbarObserver; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.fullscreen.BrowserStateBrowserControlsVisibilityDelegate; import org.chromium.chrome.browser.fullscreen.FullscreenOptions; import org.chromium.chrome.browser.metrics.OmniboxStartupMetrics; @@ -104,7 +105,6 @@ import org.chromium.chrome.browser.ui.styles.ChromeColors; import org.chromium.chrome.browser.ui.widget.highlight.ViewHighlighter; import org.chromium.chrome.browser.ui.widget.textbubble.TextBubble; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.MathUtils; import org.chromium.chrome.browser.util.UrlConstants; import org.chromium.chrome.browser.widget.ScrimView;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsCoordinator.java index 0d3bc64..6f57422 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsCoordinator.java
@@ -19,6 +19,7 @@ import org.chromium.chrome.browser.compositor.layouts.LayoutManager; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.compositor.layouts.ToolbarSwipeLayout; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.tasks.tab_management.TabGroupUi; import org.chromium.chrome.browser.tasks.tab_management.TabManagementModuleProvider; @@ -27,7 +28,6 @@ import org.chromium.chrome.browser.toolbar.TabCountProvider; import org.chromium.chrome.browser.toolbar.bottom.BottomControlsViewBinder.ViewHolder; import org.chromium.chrome.browser.ui.ImmersiveModeManager; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.base.WindowAndroid; import org.chromium.ui.modelutil.PropertyModel; import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarNewTabButton.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarNewTabButton.java index 57af55f..620e57d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarNewTabButton.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarNewTabButton.java
@@ -22,10 +22,10 @@ import org.chromium.chrome.browser.ThemeColorProvider; import org.chromium.chrome.browser.ThemeColorProvider.ThemeColorObserver; import org.chromium.chrome.browser.ThemeColorProvider.TintObserver; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.toolbar.IncognitoStateProvider; import org.chromium.chrome.browser.toolbar.IncognitoStateProvider.IncognitoStateObserver; import org.chromium.chrome.browser.toolbar.ToolbarColors; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.widget.ChromeImageButton; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/SearchAccelerator.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/SearchAccelerator.java index 958a1421..5cabd8a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/SearchAccelerator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/SearchAccelerator.java
@@ -19,10 +19,10 @@ import org.chromium.chrome.browser.ThemeColorProvider; import org.chromium.chrome.browser.ThemeColorProvider.ThemeColorObserver; import org.chromium.chrome.browser.ThemeColorProvider.TintObserver; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.toolbar.IncognitoStateProvider; import org.chromium.chrome.browser.toolbar.IncognitoStateProvider.IncognitoStateObserver; import org.chromium.chrome.browser.toolbar.ToolbarColors; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.widget.ChromeImageButton; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/ShareButton.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/ShareButton.java index 98e0a07f..6e00267 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/ShareButton.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/ShareButton.java
@@ -17,8 +17,8 @@ import org.chromium.chrome.browser.ActivityTabProvider.ActivityTabTabObserver; import org.chromium.chrome.browser.ThemeColorProvider; import org.chromium.chrome.browser.ThemeColorProvider.TintObserver; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.UrlConstants; import org.chromium.ui.widget.ChromeImageButton;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/TabSwitcherBottomToolbarCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/TabSwitcherBottomToolbarCoordinator.java index 923af03..e039aeb7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/TabSwitcherBottomToolbarCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/TabSwitcherBottomToolbarCoordinator.java
@@ -13,10 +13,10 @@ import org.chromium.chrome.browser.ThemeColorProvider; import org.chromium.chrome.browser.appmenu.AppMenuButtonHelper; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.toolbar.IncognitoStateProvider; import org.chromium.chrome.browser.toolbar.MenuButton; import org.chromium.chrome.browser.toolbar.TabCountProvider; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.modelutil.PropertyModelChangeProcessor; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/TabSwitcherModeTTCoordinatorPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/TabSwitcherModeTTCoordinatorPhone.java index ffff238a..3c59e21 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/TabSwitcherModeTTCoordinatorPhone.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/TabSwitcherModeTTCoordinatorPhone.java
@@ -13,11 +13,11 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.appmenu.AppMenuButtonHelper; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.toolbar.IncognitoStateProvider; import org.chromium.chrome.browser.toolbar.TabCountProvider; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.components.search_engines.TemplateUrlService.TemplateUrlServiceObserver; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/TabSwitcherModeTTPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/TabSwitcherModeTTPhone.java index 1d4154e8..2b9b09574 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/TabSwitcherModeTTPhone.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/TabSwitcherModeTTPhone.java
@@ -21,6 +21,7 @@ import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.appmenu.AppMenuButtonHelper; import org.chromium.chrome.browser.device.DeviceClassManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.tab.TabFeatureUtilities; import org.chromium.chrome.browser.tabmodel.TabModel; @@ -34,7 +35,6 @@ import org.chromium.chrome.browser.ui.widget.animation.CancelAwareAnimatorListener; import org.chromium.chrome.browser.ui.widget.animation.Interpolators; import org.chromium.chrome.browser.util.ColorUtils; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.ui.UiUtils; import org.chromium.ui.widget.OptimizedFrameLayout;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java index be45fe9c..0128e35 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java
@@ -54,6 +54,7 @@ import org.chromium.chrome.browser.compositor.layouts.LayoutUpdateHost; import org.chromium.chrome.browser.device.DeviceClassManager; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.ntp.NewTabPage; import org.chromium.chrome.browser.omnibox.LocationBar; import org.chromium.chrome.browser.omnibox.LocationBarPhone; @@ -73,7 +74,6 @@ import org.chromium.chrome.browser.ui.widget.animation.CancelAwareAnimatorListener; import org.chromium.chrome.browser.ui.widget.animation.Interpolators; import org.chromium.chrome.browser.util.ColorUtils; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.util.MathUtils; import org.chromium.chrome.browser.util.ViewUtils; import org.chromium.components.feature_engagement.EventConstants;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java index f1bead52..9c47bbb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java
@@ -21,6 +21,7 @@ import org.chromium.chrome.browser.compositor.layouts.EmptyOverviewModeObserver; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.device.DeviceClassManager; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.lifecycle.Destroyable; import org.chromium.chrome.browser.ntp.NewTabPage; import org.chromium.chrome.browser.tab.Tab; @@ -33,7 +34,6 @@ import org.chromium.chrome.browser.toolbar.top.TopToolbarCoordinator; import org.chromium.chrome.browser.ui.styles.ChromeColors; import org.chromium.chrome.browser.util.ColorUtils; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.widget.ScrimView; import org.chromium.ui.UiUtils;
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 641c3b8c..a28af1661 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
@@ -4,725 +4,23 @@ package org.chromium.chrome.browser.util; -import android.content.Intent; -import android.content.pm.ResolveInfo; -import android.os.Build; -import android.speech.RecognizerIntent; - -import androidx.annotation.Nullable; - -import org.chromium.base.BuildInfo; -import org.chromium.base.CommandLine; -import org.chromium.base.ContextUtils; -import org.chromium.base.FieldTrialList; -import org.chromium.base.PackageManagerUtils; -import org.chromium.base.SysUtils; -import org.chromium.base.ThreadUtils; -import org.chromium.base.VisibleForTesting; -import org.chromium.base.annotations.CalledByNative; -import org.chromium.base.annotations.NativeMethods; -import org.chromium.base.library_loader.LibraryLoader; -import org.chromium.chrome.browser.ChromeFeatureList; -import org.chromium.chrome.browser.ChromeSwitches; -import org.chromium.chrome.browser.device.DeviceClassManager; -import org.chromium.chrome.browser.firstrun.FirstRunUtils; -import org.chromium.chrome.browser.preferences.ChromePreferenceManager; -import org.chromium.chrome.browser.tasks.tab_management.TabManagementModuleProvider; -import org.chromium.ui.base.DeviceFormFactor; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - /** - * A utility {@code class} meant to help determine whether or not certain features are supported by - * this device. - * - * This utility class also contains support for cached feature flags that must take effect on - * startup before native is initialized but are set via native code. The caching is done in - * {@link android.content.SharedPreferences}, which is available in Java immediately. - * - * When adding a new cached flag, it is common practice to use a static Boolean in this file to - * track whether the feature is enabled. A static method that returns the static Boolean can - * then be added to this file allowing client code to query whether the feature is enabled. The - * first time the method is called, the static Boolean should be set to the corresponding shared - * preference. After native is initialized, the shared preference will be updated to reflect the - * native flag value (e.g. the actual experimental feature flag value). - * - * When using a cached flag, the static Boolean should be the source of truth for whether the - * feature is turned on for the current session. As such, always rely on the static Boolean - * when determining whether the corresponding experimental behavior should be enabled. When - * querying whether a cached feature is enabled from native, an @CalledByNative method can be - * exposed in this file to allow feature_utilities.cc to retrieve the cached value. - * - * For cached flags that are queried before native is initialized, when a new experiment - * configuration is received the metrics reporting system will record metrics as if the - * experiment is enabled despite the experimental behavior not yet taking effect. This will be - * remedied on the next process restart, when the static Boolean is reset to the newly cached - * value in shared preferences. + * A bridge class to {@link org.chromium.chrome.browser.flags.FeatureUtilities}. + * TODO(crbug.com/995916): Remove this when all references are gone. */ public class FeatureUtilities { - /** - * Key for whether DownloadResumptionBackgroundTask should load native in service manager only - * mode. - * Default value is false. - */ - private static final String SERVICE_MANAGER_FOR_DOWNLOAD_RESUMPTION_KEY = - "service_manager_for_download_resumption"; - - /** - * Key for whether PrefetchBackgroundTask should load native in service manager only mode. - * Default value is false. - */ - private static final String SERVICE_MANAGER_FOR_BACKGROUND_PREFETCH_KEY = - "service_manager_for_background_prefetch"; - - private static final String INTEREST_FEED_CONTENT_SUGGESTIONS_KEY = - "interest_feed_content_suggestions"; - - /** - * Whether or not the download auto-resumption is enabled in native. - * Default value is true. - */ - private static final String DOWNLOAD_AUTO_RESUMPTION_IN_NATIVE_KEY = - "download_auto_resumption_in_native"; - - /** - * Whether or not the bottom toolbar is enabled. - * Default value is false. - */ - private static final String BOTTOM_TOOLBAR_ENABLED_KEY = "bottom_toolbar_enabled"; - - /** - * Whether or not the adaptive toolbar is enabled. - * Default value is true. - */ - private static final String ADAPTIVE_TOOLBAR_ENABLED_KEY = "adaptive_toolbar_enabled"; - - /** - * Whether or not the labeled bottom toolbar is enabled. - * Default value is false. - */ - private static final String LABELED_BOTTOM_TOOLBAR_ENABLED_KEY = - "labeled_bottom_toolbar_enabled"; - - /** - * Whether or not night mode is available. - * Default value is false. - */ - private static final String NIGHT_MODE_AVAILABLE_KEY = "night_mode_available"; - - /** - * Whether or not night mode should set "light" as the default option. - * Default value is false. - */ - private static final String NIGHT_MODE_DEFAULT_TO_LIGHT = "night_mode_default_to_light"; - - /** - * Whether or not night mode is available for custom tabs. - * Default value is false. - */ - private static final String NIGHT_MODE_CCT_AVAILABLE_KEY = "night_mode_cct_available"; - - /** - * Whether or not command line on non-rooted devices is enabled. - * Default value is false. - */ - private static final String COMMAND_LINE_ON_NON_ROOTED_ENABLED_KEY = - "command_line_on_non_rooted_enabled"; - - /** - * Whether or not the start surface is enabled. - * Default value is false. - */ - private static final String START_SURFACE_ENABLED_KEY = "start_surface_enabled"; - - /** - * Whether or not the grid tab switcher is enabled. - * Default value is false. - */ - private static final String GRID_TAB_SWITCHER_ENABLED_KEY = "grid_tab_switcher_enabled"; - - /** - * Whether or not the tab group is enabled. - * Default value is false. - */ - private static final String TAB_GROUPS_ANDROID_ENABLED_KEY = "tab_group_android_enabled"; - - /** - * Whether or not bootstrap tasks should be prioritized (i.e. bootstrap task prioritization - * experiment is enabled). Default value is true. - */ - private static final String PRIORITIZE_BOOTSTRAP_TASKS_KEY = "prioritize_bootstrap_tasks"; - - /** - * Whether warming up network service is enabled. - * Default value is false. - */ - private static final String NETWORK_SERVICE_WARM_UP_ENABLED_KEY = - "network_service_warm_up_enabled"; - - /** - * Key to cache whether immersive ui mode is enabled. - */ - private static final String IMMERSIVE_UI_MODE_ENABLED = "immersive_ui_mode_enabled"; - - /** - * Key to cache whether - * {@link ChromeFeatureList#SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT} is enabled. - */ - private static final String SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT = - "swap_pixel_format_to_fix_convert_from_translucent"; - - /** - * Whether or not we should directly open the dialer when a click to call notification is - * received. Default value is false. - */ - private static final String CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY = - "click_to_call_open_dialer_directly"; - - private static Map<String, Boolean> sFlags = new HashMap<>(); - private static Boolean sHasRecognitionIntentHandler; - private static String sReachedCodeProfilerTrialGroup; - - /** - * Determines whether or not the {@link RecognizerIntent#ACTION_WEB_SEARCH} {@link Intent} - * is handled by any {@link android.app.Activity}s in the system. The result will be cached for - * future calls. Passing {@code false} to {@code useCachedValue} will force it to re-query any - * {@link android.app.Activity}s that can process the {@link Intent}. - * @param useCachedValue Whether or not to use the cached value from a previous result. - * @return {@code true} if recognition is supported. {@code false} otherwise. - */ - public static boolean isRecognitionIntentPresent(boolean useCachedValue) { - ThreadUtils.assertOnUiThread(); - if (sHasRecognitionIntentHandler == null || !useCachedValue) { - List<ResolveInfo> activities = PackageManagerUtils.queryIntentActivities( - new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); - sHasRecognitionIntentHandler = !activities.isEmpty(); - } - - return sHasRecognitionIntentHandler; - } - - /** - * Records the current custom tab visibility state with native-side feature utilities. - * @param visible Whether a custom tab is visible. - */ - public static void setCustomTabVisible(boolean visible) { - FeatureUtilitiesJni.get().setCustomTabVisible(visible); - } - - /** - * Records whether the activity is in multi-window mode with native-side feature utilities. - * @param isInMultiWindowMode Whether the activity is in Android N multi-window mode. - */ - public static void setIsInMultiWindowMode(boolean isInMultiWindowMode) { - FeatureUtilitiesJni.get().setIsInMultiWindowMode(isInMultiWindowMode); - } - - /** - * Caches flags that must take effect on startup but are set via native code. - */ - public static void cacheNativeFlags() { - cacheCommandLineOnNonRootedEnabled(); - FirstRunUtils.cacheFirstRunPrefs(); - cacheBottomToolbarEnabled(); - cacheAdaptiveToolbarEnabled(); - cacheLabeledBottomToolbarEnabled(); - cacheNightModeAvailable(); - cacheNightModeDefaultToLight(); - cacheNightModeForCustomTabsAvailable(); - cacheDownloadAutoResumptionEnabledInNative(); - cachePrioritizeBootstrapTasks(); - cacheFeedEnabled(); - cacheNetworkServiceWarmUpEnabled(); - cacheImmersiveUiModeEnabled(); - cacheSwapPixelFormatToFixConvertFromTranslucentEnabled(); - cacheReachedCodeProfilerTrialGroup(); - cacheStartSurfaceEnabled(); - cacheClickToCallOpenDialerDirectlyEnabled(); - - if (isHighEndPhone()) cacheGridTabSwitcherEnabled(); - if (isHighEndPhone()) cacheTabGroupsAndroidEnabled(); - - // Propagate REACHED_CODE_PROFILER feature value to LibraryLoader. This can't be done in - // LibraryLoader itself because it lives in //base and can't depend on ChromeFeatureList. - LibraryLoader.setReachedCodeProfilerEnabledOnNextRuns( - ChromeFeatureList.isEnabled(ChromeFeatureList.REACHED_CODE_PROFILER)); - } - - /** - * Caches flags that are enabled in ServiceManager only mode and must take effect on startup but - * are set via native code. This function needs to be called in ServiceManager only mode to mark - * these field trials as active, otherwise histogram data recorded in ServiceManager only mode - * won't be tagged with their corresponding field trial experiments. - */ - public static void cacheNativeFlagsForServiceManagerOnlyMode() { - // TODO(crbug.com/995355): Move other related flags from {@link cacheNativeFlags} to here. - cacheServiceManagerForDownloadResumption(); - cacheServiceManagerForBackgroundPrefetch(); - } - - /** - * @return True if tab model merging for Android N+ is enabled. - */ - public static boolean isTabModelMergingEnabled() { - if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_TAB_MERGING_FOR_TESTING)) { - return false; - } - return Build.VERSION.SDK_INT > Build.VERSION_CODES.M; - } - - private static void cacheServiceManagerForDownloadResumption() { - cacheFlag(SERVICE_MANAGER_FOR_DOWNLOAD_RESUMPTION_KEY, - ChromeFeatureList.SERVICE_MANAGER_FOR_DOWNLOAD); - } - - /** - * @return if DownloadResumptionBackgroundTask should load native in service manager only mode. - */ - public static boolean isServiceManagerForDownloadResumptionEnabled() { - return isFlagEnabled(SERVICE_MANAGER_FOR_DOWNLOAD_RESUMPTION_KEY, false); - } - - public static void cacheServiceManagerForBackgroundPrefetch() { - cacheFlag(SERVICE_MANAGER_FOR_BACKGROUND_PREFETCH_KEY, - ChromeFeatureList.SERVICE_MANAGER_FOR_BACKGROUND_PREFETCH); - } - - /** - * @return if PrefetchBackgroundTask should load native in service manager only mode. - */ - public static boolean isServiceManagerForBackgroundPrefetchEnabled() { - return isFlagEnabled(SERVICE_MANAGER_FOR_BACKGROUND_PREFETCH_KEY, false) && isFeedEnabled(); - } - - /** - * Cache the value of the flag whether or not to use Feed so it can be checked in Java before - * native is loaded. - */ - public static void cacheFeedEnabled() { - cacheFlag(INTEREST_FEED_CONTENT_SUGGESTIONS_KEY, - ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS); - } - - /** - * @return Whether or not the Feed is enabled (based on the cached value in SharedPrefs). - */ - public static boolean isFeedEnabled() { - return isFlagEnabled(INTEREST_FEED_CONTENT_SUGGESTIONS_KEY, false); - } - - /** - * @return Whether or not the download auto-resumptions should be enabled in native. - */ - @CalledByNative - public static boolean isDownloadAutoResumptionEnabledInNative() { - return isFlagEnabled(DOWNLOAD_AUTO_RESUMPTION_IN_NATIVE_KEY, true); - } - - /** - * Cache whether or not the bottom toolbar is enabled so on next startup, the value can - * be made available immediately. - */ - public static void cacheBottomToolbarEnabled() { - cacheFlag(BOTTOM_TOOLBAR_ENABLED_KEY, ChromeFeatureList.CHROME_DUET); - } - - /** - * Cache whether or not the adaptive toolbar is enabled so on next startup, the value can - * be made available immediately. - */ - public static void cacheAdaptiveToolbarEnabled() { - cacheFlag(ADAPTIVE_TOOLBAR_ENABLED_KEY, ChromeFeatureList.CHROME_DUET_ADAPTIVE); - } - - /** - * Cache whether or not the labeled bottom toolbar is enabled so on next startup, the value can - * be made available immediately. - */ - public static void cacheLabeledBottomToolbarEnabled() { - cacheFlag(LABELED_BOTTOM_TOOLBAR_ENABLED_KEY, ChromeFeatureList.CHROME_DUET_LABELED); - } - - /** - * Cache whether or not download auto-resumptions are enabled in native so on next startup, the - * value can be made available immediately. - */ - private static void cacheDownloadAutoResumptionEnabledInNative() { - cacheFlag(DOWNLOAD_AUTO_RESUMPTION_IN_NATIVE_KEY, - ChromeFeatureList.DOWNLOADS_AUTO_RESUMPTION_NATIVE); - } - - @VisibleForTesting - public static void setDownloadAutoResumptionEnabledInNativeForTesting(Boolean value) { - sFlags.put(DOWNLOAD_AUTO_RESUMPTION_IN_NATIVE_KEY, value); - } /** * @return Whether or not the bottom toolbar is enabled. */ public static boolean isBottomToolbarEnabled() { - // TODO(crbug.com/944228): TabGroupsAndroid and ChromeDuet are incompatible for now. - return isFlagEnabled(BOTTOM_TOOLBAR_ENABLED_KEY, false) - && !DeviceFormFactor.isNonMultiDisplayContextOnTablet( - ContextUtils.getApplicationContext()) - && !isTabGroupsAndroidEnabled(); - } - - /** - * Set whether the bottom toolbar is enabled for tests. Reset to null at the end of tests. - */ - @VisibleForTesting - public static void setIsBottomToolbarEnabledForTesting(Boolean enabled) { - sFlags.put(BOTTOM_TOOLBAR_ENABLED_KEY, enabled); - } - - /** - * @return Whether or not the adaptive toolbar is enabled. - */ - public static boolean isAdaptiveToolbarEnabled() { - return isFlagEnabled(ADAPTIVE_TOOLBAR_ENABLED_KEY, true) && isBottomToolbarEnabled() - && !isGridTabSwitcherEnabled(); - } - - /** - * @return Whether or not the labeled bottom toolbar is enabled. - */ - public static boolean isLabeledBottomToolbarEnabled() { - return isFlagEnabled(LABELED_BOTTOM_TOOLBAR_ENABLED_KEY, false) && isBottomToolbarEnabled(); - } - - /** - * Cache whether or not night mode is available (i.e. night mode experiment is enabled) so on - * next startup, the value can be made available immediately. - */ - public static void cacheNightModeAvailable() { - boolean available = ChromeFeatureList.isEnabled(ChromeFeatureList.ANDROID_NIGHT_MODE) - || (BuildInfo.isAtLeastQ() - && ChromeFeatureList.isEnabled(ChromeFeatureList.ANDROID_NIGHT_MODE_FOR_Q)); - ChromePreferenceManager.getInstance().writeBoolean(NIGHT_MODE_AVAILABLE_KEY, available); - } - - /** - * @return Whether or not night mode experiment is enabled (i.e. night mode experiment is - * enabled). - */ - public static boolean isNightModeAvailable() { - return isFlagEnabled(NIGHT_MODE_AVAILABLE_KEY, false); - } - - /** - * Toggles whether the night mode experiment is enabled for testing. Should be reset back to - * null after the test has finished. - */ - @VisibleForTesting - public static void setNightModeAvailableForTesting(@Nullable Boolean available) { - sFlags.put(NIGHT_MODE_AVAILABLE_KEY, available); - } - - /** - * Cache whether or not to default to the light theme when the night mode feature is enabled. - */ - public static void cacheNightModeDefaultToLight() { - // Do not cache on Q (where defaulting to light theme does not apply) or if night mode is - // not enabled. - if (BuildInfo.isAtLeastQ() - || !ChromeFeatureList.isEnabled(ChromeFeatureList.ANDROID_NIGHT_MODE)) { - return; - } - - String lightModeDefaultParam = "default_light_theme"; - boolean lightModeAsDefault = ChromeFeatureList.getFieldTrialParamByFeatureAsBoolean( - ChromeFeatureList.ANDROID_NIGHT_MODE, lightModeDefaultParam, false); - - ChromePreferenceManager.getInstance().writeBoolean( - NIGHT_MODE_DEFAULT_TO_LIGHT, lightModeAsDefault); - } - - /** - * @return Whether or not to default to the light theme when the night mode feature is enabled. - */ - public static boolean isNightModeDefaultToLight() { - if (BuildInfo.isAtLeastQ()) { - return false; - } - return isFlagEnabled(NIGHT_MODE_DEFAULT_TO_LIGHT, false); - } - - /** - * Toggles whether the night mode experiment is enabled for testing. Should be reset back to - * null after the test has finished. - */ - @VisibleForTesting - public static void setNightModeDefaultToLightForTesting(@Nullable Boolean available) { - sFlags.put(NIGHT_MODE_DEFAULT_TO_LIGHT, available); - } - - /** - * Cache whether or not night mode is available for custom tabs (i.e. night mode experiment is - * enabled), so the value is immediately available on next start-up. - */ - public static void cacheNightModeForCustomTabsAvailable() { - cacheFlag(NIGHT_MODE_CCT_AVAILABLE_KEY, ChromeFeatureList.ANDROID_NIGHT_MODE_CCT); - } - - /** - * @return Whether or not night mode experiment is enabled (i.e. night mode experiment is - * enabled) for custom tabs. - */ - public static boolean isNightModeForCustomTabsAvailable() { - return isFlagEnabled(NIGHT_MODE_CCT_AVAILABLE_KEY, true); - } - - /** - * Toggles whether the night mode for custom tabs experiment is enabled. Must only be used for - * testing. Should be reset back to NULL after the test has finished. - */ - public static void setNightModeForCustomTabsAvailableForTesting(Boolean available) { - sFlags.put(NIGHT_MODE_CCT_AVAILABLE_KEY, available); - } - - /** - * Cache whether or not command line is enabled on non-rooted devices. - */ - private static void cacheCommandLineOnNonRootedEnabled() { - cacheFlag(COMMAND_LINE_ON_NON_ROOTED_ENABLED_KEY, - ChromeFeatureList.COMMAND_LINE_ON_NON_ROOTED); - } - - public static boolean isCommandLineOnNonRootedEnabled() { - return isFlagEnabled(COMMAND_LINE_ON_NON_ROOTED_ENABLED_KEY, false); - } - - /** - * @return Whether or not the download progress infobar is enabled. - */ - public static boolean isDownloadProgressInfoBarEnabled() { - return ChromeFeatureList.isEnabled(ChromeFeatureList.DOWNLOAD_PROGRESS_INFOBAR); - } - - private static void cacheStartSurfaceEnabled() { - cacheFlag(START_SURFACE_ENABLED_KEY, ChromeFeatureList.START_SURFACE_ANDROID); - } - - /** - * @return Whether the Start Surface is enabled. - */ - public static boolean isStartSurfaceEnabled() { - return isFlagEnabled(START_SURFACE_ENABLED_KEY, false); - } - - private static void cacheGridTabSwitcherEnabled() { - ChromePreferenceManager.getInstance().writeBoolean(GRID_TAB_SWITCHER_ENABLED_KEY, - !DeviceClassManager.enableAccessibilityLayout() - && ChromeFeatureList.isEnabled(ChromeFeatureList.TAB_GRID_LAYOUT_ANDROID) - && TabManagementModuleProvider.getDelegate() != null); - } - - /** - * @return Whether the Grid Tab Switcher UI is enabled and available for use. - */ - public static boolean isGridTabSwitcherEnabled() { - // TODO(yusufo): AccessibilityLayout check should not be here and the flow should support - // changing that setting while Chrome is alive. - // Having Tab Groups implies Grid Tab Switcher. - return isFlagEnabled(GRID_TAB_SWITCHER_ENABLED_KEY, false) || isTabGroupsAndroidEnabled(); - } - - /** - * Toggles whether the Grid Tab Switcher is enabled for testing. Should be reset back to - * null after the test has finished. - */ - @VisibleForTesting - public static void setGridTabSwitcherEnabledForTesting(@Nullable Boolean enabled) { - sFlags.put(GRID_TAB_SWITCHER_ENABLED_KEY, enabled); - } - - private static void cacheTabGroupsAndroidEnabled() { - ChromePreferenceManager.getInstance().writeBoolean(TAB_GROUPS_ANDROID_ENABLED_KEY, - !DeviceClassManager.enableAccessibilityLayout() - && ChromeFeatureList.isEnabled(ChromeFeatureList.TAB_GROUPS_ANDROID) - && TabManagementModuleProvider.getDelegate() != null && isHighEndPhone()); - } - - /** - * @return Whether the tab group feature is enabled and available for use. - */ - public static boolean isTabGroupsAndroidEnabled() { - return isFlagEnabled(TAB_GROUPS_ANDROID_ENABLED_KEY, false); - } - - /** - * Toggles whether the Tab Group is enabled for testing. Should be reset back to null after the - * test has finished. - */ - @VisibleForTesting - public static void setTabGroupsAndroidEnabledForTesting(@Nullable Boolean available) { - sFlags.put(TAB_GROUPS_ANDROID_ENABLED_KEY, available); - } - - /** - * Toggles whether the StartSurface is enabled for testing. Should be reset back to null after - * the test has finished. - */ - @VisibleForTesting - public static void setStartSurfaceEnabledForTesting(@Nullable Boolean isEnabled) { - sFlags.put(START_SURFACE_ENABLED_KEY, isEnabled); - } - - private static boolean isHighEndPhone() { - return !SysUtils.isLowEndDevice() - && !DeviceFormFactor.isNonMultiDisplayContextOnTablet( - ContextUtils.getApplicationContext()); - } - - /** - * @return Whether the tab group ui improvement feature is enabled and available for use. - */ - public static boolean isTabGroupsAndroidUiImprovementsEnabled() { - return isTabGroupsAndroidEnabled() - && ChromeFeatureList.isEnabled( - ChromeFeatureList.TAB_GROUPS_UI_IMPROVEMENTS_ANDROID); - } - - /** - * @return Whether this device is running Android Go. This is assumed when we're running Android - * O or later and we're on a low-end device. - */ - public static boolean isAndroidGo() { - return SysUtils.isLowEndDevice() - && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O; - } - - /** - * Cache whether or not bootstrap tasks should be prioritized so on next startup, the value - * can be made available immediately. - */ - public static void cachePrioritizeBootstrapTasks() { - cacheFlag(PRIORITIZE_BOOTSTRAP_TASKS_KEY, ChromeFeatureList.PRIORITIZE_BOOTSTRAP_TASKS); - } - - /** - * @return Whether or not bootstrap tasks should be prioritized (i.e. bootstrap task - * prioritization experiment is enabled). - */ - public static boolean shouldPrioritizeBootstrapTasks() { - return isFlagEnabled(PRIORITIZE_BOOTSTRAP_TASKS_KEY, true); - } - - /** - * Cache whether warming up network service process is enabled, so that the value - * can be made available immediately on next start up. - */ - private static void cacheNetworkServiceWarmUpEnabled() { - ChromePreferenceManager.getInstance().writeBoolean(NETWORK_SERVICE_WARM_UP_ENABLED_KEY, - FeatureUtilitiesJni.get().isNetworkServiceWarmUpEnabled()); - } - - /** - * @return whether warming up network service is enabled. - */ - public static boolean isNetworkServiceWarmUpEnabled() { - return isFlagEnabled(NETWORK_SERVICE_WARM_UP_ENABLED_KEY, false); - } - - private static void cacheImmersiveUiModeEnabled() { - cacheFlag(IMMERSIVE_UI_MODE_ENABLED, ChromeFeatureList.IMMERSIVE_UI_MODE); + return org.chromium.chrome.browser.flags.FeatureUtilities.isBottomToolbarEnabled(); } /** * @return Whether immersive ui mode is enabled. */ public static boolean isImmersiveUiModeEnabled() { - return isFlagEnabled(IMMERSIVE_UI_MODE_ENABLED, false); - } - - /** - * Returns whether to use {@link Window#setFormat()} to undo opacity change caused by - * {@link Activity#convertFromTranslucent()}. - */ - public static boolean isSwapPixelFormatToFixConvertFromTranslucentEnabled() { - return ChromePreferenceManager.getInstance().readBoolean( - SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT, true); - } - - public static void cacheSwapPixelFormatToFixConvertFromTranslucentEnabled() { - cacheFlag(SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT, - ChromeFeatureList.SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT); - } - - /** - * Cache the value of the flag whether or not to directly open the dialer for click to call. - */ - public static void cacheClickToCallOpenDialerDirectlyEnabled() { - cacheFlag(CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY, - ChromeFeatureList.CLICK_TO_CALL_OPEN_DIALER_DIRECTLY); - } - - /** - * @return Whether or not we should directly open dialer for click to call (based on the cached - * value in SharedPrefs). - */ - public static boolean isClickToCallOpenDialerDirectlyEnabled() { - return isFlagEnabled(CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY, false); - } - - /** - * Toggles whether experiment for opening dialer directly in click to call is enabled for - * testing. Should be reset back to null after the test has finished. - */ - @VisibleForTesting - public static void setIsClickToCallOpenDialerDirectlyEnabledForTesting( - @Nullable Boolean isEnabled) { - sFlags.put(CLICK_TO_CALL_OPEN_DIALER_DIRECTLY_KEY, isEnabled); - } - - /** - * Caches the trial group of the reached code profiler feature to be using on next startup. - */ - private static void cacheReachedCodeProfilerTrialGroup() { - // Make sure that the existing value is saved in a static variable before overwriting it. - if (sReachedCodeProfilerTrialGroup == null) { - getReachedCodeProfilerTrialGroup(); - } - - ChromePreferenceManager.getInstance().writeString( - ChromePreferenceManager.REACHED_CODE_PROFILER_GROUP_KEY, - FieldTrialList.findFullName(ChromeFeatureList.REACHED_CODE_PROFILER)); - } - - /** - * @return The trial group of the reached code profiler. - */ - @CalledByNative - public static String getReachedCodeProfilerTrialGroup() { - if (sReachedCodeProfilerTrialGroup == null) { - sReachedCodeProfilerTrialGroup = ChromePreferenceManager.getInstance().readString( - ChromePreferenceManager.REACHED_CODE_PROFILER_GROUP_KEY, ""); - } - - return sReachedCodeProfilerTrialGroup; - } - - private static void cacheFlag(String preferenceName, String featureName) { - ChromePreferenceManager.getInstance().writeBoolean( - preferenceName, ChromeFeatureList.isEnabled(featureName)); - } - - private static boolean isFlagEnabled(String preferenceName, boolean defaultValue) { - Boolean flag = sFlags.get(preferenceName); - if (flag == null) { - flag = ChromePreferenceManager.getInstance().readBoolean(preferenceName, defaultValue); - sFlags.put(preferenceName, flag); - } - return flag; - } - - @NativeMethods - interface Natives { - void setCustomTabVisible(boolean visible); - void setIsInMultiWindowMode(boolean isInMultiWindowMode); - boolean isNetworkServiceWarmUpEnabled(); + return org.chromium.chrome.browser.flags.FeatureUtilities.isImmersiveUiModeEnabled(); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/SplashController.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/SplashController.java index 7b4d4b5a..1ca7009 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/SplashController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/SplashController.java
@@ -23,13 +23,13 @@ import org.chromium.base.metrics.CachedMetrics; import org.chromium.chrome.R; import org.chromium.chrome.browser.compositor.CompositorView; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.lifecycle.Destroyable; import org.chromium.chrome.browser.lifecycle.InflationObserver; import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabObserverRegistrar; -import org.chromium.chrome.browser.util.FeatureUtilities; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webauth/AuthenticatorImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/webauth/AuthenticatorImpl.java index 05fdc5f..2c63e671 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webauth/AuthenticatorImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webauth/AuthenticatorImpl.java
@@ -32,6 +32,7 @@ private static final String GMSCORE_PACKAGE_NAME = "com.google.android.gms"; private static final int GMSCORE_MIN_VERSION = 12800000; + private static final int GMSCORE_MIN_VERSION_ISUVPAA = 16200000; /** Ensures only one request is processed at a time. */ private boolean mIsOperationPending; @@ -97,18 +98,32 @@ public void isUserVerifyingPlatformAuthenticatorAvailable( IsUserVerifyingPlatformAuthenticatorAvailableResponse callback) { Context context = ChromeActivity.fromWebContents(mWebContents); - if (context == null - || PackageUtils.getPackageVersion(context, GMSCORE_PACKAGE_NAME) - < GMSCORE_MIN_VERSION - || Build.VERSION.SDK_INT < Build.VERSION_CODES.N - || !ChromeFeatureList.isEnabled(ChromeFeatureList.WEB_AUTH)) { + // ChromeActivity could be null. + if (context == null) { callback.call(false); return; } - FingerprintManager fingerprintManager = - (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE); - callback.call(fingerprintManager != null && fingerprintManager.hasEnrolledFingerprints()); + if (!ChromeFeatureList.isEnabled(ChromeFeatureList.WEB_AUTH)) { + callback.call(false); + return; + } + + if (PackageUtils.getPackageVersion(context, GMSCORE_PACKAGE_NAME) + >= GMSCORE_MIN_VERSION_ISUVPAA) { + mIsUserVerifyingPlatformAuthenticatorAvailableCallback = callback; + Fido2ApiHandler.getInstance().isUserVerifyingPlatformAuthenticatorAvailable( + mRenderFrameHost, this); + } else if (PackageUtils.getPackageVersion(context, GMSCORE_PACKAGE_NAME) + >= GMSCORE_MIN_VERSION + && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + FingerprintManager fingerprintManager = + (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE); + callback.call( + fingerprintManager != null && fingerprintManager.hasEnrolledFingerprints()); + } else { + callback.call(false); + } } @Override @@ -135,6 +150,13 @@ } @Override + public void onIsUserVerifyingPlatformAuthenticatorAvailableResponse(boolean isUVPAA) { + assert mIsUserVerifyingPlatformAuthenticatorAvailableCallback != null; + mIsUserVerifyingPlatformAuthenticatorAvailableCallback.call(isUVPAA); + mIsUserVerifyingPlatformAuthenticatorAvailableCallback = null; + } + + @Override public void onError(Integer status) { assert ((mMakeCredentialCallback != null && mGetAssertionCallback == null) || (mMakeCredentialCallback == null && mGetAssertionCallback != null));
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkReorderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkReorderTest.java index 0ce87a2..d75430a 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkReorderTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkReorderTest.java
@@ -36,7 +36,6 @@ import org.chromium.chrome.browser.ui.widget.ListMenuButton; import org.chromium.chrome.browser.widget.selection.SelectableListToolbar.ViewType; import org.chromium.chrome.test.ChromeJUnit4RunnerDelegate; -import org.chromium.chrome.test.util.BookmarkTestUtil; import org.chromium.chrome.test.util.browser.Features; import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils; import org.chromium.components.bookmarks.BookmarkId; @@ -720,6 +719,7 @@ // Show in folder. onView(withText("Show in folder")).perform(click()); + RecyclerViewTestUtils.waitForStableRecyclerView(mItemsContainer); // Make sure that we're in the right folder (index 1 because of promo). View itemA = mItemsContainer.findViewHolderForAdapterPosition(1).itemView; @@ -749,6 +749,9 @@ public void testAddBookmarkInBackgroundWithSelection() throws Exception { BookmarkId id = addBookmark(TEST_PAGE_TITLE_FOO, mTestPageFoo); BookmarkPromoHeader.forcePromoStateForTests(PromoState.PROMO_NONE); + // Force empty partner bookmark folder to keep set of bookmark items consistent across + // devices. + loadEmptyPartnerBookmarksForTesting(); openBookmarkManager(); Assert.assertEquals(1, getAdapter().getItemCount()); BookmarkRow row = @@ -786,6 +789,9 @@ BookmarkId googleId = addBookmark(TEST_PAGE_TITLE_GOOGLE, mTestPage); BookmarkId aId = addBookmark(TEST_TITLE_A, TEST_URL_A); BookmarkPromoHeader.forcePromoStateForTests(PromoState.PROMO_NONE); + // Force empty partner bookmark folder to keep set of bookmark items consistent across + // devices. + loadEmptyPartnerBookmarksForTesting(); openBookmarkManager(); Assert.assertEquals(3, getAdapter().getItemCount()); BookmarkRow row = @@ -816,6 +822,9 @@ BookmarkId googleId = addBookmark(TEST_PAGE_TITLE_GOOGLE, mTestPage); BookmarkId aId = addBookmark(TEST_TITLE_A, TEST_URL_A); BookmarkPromoHeader.forcePromoStateForTests(PromoState.PROMO_NONE); + // Force empty partner bookmark folder to keep set of bookmark items consistent across + // devices. + loadEmptyPartnerBookmarksForTesting(); openBookmarkManager(); Assert.assertEquals(3, getAdapter().getItemCount()); BookmarkRow row = @@ -846,6 +855,9 @@ public void testUpdateSelectedBookmarkInBackground() throws Exception { BookmarkId id = addBookmark(TEST_PAGE_TITLE_FOO, mTestPageFoo); BookmarkPromoHeader.forcePromoStateForTests(PromoState.PROMO_NONE); + // Force empty partner bookmark folder to keep set of bookmark items consistent across + // devices. + loadEmptyPartnerBookmarksForTesting(); openBookmarkManager(); Assert.assertEquals(1, getAdapter().getItemCount()); BookmarkRow row = @@ -882,17 +894,6 @@ } /** - * Loads an empty partner bookmarks folder for testing. The partner bookmarks folder will appear - * in the mobile bookmarks folder. - * - */ - private void loadEmptyPartnerBookmarksForTesting() { - TestThreadUtils.runOnUiThreadBlocking( - () -> { mBookmarkModel.loadEmptyPartnerBookmarkShimForTesting(); }); - BookmarkTestUtil.waitForBookmarkModelLoaded(); - } - - /** * Adds a bookmark in the scenario where we have partner bookmarks. * * @param title The title of the bookmark to add.
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 38f48c4b..04b3e27 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
@@ -130,6 +130,17 @@ BookmarkTestUtil.waitForBookmarkModelLoaded(); } + /** + * Loads an empty partner bookmarks folder for testing. The partner bookmarks folder will appear + * in the mobile bookmarks folder. + * + */ + protected void loadEmptyPartnerBookmarksForTesting() { + TestThreadUtils.runOnUiThreadBlocking( + () -> { mBookmarkModel.loadEmptyPartnerBookmarkShimForTesting(); }); + BookmarkTestUtil.waitForBookmarkModelLoaded(); + } + @After public void tearDown() { mTestServer.stopAndDestroyServer(); @@ -305,6 +316,9 @@ syncDelegate.setMasterSyncAutomatically(true); AndroidSyncSettings.overrideForTests(syncDelegate, null); BookmarkPromoHeader.forcePromoStateForTests(BookmarkPromoHeader.PromoState.PROMO_SYNC); + // Force empty partner bookmark folder to keep set of bookmark items consistent across + // devices. + loadEmptyPartnerBookmarksForTesting(); addBookmark(TEST_PAGE_TITLE_GOOGLE, mTestPage); addBookmark(TEST_PAGE_TITLE_FOO, mTestPageFoo); openBookmarkManager(); @@ -354,6 +368,9 @@ @MediumTest public void testSearchBookmarks_Delete() throws Exception { BookmarkPromoHeader.forcePromoStateForTests(BookmarkPromoHeader.PromoState.PROMO_NONE); + // Force empty partner bookmark folder to keep set of bookmark items consistent across + // devices. + loadEmptyPartnerBookmarksForTesting(); BookmarkId testFolder = addFolder(TEST_FOLDER_TITLE); BookmarkId testBookmark = addBookmark(TEST_PAGE_TITLE_GOOGLE, mTestPage); addBookmark(TEST_PAGE_TITLE_FOO, mTestPageFoo);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java index 9858a6f..d30138e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java
@@ -31,6 +31,7 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeSwitches; +import org.chromium.chrome.browser.compositor.bottombar.ephemeraltab.EphemeralTabPanel; import org.chromium.chrome.browser.compositor.layouts.LayoutManager; import org.chromium.chrome.browser.download.DownloadTestRule; import org.chromium.chrome.browser.download.DownloadTestRule.CustomMainActivityStart; @@ -387,8 +388,7 @@ R.id.contextmenu_copy_link_text, R.id.contextmenu_copy_link_address, R.id.contextmenu_share_link}; Integer[] featureItems = {R.id.contextmenu_open_in_ephemeral_tab}; - expectedItems = - addItemsIfEnabled(ChromeFeatureList.EPHEMERAL_TAB, expectedItems, featureItems); + expectedItems = addItemsIf(EphemeralTabPanel.isSupported(), expectedItems, featureItems); assertMenuItemsAreEqual(menu, expectedItems); } @@ -405,8 +405,7 @@ R.id.contextmenu_open_image_in_new_tab, R.id.contextmenu_search_by_image, R.id.contextmenu_share_image}; Integer[] featureItems = {R.id.contextmenu_open_image_in_ephemeral_tab}; - expectedItems = - addItemsIfEnabled(ChromeFeatureList.EPHEMERAL_TAB, expectedItems, featureItems); + expectedItems = addItemsIf(EphemeralTabPanel.isSupported(), expectedItems, featureItems); assertMenuItemsAreEqual(menu, expectedItems); } @@ -424,8 +423,7 @@ R.id.contextmenu_open_image_in_new_tab, R.id.contextmenu_search_with_google_lens, R.id.contextmenu_share_image}; Integer[] featureItems = {R.id.contextmenu_open_image_in_ephemeral_tab}; - expectedItems = - addItemsIfEnabled(ChromeFeatureList.EPHEMERAL_TAB, expectedItems, featureItems); + expectedItems = addItemsIf(EphemeralTabPanel.isSupported(), expectedItems, featureItems); assertMenuItemsAreEqual(menu, expectedItems); } @@ -443,8 +441,7 @@ Integer[] expectedItems = {R.id.contextmenu_save_image, R.id.contextmenu_open_image_in_new_tab, R.id.contextmenu_share_image}; Integer[] featureItems = {R.id.contextmenu_open_image_in_ephemeral_tab}; - expectedItems = - addItemsIfEnabled(ChromeFeatureList.EPHEMERAL_TAB, expectedItems, featureItems); + expectedItems = addItemsIf(EphemeralTabPanel.isSupported(), expectedItems, featureItems); assertMenuItemsAreEqual(menu, expectedItems); } @@ -464,8 +461,7 @@ Integer[] expectedItems = {R.id.contextmenu_save_image, R.id.contextmenu_open_image_in_new_tab, R.id.contextmenu_share_image}; Integer[] featureItems = {R.id.contextmenu_open_image_in_ephemeral_tab}; - expectedItems = - addItemsIfEnabled(ChromeFeatureList.EPHEMERAL_TAB, expectedItems, featureItems); + expectedItems = addItemsIf(EphemeralTabPanel.isSupported(), expectedItems, featureItems); assertMenuItemsAreEqual(menu, expectedItems); } @@ -484,8 +480,7 @@ R.id.contextmenu_share_image, R.id.contextmenu_share_link}; Integer[] featureItems = {R.id.contextmenu_open_in_ephemeral_tab, R.id.contextmenu_open_image_in_ephemeral_tab}; - expectedItems = - addItemsIfEnabled(ChromeFeatureList.EPHEMERAL_TAB, expectedItems, featureItems); + expectedItems = addItemsIf(EphemeralTabPanel.isSupported(), expectedItems, featureItems); assertMenuItemsAreEqual(menu, expectedItems); } @@ -507,8 +502,7 @@ R.id.contextmenu_share_image, R.id.contextmenu_share_link}; Integer[] featureItems = {R.id.contextmenu_open_in_ephemeral_tab, R.id.contextmenu_open_image_in_ephemeral_tab}; - expectedItems = - addItemsIfEnabled(ChromeFeatureList.EPHEMERAL_TAB, expectedItems, featureItems); + expectedItems = addItemsIf(EphemeralTabPanel.isSupported(), expectedItems, featureItems); assertMenuItemsAreEqual(menu, expectedItems); } @@ -556,17 +550,17 @@ } /** - * Adds items to the give baseItems if the given feature is enabled. - * @param featureName The feature to check for whether to add items or not. + * Adds items to the baseItems if the given condition is true. + * @param condition The condition to check for whether to add items or not. * @param baseItems The base list of items to add to. * @param additionalItems The additional items to add. - * @return An array of items that has the additional items added if the feature is enabled. + * @return An array of items that has the additional items added if the condition is true. */ - private Integer[] addItemsIfEnabled( - String featureName, Integer[] baseItems, Integer[] additionalItems) { - List<Integer> variableItems = new ArrayList<Integer>(); + private Integer[] addItemsIf( + boolean condition, Integer[] baseItems, Integer[] additionalItems) { + List<Integer> variableItems = new ArrayList<>(); variableItems.addAll(Arrays.asList(baseItems)); - if (ChromeFeatureList.isEnabled(featureName)) { + if (condition) { for (int i = 0; i < additionalItems.length; i++) variableItems.add(additionalItems[i]); } return variableItems.toArray(baseItems);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java index ca5d794..fb8a3a2 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
@@ -96,6 +96,7 @@ import org.chromium.chrome.browser.customtabs.content.CustomTabActivityNavigationController.FinishReason; import org.chromium.chrome.browser.document.ChromeLauncherActivity; import org.chromium.chrome.browser.firstrun.FirstRunStatus; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.history.BrowsingHistoryBridge; import org.chromium.chrome.browser.history.HistoryItem; import org.chromium.chrome.browser.history.TestBrowsingHistoryObserver; @@ -113,7 +114,6 @@ import org.chromium.chrome.browser.test.ScreenShooter; import org.chromium.chrome.browser.toolbar.top.CustomTabToolbar; import org.chromium.chrome.browser.util.ColorUtils; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.util.ChromeTabUtils;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/download/ChromeDownloadDelegateTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/download/ChromeDownloadDelegateTest.java index 93d0241..4ff9255f 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/download/ChromeDownloadDelegateTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/download/ChromeDownloadDelegateTest.java
@@ -73,16 +73,4 @@ Assert.assertFalse(delegate.shouldInterceptContextMenuDownload("http://test/test.dd")); Assert.assertTrue(delegate.shouldInterceptContextMenuDownload("https://test/test.dm")); } - - @Test - @SmallTest - @Feature({"Download"}) - public void testGetFileExtension() { - Assert.assertEquals("ext", ChromeDownloadDelegate.getFileExtension("", "file.ext")); - Assert.assertEquals("ext", ChromeDownloadDelegate.getFileExtension("http://file.ext", "")); - Assert.assertEquals( - "txt", ChromeDownloadDelegate.getFileExtension("http://file.ext", "file.txt")); - Assert.assertEquals( - "txt", ChromeDownloadDelegate.getFileExtension("http://file.ext", "file name.txt")); - } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadManagerServiceTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadManagerServiceTest.java index 33a21715..af43623 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadManagerServiceTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadManagerServiceTest.java
@@ -30,7 +30,7 @@ import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.download.DownloadInfo.Builder; import org.chromium.chrome.browser.download.DownloadManagerServiceTest.MockDownloadNotifier.MethodID; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.test.ChromeBrowserTestRule; import org.chromium.components.offline_items_collection.ContentId; import org.chromium.components.offline_items_collection.OfflineItem.Progress;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/download/OMADownloadHandlerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/download/OMADownloadHandlerTest.java index f8ce318..d975c1f 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/download/OMADownloadHandlerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/download/OMADownloadHandlerTest.java
@@ -170,12 +170,12 @@ info.addAttributeValue("type", "text/html"); Assert.assertEquals(info.getDrmType(), null); - info.addAttributeValue("type", OMADownloadHandler.OMA_DRM_MESSAGE_MIME); - Assert.assertEquals(info.getDrmType(), OMADownloadHandler.OMA_DRM_MESSAGE_MIME); + info.addAttributeValue("type", MimeUtils.OMA_DRM_MESSAGE_MIME); + Assert.assertEquals(info.getDrmType(), MimeUtils.OMA_DRM_MESSAGE_MIME); // Test that only the first DRM MIME type is returned. - info.addAttributeValue("type", OMADownloadHandler.OMA_DRM_CONTENT_MIME); - Assert.assertEquals(info.getDrmType(), OMADownloadHandler.OMA_DRM_MESSAGE_MIME); + info.addAttributeValue("type", MimeUtils.OMA_DRM_CONTENT_MIME); + Assert.assertEquals(info.getDrmType(), MimeUtils.OMA_DRM_MESSAGE_MIME); } /** @@ -189,8 +189,7 @@ Assert.assertEquals(OMADownloadHandler.getOpennableType(info), null); info.addAttributeValue(OMADownloadHandler.OMA_TYPE, "application/octet-stream"); - info.addAttributeValue(OMADownloadHandler.OMA_TYPE, - OMADownloadHandler.OMA_DRM_MESSAGE_MIME); + info.addAttributeValue(OMADownloadHandler.OMA_TYPE, MimeUtils.OMA_DRM_MESSAGE_MIME); info.addAttributeValue(OMADownloadHandler.OMA_TYPE, "text/html"); Assert.assertEquals(OMADownloadHandler.getOpennableType(info), null); @@ -235,8 +234,8 @@ Assert.assertEquals(info.getValue(OMADownloadHandler.OMA_DESCRIPTION), "testjpg"); Assert.assertEquals(info.getValue(OMADownloadHandler.OMA_NEXT_URL), "http://nexturl.html"); List<String> types = info.getTypes(); - Assert.assertThat(types, - Matchers.containsInAnyOrder("image/jpeg", OMADownloadHandler.OMA_DRM_MESSAGE_MIME)); + Assert.assertThat( + types, Matchers.containsInAnyOrder("image/jpeg", MimeUtils.OMA_DRM_MESSAGE_MIME)); } /**
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/night_mode/NightModeTestUtils.java b/chrome/android/javatests/src/org/chromium/chrome/browser/night_mode/NightModeTestUtils.java index 5e73b44..f45e47dd 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/night_mode/NightModeTestUtils.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/night_mode/NightModeTestUtils.java
@@ -8,9 +8,9 @@ import org.chromium.base.test.params.ParameterProvider; import org.chromium.base.test.params.ParameterSet; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.preferences.ChromePreferenceManager; import org.chromium.chrome.browser.preferences.themes.ThemePreferences; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.test.ui.DummyUiActivity; import java.util.Arrays;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/themes/ThemePreferencesTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/themes/ThemePreferencesTest.java index a2ec7b7..3cf6214 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/themes/ThemePreferencesTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/themes/ThemePreferencesTest.java
@@ -20,13 +20,13 @@ import org.chromium.base.test.params.ParameterizedRunner; import org.chromium.base.test.util.Feature; import org.chromium.chrome.R; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.night_mode.NightModeUtils; import org.chromium.chrome.browser.preferences.ChromePreferenceManager; import org.chromium.chrome.browser.preferences.Preferences; import org.chromium.chrome.browser.preferences.PreferencesTest; import org.chromium.chrome.browser.preferences.themes.ThemePreferences.ThemeSetting; import org.chromium.chrome.browser.ui.widget.RadioButtonWithDescription; -import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.test.ChromeJUnit4RunnerDelegate; import org.chromium.chrome.test.ui.DummyUiActivityTestCase; import org.chromium.chrome.test.util.browser.Features;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tasks/ReturnToChromeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tasks/ReturnToChromeTest.java index 147ab21..f980343b 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tasks/ReturnToChromeTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tasks/ReturnToChromeTest.java
@@ -27,7 +27,7 @@ import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.ChromeTabbedActivity; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.util.MenuUtils;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarTest.java index 70be0418319..a1f9115 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarTest.java
@@ -20,7 +20,7 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeSwitches; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.util.OverviewModeBehaviorWatcher;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/util/FeatureUtilitiesTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/util/FeatureUtilitiesTest.java index 773a2f0f..2ea1ab3 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/util/FeatureUtilitiesTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/util/FeatureUtilitiesTest.java
@@ -19,6 +19,7 @@ import org.chromium.base.ContextUtils; import org.chromium.base.test.util.AdvancedMockContext; import org.chromium.base.test.util.Feature; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.components.signin.AccountManagerFacade; import org.chromium.content_public.browser.test.util.TestThreadUtils;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/AuthenticatorTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/AuthenticatorTest.java index 27314fc..42c9a9e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/AuthenticatorTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/AuthenticatorTest.java
@@ -62,6 +62,12 @@ RenderFrameHost frameHost, HandlerResponseCallback callback) { callback.onError(AuthenticatorStatus.NOT_IMPLEMENTED); } + + @Override + protected void isUserVerifyingPlatformAuthenticatorAvailable( + RenderFrameHost frameHost, HandlerResponseCallback callback) { + callback.onIsUserVerifyingPlatformAuthenticatorAvailableResponse(false); + } } /** Waits until the JavaScript code supplies a result. */ @@ -153,6 +159,7 @@ @Feature({"WebAuth"}) public void testIsUserVerifyingPlatformAuthenticatorAvailable() throws Exception { mActivityTestRule.loadUrl(mUrl); + Fido2ApiHandler.overrideInstanceForTesting(mMockHandler); mActivityTestRule.runJavaScriptCodeInCurrentTab( "doIsUserVerifyingPlatformAuthenticatorAvailable()"); Assert.assertEquals("Success", mUpdateWaiter.waitForUpdate());
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/CustomTabNightModeStateControllerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/CustomTabNightModeStateControllerTest.java index 32a445ac..969b123 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/CustomTabNightModeStateControllerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/CustomTabNightModeStateControllerTest.java
@@ -4,6 +4,10 @@ package org.chromium.chrome.browser.customtabs; +import static androidx.browser.customtabs.CustomTabsIntent.COLOR_SCHEME_DARK; +import static androidx.browser.customtabs.CustomTabsIntent.COLOR_SCHEME_LIGHT; +import static androidx.browser.customtabs.CustomTabsIntent.COLOR_SCHEME_SYSTEM; + import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.doNothing; @@ -12,13 +16,11 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static androidx.browser.customtabs.CustomTabsIntent.COLOR_SCHEME_DARK; -import static androidx.browser.customtabs.CustomTabsIntent.COLOR_SCHEME_LIGHT; -import static androidx.browser.customtabs.CustomTabsIntent.COLOR_SCHEME_SYSTEM; - import android.content.Intent; import android.support.v7.app.AppCompatDelegate; +import androidx.browser.customtabs.CustomTabsIntent; + import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -30,13 +32,11 @@ import org.robolectric.annotation.Config; import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.night_mode.NightModeStateProvider; import org.chromium.chrome.browser.night_mode.PowerSavingModeMonitor; import org.chromium.chrome.browser.night_mode.SystemNightModeMonitor; -import org.chromium.chrome.browser.util.FeatureUtilities; - -import androidx.browser.customtabs.CustomTabsIntent; /** * Tests for {@link CustomTabNightModeStateController}.
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/download/DownloadResumptionSchedulerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/download/DownloadResumptionSchedulerTest.java index ba4ec374..30ef63a 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/download/DownloadResumptionSchedulerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/download/DownloadResumptionSchedulerTest.java
@@ -28,7 +28,7 @@ import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.util.Feature; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.components.background_task_scheduler.BackgroundTaskScheduler; import org.chromium.components.background_task_scheduler.BackgroundTaskSchedulerFactory; import org.chromium.components.background_task_scheduler.TaskIds;
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateControllerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateControllerTest.java index 48863b4..2bc5be4 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateControllerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateControllerTest.java
@@ -30,9 +30,9 @@ import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.util.DisableIf; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.preferences.ChromePreferenceManager; import org.chromium.chrome.browser.preferences.themes.ThemePreferences; -import org.chromium.chrome.browser.util.FeatureUtilities; /** * Unit tests for {@link GlobalNightModeStateController}.
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateProviderHolderTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateProviderHolderTest.java index 7f64d0f6..fd9fc4a 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateProviderHolderTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateProviderHolderTest.java
@@ -15,9 +15,9 @@ import org.robolectric.annotation.Config; import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.browser.preferences.ChromePreferenceManager; import org.chromium.chrome.browser.preferences.themes.ThemePreferences; -import org.chromium.chrome.browser.util.FeatureUtilities; /** * Unit tests for {@link GlobalNightModeStateProviderHolder}.
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/sharing/click_to_call/ClickToCallMessageHandlerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/sharing/click_to_call/ClickToCallMessageHandlerTest.java index ba2f0c1f..d2e8d41 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/sharing/click_to_call/ClickToCallMessageHandlerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/sharing/click_to_call/ClickToCallMessageHandlerTest.java
@@ -25,7 +25,7 @@ import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.DeviceConditions; import org.chromium.chrome.browser.ShadowDeviceConditions; -import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.browser.flags.FeatureUtilities; import org.chromium.chrome.test.util.browser.Features; import org.chromium.net.ConnectionType;
diff --git a/chrome/app/DEPS b/chrome/app/DEPS index 0b0bcd1..ea0340b 100644 --- a/chrome/app/DEPS +++ b/chrome/app/DEPS
@@ -12,6 +12,7 @@ "+chrome/utility/chrome_content_utility_client.h", "+chromeos/constants", "+chromeos/hugepage_text/hugepage_text.h", + "+chromeos/memory/kstaled.h", "+components/browser_watcher", "+components/component_updater", "+components/content_settings/core/common/content_settings_pattern.h",
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc index de8e0a7..593f496 100644 --- a/chrome/app/chrome_main_delegate.cc +++ b/chrome/app/chrome_main_delegate.cc
@@ -113,6 +113,7 @@ #include "chromeos/constants/chromeos_paths.h" #include "chromeos/constants/chromeos_switches.h" #include "chromeos/hugepage_text/hugepage_text.h" +#include "chromeos/memory/kstaled.h" #endif #if defined(OS_ANDROID) @@ -598,6 +599,10 @@ if (is_browser_process) { heap_profiler_controller_ = std::make_unique<HeapProfilerController>(); heap_profiler_controller_->Start(); + +#if defined(OS_CHROMEOS) + chromeos::InitializeKstaled(); +#endif } }
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index e84f2376..e6c7778 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -5806,7 +5806,7 @@ <!-- Feedback Dialog --> <if expr="use_titlecase"> <message name="IDS_FEEDBACK_REPORT_PAGE_TITLE" desc="Label showing the title of the page that will be reported"> - Tell Us What's Happening + Send Feedback to Google </message> <message name="IDS_FEEDBACK_REPORT_PAGE_TITLE_SAD_TAB_FLOW" desc="Label showing the title of the feedback app window when the crash report has been requested from the 'Aw, Snap!' page"> Describe What You Were Doing When The Tab Crashed @@ -5814,7 +5814,7 @@ </if> <if expr="not use_titlecase"> <message name="IDS_FEEDBACK_REPORT_PAGE_TITLE" desc="Label showing the title of the page that will be reported"> - Tell us what's happening + Send feedback to Google </message> <message name="IDS_FEEDBACK_REPORT_PAGE_TITLE_SAD_TAB_FLOW" desc="Label showing the title of the feedback app window when the crash report has been requested from the 'Aw, Snap!' page"> Describe what you were doing when the tab crashed
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 2db89c59..baf0436 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -2880,6 +2880,7 @@ "//chrome/android/modules/extra_icu/provider:native", "//chrome/browser/android/thin_webview/internal", "//chrome/browser/android/webapk:proto", + "//chrome/browser/notifications/chime/android", "//chrome/browser/notifications/scheduler/public", "//chrome/browser/share", "//chrome/services/media_gallery_util/public/cpp",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 1285b6b..55f21a8 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -80,6 +80,7 @@ #include "components/flags_ui/feature_entry_macros.h" #include "components/flags_ui/flags_storage.h" #include "components/flags_ui/flags_ui_switches.h" +#include "components/games/core/games_features.h" #include "components/invalidation/impl/invalidation_switches.h" #include "components/language/core/common/language_experiments.h" #include "components/nacl/common/buildflags.h" @@ -4719,6 +4720,12 @@ flag_descriptions::kMediaInspectorLoggingDescription, kOsAll, FEATURE_VALUE_TYPE(media::kMediaInspectorLogging)}, +#if defined(OS_ANDROID) + {"enable-games-hub", flag_descriptions::kGamesHubName, + flag_descriptions::kGamesHubDescription, kOsAndroid, + FEATURE_VALUE_TYPE(games::features::kGamesHub)}, +#endif // defined(OS_ANDROID) + // NOTE: Adding a new flag requires adding a corresponding entry to enum // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag // Histograms" in tools/metrics/histograms/README.md (run the
diff --git a/chrome/browser/android/explore_sites/explore_sites_service_factory.cc b/chrome/browser/android/explore_sites/explore_sites_service_factory.cc index b2314526..2e2161b 100644 --- a/chrome/browser/android/explore_sites/explore_sites_service_factory.cc +++ b/chrome/browser/android/explore_sites/explore_sites_service_factory.cc
@@ -85,7 +85,7 @@ HistoryServiceFactory::GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); auto history_stats_reporter = std::make_unique<HistoryStatisticsReporter>( - history_service, profile->GetPrefs(), base::DefaultClock::GetInstance()); + history_service, profile->GetPrefs()); return new ExploreSitesServiceImpl(std::move(explore_sites_store), std::move(url_loader_factory_getter),
diff --git a/chrome/browser/android/explore_sites/explore_sites_service_impl_unittest.cc b/chrome/browser/android/explore_sites/explore_sites_service_impl_unittest.cc index 573d69b..53661bb 100644 --- a/chrome/browser/android/explore_sites/explore_sites_service_impl_unittest.cc +++ b/chrome/browser/android/explore_sites/explore_sites_service_impl_unittest.cc
@@ -48,7 +48,7 @@ std::make_unique<ExploreSitesStore>( task_environment_.GetMainThreadTaskRunner()); auto history_stats_reporter = - std::make_unique<HistoryStatisticsReporter>(nullptr, nullptr, nullptr); + std::make_unique<HistoryStatisticsReporter>(nullptr, nullptr); service_ = std::make_unique<ExploreSitesServiceImpl>( std::move(store), std::make_unique<TestURLLoaderFactoryGetter>(
diff --git a/chrome/browser/android/explore_sites/history_statistics_reporter.cc b/chrome/browser/android/explore_sites/history_statistics_reporter.cc index 60c75fb2..09335db 100644 --- a/chrome/browser/android/explore_sites/history_statistics_reporter.cc +++ b/chrome/browser/android/explore_sites/history_statistics_reporter.cc
@@ -9,14 +9,12 @@ #include "base/bind.h" #include "base/metrics/histogram_macros.h" #include "base/threading/thread_task_runner_handle.h" +#include "base/time/time.h" #include "chrome/common/pref_names.h" #include "components/history/core/browser/history_service.h" #include "components/history/core/browser/history_types.h" namespace { -// Delay between the scheduling and actual computing/reporting of stats. -const int kComputeStatisticsDelaySeconds = 5; - // Pref name for the persistent timestamp of the last stats reporting. const char kWeeklyStatsReportingTimestamp[] = "explore_sites.weekly_stats_reporting_timestamp"; @@ -25,6 +23,9 @@ namespace explore_sites { // static +constexpr base::TimeDelta HistoryStatisticsReporter::kComputeStatisticsDelay; + +// static void HistoryStatisticsReporter::RegisterPrefs(PrefRegistrySimple* registry) { registry->RegisterTimePref(kWeeklyStatsReportingTimestamp, base::Time()); } @@ -33,11 +34,9 @@ // from HistoryService::CountUniqueHostsVisitedLastMonth) HistoryStatisticsReporter::HistoryStatisticsReporter( history::HistoryService* history_service, - PrefService* prefs, - base::Clock* clock) + PrefService* prefs) : history_service_(history_service), prefs_(prefs), - clock_(clock), history_service_observer_(this) {} HistoryStatisticsReporter::~HistoryStatisticsReporter() { @@ -52,17 +51,14 @@ // If we've already reported metrics during last week, bail out. base::Time last_report_time = prefs_->GetTime(kWeeklyStatsReportingTimestamp); - if (last_report_time > clock_->Now() - base::TimeDelta::FromDays(7)) + if (last_report_time > base::Time::Now() - base::TimeDelta::FromDays(7)) return; - base::TimeDelta computeStatisticsDelay = - base::TimeDelta::FromSeconds(kComputeStatisticsDelaySeconds); - base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, base::BindOnce(&HistoryStatisticsReporter::MaybeReportStatistics, weak_ptr_factory_.GetWeakPtr()), - computeStatisticsDelay); + kComputeStatisticsDelay); } void HistoryStatisticsReporter::OnHistoryServiceLoaded( @@ -101,6 +97,6 @@ return; UMA_HISTOGRAM_COUNTS_1000("ExploreSites.MonthlyHostCount", result.count); // Remember when stats were reported to skip attempts until next week. - prefs_->SetTime(kWeeklyStatsReportingTimestamp, clock_->Now()); + prefs_->SetTime(kWeeklyStatsReportingTimestamp, base::Time::Now()); } } // namespace explore_sites
diff --git a/chrome/browser/android/explore_sites/history_statistics_reporter.h b/chrome/browser/android/explore_sites/history_statistics_reporter.h index a500f38..a1c66d805 100644 --- a/chrome/browser/android/explore_sites/history_statistics_reporter.h +++ b/chrome/browser/android/explore_sites/history_statistics_reporter.h
@@ -11,7 +11,6 @@ #include "base/memory/weak_ptr.h" #include "base/scoped_observer.h" #include "base/task/cancelable_task_tracker.h" -#include "base/time/clock.h" #include "components/history/core/browser/history_service.h" #include "components/history/core/browser/history_service_observer.h" #include "components/prefs/pref_registry_simple.h" @@ -20,11 +19,14 @@ namespace explore_sites { class HistoryStatisticsReporter : public history::HistoryServiceObserver { public: + // Delay between the scheduling and actual computing/reporting of stats. + static constexpr base::TimeDelta kComputeStatisticsDelay = + base::TimeDelta::FromSeconds(5); + static void RegisterPrefs(PrefRegistrySimple* registry); HistoryStatisticsReporter(history::HistoryService* history_service, - PrefService* prefs, - base::Clock* clock); + PrefService* prefs); ~HistoryStatisticsReporter() override; // Schedules delayed task to compute/report history statistics. @@ -46,7 +48,6 @@ history::HistoryService* const history_service_; PrefService* prefs_; - base::Clock* clock_; base::CancelableTaskTracker cancelable_task_tracker_; ScopedObserver<history::HistoryService, history::HistoryServiceObserver>
diff --git a/chrome/browser/android/explore_sites/history_statistics_reporter_unittest.cc b/chrome/browser/android/explore_sites/history_statistics_reporter_unittest.cc index 621f76ea..24e58aa0 100644 --- a/chrome/browser/android/explore_sites/history_statistics_reporter_unittest.cc +++ b/chrome/browser/android/explore_sites/history_statistics_reporter_unittest.cc
@@ -8,7 +8,10 @@ #include "base/files/scoped_temp_dir.h" #include "base/test/bind_test_util.h" #include "base/test/metrics/histogram_tester.h" -#include "base/test/test_mock_time_task_runner.h" +#include "base/test/scoped_feature_list.h" +#include "base/test/task_environment.h" +#include "base/time/clock.h" +#include "base/time/time.h" #include "components/history/core/browser/history_database_params.h" #include "components/history/core/browser/history_service.h" #include "components/history/core/test/history_service_test_util.h" @@ -30,30 +33,34 @@ class HistoryStatisticsReporterTest : public testing::Test { public: HistoryStatisticsReporterTest() - : task_runner_(new base::TestMockTimeTaskRunner( - base::TestMockTimeTaskRunner::Type::kBoundToThread)) {} + : task_environment_( + base::test::SingleThreadTaskEnvironment::TimeSource::MOCK_TIME) {} ~HistoryStatisticsReporterTest() override {} void SetUp() override { + feature_list_.InitWithFeatures( + {history::HistoryService::kHistoryServiceUsesTaskScheduler}, {}); + HistoryStatisticsReporter::RegisterPrefs(pref_service_.registry()); ASSERT_TRUE(history_dir_.CreateUniqueTempDir()); // Creates HistoryService, but does not load it yet. Use LoadHistory() from // tests to control loading of HistoryService. history_service_ = std::make_unique<history::HistoryService>(); - reporter_ = std::make_unique<HistoryStatisticsReporter>( - history_service(), &pref_service_, task_runner_->GetMockClock()); + reporter_ = std::make_unique<HistoryStatisticsReporter>(history_service(), + &pref_service_); } // Wait for separate background task runner in HistoryService to complete // all tasks and then all the tasks on the current one to complete as well. void RunUntilIdle() { history::BlockUntilHistoryProcessesPendingRequests(history_service()); - task_runner_->RunUntilIdle(); + task_environment_.RunUntilIdle(); } void ScheduleReportAndRunUntilIdle() { reporter()->ScheduleReportStatistics(); - task_runner()->FastForwardUntilNoTasksRemain(); + task_environment_.FastForwardBy( + HistoryStatisticsReporter::kComputeStatisticsDelay); RunUntilIdle(); } @@ -68,11 +75,13 @@ HistoryStatisticsReporter* reporter() const { return reporter_.get(); } const base::HistogramTester& histograms() const { return histogram_tester_; } history::HistoryService* history_service() { return history_service_.get(); } - base::TestMockTimeTaskRunner* task_runner() { return task_runner_.get(); } TestingPrefServiceSimple* prefs() { return &pref_service_; } + protected: + base::test::TaskEnvironment task_environment_; + private: - scoped_refptr<base::TestMockTimeTaskRunner> task_runner_; + base::test::ScopedFeatureList feature_list_; base::ScopedTempDir history_dir_; TestingPrefServiceSimple pref_service_; base::HistogramTester histogram_tester_; @@ -87,7 +96,8 @@ reporter()->ScheduleReportStatistics(); // Move past initial delay of reporter. - task_runner()->FastForwardUntilNoTasksRemain(); + task_environment_.FastForwardBy( + HistoryStatisticsReporter::kComputeStatisticsDelay); // Since History is not yet loaded, there should be no histograms. histograms().ExpectTotalCount("History.DatabaseMonthlyHostCountTime", 0); @@ -108,7 +118,8 @@ reporter()->ScheduleReportStatistics(); // Move past initial delay of reporter. - task_runner()->FastForwardUntilNoTasksRemain(); + task_environment_.FastForwardBy( + HistoryStatisticsReporter::kComputeStatisticsDelay); RunUntilIdle(); // Since History is already loaded, there should be a sample reported. @@ -126,7 +137,8 @@ histograms().ExpectTotalCount("History.DatabaseMonthlyHostCountTime", 0); // Move past initial delay of reporter. - task_runner()->FastForwardUntilNoTasksRemain(); + task_environment_.FastForwardBy( + HistoryStatisticsReporter::kComputeStatisticsDelay); RunUntilIdle(); // Since History is already loaded, there should be a sample reported. @@ -200,15 +212,14 @@ histograms().ExpectTotalCount("History.DatabaseMonthlyHostCountTime", 1); // Reporter should have left the time of request in Prefs. - base::Time time_now = task_runner()->GetMockClock()->Now(); - EXPECT_EQ(time_now, prefs()->GetTime(kWeeklyStatsReportingTimestamp)); + EXPECT_EQ(base::Time::Now(), + prefs()->GetTime(kWeeklyStatsReportingTimestamp)); } TEST_F(HistoryStatisticsReporterTest, OneRunPerWeekReadTimestamp) { ASSERT_TRUE(LoadHistory()); - prefs()->SetTime(kWeeklyStatsReportingTimestamp, - task_runner()->GetMockClock()->Now()); + prefs()->SetTime(kWeeklyStatsReportingTimestamp, base::Time::Now()); ScheduleReportAndRunUntilIdle(); // No queries, a week did not pass yet. @@ -218,16 +229,15 @@ TEST_F(HistoryStatisticsReporterTest, OneRunPerWeekReadTimestampAfterWeek) { ASSERT_TRUE(LoadHistory()); - prefs()->SetTime( - kWeeklyStatsReportingTimestamp, - task_runner()->GetMockClock()->Now() - base::TimeDelta::FromDays(8)); + prefs()->SetTime(kWeeklyStatsReportingTimestamp, + base::Time::Now() - base::TimeDelta::FromDays(8)); ScheduleReportAndRunUntilIdle(); // More than a week since last query, should have gone through. histograms().ExpectTotalCount("History.DatabaseMonthlyHostCountTime", 1); // Reporter should have left the time of request in Prefs. - base::Time time_now = task_runner()->GetMockClock()->Now(); - EXPECT_EQ(time_now, prefs()->GetTime(kWeeklyStatsReportingTimestamp)); + EXPECT_EQ(base::Time::Now(), + prefs()->GetTime(kWeeklyStatsReportingTimestamp)); } } // namespace explore_sites
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd index d2a0cfd6..e518ebfa 100644 --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd
@@ -13,11 +13,13 @@ <structure name="IDR_SIGNIN_SHARED_OLD_CSS_HTML" file="resources\signin\signin_shared_old_css.html" preprocess="true" allowexternalscript="true" type="chrome_html" /> </if> <if expr="not is_android"> - <structure name="IDR_INCOGNITO_TAB_HTML" file="resources\ntp4\incognito_tab.html" flattenhtml="true" type="chrome_html" /> - <structure name="IDR_GUEST_TAB_HTML" file="resources\ntp4\guest_tab.html" flattenhtml="true" type="chrome_html" /> - <structure name="IDR_NEW_INCOGNITO_TAB_THEME_CSS" file="resources\ntp4\new_incognito_tab_theme.css" flattenhtml="true" type="chrome_html" /> - <structure name="IDR_NEW_TAB_4_HTML" file="resources\ntp4\new_tab.html" flattenhtml="true" type="chrome_html" /> - <structure name="IDR_NEW_TAB_4_THEME_CSS" file="resources\ntp4\new_tab_theme.css" flattenhtml="true" type="chrome_html" /> + <!-- New Tab Page WebUI. --> + <structure name="IDR_INCOGNITO_TAB_HTML" file="resources\ntp4\incognito_tab.html" compress="gzip" flattenhtml="true" type="chrome_html" /> + <structure name="IDR_GUEST_TAB_HTML" file="resources\ntp4\guest_tab.html" compress="gzip" flattenhtml="true" type="chrome_html" /> + <structure name="IDR_NEW_INCOGNITO_TAB_THEME_CSS" file="resources\ntp4\new_incognito_tab_theme.css" compress="gzip" flattenhtml="true" type="chrome_html" /> + <structure name="IDR_NEW_TAB_4_HTML" file="resources\ntp4\new_tab.html" compress="gzip" flattenhtml="true" type="chrome_html" /> + <structure name="IDR_NEW_TAB_4_THEME_CSS" file="resources\ntp4\new_tab_theme.css" compress="gzip" flattenhtml="true" type="chrome_html" /> + <!-- Bookmarks WebUI. --> <if expr="optimize_webui"> <then> @@ -267,9 +269,11 @@ <include name="IDR_INLINE_LOGIN_CSS" file="resources\inline_login\inline_login.css" flattenhtml="true" type="BINDATA" preprocess="true" /> <include name="IDR_INLINE_LOGIN_JS" file="resources\inline_login\inline_login.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_GAIA_AUTH_AUTHENTICATOR_JS" file="resources\gaia_auth_host\authenticator.js" flattenhtml="true" type="BINDATA" /> - <include name="IDR_INSPECT_CSS" file="resources\inspect\inspect.css" flattenhtml="true" type="BINDATA" /> - <include name="IDR_INSPECT_HTML" file="resources\inspect\inspect.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> - <include name="IDR_INSPECT_JS" file="resources\inspect\inspect.js" flattenhtml="true" type="BINDATA" /> + + <include name="IDR_INSPECT_CSS" file="resources\inspect\inspect.css" compress="gzip" flattenhtml="true" type="BINDATA" /> + <include name="IDR_INSPECT_HTML" file="resources\inspect\inspect.html" compress="gzip" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> + <include name="IDR_INSPECT_JS" file="resources\inspect\inspect.js" compress="gzip" flattenhtml="true" type="BINDATA" /> + <include name="IDR_INTERVENTIONS_INTERNALS_INDEX_HTML" file="resources\interventions_internals\index.html" flattenhtml="true" allowexternalscript="true" compress="gzip" type="BINDATA" /> <include name="IDR_INTERVENTIONS_INTERNALS_INDEX_JS" file="resources\interventions_internals\index.js" type="BINDATA" compress="gzip" /> <include name="IDR_INTERVENTIONS_INTERNALS_MOJOM_LITE_JS" file="${root_gen_dir}\chrome\browser\ui\webui\interventions_internals\interventions_internals.mojom-lite.js" use_base_dir="false" type="BINDATA" compress="gzip" />
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 2be0444..9201a3a 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -2837,6 +2837,8 @@ "printing/synced_printers_manager_unittest.cc", "printing/test_cups_print_job_manager.cc", "printing/test_cups_print_job_manager.h", + "printing/test_cups_printers_manager.cc", + "printing/test_cups_printers_manager.h", "printing/usb_printer_detector_unittest.cc", "printing/zeroconf_printer_detector_unittest.cc", "proxy_config_service_impl_unittest.cc",
diff --git a/chrome/browser/chromeos/policy/status_collector/device_status_collector.cc b/chrome/browser/chromeos/policy/status_collector/device_status_collector.cc index 70e4043..c2767462 100644 --- a/chrome/browser/chromeos/policy/status_collector/device_status_collector.cc +++ b/chrome/browser/chromeos/policy/status_collector/device_status_collector.cc
@@ -1143,16 +1143,18 @@ return; const auto& battery = result->battery_info; - enterprise_management::BatterySample battery_sample; - battery_sample.set_timestamp(sample->timestamp.ToJavaTime()); - // Convert V to mV: - battery_sample.set_voltage(std::lround(battery->voltage_now * 1000)); - // Convert Ah to mAh: - battery_sample.set_remaining_capacity( - std::lround(battery->charge_now * 1000)); - // Convert 0.1 Kelvin to Celsius: - battery_sample.set_temperature((battery->temperature_smart - 2731) / 10); - sample->battery_samples[battery->model_name] = battery_sample; + if (!battery.is_null()) { + enterprise_management::BatterySample battery_sample; + battery_sample.set_timestamp(sample->timestamp.ToJavaTime()); + // Convert V to mV: + battery_sample.set_voltage(std::lround(battery->voltage_now * 1000)); + // Convert Ah to mAh: + battery_sample.set_remaining_capacity( + std::lround(battery->charge_now * 1000)); + // Convert 0.1 Kelvin to Celsius: + battery_sample.set_temperature((battery->temperature_smart - 2731) / 10); + sample->battery_samples[battery->model_name] = battery_sample; + } SamplingCallback completion_callback; if (!callback.is_null()) {
diff --git a/chrome/browser/chromeos/printing/test_cups_printers_manager.cc b/chrome/browser/chromeos/printing/test_cups_printers_manager.cc new file mode 100644 index 0000000..7324385 --- /dev/null +++ b/chrome/browser/chromeos/printing/test_cups_printers_manager.cc
@@ -0,0 +1,38 @@ +// Copyright 2019 The Chromium 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/printing/test_cups_printers_manager.h" + +namespace chromeos { + +TestCupsPrintersManager::TestCupsPrintersManager() = default; + +TestCupsPrintersManager::~TestCupsPrintersManager() = default; + +std::vector<Printer> TestCupsPrintersManager::GetPrinters( + PrinterClass printer_class) const { + return printers_.Get(printer_class); +} + +bool TestCupsPrintersManager::IsPrinterInstalled(const Printer& printer) const { + return installed_.contains(printer.id()); +} + +base::Optional<Printer> TestCupsPrintersManager::GetPrinter( + const std::string& id) const { + return printers_.Get(id); +} + +// Add |printer| to the corresponding list in |printers_| bases on the given +// |printer_class|. +void TestCupsPrintersManager::AddPrinter(const Printer& printer, + PrinterClass printer_class) { + printers_.Insert(printer_class, printer); +} + +void TestCupsPrintersManager::InstallPrinter(const std::string& id) { + installed_.insert(id); +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/printing/test_cups_printers_manager.h b/chrome/browser/chromeos/printing/test_cups_printers_manager.h new file mode 100644 index 0000000..9dcdb77 --- /dev/null +++ b/chrome/browser/chromeos/printing/test_cups_printers_manager.h
@@ -0,0 +1,36 @@ +// Copyright 2019 The Chromium 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_PRINTING_TEST_CUPS_PRINTERS_MANAGER_H_ +#define CHROME_BROWSER_CHROMEOS_PRINTING_TEST_CUPS_PRINTERS_MANAGER_H_ + +#include "base/containers/flat_set.h" +#include "chrome/browser/chromeos/printing/printers_map.h" +#include "chrome/browser/chromeos/printing/printing_stubs.h" + +namespace chromeos { + +// Test printers manager which allows to add the printer of arbitrary class. +// It's used in unit and API integration tests. +class TestCupsPrintersManager : public StubCupsPrintersManager { + public: + TestCupsPrintersManager(); + ~TestCupsPrintersManager() override; + + // CupsPrintersManager: + std::vector<Printer> GetPrinters(PrinterClass printer_class) const override; + bool IsPrinterInstalled(const Printer& printer) const override; + base::Optional<Printer> GetPrinter(const std::string& id) const override; + + void AddPrinter(const Printer& printer, PrinterClass printer_class); + void InstallPrinter(const std::string& id); + + private: + PrintersMap printers_; + base::flat_set<std::string> installed_; +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_PRINTING_TEST_CUPS_PRINTERS_MANAGER_H_
diff --git a/chrome/browser/download/android/BUILD.gn b/chrome/browser/download/android/BUILD.gn index fa4aa2a..64dcb23a 100644 --- a/chrome/browser/download/android/BUILD.gn +++ b/chrome/browser/download/android/BUILD.gn
@@ -9,10 +9,36 @@ "java/src/org/chromium/chrome/browser/download/DirectoryOption.java", "java/src/org/chromium/chrome/browser/download/DownloadFilter.java", "java/src/org/chromium/chrome/browser/download/DownloadDirectoryProvider.java", + "java/src/org/chromium/chrome/browser/download/DownloadInfo.java", + "java/src/org/chromium/chrome/browser/download/MimeUtils.java", ] deps = [ "//base:base_java", + "//components/download/public/common:public_java", + "//components/offline_items_collection/core:core_java", "//content/public/android:content_java", ] } + +generate_jni("jni_headers") { + sources = [ + "java/src/org/chromium/chrome/browser/download/DownloadInfo.java", + "java/src/org/chromium/chrome/browser/download/MimeUtils.java", + ] +} + +android_library("download_java_tests") { + testonly = true + + java_files = [ + "javatests/src/org/chromium/chrome/browser/download/MimeUtilsTest.java", + ] + + deps = [ + ":java", + "//base:base_java_test_support", + "//chrome/test/android:chrome_java_test_support", + "//third_party/junit", + ] +}
diff --git a/chrome/browser/download/android/download_manager_service.cc b/chrome/browser/download/android/download_manager_service.cc index d8dfbbf2..bb720e77 100644 --- a/chrome/browser/download/android/download_manager_service.cc +++ b/chrome/browser/download/android/download_manager_service.cc
@@ -16,7 +16,6 @@ #include "base/strings/string_number_conversions.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" -#include "chrome/android/chrome_jni_headers/DownloadInfo_jni.h" #include "chrome/android/chrome_jni_headers/DownloadItem_jni.h" #include "chrome/android/chrome_jni_headers/DownloadManagerService_jni.h" #include "chrome/browser/android/chrome_feature_list.h" @@ -26,6 +25,7 @@ #include "chrome/browser/download/android/download_controller.h" #include "chrome/browser/download/android/download_startup_utils.h" #include "chrome/browser/download/android/download_utils.h" +#include "chrome/browser/download/android/jni_headers/DownloadInfo_jni.h" #include "chrome/browser/download/android/service/download_task_scheduler.h" #include "chrome/browser/download/offline_item_utils.h" #include "chrome/browser/download/simple_download_manager_coordinator_factory.h"
diff --git a/chrome/browser/download/android/download_media_parser.cc b/chrome/browser/download/android/download_media_parser.cc index 55ff8cf..c27eb1f 100644 --- a/chrome/browser/download/android/download_media_parser.cc +++ b/chrome/browser/download/android/download_media_parser.cc
@@ -266,15 +266,16 @@ media::mojom::InterfaceFactory* DownloadMediaParser::GetMediaInterfaceFactory() { if (!media_interface_factory_) { - service_manager::mojom::InterfaceProviderPtr interfaces; + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> interfaces; media_interface_provider_ = std::make_unique<media::MediaInterfaceProvider>( - mojo::MakeRequest(&interfaces)); + interfaces.InitWithNewPipeAndPassReceiver()); media::mojom::MediaServicePtr media_service; content::GetSystemConnector()->BindInterface( media::mojom::kMediaServiceName, &media_service); media_service->CreateInterfaceFactory( - MakeRequest(&media_interface_factory_), std::move(interfaces)); - media_interface_factory_.set_connection_error_handler( + media_interface_factory_.BindNewPipeAndPassReceiver(), + std::move(interfaces)); + media_interface_factory_.set_disconnect_handler( base::BindOnce(&DownloadMediaParser::OnDecoderConnectionError, base::Unretained(this))); }
diff --git a/chrome/browser/download/android/download_media_parser.h b/chrome/browser/download/android/download_media_parser.h index 919084ea..b178db6 100644 --- a/chrome/browser/download/android/download_media_parser.h +++ b/chrome/browser/download/android/download_media_parser.h
@@ -23,6 +23,7 @@ #include "chrome/services/media_gallery_util/public/mojom/media_parser.mojom.h" #include "media/base/media_log.h" #include "media/mojo/mojom/interface_factory.mojom.h" +#include "mojo/public/cpp/bindings/remote.h" namespace media { class GpuVideoAcceleratorFactories; @@ -123,7 +124,7 @@ // MojoVideoDecoder. media::VideoDecoderConfig config_; std::unique_ptr<media::VideoThumbnailDecoder> decoder_; - media::mojom::InterfaceFactoryPtr media_interface_factory_; + mojo::Remote<media::mojom::InterfaceFactory> media_interface_factory_; std::unique_ptr<media::MediaInterfaceProvider> media_interface_provider_; std::unique_ptr<media::GpuVideoAcceleratorFactories> gpu_factories_; bool decode_done_;
diff --git a/chrome/browser/download/android/download_utils.cc b/chrome/browser/download/android/download_utils.cc index 170c7500..9ec1b75 100644 --- a/chrome/browser/download/android/download_utils.cc +++ b/chrome/browser/download/android/download_utils.cc
@@ -11,6 +11,7 @@ #include "base/strings/string_number_conversions.h" #include "chrome/android/chrome_jni_headers/DownloadUtils_jni.h" #include "chrome/browser/android/chrome_feature_list.h" +#include "chrome/browser/download/android/jni_headers/MimeUtils_jni.h" #include "chrome/browser/download/offline_item_utils.h" #include "chrome/browser/profiles/profile.h" #include "chrome/grit/generated_resources.h" @@ -30,10 +31,6 @@ // from the beginning, throttle it. int kDefaultAutoResumptionSizeLimit = 10 * 1024 * 1024; // 10 MB const char kAutoResumptionSizeLimitParamName[] = "AutoResumptionSizeLimit"; - -// Mime type for OMA download descriptor. -const char kOmaDownloadDescriptorMimeType[] = "application/vnd.oma.dd+xml"; - } // namespace static ScopedJavaLocalRef<jstring> JNI_DownloadUtils_GetFailStateMessage( @@ -103,7 +100,7 @@ const GURL& url, const std::string& file_name) { JNIEnv* env = base::android::AttachCurrentThread(); - auto j_remapped_mime_type = Java_DownloadUtils_remapGenericMimeType( + auto j_remapped_mime_type = Java_MimeUtils_remapGenericMimeType( env, ConvertUTF8ToJavaString(env, mime_type), ConvertUTF8ToJavaString(env, url.spec()), ConvertUTF8ToJavaString(env, file_name)); @@ -120,8 +117,9 @@ // static bool DownloadUtils::IsOmaDownloadDescription(const std::string& mime_type) { - return base::EqualsCaseInsensitiveASCII(mime_type, - kOmaDownloadDescriptorMimeType); + JNIEnv* env = base::android::AttachCurrentThread(); + return Java_MimeUtils_isOMADownloadDescription( + env, ConvertUTF8ToJavaString(env, mime_type)); } // static
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java similarity index 79% rename from chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java rename to chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java index 71f2e42..70a6431c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java +++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadInfo.java
@@ -8,13 +8,11 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.components.download.DownloadState; -import org.chromium.components.download.ResumeMode; import org.chromium.components.offline_items_collection.ContentId; import org.chromium.components.offline_items_collection.FailState; import org.chromium.components.offline_items_collection.LegacyHelpers; import org.chromium.components.offline_items_collection.OfflineItem; import org.chromium.components.offline_items_collection.OfflineItem.Progress; -import org.chromium.components.offline_items_collection.OfflineItemFilter; import org.chromium.components.offline_items_collection.OfflineItemProgressUnit; import org.chromium.components.offline_items_collection.OfflineItemState; import org.chromium.components.offline_items_collection.OfflineItemVisuals; @@ -302,99 +300,6 @@ } /** - * Helper method to build an {@link OfflineItem} from a {@link DownloadInfo}. - * @param item The {@link DownloadInfo} to mimic. - * @return A {@link OfflineItem} containing the relevant fields from {@code item}. - */ - public static OfflineItem createOfflineItem(DownloadInfo downloadInfo) { - OfflineItem offlineItem = new OfflineItem(); - offlineItem.id = downloadInfo.getContentId(); - offlineItem.filePath = downloadInfo.getFilePath(); - offlineItem.title = downloadInfo.getFileName(); - offlineItem.description = downloadInfo.getDescription(); - offlineItem.isTransient = downloadInfo.getIsTransient(); - offlineItem.isAccelerated = downloadInfo.getIsParallelDownload(); - offlineItem.isSuggested = false; - offlineItem.totalSizeBytes = downloadInfo.getBytesTotalSize(); - offlineItem.receivedBytes = downloadInfo.getBytesReceived(); - offlineItem.isResumable = downloadInfo.isResumable(); - offlineItem.pageUrl = downloadInfo.getUrl(); - offlineItem.originalUrl = downloadInfo.getOriginalUrl(); - offlineItem.isOffTheRecord = downloadInfo.isOffTheRecord(); - offlineItem.mimeType = downloadInfo.getMimeType(); - offlineItem.progress = downloadInfo.getProgress(); - offlineItem.timeRemainingMs = downloadInfo.getTimeRemainingInMillis(); - offlineItem.isDangerous = downloadInfo.getIsDangerous(); - offlineItem.pendingState = downloadInfo.getPendingState(); - offlineItem.failState = downloadInfo.getFailState(); - offlineItem.promoteOrigin = downloadInfo.getShouldPromoteOrigin(); - offlineItem.lastAccessedTimeMs = downloadInfo.getLastAccessTime(); - - switch (downloadInfo.state()) { - case DownloadState.IN_PROGRESS: - offlineItem.state = downloadInfo.isPaused() ? OfflineItemState.PAUSED - : OfflineItemState.IN_PROGRESS; - break; - case DownloadState.COMPLETE: - offlineItem.state = downloadInfo.getBytesReceived() == 0 - ? OfflineItemState.FAILED - : OfflineItemState.COMPLETE; - break; - case DownloadState.CANCELLED: - offlineItem.state = OfflineItemState.CANCELLED; - break; - case DownloadState.INTERRUPTED: - DownloadItem downloadItem = new DownloadItem(false, downloadInfo); - @ResumeMode - int resumeMode = DownloadUtils.getResumeMode( - downloadInfo.getUrl(), downloadInfo.getFailState()); - if (resumeMode == ResumeMode.INVALID || resumeMode == ResumeMode.USER_RESTART) { - // Fail but can restart from the beginning. The UI should let the user to retry. - offlineItem.state = OfflineItemState.INTERRUPTED; - } - // TODO(xingliu): isDownloadPaused and isDownloadPending rely on isAutoResumable - // is set correctly in {@link DownloadSharedPreferenceEntry}. The states of - // notification UI and download home currently may not match. Also pending is - // related to Java side auto resumption on good network condition. - else if (downloadInfo.isPaused()) { - offlineItem.state = OfflineItemState.PAUSED; - } else if (DownloadUtils.isDownloadPending(downloadItem)) { - offlineItem.state = OfflineItemState.PENDING; - } else { - // Unknown failure state. - offlineItem.state = OfflineItemState.FAILED; - } - break; - default: - assert false; - } - - switch (DownloadFilter.fromMimeType(downloadInfo.getMimeType())) { - case DownloadFilter.Type.PAGE: - offlineItem.filter = OfflineItemFilter.PAGE; - break; - case DownloadFilter.Type.VIDEO: - offlineItem.filter = OfflineItemFilter.VIDEO; - break; - case DownloadFilter.Type.AUDIO: - offlineItem.filter = OfflineItemFilter.AUDIO; - break; - case DownloadFilter.Type.IMAGE: - offlineItem.filter = OfflineItemFilter.IMAGE; - break; - case DownloadFilter.Type.DOCUMENT: - offlineItem.filter = OfflineItemFilter.DOCUMENT; - break; - case DownloadFilter.Type.OTHER: - default: - offlineItem.filter = OfflineItemFilter.OTHER; - break; - } - - return offlineItem; - } - - /** * Helper class for building the DownloadInfo object. */ public static class Builder { @@ -645,8 +550,7 @@ boolean hasUserGesture, boolean isResumable, boolean isParallelDownload, String originalUrl, String referrerUrl, long timeRemainingInMs, long lastAccessTime, boolean isDangerous, @FailState int failState) { - String remappedMimeType = ChromeDownloadDelegate.remapGenericMimeType( - mimeType, url, fileName); + String remappedMimeType = MimeUtils.remapGenericMimeType(mimeType, url, fileName); Progress progress = new Progress(bytesReceived, percentCompleted == -1 ? null : bytesTotalSize, OfflineItemProgressUnit.BYTES);
diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/MimeUtils.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/MimeUtils.java new file mode 100644 index 0000000..de8b7f2 --- /dev/null +++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/MimeUtils.java
@@ -0,0 +1,85 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.download; + +import android.text.TextUtils; +import android.webkit.MimeTypeMap; + +import org.chromium.base.annotations.CalledByNative; + +import java.util.Arrays; +import java.util.HashSet; + +/** + * Utility class for MIME type related operations. + */ +public class MimeUtils { + // MIME types for OMA downloads. + public static final String OMA_DOWNLOAD_DESCRIPTOR_MIME = "application/vnd.oma.dd+xml"; + public static final String OMA_DRM_MESSAGE_MIME = "application/vnd.oma.drm.message"; + public static final String OMA_DRM_CONTENT_MIME = "application/vnd.oma.drm.content"; + public static final String OMA_DRM_RIGHTS_MIME = "application/vnd.oma.drm.rights+wbxml"; + + private static final String UNKNOWN_MIME_TYPE = "application/unknown"; + + // Mime types that Android can't handle when tries to open the file. Chrome may deduct a better + // mime type based on file extension. + private static final HashSet<String> GENERIC_MIME_TYPES = new HashSet<String>(Arrays.asList( + "text/plain", "application/octet-stream", "binary/octet-stream", "octet/stream", + "application/download", "application/force-download", "application/unknown")); + /** + * If the given MIME type is null, or one of the "generic" types (text/plain + * or application/octet-stream) map it to a type that Android can deal with. + * If the given type is not generic, return it unchanged. + * + * @param mimeType MIME type provided by the server. + * @param url URL of the data being loaded. + * @param filename file name obtained from content disposition header + * @return The MIME type that should be used for this data. + */ + @CalledByNative + public static String remapGenericMimeType(String mimeType, String url, String filename) { + if (TextUtils.isEmpty(mimeType)) mimeType = UNKNOWN_MIME_TYPE; + if (GENERIC_MIME_TYPES.contains(mimeType)) { + String extension = getFileExtension(url, filename); + String newMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); + if (newMimeType != null) { + mimeType = newMimeType; + } else if (extension.equals("dm")) { + mimeType = OMA_DRM_MESSAGE_MIME; + } else if (extension.equals("dd")) { + mimeType = OMA_DOWNLOAD_DESCRIPTOR_MIME; + } + } + return mimeType; + } + + /** + * Retrieve the file extension from a given file name or url. + * + * @param url URL to extract the extension. + * @param filename File name to extract the extension. + * @return If extension can be extracted from file name, use that. Or otherwise, use the + * extension extracted from the url. + */ + static String getFileExtension(String url, String filename) { + if (!TextUtils.isEmpty(filename)) { + int index = filename.lastIndexOf("."); + if (index > 0) return filename.substring(index + 1); + } + return MimeTypeMap.getFileExtensionFromUrl(url); + } + + /** + * Returns true if the download is for OMA download description file. + * + * @param mimeType The mime type of the download. + * @return true if the downloaded is OMA download description, or false otherwise. + */ + @CalledByNative + public static boolean isOMADownloadDescription(String mimeType) { + return OMA_DOWNLOAD_DESCRIPTOR_MIME.equalsIgnoreCase(mimeType); + } +}
diff --git a/chrome/browser/download/android/javatests/src/org/chromium/chrome/browser/download/MimeUtilsTest.java b/chrome/browser/download/android/javatests/src/org/chromium/chrome/browser/download/MimeUtilsTest.java new file mode 100644 index 0000000..753d91f5 --- /dev/null +++ b/chrome/browser/download/android/javatests/src/org/chromium/chrome/browser/download/MimeUtilsTest.java
@@ -0,0 +1,30 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.download; + +import android.support.test.filters.SmallTest; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.base.test.util.Feature; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; + +/** + * Tests for MimeUtils class. + */ +@RunWith(ChromeJUnit4ClassRunner.class) +public class MimeUtilsTest { + @Test + @SmallTest + @Feature({"Download"}) + public void testGetFileExtension() { + Assert.assertEquals("ext", MimeUtils.getFileExtension("", "file.ext")); + Assert.assertEquals("ext", MimeUtils.getFileExtension("http://file.ext", "")); + Assert.assertEquals("txt", MimeUtils.getFileExtension("http://file.ext", "file.txt")); + Assert.assertEquals("txt", MimeUtils.getFileExtension("http://file.ext", "file name.txt")); + } +}
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 02f5501..5be0d8f 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -1327,6 +1327,11 @@ "expiry_milestone": -1 }, { + "name": "enable-games-hub", + "owners": ["csharp", "seblalancette", "tmartino"], + "expiry_milestone": 84 + }, + { "name": "enable-generic-sensor-extra-classes", "owners": [ "reillyg@chromium.org", "raphael.kubo.da.costa@intel.com" ], "expiry_milestone": 83
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 7d15b73..18cb5f6 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -2557,6 +2557,10 @@ const char kExploreSitesDescription[] = "Enables portal from new tab page to explore websites."; +const char kGamesHubName[] = "Games Hub"; +const char kGamesHubDescription[] = + "Enables viewing and usage of the Games Hub."; + const char kInterestFeedNotificationsName[] = "Interest Feed Notifications"; const char kInterestFeedNotificationsDescription[] = "Show notifications for some suggested content from the interest feed. "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 068a29e..4c4dcdc8 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1510,6 +1510,9 @@ extern const char kExploreSitesName[]; extern const char kExploreSitesDescription[]; +extern const char kGamesHubName[]; +extern const char kGamesHubDescription[]; + extern const char kInterestFeedNotificationsName[]; extern const char kInterestFeedNotificationsDescription[];
diff --git a/chrome/browser/lookalikes/lookalike_url_service.h b/chrome/browser/lookalikes/lookalike_url_service.h index c299395..2b6af091 100644 --- a/chrome/browser/lookalikes/lookalike_url_service.h +++ b/chrome/browser/lookalikes/lookalike_url_service.h
@@ -34,9 +34,10 @@ // eTLD+1, used for skeleton and edit distance comparison. Must be ASCII. // Empty for non-unique domains, localhost or sites whose eTLD+1 is empty. const std::string domain_and_registry; - // eTLD+1 without the registry part. For "www.google.com", this will be - // "google". Used for edit distance comparisons. - // Empty for non-unique domains, localhost or sites whose eTLD+1 is empty. + // eTLD+1 without the registry part, and with a trailing period. For + // "www.google.com", this will be "google.". Used for edit distance + // comparisons. Empty for non-unique domains, localhost or sites whose eTLD+1 + // is empty. const std::string domain_without_registry; // Result of IDN conversion of domain_and_registry field.
diff --git a/chrome/browser/media/router/BUILD.gn b/chrome/browser/media/router/BUILD.gn index 87f36a1..54a67da 100644 --- a/chrome/browser/media/router/BUILD.gn +++ b/chrome/browser/media/router/BUILD.gn
@@ -214,6 +214,92 @@ } } +source_set("unittests") { + testonly = true + + sources = [ + "issue_manager_unittest.cc", + "media_router_base_unittest.cc", + "media_router_dialog_controller_unittest.cc", + "media_router_factory_unittest.cc", + "media_router_metrics_unittest.cc", + "media_sinks_observer_unittest.cc", + "presentation/browser_presentation_connection_proxy_unittest.cc", + "presentation/local_presentation_manager_factory_unittest.cc", + "presentation/local_presentation_manager_unittest.cc", + "presentation/presentation_media_sinks_observer_unittest.cc", + "presentation/presentation_service_delegate_impl_unittest.cc", + ] + + if (!is_android) { + sources += [ + # In-browser discovery is not used by Android for now. + "discovery/dial/device_description_fetcher_unittest.cc", + "discovery/dial/device_description_service_unittest.cc", + "discovery/dial/dial_app_discovery_service_unittest.cc", + "discovery/dial/dial_device_data_unittest.cc", + "discovery/dial/dial_media_sink_service_impl_unittest.cc", + "discovery/dial/dial_registry_unittest.cc", + "discovery/dial/dial_service_unittest.cc", + "discovery/dial/dial_url_fetcher_unittest.cc", + "discovery/dial/safe_dial_app_info_parser_unittest.cc", + "discovery/dial/safe_dial_device_description_parser_unittest.cc", + "discovery/discovery_network_list_unittest.cc", + "discovery/discovery_network_monitor_metric_observer_unittest.cc", + "discovery/discovery_network_monitor_unittest.cc", + "discovery/mdns/cast_media_sink_service_impl_unittest.cc", + "discovery/mdns/cast_media_sink_service_unittest.cc", + "discovery/mdns/dns_sd_registry_unittest.cc", + "discovery/media_sink_discovery_metrics_unittest.cc", + "event_page_request_manager_unittest.cc", + "media_router_feature_unittest.cc", + "mojo/media_router_desktop_unittest.cc", + "mojo/media_router_mojo_impl_unittest.cc", + "mojo/media_router_mojo_metrics_unittest.cc", + "mojo/media_sink_service_status_unittest.cc", + "providers/cast/cast_activity_manager_unittest.cc", + "providers/cast/cast_activity_record_unittest.cc", + "providers/cast/cast_app_availability_tracker_unittest.cc", + "providers/cast/cast_app_discovery_service_unittest.cc", + "providers/cast/cast_internal_message_util_unittest.cc", + "providers/cast/cast_media_controller_unittest.cc", + "providers/cast/cast_media_route_provider_metrics_unittest.cc", + "providers/cast/cast_media_route_provider_unittest.cc", + "providers/cast/cast_session_client_unittest.cc", + "providers/cast/cast_session_tracker_unittest.cc", + "providers/cast/dual_media_sink_service_unittest.cc", + "providers/cast/mirroring_activity_record_unittest.cc", + "providers/cast/mock_activity_record.cc", + "providers/cast/mock_activity_record.h", + "providers/cast/test_util.cc", + "providers/cast/test_util.h", + "providers/dial/dial_activity_manager_unittest.cc", + "providers/dial/dial_internal_message_util_unittest.cc", + "providers/dial/dial_media_route_provider_unittest.cc", + "providers/extension/extension_media_route_provider_proxy_unittest.cc", + "providers/wired_display/wired_display_media_route_provider_unittest.cc", + ] + } + + if (enable_openscreen) { + include_dirs = [ "//third_party/openscreen/src" ] + + sources += [ + "providers/openscreen/discovery/open_screen_listener_unittest.cc", + "providers/openscreen/network_service_quic_packet_writer_unittest.cc", + ] + } + + deps = [ + ":router", + ":test_support", + "//base", + "//base/test:test_support", + "//testing/gmock", + "//testing/gtest", + ] +} + fuzzer_test("dial_internal_message_fuzzer") { sources = [ "providers/dial/dial_internal_message_fuzzer.cc",
diff --git a/chrome/browser/metrics/process_memory_metrics_emitter.cc b/chrome/browser/metrics/process_memory_metrics_emitter.cc index 38c841c..da7a7b86 100644 --- a/chrome/browser/metrics/process_memory_metrics_emitter.cc +++ b/chrome/browser/metrics/process_memory_metrics_emitter.cc
@@ -111,12 +111,21 @@ &Memory_Experimental::SetExtensions_ValueStore}, {"font_caches", "FontCaches", !kLargeMetric, kEffectiveSize, EmitTo::kSizeInUkmAndUma, &Memory_Experimental::SetFontCaches}, + {"gpu/discardable_cache", "ServiceDiscardableManager", !kLargeMetric, kSize, + EmitTo::kSizeInUmaOnly, nullptr}, + {"gpu/discardable_cache/avg_image_size", + "ServiceDiscardableManager.AvgImageSize", !kLargeMetric, kSize, + EmitTo::kSizeInUmaOnly, nullptr}, {"gpu/gl", "CommandBuffer", kLargeMetric, kEffectiveSize, EmitTo::kSizeInUkmAndUma, &Memory_Experimental::SetCommandBuffer}, {"gpu/gr_shader_cache", "Gpu.GrShaderCache", !kLargeMetric, kEffectiveSize, EmitTo::kSizeInUmaOnly, nullptr}, {"gpu/shared_images", "gpu::SharedImageStub", !kLargeMetric, kEffectiveSize, EmitTo::kIgnored, nullptr}, + {"gpu/transfer_cache", "ServiceTransferCache", !kLargeMetric, kSize, + EmitTo::kSizeInUmaOnly, nullptr}, + {"gpu/transfer_cache/avg_image_size", "ServiceTransferCache.AvgImageSize", + !kLargeMetric, kSize, EmitTo::kSizeInUmaOnly, nullptr}, {"history", "History", !kLargeMetric, kEffectiveSize, EmitTo::kSizeInUkmAndUma, &Memory_Experimental::SetHistory}, {"java_heap", "JavaHeap", kLargeMetric, kEffectiveSize,
diff --git a/chrome/browser/notifications/chime/android/BUILD.gn b/chrome/browser/notifications/chime/android/BUILD.gn new file mode 100644 index 0000000..53fe51cab --- /dev/null +++ b/chrome/browser/notifications/chime/android/BUILD.gn
@@ -0,0 +1,37 @@ +# Copyright 2019 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/rules.gni") + +android_library("java") { + java_files = [ "java/src/org/chromium/chrome/browser/notifications/chime/ChimeSession.java" ] + + annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] + + deps = [ + "//base:base_java", + "//base:jni_java", + "//chrome/android/modules/chime/public:java", + ] +} + +source_set("android") { + sources = [ + "features.cc", + "features.h", + ] + + deps = [ + ":jni_headers", + "//base", + ] +} + +generate_jni("jni_headers") { + visibility = [ ":*" ] + + sources = [ + "java/src/org/chromium/chrome/browser/notifications/chime/ChimeSession.java", + ] +}
diff --git a/chrome/browser/notifications/chime/android/OWNERS b/chrome/browser/notifications/chime/android/OWNERS new file mode 100644 index 0000000..16384f88 --- /dev/null +++ b/chrome/browser/notifications/chime/android/OWNERS
@@ -0,0 +1,3 @@ +dtrainor@chromium.org +hesen@chromium.org +xingliu@chromium.org
diff --git a/chrome/browser/notifications/chime/android/features.cc b/chrome/browser/notifications/chime/android/features.cc new file mode 100644 index 0000000..1e275620 --- /dev/null +++ b/chrome/browser/notifications/chime/android/features.cc
@@ -0,0 +1,20 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/notifications/chime/android/features.h" +#include "chrome/browser/notifications/chime/android/jni_headers/ChimeSession_jni.h" + +jboolean JNI_ChimeSession_IsEnabled(JNIEnv* env) { + return base::FeatureList::IsEnabled( + notifications::features::kChimeNotificationPlatform); +} + +namespace notifications { +namespace features { + +const base::Feature kChimeNotificationPlatform{ + "ChimeNotificationPlatform", base::FEATURE_DISABLED_BY_DEFAULT}; + +} // namespace features +} // namespace notifications
diff --git a/chrome/browser/notifications/chime/android/features.h b/chrome/browser/notifications/chime/android/features.h new file mode 100644 index 0000000..e6759de --- /dev/null +++ b/chrome/browser/notifications/chime/android/features.h
@@ -0,0 +1,19 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_NOTIFICATIONS_CHIME_ANDROID_FEATURES_H_ +#define CHROME_BROWSER_NOTIFICATIONS_CHIME_ANDROID_FEATURES_H_ + +#include "base/feature_list.h" + +namespace notifications { +namespace features { + +// The feature flag to determine whether to use Chime notification platform. +extern const base::Feature kChimeNotificationPlatform; + +} // namespace features +} // namespace notifications + +#endif // CHROME_BROWSER_NOTIFICATIONS_CHIME_ANDROID_FEATURES_H_
diff --git a/chrome/browser/notifications/chime/android/java/src/org/chromium/chrome/browser/notifications/chime/ChimeSession.java b/chrome/browser/notifications/chime/android/java/src/org/chromium/chrome/browser/notifications/chime/ChimeSession.java new file mode 100644 index 0000000..87bb5418 --- /dev/null +++ b/chrome/browser/notifications/chime/android/java/src/org/chromium/chrome/browser/notifications/chime/ChimeSession.java
@@ -0,0 +1,48 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.notifications.chime; + +import org.chromium.base.annotations.NativeMethods; +import org.chromium.chrome.modules.chime.ChimeModule; + +/** + * Used to register to Chime notification platform. + */ +public class ChimeSession { + private static boolean sRegistered; + + /** + * Registers to Chime and start to receive notifications. + */ + public static void start() { + // TODO(xingliu): Find a better way to access feature in Java code. + // https://crbug.com/1017860. + if (!ChimeSessionJni.get().isEnabled() || sRegistered) return; + + // Install the DFM and then reigster. + if (ChimeModule.isInstalled()) { + registerChimeInternal(); + return; + } + + ChimeModule.install((success) -> { + if (success) registerChimeInternal(); + }); + } + + private static void registerChimeInternal() { + assert (ChimeModule.isInstalled()); + sRegistered = true; + ChimeModule.getImpl().register(); + } + + @NativeMethods + interface Natives { + /** + * @return Whether Chime is enabled. + */ + boolean isEnabled(); + } +}
diff --git a/chrome/browser/page_load_metrics/observers/ad_metrics/ads_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/ad_metrics/ads_page_load_metrics_observer_unittest.cc index 5c0ee11..6d56551 100644 --- a/chrome/browser/page_load_metrics/observers/ad_metrics/ads_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/ad_metrics/ads_page_load_metrics_observer_unittest.cc
@@ -46,6 +46,7 @@ #include "content/public/browser/web_contents_observer.h" #include "content/public/common/resource_type.h" #include "content/public/common/url_constants.h" +#include "content/public/test/fake_local_frame.h" #include "content/public/test/navigation_simulator.h" #include "content/public/test/test_navigation_throttle.h" #include "content/public/test/test_navigation_throttle_inserter.h" @@ -324,7 +325,7 @@ // Mock frame remote. Processes calls to SendInterventionReport and waits // for all pending messages to be sent. -class FrameRemoteTester : public blink::mojom::LocalFrame { +class FrameRemoteTester : public content::FakeLocalFrame { public: FrameRemoteTester() = default; ~FrameRemoteTester() override = default; @@ -350,12 +351,6 @@ had_message_ = true; } - void GetTextSurroundingSelection( - uint32_t max_length, - GetTextSurroundingSelectionCallback callback) override {} - - void NotifyUserActivation() override {} - // Sends an empty message and waits for it to be received. Returns true if any // other messages were received. bool FlushForTesting(RenderFrameHost* render_frame_host) {
diff --git a/chrome/browser/reputation/local_heuristics.cc b/chrome/browser/reputation/local_heuristics.cc index ab25965..02626cf 100644 --- a/chrome/browser/reputation/local_heuristics.cc +++ b/chrome/browser/reputation/local_heuristics.cc
@@ -8,8 +8,11 @@ #include "base/strings/string_split.h" #include "chrome/browser/lookalikes/lookalike_url_interstitial_page.h" #include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h" +#include "chrome/browser/lookalikes/lookalike_url_service.h" +#include "chrome/common/chrome_features.h" #include "components/security_state/core/features.h" #include "components/url_formatter/spoof_checks/top_domains/top_domain_util.h" +#include "net/base/registry_controlled_domains/registry_controlled_domain.h" namespace { @@ -33,6 +36,12 @@ std::string matched_domain; MatchType match_type; + // If the domain and registry is empty, this is a private domain and thus + // should never be flagged as malicious. + if (navigated_domain.domain_and_registry.empty()) { + return false; + } + if (!LookalikeUrlNavigationThrottle::GetMatchingDomain( navigated_domain, engaged_sites, &matched_domain, &match_type)) { return false; @@ -54,9 +63,12 @@ case MatchType::kEditDistanceSiteEngagement: return kEnableLookalikeEditDistanceSiteEngagement.Get(); case MatchType::kSiteEngagement: - // ShouldDisplayInterstitial always returns true on kSiteEngagement (i.e. - // an interstitial is always shown for this form of lookalike), so no - // Safety Tip is ever shown. + // We should only ever reach this case when the + // kLookalikeUrlNavigationSuggestionsUI feature is disabled. Otherwise, an + // interstitial will already be shown on the kSiteEngagement match type. + DCHECK(!base::FeatureList::IsEnabled( + features::kLookalikeUrlNavigationSuggestionsUI)); + return true; case MatchType::kNone: NOTREACHED(); } @@ -67,14 +79,39 @@ bool ShouldTriggerSafetyTipFromKeywordInURL( const GURL& url, + const DomainInfo& navigated_domain, const char* const sensitive_keywords[], size_t num_keywords) { - // "eTLD + 1 - 1": "www.google.com" -> "google" - std::string eTLD_plusminus; - base::TrimString(url_formatter::top_domains::HostnameWithoutRegistry( - GetETLDPlusOne(url.host())), - ".", &eTLD_plusminus); - DCHECK(eTLD_plusminus.find('.') == std::string::npos); + // We never want to trigger this heuristic on any non-http / https sites. + if (!url.SchemeIsHTTPOrHTTPS()) { + return false; + } + + std::string eTLD_plus_one = navigated_domain.domain_and_registry; + + // The URL's eTLD + 1 will be empty whenever we're given a host that's + // invalid. + if (eTLD_plus_one.empty()) { + return false; + } + + size_t registry_length = net::registry_controlled_domains::GetRegistryLength( + url, net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES, + net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); + + // Getting a registry length of 0 means that our URL has an uknown registry. + if (registry_length == 0) { + return false; + } + + // "eTLD + 1 - 1": "www.google.com" -> "google.com" -> "google" + std::string eTLD_plusminus = + eTLD_plus_one.substr(0, eTLD_plus_one.size() - registry_length - 1); + + // We should never end up with a "." in our eTLD + 1 - 1 + DCHECK_EQ(eTLD_plusminus.find("."), std::string::npos); + // Any problems that would result in an empty eTLD + 1 - 1 should have been + // caught bia the |eTLD_plus_one| check. const std::vector<std::string> eTLD_plusminus_parts = base::SplitString( eTLD_plusminus, "-", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
diff --git a/chrome/browser/reputation/local_heuristics.h b/chrome/browser/reputation/local_heuristics.h index 15843579..c1e680b0 100644 --- a/chrome/browser/reputation/local_heuristics.h +++ b/chrome/browser/reputation/local_heuristics.h
@@ -16,6 +16,9 @@ // should trigger a safety tip. This algorithm factors in the sites that the // user has already engaged with. This heuristic stores a "safe url" that the // navigated domain is a lookalike to, in the passed |safe_url|. +// +// This heuristic should never be called with a URL which is already in +// |engaged_sites|. bool ShouldTriggerSafetyTipFromLookalike( const GURL& url, const DomainInfo& navigated_domain, @@ -24,8 +27,11 @@ // Checks to see whether a given URL contains sensitive keywords in a way // that it should trigger a safety tip. +// +// URLs without a TLD or with an unknown TLD never trigger. bool ShouldTriggerSafetyTipFromKeywordInURL( const GURL& url, + const DomainInfo& navigated_domain, const char* const sensitive_keywords[], size_t num_keywords);
diff --git a/chrome/browser/reputation/local_heuristics_unittest.cc b/chrome/browser/reputation/local_heuristics_unittest.cc index 417e3c0..84b7143 100644 --- a/chrome/browser/reputation/local_heuristics_unittest.cc +++ b/chrome/browser/reputation/local_heuristics_unittest.cc
@@ -4,6 +4,7 @@ #include <vector> +#include "chrome/browser/lookalikes/lookalike_url_service.h" #include "chrome/browser/reputation/local_heuristics.h" #include "testing/gtest/include/gtest/gtest.h" @@ -100,12 +101,72 @@ // Make sure passing a lot of keywords doesn't result in a false negative. {GURL("http://evil-bad-keyword-example.com"), true}, + + // Test a few cases with edge-case URLs. URLs with unknown registries + // shouldn't trigger. + {GURL("http://foo"), false}, + {GURL("http://foo.invalidregistry"), false}, + {GURL("http://evil-site"), false}, + {GURL("http://evil-site.invalidregistry"), false}, + {GURL("http://this.is.an.evil-site.invalidregistry"), false}, + + // Test some edge cases which the heuristic should gracefully handle. + {GURL("http://localhost"), false}, + {GURL("http://1.2.3.4"), false}, + {GURL("http://127.0.0.1"), false}, + + // Make sure the heuristic never triggers on non-http / https URLs. + {GURL("ftp://www.safe-website.com"), false}, + {GURL("ftp://www.evil-website.com"), false}, + {GURL("garbage://www.evil-website.com"), false}, + + // Ensure that the URL path doesn't affect the heuristic. + {GURL("http://www.evil-site.com/some/random/path"), true}, + {GURL("http://www.safe-site.com/evil-path/even-more-evil-path"), false}, + {GURL("http://www.evil.com/safe-path/"), false}, + {GURL("http://www.evil.com/safe-path/evil"), false}, + {GURL("http://www.evil.com/evil-path/"), false}, + + // Ensure a really long path doesn't affect the heuristic. + {GURL("http://www.safe.com/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/safe-path/evil/evil/evil/evil/evil/" + "evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/evil/"), + false}, }; for (const auto& test_case : test_cases) { + const DomainInfo test_case_navigated_domain = GetDomainInfo(test_case.url); ASSERT_EQ(test_case.should_trigger, ShouldTriggerSafetyTipFromKeywordInURL( - test_case.url, keywords.data(), keywords.size())) + test_case.url, test_case_navigated_domain, keywords.data(), + keywords.size())) << "Expected that \"" << test_case.url << "\" should" << (test_case.should_trigger ? "" : "n't") << " trigger but it did" << (test_case.should_trigger ? "n't" : "");
diff --git a/chrome/browser/reputation/reputation_service.cc b/chrome/browser/reputation/reputation_service.cc index 7284cd20..757f9d1 100644 --- a/chrome/browser/reputation/reputation_service.cc +++ b/chrome/browser/reputation/reputation_service.cc
@@ -154,7 +154,7 @@ ReputationService::ReputationService(Profile* profile) : profile_(profile) {} -ReputationService::~ReputationService() {} +ReputationService::~ReputationService() = default; // static ReputationService* ReputationService::Get(Profile* profile) { @@ -257,7 +257,7 @@ // 5. Keyword heuristics. if (ShouldTriggerSafetyTipFromKeywordInURL( - url, top500_domains::kTop500Keywords, 500)) { + url, navigated_domain, top500_domains::kTop500Keywords, 500)) { std::move(callback).Run(security_state::SafetyTipStatus::kBadKeyword, IsIgnored(url), url, GURL()); return;
diff --git a/chrome/browser/reputation/reputation_web_contents_observer.cc b/chrome/browser/reputation/reputation_web_contents_observer.cc index 0091e526..4c7d732 100644 --- a/chrome/browser/reputation/reputation_web_contents_observer.cc +++ b/chrome/browser/reputation/reputation_web_contents_observer.cc
@@ -67,13 +67,14 @@ } // namespace -ReputationWebContentsObserver::~ReputationWebContentsObserver() {} +ReputationWebContentsObserver::~ReputationWebContentsObserver() = default; void ReputationWebContentsObserver::DidFinishNavigation( content::NavigationHandle* navigation_handle) { if (!navigation_handle->IsInMainFrame() || navigation_handle->IsSameDocument() || - !navigation_handle->HasCommitted()) { + !navigation_handle->HasCommitted() || navigation_handle->IsErrorPage()) { + MaybeCallReputationCheckCallback(); return; }
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_shared_styles.css b/chrome/browser/resources/chromeos/assistant_optin/assistant_shared_styles.css index a4e5fdf..bfd4372 100644 --- a/chrome/browser/resources/chromeos/assistant_optin/assistant_shared_styles.css +++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_shared_styles.css
@@ -51,6 +51,7 @@ #logo { height: 32px; margin: 0; + width: 32px; } #next-button {
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_value_prop.css b/chrome/browser/resources/chromeos/assistant_optin/assistant_value_prop.css index 81c6a29f..2a7e71c 100644 --- a/chrome/browser/resources/chromeos/assistant_optin/assistant_value_prop.css +++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_value_prop.css
@@ -4,7 +4,7 @@ #value-prop-view { display: block; - height: 256px; + height: 232px; margin: auto; }
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_voice_match.css b/chrome/browser/resources/chromeos/assistant_optin/assistant_voice_match.css index fefffcf..7650817 100644 --- a/chrome/browser/resources/chromeos/assistant_optin/assistant_voice_match.css +++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_voice_match.css
@@ -44,9 +44,10 @@ #recording-container, #already-setup-container { display: none; - height: 460px; + flex-grow: 1; } +.container, .intro #intro-container, .already-setup #already-setup-container { display: flex;
diff --git a/chrome/browser/resources/chromeos/chromevox/BUILD.gn b/chrome/browser/resources/chromeos/chromevox/BUILD.gn index 0b2b5ddfe..99d91eb0 100644 --- a/chrome/browser/resources/chromeos/chromevox/BUILD.gn +++ b/chrome/browser/resources/chromeos/chromevox/BUILD.gn
@@ -46,78 +46,19 @@ "chromevox/background/options.js", "chromevox/background/prefs.js", "chromevox/background/tabs_api_handler.js", - "chromevox/injected/active_indicator.js", - "chromevox/injected/api_implementation.js", - "chromevox/injected/event_suspender.js", - "chromevox/injected/event_watcher.js", - "chromevox/injected/history.js", - "chromevox/injected/init_document.js", - "chromevox/injected/init_globals.js", - "chromevox/injected/initial_speech.js", - "chromevox/injected/keyboard_handler.js", - "chromevox/injected/live_regions.js", - "chromevox/injected/navigation_history.js", - "chromevox/injected/navigation_manager.js", - "chromevox/injected/navigation_shifter.js", - "chromevox/injected/navigation_speaker.js", - "chromevox/injected/node_breadcrumb.js", - "chromevox/injected/script_installer.js", - "chromevox/injected/serializer.js", - "chromevox/injected/ui/braille_overlay_widget.js", - "chromevox/injected/ui/context_menu_widget.js", - "chromevox/injected/ui/keyboard_help_widget.js", - "chromevox/injected/ui/node_search_widget.js", - "chromevox/injected/ui/overlay_widget.js", - "chromevox/injected/ui/search_widget.js", - "chromevox/injected/ui/select_widget.js", - "chromevox/injected/ui/spoken_messages.js", - "chromevox/injected/ui/widget.js", - "chromevox/injected/user_commands.js", - "chromevox/injected/user_event_detail.js", - "common/aria_util.js", - "common/aural_style_util.js", - "common/braille_text_handler.js", - "common/braille_util.js", - "common/buildinfo.js", + "cvox2/injected/api_implementation.js", + "cvox2/injected/script_installer.js", "common/chromevox.js", - "common/chromevox_json.js", "common/command_store.js", "common/composite_tts.js", - "common/content_editable_extractor.js", - "common/cursor.js", - "common/cursor_selection.js", - "common/date_widget.js", - "common/description_util.js", - "common/dom_predicates.js", - "common/dom_util.js", - "common/earcon_util.js", - "common/editable_text.js", - "common/editable_text_area_shadow.js", "common/editable_text_base.js", - "common/find_util.js", - "common/focus_util.js", - "common/focuser.js", - "common/group_util.js", - "common/interframe.js", "common/key_sequence.js", "common/key_util.js", - "common/media_widget.js", - "common/memoize.js", + "common/keyboard_handler.js", "common/msgs.js", "common/nav_description.js", - "common/nav_math_description.js", - "common/node_state.js", - "common/page_selection.js", - "common/platform_util.js", - "common/selection_util.js", "common/spannable.js", "common/string_util.js", - "common/table_util.js", - "common/time_widget.js", - "common/traverse_content.js", - "common/traverse_table.js", - "common/traverse_util.js", - "common/xpath_util.js", "cvox2/background/automation_object_constructor_installer.js", "cvox2/background/automation_predicate.js", "cvox2/background/automation_util.js", @@ -142,8 +83,8 @@ "cvox2/background/gesture_command_data.js", "cvox2/background/gesture_command_handler.js", "cvox2/background/i_search.js", - "cvox2/background/keyboard_handler.js", "cvox2/background/language_switching.js", + "cvox2/background/keyboard_handler.js", "cvox2/background/live_regions.js", "cvox2/background/log.js", "cvox2/background/log_store.js", @@ -164,48 +105,17 @@ "cvox2/background/tree_dumper.js", "cvox2/background/tree_walker.js", "cvox2/background/tutorial.js", - "cvox2/injected/keyboard_handler.js", "cvox2/injected/loader.js", - "extensions/searchvox/abstract_result.js", - "extensions/searchvox/constants.js", - "extensions/searchvox/context_menu.js", - "extensions/searchvox/loader.js", - "extensions/searchvox/results.js", - "extensions/searchvox/search.js", - "extensions/searchvox/search_tools.js", - "extensions/searchvox/util.js", - "host/chrome/braille.js", "host/chrome/braille_background.js", "host/chrome/classic_earcons.js", - "host/chrome/earcons.js", "host/chrome/extension_bridge.js", - "host/chrome/host.js", - "host/chrome/tts.js", "host/chrome/tts_background.js", "host/chrome/tts_base.js", "host/interface/abstract_earcons.js", - "host/interface/abstract_host.js", "host/interface/abstract_tts.js", "host/interface/braille_interface.js", - "host/interface/host_factory.js", "host/interface/tts_interface.js", "third_party/tamachiyomi/ja_phonetic_data.js", - "walkers/abstract_node_walker.js", - "walkers/abstract_selection_walker.js", - "walkers/abstract_shifter.js", - "walkers/abstract_walker.js", - "walkers/bare_object_walker.js", - "walkers/character_walker.js", - "walkers/column_walker.js", - "walkers/group_walker.js", - "walkers/layout_line_walker.js", - "walkers/object_walker.js", - "walkers/row_walker.js", - "walkers/sentence_walker.js", - "walkers/structural_line_walker.js", - "walkers/table_shifter.js", - "walkers/table_walker.js", - "walkers/word_walker.js", ] # Closure library modules neede by chromevox. @@ -239,7 +149,6 @@ if (chromevox_compress_js) { deps += [ ":chromevox_background_script", - ":chromevox_content_script", ":chromevox_kbexplorer_script", ":chromevox_log_script", ":chromevox_min_content_script", @@ -252,7 +161,6 @@ } chromevox_background_script_loader_file = "cvox2/background/loader.js" -chromevox_content_script_loader_file = "chromevox/injected/loader.js" chromevox_kbexplorer_loader_file = "chromevox/background/kbexplorer_loader.js" chromevox_log_loader_file = "cvox2/background/log_loader.js" chromevox_min_content_script_loader_file = "cvox2/injected/loader.js" @@ -293,14 +201,10 @@ "chromevox/background/earcons/wrap.ogg", "chromevox/background/earcons/wrap_edge.ogg", "chromevox/background/kbexplorer.html", - "chromevox/background/keymaps/classic_keymap.json", - "chromevox/background/keymaps/experimental.json", - "chromevox/background/keymaps/flat_keymap.json", "chromevox/background/keymaps/next_keymap.json", "chromevox/background/options.css", "chromevox/background/options.html", "chromevox/background/unchecked.png", - "chromevox/injected/api.js", "cvox2/background/background.html", "cvox2/background/earcons/control.wav", "cvox2/background/earcons/selection.wav", @@ -312,6 +216,7 @@ "cvox2/background/log.html", "cvox2/background/panel.css", "cvox2/background/panel.html", + "cvox2/injected/api.js", "images/chromevox-128.png", "images/chromevox-16.png", "images/chromevox-19.png", @@ -328,7 +233,6 @@ sources += [ "closure/closure_preinit.js", chromevox_background_script_loader_file, - chromevox_content_script_loader_file, chromevox_kbexplorer_loader_file, chromevox_log_loader_file, chromevox_min_content_script_loader_file, @@ -437,13 +341,6 @@ } } - compress_js("chromevox_content_script") { - sources = [ - chromevox_content_script_loader_file, - ] - output_file = "$chromevox_out_dir/chromeVoxChromePageScript.js" - } - compress_js("chromevox_kbexplorer_script") { sources = [ chromevox_kbexplorer_loader_file, @@ -546,14 +443,8 @@ ] + rebase_path(sources, root_build_dir) } -chromevox_test_modules = [ - "host/testing/earcons.js", - "host/testing/host.js", - "host/testing/tts.js", - "testing/spoken_list_builder.js", - "testing/test_msgs.js", - "testing/tester.js", - ] + get_target_outputs(":chromevox_test_messages_js") +chromevox_test_modules = [ "testing/test_msgs.js" ] + + get_target_outputs(":chromevox_test_messages_js") generate_deps_js("chromevox_test_deps_js") { sources = closure_library_modules + chromevox_modules + chromevox_test_modules @@ -576,8 +467,7 @@ "braille/braille_input_handler_test.unitjs", "braille/expanding_braille_translator_test.unitjs", "braille/pan_strategy_test.unitjs", - "common/command_store_test.unitjs", - "host/chrome/braille_integration_test.unitjs", +"common/spannable_test.unitjs", "testing/mock_feedback_test.unitjs", ] gen_include_files = [
diff --git a/chrome/browser/resources/chromeos/chromevox/braille/braille_input_handler_test.unitjs b/chrome/browser/resources/chromeos/chromevox/braille/braille_input_handler_test.unitjs index 789fd66..d1afb20 100644 --- a/chrome/browser/resources/chromeos/chromevox/braille/braille_input_handler_test.unitjs +++ b/chrome/browser/resources/chromeos/chromevox/braille/braille_input_handler_test.unitjs
@@ -170,13 +170,33 @@ }; +FakeEditor.prototype.createValue = function( + text, opt_selStart, opt_selEnd, opt_textOffset) { + var spannable = new Spannable(text, new cvox.ValueSpan(opt_textOffset || 0)); + if (goog.isDef(opt_selStart)) { + opt_selEnd = goog.isDef(opt_selEnd) ? opt_selEnd : opt_selStart; + // TODO(plundblad): This looses the distinction between the selection + // anchor (start) and focus (end). We should use that information to + // decide where to pan the braille display. + if (opt_selStart > opt_selEnd) { + var temp = opt_selStart; + opt_selStart = opt_selEnd; + opt_selEnd = temp; + } + + spannable.setSpan(new cvox.ValueSelectionSpan(), opt_selStart, opt_selEnd); + } + return spannable; +}; + + /** * Calls the {@code onDisplayContentChanged} method of the input handler * with the current editor content and selection. * @private */ FakeEditor.prototype.callOnDisplayContentChanged_ = function() { - var content = cvox.BrailleUtil.createValue( + var content = this.createValue( this.text_, this.selectionStart_, this.selectionEnd_) var grabExtraCells = function() { var span = content.getSpanInstanceOf(cvox.ExtraCellsSpan); @@ -438,7 +458,6 @@ /** @override */ closureModuleDeps: [ 'cvox.BrailleInputHandler', - 'cvox.BrailleUtil', ], /**
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js b/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js index 5d4371e..2c1cb89f 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js +++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js
@@ -25,8 +25,6 @@ goog.require('cvox.ExtensionBridge'); goog.require('cvox.InjectedScriptLoader'); goog.require('cvox.NavBraille'); -goog.require('cvox.PlatformFilter'); -goog.require('cvox.PlatformUtil'); goog.require('cvox.QueueMode'); goog.require('cvox.TabsApiHandler'); goog.require('cvox.TtsBackground'); @@ -216,7 +214,7 @@ // the manifest files. if (COMPILED) { listOfFiles = - ['chromeVoxChromePageScript.js', 'chromeVox2ChromePageScript.js']; + ['chromeVox2ChromePageScript.js']; } else { listOfFiles = [ 'closure/closure_preinit.js', 'closure/base.js', 'deps.js',
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/classic_keymap.json b/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/classic_keymap.json deleted file mode 100644 index 9386c6b..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/classic_keymap.json +++ /dev/null
@@ -1,558 +0,0 @@ -{ "bindings": [ - {"command": "handleTabPrev", - "sequence": {"keys": {"keyCode": [9], - "shiftKey": [true]} - }}, - - {"command": "handleTab", - "sequence": {"keys": {"keyCode": [9]} - }}, - - {"command": "stopSpeech", - "sequence": {"keys": {"ctrlKey": [true], - "keyCode": [17]} - }}, - - {"command": "toggleKeyPrefix", - "sequence": {"keys": {"ctrlKey": [true], - "keyCode": [186]} - }}, - - {"command": "toggleStickyMode", - "sequence": {"keys": {"keyCode": [45]}, - "doubleTap": true, - "platformFilter": 5 - }}, - - {"command": "toggleStickyMode", - "sequence": {"keys": {"keyCode": [91]}, - "doubleTap": true, - "platformFilter": 10 - }}, - - {"command": "passThroughMode", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [27]} - }}, - - {"command": "performDefaultAction", - "sequence": { - "keys": {"keyCode": [13]} - }}, - - {"command": "forceClickOnCurrentItem", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [32]} - }}, - - {"command": "forceDoubleClickOnCurrentItem", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [32]}, - "doubleTap": true - }}, - - {"command": "left", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [37]} - }}, - - {"command": "backward", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [38]} - }}, - - {"command": "right", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [39]} - }}, - - {"command": "forward", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [40]} - }}, - - {"command": "fullyDescribe", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [67, 75]} - }}, - - {"command": "speakTimeAndDate", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [67, 68]} - }}, - - {"command": "readFromHere", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [82]} - }}, - - {"command": "toggleSelection", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [83]} - }}, - - {"command": "jumpToTop", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [36]}, - "platformFilter": 7 - }}, - - {"command": "jumpToTop", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [65]}, - "platformFilter": 8 - }}, - - {"command": "jumpToBottom", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [35]}, - "platformFilter": 7 - }}, - - {"command": "jumpToBottom", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [90]}, - "platformFilter": 8 - }}, - - {"command": "nextGranularity", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [187]} - }}, - - {"command": "previousGranularity", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [189]} - }}, - - {"command": "toggleKeyboardHelp", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [190]} - }}, - - {"command": "toggleSearchWidget", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [191]} - }}, - - {"command": "contextMenu", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [188]} - }}, - - {"command": "decreaseTtsRate", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [219]} - }}, - - {"command": "increaseTtsRate", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [221]} - }}, - - {"command": "decreaseTtsPitch", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [186]} - }}, - - {"command": "increaseTtsPitch", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [222]} - }}, - - {"command": "cyclePunctuationEcho", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [69, 80]} - }}, - - {"command": "cycleTypingEcho", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [69, 84]} - }}, - - {"command": "toggleEarcons", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [69, 69]} - }}, - - {"command": "enterShifter", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [220]} - }}, - - {"command": "exitShifter", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [8]} - }}, - - {"command": "toggleChromeVox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [65, 65]} - }}, - - {"command": "toggleChromeVoxVersion", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [81, 81]} - }}, - - {"command": "readCurrentTitle", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [67, 84]} - }}, - - {"command": "readCurrentURL", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [67, 85]} - }}, - - {"command": "readLinkURL", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [67, 76]} - }}, - - {"command": "openLongDesc", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [67, 68]} - }}, - - {"command": "showFormsList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [76, 70]} - }}, - - {"command": "showHeadingsList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [76, 72]} - }}, - - {"command": "showLandmarksList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [76, 186]} - }}, - - {"command": "showLinksList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [76, 76]} - }}, - - {"command": "showTablesList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [76, 84]} - }}, - - {"command": "nextHeading1", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 49]} - }}, - - {"command": "nextHeading2", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 50]} - }}, - - {"command": "nextHeading3", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 51]} - }}, - - {"command": "nextHeading4", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 52]} - }}, - - {"command": "nextHeading5", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 53]} - }}, - - {"command": "nextHeading6", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 54]} - }}, - - {"command": "nextArticle", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 65]} - }}, - - {"command": "nextButton", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 66]} - }}, - - {"command": "nextComboBox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 67]} - }}, - - {"command": "nextEditText", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 69]} - }}, - - {"command": "nextFormField", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 70]} - }}, - - {"command": "nextGraphic", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 71]} - }}, - - {"command": "nextHeading", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 72]} - }}, - - {"command": "nextListItem", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 73]} - }}, - - {"command": "nextLink", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 76]} - }}, - - {"command": "nextList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 79]} - }}, - - {"command": "nextMath", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 77]} - }}, - - {"command": "nextMedia", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 87]} - }}, - - {"command": "nextRadio", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 82]} - }}, - - {"command": "nextTable", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 84]} - }}, - - {"command": "nextVisitedLink", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 86]} - }}, - - {"command": "nextCheckbox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 88]} - }}, - - {"command": "showKbExplorerPage", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [79, 75]} - }}, - - {"command": "showOptionsPage", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [79, 79]} - }}, - - {"command": "showNextUpdatePage", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [79, 78]} - }}, - - {"command": "help", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [79, 84]} - }}, - - {"command": "previousHeading1", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 49]} - }}, - - {"command": "previousHeading2", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 50]} - }}, - - {"command": "previousHeading3", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 51]} - }}, - - {"command": "previousHeading4", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 52]} - }}, - - {"command": "previousHeading5", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 53]} - }}, - - {"command": "previousHeading6", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 54]} - }}, - - {"command": "previousArticle", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 65]} - }}, - - {"command": "previousButton", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 66]} - }}, - - {"command": "previousComboBox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 67]} - }}, - - {"command": "previousEditText", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 69]} - }}, - - {"command": "previousFormField", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 70]} - }}, - - {"command": "previousGraphic", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 71]} - }}, - - {"command": "previousHeading", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 72]} - }}, - - {"command": "previousListItem", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 73]} - }}, - - {"command": "previousLink", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 76]} - }}, - - {"command": "previousList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 79]} - }}, - - {"command": "previousMath", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 77]} - }}, - - {"command": "previousMedia", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 87]} - }}, - - {"command": "previousRadio", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 82]} - }}, - - {"command": "previousTable", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 84]} - }}, - - {"command": "previousVisitedLink", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 86]} - }}, - - {"command": "previousCheckbox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 88]} - }}, - - {"command": "announceHeaders", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 72]} - }}, - - {"command": "speakTableLocation", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 76]} - }}, - - {"command": "exitShifterContent", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 69]} - }}, - - {"command": "nextLandmark", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 186]} - }}, - - {"command": "previousLandmark", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 186]} - }}, - - {"command": "goToRowFirstCell", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 186]} - }}, - - {"command": "goToColFirstCell", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 188]} - }}, - - {"command": "goToColLastCell", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 190]} - }}, - - {"command": "goToFirstCell", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 219]} - }}, - - {"command": "goToLastCell", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 221]} - }}, - - {"command": "goToRowLastCell", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 222]} - }}, - - {"command": "pauseAllMedia", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [88]} - }}, - - {"command": "enableConsoleTts", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [68, 67]} - }}, - - {"command": "toggleBrailleCaptions", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [68, 66]} - }}, - - {"command": "toggleSemantics", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [77, 83]} - }} - ] -}
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/experimental.json b/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/experimental.json deleted file mode 100644 index 37090b7e..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/experimental.json +++ /dev/null
@@ -1,431 +0,0 @@ -{ "bindings": [ - {"command": "handleTabPrev", - "sequence": {"keys": {"keyCode": [9], - "shiftKey": [true]} - }}, - - {"command": "handleTab", - "sequence": {"keys": {"keyCode": [9]} - }}, - - {"command": "stopSpeech", - "sequence": {"keys": {"ctrlKey": [true], - "keyCode": [17]} - }}, - - {"command": "toggleKeyPrefix", - "sequence": {"keys": {"ctrlKey": [true], - "keyCode": [90]} - }}, - - {"command": "forceClickOnCurrentItem", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [32]} - }}, - - {"command": "left", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [37]} - }}, - - {"command": "backward", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [38]} - }}, - - {"command": "right", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [39]} - }}, - - {"command": "forward", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [40]} - }}, - - {"command": "help", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [72]} - }}, - - {"command": "fullyDescribe", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [75]} - }}, - - {"command": "readFromHere", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [82]} - }}, - - {"command": "toggleSelection", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [83]} - }}, - - {"command": "readLinkURL", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [85]} - }}, - - {"command": "skipBackward", - "sequence": {"cvoxModifier": false, - "keys": {"keyCode": [37]} - }}, - - {"command": "skipForward", - "sequence": {"cvoxModifier": false, - "keys": {"keyCode": [39]} - }}, - - {"command": "decreaseTtsPitch", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [186]} - }}, - - {"command": "nextGranularity", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [187]} - }}, - - {"command": "previousGranularity", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [189]} - }}, - - {"command": "showPowerKey", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [190]} - }}, - - {"command": "toggleSearchWidget", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [191]} - }}, - - {"command": "decreaseTtsRate", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [219]} - }}, - - {"command": "increaseTtsRate", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [221]} - }}, - - {"command": "increaseTtsPitch", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [222]} - }}, - - {"command": "cyclePunctuationLevel", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [81]} - }}, - - {"command": "toggleChromeVox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [65, 65]} - }}, - - {"command": "enableConsoleTts", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [66, 67]} - }}, - - {"command": "readCurrentTitle", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [67, 84]} - }}, - - {"command": "readCurrentURL", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [67, 85]} - }}, - - {"command": "showFormsList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [76, 70]} - }}, - - {"command": "showHeadingsList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [76, 72]} - }}, - - {"command": "showLinksList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [76, 76]} - }}, - - {"command": "showTablesList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [76, 84]} - }}, - - {"command": "nextHeading1", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 49]} - }}, - - {"command": "nextHeading2", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 50]} - }}, - - {"command": "nextHeading3", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 51]} - }}, - - {"command": "nextHeading4", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 52]} - }}, - - {"command": "nextHeading5", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 53]} - }}, - - {"command": "nextHeading6", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 54]} - }}, - - {"command": "nextButton", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 66]} - }}, - - {"command": "nextComboBox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 67]} - }}, - - {"command": "nextEditText", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 69]} - }}, - - {"command": "nextFormField", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 70]} - }}, - - {"command": "nextGraphic", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 71]} - }}, - - {"command": "nextHeading", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 72]} - }}, - - {"command": "nextListItem", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 73]} - }}, - - {"command": "nextLink", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 76]} - }}, - - {"command": "nextList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 79]} - }}, - - {"command": "nextRadio", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 82]} - }}, - - {"command": "nextTable", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 84]} - }}, - - {"command": "nextCheckbox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 88]} - }}, - - {"command": "showKbExplorerPage", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [79, 75]} - }}, - - {"command": "showOptionsPage", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [79, 87]} - }}, - - {"command": "previousHeading1", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 49]} - }}, - - {"command": "previousHeading2", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 50]} - }}, - - {"command": "previousHeading3", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 51]} - }}, - - {"command": "previousHeading4", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 52]} - }}, - - {"command": "previousHeading5", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 53]} - }}, - - {"command": "previousHeading6", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 54]} - }}, - - {"command": "previousButton", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 66]} - }}, - - {"command": "previousComboBox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 67]} - }}, - - {"command": "previousEditText", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 69]} - }}, - - {"command": "previousFormField", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 70]} - }}, - - {"command": "previousGraphic", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 71]} - }}, - - {"command": "previousHeading", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 72]} - }}, - - {"command": "previousListItem", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 73]} - }}, - - {"command": "previousLink", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 76]} - }}, - - {"command": "previousList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 79]} - }}, - - {"command": "previousRadio", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 82]} - }}, - - {"command": "previousTable", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 84]} - }}, - - {"command": "previousCheckbox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 88]} - }}, - - {"command": "toggleTable", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 69]} - }}, - - {"command": "announceHeaders", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 72]} - }}, - - {"command": "speakTableLocation", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 76]} - }}, - - {"command": "showLandmarksList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [76, 186]} - }}, - - {"command": "nextLandmark", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [78, 186]} - }}, - - {"command": "previousLandmark", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [80, 186]} - }}, - - {"command": "skipToRowBeginning", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 186]} - }}, - - {"command": "skipToColBeginning", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 188]} - }}, - - {"command": "skipToColEnd", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 190]} - }}, - - {"command": "skipToBeginning", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 219]} - }}, - - {"command": "skipToEnd", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 221]} - }}, - - {"command": "skipToRowEnd", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84, 222]} - }}, - - {"command": "cycleDomain", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [77, 68]} - }}, - - {"command": "cycleTraversalMode", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [77, 84]} - }}, - - {"command": "toggleExplore", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [77, 69]} - }} - ] -}
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/flat_keymap.json b/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/flat_keymap.json deleted file mode 100644 index bde4680..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/flat_keymap.json +++ /dev/null
@@ -1,621 +0,0 @@ -{ "bindings": [ - {"command": "handleTabPrev", - "sequence": {"keys": {"keyCode": [9], - "shiftKey": [true]} - }}, - - {"command": "handleTab", - "sequence": {"keys": {"keyCode": [9]} - }}, - - {"command": "stopSpeech", - "sequence": {"keys": {"ctrlKey": [true], - "keyCode": [17]} - }}, - - {"command": "enterShifter", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [220]} - }}, - - {"command": "exitShifter", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [8]} - }}, - - {"command": "nextGranularity", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [187]} - }}, - - {"command": "previousGranularity", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [189]} - }}, - - {"command": "toggleKeyPrefix", - "sequence": {"keys": {"ctrlKey": [true], - "keyCode": [186]} - }}, - - {"command": "toggleStickyMode", - "sequence": {"keys": {"keyCode": [45]}, - "doubleTap": true, - "platformFilter": 5 - }}, - - {"command": "toggleStickyMode", - "sequence": {"keys": {"keyCode": [91]}, - "doubleTap": true, - "platformFilter": 10 - }}, - - {"command": "passThroughMode", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [27]} - }}, - - {"command": "performDefaultAction", - "sequence": { - "keys": {"keyCode": [13]} - }}, - - {"command": "forceClickOnCurrentItem", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [32]} - }}, - - {"command": "forceDoubleClickOnCurrentItem", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [32]}, - "doubleTap": true - }}, - - {"command": "previousCharacter", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [37]} - }}, - - {"command": "previousWord", - "sequence": { - "keys": {"keyCode": [37], - "ctrlKey": [true]} - }}, - - - {"command": "previousSentence", - "sequence": { - "keys": {"keyCode": [38], - "altKey": [true]} - }}, - - {"command": "previousLine", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [38]} - }}, - - {"command": "previousGroup", - "sequence": { - "keys": {"keyCode": [38], - "ctrlKey": [true]} - }}, - - {"command": "previousRow", - "sequence": {"keys": {"keyCode": [38], - "altKey": [true], - "shiftKey": [true]} - }}, - - {"command": "previousCol", - "sequence": {"keys": {"keyCode": [37], - "altKey": [true], - "shiftKey": [true]} - }}, - - {"command": "nextCharacter", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [39]} - }}, - - {"command": "nextWord", - "sequence": { - "keys": {"keyCode": [39], - "ctrlKey": [true]} - }}, - - {"command": "nextSentence", - "sequence": { - "keys": {"keyCode": [40], - "altKey": [true]} - }}, - - {"command": "nextLine", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [40]} - }}, - - {"command": "nextGroup", - "sequence": { - "keys": {"keyCode": [40], - "ctrlKey": [true]} - }}, - - {"command": "nextRow", - "sequence": {"keys": {"keyCode": [40], - "altKey": [true], - "shiftKey": [true]} - }}, - - {"command": "nextCol", - "sequence": {"keys": {"keyCode": [39], - "altKey": [true], - "shiftKey": [true]} - }}, - - {"command": "left", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [37], - "shiftKey": [true]} - }}, - - {"command": "backward", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [38], - "shiftKey": [true]} - }}, - - {"command": "forward", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [40], - "shiftKey": [true]} - }}, - - {"command": "right", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [39], - "shiftKey": [true]} - }}, - - {"command": "jumpToTop", - "sequence": { - "keys": {"keyCode": [36], - "ctrlKey": [true]} - }}, - - {"command": "jumpToBottom", - "sequence": { - "keys": {"keyCode": [35], - "ctrlKey": [true]} - }}, - - {"command": "moveToStartOfLine", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [36]} - }}, - - {"command": "moveToEndOfLine", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [35]} - }}, - - {"command": "fullyDescribe", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [75]} - }}, - - {"command": "speakTimeAndDate", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [123]} - }}, - - {"command": "readFromHere", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [82]} - }}, - - {"command": "toggleSelection", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [83]} - }}, - - {"command": "contextMenu", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [188]} - }}, - - {"command": "toggleKeyboardHelp", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [190]} - }}, - - {"command": "toggleSearchWidget", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [191]} - }}, - - {"command": "decreaseTtsRate", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [116]} - }}, - - {"command": "increaseTtsRate", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [117]} - }}, - - {"command": "decreaseTtsPitch", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [118]} - }}, - - {"command": "increaseTtsPitch", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [119]} - }}, - - {"command": "decreaseTtsVolume", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [120]} - }}, - - {"command": "increaseTtsVolume", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [121]} - }}, - - {"command": "cyclePunctuationEcho", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [65, 80]} - }}, - - {"command": "cycleTypingEcho", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [65, 84]} - }}, - - {"command": "toggleEarcons", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [65, 69]} - }}, - - {"command": "showFormsList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [87, 70]} - }}, - - {"command": "showHeadingsList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [87, 72]} - }}, - - {"command": "showLandmarksList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [87, 186]} - }}, - - {"command": "showLinksList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [87, 76]} - }}, - - {"command": "showTablesList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [87, 84]} - }}, - - {"command": "nextHeading1", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [49]} - }}, - - {"command": "nextHeading2", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [50]} - }}, - - {"command": "nextHeading3", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [51]} - }}, - - {"command": "nextHeading4", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [52]} - }}, - - {"command": "nextHeading5", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [53]} - }}, - - {"command": "nextHeading6", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [54]} - }}, - - {"command": "nextButton", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [66]} - }}, - - {"command": "nextComboBox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [67]} - }}, - - {"command": "nextEditText", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [69]} - }}, - - {"command": "nextFormField", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [70]} - }}, - - {"command": "nextGraphic", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [71]} - }}, - - {"command": "nextHeading", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [72]} - }}, - - {"command": "nextListItem", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [73]} - }}, - - {"command": "nextLink", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [76]} - }}, - - {"command": "nextList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [85]} - }}, - - {"command": "nextMath", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [77]} - }}, - - {"command": "nextRadio", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [82]} - }}, - - {"command": "nextTable", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84]} - }}, - - {"command": "nextVisitedLink", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [86]} - }}, - - {"command": "nextCheckbox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [88]} - }}, - - {"command": "showKbExplorerPage", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [79, 75]} - }}, - - {"command": "showOptionsPage", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [79, 79]} - }}, - - {"command": "previousHeading1", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [49], - "shiftKey": [true]} - }}, - - {"command": "previousHeading2", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [50], - "shiftKey": [true]} - }}, - - {"command": "previousHeading3", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [51], - "shiftKey": [true]} - }}, - - {"command": "previousHeading4", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [52], - "shiftKey": [true]} - }}, - - {"command": "previousHeading5", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [53], - "shiftKey": [true]} - }}, - - {"command": "previousHeading6", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [54], - "shiftKey": [true]} - }}, - - {"command": "previousButton", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [66], - "shiftKey": [true]} - }}, - - {"command": "previousComboBox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [67], - "shiftKey": [true]} - }}, - - {"command": "previousEditText", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [69], - "shiftKey": [true]} - }}, - - {"command": "previousFormField", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [70], - "shiftKey": [true]} - }}, - - {"command": "previousGraphic", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [71], - "shiftKey": [true]} - }}, - - {"command": "previousHeading", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [72], - "shiftKey": [true]} - }}, - - {"command": "previousListItem", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [73], - "shiftKey": [true]} - }}, - - {"command": "previousLink", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [76], - "shiftKey": [true]} - }}, - - {"command": "previousList", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [85], - "shiftKey": [true]} - }}, - - {"command": "previousMath", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [77], - "shiftKey": [true]} - }}, - - {"command": "previousRadio", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [82], - "shiftKey": [true]} - }}, - - {"command": "previousTable", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [84], - "shiftKey": [true]} - }}, - - {"command": "previousVisitedLink", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [86], - "shiftKey": [true]} - }}, - - {"command": "previousCheckbox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [88], - "shiftKey": [true]} - }}, - - {"command": "announceHeaders", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [222, 72]} - }}, - - {"command": "speakTableLocation", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [222, 76]} - }}, - - {"command": "nextLandmark", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [186]} - }}, - - {"command": "previousLandmark", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [186], - "shiftKey": [true]} - }}, - - {"command": "goToRowFirstCell", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [222, 186]} - }}, - - {"command": "goToColFirstCell", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [222, 188]} - }}, - - {"command": "goToColLastCell", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [222, 190]} - }}, - - {"command": "goToFirstCell", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [222, 219]} - }}, - - {"command": "goToLastCell", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [222, 221]} - }}, - - {"command": "goToRowLastCell", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [222, 222]} - }}, - - {"command": "help", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [112]} - }}, - - {"command": "readCurrentTitle", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [113]} - }}, - - {"command": "readCurrentURL", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [114]} - }}, - - {"command": "toggleChromeVox", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [115]} - }}, - - {"command": "toggleChromeVoxVersion", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [81, 81]} - }}, - - {"command": "enableConsoleTts", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [68, 67]} - }}, - {"command": "toggleBrailleCaptions", - "sequence": {"cvoxModifier": true, - "keys": {"keyCode": [68, 66]} - }} - ] -}
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/key_map.js b/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/key_map.js index 3e2bf37..82517da 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/key_map.js +++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/key_map.js
@@ -24,7 +24,6 @@ // TODO(dtseng): Only needed for sticky mode. goog.require('cvox.KeyUtil'); -goog.require('cvox.PlatformUtil'); /** * @param {Array<Object<{command: string, sequence: cvox.KeySequence}>>} @@ -68,10 +67,7 @@ * @const */ cvox.KeyMap.AVAILABLE_MAP_INFO = { - 'keymap_classic': {'file': 'classic_keymap.json'}, - 'keymap_flat': {'file': 'flat_keymap.json'}, - 'keymap_next': {'file': 'next_keymap.json'}, - 'keymap_experimental': {'file': 'experimental.json'} + 'keymap_next': {'file': 'next_keymap.json'} }; @@ -314,7 +310,7 @@ cvox.KeyMap.fromDefaults = function() { return /** @type {!cvox.KeyMap} */ (cvox.KeyMap.fromPath( cvox.KeyMap.KEYMAP_PATH + - cvox.KeyMap.AVAILABLE_MAP_INFO['keymap_classic'].file)); + cvox.KeyMap.AVAILABLE_MAP_INFO['keymap_next'].file)); }; @@ -341,10 +337,6 @@ /** @type {Array<Object<{command: string, * sequence: cvox.KeySequence}>>} */ (JSON.parse(json).bindings); - commandsAndKeySequences = commandsAndKeySequences.filter(function(value) { - return value.sequence.platformFilter === undefined || - cvox.PlatformUtil.matchesPlatform(value.sequence.platformFilter); - }); } catch (e) { console.error('Failed to load key map from JSON'); console.error(e);
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json b/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json index 4b86e1d..f4301d8 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json +++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json
@@ -451,26 +451,13 @@ { "command": "toggleStickyMode", "sequence": { - "doubleTap": true, - "keys": { - "keyCode": [ - 45 - ] - }, - "platformFilter": 5 - } - }, - { - "command": "toggleStickyMode", - "sequence": { "skipStripping": false, "doubleTap": true, "keys": { "keyCode": [ 91 ] - }, - "platformFilter": 10 + } } }, {
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js b/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js index 0cbbb9e..1a771d7 100644 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js +++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/options.js
@@ -16,14 +16,10 @@ goog.require('PanelCommand'); goog.require('cvox.BrailleTable'); goog.require('cvox.BrailleTranslatorManager'); -goog.require('cvox.ChromeEarcons'); -goog.require('cvox.ChromeTts'); goog.require('cvox.ChromeVox'); goog.require('cvox.ChromeVoxPrefs'); goog.require('cvox.CommandStore'); goog.require('cvox.ExtensionBridge'); -goog.require('cvox.PlatformFilter'); -goog.require('cvox.PlatformUtil'); /** * Class to manage the options page. @@ -164,10 +160,6 @@ } }); - if (cvox.PlatformUtil.matchesPlatform(cvox.PlatformFilter.WML)) { - $('version').textContent = chrome.app.getDetails().version; - } - var clearVirtualDisplay = function() { var groups = []; var sizeOfDisplay =
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/active_indicator.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/active_indicator.js deleted file mode 100644 index 0d9d25b0..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/active_indicator.js +++ /dev/null
@@ -1,993 +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. - -/** - * @fileoverview Draws and animates the graphical indicator around the active - * object or text range, and handles animation when the indicator is moving. - */ - - -goog.provide('cvox.ActiveIndicator'); - -goog.require('cvox.Cursor'); -goog.require('cvox.DomUtil'); - - -/** - * Constructs and ActiveIndicator, a glowing outline around whatever - * node or text range is currently active. Initially it won't display - * anything; call syncToNode, syncToRange, or syncToCursorSelection to - * make it animate and move. It only displays when this window/iframe - * has focus. - * - * @constructor - */ -cvox.ActiveIndicator = function() { - /** - * The time when the indicator was most recently moved. - * @type {number} - * @private - */ - this.lastMoveTime_ = 0; - - /** - * An estimate of the current zoom factor of the webpage. This is - * needed in order to accurately line up the different pieces of the - * indicator border and avoid rounding errors. - * @type {number} - * @private - */ - this.zoom_ = 1; - - /** - * The parent element of the indicator. - * @type {?Element} - * @private - */ - this.container_ = null; - - /** - * The current indicator rects. - * @type {Array<ClientRect>} - * @private - */ - this.rects_ = null; - - /** - * The most recent target of a call to syncToNode, syncToRange, or - * syncToCursorSelection. - * @type {Array<Node>|Range} - * @private - */ - this.lastSyncTarget_ = null; - - /** - * The most recent client rects for the active indicator, so we - * can tell when it moved. - * @type {ClientRectList|Array<ClientRect>} - * @private - */ - this.lastClientRects_ = null; - - /** - * The id from window.setTimeout when updating the indicator if needed. - * @type {?number} - * @private - */ - this.updateIndicatorTimeoutId_ = null; - - /** - * True if this window is blurred and we shouldn't show the indicator. - * @type {boolean} - * @private - */ - this.blurred_ = false; - - /** - * A cached value of window height. - * @type {number|undefined} - * @private - */ - this.innerHeight_; - - /** - * A cached value of window width. - * @type {number|undefined} - * @private - */ - this.innerWidth_; - - // Hide the indicator when the window doesn't have focus. - window.addEventListener('focus', goog.bind(function() { - this.blurred_ = false; - if (this.container_) { - this.container_.classList.remove('cvox_indicator_window_not_focused'); - } - }, this), false); - window.addEventListener('blur', goog.bind(function() { - this.blurred_ = true; - if (this.container_) { - this.container_.classList.add('cvox_indicator_window_not_focused'); - } - }, this), false); -}; - -/** - * CSS for the active indicator. The basic hierarchy looks like this: - * - * container (pulsing) (animate_normal, animate_quick) - * region (visible) - * top - * middle_nw - * middle_ne - * middle_sw - * middle_se - * bottom - * region (visible) - * top - * middle_nw - * middle_ne - * middle_sw - * middle_se - * bottom - * - * @type {string} - * @const - */ -cvox.ActiveIndicator.STYLE = '.cvox_indicator_container {' + - ' position: absolute !important;' + - ' left: 0 !important;' + - ' top: 0 !important;' + - ' z-index: 2147483647 !important;' + - ' pointer-events: none !important;' + - ' margin: 0px !important;' + - ' padding: 0px !important;' + - '}' + - '.cvox_indicator_window_not_focused {' + - ' visibility: hidden !important;' + - '}' + - '.cvox_indicator_pulsing {' + - ' animation: ' + - // NOTE(deboer): This animation is 0 seconds long to work around - // http://crbug.com/128993. Revert it to 2s when the bug is fixed. - ' cvox_indicator_pulsing_animation 0s 2 alternate !important;' + - ' animation-timing-function: ease-in-out !important;' + - '}' + - '.cvox_indicator_region {' + - ' opacity: 0 !important;' + - ' transition: opacity 1s !important;' + - '}' + - '.cvox_indicator_visible {' + - ' opacity: 1 !important;' + - '}' + - '.cvox_indicator_container .cvox_indicator_region * {' + - ' position:absolute !important;' + - ' box-shadow: 0 0 4px 4px #f7983a !important;' + - ' border-radius: 6px !important;' + - ' margin: 0px !important;' + - ' padding: 0px !important;' + - ' transition: none !important;' + - '}' + - '.cvox_indicator_animate_normal .cvox_indicator_region * {' + - ' transition: all 0.3s !important;' + - '}' + - '.cvox_indicator_animate_quick .cvox_indicator_region * {' + - ' transition: all 0.1s !important;' + - '}' + - '.cvox_indicator_top {' + - ' border-radius: inherit inherit 0 0 !important;' + - '}' + - '.cvox_indicator_middle_nw {' + - ' border-radius: inherit 0 0 0 !important;' + - '}' + - '.cvox_indicator_middle_ne {' + - ' border-radius: 0 inherit 0 0 !important;' + - '}' + - '.cvox_indicator_middle_se {' + - ' border-radius: 0 0 inherit 0 !important;' + - '}' + - '.cvox_indicator_middle_sw {' + - ' border-radius: 0 0 0 inherit !important;' + - '}' + - '.cvox_indicator_bottom {' + - ' border-radius: 0 0 inherit inherit !important;' + - '}' + - '@keyframes cvox_indicator_pulsing_animation {' + - ' 0% {opacity: 1.0}' + - ' 50% {opacity: 0.5}' + - ' 100% {opacity: 1.0}' + - '}'; - -/** - * The minimum number of milliseconds that must have elapsed - * since the last navigation for a quick animation to be allowed. - * @type {number} - * @const - */ -cvox.ActiveIndicator.QUICK_ANIM_DELAY_MS = 100; - -/** - * The minimum number of milliseconds that must have elapsed - * since the last navigation for a normal (slower) animation - * to be allowed. - * @type {number} - * @const - */ -cvox.ActiveIndicator.NORMAL_ANIM_DELAY_MS = 300; - -/** - * Margin between the active object's rect and the indicator border. - * @type {number} - * @const - */ -cvox.ActiveIndicator.MARGIN = 8; - -/** - * Remove the indicator from the DOM. - */ -cvox.ActiveIndicator.prototype.removeFromDom = function() { - if (this.container_ && this.container_.parentElement) { - this.container_.parentElement.removeChild(this.container_); - } -}; - -/** - * Move the indicator to surround the given node. - * @param {Node} node The new target of the indicator. - */ -cvox.ActiveIndicator.prototype.syncToNode = function(node) { - if (!node) { - return; - } - // In the navigation manager, and specifically the node walkers, focusing - // on the body means we are before the beginning of the document. In - // that case, we simply hide the active indicator. - if (node == document.body) { - this.removeFromDom(); - return; - } - this.syncToNodes([node]); -}; - -/** - * Move the indicator to surround the given nodes. - * @param {Array<Node>} nodes The new targets of the indicator. - */ -cvox.ActiveIndicator.prototype.syncToNodes = function(nodes) { - var clientRects = this.clientRectsFromNodes_(nodes); - this.moveIndicator_(clientRects, cvox.ActiveIndicator.MARGIN); - this.lastSyncTarget_ = nodes; - this.lastClientRects_ = clientRects; - if (this.updateIndicatorTimeoutId_ != null) { - window.clearTimeout(this.updateIndicatorTimeoutId_); - this.updateIndicatorTimeoutId_ = null; - } -}; - -/** - * Move the indicator to surround the given range. - * @param {Range} range The range. - */ -cvox.ActiveIndicator.prototype.syncToRange = function(range) { - var margin = cvox.ActiveIndicator.MARGIN; - if (range.startContainer == range.endContainer && - range.startOffset + 1 == range.endOffset) { - margin = 1; - } - - var clientRects = range.getClientRects(); - this.moveIndicator_(clientRects, margin); - this.lastSyncTarget_ = range; - this.lastClientRects_ = clientRects; - if (this.updateIndicatorTimeoutId_ != null) { - window.clearTimeout(this.updateIndicatorTimeoutId_); - this.updateIndicatorTimeoutId_ = null; - } -}; - -/** - * Move the indicator to surround the given cursor range. - * @param {!cvox.CursorSelection} sel The start cursor position. - */ -cvox.ActiveIndicator.prototype.syncToCursorSelection = function(sel) { - if (sel.start.node == sel.end.node && sel.start.index == sel.end.index) { - this.syncToNode(sel.start.node); - } else { - var range = document.createRange(); - range.setStart(sel.start.node, sel.start.index); - range.setEnd(sel.end.node, sel.end.index); - this.syncToRange(range); - } -}; - -/** - * Called when we should check to see if the indicator target has moved. - * Schedule it after a short delay so that we don't waste a lot of time - * updating. - */ -cvox.ActiveIndicator.prototype.updateIndicatorIfChanged = function() { - if (this.updateIndicatorTimeoutId_) { - return; - } - this.updateIndicatorTimeoutId_ = window.setTimeout(goog.bind(function() { - this.handleUpdateIndicatorIfChanged_(); - }, this), 100); -}; - -/** - * Called when we should check to see if the indicator target has moved. - * Schedule it after a short delay so that we don't waste a lot of time - * updating. - * @private - */ -cvox.ActiveIndicator.prototype.handleUpdateIndicatorIfChanged_ = function() { - this.updateIndicatorTimeoutId_ = null; - if (!this.lastSyncTarget_) { - return; - } - - var newClientRects; - if (this.lastSyncTarget_ instanceof Array) { - newClientRects = this.clientRectsFromNodes_(this.lastSyncTarget_); - } else { - newClientRects = this.lastSyncTarget_.getClientRects(); - } - if (!newClientRects || newClientRects.length == 0) { - this.syncToNode(document.body); - return; - } - - var needsUpdate = false; - if (newClientRects.length != this.lastClientRects_.length) { - needsUpdate = true; - } else { - for (var i = 0; i < this.lastClientRects_.length; ++i) { - var last = this.lastClientRects_[i]; - var current = newClientRects[i]; - if (last.top != current.top || last.right != current.right || - last.bottom != current.bottom || last.left != last.left) { - needsUpdate = true; - break; - } - } - } - if (needsUpdate) { - this.moveIndicator_(newClientRects, cvox.ActiveIndicator.MARGIN); - this.lastClientRects_ = newClientRects; - } -}; - -/** - * @param {Array<Node>} nodes An array of nodes. - * @return {Array<ClientRect>} An array of client rects corresponding to - * those nodes. - * @private - */ -cvox.ActiveIndicator.prototype.clientRectsFromNodes_ = function(nodes) { - var clientRects = []; - for (var i = 0; i < nodes.length; ++i) { - var node = nodes[i]; - if (node.constructor == Text) { - var range = document.createRange(); - range.selectNode(node); - var rangeRects = range.getClientRects(); - for (var j = 0; j < rangeRects.length; ++j) - clientRects.push(rangeRects[j]); - } else { - while (!node.getClientRects) { - node = node.parentElement; - } - if (!node) { - return []; - } - var nodeRects = node.getClientRects(); - for (var j = 0; j < nodeRects.length; ++j) - clientRects.push(nodeRects[j]); - } - } - return clientRects; -}; - -/** - * Move the indicator from its current location, if any, to surround - * the given set of rectanges. - * - * The rectangles need not be contiguous - they're automatically - * grouped into contiguous regions. The first region is "primary" - it - * gets animated smoothly from the previous location to the new location. - * Any other region (like, for example, a text range - * that continues on a second column) gets a temporary outline that - * disappears as soon as the indicator moves again. - * - * A single region does not have to be rectangular - a region outline - * is designed to handle the slightly non-rectangular shape of a typical - * text paragraph, but not anything more complicated than that. - * - * @param {ClientRectList|Array<ClientRect>} immutableRects The object - * rectangles. - * @param {number} margin Margin in pixels. - * @private - */ -cvox.ActiveIndicator.prototype.moveIndicator_ = function( - immutableRects, margin) { - // Never put the active indicator into the DOM when the whole page is - // contentEditable; it will end up part of content that the user may - // be trying to edit. - if (document.body.isContentEditable) { - this.removeFromDom(); - return; - } - - var n = immutableRects.length; - if (n == 0) { - return; - } - - // Offset the rects by documentElement, body, and/or scroll offsets, - // while copying them into a new mutable array. - var offsetX; - var offsetY; - if (window.getComputedStyle(document.body, null).position != 'static') { - offsetX = -document.body.getBoundingClientRect().left; - offsetY = -document.body.getBoundingClientRect().top; - } else if ( - window.getComputedStyle(document.documentElement, null).position != - 'static') { - offsetX = -document.documentElement.getBoundingClientRect().left; - offsetY = -document.documentElement.getBoundingClientRect().top; - } else { - offsetX = window.pageXOffset; - offsetY = window.pageYOffset; - } - - var rects = []; - for (var i = 0; i < n; i++) { - rects.push( - this.inset_(immutableRects[i], offsetX, offsetY, -offsetX, -offsetY)); - } - - // Create and attach the container if it doesn't exist or if it was detached. - if (!this.container_ || !this.container_.parentElement) { - // In case there are any detached containers around, clean them up. One case - // that requires clean up like this is when users download a file on Chrome - // on Android. - var oldContainers = - document.getElementsByClassName('cvox_indicator_container'); - for (var j = 0, oldContainer; oldContainer = oldContainers[j]; j++) { - if (oldContainer.parentNode) { - oldContainer.parentNode.removeChild(oldContainer); - } - } - this.container_ = this.createDiv_( - document.body, 'cvox_indicator_container', document.body.firstChild); - } - - // Add the CSS style to the page if it's not already there. - var style = document.createElement('style'); - style.id = 'cvox_indicator_style'; - style.innerHTML = cvox.ActiveIndicator.STYLE; - cvox.DomUtil.addNodeToHead(style, style.id); - - // Decide on the animation speed. By default we do a medium-speed - // animation between the previous and new location. If the user is - // moving rapidly, we do a fast animation, or no animation. - var now = new Date().getTime(); - var delta = now - this.lastMoveTime_; - this.container_.className = 'cvox_indicator_container'; - if (!cvox.ChromeVox.documentHasFocus() || this.blurred_) { - this.container_.classList.add('cvox_indicator_window_not_focused'); - } - if (delta > cvox.ActiveIndicator.NORMAL_ANIM_DELAY_MS) { - this.container_.classList.add('cvox_indicator_animate_normal'); - } else if (delta > cvox.ActiveIndicator.QUICK_ANIM_DELAY_MS) { - this.container_.classList.add('cvox_indicator_animate_quick'); - } - this.lastMoveTime_ = now; - - // Compute the zoom level of the browser - this is needed to avoid - // roundoff errors when placing the various pieces of the region - // outline. - this.computeZoomLevel_(); - - // Make it start pulsing after it's drawn the first frame - this is so - // that the opacity is always 100% when the indicator appears, and only - // starts pulsing afterwards. - window.setTimeout(goog.bind(function() { - this.container_.classList.add('cvox_indicator_pulsing'); - }, this), 0); - - // If there was more than one region previously, delete all except - // the first one. - while (this.container_.childElementCount > 1) { - this.container_.removeChild(this.container_.lastElementChild); - } - - // Split the rects into contiguous regions. - var regions = [[rects[0]]]; - var regionRects = [rects[0]]; - for (i = 1; i < rects.length; i++) { - var found = false; - for (var j = 0; j < regions.length && !found; j++) { - if (this.intersects_(rects[i], regionRects[j])) { - regions[j].push(rects[i]); - regionRects[j] = this.union_(regionRects[j], rects[i]); - found = true; - } - } - if (!found) { - regions.push([rects[i]]); - regionRects.push(rects[i]); - } - } - - // Keep merging regions that intersect. - // TODO(dmazzoni): reduce the worst-case complexity! This appears like - // it could be O(n^3), make sure it's not in practice. - do { - var merged = false; - for (i = 0; i < regions.length - 1 && !merged; i++) { - for (j = i + 1; j < regions.length && !merged; j++) { - if (this.intersects_(regionRects[i], regionRects[j])) { - regions[i] = regions[i].concat(regions[j]); - regionRects[i] = this.union_(regionRects[i], regionRects[j]); - regions.splice(j, 1); - regionRects.splice(j, 1); - merged = true; - } - } - } - } while (merged); - - // Sort rects within each region by y and then x position. - for (i = 0; i < regions.length; i++) { - regions[i].sort(function(r1, r2) { - if (r1.top != r2.top) { - return r1.top - r2.top; - } else { - return r1.left - r2.left; - } - }); - } - - // Draw each indicator region. The first region attempts to re-use the - // existing elements (which results in animating the transition). - for (i = 0; i < regions.length; i++) { - var parent = null; - if (i == 0 && this.container_.childElementCount == 1 && - this.container_.children[0].childElementCount == 6) { - parent = this.container_.children[0]; - } - this.updateIndicatorRegion_(regions[i], parent, margin); - } -}; - -/** - * Update one indicator region - a set of contiguous rectangles on the - * page. - * - * A region is made up of six pieces, designed to handle the shape of a - * typical text paragraph: - * - * TOP TOP TOP - * TOP TOP - * NW NW NW NW NW NE NE NE NE NE NE NE NE NE - * NW NE - * NW NE - * SW SE - * SW SE - * SW SW BOTTOM BOTTOM SE SE - * BOTTOM BOTTOM - * BOTTOM BOTTOM BOTTOM BOTTOM BOTTOM - * - * When there's only a single rectangle - like when outlining something - * simple like a button, all six pieces are still used - this makes the - * animation smooth when sliding from a paragraph to a rectangular object - * and then to another paragraph, for example: - * - * TOP TOP TOP TOP TOP TOP TOP - * TOP TOP - * NW NE - * NW NE - * SW SE - * SW SE - * BOTTOM BOTTOM - * BOTTOM BOTTOM BOTTOM BOTTOM - * - * Each piece is just a div that uses CSS to absolutely position itself. - * The outline effect is done using the 'box-shadow' property around the - * whole box, with the 'clip' property used to make sure that only 2 - 3 - * sides of the box are actually shown. - * - * This code is very subtle! If you want to adjust something by a few - * pixels, be prepared to do LOTS of testing! - * - * Tip: while debugging, comment out the clipping and make each rectangle - * a different color. That will make it much easier to see where each piece - * starts and ends. - * - * @param {Array<ClientRect>} rects The list of rects in the region. - * These should already be sorted (top to bottom and left to right). - * @param {?Element} parent If present, try to reuse the existing element - * (and animate the transition). - * @param {number} margin Margin in pixels. - * @private - */ -cvox.ActiveIndicator.prototype.updateIndicatorRegion_ = function( - rects, parent, margin) { - if (parent) { - // Reuse the existing element (so we animate to the new location). - var regionTop = parent.children[0]; - var regionMiddleNW = parent.children[1]; - var regionMiddleNE = parent.children[2]; - var regionMiddleSW = parent.children[3]; - var regionMiddleSE = parent.children[4]; - var regionBottom = parent.children[5]; - } else { - // Create a new region (when the indicator first appears, or when - // this is a secondary region, like for text continuing on a second - // column). - parent = this.createDiv_(this.container_, 'cvox_indicator_region'); - window.setTimeout(function() { - parent.classList.add('cvox_indicator_visible'); - }, 0); - regionTop = this.createDiv_(parent, 'cvox_indicator_top'); - regionMiddleNW = this.createDiv_(parent, 'cvox_indicator_middle_nw'); - regionMiddleNE = this.createDiv_(parent, 'cvox_indicator_middle_ne'); - regionMiddleSW = this.createDiv_(parent, 'cvox_indicator_middle_sw'); - regionMiddleSE = this.createDiv_(parent, 'cvox_indicator_middle_se'); - regionBottom = this.createDiv_(parent, 'cvox_indicator_bottom'); - } - - // Grab all of the rectangles in the top row. - var topRect = rects[0]; - var topMiddle = Math.floor((topRect.top + topRect.bottom) / 2); - var topIndex = 1; - var n = rects.length; - while (topIndex < n && rects[topIndex].top < topMiddle) { - topRect = this.union_(topRect, rects[topIndex]); - topMiddle = Math.floor((topRect.top + topRect.bottom) / 2); - topIndex++; - } - - if (topIndex == n) { - // Everything fits on one line, so use special case code to form - // the region into a rectangle. - var r = this.inset_(topRect, -margin, -margin, -margin, -margin); - var q1 = Math.floor((3 * r.top + 1 * r.bottom) / 4); - var q2 = Math.floor((2 * r.top + 2 * r.bottom) / 4); - var q3 = Math.floor((1 * r.top + 3 * r.bottom) / 4); - this.setElementCoords_( - regionTop, r.left, r.top, r.right, q1, true, true, true, false); - this.setElementCoords_( - regionMiddleNW, r.left, q1, r.left, q2, true, true, false, false); - this.setElementCoords_( - regionMiddleSW, r.left, q2, r.left, q3, true, false, false, true); - this.setElementCoords_( - regionMiddleNE, r.right, q1, r.right, q2, false, true, true, false); - this.setElementCoords_( - regionMiddleSE, r.right, q2, r.right, q3, false, false, true, true); - this.setElementCoords_( - regionBottom, r.left, q3, r.right, r.bottom, true, false, true, true); - return; - } - - // Start from the end and grab all of the rectangles in the bottom row. - var bottomRect = rects[n - 1]; - var bottomMiddle = Math.floor((bottomRect.top + bottomRect.bottom) / 2); - var bottomIndex = n - 2; - while (bottomIndex >= 0 && rects[bottomIndex].bottom > bottomMiddle) { - bottomRect = this.union_(bottomRect, rects[bottomIndex]); - bottomMiddle = Math.floor((bottomRect.top + bottomRect.bottom) / 2); - bottomIndex--; - } - - // Extend the top and bottom rectangles a bit. - topRect = this.inset_(topRect, -margin, -margin, -margin, margin); - bottomRect = this.inset_(bottomRect, -margin, margin, -margin, -margin); - - // Whatever's in-between the top and bottom is the "middle". - var middleRect; - if (topIndex > bottomIndex) { - middleRect = this.union_(topRect, bottomRect); - middleRect.top = topRect.bottom; - middleRect.bottom = bottomRect.top; - middleRect.height = Math.floor((middleRect.top + middleRect.bottom) / 2); - } else { - middleRect = rects[topIndex]; - var middleIndex = topIndex + 1; - while (middleIndex <= bottomIndex) { - middleRect = this.union_(middleRect, rects[middleIndex]); - middleIndex++; - } - middleRect = this.inset_(middleRect, -margin, -margin, -margin, -margin); - middleRect.left = Math.min(middleRect.left, topRect.left, bottomRect.left); - middleRect.right = - Math.max(middleRect.right, topRect.right, bottomRect.right); - middleRect.width = middleRect.right - middleRect.left; - } - - // If the top or bottom is pretty close to the edge of the middle box, - // make them flush. - if (topRect.right > middleRect.right - 40) { - topRect.right = middleRect.right; - topRect.width = topRect.right - topRect.left; - } - if (topRect.left < middleRect.left + 40) { - topRect.left = middleRect.left; - topRect.width = topRect.right - topRect.left; - } - if (bottomRect.right > middleRect.right - 40) { - bottomRect.right = middleRect.right; - bottomRect.width = bottomRect.right - bottomRect.left; - } - if (bottomRect.left < middleRect.left + 40) { - bottomRect.left = middleRect.left; - bottomRect.width = bottomRect.right - bottomRect.left; - } - - var midline = Math.floor((middleRect.top + middleRect.bottom) / 2); - - this.setElementRect_(regionTop, topRect, true, true, true, false); - this.setElementRect_(regionBottom, bottomRect, true, false, true, true); - - this.setElementCoords_( - regionMiddleNW, middleRect.left, topRect.bottom, topRect.left, midline, - true, true, false, false); - this.setElementCoords_( - regionMiddleNE, topRect.right, topRect.bottom, middleRect.right, midline, - false, true, true, false); - this.setElementCoords_( - regionMiddleSW, middleRect.left, midline, bottomRect.left, bottomRect.top, - true, false, false, true); - this.setElementCoords_( - regionMiddleSE, bottomRect.right, midline, middleRect.right, - bottomRect.top, false, false, true, true); -}; - -/** - * Given two rectangles, return whether or not they intersect - * (including a bit of slop, so if they're almost touching, we - * return true). - * @param {ClientRect} r1 The first rect. - * @param {ClientRect} r2 The second rect. - * @return {boolean} Whether or not they intersect. - * @private - */ -cvox.ActiveIndicator.prototype.intersects_ = function(r1, r2) { - var slop = 2 * cvox.ActiveIndicator.MARGIN; - return ( - r2.left <= r1.right + slop && r2.right >= r1.left - slop && - r2.top <= r1.bottom + slop && r2.bottom >= r1.top - slop); -}; - -/** - * Given two rectangles, compute their union. - * @param {ClientRect} r1 The first rect. - * @param {ClientRect} r2 The second rect. - * @return {ClientRect} The union of the two rectangles. - * @private - * @suppress {invalidCasts} invalid cast - must be a subtype or supertype - * from: {bottom: number, height: number, left: number, right: number, ...} - * to : (ClientRect|null) - */ -cvox.ActiveIndicator.prototype.union_ = function(r1, r2) { - var result = { - left: Math.min(r1.left, r2.left), - top: Math.min(r1.top, r2.top), - right: Math.max(r1.right, r2.right), - bottom: Math.max(r1.bottom, r2.bottom) - }; - result.width = result.right - result.left; - result.height = result.bottom - result.top; - return /** @type {ClientRect} */ (result); -}; - -/** - * Given a rectangle and four offsets, return a new rectangle inset by - * the given offsets. - * @param {ClientRect} r The first rect. - * @param {number} left The left inset. - * @param {number} top The top inset. - * @param {number} right The right inset. - * @param {number} bottom The bottom inset. - * @return {ClientRect} The new rectangle. - * @private - * @suppress {invalidCasts} invalid cast - must be a subtype or supertype - * from: {bottom: number, height: number, left: number, right: number, ...} - * to : (ClientRect|null) - */ -cvox.ActiveIndicator.prototype.inset_ = function(r, left, top, right, bottom) { - var result = { - left: r.left + left, - top: r.top + top, - right: r.right - right, - bottom: r.bottom - bottom - }; - result.width = result.right - result.left; - result.height = result.bottom - result.top; - return /** @type {ClientRect} */ (result); -}; - -/** - * Convenience method to create an element of type DIV, give it - * particular class name, and add it as a child of a given parent. - * @param {Element} parent The parent element of the new div. - * @param {string} className The class name of the new div. - * @param {Node=} opt_before Will insert before this node, if present. - * @return {Element} The new div. - * @private - */ -cvox.ActiveIndicator.prototype.createDiv_ = function( - parent, className, opt_before) { - var elem = document.createElement('div'); - elem.setAttribute('aria-hidden', 'true'); - - // This allows the MutationObserver used for live regions to quickly - // ignore changes to this element rather than doing a lot of calculations - // first. - elem.setAttribute('cvoxIgnore', ''); - - elem.className = className; - if (opt_before) { - parent.insertBefore(elem, opt_before); - } else { - parent.appendChild(elem); - } - return elem; -}; - -/** - * In WebKit, when the user has zoomed the page, every CSS coordinate is - * multiplied by the zoom level and rounded down. This can cause objects to - * fail to line up; for example an object with left position 100 and width - * 50 may not line up with an object with right position 150 pixels, if the - * zoom is not equal to 1.0. To fix this, we compute the actual desired - * coordinate when zoomed, then add a small fractional offset and divide - * by the zoom factor, and use that value as the item's coordinate instead. - * - * @param {number} x A coordinate to be transformed. - * @return {number} The new coordinate to use. - * @private - */ -cvox.ActiveIndicator.prototype.fixZoom_ = function(x) { - return (Math.round(x * this.zoom_) + 0.1) / this.zoom_; -}; - -/** - * See fixZoom_, above. This method is the same except that it returns the - * width such that right pos (x + width) is correct when multiplied by the - * zoom factor. - * - * @param {number} x A coordinate to be transformed. - * @param {number} width The width of the object. - * @return {number} The new width to use. - * @private - */ -cvox.ActiveIndicator.prototype.fixZoomSum_ = function(x, width) { - var zoomedX = Math.round(x * this.zoom_); - var zoomedRight = Math.round((x + width) * this.zoom_); - var zoomedWidth = (zoomedRight - zoomedX); - return (zoomedWidth + 0.1) / this.zoom_; -}; - -/** - * Set the coordinates of an element to the given left, top, right, and - * bottom pixel coordinates, taking the browser zoom level into account. - * Also set the clipping rectangle to exclude some of the edges of the - * rectangle, based on the value of showLeft, showTop, showRight, and - * showBottom. - * - * @param {Element} element The element to move. - * @param {number} left The new left coordinate. - * @param {number} top The new top coordinate. - * @param {number} right The new right coordinate. - * @param {number} bottom The new bottom coordinate. - * @param {boolean} showLeft Whether to show or clip at the left border. - * @param {boolean} showTop Whether to show or clip at the top border. - * @param {boolean} showRight Whether to show or clip at the right border. - * @param {boolean} showBottom Whether to show or clip at the bottom border. - * @private - */ -cvox.ActiveIndicator.prototype.setElementCoords_ = function( - element, left, top, right, bottom, showLeft, showTop, showRight, - showBottom) { - var origWidth = right - left; - var origHeight = bottom - top; - - var width = right - left; - var height = bottom - top; - var clipLeft = showLeft ? -20 : 0; - var clipTop = showTop ? -20 : 0; - var clipRight = showRight ? 20 : 0; - var clipBottom = showBottom ? 20 : 0; - if (width == 0) { - if (showRight) { - left -= 5; - width += 5; - } else if (showLeft) { - width += 10; - } - clipTop = 10; - clipBottom = 10; - top -= 10; - height += 20; - } - if (!showBottom) - height += 5; - if (!showTop) { - top -= 5; - height += 5; - clipTop += 5; - clipBottom += 5; - } - if (clipRight == 0 && origWidth == 0) { - clipRight = 1; - } else { - clipRight = this.fixZoomSum_(left, clipRight + origWidth); - } - clipBottom = this.fixZoomSum_(top, clipBottom + origHeight); - - element.style.left = this.fixZoom_(left) + 'px'; - element.style.top = this.fixZoom_(top) + 'px'; - element.style.width = this.fixZoomSum_(left, width) + 'px'; - element.style.height = this.fixZoomSum_(top, height) + 'px'; - element.style.clip = - 'rect(' + [clipTop, clipRight, clipBottom, clipLeft].join('px ') + 'px)'; -}; - -/** - * Same as setElementCoords_, but takes a rect instead of coordinates. - * - * @param {Element} element The element to move. - * @param {ClientRect} r The new coordinates. - * @param {boolean} showLeft Whether to show or clip at the left border. - * @param {boolean} showTop Whether to show or clip at the top border. - * @param {boolean} showRight Whether to show or clip at the right border. - * @param {boolean} showBottom Whether to show or clip at the bottom border. - * @private - */ -cvox.ActiveIndicator.prototype.setElementRect_ = function( - element, r, showLeft, showTop, showRight, showBottom) { - this.setElementCoords_( - element, r.left, r.top, r.right, r.bottom, showLeft, showTop, showRight, - showBottom); -}; - -/** - * Compute an approximation of the current browser zoom level by - * comparing the measurement of a large character of text - * with the -webkit-text-size-adjust:none style to the expected - * pixel coordinates if it was adjusted. - * @private - */ -cvox.ActiveIndicator.prototype.computeZoomLevel_ = function() { - if (window.innerHeight === this.innerHeight_ && - window.innerWidth === this.innerWidth_) { - return; - } - - this.innerHeight_ = window.innerHeight; - this.innerWidth_ = window.innerWidth; - - var zoomMeasureElement = document.createElement('div'); - zoomMeasureElement.innerHTML = 'X'; - zoomMeasureElement.setAttribute( - 'style', - 'font: 5000px/1em sans-serif !important;' + - ' -webkit-text-size-adjust:none !important;' + - ' visibility:hidden !important;' + - ' left: -10000px !important;' + - ' top: -10000px !important;' + - ' position:absolute !important;'); - document.body.appendChild(zoomMeasureElement); - - var zoomLevel = 5000 / zoomMeasureElement.clientHeight; - var newZoom = Math.round(zoomLevel * 500) / 500; - if (newZoom > 0.1 && newZoom < 10) { - this.zoom_ = newZoom; - } - - // TODO(dmazzoni): warn or log if the computed zoom is bad? - zoomMeasureElement.parentNode.removeChild(zoomMeasureElement); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_suspender.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_suspender.js deleted file mode 100644 index 73b2ba4..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_suspender.js +++ /dev/null
@@ -1,77 +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. - -/** - * @fileoverview Allows events to be suspended. - * - */ - -goog.provide('cvox.ChromeVoxEventSuspender'); - -/** - * @namespace - */ -cvox.ChromeVoxEventSuspender = function() {}; - -/** - * A nestable variable to keep track of whether events are suspended. - * - * @type {number} - * @private - */ -cvox.ChromeVoxEventSuspender.suspendLevel_ = 0; - -/** - * Enters a (nested) suspended state. - */ -cvox.ChromeVoxEventSuspender.enterSuspendEvents = function() { - cvox.ChromeVoxEventSuspender.suspendLevel_ += 1; -}; - -/** - * Exits a (nested) suspended state. - */ -cvox.ChromeVoxEventSuspender.exitSuspendEvents = function() { - cvox.ChromeVoxEventSuspender.suspendLevel_ -= 1; -}; - -/** - * Returns true if events are currently suspended. - * - * @return {boolean} True if events are suspended. - */ -cvox.ChromeVoxEventSuspender.areEventsSuspended = function() { - return cvox.ChromeVoxEventSuspender.suspendLevel_ > 0; -}; - -/** - * Returns a function that runs the argument with all events suspended. - * - * @param {Function} f Function to run with suspended events. - * @return {?} Returns a function that wraps f. - */ -cvox.ChromeVoxEventSuspender.withSuspendedEvents = function(f) { - return function() { - cvox.ChromeVoxEventSuspender.enterSuspendEvents(); - var ret = f.apply(this, arguments); - cvox.ChromeVoxEventSuspender.exitSuspendEvents(); - return ret; - }; -}; - -/** - * Returns a handler that only runs the argument if events are not suspended. - * - * @param {Function} handler Function that will be used as an event handler. - * @param {boolean} ret Return value if events are suspended. - * @return {Function} Function wrapping the handler. - */ -cvox.ChromeVoxEventSuspender.makeSuspendableHandler = function(handler, ret) { - return function() { - if (cvox.ChromeVoxEventSuspender.areEventsSuspended()) { - return ret; - } - return handler(); - }; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js deleted file mode 100644 index 62bf4c4c4..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js +++ /dev/null
@@ -1,1519 +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. - -/** - * @fileoverview Watches for events in the browser such as focus changes. - * - */ - -goog.provide('cvox.ChromeVoxEventWatcher'); -goog.provide('cvox.ChromeVoxEventWatcherUtil'); - -goog.require('cvox.ActiveIndicator'); -goog.require('cvox.AriaUtil'); -goog.require('cvox.ChromeVox'); -goog.require('cvox.ChromeVoxEditableTextBase'); -goog.require('cvox.ChromeVoxEventSuspender'); -goog.require('cvox.ChromeVoxHTMLDateWidget'); -goog.require('cvox.ChromeVoxHTMLMediaWidget'); -goog.require('cvox.ChromeVoxHTMLTimeWidget'); -goog.require('cvox.ChromeVoxKbHandler'); -goog.require('cvox.ChromeVoxUserCommands'); -goog.require('cvox.DomUtil'); -goog.require('cvox.Focuser'); -goog.require('cvox.History'); -goog.require('cvox.LiveRegions'); -goog.require('cvox.Memoize'); -goog.require('cvox.NavigationSpeaker'); -goog.require('cvox.PlatformFilter'); // TODO: Find a better place for this. -goog.require('cvox.PlatformUtil'); -goog.require('cvox.QueueMode'); -goog.require('cvox.TextHandlerInterface'); -goog.require('cvox.UserEventDetail'); - -/** - * @constructor - */ -cvox.ChromeVoxEventWatcher = function() {}; - -/** - * The maximum amount of time to wait before processing events. - * A max time is needed so that even if a page is constantly updating, - * events will still go through. - * @const - * @type {number} - * @private - */ -cvox.ChromeVoxEventWatcher.MAX_WAIT_TIME_MS_ = 50; - -/** - * As long as the MAX_WAIT_TIME_ has not been exceeded, the event processor - * will wait this long after the last event was received before starting to - * process events. - * @const - * @type {number} - * @private - */ -cvox.ChromeVoxEventWatcher.WAIT_TIME_MS_ = 10; - -/** - * Maximum number of live regions that we will attempt to process. - * @const - * @type {number} - * @private - */ -cvox.ChromeVoxEventWatcher.MAX_LIVE_REGIONS_ = 5; - - -/** - * Whether or not ChromeVox should echo keys. - * It is useful to turn this off in case the system is already echoing keys (for - * example, in Android). - * - * @type {boolean} - */ -cvox.ChromeVoxEventWatcher.shouldEchoKeys = true; - - -/** - * Whether or not the next utterance should flush all previous speech. - * Immediately after a key down or user action, we make the next speech - * flush, but otherwise it's better to do a category flush, so if a single - * user action generates both a focus change and a live region change, - * both get spoken. - * @type {boolean} - */ -cvox.ChromeVoxEventWatcher.shouldFlushNextUtterance = false; - - -/** - * Inits the event watcher and adds listeners. - * @param {!Document|!Window} doc The DOM document to add event listeners to. - */ -cvox.ChromeVoxEventWatcher.init = function(doc) { - /** - * @type {Object} - */ - cvox.ChromeVoxEventWatcher.lastFocusedNode = null; - - /** - * @type {Object} - */ - cvox.ChromeVoxEventWatcher.announcedMouseOverNode = null; - - /** - * @type {Object} - */ - cvox.ChromeVoxEventWatcher.pendingMouseOverNode = null; - - /** - * @type {number?} - */ - cvox.ChromeVoxEventWatcher.mouseOverTimeoutId = null; - - /** - * @type {string?} - */ - cvox.ChromeVoxEventWatcher.lastFocusedNodeValue = null; - - /** - * @type {Object} - */ - cvox.ChromeVoxEventWatcher.eventToEat = null; - - /** - * @type {Element} - */ - cvox.ChromeVoxEventWatcher.currentTextControl = null; - - /** - * @type {cvox.ChromeVoxEditableTextBase} - */ - cvox.ChromeVoxEventWatcher.currentTextHandler = null; - - /** - * Array of event listeners we've added so we can unregister them if needed. - * @type {Array} - * @private - */ - cvox.ChromeVoxEventWatcher.listeners_ = []; - - /** - * The mutation observer we use to listen for live regions. - * @type {MutationObserver} - * @private - */ - cvox.ChromeVoxEventWatcher.mutationObserver_ = null; - - /** - * Whether or not mouse hover events should trigger focusing. - * @type {boolean} - */ - cvox.ChromeVoxEventWatcher.focusFollowsMouse = false; - - /** - * The delay before a mouseover triggers focusing or announcing anything. - * @type {number} - */ - cvox.ChromeVoxEventWatcher.mouseoverDelayMs = 500; - - /** - * Array of events that need to be processed. - * @type {Array<Event>} - * @private - */ - cvox.ChromeVoxEventWatcher.events_ = new Array(); - - /** - * The time when the last event was received. - * @type {number} - */ - cvox.ChromeVoxEventWatcher.lastEventTime = 0; - - /** - * The timestamp for the first unprocessed event. - * @type {number} - */ - cvox.ChromeVoxEventWatcher.firstUnprocessedEventTime = -1; - - /** - * Whether or not queue processing is scheduled to run. - * @type {boolean} - * @private - */ - cvox.ChromeVoxEventWatcher.queueProcessingScheduled_ = false; - - /** - * A list of callbacks to be called when the EventWatcher has - * completed processing all events in its queue. - * @type {Array<function()?>} - * @private - */ - cvox.ChromeVoxEventWatcher.readyCallbacks_ = new Array(); - - - /** - * tracks whether we've received two or more key up's while pass through mode - * is active. - * @type {boolean} - * @private - */ - cvox.ChromeVoxEventWatcher.secondPassThroughKeyUp_ = false; - - /** - * Whether or not the ChromeOS Search key (keyCode == 91) is being held. - * - * We must track this manually because on ChromeOS, the Search key being held - * down does not cause keyEvent.metaKey to be set. - * - * TODO (clchen, dmazzoni): Refactor this since there are edge cases - * where manually tracking key down and key up can fail (such as when - * the user switches tabs before letting go of the key being held). - * - * @type {boolean} - */ - cvox.ChromeVox.searchKeyHeld = false; - - /** - * The mutation observer that listens for changes to text controls - * that might not send other events. - * @type {MutationObserver} - * @private - */ - cvox.ChromeVoxEventWatcher.textMutationObserver_ = null; - - cvox.ChromeVoxEventWatcher.addEventListeners_(doc); -}; - - -/** - * Stores state variables in a provided object. - * - * @param {Object} store The object. - */ -cvox.ChromeVoxEventWatcher.storeOn = function(store) { - store['searchKeyHeld'] = cvox.ChromeVox.searchKeyHeld; -}; - -/** - * Updates the object with state variables from an earlier storeOn call. - * - * @param {Object} store The object. - */ -cvox.ChromeVoxEventWatcher.readFrom = function(store) { - cvox.ChromeVox.searchKeyHeld = store['searchKeyHeld']; -}; - -/** - * Adds an event to the events queue and updates the time when the last - * event was received. - * - * @param {Event} evt The event to be added to the events queue. - */ -cvox.ChromeVoxEventWatcher.addEvent = function(evt) { - // Don't add any events to the events queue if ChromeVox is inactive or the - // document isn't focused. - if (!cvox.ChromeVox.isActive || !cvox.ChromeVox.documentHasFocus()) { - if (evt.type == 'focus') { - // If it's a focus event, update the active indicator so that it - // properly shows and hides as focus moves to iframe and webview - // elements. - cvox.ChromeVox.navigationManager.activeIndicator.syncToNode(evt.target); - } - return; - } - cvox.ChromeVoxEventWatcher.events_.push(evt); - cvox.ChromeVoxEventWatcher.lastEventTime = new Date().getTime(); - if (cvox.ChromeVoxEventWatcher.firstUnprocessedEventTime == -1) { - cvox.ChromeVoxEventWatcher.firstUnprocessedEventTime = new Date().getTime(); - } - if (!cvox.ChromeVoxEventWatcher.queueProcessingScheduled_) { - cvox.ChromeVoxEventWatcher.queueProcessingScheduled_ = true; - window.setTimeout( - cvox.ChromeVoxEventWatcher.processQueue_, - cvox.ChromeVoxEventWatcher.WAIT_TIME_MS_); - } -}; - -/** - * Adds a callback to be called when the event watcher has finished - * processing all pending events. - * @param {Function} cb The callback. - */ -cvox.ChromeVoxEventWatcher.addReadyCallback = function(cb) { - cvox.ChromeVoxEventWatcher.readyCallbacks_.push(cb); - cvox.ChromeVoxEventWatcher.maybeCallReadyCallbacks_(); -}; - -/** - * Returns whether or not there are pending events. - * @return {boolean} Whether or not there are pending events. - * @private - */ -cvox.ChromeVoxEventWatcher.hasPendingEvents_ = function() { - return cvox.ChromeVoxEventWatcher.firstUnprocessedEventTime != -1 || - cvox.ChromeVoxEventWatcher.queueProcessingScheduled_; -}; - - -/** - * A bit used to make sure only one ready callback is pending at a time. - * @private - */ -cvox.ChromeVoxEventWatcher.readyCallbackRunning_ = false; - -/** - * Checks if the event watcher has pending events. If not, call the oldest - * readyCallback in a loop until exhausted or until there are pending events. - * @private - */ -cvox.ChromeVoxEventWatcher.maybeCallReadyCallbacks_ = function() { - if (!cvox.ChromeVoxEventWatcher.readyCallbackRunning_) { - cvox.ChromeVoxEventWatcher.readyCallbackRunning_ = true; - window.setTimeout(function() { - cvox.ChromeVoxEventWatcher.readyCallbackRunning_ = false; - if (!cvox.ChromeVoxEventWatcher.hasPendingEvents_() && - !cvox.ChromeVoxEventWatcher.queueProcessingScheduled_ && - cvox.ChromeVoxEventWatcher.readyCallbacks_.length > 0) { - cvox.ChromeVoxEventWatcher.readyCallbacks_.shift()(); - cvox.ChromeVoxEventWatcher.maybeCallReadyCallbacks_(); - } - }, 5); - } -}; - - -/** - * Add all of our event listeners to the document. - * @param {!Document|!Window} doc The DOM document to add event listeners to. - * @private - */ -cvox.ChromeVoxEventWatcher.addEventListeners_ = function(doc) { - // We always need key down listeners to intercept activate/deactivate. - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'keydown', cvox.ChromeVoxEventWatcher.keyDownEventWatcher, true); - - // If ChromeVox isn't active, skip all other event listeners. - if (!cvox.ChromeVox.isActive || cvox.ChromeVox.entireDocumentIsHidden) { - return; - } - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'keypress', cvox.ChromeVoxEventWatcher.keyPressEventWatcher, true); - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'keyup', cvox.ChromeVoxEventWatcher.keyUpEventWatcher, true); - // Listen for our own events to handle public user commands if the web app - // doesn't do it for us. - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, cvox.UserEventDetail.Category.JUMP, - cvox.ChromeVoxUserCommands.handleChromeVoxUserEvent, false); - - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'focus', cvox.ChromeVoxEventWatcher.focusEventWatcher, true); - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'blur', cvox.ChromeVoxEventWatcher.blurEventWatcher, true); - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'change', cvox.ChromeVoxEventWatcher.changeEventWatcher, true); - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'copy', cvox.ChromeVoxEventWatcher.clipboardEventWatcher, true); - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'cut', cvox.ChromeVoxEventWatcher.clipboardEventWatcher, true); - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'paste', cvox.ChromeVoxEventWatcher.clipboardEventWatcher, true); - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'select', cvox.ChromeVoxEventWatcher.selectEventWatcher, true); - - // TODO(dtseng): Experimental, see: - // https://developers.google.com/chrome/whitepapers/pagevisibility - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'webkitvisibilitychange', - cvox.ChromeVoxEventWatcher.visibilityChangeWatcher, true); - cvox.ChromeVoxEventWatcher.events_ = new Array(); - cvox.ChromeVoxEventWatcher.queueProcessingScheduled_ = false; - - // Handle mouse events directly without going into the events queue. - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'mouseover', cvox.ChromeVoxEventWatcher.mouseOverEventWatcher, true); - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'mouseout', cvox.ChromeVoxEventWatcher.mouseOutEventWatcher, true); - - // With the exception of non-Android, click events go through the event queue. - cvox.ChromeVoxEventWatcher.addEventListener_( - doc, 'click', cvox.ChromeVoxEventWatcher.mouseClickEventWatcher, true); - - cvox.ChromeVoxEventWatcher.mutationObserver_ = - new window.WebKitMutationObserver( - cvox.ChromeVoxEventWatcher.mutationHandler); - var observerTarget = null; - if (doc.documentElement) { - observerTarget = doc.documentElement; - } else if (doc.document && doc.document.documentElement) { - observerTarget = doc.document.documentElement; - } - if (observerTarget) { - cvox.ChromeVoxEventWatcher.mutationObserver_.observe( - observerTarget, - /** @type {!MutationObserverInit} */ ({ - childList: true, - attributes: true, - characterData: true, - subtree: true, - attributeOldValue: true, - characterDataOldValue: true - })); - } -}; - - -/** - * Remove all registered event watchers. - * @param {!Document|!Window} doc The DOM document to add event listeners to. - */ -cvox.ChromeVoxEventWatcher.cleanup = function(doc) { - for (var i = 0; i < cvox.ChromeVoxEventWatcher.listeners_.length; i++) { - var listener = cvox.ChromeVoxEventWatcher.listeners_[i]; - doc.removeEventListener( - listener.type, listener.listener, listener.useCapture); - } - cvox.ChromeVoxEventWatcher.listeners_ = []; - if (cvox.ChromeVoxEventWatcher.currentDateHandler) { - cvox.ChromeVoxEventWatcher.currentDateHandler.shutdown(); - } - if (cvox.ChromeVoxEventWatcher.currentTimeHandler) { - cvox.ChromeVoxEventWatcher.currentTimeHandler.shutdown(); - } - if (cvox.ChromeVoxEventWatcher.currentMediaHandler) { - cvox.ChromeVoxEventWatcher.currentMediaHandler.shutdown(); - } - if (cvox.ChromeVoxEventWatcher.mutationObserver_) { - cvox.ChromeVoxEventWatcher.mutationObserver_.disconnect(); - } - cvox.ChromeVoxEventWatcher.mutationObserver_ = null; -}; - -/** - * Add one event listener and save the data so it can be removed later. - * @param {!Document|!Window} doc The DOM document to add event listeners to. - * @param {string} type The event type. - * @param {EventListener|function(Event):(boolean|undefined)} listener - * The function to be called when the event is fired. - * @param {boolean} useCapture Whether this listener should capture events - * before they're sent to targets beneath it in the DOM tree. - * @private - */ -cvox.ChromeVoxEventWatcher.addEventListener_ = function( - doc, type, listener, useCapture) { - cvox.ChromeVoxEventWatcher.listeners_.push( - {'type': type, 'listener': listener, 'useCapture': useCapture}); - doc.addEventListener(type, listener, useCapture); -}; - -/** - * Return the last focused node. - * @return {Object} The last node that was focused. - */ -cvox.ChromeVoxEventWatcher.getLastFocusedNode = function() { - return cvox.ChromeVoxEventWatcher.lastFocusedNode; -}; - -/** - * Sets the last focused node. - * @param {Element} element The last focused element. - * - * @private - */ -cvox.ChromeVoxEventWatcher.setLastFocusedNode_ = function(element) { - cvox.ChromeVoxEventWatcher.lastFocusedNode = element; - cvox.ChromeVoxEventWatcher.lastFocusedNodeValue = - !element ? null : cvox.DomUtil.getControlValueAndStateString(element); -}; - -/** - * Called when there's any mutation of the document. We use this to - * handle live region updates. - * @param {Array<MutationRecord>} mutations The mutations. - * @return {boolean} True if the default action should be performed. - */ -cvox.ChromeVoxEventWatcher.mutationHandler = function(mutations) { - if (cvox.ChromeVoxEventSuspender.areEventsSuspended()) { - return true; - } - - cvox.ChromeVox.navigationManager.updateIndicatorIfChanged(); - - cvox.LiveRegions.processMutations( - mutations, function(assertive, navDescriptions) { - var evt = new window.Event('LiveRegion'); - evt.navDescriptions = navDescriptions; - evt.assertive = assertive; - cvox.ChromeVoxEventWatcher.addEvent(evt); - return true; - }); - return false; -}; - - -/** - * Handles mouseclick events. - * Mouseclick events are only triggered if the user touches the mouse; - * we use it to determine whether or not we should bother trying to sync to a - * selection. - * @param {Event} evt The mouseclick event to process. - * @return {boolean} True if the default action should be performed. - */ -cvox.ChromeVoxEventWatcher.mouseClickEventWatcher = function(evt) { - if (evt.fromCvox) { - return true; - } - - if (cvox.ChromeVox.host.mustRedispatchClickEvent()) { - cvox.ChromeVoxUserCommands.wasMouseClicked = true; - evt.stopPropagation(); - evt.preventDefault(); - // Since the click event was caught and we are re-dispatching it, we also - // need to refocus the current node because the current node has already - // been blurred by the window getting the click event in the first place. - // Failing to restore focus before clicking can cause odd problems such as - // the soft IME not coming up in Android (it only shows up if the click - // happens in a focused text field). - cvox.Focuser.setFocus(cvox.ChromeVox.navigationManager.getCurrentNode()); - cvox.ChromeVox.tts.speak( - Msgs.getMsg('element_clicked'), cvox.ChromeVoxEventWatcher.queueMode_(), - cvox.AbstractTts.PERSONALITY_ANNOTATION); - var targetNode = cvox.ChromeVox.navigationManager.getCurrentNode(); - // If the targetNode has a defined onclick function, just call it directly - // rather than try to generate a click event and dispatching it. - // While both work equally well on standalone Chrome, when dealing with - // embedded WebViews, generating a click event and sending it is not always - // reliable since the framework may swallow the event. - cvox.DomUtil.clickElem(targetNode, false, true); - return false; - } else { - cvox.ChromeVoxEventWatcher.addEvent(evt); - } - cvox.ChromeVoxUserCommands.wasMouseClicked = true; - return true; -}; - -/** - * Handles mouseover events. - * Mouseover events are only triggered if the user touches the mouse, so - * for users who only use the keyboard, this will have no effect. - * - * @param {Event} evt The mouseover event to process. - * @return {boolean} True if the default action should be performed. - */ -cvox.ChromeVoxEventWatcher.mouseOverEventWatcher = function(evt) { - // Chrome simulates the meta key for mouse events generated from - // touch exploration. - var isTouchEvent = (evt.metaKey); - - var mouseoverDelayMs = cvox.ChromeVoxEventWatcher.mouseoverDelayMs; - if (isTouchEvent) { - mouseoverDelayMs = 0; - } else if (!cvox.ChromeVoxEventWatcher.focusFollowsMouse) { - return true; - } - - if (cvox.DomUtil.isDescendantOfNode( - cvox.ChromeVoxEventWatcher.announcedMouseOverNode, evt.target)) { - return true; - } - - if (evt.target == cvox.ChromeVoxEventWatcher.pendingMouseOverNode) { - return true; - } - - cvox.ChromeVoxEventWatcher.pendingMouseOverNode = evt.target; - if (cvox.ChromeVoxEventWatcher.mouseOverTimeoutId) { - window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId); - cvox.ChromeVoxEventWatcher.mouseOverTimeoutId = null; - } - - if (evt.target.tagName && (evt.target.tagName == 'BODY')) { - cvox.ChromeVoxEventWatcher.pendingMouseOverNode = null; - cvox.ChromeVoxEventWatcher.announcedMouseOverNode = null; - return true; - } - - // Only focus and announce if the mouse stays over the same target - // for longer than the given delay. - cvox.ChromeVoxEventWatcher.mouseOverTimeoutId = window.setTimeout(function() { - cvox.ChromeVoxEventWatcher.mouseOverTimeoutId = null; - if (evt.target != cvox.ChromeVoxEventWatcher.pendingMouseOverNode) { - return; - } - - cvox.Memoize.scope(function() { - cvox.ChromeVoxEventWatcher.shouldFlushNextUtterance = true; - cvox.ChromeVox.navigationManager.stopReading(true); - var target = /** @type {Node} */ (evt.target); - cvox.Focuser.setFocus(target); - cvox.ChromeVox.navigationManager.syncToNode( - target, true, cvox.ChromeVoxEventWatcher.queueMode_()); - - cvox.ChromeVoxEventWatcher.announcedMouseOverNode = target; - }); - }, mouseoverDelayMs); - - return true; -}; - -/** - * Handles mouseout events. - * - * @param {Event} evt The mouseout event to process. - * @return {boolean} True if the default action should be performed. - */ -cvox.ChromeVoxEventWatcher.mouseOutEventWatcher = function(evt) { - if (evt.target == cvox.ChromeVoxEventWatcher.pendingMouseOverNode) { - cvox.ChromeVoxEventWatcher.pendingMouseOverNode = null; - if (cvox.ChromeVoxEventWatcher.mouseOverTimeoutId) { - window.clearTimeout(cvox.ChromeVoxEventWatcher.mouseOverTimeoutId); - cvox.ChromeVoxEventWatcher.mouseOverTimeoutId = null; - } - } - - return true; -}; - - -/** - * Watches for focus events. - * - * @param {Event} evt The focus event to add to the queue. - * @return {boolean} True if the default action should be performed. - */ -cvox.ChromeVoxEventWatcher.focusEventWatcher = function(evt) { - // First remove any dummy spans. We create dummy spans in UserCommands in - // order to sync the browser's default tab action with the user's current - // navigation position. - cvox.ChromeVoxUserCommands.removeTabDummySpan(); - - if (!cvox.ChromeVoxEventSuspender.areEventsSuspended()) { - cvox.ChromeVoxEventWatcher.addEvent(evt); - } else if (evt.target && evt.target.nodeType == Node.ELEMENT_NODE) { - cvox.ChromeVoxEventWatcher.setLastFocusedNode_( - /** @type {Element} */ (evt.target)); - } - return true; -}; - -/** - * Handles for focus events passed to it from the events queue. - * - * @param {Event} evt The focus event to handle. - */ -cvox.ChromeVoxEventWatcher.focusHandler = function(evt) { - if (!cvox.ChromeVox.documentHasFocus()) { - return; - } - if (evt.target && evt.target.hasAttribute && - evt.target.getAttribute('aria-hidden') == 'true' && - evt.target.getAttribute('chromevoxignoreariahidden') != 'true') { - cvox.ChromeVoxEventWatcher.setLastFocusedNode_(null); - cvox.ChromeVoxEventWatcher.setUpTextHandler(); - return; - } - if (evt.target && evt.target != window) { - var target = /** @type {Element} */ (evt.target); - var parentControl = cvox.DomUtil.getSurroundingControl(target); - if (parentControl && - parentControl == cvox.ChromeVoxEventWatcher.lastFocusedNode) { - cvox.ChromeVoxEventWatcher.handleControlChanged(target); - return; - } - - if (parentControl) { - cvox.ChromeVoxEventWatcher.setLastFocusedNode_( - /** @type {Element} */ (parentControl)); - } else { - cvox.ChromeVoxEventWatcher.setLastFocusedNode_(target); - } - - var queueMode = cvox.ChromeVoxEventWatcher.queueMode_(); - - if (cvox.ChromeVoxEventWatcher.getInitialVisibility() || - cvox.ChromeVoxEventWatcher.handleDialogFocus(target)) { - queueMode = cvox.QueueMode.QUEUE; - } - - if (cvox.ChromeVox.navigationManager.clearPageSel(true)) { - queueMode = cvox.QueueMode.QUEUE; - } - - // Navigate to this control so that it will be the same for focus as for - // regular navigation. - cvox.ChromeVox.navigationManager.syncToNode( - target, !document.webkitHidden, queueMode); - - if ((evt.target.constructor == HTMLVideoElement) || - (evt.target.constructor == HTMLAudioElement)) { - cvox.ChromeVoxEventWatcher.setUpMediaHandler_(); - return; - } - if (evt.target.hasAttribute) { - var inputType = evt.target.getAttribute('type'); - switch (inputType) { - case 'time': - cvox.ChromeVoxEventWatcher.setUpTimeHandler_(); - return; - case 'date': - case 'month': - case 'week': - cvox.ChromeVoxEventWatcher.setUpDateHandler_(); - return; - } - } - cvox.ChromeVoxEventWatcher.setUpTextHandler(); - } else { - cvox.ChromeVoxEventWatcher.setLastFocusedNode_(null); - } - return; -}; - -/** - * Watches for blur events. - * - * @param {Event} evt The blur event to add to the queue. - * @return {boolean} True if the default action should be performed. - */ -cvox.ChromeVoxEventWatcher.blurEventWatcher = function(evt) { - window.setTimeout(function() { - if (!document.activeElement) { - cvox.ChromeVoxEventWatcher.setLastFocusedNode_(null); - cvox.ChromeVoxEventWatcher.addEvent(evt); - } - }, 0); - return true; -}; - -/** - * Watches for key down events. - * - * @param {Event} evt The keydown event to add to the queue. - * @return {boolean} True if the default action should be performed. - */ -cvox.ChromeVoxEventWatcher.keyDownEventWatcher = function(evt) { - return /** @type {boolean} */ (cvox.Memoize.scope( - cvox.ChromeVoxEventWatcher.doKeyDownEventWatcher_.bind(this, evt))); -}; - -/** - * Implementation of |keyDownEventWatcher|. - * - * @param {Event} evt The keydown event to add to the queue. - * @return {boolean} True if the default action should be performed. - * @private - */ -cvox.ChromeVoxEventWatcher.doKeyDownEventWatcher_ = function(evt) { - cvox.ChromeVoxEventWatcher.shouldFlushNextUtterance = true; - - if (cvox.ChromeVox.passThroughMode) { - return true; - } - - if (cvox.ChromeVox.isChromeOS && evt.keyCode == 91) { - cvox.ChromeVox.searchKeyHeld = true; - } - - // Store some extra ChromeVox-specific properties in the event. - evt.searchKeyHeld = cvox.ChromeVox.searchKeyHeld && cvox.ChromeVox.isActive; - evt.stickyMode = cvox.ChromeVox.isStickyModeOn() && cvox.ChromeVox.isActive; - evt.keyPrefix = cvox.ChromeVox.keyPrefixOn && cvox.ChromeVox.isActive; - - cvox.ChromeVox.keyPrefixOn = false; - - cvox.ChromeVoxEventWatcher.eventToEat = null; - if (!cvox.ChromeVoxKbHandler.basicKeyDownActionsListener(evt) || - cvox.ChromeVoxEventWatcher.handleControlAction(evt)) { - // Swallow the event immediately to prevent the arrow keys - // from driving controls on the web page. - evt.preventDefault(); - evt.stopPropagation(); - // Also mark this as something to be swallowed when the followup - // keypress/keyup counterparts to this event show up later. - cvox.ChromeVoxEventWatcher.eventToEat = evt; - return false; - } - cvox.ChromeVoxEventWatcher.addEvent(evt); - return true; -}; - -/** - * Watches for key up events. - * - * @param {Event} evt The event to add to the queue. - * @return {boolean} True if the default action should be performed. - * @this {cvox.ChromeVoxEventWatcher} - */ -cvox.ChromeVoxEventWatcher.keyUpEventWatcher = function(evt) { - if (evt.keyCode == 91) { - cvox.ChromeVox.searchKeyHeld = false; - } - - if (cvox.ChromeVox.passThroughMode) { - if (!evt.ctrlKey && !evt.altKey && !evt.metaKey && !evt.shiftKey && - !cvox.ChromeVox.searchKeyHeld) { - // Only reset pass through on the second key up without modifiers since - // the first one is from the pass through shortcut itself. - if (this.secondPassThroughKeyUp_) { - this.secondPassThroughKeyUp_ = false; - cvox.ChromeVox.passThroughMode = false; - } else { - this.secondPassThroughKeyUp_ = true; - } - } - return true; - } - - if (cvox.ChromeVoxEventWatcher.eventToEat && - evt.keyCode == cvox.ChromeVoxEventWatcher.eventToEat.keyCode) { - evt.stopPropagation(); - evt.preventDefault(); - return false; - } - - cvox.ChromeVoxEventWatcher.addEvent(evt); - - return true; -}; - -/** - * Watches for key press events. - * - * @param {Event} evt The event to add to the queue. - * @return {boolean} True if the default action should be performed. - */ -cvox.ChromeVoxEventWatcher.keyPressEventWatcher = function(evt) { - var url = document.location.href; - // Use ChromeVox.typingEcho as default value. - var speakChar = cvox.TypingEcho.shouldSpeakChar(cvox.ChromeVox.typingEcho); - - if (typeof cvox.ChromeVox.keyEcho[url] !== 'undefined') { - speakChar = cvox.ChromeVox.keyEcho[url]; - } - - // Directly handle typed characters here while key echo is on. This - // skips potentially costly computations (especially for content editable). - // This is done deliberately for the sake of responsiveness and in some cases - // (e.g. content editable), to have characters echoed properly. - if (cvox.ChromeVoxEditableTextBase.eventTypingEcho && - (speakChar && - cvox.DomPredicates.editTextPredicate([document.activeElement])) && - document.activeElement.type !== 'password') { - cvox.ChromeVox.tts.speak( - String.fromCharCode(evt.charCode), cvox.QueueMode.FLUSH); - } - cvox.ChromeVoxEventWatcher.addEvent(evt); - if (cvox.ChromeVoxEventWatcher.eventToEat && - evt.keyCode == cvox.ChromeVoxEventWatcher.eventToEat.keyCode) { - evt.preventDefault(); - evt.stopPropagation(); - return false; - } - return true; -}; - -/** - * Watches for change events. - * - * @param {Event} evt The event to add to the queue. - * @return {boolean} True if the default action should be performed. - */ -cvox.ChromeVoxEventWatcher.changeEventWatcher = function(evt) { - cvox.ChromeVoxEventWatcher.addEvent(evt); - return true; -}; - -// TODO(dtseng): ChromeVoxEditableText interrupts cut and paste announcements. -/** - * Watches for cut, copy, and paste events. - * - * @param {Event} evt The event to process. - * @return {boolean} True if the default action should be performed. - */ -cvox.ChromeVoxEventWatcher.clipboardEventWatcher = function(evt) { - // Don't announce anything unless this document has focus and the - // editable element that's the target of the clipboard event is visible. - var targetNode = /** @type {Node} */ (evt.target); - if (!cvox.ChromeVox.documentHasFocus() || !targetNode || - !cvox.DomUtil.isVisible(targetNode) || - cvox.AriaUtil.isHidden(targetNode)) { - return true; - } - - var text = ''; - switch (evt.type) { - case 'paste': - text = evt.clipboardData.getData('text'); - break; - case 'copy': - case 'cut': - text = window.getSelection().toString(); - break; - } - cvox.ChromeVox.tts.speak(Msgs.getMsg(evt.type, [text]), cvox.QueueMode.QUEUE); - cvox.ChromeVox.navigationManager.clearPageSel(); - return true; -}; - -/** - * Handles change events passed to it from the events queue. - * - * @param {Event} evt The event to handle. - */ -cvox.ChromeVoxEventWatcher.changeHandler = function(evt) { - if (cvox.ChromeVoxEventWatcher.setUpTextHandler()) { - return; - } - if (document.activeElement == evt.target) { - cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement); - } -}; - -/** - * Watches for select events. - * - * @param {Event} evt The event to add to the queue. - * @return {boolean} True if the default action should be performed. - */ -cvox.ChromeVoxEventWatcher.selectEventWatcher = function(evt) { - cvox.ChromeVoxEventWatcher.addEvent(evt); - return true; -}; - -/** - * Listens for WebKit visibility change events. - */ -cvox.ChromeVoxEventWatcher.visibilityChangeWatcher = function() { - cvox.ChromeVoxEventWatcher.initialVisibility = !document.webkitHidden; - if (document.webkitHidden) { - cvox.ChromeVox.navigationManager.stopReading(true); - } -}; - -/** - * Gets the initial visibility of the page. - * @return {boolean} True if the page is visible and this is the first request - * for visibility state. - */ -cvox.ChromeVoxEventWatcher.getInitialVisibility = function() { - var ret = cvox.ChromeVoxEventWatcher.initialVisibility; - cvox.ChromeVoxEventWatcher.initialVisibility = false; - return ret; -}; - -/** - * Speaks the text of one live region. - * @param {boolean} assertive True if it's an assertive live region. - * @param {Array<cvox.NavDescription>} messages An array of navDescriptions - * representing the description of the live region changes. - * @private - */ -cvox.ChromeVoxEventWatcher.speakLiveRegion_ = function(assertive, messages) { - var queueMode = cvox.ChromeVoxEventWatcher.queueMode_(); - var descSpeaker = new cvox.NavigationSpeaker(); - descSpeaker.speakDescriptionArray(messages, queueMode, null); -}; - -/** - * Sets up the text handler. - * @return {boolean} True if an editable text control has focus. - */ -cvox.ChromeVoxEventWatcher.setUpTextHandler = function() { - var currentFocus = document.activeElement; - if (currentFocus && currentFocus.hasAttribute && - currentFocus.getAttribute('aria-hidden') == 'true' && - currentFocus.getAttribute('chromevoxignoreariahidden') != 'true') { - currentFocus = null; - } - - if (currentFocus != cvox.ChromeVoxEventWatcher.currentTextControl) { - if (cvox.ChromeVoxEventWatcher.currentTextControl) { - cvox.ChromeVoxEventWatcher.currentTextControl.removeEventListener( - 'input', cvox.ChromeVoxEventWatcher.changeEventWatcher, false); - cvox.ChromeVoxEventWatcher.currentTextControl.removeEventListener( - 'click', cvox.ChromeVoxEventWatcher.changeEventWatcher, false); - if (cvox.ChromeVoxEventWatcher.textMutationObserver_) { - cvox.ChromeVoxEventWatcher.textMutationObserver_.disconnect(); - cvox.ChromeVoxEventWatcher.textMutationObserver_ = null; - } - } - cvox.ChromeVoxEventWatcher.currentTextControl = null; - if (cvox.ChromeVoxEventWatcher.currentTextHandler) { - cvox.ChromeVoxEventWatcher.currentTextHandler.teardown(); - cvox.ChromeVoxEventWatcher.currentTextHandler = null; - } - if (currentFocus == null) { - return false; - } - if (currentFocus.constructor == HTMLInputElement && - cvox.DomUtil.isInputTypeText(currentFocus) && - cvox.ChromeVoxEventWatcher.shouldEchoKeys) { - cvox.ChromeVoxEventWatcher.currentTextControl = currentFocus; - cvox.ChromeVoxEventWatcher.currentTextHandler = - new cvox.ChromeVoxEditableHTMLInput( - /** @type {HTMLInputElement} */ (currentFocus), - cvox.ChromeVox.tts); - } else if ( - (currentFocus.constructor == HTMLTextAreaElement) && - cvox.ChromeVoxEventWatcher.shouldEchoKeys) { - cvox.ChromeVoxEventWatcher.currentTextControl = currentFocus; - cvox.ChromeVoxEventWatcher.currentTextHandler = - new cvox.ChromeVoxEditableTextArea( - /** @type {HTMLTextAreaElement} */ (currentFocus), - cvox.ChromeVox.tts); - } else if ( - currentFocus.isContentEditable || - currentFocus.getAttribute('role') == 'textbox') { - cvox.ChromeVoxEventWatcher.currentTextControl = currentFocus; - cvox.ChromeVoxEventWatcher.currentTextHandler = - new cvox.ChromeVoxEditableContentEditable( - currentFocus, cvox.ChromeVox.tts); - } - - if (cvox.ChromeVoxEventWatcher.currentTextControl) { - cvox.ChromeVoxEventWatcher.currentTextControl.addEventListener( - 'input', cvox.ChromeVoxEventWatcher.changeEventWatcher, false); - cvox.ChromeVoxEventWatcher.currentTextControl.addEventListener( - 'click', cvox.ChromeVoxEventWatcher.changeEventWatcher, false); - if (window.WebKitMutationObserver) { - cvox.ChromeVoxEventWatcher.textMutationObserver_ = - new window.WebKitMutationObserver( - cvox.ChromeVoxEventWatcher.onTextMutation); - cvox.ChromeVoxEventWatcher.textMutationObserver_.observe( - cvox.ChromeVoxEventWatcher.currentTextControl, - /** @type {!MutationObserverInit} */ ({ - childList: true, - attributes: true, - subtree: true, - attributeOldValue: false, - characterDataOldValue: false - })); - } - if (!cvox.ChromeVoxEventSuspender.areEventsSuspended()) { - cvox.ChromeVox.navigationManager.updateSel( - cvox.CursorSelection.fromNode( - cvox.ChromeVoxEventWatcher.currentTextControl)); - } - } - - return (null != cvox.ChromeVoxEventWatcher.currentTextHandler); - } - return false; -}; - -/** - * Speaks updates to editable text controls as needed. - * - * @param {boolean} isKeypress Was this change triggered by a keypress? - * @return {boolean} True if an editable text control has focus. - */ -cvox.ChromeVoxEventWatcher.handleTextChanged = function(isKeypress) { - if (cvox.ChromeVoxEventWatcher.currentTextHandler) { - var handler = cvox.ChromeVoxEventWatcher.currentTextHandler; - var shouldFlush = false; - if (isKeypress && cvox.ChromeVoxEventWatcher.shouldFlushNextUtterance) { - shouldFlush = true; - cvox.ChromeVoxEventWatcher.shouldFlushNextUtterance = false; - } - handler.update(shouldFlush); - cvox.ChromeVoxEventWatcher.shouldFlushNextUtterance = false; - return true; - } - return false; -}; - -/** - * Called when an editable text control has focus, because many changes - * to a text box don't ever generate events - e.g. if the page's javascript - * changes the contents of the text box after some delay, or if it's - * contentEditable or a generic div with role="textbox". - */ -cvox.ChromeVoxEventWatcher.onTextMutation = function() { - if (cvox.ChromeVoxEventWatcher.currentTextHandler) { - window.setTimeout(function() { - cvox.ChromeVoxEventWatcher.handleTextChanged(false); - }, cvox.ChromeVoxEventWatcher.MAX_WAIT_TIME_MS_); - } -}; - -/** - * Speaks updates to other form controls as needed. - * @param {Element} control The target control. - */ -cvox.ChromeVoxEventWatcher.handleControlChanged = function(control) { - var newValue = cvox.DomUtil.getControlValueAndStateString(control); - var parentControl = cvox.DomUtil.getSurroundingControl(control); - var announceChange = false; - - if (control != cvox.ChromeVoxEventWatcher.lastFocusedNode && - (parentControl == null || - parentControl != cvox.ChromeVoxEventWatcher.lastFocusedNode)) { - cvox.ChromeVoxEventWatcher.setLastFocusedNode_(control); - } else if (newValue == cvox.ChromeVoxEventWatcher.lastFocusedNodeValue) { - return; - } - - cvox.ChromeVoxEventWatcher.lastFocusedNodeValue = newValue; - if (cvox.DomPredicates.checkboxPredicate([control]) || - cvox.DomPredicates.radioPredicate([control])) { - // Always announce changes to checkboxes and radio buttons. - announceChange = true; - // Play earcons for checkboxes and radio buttons - if (control.checked) { - cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.CHECK_ON); - } else { - cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.CHECK_OFF); - } - } - - if (control.tagName == 'SELECT') { - announceChange = true; - } - - if (control.tagName == 'INPUT') { - switch (control.type) { - case 'color': - case 'datetime': - case 'datetime-local': - case 'range': - announceChange = true; - break; - default: - break; - } - } - - // Always announce changes for anything with an ARIA role. - if (control.hasAttribute && control.hasAttribute('role')) { - announceChange = true; - } - - var activeDescendant = cvox.AriaUtil.getActiveDescendant(control); - if ((parentControl && parentControl != control && - document.activeElement == control)) { - // Sync ChromeVox to the newly selected control. - cvox.ChromeVox.navigationManager.syncToNode( - activeDescendant || control, true, - cvox.ChromeVoxEventWatcher.queueMode_()); - - announceChange = false; - } else if (activeDescendant) { - cvox.ChromeVox.navigationManager.updateSelToArbitraryNode( - activeDescendant, true); - - announceChange = true; - } - - if (newValue && announceChange && - !cvox.ChromeVoxEventSuspender.areEventsSuspended()) { - cvox.ChromeVox.tts.speak( - newValue, cvox.ChromeVoxEventWatcher.queueMode_(), null); - cvox.ChromeVox.braille.write(cvox.NavBraille.fromText(newValue)); - } -}; - -/** - * Handle actions on form controls triggered by key presses. - * @param {Object} evt The event. - * @return {boolean} True if this key event was handled. - */ -cvox.ChromeVoxEventWatcher.handleControlAction = function(evt) { - // Ignore the control action if ChromeVox is not active. - if (!cvox.ChromeVox.isActive) { - return false; - } - var control = evt.target; - - if (control.tagName == 'SELECT' && (control.size <= 1) && - (evt.keyCode == 13 || evt.keyCode == 32)) { // Enter or Space - // TODO (dmazzoni, clchen): Remove this workaround once accessibility - // APIs make browser based popups accessible. - // - // Do nothing, but eat this keystroke when the SELECT control - // has a dropdown style since if we don't, it will generate - // a browser popup menu which is not accessible. - // List style SELECT controls are fine and don't need this workaround. - evt.preventDefault(); - evt.stopPropagation(); - return true; - } - - if (control.tagName == 'INPUT' && control.type == 'range') { - var value = parseFloat(control.value); - var step; - if (control.step && control.step > 0.0) { - step = control.step; - } else if (control.min && control.max) { - var range = (control.max - control.min); - if (range > 2 && range < 31) { - step = 1; - } else { - step = (control.max - control.min) / 10; - } - } else { - step = 1; - } - - if (evt.keyCode == 37 || evt.keyCode == 38) { // left or up - value -= step; - } else if (evt.keyCode == 39 || evt.keyCode == 40) { // right or down - value += step; - } - - if (control.max && value > control.max) { - value = control.max; - } - if (control.min && value < control.min) { - value = control.min; - } - - control.value = value; - } - return false; -}; - -/** - * When an element receives focus, see if we've entered or left a dialog - * and return a string describing the event. - * - * @param {Element} target The element that just received focus. - * @return {boolean} True if an announcement was spoken. - */ -cvox.ChromeVoxEventWatcher.handleDialogFocus = function(target) { - var dialog = target; - var role = ''; - while (dialog) { - if (dialog.hasAttribute) { - role = dialog.getAttribute('role'); - if (role == 'dialog' || role == 'alertdialog') { - break; - } - } - dialog = dialog.parentElement; - } - - if (dialog == cvox.ChromeVox.navigationManager.currentDialog) { - return false; - } - - if (cvox.ChromeVox.navigationManager.currentDialog && !dialog) { - if (!cvox.DomUtil.isDescendantOfNode( - document.activeElement, - cvox.ChromeVox.navigationManager.currentDialog)) { - cvox.ChromeVox.navigationManager.currentDialog = null; - - cvox.ChromeVoxEventWatcher.speakAnnotationWithCategory_( - Msgs.getMsg('exiting_dialog'), cvox.TtsCategory.NAV); - return true; - } - } else { - if (dialog) { - cvox.ChromeVox.navigationManager.currentDialog = dialog; - cvox.ChromeVoxEventWatcher.speakAnnotationWithCategory_( - Msgs.getMsg('entering_dialog'), cvox.TtsCategory.NAV); - - if (role == 'alertdialog') { - var dialogDescArray = - cvox.DescriptionUtil.getFullDescriptionsFromChildren(null, dialog); - var descSpeaker = new cvox.NavigationSpeaker(); - descSpeaker.speakDescriptionArray( - dialogDescArray, cvox.QueueMode.QUEUE, null); - } - return true; - } - } - return false; -}; - -/** - * Speak the given text with the annotation personality and the given - * speech queue utterance category. - * @param {string} text The text to speak. - * @param {string} category The category of text, used by the speech queue - * when flushing all speech from the same category while leaving other - * speech in the queue. - * @private - */ -cvox.ChromeVoxEventWatcher.speakAnnotationWithCategory_ = function( - text, category) { - var properties = {}; - var src = cvox.AbstractTts.PERSONALITY_ANNOTATION; - for (var key in src) { - properties[key] = src[key]; - } - properties['category'] = category; - cvox.ChromeVox.tts.speak( - text, cvox.ChromeVoxEventWatcher.queueMode_(), properties); -}; - -/** - * Returns true if we should wait to process events. - * @param {number} lastFocusTimestamp The timestamp of the last focus event. - * @param {number} firstTimestamp The timestamp of the first event. - * @param {number} currentTime The current timestamp. - * @return {boolean} True if we should wait to process events. - */ -cvox.ChromeVoxEventWatcherUtil.shouldWaitToProcess = function( - lastFocusTimestamp, firstTimestamp, currentTime) { - var timeSinceFocusEvent = currentTime - lastFocusTimestamp; - var timeSinceFirstEvent = currentTime - firstTimestamp; - return timeSinceFocusEvent < cvox.ChromeVoxEventWatcher.WAIT_TIME_MS_ && - timeSinceFirstEvent < cvox.ChromeVoxEventWatcher.MAX_WAIT_TIME_MS_; -}; - - -/** - * Returns the queue mode to use for the next utterance spoken as - * a result of an event or navigation. The first utterance that's spoken - * after an explicit user action like a key press will flush, and - * subsequent events will return a category flush. - * @return {cvox.QueueMode} The queue mode. - * @private - */ -cvox.ChromeVoxEventWatcher.queueMode_ = function() { - if (cvox.ChromeVoxEventWatcher.shouldFlushNextUtterance) { - cvox.ChromeVoxEventWatcher.shouldFlushNextUtterance = false; - return cvox.QueueMode.FLUSH; - } - return cvox.QueueMode.CATEGORY_FLUSH; -}; - - -/** - * Processes the events queue. - * - * @private - */ -cvox.ChromeVoxEventWatcher.processQueue_ = function() { - cvox.Memoize.scope(cvox.ChromeVoxEventWatcher.doProcessQueue_); -}; - -/** - * Implementation of |processQueue_|. - * - * @private - */ -cvox.ChromeVoxEventWatcher.doProcessQueue_ = function() { - // Return now if there are no events in the queue. - if (cvox.ChromeVoxEventWatcher.events_.length == 0) { - return; - } - - // Look for the most recent focus event and delete any preceding event - // that applied to whatever was focused previously. - var events = cvox.ChromeVoxEventWatcher.events_; - var lastFocusIndex = -1; - var lastFocusTimestamp = 0; - var evt; - var i; - for (i = 0; evt = events[i]; i++) { - if (evt.type == 'focus') { - lastFocusIndex = i; - lastFocusTimestamp = evt.timeStamp; - } - } - var liveRegionEvents = []; - var otherEvents = []; - for (i = 0; evt = events[i]; i++) { - var prevEvt = events[i - 1] || {}; - if ((i >= lastFocusIndex || evt.type == 'LiveRegion') && - (prevEvt.type != 'focus' || evt.type != 'change')) { - if (evt.type == 'LiveRegion') { - liveRegionEvents.push(evt); - } else { - otherEvents.push(evt); - } - } - } - // Make sure that live region events are at the end of the events array. - cvox.ChromeVoxEventWatcher.events_ = [...otherEvents, ...liveRegionEvents]; - - // If the most recent focus event was very recent, wait for things to - // settle down before processing events, unless the max wait time has - // passed. - var currentTime = new Date().getTime(); - if (lastFocusIndex >= 0 && - cvox.ChromeVoxEventWatcherUtil.shouldWaitToProcess( - lastFocusTimestamp, - cvox.ChromeVoxEventWatcher.firstUnprocessedEventTime, currentTime)) { - window.setTimeout( - cvox.ChromeVoxEventWatcher.processQueue_, - cvox.ChromeVoxEventWatcher.WAIT_TIME_MS_); - return; - } - - // Process the remaining events in the queue, in order. - for (i = 0; evt = cvox.ChromeVoxEventWatcher.events_[i]; i++) { - cvox.ChromeVoxEventWatcher.handleEvent_(evt); - } - cvox.ChromeVoxEventWatcher.events_ = new Array(); - cvox.ChromeVoxEventWatcher.firstUnprocessedEventTime = -1; - cvox.ChromeVoxEventWatcher.queueProcessingScheduled_ = false; - cvox.ChromeVoxEventWatcher.maybeCallReadyCallbacks_(); -}; - -/** - * Handle events from the queue by routing them to their respective handlers. - * - * @private - * @param {Event} evt The event to be handled. - */ -cvox.ChromeVoxEventWatcher.handleEvent_ = function(evt) { - switch (evt.type) { - case 'keydown': - case 'input': - cvox.ChromeVoxEventWatcher.setUpTextHandler(); - if (cvox.ChromeVoxEventWatcher.currentTextControl) { - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - - var editableText = /** @type {cvox.ChromeVoxEditableTextBase} */ - (cvox.ChromeVoxEventWatcher.currentTextHandler); - if (editableText && editableText.lastChangeDescribed) { - break; - } - } - // We're either not on a text control, or we are on a text control but no - // text change was described. Let's try describing the state instead. - cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement); - break; - case 'keyup': - // Some controls change only after key up. - cvox.ChromeVoxEventWatcher.handleControlChanged(document.activeElement); - break; - case 'keypress': - cvox.ChromeVoxEventWatcher.setUpTextHandler(); - break; - case 'click': - cvox.ChromeVox.navigationManager.syncToNode( - /** @type {Node} */ (evt.target), true); - break; - case 'focus': - cvox.ChromeVoxEventWatcher.focusHandler(evt); - break; - case 'blur': - cvox.ChromeVoxEventWatcher.setUpTextHandler(); - break; - case 'change': - cvox.ChromeVoxEventWatcher.changeHandler(evt); - break; - case 'select': - cvox.ChromeVoxEventWatcher.setUpTextHandler(); - break; - case 'LiveRegion': - cvox.ChromeVoxEventWatcher.speakLiveRegion_( - evt.assertive, evt.navDescriptions); - break; - } -}; - - -/** - * Sets up the time handler. - * @return {boolean} True if a time control has focus. - * @private - */ -cvox.ChromeVoxEventWatcher.setUpTimeHandler_ = function() { - var currentFocus = document.activeElement; - if (currentFocus && currentFocus.hasAttribute && - currentFocus.getAttribute('aria-hidden') == 'true' && - currentFocus.getAttribute('chromevoxignoreariahidden') != 'true') { - currentFocus = null; - } - if (currentFocus.constructor == HTMLInputElement && currentFocus.type && - (currentFocus.type == 'time')) { - cvox.ChromeVoxEventWatcher.currentTimeHandler = - new cvox.ChromeVoxHTMLTimeWidget(currentFocus, cvox.ChromeVox.tts); - } else { - cvox.ChromeVoxEventWatcher.currentTimeHandler = null; - } - return (null != cvox.ChromeVoxEventWatcher.currentTimeHandler); -}; - - -/** - * Sets up the media (video/audio) handler. - * @return {boolean} True if a media control has focus. - * @private - */ -cvox.ChromeVoxEventWatcher.setUpMediaHandler_ = function() { - var currentFocus = document.activeElement; - if (currentFocus && currentFocus.hasAttribute && - currentFocus.getAttribute('aria-hidden') == 'true' && - currentFocus.getAttribute('chromevoxignoreariahidden') != 'true') { - currentFocus = null; - } - if ((currentFocus.constructor == HTMLVideoElement) || - (currentFocus.constructor == HTMLAudioElement)) { - cvox.ChromeVoxEventWatcher.currentMediaHandler = - new cvox.ChromeVoxHTMLMediaWidget(currentFocus, cvox.ChromeVox.tts); - } else { - cvox.ChromeVoxEventWatcher.currentMediaHandler = null; - } - return (null != cvox.ChromeVoxEventWatcher.currentMediaHandler); -}; - -/** - * Sets up the date handler. - * @return {boolean} True if a date control has focus. - * @private - */ -cvox.ChromeVoxEventWatcher.setUpDateHandler_ = function() { - var currentFocus = document.activeElement; - if (currentFocus && currentFocus.hasAttribute && - currentFocus.getAttribute('aria-hidden') == 'true' && - currentFocus.getAttribute('chromevoxignoreariahidden') != 'true') { - currentFocus = null; - } - if (currentFocus.constructor == HTMLInputElement && currentFocus.type && - ((currentFocus.type == 'date') || (currentFocus.type == 'month') || - (currentFocus.type == 'week'))) { - cvox.ChromeVoxEventWatcher.currentDateHandler = - new cvox.ChromeVoxHTMLDateWidget(currentFocus, cvox.ChromeVox.tts); - } else { - cvox.ChromeVoxEventWatcher.currentDateHandler = null; - } - return (null != cvox.ChromeVoxEventWatcher.currentDateHandler); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/history.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/history.js deleted file mode 100644 index 5ed3a94..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/history.js +++ /dev/null
@@ -1,417 +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. - - -/** - * @fileoverview Stores the history of a ChromeVox session. - */ - -goog.provide('cvox.History'); - -goog.require('cvox.DomUtil'); -goog.require('cvox.NodeBreadcrumb'); - -/** - * A history event is stored in the cvox.History object and contains all the - * information about a single ChromeVox event. - * @param {Object=} opt_json A simple initializer object. - * @constructor - */ -cvox.HistoryEvent = function(opt_json) { - /** - * The start time of this event, in msec since epoch. - * @type {number} - * @private - */ - this.startTime_; - - /** - * The end time of this event, in msec since epoch. - * @type {number} - * @private - */ - this.endTime_; - - /** - * The user command executed in this event. - * @type {string} - * @private - */ - this.userCommand_; - - /** - * An array of spoken output. - * @type {Array<string>} - * @private - */ - this.spoken_ = []; - - /** - * The ChromeVox tag for the current node at the end of this event. - * @type {number} - * @private - */ - this.cvTag_; - - /** - * True if replayed. - * @type {boolean} - * @private - */ - this.replayed_ = false; - - if (opt_json) { - this.replayed_ = true; - this.userCommand_ = opt_json['cmd']; - } else { - this.startTime_ = new Date().getTime(); - } -}; - -/** - * @param {string} functionName The name of the user command. - * @return {cvox.HistoryEvent} this for chaining. - */ -cvox.HistoryEvent.prototype.withUserCommand = function(functionName) { - if (this.userCommand_) { - window.console.error('Two user commands on ' + functionName, this); - return this; - } - this.userCommand_ = functionName; - return this; -}; - -/** - * @param {string} str The text spoken. - * @return {cvox.HistoryEvent} this for chaining. - */ -cvox.HistoryEvent.prototype.speak = function(str) { - this.spoken_.push(str); - return this; -}; - -/** - * Called when the event is done. We can expect nothing else will be added to - * the event after this call. - * @return {cvox.HistoryEvent} this for chaining. - */ -cvox.HistoryEvent.prototype.done = function() { - this.endTime_ = new Date().getTime(); - - this.cvTag_ = cvox.NodeBreadcrumb.getInstance().tagCurrentNode(); - - window.console.log('User command done.', this); - return this; -}; - -/** - * Outputs the event as a simple object - * @return {Object} A object representation of the event. - */ -cvox.HistoryEvent.prototype.outputObject = function() { - return { - 'start': this.startTime_, - 'end': this.endTime_, - 'cmd': this.userCommand_, - 'spoken': this.spoken_ - }; -}; - -/** - * Outputs a HTML element that can be added to the DOM. - * @return {Element} The HTML element. - */ -cvox.HistoryEvent.prototype.outputHTML = function() { - var div = document.createElement('div'); - div.className = 'cvoxHistoryEvent'; - var dur = this.endTime_ - this.startTime_; - div.innerHTML = this.userCommand_ + ' (' + dur + 'ms)'; - for (var i = 0; i < this.spoken_.length; i++) { - var sdiv = document.createElement('div'); - sdiv.className = 'cvoxHistoryEventSpoken'; - sdiv.innerHTML = this.spoken_[i].substr(0, 20); - if (this.spoken_[i].length > 20) { - sdiv.innerHTML += '...'; - } - div.appendChild(sdiv); - } - return div; -}; - -/** - * Outputs Javascript to replay the command and assert the output. - * @return {string} The Javascript. - */ -cvox.HistoryEvent.prototype.outputJs = function() { - var o = 'this.waitForCalm(this.userCommand, \'' + this.userCommand_ + '\')'; - if (this.spoken_.length > 0) { - o += '\n .waitForCalm(this.assertSpoken, \'' + - cvox.DomUtil.collapseWhitespace(this.spoken_.join(' ')) + '\');\n'; - } else { - o += ';\n'; - } - return o; -}; - - -/** - * @constructor - * @implements {cvox.TtsInterface} - */ -cvox.History = function() { - this.recording_ = false; - - this.events_ = []; - this.markers_ = {}; - this.currentEvent_ = null; - - this.mainDiv_ = null; - this.listDiv_ = null; - this.styleDiv_ = null; - - this.bigBoxDiv_ = null; - - // NOTE(deboer): Currently we only ever have one cvox.History, but - // if we ever have more than one, we need multiple NodeBreadcrumbs as well. - this.nodeBreadcrumb_ = cvox.NodeBreadcrumb.getInstance(); - -}; -goog.addSingletonGetter(cvox.History); - -/** - * Adds a list div to the DOM for debugging. - * @private - */ -cvox.History.prototype.addListDiv_ = function() { - this.mainDiv_ = document.createElement('div'); - this.mainDiv_.style.position = 'fixed'; - this.mainDiv_.style.bottom = '0'; - this.mainDiv_.style.right = '0'; - this.mainDiv_.style.zIndex = '999'; - - this.listDiv_ = document.createElement('div'); - this.listDiv_.id = 'cvoxEventList'; - this.mainDiv_.appendChild(this.listDiv_); - - var buttonDiv = document.createElement('div'); - var button = document.createElement('button'); - button.onclick = cvox.History.sendToFeedback; - button.innerHTML = 'Create bug'; - buttonDiv.appendChild(button); - this.mainDiv_.appendChild(buttonDiv); - - var dumpDiv = document.createElement('div'); - var dumpButton = document.createElement('button'); - dumpButton.onclick = cvox.History.dumpJs; - dumpButton.innerHTML = 'Dump test case'; - dumpDiv.appendChild(dumpButton); - this.mainDiv_.appendChild(dumpDiv); - - document.body.appendChild(this.mainDiv_); - - this.styleDiv_ = document.createElement('style'); - this.styleDiv_.innerHTML = - '.cvoxHistoryEventSpoken { color: gray; font-size: 75% }'; - document.body.appendChild(this.styleDiv_); -}; - - -/** - * Removes the list div. - * @private - */ -cvox.History.prototype.removeListDiv_ = function() { - document.body.removeChild(this.mainDiv_); - document.body.removeChild(this.styleDiv_); - this.mainDiv_ = null; - this.listDiv_ = null; - this.styleDiv_ = null; -}; - - -/** - * Adds a big text box in the middle of the screen - * @private - */ -cvox.History.prototype.addBigTextBox_ = function() { - var bigBoxDiv = document.createElement('div'); - bigBoxDiv.style.position = 'fixed'; - bigBoxDiv.style.top = '0'; - bigBoxDiv.style.left = '0'; - bigBoxDiv.style.zIndex = '999'; - - var textarea = document.createElement('textarea'); - textarea.style.width = '500px'; - textarea.style.height = '500px'; - textarea.innerHTML = this.dumpJsOutput_(); - bigBoxDiv.appendChild(textarea); - - var buttons = document.createElement('div'); - bigBoxDiv.appendChild(buttons); - - function link(name, func) { - var linkElt = document.createElement('button'); - linkElt.onclick = func; - linkElt.innerHTML = name; - buttons.appendChild(linkElt); - } - link('Close dialog', function() { - document.body.removeChild(bigBoxDiv); - }); - link('Remove fluff', goog.bind(function() { - textarea.innerHTML = this.dumpJsOutput_(['stopSpeech', 'toggleKeyPrefix']); - }, this)); - document.body.appendChild(bigBoxDiv); -}; - - - -/** - * Start recording and show the debugging list div. - */ -cvox.History.prototype.startRecording = function() { - this.recording_ = true; - this.addListDiv_(); -}; - - -/** - * Stop recording and clear the events array. - */ -cvox.History.prototype.stopRecording = function() { - this.recording_ = false; - this.removeListDiv_(); - this.events_ = []; - this.currentEvent_ = null; -}; - - -/** - * Called by ChromeVox when it enters a user command. - * @param {string} functionName The function name. - */ -cvox.History.prototype.enterUserCommand = function(functionName) { - if (!this.recording_) { - return; - } - if (this.currentEvent_) { - window.console.error( - 'User command ' + functionName + ' overlaps current event', - this.currentEvent_); - } - this.currentEvent_ = new cvox.HistoryEvent().withUserCommand(functionName); - this.events_.push(this.currentEvent_); -}; - - -/** - * Called by ChromeVox when it exits a user command. - * @param {string} functionName The function name, useful for debugging. - */ -cvox.History.prototype.exitUserCommand = function(functionName) { - if (!this.recording_ || !this.currentEvent_) { - return; - } - this.currentEvent_.done(); - this.listDiv_.appendChild(this.currentEvent_.outputHTML()); - this.currentEvent_ = null; -}; - - -/** @override */ -cvox.History.prototype.speak = function(str, mode, props) { - if (!this.recording_) { - return this; - } - if (!this.currentEvent_) { - window.console.error('Speak called outside of a user command.'); - return this; - } - this.currentEvent_.speak(str); - return this; -}; - - -/** @override */ -cvox.History.prototype.isSpeaking = function() { - return false; -}; -/** @override */ -cvox.History.prototype.stop = function() {}; -/** @override */ -cvox.History.prototype.addCapturingEventListener = function(listener) {}; -/** @override */ -cvox.History.prototype.increaseOrDecreaseProperty = function( - propertyName, increase) {}; -/** @override */ -cvox.History.prototype.propertyToPercentage = function(property) {}; -/** @override */ -cvox.History.prototype.getDefaultProperty = function(property) {}; -/** @override */ -cvox.History.prototype.toggleSpeechOnOrOff = function() {}; - - -/** TODO: add doc comment. */ -cvox.History.dumpJs = function() { - var history = cvox.History.getInstance(); - history.addBigTextBox_(); - window.console.log(history.dumpJsOutput_()); -}; - - -/** - * @param {Array<string>=} opt_skipCommands - * @return {string} A string of Javascript output. - * @private - */ -cvox.History.prototype.dumpJsOutput_ = function(opt_skipCommands) { - var skipMap = {}; - if (opt_skipCommands) { - opt_skipCommands.forEach(function(e) { - skipMap[e] = 1; - }); - } - // TODO: pretty print - return ['/*DOC: += ', this.nodeBreadcrumb_.dumpWalkedDom().innerHTML, '*/\n'] - .concat(this.events_ - .filter(function(e) { - return !(e.userCommand_ in skipMap); - }) - .map(function(e) { - return e.outputJs(); - })) - .join(''); -}; - - -/** - * Send the history to Google Feedback. - */ -cvox.History.sendToFeedback = function() { - var history = cvox.History.getInstance(); - var output = history.events_.map(function(e) { - return e.outputObject(); - }); - - var feedbackScript = document.createElement('script'); - feedbackScript.type = 'text/javascript'; - feedbackScript.src = 'https://www.gstatic.com/feedback/api.js'; - - var runFeedbackScript = document.createElement('script'); - runFeedbackScript.type = 'text/javascript'; - runFeedbackScript.innerHTML = 'userfeedback.api.startFeedback(' + - '{ productId: \'76092\' }, ' + - '{ cvoxHistory: ' + - cvox.ChromeVoxJSON.stringify(cvox.ChromeVoxJSON.stringify(output)) + - ' });'; - - feedbackScript.onload = function() { - document.body.appendChild(runFeedbackScript); - }; - - document.body.appendChild(feedbackScript); -}; - - -// Add more events: key press, DOM
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js deleted file mode 100644 index 25d4eb0..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js +++ /dev/null
@@ -1,177 +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. - -/** - * @fileoverview Initializes the injected content script on the document. - * - * NOTE(deboer): This file will automatically initialize ChromeVox. If you can - * control when ChromeVox starts, consider using cvox.InitGlobals instead. - * - */ - -goog.provide('cvox.ChromeVoxInit'); - -goog.require('cvox.ChromeVox'); -goog.require('cvox.ExtensionBridge'); -goog.require('cvox.HostFactory'); -goog.require('cvox.InitGlobals'); - -/** - * The time to pause before trying again to initialize, in ms. This - * number starts small and keeps growing so that we don't waste CPU - * time on a page that takes a long time to load. - * @type {number} - * @private - */ -cvox.ChromeVox.initTimeout_ = 100; - - -/** - * @type {number} - * @private - */ -cvox.ChromeVox.initTimer_ = 0; - - -/** - * Maximum retry timeout for initialization. Note that exponential backoff - * used, so the actual time before giving up is about twice this number. - * @const {number} - * @private - */ -cvox.ChromeVox.MAX_INIT_TIMEOUT_ = 30000; - - -/** - * Flag indicating if ChromeVox Classic is enabled based on the Next - * background page which sends the state at page load. - * @type {boolean|undefined} - * @private - */ -cvox.ChromeVox.isClassicEnabled_ = undefined; - - -/** - * Call the init function later, safely. - * @param {string} reason A developer-readable string to log to the console - * explaining why we're trying again. - * @private - */ -cvox.ChromeVox.recallInit_ = function(reason) { - if (cvox.ChromeVox.initTimeout_ > cvox.ChromeVox.MAX_INIT_TIMEOUT_) { - window.console.log(reason + ' Taking too long - giving up.'); - return; - } - window.console.log( - reason + ' Will try again in ' + cvox.ChromeVox.initTimeout_ + 'ms'); - cvox.ChromeVox.initTimer_ = window.setTimeout( - cvox.ChromeVox.initDocument, cvox.ChromeVox.initTimeout_); - cvox.ChromeVox.initTimeout_ *= 2; -}; - - -/** - * Initializes cvox.ChromeVox when the document is ready. - */ -cvox.ChromeVox.initDocument = function() { - // Don't start the content script on the ChromeVox background page. - if (/^chrome-extension:\/\/.*background\.html$/.test(window.location.href)) { - return; - } - - // Look for ChromeVox-specific meta attributes. - var disableContentScript = false; - if (document.head) { - var metaNodes = document.head.querySelectorAll('meta[name="chromevox"]'); - for (var i = 0, meta; meta = metaNodes[i]; i++) { - var contentScript = meta.getAttribute('content-script'); - if (contentScript && contentScript.toLowerCase() == 'no') { - disableContentScript = true; - } - } - } - if (disableContentScript) { - var url = location.href; - url = url.substring(0, url.indexOf('#')) || url; - cvox.ExtensionBridge.send( - {target: 'next', action: 'enableClassicCompatForUrl', url: url}); - return; - } - - cvox.ExtensionBridge.send( - {target: 'next', action: 'getIsClassicEnabled', url: location.href}); - - cvox.ChromeVox.initTimer_ = 0; - var reinitReason; - if (!document.body) { - reinitReason = 'ChromeVox not starting on unloaded page'; - } - if (cvox.ChromeVox.isClassicEnabled_ === undefined) { - reinitReason = 'ChromeVox waiting for background page'; - } - if (reinitReason && cvox.ChromeVox.recallInit_) { - cvox.ChromeVox.recallInit_( - reinitReason + ': ' + document.location.href + '.'); - return; - } - - if (!cvox.ChromeVox.isClassicEnabled_) { - return; - } - - // Setup globals - cvox.ChromeVox.host = cvox.HostFactory.getHost(); - - if (!cvox.ChromeVox.host.ttsLoaded()) { - cvox.ChromeVox.recallInit_( - 'ChromeVox not starting; waiting for TTS. ' + document.location.href + - '.'); - return; - } - - window.console.log('Starting ChromeVox.'); - - cvox.InitGlobals.initGlobals(); - - // Add a global function to disable this instance of ChromeVox. - // There is a scenario where two copies of the content script can get - // loaded into the same tab on browser startup - one automatically - // and one because the background page injects the content script into - // every tab on startup. This allows the background page to first deactivate - // any existing copy of the content script (if any) before loading it again, - // otherwise there can be duplicate event listeners. - window.disableChromeVox = function() { - cvox.ChromeVox.host.killChromeVox(); - }; -}; - - -/** - * Reinitialize ChromeVox, if the extension is disabled and then enabled - * again, but our injected page script has remained. - */ -cvox.ChromeVox.reinit = function() { - cvox.ChromeVox.host.reinit(); - cvox.ChromeVox.initDocument(); -}; - -if (!COMPILED) { - // NOTE(deboer): This is called when this script is loaded, automatically - // starting ChromeVox. If this isn't the uncompiled script, it will be - // called in loader.js. - cvox.ChromeVox.initDocument(); -} - -cvox.ExtensionBridge.addMessageListener(function(msg, port) { - if (msg['target'] == 'next') { - cvox.ChromeVox.isClassicEnabled_ = msg['isClassicEnabled']; - } -}); - -cvox.ExtensionBridge.addDisconnectListener(function() { - if (cvox.ChromeVox.initTimer_ > 0) { - window.clearTimeout(cvox.ChromeVox.initTimer_); - cvox.ChromeVox.initTimer_ = 0; - } -});
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_globals.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_globals.js deleted file mode 100644 index d140a9c..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_globals.js +++ /dev/null
@@ -1,66 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview Initializes the injected content script. - * - */ - -goog.provide('cvox.InitGlobals'); - -goog.require('cvox.ChromeVox'); -goog.require('cvox.ChromeVoxEventWatcher'); -goog.require('cvox.CompositeTts'); -goog.require('cvox.HostFactory'); -goog.require('cvox.NavigationManager'); -goog.require('cvox.Serializer'); - - - -/** - * @constructor - */ -cvox.InitGlobals = function() {}; - - -/** - * Initializes cvox.ChromeVox. - */ -cvox.InitGlobals.initGlobals = function() { - if (!cvox.ChromeVox.host) { - cvox.ChromeVox.host = cvox.HostFactory.getHost(); - } - - cvox.ChromeVox.tts = new cvox.CompositeTts() - .add(cvox.HostFactory.getTts()) - .add(cvox.History.getInstance()); - - if (!cvox.ChromeVox.braille) { - cvox.ChromeVox.braille = cvox.HostFactory.getBraille(); - } - - - cvox.ChromeVox.earcons = cvox.HostFactory.getEarcons(); - cvox.ChromeVox.isActive = true; - cvox.ChromeVox.navigationManager = new cvox.NavigationManager(); - cvox.ChromeVox.navigationManager.updateIndicator(); - cvox.ChromeVox.syncToNode = cvox.ChromeVox.navigationManager.syncToNode.bind( - cvox.ChromeVox.navigationManager); - - cvox.ChromeVox.serializer = new cvox.Serializer(); - - // Do platform specific initialization here. - cvox.ChromeVox.host.init(); - - // Start the event watchers - cvox.ChromeVoxEventWatcher.init(window); - - // Provide a way for modules that can't depend on cvox.ChromeVoxUserCommands - // to execute commands. - cvox.ChromeVox.executeUserCommand = function(commandName) { - cvox.ChromeVoxUserCommands.commands[commandName](); - }; - - cvox.ChromeVox.host.onPageLoad(); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/initial_speech.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/initial_speech.js deleted file mode 100644 index 6bfac70b..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/initial_speech.js +++ /dev/null
@@ -1,84 +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. - -/** - * @fileoverview Defines the initial speech call. - */ - -goog.provide('cvox.InitialSpeech'); - -goog.require('cvox.AbstractTts'); -goog.require('cvox.BrailleOverlayWidget'); -goog.require('cvox.ChromeVox'); -goog.require('cvox.CursorSelection'); -goog.require('cvox.DescriptionUtil'); -goog.require('cvox.DomUtil'); -goog.require('cvox.LiveRegions'); - -// INJECTED_AFTER_LOAD is set true by ChromeVox itself or ChromeOS when this -// script is injected after page load (i.e. when manually enabling ChromeVox). -if (!window['INJECTED_AFTER_LOAD']) - window['INJECTED_AFTER_LOAD'] = false; - - -/** - * Initial speech when the page loads. This may happen only after we get - * prefs back, so we can make sure ChromeVox is active. - */ -cvox.InitialSpeech.speak = function() { - // Don't speak page title and other information if this script is not injected - // at the time of page load. This global is set by Chrome OS. - var disableSpeak = window['INJECTED_AFTER_LOAD']; - - if (!cvox.ChromeVox.isActive || document.webkitHidden) { - disableSpeak = true; - } - - // If we're the top-level frame, speak the title of the page + - // the active element if it is a user control. - if (window.top == window) { - var title = document.title; - - // Allow the web author to disable reading the page title on load - // by adding aria-hidden=true to the <title> element. - var titleElement = document.querySelector('head > title'); - if (titleElement && titleElement.getAttribute('aria-hidden') == 'true') { - title = null; - } - - if (title && !disableSpeak) { - cvox.ChromeVox.tts.speak(title, cvox.QueueMode.FLUSH); - } - cvox.BrailleOverlayWidget.getInstance().init(); - } - - // Initialize live regions and speak alerts. - cvox.LiveRegions.init(new Date(), cvox.QueueMode.QUEUE, disableSpeak); - - // If our activeElement is on body, try to sync to the first element. This - // actually happens inside of NavigationManager.reset, which doesn't get - // called until AbstractHost.onPageLoad, but we need to speak and braille the - // initial node here. - if (cvox.ChromeVox.documentHasFocus() && - document.activeElement == document.body) { - cvox.ChromeVox.navigationManager.syncToBeginning(); - } - - // If we had a previous position recorded, update to it. - if (cvox.ChromeVox.position[document.location.href]) { - var pos = cvox.ChromeVox.position[document.location.href]; - cvox.ChromeVox.navigationManager.updateSelToArbitraryNode( - document.elementFromPoint(pos.x, pos.y)); - } - - // If this iframe has focus, speak and braille the current focused element. - if (cvox.ChromeVox.documentHasFocus()) { - if (!disableSpeak) { - cvox.ChromeVoxEventSuspender.withSuspendedEvents(function() { - cvox.ChromeVox.navigationManager.finishNavCommand( - '', true, cvox.QueueMode.QUEUE); - })(); - } - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/live_regions.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/live_regions.js deleted file mode 100644 index 4100d80..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/live_regions.js +++ /dev/null
@@ -1,444 +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. - -/** - * @fileoverview Keeps track of live regions on the page and speaks updates - * when they change. - * - */ - -goog.provide('cvox.LiveRegions'); - -goog.require('cvox.AriaUtil'); -goog.require('cvox.ChromeVox'); -goog.require('cvox.DescriptionUtil'); -goog.require('cvox.DomUtil'); -goog.require('cvox.Interframe'); -goog.require('cvox.NavDescription'); -goog.require('cvox.NavigationSpeaker'); - -/** - * @constructor - */ -cvox.LiveRegions = function() {}; - -/** - * @type {Date} - */ -cvox.LiveRegions.pageLoadTime = null; - -/** - * Time in milliseconds after initial page load to ignore live region - * updates, to avoid announcing regions as they're initially created. - * The exception is alerts, they're announced when a page is loaded. - * @type {number} - * @const - */ -cvox.LiveRegions.INITIAL_SILENCE_MS = 2000; - -/** - * Time in milliseconds to wait for a node to become visible after a - * mutation. Needed to allow live regions to fade in and have an initial - * opacity of zero. - * @type {number} - * @const - */ -cvox.LiveRegions.VISIBILITY_TIMEOUT_MS = 50; - -/** - * A mapping from announced text to the time it was last spoken. - * @type {Object<Date>} - */ -cvox.LiveRegions.lastAnnouncedMap = {}; - -/** - * Maximum time interval in which to discard duplicate live region announcement. - * @type {number} - * @const - */ -cvox.LiveRegions.MAX_DISCARD_DUPS_MS = 2000; - -/** - * @type {Date} - */ -cvox.LiveRegions.lastAnnouncedTime = null; - -/** - * Tracks nodes handled during mutation processing. - * @type {!Array<Node>} - */ -cvox.LiveRegions.nodesAlreadyHandled = []; - -/** - * @param {Date} pageLoadTime The time the page was loaded. Live region - * updates within the first INITIAL_SILENCE_MS milliseconds are ignored. - * @param {cvox.QueueMode} queueMode Interrupt or flush. Polite live region - * changes always queue. - * @param {boolean} disableSpeak true if change announcement should be disabled. - * @return {boolean} true if any regions announced. - */ -cvox.LiveRegions.init = function(pageLoadTime, queueMode, disableSpeak) { - cvox.LiveRegions.pageLoadTime = pageLoadTime; - - if (disableSpeak || !cvox.ChromeVox.documentHasFocus()) { - return false; - } - - // Speak any live regions already on the page. The logic below will - // make sure that only alerts are actually announced. - var anyRegionsAnnounced = false; - var regions = cvox.AriaUtil.getLiveRegions(document.body); - for (var i = 0; i < regions.length; i++) { - cvox.LiveRegions.handleOneChangedNode( - regions[i], regions[i], false, false, - function(assertive, navDescriptions) { - if (!assertive && queueMode == cvox.QueueMode.FLUSH) { - queueMode = cvox.QueueMode.QUEUE; - } - var descSpeaker = new cvox.NavigationSpeaker(); - descSpeaker.speakDescriptionArray(navDescriptions, queueMode, null); - anyRegionsAnnounced = true; - }); - } - - cvox.Interframe.addListener(function(message) { - if (message['command'] != 'speakLiveRegion') { - return; - } - var iframes = document.getElementsByTagName('iframe'); - for (var i = 0, iframe; iframe = iframes[i]; i++) { - if (iframe.src == message['src']) { - if (!cvox.DomUtil.isVisible(iframe)) { - return; - } - var structs = JSON.parse(message['content']); - var descriptions = []; - for (var j = 0, description; description = structs[j]; j++) { - descriptions.push(new cvox.NavDescription(description)); - } - new cvox.NavigationSpeaker().speakDescriptionArray( - descriptions, message['queueMode'], null); - } - } - }); - - return anyRegionsAnnounced; -}; - -/** - * See if any mutations pertain to a live region, and speak them if so. - * - * This function is not reentrant, it uses some global state to keep - * track of nodes it's already spoken once. - * - * @param {Array<MutationRecord>} mutations The mutations. - * @param {function(boolean, Array<cvox.NavDescription>)} handler - * A callback function that handles each live region description found. - * The function is passed a boolean indicating if the live region is - * assertive, and an array of navdescriptions to speak. - */ -cvox.LiveRegions.processMutations = function(mutations, handler) { - cvox.LiveRegions.nodesAlreadyHandled = []; - mutations.forEach(function(mutation) { - if (mutation.target.hasAttribute && - mutation.target.hasAttribute('cvoxIgnore')) { - return; - } - if (mutation.addedNodes) { - for (var i = 0; i < mutation.addedNodes.length; i++) { - if (mutation.addedNodes[i].hasAttribute && - mutation.addedNodes[i].hasAttribute('cvoxIgnore')) { - continue; - } - cvox.LiveRegions.handleOneChangedNode( - mutation.addedNodes[i], mutation.target, false, true, handler); - } - } - if (mutation.removedNodes) { - for (var i = 0; i < mutation.removedNodes.length; i++) { - if (mutation.removedNodes[i].hasAttribute && - mutation.removedNodes[i].hasAttribute('cvoxIgnore')) { - continue; - } - cvox.LiveRegions.handleOneChangedNode( - mutation.removedNodes[i], mutation.target, true, false, handler); - } - } - if (mutation.type == 'characterData') { - cvox.LiveRegions.handleOneChangedNode( - mutation.target, mutation.target, false, false, handler); - } - if (mutation.attributeName == 'class' || - mutation.attributeName == 'style' || - mutation.attributeName == 'hidden') { - var attr = mutation.attributeName; - var target = mutation.target; - var newInvisible = !cvox.DomUtil.isVisible(target); - - // Create a fake element on the page with the old values of - // class, style, and hidden for this element, to see if that test - // element would have had different visibility. - var testElement = document.createElement('div'); - testElement.setAttribute('cvoxIgnore', '1'); - testElement.setAttribute('class', target.getAttribute('class')); - testElement.setAttribute('style', target.getAttribute('style')); - testElement.setAttribute('hidden', target.getAttribute('hidden')); - testElement.setAttribute(attr, /** @type {string} */ (mutation.oldValue)); - - var oldInvisible = true; - if (target.parentElement) { - target.parentElement.appendChild(testElement); - oldInvisible = !cvox.DomUtil.isVisible(testElement); - target.parentElement.removeChild(testElement); - } else { - oldInvisible = !cvox.DomUtil.isVisible(testElement); - } - - if (oldInvisible === true && newInvisible === false) { - cvox.LiveRegions.handleOneChangedNode( - mutation.target, mutation.target, false, true, handler); - } else if (oldInvisible === false && newInvisible === true) { - cvox.LiveRegions.handleOneChangedNode( - mutation.target, mutation.target, true, false, handler); - } - } - }); - cvox.LiveRegions.nodesAlreadyHandled.length = 0; -}; - -/** - * Handle one changed node. First check if this node is itself within - * a live region, and if that fails see if there's a live region within it - * and call this method recursively. For each actual live region, call a - * method to recursively announce all changes. - * - * @param {Node} node A node that's changed. - * @param {Node} parent The parent node. - * @param {boolean} isRemoval True if this node was removed. - * @param {boolean} subtree True if we should check the subtree. - * @param {function(boolean, Array<cvox.NavDescription>)} handler - * Callback function to be called for each live region found. - */ -cvox.LiveRegions.handleOneChangedNode = function( - node, parent, isRemoval, subtree, handler) { - var liveRoot = isRemoval ? parent : node; - if (!(liveRoot instanceof Element)) { - liveRoot = liveRoot.parentElement; - } - while (liveRoot) { - if (cvox.AriaUtil.getAriaLive(liveRoot)) { - break; - } - liveRoot = liveRoot.parentElement; - } - if (!liveRoot) { - if (subtree && node != document.body) { - var subLiveRegions = cvox.AriaUtil.getLiveRegions(node); - for (var i = 0; i < subLiveRegions.length; i++) { - cvox.LiveRegions.handleOneChangedNode( - subLiveRegions[i], parent, isRemoval, false, handler); - } - } - return; - } - - // If the page just loaded and this is any region type other than 'alert', - // skip it. Alerts are the exception, they're announced on page load. - var deltaTime = new Date() - cvox.LiveRegions.pageLoadTime; - if (cvox.AriaUtil.getRoleAttribute(liveRoot) != 'alert' && - deltaTime < cvox.LiveRegions.INITIAL_SILENCE_MS) { - return; - } - - if (cvox.LiveRegions.nodesAlreadyHandled.indexOf(node) >= 0) { - return; - } - cvox.LiveRegions.nodesAlreadyHandled.push(node); - - if (cvox.AriaUtil.getAriaBusy(liveRoot)) { - return; - } - - if (isRemoval) { - if (!cvox.AriaUtil.getAriaRelevant(liveRoot, 'removals')) { - return; - } - } else { - if (!cvox.AriaUtil.getAriaRelevant(liveRoot, 'additions')) { - return; - } - } - - cvox.LiveRegions.announceChangeIfVisible(node, liveRoot, isRemoval, handler); -}; - -/** - * Announce one node within a live region if it's visible. - * In order to handle live regions that fade in, if the node isn't currently - * visible, check again after a short timeout. - * - * @param {Node} node A node in a live region. - * @param {Node} liveRoot The root of the live region this node is in. - * @param {boolean} isRemoval True if this node was removed. - * @param {function(boolean, Array<cvox.NavDescription>)} handler - * Callback function to be called for each live region found. - */ -cvox.LiveRegions.announceChangeIfVisible = function( - node, liveRoot, isRemoval, handler) { - if (cvox.DomUtil.isVisible(liveRoot)) { - cvox.LiveRegions.announceChange(node, liveRoot, isRemoval, handler); - } else { - window.setTimeout(function() { - if (cvox.DomUtil.isVisible(liveRoot)) { - cvox.LiveRegions.announceChange(node, liveRoot, isRemoval, handler); - } - }, cvox.LiveRegions.VISIBILITY_TIMEOUT_MS); - } -}; - -/** - * Announce one node within a live region. - * - * @param {Node} node A node in a live region. - * @param {Node} liveRoot The root of the live region this node is in. - * @param {boolean} isRemoval True if this node was removed. - * @param {function(boolean, Array<cvox.NavDescription>)} handler - * Callback function to be called for each live region found. - */ -cvox.LiveRegions.announceChange = function(node, liveRoot, isRemoval, handler) { - // If this node is in an atomic container, announce the whole container. - // This includes aria-atomic, but also ARIA controls and other nodes - // whose ARIA roles make them leaves. - if (node != liveRoot) { - var atomicContainer = node.parentElement; - while (atomicContainer) { - if ((cvox.AriaUtil.getAriaAtomic(atomicContainer) || - cvox.AriaUtil.isLeafElement(atomicContainer) || - cvox.AriaUtil.isControlWidget(atomicContainer)) && - !cvox.AriaUtil.isCompositeControl(atomicContainer)) { - node = atomicContainer; - } - if (atomicContainer == liveRoot) { - break; - } - atomicContainer = atomicContainer.parentElement; - } - } - - var navDescriptions = cvox.LiveRegions.getNavDescriptionsRecursive(node); - if (isRemoval) { - navDescriptions = [cvox.DescriptionUtil.getDescriptionFromAncestors( - [node], true, cvox.ChromeVox.verbosity)]; - navDescriptions = [ - new cvox.NavDescription( - {context: Msgs.getMsg('live_regions_removed'), text: ''}) - ].concat(navDescriptions); - } - - if (navDescriptions.length == 0) { - return; - } - - // Don't announce alerts on page load if their text and values consist of - // just whitespace. - var deltaTime = new Date() - cvox.LiveRegions.pageLoadTime; - if (cvox.AriaUtil.getRoleAttribute(liveRoot) == 'alert' && - deltaTime < cvox.LiveRegions.INITIAL_SILENCE_MS) { - var regionText = ''; - for (var i = 0; i < navDescriptions.length; i++) { - regionText += navDescriptions[i].text; - regionText += navDescriptions[i].userValue; - } - if (cvox.DomUtil.collapseWhitespace(regionText) == '') { - return; - } - } - - // First, evict expired entries. - var now = new Date(); - for (var announced in cvox.LiveRegions.lastAnnouncedMap) { - if (now - cvox.LiveRegions.lastAnnouncedMap[announced] > - cvox.LiveRegions.MAX_DISCARD_DUPS_MS) { - delete cvox.LiveRegions.lastAnnouncedMap[announced]; - } - } - - // Then, skip announcement if it was already spoken in the past 2000 ms. - var key = navDescriptions.reduce(function(prev, navDescription) { - return prev + '|' + navDescription.text; - }, ''); - - if (cvox.LiveRegions.lastAnnouncedMap[key]) { - return; - } - cvox.LiveRegions.lastAnnouncedMap[key] = now; - - var assertive = cvox.AriaUtil.getAriaLive(liveRoot) == 'assertive'; - if (cvox.Interframe.isIframe() && !cvox.ChromeVox.documentHasFocus()) { - cvox.Interframe.sendMessageToParentWindow({ - 'command': 'speakLiveRegion', - 'content': JSON.stringify(navDescriptions), - 'queueMode': assertive ? 0 : 1, - 'src': window.location.href - }); - return; - } - - // Set a category on the NavDescriptions - that way live regions - // interrupt other live regions but not anything else. - navDescriptions.forEach(function(desc) { - if (!desc.category) { - desc.category = cvox.TtsCategory.LIVE; - } - }); - - // TODO(dmazzoni): http://crbug.com/415679 Temporary design decision; - // until we have a way to tell the speech queue to group the nav - // descriptions together, collapse them into one. - // Otherwise, one nav description could be spoken, then something unrelated, - // then the rest. - if (navDescriptions.length > 1) { - var allStrings = []; - navDescriptions.forEach(function(desc) { - if (desc.context) { - allStrings.push(desc.context); - } - if (desc.text) { - allStrings.push(desc.text); - } - if (desc.userValue) { - allStrings.push(desc.userValue); - } - }); - navDescriptions = [new cvox.NavDescription( - {text: allStrings.join(', '), category: cvox.TtsCategory.LIVE})]; - } - - handler(assertive, navDescriptions); -}; - -/** - * Recursively build up the value of a live region and return it as - * an array of NavDescriptions. Each atomic portion of the region gets a - * single string, otherwise each leaf node gets its own string. - * - * @param {Node} node A node in a live region. - * @return {Array<cvox.NavDescription>} An array of NavDescriptions - * describing atomic nodes or leaf nodes in the subtree rooted - * at this node. - */ -cvox.LiveRegions.getNavDescriptionsRecursive = function(node) { - if (cvox.AriaUtil.getAriaAtomic(node) || cvox.DomUtil.isLeafNode(node)) { - var description = cvox.DescriptionUtil.getDescriptionFromAncestors( - [node], true, cvox.ChromeVox.verbosity); - if (!description.isEmpty()) { - return [description]; - } else { - return []; - } - } - return cvox.DescriptionUtil.getFullDescriptionsFromChildren( - null, - /** @type {!Element} */ (node)); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/loader.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/loader.js deleted file mode 100644 index a8d9780..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/loader.js +++ /dev/null
@@ -1,24 +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. - - -/** - * @fileoverview Defines the ChromeVox app. - */ - -window.CLOSURE_USE_EXT_MESSAGES = true; - -goog.require('Msgs'); -goog.require('cvox.ChromeBraille'); -goog.require('cvox.ChromeEarcons'); -goog.require('cvox.ChromeHost'); -goog.require('cvox.ChromeTts'); -goog.require('cvox.ChromeVoxInit'); - -if (COMPILED) { - // NOTE(deboer): This is called when this script is loaded, automatically - // starting ChromeVox. If this isn't the compiled script, it will be - // called in init_document.js. - cvox.ChromeVox.initDocument(); -}
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_history.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_history.js deleted file mode 100644 index b092904..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_history.js +++ /dev/null
@@ -1,184 +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. - -/** - * @fileoverview Navigation history tracks recently visited nodes. The - * state of this class (the node history), is used to ensure the user is - * navigating to and from valid nodes. - * NOTE: The term "valid node" is simply a heuristic, defined in isValidNode_. - * - */ - - -goog.provide('cvox.NavigationHistory'); - -goog.require('cvox.DomUtil'); - - -/** - * @constructor - */ -cvox.NavigationHistory = function() { - this.reset_(); -}; - - -/** - * The maximum length of history tracked for recently visited nodes. - * @const - * @type {number} - * @private - */ -cvox.NavigationHistory.MAX_HISTORY_LEN_ = 30; - - -/** - * Resets the navigation history. - * @private - */ -cvox.NavigationHistory.prototype.reset_ = function() { - var startNode = document.body; - - /** - * An array of nodes ordered from newest to oldest in the history. - * The most recent nodes are at the start of the array. - * @type {Array<Node>} - * @private - */ - this.history_ = [startNode]; - - /** - * A flag to keep track of whether the last node added to the history was - * valid or not. If false, something strange might be going on, and we - * can react to this in the code. - * @type {boolean} - * @private - */ - this.arrivedValid_ = true; - -}; - - -/** - * Update the navigation history with the current element. - * The most recent elements are at the start of the array. - * @param {Node} newNode The new node to update the history with. - */ -cvox.NavigationHistory.prototype.update = function(newNode) { - var previousNode = this.history_[0]; - - // Avoid pushing consecutive duplicate elements. - if (newNode && newNode != previousNode) { - this.history_.unshift(newNode); - } - - // If list is too long, pop the last (oldest) item. - if (this.history_.length > cvox.NavigationHistory.MAX_HISTORY_LEN_) { - this.history_.pop(); - } - - // Check if the node is valid upon arrival. If not, set a flag because - // something fishy is probably going on. - this.arrivedValid_ = this.isValidNode_(newNode); -}; - - -/** - * Routinely clean out history and determine if the given node has become - * invalid since we arrived there (during the update call). If the node - * was already invalid, we will return false. - * @param {Node} node The node to check for validity change. - * @return {boolean} True if node changed state to invalid. - */ -cvox.NavigationHistory.prototype.becomeInvalid = function(node) { - // Remove any invalid nodes from history_. - this.clean_(); - - // If node was somehow already invalid on arrival, the page was probably - // changing very quickly. Be defensive here and allow the default - // navigation action by returning true. - if (!this.arrivedValid_) { - this.arrivedValid_ = true; // Reset flag. - return false; - } - - // Run the validation method on the given node. - return !this.isValidNode_(node); -}; - - -/** - * Determine a valid reversion for the current navigation track. A reversion - * provides both a current node to sync to and a previous node as context. - * @param {function(Node)=} opt_predicate A function that takes in a node and - * returns true if it is a valid recovery candidate. Nodes that do not - * match the predicate are removed as we search for a match. If no - * predicate is provided, return the two most recent nodes. - * @return {{current: ?Node, previous: ?Node}} - * The two nodes to override default navigation behavior with. Returning - * null or undefined means the history is empty. - */ -cvox.NavigationHistory.prototype.revert = function(opt_predicate) { - // If the currently active element is valid, it is probably the best - // recovery target. Add it to the history before computing the reversion. - var active = document.activeElement; - if (active != document.body && this.isValidNode_(active)) { - this.update(active); - } - - // Remove the most-recent-nodes that do not match the predicate. - if (opt_predicate) { - while (this.history_.length > 0) { - var node = this.history_[0]; - if (opt_predicate(node)) { - break; - } - this.history_.shift(); - } - } - - // The reversion is just the first two nodes in the history. - return {current: this.history_[0], previous: this.history_[1]}; -}; - - -/** - * Remove any and all nodes from history_ that are no longer valid. - * @return {boolean} True if any changes were made to the history. - * @private - */ -cvox.NavigationHistory.prototype.clean_ = function() { - var changed = false; - for (var i = this.history_.length - 1; i >= 0; i--) { - var valid = this.isValidNode_(this.history_[i]); - if (!valid) { - this.history_.splice(i, 1); - changed = true; - } - } - return changed; -}; - - -/** - * Determine if the given node is valid based on a heuristic. - * A valid node must be attached to the DOM and visible. - * @param {Node} node The node to validate. - * @return {boolean} True if node is valid. - * @private - */ -cvox.NavigationHistory.prototype.isValidNode_ = function(node) { - // Confirm that the element is in the DOM. - if (!cvox.DomUtil.isAttachedToDocument(node)) { - return false; - } - - // TODO (adu): In the future we may change this to just let users know the - // node is invisible instead of restoring focus. - if (!cvox.DomUtil.isVisible(node)) { - return false; - } - - return true; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_manager.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_manager.js deleted file mode 100644 index b3b1d220..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_manager.js +++ /dev/null
@@ -1,1278 +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. - -/** - * @fileoverview Manages navigation within a page. - * This unifies navigation by the DOM walker and by WebKit selection. - * NOTE: the purpose of this class is only to hold state - * and delegate all of its functionality to mostly stateless classes that - * are easy to test. - * - */ - - -goog.provide('cvox.NavigationManager'); - -goog.require('cvox.ActiveIndicator'); -goog.require('cvox.AriaUtil'); -goog.require('cvox.ChromeVox'); -goog.require('cvox.ChromeVoxEventSuspender'); -goog.require('cvox.CursorSelection'); -goog.require('cvox.DescriptionUtil'); -goog.require('cvox.DomUtil'); -goog.require('cvox.FindUtil'); -goog.require('cvox.Focuser'); -goog.require('cvox.Interframe'); -goog.require('cvox.NavBraille'); -goog.require('cvox.NavDescription'); -goog.require('cvox.NavigationHistory'); -goog.require('cvox.NavigationShifter'); -goog.require('cvox.NavigationSpeaker'); -goog.require('cvox.PageSelection'); -goog.require('cvox.SelectionUtil'); -goog.require('cvox.TableShifter'); -goog.require('cvox.Widget'); - - -/** - * @constructor - */ -cvox.NavigationManager = function() { - this.addInterframeListener_(); - - this.reset(); - - this.iframeRetries_ = 0; -}; - -/** - * Stores state variables in a provided object. - * - * @param {Object} store The object. - */ -cvox.NavigationManager.prototype.storeOn = function(store) { - store['reversed'] = this.isReversed(); - store['keepReading'] = this.keepReading_; - store['findNext'] = this.predicate_; - this.shifter_.storeOn(store); -}; - -/** - * Updates the object with state variables from an earlier storeOn call. - * - * @param {Object} store The object. - */ -cvox.NavigationManager.prototype.readFrom = function(store) { - this.curSel_.setReversed(store['reversed']); - this.shifter_.readFrom(store); - this.keepReading_ = store['keepReading']; -}; - -/** - * Resets the navigation manager to the top of the page. - */ -cvox.NavigationManager.prototype.reset = function() { - /** - * @type {!cvox.NavigationSpeaker} - * @private - */ - this.navSpeaker_ = new cvox.NavigationSpeaker(); - - /** - * @type {!Array<Object>} - * @private - */ - this.shifterTypes_ = [cvox.NavigationShifter, cvox.TableShifter]; - - /** - * @type {!Array<!cvox.AbstractShifter>} - */ - this.shifterStack_ = []; - - /** - * The active shifter. - * @type {!cvox.AbstractShifter} - * @private - */ - this.shifter_ = new cvox.NavigationShifter(); - - // NOTE(deboer): document.activeElement can not be null (c.f. - // https://developer.mozilla.org/en-US/docs/DOM/document.activeElement) - // Instead, if there is no active element, activeElement is set to - // document.body. - /** - * If there is an activeElement, use it. Otherwise, sync to the page - * beginning. - * @type {!cvox.CursorSelection} - * @private - */ - this.curSel_ = document.activeElement != document.body ? - /** @type {!cvox.CursorSelection} */ - (cvox.CursorSelection.fromNode(document.activeElement)) : - this.shifter_.begin(this.curSel_, {reversed: false}); - - /** - * @type {!cvox.CursorSelection} - * @private - */ - this.prevSel_ = this.curSel_.clone(); - - /** - * Keeps track of whether we have skipped while "reading from here" - * so that we can insert an earcon. - * @type {boolean} - * @private - */ - this.skipped_ = false; - - /** - * Keeps track of whether we have recovered from dropped focus - * so that we can insert an earcon. - * @type {boolean} - * @private - */ - this.recovered_ = false; - - /** - * True if in "reading from here" mode. - * @type {boolean} - * @private - */ - this.keepReading_ = false; - - /** - * True if we are at the end of the page and we wrap around. - * @type {boolean} - * @private - */ - this.pageEnd_ = false; - - /** - * True if we have already announced that we will wrap around. - * @type {boolean} - * @private - */ - this.pageEndAnnounced_ = false; - - /** - * True if we entered into a shifter. - * @type {boolean} - * @private - */ - this.enteredShifter_ = false; - - /** - * True if we exited a shifter. - * @type {boolean} - * @private - */ - this.exitedShifter_ = false; - - /** - * True if we want to ignore iframes no matter what. - * @type {boolean} - * @private - */ - this.ignoreIframesNoMatterWhat_ = false; - - /** - * @type {cvox.PageSelection} - * @private - */ - this.pageSel_ = null; - - /** @type {string} */ - this.predicate_ = ''; - - /** @type {cvox.CursorSelection} */ - this.saveSel_ = null; - - // TODO(stoarca): This seems goofy. Why are we doing this? - if (this.activeIndicator) { - this.activeIndicator.removeFromDom(); - } - this.activeIndicator = new cvox.ActiveIndicator(); - - /** - * Makes sure focus doesn't get lost. - * @type {!cvox.NavigationHistory} - * @private - */ - this.navigationHistory_ = new cvox.NavigationHistory(); - - /** @type {boolean} */ - this.focusRecovery_ = window.location.protocol != 'chrome:'; - - this.iframeIdMap = {}; - this.nextIframeId = 1; - - // Only sync if the activeElement is not document.body; which is shorthand for - // 'no selection'. Currently the walkers don't deal with the no selection - // case -- and it is not clear that they should. - if (document.activeElement != document.body) { - this.sync(); - } -}; - - -/** - * Determines if we are navigating from a valid node. If not, ask navigation - * history for an acceptable restart point and go there. - * @param {function(Node)=} opt_predicate A function that takes in a node and - * returns true if it is a valid recovery candidate. - * @return {boolean} True if we should continue navigation normally. - */ -cvox.NavigationManager.prototype.resolve = function(opt_predicate) { - if (!this.getFocusRecovery()) { - return true; - } - - var current = this.getCurrentNode(); - - if (!this.navigationHistory_.becomeInvalid(current)) { - return true; - } - - // Only attempt to revert if going next will cause us to restart at the top - // of the page. - if (this.hasNext_()) { - return true; - } - - // Our current node was invalid. Revert to history. - var revert = this.navigationHistory_.revert(opt_predicate); - - // If the history is empty, revert.current will be null. In that case, - // it is best to continue navigating normally. - if (!revert.current) { - return true; - } - - // Convert to selections. - var newSel = cvox.CursorSelection.fromNode(revert.current); - var context = cvox.CursorSelection.fromNode(revert.previous); - - // Default to document body if selections are null. - newSel = newSel || cvox.CursorSelection.fromBody(); - context = context || cvox.CursorSelection.fromBody(); - newSel.setReversed(this.isReversed()); - - this.updateSel(newSel, context); - this.recovered_ = true; - return false; -}; - - -/** - * Gets the state of focus recovery. - * @return {boolean} True if focus recovery is on; false otherwise. - */ -cvox.NavigationManager.prototype.getFocusRecovery = function() { - return this.focusRecovery_; -}; - - -/** - * Enables or disables focus recovery. - * @param {boolean} value True to enable, false to disable. - */ -cvox.NavigationManager.prototype.setFocusRecovery = function(value) { - this.focusRecovery_ = value; -}; - - -/** - * Delegates to NavigationShifter with current page state. - * @param {boolean=} iframes Jump in and out of iframes if true. Default false. - * @return {boolean} False if end of document has been reached. - * @private - */ -cvox.NavigationManager.prototype.next_ = function(iframes) { - if (this.tryBoundaries_(this.shifter_.next(this.curSel_), iframes)) { - // TODO(dtseng): An observer interface would help to keep logic like this - // to a minimum. - this.pageSel_ && this.pageSel_.extend(this.curSel_); - return true; - } - return false; -}; - -/** - * Looks ahead to see if it is possible to navigate forward from the current - * position. - * @return {boolean} True if it is possible to navigate forward. - * @private - */ -cvox.NavigationManager.prototype.hasNext_ = function() { - // Non-default shifters validly end before page end. - if (this.shifterStack_.length > 0) { - return true; - } - var dummySel = this.curSel_.clone(); - var result = false; - var dummyNavShifter = new cvox.NavigationShifter(); - dummyNavShifter.setGranularity(this.shifter_.getGranularity()); - dummyNavShifter.sync(dummySel); - if (dummyNavShifter.next(dummySel)) { - result = true; - } - return result; -}; - - -/** - * Delegates to NavigationShifter with current page state. - * @param {function(Array<Node>)} predicate A function taking an array - * of unique ancestor nodes as a parameter and returning a desired node. - * It returns null if that node can't be found. - * @param {string=} opt_predicateName The programmatic name that exists in - * cvox.DomPredicates. Used to dispatch calls across iframes since functions - * cannot be stringified. - * @param {boolean=} opt_initialNode Whether to start the search from node - * (true), or the next node (false); defaults to false. - * @return {cvox.CursorSelection} The newly found selection. - */ -cvox.NavigationManager.prototype.findNext = function( - predicate, opt_predicateName, opt_initialNode) { - this.predicate_ = opt_predicateName || ''; - this.resolve(); - this.shifter_ = this.shifterStack_[0] || this.shifter_; - this.shifterStack_ = []; - var ret = cvox.FindUtil.findNext(this.curSel_, predicate, opt_initialNode); - if (!this.ignoreIframesNoMatterWhat_) { - this.tryIframe_(ret && ret.start.node); - } - if (ret) { - this.updateSelToArbitraryNode(ret.start.node); - } - this.predicate_ = ''; - return ret; -}; - - -/** - * Delegates to NavigationShifter with current page state. - */ -cvox.NavigationManager.prototype.sync = function() { - this.resolve(); - var ret = this.shifter_.sync(this.curSel_); - if (ret) { - this.curSel_ = ret; - } -}; - -/** - * Sync's all possible cursors: - * - focus - * - ActiveIndicator - * - CursorSelection - * @param {boolean=} opt_skipText Skips focus on text nodes; defaults to false. - */ -cvox.NavigationManager.prototype.syncAll = function(opt_skipText) { - this.sync(); - this.setFocus(opt_skipText); - this.updateIndicator(); -}; - - -/** - * Synchronizes ChromeVox's internal cursor to the targetNode. - * Note that this will NOT trigger reading unless given the optional argument; - * it is for setting the internal ChromeVox cursor so that when the user resumes - * reading, they will be starting from a reasonable position. - * - * @param {Node} targetNode The node that ChromeVox should be synced to. - * @param {boolean=} opt_speakNode If true, speaks out the node. - * @param {number=} opt_queueMode The queue mode to use for speaking. - */ -cvox.NavigationManager.prototype.syncToNode = function( - targetNode, opt_speakNode, opt_queueMode) { - if (!cvox.ChromeVox.isActive) { - return; - } - - if (opt_queueMode == undefined) { - opt_queueMode = cvox.QueueMode.CATEGORY_FLUSH; - } - - this.updateSelToArbitraryNode(targetNode, true); - this.updateIndicator(); - - if (opt_speakNode == undefined) { - opt_speakNode = false; - } - - // Don't speak anything if the node is hidden or invisible. - if (cvox.AriaUtil.isHiddenRecursive(targetNode)) { - opt_speakNode = false; - } - - if (opt_speakNode) { - this.speakDescriptionArray( - this.getDescription(), - /** @type {cvox.QueueMode} */ (opt_queueMode), null, null, - cvox.TtsCategory.NAV); - } - - cvox.ChromeVox.braille.write(this.getBraille()); - - this.updatePosition(targetNode); -}; - - -/** - * Clears a DOM selection made via a CursorSelection. - * @param {boolean=} opt_announce True to announce the clearing. - * @return {boolean} If a selection was cleared. - */ -cvox.NavigationManager.prototype.clearPageSel = function(opt_announce) { - var hasSel = !!this.pageSel_; - if (hasSel && opt_announce) { - var announcement = Msgs.getMsg('clear_page_selection'); - cvox.ChromeVox.tts.speak( - announcement, cvox.QueueMode.FLUSH, - cvox.AbstractTts.PERSONALITY_ANNOTATION); - } - this.pageSel_ = null; - return hasSel; -}; - - -/** - * Begins or finishes a DOM selection at the current CursorSelection in the - * document. - * @return {boolean} Whether selection is on or off after this call. - */ -cvox.NavigationManager.prototype.togglePageSel = function() { - this.pageSel_ = this.pageSel_ ? - null : - new cvox.PageSelection(this.curSel_.setReversed(false)); - return !!this.pageSel_; -}; - - -// TODO(stoarca): getDiscription is split awkwardly between here and the -// walkers. The walkers should have getBaseDescription() which requires -// very little context, and then this method should tack on everything -// which requires any extensive knowledge. -/** - * Delegates to NavigationShifter with the current page state. - * @return {Array<cvox.NavDescription>} The summary of the current position. - */ -cvox.NavigationManager.prototype.getDescription = function() { - // Handle description of special content. Consider moving to DescriptionUtil. - // Specially annotated nodes. - if (this.getCurrentNode().hasAttribute && - this.getCurrentNode().hasAttribute('cvoxnodedesc')) { - var preDesc = cvox.ChromeVoxJSON.parse( - this.getCurrentNode().getAttribute('cvoxnodedesc')); - var currentDesc = new Array(); - for (var i = 0; i < preDesc.length; ++i) { - var inDesc = preDesc[i]; - // TODO: this can probably be replaced with just NavDescription(inDesc) - // need test case to ensure this change will work - currentDesc.push(new cvox.NavDescription({ - context: inDesc.context, - text: inDesc.text, - userValue: inDesc.userValue, - annotation: inDesc.annotation - })); - } - return currentDesc; - } - - // Selected content. - var desc = this.pageSel_ ? - this.pageSel_.getDescription(this.shifter_, this.prevSel_, this.curSel_) : - this.shifter_.getDescription(this.prevSel_, this.curSel_); - var earcons = []; - - // Earcons. - if (this.skipped_) { - earcons.push(cvox.Earcon.SKIP); - this.skipped_ = false; - } - if (this.recovered_) { - earcons.push(cvox.Earcon.RECOVER_FOCUS); - this.recovered_ = false; - } - if (this.pageEnd_) { - earcons.push(cvox.Earcon.WRAP); - this.pageEnd_ = false; - } - if (this.enteredShifter_) { - earcons.push(cvox.Earcon.OBJECT_ENTER); - this.enteredShifter_ = false; - } - if (this.exitedShifter_) { - earcons.push(cvox.Earcon.OBJECT_EXIT); - this.exitedShifter_ = false; - } - if (earcons.length > 0 && desc.length > 0) { - earcons.forEach(function(earcon) { - desc[0].pushEarcon(earcon); - }); - } - return desc; -}; - - -/** - * Delegates to NavigationShifter with the current page state. - * @return {!cvox.NavBraille} The braille description. - */ -cvox.NavigationManager.prototype.getBraille = function() { - return this.shifter_.getBraille(this.prevSel_, this.curSel_); -}; - -/** - * Delegates an action to the current walker. - * @param {string} name Action name. - * @return {boolean} True if action performed. - */ -cvox.NavigationManager.prototype.performAction = function(name) { - var newSel = null; - switch (name) { - case 'enterShifter': - case 'enterShifterSilently': - for (var i = this.shifterTypes_.length - 1, shifterType; - shifterType = this.shifterTypes_[i]; i--) { - var shifter = shifterType.create(this.curSel_); - if (shifter && shifter.getName() != this.shifter_.getName()) { - this.shifterStack_.push(this.shifter_); - this.shifter_ = shifter; - this.sync(); - this.enteredShifter_ = name != 'enterShifterSilently'; - break; - } else if (shifter && this.shifter_.getName() == shifter.getName()) { - break; - } - } - break; - case 'exitShifter': - if (this.shifterStack_.length == 0) { - return false; - } - this.shifter_ = this.shifterStack_.pop(); - this.sync(); - this.exitedShifter_ = true; - break; - case 'exitShifterContent': - if (this.shifterStack_.length == 0) { - return false; - } - this.updateSel(this.shifter_.performAction(name, this.curSel_)); - this.shifter_ = this.shifterStack_.pop() || this.shifter_; - this.sync(); - this.exitedShifter_ = true; - break; - default: - if (this.shifter_.hasAction(name)) { - return this.updateSel(this.shifter_.performAction(name, this.curSel_)); - } else { - return false; - } - } - return true; -}; - - -/** - * Returns the current navigation strategy. - * - * @return {string} The name of the strategy used. - */ -cvox.NavigationManager.prototype.getGranularityMsg = function() { - return this.shifter_.getGranularityMsg(); -}; - - -/** - * Delegates to NavigationShifter. - * @param {boolean=} opt_persist Persist the granularity to all running tabs; - * defaults to true. - */ -cvox.NavigationManager.prototype.makeMoreGranular = function(opt_persist) { - this.shifter_.makeMoreGranular(); - this.sync(); - this.persistGranularity_(opt_persist); -}; - - -/** - * Delegates to current shifter. - * @param {boolean=} opt_persist Persist the granularity to all running tabs; - * defaults to true. - */ -cvox.NavigationManager.prototype.makeLessGranular = function(opt_persist) { - this.shifter_.makeLessGranular(); - this.sync(); - this.persistGranularity_(opt_persist); -}; - - -/** - * Delegates to navigation shifter. Behavior is not defined if granularity - * was not previously gotten from a call to getGranularity(). This method is - * only supported by NavigationShifter which exposes a random access - * iterator-like interface. The caller has the option to force granularity - which results in exiting any entered shifters. If not forced, and there has - * been a shifter entered, setting granularity is a no-op. - * @param {number} granularity The desired granularity. - * @param {boolean=} opt_force Forces current shifter to NavigationShifter; - * false by default. - * @param {boolean=} opt_persist Persists setting to all running tabs; defaults - * to false. - */ -cvox.NavigationManager.prototype.setGranularity = function( - granularity, opt_force, opt_persist) { - if (!opt_force && this.shifterStack_.length > 0) { - return; - } - this.shifter_ = this.shifterStack_.shift() || this.shifter_; - this.shifters_ = []; - this.shifter_.setGranularity(granularity); - this.persistGranularity_(opt_persist); -}; - - -/** - * Delegates to NavigationShifter. - * @return {number} The current granularity. - */ -cvox.NavigationManager.prototype.getGranularity = function() { - var shifter = this.shifterStack_[0] || this.shifter_; - return shifter.getGranularity(); -}; - - -/** - * Delegates to NavigationShifter. - */ -cvox.NavigationManager.prototype.ensureSubnavigating = function() { - if (!this.shifter_.isSubnavigating()) { - this.shifter_.ensureSubnavigating(); - this.sync(); - } -}; - - -/** - * Stops subnavigating, specifying that we should navigate at a less granular - * level than the current navigation strategy. - */ -cvox.NavigationManager.prototype.ensureNotSubnavigating = function() { - if (this.shifter_.isSubnavigating()) { - this.shifter_.ensureNotSubnavigating(); - this.sync(); - } -}; - - -/** - * Delegates to NavigationSpeaker. - * @param {Array<cvox.NavDescription>} descriptionArray The array of - * NavDescriptions to speak. - * @param {cvox.QueueMode} initialQueueMode The initial queue mode. - * @param {Function} completionFunction Function to call when finished speaking. - * @param {Object=} opt_personality Optional personality for all descriptions. - * @param {string=} opt_category Optional category for all descriptions. - */ -cvox.NavigationManager.prototype.speakDescriptionArray = function( - descriptionArray, initialQueueMode, completionFunction, opt_personality, - opt_category) { - if (opt_personality) { - descriptionArray.forEach(function(desc) { - if (!desc.personality) { - desc.personality = opt_personality; - } - }); - } - if (opt_category) { - descriptionArray.forEach(function(desc) { - if (!desc.category) { - desc.category = opt_category; - } - }); - } - - this.navSpeaker_.speakDescriptionArray( - descriptionArray, initialQueueMode, completionFunction); -}; - -/** - * Add the position of the node on the page. - * @param {Node} node The node that ChromeVox should update the position. - */ -cvox.NavigationManager.prototype.updatePosition = function(node) { - var msg = cvox.ChromeVox.position; - msg[document.location.href] = cvox.DomUtil.elementToPoint(node); - - cvox.ChromeVox.host.sendToBackgroundPage({ - 'target': 'Prefs', - 'action': 'setPref', - 'pref': 'position', - 'value': JSON.stringify(msg) - }); -}; - - -// TODO(stoarca): The stuff below belongs in its own layer. -/** - * Perform all of the actions that should happen at the end of any - * navigation operation: update the lens, play earcons, and speak the - * description of the object that was navigated to. - * - * @param {string=} opt_prefix The string to be prepended to what - * is spoken to the user. - * @param {boolean=} opt_setFocus Whether or not to focus the current node. - * Defaults to true. - * @param {cvox.QueueMode=} opt_queueMode Initial queue mode to use. - * @param {function(): ?=} opt_callback Function to call after speaking. - */ -cvox.NavigationManager.prototype.finishNavCommand = function( - opt_prefix, opt_setFocus, opt_queueMode, opt_callback) { - if (this.pageEnd_ && !this.pageEndAnnounced_) { - this.pageEndAnnounced_ = true; - cvox.ChromeVox.tts.stop(); - cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.WRAP); - if (cvox.ChromeVox.verbosity === cvox.VERBOSITY_VERBOSE) { - var msg = Msgs.getMsg('wrapped_to_top'); - if (this.isReversed()) { - msg = Msgs.getMsg('wrapped_to_bottom'); - } - cvox.ChromeVox.tts.speak( - msg, cvox.QueueMode.QUEUE, cvox.AbstractTts.PERSONALITY_ANNOTATION); - } - return; - } - - if (this.enteredShifter_ || this.exitedShifter_) { - opt_prefix = Msgs.getMsg('enter_content_say', [this.shifter_.getName()]); - } - - var descriptionArray = cvox.ChromeVox.navigationManager.getDescription(); - - opt_setFocus = opt_setFocus === undefined ? true : opt_setFocus; - - if (opt_setFocus) { - this.setFocus(); - } - this.updateIndicator(); - - var queueMode = opt_queueMode || cvox.QueueMode.FLUSH; - - if (opt_prefix) { - cvox.ChromeVox.tts.speak( - opt_prefix, queueMode, cvox.AbstractTts.PERSONALITY_ANNOTATION); - queueMode = cvox.QueueMode.QUEUE; - } - this.speakDescriptionArray( - descriptionArray, queueMode, opt_callback || null, null, - cvox.TtsCategory.NAV); - - cvox.ChromeVox.braille.write(this.getBraille()); - - this.updatePosition(this.getCurrentNode()); -}; - - -/** - * Moves forward. Stops any subnavigation. - * @param {boolean=} opt_ignoreIframes Ignore iframes when navigating. Defaults - * to not ignore iframes. - * @param {number=} opt_granularity Optionally, switches to granularity before - * navigation. - * @return {boolean} False if end of document reached. - */ -cvox.NavigationManager.prototype.navigate = function( - opt_ignoreIframes, opt_granularity) { - this.pageEndAnnounced_ = false; - if (this.pageEnd_) { - this.pageEnd_ = false; - this.syncToBeginning(opt_ignoreIframes); - return true; - } - if (!this.resolve()) { - return false; - } - this.ensureNotSubnavigating(); - if (opt_granularity !== undefined && - (opt_granularity !== this.getGranularity() || - this.shifterStack_.length > 0)) { - this.setGranularity(opt_granularity, true); - this.sync(); - } - return this.next_(!opt_ignoreIframes); -}; - - -/** - * Moves forward after switching to a lower granularity until the next - * call to navigate(). - */ -cvox.NavigationManager.prototype.subnavigate = function() { - this.pageEndAnnounced_ = false; - if (!this.resolve()) { - return; - } - this.ensureSubnavigating(); - this.next_(true); -}; - - -/** - * Moves forward. Starts reading the page from that node. - * Uses QUEUE_MODE_FLUSH to flush any previous speech. - * @return {boolean} False if not "reading from here". True otherwise. - */ -cvox.NavigationManager.prototype.skip = function() { - if (!this.keepReading_) { - return false; - } - if (cvox.ChromeVox.host.hasTtsCallback()) { - this.skipped_ = true; - this.setReversed(false); - this.startCallbackReading_(cvox.QueueMode.FLUSH); - } - return true; -}; - - -/** - * Starts reading the page from the current selection. - * @param {cvox.QueueMode} queueMode Either flush or queue. - */ -cvox.NavigationManager.prototype.startReading = function(queueMode) { - this.keepReading_ = true; - if (cvox.ChromeVox.host.hasTtsCallback()) { - this.startCallbackReading_(queueMode); - } else { - this.startNonCallbackReading_(queueMode); - } - cvox.ChromeVox.stickyOverride = true; -}; - -/** - * Stops continuous read. - * @param {boolean} stopTtsImmediately True if the TTS should immediately stop - * speaking. - */ -cvox.NavigationManager.prototype.stopReading = function(stopTtsImmediately) { - this.keepReading_ = false; - this.navSpeaker_.stopReading = true; - if (stopTtsImmediately) { - cvox.ChromeVox.tts.stop(); - } - cvox.ChromeVox.stickyOverride = null; -}; - - -/** - * The current current state of continuous read. - * @return {boolean} The state. - */ -cvox.NavigationManager.prototype.isReading = function() { - return this.keepReading_; -}; - - -/** - * Starts reading the page from the current selection if there are callbacks. - * @param {cvox.QueueMode} queueMode Either flush or queue. - * @private - */ -cvox.NavigationManager.prototype.startCallbackReading_ = - cvox.ChromeVoxEventSuspender.withSuspendedEvents(function(queueMode) { - this.finishNavCommand('', true, queueMode, goog.bind(function() { - if (this.prevReadingSel_ == this.curSel_) { - this.stopReading(); - return; - } - this.prevReadingSel_ = this.curSel_; - if (this.next_(true) && this.keepReading_) { - this.startCallbackReading_(cvox.QueueMode.QUEUE); - } - }, this)); - }); - - -/** - * Starts reading the page from the current selection if there are no callbacks. - * With this method, we poll the keepReading_ var and stop when it is false. - * @param {cvox.QueueMode} queueMode Either flush or queue. - * @private - */ -cvox.NavigationManager.prototype.startNonCallbackReading_ = - cvox.ChromeVoxEventSuspender.withSuspendedEvents(function(queueMode) { - if (!this.keepReading_) { - return; - } - - if (!cvox.ChromeVox.tts.isSpeaking()) { - this.finishNavCommand('', true, queueMode, null); - if (!this.next_(true)) { - this.keepReading_ = false; - } - } - window.setTimeout(goog.bind(this.startNonCallbackReading_, this), 1000); - }); - - -/** - * Returns a complete description of the current position, including - * the text content and annotations such as "link", "button", etc. - * Unlike getDescription, this does not shorten the position based on the - * previous position. - * - * @return {Array<cvox.NavDescription>} The summary of the current position. - */ -cvox.NavigationManager.prototype.getFullDescription = function() { - if (this.pageSel_) { - return this.pageSel_.getFullDescription(); - } - return [cvox.DescriptionUtil.getDescriptionFromAncestors( - cvox.DomUtil.getAncestors(this.curSel_.start.node), true, - cvox.ChromeVox.verbosity)]; -}; - - -/** - * Sets the browser's focus to the current node. - * @param {boolean=} opt_skipText Skips focusing text nodes or any of their - * ancestors; defaults to false. - */ -cvox.NavigationManager.prototype.setFocus = function(opt_skipText) { - // TODO(dtseng): cvox.DomUtil.setFocus() totally destroys DOM ranges that have - // been set on the page; this requires further investigation, but - // PageSelection won't work without this. - if (this.pageSel_ || - (opt_skipText && this.curSel_.start.node.constructor == Text)) { - return; - } - cvox.Focuser.setFocus(this.curSel_.start.node); -}; - - -/** - * Returns the node of the directed start of the selection. - * @return {Node} The current node. - */ -cvox.NavigationManager.prototype.getCurrentNode = function() { - return this.curSel_.absStart().node; -}; - - -/** - * Listen to messages from other frames and respond to messages that - * tell our frame to take focus and preseve the navigation granularity - * from the other frame. - * @private - */ -cvox.NavigationManager.prototype.addInterframeListener_ = function() { - /** - * @type {!cvox.NavigationManager} - */ - var self = this; - - cvox.Interframe.addListener(function(message) { - if (message['command'] != 'enterIframe' && - message['command'] != 'exitIframe') { - return; - } - cvox.ChromeVox.serializer.readFrom(message); - - cvox.ChromeVoxEventSuspender.withSuspendedEvents(function() { - window.focus(); - if (message['findNext']) { - var predicateName = message['findNext']; - var predicate = cvox.DomPredicates[predicateName]; - var found = self.findNext(predicate, predicateName, true); - if (predicate && (!found || found.start.node.tagName == 'IFRAME')) { - return; - } - } else if (message['command'] == 'exitIframe') { - var id = message['sourceId']; - var iframeElement = self.iframeIdMap[id]; - var reversed = message['reversed']; - var granularity = message['granularity']; - if (iframeElement) { - self.updateSel(cvox.CursorSelection.fromNode(iframeElement)); - } - self.setReversed(reversed); - self.sync(); - self.navigate(); - } else { - self.syncToBeginning(); - - // if we have an empty body, then immediately exit the iframe - if (!cvox.DomUtil.hasContent(document.body)) { - self.tryIframe_(null); - return; - } - } - - // Now speak what ended up being selected. - // TODO(deboer): Some of this could be moved to readFrom - self.finishNavCommand('', true); - if (self.keepReading_) { - self.startReading(cvox.QueueMode.FLUSH); - } - })(); - }); -}; - - -/** - * Update the active indicator to reflect the current node or selection. - */ -cvox.NavigationManager.prototype.updateIndicator = function() { - this.activeIndicator.syncToCursorSelection(this.curSel_); -}; - - -/** - * Update the active indicator in case the active object moved or was - * removed from the document. - */ -cvox.NavigationManager.prototype.updateIndicatorIfChanged = function() { - this.activeIndicator.updateIndicatorIfChanged(); -}; - - -/** - * Show or hide the active indicator based on whether ChromeVox is - * active or not. - * - * If 'active' is true, cvox.NavigationManager does not do anything. - * However, callers to showOrHideIndicator also need to call updateIndicator - * to update the indicator -- which also does the work to show the - * indicator. - * - * @param {boolean} active True if we should show the indicator, false - * if we should hide the indicator. - */ -cvox.NavigationManager.prototype.showOrHideIndicator = function(active) { - if (!active) { - this.activeIndicator.removeFromDom(); - } -}; - - -/** - * Collapses the selection to directed cursor start. - */ -cvox.NavigationManager.prototype.collapseSelection = function() { - this.curSel_.collapse(); -}; - - -/** - * This is used to update the selection to arbitrary nodes because there are - * browser events, cvox API's, and user commands that require selection around a - * precise node. As a consequence, calling this method will result in a shift to - * object granularity without explicit user action or feedback. Also, note that - * this selection will be sync'ed to ObjectWalker by default unless explicitly - * ttold not to. We assume object walker can describe the node in the latter - * case. - * @param {Node} node The node to update to. - * @param {boolean=} opt_precise Whether selection will sync exactly to the - * given node. Defaults to false (and selection will sync according to object - * walker). - */ -cvox.NavigationManager.prototype.updateSelToArbitraryNode = function( - node, opt_precise) { - if (node) { - this.setGranularity(cvox.NavigationShifter.GRANULARITIES.OBJECT, true); - this.updateSel(cvox.CursorSelection.fromNode(node)); - if (!opt_precise) { - this.sync(); - } - } else { - this.syncToBeginning(); - } -}; - - -/** - * Updates curSel_ to the new selection and sets prevSel_ to the old curSel_. - * This should be called exactly when something user-perceivable happens. - * @param {cvox.CursorSelection} sel The selection to update to. - * @param {cvox.CursorSelection=} opt_context An optional override for prevSel_. - * Used to override both curSel_ and prevSel_ when jumping back in nav history. - * @return {boolean} False if sel is null. True otherwise. - */ -cvox.NavigationManager.prototype.updateSel = function(sel, opt_context) { - if (sel) { - this.prevSel_ = opt_context || this.curSel_; - this.curSel_ = sel; - } - // Only update the history if we aren't just trying to peek ahead. - var currentNode = this.getCurrentNode(); - this.navigationHistory_.update(currentNode); - return !!sel; -}; - - -/** - * Sets the direction. - * @param {!boolean} r True to reverse. - */ -cvox.NavigationManager.prototype.setReversed = function(r) { - this.curSel_.setReversed(r); -}; - - -/** - * Returns true if currently reversed. - * @return {boolean} True if reversed. - */ -cvox.NavigationManager.prototype.isReversed = function() { - return this.curSel_.isReversed(); -}; - - -/** - * Checks if boundary conditions are met and updates the selection. - * @param {cvox.CursorSelection} sel The selection. - * @param {boolean=} iframes If true, tries to enter iframes. Default false. - * @return {boolean} False if end of page is reached. - * @private - */ -cvox.NavigationManager.prototype.tryBoundaries_ = function(sel, iframes) { - iframes = (!!iframes && !this.ignoreIframesNoMatterWhat_) || false; - this.pageEnd_ = false; - if (iframes && this.tryIframe_(sel && sel.start.node)) { - return true; - } - if (sel) { - this.updateSel(sel); - return true; - } - if (this.shifterStack_.length > 0) { - return true; - } - this.syncToBeginning(!iframes); - this.clearPageSel(true); - this.stopReading(true); - this.pageEnd_ = true; - return false; -}; - - -/** - * Given a node that we just navigated to, try to jump in and out of iframes - * as needed. If the node is an iframe, jump into it. If the node is null, - * assume we reached the end of an iframe and try to jump out of it. - * @param {Node} node The node to try to jump into. - * @return {boolean} True if we jumped into an iframe. - * @private - */ -cvox.NavigationManager.prototype.tryIframe_ = function(node) { - if (node == null && cvox.Interframe.isIframe()) { - var message = { - 'command': 'exitIframe', - 'reversed': this.isReversed(), - 'granularity': this.getGranularity() - }; - cvox.ChromeVox.serializer.storeOn(message); - cvox.Interframe.sendMessageToParentWindow(message); - this.keepReading_ = false; - return true; - } - - if (node == null || node.tagName != 'IFRAME' || !node.src) { - return false; - } - var iframeElement = /** @type {HTMLIFrameElement} */ (node); - - var iframeId = undefined; - for (var id in this.iframeIdMap) { - if (this.iframeIdMap[id] == iframeElement) { - iframeId = id; - break; - } - } - if (iframeId == undefined) { - iframeId = this.nextIframeId; - this.nextIframeId++; - cvox.Interframe.sendIdToIFrame(iframeId, iframeElement, function() { - this.iframeIdMap[iframeId] = iframeElement; - this.iframeRetries_ = 0; - }.bind(this)); - } - - // We never received an ack from the iframe. - if (!this.iframeIdMap[iframeId]) { - this.iframeRetries_++; - if (this.iframeRetries_ > 5) { - // Give up. - this.iframeRetries_ = 0; - return false; - } - } - - var message = {'command': 'enterIframe', 'id': iframeId}; - cvox.ChromeVox.serializer.storeOn(message); - cvox.Interframe.sendMessageToIFrame(message, iframeElement); - return true; -}; - - -/** - * Delegates to NavigationShifter. Tries to enter any iframes or tables if - * requested. - * @param {boolean=} opt_skipIframe True to skip iframes. - */ -cvox.NavigationManager.prototype.syncToBeginning = function(opt_skipIframe) { - var ret = - this.shifter_.begin(this.curSel_, {reversed: this.curSel_.isReversed()}); - if (!opt_skipIframe && this.tryIframe_(ret && ret.start.node)) { - return; - } - this.updateSel(ret); -}; - - -/** - * Used during testing since there are iframes and we don't always want to - * interact with them so that we can test certain features. - */ -cvox.NavigationManager.prototype.ignoreIframesNoMatterWhat = function() { - this.ignoreIframesNoMatterWhat_ = true; -}; - - -/** - * Save a cursor selection during an excursion. - */ -cvox.NavigationManager.prototype.saveSel = function() { - this.saveSel_ = this.curSel_; -}; - - -/** - * Save a cursor selection after an excursion. - */ -cvox.NavigationManager.prototype.restoreSel = function() { - this.curSel_ = this.saveSel_ || this.curSel_; -}; - - -/** - * @param {boolean=} opt_persist Persist the granularity to all running tabs; - * defaults to false. - * @private - */ -cvox.NavigationManager.prototype.persistGranularity_ = function(opt_persist) { - opt_persist = opt_persist === undefined ? false : opt_persist; - if (opt_persist) { - cvox.ChromeVox.host.sendToBackgroundPage({ - 'target': 'Prefs', - 'action': 'setPref', - 'pref': 'granularity', - 'value': this.getGranularity() - }); - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_shifter.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_shifter.js deleted file mode 100644 index b3a1f8c..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_shifter.js +++ /dev/null
@@ -1,263 +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. - -/** - * @fileoverview The purpose of this class is to delegate to the correct walker - * based on the navigation state that it is in. The navigation state is a - * simplified view of the external environment; the smallest amount of knowledge - * needed to correctly delegate. One example is whether the user - * is subnavigating. Note that while this class does - * decide which walker to delegate to, it does NOT decide when its state - * should be changed. This is done by the layer above. The reason for this - * separation is that trying to make the decision here would require a lot - * of knowledge about the environment, making this class harder to - * test and maintain. - * - * This class knows about the public interfaces of all the walkers (rather - * than just of the abstract class) since there are currently walker operations - * which apply only to specific walkers. - * - * The navigation model is organized around having a chain of walkers with - * increasing "granularity". This means (with a few exceptions), that if - * walker A is more granular than walker B, then every valid selection in A - * is a subset of a valid selection in B. For example, characters are - * more granular than words, because every character is either a word or - * inside a word. - * - * Note that while any callers may assume the granularity chain exists (after - * all, there is a method makeMoreGranular()), they may not assume anything - * about the order in which the walkers occur in this chain. This is because - * the order may depend on the navigation state, and having external interaction - * would slow down the changes we could make to this class (which is a problem, - * since this is one of the core classes that impacts user-perceptible - * navigation). - * - * Thinking of adding something here? Ask these questions: - * Is it exposing functionality in some walker, the execution of which depends - * on navigation state? - * Then it is a good candidate. - * Does it require knowing more about the environment? - * If you are sure that it belongs here, then the minimum amount of knowledge - * to make the delegation decision should be added as state to this class. - * The decision for when this state changes should not be made in this class. - * - */ - - -goog.provide('cvox.NavigationShifter'); - -goog.require('cvox.AbstractShifter'); -goog.require('cvox.CharacterWalker'); -goog.require('cvox.GroupWalker'); -goog.require('cvox.LayoutLineWalker'); -goog.require('cvox.ObjectWalker'); -goog.require('cvox.SentenceWalker'); -goog.require('cvox.TraverseContent'); -goog.require('cvox.WordWalker'); - - -/** - * @constructor - * @extends {cvox.AbstractShifter} - */ -cvox.NavigationShifter = function() { - this.reset_(); - goog.base(this); -}; -goog.inherits(cvox.NavigationShifter, cvox.AbstractShifter); - -// These "const" literals may be used, but no order may be assumed -// between them by any outside callers. -/** - * @type {Object<number>} - */ -cvox.NavigationShifter.GRANULARITIES = { - 'CHARACTER': 0, - 'WORD': 1, - 'LINE': 2, - 'SENTENCE': 3, - 'OBJECT': 4, - 'GROUP': 5 -}; - - -/** - * Stores state variables in a provided object. - * - * @param {Object} store The object. - */ -cvox.NavigationShifter.prototype.storeOn = function(store) { - store['granularity'] = this.getGranularity(); -}; - - -/** - * Updates the object with state variables from an earlier storeOn call. - * - * @param {Object} store The object. - */ -cvox.NavigationShifter.prototype.readFrom = function(store) { - this.setGranularity(store['granularity']); -}; - - -/** - * @override - */ -cvox.NavigationShifter.prototype.next = function(sel) { - var ret = this.currentWalker_.next(sel); - if (this.currentWalkerIndex_ <= cvox.NavigationShifter.GRANULARITIES.LINE && - ret) { - cvox.TraverseContent.getInstance().syncToCursorSelection( - ret.clone().setReversed(false)); - cvox.TraverseContent.getInstance().updateSelection(); - } - return ret; -}; - - -/** - * @override - */ -cvox.NavigationShifter.prototype.sync = function(sel) { - return this.currentWalker_.sync(sel); -}; - - -/** - * @override - */ -cvox.NavigationShifter.prototype.getName = function() { - return Msgs.getMsg('navigation_shifter'); -}; - - -/** - * @override - */ -cvox.NavigationShifter.prototype.getDescription = function(prevSel, sel) { - return this.currentWalker_.getDescription(prevSel, sel); -}; - - -/** - * Gets the braille representation of a node-based selection. - * @override - */ -cvox.NavigationShifter.prototype.getBraille = function(prevSel, sel) { - return this.lineWalker_.getBraille(prevSel, sel); -}; - - -/** - * Delegates to currentWalker_. - * @return {string} The message string. - */ -cvox.NavigationShifter.prototype.getGranularityMsg = function() { - return this.currentWalker_.getGranularityMsg(); -}; - - -/** - * @override - */ -cvox.NavigationShifter.prototype.makeMoreGranular = function() { - goog.base(this, 'makeMoreGranular'); - this.currentWalkerIndex_ = Math.max(this.currentWalkerIndex_ - 1, 0); - if (!cvox.NavigationShifter.allowSentence && - this.currentWalkerIndex_ == - cvox.NavigationShifter.GRANULARITIES.SENTENCE) { - this.currentWalkerIndex_--; - } - this.currentWalker_ = this.walkers_[this.currentWalkerIndex_]; -}; - -/** - * @override - */ -cvox.NavigationShifter.prototype.makeLessGranular = function() { - goog.base(this, 'makeLessGranular'); - this.currentWalkerIndex_ = - Math.min(this.currentWalkerIndex_ + 1, this.walkers_.length - 1); - if (!cvox.NavigationShifter.allowSentence && - this.currentWalkerIndex_ == - cvox.NavigationShifter.GRANULARITIES.SENTENCE) { - this.currentWalkerIndex_++; - } - this.currentWalker_ = this.walkers_[this.currentWalkerIndex_]; -}; - -/** - * Shift to a specified granularity. - * NOTE: after a shift, we are no longer subnavigating, if we were. - * @param {number} granularity The granularity to shift to. - */ -cvox.NavigationShifter.prototype.setGranularity = function(granularity) { - this.ensureNotSubnavigating(); - this.currentWalkerIndex_ = granularity; - this.currentWalker_ = this.walkers_[this.currentWalkerIndex_]; -}; - -/** - * Gets the granularity. - * @return {number} The current granularity. - * - */ -cvox.NavigationShifter.prototype.getGranularity = function() { - var wasSubnavigating = this.isSubnavigating(); - this.ensureNotSubnavigating(); - var ret = this.currentWalkerIndex_; - if (wasSubnavigating) { - this.ensureSubnavigating(); - } - return ret; -}; - - -/** Actions. */ -/** - * @override - */ -cvox.NavigationShifter.prototype.hasAction = function(name) { - if (name == 'toggleLineType') { - return true; - } - return goog.base(this, 'hasAction', name); -}; - -cvox.NavigationShifter.create = function(sel) { - return new cvox.NavigationShifter(); -}; - - -/** - * Resets navigation shifter to a "new" state. Makes testing easier. - * @private - */ -cvox.NavigationShifter.prototype.reset_ = function() { - this.groupWalker_ = new cvox.GroupWalker(); - this.objectWalker_ = new cvox.ObjectWalker(); - this.sentenceWalker_ = new cvox.SentenceWalker(); - this.lineWalker_ = new cvox.LayoutLineWalker(); - this.wordWalker_ = new cvox.WordWalker(); - this.characterWalker_ = new cvox.CharacterWalker(); - - this.walkers_ = [ - this.characterWalker_, this.wordWalker_, this.lineWalker_, - this.sentenceWalker_, this.objectWalker_, this.groupWalker_ - ]; - this.currentWalkerIndex_ = this.walkers_.indexOf(this.groupWalker_); - - /** - * @type {cvox.AbstractWalker} - * @private - */ - this.currentWalker_ = this.walkers_[this.currentWalkerIndex_]; -}; - - -/** - * @type {boolean} - */ -cvox.NavigationShifter.allowSentence = false;
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_speaker.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_speaker.js deleted file mode 100644 index 89d1f97..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_speaker.js +++ /dev/null
@@ -1,138 +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. - -/** - * @fileoverview A class for speaking navigation information. - */ - - -goog.provide('cvox.NavigationSpeaker'); - -goog.require('cvox.NavDescription'); - -/** - * @constructor - */ -cvox.NavigationSpeaker = function() { - /** - * This member indicates to this speaker to cancel any pending callbacks. - * This is needed primarily to support cancelling a chain of callbacks by an - * outside caller. There's currently no way to cancel a chain of callbacks in - * any other way. Consider removing this if we ever get silence at the tts - * layer. - * @type {boolean} - */ - this.stopReading = false; - - /** - * An identifier that tracks the calls to speakDescriptionArray. Used to - * cancel a chain of callbacks that is stale. - * @type {number} - * @private - */ - this.id_ = 1; -}; - -/** - * Speak all of the NavDescriptions in the given array (as returned by - * getDescription), including playing earcons. - * - * @param {Array<cvox.NavDescription>} descriptionArray The array of - * NavDescriptions to speak. - * @param {number} initialQueueMode The initial queue mode. - * @param {Function} completionFunction Function to call when finished speaking. - */ -cvox.NavigationSpeaker.prototype.speakDescriptionArray = function( - descriptionArray, initialQueueMode, completionFunction) { - descriptionArray = this.reorderAnnotations(descriptionArray); - - this.stopReading = false; - this.id_ = (this.id_ + 1) % 10000; - - // Using self rather than goog.bind in order to get debug symbols. - var self = this; - var speakDescriptionChain = function(i, queueMode, id) { - var description = descriptionArray[i]; - if (!description || self.stopReading || self.id_ != id) { - return; - } - var startCallback = function() { - for (var j = 0; j < description.earcons.length; j++) { - cvox.ChromeVox.earcons.playEarcon(description.earcons[j]); - } - }; - var endCallbackHelper = function() { - speakDescriptionChain(i + 1, cvox.QueueMode.QUEUE, id); - }; - var endCallback = function() { - // We process content-script specific properties here for now. - if (description.personality && - description.personality[cvox.AbstractTts.PAUSE] && - typeof(description.personality[cvox.AbstractTts.PAUSE]) == 'number') { - setTimeout( - endCallbackHelper, description.personality[cvox.AbstractTts.PAUSE]); - } else { - endCallbackHelper(); - } - if ((i == descriptionArray.length - 1) && completionFunction) { - completionFunction(); - } - }; - if (!description.isEmpty()) { - description.speak(queueMode, startCallback, endCallback); - } else { - startCallback(); - endCallback(); - return; - } - if (!cvox.ChromeVox.host.hasTtsCallback()) { - startCallback(); - endCallback(); - } - }; - - speakDescriptionChain(0, initialQueueMode, this.id_); - - if ((descriptionArray.length == 0) && completionFunction) { - completionFunction(); - } -}; - - -/** - * Checks for an annotation of a structured elements. - * @param {string} annon The annotation. - * @return {boolean} True if annotating a structured element. - */ -cvox.NavigationSpeaker.structuredElement = function(annon) { - // TODO(dtseng, sorge): This doesn't work for languages other than English. - switch (annon) { - case 'table': - case 'Math': - return true; - } - return false; -}; - - -/** - * Reorder special annotations for structured elements to be spoken first. - * @param {Array<cvox.NavDescription>} descriptionArray The array of - * NavDescriptions to speak. - * @return {Array<cvox.NavDescription>} The reordered array. - */ -cvox.NavigationSpeaker.prototype.reorderAnnotations = function( - descriptionArray) { - var descs = new Array; - for (var i = 0; i < descriptionArray.length; i++) { - var descr = descriptionArray[i]; - if (cvox.NavigationSpeaker.structuredElement(descr.annotation)) { - descs.push( - new cvox.NavDescription({text: '', annotation: descr.annotation})); - descr.annotation = ''; - } - descs.push(descr); - } - return descs; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/node_breadcrumb.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/node_breadcrumb.js deleted file mode 100644 index 4b79660..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/node_breadcrumb.js +++ /dev/null
@@ -1,168 +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. - -/** - * @fileoverview Responsible for tagging nodes used by ChromeVox. - */ - -goog.provide('cvox.NodeBreadcrumb'); - -goog.require('cvox.ChromeVox'); - - - -/** - * Responsible for tagging nodes and tracking those nodes. - * @constructor - */ -cvox.NodeBreadcrumb = function() { - /** - * Counter to be incremented each time HistoryEvent tries to tag a previously - * untagged node. - * @type {number} - */ - this.cvTagCounter_ = 0; -}; -goog.addSingletonGetter(cvox.NodeBreadcrumb); - -/** - * The attribute to mark nodes that have been touched, and in what order. - * @type {string} - * @const - * NOTE: not private because tester is using this - */ -cvox.NodeBreadcrumb.TOUCHED_TAG = 'chromevoxtag'; - -/** - * The attribute to mark nodes needed to replicate results with. - * @type {string} - * @const - * @private - */ -cvox.NodeBreadcrumb.NEEDED_TAG_ = 'chromevoxneeded'; - - -/** - * Tags the current node. - * @return {number} The tag number. - */ -cvox.NodeBreadcrumb.prototype.tagCurrentNode = function() { - var cvTag; - var currentNode = cvox.ChromeVox.navigationManager.getCurrentNode(); - while (currentNode && !currentNode.hasAttribute) { - currentNode = currentNode.parentNode; - } - if (!currentNode) { - cvTag = -1; - } else if (currentNode.hasAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG)) { - cvTag = currentNode.getAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG); - } else { - cvTag = this.cvTagCounter_; - currentNode.setAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG, cvTag); - this.cvTagCounter_++; - } - return cvTag; -}; - - -/** - * Marks all elements that need to be in the test case, starting at the - * elements that have been tagged. - * @param {Node} node Root of the subtree which to mark. - * @private - */ -cvox.NodeBreadcrumb.prototype.smartStart_ = function(node) { - for (var i = 0; i < node.children.length; ++i) { - var child = node.children[i]; - this.smartStart_(child); - if (child.getAttribute && - !goog.isNull(child.getAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG))) { - this.setNeeded_(child); - } - } -}; - - -/** - * Recursively marks all elements that need to be in the test case. - * Note: modifies the node passed in. - * @param {Node} node The node to mark. - * @private - */ -cvox.NodeBreadcrumb.prototype.setNeeded_ = function(node) { - if (!node) { - return; - } - - if (node.getAttribute && - goog.isNull(node.getAttribute(cvox.NodeBreadcrumb.NEEDED_TAG_))) { - node.setAttribute(cvox.NodeBreadcrumb.NEEDED_TAG_, true); - - // only the parent needs to be added - // if the siblings are needed, then some ancestor - // would have had chromevoxtag set, in which case - // we copy the whole subtree of that ancestor anyways - if (node.nodeName !== 'body') { - this.setNeeded_(node.parentElement); - } - } -}; - - -/** - * Clones the part of the dom that is needed to recreate the test case. - * The nodes must have been marked first by calling smartStart_. - * @param {Node|Text} node The root of the subtree to clone. - * @return {Node|Text} The cloned subtree. - * @private - */ -cvox.NodeBreadcrumb.prototype.smartClone_ = function(node) { - var skipattrs = {}; - skipattrs[cvox.NodeBreadcrumb.TOUCHED_TAG] = true; - skipattrs[cvox.NodeBreadcrumb.NEEDED_TAG_] = true; - - if (node.getAttribute && node.getAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG)) { - return cvox.DomUtil.deepClone(node, skipattrs); - } - - var ret = cvox.DomUtil.shallowChildlessClone(node, skipattrs); - - for (var i = 0; i < node.childNodes.length; ++i) { - var child = node.childNodes[i]; - if (child.getAttribute && - !goog.isNull(child.getAttribute(cvox.NodeBreadcrumb.NEEDED_TAG_))) { - ret.appendChild(this.smartClone_(child)); - } - } - return ret; -}; - - -/** - * Returns a sting containing the html needed to replicate the test. - * @return {Node} The subset of the dom that was walked. - */ -cvox.NodeBreadcrumb.prototype.dumpWalkedDom = function() { - this.smartStart_(document.body); - return this.smartClone_(document.body); -}; - - -/** - * Retrieves the ChromeVox tag for the current node. - * - * @return {number} The ChromeVox tag or -1 if there is an error. - */ -cvox.NodeBreadcrumb.getCurrentNodeTag = function() { - var currentNode = cvox.ChromeVox.navigationManager.getCurrentNode(); - while (currentNode && !currentNode.hasAttribute) { - currentNode = currentNode.parentNode; - } - if (currentNode && - currentNode.hasAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG)) { - return currentNode.getAttribute(cvox.NodeBreadcrumb.TOUCHED_TAG); - } else { - return -1; - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/serializer.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/serializer.js deleted file mode 100644 index 9725a20f..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/serializer.js +++ /dev/null
@@ -1,40 +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. - -/** - * @fileoverview A global serializer object which returns the current - * ChromeVox system state. - */ - -goog.provide('cvox.Serializer'); - -goog.require('cvox.ChromeVox'); -goog.require('cvox.ChromeVoxEventWatcher'); - -/** - * @constructor - */ -cvox.Serializer = function() {}; - -/** - * Stores state variables in a provided object. - * - * @param {Object} store The object. - */ -cvox.Serializer.prototype.storeOn = function(store) { - cvox.ChromeVox.storeOn(store); - cvox.ChromeVoxEventWatcher.storeOn(store); - cvox.ChromeVox.navigationManager.storeOn(store); -}; - -/** - * Updates the object with state variables from an earlier storeOn call. - * - * @param {Object} store The object. - */ -cvox.Serializer.prototype.readFrom = function(store) { - cvox.ChromeVox.readFrom(store); - cvox.ChromeVoxEventWatcher.readFrom(store); - cvox.ChromeVox.navigationManager.readFrom(store); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/braille_overlay_widget.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/braille_overlay_widget.js deleted file mode 100644 index e440c31..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/braille_overlay_widget.js +++ /dev/null
@@ -1,183 +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. - -/** - * @fileoverview Overlay that shows the current braille display contents, - * both as text and braille, on screen in a document. - */ - -goog.provide('cvox.BrailleOverlayWidget'); - -goog.require('cvox.ExtensionBridge'); - -/** - * @constructor - */ -cvox.BrailleOverlayWidget = function() { - /** - * Whether the widget is active in the prefs. - * @type {boolean} - * @private - */ - this.active_ = false; - /** - * @type {Element} - * @private - */ - this.containerNode_ = null; - /** - * @type {Element} - * @private - */ - this.contentNode_ = null; - /** - * @type {Element} - * @private - */ - this.brailleNode_ = null; -}; -goog.addSingletonGetter(cvox.BrailleOverlayWidget); - - -/** - * One-time initializer, to be called in a top-level document. Adds a - * listener for braille content messages from the background page. - */ -cvox.BrailleOverlayWidget.prototype.init = function() { - cvox.ExtensionBridge.addMessageListener(goog.bind(this.onMessage_, this)); -}; - - -/** - * Sets whether the overlay is active and hides it if it is not active. - * @param {boolean} value Whether the overlay is active. - */ -cvox.BrailleOverlayWidget.prototype.setActive = function(value) { - this.active_ = value; - if (!value) { - this.hide_(); - } -}; - - -/** - * @return {boolean} Whether the overlay is active according to prefs. - */ -cvox.BrailleOverlayWidget.prototype.isActive = function() { - return this.active_; -}; - - -/** @private */ -cvox.BrailleOverlayWidget.prototype.show_ = function() { - var containerNode = this.createContainerNode_(); - this.containerNode_ = containerNode; - - var overlayNode = this.createOverlayNode_(); - containerNode.appendChild(overlayNode); - - this.contentNode_ = document.createElement('div'); - this.brailleNode_ = document.createElement('div'); - - overlayNode.appendChild(this.contentNode_); - overlayNode.appendChild(this.brailleNode_); - - document.body.appendChild(containerNode); - - window.setTimeout(function() { - containerNode.style['opacity'] = '1.0'; - }, 0); -}; - - -/** - * Hides the overlay if it is shown. - * @private - */ -// TODO(plundblad): Call when chromevox is deactivated and on some -// window focus changes. -cvox.BrailleOverlayWidget.prototype.hide_ = function() { - if (this.containerNode_) { - var containerNode = this.containerNode_; - containerNode.style.opacity = '0.0'; - window.setTimeout(function() { - document.body.removeChild(containerNode); - }, 1000); - this.containerNode_ = null; - this.contentNode_ = null; - this.brailleNode_ = null; - } -}; - - -/** - * @param {string} text The text represnting what was output on the display. - * @param {string} brailleChars The Unicode characters representing the - * braille patterns currently on the display. - * @private - */ -cvox.BrailleOverlayWidget.prototype.setContent_ = function(text, brailleChars) { - if (!this.contentNode_) { - this.show_(); - } - this.contentNode_.textContent = text; - this.brailleNode_.textContent = brailleChars; -}; - - -/** - * Create the container node for the braille overlay. - * - * @return {!Element} The new element, not yet added to the document. - * @private - */ -cvox.BrailleOverlayWidget.prototype.createContainerNode_ = function() { - var containerNode = document.createElement('div'); - containerNode.id = 'cvox-braille-overlay'; - containerNode.style['position'] = 'fixed'; - containerNode.style['top'] = '50%'; - containerNode.style['left'] = '50%'; - containerNode.style['transition'] = 'all 0.3s ease-in'; - containerNode.style['opacity'] = '0.0'; - containerNode.style['z-index'] = '2147483647'; - containerNode.setAttribute('aria-hidden', 'true'); - return containerNode; -}; - - -/** - * Create the braille overlay. This should be a child of the node - * returned from createContainerNode. - * - * @return {!Element} The new element, not yet added to the document. - * @private - */ -cvox.BrailleOverlayWidget.prototype.createOverlayNode_ = function() { - var overlayNode = document.createElement('div'); - overlayNode.style['position'] = 'fixed'; - overlayNode.style['left'] = '40px'; - overlayNode.style['bottom'] = '20px'; - overlayNode.style['line-height'] = '1.2em'; - overlayNode.style['font-size'] = '20px'; - overlayNode.style['font-family'] = 'monospace'; - overlayNode.style['padding'] = '30px'; - overlayNode.style['min-width'] = '150px'; - overlayNode.style['color'] = '#fff'; - overlayNode.style['background-color'] = 'rgba(0, 0, 0, 0.7)'; - overlayNode.style['border-radius'] = '10px'; - return overlayNode; -}; - - -/** - * Listens for background page messages and show braille content when it - * arrives. - * @param {Object} msg Message from background page. - * @private - */ -cvox.BrailleOverlayWidget.prototype.onMessage_ = function(msg) { - if (msg['message'] == 'BRAILLE_CAPTION') { - this.setContent_(msg['text'], msg['brailleChars']); - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/context_menu_widget.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/context_menu_widget.js deleted file mode 100644 index cc48c5a..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/context_menu_widget.js +++ /dev/null
@@ -1,126 +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. - -/** - * @fileoverview Widget presenting context menus. - */ - -goog.provide('cvox.ContextMenuWidget'); - -goog.require('cvox.ChromeVox'); -goog.require('cvox.OverlayWidget'); -goog.require('cvox.UserEventDetail'); - -var CONTEXT_MENU_ATTR = 'contextMenuActions'; -/** - * Return the list from a node or an ancestor. - * Note: If there are multiple lists, this well return the closest. - * @private - * @param {Object} node Node to extract from. - * @return {*} Extracted list. - */ -var extractMenuList = function(node) { - var curr = node; - while (curr !== document) { - var menuListJSON = curr.getAttribute(CONTEXT_MENU_ATTR); - if (menuListJSON) { - return JSON.parse(menuListJSON); - } - curr = curr.parentNode; - } - return null; -}; - -/** - * Gets the current element node. - * @private - * @return {Node} Current element node. - */ -var getCurrentElement = function() { - var currNode = cvox.ChromeVox.navigationManager.getCurrentNode(); - while (currNode.nodeType !== Node.ELEMENT_NODE) { - currNode = currNode.parentNode; - } - return currNode; -}; - -/** - * @constructor - * @extends {cvox.OverlayWidget} - */ -cvox.ContextMenuWidget = function() { - goog.base(this, ''); - this.container_ = document.createElement('div'); - - /** - * The element that triggered the ContextMenu. - * @private - * @type {Node} - */ - this.triggerElement_ = getCurrentElement(); - - /** - * List of menu items in the context menu. - */ - this.menuList = extractMenuList(this.triggerElement_); - - if (!this.menuList) { - console.log('No context menu found.'); - return; - } - - this.menuList.forEach(goog.bind(function(menuItem) { - if (menuItem['desc'] || menuItem['cmd']) { - var desc = menuItem['desc']; - var cmd = menuItem['cmd']; - - var menuElem = document.createElement('p'); - menuElem.id = cmd; - menuElem.textContent = desc; - menuElem.setAttribute('role', 'menuitem'); - this.container_.appendChild(menuElem); - } - }, this)); -}; -goog.inherits(cvox.ContextMenuWidget, cvox.OverlayWidget); - -/** - * @override - */ -cvox.ContextMenuWidget.prototype.show = function() { - if (this.menuList) { - goog.base(this, 'show'); - this.host_.appendChild(this.container_); - } -}; - -/** - * @override - */ -cvox.ContextMenuWidget.prototype.getNameMsg = function() { - return ['context_menu_intro']; -}; - -/** - * @override - */ -cvox.ContextMenuWidget.prototype.onKeyDown = function(evt) { - var ENTER_KEYCODE = 13; - if (evt.keyCode == ENTER_KEYCODE) { - var currentNode = cvox.ChromeVox.navigationManager.getCurrentNode(); - var cmd = currentNode.parentNode.id; - - /* Dispatch the event. */ - var detail = new cvox.UserEventDetail({customCommand: cmd}); - var userEvt = detail.createEventObject(); - this.triggerElement_.dispatchEvent(userEvt); - this.hide(); - - evt.preventDefault(); - evt.stopPropagation(); - return true; - } else { - return goog.base(this, 'onKeyDown', evt); - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/keyboard_help_widget.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/keyboard_help_widget.js deleted file mode 100644 index 34fc0e1..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/keyboard_help_widget.js +++ /dev/null
@@ -1,85 +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. - -/** - * @fileoverview Widget presenting all keyboard commands. - */ - -goog.provide('cvox.KeyboardHelpWidget'); - -goog.require('cvox.ChromeVox'); -goog.require('cvox.CommandStore'); -goog.require('cvox.KeyUtil'); -goog.require('cvox.OverlayWidget'); - -/** - * @constructor - * @extends {cvox.OverlayWidget} - */ -cvox.KeyboardHelpWidget = function() { - goog.base(this, ''); - this.container_ = document.createElement('div'); - var list = []; - var callbacks = []; - var keymap = cvox.ChromeVoxKbHandler.handlerKeyMap; - - keymap.bindings().forEach(goog.bind(function(pair) { - var command = pair.command; - var keySeq = pair.sequence; - var message = command; - try { - var id = cvox.CommandStore.messageForCommand(command); - if (!id) { - return; - } - message = Msgs.getMsg(id); - } catch (e) { - // TODO(dtseng): We have some commands that don't have valid message id's. - } - - var commandElement = document.createElement('p'); - commandElement.id = command; - commandElement.setAttribute('role', 'menuitem'); - commandElement.textContent = - message + ' - ' + cvox.KeyUtil.keySequenceToString(keySeq, true); - this.container_.appendChild(commandElement); - }, this)); -}; -goog.inherits(cvox.KeyboardHelpWidget, cvox.OverlayWidget); -goog.addSingletonGetter(cvox.KeyboardHelpWidget); - - -/** - * @override - */ -cvox.KeyboardHelpWidget.prototype.show = function() { - goog.base(this, 'show'); - this.host_.appendChild(this.container_); -}; - - -/** - * @override - */ -cvox.KeyboardHelpWidget.prototype.getNameMsg = function() { - return ['keyboard_help_intro']; -}; - -/** - * @override - */ -cvox.KeyboardHelpWidget.prototype.onKeyDown = function(evt) { - if (evt.keyCode == 13) { // Enter - var currentCommand = - cvox.ChromeVox.navigationManager.getCurrentNode().parentNode.id; - this.hide(); - cvox.ChromeVoxEventSuspender.withSuspendedEvents( - cvox.ChromeVoxUserCommands.commands[currentCommand])(); - evt.preventDefault(); - evt.stopPropagation(); - return true; - } else { - return goog.base(this, 'onKeyDown', evt); - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/node_search_widget.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/node_search_widget.js deleted file mode 100644 index 93adad7..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/node_search_widget.js +++ /dev/null
@@ -1,65 +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. - -/** - * @fileoverview A search Widget presenting a list of nodes with the ability - * to sync selection when chosen. - */ - -goog.provide('cvox.NodeSearchWidget'); - -goog.require('cvox.ChromeVox'); -goog.require('cvox.DomUtil'); -goog.require('cvox.SearchWidget'); - - -/** - * @constructor - * @param {string} typeMsg A message id identifying the type of items - * contained in the list. - * @param {?function(Array<Node>)} predicate A predicate; if null, no predicate - * applies. - * @extends {cvox.SearchWidget} - */ -cvox.NodeSearchWidget = function(typeMsg, predicate) { - this.typeMsg_ = typeMsg; - this.predicate_ = predicate; - goog.base(this); -}; -goog.inherits(cvox.NodeSearchWidget, cvox.SearchWidget); - - -/** - * @override - */ -cvox.NodeSearchWidget.prototype.getNameMsg = function() { - return ['choice_widget_name', [Msgs.getMsg(this.typeMsg_)]]; -}; - - -/** - * @override - */ -cvox.NodeSearchWidget.prototype.getHelpMsg = function() { - return 'choice_widget_help'; -}; - - -/** - * @override - */ -cvox.NodeSearchWidget.prototype.getPredicate = function() { - return this.predicate_; -}; - - -/** - * Shows a list generated dynamic satisfying some predicate. - * @param {string} typeMsg The message id of the type contained in nodes. - * @param {function(Array<Node>)} predicate The predicate. - * @return {cvox.NodeSearchWidget} The widget. - */ -cvox.NodeSearchWidget.create = function(typeMsg, predicate) { - return new cvox.NodeSearchWidget(typeMsg, predicate); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/overlay_widget.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/overlay_widget.js deleted file mode 100644 index a0c48c4..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/overlay_widget.js +++ /dev/null
@@ -1,84 +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. - -/** - * @fileoverview A widget hosting an HTML snippet. - */ - -goog.provide('cvox.OverlayWidget'); - -goog.require('cvox.DomUtil'); -goog.require('cvox.SearchWidget'); - - -/** - * @param {string} snippet The HTML snippet to render. - * @constructor - * @extends {cvox.SearchWidget} - */ -cvox.OverlayWidget = function(snippet) { - goog.base(this); - this.snippet_ = snippet; -}; -goog.inherits(cvox.OverlayWidget, cvox.SearchWidget); - - -/** - * @override - */ -cvox.OverlayWidget.prototype.show = function() { - goog.base(this, 'show'); - var host = document.createElement('DIV'); - host.innerHTML = this.snippet_; - - // Position the overlay over the current ChromeVox selection. - var hitPoint = cvox.DomUtil.elementToPoint( - cvox.ChromeVox.navigationManager.getCurrentNode()); - host.style.position = 'absolute'; - host.style.left = String(hitPoint.x); - host.style.top = String(hitPoint.y); - - document.body.appendChild(host); - cvox.ChromeVox.navigationManager.updateSelToArbitraryNode(host); - this.host_ = host; -}; - - -/** - * @override - */ -cvox.OverlayWidget.prototype.hide = function(opt_noSync) { - this.host_.remove(); - goog.base(this, 'hide'); -}; - - -/** - * @override - */ -cvox.OverlayWidget.prototype.onKeyDown = function(evt) { - // Allow the base class to handle all keys first. - goog.base(this, 'onKeyDown', evt); - - // Do not interfere with any key that exits the widget. - if (evt.keyCode == 13 || evt.keyCode == 27) { // Enter or escape. - return true; - } - - // Bound navigation within the snippet for any other key. - var r = cvox.ChromeVox.navigationManager.isReversed(); - if (!cvox.DomUtil.isDescendantOfNode( - cvox.ChromeVox.navigationManager.getCurrentNode(), this.host_)) { - if (r) { - cvox.ChromeVox.navigationManager.syncToBeginning(); - } else { - cvox.ChromeVox.navigationManager.updateSelToArbitraryNode(this.host_); - } - this.onNavigate(); - cvox.ChromeVox.navigationManager.speakDescriptionArray( - cvox.ChromeVox.navigationManager.getDescription(), cvox.QueueMode.FLUSH, - null); - } - return false; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/search_widget.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/search_widget.js deleted file mode 100644 index fda79a99e..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/search_widget.js +++ /dev/null
@@ -1,527 +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. - -/** - * @fileoverview JavaScript for poppup up a search widget and performing - * search within a page. - */ - -goog.provide('cvox.SearchWidget'); - -goog.require('cvox.AbstractEarcons'); -goog.require('cvox.ApiImplementation'); -goog.require('cvox.ChromeVox'); -goog.require('cvox.CursorSelection'); -goog.require('cvox.NavigationManager'); -goog.require('cvox.SpokenMessages'); -goog.require('cvox.Widget'); - - -/** - * Initializes the search widget. - * @constructor - * @extends {cvox.Widget} - */ -cvox.SearchWidget = function() { - /** - * @type {Element} - * @private - */ - this.containerNode_ = null; - - /** - * @type {Element} - * @private - */ - this.txtNode_ = null; - - /** - * @type {string} - * @const - * @private - */ - this.PROMPT_ = 'Search:'; - - /** - * @type {boolean} - * @private - */ - this.caseSensitive_ = false; - - /** - * @type {boolean} - * @private - */ - this.hasMatch_ = false; - goog.base(this); -}; -goog.inherits(cvox.SearchWidget, cvox.Widget); -goog.addSingletonGetter(cvox.SearchWidget); - - -/** - * @override - */ -cvox.SearchWidget.prototype.show = function() { - goog.base(this, 'show'); - this.active = true; - this.hasMatch_ = false; - cvox.ChromeVox.navigationManager.setGranularity( - cvox.NavigationShifter.GRANULARITIES.OBJECT, true, false); - - // Always start search forward. - cvox.ChromeVox.navigationManager.setReversed(false); - - // During profiling, NavigationHistory was found to have a serious performance - // impact on search. - this.focusRecovery_ = cvox.ChromeVox.navigationManager.getFocusRecovery(); - cvox.ChromeVox.navigationManager.setFocusRecovery(false); - - var containerNode = this.createContainerNode_(); - this.containerNode_ = containerNode; - - var overlayNode = this.createOverlayNode_(); - containerNode.appendChild(overlayNode); - - var promptNode = document.createElement('span'); - promptNode.innerHTML = this.PROMPT_; - overlayNode.appendChild(promptNode); - - this.txtNode_ = this.createTextAreaNode_(); - - overlayNode.appendChild(this.txtNode_); - - document.body.appendChild(containerNode); - - this.txtNode_.focus(); - - window.setTimeout(function() { - containerNode.style['opacity'] = '1.0'; - }, 0); -}; - - -/** - * @override - */ -cvox.SearchWidget.prototype.hide = function(opt_noSync) { - if (this.isActive()) { - var containerNode = this.containerNode_; - containerNode.style.opacity = '0.0'; - window.setTimeout(function() { - document.body.removeChild(containerNode); - }, 1000); - this.txtNode_ = null; - cvox.SearchWidget.containerNode = null; - cvox.ChromeVox.navigationManager.setFocusRecovery(this.focusRecovery_); - this.active = false; - } - - cvox.$m('choice_widget_exited') - .andPause() - .andMessage(this.getNameMsg()) - .speakFlush(); - - if (!this.hasMatch_ || !opt_noSync) { - cvox.ChromeVox.navigationManager.updateSelToArbitraryNode(this.initialNode); - } - cvox.ChromeVoxEventSuspender.withSuspendedEvents(goog.bind( - cvox.ChromeVox.navigationManager.syncAll, - cvox.ChromeVox.navigationManager))(true); - cvox.ChromeVox.navigationManager.speakDescriptionArray( - cvox.ChromeVox.navigationManager.getDescription(), cvox.QueueMode.QUEUE, - null, cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT); - - // Update on Braille too. - // TODO: Use line granularity in search so we can simply call - // cvox.ChromeVox.navigationManager.getBraille().write() instead. - var text = this.textFromCurrentDescription_(); - cvox.ChromeVox.braille.write( - new cvox.NavBraille({text: text, startIndex: 0, endIndex: 0})); - - goog.base(this, 'hide', true); -}; - - -/** - * @override - */ -cvox.SearchWidget.prototype.getNameMsg = function() { - return ['search_widget_intro']; -}; - - -/** - * @override - */ -cvox.SearchWidget.prototype.getHelpMsg = function() { - return 'search_widget_intro_help'; -}; - - -/** - * @override - */ -cvox.SearchWidget.prototype.onKeyDown = function(evt) { - if (!this.isActive()) { - return false; - } - var searchStr = this.txtNode_.value; - if (evt.keyCode == 8) { // Backspace - if (searchStr.length > 0) { - searchStr = searchStr.substring(0, searchStr.length - 1); - this.txtNode_.value = searchStr; - this.beginSearch_(searchStr); - } else { - cvox.ChromeVox.navigationManager.updateSelToArbitraryNode( - this.initialNode); - cvox.ChromeVox.navigationManager.syncAll(); - } - } else if (evt.keyCode == 40) { // Down arrow - this.next_(searchStr, false); - } else if (evt.keyCode == 38) { // Up arrow - this.next_(searchStr, true); - } else if (evt.keyCode == 13) { // Enter - this.hide(true); - } else if (evt.keyCode == 27) { // Escape - this.hide(false); - } else if (evt.ctrlKey && evt.keyCode == 67) { // ctrl + c - this.toggleCaseSensitivity_(); - } else { - return goog.base(this, 'onKeyDown', evt); - } - evt.preventDefault(); - evt.stopPropagation(); - return true; -}; - - -/** - * Adds the letter the user typed to the search string and updates the search. - * @override - */ -cvox.SearchWidget.prototype.onKeyPress = function(evt) { - if (!this.isActive()) { - return false; - } - - this.txtNode_.value += String.fromCharCode(evt.charCode); - var searchStr = this.txtNode_.value; - this.beginSearch_(searchStr); - evt.preventDefault(); - evt.stopPropagation(); - return true; -}; - - -/** - * Called when navigation occurs. - * Override this method to react to navigation caused by user input. - */ -cvox.SearchWidget.prototype.onNavigate = function() {}; - - -/** - * Gets the predicate to apply to every search. - * @return {?function(Array<Node>)} A predicate; if null, no predicate applies. - */ -cvox.SearchWidget.prototype.getPredicate = function() { - return null; -}; - - -/** - * Goes to the next or previous result. For use in AndroidVox. - * @param {boolean=} opt_reverse Whether to find the next result in reverse. - * @return {Array<cvox.NavDescription>} The next result. - */ -cvox.SearchWidget.prototype.nextResult = function(opt_reverse) { - if (!this.isActive()) { - return null; - } - var searchStr = this.txtNode_.value; - return this.next_(searchStr, opt_reverse); -}; - - -/** - * Create the container node for the search overlay. - * - * @return {!Element} The new element, not yet added to the document. - * @private - */ -cvox.SearchWidget.prototype.createContainerNode_ = function() { - var containerNode = document.createElement('div'); - containerNode.id = 'cvox-search'; - containerNode.style['position'] = 'fixed'; - containerNode.style['top'] = '50%'; - containerNode.style['left'] = '50%'; - containerNode.style['transition'] = 'all 0.3s ease-in'; - containerNode.style['opacity'] = '0.0'; - containerNode.style['z-index'] = '2147483647'; - containerNode.setAttribute('aria-hidden', 'true'); - return containerNode; -}; - - -/** - * Create the search overlay. This should be a child of the node - * returned from createContainerNode. - * - * @return {!Element} The new element, not yet added to the document. - * @private - */ -cvox.SearchWidget.prototype.createOverlayNode_ = function() { - var overlayNode = document.createElement('div'); - overlayNode.style['position'] = 'relative'; - overlayNode.style['left'] = '-50%'; - overlayNode.style['top'] = '-40px'; - overlayNode.style['line-height'] = '1.2em'; - overlayNode.style['font-size'] = '20px'; - overlayNode.style['padding'] = '30px'; - overlayNode.style['min-width'] = '150px'; - overlayNode.style['color'] = '#fff'; - overlayNode.style['background-color'] = 'rgba(0, 0, 0, 0.7)'; - overlayNode.style['border-radius'] = '10px'; - return overlayNode; -}; - - -/** - * Create the text area node. This should be the child of the node - * returned from createOverlayNode. - * - * @return {!Element} The new element, not yet added to the document. - * @private - */ -cvox.SearchWidget.prototype.createTextAreaNode_ = function() { - var textNode = document.createElement('textarea'); - textNode.setAttribute('aria-hidden', 'true'); - textNode.setAttribute('rows', '1'); - textNode.style['color'] = '#fff'; - textNode.style['background-color'] = 'rgba(0, 0, 0, 0.7)'; - textNode.style['vertical-align'] = 'middle'; - textNode.addEventListener('textInput', this.handleSearchChanged_, false); - return textNode; -}; - - -/** - * Toggles whether or not searches are case sensitive. - * @private - */ -cvox.SearchWidget.prototype.toggleCaseSensitivity_ = function() { - if (this.caseSensitive_) { - cvox.SearchWidget.caseSensitive_ = false; - cvox.ChromeVox.tts.speak( - Msgs.getMsg('ignoring_case'), cvox.QueueMode.FLUSH, null); - } else { - this.caseSensitive_ = true; - cvox.ChromeVox.tts.speak( - Msgs.getMsg('case_sensitive'), cvox.QueueMode.FLUSH, null); - } -}; - - -/** - * Gets the next result. - * - * @param {string} searchStr The text to search for. - * @return {Array<cvox.NavDescription>} The next result, in the form of - * NavDescriptions. - * @private - */ -cvox.SearchWidget.prototype.getNextResult_ = function(searchStr) { - var r = cvox.ChromeVox.navigationManager.isReversed(); - if (!this.caseSensitive_) { - searchStr = searchStr.toLowerCase(); - } - - cvox.ChromeVox.navigationManager.setGranularity( - cvox.NavigationShifter.GRANULARITIES.OBJECT, true, false); - - do { - if (this.getPredicate()) { - var retNode = this.getPredicate()(cvox.DomUtil.getAncestors( - cvox.ChromeVox.navigationManager.getCurrentNode())); - if (!retNode) { - continue; - } - } - - var descriptions = cvox.ChromeVox.navigationManager.getDescription(); - for (var i = 0; i < descriptions.length; i++) { - var targetStr = this.caseSensitive_ ? descriptions[i].text : - descriptions[i].text.toLowerCase(); - var targetIndex = targetStr.indexOf(searchStr); - - // Surround search hit with pauses. - if (targetIndex != -1 && targetStr.length > searchStr.length) { - descriptions[i].text = cvox.DomUtil.collapseWhitespace( - targetStr.substring(0, targetIndex)) + - ', ' + searchStr + ', ' + - targetStr.substring(targetIndex + searchStr.length); - descriptions[i].text = - cvox.DomUtil.collapseWhitespace(descriptions[i].text); - } - if (targetIndex != -1) { - return descriptions; - } - } - cvox.ChromeVox.navigationManager.setReversed(r); - } while (cvox.ChromeVox.navigationManager.navigate( - true, cvox.NavigationShifter.GRANULARITIES.OBJECT)); - return null; -}; - - -/** - * Performs the search starting from the initial position. - * - * @param {string} searchStr The text to search for. - * @private - */ -cvox.SearchWidget.prototype.beginSearch_ = function(searchStr) { - var result = this.getNextResult_(searchStr); - this.outputSearchResult_(result, searchStr); - this.onNavigate(); -}; - - -/** - * Goes to the next (directed) matching result. - * - * @param {string} searchStr The text to search for. - * @param {boolean=} opt_reversed The direction. - * @return {Array<cvox.NavDescription>} The next result. - * @private - */ -cvox.SearchWidget.prototype.next_ = function(searchStr, opt_reversed) { - cvox.ChromeVox.navigationManager.setReversed(!!opt_reversed); - - var success = false; - if (this.getPredicate()) { - success = cvox.ChromeVox.navigationManager.findNext( - /** @type {function(Array<Node>)} */ (this.getPredicate())); - // TODO(dtseng): findNext always seems to point direction forward! - cvox.ChromeVox.navigationManager.setReversed(!!opt_reversed); - if (!success) { - cvox.ChromeVox.navigationManager.syncToBeginning(); - cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.WRAP); - success = true; - } - } else { - success = cvox.ChromeVox.navigationManager.navigate(true); - } - var result = success ? this.getNextResult_(searchStr) : null; - this.outputSearchResult_(result, searchStr); - this.onNavigate(); - return result; -}; - - -/** - * Given a range corresponding to a search result, highlight the result, - * speak it, focus the node if applicable, and speak some instructions - * at the end. - * - * @param {Array<cvox.NavDescription>} result The description of the next - * result. If null, no more results were found and an error will be presented. - * @param {string} searchStr The text to search for. - * @private - */ -cvox.SearchWidget.prototype.outputSearchResult_ = function(result, searchStr) { - cvox.ChromeVox.tts.stop(); - if (!result) { - cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.WRAP); - this.hasMatch_ = false; - return; - } - - this.hasMatch_ = true; - - // Speak the modified description and some instructions. - cvox.ChromeVoxEventSuspender.withSuspendedEvents(goog.bind( - cvox.ChromeVox.navigationManager.syncAll, - cvox.ChromeVox.navigationManager))(true); - - cvox.ChromeVox.navigationManager.speakDescriptionArray( - result, cvox.QueueMode.FLUSH, null, - cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT); - - cvox.ChromeVox.tts.speak( - Msgs.getMsg('search_help_item'), cvox.QueueMode.QUEUE, - cvox.AbstractTts.PERSONALITY_ANNOTATION); - - // Output to Braille. - // TODO: Use line granularity in search so we can simply call - // cvox.ChromeVox.navigationManager.getBraille().write() instead. - this.outputSearchResultToBraille_(searchStr); -}; - - -/** - * Writes the currently selected search result to Braille, with description - * text formatted for Braille display instead of speech. - * - * @param {string} searchStr The text to search for. - * Should be in navigation manager's description. - * @private - */ -cvox.SearchWidget.prototype.outputSearchResultToBraille_ = function(searchStr) { - // Construct object we can pass to Chromevox.braille to write. - // We concatenate the text together and set the "cursor" - // position to be at the end of search query string - // (consistent with editing text in a field). - var text = this.textFromCurrentDescription_(); - var targetStr = this.caseSensitive_ ? text : text.toLowerCase(); - searchStr = this.caseSensitive_ ? searchStr : searchStr.toLowerCase(); - var targetIndex = targetStr.indexOf(searchStr); - if (targetIndex == -1) { - console.log('Search string not in result when preparing for Braille.'); - return; - } - - // Mark the string as a search result by adding a prefix - // and adjust the targetIndex accordingly. - var oldLength = text.length; - text = Msgs.getMsg('mark_as_search_result_brl', [text]); - var newLength = text.length; - targetIndex += (newLength - oldLength); - - // Write to Braille with cursor at the end of the search hit. - cvox.ChromeVox.braille.write(new cvox.NavBraille({ - text: text, - startIndex: (targetIndex + searchStr.length), - endIndex: (targetIndex + searchStr.length) - })); -}; - - -/** - * Returns the concatenated text from the current description in the - * NavigationManager. - * TODO: May not be needed after we just simply use line granularity in search, - * since this is mostly used to display the long search result descriptions on - * Braille. - * @return {string} The concatenated text from the current description. - * @private - */ -cvox.SearchWidget.prototype.textFromCurrentDescription_ = function() { - var descriptions = cvox.ChromeVox.navigationManager.getDescription(); - var text = ''; - for (var i = 0; i < descriptions.length; i++) { - text += descriptions[i].text + ' '; - } - return text; -}; - -/** - * @param {Object} evt The onInput event that the function is handling. - * @private - */ -cvox.SearchWidget.prototype.handleSearchChanged_ = function(evt) { - var searchStr = evt.target.value + evt.data; - cvox.SearchWidget.prototype.beginSearch_(searchStr); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/select_widget.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/select_widget.js deleted file mode 100644 index b2decc2..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/select_widget.js +++ /dev/null
@@ -1,82 +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. - -/** - * @fileoverview A widget hosting an HTML <select> element. - * In most cases, the browser's native key-driven usage model works for user - * interaction and manipulation of a <select>. However, on platforms like Mac - * OS X where <select> elements get their own renderer, users can still interact - * with <select> elements via a ChromeVox overlay/context widget. - */ - -goog.provide('cvox.SelectWidget'); - - -goog.require('cvox.OverlayWidget'); - - -/** - * @param {Node} node The select node. - * @constructor - * @extends {cvox.OverlayWidget} - */ -cvox.SelectWidget = function(node) { - goog.base(this, ''); - this.selectNode_ = node; -}; -goog.inherits(cvox.SelectWidget, cvox.OverlayWidget); - - -/** - * @override - */ -cvox.SelectWidget.prototype.show = function() { - goog.base(this, 'show'); - var container = document.createElement('div'); - container.setAttribute('role', 'menu'); - for (var i = 0, item = null; item = this.selectNode_.options[i]; i++) { - var newItem = document.createElement('p'); - newItem.innerHTML = item.innerHTML; - newItem.id = i; - newItem.setAttribute('role', 'menuitem'); - container.appendChild(newItem); - } - this.host_.appendChild(container); - var currentSelection = this.selectNode_.selectedIndex; - if (typeof(currentSelection) == 'number') { - cvox.ChromeVox.syncToNode(container.children[currentSelection], true); - } -}; - - -/** - * @override - */ -cvox.SelectWidget.prototype.hide = function(opt_noSync) { - var evt = document.createEvent('Event'); - evt.initEvent('change', false, false); - this.selectNode_.dispatchEvent(evt); - goog.base(this, 'hide', true); -}; - - -/** - * @override - */ -cvox.SelectWidget.prototype.onNavigate = function() { - var self = this; - cvox.ChromeVoxEventSuspender.withSuspendedEvents(function() { - var selectedIndex = - cvox.ChromeVox.navigationManager.getCurrentNode().parentNode.id; - self.selectNode_.selectedIndex = selectedIndex; - })(); -}; - - -/** - * @override - */ -cvox.SelectWidget.prototype.getNameMsg = function() { - return ['role_menu']; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/spoken_messages.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/spoken_messages.js deleted file mode 100644 index 9364fa6..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/spoken_messages.js +++ /dev/null
@@ -1,90 +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. - -/** - * @fileoverview Useful abstraction when speaking messages. - * - * Usage: - * $m('role_link') - * .andPause() - * .andMessage('role_forms') - * .speakFlush(); - * - */ - -goog.provide('cvox.SpokenMessage'); -goog.provide('cvox.SpokenMessages'); - -goog.require('cvox.AbstractTts'); -goog.require('cvox.ChromeVox'); - -/** - * @constructor - */ -cvox.SpokenMessage = function() { - /** @type {Array} */ - this.id = null; -}; - -/** - * @type {Array} - */ -cvox.SpokenMessages.messages = []; - -/** - * Speaks the message chain and interrupts any on-going speech. - */ -cvox.SpokenMessages.speakFlush = function() { - cvox.SpokenMessages.speak(cvox.QueueMode.FLUSH); -}; - -/** - * Speak the message chain. - * @param {cvox.QueueMode} mode The speech queue mode. - */ -cvox.SpokenMessages.speak = function(mode) { - for (var i = 0; i < cvox.SpokenMessages.messages.length; ++i) { - var message = cvox.SpokenMessages.messages[i]; - - // An invalid message format. - if (!message || !message.id) - throw 'Invalid message received.'; - - var finalText = Msgs.getMsg.apply(Msgs, message.id); - cvox.ChromeVox.tts.speak( - finalText, mode, cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT); - - // Always queue after the first message. - mode = cvox.QueueMode.QUEUE; - } - - cvox.SpokenMessages.messages = []; -}; - -/** - * Adds a message. - * @param {string|Array} messageId The id of the message. - * @return {Object} This object, useful for chaining. - */ -cvox.SpokenMessages.andMessage = function(messageId) { - var newMessage = new cvox.SpokenMessage(); - newMessage.id = typeof(messageId) == 'string' ? [messageId] : messageId; - cvox.SpokenMessages.messages.push(newMessage); - return cvox.SpokenMessages; -}; - -/** - * Pauses after the message, with an appropriate marker. - * @return {Object} This object, useful for chaining. - */ -cvox.SpokenMessages.andPause = function() { - return cvox.SpokenMessages.andMessage('pause'); -}; - -/** - * Adds a message. - * @param {string|Array} messageId The id of the message. - * @return {Object} This object, useful for chaining. - */ -cvox.$m = cvox.SpokenMessages.andMessage;
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/widget.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/widget.js deleted file mode 100644 index 40e3fea..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/ui/widget.js +++ /dev/null
@@ -1,194 +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. - -/** - * @fileoverview Base class for all ChromeVox widgets. - * - * Widgets are keyboard driven and modal mediums for ChromeVox to expose - * additional features such as lists, interactive search, or grids. - */ - -goog.provide('cvox.Widget'); - -goog.require('cvox.AbstractEarcons'); -goog.require('cvox.ApiImplementation'); -goog.require('cvox.ChromeVox'); -goog.require('cvox.SpokenMessages'); - -/** - * Keeps a reference to a currently or formerly active widget. This enforces - * the singleton nature of widgets. - * @type {cvox.Widget} - * @private - */ -cvox.Widget.ref_; - - -/** - * @constructor - */ -cvox.Widget = function() { - /** - * @type {boolean} - * @protected - */ - this.active = false; - - - /** - * Keeps a reference to a node which should receive focus once a widget hides. - * @type {Node} - * @protected - */ - this.initialFocus = null; - - /** - * Keeps a reference to a node which should receive selection once a widget - * hides. - * @type {Node} - * @protected - */ - this.initialNode = null; - - // Checks to see if there is a current widget in use. - if (!cvox.Widget.ref_ || !cvox.Widget.ref_.isActive()) { - cvox.Widget.ref_ = this; - } -}; - - -/** - * Returns whether or not the widget is active. - * @return {boolean} Whether the widget is active. - */ -cvox.Widget.prototype.isActive = function() { - return this.active; -}; - - -/** - * Visual/aural display of this widget. - */ -cvox.Widget.prototype.show = function() { - if (this.isActive()) { - // Only one widget should be shown at any given time. - this.hide(true); - } - this.onKeyDown = goog.bind(this.onKeyDown, this); - this.onKeyPress = goog.bind(this.onKeyPress, this); - window.addEventListener('keydown', this.onKeyDown, true); - window.addEventListener('keypress', this.onKeyPress, true); - - this.initialNode = cvox.ChromeVox.navigationManager.getCurrentNode(); - this.initialFocus = document.activeElement; - - // Widgets do not respond to sticky key. - cvox.ChromeVox.stickyOverride = false; - - if (this.getNameMsg() && this.getHelpMsg()) { - cvox.$m(this.getNameMsg()) - .andPause() - .andMessage(this.getHelpMsg()) - .speakFlush(); - } - cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.OBJECT_OPEN); - - this.active = true; -}; - - -/** - * Visual/aural hide of this widget. - * @param {boolean=} opt_noSync Whether to attempt to sync to the node before - * this widget was first shown. If left unspecified or false, an attempt to sync - * will be made. - */ -cvox.Widget.prototype.hide = function(opt_noSync) { - window.removeEventListener('keypress', this.onKeyPress, true); - window.removeEventListener('keydown', this.onKeyDown, true); - cvox.ChromeVox.stickyOverride = null; - - cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.OBJECT_CLOSE); - if (!opt_noSync) { - this.initialNode = this.initialNode.nodeType == 1 ? - this.initialNode : - this.initialNode.parentNode; - cvox.ChromeVox.navigationManager.syncToNode( - this.initialNode, true, cvox.QueueMode.QUEUE); - } - - this.active = false; -}; - - -/** - * Toggle between showing and hiding. - */ -cvox.Widget.prototype.toggle = function() { - if (this.isActive()) { - this.hide(); - } else { - this.show(); - } -}; - - -/** - * The name of the widget. - * @return {!Array} The message id referencing the name of the widget in an - * array argument form passable to Msgs.getMsg.apply. - */ -cvox.Widget.prototype.getNameMsg = goog.abstractMethod; - - -/** - * Gets the help message for the widget. - * The help message succintly describes how to use the widget. - * @return {string} The message id referencing the help for the widget. - */ -cvox.Widget.prototype.getHelpMsg = goog.abstractMethod; - - -/** - * The default widget key down handler. - * - * @param {Event} evt The keyDown event. - * @return {boolean} Whether or not the event was handled. - * - * @protected - */ -cvox.Widget.prototype.onKeyDown = function(evt) { - if (evt.keyCode == 27) { // Escape - this.hide(); - evt.preventDefault(); - return true; - } else if (evt.keyCode == 9) { // Tab - this.hide(); - return true; - } else if (evt.keyCode == 17) { - cvox.ChromeVox.tts.stop(); - } - - evt.stopPropagation(); - return true; -}; - - -/** - * The default widget key press handler. - * - * @param {Event} evt The keyPress event. - * @return {boolean} Whether or not the event was handled. - * - * @protected - */ -cvox.Widget.prototype.onKeyPress = function(evt) { - return false; -}; -/** - * @return {boolean} True if any widget is currently active. - */ -cvox.Widget.isActive = function() { - return (cvox.Widget.ref_ && cvox.Widget.ref_.isActive()) || false; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/user_commands.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/user_commands.js deleted file mode 100644 index 356d52c..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/user_commands.js +++ /dev/null
@@ -1,796 +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. - -/** - * @fileoverview High level commands that the user can invoke using hotkeys. - * - * Usage: - * If you are here, you probably want to add a new user command. Here are some - * general steps to get you started. - * - Go to command_store.js, where all static data about a command lives. Follow - * the instructions there. - * - Add the logic of the command to doCommand_ below. Try to reuse or group - * your command with related commands. - */ - - -goog.provide('cvox.ChromeVoxUserCommands'); - -goog.require('cvox.BrailleKeyCommand'); -goog.require('cvox.BrailleOverlayWidget'); -goog.require('cvox.ChromeVox'); -goog.require('cvox.ChromeVoxKbHandler'); -goog.require('cvox.CommandStore'); -goog.require('cvox.ContextMenuWidget'); -goog.require('cvox.DomPredicates'); -goog.require('cvox.DomUtil'); -goog.require('cvox.FocusUtil'); -goog.require('cvox.History'); -goog.require('cvox.KeyboardHelpWidget'); -goog.require('cvox.NodeSearchWidget'); -goog.require('cvox.PlatformUtil'); -goog.require('cvox.SearchWidget'); -goog.require('cvox.SelectWidget'); -goog.require('cvox.TypingEcho'); -goog.require('cvox.UserEventDetail'); -goog.require('goog.object'); - - -/** - * Initializes commands map. - * Initializes global members. - * @private - */ -cvox.ChromeVoxUserCommands.init_ = function() { - cvox.ChromeVoxKbHandler.commandHandler = function(commandName) { - var command = cvox.ChromeVoxUserCommands.commands[commandName]; - if (!command) - return undefined; - var history = cvox.History.getInstance(); - history.enterUserCommand(commandName); - var ret = command(); - history.exitUserCommand(commandName); - return ret; - }; - - if (cvox.ChromeVoxUserCommands.commands) { - return; - } else { - cvox.ChromeVoxUserCommands.commands = {}; - } - for (var cmd in cvox.CommandStore.CMD_WHITELIST) { - cvox.ChromeVoxUserCommands.commands[cmd] = - cvox.ChromeVoxUserCommands.createCommand_(cmd); - } -}; - - -/** - * @type {!Object<function(Object=): boolean>} - */ -cvox.ChromeVoxUserCommands.commands; - - -/** - * @type {boolean} - * TODO (clchen, dmazzoni): Implement syncing on click to avoid needing this. - */ -cvox.ChromeVoxUserCommands.wasMouseClicked = false; - - -/** - * @type {boolean} Flag to set whether or not certain user commands will be - * first dispatched to the underlying web page. Some commands (such as finding - * the next/prev structural element) may be better implemented by the web app - * than by ChromeVox. - * - * By default, this is enabled; however, for testing, we usually disable this to - * reduce flakiness caused by event timing issues. - * - * TODO (clchen, dtseng): Fix testing framework so that we don't need to turn - * this feature off at all. - */ -cvox.ChromeVoxUserCommands.enableCommandDispatchingToPage = true; - - -/** - * Handles any tab navigation by putting focus at the user's position. - * This function will create dummy nodes if there is nothing that is focusable - * at the current position. - * TODO (adu): This function is too long. We need to break it up into smaller - * helper functions. - * @return {boolean} True if default action should be taken. - * @private - */ -cvox.ChromeVoxUserCommands.handleTabAction_ = function() { - cvox.ChromeVox.tts.stop(); - - // If we are tabbing from an invalid location, prevent the default action. - // We pass the isFocusable function as a predicate to specify we only want to - // revert to focusable nodes. - if (!cvox.ChromeVox.navigationManager.resolve(cvox.DomUtil.isFocusable)) { - cvox.ChromeVox.navigationManager.setFocus(); - return false; - } - - // If the user is already focused on anything, nothing more needs to be done. - if (document.activeElement != document.body) { - return true; - } - - // Try to find something reasonable to focus on. - // Use selection if it exists because it means that the user has probably - // clicked with their mouse and we should respect their position. - // If there is no selection, then use the last known position based on - // NavigationManager's currentNode. - var anchorNode = null; - var focusNode = null; - var sel = window.getSelection(); - if (!cvox.ChromeVoxUserCommands.wasMouseClicked) { - sel = null; - } else { - cvox.ChromeVoxUserCommands.wasMouseClicked = false; - } - if (sel == null || sel.anchorNode == null || sel.focusNode == null) { - anchorNode = cvox.ChromeVox.navigationManager.getCurrentNode(); - focusNode = cvox.ChromeVox.navigationManager.getCurrentNode(); - } else { - anchorNode = sel.anchorNode; - focusNode = sel.focusNode; - } - - // See if we can set focus to either anchorNode or focusNode. - // If not, try the parents. Otherwise give up and create a dummy span. - if (anchorNode == null || focusNode == null) { - return true; - } - if (cvox.DomUtil.isFocusable(anchorNode)) { - anchorNode.focus(); - return true; - } - if (cvox.DomUtil.isFocusable(focusNode)) { - focusNode.focus(); - return true; - } - if (cvox.DomUtil.isFocusable(anchorNode.parentNode)) { - anchorNode.parentNode.focus(); - return true; - } - if (cvox.DomUtil.isFocusable(focusNode.parentNode)) { - focusNode.parentNode.focus(); - return true; - } - - // Insert and focus a dummy span immediately before the current position - // so that the default tab action will start off as close to the user's - // current position as possible. - var bestGuess = anchorNode; - var dummySpan = cvox.ChromeVoxUserCommands.createTabDummySpan_(); - bestGuess.parentNode.insertBefore(dummySpan, bestGuess); - dummySpan.focus(); - return true; -}; - - -/** - * If a lingering tab dummy span exists, remove it. - */ -cvox.ChromeVoxUserCommands.removeTabDummySpan = function() { - // Break the following line to get around a Chromium js linter warning. - // TODO(plundblad): Find a better solution. - var previousDummySpan = document.getElementById('ChromeVoxTabDummySpan'); - if (previousDummySpan && document.activeElement != previousDummySpan) { - previousDummySpan.parentNode.removeChild(previousDummySpan); - } -}; - - -/** - * Create a new tab dummy span. - * @return {Element} The dummy span element to be inserted. - * @private - */ -cvox.ChromeVoxUserCommands.createTabDummySpan_ = function() { - var span = document.createElement('span'); - span.id = 'ChromeVoxTabDummySpan'; - span.tabIndex = -1; - return span; -}; - - -/** - * @param {string} cmd The programmatic command name. - * @return {function(Object=): boolean} The callable command taking an optional - * args dictionary. - * @private - */ -cvox.ChromeVoxUserCommands.createCommand_ = function(cmd) { - return goog.bind(function(opt_kwargs) { - var cmdStruct = cvox.ChromeVoxUserCommands.lookupCommand_(cmd, opt_kwargs); - return cvox.ChromeVoxUserCommands.dispatchCommand_(cmdStruct); - }, cvox.ChromeVoxUserCommands); -}; - - -/** - * @param {Object} cmdStruct The command to do. - * @return {boolean} False to prevent the default action. True otherwise. - * @private - */ -cvox.ChromeVoxUserCommands.dispatchCommand_ = function(cmdStruct) { - if (cvox.Widget.isActive()) { - return true; - } - if (!cvox.PlatformUtil.matchesPlatform(cmdStruct.platformFilter) || - (cmdStruct.skipInput && cvox.FocusUtil.isFocusInTextInputField())) { - return true; - } - // Handle dispatching public command events - if (cvox.ChromeVoxUserCommands.enableCommandDispatchingToPage && - (cvox.UserEventDetail.JUMP_COMMANDS.indexOf(cmdStruct.command) != -1)) { - var detail = new cvox.UserEventDetail({command: cmdStruct.command}); - var evt = detail.createEventObject(); - var currentNode = cvox.ChromeVox.navigationManager.getCurrentNode(); - if (!currentNode) { - currentNode = document.body; - } - currentNode.dispatchEvent(evt); - return false; - } - // Not a public command; act on this command directly. - return cvox.ChromeVoxUserCommands.doCommand_(cmdStruct); -}; - - -/** - * @param {Object} cmdStruct The command to do. - * @return {boolean} False to prevent the default action. True otherwise. - * @private - */ -cvox.ChromeVoxUserCommands.doCommand_ = function(cmdStruct) { - if (cvox.Widget.isActive()) { - return true; - } - - if (!cvox.PlatformUtil.matchesPlatform(cmdStruct.platformFilter) || - (cmdStruct.skipInput && cvox.FocusUtil.isFocusInTextInputField())) { - return true; - } - - if (cmdStruct.disallowOOBE && document.URL.match(/^chrome:\/\/oobe/i)) { - return true; - } - - var cmd = cmdStruct.command; - - if (!cmdStruct.allowEvents) { - cvox.ChromeVoxEventSuspender.enterSuspendEvents(); - } - - if (cmdStruct.disallowContinuation) { - cvox.ChromeVox.navigationManager.stopReading(true); - } - - if (cmdStruct.forward) { - cvox.ChromeVox.navigationManager.setReversed(false); - } else if (cmdStruct.backward) { - cvox.ChromeVox.navigationManager.setReversed(true); - } - - if (cmdStruct.findNext) { - cmd = 'find'; - cmdStruct.announce = true; - } - - var errorMsg = ''; - var prefixMsg = ''; - var ret = false; - switch (cmd) { - case 'handleTab': - case 'handleTabPrev': - ret = cvox.ChromeVoxUserCommands.handleTabAction_(); - break; - case 'forward': - case 'backward': - ret = !cvox.ChromeVox.navigationManager.navigate(); - break; - case 'right': - case 'left': - cvox.ChromeVox.navigationManager.subnavigate(); - break; - case 'find': - if (!cmdStruct.findNext) { - throw 'Invalid find command.'; - } - var NodeInfoStruct = cvox.CommandStore.NODE_INFO_MAP[cmdStruct.findNext]; - var predicateName = NodeInfoStruct.predicate; - var predicate = cvox.DomPredicates[predicateName]; - var error = ''; - var wrap = ''; - if (cmdStruct.forward) { - wrap = Msgs.getMsg('wrapped_to_top'); - error = Msgs.getMsg(NodeInfoStruct.forwardError); - } else if (cmdStruct.backward) { - wrap = Msgs.getMsg('wrapped_to_bottom'); - error = Msgs.getMsg(NodeInfoStruct.backwardError); - } - var found = null; - var status = cmdStruct.status || cvox.UserEventDetail.Status.PENDING; - var resultNode = cmdStruct.resultNode || null; - switch (status) { - case cvox.UserEventDetail.Status.SUCCESS: - if (resultNode) { - cvox.ChromeVox.navigationManager.updateSelToArbitraryNode( - resultNode, true); - } - break; - case cvox.UserEventDetail.Status.FAILURE: - prefixMsg = error; - break; - default: - found = cvox.ChromeVox.navigationManager.findNext( - predicate, predicateName); - if (!found) { - cvox.ChromeVox.navigationManager.saveSel(); - prefixMsg = wrap; - cvox.ChromeVox.navigationManager.syncToBeginning(); - cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.WRAP); - found = cvox.ChromeVox.navigationManager.findNext( - predicate, predicateName, true); - if (!found) { - prefixMsg = error; - cvox.ChromeVox.navigationManager.restoreSel(); - } - } - break; - } - // NavigationManager performs announcement inside of frames when finding. - if (found && found.start.node.tagName == 'IFRAME') { - cmdStruct.announce = false; - } - break; - // TODO(stoarca): Bad naming. Should be less instead of previous. - case 'previousGranularity': - cvox.ChromeVox.navigationManager.makeLessGranular(true); - prefixMsg = cvox.ChromeVox.navigationManager.getGranularityMsg(); - break; - case 'nextGranularity': - cvox.ChromeVox.navigationManager.makeMoreGranular(true); - prefixMsg = cvox.ChromeVox.navigationManager.getGranularityMsg(); - break; - - case 'previousCharacter': - cvox.ChromeVox.navigationManager.navigate( - false, cvox.NavigationShifter.GRANULARITIES.CHARACTER); - break; - case 'nextCharacter': - cvox.ChromeVox.navigationManager.navigate( - false, cvox.NavigationShifter.GRANULARITIES.CHARACTER); - break; - - case 'previousWord': - cvox.ChromeVox.navigationManager.navigate( - false, cvox.NavigationShifter.GRANULARITIES.WORD); - break; - case 'nextWord': - cvox.ChromeVox.navigationManager.navigate( - false, cvox.NavigationShifter.GRANULARITIES.WORD); - break; - - case 'previousSentence': - cvox.ChromeVox.navigationManager.navigate( - false, cvox.NavigationShifter.GRANULARITIES.SENTENCE); - break; - case 'nextSentence': - cvox.ChromeVox.navigationManager.navigate( - false, cvox.NavigationShifter.GRANULARITIES.SENTENCE); - break; - - case 'previousLine': - cvox.ChromeVox.navigationManager.navigate( - false, cvox.NavigationShifter.GRANULARITIES.LINE); - break; - case 'nextLine': - cvox.ChromeVox.navigationManager.navigate( - false, cvox.NavigationShifter.GRANULARITIES.LINE); - break; - - case 'previousObject': - cvox.ChromeVox.navigationManager.navigate( - false, cvox.NavigationShifter.GRANULARITIES.OBJECT); - break; - case 'nextObject': - cvox.ChromeVox.navigationManager.navigate( - false, cvox.NavigationShifter.GRANULARITIES.OBJECT); - break; - - case 'previousGroup': - cvox.ChromeVox.navigationManager.navigate( - false, cvox.NavigationShifter.GRANULARITIES.GROUP); - break; - case 'nextGroup': - cvox.ChromeVox.navigationManager.navigate( - false, cvox.NavigationShifter.GRANULARITIES.GROUP); - break; - - case 'previousRow': - case 'previousCol': - // Fold these commands to their "next" equivalents since we already set - // isReversed above. - cmd = cmd == 'previousRow' ? 'nextRow' : 'nextCol'; - case 'nextRow': - case 'nextCol': - cvox.ChromeVox.navigationManager.performAction('enterShifterSilently'); - cvox.ChromeVox.navigationManager.performAction(cmd); - break; - - case 'moveToStartOfLine': - case 'moveToEndOfLine': - cvox.ChromeVox.navigationManager.setGranularity( - cvox.NavigationShifter.GRANULARITIES.LINE); - cvox.ChromeVox.navigationManager.sync(); - cvox.ChromeVox.navigationManager.collapseSelection(); - break; - - case 'readFromHere': - cvox.ChromeVox.navigationManager.setGranularity( - cvox.NavigationShifter.GRANULARITIES.OBJECT, true, true); - cvox.ChromeVox.navigationManager.startReading(cvox.QueueMode.FLUSH); - break; - case 'cycleTypingEcho': - cvox.ChromeVox.host.sendToBackgroundPage({ - 'target': 'Prefs', - 'action': 'setPref', - 'pref': 'typingEcho', - 'value': cvox.TypingEcho.cycle(cvox.ChromeVox.typingEcho), - 'announce': true - }); - break; - case 'jumpToTop': - case cvox.BrailleKeyCommand.TOP: - cvox.ChromeVox.navigationManager.syncToBeginning(); - break; - case 'jumpToBottom': - case cvox.BrailleKeyCommand.BOTTOM: - cvox.ChromeVox.navigationManager.syncToBeginning(); - break; - case 'stopSpeech': - cvox.ChromeVox.navigationManager.stopReading(true); - break; - case 'toggleKeyboardHelp': - cvox.KeyboardHelpWidget.getInstance().toggle(); - break; - case 'help': - cvox.ChromeVox.tts.stop(); - cvox.ChromeVox.host.sendToBackgroundPage( - {'target': 'HelpDocs', 'action': 'open'}); - break; - case 'contextMenu': - // Move this logic to a central dispatching class if it grows any bigger. - var node = cvox.ChromeVox.navigationManager.getCurrentNode(); - if (node.tagName == 'SELECT' && !node.multiple) { - new cvox.SelectWidget(node).show(); - } else { - var contextMenuWidget = new cvox.ContextMenuWidget(); - contextMenuWidget.toggle(); - } - break; - case 'showBookmarkManager': - // TODO(stoarca): Should this have tts.stop()?? - cvox.ChromeVox.host.sendToBackgroundPage( - {'target': 'BookmarkManager', 'action': 'open'}); - break; - case 'showOptionsPage': - cvox.ChromeVox.tts.stop(); - cvox.ChromeVox.host.sendToBackgroundPage( - {'target': 'Options', 'action': 'open'}); - break; - case 'showKbExplorerPage': - cvox.ChromeVox.tts.stop(); - cvox.ChromeVox.host.sendToBackgroundPage( - {'target': 'KbExplorer', 'action': 'open'}); - break; - case 'readLinkURL': - var activeElement = document.activeElement; - var currentSelectionAnchor = window.getSelection().anchorNode; - - var url = ''; - if (activeElement.tagName == 'A') { - url = cvox.DomUtil.getLinkURL(activeElement); - } else if (currentSelectionAnchor) { - url = cvox.DomUtil.getLinkURL(currentSelectionAnchor.parentNode); - } - - if (url != '') { - cvox.ChromeVox.tts.speak(url, cvox.QueueMode.QUEUE); - } else { - cvox.ChromeVox.tts.speak( - Msgs.getMsg('no_url_found'), cvox.QueueMode.QUEUE); - } - break; - case 'readCurrentTitle': - cvox.ChromeVox.tts.speak(document.title, cvox.QueueMode.QUEUE); - break; - case 'readCurrentURL': - cvox.ChromeVox.tts.speak(document.URL, cvox.QueueMode.QUEUE); - break; - case 'performDefaultAction': - if (cvox.DomPredicates.linkPredicate([document.activeElement])) { - if (cvox.DomUtil.isInternalLink(document.activeElement)) { - // First, sync our selection to the destination of the internal link. - cvox.DomUtil.syncInternalLink(document.activeElement); - // Now, sync our selection based on the current granularity. - cvox.ChromeVox.navigationManager.sync(); - // Announce this new selection. - cmdStruct.announce = true; - } - } - break; - case 'forceClickOnCurrentItem': - prefixMsg = Msgs.getMsg('element_clicked'); - var targetNode = cvox.ChromeVox.navigationManager.getCurrentNode(); - cvox.DomUtil.clickElem(targetNode, false, false); - break; - case 'forceDoubleClickOnCurrentItem': - prefixMsg = Msgs.getMsg('element_double_clicked'); - var targetNode = cvox.ChromeVox.navigationManager.getCurrentNode(); - cvox.DomUtil.clickElem(targetNode, false, false, true); - break; - case 'toggleChromeVox': - cvox.ChromeVox.host.sendToBackgroundPage({ - 'target': 'Prefs', - 'action': 'setPref', - 'pref': 'active', - 'value': !cvox.ChromeVox.isActive - }); - break; - case 'toggleChromeVoxVersion': - case 'showNextUpdatePage': - cvox.ChromeVox.host.sendToBackgroundPage( - {'target': 'next', 'action': 'onCommand', 'command': cmd}); - break; - case 'fullyDescribe': - var descs = cvox.ChromeVox.navigationManager.getFullDescription(); - cvox.ChromeVox.navigationManager.speakDescriptionArray( - descs, cvox.QueueMode.FLUSH, null); - break; - case 'speakTimeAndDate': - var dateTime = new Date(); - cvox.ChromeVox.tts.speak( - dateTime.toLocaleTimeString() + ', ' + dateTime.toLocaleDateString(), - cvox.QueueMode.QUEUE); - break; - case 'toggleSelection': - var selState = cvox.ChromeVox.navigationManager.togglePageSel(); - prefixMsg = Msgs.getMsg(selState ? 'begin_selection' : 'end_selection'); - break; - case 'startHistoryRecording': - cvox.History.getInstance().startRecording(); - break; - case 'stopHistoryRecording': - cvox.History.getInstance().stopRecording(); - break; - case 'toggleBrailleCaptions': - cvox.ChromeVox.host.sendToBackgroundPage({ - 'target': 'Prefs', - 'action': 'setPref', - 'pref': 'brailleCaptions', - 'value': !cvox.BrailleOverlayWidget.getInstance().isActive() - }); - break; - - // Table actions. - case 'goToFirstCell': - case 'goToLastCell': - case 'goToRowFirstCell': - case 'goToRowLastCell': - case 'goToColFirstCell': - case 'goToColLastCell': - case 'announceHeaders': - case 'speakTableLocation': - case 'exitShifterContent': - if (!cvox.DomPredicates.tablePredicate(cvox.DomUtil.getAncestors( - cvox.ChromeVox.navigationManager.getCurrentNode()))) { - errorMsg = 'not_inside_table'; - } else if (!cvox.ChromeVox.navigationManager.performAction(cmd)) { - errorMsg = 'not_in_table_mode'; - } - break; - - // Generic actions. - case 'enterShifter': - case 'exitShifter': - cvox.ChromeVox.navigationManager.performAction(cmd); - break; - // TODO(stoarca): Code repetition. - case 'decreaseTtsRate': - // TODO(stoarca): This function name is way too long. - cvox.ChromeVox.tts.increaseOrDecreaseProperty( - cvox.AbstractTts.RATE, false); - break; - case 'increaseTtsRate': - cvox.ChromeVox.tts.increaseOrDecreaseProperty( - cvox.AbstractTts.RATE, true); - break; - case 'decreaseTtsPitch': - cvox.ChromeVox.tts.increaseOrDecreaseProperty( - cvox.AbstractTts.PITCH, false); - break; - case 'increaseTtsPitch': - cvox.ChromeVox.tts.increaseOrDecreaseProperty( - cvox.AbstractTts.PITCH, true); - break; - case 'decreaseTtsVolume': - cvox.ChromeVox.tts.increaseOrDecreaseProperty( - cvox.AbstractTts.VOLUME, false); - break; - case 'increaseTtsVolume': - cvox.ChromeVox.tts.increaseOrDecreaseProperty( - cvox.AbstractTts.VOLUME, true); - break; - case 'cyclePunctuationEcho': - cvox.ChromeVox.host.sendToBackgroundPage( - {'target': 'TTS', 'action': 'cyclePunctuationEcho'}); - break; - - case 'toggleStickyMode': - cvox.ChromeVox.host.sendToBackgroundPage({ - 'target': 'Prefs', - 'action': 'setPref', - 'pref': 'sticky', - 'value': !cvox.ChromeVox.isStickyPrefOn, - 'announce': true - }); - break; - case 'toggleKeyPrefix': - cvox.ChromeVox.keyPrefixOn = !cvox.ChromeVox.keyPrefixOn; - break; - case 'passThroughMode': - cvox.ChromeVox.passThroughMode = true; - cvox.ChromeVox.tts.speak( - Msgs.getMsg('pass_through_key'), cvox.QueueMode.QUEUE); - break; - case 'toggleSearchWidget': - cvox.SearchWidget.getInstance().toggle(); - break; - - case 'toggleEarcons': - prefixMsg = cvox.ChromeVox.earcons.toggle() ? Msgs.getMsg('earcons_on') : - Msgs.getMsg('earcons_off'); - break; - - case 'showHeadingsList': - case 'showLinksList': - case 'showFormsList': - case 'showTablesList': - case 'showLandmarksList': - if (!cmdStruct.nodeList) { - break; - } - var nodeListStruct = cvox.CommandStore.NODE_INFO_MAP[cmdStruct.nodeList]; - - cvox.NodeSearchWidget - .create( - nodeListStruct.typeMsg, - cvox.DomPredicates[nodeListStruct.predicate]) - .show(); - break; - - case 'openLongDesc': - var currentNode = cvox.ChromeVox.navigationManager.getCurrentNode(); - if (cvox.DomUtil.hasLongDesc(currentNode)) { - cvox.ChromeVox.host.sendToBackgroundPage({ - 'target': 'OpenTab', - 'url': currentNode.longDesc // Use .longDesc instead of getAttribute - // since we want Chrome to convert the - // longDesc to an absolute URL. - }); - } else { - cvox.ChromeVox.tts.speak( - Msgs.getMsg('no_long_desc'), cvox.QueueMode.FLUSH, - cvox.AbstractTts.PERSONALITY_ANNOTATION); - } - break; - - case 'pauseAllMedia': - var videos = document.getElementsByTagName('VIDEO'); - for (var i = 0, mediaElem; mediaElem = videos[i]; i++) { - mediaElem.pause(); - } - var audios = document.getElementsByTagName('AUDIO'); - for (var i = 0, mediaElem; mediaElem = audios[i]; i++) { - mediaElem.pause(); - } - break; - - // Braille specific commands. - case cvox.BrailleKeyCommand.ROUTING: - var braille = cmdStruct.content; - if (braille) { - cvox.BrailleUtil.click(braille, cmdStruct.event.displayPosition); - } - break; - case cvox.BrailleKeyCommand.PAN_LEFT: - case cvox.BrailleKeyCommand.LINE_UP: - case cvox.BrailleKeyCommand.PAN_RIGHT: - case cvox.BrailleKeyCommand.LINE_DOWN: - // TODO(dtseng, plundblad): This needs to sync to the last pan position - // after line up/pan left and move the display to the far right on the - // line in case the synced to node is longer than one display line. - // Should also work with all widgets. - cvox.ChromeVox.navigationManager.navigate( - false, cvox.NavigationShifter.GRANULARITIES.LINE); - break; - - case 'debug': - // TODO(stoarca): This doesn't belong here. - break; - - case 'nop': - break; - default: - throw 'Command behavior not defined: ' + cmd; - } - - if (errorMsg != '') { - cvox.ChromeVox.tts.speak( - Msgs.getMsg(errorMsg), cvox.QueueMode.FLUSH, - cvox.AbstractTts.PERSONALITY_ANNOTATION); - } else if (cvox.ChromeVox.navigationManager.isReading()) { - if (cmdStruct.disallowContinuation) { - cvox.ChromeVox.navigationManager.stopReading(true); - } else if (cmd != 'readFromHere') { - cvox.ChromeVox.navigationManager.skip(); - } - } else { - if (cmdStruct.announce) { - cvox.ChromeVox.navigationManager.finishNavCommand(prefixMsg); - } - } - if (!cmdStruct.allowEvents) { - cvox.ChromeVoxEventSuspender.exitSuspendEvents(); - } - return !!cmdStruct.doDefault || ret; -}; - - -/** - * Default handler for public user commands that are dispatched to the web app - * first so that the web developer can handle these commands instead of - * ChromeVox if they decide they can do a better job than the default algorithm. - * - * @param {Object} cvoxUserEvent The cvoxUserEvent to handle. - */ -cvox.ChromeVoxUserCommands.handleChromeVoxUserEvent = function(cvoxUserEvent) { - var detail = new cvox.UserEventDetail(cvoxUserEvent.detail); - if (detail.command) { - cvox.ChromeVoxUserCommands.doCommand_( - cvox.ChromeVoxUserCommands.lookupCommand_(detail.command, detail)); - } -}; - - -/** - * Returns an object containing information about the given command. - * @param {string} cmd The name of the command. - * @param {Object=} opt_kwargs Optional key values to add to the command - * structure. - * @return {Object} A key value mapping. - * @private - */ -cvox.ChromeVoxUserCommands.lookupCommand_ = function(cmd, opt_kwargs) { - var cmdStruct = cvox.CommandStore.CMD_WHITELIST[cmd]; - if (!cmdStruct) { - throw 'Invalid command: ' + cmd; - } - cmdStruct = goog.object.clone(cmdStruct); - cmdStruct.command = cmd; - if (opt_kwargs) { - goog.object.extend(cmdStruct, opt_kwargs); - } - return cmdStruct; -}; - - -cvox.ChromeVoxUserCommands.init_();
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/user_event_detail.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/user_event_detail.js deleted file mode 100644 index b8d759d..0000000 --- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/user_event_detail.js +++ /dev/null
@@ -1,171 +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. - -/** - * @fileoverview The ChromeVox User Event Detail object. - * - * This is the detail object for a CustomEvent that ChromeVox sends to the - * current node in the DOM when the user wants to perform a ChromeVox action - * that could potentially be handled better by the underlying web app. - * - * ChromeVox events are sent with status "PENDING" and an action that maps to - * the command list in ChromeVoxUserCommands. - * - * If a web app wishes to handle the action, it can perform the action then set - * the status of the event to either "SUCCESS" or "FAILURE". - * - * When the event bubbles back up to the document, ChromeVox will process it. - * If the status is "PENDING", ChromeVox will perform the action itself. - * If the status is "FAILURE", ChromeVox will speak the associated error message - * for that action. (For example: "No next heading.") - * If the status is "SUCCESS", then ChromeVox will check to see if an associated - * resultNode is added to the event. If this node exists, then ChromeVox will - * treat this node as the result of the action and sync/speak it as if it had - * gotten to this node through ChromeVox's default algorithm. If this field is - * left as null, then ChromeVox assumes that the web app has already handled - * speaking/syncing to the result and will do nothing more for this action. - * - */ - -goog.provide('cvox.UserEventDetail'); - -goog.require('cvox.ChromeVox'); - - - -/** - * Enables web apps to use its own algorithms to handle certain ChromeVox - * actions where the web app may be able to do a better job than the default - * ChromeVox algorithms because it has much more information about its own - * content and functionality. - * @constructor - * - * @param {Object<{command: (string), - * status: (undefined|string), - * resultNode: (undefined|Node), - * customCommand: (undefined|string) - * }>} detailObj - * command: The ChromeVox UserCommand to be performed. - * status: The status of the event. If the status is left at PENDING, ChromeVox - * will run its default algorithm for performing the action. Otherwise, it means - * the underlying web app has performed the action itself. If the status is set - * to FAILURE, ChromeVox will speak the default error message for this command - * to the user. - * resultNode: The result of the action if it has been performed and there is a - * result. If this is a valid node and the status is set to SUCCESS, ChromeVox - * will sync to this node and speak it. - * customCommand: The custom command to be performed. This is designed to allow - * web apps / other extensions to define custom actions that can be shown in - * ChromeVox (for example, inside the context menu) and then dispatched back to - * the page. - */ -cvox.UserEventDetail = function(detailObj) { - /** - * The category of command that should be performed. - * @type {string} - */ - this.category = ''; - - /** - * The user command that should be performed. - * @type {string} - */ - this.command = ''; - if (cvox.UserEventDetail.JUMP_COMMANDS.indexOf(detailObj.command) != -1) { - this.command = detailObj.command; - this.category = cvox.UserEventDetail.Category.JUMP; - } - - /** - * The custom command that should be performed. - * @type {string} - */ - this.customCommand = ''; - if (detailObj.customCommand) { - this.customCommand = detailObj.customCommand; - this.category = cvox.UserEventDetail.Category.CUSTOM; - } - - /** - * The status of the event. - * @type {string} - */ - this.status = cvox.UserEventDetail.Status.PENDING; - switch (detailObj.status) { - case cvox.UserEventDetail.Status.SUCCESS: - this.status = cvox.UserEventDetail.Status.SUCCESS; - break; - case cvox.UserEventDetail.Status.FAILURE: - this.status = cvox.UserEventDetail.Status.FAILURE; - break; - } - - /** - * The result of performing the command. - * - * @type {Node} - */ - this.resultNode = null; - if (detailObj.resultNode && - cvox.DomUtil.isAttachedToDocument(detailObj.resultNode)) { - this.resultNode = detailObj.resultNode; - } -}; - -/** - * Category of the user event. This is the event name that the web app should - * be listening for. - * @enum {string} - */ -cvox.UserEventDetail.Category = { - JUMP: 'ATJumpEvent', - CUSTOM: 'ATCustomEvent' -}; - -/** - * Status of the cvoxUserEvent. Events start off as PENDING. If the underlying - * web app has handled this event, it should set the event to either SUCCESS or - * FAILURE to prevent ChromeVox from trying to redo the same command. - * @enum {string} - */ -cvox.UserEventDetail.Status = { - PENDING: 'PENDING', - SUCCESS: 'SUCCESS', - FAILURE: 'FAILURE' -}; - - -/** - * List of commands that are dispatchable to the page. - * - * @type {Array} - */ -// TODO (clchen): Integrate this with command_store.js. -cvox.UserEventDetail.JUMP_COMMANDS = [ - 'nextCheckbox', 'previousCheckbox', 'nextRadio', 'previousRadio', - 'nextSlider', 'previousSlider', 'nextGraphic', 'previousGraphic', - 'nextButton', 'previousButton', 'nextComboBox', 'previousComboBox', - 'nextEditText', 'previousEditText', 'nextHeading', 'previousHeading', - 'nextHeading1', 'previousHeading1', 'nextHeading2', 'previousHeading2', - 'nextHeading3', 'previousHeading3', 'nextHeading4', 'previousHeading4', - 'nextHeading5', 'previousHeading5', 'nextHeading6', 'previousHeading6', - 'nextLink', 'previousLink', 'nextMath', 'previousMath', - 'nextTable', 'previousTable', 'nextList', 'previousList', - 'nextListItem', 'previousListItem', 'nextFormField', 'previousFormField', - 'nextLandmark', 'previousLandmark', 'nextSection', 'previousSection', - 'nextControl', 'previousControl' -]; - -/** - * Creates a custom event object from the UserEventDetail. - * - * @return {!Event} A custom event object that can be dispatched to the page. - */ -cvox.UserEventDetail.prototype.createEventObject = function() { - // We use CustomEvent so that it will go all the way to the page and come back - // into the ChromeVox context correctly. - var evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(this.category, true, true, this); - return evt; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/aria_util.js b/chrome/browser/resources/chromeos/chromevox/common/aria_util.js deleted file mode 100644 index 06b7389..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/aria_util.js +++ /dev/null
@@ -1,977 +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. - -/** - * @fileoverview A collection of JavaScript utilities used to simplify working - * with ARIA (http://www.w3.org/TR/wai-aria). - */ - - -goog.provide('cvox.AriaUtil'); -goog.require('cvox.AbstractEarcons'); -goog.require('cvox.ChromeVox'); -goog.require('cvox.NodeState'); -goog.require('cvox.NodeStateUtil'); - - -/** - * Create the namespace - * @constructor - */ -cvox.AriaUtil = function() {}; - - -/** - * A mapping from ARIA role names to their message ids. - * Note: If you are adding a new mapping, the new message identifier needs a - * corresponding braille message. For example, a message id 'tag_button' - * requires another message 'tag_button_brl' within messages.js. - * @type {Object<string>} - */ -cvox.AriaUtil.WIDGET_ROLE_TO_NAME = { - 'alert': 'role_alert', - 'alertdialog': 'role_alertdialog', - 'button': 'role_button', - 'checkbox': 'role_checkbox', - 'columnheader': 'role_columnheader', - 'combobox': 'role_combobox', - 'dialog': 'role_dialog', - 'grid': 'role_grid', - 'gridcell': 'role_gridcell', - 'link': 'role_link', - 'listbox': 'role_listbox', - 'log': 'role_log', - 'marquee': 'role_marquee', - 'menu': 'role_menu', - 'menubar': 'role_menubar', - 'menuitem': 'role_menuitem', - 'menuitemcheckbox': 'role_menuitemcheckbox', - 'menuitemradio': 'role_menuitemradio', - 'option': 'role_option', - 'progressbar': 'role_progressbar', - 'radio': 'role_radio', - 'radiogroup': 'role_radiogroup', - 'rowheader': 'role_rowheader', - 'scrollbar': 'role_scrollbar', - 'slider': 'role_slider', - 'spinbutton': 'role_spinbutton', - 'status': 'role_status', - 'tab': 'role_tab', - 'tablist': 'role_tablist', - 'tabpanel': 'role_tabpanel', - 'textbox': 'role_textbox', - 'timer': 'role_timer', - 'toolbar': 'role_toolbar', - 'tooltip': 'role_tooltip', - 'treeitem': 'role_treeitem' -}; - - -/** - * Note: If you are adding a new mapping, the new message identifier needs a - * corresponding braille message. For example, a message id 'tag_button' - * requires another message 'tag_button_brl' within messages.js. - * @type {Object<string>} - */ -cvox.AriaUtil.STRUCTURE_ROLE_TO_NAME = { - 'article': 'role_article', - 'application': 'role_application', - 'banner': 'role_banner', - 'columnheader': 'role_columnheader', - 'complementary': 'role_complementary', - 'contentinfo': 'role_contentinfo', - 'definition': 'role_definition', - 'directory': 'role_directory', - 'document': 'role_document', - 'form': 'role_form', - 'group': 'role_group', - 'heading': 'role_heading', - 'img': 'role_img', - 'list': 'role_list', - 'listitem': 'role_listitem', - 'main': 'role_main', - 'math': 'role_math', - 'navigation': 'role_navigation', - 'note': 'role_note', - 'region': 'role_region', - 'rowheader': 'role_rowheader', - 'search': 'role_search', - 'separator': 'role_separator' -}; - - -/** - * @type {Array<Object>} - */ -cvox.AriaUtil.ATTRIBUTE_VALUE_TO_STATUS = [ - { - name: 'aria-autocomplete', - values: { - 'inline': 'aria_autocomplete_inline', - 'list': 'aria_autocomplete_list', - 'both': 'aria_autocomplete_both' - } - }, - { - name: 'aria-checked', - values: { - 'true': 'checked_true', - 'false': 'checked_false', - 'mixed': 'checked_mixed' - } - }, - {name: 'aria-disabled', values: {'true': 'aria_disabled_true'}}, { - name: 'aria-expanded', - values: {'true': 'aria_expanded_true', 'false': 'aria_expanded_false'} - }, - { - name: 'aria-invalid', - values: { - 'true': 'aria_invalid_true', - 'grammar': 'aria_invalid_grammar', - 'spelling': 'aria_invalid_spelling' - } - }, - {name: 'aria-multiline', values: {'true': 'aria_multiline_true'}}, - {name: 'aria-multiselectable', values: {'true': 'aria_multiselectable_true'}}, - { - name: 'aria-pressed', - values: { - 'true': 'aria_pressed_true', - 'false': 'aria_pressed_false', - 'mixed': 'aria_pressed_mixed' - } - }, - {name: 'aria-readonly', values: {'true': 'aria_readonly_true'}}, - {name: 'aria-required', values: {'true': 'aria_required_true'}}, { - name: 'aria-selected', - values: {'true': 'aria_selected_true', 'false': 'aria_selected_false'} - } -]; - - -/** - * Checks if a node should be treated as a hidden node because of its ARIA - * markup. - * - * @param {Node} targetNode The node to check. - * @return {boolean} True if the targetNode should be treated as hidden. - */ -cvox.AriaUtil.isHiddenRecursive = function(targetNode) { - if (cvox.AriaUtil.isHidden(targetNode)) { - return true; - } - var parent = targetNode.parentElement; - while (parent) { - if ((parent.getAttribute('aria-hidden') == 'true') && - (parent.getAttribute('chromevoxignoreariahidden') != 'true')) { - return true; - } - parent = parent.parentElement; - } - return false; -}; - - -/** - * Checks if a node should be treated as a hidden node because of its ARIA - * markup. Does not check parents, so if you need to know if this is a - * descendant of a hidden node, call isHiddenRecursive. - * - * @param {Node} targetNode The node to check. - * @return {boolean} True if the targetNode should be treated as hidden. - */ -cvox.AriaUtil.isHidden = function(targetNode) { - if (!targetNode) { - return true; - } - if (targetNode.getAttribute) { - if ((targetNode.getAttribute('aria-hidden') == 'true') && - (targetNode.getAttribute('chromevoxignoreariahidden') != 'true')) { - return true; - } - } - return false; -}; - - -/** - * Checks if a node should be treated as a visible node because of its ARIA - * markup, regardless of whatever other styling/attributes it may have. - * It is possible to force a node to be visible by setting aria-hidden to - * false. - * - * @param {Node} targetNode The node to check. - * @return {boolean} True if the targetNode should be treated as visible. - */ -cvox.AriaUtil.isForcedVisibleRecursive = function(targetNode) { - var node = targetNode; - while (node) { - if (node.getAttribute) { - // Stop and return the result based on the closest node that has - // aria-hidden set. - if (node.hasAttribute('aria-hidden') && - (node.getAttribute('chromevoxignoreariahidden') != 'true')) { - return node.getAttribute('aria-hidden') == 'false'; - } - } - node = node.parentElement; - } - return false; -}; - - -/** - * Checks if a node should be treated as a leaf node because of its ARIA - * markup. Does not check recursively, and does not check isControlWidget. - * - * @param {Element} targetElement The node to check. - * @return {boolean} True if the targetNode should be treated as a leaf node. - */ -cvox.AriaUtil.isLeafElement = function(targetElement) { - var role = targetElement.getAttribute('role'); - return role == 'img' || role == 'progressbar'; -}; - - -/** - * Determines whether or not a node is or is the descendant of a node - * with a particular role. - * - * @param {Node} node The node to be checked. - * @param {string} roleName The role to check for. - * @return {boolean} True if the node or one of its ancestor has the specified - * role. - */ -cvox.AriaUtil.isDescendantOfRole = function(node, roleName) { - while (node) { - if (roleName && node && (node.getAttribute('role') == roleName)) { - return true; - } - node = node.parentNode; - } - return false; -}; - - -/** - * Helper function to return the role name message identifier for a role. - * @param {string} role The role. - * @return {?string} The role name message identifier. - * @private - */ -cvox.AriaUtil.getRoleNameMsgForRole_ = function(role) { - var msgId = cvox.AriaUtil.WIDGET_ROLE_TO_NAME[role]; - if (!msgId) { - return null; - } - return msgId; -}; - -/** - * Returns true is the node is any kind of button. - * - * @param {Node} node The node to check. - * @return {boolean} True if the node is a button. - */ -cvox.AriaUtil.isButton = function(node) { - var role = cvox.AriaUtil.getRoleAttribute(node); - if (role == 'button') { - return true; - } - if (node.tagName == 'BUTTON') { - return true; - } - if (node.tagName == 'INPUT') { - return ( - node.type == 'submit' || node.type == 'reset' || node.type == 'button'); - } - return false; -}; - -/** - * Returns a role message identifier for a node. - * For a localized string, see cvox.AriaUtil.getRoleName. - * @param {Node} targetNode The node to get the role name for. - * @return {string} The role name message identifier for the targetNode. - */ -cvox.AriaUtil.getRoleNameMsg = function(targetNode) { - var roleName; - if (targetNode && targetNode.getAttribute) { - var role = cvox.AriaUtil.getRoleAttribute(targetNode); - - // Special case for pop-up buttons. - if (targetNode.getAttribute('aria-haspopup') == 'true' && - cvox.AriaUtil.isButton(targetNode)) { - return 'role_popup_button'; - } - - if (role) { - roleName = cvox.AriaUtil.getRoleNameMsgForRole_(role); - if (!roleName) { - roleName = cvox.AriaUtil.STRUCTURE_ROLE_TO_NAME[role]; - } - } - - // To a user, a menu item within a menu bar is called a "menu"; - // any other menu item is called a "menu item". - // - // TODO(deboer): This block feels like a hack. dmazzoni suggests - // using css-like syntax for names. Investigate further if - // we need more of these hacks. - if (role == 'menuitem') { - var container = targetNode.parentElement; - while (container) { - if (container.getAttribute && - (cvox.AriaUtil.getRoleAttribute(container) == 'menu' || - cvox.AriaUtil.getRoleAttribute(container) == 'menubar')) { - break; - } - container = container.parentElement; - } - if (container && cvox.AriaUtil.getRoleAttribute(container) == 'menubar') { - roleName = cvox.AriaUtil.getRoleNameMsgForRole_('menu'); - } // else roleName is already 'Menu item', no need to change it. - } - } - if (!roleName) { - roleName = ''; - } - return roleName; -}; - -/** - * Returns a string to be presented to the user that identifies what the - * targetNode's role is. - * - * @param {Node} targetNode The node to get the role name for. - * @return {string} The role name for the targetNode. - */ -cvox.AriaUtil.getRoleName = function(targetNode) { - var roleMsg = cvox.AriaUtil.getRoleNameMsg(targetNode); - var roleName = Msgs.getMsg(roleMsg); - var role = cvox.AriaUtil.getRoleAttribute(targetNode); - if ((role == 'heading') && (targetNode.hasAttribute('aria-level'))) { - roleName += ' ' + targetNode.getAttribute('aria-level'); - } - return roleName ? roleName : ''; -}; - -/** - * Returns a string that gives information about the state of the targetNode. - * - * @param {Node} targetNode The node to get the state information for. - * @param {boolean} primary Whether this is the primary node we're - * interested in, where we might want extra information - as - * opposed to an ancestor, where we might be more brief. - * @return {cvox.NodeState} The status information about the node. - */ -cvox.AriaUtil.getStateMsgs = function(targetNode, primary) { - var state = []; - if (!targetNode || !targetNode.getAttribute) { - return state; - } - - for (var i = 0, attr; attr = cvox.AriaUtil.ATTRIBUTE_VALUE_TO_STATUS[i]; - i++) { - var value = targetNode.getAttribute(attr.name); - var msgId = attr.values[value]; - if (msgId) { - state.push([msgId]); - } - } - if (targetNode.getAttribute('role') == 'grid') { - return cvox.AriaUtil.getGridState_(targetNode, targetNode); - } - - var role = cvox.AriaUtil.getRoleAttribute(targetNode); - if (targetNode.getAttribute('aria-haspopup') == 'true') { - if (role == 'menuitem') { - state.push(['has_submenu']); - } else if (cvox.AriaUtil.isButton(targetNode)) { - // Do nothing - the role name will be 'pop-up button'. - } else { - state.push(['has_popup']); - } - } - - var valueText = targetNode.getAttribute('aria-valuetext'); - if (valueText) { - // If there is a valueText, that always wins. - state.push(['aria_value_text', valueText]); - return state; - } - - var valueNow = targetNode.getAttribute('aria-valuenow'); - var valueMin = targetNode.getAttribute('aria-valuemin'); - var valueMax = targetNode.getAttribute('aria-valuemax'); - - // Scrollbar and progressbar should speak the percentage. - // http://www.w3.org/TR/wai-aria/roles#scrollbar - // http://www.w3.org/TR/wai-aria/roles#progressbar - if ((valueNow != null) && (valueMin != null) && (valueMax != null)) { - if ((role == 'scrollbar') || (role == 'progressbar')) { - var percent = Math.round((valueNow / (valueMax - valueMin)) * 100); - state.push(['state_percent', percent]); - return state; - } - } - - // Return as many of the value attributes as possible. - if (valueNow != null) { - state.push(['aria_value_now', valueNow]); - } - if (valueMin != null) { - state.push(['aria_value_min', valueMin]); - } - if (valueMax != null) { - state.push(['aria_value_max', valueMax]); - } - - // If this is a composite control or an item within a composite control, - // get the index and count of the current descendant or active - // descendant. - var parentControl = targetNode; - var currentDescendant = null; - - if (cvox.AriaUtil.isCompositeControl(parentControl) && primary) { - currentDescendant = cvox.AriaUtil.getActiveDescendant(parentControl); - } else { - role = cvox.AriaUtil.getRoleAttribute(targetNode); - if (role == 'option' || role == 'menuitem' || role == 'menuitemcheckbox' || - role == 'menuitemradio' || role == 'radio' || role == 'tab' || - role == 'treeitem') { - currentDescendant = targetNode; - parentControl = targetNode.parentElement; - while (parentControl && - !cvox.AriaUtil.isCompositeControl(parentControl)) { - parentControl = parentControl.parentElement; - if (parentControl && - cvox.AriaUtil.getRoleAttribute(parentControl) == 'treeitem') { - break; - } - } - } - } - - if (parentControl && - (cvox.AriaUtil.isCompositeControl(parentControl) || - cvox.AriaUtil.getRoleAttribute(parentControl) == 'treeitem') && - currentDescendant) { - var parentRole = cvox.AriaUtil.getRoleAttribute(parentControl); - var descendantRoleList; - switch (parentRole) { - case 'combobox': - case 'listbox': - descendantRoleList = ['option']; - break; - case 'menu': - descendantRoleList = ['menuitem', 'menuitemcheckbox', 'menuitemradio']; - break; - case 'radiogroup': - descendantRoleList = ['radio']; - break; - case 'tablist': - descendantRoleList = ['tab']; - break; - case 'tree': - case 'treegrid': - case 'treeitem': - descendantRoleList = ['treeitem']; - break; - } - - if (descendantRoleList) { - var listLength; - var currentIndex; - - var ariaLength = - parseInt(currentDescendant.getAttribute('aria-setsize'), 10); - if (!isNaN(ariaLength)) { - listLength = ariaLength; - } - var ariaIndex = - parseInt(currentDescendant.getAttribute('aria-posinset'), 10); - if (!isNaN(ariaIndex)) { - currentIndex = ariaIndex; - } - - if (listLength == undefined || currentIndex == undefined) { - var descendants = - cvox.AriaUtil.getNextLevel(parentControl, descendantRoleList); - if (listLength == undefined) { - listLength = descendants.length; - } - if (currentIndex == undefined) { - for (var j = 0; j < descendants.length; j++) { - if (descendants[j] == currentDescendant) { - currentIndex = j + 1; - } - } - } - } - if (currentIndex && listLength) { - state.push(['list_position', currentIndex, listLength]); - } - } - } - return state; -}; - - -/** - * Returns a string that gives information about the state of the grid node. - * - * @param {Node} targetNode The node to get the state information for. - * @param {Node} parentControl The parent composite control. - * @return {cvox.NodeState} The status information about the node. - * @private - */ -cvox.AriaUtil.getGridState_ = function(targetNode, parentControl) { - var activeDescendant = cvox.AriaUtil.getActiveDescendant(parentControl); - - if (activeDescendant) { - var descendantSelector = '*[role~="row"]'; - var rows = parentControl.querySelectorAll(descendantSelector); - var currentIndex = null; - for (var j = 0; j < rows.length; j++) { - var gridcells = rows[j].querySelectorAll('*[role~="gridcell"]'); - for (var k = 0; k < gridcells.length; k++) { - if (gridcells[k] == activeDescendant) { - return /** @type {cvox.NodeState} */ ( - [['role_gridcell_pos', j + 1, k + 1]]); - } - } - } - } - return []; -}; - - -/** - * Returns the id of a node's active descendant - * @param {Node} targetNode The node. - * @return {?string} The id of the active descendant. - * @private - */ -cvox.AriaUtil.getActiveDescendantId_ = function(targetNode) { - if (!targetNode.getAttribute) { - return null; - } - - var activeId = targetNode.getAttribute('aria-activedescendant'); - if (!activeId) { - return null; - } - return activeId; -}; - - -/** - * Returns the list of elements that are one aria-level below. - * - * @param {Node} parentControl The node whose descendants should be analyzed. - * @param {Array<string>} role The role(s) of descendant we are looking for. - * @return {Array<Node>} The array of matching nodes. - */ -cvox.AriaUtil.getNextLevel = function(parentControl, role) { - var result = []; - var children = parentControl.childNodes; - var length = children.length; - for (var i = 0; i < children.length; i++) { - if (cvox.AriaUtil.isHidden(children[i]) || - !cvox.DomUtil.isVisible(children[i])) { - continue; - } - var nextLevel = cvox.AriaUtil.getNextLevelItems(children[i], role); - if (nextLevel.length > 0) { - result = result.concat(nextLevel); - } - } - return result; -}; - - -/** - * Recursively finds the first node(s) that match the role. - * - * @param {Node} current The node to start looking at. - * @param {Array<string>} role The role(s) to match. - * @return {Array<Element>} The array of matching nodes. - */ -cvox.AriaUtil.getNextLevelItems = function(current, role) { - if (current.nodeType != 1) { // If reached a node that is not an element. - return []; - } - if (role.indexOf(cvox.AriaUtil.getRoleAttribute(current)) != -1) { - return [current]; - } else { - var children = current.childNodes; - var length = children.length; - if (length == 0) { - return []; - } else { - var resultArray = []; - for (var i = 0; i < length; i++) { - var result = cvox.AriaUtil.getNextLevelItems(children[i], role); - if (result.length > 0) { - resultArray = resultArray.concat(result); - } - } - return resultArray; - } - } -}; - - -/** - * If the node is an object with an active descendant, returns the - * descendant node. - * - * This function will fully resolve an active descendant chain. If a circular - * chain is detected, it will return null. - * - * @param {Node} targetNode The node to get descendant information for. - * @return {Node} The descendant node or null if no node exists. - */ -cvox.AriaUtil.getActiveDescendant = function(targetNode) { - var seenIds = {}; - var node = targetNode; - - while (node) { - var activeId = cvox.AriaUtil.getActiveDescendantId_(node); - if (!activeId) { - break; - } - if (activeId in seenIds) { - // A circlar activeDescendant is an error, so return null. - return null; - } - seenIds[activeId] = true; - node = document.getElementById(activeId); - } - - if (node == targetNode) { - return null; - } - return node; -}; - - -/** - * Given a node, returns true if it's an ARIA control widget. Control widgets - * are treated as leaf nodes. - * - * @param {Node} targetNode The node to be checked. - * @return {boolean} Whether the targetNode is an ARIA control widget. - */ -cvox.AriaUtil.isControlWidget = function(targetNode) { - if (targetNode && targetNode.getAttribute) { - var role = cvox.AriaUtil.getRoleAttribute(targetNode); - switch (role) { - case 'button': - case 'checkbox': - case 'combobox': - case 'listbox': - case 'menu': - case 'menuitemcheckbox': - case 'menuitemradio': - case 'radio': - case 'slider': - case 'progressbar': - case 'scrollbar': - case 'spinbutton': - case 'tab': - case 'tablist': - case 'textbox': - return true; - } - } - return false; -}; - - -/** - * Given a node, returns true if it's an ARIA composite control. - * - * @param {Node} targetNode The node to be checked. - * @return {boolean} Whether the targetNode is an ARIA composite control. - */ -cvox.AriaUtil.isCompositeControl = function(targetNode) { - if (targetNode && targetNode.getAttribute) { - var role = cvox.AriaUtil.getRoleAttribute(targetNode); - switch (role) { - case 'combobox': - case 'grid': - case 'listbox': - case 'menu': - case 'menubar': - case 'radiogroup': - case 'tablist': - case 'tree': - case 'treegrid': - return true; - } - } - return false; -}; - - -/** - * Given a node, returns its 'aria-live' value if it's a live region, or - * null otherwise. - * - * @param {Node} node The node to be checked. - * @return {?string} The live region value, like 'polite' or - * 'assertive', or null if 'off' or none. - */ -cvox.AriaUtil.getAriaLive = function(node) { - if (!node.hasAttribute) - return null; - var value = node.getAttribute('aria-live'); - if (value == 'off') { - return null; - } else if (value) { - return value; - } - var role = cvox.AriaUtil.getRoleAttribute(node); - switch (role) { - case 'alert': - return 'assertive'; - case 'log': - case 'status': - return 'polite'; - default: - return null; - } -}; - - -/** - * Given a node, returns its 'aria-atomic' value. - * - * @param {Node} node The node to be checked. - * @return {boolean} The aria-atomic live region value, either true or false. - */ -cvox.AriaUtil.getAriaAtomic = function(node) { - if (!node.hasAttribute) - return false; - var value = node.getAttribute('aria-atomic'); - if (value) { - return (value === 'true'); - } - var role = cvox.AriaUtil.getRoleAttribute(node); - if (role == 'alert') { - return true; - } - return false; -}; - - -/** - * Given a node, returns its 'aria-busy' value. - * - * @param {Node} node The node to be checked. - * @return {boolean} The aria-busy live region value, either true or false. - */ -cvox.AriaUtil.getAriaBusy = function(node) { - if (!node.hasAttribute) - return false; - var value = node.getAttribute('aria-busy'); - if (value) { - return (value === 'true'); - } - return false; -}; - - -/** - * Given a node, checks its aria-relevant attribute (with proper inheritance) - * and determines whether the given change (additions, removals, text, all) - * is relevant and should be announced. - * - * @param {Node} node The node to be checked. - * @param {string} change The name of the change to check - one of - * 'additions', 'removals', 'text', 'all'. - * @return {boolean} True if that change is relevant to that node as part of - * a live region. - */ -cvox.AriaUtil.getAriaRelevant = function(node, change) { - if (!node.hasAttribute) - return false; - var value; - if (node.hasAttribute('aria-relevant')) { - value = node.getAttribute('aria-relevant'); - } else { - value = 'additions text'; - } - if (value == 'all') { - value = 'additions removals text'; - } - - var tokens = value.replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, '').split(' '); - - if (change == 'all') { - return ( - tokens.indexOf('additions') >= 0 && tokens.indexOf('text') >= 0 && - tokens.indexOf('removals') >= 0); - } else { - return (tokens.indexOf(change) >= 0); - } -}; - - -/** - * Given a node, return all live regions that are either rooted at this - * node or contain this node. - * - * @param {Node} node The node to be checked. - * @return {Array<Element>} All live regions affected by this node changing. - */ -cvox.AriaUtil.getLiveRegions = function(node) { - var result = []; - if (node.querySelectorAll) { - var nodes = node.querySelectorAll( - '[role="alert"], [role="log"], [role="marquee"], ' + - '[role="status"], [role="timer"], [aria-live]'); - if (nodes) { - for (var i = 0; i < nodes.length; i++) { - result.push(nodes[i]); - } - } - } - - while (node) { - if (cvox.AriaUtil.getAriaLive(node)) { - result.push(node); - return result; - } - node = node.parentElement; - } - - return result; -}; - - -/** - * Checks to see whether or not a node is an ARIA landmark. - * - * @param {Node} node The node to be checked. - * @return {boolean} Whether or not the node is an ARIA landmark. - */ -cvox.AriaUtil.isLandmark = function(node) { - if (!node || !node.getAttribute) { - return false; - } - var role = cvox.AriaUtil.getRoleAttribute(node); - switch (role) { - case 'application': - case 'banner': - case 'complementary': - case 'contentinfo': - case 'form': - case 'main': - case 'navigation': - case 'search': - return true; - } - return false; -}; - - -/** - * Checks to see whether or not a node is an ARIA grid. - * - * @param {Node} node The node to be checked. - * @return {boolean} Whether or not the node is an ARIA grid. - */ -cvox.AriaUtil.isGrid = function(node) { - if (!node || !node.getAttribute) { - return false; - } - var role = cvox.AriaUtil.getRoleAttribute(node); - switch (role) { - case 'grid': - case 'treegrid': - return true; - } - return false; -}; - - -/** - * Returns the id of an earcon to play along with the description for a node. - * - * @param {Node} node The node to get the earcon for. - * @return {cvox.Earcon?} The earcon id, or null if none applies. - */ -cvox.AriaUtil.getEarcon = function(node) { - if (!node || !node.getAttribute) { - return null; - } - var role = cvox.AriaUtil.getRoleAttribute(node); - switch (role) { - case 'button': - return cvox.Earcon.BUTTON; - case 'checkbox': - case 'radio': - case 'menuitemcheckbox': - case 'menuitemradio': - var checked = node.getAttribute('aria-checked'); - if (checked == 'true') { - return cvox.Earcon.CHECK_ON; - } else { - return cvox.Earcon.CHECK_OFF; - } - case 'combobox': - case 'listbox': - return cvox.Earcon.LISTBOX; - case 'textbox': - return cvox.Earcon.EDITABLE_TEXT; - case 'listitem': - return cvox.Earcon.LIST_ITEM; - case 'link': - return cvox.Earcon.LINK; - } - - return null; -}; - - -/** - * Returns the role of the node. - * - * This is equivalent to targetNode.getAttribute('role') - * except it also takes into account cases where ChromeVox - * itself has changed the role (ie, adding role="application" - * to BODY elements for better screen reader compatibility. - * - * @param {Node} targetNode The node to get the role for. - * @return {string} role of the targetNode. - */ -cvox.AriaUtil.getRoleAttribute = function(targetNode) { - if (!targetNode.getAttribute) { - return ''; - } - var role = targetNode.getAttribute('role'); - if (targetNode.hasAttribute('chromevoxoriginalrole')) { - role = targetNode.getAttribute('chromevoxoriginalrole'); - } - return role; -}; - - -/** - * Checks to see whether or not a node is an ARIA math node. - * - * @param {Node} node The node to be checked. - * @return {boolean} Whether or not the node is an ARIA math node. - */ -cvox.AriaUtil.isMath = function(node) { - if (!node || !node.getAttribute) { - return false; - } - var role = cvox.AriaUtil.getRoleAttribute(node); - return role == 'math'; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/aural_style_util.js b/chrome/browser/resources/chromeos/chromevox/common/aural_style_util.js deleted file mode 100644 index cfdce46..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/aural_style_util.js +++ /dev/null
@@ -1,179 +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. - -/** - * @fileoverview A set of classes to support aural CSS. - */ - - -goog.provide('cvox.AuralProperty'); -goog.provide('cvox.AuralStyleConverter'); -goog.provide('cvox.AuralStyleUtil'); - -// This seems the only way to lay out an enum and use it as a key. -/** - * @enum {string} - */ -cvox.AuralProperty = { - VOLUME: 'VOLUME', - SPEAK: 'SPEAK', - PAUSE_BEFORE: 'PAUSE_BEFORE', - PAUSE_AFTER: 'PAUSE_AFTER', - PAUSE: 'PAUSE', - CUE_BEFORE: 'CUE_BEFORE', - CUE_AFTER: 'CUE_AFTER', - CUE: 'CUE', - PLAY_DURING: 'PLAY_DURING', - AZIMUTH: 'AZIMUTH', - ELEVATION: 'ELEVATION', - SPEECH_RATE: 'SPEECH_RATE', - VOICE_FAMILY: 'VOICE_FAMILY', - PITCH: 'PITCH', - PITCH_RANGE: 'PITCH_RANGE', - STRESS: 'STRESS', - RICHNESS: 'RICHNESS', - SPEAK_PUNCTUATION: 'SPEAK_PUNCTUATION', - SPEAK_NUMERIAL: 'SPEAK_NUMERIAL', - SPEAK_HEADER: 'SPEAK_HEADER', - NONE: 'NONE' -}; - - -/* A series of conversion functions. */ -/** - * An identity conversion. - * @param {number} value The aural CSS value to convert. - * @return {number} The resulting tts property value. - */ -cvox.AuralStyleConverter.identity = function(value) { - return value; -}; - - -/** - * Conversion from an aural style property to Chrome TTS property. - * TODO(dtseng): no-op's below need to be supported by the extension API itself - * or by ChromeVox. - * @type {Object<cvox.AuralProperty, string>} - */ -cvox.AuralStyleConverter.propertyTable = { - VOLUME: 'volume', - SPEAK: 'no-op', - PAUSE_BEFORE: 'no-op', - PAUSE_AFTER: 'no-op', - PAUSE: 'no-op', - CUE_BEFORE: 'no-op', - CUE_AFTER: 'no-op', - CUE: 'no-op', - PLAY_DURING: 'no-op', - AZIMUTH: 'no-op', - ELEVATION: 'no-op', - SPEECH_RATE: 'relativeRate', - VOICE_FAMILY: 'no-op', - PITCH: 'relativePitch', - PITCH_RANGE: 'no-op', - STRESS: 'no-op', - RICHNESS: 'no-op', - SPEAK_PUNCTUATION: 'no-op', - SPEAK_NUMERIAL: 'no-op', - SPEAK_HEADER: 'no-op', - NONE: 'no-op' -}; - - -/** - * Conversion from an aural style value to Chrome TTS value. - * TODO(dtseng): Conversion of aural CSS values is incomplete; everything is an - * identity conversion at the moment. - * @type {Object<cvox.AuralProperty, function(*)>} - */ -cvox.AuralStyleConverter.valueTable = { - VOLUME: cvox.AuralStyleConverter.identity, - SPEAK: cvox.AuralStyleConverter.identity, - PAUSE_BEFORE: cvox.AuralStyleConverter.identity, - PAUSE_AFTER: cvox.AuralStyleConverter.identity, - PAUSE: cvox.AuralStyleConverter.identity, - CUE_BEFORE: cvox.AuralStyleConverter.identity, - CUE_AFTER: cvox.AuralStyleConverter.identity, - CUE: cvox.AuralStyleConverter.identity, - PLAY_DURING: cvox.AuralStyleConverter.identity, - AZIMUTH: cvox.AuralStyleConverter.identity, - ELEVATION: cvox.AuralStyleConverter.identity, - SPEECH_RATE: cvox.AuralStyleConverter.identity, - VOICE_FAMILY: cvox.AuralStyleConverter.identity, - PITCH: cvox.AuralStyleConverter.identity, - PITCH_RANGE: cvox.AuralStyleConverter.identity, - STRESS: cvox.AuralStyleConverter.identity, - RICHNESS: cvox.AuralStyleConverter.identity, - SPEAK_PUNCTUATION: cvox.AuralStyleConverter.identity, - SPEAK_NUMERIAL: cvox.AuralStyleConverter.identity, - SPEAK_HEADER: cvox.AuralStyleConverter.identity, - NONE: cvox.AuralStyleConverter.identity -}; - - -/** - * Converts a given aural property/value rule to a tts property/value. - * @param {cvox.AuralProperty} property The property. - * @param {*} value The CSS-based value. - * @return {Object} An object holding tts property and value. - */ -cvox.AuralStyleConverter.convertRule = function(property, value) { - return { - property: cvox.AuralStyleConverter.propertyTable[property], - value: cvox.AuralStyleConverter.valueTable[property](value) - }; -}; - - -/** - * Converts an aural CSS style block to a TTS property object. - * @param {Object<cvox.AuralProperty, *>} style The style. - * @return {Object} The tts property object. - */ -cvox.AuralStyleConverter.convertStyle = function(style) { - var ttsProperties = {}; - for (var property in style) { - var ttsProperty = - cvox.AuralStyleConverter.convertRule(property, style[property]); - ttsProperties[ttsProperty.property] = ttsProperty.value; - } - return ttsProperties; -}; - - -/** - * Gets the aural style for a node. - * @param {Node} node The node. - * @return {Object} The aural style, converted to tts properties. - */ -cvox.AuralStyleUtil.getStyleForNode = function(node) { - var style = cvox.AuralStyleUtil.defaultStyles[node.tagName]; - if (!style) { - return null; - } - return cvox.AuralStyleConverter.convertStyle(style); -}; - - -/** - * A list of default aural styles. - */ -cvox.AuralStyleUtil.defaultStyles = { - 'ARTICLE': {PITCH: -0.1}, - 'ASIDE': {PITCH: -0.1}, - 'FOOTER': {PITCH: -0.1}, - 'H1': {PITCH: -0.3}, - 'H2': {PITCH: -0.25}, - 'H3': {PITCH: -0.2}, - 'H4': {PITCH: -0.15}, - 'H5': {PITCH: -0.1}, - 'H6': {PITCH: -0.05}, - 'HEADER': {PITCH: -0.1}, - 'HGROUP': {PITCH: -0.1}, - 'MARK': {PITCH: -0.1}, - 'NAV': {PITCH: -0.1}, - 'SECTION': {PITCH: -0.1}, - 'TIME': {PITCH: -0.1} -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/braille_text_handler.js b/chrome/browser/resources/chromeos/chromevox/common/braille_text_handler.js deleted file mode 100644 index dc2c3354..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/braille_text_handler.js +++ /dev/null
@@ -1,62 +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. - -goog.provide('cvox.BrailleTextHandler'); - -goog.require('cvox.BrailleInterface'); -goog.require('cvox.BrailleUtil'); -goog.require('cvox.ChromeVox'); -goog.require('cvox.NavBraille'); - -/** - * @fileoverview Updates braille display contents following text changes. - * - */ - -/** - * Represents an editable text region. - * - * @constructor - * @param {!cvox.BrailleInterface} braille Braille interface. - */ -cvox.BrailleTextHandler = function(braille) { - /** - * Braille interface used to produce output. - * @type {!cvox.BrailleInterface} - * @private - */ - this.braille_ = braille; -}; - - -/** - * Called by controller class when text changes. - * @param {string} line The text of the line. - * @param {number} start The 0-based index starting selection. - * @param {number} end The 0-based index ending selection. - * @param {boolean} multiline True if the text comes from a multi line text - * field. - * @param {Element} element DOM node which line comes from. - * @param {number} lineStart Start offset of line (might be > 0 for multiline - * fields). - */ -cvox.BrailleTextHandler.prototype.changed = function( - line, start, end, multiline, element, lineStart) { - var content; - if (multiline) { - var spannable = cvox.BrailleUtil.createValue(line, start, end, lineStart); - if (element) { - spannable.setSpan(element, 0, line.length); - } - content = new cvox.NavBraille( - {text: spannable, startIndex: start, endIndex: end}); - } else { - if (cvox.ChromeVox.navigationManager) { - content = cvox.ChromeVox.navigationManager.getBraille(); - } - } - if (content) { - this.braille_.write(content); - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/braille_util.js b/chrome/browser/resources/chromeos/chromevox/common/braille_util.js deleted file mode 100644 index a720580..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/braille_util.js +++ /dev/null
@@ -1,368 +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. - -/** - * @fileoverview A utility class for general braille functionality. - */ - - -goog.provide('cvox.BrailleUtil'); - -goog.require('Spannable'); -goog.require('cvox.ChromeVox'); -goog.require('cvox.DomUtil'); -goog.require('cvox.EditableTextAreaShadow'); -goog.require('cvox.Focuser'); -goog.require('cvox.NavBraille'); -goog.require('cvox.NodeStateUtil'); -goog.require('cvox.ValueSelectionSpan'); -goog.require('cvox.ValueSpan'); - - -/** - * Trimmable whitespace character that appears between consecutive items in - * braille. - * @const {string} - */ -cvox.BrailleUtil.ITEM_SEPARATOR = ' '; - - -/** - * Messages considered as containers in braille. - * Containers are distinguished from roles by their appearance higher up in the - * DOM tree of a selected node. - * This list should be very short. - * @type {!Array<string>} - */ -cvox.BrailleUtil.CONTAINER = [ - 'tag_h1_brl', 'tag_h2_brl', 'tag_h3_brl', 'tag_h4_brl', 'tag_h5_brl', - 'tag_h6_brl' -]; - - -/** - * Maps a ChromeVox message id to a braille template. - * The template takes one-character specifiers: - * n: replaced with braille name. - * r: replaced with braille role. - * s: replaced with braille state. - * c: replaced with braille container role; this potentially returns whitespace, - * so place at the beginning or end of templates for trimming. - * v: replaced with braille value. - * @type {Object<string>} - */ -cvox.BrailleUtil.TEMPLATE = { - 'base': 'c n v r s', - 'role_alert': 'r: n', - 'role_button': 'n r s', - 'role_checkbox': 'n r s', - 'role_menuitemcheckbox': 'n r s', - 'role_menuitemradio': 'n r s', - 'role_radio': 'n r s', - 'role_textbox': 'n: v r s', - 'input_type_email': 'n: v r s', - 'input_type_number': 'n: v r s', - 'input_type_password': 'n: v r s', - 'input_type_search': 'n: v r s', - 'input_type_text': 'n: v r s', - 'input_type_url': 'n: v r s', - 'tag_textarea': 'n: v r s' -}; - - -/** - * Gets the braille name for a node. - * See DomUtil for a more precise definition of 'name'. - * Additionally, whitespace is trimmed. - * @param {Node} node The node. - * @return {string} The string representation. - */ -cvox.BrailleUtil.getName = function(node) { - if (!node) { - return ''; - } - return cvox.DomUtil.getName(node).trim(); -}; - - -/** - * Gets the braille role message id for a node. - * See DomUtil for a more precise definition of 'role'. - * @param {Node} node The node. - * @return {string} The string representation. - */ -cvox.BrailleUtil.getRoleMsg = function(node) { - if (!node) { - return ''; - } - var roleMsg = cvox.DomUtil.getRoleMsg(node, cvox.VERBOSITY_VERBOSE); - if (roleMsg) { - roleMsg = cvox.DomUtil.collapseWhitespace(roleMsg); - } - if (roleMsg && (roleMsg.length > 0)) { - if (Msgs.getMsg(roleMsg + '_brl')) { - roleMsg += '_brl'; - } - } - return roleMsg; -}; - - -/** - * Transforms a {@code cvox.NodeState} list of state messages to the - * corresponding messages for braille and expands them into a localized - * string suitable for output on a braille display. - * @param {cvox.NodeState} stateMsgs The states to expand. The content of this - * array is modified. - * @return {string} The string representation. - * @private - */ -cvox.BrailleUtil.expandStateMsgs_ = function(stateMsgs) { - stateMsgs.forEach(function(state) { - // Check to see if a variant of the message with '_brl' exists, - // and use it if so. - // - // Note: many messages are templatized, and if we don't pass any - // argument to substitute, getMsg might throw an error if the - // resulting string is empty. To avoid this, we pass a dummy - // substitution string array here. - var dummySubs = ['dummy', 'dummy', 'dummy']; - if (Msgs.getMsg(state[0] + '_brl', dummySubs)) { - state[0] += '_brl'; - } - }); - return cvox.NodeStateUtil.expand(stateMsgs); -}; - - -/** - * Gets the braille container role of a node. - * @param {Node} prev The previous node in navigation. - * @param {Node} node The node. - * @return {string} The string representation. - */ -cvox.BrailleUtil.getContainer = function(prev, node) { - if (!prev || !node) { - return ''; - } - var ancestors = cvox.DomUtil.getUniqueAncestors(prev, node); - for (var i = 0, container; container = ancestors[i]; i++) { - var msg = cvox.BrailleUtil.getRoleMsg(container); - if (msg && cvox.BrailleUtil.CONTAINER.indexOf(msg) != -1) { - return Msgs.getMsg(msg); - } - } - return ''; -}; - - -/** - * Gets the braille value of a node. A {@code cvox.ValueSpan} will be - * attached, along with (possibly) a {@code cvox.ValueSelectionSpan}. - * @param {Node} node The node. - * @return {!Spannable} The value spannable. - */ -cvox.BrailleUtil.getValue = function(node) { - if (!node) { - return new Spannable(); - } - var valueSpan = new cvox.ValueSpan(0 /* offset */); - if (cvox.DomUtil.isInputTypeText(node)) { - var value = node.value; - if (node.type === 'password') { - value = value.replace(/./g, '*'); - } - var spannable = new Spannable(value, valueSpan); - if (node === document.activeElement && - cvox.DomUtil.doesInputSupportSelection(node)) { - var selectionStart = - cvox.BrailleUtil.clamp_(node.selectionStart, 0, spannable.length); - var selectionEnd = - cvox.BrailleUtil.clamp_(node.selectionEnd, 0, spannable.length); - spannable.setSpan( - new cvox.ValueSelectionSpan(), Math.min(selectionStart, selectionEnd), - Math.max(selectionStart, selectionEnd)); - } - return spannable; - } else if (node instanceof HTMLTextAreaElement) { - var shadow = new cvox.EditableTextAreaShadow(); - shadow.update(node); - var lineIndex = shadow.getLineIndex(node.selectionEnd); - var lineStart = shadow.getLineStart(lineIndex); - var lineEnd = shadow.getLineEnd(lineIndex); - var lineText = node.value.substring(lineStart, lineEnd); - valueSpan.offset = lineStart; - var spannable = new Spannable(lineText, valueSpan); - if (node === document.activeElement) { - var selectionStart = cvox.BrailleUtil.clamp_( - node.selectionStart - lineStart, 0, spannable.length); - var selectionEnd = cvox.BrailleUtil.clamp_( - node.selectionEnd - lineStart, 0, spannable.length); - spannable.setSpan( - new cvox.ValueSelectionSpan(), Math.min(selectionStart, selectionEnd), - Math.max(selectionStart, selectionEnd)); - } - return spannable; - } else { - return new Spannable(cvox.DomUtil.getValue(node), valueSpan); - } -}; - - -/** - * Gets the templated representation of braille. - * @param {Node} prev The previous node (during navigation). - * @param {Node} node The node. - * @param {{name:(undefined|string), - * role:(undefined|string), - * roleMsg:(undefined|string), - * state:(undefined|string), - * container:(undefined|string), - * value:(undefined|Spannable)}|Object=} opt_override Override a - * specific property for the given node. - * @return {!Spannable} The string representation. - */ -cvox.BrailleUtil.getTemplated = function(prev, node, opt_override) { - opt_override = opt_override ? opt_override : {}; - var roleMsg = opt_override.roleMsg || - (node ? cvox.DomUtil.getRoleMsg(node, cvox.VERBOSITY_VERBOSE) : ''); - var template = - cvox.BrailleUtil.TEMPLATE[roleMsg] || cvox.BrailleUtil.TEMPLATE['base']; - var state = opt_override.state; - if (!state) { - if (node) { - state = cvox.BrailleUtil.expandStateMsgs_( - cvox.DomUtil.getStateMsgs(node, true)); - } else { - state = ''; - } - } - var role = opt_override.role || ''; - if (!role && roleMsg) { - role = Msgs.getMsg(roleMsg + '_brl') || Msgs.getMsg(roleMsg); - } - - var templated = new Spannable(); - var mapChar = function(c) { - switch (c) { - case 'n': - return opt_override.name || cvox.BrailleUtil.getName(node); - case 'r': - return role; - case 's': - return state; - case 'c': - return opt_override.container || - cvox.BrailleUtil.getContainer(prev, node); - case 'v': - return opt_override.value || cvox.BrailleUtil.getValue(node); - default: - return c; - } - }; - for (var i = 0; i < template.length; i++) { - var component = mapChar(template[i]); - templated.append(component); - // Ignore the next whitespace separator if the current component is empty, - // unless the empty value has a selection, in which case the cursor - // should be placed on the empty space after the empty value. - if (!component.toString() && template[i + 1] == ' ' && - (!(component instanceof Spannable) || - !/**@type {Spannable}*/ (component).getSpanInstanceOf( - cvox.ValueSelectionSpan))) { - i++; - } - } - return templated.trimRight(); -}; - - -/** - * Creates a braille value from a string and, optionally, a selection range. - * A {@code cvox.ValueSpan} will be attached, along with a - * {@code cvox.ValueSelectionSpan} if applicable. - * @param {string} text The text to display as the value. - * @param {number=} opt_selStart Selection start. - * @param {number=} opt_selEnd Selection end if different from selection start. - * @param {number=} opt_textOffset Start offset of text. - * @return {!Spannable} The value spannable. - */ -cvox.BrailleUtil.createValue = function( - text, opt_selStart, opt_selEnd, opt_textOffset) { - var spannable = new Spannable(text, new cvox.ValueSpan(opt_textOffset || 0)); - if (goog.isDef(opt_selStart)) { - opt_selEnd = goog.isDef(opt_selEnd) ? opt_selEnd : opt_selStart; - // TODO(plundblad): This looses the distinction between the selection - // anchor (start) and focus (end). We should use that information to - // decide where to pan the braille display. - if (opt_selStart > opt_selEnd) { - var temp = opt_selStart; - opt_selStart = opt_selEnd; - opt_selEnd = temp; - } - - spannable.setSpan(new cvox.ValueSelectionSpan(), opt_selStart, opt_selEnd); - } - return spannable; -}; - - -/** - * Activates a position in a nav braille. Moves the caret in text fields - * and simulates a mouse click on the node at the position. - * - * @param {!cvox.NavBraille} braille the nav braille representing the display - * content that was active when the user issued the key command. - * The annotations in the spannable are used to decide what - * node to activate and what part of the node value (if any) to - * move the caret to. - * @param {number=} opt_displayPosition position of the display that the user - * activated, relative to the start of braille. - */ -cvox.BrailleUtil.click = function(braille, opt_displayPosition) { - var handled = false; - var spans = braille.text.getSpans(opt_displayPosition || 0); - var node = spans.filter(function(n) { - return n instanceof Node; - })[0]; - if (node) { - if (goog.isDef(opt_displayPosition) && - (cvox.DomUtil.isInputTypeText(node) || - node instanceof HTMLTextAreaElement)) { - var valueSpan = spans.filter(function(s) { - return s instanceof cvox.ValueSpan; - })[0]; - if (valueSpan) { - if (document.activeElement !== node) { - cvox.Focuser.setFocus(node); - } - var cursorPosition = opt_displayPosition - - braille.text.getSpanStart(valueSpan) + valueSpan.offset; - cvox.ChromeVoxEventWatcher.setUpTextHandler(); - node.selectionStart = node.selectionEnd = cursorPosition; - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - handled = true; - } - } - } - if (!handled) { - cvox.DomUtil.clickElem( - node || cvox.ChromeVox.navigationManager.getCurrentNode(), false, false, - false, true); - } -}; - - -/** - * Clamps a number so it is within the given boundaries. - * @param {number} number The number to clamp. - * @param {number} min The minimum value to return. - * @param {number} max The maximum value to return. - * @return {number} {@code number} if it is within the bounds, or the nearest - * number within the bounds otherwise. - * @private - */ -cvox.BrailleUtil.clamp_ = function(number, min, max) { - return Math.min(Math.max(number, min), max); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/buildinfo.js b/chrome/browser/resources/chromeos/chromevox/common/buildinfo.js deleted file mode 100644 index 47ee49d4..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/buildinfo.js +++ /dev/null
@@ -1,20 +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. - - -/** - * @fileoverview Build info for ChromeVox. - * - * This file may be replaced in package.py for dev builds. - * For releases, it is updated by hand with meaningful values. - * - */ - -goog.provide('cvox.BuildInfo'); - -/** - * An identified for this build. - * @type {string} - */ -cvox.BuildInfo.build = 'development build';
diff --git a/chrome/browser/resources/chromeos/chromevox/common/chromevox.js b/chrome/browser/resources/chromeos/chromevox/common/chromevox.js index 37cb604f..5d71298d 100644 --- a/chrome/browser/resources/chromeos/chromevox/common/chromevox.js +++ b/chrome/browser/resources/chromeos/chromevox/common/chromevox.js
@@ -17,17 +17,11 @@ // us to group all of the forward declarations for each file without // having them overwrite the mapping in deps.js goog.addDependency( - '../host/interface/abstract_host.js', ['cvox.AbstractHost'], []); - -goog.addDependency( '../host/interface/tts_interface.js', ['cvox.TtsInterface'], []); goog.addDependency( '../host/interface/braille_interface.js', ['cvox.BrailleInterface'], []); -goog.addDependency( - '../host/interface/mathjax_interface.js', ['cvox.MathJaxInterface'], []); - goog.addDependency('../chromevox/messages/msgs.js', ['Msgs'], []); goog.addDependency( @@ -64,10 +58,6 @@ cvox.ChromeVox = function() {}; /** - * @type {cvox.AbstractHost} - */ -cvox.ChromeVox.host = null; -/** * @type {cvox.TtsInterface} */ cvox.ChromeVox.tts;
diff --git a/chrome/browser/resources/chromeos/chromevox/common/chromevox_json.js b/chrome/browser/resources/chromeos/chromevox/common/chromevox_json.js deleted file mode 100644 index 2757908..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/chromevox_json.js +++ /dev/null
@@ -1,362 +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. - -goog.provide('cvox.ChromeVoxJSON'); - - -/** - * @fileoverview A simple wrapper around the JSON APIs. - * If it is possible to use the browser's built in native JSON, then - * cvox.ChromeVoxJSON is the same as JSON. - * If the page has its own version of JSON, cvox.ChromeVoxJSON will use its - * own implementation (rather than the version of JSON on the page - * which may be outdated/broken). - */ - -if (!cvox.ChromeVoxJSON) { - /** Placeholder object. */ - cvox.ChromeVoxJSON = {}; -} - -if (window.JSON && window.JSON.toString() == '[object JSON]') { - cvox.ChromeVoxJSON = window.JSON; -} else { - /* - * JSON implementation renamed to cvox.ChromeVoxJSON. - * This only gets called if the page has its own version of JSON. - * - * Based on: - * http://www.JSON.org/json2.js - * 2010-03-20 - * - * Public Domain. - * - * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. - * - * See http://www.JSON.org/js.html - */ - (function() { - function f(n) { - // Format integers to have at least two digits. - return n < 10 ? '0' + n : n; - } - - if (typeof Date.prototype.toJSON !== 'function') { - Date.prototype.toJSON = function(key) { - - return isFinite(this.valueOf()) ? - this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + - f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + - f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z' : - 'null'; - }; - - Boolean.prototype.toJSON = Number.prototype.toJSON = - String.prototype.toJSON = function(key) { - return /** @type {string} */ (this.valueOf()); - }; - } - - var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - gap, - indent, - meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }, - rep; - - - function quote(string) { - // If the string contains no control characters, no quote characters, and - // no backslash characters, then we can safely slap some quotes around it. - // Otherwise we must also replace the offending characters with safe - // escape sequences. - - escapable.lastIndex = 0; - return escapable.test(string) ? '"' + - string.replace( - escapable, - function(a) { - var c = meta[a]; - return typeof c === 'string' ? c : - '\\u' + - ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }) + - '"' : - '"' + string + '"'; - } - - - function str(key, holder) { - // Produce a string from holder[key]. - - var i, // The loop counter. - k, // The member key. - v, // The member value. - length, mind = gap, partial, value = holder[key]; - - // If the value has a toJSON method, call it to obtain a replacement - // value. - - if (value && typeof value === 'object' && - typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - - // If we were called with a replacer function, then call the replacer to - // obtain a replacement value. - - if (typeof rep === 'function') { - value = rep.call(holder, key, value); - } - - // What happens next depends on the value's type. - - switch (typeof value) { - case 'string': - return quote(value); - - case 'number': - // JSON numbers must be finite. Encode non-finite numbers as null. - return isFinite(value) ? String(value) : 'null'; - - case 'boolean': - case 'null': - // If the value is a boolean or null, convert it to a string. Note: - // typeof null does not produce 'null'. The case is included here in - // the remote chance that this gets fixed someday. - return String(value); - - // If the type is 'object', we might be dealing with an object or an - // array or null. - - case 'object': - - // Due to a specification blunder in ECMAScript, typeof null is - // 'object', so watch out for that case. - - if (!value) { - return 'null'; - } - - // Make an array to hold the partial results of stringifying this - // object value. - - gap += indent; - partial = []; - - // Is the value an array? - - if (Object.prototype.toString.apply(value) === '[object Array]') { - // The value is an array. Stringify every element. Use null as a - // placeholder for non-JSON values. - - length = value.length; - for (i = 0; i < length; i += 1) { - partial[i] = str(i, value) || 'null'; - } - - // Join all of the elements together, separated with commas, and - // wrap them in brackets. - - v = partial.length === 0 ? - '[]' : - gap ? - '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : - '[' + partial.join(',') + ']'; - gap = mind; - return v; - } - - // If the replacer is an array, use it to select the members to be - // stringified. - - if (rep && typeof rep === 'object') { - length = rep.length; - for (i = 0; i < length; i += 1) { - k = rep[i]; - if (typeof k === 'string') { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } else { - // Otherwise, iterate through all of the keys in the object. - for (k in value) { - if (Object.hasOwnProperty.call(value, k)) { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - - // Join all of the member texts together, separated with commas, - // and wrap them in braces. - - v = partial.length === 0 ? - '{}' : - gap ? - '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : - '{' + partial.join(',') + '}'; - gap = mind; - return v; - } - } - - // If the JSON object does not yet have a stringify method, give it one. - - if (typeof cvox.ChromeVoxJSON.stringify !== 'function') { - /** - * @param {*} value Input object. - * @param {(Array<string>|(function(string, *) : *)|null)=} replacer - * Replacer array or function. - * @param {(number|string|null)=} space Whitespace character. - * @return {string} json string which represents jsonObj. - */ - cvox.ChromeVoxJSON.stringify = function(value, replacer, space) { - - // The stringify method takes a value and an optional replacer, and an - // optional space parameter, and returns a JSON text. The replacer can - // be a function that can replace values, or an array of strings that - // will select the keys. A default replacer method can be provided. Use - // of the space parameter can produce text that is more easily readable. - - var i; - gap = ''; - indent = ''; - - // If the space parameter is a number, make an indent string containing - // that many spaces. - - if (typeof space === 'number') { - for (i = 0; i < space; i += 1) { - indent += ' '; - } - - // If the space parameter is a string, it will be used as the indent - // string. - - } else if (typeof space === 'string') { - indent = space; - } - - // If there is a replacer, it must be a function or an array. - // Otherwise, throw an error. - - rep = replacer; - if (replacer && typeof replacer !== 'function' && - (typeof replacer !== 'object' || - typeof replacer.length !== 'number')) { - throw new Error('JSON.stringify'); - } - - // Make a fake root object containing our value under the key of ''. - // Return the result of stringifying the value. - - return str('', {'': value}); - }; - } - - - // If the JSON object does not yet have a parse method, give it one. - - if (typeof cvox.ChromeVoxJSON.parse !== 'function') { - /** - * @param {string} text The string to parse. - * @param {(function(string, *) : *|null)=} reviver Reviver function. - * @return {*} The JSON object. - */ - cvox.ChromeVoxJSON.parse = function(text, reviver) { - - // The parse method takes a text and an optional reviver function, and - // returns a JavaScript value if the text is a valid JSON text. - - var j; - - function walk(holder, key) { - // The walk method is used to recursively walk the resulting structure - // so that modifications can be made. - - var k, v, value = holder[key]; - if (value && typeof value === 'object') { - for (k in value) { - if (Object.hasOwnProperty.call(value, k)) { - v = walk(value, k); - if (v !== undefined) { - value[k] = v; - } else { - delete value[k]; - } - } - } - } - return reviver.call(holder, key, value); - } - - - // Parsing happens in four stages. In the first stage, we replace - // certain Unicode characters with escape sequences. JavaScript handles - // many characters incorrectly, either silently deleting them, or - // treating them as line endings. - - text = String(text); - cx.lastIndex = 0; - if (cx.test(text)) { - text = text.replace(cx, function(a) { - return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }); - } - - // In the second stage, we run the text against regular expressions that - // look for non-JSON patterns. We are especially concerned with '()' and - // 'new' because they can cause invocation, and '=' because it can cause - // mutation. But just to be safe, we want to reject all unexpected - // forms. - // We split the second stage into 4 regexp operations in order to work - // around crippling inefficiencies in IE's and Safari's regexp engines. - // First we replace the JSON backslash pairs with '@' (a non-JSON - // character). Second, we replace all simple value tokens with ']' - // characters. Third, we delete all open brackets that follow a colon or - // comma or that begin the text. Finally, we look to see that the - // remaining characters are only whitespace or ']' or ',' or ':' or '{' - // or '}'. If that is so, then the text is safe for eval. - - if (/^[\],:{}\s]*$/.test( - text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') - .replace( - /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, - ']') - .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { - // In the third stage we use the eval function to compile the text - // into a JavaScript structure. The '{' operator is subject to a - // syntactic ambiguity in JavaScript: it can begin a block or an - // object literal. We wrap the text in parens to eliminate the - // ambiguity. - - j = eval('(' + text + ')'); - - // In the optional fourth stage, we recursively walk the new - // structure, passing each name/value pair to a reviver function for - // possible transformation. - return typeof reviver === 'function' ? walk({'': j}, '') : j; - } - - // If the text is not JSON parseable, then a SyntaxError is thrown. - - throw new SyntaxError('JSON.parse'); - }; - } - }()); -}
diff --git a/chrome/browser/resources/chromeos/chromevox/common/command_store.js b/chrome/browser/resources/chromeos/chromevox/common/command_store.js index b70b092..856ca20 100644 --- a/chrome/browser/resources/chromeos/chromevox/common/command_store.js +++ b/chrome/browser/resources/chromeos/chromevox/common/command_store.js
@@ -33,9 +33,6 @@ goog.provide('cvox.CommandStore'); -goog.require('cvox.PlatformFilter'); - - /** * Returns all of the categories in the store as an array. * @return {Array<string>} The collection of categories. @@ -103,7 +100,6 @@ * doDefault: (undefined|boolean), * msgId: (undefined|string), * nodeList: (undefined|string), - * platformFilter: (undefined|cvox.PlatformFilter), * skipInput: (undefined|boolean), * allowEvents: (undefined|boolean), * disallowContinuation: (undefined|boolean)}>} @@ -120,8 +116,6 @@ * msgId: The message resource describing the command. * nodeList: The id from the map above if this command is used for * showing a list of nodes. - * platformFilter: Specifies to which platforms this command applies. If left - * undefined, the command applies to all platforms. * skipInput: Explicitly skips this command when text input has focus. * Defaults to false. * disallowOOBE: Explicitly disallows this command when on chrome://oobe/*. @@ -147,12 +141,6 @@ msgId: 'stop_speech_key', category: 'controlling_speech' }, - 'toggleChromeVox': { - announce: false, - platformFilter: cvox.PlatformFilter.WML, - msgId: 'toggle_chromevox_active' - }, - 'toggleChromeVoxVersion': {announce: false}, 'openChromeVoxMenus': {announce: false, msgId: 'menus_title'}, 'decreaseTtsRate': { announce: false,
diff --git a/chrome/browser/resources/chromeos/chromevox/common/command_store_test.unitjs b/chrome/browser/resources/chromeos/chromevox/common/command_store_test.unitjs deleted file mode 100644 index 758397f..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/command_store_test.unitjs +++ /dev/null
@@ -1,73 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Include test fixture. -GEN_INCLUDE(['../testing/chromevox_unittest_base.js']); - -/** - * Test fixture. - * @constructor - * @extends {ChromeVoxUnitTestBase} - */ -function ChromeVoxCommandStoreUnitTest() {} - -ChromeVoxCommandStoreUnitTest.prototype = { - __proto__: ChromeVoxUnitTestBase.prototype, - - /** @override */ - closureModuleDeps: [ - 'cvox.ChromeVoxUserCommands', - 'cvox.CommandStore', - ] -}; - -TEST_F('ChromeVoxCommandStoreUnitTest', 'TableData', function() { - var categories = cvox.CommandStore.categories(); - assertEquals(11, categories.length); - assertEquals('modifier_keys', categories[0]); - assertEquals('controlling_speech', categories[1]); - assertEquals('navigation', categories[2]); - assertEquals('actions', categories[3]); - assertEquals('information', categories[4]); - assertEquals('help_commands', categories[5]); - assertEquals('overview', categories[6]); - assertEquals('jump_commands', categories[7]); - assertEquals('tables', categories[8]); - - assertEquals('stop_speech_key', - cvox.CommandStore.messageForCommand('stopSpeech')); - assertEquals('controlling_speech', - cvox.CommandStore.categoryForCommand('stopSpeech')); - - var controllingSpeechCmds = - cvox.CommandStore.commandsForCategory('controlling_speech'); - assertEquals(11, controllingSpeechCmds.length); - assertEquals('stopSpeech', controllingSpeechCmds[0]); - assertEquals('decreaseTtsRate', controllingSpeechCmds[1]); - assertEquals('increaseTtsRate', controllingSpeechCmds[2]); - assertEquals('decreaseTtsPitch', controllingSpeechCmds[3]); - assertEquals('increaseTtsPitch', controllingSpeechCmds[4]); -}); - - -/** Tests that undefined is returned for bad queries. */ -TEST_F('ChromeVoxCommandStoreUnitTest', 'InvalidQueries', function() { - assertThat(cvox.CommandStore.commandsForCategory('foo'), eqJSON([])); - assertTrue(undefined == cvox.CommandStore.categoryForCommand('foo')); - assertTrue(undefined == cvox.CommandStore.messageForCommand('foo')); -}); - - -/** Tests the validity of every command. */ -TEST_F('ChromeVoxCommandStoreUnitTest', 'CommandValidity', function() { - var categories = cvox.CommandStore.categories(); - for (var i = 0; i < categories.length; i++) { - var commands = cvox.CommandStore.commandsForCategory(categories[i]); - for (j = 0; j < commands.length; j++) { - var command = commands[j]; - assertEquals(command + ' function', - command + ' ' + typeof(cvox.ChromeVoxUserCommands.commands[command])); - } - } -});
diff --git a/chrome/browser/resources/chromeos/chromevox/common/content_editable_extractor.js b/chrome/browser/resources/chromeos/chromevox/common/content_editable_extractor.js deleted file mode 100644 index f0f8dfff..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/content_editable_extractor.js +++ /dev/null
@@ -1,230 +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. - -/** - * @fileoverview Defines the ContentEditableExtractor class. - */ - -goog.provide('cvox.ContentEditableExtractor'); - -goog.require('cvox.Cursor'); -goog.require('cvox.TraverseUtil'); - -/** - * Extracts the text and line break information from a contenteditable region. - * @constructor - */ -cvox.ContentEditableExtractor = function() { - /** - * The extracted, flattened, text. - * @type {string} - * @private - */ - this.text_ = ''; - - /** - * The start cursor/selection index. - * @type {number} - * @private - */ - this.start_ = 0; - - /** - * The end cursor/selection index. - * @type {number} - * @private - */ - this.end_ = 0; - - /** - * Map from line index to a data structure containing the start - * and end index within the line. - * @type {Object<number, {startIndex: number, endIndex: number}>} - * @private - */ - this.lines_ = {}; - - /** - * Map from 0-based character index to 0-based line index. - * @type {Array<number>} - * @private - */ - this.characterToLineMap_ = []; -}; - -/** - * Update the metadata. - * @param {Element} element The DOM element that's contentEditable. - */ -cvox.ContentEditableExtractor.prototype.update = function(element) { - /** - * Map from line index to a data structure containing the start - * and end index within the line. - * @type {Object<number, {startIndex: number, endIndex: number}>} - */ - var lines = {0: {startIndex: 0, endIndex: 0}}; - var startCursor = new cvox.Cursor(element, 0, ''); - var endCursor = startCursor.clone(); - var range = document.createRange(); - var rect; - var lineIndex = 0; - var lastBottom = null; - var text = ''; - var textSize = 0; - var selectionStartIndex = -1; - var selectionEndIndex = -1; - var sel = window.getSelection(); - var selectionStart = new cvox.Cursor(sel.baseNode, sel.baseOffset, ''); - var selectionEnd = new cvox.Cursor(sel.extentNode, sel.extentOffset, ''); - var setStart = false; - var setEnd = false; - while (true) { - var entered = []; - var left = []; - var c = cvox.TraverseUtil.forwardsChar(endCursor, entered, left); - var done = false; - if (!c) { - done = true; - } - for (var i = 0; i < left.length && !done; i++) { - if (left[i] == element) { - done = true; - } - } - if (done) { - break; - } - - range.setStart(startCursor.node, startCursor.index); - range.setEnd(endCursor.node, endCursor.index); - rect = range.getBoundingClientRect(); - if (!rect || rect.width == 0 || rect.height == 0) { - continue; - } - - if (lastBottom !== null && rect.bottom != lastBottom && textSize > 0 && - text.substr(-1).match(/\S/) && c.match(/\S/)) { - text += '\n'; - textSize++; - } - - if (startCursor.node != endCursor.node && endCursor.index > 0) { - range.setStart(endCursor.node, endCursor.index - 1); - rect = range.getBoundingClientRect(); - if (!rect || rect.width == 0 || rect.height == 0) { - continue; - } - } - - if (!setStart && selectionStartIndex == -1 && - endCursor.node == selectionStart.node && - endCursor.index >= selectionStart.index) { - if (endCursor.index > selectionStart.index) { - selectionStartIndex = textSize; - } else { - setStart = true; - } - } - if (!setEnd && selectionEndIndex == -1 && - endCursor.node == selectionEnd.node && - endCursor.index >= selectionEnd.index) { - if (endCursor.index > selectionEnd.index) { - selectionEndIndex = textSize; - } else { - setEnd = true; - } - } - - if (lastBottom === null) { - // This is the first character we've successfully measured on this - // line. Save the vertical position but don't do anything else. - lastBottom = rect.bottom; - } else if (rect.bottom != lastBottom) { - lines[lineIndex].endIndex = textSize; - lineIndex++; - lines[lineIndex] = {startIndex: textSize, endIndex: textSize}; - lastBottom = rect.bottom; - } - text += c; - textSize++; - startCursor = endCursor.clone(); - - if (setStart) { - selectionStartIndex = textSize; - setStart = false; - } - if (setEnd) { - selectionEndIndex = textSize; - setEnd = false; - } - } - - // Finish up the last line. - lines[lineIndex].endIndex = textSize; - - // Create a map from character index to line number. - var characterToLineMap = []; - for (var i = 0; i <= lineIndex; i++) { - for (var j = lines[i].startIndex; j <= lines[i].endIndex; j++) { - characterToLineMap[j] = i; - } - } - - // Finish updating fields. - this.text_ = text; - this.characterToLineMap_ = characterToLineMap; - this.lines_ = lines; - - this.start_ = selectionStartIndex >= 0 ? selectionStartIndex : text.length; - this.end_ = selectionEndIndex >= 0 ? selectionEndIndex : text.length; -}; - -/** - * Get the text. - * @return {string} The extracted, flattened, text. - */ -cvox.ContentEditableExtractor.prototype.getText = function() { - return this.text_; -}; - -/** - * @return {number} The start cursor/selection index. - */ -cvox.ContentEditableExtractor.prototype.getStartIndex = function() { - return this.start_; -}; - -/** - * @return {number} The end cursor/selection index. - */ -cvox.ContentEditableExtractor.prototype.getEndIndex = function() { - return this.end_; -}; - -/** - * Get the line number corresponding to a particular index. - * @param {number} index The 0-based character index. - * @return {number} The 0-based line number corresponding to that character. - */ -cvox.ContentEditableExtractor.prototype.getLineIndex = function(index) { - return this.characterToLineMap_[index]; -}; - -/** - * Get the start character index of a line. - * @param {number} index The 0-based line index. - * @return {number} The 0-based index of the first character in this line. - */ -cvox.ContentEditableExtractor.prototype.getLineStart = function(index) { - return this.lines_[index].startIndex; -}; - -/** - * Get the end character index of a line. - * @param {number} index The 0-based line index. - * @return {number} The 0-based index of the end of this line. - */ -cvox.ContentEditableExtractor.prototype.getLineEnd = function(index) { - return this.lines_[index].endIndex; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/cursor.js b/chrome/browser/resources/chromeos/chromevox/common/cursor.js deleted file mode 100644 index 223c10f..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/cursor.js +++ /dev/null
@@ -1,58 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview Simple class to represent a cursor location in the document. - */ - -goog.provide('cvox.Cursor'); - -/** - * A class to represent a cursor location in the document, - * like the start position or end position of a selection range. - * - * Later this may be extended to support "virtual text" for an object, - * like the ALT text for an image. - * - * Note: we cache the text of a particular node at the time we - * traverse into it. Later we should add support for dynamically - * reloading it. - * NOTE: Undefined behavior if node is null - * @param {Node} node The DOM node. - * @param {number} index The index of the character within the node. - * @param {string} text The cached text contents of the node. - * @constructor - */ -cvox.Cursor = function(node, index, text) { - this.node = node; - this.index = index; - this.text = text; -}; - -/** - * @return {!cvox.Cursor} A new cursor pointing to the same location. - */ -cvox.Cursor.prototype.clone = function() { - return new cvox.Cursor(this.node, this.index, this.text); -}; - -/** - * Modify this cursor to point to the location that another cursor points to. - * @param {!cvox.Cursor} otherCursor The cursor to copy from. - */ -cvox.Cursor.prototype.copyFrom = function(otherCursor) { - this.node = otherCursor.node; - this.index = otherCursor.index; - this.text = otherCursor.text; -}; - -/** - * Check for equality. - * @param {!cvox.Cursor} rhs The cursor to compare against. - * @return {boolean} True if equal. - */ -cvox.Cursor.prototype.equals = function(rhs) { - return this.node == rhs.node && this.index == rhs.index && - this.text == rhs.text; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/cursor_selection.js b/chrome/browser/resources/chromeos/chromevox/common/cursor_selection.js deleted file mode 100644 index cb8bea8..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/cursor_selection.js +++ /dev/null
@@ -1,255 +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. - -/** - * @fileoverview Simple class to represent a cursor selection. - * A cursor selection is just two cursors; one for the start and one for - * the end of some interval in the document. - */ - -goog.provide('cvox.CursorSelection'); - -goog.require('cvox.Cursor'); -goog.require('cvox.SelectionUtil'); -goog.require('cvox.TraverseUtil'); - - -/** - * If the start node and end node are the same, and the indexes are the same, - * the selection is interpreted to be a node. Otherwise, it is interpreted - * to be a range. - * @param {!cvox.Cursor} start The starting cursor. - * @param {!cvox.Cursor} end The ending cursor. - * @param {boolean=} opt_reverse Whether to make it a reversed selection or - * not. Default is selection is not reversed. If start and end are in the - * wrong order, they will be swapped automatically. - * NOTE: Can't infer automatically whether the selection is reversed because - * for a selection on a single node, the start and end are equal. - * @constructor - */ -cvox.CursorSelection = function(start, end, opt_reverse) { - this.start = start.clone(); - this.end = end.clone(); - - if (opt_reverse == undefined) { - opt_reverse = false; - } - /** @private */ - this.isReversed_ = opt_reverse; - - if ((this.isReversed_ && - this.start.node.compareDocumentPosition(this.end.node) == - cvox.CursorSelection.BEFORE) || - (!this.isReversed_ && - this.end.node.compareDocumentPosition(this.start.node) == - cvox.CursorSelection.BEFORE)) { - var oldStart = this.start; - this.start = this.end; - this.end = oldStart; - } -}; - - -/** - * From http://www.w3schools.com/jsref/met_node_comparedocumentposition.asp - */ -cvox.CursorSelection.BEFORE = 4; - - -/** - * If true, ensures that this selection is reversed. Otherwise, ensures that - * it is not reversed. - * @param {boolean} reversed True to reverse. False to nonreverse. - * @return {!cvox.CursorSelection} For chaining. - */ -cvox.CursorSelection.prototype.setReversed = function(reversed) { - if (reversed == this.isReversed_) { - return this; - } - var oldStart = this.start; - this.start = this.end; - this.end = oldStart; - this.isReversed_ = reversed; - return this; -}; - - -/** - * Returns true if this selection is a reverse selection. - * @return {boolean} true if reversed. - */ -cvox.CursorSelection.prototype.isReversed = function() { - return this.isReversed_; -}; - - -/** - * Returns start if not reversed, end if reversed. - * @return {!cvox.Cursor} start if not reversed, end if reversed. - */ -cvox.CursorSelection.prototype.absStart = function() { - return this.isReversed_ ? this.end : this.start; -}; - -/** - * Returns end if not reversed, start if reversed. - * @return {!cvox.Cursor} end if not reversed, start if reversed. - */ -cvox.CursorSelection.prototype.absEnd = function() { - return this.isReversed_ ? this.start : this.end; -}; - - -/** - * Clones the selection. - * @return {!cvox.CursorSelection} The cloned selection. - */ -cvox.CursorSelection.prototype.clone = function() { - return new cvox.CursorSelection(this.start, this.end, this.isReversed_); -}; - - -/** - * Places a DOM selection around this CursorSelection. - */ -cvox.CursorSelection.prototype.select = function() { - var sel = window.getSelection(); - sel.removeAllRanges(); - this.normalize(); - sel.addRange(this.getRange()); -}; - - -/** - * Creates a new cursor selection that starts and ends at the node. - * Returns null if node is null. - * @param {Node} node The node. - * @return {cvox.CursorSelection} The selection. - */ -cvox.CursorSelection.fromNode = function(node) { - if (!node) { - return null; - } - var text = cvox.TraverseUtil.getNodeText(node); - - return new cvox.CursorSelection( - new cvox.Cursor(node, 0, text), new cvox.Cursor(node, 0, text)); -}; - - -/** - * Creates a new cursor selection that starts and ends at document.body. - * @return {!cvox.CursorSelection} The selection. - */ -cvox.CursorSelection.fromBody = function() { - return /** @type {!cvox.CursorSelection} */ ( - cvox.CursorSelection.fromNode(document.body)); -}; - -/** - * Returns the text that the selection spans. - * @return {string} Text within the selection. '' if it is a node selection. - */ -cvox.CursorSelection.prototype.getText = function() { - if (this.start.equals(this.end)) { - return cvox.TraverseUtil.getNodeText(this.start.node); - } - return cvox.SelectionUtil.getRangeText(this.getRange()); -}; - -/** - * Returns a range from the given selection. - * @return {Range} The range. - */ -cvox.CursorSelection.prototype.getRange = function() { - var range = document.createRange(); - if (this.isReversed_) { - range.setStart(this.end.node, this.end.index); - range.setEnd(this.start.node, this.start.index); - } else { - range.setStart(this.start.node, this.start.index); - range.setEnd(this.end.node, this.end.index); - } - return range; -}; - -/** - * Check for equality. - * @param {!cvox.CursorSelection} rhs The CursorSelection to compare against. - * @return {boolean} True if equal. - */ -cvox.CursorSelection.prototype.equals = function(rhs) { - return this.start.equals(rhs.start) && this.end.equals(rhs.end); -}; - -/** - * Check for equality regardless of direction. - * @param {!cvox.CursorSelection} rhs The CursorSelection to compare against. - * @return {boolean} True if equal. - */ -cvox.CursorSelection.prototype.absEquals = function(rhs) { - return ( - (this.start.equals(rhs.start) && this.end.equals(rhs.end)) || - (this.end.equals(rhs.start) && this.start.equals(rhs.end))); -}; - -/** - * Determines if this starts before another CursorSelection in document order. - * If this is reversed, then a reversed document order is checked. - * In the case that this and rhs start at the same position, we return true. - * @param {!cvox.CursorSelection} rhs The selection to compare. - * @return {boolean} True if this is before rhs. - */ -cvox.CursorSelection.prototype.directedBefore = function(rhs) { - var leftToRight = this.start.node.compareDocumentPosition(rhs.start.node) == - cvox.CursorSelection.BEFORE; - return this.start.node == rhs.start.node || - (this.isReversed() ? !leftToRight : leftToRight); -}; -/** - * Normalizes this selection. - * Use this routine to adjust CursorSelection's that have been collapsed due to - * convention such as when a CursorSelection references a node without attention - * to its endpoints. - * The result is to surround the node with this cursor. - * @return {!cvox.CursorSelection} The normalized selection. - */ -cvox.CursorSelection.prototype.normalize = function() { - if (this.absEnd().index == 0 && this.absEnd().node) { - var node = this.absEnd().node; - - // DOM ranges use different conventions when surrounding a node. For - // instance, input nodes endOffset is always 0 while h1's endOffset is 1 - // with both having no children. Use a range to compute the endOffset. - var testRange = document.createRange(); - testRange.selectNodeContents(node); - this.absEnd().index = testRange.endOffset; - } - return this; -}; - -/** - * Collapses to the directed start of the selection. - * @return {!cvox.CursorSelection} For chaining. - */ -cvox.CursorSelection.prototype.collapse = function() { - // Not a selection. - if (this.start.equals(this.end)) { - return this; - } - this.end.copyFrom(this.start); - if (this.start.text.length == 0) { - return this; - } - if (this.isReversed()) { - if (this.end.index > 0) { - this.end.index--; - } - } else { - if (this.end.index < this.end.text.length) { - this.end.index++; - } - } - return this; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/date_widget.js b/chrome/browser/resources/chromeos/chromevox/common/date_widget.js deleted file mode 100644 index 0b4860f..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/date_widget.js +++ /dev/null
@@ -1,322 +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. - -goog.provide('cvox.ChromeVoxHTMLDateWidget'); - -goog.require('Msgs'); - -/** - * @fileoverview Gives the user spoken feedback as they interact with the date - * widget (input type=date). - * - */ - -/** - * A class containing the information needed to speak - * a text change event to the user. - * - * @constructor - * @param {Element} dateElem The time widget element. - * @param {cvox.TtsInterface} tts The TTS object from ChromeVox. - */ -cvox.ChromeVoxHTMLDateWidget = function(dateElem, tts) { - var self = this; - /** - * Currently selected field in the widget. - * @type {number} - * @private - */ - this.pos_ = 0; - var maxpos = 2; - if (dateElem.type == 'month' || dateElem.type == 'week') { - maxpos = 1; - } - /** - * The maximum number of fields in the widget. - * @type {number} - * @private - */ - this.maxPos_ = maxpos; - /** - * The HTML node of the widget. - * @type {Node} - * @private - */ - this.dateElem_ = dateElem; - /** - * A handle to the ChromeVox TTS object. - * @type {Object} - * @private - */ - this.dateTts_ = tts; - /** - * The previous value of the year field. - * @type {number} - * @private - */ - this.pYear_ = -1; - /** - * The previous value of the month field. - * @type {number} - * @private - */ - this.pMonth_ = -1; - /** - * The previous value of the week field. - * @type {number} - * @private - */ - this.pWeek_ = -1; - /** - * The previous value of the day field. - * @type {number} - * @private - */ - this.pDay_ = -1; - - // Use listeners to make this work when running tests inside of ChromeVox. - this.keyListener_ = function(evt) { - self.eventHandler_(evt); - }; - this.blurListener_ = function(evt) { - self.shutdown(); - }; - - // Ensure we have a reasonable value to start with. - if (this.dateElem_.value.length == 0) { - this.forceInitTime_(); - } - - // Move the cursor to the first position so that we are guaranteed to start - // off at the hours position. - for (var i = 0; i < this.maxPos_; i++) { - var evt = document.createEvent('KeyboardEvent'); - evt.initKeyboardEvent( - 'keydown', true, true, window, 'Left', 0, false, false, false, false); - this.dateElem_.dispatchEvent(evt); - evt = document.createEvent('KeyboardEvent'); - evt.initKeyboardEvent( - 'keyup', true, true, window, 'Left', 0, false, false, false, false); - this.dateElem_.dispatchEvent(evt); - } - - this.dateElem_.addEventListener('keydown', this.keyListener_, false); - this.dateElem_.addEventListener('keyup', this.keyListener_, false); - this.dateElem_.addEventListener('blur', this.blurListener_, false); - this.update_(true); -}; - -/** - * Removes the key listeners for the time widget. - * - */ -cvox.ChromeVoxHTMLDateWidget.prototype.shutdown = function() { - this.dateElem_.removeEventListener('blur', this.blurListener_, false); - this.dateElem_.removeEventListener('keydown', this.keyListener_, false); - this.dateElem_.removeEventListener('keyup', this.keyListener_, false); -}; - -/** - * Forces a sensible default value so that there is something there that can - * be inspected with JS. - * @private - */ -cvox.ChromeVoxHTMLDateWidget.prototype.forceInitTime_ = function() { - var currentDate = new Date(); - var valueString = ''; - var yearString = currentDate.getFullYear() + ''; - // Date.getMonth starts at 0, but the value for the HTML5 date widget needs to - // start at 1. - var monthString = currentDate.getMonth() + 1 + ''; - if (monthString.length < 2) { - monthString = '0' + monthString; // Month format is MM. - } - var dayString = currentDate.getDate() + ''; - - switch (this.dateElem_.type) { - case 'month': - valueString = yearString + '-' + monthString; - break; - case 'week': - // Based on info from: http://www.merlyn.demon.co.uk/weekcalc.htm#WNR - currentDate.setHours(0, 0, 0); - // Set to nearest Thursday: current date + 4 - current day number - // Make Sunday's day number 7 - currentDate.setDate( - currentDate.getDate() + 4 - (currentDate.getDay() || 7)); - // Get first day of year - var yearStart = new Date(currentDate.getFullYear(), 0, 1); - // Calculate full weeks to nearest Thursday - var weekString = - Math.ceil((((currentDate - yearStart) / 86400000) + 1) / 7) + ''; - if (weekString.length < 2) { - weekString = '0' + weekString; // Week format is WXX. - } - weekString = 'W' + weekString; - valueString = yearString + '-' + weekString; - break; - default: - valueString = yearString + '-' + monthString + '-' + dayString; - break; - } - this.dateElem_.setAttribute('value', valueString); -}; - -/** - * Ensure that the position stays within bounds. - * @private - */ -cvox.ChromeVoxHTMLDateWidget.prototype.handlePosChange_ = function() { - this.pos_ = Math.max(this.pos_, 0); - this.pos_ = Math.min(this.pos_, this.maxPos_); - // TODO (clchen, dtseng): Make this logic i18n once there is a way to - // determine what the date format actually is. For now, assume that: - // date == mm/dd/yyyy - // week == ww/yyyy - // month == mm/yyyy. - switch (this.pos_) { - case 0: - if (this.dateElem_.type == 'week') { - this.pWeek_ = -1; - } else { - this.pMonth_ = -1; - } - break; - case 1: - if (this.dateElem_.type == 'date') { - this.pDay_ = -1; - } else { - this.pYear_ = -1; - } - break; - case 2: - this.pYear_ = -1; - break; - } -}; - -/** - * Speaks any changes to the control. - * @private - * @param {boolean} shouldSpeakLabel Whether or not to speak the label. - */ -cvox.ChromeVoxHTMLDateWidget.prototype.update_ = function(shouldSpeakLabel) { - var splitDate = this.dateElem_.value.split('-'); - if (splitDate.length < 1) { - this.forceInitTime_(); - return; - } - - var year = -1; - var month = -1; - var week = -1; - var day = -1; - - year = parseInt(splitDate[0], 10); - - if (this.dateElem_.type == 'week') { - week = parseInt(splitDate[1].replace('W', ''), 10); - } else if (this.dateElem_.type == 'date') { - month = parseInt(splitDate[1], 10); - day = parseInt(splitDate[2], 10); - } else { - month = parseInt(splitDate[1], 10); - } - - var changeMessage = ''; - - if (shouldSpeakLabel) { - changeMessage = cvox.DomUtil.getName(this.dateElem_, true, true) + '\n'; - } - - if (week != this.pWeek_) { - changeMessage = - changeMessage + Msgs.getMsg('datewidget_week') + week + '\n'; - this.pWeek_ = week; - } - - if (month != this.pMonth_) { - var monthName = ''; - switch (month) { - case 1: - monthName = Msgs.getMsg('datewidget_january'); - break; - case 2: - monthName = Msgs.getMsg('datewidget_february'); - break; - case 3: - monthName = Msgs.getMsg('datewidget_march'); - break; - case 4: - monthName = Msgs.getMsg('datewidget_april'); - break; - case 5: - monthName = Msgs.getMsg('datewidget_may'); - break; - case 6: - monthName = Msgs.getMsg('datewidget_june'); - break; - case 7: - monthName = Msgs.getMsg('datewidget_july'); - break; - case 8: - monthName = Msgs.getMsg('datewidget_august'); - break; - case 9: - monthName = Msgs.getMsg('datewidget_september'); - break; - case 10: - monthName = Msgs.getMsg('datewidget_october'); - break; - case 11: - monthName = Msgs.getMsg('datewidget_november'); - break; - case 12: - monthName = Msgs.getMsg('datewidget_december'); - break; - } - changeMessage = changeMessage + monthName + '\n'; - this.pMonth_ = month; - } - - if (day != this.pDay_) { - changeMessage = changeMessage + day + '\n'; - this.pDay_ = day; - } - - if (year != this.pYear_) { - changeMessage = changeMessage + year + '\n'; - this.pYear_ = year; - } - - if (changeMessage.length > 0) { - this.dateTts_.speak(changeMessage, 0, null); - } -}; - -/** - * Handles user key events. - * @private - * @param {Event} evt The event to be handled. - */ -cvox.ChromeVoxHTMLDateWidget.prototype.eventHandler_ = function(evt) { - var shouldSpeakLabel = false; - if (evt.type == 'keydown') { - // Handle tab/right arrow - if (((evt.keyCode == 9) && !evt.shiftKey) || (evt.keyCode == 39)) { - this.pos_++; - this.handlePosChange_(); - shouldSpeakLabel = true; - } - // Handle shift+tab/left arrow - if (((evt.keyCode == 9) && evt.shiftKey) || (evt.keyCode == 37)) { - this.pos_--; - this.handlePosChange_(); - shouldSpeakLabel = true; - } - // For all other cases, fall through and let update_ decide if there are any - // changes that need to be spoken. - } - this.update_(shouldSpeakLabel); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/description_util.js b/chrome/browser/resources/chromeos/chromevox/common/description_util.js deleted file mode 100644 index 36824ae..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/description_util.js +++ /dev/null
@@ -1,430 +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. - -/** - * @fileoverview A utility class for building NavDescriptions from the dom. - */ - - -goog.provide('cvox.DescriptionUtil'); - -goog.require('cvox.AriaUtil'); -goog.require('cvox.AuralStyleUtil'); -goog.require('cvox.BareObjectWalker'); -goog.require('cvox.CursorSelection'); -goog.require('cvox.DomUtil'); -goog.require('cvox.EarconUtil'); -goog.require('cvox.NavDescription'); - - -/** - * Lists all Node tagName's who's description is derived from its subtree. - * @type {Object<boolean>} - */ -cvox.DescriptionUtil.COLLECTION_NODE_TYPE = { - 'H1': true, - 'H2': true, - 'H3': true, - 'H4': true, - 'H5': true, - 'H6': true -}; - -/** - * Get a control's complete description in the same format as if you - * navigated to the node. - * @param {Element} control A control. - * @param {Array<Node>=} opt_changedAncestors The changed ancestors that will - * be used to determine what needs to be spoken. If this is not provided, the - * ancestors used to determine what needs to be spoken will just be the control - * itself and its surrounding control if it has one. - * @return {cvox.NavDescription} The description of the control. - */ -cvox.DescriptionUtil.getControlDescription = function( - control, opt_changedAncestors) { - var ancestors = [control]; - if (opt_changedAncestors && (opt_changedAncestors.length > 0)) { - ancestors = opt_changedAncestors; - } else { - var surroundingControl = cvox.DomUtil.getSurroundingControl(control); - if (surroundingControl) { - ancestors = [surroundingControl, control]; - } - } - - var description = cvox.DescriptionUtil.getDescriptionFromAncestors( - ancestors, true, cvox.VERBOSITY_VERBOSE); - - // Use heuristics if the control doesn't otherwise have a name. - if (surroundingControl) { - var name = cvox.DomUtil.getName(surroundingControl); - if (name.length == 0) { - name = cvox.DomUtil.getControlLabelHeuristics(surroundingControl); - if (name.length > 0) { - description.context = name + ' ' + description.context; - } - } - } else { - var name = cvox.DomUtil.getName(control); - if (name.length == 0) { - name = cvox.DomUtil.getControlLabelHeuristics(control); - if (name.length > 0) { - description.text = cvox.DomUtil.collapseWhitespace(name); - } - } - var value = cvox.DomUtil.getValue(control); - if (value.length > 0) { - description.userValue = cvox.DomUtil.collapseWhitespace(value); - } - } - - return description; -}; - - -/** - * Returns a description of a navigation from an array of changed - * ancestor nodes. The ancestors are in order from the highest in the - * tree to the lowest, i.e. ending with the current leaf node. - * - * @param {Array<Node>} ancestorsArray An array of ancestor nodes. - * @param {boolean} recursive Whether or not the element's subtree should - * be used; true by default. - * @param {number} verbosity The verbosity setting. - * @return {cvox.NavDescription} The description of the navigation action. - */ -cvox.DescriptionUtil.getDescriptionFromAncestors = function( - ancestorsArray, recursive, verbosity) { - if (typeof(recursive) === 'undefined') { - recursive = true; - } - var len = ancestorsArray.length; - var context = ''; - var text = ''; - var userValue = ''; - var annotation = ''; - var earcons = []; - var personality = null; - var hint = ''; - - if (len > 0) { - text = cvox.DomUtil.getName(ancestorsArray[len - 1], recursive); - - userValue = cvox.DomUtil.getValue(ancestorsArray[len - 1]); - } - for (var i = len - 1; i >= 0; i--) { - var node = ancestorsArray[i]; - - hint = cvox.DomUtil.getHint(node); - - // Don't speak dialogs here, they're spoken when events occur. - var role = node.getAttribute ? node.getAttribute('role') : null; - if (role == 'alertdialog') { - continue; - } - - var roleText = cvox.DomUtil.getRole(node, verbosity); - - // Use the ancestor closest to the target to be the personality. - if (!personality) { - personality = cvox.AuralStyleUtil.getStyleForNode(node); - } - // TODO(dtseng): Is this needed? - if (i < len - 1 && node.hasAttribute('role')) { - var name = cvox.DomUtil.getName(node, false); - if (name) { - roleText = name + ' ' + roleText; - } - } - if (roleText.length > 0) { - // Since we prioritize reading of context in reading order, only populate - // it for larger ancestry changes. - if (context.length > 0 || - (annotation.length > 0 && node.childElementCount > 1)) { - context = - roleText + ' ' + cvox.DomUtil.getState(node, false) + ' ' + context; - } else { - if (annotation.length > 0) { - annotation += - ' ' + roleText + ' ' + cvox.DomUtil.getState(node, true); - } else { - annotation = roleText + ' ' + cvox.DomUtil.getState(node, true); - } - } - } - var earcon = cvox.EarconUtil.getEarcon(node); - if (earcon != null && earcons.indexOf(earcon) == -1) { - earcons.push(earcon); - } - } - return new cvox.NavDescription({ - context: cvox.DomUtil.collapseWhitespace(context), - text: cvox.DomUtil.collapseWhitespace(text), - userValue: cvox.DomUtil.collapseWhitespace(userValue), - annotation: cvox.DomUtil.collapseWhitespace(annotation), - earcons: earcons, - personality: personality, - hint: cvox.DomUtil.collapseWhitespace(hint) - }); -}; - -/** - * Returns a description of a navigation from an array of changed - * ancestor nodes. The ancestors are in order from the highest in the - * tree to the lowest, i.e. ending with the current leaf node. - * - * @param {Node} prevNode The previous node in navigation. - * @param {Node} node The current node in navigation. - * @param {boolean} recursive Whether or not the element's subtree should - * be used; true by default. - * @param {number} verbosity The verbosity setting. - * @return {!Array<cvox.NavDescription>} The description of the navigation - * action. - */ -cvox.DescriptionUtil.getDescriptionFromNavigation = function( - prevNode, node, recursive, verbosity) { - if (!prevNode || !node) { - return []; - } - - // Next, check to see if the current node is a collection type. - if (cvox.DescriptionUtil.COLLECTION_NODE_TYPE[node.tagName]) { - return cvox.DescriptionUtil.getCollectionDescription( - /** @type {!cvox.CursorSelection} */ ( - cvox.CursorSelection.fromNode(prevNode)), - /** @type {!cvox.CursorSelection} */ - (cvox.CursorSelection.fromNode(node))); - } - - // Now, generate a description for all other elements. - var ancestors = cvox.DomUtil.getUniqueAncestors(prevNode, node, true); - var desc = cvox.DescriptionUtil.getDescriptionFromAncestors( - ancestors, recursive, verbosity); - var prevAncestors = cvox.DomUtil.getUniqueAncestors(node, prevNode); - if (cvox.DescriptionUtil.shouldDescribeExit_(prevAncestors)) { - var prevDesc = cvox.DescriptionUtil.getDescriptionFromAncestors( - prevAncestors, recursive, verbosity); - if (prevDesc.context && !desc.context) { - desc.context = Msgs.getMsg('exited_container', [prevDesc.context]); - } - } - return [desc]; -}; - - -/** - * Returns an array of NavDescriptions that includes everything that would be - * spoken by an object walker while traversing from prevSel to sel. - * It also includes any necessary annotations and context about the set of - * descriptions. This function is here because most (currently all) walkers - * that iterate over non-leaf nodes need this sort of description. - * This is an awkward design, and should be changed in the future. - * @param {!cvox.CursorSelection} prevSel The previous selection. - * @param {!cvox.CursorSelection} sel The selection. - * @return {!Array<!cvox.NavDescription>} The descriptions as described above. - */ -cvox.DescriptionUtil.getCollectionDescription = function(prevSel, sel) { - var descriptions = cvox.DescriptionUtil.getRawDescriptions_(prevSel, sel); - cvox.DescriptionUtil.insertCollectionDescription_(descriptions); - return descriptions; -}; - - -/** - * Used for getting collection descriptions. - * @type {!cvox.BareObjectWalker} - * @private - */ -cvox.DescriptionUtil.subWalker_ = new cvox.BareObjectWalker(); - - -/** - * Returns the descriptions that would be gotten by an object walker. - * @param {!cvox.CursorSelection} prevSel The previous selection. - * @param {!cvox.CursorSelection} sel The selection. - * @return {!Array<!cvox.NavDescription>} The descriptions. - * @private - */ -cvox.DescriptionUtil.getRawDescriptions_ = function(prevSel, sel) { - // Use a object walker in non-smart mode to traverse all of the - // nodes inside the current smart node and return their annotations. - var descriptions = []; - - // We want the descriptions to be in forward order whether or not the - // selection is reversed. - sel = sel.clone().setReversed(false); - var node = cvox.DescriptionUtil.subWalker_.sync(sel).start.node; - - var prevNode = prevSel.end.node; - var curSel = cvox.CursorSelection.fromNode(node); - - if (!curSel) { - return []; - } - - while (cvox.DomUtil.isDescendantOfNode(node, sel.start.node)) { - var ancestors = cvox.DomUtil.getUniqueAncestors(prevNode, node); - var description = cvox.DescriptionUtil.getDescriptionFromAncestors( - ancestors, true, cvox.ChromeVox.verbosity); - descriptions.push(description); - - curSel = cvox.DescriptionUtil.subWalker_.next(curSel); - if (!curSel) { - break; - } - - curSel = /** @type {!cvox.CursorSelection} */ (curSel); - prevNode = node; - node = curSel.start.node; - } - - return descriptions; -}; - -/** - * Returns the full descriptions of the child nodes that would be gotten by an - * object walker. - * @param {?Node} prevnode The previous element if there is one. - * @param {!Node} node The target element. - * @return {!Array<!cvox.NavDescription>} The descriptions. - */ -cvox.DescriptionUtil.getFullDescriptionsFromChildren = function( - prevnode, node) { - var descriptions = []; - if (!node) { - return descriptions; - } - var desc; - if (cvox.DomUtil.isLeafNode(node)) { - var ancestors; - if (prevnode) { - ancestors = cvox.DomUtil.getUniqueAncestors(prevnode, node); - } else { - ancestors = new Array(); - ancestors.push(node); - } - desc = cvox.DescriptionUtil.getDescriptionFromAncestors( - ancestors, true, cvox.ChromeVox.verbosity); - descriptions.push(desc); - return descriptions; - } - var originalNode = node; - var curSel = cvox.CursorSelection.fromNode(node); - if (!curSel) { - return descriptions; - } - var newNode = cvox.DescriptionUtil.subWalker_.sync(curSel).start.node; - curSel = cvox.CursorSelection.fromNode(newNode); - if (!curSel) { - return descriptions; - } - while (newNode && cvox.DomUtil.isDescendantOfNode(newNode, originalNode)) { - descriptions = descriptions.concat( - cvox.DescriptionUtil.getFullDescriptionsFromChildren( - prevnode, newNode)); - curSel = cvox.DescriptionUtil.subWalker_.next(curSel); - if (!curSel) { - break; - } - curSel = /** @type {!cvox.CursorSelection} */ (curSel); - prevnode = newNode; - newNode = curSel.start.node; - } - return descriptions; -}; - - -/** - * Modify the descriptions to say that it is a collection. - * @param {Array<cvox.NavDescription>} descriptions The descriptions. - * @private - */ -cvox.DescriptionUtil.insertCollectionDescription_ = function(descriptions) { - var annotations = cvox.DescriptionUtil.getAnnotations_(descriptions); - // If all of the items have the same annotation, describe it as a - // <annotation> collection with <n> items. Currently only enabled - // for links, but support should be added for any other type that - // makes sense. - if (descriptions.length >= 3 && descriptions[0].context.length == 0 && - annotations.length == 1 && annotations[0].length > 0 && - cvox.DescriptionUtil.isAnnotationCollection_(annotations[0])) { - var commonAnnotation = annotations[0]; - var firstContext = descriptions[0].context; - descriptions[0].context = ''; - for (var i = 0; i < descriptions.length; i++) { - descriptions[i].annotation = ''; - } - - descriptions.splice(0, 0, new cvox.NavDescription({ - context: firstContext, - text: '', - annotation: Msgs.getMsg( - 'collection', - [commonAnnotation, Msgs.getNumber(descriptions.length)]) - })); - } -}; - - -/** - * Pulls the annotations from a description array. - * @param {Array<cvox.NavDescription>} descriptions The descriptions. - * @return {Array<string>} The annotations. - * @private - */ -cvox.DescriptionUtil.getAnnotations_ = function(descriptions) { - var annotations = []; - for (var i = 0; i < descriptions.length; ++i) { - var description = descriptions[i]; - if (annotations.indexOf(description.annotation) == -1) { - // If we have an Internal link collection, call it Link collection. - // NOTE(deboer): The message comparison is a symptom of a bad design. - // I suspect this code belongs elsewhere but I don't know where, yet. - var linkMsg = Msgs.getMsg('role_link'); - if (description.annotation.toLowerCase().indexOf(linkMsg.toLowerCase()) != - -1) { - if (annotations.indexOf(linkMsg) == -1) { - annotations.push(linkMsg); - } - } else { - annotations.push(description.annotation); - } - } - } - return annotations; -}; - - -/** - * Returns true if this annotation should be grouped as a collection, - * meaning that instead of repeating the annotation for each item, we - * just announce <annotation> collection with <n> items at the front. - * - * Currently enabled for links, but could be extended to support other - * roles that make sense. - * - * @param {string} annotation The annotation text. - * @return {boolean} If this annotation should be a collection. - * @private - */ -cvox.DescriptionUtil.isAnnotationCollection_ = function(annotation) { - return (annotation == Msgs.getMsg('role_link')); -}; - -/** - * Determines whether to describe the exit of an ancestor chain. - * @param {Array<Node>} ancestors The ancestors exited during navigation. - * @return {boolean} The result. - * @private - */ -cvox.DescriptionUtil.shouldDescribeExit_ = function(ancestors) { - return ancestors.some(function(node) { - switch (node.tagName) { - case 'TABLE': - case 'MATH': - return true; - } - return cvox.AriaUtil.isLandmark(node); - }); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/dom_predicates.js b/chrome/browser/resources/chromeos/chromevox/common/dom_predicates.js deleted file mode 100644 index 3674383..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/dom_predicates.js +++ /dev/null
@@ -1,487 +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. - -/** - * @fileoverview A bunch of predicates that take as input an array of - * nodes with the unique ancestors of a node. They output true if a - * certain category of node has been found. - * - */ - -goog.provide('cvox.DomPredicates'); - - -/** - * Checkbox. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a checkbox. - */ -cvox.DomPredicates.checkboxPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if ((nodes[i].getAttribute && - nodes[i].getAttribute('role') == 'checkbox') || - (nodes[i].tagName == 'INPUT' && nodes[i].type == 'checkbox')) { - return nodes[i]; - } - } - return null; -}; - - -/** - * Radio button. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a radio button. - */ -cvox.DomPredicates.radioPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if ((nodes[i].getAttribute && nodes[i].getAttribute('role') == 'radio') || - (nodes[i].tagName == 'INPUT' && nodes[i].type == 'radio')) { - return nodes[i]; - } - } - return null; -}; - - -/** - * Slider. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a slider. - */ -cvox.DomPredicates.sliderPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if ((nodes[i].getAttribute && nodes[i].getAttribute('role') == 'slider') || - (nodes[i].tagName == 'INPUT' && nodes[i].type == 'range')) { - return nodes[i]; - } - } - return null; -}; - - -/** - * Graphic. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a graphic. - */ -cvox.DomPredicates.graphicPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if (nodes[i].tagName == 'IMG' || - (nodes[i].tagName == 'INPUT' && nodes[i].type == 'img')) { - return nodes[i]; - } - } - return null; -}; - - -/** - * Button. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a button. - */ -cvox.DomPredicates.buttonPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if ((nodes[i].getAttribute && nodes[i].getAttribute('role') == 'button') || - nodes[i].tagName == 'BUTTON' || - (nodes[i].tagName == 'INPUT' && nodes[i].type == 'submit') || - (nodes[i].tagName == 'INPUT' && nodes[i].type == 'button') || - (nodes[i].tagName == 'INPUT' && nodes[i].type == 'reset')) { - return nodes[i]; - } - } - return null; -}; - - -/** - * Combo box. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a combo box. - */ -cvox.DomPredicates.comboBoxPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if ((nodes[i].getAttribute && - nodes[i].getAttribute('role') == 'combobox') || - nodes[i].tagName == 'SELECT') { - return nodes[i]; - } - } - return null; -}; - - -/** - * Editable text field. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is an editable text field. - */ -cvox.DomPredicates.editTextPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if ((nodes[i].getAttribute && nodes[i].getAttribute('role') == 'textbox') || - nodes[i].tagName == 'TEXTAREA' || nodes[i].isContentEditable || - (nodes[i].tagName == 'INPUT' && - cvox.DomUtil.isInputTypeText(nodes[i]))) { - return nodes[i]; - } - } - return null; -}; - - -/** - * Heading. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a heading. - */ -cvox.DomPredicates.headingPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if (nodes[i].getAttribute && nodes[i].getAttribute('role') == 'heading') { - return nodes[i]; - } - switch (nodes[i].tagName) { - case 'H1': - case 'H2': - case 'H3': - case 'H4': - case 'H5': - case 'H6': - return nodes[i]; - } - } - return null; -}; - - -/** - * Heading level 1. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a heading level 1. - * TODO: handle ARIA headings with ARIA heading levels? - */ -cvox.DomPredicates.heading1Predicate = function(nodes) { - return cvox.DomPredicates.containsTagName_(nodes, 'H1'); -}; - - -/** - * Heading level 2. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a heading level 2. - */ -cvox.DomPredicates.heading2Predicate = function(nodes) { - return cvox.DomPredicates.containsTagName_(nodes, 'H2'); -}; - - -/** - * Heading level 3. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a heading level 3. - */ -cvox.DomPredicates.heading3Predicate = function(nodes) { - return cvox.DomPredicates.containsTagName_(nodes, 'H3'); -}; - - -/** - * Heading level 4. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a heading level 4. - */ -cvox.DomPredicates.heading4Predicate = function(nodes) { - return cvox.DomPredicates.containsTagName_(nodes, 'H4'); -}; - - -/** - * Heading level 5. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a heading level 5. - */ -cvox.DomPredicates.heading5Predicate = function(nodes) { - return cvox.DomPredicates.containsTagName_(nodes, 'H5'); -}; - - -/** - * Heading level 6. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a heading level 6. - */ -cvox.DomPredicates.heading6Predicate = function(nodes) { - return cvox.DomPredicates.containsTagName_(nodes, 'H6'); -}; - - -/** - * Link. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a link. - */ -cvox.DomPredicates.linkPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if ((nodes[i].getAttribute && nodes[i].getAttribute('role') == 'link') || - (nodes[i].tagName == 'A' && nodes[i].href)) { - return nodes[i]; - } - } - return null; -}; - - -/** - * Table. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a data table. - */ -cvox.DomPredicates.tablePredicate = function(nodes) { - // TODO(stoarca): Captions should always be allowed!! - var node = cvox.DomUtil.findTableNodeInList(nodes, {allowCaptions: true}); - if (node && !cvox.DomUtil.isLayoutTable(node)) { - return node; - } else { - return null; - } -}; - -/** - * Table Cell. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a table cell. - */ -cvox.DomPredicates.cellPredicate = function(nodes) { - for (var i = nodes.length - 1; i >= 0; --i) { - var node = nodes[i]; - if (node.tagName == 'TD' || node.tagName == 'TH' || - (node.getAttribute && node.getAttribute('role') == 'gridcell')) { - return node; - } - } - return null; -}; - - -/** - * Visited link. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a visited link. - */ -cvox.DomPredicates.visitedLinkPredicate = function(nodes) { - for (var i = nodes.length - 1; i >= 0; --i) { - if (cvox.DomPredicates.linkPredicate([nodes[i]]) && - cvox.ChromeVox.visitedUrls[nodes[i].href]) { - return nodes[i]; - } - } - return null; -}; - - -/** - * List. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a list. - */ -cvox.DomPredicates.listPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if ((nodes[i].getAttribute && nodes[i].getAttribute('role') == 'list') || - nodes[i].tagName == 'UL' || nodes[i].tagName == 'OL') { - return nodes[i]; - } - } - return null; -}; - - -/** - * List item. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a list item. - */ -cvox.DomPredicates.listItemPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if ((nodes[i].getAttribute && - nodes[i].getAttribute('role') == 'listitem') || - nodes[i].tagName == 'LI') { - return nodes[i]; - } - } - return null; -}; - - -/** - * Blockquote. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a blockquote. - */ -cvox.DomPredicates.blockquotePredicate = function(nodes) { - return cvox.DomPredicates.containsTagName_(nodes, 'BLOCKQUOTE'); -}; - - -/** - * Form field. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is any type of form field. - */ -cvox.DomPredicates.formFieldPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if (cvox.DomUtil.isControl(nodes[i])) { - return nodes[i]; - } - } - return null; -}; - - -/** - * ARIA landmark. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is an ARIA landmark. - */ -cvox.DomPredicates.landmarkPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if (cvox.AriaUtil.isLandmark(nodes[i])) { - return nodes[i]; - } - } - return null; -}; - - -/** - * @param {Array} arr Array of nodes. - * @param {string} tagName The name of the tag. - * @return {?Node} Node if obj is in the array. - * @private - */ -cvox.DomPredicates.containsTagName_ = function(arr, tagName) { - var i = arr.length; - while (i--) { - if (arr[i].tagName == tagName) { - return arr[i]; - } - } - return null; -}; - - -/** - * MathML expression - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a math expression. - */ -cvox.DomPredicates.mathPredicate = function(nodes) { - return cvox.DomUtil.findMathNodeInList(nodes); -}; - -/** - * SECTION: A section is anything that indicates a new section. This includes - * headings and landmarks. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is considered a section marker. - */ -cvox.DomPredicates.sectionPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if (cvox.DomUtil.isSemanticElt(nodes[i])) { - return nodes[i]; - } - if (cvox.AriaUtil.isLandmark(nodes[i])) { - return nodes[i]; - } - if (nodes[i].getAttribute && nodes[i].getAttribute('role') == 'heading') { - return nodes[i]; - } - switch (nodes[i].tagName) { - case 'H1': - case 'H2': - case 'H3': - case 'H4': - case 'H5': - case 'H6': - return nodes[i]; - } - } - return null; -}; - -/** - * CONTROL: A control is anything that the user can interact with. This includes - * form fields and links. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is considered a control. - */ -cvox.DomPredicates.controlPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if (cvox.DomUtil.isControl(nodes[i])) { - return nodes[i]; - } - if ((nodes[i].getAttribute && nodes[i].getAttribute('role') == 'link') || - (nodes[i].tagName == 'A' && nodes[i].href)) { - return nodes[i]; - } - } - return null; -}; - -/** - * Caption. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a caption. - */ -cvox.DomPredicates.captionPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if (nodes[i].tagName == 'CAPTION') { - return nodes[i]; - } - } - return null; -}; - -/** - * Article. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a article. - */ -cvox.DomPredicates.articlePredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if ((nodes[i].getAttribute && nodes[i].getAttribute('role') == 'article') || - nodes[i].tagName == 'ARTICLE') { - return nodes[i]; - } - } - return null; -}; - -/** - * Media. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a media widget (video or audio). - */ -cvox.DomPredicates.mediaPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if (nodes[i].tagName == 'AUDIO' || nodes[i].tagName == 'VIDEO') { - return nodes[i]; - } - } - return null; -}; - - -/** - * Ordered List. - * @param {Array<Node>} nodes An array of nodes to check. - * @return {?Node} Node in the array that is a ordered list. - */ -cvox.DomPredicates.orderedListPredicate = function(nodes) { - for (var i = 0; i < nodes.length; i++) { - if (nodes[i].tagName == 'OL') { - return nodes[i]; - } - } - return null; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/dom_util.js b/chrome/browser/resources/chromeos/chromevox/common/dom_util.js deleted file mode 100644 index 70cd5a2..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/dom_util.js +++ /dev/null
@@ -1,2612 +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. - -/** - * @fileoverview A collection of JavaScript utilities used to simplify working - * with the DOM. - */ - - -goog.provide('cvox.DomUtil'); - -goog.require('cvox.AbstractTts'); -goog.require('cvox.AriaUtil'); -goog.require('cvox.ChromeVox'); -goog.require('cvox.DomPredicates'); -goog.require('cvox.Memoize'); -goog.require('cvox.NodeState'); -goog.require('cvox.XpathUtil'); - - - -/** - * Create the namespace - * @constructor - */ -cvox.DomUtil = function() {}; - - -/** - * Note: If you are adding a new mapping, the new message identifier needs a - * corresponding braille message. For example, a message id 'tag_button' - * requires another message 'tag_button_brl' within messages.js. - * @type {Object} - */ -cvox.DomUtil.INPUT_TYPE_TO_INFORMATION_TABLE_MSG = { - 'button': 'role_button', - 'checkbox': 'role_checkbox', - 'color': 'input_type_color', - 'datetime': 'input_type_datetime', - 'datetime-local': 'input_type_datetime_local', - 'date': 'input_type_date', - 'email': 'input_type_email', - 'file': 'input_type_file', - 'image': 'role_button', - 'month': 'input_type_month', - 'number': 'input_type_number', - 'password': 'input_type_password', - 'radio': 'role_radio', - 'range': 'role_slider', - 'reset': 'input_type_reset', - 'search': 'input_type_search', - 'submit': 'role_button', - 'tel': 'input_type_number', - 'text': 'input_type_text', - 'url': 'input_type_url', - 'week': 'input_type_week' -}; - - -/** - * Note: If you are adding a new mapping, the new message identifier needs a - * corresponding braille message. For example, a message id 'tag_button' - * requires another message 'tag_button_brl' within messages.js. - * @type {Object} - */ -cvox.DomUtil.TAG_TO_INFORMATION_TABLE_VERBOSE_MSG = { - 'A': 'role_link', - 'ARTICLE': 'tag_article', - 'ASIDE': 'tag_aside', - 'AUDIO': 'tag_audio', - 'BUTTON': 'role_button', - 'FOOTER': 'tag_footer', - 'H1': 'tag_h1', - 'H2': 'tag_h2', - 'H3': 'tag_h3', - 'H4': 'tag_h4', - 'H5': 'tag_h5', - 'H6': 'tag_h6', - 'HEADER': 'tag_header', - 'HGROUP': 'tag_hgroup', - 'LI': 'tag_li', - 'MARK': 'tag_mark', - 'NAV': 'tag_nav', - 'OL': 'tag_ol', - 'SECTION': 'tag_section', - 'SELECT': 'tag_select', - 'TABLE': 'tag_table', - 'TEXTAREA': 'tag_textarea', - 'TIME': 'tag_time', - 'UL': 'tag_ul', - 'VIDEO': 'tag_video' -}; - -/** - * ChromeVox does not speak the omitted tags. - * @type {Object} - */ -cvox.DomUtil.TAG_TO_INFORMATION_TABLE_BRIEF_MSG = { - 'AUDIO': 'tag_audio', - 'BUTTON': 'role_button', - 'SELECT': 'tag_select', - 'TABLE': 'tag_table', - 'TEXTAREA': 'tag_textarea', - 'VIDEO': 'tag_video' -}; - -/** - * These tags are treated as text formatters. - * @type {Array<string>} - */ -cvox.DomUtil.FORMATTING_TAGS = [ - 'B', 'BIG', 'CITE', 'CODE', 'DFN', 'EM', 'I', 'KBD', 'SAMP', 'SMALL', 'SPAN', - 'STRIKE', 'STRONG', 'SUB', 'SUP', 'U', 'VAR' -]; - -/** - * Determine if the given node is visible on the page. This does not check if - * it is inside the document view-port as some sites try to communicate with - * screen readers with such elements. - * @param {Node} node The node to determine as visible or not. - * @param {{checkAncestors: (boolean|undefined), - checkDescendants: (boolean|undefined)}=} opt_options - * In certain cases, we already have information - * on the context of the node. To improve performance and avoid redundant - * operations, you may wish to turn certain visibility checks off by - * passing in an options object. The following properties are configurable: - * checkAncestors: {boolean=} True if we should check the ancestor chain - * for forced invisibility traits of descendants. True by default. - * checkDescendants: {boolean=} True if we should consider descendants of - * the given node for visible elements. True by default. - * @return {boolean} True if the node is visible. - */ -cvox.DomUtil.isVisible = function(node, opt_options) { - var checkAncestors = true; - var checkDescendants = true; - if (opt_options) { - if (opt_options.checkAncestors !== undefined) { - checkAncestors = opt_options.checkAncestors; - } - if (opt_options.checkDescendants !== undefined) { - checkDescendants = opt_options.checkDescendants; - } - } - - // Generate a unique function name based on the arguments, and - // memoize the result of the internal visibility computation so that - // within the same call stack, we don't need to recompute the visibility - // of the same node. - var fname = 'isVisible-' + checkAncestors + '-' + checkDescendants; - return /** @type {boolean} */ (cvox.Memoize.memoize( - cvox.DomUtil.computeIsVisible_.bind( - this, node, checkAncestors, checkDescendants), - fname, node)); -}; - -/** - * Implementation of |cvox.DomUtil.isVisible|. - * @param {Node} node The node to determine as visible or not. - * @param {boolean} checkAncestors True if we should check the ancestor chain - * for forced invisibility traits of descendants. - * @param {boolean} checkDescendants True if we should consider descendants of - * the given node for visible elements. - * @return {boolean} True if the node is visible. - * @private - */ -cvox.DomUtil.computeIsVisible_ = function( - node, checkAncestors, checkDescendants) { - // If the node is an iframe that we can never inject into, consider it hidden. - if (node.tagName == 'IFRAME' && !node.src) { - return false; - } - - // If the node is being forced visible by ARIA, ARIA wins. - if (cvox.AriaUtil.isForcedVisibleRecursive(node)) { - return true; - } - - // Confirm that no subtree containing node is invisible. - if (checkAncestors && cvox.DomUtil.hasInvisibleAncestor_(node)) { - return false; - } - - // If the node's subtree has a visible node, we declare it as visible. - if (cvox.DomUtil.hasVisibleNodeSubtree_(node, checkDescendants)) { - return true; - } - - return false; -}; - - -/** - * Checks the ancestor chain for the given node for invisibility. If an - * ancestor is invisible and this cannot be overriden by a descendant, - * we return true. If the element is not a descendant of the document - * element it will return true (invisible). - * @param {Node} node The node to check the ancestor chain for. - * @return {boolean} True if a descendant is invisible. - * @private - */ -cvox.DomUtil.hasInvisibleAncestor_ = function(node) { - var ancestor = node; - while (ancestor = ancestor.parentElement) { - var style = document.defaultView.getComputedStyle(ancestor, null); - if (cvox.DomUtil.isInvisibleStyle(style, true)) { - return true; - } - // Once we reach the document element and we haven't found anything - // invisible yet, we're done. If we exit the while loop and never found - // the document element, the element wasn't part of the DOM and thus it's - // invisible. - if (ancestor == document.documentElement) { - return false; - } - } - return true; -}; - - -/** - * Checks for a visible node in the subtree defined by root. - * @param {Node} root The root of the subtree to check. - * @param {boolean} recursive Whether or not to check beyond the root of the - * subtree for visible nodes. This option exists for performance tuning. - * Sometimes we already have information about the descendants, and we do - * not need to check them again. - * @return {boolean} True if the subtree contains a visible node. - * @private - */ -cvox.DomUtil.hasVisibleNodeSubtree_ = function(root, recursive) { - if (!(root instanceof Element)) { - if (!root.parentElement) { - return false; - } - var parentStyle = - document.defaultView.getComputedStyle(root.parentElement, null); - var isVisibleParent = !cvox.DomUtil.isInvisibleStyle(parentStyle); - return isVisibleParent; - } - - var rootStyle = document.defaultView.getComputedStyle(root, null); - var isRootVisible = !cvox.DomUtil.isInvisibleStyle(rootStyle); - if (isRootVisible) { - return true; - } - var isSubtreeInvisible = cvox.DomUtil.isInvisibleStyle(rootStyle, true); - if (!recursive || isSubtreeInvisible) { - return false; - } - - // Carry on with a recursive check of the descendants. - var children = root.childNodes; - for (var i = 0; i < children.length; i++) { - var child = children[i]; - if (cvox.DomUtil.hasVisibleNodeSubtree_(child, recursive)) { - return true; - } - } - return false; -}; - - -/** - * Determines whether or a node is not visible according to any CSS criteria - * that can hide it. - * @param {CSSStyleDeclaration} style The style of the node to determine as - * invsible or not. - * @param {boolean=} opt_strict If set to true, we do not check the visibility - * style attribute. False by default. - * CAUTION: Checking the visibility style attribute can result in returning - * true (invisible) even when an element has have visible descendants. This - * is because an element with visibility:hidden can have descendants that - * are visible. - * @return {boolean} True if the node is invisible. - */ -cvox.DomUtil.isInvisibleStyle = function(style, opt_strict) { - if (!style) { - return false; - } - if (style.display == 'none') { - return true; - } - // Opacity values range from 0.0 (transparent) to 1.0 (fully opaque). - if (parseFloat(style.opacity) == 0) { - return true; - } - // Visibility style tests for non-strict checking. - if (!opt_strict && - (style.visibility == 'hidden' || style.visibility == 'collapse')) { - return true; - } - return false; -}; - - -/** - * Determines whether a control should be announced as disabled. - * - * @param {Node} node The node to be examined. - * @return {boolean} Whether or not the node is disabled. - */ -cvox.DomUtil.isDisabled = function(node) { - if (node.disabled) { - return true; - } - var ancestor = node; - while (ancestor = ancestor.parentElement) { - if (ancestor.tagName == 'FIELDSET' && ancestor.disabled) { - return true; - } - } - return false; -}; - - -/** - * Determines whether a node is an HTML5 semantic element - * - * @param {Node} node The node to be checked. - * @return {boolean} True if the node is an HTML5 semantic element. - */ -cvox.DomUtil.isSemanticElt = function(node) { - if (node.tagName) { - var tag = node.tagName; - if ((tag == 'SECTION') || (tag == 'NAV') || (tag == 'ARTICLE') || - (tag == 'ASIDE') || (tag == 'HGROUP') || (tag == 'HEADER') || - (tag == 'FOOTER') || (tag == 'TIME') || (tag == 'MARK')) { - return true; - } - } - return false; -}; - - -/** - * Determines whether or not a node is a leaf node. - * TODO (adu): This function is doing a lot more than just checking for the - * presence of descendants. We should be more precise in the documentation - * about what we mean by leaf node. - * - * @param {Node} node The node to be checked. - * @param {boolean=} opt_allowHidden Allows hidden nodes during descent. - * @return {boolean} True if the node is a leaf node. - */ -cvox.DomUtil.isLeafNode = function(node, opt_allowHidden) { - // If it's not an Element, then it's a leaf if it has no first child. - if (!(node instanceof Element)) { - return (node.firstChild == null); - } - - // Now we know for sure it's an element. - var element = /** @type {Element} */ (node); - if (!opt_allowHidden && - !cvox.DomUtil.isVisible(element, {checkAncestors: false})) { - return true; - } - if (!opt_allowHidden && cvox.AriaUtil.isHidden(element)) { - return true; - } - if (cvox.AriaUtil.isLeafElement(element)) { - return true; - } - switch (element.tagName) { - case 'OBJECT': - case 'EMBED': - case 'VIDEO': - case 'AUDIO': - case 'IFRAME': - case 'FRAME': - return true; - } - - if (cvox.DomPredicates.linkPredicate([element])) { - return !cvox.DomUtil.findNode(element, function(node) { - return !!cvox.DomPredicates.headingPredicate([node]); - }); - } - if (cvox.DomUtil.isLeafLevelControl(element)) { - return true; - } - if (!element.firstChild) { - return true; - } - if (cvox.DomUtil.isMath(element)) { - return true; - } - if (cvox.DomPredicates.headingPredicate([element])) { - return !cvox.DomUtil.findNode(element, function(n) { - return !!cvox.DomPredicates.controlPredicate([n]); - }); - } - return false; -}; - - -/** - * Determines whether or not a node is or is the descendant of a node - * with a particular tag or class name. - * - * @param {Node} node The node to be checked. - * @param {?string} tagName The tag to check for, or null if the tag - * doesn't matter. - * @param {?string=} className The class to check for, or null if the class - * doesn't matter. - * @return {boolean} True if the node or one of its ancestor has the specified - * tag. - */ -cvox.DomUtil.isDescendantOf = function(node, tagName, className) { - while (node) { - if (tagName && className && (node.tagName && (node.tagName == tagName)) && - (node.className && (node.className == className))) { - return true; - } else if ( - tagName && !className && (node.tagName && (node.tagName == tagName))) { - return true; - } else if ( - !tagName && className && - (node.className && (node.className == className))) { - return true; - } - node = node.parentNode; - } - return false; -}; - - -/** - * Determines whether or not a node is or is the descendant of another node. - * - * @param {Object} node The node to be checked. - * @param {Object} ancestor The node to see if it's a descendant of. - * @return {boolean} True if the node is ancestor or is a descendant of it. - */ -cvox.DomUtil.isDescendantOfNode = function(node, ancestor) { - while (node && ancestor) { - if (node.isSameNode(ancestor)) { - return true; - } - node = node.parentNode; - } - return false; -}; - - -/** - * Remove all whitespace from the beginning and end, and collapse all - * inner strings of whitespace to a single space. - * @param {string} str The input string. - * @return {string} The string with whitespace collapsed. - */ -cvox.DomUtil.collapseWhitespace = function(str) { - return str.replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, ''); -}; - -/** - * Gets the base label of a node. I don't know exactly what this is. - * - * @param {Node} node The node to get the label from. - * @param {boolean=} recursive Whether or not the element's subtree - * should be used; true by default. - * @param {boolean=} includeControls Whether or not controls in the subtree - * should be included; true by default. - * @return {string} The base label of the node. - * @private - */ -cvox.DomUtil.getBaseLabel_ = function(node, recursive, includeControls) { - var label = ''; - if (node.hasAttribute) { - if (node.hasAttribute('aria-labelledby')) { - var labelNodeIds = node.getAttribute('aria-labelledby').split(' '); - for (var labelNodeId, i = 0; labelNodeId = labelNodeIds[i]; i++) { - var labelNode = document.getElementById(labelNodeId); - if (labelNode) { - label += ' ' + - cvox.DomUtil.getName(labelNode, true, includeControls, true); - } - } - } else if (node.hasAttribute('aria-label')) { - label = node.getAttribute('aria-label'); - } else if (node.constructor == HTMLImageElement) { - label = cvox.DomUtil.getImageTitle(node); - } else if (node.tagName == 'FIELDSET') { - // Other labels will trump fieldset legend with this implementation. - // Depending on how this works out on the web, we may later switch this - // to appending the fieldset legend to any existing label. - var legends = node.getElementsByTagName('LEGEND'); - label = ''; - for (var legend, i = 0; legend = legends[i]; i++) { - label += ' ' + cvox.DomUtil.getName(legend, true, includeControls); - } - } - - if (label.length == 0 && node && node.id) { - var labelFor = document.querySelector('label[for="' + node.id + '"]'); - if (labelFor) { - label = cvox.DomUtil.getName(labelFor, recursive, includeControls); - } - } - } - return cvox.DomUtil.collapseWhitespace(label); -}; - -/** - * Gets the nearest label in the ancestor chain, if one exists. - * @param {Node} node The node to start from. - * @return {string} The label. - * @private - */ -cvox.DomUtil.getNearestAncestorLabel_ = function(node) { - var label = ''; - var enclosingLabel = node; - while (enclosingLabel && enclosingLabel.tagName != 'LABEL') { - enclosingLabel = enclosingLabel.parentElement; - } - if (enclosingLabel && !enclosingLabel.hasAttribute('for')) { - // Get all text from the label but don't include any controls. - label = cvox.DomUtil.getName(enclosingLabel, true, false); - } - return label; -}; - - -/** - * Gets the name for an input element. - * @param {Node} node The node. - * @return {string} The name. - * @private - */ -cvox.DomUtil.getInputName_ = function(node) { - var label = ''; - if (node.type == 'image') { - label = cvox.DomUtil.getImageTitle(node); - } else if (node.type == 'submit') { - if (node.hasAttribute('value')) { - label = node.getAttribute('value'); - } else { - label = 'Submit'; - } - } else if (node.type == 'reset') { - if (node.hasAttribute('value')) { - label = node.getAttribute('value'); - } else { - label = 'Reset'; - } - } else if (node.type == 'button') { - if (node.hasAttribute('value')) { - label = node.getAttribute('value'); - } - } - return label; -}; - -/** - * Wraps getName_ with marking and unmarking nodes so that infinite loops - * don't occur. This is the ugly way to solve this; getName should not ever - * do a recursive call somewhere above it in the tree. - * @param {Node} node See getName_. - * @param {boolean=} recursive See getName_. - * @param {boolean=} includeControls See getName_. - * @param {boolean=} opt_allowHidden Allows hidden nodes in name computation. - * @return {string} See getName_. - */ -cvox.DomUtil.getName = function( - node, recursive, includeControls, opt_allowHidden) { - if (!node || node.cvoxGetNameMarked == true) { - return ''; - } - node.cvoxGetNameMarked = true; - var ret = - cvox.DomUtil.getName_(node, recursive, includeControls, opt_allowHidden); - node.cvoxGetNameMarked = false; - var prefix = cvox.DomUtil.getPrefixText(node); - return prefix + ret; -}; - -// TODO(dtseng): Seems like this list should be longer... -/** - * Determines if a node has a name obtained from concatinating the names of its - * children. - * @param {!Node} node The node under consideration. - * @param {boolean=} opt_allowHidden Allows hidden nodes in name computation. - * @return {boolean} True if node has name based on children. - * @private - */ -cvox.DomUtil.hasChildrenBasedName_ = function(node, opt_allowHidden) { - if (cvox.DomPredicates.linkPredicate([node]) || - cvox.DomPredicates.headingPredicate([node]) || node.tagName == 'BUTTON' || - cvox.AriaUtil.isControlWidget(node) || - !cvox.DomUtil.isLeafNode(node, opt_allowHidden)) { - return true; - } else { - return false; - } -}; - -/** - * Get the name of a node: this includes all static text content and any - * HTML-author-specified label, title, alt text, aria-label, etc. - but - * does not include: - * - the user-generated control value (use getValue) - * - the current state (use getState) - * - the role (use getRole) - * - * Order of precedence: - * Text content if it's a text node. - * aria-labelledby - * aria-label - * alt (for an image) - * title - * label (for a control) - * placeholder (for an input element) - * recursive calls to getName on all children - * - * @param {Node} node The node to get the name from. - * @param {boolean=} recursive Whether or not the element's subtree should - * be used; true by default. - * @param {boolean=} includeControls Whether or not controls in the subtree - * should be included; true by default. - * @param {boolean=} opt_allowHidden Allows hidden nodes in name computation. - * @return {string} The name of the node. - * @private - */ -cvox.DomUtil.getName_ = function( - node, recursive, includeControls, opt_allowHidden) { - if (typeof(recursive) === 'undefined') { - recursive = true; - } - if (typeof(includeControls) === 'undefined') { - includeControls = true; - } - - if (node.constructor == Text) { - return node.data; - } - - var label = cvox.DomUtil.getBaseLabel_(node, recursive, includeControls); - - if (label.length == 0 && cvox.DomUtil.isControl(node)) { - label = cvox.DomUtil.getNearestAncestorLabel_(node); - } - - if (label.length == 0 && node.constructor == HTMLInputElement) { - label = cvox.DomUtil.getInputName_(node); - } - - if (cvox.DomUtil.isInputTypeText(node) && node.hasAttribute('placeholder')) { - var placeholder = node.getAttribute('placeholder'); - if (label.length > 0) { - if (cvox.DomUtil.getValue(node).length > 0) { - return label; - } else { - return label + ' with hint ' + placeholder; - } - } else { - return placeholder; - } - } - - if (label.length > 0) { - return label; - } - - // Fall back to naming via title only if there is no text content. - if (cvox.DomUtil.collapseWhitespace(node.textContent).length == 0 && - node.hasAttribute && node.hasAttribute('title')) { - return node.getAttribute('title'); - } - - if (!recursive) { - return ''; - } - - if (cvox.AriaUtil.isCompositeControl(node)) { - return ''; - } - if (cvox.DomUtil.hasChildrenBasedName_(node, opt_allowHidden)) { - return cvox.DomUtil.getNameFromChildren( - node, includeControls, opt_allowHidden); - } - return ''; -}; - - -/** - * Get the name from the children of a node, not including the node itself. - * - * @param {Node} node The node to get the name from. - * @param {boolean=} includeControls Whether or not controls in the subtree - * should be included; true by default. - * @param {boolean=} opt_allowHidden Allow hidden nodes in name computation. - * @return {string} The concatenated text of all child nodes. - */ -cvox.DomUtil.getNameFromChildren = function( - node, includeControls, opt_allowHidden) { - if (includeControls == undefined) { - includeControls = true; - } - var name = ''; - var delimiter = ''; - for (var i = 0; i < node.childNodes.length; i++) { - var child = node.childNodes[i]; - var prevChild = node.childNodes[i - 1] || child; - if (!includeControls && cvox.DomUtil.isControl(child)) { - continue; - } - var isVisible = cvox.DomUtil.isVisible(child, {checkAncestors: false}); - if (opt_allowHidden || (isVisible && !cvox.AriaUtil.isHidden(child))) { - delimiter = (prevChild.tagName == 'SPAN' || child.tagName == 'SPAN' || - child.parentNode.tagName == 'SPAN') ? - '' : - ' '; - name += delimiter + cvox.DomUtil.getName(child, true, includeControls); - } - } - - return name; -}; - -/** - * Get any prefix text for the given node. - * This includes list style text for the leftmost leaf node under a listitem. - * @param {Node} node Compute prefix for this node. - * @param {number=} opt_index Starting offset into the given node's text. - * @return {string} Prefix text, if any. - */ -cvox.DomUtil.getPrefixText = function(node, opt_index) { - opt_index = opt_index || 0; - - // Generate list style text. - var ancestors = cvox.DomUtil.getAncestors(node); - var prefix = ''; - var firstListitem = cvox.DomPredicates.listItemPredicate(ancestors); - - var leftmost = firstListitem; - while (leftmost && leftmost.firstChild) { - leftmost = leftmost.firstChild; - } - - // Do nothing if we're not at the leftmost leaf. - if (firstListitem && firstListitem.parentNode && opt_index == 0 && - firstListitem.parentNode.tagName == 'OL' && node == leftmost && - document.defaultView.getComputedStyle(firstListitem.parentElement) - .listStyleType != 'none') { - var items = cvox.DomUtil.toArray(firstListitem.parentNode.children) - .filter(function(li) { - return li.tagName == 'LI'; - }); - var position = items.indexOf(firstListitem) + 1; - // TODO(dtseng): Support all list style types. - if (document.defaultView.getComputedStyle(firstListitem.parentElement) - .listStyleType.indexOf('latin') != -1) { - position--; - prefix = String.fromCharCode('A'.charCodeAt(0) + position % 26); - } else { - prefix = position; - } - prefix += '. '; - } - return prefix; -}; - - -/** - * Use heuristics to guess at the label of a control, to be used if one - * is not explicitly set in the DOM. This is useful when a control - * field gets focus, but probably not useful when browsing the page - * element at a time. - * @param {Node} node The node to get the label from. - * @return {string} The name of the control, using heuristics. - */ -cvox.DomUtil.getControlLabelHeuristics = function(node) { - // If the node explicitly has aria-label or title set to '', - // treat it the same way as alt='' and do not guess - just assume - // the web developer knew what they were doing and wanted - // no title/label for that control. - if (node.hasAttribute && - ((node.hasAttribute('aria-label') && - (node.getAttribute('aria-label') == '')) || - (node.hasAttribute('aria-title') && - (node.getAttribute('aria-title') == '')))) { - return ''; - } - - // TODO (clchen, rshearer): Implement heuristics for getting the label - // information from the table headers once the code for getting table - // headers quickly is implemented. - - // If no description has been found yet and heuristics are enabled, - // then try getting the content from the closest node. - var prevNode = cvox.DomUtil.previousLeafNode(node); - var prevTraversalCount = 0; - while (prevNode && - (!cvox.DomUtil.hasContent(prevNode) || - cvox.DomUtil.isControl(prevNode))) { - prevNode = cvox.DomUtil.previousLeafNode(prevNode); - prevTraversalCount++; - } - var nextNode = cvox.DomUtil.directedNextLeafNode(node); - var nextTraversalCount = 0; - while (nextNode && - (!cvox.DomUtil.hasContent(nextNode) || - cvox.DomUtil.isControl(nextNode))) { - nextNode = cvox.DomUtil.directedNextLeafNode(nextNode); - nextTraversalCount++; - } - var guessedLabelNode; - if (prevNode && nextNode) { - var parentNode = node; - // Count the number of parent nodes until there is a shared parent; the - // label is most likely in the same branch of the DOM as the control. - // TODO (chaitanyag): Try to generalize this algorithm and move it to - // its own function in DOM Utils. - var prevCount = 0; - while (parentNode) { - if (cvox.DomUtil.isDescendantOfNode(prevNode, parentNode)) { - break; - } - parentNode = parentNode.parentNode; - prevCount++; - } - parentNode = node; - var nextCount = 0; - while (parentNode) { - if (cvox.DomUtil.isDescendantOfNode(nextNode, parentNode)) { - break; - } - parentNode = parentNode.parentNode; - nextCount++; - } - guessedLabelNode = nextCount < prevCount ? nextNode : prevNode; - } else { - guessedLabelNode = prevNode || nextNode; - } - if (guessedLabelNode) { - return cvox.DomUtil.collapseWhitespace( - cvox.DomUtil.getValue(guessedLabelNode) + ' ' + - cvox.DomUtil.getName(guessedLabelNode)); - } - - return ''; -}; - - -/** - * Get the text value of a node: the selected value of a select control or the - * current text of a text control. Does not return the state of a checkbox - * or radio button. - * - * Not recursive. - * - * @param {Node} node The node to get the value from. - * @return {string} The value of the node. - */ -cvox.DomUtil.getValue = function(node) { - var activeDescendant = cvox.AriaUtil.getActiveDescendant(node); - if (activeDescendant) { - return cvox.DomUtil.collapseWhitespace( - cvox.DomUtil.getValue(activeDescendant) + ' ' + - cvox.DomUtil.getName(activeDescendant)); - } - - if (node.constructor == HTMLSelectElement) { - node = /** @type {HTMLSelectElement} */ (node); - var value = ''; - var start = node.selectedOptions ? node.selectedOptions[0] : null; - var end = node.selectedOptions ? - node.selectedOptions[node.selectedOptions.length - 1] : - null; - // TODO(dtseng): Keeping this stateless means we describe the start and end - // of the selection only since we don't know which was added or - // removed. Once we keep the previous selection, we can read the diff. - if (start && end && start != end) { - value = Msgs.getMsg('selected_options_value', [start.text, end.text]); - } else if (start) { - value = start.text + ''; - } - return value; - } - - if (node.constructor == HTMLTextAreaElement) { - return node.value; - } - - if (node.constructor == HTMLInputElement) { - switch (node.type) { - // Returning '' for inputs that are covered by getName. - case 'hidden': - case 'image': - case 'submit': - case 'reset': - case 'button': - case 'checkbox': - case 'radio': - return ''; - case 'password': - return node.value.replace(/./g, 'dot '); - default: - return node.value; - } - } - - if (node.isContentEditable) { - return cvox.DomUtil.getNameFromChildren(node, true); - } - - return ''; -}; - - -/** - * Given an image node, return its title as a string. The preferred title - * is always the alt text, and if that's not available, then the title - * attribute. If neither of those are available, it attempts to construct - * a title from the filename, and if all else fails returns the word Image. - * @param {Node} node The image node. - * @return {string} The title of the image. - */ -cvox.DomUtil.getImageTitle = function(node) { - var text; - if (node.hasAttribute('alt')) { - text = node.alt; - } else if (node.hasAttribute('title')) { - text = node.title; - } else { - var url = node.src; - if (url.substring(0, 4) != 'data') { - var filename = - url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('.')); - - // Hack to not speak the filename if it's ridiculously long. - if (filename.length >= 1 && filename.length <= 16) { - text = filename + ' Image'; - } else { - text = 'Image'; - } - } else { - text = 'Image'; - } - } - return text; -}; - - -/** - * Search the whole page for any aria-labelledby attributes and collect - * the complete set of ids they map to, so that we can skip elements that - * just label other elements and not double-speak them. We cache this - * result and then throw it away at the next event loop. - * @return {Object<boolean>} Set of all ids that are mapped by aria-labelledby. - */ -cvox.DomUtil.getLabelledByTargets = function() { - if (cvox.labelledByTargets) { - return cvox.labelledByTargets; - } - - // Start by getting all elements with - // aria-labelledby on the page since that's probably a short list, - // then see if any of those ids overlap with an id in this element's - // ancestor chain. - var labelledByElements = document.querySelectorAll('[aria-labelledby]'); - var labelledByTargets = {}; - for (var i = 0; i < labelledByElements.length; ++i) { - var element = labelledByElements[i]; - var attrValue = element.getAttribute('aria-labelledby'); - var ids = attrValue.split(/ +/); - for (var j = 0; j < ids.length; j++) { - labelledByTargets[ids[j]] = true; - } - } - cvox.labelledByTargets = labelledByTargets; - - window.setTimeout(function() { - cvox.labelledByTargets = null; - }, 0); - - return labelledByTargets; -}; - - -/** - * Determines whether or not a node has content. - * - * @param {Node} node The node to be checked. - * @return {boolean} True if the node has content. - */ -cvox.DomUtil.hasContent = function(node) { - // Memoize the result of the internal content computation so that - // within the same call stack, we don't need to redo the computation - // on the same node twice. - return /** @type {boolean} */ (cvox.Memoize.memoize( - cvox.DomUtil.computeHasContent_.bind(this), 'hasContent', node)); -}; - -/** - * Internal implementation of |cvox.DomUtil.hasContent|. - * - * @param {Node} node The node to be checked. - * @return {boolean} True if the node has content. - * @private - */ -cvox.DomUtil.computeHasContent_ = function(node) { - // nodeType:8 == COMMENT_NODE - if (node.nodeType == 8) { - return false; - } - - // Exclude anything in the head - if (cvox.DomUtil.isDescendantOf(node, 'HEAD')) { - return false; - } - - // Exclude script nodes - if (cvox.DomUtil.isDescendantOf(node, 'SCRIPT')) { - return false; - } - - // Exclude noscript nodes - if (cvox.DomUtil.isDescendantOf(node, 'NOSCRIPT')) { - return false; - } - - // Exclude noembed nodes since NOEMBED is deprecated. We treat - // noembed as having not content rather than try to get its content since - // Chrome will return raw HTML content rather than a valid DOM subtree. - if (cvox.DomUtil.isDescendantOf(node, 'NOEMBED')) { - return false; - } - - // Exclude style nodes that have been dumped into the body. - if (cvox.DomUtil.isDescendantOf(node, 'STYLE')) { - return false; - } - - // Check the style to exclude undisplayed/hidden nodes. - if (!cvox.DomUtil.isVisible(node)) { - return false; - } - - // Ignore anything that is hidden by ARIA. - if (cvox.AriaUtil.isHidden(node)) { - return false; - } - - // We need to speak controls, including those with no value entered. We - // therefore treat visible controls as if they had content, and return true - // below. - if (cvox.DomUtil.isControl(node)) { - return true; - } - - // Videos are always considered to have content so that we can navigate to - // and use the controls of the video widget. - if (cvox.DomUtil.isDescendantOf(node, 'VIDEO')) { - return true; - } - // Audio elements are always considered to have content so that we can - // navigate to and use the controls of the audio widget. - if (cvox.DomUtil.isDescendantOf(node, 'AUDIO')) { - return true; - } - - // We want to try to jump into an iframe iff it has a src attribute. - // For right now, we will avoid iframes without any content in their src since - // ChromeVox is not being injected in those cases and will cause the user to - // get stuck. - // TODO (clchen, dmazzoni): Manually inject ChromeVox for iframes without src. - if ((node.tagName == 'IFRAME') && (node.src) && - (!node.src.startsWith('javascript:'))) { - return true; - } - - var controlQuery = 'button,input,select,textarea'; - - // Skip any non-control content inside of a label if the label is - // correctly associated with a control, the label text will get spoken - // when the control is reached. - var enclosingLabel = node.parentElement; - while (enclosingLabel && enclosingLabel.tagName != 'LABEL') { - enclosingLabel = enclosingLabel.parentElement; - } - if (enclosingLabel) { - var embeddedControl = enclosingLabel.querySelector(controlQuery); - if (enclosingLabel.hasAttribute('for')) { - var targetId = enclosingLabel.getAttribute('for'); - var targetNode = document.getElementById(targetId); - if (targetNode && cvox.DomUtil.isControl(targetNode) && - !embeddedControl) { - return false; - } - } else if (embeddedControl) { - return false; - } - } - - // Skip any non-control content inside of a legend if the legend is correctly - // nested within a fieldset. The legend text will get spoken when the fieldset - // is reached. - var enclosingLegend = node.parentElement; - while (enclosingLegend && enclosingLegend.tagName != 'LEGEND') { - enclosingLegend = enclosingLegend.parentElement; - } - if (enclosingLegend) { - var legendAncestor = enclosingLegend.parentElement; - while (legendAncestor && legendAncestor.tagName != 'FIELDSET') { - legendAncestor = legendAncestor.parentElement; - } - var embeddedControl = - legendAncestor && legendAncestor.querySelector(controlQuery); - if (legendAncestor && !embeddedControl) { - return false; - } - } - - if (cvox.DomPredicates.linkPredicate([node])) { - return true; - } - - // At this point, any non-layout tables are considered to have content. - // For layout tables, it is safe to consider them as without content since the - // sync operation would select a descendant of a layout table if possible. The - // only instance where |hasContent| gets called on a layout table is if no - // descendants have content (see |AbstractNodeWalker.next|). - if (node.tagName == 'TABLE' && !cvox.DomUtil.isLayoutTable(node)) { - return true; - } - - // Math is always considered to have content. - if (cvox.DomUtil.isMath(node)) { - return true; - } - - if (cvox.DomPredicates.headingPredicate([node])) { - return true; - } - - if (cvox.DomUtil.isFocusable(node)) { - return true; - } - - // Skip anything referenced by another element on the page - // via aria-labelledby. - var labelledByTargets = cvox.DomUtil.getLabelledByTargets(); - var enclosingNodeWithId = node; - while (enclosingNodeWithId) { - if (enclosingNodeWithId.id && labelledByTargets[enclosingNodeWithId.id]) { - // If we got here, some element on this page has an aria-labelledby - // attribute listing this node as its id. As long as that "some" element - // is not this element, we should return false, indicating this element - // should be skipped. - var attrValue = enclosingNodeWithId.getAttribute('aria-labelledby'); - if (attrValue) { - var ids = attrValue.split(/ +/); - if (ids.indexOf(enclosingNodeWithId.id) == -1) { - return false; - } - } else { - return false; - } - } - enclosingNodeWithId = enclosingNodeWithId.parentElement; - } - - var text = cvox.DomUtil.getValue(node) + ' ' + cvox.DomUtil.getName(node); - var state = cvox.DomUtil.getState(node, true); - if (text.match(/^\s+$/) && state === '') { - // Text only contains whitespace - return false; - } - - return true; -}; - - -/** - * Returns a list of all the ancestors of a given node. The last element - * is the current node. - * - * @param {Node} targetNode The node to get ancestors for. - * @return {Array<Node>} An array of ancestors for the targetNode. - */ -cvox.DomUtil.getAncestors = function(targetNode) { - var ancestors = new Array(); - while (targetNode) { - ancestors.push(targetNode); - targetNode = targetNode.parentNode; - } - ancestors.reverse(); - while (ancestors.length && !ancestors[0].tagName && !ancestors[0].nodeValue) { - ancestors.shift(); - } - return ancestors; -}; - - -/** - * Compares Ancestors of A with Ancestors of B and returns - * the index value in B at which B diverges from A. - * If there is no divergence, the result will be -1. - * Note that if B is the same as A except B has more nodes - * even after A has ended, that is considered a divergence. - * The first node that B has which A does not have will - * be treated as the divergence point. - * - * @param {Object} ancestorsA The array of ancestors for Node A. - * @param {Object} ancestorsB The array of ancestors for Node B. - * @return {number} The index of the divergence point (the first node that B has - * which A does not have in B's list of ancestors). - */ -cvox.DomUtil.compareAncestors = function(ancestorsA, ancestorsB) { - var i = 0; - while (ancestorsA[i] && ancestorsB[i] && (ancestorsA[i] == ancestorsB[i])) { - i++; - } - if (!ancestorsA[i] && !ancestorsB[i]) { - i = -1; - } - return i; -}; - - -/** - * Returns an array of ancestors that are unique for the currentNode when - * compared to the previousNode. Having such an array is useful in generating - * the node information (identifying when interesting node boundaries have been - * crossed, etc.). - * - * @param {Node} previousNode The previous node. - * @param {Node} currentNode The current node. - * @param {boolean=} opt_fallback True returns node's ancestors in the case - * where node's ancestors is a subset of previousNode's ancestors. - * @return {Array<Node>} An array of unique ancestors for the current node - * (inclusive). - */ -cvox.DomUtil.getUniqueAncestors = function( - previousNode, currentNode, opt_fallback) { - var prevAncestors = cvox.DomUtil.getAncestors(previousNode); - var currentAncestors = cvox.DomUtil.getAncestors(currentNode); - var divergence = - cvox.DomUtil.compareAncestors(prevAncestors, currentAncestors); - var diff = currentAncestors.slice(divergence); - return (diff.length == 0 && opt_fallback) ? currentAncestors : diff; -}; - - -/** - * Returns a role message identifier for a node. - * For a localized string, see cvox.DomUtil.getRole. - * @param {Node} targetNode The node to get the role name for. - * @param {number} verbosity The verbosity setting to use. - * @return {string} The role message identifier for the targetNode. - */ -cvox.DomUtil.getRoleMsg = function(targetNode, verbosity) { - var info; - info = cvox.AriaUtil.getRoleNameMsg(targetNode); - if (!info) { - if (targetNode.tagName == 'INPUT') { - info = cvox.DomUtil.INPUT_TYPE_TO_INFORMATION_TABLE_MSG[targetNode.type]; - } else if ( - targetNode.tagName == 'A' && cvox.DomUtil.isInternalLink(targetNode)) { - info = 'internal_link'; - } else if ( - targetNode.tagName == 'A' && targetNode.getAttribute('href') && - cvox.ChromeVox.visitedUrls[targetNode.href]) { - info = 'visited_link'; - } else if (targetNode.tagName == 'A' && targetNode.getAttribute('name')) { - info = ''; // Don't want to add any role to anchors. - } else if (targetNode.isContentEditable) { - info = 'input_type_text'; - } else if (cvox.DomUtil.isMath(targetNode)) { - info = 'math_expr'; - } else if ( - targetNode.tagName == 'TABLE' && - cvox.DomUtil.isLayoutTable(targetNode)) { - info = ''; - } else { - if (verbosity == cvox.VERBOSITY_BRIEF) { - info = - cvox.DomUtil.TAG_TO_INFORMATION_TABLE_BRIEF_MSG[targetNode.tagName]; - } else { - info = cvox.DomUtil - .TAG_TO_INFORMATION_TABLE_VERBOSE_MSG[targetNode.tagName]; - - if (cvox.DomUtil.hasLongDesc(targetNode)) { - info = 'image_with_long_desc'; - } - - if (!info && targetNode.onclick) { - info = 'clickable'; - } - } - } - } - - return info; -}; - - -/** - * Returns a string to be presented to the user that identifies what the - * targetNode's role is. - * ARIA roles are given priority; if there is no ARIA role set, the role - * will be determined by the HTML tag for the node. - * - * @param {Node} targetNode The node to get the role name for. - * @param {number} verbosity The verbosity setting to use. - * @return {string} The role name for the targetNode. - */ -cvox.DomUtil.getRole = function(targetNode, verbosity) { - var roleMsg = cvox.DomUtil.getRoleMsg(targetNode, verbosity) || ''; - var role = roleMsg && roleMsg != ' ' ? Msgs.getMsg(roleMsg) : ''; - return role ? role : roleMsg; -}; - - -/** - * Count the number of items in a list node. - * - * @param {Node} targetNode The list node. - * @return {number} The number of items in the list. - */ -cvox.DomUtil.getListLength = function(targetNode) { - var count = 0; - for (var node = targetNode.firstChild; node; node = node.nextSibling) { - if (cvox.DomUtil.isVisible(node) && - (node.tagName == 'LI' || - (node.getAttribute && node.getAttribute('role') == 'listitem'))) { - if (node.hasAttribute('aria-setsize')) { - var ariaLength = parseInt(node.getAttribute('aria-setsize'), 10); - if (!isNaN(ariaLength)) { - return ariaLength; - } - } - count++; - } - } - return count; -}; - - -/** - * Returns a NodeState that gives information about the state of the targetNode. - * - * @param {Node} targetNode The node to get the state information for. - * @param {boolean} primary Whether this is the primary node we're - * interested in, where we might want extra information - as - * opposed to an ancestor, where we might be more brief. - * @return {cvox.NodeState} The status information about the node. - */ -cvox.DomUtil.getStateMsgs = function(targetNode, primary) { - var activeDescendant = cvox.AriaUtil.getActiveDescendant(targetNode); - if (activeDescendant) { - return cvox.DomUtil.getStateMsgs(activeDescendant, primary); - } - var info = []; - var role = targetNode.getAttribute ? targetNode.getAttribute('role') : ''; - info = cvox.AriaUtil.getStateMsgs(targetNode, primary); - if (!info) { - info = []; - } - - if (targetNode.tagName == 'INPUT') { - if (!targetNode.hasAttribute('aria-checked')) { - var INPUT_MSGS = { - 'checkbox-true': 'checkbox_checked_state', - 'checkbox-false': 'checkbox_unchecked_state', - 'radio-true': 'radio_selected_state', - 'radio-false': 'radio_unselected_state' - }; - var msgId = INPUT_MSGS[targetNode.type + '-' + !!targetNode.checked]; - if (msgId) { - info.push([msgId]); - } - } - } else if (targetNode.tagName == 'SELECT') { - if (targetNode.selectedOptions && targetNode.selectedOptions.length <= 1) { - info.push([ - 'list_position', Msgs.getNumber(targetNode.selectedIndex + 1), - Msgs.getNumber(targetNode.options.length) - ]); - } else { - info.push([ - 'selected_options_state', - Msgs.getNumber(targetNode.selectedOptions.length) - ]); - } - } else if ( - targetNode.tagName == 'UL' || targetNode.tagName == 'OL' || - role == 'list') { - info.push([ - 'list_with_items_not_pluralized', - Msgs.getNumber(cvox.DomUtil.getListLength(targetNode)) - ]); - } - - if (cvox.DomUtil.isDisabled(targetNode)) { - info.push(['aria_disabled_true']); - } - - if (targetNode.accessKey) { - info.push(['access_key', targetNode.accessKey]); - } - - return info; -}; - - -/** - * Returns a string that gives information about the state of the targetNode. - * - * @param {Node} targetNode The node to get the state information for. - * @param {boolean} primary Whether this is the primary node we're - * interested in, where we might want extra information - as - * opposed to an ancestor, where we might be more brief. - * @return {string} The status information about the node. - */ -cvox.DomUtil.getState = function(targetNode, primary) { - return cvox.NodeStateUtil.expand( - cvox.DomUtil.getStateMsgs(targetNode, primary)); -}; - - -/** - * Return whether a node is focusable. This includes nodes whose tabindex - * attribute is set to "-1" explicitly - these nodes are not in the tab - * order, but they should still be focused if the user navigates to them - * using linear or smart DOM navigation. - * - * Note that when the tabIndex property of an Element is -1, that doesn't - * tell us whether the tabIndex attribute is missing or set to "-1" explicitly, - * so we have to check the attribute. - * - * @param {Object} targetNode The node to check if it's focusable. - * @return {boolean} True if the node is focusable. - */ -cvox.DomUtil.isFocusable = function(targetNode) { - if (!targetNode || typeof(targetNode.tabIndex) != 'number') { - return false; - } - - // Workaround for http://code.google.com/p/chromium/issues/detail?id=153904 - if ((targetNode.tagName == 'A') && !targetNode.hasAttribute('href') && - !targetNode.hasAttribute('tabindex')) { - return false; - } - - if (targetNode.tabIndex >= 0) { - return true; - } - - if (targetNode.hasAttribute && targetNode.hasAttribute('tabindex') && - targetNode.getAttribute('tabindex') == '-1') { - return true; - } - - return false; -}; - - -/** - * Find a focusable descendant of a given node. This includes nodes whose - * tabindex attribute is set to "-1" explicitly - these nodes are not in the - * tab order, but they should still be focused if the user navigates to them - * using linear or smart DOM navigation. - * - * @param {Node} targetNode The node whose descendants to check if focusable. - * @return {Node} The focusable descendant node. Null if no descendant node - * was found. - */ -cvox.DomUtil.findFocusableDescendant = function(targetNode) { - // Search down the descendants chain until a focusable node is found - if (targetNode) { - var focusableNode = - cvox.DomUtil.findNode(targetNode, cvox.DomUtil.isFocusable); - if (focusableNode) { - return focusableNode; - } - } - return null; -}; - - -/** - * Returns the number of focusable nodes in root's subtree. The count does not - * include root. - * - * @param {Node} targetNode The node whose descendants to check are focusable. - * @return {number} The number of focusable descendants. - */ -cvox.DomUtil.countFocusableDescendants = function(targetNode) { - return targetNode ? - cvox.DomUtil.countNodes(targetNode, cvox.DomUtil.isFocusable) : - 0; -}; - - -/** - * Checks if the targetNode is still attached to the document. - * A node can become detached because of AJAX changes. - * - * @param {Object} targetNode The node to check. - * @return {boolean} True if the targetNode is still attached. - */ -cvox.DomUtil.isAttachedToDocument = function(targetNode) { - while (targetNode) { - if (targetNode.tagName && (targetNode.tagName == 'HTML')) { - return true; - } - targetNode = targetNode.parentNode; - } - return false; -}; - - -/** - * Dispatches a left click event on the element that is the targetNode. - * Clicks go in the sequence of mousedown, mouseup, and click. - * @param {Node} targetNode The target node of this operation. - * @param {boolean} shiftKey Specifies if shift is held down. - * @param {boolean} callOnClickDirectly Specifies whether or not to directly - * invoke the onclick method if there is one. - * @param {boolean=} opt_double True to issue a double click. - * @param {boolean=} opt_handleOwnEvents Whether to handle the generated - * events through the normal event processing. - */ -cvox.DomUtil.clickElem = function( - targetNode, shiftKey, callOnClickDirectly, opt_double, - opt_handleOwnEvents) { - // If there is an activeDescendant of the targetNode, then that is where the - // click should actually be targeted. - var activeDescendant = cvox.AriaUtil.getActiveDescendant(targetNode); - if (activeDescendant) { - targetNode = activeDescendant; - } - if (callOnClickDirectly) { - var onClickFunction = null; - if (targetNode.onclick) { - onClickFunction = targetNode.onclick; - } - if (!onClickFunction && (targetNode.nodeType != 1) && - targetNode.parentNode && targetNode.parentNode.onclick) { - onClickFunction = targetNode.parentNode.onclick; - } - var keepGoing = true; - if (onClickFunction) { - try { - keepGoing = onClickFunction(); - } catch (exception) { - // Something went very wrong with the onclick method; we'll ignore it - // and just dispatch a click event normally. - } - } - if (!keepGoing) { - // The onclick method ran successfully and returned false, meaning the - // event should not bubble up, so we will return here. - return; - } - } - - // Send a mousedown (or simply a double click if requested). - var evt = document.createEvent('MouseEvents'); - var evtType = opt_double ? 'dblclick' : 'mousedown'; - evt.initMouseEvent( - evtType, true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, - shiftKey, false, 0, null); - // Unless asked not to, Mark any events we generate so we don't try to - // process our own events. - evt.fromCvox = !opt_handleOwnEvents; - try { - targetNode.dispatchEvent(evt); - } catch (e) { - } - // Send a mouse up - evt = document.createEvent('MouseEvents'); - evt.initMouseEvent( - 'mouseup', true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, - shiftKey, false, 0, null); - evt.fromCvox = !opt_handleOwnEvents; - try { - targetNode.dispatchEvent(evt); - } catch (e) { - } - // Send a click - evt = document.createEvent('MouseEvents'); - evt.initMouseEvent( - 'click', true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, - shiftKey, false, 0, null); - evt.fromCvox = !opt_handleOwnEvents; - try { - targetNode.dispatchEvent(evt); - } catch (e) { - } - - if (cvox.DomUtil.isInternalLink(targetNode)) { - cvox.DomUtil.syncInternalLink(targetNode); - } -}; - - -/** - * Syncs to an internal link. - * @param {Node} node A link whose href's target we want to sync. - */ -cvox.DomUtil.syncInternalLink = function(node) { - var targetNode; - var targetId = node.href.split('#')[1]; - targetNode = document.getElementById(targetId); - if (!targetNode) { - var nodes = document.getElementsByName(targetId); - if (nodes.length > 0) { - targetNode = nodes[0]; - } - } - if (targetNode) { - // Insert a dummy node to adjust next Tab focus location. - var parent = targetNode.parentNode; - var dummyNode = document.createElement('div'); - dummyNode.setAttribute('tabindex', '-1'); - parent.insertBefore(dummyNode, targetNode); - dummyNode.setAttribute('chromevoxignoreariahidden', 1); - dummyNode.focus(); - cvox.ChromeVox.syncToNode(targetNode, false); - } -}; - - -/** - * Given an HTMLInputElement, returns true if it's an editable text type. - * This includes input type='text' and input type='password' and a few - * others. - * - * @param {Node} node The node to check. - * @return {boolean} True if the node is an INPUT with an editable text type. - */ -cvox.DomUtil.isInputTypeText = function(node) { - if (!node || node.constructor != HTMLInputElement) { - return false; - } - - switch (node.type) { - case 'email': - case 'number': - case 'password': - case 'search': - case 'text': - case 'tel': - case 'url': - case '': - return true; - default: - return false; - } -}; - - -/** - * Given a node, returns true if it's a control. Controls are *not necessarily* - * leaf-level given that some composite controls may have focusable children - * if they are managing focus with tabindex: - * ( http://www.w3.org/TR/2010/WD-wai-aria-practices-20100916/#visualfocus ). - * - * @param {Node} node The node to check. - * @return {boolean} True if the node is a control. - */ -cvox.DomUtil.isControl = function(node) { - if (cvox.AriaUtil.isControlWidget(node) && cvox.DomUtil.isFocusable(node)) { - return true; - } - if (node.tagName) { - switch (node.tagName) { - case 'BUTTON': - case 'TEXTAREA': - case 'SELECT': - return true; - case 'INPUT': - return node.type != 'hidden'; - } - } - if (node.isContentEditable) { - return true; - } - return false; -}; - - -/** - * Given a node, returns true if it's a leaf-level control. This includes - * composite controls thare are managing focus for children with - * activedescendant, but not composite controls with focusable children: - * ( http://www.w3.org/TR/2010/WD-wai-aria-practices-20100916/#visualfocus ). - * - * @param {Node} node The node to check. - * @return {boolean} True if the node is a leaf-level control. - */ -cvox.DomUtil.isLeafLevelControl = function(node) { - if (cvox.DomUtil.isControl(node)) { - return !( - cvox.AriaUtil.isCompositeControl(node) && - cvox.DomUtil.findFocusableDescendant(node)); - } - return false; -}; - - -/** - * Given a node that might be inside of a composite control like a listbox, - * return the surrounding control. - * @param {Node} node The node from which to start looking. - * @return {Node} The surrounding composite control node, or null if none. - */ -cvox.DomUtil.getSurroundingControl = function(node) { - var surroundingControl = null; - if (!cvox.DomUtil.isControl(node) && node.hasAttribute && - node.hasAttribute('role')) { - surroundingControl = node.parentElement; - while (surroundingControl && - !cvox.AriaUtil.isCompositeControl(surroundingControl)) { - surroundingControl = surroundingControl.parentElement; - } - } - return surroundingControl; -}; - - -/** - * Given a node and a function for determining when to stop - * descent, return the next leaf-like node. - * - * @param {!Node} node The node from which to start looking, - * this node *must not* be above document.body. - * @param {boolean} r True if reversed. False by default. - * @param {function(!Node):boolean} isLeaf A function that - * returns true if we should stop descending. - * @return {Node} The next leaf-like node or null if there is no next - * leaf-like node. This function will always return a node below - * document.body and never document.body itself. - */ -cvox.DomUtil.directedNextLeafLikeNode = function(node, r, isLeaf) { - if (node != document.body) { - // if not at the top of the tree, we want to find the next possible - // branch forward in the dom, so we climb up the parents until we find a - // node that has a nextSibling - while (!cvox.DomUtil.directedNextSibling(node, r)) { - if (!node) { - return null; - } - // since node is never above document.body, it always has a parent. - // so node.parentNode will never be null. - node = /** @type {!Node} */ (node.parentNode); - if (node == document.body) { - // we've readed the end of the document. - return null; - } - } - if (cvox.DomUtil.directedNextSibling(node, r)) { - // we just checked that next sibling is non-null. - node = /** @type {!Node} */ (cvox.DomUtil.directedNextSibling(node, r)); - } - } - // once we're at our next sibling, we want to descend down into it as - // far as the child class will allow - while (cvox.DomUtil.directedFirstChild(node, r) && !isLeaf(node)) { - node = /** @type {!Node} */ (cvox.DomUtil.directedFirstChild(node, r)); - } - - // after we've done all that, if we are still at document.body, this must - // be an empty document. - if (node == document.body) { - return null; - } - return node; -}; - - -/** - * Given a node, returns the next leaf node. - * - * @param {!Node} node The node from which to start looking - * for the next leaf node. - * @param {boolean=} reverse True if reversed. False by default. - * @return {Node} The next leaf node. - * Null if there is no next leaf node. - */ -cvox.DomUtil.directedNextLeafNode = function(node, reverse) { - reverse = !!reverse; - return cvox.DomUtil.directedNextLeafLikeNode( - node, reverse, cvox.DomUtil.isLeafNode); -}; - - -/** - * Given a node, returns the previous leaf node. - * - * @param {!Node} node The node from which to start looking - * for the previous leaf node. - * @return {Node} The previous leaf node. - * Null if there is no previous leaf node. - */ -cvox.DomUtil.previousLeafNode = function(node) { - return cvox.DomUtil.directedNextLeafNode(node, true); -}; - - -/** - * Computes the outer most leaf node of a given node, depending on value - * of the reverse flag r. - * @param {!Node} node in the DOM. - * @param {boolean} r True if reversed. False by default. - * @param {function(!Node):boolean} pred Predicate to decide - * what we consider a leaf. - * @return {Node} The outer most leaf node of that node. - */ -cvox.DomUtil.directedFindFirstNode = function(node, r, pred) { - var child = cvox.DomUtil.directedFirstChild(node, r); - while (child) { - if (pred(child)) { - return child; - } else { - var leaf = cvox.DomUtil.directedFindFirstNode(child, r, pred); - if (leaf) { - return leaf; - } - } - child = cvox.DomUtil.directedNextSibling(child, r); - } - return null; -}; - - -/** - * Moves to the deepest node satisfying a given predicate under the given node. - * @param {!Node} node in the DOM. - * @param {boolean} r True if reversed. False by default. - * @param {function(!Node):boolean} pred Predicate deciding what a leaf is. - * @return {Node} The deepest node satisfying pred. - */ -cvox.DomUtil.directedFindDeepestNode = function(node, r, pred) { - var next = cvox.DomUtil.directedFindFirstNode(node, r, pred); - if (!next) { - if (pred(node)) { - return node; - } else { - return null; - } - } else { - return cvox.DomUtil.directedFindDeepestNode(next, r, pred); - } -}; - - -/** - * Computes the next node wrt. a predicate that is a descendant of ancestor. - * @param {!Node} node in the DOM. - * @param {!Node} ancestor of the given node. - * @param {boolean} r True if reversed. False by default. - * @param {function(!Node):boolean} pred Predicate to decide - * what we consider a leaf. - * @param {boolean=} above True if the next node can live in the subtree - * directly above the start node. False by default. - * @param {boolean=} deep True if we are looking for the next node that is - * deepest in the tree. Otherwise the next shallow node is returned. - * False by default. - * @return {Node} The next node in the DOM that satisfies the predicate. - */ -cvox.DomUtil.directedFindNextNode = function( - node, ancestor, r, pred, above, deep) { - above = !!above; - deep = !!deep; - if (!cvox.DomUtil.isDescendantOfNode(node, ancestor) || node == ancestor) { - return null; - } - var next = cvox.DomUtil.directedNextSibling(node, r); - while (next) { - if (!deep && pred(next)) { - return next; - } - var leaf = - (deep ? cvox.DomUtil.directedFindDeepestNode : - cvox.DomUtil.directedFindFirstNode)(next, r, pred); - if (leaf) { - return leaf; - } - if (deep && pred(next)) { - return next; - } - next = cvox.DomUtil.directedNextSibling(next, r); - } - var parent = /** @type {!Node} */ (node.parentNode); - if (above && pred(parent)) { - return parent; - } - return cvox.DomUtil.directedFindNextNode( - parent, ancestor, r, pred, above, deep); -}; - - -/** - * Get a string representing a control's value and state, i.e. the part - * that changes while interacting with the control - * @param {Element} control A control. - * @return {string} The value and state string. - */ -cvox.DomUtil.getControlValueAndStateString = function(control) { - var parentControl = cvox.DomUtil.getSurroundingControl(control); - if (parentControl) { - return cvox.DomUtil.collapseWhitespace( - cvox.DomUtil.getValue(control) + ' ' + cvox.DomUtil.getName(control) + - ' ' + cvox.DomUtil.getState(control, true)); - } else { - return cvox.DomUtil.collapseWhitespace( - cvox.DomUtil.getValue(control) + ' ' + - cvox.DomUtil.getState(control, true)); - } -}; - - -/** - * Determine whether the given node is an internal link. - * @param {Node} node The node to be examined. - * @return {boolean} True if the node is an internal link, false otherwise. - */ -cvox.DomUtil.isInternalLink = function(node) { - if (node.nodeType == 1) { // Element nodes only. - var href = node.getAttribute('href'); - if (href && href.indexOf('#') != -1) { - var path = href.split('#')[0]; - return path == '' || path == window.location.pathname; - } - } - return false; -}; - - -/** - * Get a string containing the currently selected link's URL. - * @param {Node} node The link from which URL needs to be extracted. - * @return {string} The value of the URL. - */ -cvox.DomUtil.getLinkURL = function(node) { - if (node.tagName == 'A') { - if (node.getAttribute('href')) { - if (cvox.DomUtil.isInternalLink(node)) { - return Msgs.getMsg('internal_link'); - } else { - return node.getAttribute('href'); - } - } else { - return ''; - } - } else if (cvox.AriaUtil.getRoleName(node) == Msgs.getMsg('role_link')) { - return Msgs.getMsg('unknown_link'); - } - - return ''; -}; - - -/** - * Checks if a given node is inside a table and returns the table node if it is - * @param {Node} node The node. - * @param {{allowCaptions: (undefined|boolean)}=} kwargs Optional named args. - * allowCaptions: If true, will return true even if inside a caption. False - * by default. - * @return {Node} If the node is inside a table, the table node. Null if it - * is not. - */ -cvox.DomUtil.getContainingTable = function(node, kwargs) { - var ancestors = cvox.DomUtil.getAncestors(node); - return cvox.DomUtil.findTableNodeInList(ancestors, kwargs); -}; - - -/** - * Extracts a table node from a list of nodes. - * @param {Array<Node>} nodes The list of nodes. - * @param {{allowCaptions: (undefined|boolean)}=} kwargs Optional named args. - * allowCaptions: If true, will return true even if inside a caption. False - * by default. - * @return {Node} The table node if the list of nodes contains a table node. - * Null if it does not. - */ -cvox.DomUtil.findTableNodeInList = function(nodes, kwargs) { - kwargs = kwargs || {allowCaptions: false}; - // Don't include the caption node because it is actually rendered outside - // of the table. - for (var i = nodes.length - 1, node; node = nodes[i]; i--) { - if (node.constructor != Text) { - if (!kwargs.allowCaptions && node.tagName == 'CAPTION') { - return null; - } - if ((node.tagName == 'TABLE') || cvox.AriaUtil.isGrid(node)) { - return node; - } - } - } - return null; -}; - - -/** - * Determines whether a given table is a data table or a layout table - * @param {Node} tableNode The table node. - * @return {boolean} If the table is a layout table, returns true. False - * otherwise. - */ -cvox.DomUtil.isLayoutTable = function(tableNode) { - // TODO(stoarca): Why are we returning based on this inaccurate heuristic - // instead of first trying the better heuristics below? - if (tableNode.rows && - (tableNode.rows.length <= 1 || - (tableNode.rows[0].childElementCount == 1))) { - // This table has either 0 or one rows, or only "one" column. - // This is a quick check for column count and may not be accurate. See - // TraverseTable.getW3CColCount_ for a more accurate - // (but more complicated) way to determine column count. - return true; - } - - // These heuristics are adapted from the Firefox data and layout table. - // heuristics: http://asurkov.blogspot.com/2011/10/data-vs-layout-table.html - if (cvox.AriaUtil.isGrid(tableNode)) { - // This table has an ARIA role identifying it as a grid. - // Not a layout table. - return false; - } - if (cvox.AriaUtil.isLandmark(tableNode)) { - // This table has an ARIA landmark role - not a layout table. - return false; - } - - if (tableNode.caption || tableNode.summary) { - // This table has a caption or a summary - not a layout table. - return false; - } - - if ((cvox.XpathUtil.evalXPath('tbody/tr/th', tableNode).length > 0) && - (cvox.XpathUtil.evalXPath('tbody/tr/td', tableNode).length > 0)) { - // This table at least one column and at least one column header. - // Not a layout table. - return false; - } - - if (cvox.XpathUtil.evalXPath('colgroup', tableNode).length > 0) { - // This table specifies column groups - not a layout table. - return false; - } - - if ((cvox.XpathUtil.evalXPath('thead', tableNode).length > 0) || - (cvox.XpathUtil.evalXPath('tfoot', tableNode).length > 0)) { - // This table has header or footer rows - not a layout table. - return false; - } - - if ((cvox.XpathUtil.evalXPath('tbody/tr/td/embed', tableNode).length > 0) || - (cvox.XpathUtil.evalXPath('tbody/tr/td/object', tableNode).length > 0) || - (cvox.XpathUtil.evalXPath('tbody/tr/td/iframe', tableNode).length > 0) || - (cvox.XpathUtil.evalXPath('tbody/tr/td/applet', tableNode).length > 0)) { - // This table contains embed, object, applet, or iframe elements. It is - // a layout table. - return true; - } - - // These heuristics are loosely based on Okada and Miura's "Detection of - // Layout-Purpose TABLE Tags Based on Machine Learning" (2007). - // http://books.google.com/books?id=kUbmdqasONwC&lpg=PA116&ots=Lb3HJ7dISZ&lr&pg=PA116 - - // Increase the points for each heuristic. If there are 3 or more points, - // this is probably a layout table. - var points = 0; - - if (!cvox.DomUtil.hasBorder(tableNode)) { - // This table has no border. - points++; - } - - if (tableNode.rows.length <= 6) { - // This table has a limited number of rows. - points++; - } - - if (cvox.DomUtil.countPreviousTags(tableNode) <= 12) { - // This table has a limited number of previous tags. - points++; - } - - if (cvox.XpathUtil.evalXPath('tbody/tr/td/table', tableNode).length > 0) { - // This table has nested tables. - points++; - } - return (points >= 3); -}; - - -/** - * Count previous tags, which we dfine as the number of HTML tags that - * appear before the given node. - * @param {Node} node The given node. - * @return {number} The number of previous tags. - */ -cvox.DomUtil.countPreviousTags = function(node) { - var ancestors = cvox.DomUtil.getAncestors(node); - return ancestors.length + cvox.DomUtil.countPreviousSiblings(node); -}; - - -/** - * Counts previous siblings, not including text nodes. - * @param {Node} node The given node. - * @return {number} The number of previous siblings. - */ -cvox.DomUtil.countPreviousSiblings = function(node) { - var count = 0; - var prev = node.previousSibling; - while (prev != null) { - if (prev.constructor != Text) { - count++; - } - prev = prev.previousSibling; - } - return count; -}; - - -/** - * Whether a given table has a border or not. - * @param {Node} tableNode The table node. - * @return {boolean} If the table has a border, return true. False otherwise. - */ -cvox.DomUtil.hasBorder = function(tableNode) { - // If .frame contains "void" there is no border. - if (tableNode.frame) { - return (tableNode.frame.indexOf('void') == -1); - } - - // If .border is defined and == "0" then there is no border. - if (tableNode.border) { - if (tableNode.border.length == 1) { - return (tableNode.border != '0'); - } else { - return (tableNode.border.slice(0, -2) != 0); - } - } - - // If .style.border-style is 'none' there is no border. - if (tableNode.style.borderStyle && tableNode.style.borderStyle == 'none') { - return false; - } - - // If .style.border-width is specified in units of length - // ( https://developer.mozilla.org/en/CSS/border-width ) then we need - // to check if .style.border-width starts with 0[px,em,etc] - if (tableNode.style.borderWidth) { - return (tableNode.style.borderWidth.slice(0, -2) != 0); - } - - // If .style.border-color is defined, then there is a border - if (tableNode.style.borderColor) { - return true; - } - return false; -}; - - -/** - * Return the first leaf node, starting at the top of the document. - * @return {Node?} The first leaf node in the document, if found. - */ -cvox.DomUtil.getFirstLeafNode = function() { - var node = document.body; - while (node && node.firstChild) { - node = node.firstChild; - } - while (node && !cvox.DomUtil.hasContent(node)) { - node = cvox.DomUtil.directedNextLeafNode(node); - } - return node; -}; - - -/** - * Finds the first descendant node that matches the filter function, using - * a depth first search. This function offers the most general purpose way - * of finding a matching element. You may also wish to consider - * {@code goog.dom.query} which can express many matching criteria using - * CSS selector expressions. These expressions often result in a more - * compact representation of the desired result. - * This is the findNode function from goog.dom: - * http://code.google.com/p/closure-library/source/browse/trunk/closure/goog/dom/dom.js - * - * @param {Node} root The root of the tree to search. - * @param {function(Node) : boolean} p The filter function. - * @return {Node|undefined} The found node or undefined if none is found. - */ -cvox.DomUtil.findNode = function(root, p) { - var rv = []; - var found = cvox.DomUtil.findNodes_(root, p, rv, true, 10000); - return found ? rv[0] : undefined; -}; - - -/** - * Finds the number of nodes matching the filter. - * @param {Node} root The root of the tree to search. - * @param {function(Node) : boolean} p The filter function. - * @return {number} The number of nodes selected by filter. - */ -cvox.DomUtil.countNodes = function(root, p) { - var rv = []; - cvox.DomUtil.findNodes_(root, p, rv, false, 10000); - return rv.length; -}; - - -/** - * Finds the first or all the descendant nodes that match the filter function, - * using a depth first search. - * @param {Node} root The root of the tree to search. - * @param {function(Node) : boolean} p The filter function. - * @param {Array<Node>} rv The found nodes are added to this array. - * @param {boolean} findOne If true we exit after the first found node. - * @param {number} maxChildCount The max child count. This is used as a kill - * switch - if there are more nodes than this, terminate the search. - * @return {boolean} Whether the search is complete or not. True in case - * findOne is true and the node is found. False otherwise. This is the - * findNodes_ function from goog.dom: - * http://code.google.com/p/closure-library/source/browse/trunk/closure/goog/dom/dom.js. - * @private - */ -cvox.DomUtil.findNodes_ = function(root, p, rv, findOne, maxChildCount) { - if ((root != null) || (maxChildCount == 0)) { - var child = root.firstChild; - while (child) { - if (p(child)) { - rv.push(child); - if (findOne) { - return true; - } - } - maxChildCount = maxChildCount - 1; - if (cvox.DomUtil.findNodes_(child, p, rv, findOne, maxChildCount)) { - return true; - } - child = child.nextSibling; - } - } - return false; -}; - - -/** - * Converts a NodeList into an array - * @param {NodeList} nodeList The nodeList. - * @return {Array} The array of nodes in the nodeList. - */ -cvox.DomUtil.toArray = function(nodeList) { - var nodeArray = []; - for (var i = 0; i < nodeList.length; i++) { - nodeArray.push(nodeList[i]); - } - return nodeArray; -}; - - -/** - * Creates a new element with the same attributes and no children. - * @param {Node|Text} node A node to clone. - * @param {Object<boolean>} skipattrs Set the attribute to true to skip it - * during cloning. - * @return {Node|Text} The cloned node. - */ -cvox.DomUtil.shallowChildlessClone = function(node, skipattrs) { - if (node.nodeName == '#text') { - return document.createTextNode(node.nodeValue); - } - - if (node.nodeName == '#comment') { - return document.createComment(node.nodeValue); - } - - var ret = document.createElement(node.nodeName); - for (var i = 0; i < node.attributes.length; ++i) { - var attr = node.attributes[i]; - if (skipattrs && skipattrs[attr.nodeName]) { - continue; - } - ret.setAttribute(attr.nodeName, attr.nodeValue); - } - return ret; -}; - - -/** - * Creates a new element with the same attributes and clones of children. - * @param {Node|Text} node A node to clone. - * @param {Object<boolean>} skipattrs Set the attribute to true to skip it - * during cloning. - * @return {Node|Text} The cloned node. - */ -cvox.DomUtil.deepClone = function(node, skipattrs) { - var ret = cvox.DomUtil.shallowChildlessClone(node, skipattrs); - for (var i = 0; i < node.childNodes.length; ++i) { - ret.appendChild(cvox.DomUtil.deepClone(node.childNodes[i], skipattrs)); - } - return ret; -}; - - -/** - * Returns either node.firstChild or node.lastChild, depending on direction. - * @param {Node|Text} node The node. - * @param {boolean} reverse If reversed. - * @return {Node|Text} The directed first child or null if the node has - * no children. - */ -cvox.DomUtil.directedFirstChild = function(node, reverse) { - if (reverse) { - return node.lastChild; - } - return node.firstChild; -}; - -/** - * Returns either node.nextSibling or node.previousSibling, depending on - * direction. - * @param {Node|Text} node The node. - * @param {boolean=} reverse If reversed. - * @return {Node|Text} The directed next sibling or null if there are - * no more siblings in that direction. - */ -cvox.DomUtil.directedNextSibling = function(node, reverse) { - if (!node) { - return null; - } - if (reverse) { - return node.previousSibling; - } - return node.nextSibling; -}; - -/** - * Creates a function that sends a click. This is because loop closures - * are dangerous. - * See: http://joust.kano.net/weblog/archive/2005/08/08/ - * a-huge-gotcha-with-javascript-closures/ - * @param {Node} targetNode The target node to click on. - * @return {function()} A function that will click on the given targetNode. - */ -cvox.DomUtil.createSimpleClickFunction = function(targetNode) { - var target = targetNode.cloneNode(true); - return function() { - cvox.DomUtil.clickElem(target, false, false); - }; -}; - -/** - * Adds a node to document.head if that node has not already been added. - * If document.head does not exist, this will add the node to the body. - * @param {Node} node The node to add. - * @param {string=} opt_id The id of the node to ensure the node is only - * added once. - */ -cvox.DomUtil.addNodeToHead = function(node, opt_id) { - if (opt_id && document.getElementById(opt_id)) { - return; - } - var p = document.head || document.body; - p.appendChild(node); -}; - - -/** - * Checks if a given node is inside a math expressions and - * returns the math node if one exists. - * @param {Node} node The node. - * @return {Node} The math node, if the node is inside a math expression. - * Null if it is not. - */ -cvox.DomUtil.getContainingMath = function(node) { - var ancestors = cvox.DomUtil.getAncestors(node); - return cvox.DomUtil.findMathNodeInList(ancestors); -}; - - -/** - * Extracts a math node from a list of nodes. - * @param {Array<Node>} nodes The list of nodes. - * @return {Node} The math node if the list of nodes contains a math node. - * Null if it does not. - */ -cvox.DomUtil.findMathNodeInList = function(nodes) { - for (var i = 0, node; node = nodes[i]; i++) { - if (cvox.DomUtil.isMath(node)) { - return node; - } - } - return null; -}; - - -/** - * Checks to see wether a node is a math node. - * @param {Node} node The node to be tested. - * @return {boolean} Whether or not a node is a math node. - */ -cvox.DomUtil.isMath = function(node) { - return cvox.DomUtil.isMathml(node) || cvox.DomUtil.isMathJax(node) || - cvox.DomUtil.isMathImg(node) || cvox.AriaUtil.isMath(node); -}; - - -/** - * Specifies node classes in which we expect maths expressions a alt text. - * @type {{tex: Array<string>, - * asciimath: Array<string>}} - */ -// These are the classes for which we assume they contain Maths in the ALT or -// TITLE attribute. -// tex: Wikipedia; -// latex: Wordpress; -// numberedequation, inlineformula, displayformula: MathWorld; -cvox.DomUtil.ALT_MATH_CLASSES = { - tex: ['tex', 'latex'], - asciimath: ['numberedequation', 'inlineformula', 'displayformula'] -}; - - -/** - * Composes a query selector string for image nodes with alt math content by - * type of content. - * @param {string} contentType The content type, e.g., tex, asciimath. - * @return {!string} The query elector string. - */ -cvox.DomUtil.altMathQuerySelector = function(contentType) { - var classes = cvox.DomUtil.ALT_MATH_CLASSES[contentType]; - if (classes) { - return classes - .map(function(x) { - return 'img.' + x; - }) - .join(', '); - } - return ''; -}; - - -/** - * Check if a given node is potentially a math image with alternative text in - * LaTeX. - * @param {Node} node The node to be tested. - * @return {boolean} Whether or not a node has an image with class TeX or LaTeX. - */ -cvox.DomUtil.isMathImg = function(node) { - if (!node || !node.tagName || !node.className) { - return false; - } - if (node.tagName != 'IMG') { - return false; - } - for (var i = 0, className; className = node.classList.item(i); i++) { - className = className.toLowerCase(); - if (cvox.DomUtil.ALT_MATH_CLASSES.tex.indexOf(className) != -1 || - cvox.DomUtil.ALT_MATH_CLASSES.asciimath.indexOf(className) != -1) { - return true; - } - } - return false; -}; - - -/** - * Checks to see whether a node is a MathML node. - * !! This is necessary as Chrome currently does not upperCase Math tags !! - * @param {Node} node The node to be tested. - * @return {boolean} Whether or not a node is a MathML node. - */ -cvox.DomUtil.isMathml = function(node) { - if (!node || !node.tagName) { - return false; - } - return node.tagName.toLowerCase() == 'math'; -}; - - -/** - * Checks to see wether a node is a MathJax node. - * @param {Node} node The node to be tested. - * @return {boolean} Whether or not a node is a MathJax node. - */ -cvox.DomUtil.isMathJax = function(node) { - if (!node || !node.tagName || !node.className) { - return false; - } - - function isSpanWithClass(n, cl) { - return (n.tagName == 'SPAN' && n.className.split(' ').some(function(x) { - return x.toLowerCase() == cl; - })); - } - if (isSpanWithClass(node, 'math')) { - var ancestors = cvox.DomUtil.getAncestors(node); - return ancestors.some(function(x) { - return isSpanWithClass(x, 'mathjax'); - }); - } - return false; -}; - - -/** - * Computes the id of the math span in a MathJax DOM element. - * @param {string} jaxId The id of the MathJax node. - * @return {string} The id of the span node. - */ -cvox.DomUtil.getMathSpanId = function(jaxId) { - var node = document.getElementById(jaxId + '-Frame'); - if (node) { - var span = node.querySelector('span.math'); - if (span) { - return span.id; - } - } - return ''; -}; - - -/** - * Returns true if the node has a longDesc. - * @param {Node} node The node to be tested. - * @return {boolean} Whether or not a node has a longDesc. - */ -cvox.DomUtil.hasLongDesc = function(node) { - if (node && node.longDesc) { - return true; - } - return false; -}; - - -/** - * Returns tag name of a node if it has one. - * @param {Node} node A node. - * @return {string} A the tag name of the node. - */ -cvox.DomUtil.getNodeTagName = function(node) { - if (node.nodeType == Node.ELEMENT_NODE) { - return node.tagName; - } - return ''; -}; - - -/** - * Cleaning up a list of nodes to remove empty text nodes. - * @param {NodeList} nodes The nodes list. - * @return {!Array<Node|string|null>} The cleaned up list of nodes. - */ -cvox.DomUtil.purgeNodes = function(nodes) { - return cvox.DomUtil.toArray(nodes).filter(function(node) { - return node.nodeType != Node.TEXT_NODE || !node.textContent.match(/^\s+$/); - }); -}; - - -/** - * Calculates a hit point for a given node. - * @param {Node} node The given node. - * @return {{x:(number), y:(number)}} The position. - */ -cvox.DomUtil.elementToPoint = function(node) { - if (!node) { - return {x: 0, y: 0}; - } - if (node.constructor == Text) { - node = node.parentNode; - } - var r = node.getBoundingClientRect(); - return {x: r.left + (r.width / 2), y: r.top + (r.height / 2)}; -}; - - -/** - * Checks if an input node supports HTML5 selection. - * If the node is not an input element, returns false. - * @param {Node} node The node to check. - * @return {boolean} True if HTML5 selection supported. - */ -cvox.DomUtil.doesInputSupportSelection = function(node) { - return goog.isDef(node) && node.tagName == 'INPUT' && node.type != 'email' && - node.type != 'number'; -}; - - -/** - * Gets the hint text for a given element. - * @param {Node} node The target node. - * @return {string} The hint text. - */ -cvox.DomUtil.getHint = function(node) { - var desc = ''; - if (node.hasAttribute) { - if (node.hasAttribute('aria-describedby')) { - var describedByIds = node.getAttribute('aria-describedby').split(' '); - for (var describedById, i = 0; describedById = describedByIds[i]; i++) { - var describedNode = document.getElementById(describedById); - if (describedNode) { - desc += ' ' + cvox.DomUtil.getName(describedNode, true, true, true); - } - } - } - } - return desc; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/earcon_util.js b/chrome/browser/resources/chromeos/chromevox/common/earcon_util.js deleted file mode 100644 index 51679ab..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/earcon_util.js +++ /dev/null
@@ -1,67 +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. - -/** - * @fileoverview Earcon utils. - */ - -goog.provide('cvox.EarconUtil'); - -goog.require('cvox.AbstractEarcons'); -goog.require('cvox.AriaUtil'); -goog.require('cvox.DomUtil'); - -/** - * Returns the id of an earcon to play along with the description for a node. - * - * @param {Node} node The node to get the earcon for. - * @return {cvox.Earcon?} The earcon id, or null if none applies. - */ -cvox.EarconUtil.getEarcon = function(node) { - var earcon = cvox.AriaUtil.getEarcon(node); - if (earcon != null) { - return earcon; - } - - switch (node.tagName) { - case 'BUTTON': - return cvox.Earcon.BUTTON; - case 'A': - if (node.hasAttribute('href')) { - return cvox.Earcon.LINK; - } - break; - case 'IMG': - if (cvox.DomUtil.hasLongDesc(node)) { - return cvox.Earcon.LONG_DESC; - } - break; - case 'LI': - return cvox.Earcon.LIST_ITEM; - case 'SELECT': - return cvox.Earcon.LISTBOX; - case 'TEXTAREA': - return cvox.Earcon.EDITABLE_TEXT; - case 'INPUT': - switch (node.type) { - case 'button': - case 'submit': - case 'reset': - return cvox.Earcon.BUTTON; - case 'checkbox': - case 'radio': - if (node.checked) { - return cvox.Earcon.CHECK_ON; - } else { - return cvox.Earcon.CHECK_OFF; - } - default: - if (cvox.DomUtil.isInputTypeText(node)) { - // 'text', 'password', etc. - return cvox.Earcon.EDITABLE_TEXT; - } - } - } - return null; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/editable_text.js b/chrome/browser/resources/chromeos/chromevox/common/editable_text.js deleted file mode 100644 index a18a44cf..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/editable_text.js +++ /dev/null
@@ -1,646 +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. - -goog.provide('cvox.ChromeVoxEditableContentEditable'); -goog.provide('cvox.ChromeVoxEditableElement'); -goog.provide('cvox.ChromeVoxEditableHTMLInput'); -goog.provide('cvox.ChromeVoxEditableTextArea'); -goog.provide('cvox.TextHandlerInterface'); - - -goog.require('cvox.BrailleTextHandler'); -goog.require('cvox.ChromeVoxEditableTextBase'); -goog.require('cvox.ContentEditableExtractor'); -goog.require('cvox.DomUtil'); -goog.require('cvox.EditableTextAreaShadow'); -goog.require('cvox.TextChangeEvent'); -goog.require('cvox.TtsInterface'); - -/** - * @fileoverview Gives the user spoken and braille feedback as they type, - * select text, and move the cursor in editable HTML text controls, including - * multiline controls and contenteditable regions. - * - * The two subclasses, ChromeVoxEditableHTMLInput and - * ChromeVoxEditableTextArea, take a HTML input (type=text) or HTML - * textarea node (respectively) in the constructor, and automatically - * handle retrieving the current state of the control, including - * computing line break information for a textarea using an offscreen - * shadow object. It is the responsibility of the user of these classes to - * trap key and focus events and call the update method as needed. - * - */ - - -/** - * An interface for being notified when the text changes. - * @interface - */ -cvox.TextHandlerInterface = function() {}; - - -/** - * Called when text changes. - * @param {cvox.TextChangeEvent} evt The text change event. - */ -cvox.TextHandlerInterface.prototype.changed = function(evt) {}; - - -/** - * A subclass of ChromeVoxEditableTextBase a text element that's part of - * the webpage DOM. Contains common code shared by both EditableHTMLInput - * and EditableTextArea, but that might not apply to a non-DOM text box. - * @param {Element} node A DOM node which allows text input. - * @param {string} value The string value of the editable text control. - * @param {number} start The 0-based start cursor/selection index. - * @param {number} end The 0-based end cursor/selection index. - * @param {boolean} isPassword Whether the text control if a password field. - * @param {cvox.TtsInterface} tts A TTS object. - * @extends {cvox.ChromeVoxEditableTextBase} - * @constructor - */ -cvox.ChromeVoxEditableElement = function( - node, value, start, end, isPassword, tts) { - goog.base(this, value, start, end, isPassword, tts); - - /** - * An optional handler for braille output. - * @type {cvox.BrailleTextHandler|undefined} - * @private - */ - this.brailleHandler_ = cvox.ChromeVox.braille ? - new cvox.BrailleTextHandler(cvox.ChromeVox.braille) : - undefined; - - /** - * The DOM node which allows text input. - * @type {Element} - * @protected - */ - this.node = node; - - /** - * True if the description was just spoken. - * @type {boolean} - * @private - */ - this.justSpokeDescription_ = false; -}; -goog.inherits(cvox.ChromeVoxEditableElement, cvox.ChromeVoxEditableTextBase); - - -/** @override */ -cvox.ChromeVoxEditableElement.prototype.changed = function(evt) { - // Ignore changes to the cursor and selection if they happen immediately - // after the description was just spoken. This avoid double-speaking when, - // for example, a text field is focused and then a moment later the - // contents are selected. If the value changes, though, this change will - // not be ignored. - if (this.justSpokeDescription_ && this.value == evt.value) { - this.value = evt.value; - this.start = evt.start; - this.end = evt.end; - this.justSpokeDescription_ = false; - } - goog.base(this, 'changed', evt); - if (this.lastChangeDescribed) { - this.brailleCurrentLine_(); - } -}; - - -/** @override */ -cvox.ChromeVoxEditableElement.prototype.speak = function( - str, opt_triggeredByUser, opt_personality) { - // If there is a node associated with the editable text object, - // make sure that node has focus before speaking it. - if (this.node && (document.activeElement != this.node)) { - return; - } - goog.base(this, 'speak', str, opt_triggeredByUser, opt_personality); -}; - -/** @override */ -cvox.ChromeVoxEditableElement.prototype.moveCursorToNextCharacter = function() { - var node = this.node; - node.selectionEnd++; - node.selectionStart = node.selectionEnd; - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - return true; -}; - - -/** @override */ -cvox.ChromeVoxEditableElement.prototype.moveCursorToPreviousCharacter = - function() { - var node = this.node; - if (node.selectionStart > 0) { - node.selectionStart--; - node.selectionEnd = node.selectionStart; - } - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - return true; -}; - - -/** @override */ -cvox.ChromeVoxEditableElement.prototype.moveCursorToNextWord = function() { - var node = this.node; - var length = node.value.length; - var re = /\W+/gm; - var substring = node.value.substring(node.selectionEnd); - var match = re.exec(substring); - if (match !== null && match.index == 0) { - // Ignore word-breaking sequences right next to the cursor. - match = re.exec(substring); - } - var index = (match === null) ? length : match.index + node.selectionEnd; - node.selectionStart = node.selectionEnd = index; - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - return true; -}; - - -/** @override */ -cvox.ChromeVoxEditableElement.prototype.moveCursorToPreviousWord = function() { - var node = this.node; - var length = node.value.length; - var re = /\W+/gm; - var substring = node.value.substring(0, node.selectionStart); - var index = 0; - while (re.exec(substring) !== null) { - if (re.lastIndex < node.selectionStart) { - index = re.lastIndex; - } - } - node.selectionStart = node.selectionEnd = index; - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - return true; -}; - - -/** @override */ -cvox.ChromeVoxEditableElement.prototype.moveCursorToNextParagraph = function() { - var node = this.node; - var length = node.value.length; - var index = node.selectionEnd >= length ? - length : - node.value.indexOf('\n', node.selectionEnd); - if (index < 0) { - index = length; - } - node.selectionStart = node.selectionEnd = index + 1; - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - return true; -}; - - -/** @override */ -cvox.ChromeVoxEditableElement.prototype.moveCursorToPreviousParagraph = - function() { - var node = this.node; - var index = node.selectionStart <= 0 ? - 0 : - node.value.lastIndexOf('\n', node.selectionStart - 2) + 1; - if (index < 0) { - index = 0; - } - node.selectionStart = node.selectionEnd = index; - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - return true; -}; - -/** - * Shows the current line on the braille display. - * @private - */ -cvox.ChromeVoxEditableElement.prototype.brailleCurrentLine_ = function() { - if (this.brailleHandler_) { - var lineIndex = this.getLineIndex(this.start); - var line = this.getLine(lineIndex); - // Collapsable whitespace inside the contenteditable is represented - // as non-breaking spaces. This confuses braille input (which relies on - // the text being added to be the same as the text in the input field). - // Since the non-breaking spaces are just an artifact of how - // contenteditable is implemented, normalize to normal spaces instead. - if (this instanceof cvox.ChromeVoxEditableContentEditable) { - line = line.replace(/\u00A0/g, ' '); - } - var lineStart = this.getLineStart(lineIndex); - var start = this.start - lineStart; - var end = Math.min(this.end - lineStart, line.length); - this.brailleHandler_.changed( - line, start, end, this.multiline, this.node, lineStart); - } -}; - -/******************************************/ - - -/** - * A subclass of ChromeVoxEditableElement for an HTMLInputElement. - * @param {HTMLInputElement} node The HTMLInputElement node. - * @param {cvox.TtsInterface} tts A TTS object. - * @extends {cvox.ChromeVoxEditableElement} - * @implements {cvox.TextHandlerInterface} - * @constructor - */ -cvox.ChromeVoxEditableHTMLInput = function(node, tts) { - this.node = node; - this.setup(); - goog.base( - this, node, node.value, node.selectionStart, node.selectionEnd, - node.type === 'password', tts); -}; -goog.inherits(cvox.ChromeVoxEditableHTMLInput, cvox.ChromeVoxEditableElement); - - -/** - * Performs setup for this input node. - * This accounts for exception-throwing behavior introduced by crbug.com/324360. - * @override - */ -cvox.ChromeVoxEditableHTMLInput.prototype.setup = function() { - if (!this.node) { - return; - } - if (!cvox.DomUtil.doesInputSupportSelection(this.node)) { - this.originalType = this.node.type; - this.node.type = 'text'; - } -}; - - -/** - * Performs teardown for this input node. - * This accounts for exception-throwing behavior introduced by crbug.com/324360. - * @override - */ -cvox.ChromeVoxEditableHTMLInput.prototype.teardown = function() { - if (this.node && this.originalType) { - this.node.type = this.originalType; - } -}; - - -/** - * Update the state of the text and selection and describe any changes as - * appropriate. - * - * @param {boolean} triggeredByUser True if this was triggered by a user action. - */ -cvox.ChromeVoxEditableHTMLInput.prototype.update = function(triggeredByUser) { - var newValue = this.node.value; - var textChangeEvent = new cvox.TextChangeEvent( - newValue, this.node.selectionStart, this.node.selectionEnd, - triggeredByUser); - this.changed(textChangeEvent); -}; - - -/******************************************/ - - -/** - * A subclass of ChromeVoxEditableElement for an HTMLTextAreaElement. - * @param {HTMLTextAreaElement} node The HTMLTextAreaElement node. - * @param {cvox.TtsInterface} tts A TTS object. - * @extends {cvox.ChromeVoxEditableElement} - * @implements {cvox.TextHandlerInterface} - * @constructor - */ -cvox.ChromeVoxEditableTextArea = function(node, tts) { - goog.base( - this, node, node.value, node.selectionStart, node.selectionEnd, - false /* isPassword */, tts); - this.multiline = true; - - /** - * True if the shadow is up to date with the current value of this text area. - * @type {boolean} - * @private - */ - this.shadowIsCurrent_ = false; -}; -goog.inherits(cvox.ChromeVoxEditableTextArea, cvox.ChromeVoxEditableElement); - - -/** - * An offscreen div used to compute the line numbers. A single div is - * shared by all instances of the class. - * @type {!cvox.EditableTextAreaShadow|undefined} - * @private - */ -cvox.ChromeVoxEditableTextArea.shadow_; - - -/** - * Update the state of the text and selection and describe any changes as - * appropriate. - * - * @param {boolean} triggeredByUser True if this was triggered by a user action. - */ -cvox.ChromeVoxEditableTextArea.prototype.update = function(triggeredByUser) { - if (this.node.value != this.value) { - this.shadowIsCurrent_ = false; - } - var textChangeEvent = new cvox.TextChangeEvent( - this.node.value, this.node.selectionStart, this.node.selectionEnd, - triggeredByUser); - this.changed(textChangeEvent); -}; - - -/** - * Get the line number corresponding to a particular index. - * @param {number} index The 0-based character index. - * @return {number} The 0-based line number corresponding to that character. - */ -cvox.ChromeVoxEditableTextArea.prototype.getLineIndex = function(index) { - return this.getShadow().getLineIndex(index); -}; - - -/** - * Get the start character index of a line. - * @param {number} index The 0-based line index. - * @return {number} The 0-based index of the first character in this line. - */ -cvox.ChromeVoxEditableTextArea.prototype.getLineStart = function(index) { - return this.getShadow().getLineStart(index); -}; - - -/** - * Get the end character index of a line. - * @param {number} index The 0-based line index. - * @return {number} The 0-based index of the end of this line. - */ -cvox.ChromeVoxEditableTextArea.prototype.getLineEnd = function(index) { - return this.getShadow().getLineEnd(index); -}; - - -/** - * Update the shadow object, an offscreen div used to compute line numbers. - * @return {!cvox.EditableTextAreaShadow} The shadow object. - */ -cvox.ChromeVoxEditableTextArea.prototype.getShadow = function() { - var shadow = cvox.ChromeVoxEditableTextArea.shadow_; - if (!shadow) { - shadow = cvox.ChromeVoxEditableTextArea.shadow_ = - new cvox.EditableTextAreaShadow(); - } - if (!this.shadowIsCurrent_) { - shadow.update(this.node); - this.shadowIsCurrent_ = true; - } - return shadow; -}; - - -/** @override */ -cvox.ChromeVoxEditableTextArea.prototype.moveCursorToNextLine = function() { - var node = this.node; - var length = node.value.length; - if (node.selectionEnd >= length) { - return false; - } - var shadow = this.getShadow(); - var lineIndex = shadow.getLineIndex(node.selectionEnd); - var lineStart = shadow.getLineStart(lineIndex); - var offset = node.selectionEnd - lineStart; - var lastLine = (length == 0) ? 0 : shadow.getLineIndex(length - 1); - var newCursorPosition = (lineIndex >= lastLine) ? - length : - Math.min( - shadow.getLineStart(lineIndex + 1) + offset, - shadow.getLineEnd(lineIndex + 1)); - node.selectionStart = node.selectionEnd = newCursorPosition; - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - return true; -}; - - -/** @override */ -cvox.ChromeVoxEditableTextArea.prototype.moveCursorToPreviousLine = function() { - var node = this.node; - if (node.selectionStart <= 0) { - return false; - } - var shadow = this.getShadow(); - var lineIndex = shadow.getLineIndex(node.selectionStart); - var lineStart = shadow.getLineStart(lineIndex); - var offset = node.selectionStart - lineStart; - var newCursorPosition = (lineIndex <= 0) ? - 0 : - Math.min( - shadow.getLineStart(lineIndex - 1) + offset, - shadow.getLineEnd(lineIndex - 1)); - node.selectionStart = node.selectionEnd = newCursorPosition; - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - return true; -}; - - -/******************************************/ - - -/** - * A subclass of ChromeVoxEditableElement for elements that are contentEditable. - * This is also used for a region of HTML with the ARIA role of "textbox", - * so that an author can create a pure-JavaScript editable text object - this - * will work the same as contentEditable as long as the DOM selection is - * updated properly within the textbox when it has focus. - * @param {Element} node The root contentEditable node. - * @param {cvox.TtsInterface} tts A TTS object. - * @extends {cvox.ChromeVoxEditableElement} - * @implements {cvox.TextHandlerInterface} - * @constructor - */ -cvox.ChromeVoxEditableContentEditable = function(node, tts) { - goog.base(this, node, '', 0, 0, false /* isPassword */, tts); - - - /** - * True if the ContentEditableExtractor is current with this field's data. - * @type {boolean} - * @private - */ - this.extractorIsCurrent_ = false; - - var extractor = this.getExtractor(); - this.value = extractor.getText(); - this.start = extractor.getStartIndex(); - this.end = extractor.getEndIndex(); - this.multiline = true; -}; -goog.inherits( - cvox.ChromeVoxEditableContentEditable, cvox.ChromeVoxEditableElement); - -/** - * A helper used to compute the line numbers. A single object is - * shared by all instances of the class. - * @type {!cvox.ContentEditableExtractor|undefined} - * @private - */ -cvox.ChromeVoxEditableContentEditable.extractor_; - - -/** - * Update the state of the text and selection and describe any changes as - * appropriate. - * - * @param {boolean} triggeredByUser True if this was triggered by a user action. - */ -cvox.ChromeVoxEditableContentEditable.prototype.update = function( - triggeredByUser) { - this.extractorIsCurrent_ = false; - var textChangeEvent = new cvox.TextChangeEvent( - this.getExtractor().getText(), this.getExtractor().getStartIndex(), - this.getExtractor().getEndIndex(), triggeredByUser); - this.changed(textChangeEvent); -}; - - -/** - * Get the line number corresponding to a particular index. - * @param {number} index The 0-based character index. - * @return {number} The 0-based line number corresponding to that character. - */ -cvox.ChromeVoxEditableContentEditable.prototype.getLineIndex = function(index) { - return this.getExtractor().getLineIndex(index); -}; - - -/** - * Get the start character index of a line. - * @param {number} index The 0-based line index. - * @return {number} The 0-based index of the first character in this line. - */ -cvox.ChromeVoxEditableContentEditable.prototype.getLineStart = function(index) { - return this.getExtractor().getLineStart(index); -}; - - -/** - * Get the end character index of a line. - * @param {number} index The 0-based line index. - * @return {number} The 0-based index of the end of this line. - */ -cvox.ChromeVoxEditableContentEditable.prototype.getLineEnd = function(index) { - return this.getExtractor().getLineEnd(index); -}; - - -/** - * Update the extractor object, an offscreen div used to compute line numbers. - * @return {!cvox.ContentEditableExtractor} The extractor object. - */ -cvox.ChromeVoxEditableContentEditable.prototype.getExtractor = function() { - var extractor = cvox.ChromeVoxEditableContentEditable.extractor_; - if (!extractor) { - extractor = cvox.ChromeVoxEditableContentEditable.extractor_ = - new cvox.ContentEditableExtractor(); - } - if (!this.extractorIsCurrent_) { - extractor.update(this.node); - this.extractorIsCurrent_ = true; - } - return extractor; -}; - - -/** @override */ -cvox.ChromeVoxEditableContentEditable.prototype.changed = function(evt) { - if (!evt.triggeredByUser) { - return; - } - // Take over here if we can't describe a change; assume it's a blank line. - if (!this.shouldDescribeChange(evt)) { - this.speak(Msgs.getMsg('text_box_blank'), true); - if (this.brailleHandler_) { - this.brailleHandler_.changed( - '' /*line*/, 0 /*start*/, 0 /*end*/, true /*multiline*/, - null /*element*/, evt.start /*lineStart*/); - } - } else { - goog.base(this, 'changed', evt); - } -}; - - -/** @override */ -cvox.ChromeVoxEditableContentEditable.prototype.moveCursorToNextCharacter = - function() { - window.getSelection().modify('move', 'forward', 'character'); - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - return true; -}; - - -/** @override */ -cvox.ChromeVoxEditableContentEditable.prototype.moveCursorToPreviousCharacter = - function() { - window.getSelection().modify('move', 'backward', 'character'); - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - return true; -}; - - -/** @override */ -cvox.ChromeVoxEditableContentEditable.prototype.moveCursorToNextParagraph = - function() { - window.getSelection().modify('move', 'forward', 'paragraph'); - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - return true; -}; - -/** @override */ -cvox.ChromeVoxEditableContentEditable.prototype.moveCursorToPreviousParagraph = - function() { - window.getSelection().modify('move', 'backward', 'paragraph'); - cvox.ChromeVoxEventWatcher.handleTextChanged(true); - return true; -}; - - -/** - * @override - */ -cvox.ChromeVoxEditableContentEditable.prototype.shouldDescribeChange = function( - evt) { - var sel = window.getSelection(); - var cursor = new cvox.Cursor(sel.baseNode, sel.baseOffset, ''); - - // This is a very specific work around because of our buggy content editable - // support. Blank new lines are not captured in the line indexing data - // structures. - // Scenario: given a piece of text like: - // - // Some Title - // - // Description - // Footer - // - // The new lines after Title are not traversed to by TraverseUtil. A root fix - // would make changes there. However, considering the fickle nature of that - // code, we specifically detect for new lines here. - if (Math.abs(this.start - evt.start) != 1 && this.start == this.end && - evt.start == evt.end && sel.baseNode == sel.extentNode && - sel.baseOffset == sel.extentOffset && - sel.baseNode.nodeType == Node.ELEMENT_NODE && - sel.baseNode.querySelector('BR') && - cvox.TraverseUtil.forwardsChar(cursor, [], [])) { - // This case detects if the range selection surrounds a new line, - // but there is still content after the new line (like the example - // above after "Title"). In these cases, we "pretend" we're the - // last character so we speak "blank". - return false; - } - - // Otherwise, we should never speak "blank" no matter what (even if - // we're at the end of a content editable). - return true; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/editable_text_area_shadow.js b/chrome/browser/resources/chromeos/chromevox/common/editable_text_area_shadow.js deleted file mode 100644 index 8e2e0d8..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/editable_text_area_shadow.js +++ /dev/null
@@ -1,190 +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. - -/** - * @fileoverview Defines the EditableTextAreaShadow class. - */ - -goog.provide('cvox.EditableTextAreaShadow'); - -/** - * Creates a shadow element for an editable text area used to compute line - * numbers. - * @constructor - */ -cvox.EditableTextAreaShadow = function() { - /** - * @type {Element} - * @private - */ - this.shadowElement_ = document.createElement('div'); - - /** - * Map from line index to a data structure containing the start - * and end index within the line. - * @type {Object<number, {startIndex: number, endIndex: number}>} - * @private - */ - this.lines_ = {}; - - /** - * Map from 0-based character index to 0-based line index. - * @type {Array<number>} - * @private - */ - this.characterToLineMap_ = []; -}; - -/** - * Update the shadow element. - * @param {Element} element The textarea element. - */ -cvox.EditableTextAreaShadow.prototype.update = function(element) { - document.body.appendChild(this.shadowElement_); - - while (this.shadowElement_.childNodes.length) { - this.shadowElement_.removeChild(this.shadowElement_.childNodes[0]); - } - this.shadowElement_.style.cssText = - window.getComputedStyle(element, null).cssText; - this.shadowElement_.style.position = 'absolute'; - this.shadowElement_.style.top = '-9999'; - this.shadowElement_.style.left = '-9999'; - this.shadowElement_.setAttribute('aria-hidden', 'true'); - - // Add the text to the shadow element, but with an extra character to the - // end so that we can get the bounding box of the last line - we can't - // measure blank lines otherwise. - var text = element.value; - var textNode = document.createTextNode(text + '.'); - this.shadowElement_.appendChild(textNode); - - /** - * For extra speed, try to skip this many characters at a time - if - * none of the characters are newlines and they're all at the same - * vertical position, we don't have to examine each one. If not, - * fall back to moving by one character at a time. - * @const - */ - var SKIP = 8; - - /** - * Map from line index to a data structure containing the start - * and end index within the line. - * @type {Object<number, {startIndex: number, endIndex: number}>} - */ - var lines = {0: {startIndex: 0, endIndex: 0}}; - - var range = document.createRange(); - var offset = 0; - var lastGoodOffset = 0; - var lineIndex = 0; - var lastBottom = null; - var nearNewline = false; - var rect; - while (offset <= text.length) { - range.setStart(textNode, offset); - - // If we're near the end or if there's an explicit newline character, - // don't even try to skip. - if (offset + SKIP > text.length || - text.substr(offset, SKIP).indexOf('\n') >= 0) { - nearNewline = true; - } - - if (nearNewline) { - // Move by one character. - offset++; - range.setEnd(textNode, offset); - rect = range.getBoundingClientRect(); - } else { - // Try to move by |SKIP| characters. - range.setEnd(textNode, offset + SKIP); - rect = range.getBoundingClientRect(); - if (rect.bottom == lastBottom) { - // Great, they all seem to be on the same line. - offset += SKIP; - } else { - // Nope, there might be a newline, better go one at a time to be safe. - if (rect && lastBottom !== null) { - nearNewline = true; - } - offset++; - range.setEnd(textNode, offset); - rect = range.getBoundingClientRect(); - } - } - - if (offset > 0 && text[offset - 1] == '\n') { - // Handle an explicit newline character - that always results in - // a new line. - lines[lineIndex].endIndex = offset - 1; - lineIndex++; - lines[lineIndex] = {startIndex: offset, endIndex: offset}; - lastBottom = null; - nearNewline = false; - lastGoodOffset = offset; - } else if (rect && (lastBottom === null)) { - // This is the first character we've successfully measured on this - // line. Save the vertical position but don't do anything else. - lastBottom = rect.bottom; - } else if (rect && rect.bottom != lastBottom) { - // This character is at a different vertical position, so place an - // implicit newline immediately after the *previous* good character - // we found (which we now know was the last character of the previous - // line). - lines[lineIndex].endIndex = lastGoodOffset; - lineIndex++; - lines[lineIndex] = {startIndex: lastGoodOffset, endIndex: lastGoodOffset}; - lastBottom = rect ? rect.bottom : null; - nearNewline = false; - } - - if (rect) { - lastGoodOffset = offset; - } - } - // Finish up the last line. - lines[lineIndex].endIndex = text.length; - - // Create a map from character index to line number. - var characterToLineMap = []; - for (var i = 0; i <= lineIndex; i++) { - for (var j = lines[i].startIndex; j <= lines[i].endIndex; j++) { - characterToLineMap[j] = i; - } - } - - // Finish updating fields and remove the shadow element. - this.characterToLineMap_ = characterToLineMap; - this.lines_ = lines; - document.body.removeChild(this.shadowElement_); -}; - -/** - * Get the line number corresponding to a particular index. - * @param {number} index The 0-based character index. - * @return {number} The 0-based line number corresponding to that character. - */ -cvox.EditableTextAreaShadow.prototype.getLineIndex = function(index) { - return this.characterToLineMap_[index]; -}; - -/** - * Get the start character index of a line. - * @param {number} index The 0-based line index. - * @return {number} The 0-based index of the first character in this line. - */ -cvox.EditableTextAreaShadow.prototype.getLineStart = function(index) { - return this.lines_[index].startIndex; -}; - -/** - * Get the end character index of a line. - * @param {number} index The 0-based line index. - * @return {number} The 0-based index of the end of this line. - */ -cvox.EditableTextAreaShadow.prototype.getLineEnd = function(index) { - return this.lines_[index].endIndex; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/externs.js b/chrome/browser/resources/chromeos/chromevox/common/externs.js deleted file mode 100644 index 6ae51f4..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/externs.js +++ /dev/null
@@ -1,5 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -Document.prototype.documentElement.innerWidth;
diff --git a/chrome/browser/resources/chromeos/chromevox/common/find_util.js b/chrome/browser/resources/chromeos/chromevox/common/find_util.js deleted file mode 100644 index 4599c027..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/find_util.js +++ /dev/null
@@ -1,66 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview Utilities for finding DOM nodes and CursorSelection's. - */ - - -goog.provide('cvox.FindUtil'); - -goog.require('cvox.BareObjectWalker'); -goog.require('cvox.CursorSelection'); - - -/** - * @type {!cvox.BareObjectWalker} - * @private - */ -cvox.FindUtil.objectWalker_ = new cvox.BareObjectWalker(); - - -/** - * Finds the next selection that matches the predicate function starting from - * sel. Undefined if the nodes in sel are not attached to the document. - * @param {!cvox.CursorSelection} sel The selection from which to start. - * @param {function(Array<Node>):Node} predicate A function taking a - * unique ancestor tree and outputting Node if the ancestor tree matches - * the desired node to find. - * @param {boolean=} opt_initialNode Whether to start the search from node - * (true), or the next node (false); defaults to false. - * @return {cvox.CursorSelection} The selection that was found. - * null if end of document reached. - */ -cvox.FindUtil.findNext = function(sel, predicate, opt_initialNode) { - var r = sel.isReversed(); - var cur = - new cvox.CursorSelection(sel.absStart(), sel.absStart()).setReversed(r); - - // We may have been sync'ed into a subtree of the current predicate match. - // Find our ancestor that matches the predicate. - var ancestor; - if (ancestor = predicate(cvox.DomUtil.getAncestors(cur.start.node))) { - cur = cvox.CursorSelection.fromNode(ancestor).setReversed(r); - if (opt_initialNode) { - return cur; - } - } - - while (cur) { - // Use ObjectWalker's traversal which guarantees us a stable iteration of - // the DOM including returning null at page bounds. - cur = cvox.FindUtil.objectWalker_.next(cur); - var retNode = null; - if (!cur || - (retNode = predicate(cvox.DomUtil.getAncestors(cur.start.node)))) { - return retNode ? cvox.CursorSelection.fromNode(retNode) : null; - } - - // Iframes require inter-frame messaging. - if (cur.start.node.tagName == 'IFRAME') { - return cur; - } - } - return null; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/focus_util.js b/chrome/browser/resources/chromeos/chromevox/common/focus_util.js deleted file mode 100644 index f543834..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/focus_util.js +++ /dev/null
@@ -1,97 +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. - -/** - * @fileoverview A collection of JavaScript utilities used to manage focus - * within a document. - */ - - -goog.provide('cvox.FocusUtil'); - - -/** - * Utilities for managing focus. - * @constructor - */ -cvox.FocusUtil = function() {}; - -/** - * Maps whether an input element of specified type accepts text selection or - * not. True if the element does accept text selection, false if it does not. - * This can be used to determine whether a visitor to that element should - * provide interactive text editing to the user. - * From the W3C table of possible type keywords: - * http://www.w3.org/TR/html5/the-input-element.html#attr-input-type - * - * TODO(dmazzoni): merge this with cvox.DomUtil.isInputTypeText - * - * @type {Object} - */ -cvox.FocusUtil.INPUT_TYPE_ACCEPTS_SELECTION_TABLE = { - 'hidden': false, - 'text': true, - 'search': true, - 'tel': true, - 'url': true, - 'email': true, - 'password': true, - 'datetime': false, - 'date': false, - 'month': false, - 'week': false, - 'time': false, - 'datetime-local': false, - 'number': false, - 'range': false, - 'color': false, - 'checkbox': false, - 'radio': false, - 'file': false, - 'submit': false, - 'image': false, - 'reset': false, - 'button': false -}; - -/** - * Checks if the currently focused element is a field that accepts text input - * (This can include text fields and selectors) - * - * @return {boolean} True if the currently focused element accepts text input. - */ -cvox.FocusUtil.isFocusInTextInputField = function() { - var activeElement = document.activeElement; - - if (!activeElement) { - return false; - } - - if (activeElement.isContentEditable) { - return true; - } - - if (activeElement.getAttribute('role') == 'textbox') { - return true; - } - - if (activeElement.getAttribute('readOnly') == 'true') { - return false; - } - - if (activeElement.tagName === 'TEXTAREA' || - activeElement.tagName === 'SELECT') { - return true; - } - - if (activeElement.tagName === 'INPUT') { - if (!activeElement.hasAttribute('type')) { - return true; - } else { - var activeType = activeElement.getAttribute('type').toLowerCase(); - return cvox.FocusUtil.INPUT_TYPE_ACCEPTS_SELECTION_TABLE[activeType]; - } - } - return false; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/focuser.js b/chrome/browser/resources/chromeos/chromevox/common/focuser.js deleted file mode 100644 index dede442..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/focuser.js +++ /dev/null
@@ -1,119 +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. - -/** - * @fileoverview Implements the setFocus function. - */ - -goog.provide('cvox.Focuser'); - -goog.require('cvox.ChromeVoxEventSuspender'); -goog.require('cvox.DomUtil'); - - -/** - * Sets the browser focus to the targetNode or its closest ancestor that is - * focusable. - * - * @param {Node} targetNode The node to move the browser focus to. - * @param {boolean=} opt_focusDescendants Whether or not we check descendants - * of the target node to see if they are focusable. If true, sets focus on the - * first focusable descendant. If false, only sets focus on the targetNode or - * its closest ancestor. Default is false. - */ -cvox.Focuser.setFocus = function(targetNode, opt_focusDescendants) { - // Save the selection because Chrome will lose it if there's a focus or blur. - var sel = window.getSelection(); - var range; - if (sel.rangeCount > 0) { - range = sel.getRangeAt(0); - } - // Blur the currently-focused element if the target node is not a descendant. - if (document.activeElement && - !cvox.DomUtil.isDescendantOfNode(targetNode, document.activeElement)) { - document.activeElement.blur(); - } - - // Video elements should always be focusable. - if (targetNode && (targetNode.constructor == HTMLVideoElement)) { - if (!cvox.DomUtil.isFocusable(targetNode)) { - targetNode.setAttribute('tabIndex', 0); - } - } - - if (opt_focusDescendants && !cvox.DomUtil.isFocusable(targetNode)) { - var focusableDescendant = cvox.DomUtil.findFocusableDescendant(targetNode); - if (focusableDescendant) { - targetNode = focusableDescendant; - } - } else { - // Search up the parent chain until a focusable node is found. - while (targetNode && !cvox.DomUtil.isFocusable(targetNode)) { - targetNode = targetNode.parentNode; - } - } - - // If we found something focusable, focus it - otherwise, blur it. - if (cvox.DomUtil.isFocusable(targetNode)) { - // Don't let the instance of ChromeVox in the parent focus iframe children - // - instead, let the instance of ChromeVox in the iframe focus itself to - // avoid getting trapped in iframes that have no ChromeVox in them. - // This self focusing is performed by calling window.focus() in - // cvox.NavigationManager.prototype.addInterframeListener_ - if (targetNode.tagName != 'IFRAME') { - // setTimeout must be used because there's a bug (in Chrome, I think) - // with .focus() which causes the page to be redrawn incorrectly if - // not in setTimeout. - if (cvox.ChromeVoxEventSuspender.areEventsSuspended()) { - if (cvox.Focuser.shouldEnterSuspendEvents_(targetNode)) { - cvox.ChromeVoxEventSuspender.enterSuspendEvents(); - } - window.setTimeout(function() { - targetNode.focus(); - cvox.ChromeVoxEventSuspender.exitSuspendEvents(); - }, 0); - } else { - window.setTimeout(function() { - targetNode.focus(); - }, 0); - } - } - } else if ( - document.activeElement && document.activeElement.tagName != 'BODY') { - document.activeElement.blur(); - } - - // Restore the selection, unless the focused item is a text box. - if (cvox.DomUtil.isInputTypeText(targetNode)) { - targetNode.select(); - } else if (range) { - sel.removeAllRanges(); - sel.addRange(range); - } -}; - -/** - * Rules for whether or not enterSuspendEvents should be called. - * In general, we should not enterSuspendEvents if the targetNode will get some - * special handlers attached when a focus event is received for it; otherwise, - * the special handlers will not get attached. - * - * @param {Node} targetNode The node that is being focused. - * @return {boolean} True if enterSuspendEvents should be called. - */ -cvox.Focuser.shouldEnterSuspendEvents_ = function(targetNode) { - if (targetNode.constructor && targetNode.constructor == HTMLVideoElement) { - return false; - } - if (targetNode.hasAttribute) { - switch (targetNode.getAttribute('type')) { - case 'time': - case 'date': - case 'week': - case 'month': - return false; - } - } - return true; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/group_util.js b/chrome/browser/resources/chromeos/chromevox/common/group_util.js deleted file mode 100644 index d487cfc..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/group_util.js +++ /dev/null
@@ -1,149 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview Some utilities for defining what groups are. - */ - - -goog.provide('cvox.GroupUtil'); - -goog.require('cvox.AriaUtil'); -goog.require('cvox.DomUtil'); - - -/** - * If a node contains more characters than this, it should not be treated - * as a leaf node by the smart navigation algorithm. - * - * This number was determined by looking at the average number of - * characters in a paragraph: - * http://www.fullondesign.co.uk/design/usability/ - * 285-how-many-characters-per-a-page-is-normal.htm - * and then trying it out on a few popular websites (CNN, BBC, - * Google Search, etc.) and making sure it made sense. - * @type {number} - * @private - * @const - */ -cvox.GroupUtil.MAX_CHARCOUNT_ = 1500; - - -/** - * If a node contains any of these elements, it should not be treated - * as a leaf node by the smart navigation algorithm. - * @type {string} - * @private - * @const - */ -cvox.GroupUtil.BREAKOUT_SELECTOR_ = 'blockquote,' + - 'button,' + - 'code,' + - 'form,' + - 'frame,' + - 'h1,' + - 'h2,' + - 'h3,' + - 'h4,' + - 'h5,' + - 'h6,' + - 'hr,' + - 'iframe,' + - 'input,' + - 'object,' + - 'ol,' + - 'p,' + - 'pre,' + - 'select,' + - 'table,' + - 'tr,' + - 'ul,' + - 'math,' + - // This takes care of MathJax expressions. - 'span.math,' + - // TODO (sorge) Do we want to group all math or only display math? - // '[mode="display"],' + - // Aria widget roles - '[role~="alert ' + - 'alertdialog ' + - 'button ' + - 'checkbox ' + - 'combobox ' + - 'dialog ' + - 'log ' + - 'marquee ' + - 'menubar ' + - 'progressbar ' + - 'radio ' + - 'radiogroup ' + - 'scrollbar ' + - 'slider ' + - 'spinbutton ' + - 'status ' + - 'tab ' + - 'tabpanel ' + - 'textbox ' + - 'toolbar ' + - 'tooltip ' + - 'treeitem ' + - // Aria structure roles - 'article ' + - 'document ' + - 'group ' + - 'heading ' + - 'img ' + - 'list ' + - 'math ' + - 'region ' + - 'row ' + - 'separator"]'; - - -/** - * Returns true if this is a leaf node for groups. - * true for a node => true for all child nodes - * true if node has no children - * @param {!Node} node The node to check. - * @return {boolean} true if this is at the "leaf node" level or lower - * for this granularity. - */ -cvox.GroupUtil.isLeafNode = function(node) { - // TODO (stoarca): Write test to make sure that this function satisfies - // the restriction given above. - if (node.tagName == 'LABEL') { - return cvox.DomUtil.isLeafNode(node); - } - if (cvox.DomUtil.isLeafNode(node)) { - return true; - } - - if (!cvox.DomUtil.isSemanticElt(node)) { - var breakingNodes = - node.querySelectorAll(cvox.GroupUtil.BREAKOUT_SELECTOR_); - - for (var i = 0; i < breakingNodes.length; ++i) { - if (cvox.DomUtil.hasContent(breakingNodes[i])) { - return false; - } - } - } - - if (cvox.AriaUtil.isCompositeControl(node) && - !cvox.DomUtil.isFocusable(node)) { - return false; - } - - var content = cvox.DomUtil.collapseWhitespace( - cvox.DomUtil.getValue(node) + ' ' + cvox.DomUtil.getName(node)); - if (content.length > cvox.GroupUtil.MAX_CHARCOUNT_) { - return false; - } - - if (content.replace(/\s/g, '') === '') { - // Text only contains whitespace - return false; - } - - return true; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/interframe.js b/chrome/browser/resources/chromeos/chromevox/common/interframe.js deleted file mode 100644 index bae17e9..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/interframe.js +++ /dev/null
@@ -1,235 +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. - -/** - * @fileoverview Tools for interframe communication. To use this class, every - * window that wants to communicate with its child iframes should enumerate - * them using document.getElementsByTagName('iframe'), create an ID to - * associate with that iframe, then call cvox.Interframe.sendIdToIFrame - * on each of them. Then use cvox.Interframe.sendMessageToIFrame to send - * messages to that iframe and cvox.Interframe.addListener to receive - * replies. When a reply is received, it will automatically contain the ID of - * that iframe as a parameter. - * - */ - -goog.provide('cvox.Interframe'); - -goog.require('cvox.ChromeVoxJSON'); -goog.require('cvox.DomUtil'); - -/** - * @constructor - */ -cvox.Interframe = function() {}; - -/** - * The prefix of all interframe messages. - * @type {string} - * @const - */ -cvox.Interframe.IF_MSG_PREFIX = 'cvox.INTERFRAME:'; - -/** - * The message used to set the ID of a child frame so that it can send replies - * to its parent frame. - * @type {string} - * @const - */ -cvox.Interframe.SET_ID = 'cvox.INTERFRAME_SET_ID'; - -/** - * The message used by a child frame to acknowledge an id was set (sent to its - * parent frame. - * @type {string} - * @const - */ -cvox.Interframe.ACK_SET_ID = 'cvox.INTERFRAME_ACK_SET_ID'; - -/** - * The ID of this window (relative to its parent farme). - * @type {number|string|undefined} - */ -cvox.Interframe.id; - -/** - * Array of functions that have been registered as listeners to interframe - * messages send to this window. - * @type {Array<function(Object)>} - */ -cvox.Interframe.listeners = []; - -/** - * Maps an id to a function which gets called when a frame first sends an ack - * for a set id msg. - @dict {!Object<number|string, function()>} - * @private - */ -cvox.Interframe.idToCallback_ = {}; - -/** - * Flag for unit testing. When false, skips over iframe.contentWindow check - * in sendMessageToIframe. This is needed because in the wild, ChromeVox may - * not have access to iframe.contentWindow due to the same-origin security - * policy. There is no reason to set this outside of a test. - * @type {boolean} - */ -cvox.Interframe.allowAccessToIframeContentWindow = true; - -/** - * Initializes the cvox.Interframe module. (This is called automatically.) - */ -cvox.Interframe.init = function() { - cvox.Interframe.messageListener = function(event) { - if (typeof event.data === 'string' && - event.data.startsWith(cvox.Interframe.IF_MSG_PREFIX)) { - var suffix = event.data.substr(cvox.Interframe.IF_MSG_PREFIX.length); - var message = /** @type {Object} */ (cvox.ChromeVoxJSON.parse(suffix)); - if (message['command'] == cvox.Interframe.SET_ID) { - cvox.Interframe.id = message['id']; - message['command'] = cvox.Interframe.ACK_SET_ID; - cvox.Interframe.sendMessageToParentWindow(message); - } else if (message['command'] == cvox.Interframe.ACK_SET_ID) { - cvox.Interframe.id = message['id']; - var callback = cvox.Interframe.idToCallback_[cvox.Interframe.id]; - callback(); - } - for (var i = 0, listener; listener = cvox.Interframe.listeners[i]; i++) { - listener(message); - } - } - return false; - }; - window.addEventListener('message', cvox.Interframe.messageListener, true); -}; - -/** - * Unregister the main window event listener. Intended for clean unit testing; - * normally there's no reason to call this outside of a test. - */ -cvox.Interframe.shutdown = function() { - window.removeEventListener('message', cvox.Interframe.messageListener, true); -}; - -/** - * Register a function to listen to all interframe communication messages. - * Messages from a child frame will have a parameter 'id' that you assigned - * when you called cvox.Interframe.sendIdToIFrame. - * @param {function(Object)} listener The listener function. - */ -cvox.Interframe.addListener = function(listener) { - cvox.Interframe.listeners.push(listener); -}; - -/** - * Send a message to another window. - * @param {Object} message The message to send. - * @param {Window} window The window to receive the message. - */ -cvox.Interframe.sendMessageToWindow = function(message, window) { - var encodedMessage = cvox.Interframe.IF_MSG_PREFIX + - cvox.ChromeVoxJSON.stringify(message, null, null); - window.postMessage(encodedMessage, '*'); -}; - -/** - * Send a message to another iframe. - * @param {Object} message The message to send. The message must have an 'id' - * parameter in order to be sent. - * @param {HTMLIFrameElement} iframe The iframe to send the message to. - */ -cvox.Interframe.sendMessageToIFrame = function(message, iframe) { - if (cvox.Interframe.allowAccessToIframeContentWindow && - iframe.contentWindow) { - cvox.Interframe.sendMessageToWindow(message, iframe.contentWindow); - return; - } - - // A content script can't access window.parent, but the page can, so - // inject a tiny bit of javascript into the page. - var encodedMessage = cvox.Interframe.IF_MSG_PREFIX + - cvox.ChromeVoxJSON.stringify(message, null, null); - var script = document.createElement('script'); - script.type = 'text/javascript'; - - // TODO: Make this logic more like makeNodeReference_ inside api.js - // (line 126) so we can use an attribute instead of a classname - if (iframe.hasAttribute('id') && - document.getElementById(iframe.id) == iframe) { - // Ideally, try to send it based on the iframe's existing id. - script.innerHTML = 'document.getElementById(decodeURI(\'' + - encodeURI(iframe.id) + '\')).contentWindow.postMessage(decodeURI(\'' + - encodeURI(encodedMessage) + '\'), \'*\');'; - } else { - // If not, add a style name and send it based on that. - var styleName = 'cvox_iframe' + message['id']; - if (iframe.className === '') { - iframe.className = styleName; - } else if (iframe.className.indexOf(styleName) == -1) { - iframe.className += ' ' + styleName; - } - - script.innerHTML = 'document.getElementsByClassName(decodeURI(\'' + - encodeURI(styleName) + - '\'))[0].contentWindow.postMessage(decodeURI(\'' + - encodeURI(encodedMessage) + '\'), \'*\');'; - } - - // Remove the script so we don't leave any clutter. - document.head.appendChild(script); - window.setTimeout(function() { - document.head.removeChild(script); - }, 1000); -}; - -/** - * Send a message to the parent window of this window, if any. If the parent - * assigned this window an ID, sends back the ID in the reply automatically. - * @param {Object} message The message to send. - */ -cvox.Interframe.sendMessageToParentWindow = function(message) { - if (!cvox.Interframe.isIframe()) { - return; - } - - message['sourceId'] = cvox.Interframe.id; - if (window.parent) { - cvox.Interframe.sendMessageToWindow(message, window.parent); - return; - } - - // A content script can't access window.parent, but the page can, so - // use window.location.href to execute a simple line of javascript in - // the page context. - var encodedMessage = cvox.Interframe.IF_MSG_PREFIX + - cvox.ChromeVoxJSON.stringify(message, null, null); - window.location.href = 'javascript:window.parent.postMessage(\'' + - encodeURI(encodedMessage) + '\', \'*\');'; -}; - -/** - * Send the given ID to a child iframe. - * @param {number|string} id The ID you want to receive in replies from - * this iframe. - * @param {HTMLIFrameElement} iframe The iframe to assign. - * @param {function()=} opt_callback Called when a ack msg arrives from the - *frame. - */ -cvox.Interframe.sendIdToIFrame = function(id, iframe, opt_callback) { - if (opt_callback) { - cvox.Interframe.idToCallback_[id] = opt_callback; - } - var message = {'command': cvox.Interframe.SET_ID, 'id': id}; - cvox.Interframe.sendMessageToIFrame(message, iframe); -}; - -/** - * Returns true if inside iframe - * @return {boolean} true if inside iframe. - */ -cvox.Interframe.isIframe = function() { - return (window != window.parent); -}; - -cvox.Interframe.init();
diff --git a/chrome/browser/resources/chromeos/chromevox/common/key_sequence.js b/chrome/browser/resources/chromeos/chromevox/common/key_sequence.js index a96c7a71..f1550e1 100644 --- a/chrome/browser/resources/chromeos/chromevox/common/key_sequence.js +++ b/chrome/browser/resources/chromeos/chromevox/common/key_sequence.js
@@ -11,7 +11,6 @@ goog.provide('cvox.KeySequence'); goog.require('cvox.ChromeVox'); -goog.require('cvox.PlatformFilter'); /** @@ -53,8 +52,6 @@ /** @type {boolean} */ this.requireStickyMode = !!opt_requireStickyMode; - /** @type {cvox.PlatformFilter} */ - this.platformFilter; /** @type {boolean} */ this.skipStripping = !!opt_skipStripping;
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/keyboard_handler.js b/chrome/browser/resources/chromeos/chromevox/common/keyboard_handler.js similarity index 100% rename from chrome/browser/resources/chromeos/chromevox/chromevox/injected/keyboard_handler.js rename to chrome/browser/resources/chromeos/chromevox/common/keyboard_handler.js
diff --git a/chrome/browser/resources/chromeos/chromevox/common/media_widget.js b/chrome/browser/resources/chromeos/chromevox/common/media_widget.js deleted file mode 100644 index 9ea4a695..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/media_widget.js +++ /dev/null
@@ -1,91 +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. - -goog.provide('cvox.ChromeVoxHTMLMediaWidget'); - -/** - * @fileoverview Gives the user spoken feedback as they interact with the HTML5 - * media widgets (<video> and <audio>) + makes the widget keyboard accessible. - * - */ - -/** - * A class containing the information needed to speak - * a media element to the user. - * - * @constructor - * @param {Element} mediaElem The media widget element. - * @param {cvox.TtsInterface} tts The TTS object from ChromeVox. - */ -cvox.ChromeVoxHTMLMediaWidget = function(mediaElem, tts) { - var self = this; - this.mediaElem_ = mediaElem; - this.mediaTts_ = tts; - - this.keyListener_ = function(evt) { - self.eventHandler_(evt); - }; - this.blurListener_ = function(evt) { - self.shutdown(); - }; - - this.mediaElem_.addEventListener('keydown', this.keyListener_, false); - this.mediaElem_.addEventListener('keyup', this.keyListener_, false); - this.mediaElem_.addEventListener('blur', this.blurListener_, false); -}; - -/** - * Removes the key listeners for the media widget. - */ -cvox.ChromeVoxHTMLMediaWidget.prototype.shutdown = function() { - this.mediaElem_.removeEventListener('blur', this.blurListener_, false); - this.mediaElem_.removeEventListener('keydown', this.keyListener_, false); - this.mediaElem_.removeEventListener('keyup', this.keyListener_, false); -}; - -cvox.ChromeVoxHTMLMediaWidget.prototype.jumpToTime_ = function(targetTime) { - if (targetTime < 0) { - targetTime = 0; - } - if (targetTime > this.mediaElem_.duration) { - targetTime = this.mediaElem_.duration; - } - this.mediaElem_.currentTime = targetTime; -}; - -cvox.ChromeVoxHTMLMediaWidget.prototype.setVolume_ = function(targetVolume) { - if (targetVolume < 0) { - targetVolume = 0; - } - if (targetVolume > 1.0) { - targetVolume = 1.0; - } - this.mediaElem_.volume = targetVolume; -}; - -/** - * Adds basic keyboard handlers to the media widget. - */ -cvox.ChromeVoxHTMLMediaWidget.prototype.eventHandler_ = function(evt) { - if (evt.type == 'keydown') { - // Space/Enter for play/pause toggle. - if ((evt.keyCode == 13) || (evt.keyCode == 32)) { - if (this.mediaElem_.paused) { - this.mediaElem_.play(); - } else { - this.mediaElem_.pause(); - } - } else if (evt.keyCode == 39) { // Right - FF - this.jumpToTime_( - this.mediaElem_.currentTime + (this.mediaElem_.duration / 10)); - } else if (evt.keyCode == 37) { // Left - REW - this.jumpToTime_( - this.mediaElem_.currentTime - (this.mediaElem_.duration / 10)); - } else if (evt.keyCode == 38) { // Up - Vol. Up - this.setVolume_(this.mediaElem_.volume + .1); - } else if (evt.keyCode == 40) { // Down - Vol. Down - this.setVolume_(this.mediaElem_.volume - .1); - } - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/memoize.js b/chrome/browser/resources/chromeos/chromevox/common/memoize.js deleted file mode 100644 index d17970f..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/memoize.js +++ /dev/null
@@ -1,132 +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. - -/** - * @fileoverview Provides a system for memoizing computations applied to - * DOM nodes within the same call stack. - * - * To make a function memoizable - suppose you have a function - * isAccessible that takes a node and returns a boolean: - * - * function isAccessible(node) { - * return expensiveComputation(node); - * } - * - * Make it memoizable like this: - * - * function isAccessible(node) { - * return cvox.Memoize.memoize(computeIsAccessible_, 'isAccessible', node); - * } - * - * function computeIsAccessible_(node) { - * return expensiveComputation(node); - * } - * - * To take advantage of memoization, you need to wrap a sequence of - * computations in a call to memoize.scope() - memoization is only - * enabled while in that scope, and all cached data is thrown away at - * the end. You should use this only when you're sure the computation - * being memoized will not change within the scope. - * - * cvox.Memoize.scope(function() { - * console.log(isAccessible(document.body)); - * }); - * - */ - - -goog.provide('cvox.Memoize'); - - -/** - * Create the namespace. - * @constructor - */ -cvox.Memoize = function() {}; - -/** - * The cache: a map from string function name to a WeakMap from DOM node - * to function result. This variable is null when we're out of scope, and it's - * a map from string to WeakMap to result when we're in scope. - * - * @type {?Object<WeakMap<Node, *> >} - * @private - */ -cvox.Memoize.nodeMap_ = null; - -/** - * Keeps track of how many nested times scope() has been called. - * @type {number} - * @private - */ -cvox.Memoize.scopeCount_ = 0; - - -/** - * Enables memoization within the scope of the given function. You should - * ensure that the DOM is not modified within this scope. - * - * It's safe to nest calls to scope. The nested calls have - * no effect, only the outermost one. - * - * @param {Function} functionScope The function to call with memoization - * enabled. - * @return {*} The value returned by |functionScope|. - */ -cvox.Memoize.scope = function(functionScope) { - var result; - try { - cvox.Memoize.scopeCount_++; - if (cvox.Memoize.scopeCount_ == 1) { - cvox.Memoize.nodeMap_ = {}; - } - result = functionScope(); - } finally { - cvox.Memoize.scopeCount_--; - if (cvox.Memoize.scopeCount_ == 0) { - cvox.Memoize.nodeMap_ = null; - } - } - return result; -}; - -/** - * Memoizes the result of a function call, so if you call this again - * with the same exact parameters and memoization is currently enabled - * (via a call to scope()), the second time the cached result - * will just be returned directly. - * - * @param {Function} functionClosure The function to call and cache the - * result of. - * @param {string} functionName The name of the function you're calling. - * This string is used to store and retrieve the cached result, so - * it should be unique. If the function to be memoized takes simple - * arguments in addition to a DOM node, you can incorporate those - * arguments into the function name. - * @param {Node} node The DOM node that should be passed as the argument - * to the function. - * @return {*} The return value of |functionClosure|. - */ -cvox.Memoize.memoize = function(functionClosure, functionName, node) { - if (cvox.Memoize.nodeMap_ && - cvox.Memoize.nodeMap_[functionName] === undefined) { - cvox.Memoize.nodeMap_[functionName] = new WeakMap(); - } - - // If we're not in scope, just call the function directly. - if (!cvox.Memoize.nodeMap_) { - return functionClosure(node); - } - - var result = cvox.Memoize.nodeMap_[functionName].get(node); - if (result === undefined) { - result = functionClosure(node); - if (result === undefined) { - throw 'A memoized function cannot return undefined.'; - } - cvox.Memoize.nodeMap_[functionName].set(node, result); - } - - return result; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/nav_description.js b/chrome/browser/resources/chromeos/chromevox/common/nav_description.js index 15b957da..319f2b9 100644 --- a/chrome/browser/resources/chromeos/chromevox/common/nav_description.js +++ b/chrome/browser/resources/chromeos/chromevox/common/nav_description.js
@@ -13,7 +13,6 @@ goog.require('cvox.AbstractTts'); goog.require('cvox.ChromeVox'); -goog.require('cvox.CursorSelection'); goog.require('cvox.QueueMode'); /**
diff --git a/chrome/browser/resources/chromeos/chromevox/common/nav_math_description.js b/chrome/browser/resources/chromeos/chromevox/common/nav_math_description.js deleted file mode 100644 index e76c6886..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/nav_math_description.js +++ /dev/null
@@ -1,48 +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. - -/** - * @fileoverview A subclass of the navigation description container - * specialising on math objects. - * - */ - - -goog.provide('cvox.NavMathDescription'); - -goog.require('cvox.NavDescription'); - - -/** - * Class specialising navigation descriptions for mathematics. - * @param {{context: (undefined|string), - * text: (string), - * userValue: (undefined|string), - * annotation: (undefined|string), - * earcons: (undefined|Array<cvox.Earcon>), - * personality: (undefined|Object), - * hint: (undefined|string), - * category: (undefined|string), - * domain: (undefined|string), - * style: (undefined|string)}} kwargs The arguments for - * the specialised math navigationdescription. See arguments of nav - * description plus the following: - * domain Domain for translation. - * style Style for translation. - * @constructor - * @extends {cvox.NavDescription} - */ -cvox.NavMathDescription = function(kwargs) { - goog.base(this, kwargs); - - var newPersonality = this.personality ? this.personality : {}; - var mathDescr = new Object(); - - mathDescr['domain'] = kwargs.domain ? kwargs.domain : ''; - // TODO (sorge) Collate and document styles in an enum structure. - mathDescr['style'] = kwargs.style ? kwargs.style : ''; - newPersonality['math'] = mathDescr; - this.personality = newPersonality; -}; -goog.inherits(cvox.NavMathDescription, cvox.NavDescription);
diff --git a/chrome/browser/resources/chromeos/chromevox/common/node_state.js b/chrome/browser/resources/chromeos/chromevox/common/node_state.js deleted file mode 100644 index ce082ac1..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/node_state.js +++ /dev/null
@@ -1,54 +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. - -/** - * @fileoverview The cvox.NodeState typedef. - */ - -goog.provide('cvox.NodeState'); -goog.provide('cvox.NodeStateUtil'); - -goog.require('Msgs'); - -/** - * Holds the state of a node. It is an Array or Arrays of strings and numbers. - * Each sub array is in the format: - * [state, opt_arg, opt_arg, ...]. These sub arrays map directly to a - * cvox.ChromeVox.getMsg() call. For example [list_position, 3, 5] maps to - * getMsg('list_position', [3, 5]); - * - * @typedef {!Array<!Array<string|number>>} - */ -cvox.NodeState; - -/** - * Returns a localized, readable string with the NodeState. - * - * NOTE(deboer): Once AriaUtil and DomUtil are using NodeState exclusively, this - * function can be moved into DescriptionUtil, removing the cvox.ChromeVox - * dependency here. - * - * @param {cvox.NodeState} state The node state. - * @return {string} The readable state string. - */ -cvox.NodeStateUtil.expand = function(state) { - try { - return state - .map(function(s) { - if (s.length < 1) { - throw new Error('cvox.NodeState must have at least one entry'); - } - var args = s.slice(1).map(function(a) { - if (typeof a == 'number') { - return Msgs.getNumber(a); - } - return a; - }); - return Msgs.getMsg(/** @type {string} */ (s[0]), args); - }) - .join(' '); - } catch (e) { - throw new Error('error: ' + e + ' state: ' + state); - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/page_selection.js b/chrome/browser/resources/chromeos/chromevox/common/page_selection.js deleted file mode 100644 index 1f866772..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/page_selection.js +++ /dev/null
@@ -1,108 +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. - -/** - * @fileoverview A class representing a DOM selection conveyed through - * CursorSelection idioms. - * A PageSelection is just a DOM selection. The class itself manages a single - * CursorSelection that surrounds a fragment on the page. It also provides an - * extend operation to either grow or shrink the selection given a - * CursorSelection. The class handles correctly moving the internal - * CursorSelection and providing immediate access to a full description of the - * selection at any time. - */ - -goog.provide('cvox.PageSelection'); - -goog.require('cvox.AbstractEarcons'); -goog.require('cvox.CursorSelection'); -goog.require('cvox.NavDescription'); - -/** - * @constructor - * @param {!cvox.CursorSelection} sel The initial selection. - */ -cvox.PageSelection = function(sel) { - this.sel_ = sel.clone(); - this.sel_.select(); - this.wasBegin_ = true; -}; - - -/** - * Gets a description for the DOM selection during the course of navigation. - * @param {cvox.AbstractShifter} navShifter Used to obtain walker-based - * descriptions. - * @param {!cvox.CursorSelection} prevSel Previous CursorSelection in - * navigation. - * @param {!cvox.CursorSelection} curSel Current CursorSelection in navigation. - * @return {Array<cvox.NavDescription>} The new description. - */ -cvox.PageSelection.prototype.getDescription = function( - navShifter, prevSel, curSel) { - var desc = []; - if (this.sel_.isReversed() != curSel.isReversed()) { - // A shrinking selection. - desc = navShifter.getDescription(curSel, prevSel); - desc[0].annotation = Msgs.getMsg('describe_unselected'); - desc[0].pushEarcon(cvox.Earcon.SELECTION_REVERSE); - } else { - // A growing selection. - desc = navShifter.getDescription(prevSel, curSel); - desc[0].annotation = Msgs.getMsg('describe_selected'); - desc[0].pushEarcon(cvox.Earcon.SELECTION); - if (!this.wasBegin_ && this.sel_.absEquals(curSel.clone().normalize())) { - // A selection has inverted across the start cursor. Describe it. - var prevDesc = navShifter.getDescription(curSel, prevSel); - prevDesc[0].annotation = Msgs.getMsg('describe_unselected'); - prevDesc[0].pushEarcon(cvox.Earcon.SELECTION_REVERSE); - prevDesc[0].pushEarcon(cvox.Earcon.WRAP); - desc = prevDesc.concat(desc); - } - } - return desc; -}; - - -/** - * Gets a full description for the entire DOM selection. - * Use this description when you want to describe the entire selection - * represented by this instance. - * - * @return {Array<cvox.NavDescription>} The new description. - */ -cvox.PageSelection.prototype.getFullDescription = function() { - return [new cvox.NavDescription({ - text: window.getSelection().toString(), - context: Msgs.getMsg('selection_is') - })]; -}; - - -/** - * Extends this selection. - * @param {!cvox.CursorSelection} sel Extend DOM selection to the selection. - * @return {boolean} True if the extension occurred, false if the PageSelection - * was reset to sel. - */ -cvox.PageSelection.prototype.extend = function(sel) { - if (!this.sel_.directedBefore(sel)) { - // Do not allow for crossed selections. This restarts a page selection that - // has been collapsed. This occurs when two CursorSelection's point away - // from one another. - this.sel_ = sel.clone(); - } else { - // Otherwise, it is assumed that the CursorSelection's are in directed - // document order. The CursorSelection's are either pointing in the same - // direction or towards one another. In the first case, shrink/extend this - // PageSelection to the end of "sel". In the second case, shrink/extend this - // PageSelection to the start of "sel". - this.sel_.end = this.sel_.isReversed() == sel.isReversed() ? - sel.end.clone() : - sel.start.clone(); - } - this.sel_.select(); - this.wasBegin_ = false; - return !this.sel_.absEquals(sel); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/platform_util.js b/chrome/browser/resources/chromeos/chromevox/common/platform_util.js deleted file mode 100644 index c1c67ed3..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/platform_util.js +++ /dev/null
@@ -1,51 +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. - -/** - * @fileoverview Utilities for working with platforms. - */ - - -goog.provide('cvox.PlatformFilter'); -goog.provide('cvox.PlatformUtil'); - -goog.require('cvox.ChromeVox'); - -/** - * @enum - */ -cvox.PlatformFilter = { - NONE: 0, - WINDOWS: 1, - MAC: 2, - LINUX: 4, - WML: 7, - CHROMEOS: 8, - ANDROID: 16 -}; - - -/** - *Checks whether the given filter matches the current platform. An undefined - * filter always matches the current platform. - * @param {undefined|cvox.PlatformFilter|number} filter The filter. - * @return {boolean} Whether the filter matches the current platform. - */ -cvox.PlatformUtil.matchesPlatform = function(filter) { - var uA = navigator.userAgent; - if (filter == undefined) { - return true; - } else if (uA.indexOf('Android') != -1) { - return (filter & cvox.PlatformFilter.ANDROID) != 0; - } else if (uA.indexOf('Win') != -1) { - return (filter & cvox.PlatformFilter.WINDOWS) != 0; - } else if (uA.indexOf('Mac') != -1) { - return (filter & cvox.PlatformFilter.MAC) != 0; - } else if (uA.indexOf('Linux') != -1) { - return (filter & cvox.PlatformFilter.LINUX) != 0; - } else if (uA.indexOf('CrOS') != -1) { - return (filter & cvox.PlatformFilter.CHROMEOS) != 0; - } - return false; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/selection_util.js b/chrome/browser/resources/chromeos/chromevox/common/selection_util.js deleted file mode 100644 index 6993225..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/selection_util.js +++ /dev/null
@@ -1,607 +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. - -/** - * @fileoverview A collection of JavaScript utilities used to improve selection - * at different granularities. - */ - - -goog.provide('cvox.SelectionUtil'); - -goog.require('cvox.DomUtil'); -goog.require('cvox.XpathUtil'); - -/** - * Utilities for improving selection. - * @constructor - */ -cvox.SelectionUtil = function() {}; - -/** - * Cleans up a paragraph selection acquired by extending forward. - * In this context, a paragraph selection is 'clean' when the focus - * node (the end of the selection) is not on a text node. - * @param {Selection} sel The paragraph-length selection. - * @return {boolean} True if the selection has been cleaned. - * False if the selection cannot be cleaned without invalid extension. - */ -cvox.SelectionUtil.cleanUpParagraphForward = function(sel) { - var expand = true; - - // nodeType:3 == TEXT_NODE - while (sel.focusNode.nodeType == 3) { - // Ending with a text node, which is incorrect. Keep extending forward. - var fnode = sel.focusNode; - var foffset = sel.focusOffset; - - sel.modify('extend', 'forward', 'sentence'); - if ((fnode == sel.focusNode) && (foffset == sel.focusOffset)) { - // Nothing more to be done, cannot extend forward further. - return false; - } - } - - return true; -}; - -/** - * Cleans up a paragraph selection acquired by extending backward. - * In this context, a paragraph selection is 'clean' when the focus - * node (the end of the selection) is not on a text node. - * @param {Selection} sel The paragraph-length selection. - * @return {boolean} True if the selection has been cleaned. - * False if the selection cannot be cleaned without invalid extension. - */ -cvox.SelectionUtil.cleanUpParagraphBack = function(sel) { - var expand = true; - - var fnode; - var foffset; - - // nodeType:3 == TEXT_NODE - while (sel.focusNode.nodeType == 3) { - // Ending with a text node, which is incorrect. Keep extending backward. - fnode = sel.focusNode; - foffset = sel.focusOffset; - - sel.modify('extend', 'backward', 'sentence'); - - if ((fnode == sel.focusNode) && (foffset == sel.focusOffset)) { - // Nothing more to be done, cannot extend backward further. - return true; - } - } - - return true; -}; - -/** - * Cleans up a sentence selection by extending forward. - * In this context, a sentence selection is 'clean' when the focus - * node (the end of the selection) is either: - * - not on a text node - * - on a text node that ends with a period or a space - * @param {Selection} sel The sentence-length selection. - * @return {boolean} True if the selection has been cleaned. - * False if the selection cannot be cleaned without invalid extension. - */ -cvox.SelectionUtil.cleanUpSentence = function(sel) { - var expand = true; - var lastSelection; - var lastSelectionOffset; - - while (expand) { - // nodeType:3 == TEXT_NODE - if (sel.focusNode.nodeType == 3) { - // The focus node is of type text, check end for period - - var fnode = sel.focusNode; - var foffset = sel.focusOffset; - - if (sel.rangeCount > 0 && sel.getRangeAt(0).endOffset > 0) { - if (fnode.substringData(sel.getRangeAt(0).endOffset - 1, 1) == '.') { - // Text node ends with period. - return true; - } else if ( - fnode.substringData(sel.getRangeAt(0).endOffset - 1, 1) == ' ') { - // Text node ends with space. - return true; - } else { - // Text node does not end with period or space. Extend forward. - sel.modify('extend', 'forward', 'sentence'); - - if ((fnode == sel.focusNode) && (foffset == sel.focusOffset)) { - // Nothing more to be done, cannot extend forward any further. - return false; - } - } - } else { - return true; - } - } else { - // Focus node is not text node, no further cleaning required. - return true; - } - } - - return true; -}; - -/** - * Finds the starting position (height from top and left width) of a - * selection in a document. - * @param {Selection} sel The selection. - * @return {Array} The coordinates [top, left] of the selection. - */ -cvox.SelectionUtil.findSelPosition = function(sel) { - if (sel.rangeCount == 0) { - return [0, 0]; - } - - var clientRect = sel.getRangeAt(0).getBoundingClientRect(); - - if (!clientRect) { - return [0, 0]; - } - - var top = window.pageYOffset + clientRect.top; - var left = window.pageXOffset + clientRect.left; - return [top, left]; -}; - -/** - * Calculates the horizontal and vertical position of a node - * @param {Node} targetNode The node. - * @return {Array} The coordinates [top, left] of the node. - */ -cvox.SelectionUtil.findTopLeftPosition = function(targetNode) { - var left = 0; - var top = 0; - var obj = targetNode; - - if (obj.offsetParent) { - left = obj.offsetLeft; - top = obj.offsetTop; - obj = obj.offsetParent; - - while (obj !== null) { - left += obj.offsetLeft; - top += obj.offsetTop; - obj = obj.offsetParent; - } - } - - return [top, left]; -}; - - -/** - * Checks the contents of a selection for meaningful content. - * @param {Selection} sel The selection. - * @return {boolean} True if the selection is valid. False if the selection - * contains only whitespace or is an empty string. - */ -cvox.SelectionUtil.isSelectionValid = function(sel) { - var regExpWhiteSpace = new RegExp(/^\s+$/); - return (!((regExpWhiteSpace.test(sel.toString())) || (sel.toString() == ''))); -}; - -/** - * Checks the contents of a range for meaningful content. - * @param {Range} range The range. - * @return {boolean} True if the range is valid. False if the range - * contains only whitespace or is an empty string. - */ -cvox.SelectionUtil.isRangeValid = function(range) { - var text = range.cloneContents().textContent; - var regExpWhiteSpace = new RegExp(/^\s+$/); - return (!((regExpWhiteSpace.test(text)) || (text == ''))); -}; - -/** - * Returns absolute top and left positions of an element. - * - * @param {!Node} node The element for which to compute the position. - * @return {Array<number>} Index 0 is the left; index 1 is the top. - * @private - */ -cvox.SelectionUtil.findPos_ = function(node) { - var curLeft = 0; - var curTop = 0; - if (node.offsetParent) { - do { - curLeft += node.offsetLeft; - curTop += node.offsetTop; - } while (node = node.offsetParent); - } - return [curLeft, curTop]; -}; - -/** - * Scrolls node in its parent node such the given node is visible. - * @param {Node} focusNode The node. - */ -cvox.SelectionUtil.scrollElementsToView = function(focusNode) { - // First, walk up the DOM until we find a node with a bounding rectangle. - while (focusNode && !focusNode.getBoundingClientRect) { - focusNode = focusNode.parentElement; - } - if (!focusNode) { - return; - } - - // Walk up the DOM, ensuring each element is visible inside its parent. - var node = focusNode; - var parentNode = node.parentElement; - while (node != document.body && parentNode) { - node.scrollTop = node.offsetTop; - node.scrollLeft = node.offsetLeft; - node = parentNode; - parentNode = node.parentElement; - } - - // Center the active element on the page once we know it's visible. - var pos = cvox.SelectionUtil.findPos_(focusNode); - window.scrollTo( - pos[0] - window.innerWidth / 2, pos[1] - window.innerHeight / 2); -}; - -/** - * Scrolls the selection into view if it is out of view in the current window. - * Inspired by workaround for already-on-screen elements @ - * http:// - * www.performantdesign.com/2009/08/26/scrollintoview-but-only-if-out-of-view/ - * @param {Selection} sel The selection to be scrolled into view. - */ -cvox.SelectionUtil.scrollToSelection = function(sel) { - if (sel.rangeCount == 0) { - return; - } - - // First, scroll all parent elements into view. Later, move the body - // which works slightly differently. - - cvox.SelectionUtil.scrollElementsToView(sel.focusNode); - - var pos = cvox.SelectionUtil.findSelPosition(sel); - var top = pos[0]; - var left = pos[1]; - - var scrolledVertically = window.pageYOffset || - document.documentElement.scrollTop || document.body.scrollTop; - var pageHeight = window.innerHeight || - document.documentElement.clientHeight || document.body.clientHeight; - var pageWidth = window.innerWidth || document.documentElement.innerWidth || - document.body.clientWidth; - - if (left < pageWidth) { - left = 0; - } - - // window.scroll puts specified pixel in upper left of window - if ((scrolledVertically + pageHeight) < top) { - // Align with bottom of page - var diff = top - pageHeight; - window.scroll(left, diff + 100); - } else if (top < scrolledVertically) { - // Align with top of page - window.scroll(left, top - 100); - } -}; - -/** - * This is from https://developer.mozilla.org/en/Whitespace_in_the_DOM - * Determine whether a node's text content is entirely whitespace. - * - * Throughout, whitespace is defined as one of the characters - * "\t" TAB \u0009 - * "\n" LF \u000A - * "\r" CR \u000D - * " " SPC \u0020 - * - * This does not use Javascript's "\s" because that includes non-breaking - * spaces (and also some other characters). - * - * @param {Node} node A node implementing the |CharacterData| interface (i.e., - * a |Text|, |Comment|, or |CDATASection| node. - * @return {boolean} True if all of the text content of |node| is whitespace, - * otherwise false. - */ -cvox.SelectionUtil.isAllWs = function(node) { - // Use ECMA-262 Edition 3 String and RegExp features - return !(/[^\t\n\r ]/.test(node.data)); -}; - - -/** - * This is from https://developer.mozilla.org/en/Whitespace_in_the_DOM - * Determine if a node should be ignored by the iterator functions. - * - * @param {Node} node An object implementing the DOM1 |Node| interface. - * @return {boolean} True if the node is: - * 1) A |Text| node that is all whitespace - * 2) A |Comment| node - * and otherwise false. - */ - -cvox.SelectionUtil.isIgnorable = function(node) { - return (node.nodeType == 8) || // A comment node - ((node.nodeType == 3) && - cvox.SelectionUtil.isAllWs(node)); // a text node, all ws -}; - -/** - * This is from https://developer.mozilla.org/en/Whitespace_in_the_DOM - * Version of |previousSibling| that skips nodes that are entirely - * whitespace or comments. (Normally |previousSibling| is a property - * of all DOM nodes that gives the sibling node, the node that is - * a child of the same parent, that occurs immediately before the - * reference node.) - * - * @param {Node} sib The reference node. - * @return {Node} Either: - * 1) The closest previous sibling to |sib| that is not - * ignorable according to |isIgnorable|, or - * 2) null if no such node exists. - */ -cvox.SelectionUtil.nodeBefore = function(sib) { - while ((sib = sib.previousSibling)) { - if (!cvox.SelectionUtil.isIgnorable(sib)) { - return sib; - } - } - return null; -}; - -/** - * This is from https://developer.mozilla.org/en/Whitespace_in_the_DOM - * Version of |nextSibling| that skips nodes that are entirely - * whitespace or comments. - * - * @param {Node} sib The reference node. - * @return {Node} Either: - * 1) The closest next sibling to |sib| that is not - * ignorable according to |isIgnorable|, or - * 2) null if no such node exists. - */ -cvox.SelectionUtil.nodeAfter = function(sib) { - while ((sib = sib.nextSibling)) { - if (!cvox.SelectionUtil.isIgnorable(sib)) { - return sib; - } - } - return null; -}; - -/** - * This is from https://developer.mozilla.org/en/Whitespace_in_the_DOM - * Version of |lastChild| that skips nodes that are entirely - * whitespace or comments. (Normally |lastChild| is a property - * of all DOM nodes that gives the last of the nodes contained - * directly in the reference node.) - * - * @param {Node} par The reference node. - * @return {Node} Either: - * 1) The last child of |sib| that is not - * ignorable according to |isIgnorable|, or - * 2) null if no such node exists. - */ -cvox.SelectionUtil.lastChildNode = function(par) { - var res = par.lastChild; - while (res) { - if (!cvox.SelectionUtil.isIgnorable(res)) { - return res; - } - res = res.previousSibling; - } - return null; -}; - -/** - * This is from https://developer.mozilla.org/en/Whitespace_in_the_DOM - * Version of |firstChild| that skips nodes that are entirely - * whitespace and comments. - * - * @param {Node} par The reference node. - * @return {Node} Either: - * 1) The first child of |sib| that is not - * ignorable according to |isIgnorable|, or - * 2) null if no such node exists. - */ -cvox.SelectionUtil.firstChildNode = function(par) { - var res = par.firstChild; - while (res) { - if (!cvox.SelectionUtil.isIgnorable(res)) { - return res; - } - res = res.nextSibling; - } - return null; -}; - -/** - * This is from https://developer.mozilla.org/en/Whitespace_in_the_DOM - * Version of |data| that doesn't include whitespace at the beginning - * and end and normalizes all whitespace to a single space. (Normally - * |data| is a property of text nodes that gives the text of the node.) - * - * @param {Node} txt The text node whose data should be returned. - * @return {string} A string giving the contents of the text node with - * whitespace collapsed. - */ -cvox.SelectionUtil.dataOf = function(txt) { - var data = txt.data; - // Use ECMA-262 Edition 3 String and RegExp features - data = data.replace(/[\t\n\r ]+/g, ' '); - if (data.charAt(0) == ' ') { - data = data.substring(1, data.length); - } - if (data.charAt(data.length - 1) == ' ') { - data = data.substring(0, data.length - 1); - } - return data; -}; - -/** - * Returns true if the selection has content from at least one node - * that has the specified tagName. - * - * @param {Selection} sel The selection. - * @param {string} tagName Tagname that the selection should be checked for. - * @return {boolean} True if the selection has content from at least one node - * with the specified tagName. - */ -cvox.SelectionUtil.hasContentWithTag = function(sel, tagName) { - if (!sel || !sel.anchorNode || !sel.focusNode) { - return false; - } - if (sel.anchorNode.tagName && (sel.anchorNode.tagName == tagName)) { - return true; - } - if (sel.focusNode.tagName && (sel.focusNode.tagName == tagName)) { - return true; - } - if (sel.anchorNode.parentNode.tagName && - (sel.anchorNode.parentNode.tagName == tagName)) { - return true; - } - if (sel.focusNode.parentNode.tagName && - (sel.focusNode.parentNode.tagName == tagName)) { - return true; - } - var docFrag = sel.getRangeAt(0).cloneContents(); - var span = document.createElement('span'); - span.appendChild(docFrag); - return (span.getElementsByTagName(tagName).length > 0); -}; - -/** - * Selects text within a text node. - * - * Note that the input node MUST be of type TEXT; otherwise, the offset - * count would not mean # of characters - this is because of the way Range - * works in JavaScript. - * - * @param {Node} textNode The text node to select text within. - * @param {number} start The start of the selection. - * @param {number} end The end of the selection. - */ -cvox.SelectionUtil.selectText = function(textNode, start, end) { - var newRange = document.createRange(); - newRange.setStart(textNode, start); - newRange.setEnd(textNode, end); - var sel = window.getSelection(); - sel.removeAllRanges(); - sel.addRange(newRange); -}; - -/** - * Selects all the text in a given node. - * - * @param {Node} node The target node. - */ -cvox.SelectionUtil.selectAllTextInNode = function(node) { - var newRange = document.createRange(); - newRange.setStart(node, 0); - newRange.setEndAfter(node); - var sel = window.getSelection(); - sel.removeAllRanges(); - sel.addRange(newRange); -}; - -/** - * Collapses the selection to the start. If nothing is selected, - * selects the beginning of the given node. - * - * @param {Node} node The target node. - */ -cvox.SelectionUtil.collapseToStart = function(node) { - var sel = window.getSelection(); - var cursorNode = sel.anchorNode; - var cursorOffset = sel.anchorOffset; - if (cursorNode == null) { - cursorNode = node; - cursorOffset = 0; - } - var newRange = document.createRange(); - newRange.setStart(cursorNode, cursorOffset); - newRange.setEnd(cursorNode, cursorOffset); - sel.removeAllRanges(); - sel.addRange(newRange); -}; - -/** - * Collapses the selection to the end. If nothing is selected, - * selects the end of the given node. - * - * @param {Node} node The target node. - */ -cvox.SelectionUtil.collapseToEnd = function(node) { - var sel = window.getSelection(); - var cursorNode = sel.focusNode; - var cursorOffset = sel.focusOffset; - if (cursorNode == null) { - cursorNode = node; - cursorOffset = 0; - } - var newRange = document.createRange(); - newRange.setStart(cursorNode, cursorOffset); - newRange.setEnd(cursorNode, cursorOffset); - sel.removeAllRanges(); - sel.addRange(newRange); -}; - -/** - * Retrieves all the text within a selection. - * - * Note that this can be different than simply using the string from - * window.getSelection() as this will account for IMG nodes, etc. - * - * @return {string} The string of text contained in the current selection. - */ -cvox.SelectionUtil.getText = function() { - var sel = window.getSelection(); - if (cvox.SelectionUtil.hasContentWithTag(sel, 'IMG')) { - var text = ''; - var docFrag = sel.getRangeAt(0).cloneContents(); - var span = document.createElement('span'); - span.appendChild(docFrag); - var leafNodes = cvox.XpathUtil.getLeafNodes(span); - for (var i = 0, node; node = leafNodes[i]; i++) { - text = text + ' ' + cvox.DomUtil.getName(node); - } - return text; - } else { - return cvox.SelectionUtil.getSelectionText_(); - } -}; - -/** - * Returns the selection as text instead of a selection object. Note that this - * function must be used in place of getting text directly from the DOM - * if you want i18n tests to pass. - * - * @return {string} The text. - * @private - */ -cvox.SelectionUtil.getSelectionText_ = function() { - return '' + window.getSelection(); -}; - - -/** - * Returns a range as text instead of a selection object. Note that this - * function must be used in place of getting text directly from the DOM - * if you want i18n tests to pass. - * - * @param {Range} range A range. - * @return {string} The text. - */ -cvox.SelectionUtil.getRangeText = function(range) { - if (range) - return range.cloneContents().textContent.replace(/\s+/g, ' '); - else - return ''; -};
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/spannable_test.unitjs b/chrome/browser/resources/chromeos/chromevox/common/spannable_test.unitjs similarity index 100% rename from ui/accessibility/extensions/chromevoxclassic/common/spannable_test.unitjs rename to chrome/browser/resources/chromeos/chromevox/common/spannable_test.unitjs
diff --git a/chrome/browser/resources/chromeos/chromevox/common/table_util.js b/chrome/browser/resources/chromeos/chromevox/common/table_util.js deleted file mode 100644 index a5b1df6..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/table_util.js +++ /dev/null
@@ -1,180 +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. - -/** - * @fileoverview DOM utility functions to aid in table navigation. - */ - -goog.provide('cvox.TableUtil'); - -goog.require('cvox.XpathUtil'); - - -/** - * Utility function to check if a particular table cell is a candidate - * header cell. - * @param {Node} cell The table cell. - * @return {boolean} Whether or not the table cell is acting as a header cell. - */ -cvox.TableUtil.checkIfHeader = function(cell) { - /* - * Headers are defined here as <TH> or <TD> elements. <TD> elements when - * serving as header cells must have either: - * - The scope attribute defined - * - Their IDs referenced in the header content attribute of another <TD> or - * <TH> element. - * This function does not check whether this cell is referenced by another - * <TD>. So this function by itself will not be able to gather all possible - * header cells when applied across all table cells. - * - * Please Note: - * The HTML5 spec specifies that only header <TH> elements can be headers - * ( http://dev.w3.org/html5/spec/tabular-data.html#row-header ) but the - * HTML4 spec says that <TD> elements can act as headers if they have a - * scope attribute defined - * ( http://www.w3.org/TR/html401/struct/tables.html#h-11.2.6 ). In the - * interest of providing meaningful header information for all tables, here - * we take the position that <TD> elements can act as headers. - */ - return ( - (cell.tagName == 'TH') || cell.hasAttribute('scope') || - (cell.hasAttribute('role') && - ((cell.getAttribute('role') == 'rowheader') || - (cell.getAttribute('role') == 'columnheader')))); -}; - - -/** - * Utility function to determine colgroup structure. Builds an array that - * associates a column number to a particular col group. - * @param {Array} colGroups An array of all the colgroup elements in a - * particular table. - * @return {Array} An array that maps indexes representing table columns - * to indexes into the colGroups array. - */ -cvox.TableUtil.determineColGroups = function(colGroups) { - var colToColGroup = []; - - if (colGroups.length == 0) { - return colToColGroup; - } - // A colgroup has either a series of col element children or a span - // attribute. If it has col children, ignore the span attribute - for (var colGroupCtr = 0; colGroupCtr < colGroups.length; colGroupCtr++) { - var currentColGroup = colGroups[colGroupCtr]; - - var childCols = cvox.TableUtil.getColNodes(currentColGroup); - if (childCols.length > 0) { - for (var colNodeCtr = 0; colNodeCtr < childCols.length; colNodeCtr++) { - var colElement = childCols[colNodeCtr]; - - if (colElement.hasAttribute('span')) { - var span = parseInt(colElement.getAttribute('span'), 10); - - for (var s = 0; s < span; s++) { - colToColGroup.push(colGroupCtr); - } - } else { - colToColGroup.push(colGroupCtr); - } - } - } else { - // No children of the current colgroup. Does it have a span attribute? - if (currentColGroup.hasAttribute('span')) { - var span = parseInt(currentColGroup.getAttribute('span'), 10); - - for (var s = 0; s < span; s++) { - colToColGroup.push(colGroupCtr); - } - } else { - // Default span value is 1 - colToColGroup.push(colGroupCtr); - } - } - } - return colToColGroup; - -}; - - -/** - * Utility function to push an element into a given array only if that element - * is not already contained in the array. - * @param {Array} givenArray The given array. - * @param {Node} givenElement The given element. - */ -cvox.TableUtil.pushIfNotContained = function(givenArray, givenElement) { - if (givenArray.indexOf(givenElement) == -1) { - givenArray.push(givenElement); - } -}; - - -/** - * Returns a JavaScript array of all the non-nested rows in the given table. - * - * @param {Node} table A table node. - * @return {Array} An array of all the child rows of the active table. - */ -cvox.TableUtil.getChildRows = function(table) { - return cvox.XpathUtil.evalXPath( - 'child::tbody/tr | child::thead/tr | ' + - 'child::*[attribute::role="row"]', - table); -}; - - -/** - * Returns a JavaScript array of all the child cell <TD> or <TH> or - * role='gridcell' nodes of the given row. - * - * @param {Node} rowNode The specified row node. - * @return {Array} An array of all the child cells of the given row node. - */ -cvox.TableUtil.getChildCells = function(rowNode) { - return cvox.XpathUtil.evalXPath( - 'child::td | child::th | ' + - 'child::*[attribute::role="gridcell"] |' + - 'child::*[attribute::role="rowheader"] |' + - 'child::*[attribute::role="columnheader"]', - rowNode); -}; - - -/** - * Returns a JavaScript array containing the cell in the active table - * with the given ID. - * - * @param {Node} table A table node. - * @param {string} cellID The specified ID. - * @return {Array} An array containing the cell with the specified ID. - */ -cvox.TableUtil.getCellWithID = function(table, cellID) { - return cvox.XpathUtil.evalXPath('id(\'' + cellID + '\')', table); -}; - - -/** - * Returns a Javascript array containing the colgroup elements in the - * active table. - * - * @param {Node} table A table node. - * @return {Array} An array of all the colgroup elements in the active table. - */ -cvox.TableUtil.getColGroups = function(table) { - return cvox.XpathUtil.evalXPath('child::colgroup', table); -}; - - -/** - * Returns a Javascript array containing the child col elements of the given - * colgroup element. - * - * @param {Node} colGroupNode The specified <COLGROUP> element. - * @return {Array} An array of all of the child col elements of the given - * colgroup element. - */ -cvox.TableUtil.getColNodes = function(colGroupNode) { - return cvox.XpathUtil.evalXPath('child::col', colGroupNode); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/time_widget.js b/chrome/browser/resources/chromeos/chromevox/common/time_widget.js deleted file mode 100644 index bfb17a62f..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/time_widget.js +++ /dev/null
@@ -1,221 +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. - -goog.provide('cvox.ChromeVoxHTMLTimeWidget'); - -/** - * @fileoverview Gives the user spoken feedback as they interact with the time - * widget (input type=time). - * - */ - -/** - * A class containing the information needed to speak - * a text change event to the user. - * - * @constructor - * @param {Element} timeElem The time widget element. - * @param {cvox.TtsInterface} tts The TTS object from ChromeVox. - */ -cvox.ChromeVoxHTMLTimeWidget = function(timeElem, tts) { - var self = this; - this.timeElem_ = timeElem; - this.timeTts_ = tts; - this.pHours_ = -1; - this.pMinutes_ = -1; - this.pSeconds_ = 0; - this.pMilliseconds_ = 0; - this.pAmpm_ = ''; - this.pos_ = 0; - this.maxPos_ = 2; - this.keyListener_ = function(evt) { - self.eventHandler_(evt); - }; - this.blurListener_ = function(evt) { - self.shutdown(); - }; - if (this.timeElem_.hasAttribute('step')) { - var step = this.timeElem_.getAttribute('step'); - if (step > 0) { // 0 or invalid values show hh:mm AM/PM - if (step >= 1) { - this.maxPos_ = 3; // Anything larger than 1 shows hh:mm:ss AM/PM - } else { - this.maxPos_ = 4; // Anything less than 1 shows hh:mm:ss.ms AM/PM - } - } - } - - // Ensure we have a reasonable value to start with. - if (this.timeElem_.value.length == 0) { - this.forceInitTime_(); - } - - // Move the cursor to the first position so that we are guaranteed to start - // off at the hours position. - for (var i = 0; i < this.maxPos_; i++) { - var evt = document.createEvent('KeyboardEvent'); - evt.initKeyboardEvent( - 'keydown', true, true, window, 'Left', 0, false, false, false, false); - this.timeElem_.dispatchEvent(evt); - evt = document.createEvent('KeyboardEvent'); - evt.initKeyboardEvent( - 'keyup', true, true, window, 'Left', 0, false, false, false, false); - this.timeElem_.dispatchEvent(evt); - } - - this.timeElem_.addEventListener('keydown', this.keyListener_, false); - this.timeElem_.addEventListener('keyup', this.keyListener_, false); - this.timeElem_.addEventListener('blur', this.blurListener_, false); - this.update_(true); -}; - -/** - * Removes the key listeners for the time widget. - * - */ -cvox.ChromeVoxHTMLTimeWidget.prototype.shutdown = function() { - this.timeElem_.removeEventListener('blur', this.blurListener_, false); - this.timeElem_.removeEventListener('keydown', this.keyListener_, false); - this.timeElem_.removeEventListener('keyup', this.keyListener_, false); -}; - -/** - * Initialize to midnight. - * @private - */ -cvox.ChromeVoxHTMLTimeWidget.prototype.forceInitTime_ = function() { - this.timeElem_.setAttribute('value', '12:00'); -}; - -/** - * Called when the position changes. - * @private - */ -cvox.ChromeVoxHTMLTimeWidget.prototype.handlePosChange_ = function() { - if (this.pos_ < 0) { - this.pos_ = 0; - } - if (this.pos_ > this.maxPos_) { - this.pos_ = this.maxPos_; - } - // Reset the cached state of the new field so that the field will be spoken - // in the update. - if (this.pos_ == this.maxPos_) { - this.pAmpm_ = ''; - return; - } - switch (this.pos_) { - case 0: - this.pHours_ = -1; - break; - case 1: - this.pMinutes_ = -1; - break; - case 2: - this.pSeconds_ = -1; - break; - case 3: - this.pMilliseconds_ = -1; - break; - } -}; - -/** - * @param {boolean} shouldSpeakLabel True if the label should be spoken. - * @private - */ -cvox.ChromeVoxHTMLTimeWidget.prototype.update_ = function(shouldSpeakLabel) { - var splitTime = this.timeElem_.value.split(':'); - if (splitTime.length < 1) { - this.forceInitTime_(); - return; - } - - var hours = splitTime[0]; - var minutes = -1; - var seconds = 0; - var milliseconds = 0; - var ampm = Msgs.getMsg('timewidget_am'); - if (splitTime.length > 1) { - minutes = splitTime[1]; - } - if (splitTime.length > 2) { - var splitSecondsAndMilliseconds = splitTime[2].split('.'); - seconds = splitSecondsAndMilliseconds[0]; - if (splitSecondsAndMilliseconds.length > 1) { - milliseconds = splitSecondsAndMilliseconds[1]; - } - } - if (hours > 12) { - hours = hours - 12; - ampm = Msgs.getMsg('timewidget_pm'); - } - if (hours == 12) { - ampm = Msgs.getMsg('timewidget_pm'); - } - if (hours == 0) { - hours = 12; - ampm = Msgs.getMsg('timewidget_am'); - } - - var changeMessage = ''; - - if (shouldSpeakLabel) { - changeMessage = cvox.DomUtil.getName(this.timeElem_, true, true) + '\n'; - } - - if (hours != this.pHours_) { - changeMessage = - changeMessage + hours + ' ' + Msgs.getMsg('timewidget_hours') + '\n'; - this.pHours_ = hours; - } - - if (minutes != this.pMinutes_) { - changeMessage = changeMessage + minutes + ' ' + - Msgs.getMsg('timewidget_minutes') + '\n'; - this.pMinutes_ = minutes; - } - - if (seconds != this.pSeconds_) { - changeMessage = changeMessage + seconds + ' ' + - Msgs.getMsg('timewidget_seconds') + '\n'; - this.pSeconds_ = seconds; - } - - if (milliseconds != this.pMilliseconds_) { - changeMessage = changeMessage + milliseconds + ' ' + - Msgs.getMsg('timewidget_milliseconds') + '\n'; - this.pMilliseconds_ = milliseconds; - } - - if (ampm != this.pAmpm_) { - changeMessage = changeMessage + ampm; - this.pAmpm_ = ampm; - } - - if (changeMessage.length > 0) { - this.timeTts_.speak(changeMessage, cvox.QueueMode.FLUSH, null); - } -}; - -/** - * @param {Object} evt The event to handle. - * @private - */ -cvox.ChromeVoxHTMLTimeWidget.prototype.eventHandler_ = function(evt) { - var shouldSpeakLabel = false; - if (evt.type == 'keydown') { - if (((evt.keyCode == 9) && !evt.shiftKey) || (evt.keyCode == 39)) { - this.pos_++; - this.handlePosChange_(); - shouldSpeakLabel = true; - } - if (((evt.keyCode == 9) && evt.shiftKey) || (evt.keyCode == 37)) { - this.pos_--; - this.handlePosChange_(); - shouldSpeakLabel = true; - } - } - this.update_(shouldSpeakLabel); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/traverse_content.js b/chrome/browser/resources/chromeos/chromevox/common/traverse_content.js deleted file mode 100644 index a473d31..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/traverse_content.js +++ /dev/null
@@ -1,477 +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. - - -/** - * @fileoverview A DOM traversal interface for moving a selection around a - * webpage. Provides multiple granularities: - * 1. Move by paragraph. - * 2. Move by sentence. - * 3. Move by line. - * 4. Move by word. - * 5. Move by character. - */ - -goog.provide('cvox.TraverseContent'); - -goog.require('cvox.CursorSelection'); -goog.require('cvox.DomUtil'); -goog.require('cvox.SelectionUtil'); -goog.require('cvox.TraverseUtil'); - -/** - * Moves a selection around a document or within a provided DOM object. - * - * @constructor - * @param {Node=} domObj a DOM node (optional). - */ -cvox.TraverseContent = function(domObj) { - if (domObj != null) { - this.currentDomObj = domObj; - } else { - this.currentDomObj = document.body; - } - var range = document.createRange(); - // TODO (dmazzoni): Switch this to avoid using range methods. Range methods - // can cause exceptions (such as if the node is not attached to the DOM). - try { - range.selectNode(this.currentDomObj); - this.startCursor_ = new cvox.Cursor( - range.startContainer, range.startOffset, - cvox.TraverseUtil.getNodeText(range.startContainer)); - this.endCursor_ = new cvox.Cursor( - range.endContainer, range.endOffset, - cvox.TraverseUtil.getNodeText(range.endContainer)); - } catch (e) { - // Ignoring this error so that it will not break everything else. - window.console.log('Error: Unselectable node:'); - window.console.log(domObj); - } -}; -goog.addSingletonGetter(cvox.TraverseContent); - -/** - * Whether the last navigated selection only contained whitespace. - * @type {boolean} - */ -cvox.TraverseContent.prototype.lastSelectionWasWhitespace = false; - -/** - * Whether we should skip whitespace when traversing individual characters. - * @type {boolean} - */ -cvox.TraverseContent.prototype.skipWhitespace = false; - -/** - * If moveNext and movePrev should skip past an invalid selection, - * so the user never gets stuck. Ideally the navigation code should never - * return a range that's not a valid selection, but this keeps the user from - * getting stuck if that code fails. This is set to false for unit testing. - * @type {boolean} - */ -cvox.TraverseContent.prototype.skipInvalidSelections = true; - -/** - * If line and sentence navigation should break at <a> links. - * @type {boolean} - */ -cvox.TraverseContent.prototype.breakAtLinks = true; - -/** - * The string constant for character granularity. - * @type {string} - * @const - */ -cvox.TraverseContent.kCharacter = 'character'; - -/** - * The string constant for word granularity. - * @type {string} - * @const - */ -cvox.TraverseContent.kWord = 'word'; - -/** - * The string constant for sentence granularity. - * @type {string} - * @const - */ -cvox.TraverseContent.kSentence = 'sentence'; - -/** - * The string constant for line granularity. - * @type {string} - * @const - */ -cvox.TraverseContent.kLine = 'line'; - -/** - * The string constant for paragraph granularity. - * @type {string} - * @const - */ -cvox.TraverseContent.kParagraph = 'paragraph'; - -/** - * A constant array of all granularities. - * @type {Array<string>} - * @const - */ -cvox.TraverseContent.kAllGrains = [ - cvox.TraverseContent.kParagraph, cvox.TraverseContent.kSentence, - cvox.TraverseContent.kLine, cvox.TraverseContent.kWord, - cvox.TraverseContent.kCharacter -]; - -/** - * Set the current position to match the current WebKit selection. - */ -cvox.TraverseContent.prototype.syncToSelection = function() { - this.normalizeSelection(); - - var selection = window.getSelection(); - if (!selection || !selection.anchorNode || !selection.focusNode) { - return; - } - this.startCursor_ = new cvox.Cursor( - selection.anchorNode, selection.anchorOffset, - cvox.TraverseUtil.getNodeText(selection.anchorNode)); - this.endCursor_ = new cvox.Cursor( - selection.focusNode, selection.focusOffset, - cvox.TraverseUtil.getNodeText(selection.focusNode)); -}; - -/** - * Set the start and end cursors to the selection. - * @param {cvox.CursorSelection} sel The selection. - */ -cvox.TraverseContent.prototype.syncToCursorSelection = function(sel) { - this.startCursor_ = sel.start.clone(); - this.endCursor_ = sel.end.clone(); -}; - -/** - * Get the cursor selection. - * @return {cvox.CursorSelection} The selection. - */ -cvox.TraverseContent.prototype.getCurrentCursorSelection = function() { - return new cvox.CursorSelection(this.startCursor_, this.endCursor_); -}; - -/** - * Set the WebKit selection based on the current position. - */ -cvox.TraverseContent.prototype.updateSelection = function() { - cvox.TraverseUtil.setSelection(this.startCursor_, this.endCursor_); - cvox.SelectionUtil.scrollToSelection(window.getSelection()); -}; - -/** - * Get the current position as a range. - * @return {Range} The current range. - */ -cvox.TraverseContent.prototype.getCurrentRange = function() { - var range = document.createRange(); - try { - range.setStart(this.startCursor_.node, this.startCursor_.index); - range.setEnd(this.endCursor_.node, this.endCursor_.index); - } catch (e) { - console.log('Invalid range '); - } - return range; -}; - -/** - * Get the current text content as a string. - * @return {string} The current spanned content. - */ -cvox.TraverseContent.prototype.getCurrentText = function() { - return cvox.SelectionUtil.getRangeText(this.getCurrentRange()); -}; - -/** - * Collapse to the end of the range. - */ -cvox.TraverseContent.prototype.collapseToEnd = function() { - this.startCursor_ = this.endCursor_.clone(); -}; - -/** - * Collapse to the start of the range. - */ -cvox.TraverseContent.prototype.collapseToStart = function() { - this.endCursor_ = this.startCursor_.clone(); -}; - -/** - * Moves selection forward. - * - * @param {string} grain specifies "sentence", "word", "character", - * or "paragraph" granularity. - * @return {?string} Either: - * 1) The new selected text. - * 2) null if the end of the domObj has been reached. - */ -cvox.TraverseContent.prototype.moveNext = function(grain) { - var breakTags = this.getBreakTags(); - - // As a special case, if the current selection is empty or all - // whitespace, ensure that the next returned selection will NOT be - // only whitespace - otherwise you can get trapped. - var skipWhitespace = this.skipWhitespace; - - var range = this.getCurrentRange(); - if (!cvox.SelectionUtil.isRangeValid(range)) { - skipWhitespace = true; - } - - var elementsEntered = []; - var elementsLeft = []; - var str; - do { - if (grain === cvox.TraverseContent.kSentence) { - str = cvox.TraverseUtil.getNextSentence( - this.startCursor_, this.endCursor_, elementsEntered, elementsLeft, - breakTags); - } else if (grain === cvox.TraverseContent.kWord) { - str = cvox.TraverseUtil.getNextWord( - this.startCursor_, this.endCursor_, elementsEntered, elementsLeft); - } else if (grain === cvox.TraverseContent.kCharacter) { - str = cvox.TraverseUtil.getNextChar( - this.startCursor_, this.endCursor_, elementsEntered, elementsLeft, - skipWhitespace); - } else if (grain === cvox.TraverseContent.kParagraph) { - str = cvox.TraverseUtil.getNextParagraph( - this.startCursor_, this.endCursor_, elementsEntered, elementsLeft); - } else if (grain === cvox.TraverseContent.kLine) { - str = cvox.TraverseUtil.getNextLine( - this.startCursor_, this.endCursor_, elementsEntered, elementsLeft, - breakTags); - } else { - // User has provided an invalid string. - // Fall through to default: extend by sentence - window.console.log('Invalid selection granularity: "' + grain + '"'); - grain = cvox.TraverseContent.kSentence; - str = cvox.TraverseUtil.getNextSentence( - this.startCursor_, this.endCursor_, elementsEntered, elementsLeft, - breakTags); - } - - if (str == null) { - // We reached the end of the document. - return null; - } - - range = this.getCurrentRange(); - var isInvalid = !range.getBoundingClientRect(); - } while (this.skipInvalidSelections && isInvalid); - - if (!cvox.SelectionUtil.isRangeValid(range)) { - // It's OK if the selection navigation lands on whitespace once (in - // character granularity), but if it hits whitespace more than once, then - // skip forward until there is real content. - if (!this.lastSelectionWasWhitespace && - grain == cvox.TraverseContent.kCharacter) { - this.lastSelectionWasWhitespace = true; - } else { - while (!cvox.SelectionUtil.isRangeValid(this.getCurrentRange())) { - if (this.moveNext(grain) == null) { - break; - } - } - } - } else { - this.lastSelectionWasWhitespace = false; - } - - return this.getCurrentText(); -}; - - -/** - * Moves selection backward. - * - * @param {string} grain specifies "sentence", "word", "character", - * or "paragraph" granularity. - * @return {?string} Either: - * 1) The new selected text. - * 2) null if the beginning of the domObj has been reached. - */ -cvox.TraverseContent.prototype.movePrev = function(grain) { - var breakTags = this.getBreakTags(); - - // As a special case, if the current selection is empty or all - // whitespace, ensure that the next returned selection will NOT be - // only whitespace - otherwise you can get trapped. - var skipWhitespace = this.skipWhitespace; - - var range = this.getCurrentRange(); - if (!cvox.SelectionUtil.isRangeValid(range)) { - skipWhitespace = true; - } - - var elementsEntered = []; - var elementsLeft = []; - var str; - do { - if (grain === cvox.TraverseContent.kSentence) { - str = cvox.TraverseUtil.getPreviousSentence( - this.startCursor_, this.endCursor_, elementsEntered, elementsLeft, - breakTags); - } else if (grain === cvox.TraverseContent.kWord) { - str = cvox.TraverseUtil.getPreviousWord( - this.startCursor_, this.endCursor_, elementsEntered, elementsLeft); - } else if (grain === cvox.TraverseContent.kCharacter) { - str = cvox.TraverseUtil.getPreviousChar( - this.startCursor_, this.endCursor_, elementsEntered, elementsLeft, - skipWhitespace); - } else if (grain === cvox.TraverseContent.kParagraph) { - str = cvox.TraverseUtil.getPreviousParagraph( - this.startCursor_, this.endCursor_, elementsEntered, elementsLeft); - } else if (grain === cvox.TraverseContent.kLine) { - str = cvox.TraverseUtil.getPreviousLine( - this.startCursor_, this.endCursor_, elementsEntered, elementsLeft, - breakTags); - } else { - // User has provided an invalid string. - // Fall through to default: extend by sentence - window.console.log('Invalid selection granularity: "' + grain + '"'); - grain = cvox.TraverseContent.kSentence; - str = cvox.TraverseUtil.getPreviousSentence( - this.startCursor_, this.endCursor_, elementsEntered, elementsLeft, - breakTags); - } - - if (str == null) { - // We reached the end of the document. - return null; - } - - range = this.getCurrentRange(); - var isInvalid = !range.getBoundingClientRect(); - } while (this.skipInvalidSelections && isInvalid); - - if (!cvox.SelectionUtil.isRangeValid(range)) { - // It's OK if the selection navigation lands on whitespace once (in - // character granularity), but if it hits whitespace more than once, then - // skip forward until there is real content. - if (!this.lastSelectionWasWhitespace && - grain == cvox.TraverseContent.kCharacter) { - this.lastSelectionWasWhitespace = true; - } else { - while (!cvox.SelectionUtil.isRangeValid(this.getCurrentRange())) { - if (this.movePrev(grain) == null) { - break; - } - } - } - } else { - this.lastSelectionWasWhitespace = false; - } - - return this.getCurrentText(); -}; - -/** - * Get the tag names that should break a sentence or line. Currently - * just an anchor 'A' should break a sentence or line if the breakAtLinks - * flag is true, but in the future we might have other rules for breaking. - * - * @return {Object} An associative array mapping a tag name to true if - * it should break a sentence or line. - */ -cvox.TraverseContent.prototype.getBreakTags = function() { - return {'A': this.breakAtLinks, 'BR': true, 'HR': true}; -}; - -/** - * Selects the next element of the document or within the provided DOM object. - * Scrolls the window as appropriate. - * - * @param {string} grain specifies "sentence", "word", "character", - * or "paragraph" granularity. - * @param {Node=} domObj a DOM node (optional). - * @return {?string} Either: - * 1) The new selected text. - * 2) null if the end of the domObj has been reached. - */ -cvox.TraverseContent.prototype.nextElement = function(grain, domObj) { - if (domObj != null) { - this.currentDomObj = domObj; - } - - var result = this.moveNext(grain); - if (result != null && - (!cvox.DomUtil.isDescendantOfNode( - this.startCursor_.node, this.currentDomObj) || - !cvox.DomUtil.isDescendantOfNode( - this.endCursor_.node, this.currentDomObj))) { - return null; - } - - return result; -}; - - -/** - * Selects the previous element of the document or within the provided DOM - * object. Scrolls the window as appropriate. - * - * @param {string} grain specifies "sentence", "word", "character", - * or "paragraph" granularity. - * @param {Node=} domObj a DOM node (optional). - * @return {?string} Either: - * 1) The new selected text. - * 2) null if the beginning of the domObj has been reached. - */ -cvox.TraverseContent.prototype.prevElement = function(grain, domObj) { - if (domObj != null) { - this.currentDomObj = domObj; - } - - var result = this.movePrev(grain); - if (result != null && - (!cvox.DomUtil.isDescendantOfNode( - this.startCursor_.node, this.currentDomObj) || - !cvox.DomUtil.isDescendantOfNode( - this.endCursor_.node, this.currentDomObj))) { - return null; - } - - return result; -}; - -/** - * Make sure that exactly one item is selected. If there's no selection, - * set the selection to the start of the document. - */ -cvox.TraverseContent.prototype.normalizeSelection = function() { - var selection = window.getSelection(); - if (selection.rangeCount < 1) { - // Before the user has clicked a freshly-loaded page - - var range = document.createRange(); - range.setStart(this.currentDomObj, 0); - range.setEnd(this.currentDomObj, 0); - - selection.removeAllRanges(); - selection.addRange(range); - - } else if (selection.rangeCount > 1) { - // Multiple ranges exist - remove all ranges but the last one - for (var i = 0; i < (selection.rangeCount - 1); i++) { - selection.removeRange(selection.getRangeAt(i)); - } - } -}; - -/** - * Resets the selection. - * - * @param {Node=} domObj a DOM node. Optional. - * - */ -cvox.TraverseContent.prototype.reset = function(domObj) { - window.getSelection().removeAllRanges(); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/traverse_table.js b/chrome/browser/resources/chromeos/chromevox/common/traverse_table.js deleted file mode 100644 index 925af5f..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/traverse_table.js +++ /dev/null
@@ -1,1282 +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. - -/** - * TODO(stoarca): This class has become obsolete except for the shadow table. - * Chop most of it away. - * @fileoverview A DOM traversal interface for navigating data in tables. - */ - -goog.provide('cvox.TraverseTable'); - -goog.require('cvox.DomPredicates'); -goog.require('cvox.DomUtil'); -goog.require('cvox.SelectionUtil'); -goog.require('cvox.TableUtil'); -goog.require('cvox.TraverseUtil'); - - - -/** - * An object that represents an active table cell inside the shadow table. - * @constructor - */ -function ShadowTableNode() { - /** - * The cells that are row headers of the corresponding active table cell - * @type {!Array} - */ - this.rowHeaderCells = []; - - /** - * The cells that are column headers of the corresponding active table cell - * @type {!Array} - */ - this.colHeaderCells = []; -} - - -/** - * Whether or not the active cell is spanned by a preceding cell. - * @type {boolean} - */ -ShadowTableNode.prototype.spanned; - - -/** - * Whether or not this cell is spanned by a rowSpan. - * @type {?boolean} - */ -ShadowTableNode.prototype.rowSpan; - - -/** - * Whether or not this cell is spanned by a colspan - * @type {?boolean} - */ -ShadowTableNode.prototype.colSpan; - - -/** - * The row index of the corresponding active table cell - * @type {number} - */ -ShadowTableNode.prototype.i = -1; - - -/** - * The column index of the corresponding active table cell - * @type {number} - */ -ShadowTableNode.prototype.j = -1; - - -/** - * The corresponding <TD> or <TH> node in the active table. - * @type {?Node} - */ -ShadowTableNode.prototype.activeCell; - - -/** - * Initializes the traversal with the provided table node. - * - * @constructor - * @param {Node} tableNode The table to be traversed. - */ -cvox.TraverseTable = function(tableNode) { - - /** - * The active table <TABLE> node. In this context, "active" means that this is - * the table the TraverseTable object is navigating. - * @type {Node} - * @private - */ - this.activeTable_ = null; - - /** - * A 2D array "shadow table" that contains pointers to nodes in the active - * table. More specifically, each cell of the shadow table contains a special - * object ShadowTableNode that has as one of its member variables the - * corresponding cell in the active table. - * - * The shadow table will allow us efficient navigation of tables with - * rowspans and colspans without needing to repeatedly scan the table. For - * example, if someone requests a cell at (1,3), predecessor cells with - * rowspans/colspans mean the cell you eventually return could actually be - * one located at (0,2) that spans out to (1,3). - * - * This shadow table will contain a ShadowTableNode with the (0, 2) index at - * the (1,3) position, eliminating the need to check for predecessor cells - * with rowspan/colspan every time we traverse the table. - * - * @type {!Array<Array<ShadowTableNode>>} - * @private - */ - this.shadowTable_ = []; - - /** - * An array of shadow table nodes that have been determined to contain header - * cells or information about header cells. This array is collected at - * initialization and then only recalculated if the table changes. - * This array is used by findHeaderCells() to determine table row headers - * and column headers. - * @type {Array<ShadowTableNode>} - * @private - */ - this.candidateHeaders_ = []; - - /** - * An array that associates cell IDs with their corresponding shadow nodes. - * If there are two shadow nodes for the same cell (i.e. when a cell spans - * other cells) then the first one will be associated with the ID. This means - * that shadow nodes that have spanned set to true will not be included in - * this array. - * @type {Array<ShadowTableNode>} - * @private - */ - this.idToShadowNode_ = []; - - this.initialize(tableNode); -}; - - -/** - * The cell cursor, represented by an array that stores the row and - * column location [i, j] of the active cell. These numbers are 0-based. - * In this context, "active" means that this is the cell the user is - * currently looking at. - * @type {Array} - */ -cvox.TraverseTable.prototype.currentCellCursor; - - -/** - * The number of columns in the active table. This is calculated at - * initialization and then only recalculated if the table changes. - * - * Please Note: We have chosen to use the number of columns in the shadow - * table as the canonical column count. This is important for tables that - * have colspans - the number of columns in the active table will always be - * less than the true number of columns. - * @type {?number} - */ -cvox.TraverseTable.prototype.colCount = null; - - -/** - * The number of rows in the active table. This is calculated at - * initialization and then only recalculated if the table changes. - * @type {?number} - */ -cvox.TraverseTable.prototype.rowCount = null; - - -/** - * The row headers in the active table. This is calculated at - * initialization and then only recalculated if the table changes. - * - * Please Note: - * Row headers are defined here as <TH> or <TD> elements. <TD> elements when - * serving as header cells must have either: - * - The scope attribute defined - * - Their IDs referenced in the header content attribute of another <TD> or - * <TH> element. - * - * The HTML5 spec specifies that only header <TH> elements can be row headers - * ( http://dev.w3.org/html5/spec/tabular-data.html#row-header ) but the - * HTML4 spec says that <TD> elements can act as both - * ( http://www.w3.org/TR/html401/struct/tables.html#h-11.2.6 ). In the - * interest of providing meaningful header information for all tables, here - * we take the position that <TD> elements can act as both. - * - * @type {Array} - */ -cvox.TraverseTable.prototype.tableRowHeaders = null; - - -/** - * The column headers in the active table. This is calculated at - * initialization and then only recalculated if the table changes. - * - * Please Note: see comment for tableRowHeaders. - * - * @type {Array} - */ -cvox.TraverseTable.prototype.tableColHeaders = null; - - -// TODO (stoarca): tighten up interface to {!Node} -/** - * Initializes the class member variables. - * @param {Node} tableNode The table to be traversed. - */ -cvox.TraverseTable.prototype.initialize = function(tableNode) { - if (!tableNode) { - return; - } - if (tableNode == this.activeTable_) { - return; - } - this.activeTable_ = tableNode; - this.currentCellCursor = null; - - this.tableRowHeaders = []; - this.tableColHeaders = []; - - this.buildShadowTable_(); - - this.colCount = this.shadowColCount_(); - this.rowCount = this.countRows_(); - - this.findHeaderCells_(); - - // Listen for changes to the active table. If the active table changes, - // rebuild the shadow table. - // TODO (stoarca): Is this safe? When this object goes away, doesn't the - // eventListener stay on the node? Someone with better knowledge of js - // please confirm. If so, this is a leak. - this.activeTable_.addEventListener( - 'DOMSubtreeModified', goog.bind(function() { - this.buildShadowTable_(); - this.colCount = this.shadowColCount_(); - this.rowCount = this.countRows_(); - - this.tableRowHeaders = []; - this.tableColHeaders = []; - this.findHeaderCells_(); - - if (this.colCount == 0 && this.rowCount == 0) { - return; - } - - if (this.getCell() == null) { - this.attachCursorToNearestCell_(); - } - }, this), false); -}; - - -/** - * Finds the cell cursor containing the specified node within the table. - * Returns null if there is no close cell. - * @param {Node} node The node for which to find the cursor. - * @return {Array<number>} The table index for the node. - */ -cvox.TraverseTable.prototype.findNearestCursor = function(node) { - if (!node) { - return null; - } - // TODO (stoarca): The current structure for representing the - // shadow table is not optimal for this query, but it's not urgent - // since this only gets executed at most once per user action. - - // In case node is in a table but above any individual cell, we go down as - // deep as we can, being careful to avoid going into nested tables. - var n = node; - - while (n.firstElementChild && - !(n.firstElementChild.tagName == 'TABLE' || - cvox.AriaUtil.isGrid(n.firstElementChild))) { - n = n.firstElementChild; - } - while (!cvox.DomPredicates.cellPredicate(cvox.DomUtil.getAncestors(n))) { - n = cvox.DomUtil.directedNextLeafNode(n); - // TODO(stoarca): Ugly logic. Captions should be part of tables. - // There have been a bunch of bugs as a result of - // DomUtil.findTableNodeInList excluding captions from tables because - // it makes them non-contiguous. - if (!cvox.DomUtil.getContainingTable(n, {allowCaptions: true})) { - return null; - } - } - for (var i = 0; i < this.rowCount; ++i) { - for (var j = 0; j < this.colCount; ++j) { - if (this.shadowTable_[i][j]) { - if (cvox.DomUtil.isDescendantOfNode( - n, this.shadowTable_[i][j].activeCell)) { - return [i, j]; - } - } - } - } - return null; -}; - -/** - * Finds the valid cell nearest to the current cell cursor and moves the cell - * cursor there. To be used when the table has changed and the current cell - * cursor is now invalid (doesn't exist anymore). - * @private - */ -cvox.TraverseTable.prototype.attachCursorToNearestCell_ = function() { - if (!this.currentCellCursor) { - // We have no idea. Just go 'somewhere'. Other code paths in this - // function go to the last cell, so let's do that! - this.goToLastCell(); - return; - } - - var currentCursor = this.currentCellCursor; - - // Does the current row still exist in the table? - var currentRow = this.shadowTable_[currentCursor[0]]; - if (currentRow) { - // Try last cell of current row - this.currentCellCursor = [currentCursor[0], (currentRow.length - 1)]; - } else { - // Current row does not exist anymore. Does current column still exist? - // Try last cell of current column - var numRows = this.shadowTable_.length; - if (numRows == 0) { - // Table has been deleted! - this.currentCellCursor = null; - return; - } - var aboveCell = this.shadowTable_[numRows - 1][currentCursor[1]]; - if (aboveCell) { - this.currentCellCursor = [(numRows - 1), currentCursor[1]]; - } else { - // Current column does not exist anymore either. - // Move cursor to last cell in table. - this.goToLastCell(); - } - } -}; - - -/** - * Builds or rebuilds the shadow table by iterating through all of the cells - * ( <TD> or <TH> or role='gridcell' nodes) of the active table. - * @return {!Array} The shadow table. - * @private - */ -cvox.TraverseTable.prototype.buildShadowTable_ = function() { - // Clear shadow table - this.shadowTable_ = []; - - // Build shadow table structure. Initialize it as a 2D array. - var allRows = cvox.TableUtil.getChildRows(this.activeTable_); - var currentRowParent = null; - var currentRowGroup = null; - - var colGroups = cvox.TableUtil.getColGroups(this.activeTable_); - var colToColGroup = cvox.TableUtil.determineColGroups(colGroups); - - for (var ctr = 0; ctr < allRows.length; ctr++) { - this.shadowTable_.push([]); - } - - // Iterate through active table by row - for (var i = 0; i < allRows.length; i++) { - var childCells = cvox.TableUtil.getChildCells(allRows[i]); - - // Keep track of position in active table - var activeTableCol = 0; - // Keep track of position in shadow table - var shadowTableCol = 0; - - while (activeTableCol < childCells.length) { - // Check to make sure we haven't already filled this cell. - if (this.shadowTable_[i][shadowTableCol] == null) { - var activeTableCell = childCells[activeTableCol]; - - // Default value for colspan and rowspan is 1 - var colsSpanned = 1; - var rowsSpanned = 1; - - if (activeTableCell.hasAttribute('colspan')) { - colsSpanned = parseInt(activeTableCell.getAttribute('colspan'), 10); - - if ((isNaN(colsSpanned)) || (colsSpanned <= 0)) { - // The HTML5 spec defines colspan MUST be greater than 0: - // http://dev.w3.org/html5/spec/Overview.html#attr-tdth-colspan - // - // This is a change from the HTML4 spec: - // http://www.w3.org/TR/html401/struct/tables.html#adef-colspan - // - // We will degrade gracefully by treating a colspan=0 as - // equivalent to a colspan=1. - // Tested in method testColSpan0 in rowColSpanTable_test.js - colsSpanned = 1; - } - } - if (activeTableCell.hasAttribute('rowspan')) { - rowsSpanned = parseInt(activeTableCell.getAttribute('rowspan'), 10); - - if ((isNaN(rowsSpanned)) || (rowsSpanned <= 0)) { - // The HTML5 spec defines that rowspan can be any non-negative - // integer, including 0: - // http://dev.w3.org/html5/spec/Overview.html#attr-tdth-rowspan - // - // However, Chromium treats rowspan=0 as rowspan=1. This appears - // to be a bug from WebKit: - // https://bugs.webkit.org/show_bug.cgi?id=10300 - // Inherited from a bug (since fixed) in KDE: - // http://bugs.kde.org/show_bug.cgi?id=41063 - // - // We will follow Chromium and treat rowspan=0 as equivalent to - // rowspan=1. - // - // Tested in method testRowSpan0 in rowColSpanTable_test.js - // - // Filed as a bug in Chromium: http://crbug.com/58223 - rowsSpanned = 1; - } - } - for (var r = 0; r < rowsSpanned; r++) { - for (var c = 0; c < colsSpanned; c++) { - var shadowNode = new ShadowTableNode(); - if ((r == 0) && (c == 0)) { - // This position is not spanned. - shadowNode.spanned = false; - shadowNode.rowSpan = false; - shadowNode.colSpan = false; - shadowNode.i = i; - shadowNode.j = shadowTableCol; - shadowNode.activeCell = activeTableCell; - shadowNode.rowHeaderCells = []; - shadowNode.colHeaderCells = []; - shadowNode.isRowHeader = false; - shadowNode.isColHeader = false; - } else { - // This position is spanned. - shadowNode.spanned = true; - shadowNode.rowSpan = (rowsSpanned > 1); - shadowNode.colSpan = (colsSpanned > 1); - shadowNode.i = i; - shadowNode.j = shadowTableCol; - shadowNode.activeCell = activeTableCell; - shadowNode.rowHeaderCells = []; - shadowNode.colHeaderCells = []; - shadowNode.isRowHeader = false; - shadowNode.isColHeader = false; - } - // Check this shadowNode to see if it is a candidate header cell - if (cvox.TableUtil.checkIfHeader(shadowNode.activeCell)) { - this.candidateHeaders_.push(shadowNode); - } else if (shadowNode.activeCell.hasAttribute('headers')) { - // This shadowNode has information about other header cells - this.candidateHeaders_.push(shadowNode); - } - - // Check and update row group status. - if (currentRowParent == null) { - // This is the first row - currentRowParent = allRows[i].parentNode; - currentRowGroup = 0; - } else { - if (allRows[i].parentNode != currentRowParent) { - // We're in a different row group now - currentRowParent = allRows[i].parentNode; - currentRowGroup = currentRowGroup + 1; - } - } - shadowNode.rowGroup = currentRowGroup; - - // Check and update col group status - if (colToColGroup.length > 0) { - shadowNode.colGroup = colToColGroup[shadowTableCol]; - } else { - shadowNode.colGroup = 0; - } - - if (!shadowNode.spanned) { - if (activeTableCell.id != null) { - this.idToShadowNode_[activeTableCell.id] = shadowNode; - } - } - - this.shadowTable_[i + r][shadowTableCol + c] = shadowNode; - } - } - shadowTableCol += colsSpanned; - activeTableCol++; - } else { - // This position has already been filled (by a previous cell that has - // a colspan or a rowspan) - shadowTableCol += 1; - } - } - } - return this.shadowTable_; -}; - - -/** - * Finds header cells from the list of candidate headers and classifies them - * in two ways: - * -- Identifies them for the entire table by adding them to - * this.tableRowHeaders and this.tableColHeaders. - * -- Identifies them for each shadow table node by adding them to the node's - * rowHeaderCells or colHeaderCells arrays. - * - * @private - */ -cvox.TraverseTable.prototype.findHeaderCells_ = function() { - // Forming relationships between data cells and header cells: - // http://dev.w3.org/html5/spec/tabular-data.html - // #header-and-data-cell-semantics - - for (var i = 0; i < this.candidateHeaders_.length; i++) { - var currentShadowNode = this.candidateHeaders_[i]; - var currentCell = currentShadowNode.activeCell; - - var assumedScope = null; - var specifiedScope = null; - - if (currentShadowNode.spanned) { - continue; - } - - if ((currentCell.tagName == 'TH') && !(currentCell.hasAttribute('scope'))) { - // No scope specified - compute scope ourselves. - // Go left/right - if there's a header node, then this is a column - // header - if (currentShadowNode.j > 0) { - if (this.shadowTable_[currentShadowNode.i][currentShadowNode.j - 1] - .activeCell.tagName == 'TH') { - assumedScope = 'col'; - } - } else if ( - currentShadowNode.j < - this.shadowTable_[currentShadowNode.i].length - 1) { - if (this.shadowTable_[currentShadowNode.i][currentShadowNode.j + 1] - .activeCell.tagName == 'TH') { - assumedScope = 'col'; - } - } else { - // This row has a width of 1 cell, just assume this is a colum header - assumedScope = 'col'; - } - - if (assumedScope == null) { - // Go up/down - if there's a header node, then this is a row header - if (currentShadowNode.i > 0) { - if (this.shadowTable_[currentShadowNode.i - 1][currentShadowNode.j] - .activeCell.tagName == 'TH') { - assumedScope = 'row'; - } - } else if (currentShadowNode.i < this.shadowTable_.length - 1) { - if (this.shadowTable_[currentShadowNode.i + 1][currentShadowNode.j] - .activeCell.tagName == 'TH') { - assumedScope = 'row'; - } - } else { - // This column has a height of 1 cell, just assume that this is - // a row header - assumedScope = 'row'; - } - } - } else if (currentCell.hasAttribute('scope')) { - specifiedScope = currentCell.getAttribute('scope'); - } else if ( - currentCell.hasAttribute('role') && - (currentCell.getAttribute('role') == 'rowheader')) { - specifiedScope = 'row'; - } else if ( - currentCell.hasAttribute('role') && - (currentCell.getAttribute('role') == 'columnheader')) { - specifiedScope = 'col'; - } - - if ((specifiedScope == 'row') || (assumedScope == 'row')) { - currentShadowNode.isRowHeader = true; - - // Go right until you hit the edge of the table or a data - // cell after another header cell. - // Add this cell to each shadowNode.rowHeaderCells attribute as you go. - for (var rightCtr = currentShadowNode.j; - rightCtr < this.shadowTable_[currentShadowNode.i].length; - rightCtr++) { - var rightShadowNode = this.shadowTable_[currentShadowNode.i][rightCtr]; - var rightCell = rightShadowNode.activeCell; - - if ((rightCell.tagName == 'TH') || (rightCell.hasAttribute('scope'))) { - if (rightCtr < this.shadowTable_[currentShadowNode.i].length - 1) { - var checkDataCell = - this.shadowTable_[currentShadowNode.i][rightCtr + 1]; - } - } - rightShadowNode.rowHeaderCells.push(currentCell); - } - this.tableRowHeaders.push(currentCell); - } else if ((specifiedScope == 'col') || (assumedScope == 'col')) { - currentShadowNode.isColHeader = true; - - // Go down until you hit the edge of the table or a data cell - // after another header cell. - // Add this cell to each shadowNode.colHeaders attribute as you go. - - for (var downCtr = currentShadowNode.i; - downCtr < this.shadowTable_.length; downCtr++) { - var downShadowNode = this.shadowTable_[downCtr][currentShadowNode.j]; - if (downShadowNode == null) { - break; - } - var downCell = downShadowNode.activeCell; - - if ((downCell.tagName == 'TH') || (downCell.hasAttribute('scope'))) { - if (downCtr < this.shadowTable_.length - 1) { - var checkDataCell = - this.shadowTable_[downCtr + 1][currentShadowNode.j]; - } - } - downShadowNode.colHeaderCells.push(currentCell); - } - this.tableColHeaders.push(currentCell); - } else if (specifiedScope == 'rowgroup') { - currentShadowNode.isRowHeader = true; - - // This cell is a row header for the rest of the cells in this row group. - var currentRowGroup = currentShadowNode.rowGroup; - - // Get the rest of the cells in this row first - for (var cellsInRow = currentShadowNode.j + 1; - cellsInRow < this.shadowTable_[currentShadowNode.i].length; - cellsInRow++) { - this.shadowTable_[currentShadowNode.i][cellsInRow].rowHeaderCells.push( - currentCell); - } - - // Now propagate to rest of row group - for (var downCtr = currentShadowNode.i + 1; - downCtr < this.shadowTable_.length; downCtr++) { - if (this.shadowTable_[downCtr][0].rowGroup != currentRowGroup) { - break; - } - - for (var rightCtr = 0; rightCtr < this.shadowTable_[downCtr].length; - rightCtr++) { - this.shadowTable_[downCtr][rightCtr].rowHeaderCells.push(currentCell); - } - } - this.tableRowHeaders.push(currentCell); - - } else if (specifiedScope == 'colgroup') { - currentShadowNode.isColHeader = true; - - // This cell is a col header for the rest of the cells in this col group. - var currentColGroup = currentShadowNode.colGroup; - - // Get the rest of the cells in this colgroup first - for (var cellsInCol = currentShadowNode.j + 1; - cellsInCol < this.shadowTable_[currentShadowNode.i].length; - cellsInCol++) { - if (this.shadowTable_[currentShadowNode.i][cellsInCol].colGroup == - currentColGroup) { - this.shadowTable_[currentShadowNode.i][cellsInCol] - .colHeaderCells.push(currentCell); - } - } - - // Now propagate to rest of col group - for (var downCtr = currentShadowNode.i + 1; - downCtr < this.shadowTable_.length; downCtr++) { - for (var rightCtr = 0; rightCtr < this.shadowTable_[downCtr].length; - rightCtr++) { - if (this.shadowTable_[downCtr][rightCtr].colGroup == - currentColGroup) { - this.shadowTable_[downCtr][rightCtr].colHeaderCells.push( - currentCell); - } - } - } - this.tableColHeaders.push(currentCell); - } - if (currentCell.hasAttribute('headers')) { - this.findAttrbHeaders_(currentShadowNode); - } - if (currentCell.hasAttribute('aria-describedby')) { - this.findAttrbDescribedBy_(currentShadowNode); - } - } -}; - - -/** - * Finds header cells from the 'headers' attribute of a given shadow node's - * active cell and classifies them in two ways: - * -- Identifies them for the entire table by adding them to - * this.tableRowHeaders and this.tableColHeaders. - * -- Identifies them for the shadow table node by adding them to the node's - * rowHeaderCells or colHeaderCells arrays. - * Please note that header cells found through the 'headers' attribute are - * difficult to attribute to being either row or column headers because a - * table cell can declare arbitrary cells as its headers. A guess is made here - * based on which axis the header cell is closest to. - * - * @param {ShadowTableNode} currentShadowNode A shadow node with an active cell - * that has a 'headers' attribute. - * - * @private - */ -cvox.TraverseTable.prototype.findAttrbHeaders_ = function(currentShadowNode) { - var activeTableCell = currentShadowNode.activeCell; - - var idList = activeTableCell.getAttribute('headers').split(' '); - for (var idToken = 0; idToken < idList.length; idToken++) { - // Find cell(s) with this ID, add to header list - var idCellArray = - cvox.TableUtil.getCellWithID(this.activeTable_, idList[idToken]); - - for (var idCtr = 0; idCtr < idCellArray.length; idCtr++) { - if (idCellArray[idCtr].id == activeTableCell.id) { - // Skip if the ID is the same as the current cell's ID - break; - } - // Check if this list of candidate headers contains a - // shadowNode with an active cell with this ID already - var possibleHeaderNode = this.idToShadowNode_[idCellArray[idCtr].id]; - if (!cvox.TableUtil.checkIfHeader(possibleHeaderNode.activeCell)) { - // This listed header cell will not be handled later. - // Determine whether this is a row or col header for - // the active table cell - - var iDiff = Math.abs(possibleHeaderNode.i - currentShadowNode.i); - var jDiff = Math.abs(possibleHeaderNode.j - currentShadowNode.j); - if ((iDiff == 0) || (iDiff < jDiff)) { - cvox.TableUtil.pushIfNotContained( - currentShadowNode.rowHeaderCells, possibleHeaderNode.activeCell); - cvox.TableUtil.pushIfNotContained( - this.tableRowHeaders, possibleHeaderNode.activeCell); - } else { - // This is a column header - cvox.TableUtil.pushIfNotContained( - currentShadowNode.colHeaderCells, possibleHeaderNode.activeCell); - cvox.TableUtil.pushIfNotContained( - this.tableColHeaders, possibleHeaderNode.activeCell); - } - } - } - } -}; - - -/** - * Finds header cells from the 'aria-describedby' attribute of a given shadow - * node's active cell and classifies them in two ways: - * -- Identifies them for the entire table by adding them to - * this.tableRowHeaders and this.tableColHeaders. - * -- Identifies them for the shadow table node by adding them to the node's - * rowHeaderCells or colHeaderCells arrays. - * - * Please note that header cells found through the 'aria-describedby' attribute - * must have the role='rowheader' or role='columnheader' attributes in order to - * be considered header cells. - * - * @param {ShadowTableNode} currentShadowNode A shadow node with an active cell - * that has an 'aria-describedby' attribute. - * - * @private - */ -cvox.TraverseTable.prototype.findAttrbDescribedBy_ = function( - currentShadowNode) { - var activeTableCell = currentShadowNode.activeCell; - - var idList = activeTableCell.getAttribute('aria-describedby').split(' '); - for (var idToken = 0; idToken < idList.length; idToken++) { - // Find cell(s) with this ID, add to header list - var idCellArray = - cvox.TableUtil.getCellWithID(this.activeTable_, idList[idToken]); - - for (var idCtr = 0; idCtr < idCellArray.length; idCtr++) { - if (idCellArray[idCtr].id == activeTableCell.id) { - // Skip if the ID is the same as the current cell's ID - break; - } - // Check if this list of candidate headers contains a - // shadowNode with an active cell with this ID already - var possibleHeaderNode = this.idToShadowNode_[idCellArray[idCtr].id]; - if (!cvox.TableUtil.checkIfHeader(possibleHeaderNode.activeCell)) { - // This listed header cell will not be handled later. - // Determine whether this is a row or col header for - // the active table cell - - if (possibleHeaderNode.activeCell.hasAttribute('role') && - (possibleHeaderNode.activeCell.getAttribute('role') == - 'rowheader')) { - cvox.TableUtil.pushIfNotContained( - currentShadowNode.rowHeaderCells, possibleHeaderNode.activeCell); - cvox.TableUtil.pushIfNotContained( - this.tableRowHeaders, possibleHeaderNode.activeCell); - } else if ( - possibleHeaderNode.activeCell.hasAttribute('role') && - (possibleHeaderNode.activeCell.getAttribute('role') == - 'columnheader')) { - cvox.TableUtil.pushIfNotContained( - currentShadowNode.colHeaderCells, possibleHeaderNode.activeCell); - cvox.TableUtil.pushIfNotContained( - this.tableColHeaders, possibleHeaderNode.activeCell); - } - } - } - } -}; - - -/** - * Gets the current cell or null if there is no current cell. - * @return {?Node} The cell <TD> or <TH> or role='gridcell' node. - */ -cvox.TraverseTable.prototype.getCell = function() { - if (!this.currentCellCursor || !this.shadowTable_) { - return null; - } - - var shadowEntry = - this.shadowTable_[this.currentCellCursor[0]][this.currentCellCursor[1]]; - - return shadowEntry && shadowEntry.activeCell; -}; - - -/** - * Gets the cell at the specified location. - * @param {Array<number>} index The index <i, j> of the required cell. - * @return {?Node} The cell <TD> or <TH> or role='gridcell' node at the - * specified location. Null if that cell does not exist. - */ -cvox.TraverseTable.prototype.getCellAt = function(index) { - if (((index[0] < this.rowCount) && (index[0] >= 0)) && - ((index[1] < this.colCount) && (index[1] >= 0))) { - var shadowEntry = this.shadowTable_[index[0]][index[1]]; - if (shadowEntry != null) { - return shadowEntry.activeCell; - } - } - return null; -}; - - -/** - * Gets the cells that are row headers of the current cell. - * @return {!Array} The cells that are row headers of the current cell. Empty if - * the current cell does not have row headers. - */ -cvox.TraverseTable.prototype.getCellRowHeaders = function() { - var shadowEntry = - this.shadowTable_[this.currentCellCursor[0]][this.currentCellCursor[1]]; - - return shadowEntry.rowHeaderCells; -}; - - -/** - * Gets the cells that are col headers of the current cell. - * @return {!Array} The cells that are col headers of the current cell. Empty if - * the current cell does not have col headers. - */ -cvox.TraverseTable.prototype.getCellColHeaders = function() { - var shadowEntry = - this.shadowTable_[this.currentCellCursor[0]][this.currentCellCursor[1]]; - - return shadowEntry.colHeaderCells; -}; - - -/** - * Whether or not the current cell is spanned by another cell. - * @return {boolean} Whether or not the current cell is spanned by another cell. - */ -cvox.TraverseTable.prototype.isSpanned = function() { - var shadowEntry = - this.shadowTable_[this.currentCellCursor[0]][this.currentCellCursor[1]]; - - return shadowEntry.spanned; -}; - - -/** - * Whether or not the current cell is a row header cell. - * @return {boolean} Whether or not the current cell is a row header cell. - */ -cvox.TraverseTable.prototype.isRowHeader = function() { - var shadowEntry = - this.shadowTable_[this.currentCellCursor[0]][this.currentCellCursor[1]]; - - return shadowEntry.isRowHeader; -}; - - -/** - * Whether or not the current cell is a col header cell. - * @return {boolean} Whether or not the current cell is a col header cell. - */ -cvox.TraverseTable.prototype.isColHeader = function() { - var shadowEntry = - this.shadowTable_[this.currentCellCursor[0]][this.currentCellCursor[1]]; - - return shadowEntry.isColHeader; -}; - - -/** - * Gets the active column, represented as an array of <TH> or <TD> nodes that - * make up a column. In this context, "active" means that this is the column - * that contains the cell the user is currently looking at. - * @return {Array} An array of <TH> or <TD> or role='gridcell' nodes. - */ -cvox.TraverseTable.prototype.getCol = function() { - var colArray = []; - for (var i = 0; i < this.shadowTable_.length; i++) { - if (this.shadowTable_[i][this.currentCellCursor[1]]) { - var shadowEntry = this.shadowTable_[i][this.currentCellCursor[1]]; - - if (shadowEntry.colSpan && shadowEntry.rowSpan) { - // Look at the last element in the column cell aray. - var prev = colArray[colArray.length - 1]; - if (prev != shadowEntry.activeCell) { - // Watch out for positions spanned by a cell with rowspan and - // colspan. We don't want the same cell showing up multiple times - // in per-column cell lists. - colArray.push(shadowEntry.activeCell); - } - } else if ((shadowEntry.colSpan) || (!shadowEntry.rowSpan)) { - colArray.push(shadowEntry.activeCell); - } - } - } - return colArray; -}; - - -/** - * Gets the active row <TR> node. In this context, "active" means that this is - * the row that contains the cell the user is currently looking at. - * @return {Node} The active row node. - */ -cvox.TraverseTable.prototype.getRow = function() { - var childRows = cvox.TableUtil.getChildRows(this.activeTable_); - return childRows[this.currentCellCursor[0]]; -}; - - -/** - * Gets the table summary text. - * - * @return {?string} Either: - * 1) The table summary text - * 2) Null if the table does not contain a summary attribute. - */ -cvox.TraverseTable.prototype.summaryText = function() { - // see http://code.google.com/p/chromium/issues/detail?id=46567 - // for information why this is necessary - if (!this.activeTable_.hasAttribute('summary')) { - return null; - } - return this.activeTable_.getAttribute('summary'); -}; - - -/** - * Gets the table caption text. - * - * @return {?string} Either: - * 1) The table caption text - * 2) Null if the table does not include a caption tag. - */ -cvox.TraverseTable.prototype.captionText = function() { - // If there's more than one outer <caption> element, choose the first one. - var captionNodes = cvox.XpathUtil.evalXPath('caption\[1]', this.activeTable_); - if (captionNodes.length > 0) { - return captionNodes[0].innerHTML; - } else { - return null; - } -}; - - -/** - * Calculates the number of columns in the shadow table. - * @return {number} The number of columns in the shadow table. - * @private - */ -cvox.TraverseTable.prototype.shadowColCount_ = function() { - // As the shadow table is a 2D array, the number of columns is the - // max number of elements in the second-level arrays. - var max = 0; - for (var i = 0; i < this.shadowTable_.length; i++) { - if (this.shadowTable_[i].length > max) { - max = this.shadowTable_[i].length; - } - } - return max; -}; - - -/** - * Calculates the number of rows in the table. - * @return {number} The number of rows in the table. - * @private - */ -cvox.TraverseTable.prototype.countRows_ = function() { - // Number of rows in a table is equal to the number of TR elements contained - // by the (outer) TBODY elements. - var rowCount = cvox.TableUtil.getChildRows(this.activeTable_); - return rowCount.length; -}; - - -/** - * Calculates the number of columns in the table. - * This uses the W3C recommended algorithm for calculating number of - * columns, but it does not take rowspans or colspans into account. This means - * that the number of columns calculated here might be lower than the actual - * number of columns in the table if columns are indicated by colspans. - * @return {number} The number of columns in the table. - * @private - */ -cvox.TraverseTable.prototype.getW3CColCount_ = function() { - // See http://www.w3.org/TR/html401/struct/tables.html#h-11.2.4.3 - - var colgroupNodes = - cvox.XpathUtil.evalXPath('child::colgroup', this.activeTable_); - var colNodes = cvox.XpathUtil.evalXPath('child::col', this.activeTable_); - - if ((colgroupNodes.length == 0) && (colNodes.length == 0)) { - var maxcols = 0; - var outerChildren = cvox.TableUtil.getChildRows(this.activeTable_); - for (var i = 0; i < outerChildren.length; i++) { - var childrenCount = cvox.TableUtil.getChildCells(outerChildren[i]); - if (childrenCount.length > maxcols) { - maxcols = childrenCount.length; - } - } - return maxcols; - } else { - var sum = 0; - for (var i = 0; i < colNodes.length; i++) { - if (colNodes[i].hasAttribute('span')) { - sum += colNodes[i].getAttribute('span'); - } else { - sum += 1; - } - } - for (i = 0; i < colgroupNodes.length; i++) { - var colChildren = - cvox.XpathUtil.evalXPath('child::col', colgroupNodes[i]); - if (colChildren.length == 0) { - if (colgroupNodes[i].hasAttribute('span')) { - sum += colgroupNodes[i].getAttribute('span'); - } else { - sum += 1; - } - } - } - } - return sum; -}; - - -/** - * Moves to the next row in the table. Updates the cell cursor. - * - * @return {boolean} Either: - * 1) True if the update has been made. - * 2) False if the end of the table has been reached and the update has not - * happened. - */ -cvox.TraverseTable.prototype.nextRow = function() { - if (!this.currentCellCursor) { - // We have not started moving through the table yet - return this.goToRow(0); - } else { - return this.goToRow(this.currentCellCursor[0] + 1); - } - -}; - - -/** - * Moves to the previous row in the table. Updates the cell cursor. - * - * @return {boolean} Either: - * 1) True if the update has been made. - * 2) False if the end of the table has been reached and the update has not - * happened. - */ -cvox.TraverseTable.prototype.prevRow = function() { - if (!this.currentCellCursor) { - // We have not started moving through the table yet - return this.goToRow(this.rowCount - 1); - } else { - return this.goToRow(this.currentCellCursor[0] - 1); - } -}; - - -/** - * Moves to the next column in the table. Updates the cell cursor. - * - * @return {boolean} Either: - * 1) True if the update has been made. - * 2) False if the end of the table has been reached and the update has not - * happened. - */ -cvox.TraverseTable.prototype.nextCol = function() { - if (!this.currentCellCursor) { - // We have not started moving through the table yet - return this.goToCol(0); - } else { - return this.goToCol(this.currentCellCursor[1] + 1); - } -}; - - -/** - * Moves to the previous column in the table. Updates the cell cursor. - * - * @return {boolean} Either: - * 1) True if the update has been made. - * 2) False if the end of the table has been reached and the update has not - * happened. - */ -cvox.TraverseTable.prototype.prevCol = function() { - if (!this.currentCellCursor) { - // We have not started moving through the table yet - return this.goToCol(this.shadowColCount_() - 1); - } else { - return this.goToCol(this.currentCellCursor[1] - 1); - } -}; - - -/** - * Moves to the row at the specified index in the table. Updates the cell - * cursor. - * @param {number} index The index of the required row. - * @return {boolean} Either: - * 1) True if the index is valid and the update has been made. - * 2) False if the index is not valid (either less than 0 or greater than - * the number of rows in the table). - */ -cvox.TraverseTable.prototype.goToRow = function(index) { - if (this.shadowTable_[index] != null) { - if (this.currentCellCursor == null) { - // We haven't started moving through the table yet - this.currentCellCursor = [index, 0]; - } else { - this.currentCellCursor = [index, this.currentCellCursor[1]]; - } - return true; - } else { - return false; - } -}; - - -/** - * Moves to the column at the specified index in the table. Updates the cell - * cursor. - * @param {number} index The index of the required column. - * @return {boolean} Either: - * 1) True if the index is valid and the update has been made. - * 2) False if the index is not valid (either less than 0 or greater than - * the number of rows in the table). - */ -cvox.TraverseTable.prototype.goToCol = function(index) { - if (index < 0 || index >= this.colCount) { - return false; - } - if (this.currentCellCursor == null) { - // We haven't started moving through the table yet - this.currentCellCursor = [0, index]; - } else { - this.currentCellCursor = [this.currentCellCursor[0], index]; - } - return true; -}; - - -/** - * Moves to the cell at the specified index <i, j> in the table. Updates the - * cell cursor. - * @param {Array<number>} index The index <i, j> of the required cell. - * @return {boolean} Either: - * 1) True if the index is valid and the update has been made. - * 2) False if the index is not valid (either less than 0, greater than - * the number of rows or columns in the table, or there is no cell - * at that location). - */ -cvox.TraverseTable.prototype.goToCell = function(index) { - if (((index[0] < this.rowCount) && (index[0] >= 0)) && - ((index[1] < this.colCount) && (index[1] >= 0))) { - var cell = this.shadowTable_[index[0]][index[1]]; - if (cell != null) { - this.currentCellCursor = index; - return true; - } - } - return false; -}; - - -/** - * Moves to the cell at the last index in the table. Updates the cell cursor. - * @return {boolean} Either: - * 1) True if the index is valid and the update has been made. - * 2) False if the index is not valid (there is no cell at that location). - */ -cvox.TraverseTable.prototype.goToLastCell = function() { - var numRows = this.shadowTable_.length; - if (numRows == 0) { - return false; - } - var lastRow = this.shadowTable_[numRows - 1]; - var lastIndex = [(numRows - 1), (lastRow.length - 1)]; - var cell = this.shadowTable_[lastIndex[0]][lastIndex[1]]; - if (cell != null) { - this.currentCellCursor = lastIndex; - return true; - } - return false; -}; - - -/** - * Moves to the cell at the last index in the current row of the table. Update - * the cell cursor. - * @return {boolean} Either: - * 1) True if the index is valid and the update has been made. - * 2) False if the index is not valid (there is no cell at that location). - */ -cvox.TraverseTable.prototype.goToRowLastCell = function() { - var currentRow = this.currentCellCursor[0]; - var lastIndex = [currentRow, (this.shadowTable_[currentRow].length - 1)]; - var cell = this.shadowTable_[lastIndex[0]][lastIndex[1]]; - if (cell != null) { - this.currentCellCursor = lastIndex; - return true; - } - return false; -}; - - -/** - * Moves to the cell at the last index in the current column of the table. - * Update the cell cursor. - * @return {boolean} Either: - * 1) True if the index is valid and the update has been made. - * 2) False if the index is not valid (there is no cell at that location). - */ -cvox.TraverseTable.prototype.goToColLastCell = function() { - var currentCol = this.getCol(); - var lastIndex = [(currentCol.length - 1), this.currentCellCursor[1]]; - var cell = this.shadowTable_[lastIndex[0]][lastIndex[1]]; - if (cell != null) { - this.currentCellCursor = lastIndex; - return true; - } - return false; -}; - - -/** - * Resets the table cursors. - * - */ -cvox.TraverseTable.prototype.resetCursor = function() { - this.currentCellCursor = null; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/traverse_util.js b/chrome/browser/resources/chromeos/chromevox/common/traverse_util.js deleted file mode 100644 index 717fc8af..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/traverse_util.js +++ /dev/null
@@ -1,921 +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. - -/** - * @fileoverview Low-level DOM traversal utility functions to find the - * next (or previous) character, word, sentence, line, or paragraph, - * in a completely stateless manner without actually manipulating the - * selection. - */ - -goog.provide('cvox.TraverseUtil'); - -goog.require('cvox.Cursor'); -goog.require('cvox.DomPredicates'); -goog.require('cvox.DomUtil'); - -/** - * Utility functions for stateless DOM traversal. - * @constructor - */ -cvox.TraverseUtil = function() {}; - -/** - * Gets the text representation of a node. This allows us to substitute - * alt text, names, or titles for html elements that provide them. - * @param {Node} node A DOM node. - * @return {string} A text string representation of the node. - */ -cvox.TraverseUtil.getNodeText = function(node) { - if (node.constructor == Text) { - return node.data; - } else { - return ''; - } -}; - -/** - * Return true if a node should be treated as a leaf node, because - * its children are properties of the object that shouldn't be traversed. - * - * TODO(dmazzoni): replace this with a predicate that detects nodes with - * ARIA roles and other objects that have their own description. - * For now we just detect a couple of common cases. - * - * @param {Node} node A DOM node. - * @return {boolean} True if the node should be treated as a leaf node. - */ -cvox.TraverseUtil.treatAsLeafNode = function(node) { - return node.childNodes.length == 0 || node.nodeName == 'SELECT' || - node.getAttribute('role') == 'listbox' || node.nodeName == 'OBJECT'; -}; - -/** - * Return true only if a single character is whitespace. - * From https://developer.mozilla.org/en/Whitespace_in_the_DOM, - * whitespace is defined as one of the characters - * "\t" TAB \u0009 - * "\n" LF \u000A - * "\r" CR \u000D - * " " SPC \u0020. - * - * @param {string} c A string containing a single character. - * @return {boolean} True if the character is whitespace, otherwise false. - */ -cvox.TraverseUtil.isWhitespace = function(c) { - return (c == ' ' || c == '\n' || c == '\r' || c == '\t'); -}; - -/** - * Set the selection to the range between the given start and end cursors. - * @param {cvox.Cursor} start The desired start of the selection. - * @param {cvox.Cursor} end The desired end of the selection. - * @return {Selection} the selection object. - */ -cvox.TraverseUtil.setSelection = function(start, end) { - var sel = window.getSelection(); - sel.removeAllRanges(); - var range = document.createRange(); - range.setStart(start.node, start.index); - range.setEnd(end.node, end.index); - sel.addRange(range); - - return sel; -}; - -// TODO(dtseng): Combine with cvox.DomUtil.hasContent. -/** - * Check if this DOM node has the attribute aria-hidden='true', which should - * hide it from screen readers. - * @param {Node} node An HTML DOM node. - * @return {boolean} Whether or not the html node should be traversed. - */ -cvox.TraverseUtil.isHidden = function(node) { - if (node instanceof HTMLElement && - node.getAttribute('aria-hidden') == 'true') { - return true; - } - switch (node.tagName) { - case 'SCRIPT': - case 'NOSCRIPT': - return true; - } - return false; -}; - -/** - * Moves the cursor forwards until it has crossed exactly one character. - * @param {cvox.Cursor} cursor The cursor location where the search should - * start. On exit, the cursor will be immediately to the right of the - * character returned. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * @return {?string} The character found, or null if the bottom of the - * document has been reached. - */ -cvox.TraverseUtil.forwardsChar = function( - cursor, elementsEntered, elementsLeft) { - while (true) { - // Move down until we get to a leaf node. - var childNode = null; - if (!cvox.TraverseUtil.treatAsLeafNode(cursor.node)) { - for (var i = cursor.index; i < cursor.node.childNodes.length; i++) { - var node = cursor.node.childNodes[i]; - if (cvox.TraverseUtil.isHidden(node)) { - if (node instanceof HTMLElement) { - elementsEntered.push(node); - } - continue; - } - if (cvox.DomUtil.isVisible(node, {checkAncestors: false})) { - childNode = node; - break; - } - } - } - if (childNode) { - cursor.node = childNode; - cursor.index = 0; - cursor.text = cvox.TraverseUtil.getNodeText(cursor.node); - if (cursor.node instanceof HTMLElement) { - elementsEntered.push(cursor.node); - } - continue; - } - - // Return the next character from this leaf node. - if (cursor.index < cursor.text.length) - return cursor.text[cursor.index++]; - - // Move to the next sibling, going up the tree as necessary. - while (cursor.node != null) { - // Try to move to the next sibling. - var siblingNode = null; - for (var node = cursor.node.nextSibling; node != null; - node = node.nextSibling) { - if (cvox.TraverseUtil.isHidden(node)) { - if (node instanceof HTMLElement) { - elementsEntered.push(node); - } - continue; - } - if (cvox.DomUtil.isVisible(node, {checkAncestors: false})) { - siblingNode = node; - break; - } - } - if (siblingNode) { - if (cursor.node instanceof HTMLElement) { - elementsLeft.push(cursor.node); - } - - cursor.node = siblingNode; - cursor.text = cvox.TraverseUtil.getNodeText(siblingNode); - cursor.index = 0; - - if (cursor.node instanceof HTMLElement) { - elementsEntered.push(cursor.node); - } - - break; - } - - // Otherwise, move to the parent. - if (cursor.node.parentNode && - cursor.node.parentNode.constructor != HTMLBodyElement) { - if (cursor.node instanceof HTMLElement) { - elementsLeft.push(cursor.node); - } - cursor.node = cursor.node.parentNode; - cursor.text = null; - cursor.index = 0; - } else { - return null; - } - } - } -}; - -/** - * Moves the cursor backwards until it has crossed exactly one character. - * @param {cvox.Cursor} cursor The cursor location where the search should - * start. On exit, the cursor will be immediately to the left of the - * character returned. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * @return {?string} The previous character, or null if the top of the - * document has been reached. - */ -cvox.TraverseUtil.backwardsChar = function( - cursor, elementsEntered, elementsLeft) { - while (true) { - // Move down until we get to a leaf node. - var childNode = null; - if (!cvox.TraverseUtil.treatAsLeafNode(cursor.node)) { - for (var i = cursor.index - 1; i >= 0; i--) { - var node = cursor.node.childNodes[i]; - if (cvox.TraverseUtil.isHidden(node)) { - if (node instanceof HTMLElement) { - elementsEntered.push(node); - } - continue; - } - if (cvox.DomUtil.isVisible(node, {checkAncestors: false})) { - childNode = node; - break; - } - } - } - if (childNode) { - cursor.node = childNode; - cursor.text = cvox.TraverseUtil.getNodeText(cursor.node); - if (cursor.text.length) - cursor.index = cursor.text.length; - else - cursor.index = cursor.node.childNodes.length; - if (cursor.node instanceof HTMLElement) { - elementsEntered.push(cursor.node); - } - continue; - } - - // Return the previous character from this leaf node. - if (cursor.text.length > 0 && cursor.index > 0) { - return cursor.text[--cursor.index]; - } - - // Move to the previous sibling, going up the tree as necessary. - while (true) { - // Try to move to the previous sibling. - var siblingNode = null; - for (var node = cursor.node.previousSibling; node != null; - node = node.previousSibling) { - if (cvox.TraverseUtil.isHidden(node)) { - if (node instanceof HTMLElement) { - elementsEntered.push(node); - } - continue; - } - if (cvox.DomUtil.isVisible(node, {checkAncestors: false})) { - siblingNode = node; - break; - } - } - if (siblingNode) { - if (cursor.node instanceof HTMLElement) { - elementsLeft.push(cursor.node); - } - - cursor.node = siblingNode; - cursor.text = cvox.TraverseUtil.getNodeText(siblingNode); - if (cursor.text.length) - cursor.index = cursor.text.length; - else - cursor.index = cursor.node.childNodes.length; - - if (cursor.node instanceof HTMLElement) { - elementsEntered.push(cursor.node); - } - break; - } - - // Otherwise, move to the parent. - if (cursor.node.parentNode && - cursor.node.parentNode.constructor != HTMLBodyElement) { - if (cursor.node instanceof HTMLElement) { - elementsLeft.push(cursor.node); - } - cursor.node = cursor.node.parentNode; - cursor.text = null; - cursor.index = 0; - } else { - return null; - } - } - } -}; - -/** - * Finds the next character, starting from endCursor. Upon exit, startCursor - * and endCursor will surround the next character. If skipWhitespace is - * true, will skip until a real character is found. Otherwise, it will - * attempt to select all of the whitespace between the initial position - * of endCursor and the next non-whitespace character. - * @param {!cvox.Cursor} startCursor On exit, points to the position before - * the char. - * @param {!cvox.Cursor} endCursor The position to start searching for the next - * char. On exit, will point to the position past the char. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * initial and final cursor position will be pushed onto this array. - * @param {boolean} skipWhitespace If true, will keep scanning until a - * non-whitespace character is found. - * @return {?string} The next char, or null if the bottom of the - * document has been reached. - */ -cvox.TraverseUtil.getNextChar = function( - startCursor, endCursor, elementsEntered, elementsLeft, skipWhitespace) { - - // Save the starting position and get the first character. - startCursor.copyFrom(endCursor); - var c = - cvox.TraverseUtil.forwardsChar(endCursor, elementsEntered, elementsLeft); - if (c == null) - return null; - - // Keep track of whether the first character was whitespace. - var initialWhitespace = cvox.TraverseUtil.isWhitespace(c); - - // Keep scanning until we find a non-whitespace or non-skipped character. - while ((cvox.TraverseUtil.isWhitespace(c)) || - (cvox.TraverseUtil.isHidden(endCursor.node))) { - c = cvox.TraverseUtil.forwardsChar( - endCursor, elementsEntered, elementsLeft); - if (c == null) - return null; - } - if (skipWhitespace || !initialWhitespace) { - // If skipWhitepace is true, or if the first character we encountered - // was not whitespace, return that non-whitespace character. - startCursor.copyFrom(endCursor); - startCursor.index--; - return c; - } else { - for (var i = 0; i < elementsEntered.length; i++) { - if (cvox.TraverseUtil.isHidden(elementsEntered[i])) { - // We need to make sure that startCursor and endCursor aren't - // surrounding a skippable node. - endCursor.index--; - startCursor.copyFrom(endCursor); - startCursor.index--; - return ' '; - } - } - // Otherwise, return all of the whitespace before that last character. - endCursor.index--; - return ' '; - } -}; - -/** - * Finds the previous character, starting from startCursor. Upon exit, - * startCursor and endCursor will surround the previous character. - * If skipWhitespace is true, will skip until a real character is found. - * Otherwise, it will attempt to select all of the whitespace between - * the initial position of endCursor and the next non-whitespace character. - * @param {!cvox.Cursor} startCursor The position to start searching for the - * char. On exit, will point to the position before the char. - * @param {!cvox.Cursor} endCursor The position to start searching for the next - * char. On exit, will point to the position past the char. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * initial and final cursor position will be pushed onto this array. - * @param {boolean} skipWhitespace If true, will keep scanning until a - * non-whitespace character is found. - * @return {?string} The previous char, or null if the top of the - * document has been reached. - */ -cvox.TraverseUtil.getPreviousChar = function( - startCursor, endCursor, elementsEntered, elementsLeft, skipWhitespace) { - - // Save the starting position and get the first character. - endCursor.copyFrom(startCursor); - var c = cvox.TraverseUtil.backwardsChar( - startCursor, elementsEntered, elementsLeft); - if (c == null) - return null; - - // Keep track of whether the first character was whitespace. - var initialWhitespace = cvox.TraverseUtil.isWhitespace(c); - - // Keep scanning until we find a non-whitespace or non-skipped character. - while ((cvox.TraverseUtil.isWhitespace(c)) || - (cvox.TraverseUtil.isHidden(startCursor.node))) { - c = cvox.TraverseUtil.backwardsChar( - startCursor, elementsEntered, elementsLeft); - if (c == null) - return null; - } - if (skipWhitespace || !initialWhitespace) { - // If skipWhitepace is true, or if the first character we encountered - // was not whitespace, return that non-whitespace character. - endCursor.copyFrom(startCursor); - endCursor.index++; - return c; - } else { - for (var i = 0; i < elementsEntered.length; i++) { - if (cvox.TraverseUtil.isHidden(elementsEntered[i])) { - startCursor.index++; - endCursor.copyFrom(startCursor); - endCursor.index++; - return ' '; - } - } - // Otherwise, return all of the whitespace before that last character. - startCursor.index++; - return ' '; - } -}; - -/** - * Finds the next word, starting from endCursor. Upon exit, startCursor - * and endCursor will surround the next word. A word is defined to be - * a string of 1 or more non-whitespace characters in the same DOM node. - * @param {cvox.Cursor} startCursor On exit, will point to the beginning of the - * word returned. - * @param {cvox.Cursor} endCursor The position to start searching for the next - * word. On exit, will point to the end of the word returned. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * @return {?string} The next word, or null if the bottom of the - * document has been reached. - */ -cvox.TraverseUtil.getNextWord = function( - startCursor, endCursor, elementsEntered, elementsLeft) { - - // Find the first non-whitespace or non-skipped character. - var cursor = endCursor.clone(); - var c = cvox.TraverseUtil.forwardsChar(cursor, elementsEntered, elementsLeft); - if (c == null) - return null; - while ((cvox.TraverseUtil.isWhitespace(c)) || - (cvox.TraverseUtil.isHidden(cursor.node))) { - c = cvox.TraverseUtil.forwardsChar(cursor, elementsEntered, elementsLeft); - if (c == null) - return null; - } - - // Set startCursor to the position immediately before the first - // character in our word. It's safe to decrement |index| because - // forwardsChar guarantees that the cursor will be immediately to the - // right of the returned character on exit. - startCursor.copyFrom(cursor); - startCursor.index--; - - // Keep building up our word until we reach a whitespace character or - // would cross a tag. Don't actually return any tags crossed, because this - // word goes up until the tag boundary but not past it. - endCursor.copyFrom(cursor); - var word = c; - var newEntered = []; - var newLeft = []; - c = cvox.TraverseUtil.forwardsChar(cursor, newEntered, newLeft); - if (c == null) { - return word; - } - while (!cvox.TraverseUtil.isWhitespace(c) && newEntered.length == 0 && - newLeft == 0) { - word += c; - endCursor.copyFrom(cursor); - c = cvox.TraverseUtil.forwardsChar(cursor, newEntered, newLeft); - if (c == null) { - return word; - } - } - - return word; -}; - -/** - * Finds the previous word, starting from startCursor. Upon exit, startCursor - * and endCursor will surround the previous word. A word is defined to be - * a string of 1 or more non-whitespace characters in the same DOM node. - * @param {cvox.Cursor} startCursor The position to start searching for the - * previous word. On exit, will point to the beginning of the - * word returned. - * @param {cvox.Cursor} endCursor On exit, will point to the end of the - * word returned. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * @return {?string} The previous word, or null if the bottom of the - * document has been reached. - */ -cvox.TraverseUtil.getPreviousWord = function( - startCursor, endCursor, elementsEntered, elementsLeft) { - // Find the first non-whitespace or non-skipped character. - var cursor = startCursor.clone(); - var c = - cvox.TraverseUtil.backwardsChar(cursor, elementsEntered, elementsLeft); - if (c == null) - return null; - while ( - (cvox.TraverseUtil.isWhitespace(c) || - (cvox.TraverseUtil.isHidden(cursor.node)))) { - c = cvox.TraverseUtil.backwardsChar(cursor, elementsEntered, elementsLeft); - if (c == null) - return null; - } - - // Set endCursor to the position immediately after the first - // character we've found (the last character of the word, since we're - // searching backwards). - endCursor.copyFrom(cursor); - endCursor.index++; - - // Keep building up our word until we reach a whitespace character or - // would cross a tag. Don't actually return any tags crossed, because this - // word goes up until the tag boundary but not past it. - startCursor.copyFrom(cursor); - var word = c; - var newEntered = []; - var newLeft = []; - c = cvox.TraverseUtil.backwardsChar(cursor, newEntered, newLeft); - if (c == null) - return word; - while (!cvox.TraverseUtil.isWhitespace(c) && newEntered.length == 0 && - newLeft.length == 0) { - word = c + word; - startCursor.copyFrom(cursor); - - c = cvox.TraverseUtil.backwardsChar(cursor, newEntered, newLeft); - if (c == null) - return word; - } - - return word; -}; - - -/** - * Given elements entered and left, and break tags, returns true if the - * current word should break. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * @param {Object<boolean>} breakTags Associative array of tags that should - * break. - * @return {boolean} True if elementsEntered or elementsLeft include an - * element with one of these tags. - */ -cvox.TraverseUtil.includesBreakTagOrSkippedNode = function( - elementsEntered, elementsLeft, breakTags) { - for (var i = 0; i < elementsEntered.length; i++) { - if (cvox.TraverseUtil.isHidden(elementsEntered[i])) { - return true; - } - var style = window.getComputedStyle(elementsEntered[i], null); - if ((style && style.display != 'inline') || - breakTags[elementsEntered[i].tagName]) { - return true; - } - } - for (i = 0; i < elementsLeft.length; i++) { - var style = window.getComputedStyle(elementsLeft[i], null); - if ((style && style.display != 'inline') || - breakTags[elementsLeft[i].tagName]) { - return true; - } - } - return false; -}; - - -/** - * Finds the next sentence, starting from endCursor. Upon exit, - * startCursor and endCursor will surround the next sentence. - * - * @param {cvox.Cursor} startCursor On exit, marks the beginning of the - * sentence. - * @param {cvox.Cursor} endCursor The position to start searching for the next - * sentence. On exit, will point to the end of the returned string. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * @param {Object<boolean>} breakTags Associative array of tags that should - * break the sentence. - * @return {?string} The next sentence, or null if the bottom of the - * document has been reached. - */ -cvox.TraverseUtil.getNextSentence = function( - startCursor, endCursor, elementsEntered, elementsLeft, breakTags) { - return cvox.TraverseUtil.getNextString( - startCursor, endCursor, elementsEntered, elementsLeft, - function(str, word, elementsEntered, elementsLeft) { - if (str.substr(-1) == '.') - return true; - return cvox.TraverseUtil.includesBreakTagOrSkippedNode( - elementsEntered, elementsLeft, breakTags); - }); -}; - -/** - * Finds the previous sentence, starting from startCursor. Upon exit, - * startCursor and endCursor will surround the previous sentence. - * - * @param {cvox.Cursor} startCursor The position to start searching for the next - * sentence. On exit, will point to the start of the returned string. - * @param {cvox.Cursor} endCursor On exit, the end of the returned string. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * @param {Object<boolean>} breakTags Associative array of tags that should - * break the sentence. - * @return {?string} The previous sentence, or null if the bottom of the - * document has been reached. - */ -cvox.TraverseUtil.getPreviousSentence = function( - startCursor, endCursor, elementsEntered, elementsLeft, breakTags) { - return cvox.TraverseUtil.getPreviousString( - startCursor, endCursor, elementsEntered, elementsLeft, - function(str, word, elementsEntered, elementsLeft) { - if (word.substr(-1) == '.') - return true; - return cvox.TraverseUtil.includesBreakTagOrSkippedNode( - elementsEntered, elementsLeft, breakTags); - }); -}; - -/** - * Finds the next line, starting from endCursor. Upon exit, - * startCursor and endCursor will surround the next line. - * - * @param {cvox.Cursor} startCursor On exit, marks the beginning of the line. - * @param {cvox.Cursor} endCursor The position to start searching for the next - * line. On exit, will point to the end of the returned string. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * @param {Object<boolean>} breakTags Associative array of tags that should - * break the line. - * @return {?string} The next line, or null if the bottom of the - * document has been reached. - */ -cvox.TraverseUtil.getNextLine = function( - startCursor, endCursor, elementsEntered, elementsLeft, breakTags) { - var range = document.createRange(); - var currentRect = null; - var rightMostRect = null; - var prevCursor = endCursor.clone(); - return cvox.TraverseUtil.getNextString( - startCursor, endCursor, elementsEntered, elementsLeft, - function(str, word, elementsEntered, elementsLeft) { - range.setStart(startCursor.node, startCursor.index); - range.setEnd(endCursor.node, endCursor.index); - var currentRect = range.getBoundingClientRect(); - if (!rightMostRect) { - rightMostRect = currentRect; - } - - // Break at new lines except when within a link. - if (currentRect.bottom != rightMostRect.bottom && - !cvox.DomPredicates.linkPredicate( - cvox.DomUtil.getAncestors(endCursor.node))) { - endCursor.copyFrom(prevCursor); - return true; - } - - rightMostRect = currentRect; - prevCursor.copyFrom(endCursor); - - return cvox.TraverseUtil.includesBreakTagOrSkippedNode( - elementsEntered, elementsLeft, breakTags); - }); -}; - -/** - * Finds the previous line, starting from startCursor. Upon exit, - * startCursor and endCursor will surround the previous line. - * - * @param {cvox.Cursor} startCursor The position to start searching for the next - * line. On exit, will point to the start of the returned string. - * @param {cvox.Cursor} endCursor On exit, the end of the returned string. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * @param {Object<boolean>} breakTags Associative array of tags that should - * break the line. - * @return {?string} The previous line, or null if the bottom of the - * document has been reached. - */ -cvox.TraverseUtil.getPreviousLine = function( - startCursor, endCursor, elementsEntered, elementsLeft, breakTags) { - var range = document.createRange(); - var currentRect = null; - var leftMostRect = null; - var prevCursor = startCursor.clone(); - return cvox.TraverseUtil.getPreviousString( - startCursor, endCursor, elementsEntered, elementsLeft, - function(str, word, elementsEntered, elementsLeft) { - range.setStart(startCursor.node, startCursor.index); - range.setEnd(endCursor.node, endCursor.index); - var currentRect = range.getBoundingClientRect(); - if (!leftMostRect) { - leftMostRect = currentRect; - } - - // Break at new lines except when within a link. - if (currentRect.top != leftMostRect.top && - !cvox.DomPredicates.linkPredicate( - cvox.DomUtil.getAncestors(startCursor.node))) { - startCursor.copyFrom(prevCursor); - return true; - } - - leftMostRect = currentRect; - prevCursor.copyFrom(startCursor); - - return cvox.TraverseUtil.includesBreakTagOrSkippedNode( - elementsEntered, elementsLeft, breakTags); - }); -}; - -/** - * Finds the next paragraph, starting from endCursor. Upon exit, - * startCursor and endCursor will surround the next paragraph. - * - * @param {cvox.Cursor} startCursor On exit, marks the beginning of the - * paragraph. - * @param {cvox.Cursor} endCursor The position to start searching for the next - * paragraph. On exit, will point to the end of the returned string. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * @return {?string} The next paragraph, or null if the bottom of the - * document has been reached. - */ -cvox.TraverseUtil.getNextParagraph = function( - startCursor, endCursor, elementsEntered, elementsLeft) { - return cvox.TraverseUtil.getNextString( - startCursor, endCursor, elementsEntered, elementsLeft, - function(str, word, elementsEntered, elementsLeft) { - for (var i = 0; i < elementsEntered.length; i++) { - if (cvox.TraverseUtil.isHidden(elementsEntered[i])) { - return true; - } - var style = window.getComputedStyle(elementsEntered[i], null); - if (style && style.display != 'inline') { - return true; - } - } - for (i = 0; i < elementsLeft.length; i++) { - var style = window.getComputedStyle(elementsLeft[i], null); - if (style && style.display != 'inline') { - return true; - } - } - return false; - }); -}; - -/** - * Finds the previous paragraph, starting from startCursor. Upon exit, - * startCursor and endCursor will surround the previous paragraph. - * - * @param {cvox.Cursor} startCursor The position to start searching for the next - * paragraph. On exit, will point to the start of the returned string. - * @param {cvox.Cursor} endCursor On exit, the end of the returned string. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * @return {?string} The previous paragraph, or null if the bottom of the - * document has been reached. - */ -cvox.TraverseUtil.getPreviousParagraph = function( - startCursor, endCursor, elementsEntered, elementsLeft) { - return cvox.TraverseUtil.getPreviousString( - startCursor, endCursor, elementsEntered, elementsLeft, - function(str, word, elementsEntered, elementsLeft) { - for (var i = 0; i < elementsEntered.length; i++) { - if (cvox.TraverseUtil.isHidden(elementsEntered[i])) { - return true; - } - var style = window.getComputedStyle(elementsEntered[i], null); - if (style && style.display != 'inline') { - return true; - } - } - for (i = 0; i < elementsLeft.length; i++) { - var style = window.getComputedStyle(elementsLeft[i], null); - if (style && style.display != 'inline') { - return true; - } - } - return false; - }); -}; - -/** - * Customizable function to return the next string of words in the DOM, based - * on provided functions to decide when to break one string and start - * the next. This can be used to get the next sentence, line, paragraph, - * or potentially other granularities. - * - * Finds the next contiguous string, starting from endCursor. Upon exit, - * startCursor and endCursor will surround the next string. - * - * The breakBefore function takes four parameters, and - * should return true if the string should be broken before the proposed - * next word: - * str The string so far. - * word The next word to be added. - * elementsEntered The elements entered in reaching this next word. - * elementsLeft The elements left in reaching this next word. - * - * @param {cvox.Cursor} startCursor On exit, will point to the beginning of the - * next string. - * @param {cvox.Cursor} endCursor The position to start searching for the next - * string. On exit, will point to the end of the returned string. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * @param {function(string, string, Array<Element>, Array<Element>)} - * breakBefore Function that takes the string so far, next word to be - * added, and elements entered and left, and returns true if the string - * should be ended before adding this word. - * @return {?string} The next string, or null if the bottom of the - * document has been reached. - */ -cvox.TraverseUtil.getNextString = function( - startCursor, endCursor, elementsEntered, elementsLeft, breakBefore) { - // Get the first word and set the start cursor to the start of the - // first word. - var wordStartCursor = endCursor.clone(); - var wordEndCursor = endCursor.clone(); - var newEntered = []; - var newLeft = []; - var str = ''; - var word = cvox.TraverseUtil.getNextWord( - wordStartCursor, wordEndCursor, newEntered, newLeft); - if (word == null) - return null; - startCursor.copyFrom(wordStartCursor); - - // Always add the first word when the string is empty, and then keep - // adding more words as long as breakBefore returns false - while (!str || !breakBefore(str, word, newEntered, newLeft)) { - // Append this word, set the end cursor to the end of this word, and - // update the returned list of nodes crossed to include ones we crossed - // in reaching this word. - if (str) - str += ' '; - str += word; - elementsEntered = elementsEntered.concat(newEntered); - elementsLeft = elementsLeft.concat(newLeft); - endCursor.copyFrom(wordEndCursor); - - // Get the next word and go back to the top of the loop. - newEntered = []; - newLeft = []; - word = cvox.TraverseUtil.getNextWord( - wordStartCursor, wordEndCursor, newEntered, newLeft); - if (word == null) - return str; - } - - return str; -}; - -/** - * Customizable function to return the previous string of words in the DOM, - * based on provided functions to decide when to break one string and start - * the next. See getNextString, above, for more details. - * - * Finds the previous contiguous string, starting from startCursor. Upon exit, - * startCursor and endCursor will surround the next string. - * - * @param {cvox.Cursor} startCursor The position to start searching for the - * previous string. On exit, will point to the beginning of the - * string returned. - * @param {cvox.Cursor} endCursor On exit, will point to the end of the - * string returned. - * @param {Array<Element>} elementsEntered Any HTML elements entered. - * @param {Array<Element>} elementsLeft Any HTML elements left. - * @param {function(string, string, Array<Element>, Array<Element>)} - * breakBefore Function that takes the string so far, the word to be - * added, and nodes crossed, and returns true if the string should be - * ended before adding this word. - * @return {?string} The next string, or null if the top of the - * document has been reached. - */ -cvox.TraverseUtil.getPreviousString = function( - startCursor, endCursor, elementsEntered, elementsLeft, breakBefore) { - // Get the first word and set the end cursor to the end of the - // first word. - var wordStartCursor = startCursor.clone(); - var wordEndCursor = startCursor.clone(); - var newEntered = []; - var newLeft = []; - var str = ''; - var word = cvox.TraverseUtil.getPreviousWord( - wordStartCursor, wordEndCursor, newEntered, newLeft); - if (word == null) - return null; - endCursor.copyFrom(wordEndCursor); - - // Always add the first word when the string is empty, and then keep - // adding more words as long as breakBefore returns false - while (!str || !breakBefore(str, word, newEntered, newLeft)) { - // Prepend this word, set the start cursor to the start of this word, and - // update the returned list of nodes crossed to include ones we crossed - // in reaching this word. - if (str) - str = ' ' + str; - str = word + str; - elementsEntered = elementsEntered.concat(newEntered); - elementsLeft = elementsLeft.concat(newLeft); - startCursor.copyFrom(wordStartCursor); - - // Get the previous word and go back to the top of the loop. - newEntered = []; - newLeft = []; - word = cvox.TraverseUtil.getPreviousWord( - wordStartCursor, wordEndCursor, newEntered, newLeft); - if (word == null) - return str; - } - - return str; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/common/xpath_util.js b/chrome/browser/resources/chromeos/chromevox/common/xpath_util.js deleted file mode 100644 index 96efc6e..0000000 --- a/chrome/browser/resources/chromeos/chromevox/common/xpath_util.js +++ /dev/null
@@ -1,142 +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. - -/** - * @fileoverview A collection of JavaScript utilities used to simplify working - * with xpaths. - */ - - -goog.provide('cvox.XpathUtil'); - - -/** - * Utilities for simplifying working with xpaths - * @constructor - */ -cvox.XpathUtil = function() {}; - - -/** - * Mapping for some default namespaces. - * @const - * @private - */ -cvox.XpathUtil.nameSpaces_ = { - 'xhtml': 'http://www.w3.org/1999/xhtml', - 'mathml': 'http://www.w3.org/1998/Math/MathML' -}; - - -/** - * Resolve some default name spaces. - * @param {string} prefix Namespace prefix. - * @return {string} The corresponding namespace URI. - */ -cvox.XpathUtil.resolveNameSpace = function(prefix) { - return cvox.XpathUtil.nameSpaces_[prefix] || null; -}; - - -/** - * Given an XPath expression and rootNode, it returns an array of children nodes - * that match. The code for this function was taken from Mihai Parparita's GMail - * Macros Greasemonkey Script. - * http://gmail-greasemonkey.googlecode.com/svn/trunk/scripts/gmail-new-macros.user.js - * @param {string} expression The XPath expression to evaluate. - * @param {Node} rootNode The HTML node to start evaluating the XPath from. - * @return {Array} The array of children nodes that match. - */ -cvox.XpathUtil.evalXPath = function(expression, rootNode) { - try { - var xpathIterator = rootNode.ownerDocument.evaluate( - expression, rootNode, cvox.XpathUtil.resolveNameSpace, - XPathResult.ORDERED_NODE_ITERATOR_TYPE, - null); // no existing results - } catch (err) { - return []; - } - var results = []; - // Convert result to JS array - for (var xpathNode = xpathIterator.iterateNext(); xpathNode; - xpathNode = xpathIterator.iterateNext()) { - results.push(xpathNode); - } - return results; -}; - -/** - * Given a rootNode, it returns an array of all its leaf nodes. - * @param {Node} rootNode The node to get the leaf nodes from. - * @return {Array} The array of leaf nodes for the given rootNode. - */ -cvox.XpathUtil.getLeafNodes = function(rootNode) { - try { - var xpathIterator = rootNode.ownerDocument.evaluate( - './/*[count(*)=0]', rootNode, - null, // no namespace resolver - XPathResult.ORDERED_NODE_ITERATOR_TYPE, - null); // no existing results - } catch (err) { - return []; - } - var results = []; - // Convert result to JS array - for (var xpathNode = xpathIterator.iterateNext(); xpathNode; - xpathNode = xpathIterator.iterateNext()) { - results.push(xpathNode); - } - return results; -}; - -/** - * Returns whether or not xpath is supported. - * @return {boolean} True if xpath is supported. - */ -cvox.XpathUtil.xpathSupported = function() { - if (typeof(XPathResult) == 'undefined') { - return false; - } - return true; -}; - - -/** - * Given an XPath expression and rootNode, it evaluates the XPath expression as - * a boolean type and returns the result. - * @param {string} expression The XPath expression to evaluate. - * @param {Node} rootNode The HTML node to start evaluating the XPath from. - * @return {boolean} The result of evaluating the xpath expression. - */ -cvox.XpathUtil.evaluateBoolean = function(expression, rootNode) { - try { - var xpathResult = rootNode.ownerDocument.evaluate( - expression, rootNode, cvox.XpathUtil.resolveNameSpace, - XPathResult.BOOLEAN_TYPE, - null); // no existing results - } catch (err) { - return false; - } - return xpathResult.booleanValue; -}; - - -/** - * Given an XPath expression and rootNode, it evaluates the XPath expression as - * a string type and returns the result. - * @param {string} expression The XPath expression to evaluate. - * @param {Node} rootNode The HTML node to start evaluating the XPath from. - * @return {string} The result of evaluating the Xpath expression. - */ -cvox.XpathUtil.evaluateString = function(expression, rootNode) { - try { - var xpathResult = rootNode.ownerDocument.evaluate( - expression, rootNode, cvox.XpathUtil.resolveNameSpace, - XPathResult.STRING_TYPE, - null); // no existing results - } catch (err) { - return ''; - } - return xpathResult.stringValue; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs index b5c964a..06e862f 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
@@ -1961,7 +1961,7 @@ }); }); -TEST_F('ChromeVoxBackgroundTest', 'EventFromUser', function() { +TEST_F('ChromeVoxBackgroundTest', 'DISABLED_EventFromUser', function() { this.runWithLoadedTree(function() {/* <button>ok</button><button>cancel</button> */}, function(root) {
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js index 3980ec9..a7b80a4 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -2109,6 +2109,11 @@ return; } + // Undelayed hints. + if (node.errorMessage) { + this.format_(node, '$node(errorMessage)', buff, ruleStr, undefined, {}); + } + // Hints should be delayed. var hintProperties = new Output.SpeechProperties(); hintProperties['delay'] = true;
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/api.js b/chrome/browser/resources/chromeos/chromevox/cvox2/injected/api.js similarity index 100% rename from chrome/browser/resources/chromeos/chromevox/chromevox/injected/api.js rename to chrome/browser/resources/chromeos/chromevox/cvox2/injected/api.js
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/api_implementation.js b/chrome/browser/resources/chromeos/chromevox/cvox2/injected/api_implementation.js similarity index 100% rename from chrome/browser/resources/chromeos/chromevox/chromevox/injected/api_implementation.js rename to chrome/browser/resources/chromeos/chromevox/cvox2/injected/api_implementation.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/injected/keyboard_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/injected/keyboard_handler.js deleted file mode 100644 index 6caf89a..0000000 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/injected/keyboard_handler.js +++ /dev/null
@@ -1,56 +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. - -/** - * @fileoverview A minimal keyboard handler. - */ - -goog.provide('KeyboardHandler'); - -// Implicit dependency on cvox.ChromeVoxKbHandler; cannot include here because -// ChromeVoxKbHandler redefines members. - -/** - * @constructor - */ -KeyboardHandler = function() { - cvox.ChromeVoxKbHandler.commandHandler = this.handleCommand_.bind(this); - cvox.ChromeVoxKbHandler.handlerKeyMap = cvox.KeyMap.fromNext(); - document.addEventListener('keydown', this.handleKeyDown_.bind(this), false); - - // Register for Classic pref changes to get sticky mode state. - cvox.ExtensionBridge.addMessageListener(function(msg) { - if (msg['prefs']) { - var prefs = msg['prefs']; - cvox.ChromeVox.isStickyPrefOn = prefs['sticky'] == 'true'; - } - }); - - // Make the initial request for prefs. - cvox.ExtensionBridge.send({'target': 'Prefs', 'action': 'getPrefs'}); -}; - -KeyboardHandler.prototype = { - /** - * @param {Event} evt - * @private - */ - handleKeyDown_: function(evt) { - cvox.ExtensionBridge.send( - {'target': 'next', 'action': 'flushNextUtterance'}); - - evt.stickyMode = cvox.ChromeVox.isStickyPrefOn; - - cvox.ChromeVoxKbHandler.basicKeyDownActionsListener(evt); - }, - - /** - * @param {string} command - * @private - */ - handleCommand_: function(command) { - cvox.ExtensionBridge.send( - {'target': 'next', 'action': 'onCommand', 'command': command}); - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/injected/loader.js b/chrome/browser/resources/chromeos/chromevox/cvox2/injected/loader.js index 911a905..90913c0 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/injected/loader.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/injected/loader.js
@@ -3,28 +3,12 @@ // found in the LICENSE file. goog.require('cvox.ApiImplementation'); -goog.require('KeyboardHandler'); /** * Initializes minimal content script. */ function initMin() { - if (cvox.ChromeVox.isChromeOS) { - cvox.ApiImplementation.init(); - return; - } - - if (cvox.ChromeVox.isClassicEnabled_ === undefined) { - window.setTimeout(function() { - initMin(); - }, 500); - return; - } - - if (cvox.ChromeVox.isClassicEnabled_) - return; - - new KeyboardHandler(); + cvox.ApiImplementation.init(); } initMin();
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/script_installer.js b/chrome/browser/resources/chromeos/chromevox/cvox2/injected/script_installer.js similarity index 100% rename from chrome/browser/resources/chromeos/chromevox/chromevox/injected/script_installer.js rename to chrome/browser/resources/chromeos/chromevox/cvox2/injected/script_installer.js
diff --git a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/abstract_result.js b/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/abstract_result.js deleted file mode 100644 index 017425e..0000000 --- a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/abstract_result.js +++ /dev/null
@@ -1,51 +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. - - -/** - * @fileoverview Defines a result type interface. - */ - -goog.provide('cvox.AbstractResult'); - -goog.require('cvox.SearchUtil'); - -/** - * @constructor - */ -cvox.AbstractResult = function() {}; - -/** - * Checks the result if it is an unknown result. - * @param {Element} result Result to be checked. - * @return {boolean} Whether or not the element is an unknown result. - */ -cvox.AbstractResult.prototype.isType = function(result) { - return false; -}; - -/** - * Speak a generic search result. - * @param {Node} result Generic result to be spoken. - * @return {boolean} Whether or not the result was spoken. - */ -cvox.AbstractResult.prototype.speak = function(result) { - return false; -}; - -/** - * Extracts the wikipedia URL from knowledge panel. - * @param {Node} result Result to extract from. - * @return {?string} URL. - */ -cvox.AbstractResult.prototype.getURL = cvox.SearchUtil.extractURL; - -/** - * Returns the node to sync to. - * @param {Node} result Result. - * @return {?Node} Node to sync to. - */ -cvox.AbstractResult.prototype.getSyncNode = function(result) { - return result; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/constants.js b/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/constants.js deleted file mode 100644 index ee740f0..0000000 --- a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/constants.js +++ /dev/null
@@ -1,29 +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. - - -/** - * @fileoverview Constants for Search. - */ - -goog.provide('cvox.SearchConstants'); - -/** - * @constructor - */ -cvox.SearchConstants = function() {}; - -/** - * Keycodes. - */ -cvox.SearchConstants.KeyCode = { - UP: 38, - DOWN: 40, - PAGE_UP: 33, - PAGE_DOWN: 34, - LEFT: 37, - RIGHT: 39, - ENTER: 13, - ESC: 27 -};
diff --git a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/context_menu.js b/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/context_menu.js deleted file mode 100644 index a422744..0000000 --- a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/context_menu.js +++ /dev/null
@@ -1,136 +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. - - -/** - * @fileoverview Context Menu for Search. - */ - -goog.provide('cvox.SearchContextMenu'); - -goog.require('cvox.ChromeVoxKbHandler'); -goog.require('cvox.KeySequence'); -goog.require('cvox.Search'); -goog.require('cvox.SearchTool'); - -/** - * @constructor - */ -cvox.SearchContextMenu = function() {}; - -/* Globals */ -var Command = {TOOLS: 'tools', ADS: 'ads', MAIN: 'main'}; - -/** - * Current focus Search is in. - */ -cvox.SearchContextMenu.currState = Command.MAIN; - -/** - * Handles context menu events. - * @param {Event} evt Event received. - */ -cvox.SearchContextMenu.contextMenuHandler = function(evt) { - var cmd = evt.detail['customCommand']; - switch (cmd) { - case Command.TOOLS: - cvox.SearchContextMenu.focusTools(); - break; - - case Command.ADS: - cvox.SearchContextMenu.focusAds(); - break; - - case Command.MAIN: - cvox.SearchContextMenu.focusMain(); - break; - } -}; - -/** - * Handles key events. - * @param {Event} evt Event received. - * @return {boolean} True if key was handled, false otherwise. - */ -cvox.SearchContextMenu.keyhandler = function(evt) { - var ret = false; - var keySeq = new cvox.KeySequence(evt); - var command = cvox.ChromeVoxKbHandler.handlerKeyMap.commandForKey(keySeq); - /* Handle if just default action. */ - if (!command || command === 'performDefaultAction') { - switch (cvox.SearchContextMenu.currState) { - case Command.TOOLS: - ret = cvox.SearchTool.keyhandler(evt); - break; - case Command.ADS: - case Command.MAIN: - ret = cvox.Search.keyhandler(evt); - break; - } - } - return ret; -}; - -/** - * Switch to main search results focus. - */ -cvox.SearchContextMenu.focusMain = function() { - if (cvox.SearchContextMenu.currState === Command.TOOLS) { - cvox.SearchTool.toggleMenu(); - } - cvox.Search.populateResults(); - cvox.Search.index = 0; - cvox.Search.syncToIndex(); - cvox.SearchContextMenu.currState = Command.MAIN; -}; - -/** - * Switch to ads focus. - */ -cvox.SearchContextMenu.focusAds = function() { - cvox.Search.populateAdResults(); - if (cvox.Search.results.length === 0) { - cvox.SearchContextMenu.focusMain(); - return; - } - cvox.Search.index = 0; - cvox.Search.syncToIndex(); - - if (cvox.SearchContextMenu.currState === Command.TOOLS) { - cvox.SearchTool.toggleMenu(); - } - - cvox.SearchContextMenu.currState = Command.ADS; -}; - -/** - * Switch to tools focus. - */ -cvox.SearchContextMenu.focusTools = function() { - if (cvox.SearchContextMenu.currState !== Command.TOOLS) { - cvox.SearchTool.activateTools(); - cvox.SearchContextMenu.currState = Command.TOOLS; - } -}; - -/** - * Initializes the context menu. - */ -cvox.SearchContextMenu.init = function() { - var ACTIONS = [ - {desc: 'Main Results', cmd: Command.MAIN}, - {desc: 'Search Tools', cmd: Command.TOOLS}, - {desc: 'Ads', cmd: Command.ADS} - ]; - /* Attach ContextMenuActions. */ - var body = document.querySelector('body'); - body.setAttribute('contextMenuActions', JSON.stringify(ACTIONS)); - - /* Listen for ContextMenu events. */ - body.addEventListener( - 'ATCustomEvent', cvox.SearchContextMenu.contextMenuHandler, true); - - window.addEventListener('keydown', cvox.SearchContextMenu.keyhandler, true); - cvox.Search.init(); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/loader.js b/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/loader.js deleted file mode 100644 index da819da..0000000 --- a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/loader.js +++ /dev/null
@@ -1,47 +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. - - -goog.provide('cvox.SearchLoader'); -goog.require('cvox.SearchContextMenu'); - -/** - * @fileoverview Inject the script into the page. - */ - -/** - * @constructor - */ -cvox.SearchLoader = function() {}; - -/** - * Called when document ready state changes. - */ -cvox.SearchLoader.onReadyStateChange = function() { - /* Make sure document is complete. Loading base.js when the document is - * loading will destroy the DOM. */ - if (document.readyState !== 'complete') { - return; - } - var GOOGLE_HOST = 'www.google.com'; - var SEARCH_PATH = '/search'; - - if (window.location.host !== GOOGLE_HOST || - window.location.pathname !== SEARCH_PATH) { - return; - } - - cvox.SearchContextMenu.init(); -}; - -/** - * Inject Search into the page. - */ -cvox.SearchLoader.init = function() { - if (document.readyState !== 'complete') { - document.onreadystatechange = cvox.SearchLoader.onReadyStateChange; - } else { - cvox.SearchLoader.onReadyStateChange(); - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/results.js b/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/results.js deleted file mode 100644 index 7747a66e..0000000 --- a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/results.js +++ /dev/null
@@ -1,410 +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. - - -/** - * @fileoverview Provides different rules for each type of result. - */ - -goog.provide('cvox.SearchResults'); -goog.provide('cvox.UnknownResult'); - -goog.require('cvox.AbstractResult'); -goog.require('cvox.ChromeVox'); -goog.require('cvox.SearchUtil'); - -/** - * @constructor - */ -cvox.SearchResults = function() {}; - -/** - * Speaks a result based on given selectors. - * @param {Node} result Search result to be spoken. - * @param {Array} selectTexts Array of selectors or text to speak. - */ -cvox.SearchResults.speakResultBySelectTexts = function(result, selectTexts) { - for (var j = 0; j < selectTexts.length; j++) { - var selectText = selectTexts[j]; - if (selectText.select) { - var elems = result.querySelectorAll(selectText.select); - for (var i = 0; i < elems.length; i++) { - cvox.ChromeVox.tts.speak( - cvox.DomUtil.getName(elems.item(i)), cvox.QueueMode.QUEUE); - } - } - if (selectText.text) { - cvox.ChromeVox.tts.speak(selectText.text, cvox.QueueMode.QUEUE); - } - } -}; - -/** - * Unknown Result Type. This is used if we don't know what to do. - * @constructor - * @extends {cvox.AbstractResult} - */ -cvox.UnknownResult = function() {}; -goog.inherits(cvox.UnknownResult, cvox.AbstractResult); - -/* Normal Result Type. */ -/** - * @constructor - * @extends {cvox.AbstractResult} - */ -cvox.NormalResult = function() {}; -goog.inherits(cvox.NormalResult, cvox.AbstractResult); - -/** - * Checks the result if it is a normal result. - * @override - */ -cvox.NormalResult.prototype.isType = function(result) { - var NORMAL_SELECT = '.rc'; - return result.querySelector(NORMAL_SELECT) !== null; -}; - -/** - * Speak a normal search result. - * @override - */ -cvox.NormalResult.prototype.speak = function(result) { - if (!result) { - return false; - } - var NORMAL_TITLE_SELECT = '.rc .r'; - var NORMAL_URL_SELECT = '.kv'; - var NORMAL_DESC_SELECT = '.rc .st'; - var SITE_LINK_SELECT = '.osl'; - var MORE_RESULTS_SELECT = '.sld'; - var MORE_RESULTS_LINK_SELECT = '.mrf'; - - var NORMAL_SELECTORS = [ - {select: NORMAL_TITLE_SELECT}, {select: NORMAL_DESC_SELECT}, - {select: NORMAL_URL_SELECT}, {select: SITE_LINK_SELECT}, - {select: MORE_RESULTS_SELECT}, {select: MORE_RESULTS_LINK_SELECT} - ]; - cvox.SearchResults.speakResultBySelectTexts(result, NORMAL_SELECTORS); - - var DISCUSS_TITLE_SELECT = '.mas-1st-col div'; - var DISCUSS_DATE_SELECT = '.mas-col div'; - var discussTitles = result.querySelectorAll(DISCUSS_TITLE_SELECT); - var discussDates = result.querySelectorAll(DISCUSS_DATE_SELECT); - for (var i = 0; i < discussTitles.length; i++) { - cvox.ChromeVox.tts.speak( - cvox.DomUtil.getName(discussTitles.item(i)), cvox.QueueMode.QUEUE); - cvox.ChromeVox.tts.speak( - cvox.DomUtil.getName(discussDates.item(i)), cvox.QueueMode.QUEUE); - } - return true; -}; - -/* Weather Result */ -/** - * @constructor - * @extends {cvox.AbstractResult} - */ -cvox.WeatherResult = function() {}; -goog.inherits(cvox.WeatherResult, cvox.AbstractResult); - -/** - * Checks the result if it is a weather result. - * @override - */ -cvox.WeatherResult.prototype.isType = function(result) { - var WEATHER_SELECT = '#wob_wc'; - return result.querySelector(WEATHER_SELECT) !== null; -}; - -/** - * Speak a weather forecast. - * @param {Element} forecast Weather forecast to be spoken. - */ -cvox.WeatherResult.speakForecast = function(forecast) { - if (!forecast) { - return; - } - var FORE_DAY_SELECT = '.vk_lgy'; - var FORE_COND_SELECT = 'img'; - var FORE_HIGH_SELECT = '.vk_gy'; - var FORE_LOW_SELECT = '.vk_lgy'; - - var FORE_SELECTORS = [ - {select: FORE_DAY_SELECT}, {select: FORE_COND_SELECT}, - {select: FORE_HIGH_SELECT}, {select: FORE_LOW_SELECT} - ]; - cvox.SearchResults.speakResultBySelectTexts(forecast, FORE_SELECTORS); -}; - -/** - * Speak a weather search result. - * @override - */ -cvox.WeatherResult.prototype.speak = function(result) { - if (!result) { - return false; - } - /* TODO(peterxiao): Internationalization? */ - var WEATHER_INTRO = 'The weather forcast for'; - var WEATHER_TEMP_UNITS = 'degrees fahrenheit'; - var WEATHER_PREC_INTRO = 'precipitation is'; - var WEATHER_HUMID_INTRO = 'humidity is'; - var WEATHER_WIND_INTRO = 'wind is'; - var FORE_INTRO = 'Forecasts for this week'; - var WEATHER_LOC_SELECT = '.vk_h'; - var WEATHER_WHEN_SELECT = '#wob_dts'; - var WEATHER_COND_SELECT = '#wob_dc'; - var WEATHER_TEMP_SELECT = '#wob_tm'; - var WEATHER_PREC_SELECT = '#wob_pp'; - var WEATHER_HUMID_SELECT = '#wob_hm'; - var WEATHER_WIND_SELECT = '#wob_ws'; - - var WEATHER_SELECT_TEXTS = [ - {text: WEATHER_INTRO}, {select: WEATHER_LOC_SELECT}, - {select: WEATHER_WHEN_SELECT}, {select: WEATHER_COND_SELECT}, - {select: WEATHER_TEMP_SELECT}, {text: WEATHER_TEMP_UNITS}, - {text: WEATHER_PREC_INTRO}, {select: WEATHER_PREC_SELECT}, - {text: WEATHER_HUMID_INTRO}, {select: WEATHER_HUMID_SELECT}, - {text: WEATHER_WIND_INTRO}, {select: WEATHER_WIND_SELECT} - ]; - cvox.SearchResults.speakResultBySelectTexts(result, WEATHER_SELECT_TEXTS); - - var WEATHER_FORCAST_CLASS = 'wob_df'; - var forecasts = result.getElementsByClassName(WEATHER_FORCAST_CLASS); - cvox.ChromeVox.tts.speak(FORE_INTRO, cvox.QueueMode.QUEUE); - for (var i = 0; i < forecasts.length; i++) { - var forecast = forecasts.item(i); - cvox.WeatherResult.speakForecast(forecast); - } - return true; -}; - -/* Knowledge Panel Result */ -/** - * @constructor - * @extends {cvox.AbstractResult} - */ -cvox.KnowResult = function() {}; -goog.inherits(cvox.KnowResult, cvox.AbstractResult); - -/** - * Checks the result if it is a know result. - * @override - */ -cvox.KnowResult.prototype.isType = function(result) { - var KNOP_SELECT = '.kno-ec'; - return result.querySelector(KNOP_SELECT) !== null; -}; - -/** - * Speak a knowledge panel search result. - * @override - */ -cvox.KnowResult.prototype.speak = function(result) { - - cvox.ChromeVox.tts.speak(cvox.DomUtil.getName(result), cvox.QueueMode.QUEUE); - return true; -}; - -/** - * Extracts the wikipedia URL from knowledge panel. - * @override - */ -cvox.KnowResult.prototype.getURL = function(result) { - var LINK_SELECTOR = '.q'; - return cvox.SearchUtil.extractURL(result.querySelector(LINK_SELECTOR)); -}; - -/** - * @override - */ -cvox.KnowResult.prototype.getSyncNode = function(result) { - var HEADER_SELECTOR = '.kno-ecr-pt'; - return result.querySelector(HEADER_SELECTOR); -}; - -/* Calculator Type */ -/** - * @constructor - * @extends {cvox.AbstractResult} - */ -cvox.CalcResult = function() {}; -goog.inherits(cvox.CalcResult, cvox.AbstractResult); - -/** - * Checks the result if it is a calculator result. - * @override - */ -cvox.CalcResult.prototype.isType = function(result) { - var CALC_SELECT = '#cwmcwd'; - return result.querySelector(CALC_SELECT) !== null; -}; - -/** - * Speak a calculator search result. - * @override - */ -cvox.CalcResult.prototype.speak = function(result) { - if (!result) { - return false; - } - var CALC_QUERY_SELECT = '#cwles'; - var CALC_RESULT_SELECT = '#cwos'; - var CALC_SELECTORS = - [{select: CALC_QUERY_SELECT}, {select: CALC_RESULT_SELECT}]; - cvox.SearchResults.speakResultBySelectTexts(result, CALC_SELECTORS); - return true; -}; - -/* Game Type */ -/** - * @constructor - * @extends {cvox.AbstractResult} - */ -cvox.GameResult = function() {}; -goog.inherits(cvox.GameResult, cvox.AbstractResult); - -/** - * Checks the result if it is a game result. - * @override - */ -cvox.GameResult.prototype.isType = function(result) { - var GAME_SELECT = '.xpdbox'; - return result.querySelector(GAME_SELECT) !== null; -}; - -/* Image Type */ -/** - * @constructor - * @extends {cvox.AbstractResult} - */ -cvox.ImageResult = function() {}; -goog.inherits(cvox.ImageResult, cvox.AbstractResult); - -/** - * Checks the result if it is a image result. - * @override - */ -cvox.ImageResult.prototype.isType = function(result) { - var IMAGE_CLASSES = 'rg_di'; - return result.className === IMAGE_CLASSES; -}; - -/** - * Speak an image result. - * @override - */ -cvox.ImageResult.prototype.speak = function(result) { - if (!result) { - return false; - } - /* Grab image result metadata. */ - var META_CLASS = 'rg_meta'; - var metaDiv = result.querySelector('.' + META_CLASS); - var metaJSON = metaDiv.innerHTML; - var metaData = JSON.parse(metaJSON); - - var imageSelectTexts = []; - - var filename = metaData['fn']; - if (filename) { - imageSelectTexts.push({text: filename}); - } - - var rawDimensions = metaData['is']; - if (rawDimensions) { - /* Dimensions contain HTML codes, so we convert them. */ - var tmpDiv = document.createElement('div'); - tmpDiv.innerHTML = rawDimensions; - var dimensions = tmpDiv.textContent || tmpDiv.innerText; - imageSelectTexts.push({text: dimensions}); - } - - var url = metaData['isu']; - if (url) { - imageSelectTexts.push({text: url}); - } - cvox.SearchResults.speakResultBySelectTexts(result, imageSelectTexts); - return true; -}; - -/* Category Result */ -/** - * @constructor - * @extends {cvox.AbstractResult} - */ -cvox.CategoryResult = function() {}; -goog.inherits(cvox.CategoryResult, cvox.AbstractResult); - -/** - * Checks the result if it is a category result. - * @param {Element} result Result to be checked. - * @return {boolean} Whether or not the element is a category result. - * @override - */ -cvox.CategoryResult.prototype.isType = function(result) { - var CATEGORY_CLASSES = 'rg_fbl nj'; - return result.className === CATEGORY_CLASSES; -}; - -/** - * Speak a category result. - * @override - */ -cvox.CategoryResult.prototype.speak = function(result) { - if (!result) { - return false; - } - var LABEL_SELECT = '.rg_bb_label'; - var label = result.querySelector(LABEL_SELECT); - - cvox.ChromeVox.tts.speak(cvox.DomUtil.getName(label), cvox.QueueMode.QUEUE); - return true; -}; - -/* Ad Result */ -/** - * @constructor - * @extends {cvox.AbstractResult} - */ -cvox.AdResult = function() {}; -goog.inherits(cvox.AdResult, cvox.AbstractResult); - -/** - * Checks the result if it is an ad result. - * @override - */ -cvox.AdResult.prototype.isType = function(result) { - var ADS_CLASS = 'ads-ad'; - return result.className === ADS_CLASS; -}; - -/** - * Speak an ad result. - * @override - */ -cvox.AdResult.prototype.speak = function(result) { - if (!result) { - return false; - } - var HEADER_SELECT = 'h3'; - var DESC_SELECT = '.ads-creative'; - var URL_SELECT = '.ads-visurl'; - var AD_SELECTS = - [{select: HEADER_SELECT}, {select: DESC_SELECT}, {select: URL_SELECT}]; - cvox.SearchResults.speakResultBySelectTexts(result, AD_SELECTS); - return true; -}; - -/** - * To add new result types, create a new object with the following properties: - * isType: Function to indicate if an element is the object's type. - * speak: Function that takes in a result and speaks the type to the user. - * getURL: Function that takes in a result and extracts the URL to follow. - */ -cvox.SearchResults.RESULT_TYPES = [ - cvox.UnknownResult, cvox.NormalResult, cvox.KnowResult, cvox.WeatherResult, - cvox.AdResult, cvox.CalcResult, cvox.GameResult, cvox.ImageResult, - cvox.CategoryResult -];
diff --git a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/search.js b/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/search.js deleted file mode 100644 index bca762c..0000000 --- a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/search.js +++ /dev/null
@@ -1,440 +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. - - -/** - * @fileoverview Uses ChromeVox API to enhance the search experience. - */ - -goog.provide('cvox.Search'); - -goog.require('cvox.ChromeVox'); -goog.require('cvox.SearchConstants'); -goog.require('cvox.SearchResults'); -goog.require('cvox.SearchUtil'); -goog.require('cvox.UnknownResult'); - -/** - * @constructor - */ -cvox.Search = function() {}; - -/** - * Selectors to match results. - * @type {Object<string>} - */ -cvox.Search.selectors = {}; - -/** - * Selectors for web results. - */ -cvox.Search.webSelectors = { - /* Topstuff typically contains important messages to be added first. */ - TOPSTUFF_SELECT: '#topstuff', - SPELL_SUGG_SELECT: '.ssp', - SPELL_CORRECTION_SELECT: '.sp_cnt', - KNOW_PANEL_SELECT: '.knop', - RESULT_SELECT: '.g', - RELATED_SELECT: '#brs' -}; - -/** - * Selectors for image results. - */ -cvox.Search.imageSelectors = { - IMAGE_CATEGORIES_SELECT: '#ifbc .rg_fbl', - IMAGE_RESULT_SELECT: '#rg_s .rg_di' -}; - -/** - * Index of the currently synced result. - * @type {number} - */ -cvox.Search.index; - -/** - * Array of the search results. - * @type {Array<Node>} - */ -cvox.Search.results = []; - -/** - * Array of the navigation panes. - * @type {Array<Element>} - */ -cvox.Search.panes = []; - -/** - * Index of the currently synced pane. - * @type {number} - */ -cvox.Search.paneIndex; - -/** - * If currently synced item is a pane. - */ -cvox.Search.isPane = false; - -/** - * Class of a selected pane. - */ -cvox.Search.SELECTED_PANE_CLASS = 'hdtb_mitem hdtb_msel'; - - -/** - * Speak and sync. - * @private - */ -cvox.Search.speakSync_ = function() { - var result = cvox.Search.results[cvox.Search.index]; - var resultType = cvox.Search.getResultType(result); - var isSpoken = resultType.speak(result); - cvox.ChromeVox.syncToNode(resultType.getSyncNode(result), !isSpoken); - cvox.Search.isPane = false; -}; - -/** - * Sync the search result index to ChromeVox. - */ -cvox.Search.syncToIndex = function() { - cvox.ChromeVox.tts.stop(); - var prop = {endCallback: cvox.Search.speakSync_}; - if (cvox.Search.index === 0) { - cvox.ChromeVox.tts.speak('First result', cvox.QueueMode.QUEUE, prop); - } else if (cvox.Search.index === cvox.Search.results.length - 1) { - cvox.ChromeVox.tts.speak('Last result', cvox.QueueMode.QUEUE, prop); - } else { - cvox.Search.speakSync_(); - } -}; - -/** - * Sync the current pane index to ChromeVox. - */ -cvox.Search.syncPaneToIndex = function() { - var pane = cvox.Search.panes[cvox.Search.paneIndex]; - var anchor = pane.querySelector('a'); - if (anchor) { - cvox.ChromeVox.syncToNode(anchor, true); - } else { - cvox.ChromeVox.syncToNode(pane, true); - } - cvox.Search.isPane = true; -}; - -/** - * Get the type of the result such as Knowledge Panel, Weather, etc. - * @param {Node} result Result to be classified. - * @return {cvox.AbstractResult} Type of the result. - */ -cvox.Search.getResultType = function(result) { - for (var i = 0; i < cvox.SearchResults.RESULT_TYPES.length; i++) { - var resultType = new cvox.SearchResults.RESULT_TYPES[i](); - if (resultType.isType(result)) { - return resultType; - } - } - return new cvox.UnknownResult(); -}; - -/** - * Get the page number associated with the url. - * @param {string} url Url of search page. - * @return {number} Page number. - */ -cvox.Search.getPageNumber = function(url) { - var PAGE_ANCHOR_SELECTOR = '#nav .fl'; - var pageAnchors = document.querySelectorAll(PAGE_ANCHOR_SELECTOR); - for (var i = 0; i < pageAnchors.length; i++) { - var pageAnchor = pageAnchors.item(i); - if (pageAnchor.href === url) { - return parseInt(pageAnchor.innerText, 10); - } - } - return NaN; -}; - -/** - * Navigate to the next / previous page. - * @param {boolean} next True for the next page, false for the previous. - */ -cvox.Search.navigatePage = function(next) { - /* NavEnd contains previous / next page links. */ - var NAV_END_CLASS = 'navend'; - var navEnds = document.getElementsByClassName(NAV_END_CLASS); - var navEnd = next ? navEnds[1] : navEnds[0]; - var url = cvox.SearchUtil.extractURL(navEnd); - var navToUrl = function() { - window.location = url; - }; - var prop = {endCallback: navToUrl}; - if (url) { - var pageNumber = cvox.Search.getPageNumber(url); - if (!isNaN(pageNumber)) { - cvox.ChromeVox.tts.speak( - 'Page ' + pageNumber, cvox.QueueMode.FLUSH, prop); - } else { - cvox.ChromeVox.tts.speak('Unknown page.', cvox.QueueMode.FLUSH, prop); - } - } -}; - -/** - * Navigates to the currently synced pane. - */ -cvox.Search.goToPane = function() { - var pane = cvox.Search.panes[cvox.Search.paneIndex]; - if (pane.className === cvox.Search.SELECTED_PANE_CLASS) { - cvox.ChromeVox.tts.speak( - 'You are already on that page.', cvox.QueueMode.QUEUE); - return; - } - var anchor = pane.querySelector('a'); - cvox.ChromeVox.tts.speak(anchor.textContent, cvox.QueueMode.QUEUE); - var url = cvox.SearchUtil.extractURL(pane); - if (url) { - window.location = url; - } -}; - -/** - * Follow the link to the current result. - */ -cvox.Search.goToResult = function() { - var result = cvox.Search.results[cvox.Search.index]; - var resultType = cvox.Search.getResultType(result); - var url = resultType.getURL(result); - if (url) { - window.location = url; - } -}; - -/** - * Handle the keyboard. - * @param {Event} evt Keydown event. - * @return {boolean} True if key was handled, false otherwise. - */ -cvox.Search.keyhandler = function(evt) { - var SEARCH_INPUT_ID = 'gbqfq'; - var searchInput = document.getElementById(SEARCH_INPUT_ID); - var result = cvox.Search.results[cvox.Search.index]; - var ret = false; - - /* TODO(peterxiao): Add cvox api call to determine cvox key. */ - if (evt.shiftKey || evt.altKey || evt.ctrlKey) { - return false; - } - - /* Do not handle if search input has focus, or if the search widget - * has focus. - */ - if (document.activeElement !== searchInput && - !cvox.SearchUtil.isSearchWidgetActive()) { - switch (evt.keyCode) { - case cvox.SearchConstants.KeyCode.UP: - /* Add results.length because JS Modulo is silly. */ - cvox.Search.index = cvox.SearchUtil.subOneWrap( - cvox.Search.index, cvox.Search.results.length); - if (cvox.Search.index === cvox.Search.results.length - 1) { - cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.WRAP); - } - cvox.Search.syncToIndex(); - break; - - case cvox.SearchConstants.KeyCode.DOWN: - cvox.Search.index = cvox.SearchUtil.addOneWrap( - cvox.Search.index, cvox.Search.results.length); - if (cvox.Search.index === 0) { - cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.WRAP); - } - cvox.Search.syncToIndex(); - break; - - case cvox.SearchConstants.KeyCode.PAGE_UP: - cvox.Search.navigatePage(false); - break; - - case cvox.SearchConstants.KeyCode.PAGE_DOWN: - cvox.Search.navigatePage(true); - break; - - case cvox.SearchConstants.KeyCode.LEFT: - cvox.Search.paneIndex = cvox.SearchUtil.subOneWrap( - cvox.Search.paneIndex, cvox.Search.panes.length); - cvox.Search.syncPaneToIndex(); - break; - - case cvox.SearchConstants.KeyCode.RIGHT: - cvox.Search.paneIndex = cvox.SearchUtil.addOneWrap( - cvox.Search.paneIndex, cvox.Search.panes.length); - cvox.Search.syncPaneToIndex(); - break; - - case cvox.SearchConstants.KeyCode.ENTER: - if (cvox.Search.isPane) { - cvox.Search.goToPane(); - } else { - cvox.Search.goToResult(); - } - break; - - default: - return false; - } - evt.preventDefault(); - evt.stopPropagation(); - return true; - } - return false; -}; - -/** - * Adds the elements that match the selector to results. - * @param {string} selector Selector of element to add. - */ -cvox.Search.addToResultsBySelector = function(selector) { - var nodes = document.querySelectorAll(selector); - for (var i = 0; i < nodes.length; i++) { - var node = nodes.item(i); - /* Do not add if empty. */ - if (node.innerHTML !== '') { - cvox.Search.results.push(nodes.item(i)); - } - } -}; - -/** - * Populates the panes array. - */ -cvox.Search.populatePanes = function() { - cvox.Search.panes = []; - var PANE_SELECT = '.hdtb_mitem'; - var paneElems = document.querySelectorAll(PANE_SELECT); - for (var i = 0; i < paneElems.length; i++) { - cvox.Search.panes.push(paneElems.item(i)); - } -}; - -/** - * Populates the results with results. - */ -cvox.Search.populateResults = function() { - for (var prop in cvox.Search.selectors) { - cvox.Search.addToResultsBySelector(cvox.Search.selectors[prop]); - } -}; - -/** - * Populates the results with ad results. - */ -cvox.Search.populateAdResults = function() { - cvox.Search.results = []; - var ADS_SELECT = '.ads-ad'; - cvox.Search.addToResultsBySelector(ADS_SELECT); -}; - -/** - * Observes mutations and updates results accordingly. - */ -cvox.Search.observeMutation = function() { - var SEARCH_AREA_SELECT = '#rg_s'; - var target = document.querySelector(SEARCH_AREA_SELECT); - - var observer = new MutationObserver(function(mutations) { - cvox.Search.results = []; - cvox.Search.populateResults(); - }); - - var config = - /** @type MutationObserverInit */ - ({attributes: true, childList: true, characterData: true}); - observer.observe(target, config); -}; - -/** - * Get the current selected pane's index. - * @return {number} Index of selected pane. - */ -cvox.Search.getSelectedPaneIndex = function() { - var panes = cvox.Search.panes; - for (var i = 0; i < panes.length; i++) { - if (panes[i].className === cvox.Search.SELECTED_PANE_CLASS) { - return i; - } - } - return 0; -}; - -/** - * Get the ancestor of node that is a result. - * @param {Node} node Node. - * @return {Node} Result ancestor. - */ -cvox.Search.getAncestorResult = function(node) { - var curr = node; - while (curr) { - for (var prop in cvox.Search.selectors) { - var selector = cvox.Search.selectors[prop]; - if (curr.webkitMatchesSelector && curr.webkitMatchesSelector(selector)) { - return curr; - } - } - curr = curr.parentNode; - } - return null; -}; - -/** - * Sync to the correct initial node. - */ -cvox.Search.initialSync = function() { - var currNode = cvox.ChromeVox.navigationManager.getCurrentNode(); - var result = cvox.Search.getAncestorResult(currNode); - cvox.Search.index = cvox.Search.results.indexOf(result); - if (cvox.Search.index === -1) { - cvox.Search.index = 0; - } - - if (cvox.Search.results.length > 0) { - cvox.Search.syncToIndex(); - } -}; - -/** - * Initialize Search. - */ -cvox.Search.init = function() { - cvox.Search.index = 0; - - /* Flush out anything that may have been speaking. */ - cvox.ChromeVox.tts.stop(); - - /* Determine the type of search. */ - var SELECTED_CLASS = 'hdtb-msel'; - var selected = document.getElementsByClassName(SELECTED_CLASS)[0]; - if (!selected) { - return; - } - - var selectedHTML = selected.innerHTML; - switch (selectedHTML) { - case 'Web': - case 'News': - cvox.Search.selectors = cvox.Search.webSelectors; - break; - case 'Images': - cvox.Search.selectors = cvox.Search.imageSelectors; - cvox.Search.observeMutation(); - break; - default: - return; - } - - cvox.Search.populateResults(); - cvox.Search.populatePanes(); - cvox.Search.paneIndex = cvox.Search.getSelectedPaneIndex(); - - cvox.Search.initialSync(); - -};
diff --git a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/search_tools.js b/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/search_tools.js deleted file mode 100644 index 1d94c1e..0000000 --- a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/search_tools.js +++ /dev/null
@@ -1,207 +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. - - -/** - * @fileoverview Uses ChromeVox API to access the search tools menu. - */ - -goog.provide('cvox.SearchTool'); - -goog.require('cvox.ChromeVox'); -goog.require('cvox.DomUtil'); -goog.require('cvox.Search'); -goog.require('cvox.SearchConstants'); -goog.require('cvox.SearchUtil'); - -/** - * @constructor - */ -cvox.SearchTool = function() {}; - -/** - * Index of the current menu in focus. - * @type {number} - */ -cvox.SearchTool.menuIndex; - -/** - * Array of menus. - * @type {Array<Node>} - */ -cvox.SearchTool.menus = []; - -/** - * Index of the current menu item in focus. - * @type {number} - */ -cvox.SearchTool.menuItemIndex; - -/** - * Array of menu items for the current menu. - * @type {Array<Node>} - */ -cvox.SearchTool.menuItems = []; - -/** - * Id of the clear button. - * @type {string} - */ -cvox.SearchTool.CLEAR_ID = 'hdtb_rst'; - -/** - * Toggles a menu open / close by simulating a click. - */ -cvox.SearchTool.toggleMenu = function() { - var menu = cvox.SearchTool.menus[cvox.SearchTool.menuIndex]; - var menuDiv = menu.previousSibling; - cvox.DomUtil.clickElem(menuDiv, false, false, false); -}; - -/** - * Syncs the first item in the current menu to ChromeVox. - */ -cvox.SearchTool.syncToMenu = function() { - cvox.SearchTool.menuItemIndex = 0; - cvox.SearchTool.toggleMenu(); - cvox.SearchTool.populateMenuItems(); - cvox.SearchTool.syncToMenuItem(); -}; - -/** - * Syncs the current menu item to ChromeVox. - */ -cvox.SearchTool.syncToMenuItem = function() { - var menuItem = cvox.SearchTool.menuItems[cvox.SearchTool.menuItemIndex]; - cvox.ChromeVox.syncToNode(menuItem, true); -}; - -/** - * Fills in menuItems with the current menu's items. - */ -cvox.SearchTool.populateMenuItems = function() { - var menu = cvox.SearchTool.menus[cvox.SearchTool.menuIndex]; - cvox.SearchTool.menuItems = []; - /* For now, we just special case on the clear button. */ - if (menu.id !== cvox.SearchTool.CLEAR_ID) { - var MENU_ITEM_SELECTOR = '.hdtbItm'; - var menuItemNodeList = menu.querySelectorAll(MENU_ITEM_SELECTOR); - for (var i = 0; i < menuItemNodeList.length; i++) { - cvox.SearchTool.menuItems.push(menuItemNodeList.item(i)); - } - } else { - cvox.SearchTool.menuItems = []; - cvox.SearchTool.menuItems.push(menu); - } -}; - -/** - * Fills in menus with the menus of the page. - */ -cvox.SearchTool.populateMenus = function() { - var MENU_SELECTOR = '.hdtbU'; - var menuDivs = document.querySelectorAll(MENU_SELECTOR); - for (var i = 0; i < menuDivs.length; i++) { - cvox.SearchTool.menus.push(menuDivs.item(i)); - } - - var clearDiv = document.getElementById(cvox.SearchTool.CLEAR_ID); - if (clearDiv) { - cvox.SearchTool.menus.push(clearDiv); - } -}; - -/** - * Switches focus to the tools interface, giving keyboard access. - */ -cvox.SearchTool.activateTools = function() { - var MENU_BAR_SELECTOR = '#hdtbMenus'; - var menuBar = document.querySelector(MENU_BAR_SELECTOR); - var MENUS_OPEN_CLASS = 'hdtb-td-o'; - menuBar.className = MENUS_OPEN_CLASS; - - cvox.SearchTool.populateMenus(); - cvox.SearchTool.menuIndex = 0; - cvox.SearchTool.syncToMenu(); -}; - -/** - * Goes to the link of the current menu item action. - */ -cvox.SearchTool.gotoMenuItem = function() { - var menuItem = cvox.SearchTool.menuItems[cvox.SearchTool.menuItemIndex]; - var LOCATION_INPUT_ID = '#lc-input'; - var input = menuItem.querySelector(LOCATION_INPUT_ID); - /* Special case for setting location. */ - if (input) { - input.focus(); - return; - } - - /* Custom Date Range. */ - var CDR_ID = 'cdr_opt'; - switch (menuItem.id) { - case cvox.SearchTool.CLEAR_ID: - window.location = menuItem.dataset.url; - break; - case CDR_ID: - var CDR_LINK_SELECTOR = '#cdrlnk'; - var cdrLink = menuItem.querySelector(CDR_LINK_SELECTOR); - cvox.DomUtil.clickElem(cdrLink, false, false, false); - cvox.SearchTool.toggleMenu(); - break; - default: - window.location = cvox.SearchUtil.extractURL(menuItem); - break; - } -}; - -/** - * Handles key events for the tools interface. - * @param {Event} evt Keydown event. - * @return {boolean} True if key was handled, false otherwise. - */ -cvox.SearchTool.keyhandler = function(evt) { - if (cvox.SearchUtil.isSearchWidgetActive()) { - return false; - } - - switch (evt.keyCode) { - case cvox.SearchConstants.KeyCode.UP: - cvox.SearchTool.menuItemIndex = cvox.SearchUtil.subOneWrap( - cvox.SearchTool.menuItemIndex, cvox.SearchTool.menuItems.length); - cvox.SearchTool.syncToMenuItem(); - break; - - case cvox.SearchConstants.KeyCode.DOWN: - cvox.SearchTool.menuItemIndex = cvox.SearchUtil.addOneWrap( - cvox.SearchTool.menuItemIndex, cvox.SearchTool.menuItems.length); - cvox.SearchTool.syncToMenuItem(); - break; - - case cvox.SearchConstants.KeyCode.LEFT: - cvox.SearchTool.toggleMenu(); - cvox.SearchTool.menuIndex = cvox.SearchUtil.subOneWrap( - cvox.SearchTool.menuIndex, cvox.SearchTool.menus.length); - cvox.SearchTool.syncToMenu(); - break; - - case cvox.SearchConstants.KeyCode.RIGHT: - cvox.SearchTool.toggleMenu(); - cvox.SearchTool.menuIndex = cvox.SearchUtil.addOneWrap( - cvox.SearchTool.menuIndex, cvox.SearchTool.menus.length); - cvox.SearchTool.syncToMenu(); - break; - - case cvox.SearchConstants.KeyCode.ENTER: - cvox.SearchTool.gotoMenuItem(); - break; - - default: - return false; - } - evt.preventDefault(); - evt.stopPropagation(); - return true; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/util.js b/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/util.js deleted file mode 100644 index 9d409c9..0000000 --- a/chrome/browser/resources/chromeos/chromevox/extensions/searchvox/util.js +++ /dev/null
@@ -1,189 +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. - - -/** - * @fileoverview Helper functions. - */ - -goog.provide('cvox.SearchUtil'); - -/** Utility functions. */ -cvox.SearchUtil = function() {}; - -/** - * Extracts the first URL from an element. - * @param {Node} node DOM element to extract from. - * @return {?string} URL. - */ -cvox.SearchUtil.extractURL = function(node) { - if (node) { - if (node.tagName === 'A') { - return node.href; - } - var anchor = node.querySelector('a'); - if (anchor) { - return anchor.href; - } - } - return null; -}; - -/** - * Indicates whether or not the search widget has been activated. - * @return {boolean} Whether or not the search widget is active. - */ -cvox.SearchUtil.isSearchWidgetActive = function() { - var SEARCH_WIDGET_SELECT = '#cvox-search'; - return document.querySelector(SEARCH_WIDGET_SELECT) !== null; -}; - -/** - * Adds one to and index with wrapping. - * @param {number} index Index to add to. - * @param {number} length Length to wrap at. - * @return {number} The new index++, wrapped if exceeding length. - */ -cvox.SearchUtil.addOneWrap = function(index, length) { - return (index + 1) % length; -}; - -/** - * Subtracts one to and index with wrapping. - * @param {number} index Index to subtract from. - * @param {number} length Length to wrap at. - * @return {number} The new index--, wrapped if below 0. - */ -cvox.SearchUtil.subOneWrap = function(index, length) { - return (index - 1 + length) % length; -}; - -/** - * Returns the id of a node's active descendant - * @param {Node} targetNode The node. - * @return {?string} The id of the active descendant. - * @private - */ -var getActiveDescendantId = function(targetNode) { - if (!targetNode.getAttribute) { - return null; - } - - var activeId = targetNode.getAttribute('aria-activedescendant'); - if (!activeId) { - return null; - } - return activeId; -}; - -/** - * If the node is an object with an active descendant, returns the - * descendant node. - * - * This function will fully resolve an active descendant chain. If a circular - * chain is detected, it will return null. - * - * @param {Node} targetNode The node to get descendant information for. - * @return {Node} The descendant node or null if no node exists. - */ -var getActiveDescendant = function(targetNode) { - var seenIds = {}; - var node = targetNode; - - while (node) { - var activeId = getActiveDescendantId(node); - if (!activeId) { - break; - } - if (activeId in seenIds) { - // A circlar activeDescendant is an error, so return null. - return null; - } - seenIds[activeId] = true; - node = document.getElementById(activeId); - } - - if (node == targetNode) { - return null; - } - return node; -}; - -/** - * Dispatches a left click event on the element that is the targetNode. - * Clicks go in the sequence of mousedown, mouseup, and click. - * @param {Node} targetNode The target node of this operation. - * @param {boolean=} shiftKey Specifies if shift is held down. - * @param {boolean=} callOnClickDirectly Specifies whether or not to directly - * invoke the onclick method if there is one. - * @param {boolean=} opt_double True to issue a double click. - */ -cvox.SearchUtil.clickElem = function( - targetNode, shiftKey, callOnClickDirectly, opt_double) { - // If there is an activeDescendant of the targetNode, then that is where the - // click should actually be targeted. - var activeDescendant = getActiveDescendant(targetNode); - if (activeDescendant) { - targetNode = activeDescendant; - } - if (callOnClickDirectly) { - var onClickFunction = null; - if (targetNode.onclick) { - onClickFunction = targetNode.onclick; - } - if (!onClickFunction && (targetNode.nodeType != 1) && - targetNode.parentNode && targetNode.parentNode.onclick) { - onClickFunction = targetNode.parentNode.onclick; - } - var keepGoing = true; - if (onClickFunction) { - try { - keepGoing = onClickFunction(); - } catch (exception) { - // Something went very wrong with the onclick method; we'll ignore it - // and just dispatch a click event normally. - } - } - if (!keepGoing) { - // The onclick method ran successfully and returned false, meaning the - // event should not bubble up, so we will return here. - return; - } - } - - // Send a mousedown (or simply a double click if requested). - var evt = document.createEvent('MouseEvents'); - var evtType = opt_double ? 'dblclick' : 'mousedown'; - evt.initMouseEvent( - evtType, true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, - shiftKey, false, 0, null); - // Mark any events we generate so we don't try to process our own events. - evt.fromCvox = true; - try { - targetNode.dispatchEvent(evt); - } catch (e) { - } - // Send a mouse up - evt = document.createEvent('MouseEvents'); - evt.initMouseEvent( - 'mouseup', true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, - shiftKey, false, 0, null); - // Mark any events we generate so we don't try to process our own events. - evt.fromCvox = true; - try { - targetNode.dispatchEvent(evt); - } catch (e) { - } - // Send a click - evt = document.createEvent('MouseEvents'); - evt.initMouseEvent( - 'click', true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, - shiftKey, false, 0, null); - // Mark any events we generate so we don't try to process our own events. - evt.fromCvox = true; - try { - targetNode.dispatchEvent(evt); - } catch (e) { - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/host/chrome/braille.js b/chrome/browser/resources/chromeos/chromevox/host/chrome/braille.js deleted file mode 100644 index 168cb2e..0000000 --- a/chrome/browser/resources/chromeos/chromevox/host/chrome/braille.js +++ /dev/null
@@ -1,135 +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. - -/** - * @fileoverview Bridge that sends Braille messages from content scripts or - * other pages to the main background page. - * - */ - -goog.provide('cvox.ChromeBraille'); - -goog.require('cvox.BrailleInterface'); -goog.require('cvox.BrailleKeyEvent'); -goog.require('cvox.ChromeVoxUserCommands'); -goog.require('cvox.HostFactory'); - - -/** - * @constructor - * @implements {cvox.BrailleInterface} - */ -cvox.ChromeBraille = function() { - /** - * @type {cvox.NavBraille} - * @private - */ - this.lastContent_ = null; - /** - * @type {string} - * @private - */ - this.lastContentId_ = ''; - /** - * @type {number} - * @private - */ - this.nextLocalId_ = 1; - cvox.ExtensionBridge.addMessageListener(goog.bind(function(msg, port) { - // Since ChromeVox gets injected into multiple iframes on a page, check to - // ensure that this is the "active" iframe via its focused state. - // Furthermore, if the active element is itself an iframe, the focus is - // within the iframe even though the containing document also has focus. - // Don't process the event if this document isn't focused or focus lies in - // a descendant. - if (!cvox.ChromeVox.documentHasFocus()) { - return; - } - if (msg['message'] == 'BRAILLE' && msg['args']) { - var content = null; - if (msg['contentId'] == this.lastContentId_) { - content = this.lastContent_; - } - this.onKeyEvent_(msg['args'], content); - } - }, this)); -}; - - -/** @override */ -cvox.ChromeBraille.prototype.write = function(params) { - this.lastContent_ = params; - this.updateLastContentId_(); - var outParams = params.toJson(); - - var message = { - 'target': 'BRAILLE', - 'action': 'write', - 'params': outParams, - 'contentId': this.lastContentId_ - }; - - cvox.ExtensionBridge.send(message); -}; - - -/** @override */ -cvox.ChromeBraille.prototype.writeRawImage = function(imageDataUrl) { - // Do Nothing. -}; - - -/** @override */ -cvox.ChromeBraille.prototype.freeze = function() { - // Do Nothing. -}; - - -/** @override */ -cvox.ChromeBraille.prototype.thaw = function() { - // Do Nothing. -}; - - -/** @override */ -cvox.ChromeBraille.prototype.getDisplayState = function() { - return {available: false, textRowCount: 0, textColumnCount: 0}; -}; - - -/** @private */ -cvox.ChromeBraille.prototype.updateLastContentId_ = function() { - this.lastContentId_ = - cvox.ExtensionBridge.uniqueId() + '.' + this.nextLocalId_++; -}; - - -/** - * Dispatches braille input commands. - * @param {!cvox.BrailleKeyEvent} brailleEvt The braille key event. - * @param {cvox.NavBraille} content display content when command was issued, - * if available. - * @private - */ -cvox.ChromeBraille.prototype.onKeyEvent_ = function(brailleEvt, content) { - var command = cvox.ChromeVoxUserCommands.commands[brailleEvt.command]; - if (command) { - command({event: brailleEvt, content: content}); - } else { - console.error('Unknown braille command: ' + JSON.stringify(brailleEvt)); - } -}; - - -/** - * Overrides the key event handler - * @param {function(!cvox.BrailleKeyEvent, cvox.NavBraille):void} listener - */ -cvox.ChromeBraille.prototype.setKeyEventHandlerForTest = function(listener) { - this.onKeyEvent_ = listener; -}; - - -/** Export platform constructor. */ -cvox.HostFactory.brailleConstructor = cvox.ChromeBraille;
diff --git a/chrome/browser/resources/chromeos/chromevox/host/chrome/braille_integration_test.unitjs b/chrome/browser/resources/chromeos/chromevox/host/chrome/braille_integration_test.unitjs deleted file mode 100644 index e0a93e1..0000000 --- a/chrome/browser/resources/chromeos/chromevox/host/chrome/braille_integration_test.unitjs +++ /dev/null
@@ -1,254 +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 test fixture. -GEN_INCLUDE(['../../testing/chromevox_unittest_base.js', - '../../testing/assert_additions.js']); - -// Tests the communication between content script and background page for -// braille. - -/** - * Test fixture. - * @constructor - * @extends {ChromeVoxUnitTestBase} - */ -function ChromeVoxBrailleIntegrationUnitTest() { - ChromeVoxUnitTestBase.call(this); -} - -ChromeVoxBrailleIntegrationUnitTest.prototype = { - __proto__: ChromeVoxUnitTestBase.prototype, - - /** @override */ - closureModuleDeps: [ - 'cvox.BrailleBackground', - 'cvox.BrailleInputHandler', - 'cvox.BrailleKeyCommand', - 'cvox.ChromeBraille', - 'cvox.ExpandingBrailleTranslator', - 'cvox.ValueSelectionSpan', - 'cvox.ValueSpan', - ], - - /** @override */ - isAsync: true, - - /** @override */ - setUp: function() { - this.displayManager = new FakeDisplayManager(); - this.inputHandler = new FakeInputHandler(); - this.translatorManager = new FakeTranslatorManager(); - - this.brailleBackground = new cvox.BrailleBackground( - this.displayManager, this.inputHandler, this.translatorManager); - - cvox.ExtensionBridge = new FakeExtensionBridge(this.brailleBackground); - - this.braille = new cvox.ChromeBraille(); - this.braille.setKeyEventHandlerForTest(function(command, content) { - this.lastCommand = command; - this.lastCommandContent = content; - }.bind(this)); - this.lastCommand = null; - this.lastCommandContent = null; - - // Create convenience objects used in all tests. - this.command1 = {command: cvox.BrailleKeyCommand.PAN_LEFT}; - this.content1 = cvox.NavBraille.fromText('text 1'); - this.command2 = {command: cvox.BrailleKeyCommand.ROUTING}; - this.content2 = cvox.NavBraille.fromText('text 2'); - }, - - /** @Override */ - tearDown: function() { - cvox.ExtensionBridge = null; - }, - - sendCommand: function(command, content) { - this.displayManager.commandListener(command, content); - }, - - /** - * Waits for {@code document} to gain focus, arranging to call - * {@code testDone} afterwards. - * @param {Function()} callback Called when focus is gained - */ - awaitDocumentFocused: function(callback) { - callback = this.newCallback(callback); - if (!document.hasFocus()) { - var listener = this.newCallback(function() { - assertTrue(document.hasFocus()); - window.removeEventListener('focus', listener); - callback(); - }); - window.addEventListener('focus', listener); - } else { - callback(); - } - } -}; - -function FakeExtensionBridge(brailleBackground) { - /** @private {Function} */ - this.messageListener_ = null; - /** @private {cvox.BrailleBackground} */ - this.brailleBackground_ = brailleBackground; -} - -FakeExtensionBridge.prototype = { - uniqueId: function() { return 1; }, - - /** @param {Function} listener The listener. */ - addMessageListener: function(listener) { - assertEquals(null, this.messageListener_); - this.messageListener_ = listener; - }, - - send: function(msg) { - if (msg['message'] == 'BRAILLE') { - assertNotEquals(null, this.messageListener_); - this.messageListener_(msg); - } else { - assertEquals('BRAILLE', msg['target']); - this.brailleBackground_.onBrailleMessage(msg); - } - } -}; - -/** @extends {cvox.BrailleDisplaymanager} */ -function FakeDisplayManager() { - /** @type {Function} */ - this.commandListener = null; - /** @type {cvox.NavBraille} */ - this.content = null; -} - -FakeDisplayManager.prototype = { - /** @Override */ - setCommandListener: function(listener) { - this.commandListener = listener; - }, - - /** @Override */ - setContent: function(content, expansionType) { - assertEquals(cvox.ExpandingBrailleTranslator.ExpansionType.SELECTION, - expansionType); - this.content = content; - } -}; - -/** @extends {cvox.BrailleInputHandler} */ -function FakeInputHandler() { -} - -FakeInputHandler.prototype = { - /** @Override */ - init: function() {}, - - /** @Override */ - onBrailleKeyEvent: function() { - return false; - }, - - /** @Override */ - onDisplayContentChanged: function() {}, - - /** @Override */ - getExpansionType: function() { - return cvox.ExpandingBrailleTranslator.ExpansionType.SELECTION; - } -}; - -/** @extends {cvox.BrailleTranslatorManager} */ -function FakeTranslatorManager() { -} - -SYNC_TEST_F('ChromeVoxBrailleIntegrationUnitTest', 'Write', function() { - this.braille.write(this.content1); - assertEqualsJSON(this.content1, this.displayManager.content); -}); - -SYNC_TEST_F('ChromeVoxBrailleIntegrationUnitTest', 'WriteWithSpans', - function() { - var selectionSpan = new cvox.ValueSelectionSpan(); - var valueSpan = new cvox.ValueSpan(20); - var toSend = cvox.NavBraille.fromText( - new Spannable('Hello', valueSpan)); - toSend.text.setSpan(selectionSpan, 0, 0); - toSend.text.setSpan(document.body, 0, toSend.text.length); - var expected = cvox.NavBraille.fromText( - new Spannable(toSend.text.toString(), valueSpan)); - expected.text.setSpan(selectionSpan, 0, 0); - - this.braille.write(toSend); - assertEqualsJSON(expected, this.displayManager.content); -}); - -TEST_F('ChromeVoxBrailleIntegrationUnitTest', 'CommandNoContent', function() { - // Commands are only delivered to the content script if the window has focus. - this.awaitDocumentFocused(function() { - this.sendCommand(this.command1, null); - assertEqualsJSON(this.command1, this.lastCommand); - assertEquals(null, this.lastCommandContent); - }); -}); - -TEST_F('ChromeVoxBrailleIntegrationUnitTest', - 'InterleavedWritesAndCommands', - function() { - this.awaitDocumentFocused(function() { - this.braille.write(this.content1); - this.sendCommand(this.command1, this.displayManager.content); - assertEqualsJSON(this.command1, this.lastCommand); - assertEqualsJSON(this.content1, this.lastCommandContent); - - var savedContent1 = this.displayManager.content; - this.braille.write(this.content2); - // Old content still on display. - this.sendCommand(this.command1, savedContent1); - assertEqualsJSON(this.command1, this.lastCommand); - assertEquals(null, this.lastCommandContent); - this.sendCommand(this.command2, this.displayManager.content); - assertEqualsJSON(this.command2, this.lastCommand); - assertEqualsJSON(this.content2, this.lastCommandContent); - }); -}); - -TEST_F('ChromeVoxBrailleIntegrationUnitTest', 'CommandAfterBackgroundWrite', - function() { - this.awaitDocumentFocused(function() { - this.braille.write(this.content1); - this.sendCommand(this.command1, this.displayManager.content); - assertEqualsJSON(this.command1, this.lastCommand); - assertEqualsJSON(this.content1, this.lastCommandContent); - - this.brailleBackground.write(this.content2); - assertEqualsJSON(this.content2, this.displayManager.content); - this.sendCommand(this.command2, this.displayManager.content); - assertEqualsJSON(this.command2, this.lastCommand); - assertEquals(null, this.lastCommandContent); - }); -}); - -TEST_F('ChromeVoxBrailleIntegrationUnitTest', 'CommandAfterOtherTabWrite', - function() { - this.awaitDocumentFocused(function() { - // Ignore the listener of the braille from the second 'tab'. - cvox.ExtensionBridge.addMessageListener = function() {} - // Create another content script braille object, presumably from another - // tab. - var anotherBraille = new cvox.ChromeBraille(); - this.braille.write(this.content1); - this.sendCommand(this.command1, this.displayManager.content); - // Now, this other braille gets a different unique id. - cvox.ExtensionBridge.uniqueId = function() { return 2; } - anotherBraille.write(this.content2); - this.sendCommand(this.command2, this.displayManager.content); - // The first 'tab' still gets the command, but since the second 'tab's\ - // braille was on the display, it gets null content. - assertEqualsJSON(this.command2, this.lastCommand); - assertEquals(null, this.lastCommandContent); - }); -});
diff --git a/chrome/browser/resources/chromeos/chromevox/host/chrome/earcons.js b/chrome/browser/resources/chromeos/chromevox/host/chrome/earcons.js deleted file mode 100644 index abe1b6c..0000000 --- a/chrome/browser/resources/chromeos/chromevox/host/chrome/earcons.js +++ /dev/null
@@ -1,65 +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. - -/** - * @fileoverview Bridge that sends earcon messages from content scripts or - * other pages to the main background page. - * - */ - - -goog.provide('cvox.ChromeEarcons'); - -goog.require('cvox.AbstractEarcons'); -goog.require('cvox.ExtensionBridge'); -goog.require('cvox.HostFactory'); - - -/** - * @constructor - * @extends {cvox.AbstractEarcons} - */ -cvox.ChromeEarcons = function() { - goog.base(this); -}; -goog.inherits(cvox.ChromeEarcons, cvox.AbstractEarcons); - - -/** - * @override - */ -cvox.ChromeEarcons.prototype.playEarcon = function(earcon, opt_location) { - goog.base(this, 'playEarcon', earcon); - if (!cvox.AbstractEarcons.enabled) { - return; - } - - cvox.ExtensionBridge.send( - {'target': 'EARCON', 'action': 'play', 'earcon': earcon}); -}; - - -/** - * @override - */ -cvox.ChromeEarcons.prototype.toggle = function() { - goog.base(this, 'toggle'); - cvox.ChromeVox.host.sendToBackgroundPage({ - 'target': 'Prefs', - 'action': 'setPref', - 'pref': 'earcons', - 'value': cvox.AbstractEarcons.enabled - }); - if (!cvox.AbstractEarcons.enabled) { - cvox.ChromeVox.host.sendToBackgroundPage({ - 'target': 'Prefs', - 'action': 'setPref', - 'pref': 'useVerboseMode', - 'value': true - }); - } - return cvox.AbstractEarcons.enabled; -}; - -cvox.HostFactory.earconsConstructor = cvox.ChromeEarcons;
diff --git a/chrome/browser/resources/chromeos/chromevox/host/chrome/extension_bridge.js b/chrome/browser/resources/chromeos/chromevox/host/chrome/extension_bridge.js index ef144e0..f45022ab 100644 --- a/chrome/browser/resources/chromeos/chromevox/host/chrome/extension_bridge.js +++ b/chrome/browser/resources/chromeos/chromevox/host/chrome/extension_bridge.js
@@ -15,8 +15,6 @@ goog.provide('cvox.ExtensionBridge'); -goog.require('cvox.ChromeVoxJSON'); - /** * @constructor */
diff --git a/chrome/browser/resources/chromeos/chromevox/host/chrome/host.js b/chrome/browser/resources/chromeos/chromevox/host/chrome/host.js deleted file mode 100644 index fe35be1..0000000 --- a/chrome/browser/resources/chromeos/chromevox/host/chrome/host.js +++ /dev/null
@@ -1,177 +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. - -/** - * @fileoverview Chrome-specific implementation of methods that differ - * depending on the host platform. - * - */ - -goog.provide('cvox.ChromeHost'); - -goog.require('cvox.AbstractHost'); -goog.require('cvox.BrailleOverlayWidget'); -goog.require('cvox.ChromeVox'); -goog.require('cvox.ChromeVoxEventWatcher'); -goog.require('cvox.ChromeVoxKbHandler'); -goog.require('cvox.ExtensionBridge'); -goog.require('cvox.HostFactory'); -goog.require('cvox.InitialSpeech'); -goog.require('cvox.SearchLoader'); - -/** - * @constructor - * @extends {cvox.AbstractHost} - */ -cvox.ChromeHost = function() { - goog.base(this); - - /** @private {boolean} */ - this.gotPrefsAtLeastOnce_ = false; -}; -goog.inherits(cvox.ChromeHost, cvox.AbstractHost); - - -/** @override */ -cvox.ChromeHost.prototype.init = function() { - // TODO(deboer): This pattern is relatively painful since it - // must be duplicated in all host.js files. It also causes odd - // dependencies. - // TODO (stoarca): Not using goog.bind because for some reason it gets - // compiled to native code and not possible to debug. - var self = this; - var listener = function(message) { - if (message['history']) { - cvox.ChromeVox.visitedUrls = message['history']; - } - - if (message['keyBindings']) { - cvox.ChromeVoxKbHandler.loadKeyToFunctionsTable(message['keyBindings']); - } - if (message['prefs']) { - var prefs = message['prefs']; - cvox.ChromeVoxEditableTextBase.useIBeamCursor = - (prefs['useIBeamCursor'] == 'true'); - cvox.ChromeVoxEditableTextBase.eventTypingEcho = true; - cvox.ChromeVoxEventWatcher.focusFollowsMouse = - (prefs['focusFollowsMouse'] == 'true'); - - cvox.ChromeVox.version = prefs['version']; - - cvox.ChromeVox.typingEcho = - /** @type {number} */ (JSON.parse(prefs['typingEcho'])); - - if (prefs['position']) { - cvox.ChromeVox.position = - /** @type {Object<{x:number, y:number}>} */ ( - JSON.parse(prefs['position'])); - } - - if (prefs['granularity'] != 'undefined') { - cvox.ChromeVox.navigationManager.setGranularity( - /** @type {number} */ (JSON.parse(prefs['granularity']))); - } - - self.activateOrDeactivateChromeVox(prefs['active'] == 'true'); - self.activateOrDeactivateStickyMode(prefs['sticky'] == 'true'); - if (!self.gotPrefsAtLeastOnce_) { - cvox.InitialSpeech.speak(); - } - self.gotPrefsAtLeastOnce_ = true; - - if (prefs['useVerboseMode'] == 'false') { - cvox.ChromeVox.verbosity = cvox.VERBOSITY_BRIEF; - } else { - cvox.ChromeVox.verbosity = cvox.VERBOSITY_VERBOSE; - } - if (prefs['cvoxKey']) { - cvox.ChromeVox.modKeyStr = prefs['cvoxKey']; - } - - cvox.BrailleOverlayWidget.getInstance().setActive( - prefs['brailleCaptions'] == 'true'); - } - }; - cvox.ExtensionBridge.addMessageListener(listener); - - cvox.ExtensionBridge.addMessageListener(function(msg, port) { - var message = msg['message']; - var cmd = msg['command']; - if (message == 'USER_COMMAND') { - if (cmd != 'toggleChromeVox' && !cvox.ChromeVox.documentHasFocus()) { - return; - } - cvox.ChromeVoxUserCommands.commands[cmd](msg); - } else if (message == 'SYSTEM_COMMAND') { - if (cmd == 'killChromeVox') { - var reStr = msg['excludeUrlRegExp']; - if (reStr && new RegExp(reStr).test(location.href)) { - return; - } - this.killChromeVox(); - } - } - }.bind(this)); - - cvox.ExtensionBridge.send({'target': 'Prefs', 'action': 'getPrefs'}); - - cvox.ExtensionBridge.send({'target': 'Data', 'action': 'getHistory'}); -}; - - -/** @override */ -cvox.ChromeHost.prototype.reinit = function() { - cvox.ExtensionBridge.init(); -}; - - -/** @override */ -cvox.ChromeHost.prototype.onPageLoad = function() { - cvox.ExtensionBridge.addDisconnectListener(goog.bind(function() { - cvox.ChromeVox.isActive = false; - cvox.ChromeVoxEventWatcher.cleanup(window); - // TODO(stoarca): Huh?? Why are we resetting during disconnect? - // This is not appropriate behavior! - cvox.ChromeVox.navigationManager.reset(); - }, this)); -}; - - -/** @override */ -cvox.ChromeHost.prototype.sendToBackgroundPage = function(message) { - cvox.ExtensionBridge.send(message); -}; - - -/** @override */ -cvox.ChromeHost.prototype.getApiSrc = function() { - return this.getFileSrc('chromevox/injected/api.js'); -}; - - -/** @override */ -cvox.ChromeHost.prototype.getFileSrc = function(file) { - return window.chrome.extension.getURL(file); -}; - - -/** @override */ -cvox.ChromeHost.prototype.killChromeVox = function() { - goog.base(this, 'killChromeVox'); - cvox.ExtensionBridge.removeMessageListeners(); -}; - - -/** - * Activates or deactivates Sticky Mode. - * @param {boolean} sticky Whether sticky mode should be active. - */ -cvox.ChromeHost.prototype.activateOrDeactivateStickyMode = function(sticky) { - cvox.ChromeVox.isStickyPrefOn = sticky; -}; - -/** - * The host constructor for Chrome. - */ -cvox.HostFactory.hostConstructor = cvox.ChromeHost;
diff --git a/chrome/browser/resources/chromeos/chromevox/host/chrome/tts.js b/chrome/browser/resources/chromeos/chromevox/host/chrome/tts.js deleted file mode 100644 index fe6119e..0000000 --- a/chrome/browser/resources/chromeos/chromevox/host/chrome/tts.js +++ /dev/null
@@ -1,140 +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. - -/** - * @fileoverview Bridge that sends TTS messages from content scripts or - * other pages to the main background page. - * - */ - -goog.provide('cvox.ChromeTts'); - -goog.require('cvox.ChromeTtsBase'); -goog.require('cvox.HostFactory'); - -/** - * @constructor - * @extends {cvox.ChromeTtsBase} - */ -cvox.ChromeTts = function() { - goog.base(this); - - this.addBridgeListener(); -}; -goog.inherits(cvox.ChromeTts, cvox.ChromeTtsBase); - -/** - * Current call id, used for matching callback functions. - * @type {number} - */ -cvox.ChromeTts.callId = 1; - -/** - * Maps call ids to callback functions. - * @type {Object<number, Function>} - */ -cvox.ChromeTts.functionMap = new Object(); - -/** @override */ -cvox.ChromeTts.prototype.speak = function(textString, queueMode, properties) { - if (!properties) { - properties = {}; - } - - goog.base(this, 'speak', textString, queueMode, properties); - - cvox.ExtensionBridge.send( - this.createMessageForProperties_(textString, queueMode, properties)); - return this; -}; - -/** @override */ -cvox.ChromeTts.prototype.isSpeaking = function() { - cvox.ChromeTts.superClass_.isSpeaking.call(this); - return false; -}; - -/** @override */ -cvox.ChromeTts.prototype.stop = function() { - cvox.ChromeTts.superClass_.stop.call(this); - cvox.ExtensionBridge.send({'target': 'TTS', 'action': 'stop'}); -}; - -/** @override */ -cvox.ChromeTts.prototype.increaseOrDecreaseProperty = function( - propertyName, increase) { - cvox.ExtensionBridge.send({ - 'target': 'TTS', - 'action': 'increaseOrDecrease', - 'property': propertyName, - 'increase': increase - }); -}; - -/** - * Increases a TTS speech property. - * @param {string} property_name The name of the property to increase. - * @param {boolean} announce Whether to announce that the property is - * changing. - */ -cvox.ChromeTts.prototype.increaseProperty = function(property_name, announce) { - goog.base(this, 'increaseProperty', property_name, announce); - cvox.ExtensionBridge.send({ - 'target': 'TTS', - 'action': 'increase' + property_name, - 'announce': announce - }); -}; - -/** - * Listens for TTS_COMPLETED message and executes the callback function. - */ -cvox.ChromeTts.prototype.addBridgeListener = function() { - cvox.ExtensionBridge.addMessageListener(function(msg, port) { - var message = msg['message']; - if (message == 'TTS_CALLBACK') { - var id = msg['id']; - var func = cvox.ChromeTts.functionMap[id]; - if (func != undefined) { - if (!msg['cleanupOnly']) { - func(); - } - delete cvox.ChromeTts.functionMap[id]; - } - } - }); -}; - -/** - * Creates a message suitable for sending as a speak action to background tts. - * @param {string} textString The string of text to be spoken. - * @param {cvox.QueueMode} queueMode The queue mode. - * @param {Object=} properties Speech properties to use for this utterance. - * @return {Object} A message. - * @private - */ -cvox.ChromeTts.prototype.createMessageForProperties_ = function( - textString, queueMode, properties) { - var message = { - 'target': 'TTS', - 'action': 'speak', - 'text': textString, - 'queueMode': queueMode, - 'properties': properties - }; - - if (properties['startCallback'] != undefined) { - cvox.ChromeTts.functionMap[cvox.ChromeTts.callId] = - properties['startCallback']; - message['startCallbackId'] = cvox.ChromeTts.callId++; - } - if (properties['endCallback'] != undefined) { - cvox.ChromeTts.functionMap[cvox.ChromeTts.callId] = - properties['endCallback']; - message['endCallbackId'] = cvox.ChromeTts.callId++; - } - return message; -}; - -cvox.HostFactory.ttsConstructor = cvox.ChromeTts;
diff --git a/chrome/browser/resources/chromeos/chromevox/host/interface/abstract_host.js b/chrome/browser/resources/chromeos/chromevox/host/interface/abstract_host.js deleted file mode 100644 index ad0d69cc..0000000 --- a/chrome/browser/resources/chromeos/chromevox/host/interface/abstract_host.js +++ /dev/null
@@ -1,162 +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. - -/** - * @fileoverview Abstract interface to methods that differ depending on the - * host platform. - * - */ - -goog.provide('cvox.AbstractHost'); - -goog.require('cvox.ChromeVoxEventWatcher'); - -/** - * @constructor - */ -cvox.AbstractHost = function() {}; - - -/** - * @enum {number} - */ -cvox.AbstractHost.State = { - ACTIVE: 0, - INACTIVE: 1, - KILLED: 2 -}; - - -/** - * Do all host-platform-specific initialization. - */ -cvox.AbstractHost.prototype.init = function() {}; - - -/** - * Used to reinitialize ChromeVox if initialization fails. - */ -cvox.AbstractHost.prototype.reinit = function() {}; - - -/** - * Executed on page load. - */ -cvox.AbstractHost.prototype.onPageLoad = function() {}; - - -/** - * Sends a message to the background page (if it exists) for this host. - * @param {Object} message The message to pass to the background page. - */ -cvox.AbstractHost.prototype.sendToBackgroundPage = function(message) {}; - - -/** - * Returns the absolute URL to the API source. - * @return {string} The URL. - */ -cvox.AbstractHost.prototype.getApiSrc = function() { - return ''; -}; - - -/** - * Return the absolute URL to the given file. - * @param {string} path The URL suffix. - * @return {string} The full URL. - */ -cvox.AbstractHost.prototype.getFileSrc = function(path) { - return ''; -}; - - -/** - * @return {boolean} True if the host has a Tts callback. - */ -cvox.AbstractHost.prototype.hasTtsCallback = function() { - return true; -}; - - -/** - * @return {boolean} True if the TTS has been loaded. - */ -cvox.AbstractHost.prototype.ttsLoaded = function() { - return true; -}; - - -/** - * @return {boolean} True if the ChromeVox is supposed to intercept and handle - * mouse clicks for the platform, instead of just letting the clicks fall - * through. - * - * Note: This behavior is only needed for Android because of the way touch - * exploration and double-tap to click is implemented by the platform. - */ -cvox.AbstractHost.prototype.mustRedispatchClickEvent = function() { - return false; -}; - -/** - * Activate or deactivate ChromeVox on this host. - * @param {boolean} active The desired state; true for active, false for - * inactive. - */ -cvox.AbstractHost.prototype.activateOrDeactivateChromeVox = function(active) { - this.onStateChanged_( - active ? cvox.AbstractHost.State.ACTIVE : - cvox.AbstractHost.State.INACTIVE); -}; - - -/** - * Kills ChromeVox on this host. - */ -cvox.AbstractHost.prototype.killChromeVox = function() { - this.onStateChanged_(cvox.AbstractHost.State.KILLED); -}; - - -/** - * Helper managing the three states of ChromeVox -- - * active: all event listeners registered - * inactive: only key down listener registered - * killed: no listeners registered - * @param {cvox.AbstractHost.State} state The new state. - * @private - */ -cvox.AbstractHost.prototype.onStateChanged_ = function(state) { - var active = state == cvox.AbstractHost.State.ACTIVE; - if (active == cvox.ChromeVox.isActive) { - return; - } - cvox.ChromeVoxEventWatcher.cleanup(window); - switch (state) { - case cvox.AbstractHost.State.ACTIVE: - cvox.ChromeVox.isActive = true; - cvox.ChromeVox.navigationManager.showOrHideIndicator(true); - cvox.ChromeVoxEventWatcher.init(window); - if (document.activeElement) { - var speakNodeAlso = cvox.ChromeVox.documentHasFocus(); - cvox.ChromeVox.navigationManager.syncToNode( - document.activeElement, speakNodeAlso); - } else { - cvox.ChromeVox.navigationManager.updateIndicator(); - } - break; - case cvox.AbstractHost.State.INACTIVE: - cvox.ChromeVox.isActive = false; - cvox.ChromeVox.navigationManager.showOrHideIndicator(false); - // If ChromeVox is inactive, the event watcher will only listen for key - // down events. - cvox.ChromeVoxEventWatcher.init(window); - break; - case cvox.AbstractHost.State.KILLED: - cvox.ChromeVox.isActive = false; - cvox.ChromeVox.navigationManager.showOrHideIndicator(false); - break; - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/host/interface/host_factory.js b/chrome/browser/resources/chromeos/chromevox/host/interface/host_factory.js deleted file mode 100644 index af3d8d8..0000000 --- a/chrome/browser/resources/chromeos/chromevox/host/interface/host_factory.js +++ /dev/null
@@ -1,73 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - - -/** - * @fileoverview A host factory. This factory allows us to decouple the - * cvox.Host|Tts|... creatation from the main ChromeVox code. - */ - -goog.provide('cvox.HostFactory'); - -goog.require('cvox.AbstractEarcons'); -goog.require('cvox.AbstractHost'); -goog.require('cvox.AbstractTts'); - - -/** - * @constructor - */ -cvox.HostFactory = function() {}; - -/** - * Returns the host. - * @return {cvox.AbstractHost} - */ -cvox.HostFactory.getHost = function() { - return new cvox.HostFactory.hostConstructor; -}; - -/** - * Returns the TTS interface. - * @return {cvox.TtsInterface} The TTS engine. - */ -cvox.HostFactory.getTts = function() { - return new cvox.HostFactory.ttsConstructor; -}; - -/** - * Returns the Braille interface. - * @return {cvox.BrailleInterface} The Braille interface. - */ -cvox.HostFactory.getBraille = function() { - return new cvox.HostFactory.brailleConstructor; -}; - -/** - * Returns the earcons interface. - * @return {cvox.AbstractEarcons} - */ -cvox.HostFactory.getEarcons = function() { - return new cvox.HostFactory.earconsConstructor; -}; - -/** - * @type {function (new:cvox.AbstractHost)} - */ -cvox.HostFactory.hostConstructor; - -/** - * @type {function (new:cvox.TtsInterface)} - */ -cvox.HostFactory.ttsConstructor; - -/** - * @type {function (new:cvox.BrailleInterface)} - */ -cvox.HostFactory.brailleConstructor; - -/** - * @type {function (new:cvox.AbstractEarcons)} - */ -cvox.HostFactory.earconsConstructor;
diff --git a/chrome/browser/resources/chromeos/chromevox/host/testing/earcons.js b/chrome/browser/resources/chromeos/chromevox/host/testing/earcons.js deleted file mode 100644 index c2a2658..0000000 --- a/chrome/browser/resources/chromeos/chromevox/host/testing/earcons.js +++ /dev/null
@@ -1,25 +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. - -/** - * @fileoverview Dummy earcons implementation for testing. - * - */ - -goog.provide('cvox.TestEarcons'); - -goog.require('cvox.AbstractEarcons'); -goog.require('cvox.HostFactory'); - -/** - * @constructor - * @extends {cvox.AbstractEarcons} - */ -cvox.TestEarcons = function() { - cvox.Earcon.call(this); -}; -goog.inherits(cvox.TestEarcons, cvox.AbstractEarcons); - -/** @override */ -cvox.HostFactory.earconsConstructor = cvox.TestEarcons;
diff --git a/chrome/browser/resources/chromeos/chromevox/host/testing/host.js b/chrome/browser/resources/chromeos/chromevox/host/testing/host.js deleted file mode 100644 index 84ea9b1..0000000 --- a/chrome/browser/resources/chromeos/chromevox/host/testing/host.js +++ /dev/null
@@ -1,25 +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. - -/** - * @fileoverview Dummy implementation of host.js for testing. - * - */ - -goog.provide('cvox.TestHost'); - -goog.require('cvox.AbstractHost'); -goog.require('cvox.HostFactory'); - -/** - * @constructor - * @extends {cvox.AbstractHost} - */ -cvox.TestHost = function() { - cvox.AbstractHost.call(this); -}; -goog.inherits(cvox.TestHost, cvox.AbstractHost); - -/** @override */ -cvox.HostFactory.hostConstructor = cvox.TestHost;
diff --git a/chrome/browser/resources/chromeos/chromevox/host/testing/tts.js b/chrome/browser/resources/chromeos/chromevox/host/testing/tts.js deleted file mode 100644 index 466653d..0000000 --- a/chrome/browser/resources/chromeos/chromevox/host/testing/tts.js +++ /dev/null
@@ -1,143 +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. - -/** - * @fileoverview Dummy implementation of TTS for testing. - * - */ - -goog.provide('cvox.TestTts'); - -goog.require('cvox.AbstractTts'); -goog.require('cvox.DomUtil'); -goog.require('cvox.HostFactory'); - - - -/** - * @constructor - * @extends {cvox.AbstractTts} - */ -cvox.TestTts = function() { - cvox.AbstractTts.call(this); - this.utterances_ = []; -}; -goog.inherits(cvox.TestTts, cvox.AbstractTts); - - -/** - * @type {string} - * @private - */ -cvox.TestTts.prototype.sentinelText_ = '@@@STOP@@@'; - - -/** - * @override - */ -cvox.TestTts.prototype.speak = function(text, queueMode, opt_properties) { - this.utterances_.push( - {text: text, queueMode: queueMode, properties: opt_properties}); - if (opt_properties && opt_properties['endCallback'] != undefined) { - var len = this.utterances_.length; - // 'After' is a sentinel value in the tests that tells TTS to stop and - // ends callbacks being called. - if (this.utterances_[len - 1].text != this.sentinelText_) { - opt_properties['endCallback'](); - } - } -}; - - -/** - * Creates a sentinel element that indicates when TTS should stop and callbacks - * should stop being called. - * @return {Element} The sentinel element. - */ -cvox.TestTts.prototype.createSentinel = function() { - var sentinel = document.createElement('div'); - sentinel.textContent = this.sentinelText_; - return sentinel; -}; - - -/** - * All calls to tts.speak are saved in an array of utterances. - * Clear any utterances that were saved up to this point. - */ -cvox.TestTts.prototype.clearUtterances = function() { - this.utterances_.length = 0; -}; - -/** - * Return a string of what was spoken by tts.speak(). - * @return {string} A single string containing all utterances spoken - * since initialization or the last call to clearUtterances, - * concatenated together with all whitespace collapsed to single - * spaces. - */ -cvox.TestTts.prototype.getUtterancesAsString = function() { - return cvox.DomUtil.collapseWhitespace(this.getUtteranceList().join(' ')); -}; - -/** - * Processes the utterances spoken the same way the speech queue does, - * as if they were all generated one after another, with no delay between - * them, and returns a list of strings that would be output. - * - * For example, if two strings were spoken with a queue mode of FLUSH, - * only the second string will be returned. - * @return {Array<string>} A list of strings representing the speech output. - */ -cvox.TestTts.prototype.getSpeechQueueOutput = function() { - var queue = []; - for (var i = 0; i < this.utterances_.length; i++) { - var utterance = this.utterances_[i]; - switch (utterance.queueMode) { - case cvox.AbstractTts.QUEUE_MODE_FLUSH: - queue = []; - break; - case cvox.AbstractTts.QUEUE_MODE_QUEUE: - break; - case cvox.AbstractTts.QUEUE_MODE_CATEGORY_FLUSH: - queue = queue.filter(function(u) { - return (utterance.properties && utterance.properties.category) && - (!u.properties || - u.properties.category != utterance.properties.category); - }); - break; - } - queue.push(utterance); - } - - return queue.map(function(u) { - return u.text; - }); -}; - -/** - * Return a list of strings of what was spoken by tts.speak(). - * @return {Array<string>} A list of all utterances spoken since - * initialization or the last call to clearUtterances. - */ -cvox.TestTts.prototype.getUtteranceList = function() { - var result = []; - for (var i = 0; i < this.utterances_.length; i++) { - result.push(this.utterances_[i].text); - } - return result; -}; - -/** - * Return a list of strings of what was spoken by tts.speak(). - * @return {Array<{text: string, queueMode: cvox.QueueMode}>} - * A list of info about all utterances spoken since - * initialization or the last call to clearUtterances. - */ -cvox.TestTts.prototype.getUtteranceInfoList = function() { - return this.utterances_; -}; - -/** @override */ -cvox.HostFactory.ttsConstructor = cvox.TestTts;
diff --git a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js index 2f5b582e..c01edcd 100644 --- a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js +++ b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js
@@ -25,13 +25,6 @@ __proto__: testing.Test.prototype, /** @override */ - closureModuleDeps: [ - 'cvox.ChromeVoxTester', - 'cvox.ChromeVoxUserCommands', - 'cvox.SpokenListBuilder', - ], - - /** @override */ browsePreload: DUMMY_URL, /** @@ -108,92 +101,6 @@ }, /** - * Waits for the queued events in ChromeVoxEventWatcher to be - * handled, then calls a callback function with provided arguments - * in the test case scope. Very useful for asserting the results of events. - * - * @param {function()} func A function to call when ChromeVox is ready. - * @param {*} var_args Additional arguments to pass through to the function. - * @return {ChromeVoxUnitTestBase} this. - */ - waitForCalm: function(func, var_args) { - var calmArguments = Array.prototype.slice.call(arguments); - calmArguments.shift(); - cvox.ChromeVoxEventWatcher.addReadyCallback(this.newCallback(function() { - func.apply(this, calmArguments); - })); - return this; // for chaining. - }, - - /** - * Asserts the TTS engine spoke a certain string. Clears the TTS buffer. - * @param {string} expectedText The expected text. - * @return {ChromeVoxUnitTestBase} this. - */ - assertSpoken: function(expectedText) { - assertEquals( - expectedText, cvox.ChromeVoxTester.testTts().getUtterancesAsString()); - cvox.ChromeVoxTester.clearUtterances(); - return this; // for chaining. - }, - - /** - * Asserts a list of utterances are in the correct queue mode. - * @param {cvox.SpokenListBuilder|Array} expectedList A list - * of [text, queueMode] tuples OR a SpokenListBuilder with the expected - * utterances. - * @return {ChromeVoxUnitTestBase} this. - */ - assertSpokenList: function(expectedList) { - if (expectedList instanceof cvox.SpokenListBuilder) { - expectedList = expectedList.build(); - } - - var ulist = cvox.ChromeVoxTester.testTts().getUtteranceInfoList(); - for (var i = 0; i < expectedList.length; i++) { - var text = expectedList[i][0]; - var queueMode = expectedList[i][1]; - this.assertSingleUtterance_( - text, queueMode, ulist[i].text, ulist[i].queueMode); - } - cvox.ChromeVoxTester.clearUtterances(); - return this; // for chaining. - }, - - assertSingleUtterance_: function( - expectedText, expectedQueueMode, text, queueMode) { - assertEquals(expectedQueueMode, queueMode); - assertEquals(expectedText, text); - }, - - /** - * Focuses an element. - * @param {string} id The id of the element to focus. - * @return {ChromeVoxUnitTestBase} this. - */ - setFocus: function(id) { - $(id).focus(); - return this; // for chaining. - }, - - /** - * Executes a ChromeVox user command. - * @param {string} command The name of the command to run. - * @return {ChromeVoxUnitTestBase} this. - */ - userCommand: function(command) { - cvox.ChromeVoxUserCommands.commands[command](); - return this; // for chaining. - }, - - /** - * @return {cvox.SpokenListBuilder} A new builder. - */ - spokenList: function() { - return new cvox.SpokenListBuilder(); - }, - - /** * @type {CallbackHelper} * @private */
diff --git a/chrome/browser/resources/chromeos/chromevox/testing/spoken_list_builder.js b/chrome/browser/resources/chromeos/chromevox/testing/spoken_list_builder.js deleted file mode 100644 index 64bc467..0000000 --- a/chrome/browser/resources/chromeos/chromevox/testing/spoken_list_builder.js +++ /dev/null
@@ -1,61 +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. - -/** - * @fileoverview The spoken list builder. Used in test cases. - */ - -goog.provide('cvox.SpokenListBuilder'); -goog.require('cvox.QueueMode'); - - -/** - * Builds a spoken list. - * @constructor - */ -cvox.SpokenListBuilder = function() { - this.list_ = []; -}; - - -/** - * Adds an expected flushed utterance to the builder. - * @param {string} expectedText The expected text. - * @return {cvox.SpokenListBuilder} this. - */ -cvox.SpokenListBuilder.prototype.flush = function(expectedText) { - this.list_.push([expectedText, cvox.QueueMode.FLUSH]); - return this; // for chaining -}; - - -/** - * Adds an expected queued utterance to the builder. - * @param {string} expectedText The expected text. - * @return {cvox.SpokenListBuilder} this. - */ -cvox.SpokenListBuilder.prototype.queue = function(expectedText) { - this.list_.push([expectedText, cvox.QueueMode.QUEUE]); - return this; // for chaining -}; - - -/** - * Adds an expected category-flush utterance to the builder. - * @param {string} expectedText The expected text. - * @return {cvox.SpokenListBuilder} this. - */ -cvox.SpokenListBuilder.prototype.categoryFlush = function(expectedText) { - this.list_.push([expectedText, cvox.QueueMode.CATEGORY_FLUSH]); - return this; // for chaining -}; - - -/** - * Builds the list. - * @return {Array} The array of utterances. - */ -cvox.SpokenListBuilder.prototype.build = function() { - return this.list_; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/testing/tester.js b/chrome/browser/resources/chromeos/chromevox/testing/tester.js deleted file mode 100644 index de0174e..0000000 --- a/chrome/browser/resources/chromeos/chromevox/testing/tester.js +++ /dev/null
@@ -1,135 +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. - -goog.provide('cvox.ChromeVoxTester'); - -goog.require('TestMsgs'); -goog.require('cvox.AbstractEarcons'); -goog.require('cvox.BrailleInterface'); -goog.require('cvox.ChromeVoxEventWatcher'); -goog.require('cvox.ChromeVoxUserCommands'); -goog.require('cvox.LiveRegions'); -goog.require('cvox.NavigationManager'); -goog.require('cvox.NavigationShifter'); -goog.require('cvox.QueueMode'); -goog.require('cvox.TestHost'); -goog.require('cvox.TestTts'); - - -/** - * @fileoverview Testing framework for ChromeVox. - * - */ - - -/** - * Initializes cvox.ChromeVoxTester and sets up the mock ChromeVox - * environment. - * @param {!Document} doc The DOM document to add event listeners to. - */ -cvox.ChromeVoxTester.setUp = function(doc) { - - cvox.ChromeVox.navigationManager = new cvox.NavigationManager(); - cvox.ChromeVoxTester.testTts_ = new cvox.TestTts(); - cvox.ChromeVox.tts = cvox.ChromeVoxTester.testTts_; - - // TODO(deboer): Factor this out as 'TestEarcons' - cvox.ChromeVox.earcons = new cvox.AbstractEarcons(); - cvox.ChromeVox.earcons.playEarcon = function(earcon) {}; - - cvox.ChromeVox.braille = new cvox.BrailleInterface(); - cvox.ChromeVox.braille.write = function(params) {}; - - Msgs = TestMsgs; - - cvox.ChromeVox.host = new cvox.TestHost(); - - // Init LiveRegions with a date of 0 so that the initial delay before - // things is spoken is skipped. - cvox.LiveRegions.init(new Date(0), cvox.QueueMode.QUEUE, false); - - cvox.ChromeVoxEventWatcher.init(doc); - window.console.log('done setup'); -}; - -/** - * Tears down cvox.ChromeVoxTester. - * @param {!Document} doc The DOM document where event listeners were added. - */ -cvox.ChromeVoxTester.tearDown = function(doc) { - cvox.ChromeVoxEventWatcher.cleanup(doc); -}; - - -/** - * Returns the cvox.TestTts created by the tester. - * @return {cvox.TestTts} The TestTts. - */ -cvox.ChromeVoxTester.testTts = function() { - return cvox.ChromeVoxTester.testTts_; -}; - - -/** - * All calls to tts.speak are saved in an array of utterances. - * Clear any utterances that were saved up to this poing. - */ -cvox.ChromeVoxTester.clearUtterances = function() { - cvox.ChromeVoxTester.testTts_.clearUtterances(); -}; - - -/** - * Return a list of strings of what was spoken by tts.speak(). - * @return {Array<string>} A list of all utterances spoken since - * initialization or the last call to clearUtterances. - */ -cvox.ChromeVoxTester.getUtteranceList = function() { - return cvox.ChromeVoxTester.testTts_.getUtteranceList(); -}; - -/** - * @type {Object<number>} Map from a navigation strategy name to the Navigation - * Manager strategy enum. - */ -cvox.ChromeVoxTester.STRATEGY_MAP = { - 'lineardom': cvox.NavigationShifter.GRANULARITIES.OBJECT, - 'smart': cvox.NavigationShifter.GRANULARITIES.GROUP, - 'selection': cvox.NavigationShifter.GRANULARITIES.SENTENCE -}; - -/** - * Switches to a different navigation strategy. - * @param {string} strategy The desired navigation strategy. - */ -cvox.ChromeVoxTester.setStrategy = function(strategy) { - cvox.ChromeVox.navigationManager.ensureNotSubnavigating(); - cvox.ChromeVox.navigationManager.setGranularity( - cvox.ChromeVoxTester.STRATEGY_MAP[strategy]); -}; - -/** - * Starts reading the page from the current node. - */ -cvox.ChromeVoxTester.readFromHere = function() { - cvox.ChromeVox.navigationManager.startReading(cvox.QueueMode.FLUSH); -}; - -/** - * Syncs to the given node in the test HTML - * @param {Node} node The node to sync to. - */ -cvox.ChromeVoxTester.syncToNode = function(node) { - cvox.ChromeVox.navigationManager.updateSel( - cvox.CursorSelection.fromNode(node)); - cvox.ChromeVox.navigationManager.sync(); -}; - -/** - * Syncs to the first node in the test. - */ -cvox.ChromeVoxTester.syncToFirstNode = function() { - cvox.ChromeVox.navigationManager.updateSel(cvox.CursorSelection.fromBody()); - cvox.ChromeVox.navigationManager.sync(); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/tools/check_chromevox.py b/chrome/browser/resources/chromeos/chromevox/tools/check_chromevox.py index a77193d7..d9ce253 100755 --- a/chrome/browser/resources/chromeos/chromevox/tools/check_chromevox.py +++ b/chrome/browser/resources/chromeos/chromevox/tools/check_chromevox.py
@@ -82,7 +82,6 @@ # Externs common to many ChromeVox scripts. _COMMON_EXTERNS = [ - CVoxPath('common/externs.js'), CVoxPath('common/chrome_extension_externs.js'), CVoxPath('chromevox/background/externs.js'), CVoxPath('host/chrome/externs.js'), @@ -101,7 +100,6 @@ [[CVoxPath('chromevox/background/kbexplorer_loader.js')], _COMMON_EXTERNS], [[CVoxPath('chromevox/background/options_loader.js')], _COMMON_EXTERNS], [[CVoxPath('cvox2/background/log_loader.js')], _COMMON_EXTERNS], - [[CVoxPath('chromevox/injected/loader.js')], _COMMON_EXTERNS], [[CVoxPath('cvox2/background/loader.js')], _COMMON_EXTERNS], [[CVoxPath('cvox2/background/panel_loader.js')], _COMMON_EXTERNS], ]
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/abstract_node_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/abstract_node_walker.js deleted file mode 100644 index af867d6..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/abstract_node_walker.js +++ /dev/null
@@ -1,117 +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. - -/** - * @fileoverview A base class for walkers that have a concept of lowest-level - * node. Base classes must override the stopNodeDescent method to define - * what a lowest-level node is. Then this walker will use those nodes as the - * set of valid CursorSelections. - */ - - -goog.provide('cvox.AbstractNodeWalker'); - -goog.require('cvox.AbstractWalker'); -goog.require('cvox.CursorSelection'); -goog.require('cvox.DomUtil'); - -/** - * @constructor - * @extends {cvox.AbstractWalker} - */ -cvox.AbstractNodeWalker = function() { - goog.base(this); - - /** - * To keep track of and break infinite loops when trying to call next on - * a body that does not DomUtil.hasContent(). - * @type {boolean} - * @private - */ - this.wasBegin_ = false; -}; -goog.inherits(cvox.AbstractNodeWalker, cvox.AbstractWalker); - -/** - * @override - */ -cvox.AbstractNodeWalker.prototype.next = function(sel) { - var r = sel.isReversed(); - var node = sel.end.node || document.body; - if (!node) { - return null; - } - do { - node = cvox.DomUtil.directedNextLeafLikeNode( - node, r, goog.bind(this.stopNodeDescent, this)); - if (!node) { - return null; - } - // and repeat all of the above until we have a node that is not empty - } while (node && !cvox.DomUtil.hasContent(node)); - - return cvox.CursorSelection.fromNode(node).setReversed(r); -}; - -/** - * @override - */ -cvox.AbstractNodeWalker.prototype.sync = function(sel) { - var ret = this.privateSync_(sel); - this.wasBegin_ = false; - return ret; -}; - - -/** - * Private version of sync to ensure that when a body has no content, we - * don't do an infinite loop trying to find an empty node. - * @param {!cvox.CursorSelection} sel The selection. - * @return {cvox.CursorSelection} The synced selection. - * @private - */ -cvox.AbstractNodeWalker.prototype.privateSync_ = function(sel) { - var r = sel.isReversed(); - - if (sel.equals(cvox.CursorSelection.fromBody())) { - if (this.wasBegin_) { - // if body is empty, we return just the body selection - return cvox.CursorSelection.fromBody().setReversed(r); - } - this.wasBegin_ = true; - } - - var node = sel.start.node; - - while (node != document.body && node.parentNode && - this.stopNodeDescent(node.parentNode)) { - node = node.parentNode; - } - - while (node && !this.stopNodeDescent(node)) { - node = cvox.DomUtil.directedFirstChild(node, r); - } - - var n = cvox.CursorSelection.fromNode(node); - if (!cvox.DomUtil.hasContent(node)) { - n = this.next(/** @type {!cvox.CursorSelection} */ - (cvox.CursorSelection.fromNode(node)).setReversed(r)); - } - if (n) { - return n.setReversed(r); - } - return this.begin({reversed: r}); -}; - -/** - * Returns true if this is "a leaf node" or lower. That is, - * it is at the lowest valid level or lower for this granularity. - * RESTRICTION: true for a node => true for all child nodes - * RESTRICTION: true if node has no children - * @param {!Node} node The node to check. - * @return {boolean} true if this is at the "leaf node" level or lower - * for this granularity. - * @protected - */ -cvox.AbstractNodeWalker.prototype.stopNodeDescent = goog.abstractMethod;
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/abstract_selection_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/abstract_selection_walker.js deleted file mode 100644 index 050b203..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/abstract_selection_walker.js +++ /dev/null
@@ -1,157 +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. - -/** - * @fileoverview An abstract class for walking at the sub-element level. - * For example, walking at the sentence, word, or character level. - * This class is an adapter around TraverseContent which exposes the interface - * required by walkers. Subclasses must override the this.grain attribute - * on initialization. - */ - - -goog.provide('cvox.AbstractSelectionWalker'); - -goog.require('Spannable'); -goog.require('cvox.AbstractWalker'); -goog.require('cvox.BareObjectWalker'); -goog.require('cvox.DescriptionUtil'); -goog.require('cvox.DomUtil'); -goog.require('cvox.TraverseContent'); - -/** - * @constructor - * @extends {cvox.AbstractWalker} - */ -cvox.AbstractSelectionWalker = function() { - cvox.AbstractWalker.call(this); - this.objWalker_ = new cvox.BareObjectWalker(); - this.tc_ = cvox.TraverseContent.getInstance(); - this.grain /** @protected */ = ''; // child must override -}; -goog.inherits(cvox.AbstractSelectionWalker, cvox.AbstractWalker); - -/** - * @override - */ -cvox.AbstractSelectionWalker.prototype.next = function(sel) { - var r = sel.isReversed(); - this.tc_.syncToCursorSelection(sel.clone().setReversed(false)); - var ret = - r ? this.tc_.prevElement(this.grain) : this.tc_.nextElement(this.grain); - if (ret == null) { - // Unfortunately, we can't trust TraverseContent; fall back to ObjectWalker. - return this.objWalker_.next(sel); - } - var retSel = this.tc_.getCurrentCursorSelection().setReversed(r); - var objSel = this.objWalker_.next(sel); - objSel = objSel ? objSel.setReversed(r) : null; - - // ObjectWalker wins when there's a discrepancy between it and - // TraverseContent. The only exception is with an end cursor on a text node. - // In all other cases, this makes sure we visit the same selections as - // object walker. - if (objSel && - (retSel.end.node.constructor.name != 'Text' || - objSel.end.node.constructor.name != 'Text') && - !cvox.DomUtil.isDescendantOfNode(retSel.end.node, sel.end.node) && - !cvox.DomUtil.isDescendantOfNode(retSel.end.node, objSel.end.node)) { - return objSel; - } - return retSel; -}; - -/** - * @override - */ -cvox.AbstractSelectionWalker.prototype.sync = function(sel) { - var r = sel.isReversed(); - var newSel = null; - if (sel.start.equals(sel.end) && sel.start.node.constructor.name != 'Text') { - var node = sel.start.node; - - // Find the deepest visible node; written specifically here because we want - // to move across siblings if necessary and take the deepest node which can - // be BODY. - while (node && cvox.DomUtil.directedFirstChild(node, r) && - !cvox.TraverseUtil.treatAsLeafNode(node)) { - var child = cvox.DomUtil.directedFirstChild(node, r); - - // Find the first visible child. - while (child) { - if (cvox.DomUtil.isVisible( - child, {checkAncestors: false, checkDescendants: false})) { - node = child; - break; - } else { - child = cvox.DomUtil.directedNextSibling(child, r); - } - } - - // node has no visible children; it's therefore the deepest visible node. - if (!child) { - break; - } - } - newSel = cvox.CursorSelection.fromNode(node); - } else { - newSel = sel.clone(); - if (r) { - newSel.start = newSel.end; - } else { - newSel.end = newSel.start; - } - } - - // This.next places us at the correct initial position (except below). - newSel = this.next(newSel.setReversed(false)); - - // ObjectWalker wins when there's a discrepancy between it and - // TraverseContent. The only exception is with an end cursor on a text node. - // In all other cases, this makes sure we visit the same selections as - // object walker. - var objSel = this.objWalker_.sync(sel); - objSel = objSel ? objSel.setReversed(r) : null; - - if (!newSel) { - return objSel; - } - - newSel.setReversed(r); - - if (objSel && - (newSel.end.node.constructor.name != 'Text' || - objSel.end.node.constructor.name != 'Text') && - !cvox.DomUtil.isDescendantOfNode(newSel.end.node, sel.end.node) && - !cvox.DomUtil.isDescendantOfNode(newSel.end.node, objSel.end.node)) { - return objSel; - } - return newSel; -}; - -/** - * @override - */ -cvox.AbstractSelectionWalker.prototype.getDescription = function(prevSel, sel) { - var description = cvox.DescriptionUtil.getDescriptionFromAncestors( - cvox.DomUtil.getUniqueAncestors(prevSel.end.node, sel.start.node), true, - cvox.ChromeVox.verbosity); - description.text = sel.getText() || description.text; - return [description]; -}; - -/** - * @override - */ -cvox.AbstractSelectionWalker.prototype.getBraille = function(prevSel, sel) { - var node = sel.absStart().node; - var text = cvox.TraverseUtil.getNodeText(node); - var spannable = new Spannable(text); - spannable.setSpan(node, 0, text.length); - return new cvox.NavBraille({ - text: spannable, - startIndex: sel.absStart().index, - endIndex: sel.absEnd().index - }); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/abstract_shifter.js b/chrome/browser/resources/chromeos/chromevox/walkers/abstract_shifter.js deleted file mode 100644 index 0d72269..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/abstract_shifter.js +++ /dev/null
@@ -1,166 +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. - -/** - * @fileoverview An interface for an ordered collection of walkers, called a - * shifter. - */ - - -goog.provide('cvox.AbstractShifter'); - -goog.require('cvox.AbstractWalker'); -goog.require('cvox.CursorSelection'); -goog.require('cvox.NavBraille'); - - -/** - * @constructor - */ -cvox.AbstractShifter = function() { - this.isSubnavigating_ = false; -}; - - -/** - * Moves to the next selection in the DOM, performing any walker shifts as - * necessary. - * @param {!cvox.CursorSelection} sel The selection to go next from. - * @return {cvox.CursorSelection} The resulting selection. - */ -cvox.AbstractShifter.prototype.next = goog.abstractMethod; - - -/** - * Gets the first (or last) selection for this shifter's current granularity. - * @param {?} sel - * @param {{reversed: (undefined|boolean)}=} kwargs Extra arguments. - * reversed: If true, syncs to the end and returns a reversed selection. - * False by default. - * @return {!cvox.CursorSelection} The valid selection. - */ -cvox.AbstractShifter.prototype.begin = function(sel, kwargs) { - return this.currentWalker_.begin(kwargs); -}; - - -/** - * Syncs to this shifter. - * @param {!cvox.CursorSelection} sel The selection to sync, if any. - * @return {cvox.CursorSelection} The selection. - */ -cvox.AbstractShifter.prototype.sync = goog.abstractMethod; - - -/** - * Name of this shifter. - * @return {string} The shifter's name. - */ -cvox.AbstractShifter.prototype.getName = goog.abstractMethod; - - -/** - * Gets the current description. - * @param {!cvox.CursorSelection} prevSel The previous selection, for context. - * @param {!cvox.CursorSelection} sel The current selection. - * @return {Array<cvox.NavDescription>} The description array. - */ -cvox.AbstractShifter.prototype.getDescription = goog.abstractMethod; - - -/** - * Gets the current braille. - * @param {!cvox.CursorSelection} prevSel The previous selection, for context. - * @param {!cvox.CursorSelection} sel The current selection. - * @return {!cvox.NavBraille} The braille description. - */ -cvox.AbstractShifter.prototype.getBraille = goog.abstractMethod; - - -/** - * Gets the granularity message. - * @return {string} The message string. - */ -cvox.AbstractShifter.prototype.getGranularityMsg = goog.abstractMethod; - - -/** - * Shifts to a less granular level. - */ -cvox.AbstractShifter.prototype.makeLessGranular = function() { - this.ensureNotSubnavigating(); -}; - - -/** - * Shifts to a more granular level. - * NOTE: after a shift, we are no longer subnavigating, if we were. - */ -cvox.AbstractShifter.prototype.makeMoreGranular = function() { - this.ensureNotSubnavigating(); -}; - - -/** - * Enters subnavigation mode, if it was not already in it. - * Subnavigation mode is where the shifter is temporarily one level - * more granular (until either the next granularity shift or - * ensureNotSubnavigating is called). - */ -cvox.AbstractShifter.prototype.ensureSubnavigating = function() { - if (this.isSubnavigating_ == false) { - this.makeMoreGranular(); - this.isSubnavigating_ = true; - } -}; - - -/** - * Exits subnavigation mode, if it was in it. - */ -cvox.AbstractShifter.prototype.ensureNotSubnavigating = function() { - if (this.isSubnavigating_ == true) { - this.isSubnavigating_ = false; - this.makeLessGranular(); - } -}; - - -/** - * Returns true if the shifter is currently in subnavigation mode. - * @return {boolean} If in subnavigation mode. - */ -cvox.AbstractShifter.prototype.isSubnavigating = function() { - return this.isSubnavigating_; -}; - - -/** - * Delegates to current walker. - * @param {string} name Action name. - * @return {boolean} True if this shifter contains action. - */ -cvox.AbstractShifter.prototype.hasAction = function(name) { - return this.currentWalker_.hasAction(name); -}; - - -/** - * Delegates an action to the current walker. - * @param {string} name The action name. - * @param {!cvox.CursorSelection} sel The current selection. - * @return {cvox.CursorSelection} The selection after the action. - */ -cvox.AbstractShifter.prototype.performAction = function(name, sel) { - return this.currentWalker_.performAction(name, sel); -}; - - -/** - * Factory method to create an instance of this shifter. - * @param {!cvox.CursorSelection} sel The initial selection. - * @return {cvox.AbstractShifter} The shifter or null if given a selection not - * within the shifter's domain. - */ -cvox.AbstractShifter.create = goog.abstractMethod;
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/abstract_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/abstract_walker.js deleted file mode 100644 index bf77fd9..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/abstract_walker.js +++ /dev/null
@@ -1,176 +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. - -/** - * @fileoverview An interface (and partial implementation) for the basic - * traversal through some piece of the dom. - * For each different ordered (either in dom or by any other metric) set - * of "valid selections" (just set from now on), a new - * base class should be defined that implements this interface. For example, - * there are subclasses for words, sentences, and lowest-level dom nodes. - * These classes should all be stateless; this makes testing much more - * effective at pinpointing errors. - * For all of the operations in this interface, the position in the dom on - * which to operate is given by a CursorSelection, see that file for - * documentation. - * The two main operations that currently exist for walkers are sync and - * next. See the docs where those functions are defined. - * Since most operations are hard to even define if there is no root element, - * all operations may assume that the selection given is attached to the body - * node. The behavior is undefined if any part of the selection passed in - * is not attached to the body. As a user of this class, it is your - * responsibility to make sure the selection is attached. - * No operation may visibly modify any of its arguments. In particular, take - * care with CursorSelections, since setReversed modifies the selection. - * For all documentation, = refers to the method equals for CursorSelections - * comparison. - * Thinking of adding something in this class? Here are some good questions to - * ask: - * Is this an operation that applies to any element of any arbitrary set? - * If not, then it probably doesn't belong here. - * Does it need to know something other than the set that it operates on? - * If so, then it probably doesn't belong here. - * - * This interface resembles a C++ STL bidirectional iterator. Additions should - * keep this in mind. - * - */ - - -goog.provide('cvox.AbstractWalker'); - -goog.require('cvox.CursorSelection'); -goog.require('cvox.NavBraille'); - -/** - * @constructor - */ -cvox.AbstractWalker = function() {}; - - -/** - * This takes a valid CursorSelection and returns the directed-next - * valid CursorSelection in the dom, or null. For example, if the walker - * navigates across sentences, this would return the selection of the sentence - * following the selection passed in. If sel is at the "end" of a section, - * this method may return null. In the example above, if we try to next on - * the last sentence in the dom, we would return null. - * Note that sel must be a valid selection. Undefined behavior if it isn't. - * There are several invariants that must hold for any subclasses. There may - * not be explicit tests for these, but subclasses are responsible for ensuring - * them and callers may assume them: - * 1) next(next(sel).setReversed(!sel.isReversed())) = sel for all sel if sel - * is a valid CursorSelection and next(sel) != null. - * That is, the valid elements for this walker are totally ordered; going - * forward and then backward returns us to the same cell. - * 2) next(sel).isReversed() = sel.isReversed() for all sel if sel is a - * valid CursorSelection and next(sel) != null. - * That is, next preserves direction. - * @param {!cvox.CursorSelection} sel The valid selection to start moving from. - * @return {cvox.CursorSelection} Returns the valid selection the walker moves - * to. null if directed end of section is reached. - */ -cvox.AbstractWalker.prototype.next = goog.abstractMethod; - - -/** - * Syncs and returns the first or last valid, non-null selection in the - * this walker's linearization of the DOM. - * @param {{reversed: (undefined|boolean)}=} kwargs Extra arguments. - * reversed: If true, syncs to the end and returns a reversed selection. - * False by default. - * @return {!cvox.CursorSelection} The valid selection. - */ -cvox.AbstractWalker.prototype.begin = function(kwargs) { - kwargs = kwargs || {reversed: false}; - - return /** @type {!cvox.CursorSelection} */ ( - this.sync(cvox.CursorSelection.fromBody().setReversed(kwargs.reversed))); -}; - - -/** - * This takes an arbitrary CursorSelection and returns a valid CursorSelection, - * or null. For example, if the walker navigates across - * text nodes, and the selection passed in is for a single character within a - * larger text node, this method should return a text node. No restrictions - * are made as to exactly what selection should be returned, but it should be - * something "reasonable", and from the user's point of view, "close" to the - * previous selection. If no such selection exists, null may be returned. - * Note that, since CursorSelection has a direction, syncing to a selection - * should make sense in either direction. - * Note also that, as mentioned in the file overview, this operation has - * undefined behavior if the input selection is not attached to the body. - * There are several invariants that must hold for any subclasses. While they - * may not all be tested for at the time, subclasses are responsible for - * making sure these hold, and any caller may assume these to be true: - * 1) sync(sel) = sel iff sel is a valid selection - * This defines the set of valid selections for this walker. - * Note, in particular, that this implies sync(sync(sel)) = sync(sel) - * whenever sync(sel) != null. - * 2) sync(sel).isReversed() = sel.isReversed() for all sel if sync(sel) != null - * That is, sync preserves direction. - * Why do these restrictions exist? Because it makes it much easier to reason - * about the effect (and intent) of an operation if we can make these - * assumptions. - * @param {!cvox.CursorSelection} sel The (possibly unsynched) selection. - * @return {cvox.CursorSelection} The synched selection. - */ -cvox.AbstractWalker.prototype.sync = goog.abstractMethod; - - -/** - * Returns an array of NavDescriptions that defines what should be said - * by the tts engine on traversal from prevSel to sel. While this is - * introducing knowledge (of NavDescriptions) into this class that - * it shouldn't know, this is currently the best place for this method - * to reside, as the set of valid CursorSelections must be known. - * sel must be valid CursorSelections for this walker, prevSel may be any - * selection. Undefined behavior otherwise. - * @param {!cvox.CursorSelection} prevSel The valid previous selection. - * @param {!cvox.CursorSelection} sel The valid current selection. - * @return {!Array<!cvox.NavDescription>} The description array. - */ -cvox.AbstractWalker.prototype.getDescription = goog.abstractMethod; - - -/** - * Returns a NavBraille that defines what should be brailled on traversal from - * prevSel to sel. - * sel must be valid CursorSelections for this walker, prevSel may be any - * selection. Undefined behavior otherwise. - * @param {!cvox.CursorSelection} prevSel The valid previous selection. - * @param {!cvox.CursorSelection} sel The valid current selection. - * @return {!cvox.NavBraille} The braille description. - */ -cvox.AbstractWalker.prototype.getBraille = goog.abstractMethod; - - -/** - * Returns if this walker supports the given action. - * @param {string} name Action name. - * @return {boolean} True if action supported. - */ -cvox.AbstractWalker.prototype.hasAction = function(name) { - return typeof(this[name]) == 'function'; -}; - -/** - * Performs an action specific to the walker. - * @param {string} name Action name. - * @param {!cvox.CursorSelection} sel The current selection. - * @return {cvox.CursorSelection} Selection after action. - */ -cvox.AbstractWalker.prototype.performAction = function(name, sel) { - if (this.hasAction(name)) { - return this[name](sel); - } - return null; -}; - -/** - * Returns message string of the walker's granularity. - * @return {string} The message string. - */ -cvox.AbstractWalker.prototype.getGranularityMsg = goog.abstractMethod;
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/bare_object_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/bare_object_walker.js deleted file mode 100644 index c45f3a85..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/bare_object_walker.js +++ /dev/null
@@ -1,32 +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. - -/** - * @fileoverview A JavaScript class for walking the leaf nodes of the dom. - * This is a bare class that tries to limit dependencies. It should only be used - * when traversal of the leaf nodes is required (e.g. by other walkers), but - * no other walker functionality (such as being able to describe the position). - * It should not be used for user-visible navigation. - */ - - -goog.provide('cvox.BareObjectWalker'); - -goog.require('cvox.AbstractNodeWalker'); - -/** - * @constructor - * @extends {cvox.AbstractNodeWalker} - */ -cvox.BareObjectWalker = function() { - goog.base(this); -}; -goog.inherits(cvox.BareObjectWalker, cvox.AbstractNodeWalker); - -/** - * @override - */ -cvox.BareObjectWalker.prototype.stopNodeDescent = function(node) { - return cvox.DomUtil.isLeafNode(node); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/character_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/character_walker.js deleted file mode 100644 index 32621a67..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/character_walker.js +++ /dev/null
@@ -1,44 +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. - -/** - * @fileoverview A class for walking one character at a time. - */ - - -goog.provide('cvox.CharacterWalker'); - -goog.require('cvox.AbstractSelectionWalker'); -goog.require('cvox.TraverseContent'); - -/** - * @constructor - * @extends {cvox.AbstractSelectionWalker} - */ -cvox.CharacterWalker = function() { - cvox.AbstractSelectionWalker.call(this); - this.grain = cvox.TraverseContent.kCharacter; -}; -goog.inherits(cvox.CharacterWalker, cvox.AbstractSelectionWalker); - -/** - * @override - */ -cvox.CharacterWalker.prototype.getDescription = function(prevSel, sel) { - var desc = goog.base(this, 'getDescription', prevSel, sel); - desc.forEach(function(item) { - if (!item.personality) { - item.personality = {}; - } - item.personality['phoneticCharacters'] = true; - }); - return desc; -}; - -/** - * @override - */ -cvox.CharacterWalker.prototype.getGranularityMsg = function() { - return Msgs.getMsg('character_granularity'); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/column_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/column_walker.js deleted file mode 100644 index d39bea0..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/column_walker.js +++ /dev/null
@@ -1,38 +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. - -/** - * @fileoverview A class for walking columns. - */ - - -goog.provide('cvox.ColumnWalker'); - -goog.require('cvox.TableWalker'); - - -/** - * @constructor - * @extends {cvox.TableWalker} - */ -cvox.ColumnWalker = function() { - goog.base(this); -}; -goog.inherits(cvox.ColumnWalker, cvox.TableWalker); - - -/** - * @override - */ -cvox.ColumnWalker.prototype.next = function(sel) { - return this.nextCol(sel); -}; - - -/** - * @override - */ -cvox.ColumnWalker.prototype.getGranularityMsg = function() { - return Msgs.getMsg('column_granularity'); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/group_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/group_walker.js deleted file mode 100644 index 5015d3f..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/group_walker.js +++ /dev/null
@@ -1,59 +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. - -/** - * @fileoverview A class for walking "groups". Groups, intuitively, are logical - * collections of dom elements. See AbstractNodeWalker and the - * stopNodeDescent() method here for how groups are defined. - */ - - -goog.provide('cvox.GroupWalker'); - -goog.require('cvox.AbstractNodeWalker'); -goog.require('cvox.BrailleUtil'); -goog.require('cvox.CursorSelection'); -goog.require('cvox.DescriptionUtil'); -goog.require('cvox.DomUtil'); -goog.require('cvox.GroupUtil'); - - -/** - * @constructor - * @extends {cvox.AbstractNodeWalker} - */ -cvox.GroupWalker = function() { - cvox.AbstractNodeWalker.call(this); -}; -goog.inherits(cvox.GroupWalker, cvox.AbstractNodeWalker); - - -/** - * @override - */ -cvox.GroupWalker.prototype.getDescription = function(prevSel, sel) { - return cvox.DescriptionUtil.getCollectionDescription(prevSel, sel); -}; - - -/** - * @override - */ -cvox.GroupWalker.prototype.getBraille = function(prevSel, sel) { - throw 'getBraille is unsupported'; -}; - -/** - * @override - */ -cvox.GroupWalker.prototype.getGranularityMsg = function() { - return Msgs.getMsg('group_strategy'); -}; - -/** - * @override - */ -cvox.GroupWalker.prototype.stopNodeDescent = function(node) { - return cvox.GroupUtil.isLeafNode(node); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/layout_line_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/layout_line_walker.js deleted file mode 100644 index bc9315f..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/layout_line_walker.js +++ /dev/null
@@ -1,246 +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. - -/** - * @fileoverview A JavaScript class for walking lines consisting of one or more - * clickable nodes. - */ - - -goog.provide('cvox.LayoutLineWalker'); - -goog.require('cvox.AbstractWalker'); -goog.require('cvox.StructuralLineWalker'); - - -/** - * @constructor - * @extends {cvox.AbstractWalker} - */ -cvox.LayoutLineWalker = function() { - this.subWalker_ = new cvox.StructuralLineWalker(); -}; -goog.inherits(cvox.LayoutLineWalker, cvox.AbstractWalker); - - -/** - * @override - */ -cvox.LayoutLineWalker.prototype.next = function(sel) { - // Collapse selection to the directed end. - var endSel = new cvox.CursorSelection(sel.end, sel.end, sel.isReversed()); - - // Sync to the line. - var sync = this.subWalker_.sync(endSel); - if (!sync) { - return null; - } - - // Compute the next selection. - var start = this.subWalker_.next(endSel); - if (!start) { - return null; - } - start.setReversed(sel.isReversed()); - return this.extend_(start).setReversed(false); -}; - - -/** - * @override - */ -cvox.LayoutLineWalker.prototype.sync = function(sel) { - var line = this.subWalker_.sync(sel); - if (!line) { - return null; - } - - // Extend to both line breaks (in each direction). - var end = this.extend_(line); - var start = this.extend_(line.setReversed(!line.isReversed())); - - return new cvox.CursorSelection(start.end, end.end, sel.isReversed()); -}; - - -/** - * @override - */ -cvox.LayoutLineWalker.prototype.getDescription = function(prevSel, sel) { - var descriptions = []; - var prev = prevSel; - var absSel = sel.clone().setReversed(false); - var cur = new cvox.CursorSelection(absSel.start, absSel.start); - cur = this.subWalker_.sync(cur); - if (!cur) { - return []; - } - - // No need to accumulate descriptions. - if (absSel.start.node == absSel.end.node) { - return this.subWalker_.getDescription(prevSel, sel); - } - - // Walk through and collect descriptions for each line. - while (cur && !cur.end.equals(absSel.end)) { - descriptions.push.apply( - descriptions, this.subWalker_.getDescription(prev, cur)); - prev = cur; - cur = this.subWalker_.next(cur); - } - if (cur) { - descriptions.push.apply( - descriptions, this.subWalker_.getDescription(prev, cur)); - } - return descriptions; -}; - - -/** - * @override - */ -cvox.LayoutLineWalker.prototype.getBraille = function(prevSel, sel) { - var braille = new cvox.NavBraille({}); - var absSel = this.subWalker_.sync(sel.clone().setReversed(false)); - var layoutSel = this.sync(sel).setReversed(false); - if (!layoutSel || !absSel) { - return braille; - } - var cur = new cvox.CursorSelection(layoutSel.start, layoutSel.start); - cur = this.subWalker_.sync(cur); - if (!cur) { - return braille; - } - - // Walk through and collect braille for each line. - while (cur && !cur.end.equals(layoutSel.end)) { - this.appendBraille_(prevSel, absSel, cur, braille); - prevSel = cur; - cur = this.subWalker_.next(cur); - } - if (cur) { - this.appendBraille_(prevSel, absSel, cur, braille); - } - return braille; -}; - - -/** - * @override - */ -cvox.LayoutLineWalker.prototype.getGranularityMsg = function() { - return Msgs.getMsg('layout_line'); -}; - - -/** - * Compares two selections and determines if the lie on the same horizontal - * line as determined by their bounding rectangles. - * @param {!cvox.CursorSelection} lSel Left selection. - * @param {!cvox.CursorSelection} rSel Right selection. - * @return {boolean} Whether lSel and rSel are on different visual lines. - * @private - */ -cvox.LayoutLineWalker.prototype.isVisualLineBreak_ = function(lSel, rSel) { - if (this.wantsOwnLine_(lSel.end.node) || - this.wantsOwnLine_(rSel.start.node)) { - return true; - } - var lRect = lSel.getRange().getBoundingClientRect(); - var rRect = rSel.getRange().getBoundingClientRect(); - - // Some ranges from the browser give us 0-sized rects (such as in the case of - // select's). Detect these cases and use a more reliable method (take the - // bounding rect of the actual element rather than the range). - if (lRect.width == 0 && lRect.height == 0 && - lSel.end.node.nodeType == Node.ELEMENT_NODE) { - lRect = lSel.end.node.getBoundingClientRect(); - } - - if (rRect.width == 0 && rRect.height == 0 && - rSel.start.node.nodeType == Node.ELEMENT_NODE) { - rRect = rSel.start.node.getBoundingClientRect(); - } - return lRect.bottom != rRect.bottom; -}; - - -/** - * Determines if node should force a line break. - * This is used for elements with unusual semantics, such as multi-line - * text fields, where the behaviour would otherwise be confusing. - * @param {Node} node Node. - * @return {boolean} True if the node should appear next to a line break. - * @private - */ -cvox.LayoutLineWalker.prototype.wantsOwnLine_ = function(node) { - if (!node) { - return false; - } - return node instanceof HTMLTextAreaElement || - node.parentNode instanceof HTMLTextAreaElement; -}; - - -/** - * Extends a given cursor selection up to the next visual line break. - * @param {!cvox.CursorSelection} start The selection. - * @return {!cvox.CursorSelection} The resulting selection. - * @private - */ -cvox.LayoutLineWalker.prototype.extend_ = function(start) { - // Extend the selection up to just before a new visual line break. - var end = start; - var next = start; - - do { - end = next; - next = this.subWalker_.next(end); - } while (next && !this.isVisualLineBreak_(end, next)); - return new cvox.CursorSelection(start.start, end.end, start.isReversed()); -}; - - -/** - * Private routine to append braille given three selections. - * @param {!cvox.CursorSelection} prevSel A previous selection in walker - * ordering. - * @param {!cvox.CursorSelection} sel A selection that represents the location - * of the braille cursor. - * @param {!cvox.CursorSelection} cur The specific selection to append. - * @param {!cvox.NavBraille} braille Braille on which to append. - * @private - */ -cvox.LayoutLineWalker.prototype.appendBraille_ = function( - prevSel, sel, cur, braille) { - var item = this.subWalker_.getBraille(prevSel, cur).text; - var valueSelectionSpan = item.getSpanInstanceOf(cvox.ValueSelectionSpan); - - if (braille.text.length > 0) { - braille.text.append(cvox.BrailleUtil.ITEM_SEPARATOR); - } - - // Find the surrounding logical "leaf node". - // This prevents us from labelling the braille output with the wrong node, - // such as a text node child of a <textarea>. - var node = cur.start.node; - while (node.parentNode && cvox.DomUtil.isLeafNode(node.parentNode)) { - node = node.parentNode; - } - - var nodeStart = braille.text.length; - var nodeEnd = nodeStart + item.length; - braille.text.append(item); - braille.text.setSpan(node, nodeStart, nodeEnd); - - if (sel && cur.absEquals(sel)) { - if (valueSelectionSpan) { - braille.startIndex = nodeStart + item.getSpanStart(valueSelectionSpan); - braille.endIndex = nodeStart + item.getSpanEnd(valueSelectionSpan); - } else { - braille.startIndex = nodeStart; - braille.endIndex = nodeStart + 1; - } - } -};
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/object_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/object_walker.js deleted file mode 100644 index 337ee1b..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/object_walker.js +++ /dev/null
@@ -1,53 +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. - -/** - * @fileoverview A JavaScript class for walking the leaf nodes of the dom. - */ - - -goog.provide('cvox.ObjectWalker'); - -goog.require('cvox.AbstractNodeWalker'); -goog.require('cvox.BrailleUtil'); -goog.require('cvox.DescriptionUtil'); - -/** - * @constructor - * @extends {cvox.AbstractNodeWalker} - */ -cvox.ObjectWalker = function() { - goog.base(this); -}; -goog.inherits(cvox.ObjectWalker, cvox.AbstractNodeWalker); - -/** - * @override - */ -cvox.ObjectWalker.prototype.stopNodeDescent = function(node) { - return cvox.DomUtil.isLeafNode(node); -}; - -// TODO(dtseng): Causes a circular dependency if put into AbstractNodeWalker. -/** - * @override - */ -cvox.AbstractNodeWalker.prototype.getDescription = function(prevSel, sel) { - return cvox.DescriptionUtil.getDescriptionFromNavigation( - prevSel.end.node, sel.start.node, true, cvox.ChromeVox.verbosity); -}; - -/** - * @override - */ -cvox.ObjectWalker.prototype.getBraille = function(prevSel, sel) { - throw 'getBraille is unsupported'; -}; - -/** - * @override - */ -cvox.ObjectWalker.prototype.getGranularityMsg = function() { - return Msgs.getMsg('object_strategy'); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/row_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/row_walker.js deleted file mode 100644 index b6d94a3..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/row_walker.js +++ /dev/null
@@ -1,38 +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. - -/** - * @fileoverview A class for walking rows. - */ - - -goog.provide('cvox.RowWalker'); - -goog.require('cvox.TableWalker'); - - -/** - * @constructor - * @extends {cvox.TableWalker} - */ -cvox.RowWalker = function() { - goog.base(this); -}; -goog.inherits(cvox.RowWalker, cvox.TableWalker); - - -/** - * @override - */ -cvox.RowWalker.prototype.next = function(sel) { - return this.nextRow(sel); -}; - - -/** - * @override - */ -cvox.RowWalker.prototype.getGranularityMsg = function() { - return Msgs.getMsg('row_granularity'); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/sentence_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/sentence_walker.js deleted file mode 100644 index 2213db3c..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/sentence_walker.js +++ /dev/null
@@ -1,30 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview A JavaScript class for walking sentences. - */ - - -goog.provide('cvox.SentenceWalker'); - -goog.require('cvox.AbstractSelectionWalker'); -goog.require('cvox.TraverseContent'); - -/** - * @constructor - * @extends {cvox.AbstractSelectionWalker} - */ -cvox.SentenceWalker = function() { - cvox.AbstractSelectionWalker.call(this); - this.grain = cvox.TraverseContent.kSentence; -}; -goog.inherits(cvox.SentenceWalker, cvox.AbstractSelectionWalker); - -/** - * @override - */ -cvox.SentenceWalker.prototype.getGranularityMsg = function() { - return Msgs.getMsg('sentence_granularity'); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/structural_line_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/structural_line_walker.js deleted file mode 100644 index d87dcee..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/structural_line_walker.js +++ /dev/null
@@ -1,79 +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. - -/** - * @fileoverview A JavaScript class for walking lines. - */ - - -goog.provide('cvox.StructuralLineWalker'); - -goog.require('cvox.AbstractSelectionWalker'); -goog.require('cvox.BrailleUtil'); -goog.require('cvox.TraverseContent'); - -/** - * @constructor - * @extends {cvox.AbstractSelectionWalker} - */ -cvox.StructuralLineWalker = function() { - goog.base(this); - this.grain = cvox.TraverseContent.kLine; -}; -goog.inherits(cvox.StructuralLineWalker, cvox.AbstractSelectionWalker); - - -/** - * @override - */ -cvox.StructuralLineWalker.prototype.getGranularityMsg = function() { - return Msgs.getMsg('structural_line'); -}; - - -/** - * @override - */ -cvox.StructuralLineWalker.prototype.getDescription = function(prevSel, sel) { - var desc = goog.base(this, 'getDescription', prevSel, sel); - desc[0].text = - cvox.DomUtil.getPrefixText(sel.absStart().node, sel.absStart().index) + - desc[0].text; - return desc; -}; - - -/** - * @override - */ -cvox.StructuralLineWalker.prototype.getBraille = function(prevSel, sel) { - var braille = goog.base(this, 'getBraille', prevSel, sel); - - var objNode = this.objWalker_.sync(sel).absStart().node; - var node = sel.absStart().node; - var prevNode = prevSel.absEnd().node; - - // Show only the visible line in braille for DOM ranges. This overrides any - // labels computed for the node. - // - // <textarea> needs to be treated specially. It may have TextNode children, - // but these reflect the initial value of the node only, and are not updated - // as content changes. - var name = undefined; - if (!sel.start.equals(sel.end) && - !cvox.DomPredicates.editTextPredicate([objNode])) { - var prefix = - cvox.DomUtil.getPrefixText(sel.absStart().node, sel.absStart().index); - name = prefix + sel.getText(); - } - var spannable = - cvox.BrailleUtil.getTemplated(prevNode, objNode, {name: name}); - spannable.setSpan(objNode, 0, spannable.length); - braille.text = spannable; - - // Remove any selections. - braille.startIndex = 0; - braille.endIndex = 0; - return braille; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/table_shifter.js b/chrome/browser/resources/chromeos/chromevox/walkers/table_shifter.js deleted file mode 100644 index a951493..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/table_shifter.js +++ /dev/null
@@ -1,146 +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. - -/** - * @fileoverview Walkers to traverse a table. - */ - - -goog.provide('cvox.TableShifter'); - -goog.require('cvox.AbstractShifter'); -goog.require('cvox.ColumnWalker'); -goog.require('cvox.CursorSelection'); -goog.require('cvox.DomPredicates'); -goog.require('cvox.DomUtil'); -goog.require('cvox.NavBraille'); -goog.require('cvox.RowWalker'); - - -/** - * @constructor - * @extends {cvox.AbstractShifter} - */ -cvox.TableShifter = function() { - this.rowWalker_ = new cvox.RowWalker(); - this.columnWalker_ = new cvox.ColumnWalker(); - this.currentWalker_ = this.rowWalker_; - this.bumpedEdge_ = false; - this.begin_ = true; - goog.base(this); -}; -goog.inherits(cvox.TableShifter, cvox.AbstractShifter); - - -/** - * @override - */ -cvox.TableShifter.prototype.next = function(sel) { - var nextSel = this.currentWalker_.next(sel); - if (!nextSel) { - // Bumped edge. - this.bumpedEdge_ = true; - return sel; - } - return nextSel; -}; - - -/** - * @override - */ -cvox.TableShifter.prototype.sync = function(sel) { - if (sel.start.node.tagName == 'TABLE') { - return sel.isReversed() ? this.currentWalker_.goToLastCell(sel) : - this.currentWalker_.goToFirstCell(sel); - } - return this.currentWalker_.sync(sel); -}; - - -/** - * @override - */ -cvox.TableShifter.prototype.getName = function() { - return Msgs.getMsg('table_shifter'); -}; - - -/** - * @override - * @suppress {checkTypes} actual parameter 2 of - * Msgs.prototype.getMsg does not match formal parameter - * found : Array<number> - * required: (Array<string>|null|undefined) - */ -cvox.TableShifter.prototype.getDescription = function(prevSel, sel) { - var descs = this.currentWalker_.getDescription(prevSel, sel); - if (descs.length > 0) { - if (this.bumpedEdge_) { - descs[0].pushEarcon(cvox.Earcon.WRAP_EDGE); - this.bumpedEdge_ = false; - } - if (this.begin_) { - var len = descs.length; - var summaryText = this.currentWalker_.tt.summaryText(); - var locationInfo = this.currentWalker_.getLocationInfo(sel); - if (locationInfo != null) { - descs.push(new cvox.NavDescription({ - context: Msgs.getMsg('table_location', locationInfo), - text: '', - annotation: summaryText ? summaryText + ' ' : '' - })); - } - if (this.currentWalker_.tt.isSpanned()) { - descs.push(new cvox.NavDescription( - {text: '', annotation: Msgs.getMsg('spanned')})); - } - this.begin_ = false; - } - } - return descs; -}; - - -/** - * @override - */ -cvox.TableShifter.prototype.getBraille = function(prevSel, sel) { - return this.currentWalker_.getBraille(prevSel, sel); -}; - - -/** - * @override - */ -cvox.TableShifter.prototype.getGranularityMsg = function() { - return this.currentWalker_.getGranularityMsg(); -}; - - -/** - * @override - */ -cvox.TableShifter.prototype.makeLessGranular = function() { - goog.base(this, 'makeLessGranular'); - this.currentWalker_ = this.rowWalker_; -}; - - -/** - * @override - */ -cvox.TableShifter.prototype.makeMoreGranular = function() { - goog.base(this, 'makeMoreGranular'); - this.currentWalker_ = this.columnWalker_; -}; - -cvox.TableShifter.create = function(sel) { - var ancestors = cvox.DomUtil.getAncestors(sel.start.node); - if (cvox.DomPredicates.tablePredicate(ancestors) && - !cvox.DomPredicates.captionPredicate(ancestors)) { - return new cvox.TableShifter(); - } - return null; -};
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/table_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/table_walker.js deleted file mode 100644 index ed06a167..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/table_walker.js +++ /dev/null
@@ -1,419 +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. - -/** - * @fileoverview A class for walking tables. - * NOTE: This class has a very different interface than the other walkers. - * This means it does not lend itself easily to e.g. decorators. - * TODO (stoarca): This might be able to be fixed by breaking it up into - * separate walkers for cell, row and column. - */ - - -goog.provide('cvox.TableWalker'); - -goog.require('cvox.AbstractWalker'); -goog.require('cvox.BrailleUtil'); -goog.require('cvox.DescriptionUtil'); -goog.require('cvox.DomUtil'); -goog.require('cvox.NavDescription'); -goog.require('cvox.QueueMode'); -goog.require('cvox.TraverseTable'); - -/** - * @constructor - * @extends {cvox.AbstractWalker} - */ -cvox.TableWalker = function() { - cvox.AbstractWalker.call(this); - - /** - * Only used as a cache for faster lookup. - * @type {!cvox.TraverseTable} - */ - this.tt = new cvox.TraverseTable(null); -}; -goog.inherits(cvox.TableWalker, cvox.AbstractWalker); - -/** - * @override - */ -cvox.TableWalker.prototype.next = function(sel) { - // TODO (stoarca): See bug 6677953 - return this.nextRow(sel); -}; - -/** - * @override - */ -cvox.TableWalker.prototype.sync = function(sel) { - return this.goTo_(sel, goog.bind(function(position) { - return this.tt.goToCell(position); - }, this)); -}; - -/** - * @override - * @suppress {checkTypes} actual parameter 2 of - * Msgs.prototype.getMsg does not match formal parameter - * found : Array<number> - * required: (Array<string>|null|undefined) - */ -cvox.TableWalker.prototype.getDescription = function(prevSel, sel) { - var position = this.syncPosition_(sel); - if (!position) { - return []; - } - this.tt.goToCell(position); - var descs = cvox.DescriptionUtil.getCollectionDescription(prevSel, sel); - if (descs.length == 0) { - descs.push( - new cvox.NavDescription({annotation: Msgs.getMsg('empty_cell')})); - } - return descs; -}; - -/** - * @override - */ -cvox.TableWalker.prototype.getBraille = function(prevSel, sel) { - var ret = new cvox.NavBraille({}); - var position = this.syncPosition_(sel); - if (position) { - var text = - cvox.BrailleUtil.getTemplated(prevSel.start.node, sel.start.node); - text.append(' ' + ++position[0] + '/' + ++position[1]); - } - return new cvox.NavBraille({text: text}); -}; - -/** - * @override - */ -cvox.TableWalker.prototype.getGranularityMsg = goog.abstractMethod; - - -/** Table Actions. */ - - -/** - * Returns the first cell of the table that this selection is inside. - * @param {!cvox.CursorSelection} sel The selection. - * @return {cvox.CursorSelection} The selection for first cell of the table. - * @export - */ -cvox.TableWalker.prototype.goToFirstCell = function(sel) { - return this.goTo_(sel, goog.bind(function(position) { - return this.tt.goToCell([0, 0]); - }, this)); -}; - -/** - * Returns the last cell of the table that this selection is inside. - * @param {!cvox.CursorSelection} sel The selection. - * @return {cvox.CursorSelection} The selection for the last cell of the table. - * @export - */ -cvox.TableWalker.prototype.goToLastCell = function(sel) { - return this.goTo_(sel, goog.bind(function(position) { - return this.tt.goToLastCell(); - }, this)); -}; - -/** - * Returns the first cell of the row that the selection is in. - * @param {!cvox.CursorSelection} sel The selection. - * @return {cvox.CursorSelection} The selection for the first cell in the row. - * @export - */ -cvox.TableWalker.prototype.goToRowFirstCell = function(sel) { - return this.goTo_(sel, goog.bind(function(position) { - return this.tt.goToCell([position[0], 0]); - }, this)); -}; - -/** - * Returns the last cell of the row that the selection is in. - * @param {!cvox.CursorSelection} sel The selection. - * @return {cvox.CursorSelection} The selection for the last cell in the row. - * @export - */ -cvox.TableWalker.prototype.goToRowLastCell = function(sel) { - return this.goTo_(sel, goog.bind(function(position) { - return this.tt.goToRowLastCell(); - }, this)); -}; - -/** - * Returns the first cell of the column that the selection is in. - * @param {!cvox.CursorSelection} sel The selection. - * @return {cvox.CursorSelection} The selection for the first cell in the col. - * @export - */ -cvox.TableWalker.prototype.goToColFirstCell = function(sel) { - return this.goTo_(sel, goog.bind(function(position) { - return this.tt.goToCell([0, position[1]]); - }, this)); -}; - -/** - * Returns the last cell of the column that the selection is in. - * @param {!cvox.CursorSelection} sel The selection. - * @return {cvox.CursorSelection} The selection for the last cell in the col. - * @export - */ -cvox.TableWalker.prototype.goToColLastCell = function(sel) { - return this.goTo_(sel, goog.bind(function(position) { - return this.tt.goToColLastCell(); - }, this)); -}; - -/** - * Returns the first cell in the row after the current selection. - * @param {!cvox.CursorSelection} sel The selection. - * @return {cvox.CursorSelection} The selection for the first cell in the next - * row. - * @export - */ -cvox.TableWalker.prototype.nextRow = function(sel) { - return this.goTo_(sel, goog.bind(function(position) { - return this.tt.goToCell( - [position[0] + (sel.isReversed() ? -1 : 1), position[1]]); - }, this)); -}; - -/** - * Returns the first cell in the column after the current selection. - * @param {!cvox.CursorSelection} sel The selection. - * @return {cvox.CursorSelection} The selection for the first cell in the - * next col. - * @export - */ -cvox.TableWalker.prototype.nextCol = function(sel) { - return this.goTo_(sel, goog.bind(function(position) { - return this.tt.goToCell( - [position[0], position[1] + (sel.isReversed() ? -1 : 1)]); - }, this)); -}; - -/** - * @param {!cvox.CursorSelection} sel The current selection. - * @return {cvox.CursorSelection} The resulting selection. - * @export - */ -cvox.TableWalker.prototype.announceHeaders = function(sel) { - cvox.ChromeVox.tts.speak( - this.getHeaderText_(sel), cvox.QueueMode.FLUSH, - cvox.AbstractTts.PERSONALITY_ANNOTATION); - return sel; -}; - -/** - * @param {!cvox.CursorSelection} sel The current selection. - * @return {cvox.CursorSelection} The resulting selection. - * @export - */ -cvox.TableWalker.prototype.speakTableLocation = function(sel) { - cvox.ChromeVox.navigationManager.speakDescriptionArray( - this.getLocationDescription_(sel), cvox.QueueMode.FLUSH, null); - return sel; -}; - - -/** - * @param {!cvox.CursorSelection} sel The current selection. - * @return {cvox.CursorSelection} The resulting selection. - * @export - */ -cvox.TableWalker.prototype.exitShifterContent = function(sel) { - var tableNode = this.getTableNode_(sel); - if (!tableNode) { - return null; - } - var nextNode = cvox.DomUtil.directedNextLeafNode(tableNode, false); - return cvox.CursorSelection.fromNode(nextNode); -}; - - -/** End of actions. */ - - -/** - * Returns the text content of the header(s) of the cell that contains sel. - * @param {!cvox.CursorSelection} sel The selection. - * @return {!string} The header text. - * @private - */ -cvox.TableWalker.prototype.getHeaderText_ = function(sel) { - this.tt.initialize(this.getTableNode_(sel)); - var position = this.tt.findNearestCursor(sel.start.node); - if (!position) { - return Msgs.getMsg('not_inside_table'); - } - if (!this.tt.goToCell(position)) { - return Msgs.getMsg('not_inside_table'); - } - return ( - this.getRowHeaderText_(position) + ' ' + - this.getColHeaderText_(position)); -}; - -/** - * Returns the location description. - * @param {!cvox.CursorSelection} sel A valid selection. - * @return {Array<cvox.NavDescription>} The location description. - * @suppress {checkTypes} actual parameter 2 of - * Msgs.prototype.getMsg does not match - * formal parameter - * found : Array<number> - * required: (Array<string>|null|undefined) - * @private - */ -cvox.TableWalker.prototype.getLocationDescription_ = function(sel) { - var locationInfo = this.getLocationInfo(sel); - if (locationInfo == null) { - return null; - } - return [new cvox.NavDescription( - {text: Msgs.getMsg('table_location', locationInfo)})]; -}; - -/** - * Returns the text content of the row header(s) of the cell that contains sel. - * @param {!Array<number>} position The selection. - * @return {!string} The header text. - * @private - */ -cvox.TableWalker.prototype.getRowHeaderText_ = function(position) { - // TODO(stoarca): OPTMZ Replace with join(); - var rowHeaderText = ''; - - var rowHeaders = this.tt.getCellRowHeaders(); - if (rowHeaders.length == 0) { - var firstCellInRow = this.tt.getCellAt([position[0], 0]); - rowHeaderText += cvox.DomUtil.collapseWhitespace( - cvox.DomUtil.getValue(firstCellInRow) + ' ' + - cvox.DomUtil.getName(firstCellInRow)); - return Msgs.getMsg('row_header') + rowHeaderText; - } - - for (var i = 0; i < rowHeaders.length; ++i) { - rowHeaderText += cvox.DomUtil.collapseWhitespace( - cvox.DomUtil.getValue(rowHeaders[i]) + ' ' + - cvox.DomUtil.getName(rowHeaders[i])); - } - if (rowHeaderText == '') { - return Msgs.getMsg('empty_row_header'); - } - return Msgs.getMsg('row_header') + rowHeaderText; -}; - -/** - * Returns the text content of the col header(s) of the cell that contains sel. - * @param {!Array<number>} position The selection. - * @return {!string} The header text. - * @private - */ -cvox.TableWalker.prototype.getColHeaderText_ = function(position) { - // TODO(stoarca): OPTMZ Replace with join(); - var colHeaderText = ''; - - var colHeaders = this.tt.getCellColHeaders(); - if (colHeaders.length == 0) { - var firstCellInCol = this.tt.getCellAt([0, position[1]]); - colHeaderText += cvox.DomUtil.collapseWhitespace( - cvox.DomUtil.getValue(firstCellInCol) + ' ' + - cvox.DomUtil.getName(firstCellInCol)); - return Msgs.getMsg('column_header') + colHeaderText; - } - - for (var i = 0; i < colHeaders.length; ++i) { - colHeaderText += cvox.DomUtil.collapseWhitespace( - cvox.DomUtil.getValue(colHeaders[i]) + ' ' + - cvox.DomUtil.getName(colHeaders[i])); - } - if (colHeaderText == '') { - return Msgs.getMsg('empty_row_header'); - } - return Msgs.getMsg('column_header') + colHeaderText; -}; - -/** - * Returns the location info of sel within the containing table. - * @param {!cvox.CursorSelection} sel The selection. - * @return {Array<number>} The location info: - * [row index, row count, col index, col count]. - */ -cvox.TableWalker.prototype.getLocationInfo = function(sel) { - this.tt.initialize(this.getTableNode_(sel)); - var position = this.tt.findNearestCursor(sel.start.node); - if (!position) { - return null; - } - // + 1 to account for 0-indexed - return [ - position[0] + 1, this.tt.rowCount, position[1] + 1, this.tt.colCount - ].map(function(x) { - return Msgs.getNumber(x); - }); -}; - -/** - * Returns true if sel is inside a table. - * @param {!cvox.CursorSelection} sel The selection. - * @return {boolean} True if inside a table node. - */ -cvox.TableWalker.prototype.isInTable = function(sel) { - return this.getTableNode_(sel) != null; -}; - -/** - * Wrapper for going to somewhere so that boilerplate is not repeated. - * @param {!cvox.CursorSelection} sel The selection from which to base the - * movement. - * @param {function(Array<number>):boolean} f The function to use for moving. - * Returns true on success and false on failure. - * @return {cvox.CursorSelection} The resulting selection. - * @private - */ -cvox.TableWalker.prototype.goTo_ = function(sel, f) { - if (!sel.end.node) { - return null; - } - this.tt.initialize(this.getTableNode_(sel)); - var position = this.tt.findNearestCursor(sel.end.node); - if (!position) { - return null; - } - this.tt.goToCell(position); - if (!f(position)) { - return null; - } - return cvox.CursorSelection.fromNode(this.tt.getCell()) - .setReversed(sel.isReversed()); -}; - -/** - * Returns the nearest table node containing the end of the selection - * @param {!cvox.CursorSelection} sel The selection. - * @return {Node} The table node containing sel. null if not in a table. - * @private - */ -cvox.TableWalker.prototype.getTableNode_ = function(sel) { - return cvox.DomUtil.getContainingTable(sel.end.node); -}; - -/** - * Sync the backing traversal utility to the given selection. - * @param {!cvox.CursorSelection} sel The selection. - * @return {Array<number>} The position [x, y] of the selection. - * @private - */ -cvox.TableWalker.prototype.syncPosition_ = function(sel) { - var tableNode = this.getTableNode_(sel); - this.tt.initialize(tableNode); - // we need to align the TraverseTable with our sel because our walker - // uses parts of it (for example isSpanned relies on being at a specific cell) - return this.tt.findNearestCursor(sel.end.node); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/walker_unittest_base.js b/chrome/browser/resources/chromeos/chromevox/walkers/walker_unittest_base.js deleted file mode 100644 index 0e0d099..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/walker_unittest_base.js +++ /dev/null
@@ -1,238 +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. - -GEN_INCLUDE(['../testing/chromevox_unittest_base.js']); - -/** - * Base class for walker test fixtures. - * @constructor - * @extends {ChromeVoxUnitTestBase} - */ -function ChromeVoxWalkerUnitTestBase() {} - -ChromeVoxWalkerUnitTestBase.prototype = { - __proto__: ChromeVoxUnitTestBase.prototype, - - /** @override */ - closureModuleDeps: ['TestMsgs', 'cvox.CursorSelection'], - - /** - * Common set up for all walker test cases. - */ - setUp: function() { - // Needed for getDescription and getGranularityMsg. - Msgs = TestMsgs; - - // Delete all nodes in the body. - while (document.body.hasChildNodes()) { - document.body.removeChild(document.body.lastChild); - } - - this.walker = this.newWalker(); - }, - - /** - * Returns a new walker appropriate for the child test. - * @return {!cvox.AbstractWalker} The walker instance. - */ - // Closure library is not available when this literal is evaluated, so - // we can't use goog.abstractMethod here. - newWalker: function() { - throw Error('newWalker not implemented.'); - }, - - /** - * Makes testing much less verbose. Executes the command on the - * selection, then asserts that for all the parameters passed in desc, - * the new selection matches. Returns the new selections if assertion passes. - * NOTE: If you change the parameters here, you should also change the - * whitelist above. - * @param {!cvox.CursorSelection} sel The selection. - * @param {!string|!cvox.CursorSelection} opt_cmdOrDest The command to - * execute, or the override returned selection. - * @param {{selText: string=, - * selNodeId: string=, - * selParentNodeId: string=, - * selStartIndex: number=, - * selEndIndex: number=, - * selReversed: boolean=, - * descText: string=, - * descContext: string=, - * descAnnotation: string=, - * descUserValue: string=, - * descPersonality: string=}} desc The parameters to assert. - * selText: The text in the new selection matches for both start and end. - * selNodeId: The node in the new selection matches for both start and end. - * selParentNodeId: The parent node of both start and end matches. - * selStartIndex: The index of the absolute start. - * selEndIndex: The index of the absolute end. - * selReversed: True if should be reversed. - * descText: The text in the NavDescription when getDescription is called. - * descContext: The context in the NavDescription - * descAnnotation: The annotation in the NavDescription - * descUserValue: The userValue in the NavDescription - * descPersonality: The personality in the NavDescription - * @return {cvox.CursorSelection} The new selection. - */ - go: function(sel, opt_cmdOrDest, desc) { - if (opt_cmdOrDest instanceof cvox.CursorSelection) { - var ret = opt_cmdOrDest; - } else { - if (ChromeVoxWalkerUnitTestBase.CMD_WHITELIST.indexOf(opt_cmdOrDest) == - -1) { - // Intentionally fail the test if there's a typo. - throw 'Got an invalid command: "' + opt_cmdOrDest + '".'; - } - - var ret = this.walker[opt_cmdOrDest](sel); - } - - if (ret == null) { - assertEquals(null, desc); - return; - } - if (desc == null) { - assertEquals(null, ret); - return; - } - - for (var key in desc) { - if (ChromeVoxWalkerUnitTestBase.DESC_WHITELIST.indexOf(key) == -1) { - throw 'Invalid key in desc parameter: "' + key + '".'; - } - } - - // Intentionally only check one-to-one and not onto. This allows us to - // write tests that just ignore everything except what we care about. - if (desc.hasOwnProperty('selText')) { - assertEquals(desc.selText, ret.start.text); - assertEquals(desc.selText, ret.end.text); - } - if (desc.hasOwnProperty('selNodeId')) { - assertEquals(desc.selNodeId, ret.start.node.id); - assertEquals(desc.selNodeId, ret.end.node.id); - } - if (desc.hasOwnProperty('selParentNodeId')) { - assertEquals(desc.selParentNodeId, ret.start.node.parentNode.id); - assertEquals(desc.selParentNodeId, ret.end.node.parentNode.id); - } - if (desc.hasOwnProperty('selStartIndex')) { - assertEquals(desc.selStartIndex, ret.absStart().index); - } - if (desc.hasOwnProperty('selEndIndex')) { - assertEquals(desc.selEndIndex, ret.absEnd().index); - } - if (desc.hasOwnProperty('selReversed')) { - assertEquals(desc.selReversed, ret.isReversed()); - } - - var trueDesc = this.walker.getDescription(sel, ret)[0]; - if (desc.hasOwnProperty('descText')) { - assertEquals(desc.descText, trueDesc.text); - } - if (desc.hasOwnProperty('descContext')) { - assertEquals(desc.descContext, trueDesc.context); - } - if (desc.hasOwnProperty('descAnnotation')) { - assertEquals(desc.descAnnotation, trueDesc.annotation); - } - if (desc.hasOwnProperty('descUserValue')) { - assertEquals(desc.descUserValue, trueDesc.userValue); - } - if (desc.hasOwnProperty('descPersonality')) { - assertEquals(desc.descPersonality, trueDesc.personality); - } - - return ret; - }, -}; - -/** - * Whitelist for the commands that are allowed to be executed with go(). - * @type {Array.string} - * @const - */ -ChromeVoxWalkerUnitTestBase.CMD_WHITELIST = - ['next', 'sync', 'nextRow', 'nextCol']; - -/** - * Whitelist for the properties that can be asserted with go(). - * @type {Array.string} - * @const - */ -ChromeVoxWalkerUnitTestBase.DESC_WHITELIST = [ - 'selText', 'selNodeId', 'selParentNodeId', 'selStartIndex', 'selEndIndex', - 'selReversed', 'descText', 'descContext', 'descAnnotation', 'descUserValue', - 'descPersonality' -]; - -/** - * Adds common walker tests - * @param {string} testFixture Name of the test fixture class. - */ -ChromeVoxWalkerUnitTestBase.addCommonTests = function(testFixture) { - /** - * Ensures that syncing to the beginning and ends of the page return - * not null. - */ - TEST_F(testFixture, 'testSyncToPage', function() { - this.loadDoc(function() { /*! - <div><p id="a">a</p></div> - */ }); - var ret = this.walker.begin(); - assertNotEquals(null, ret); - ret = this.walker.begin({reversed: true}); - assertNotEquals(null, ret); - }); - - /** - * Ensures that sync(sync(sel)) = sync(sel) - * TODO (stoarca): The interfaces are not frozen yet. In particular, - * for TableWalker, sync can return null. Override if it doesn't work yet. - */ - TEST_F(testFixture, 'testSyncInvariant', function() { - this.loadDoc(function() { /*! - <div id="outer"> - <p id="a">a</p> - <p id="b">b</p> - <p id="c">c</p> - <p id="d">d</p> - <h1 id="A">h1</h1> - <p id="e">e</p> - <h1 id="B">h1</h1> - </div> - */ }); - var sel = cvox.CursorSelection.fromNode($('outer').firstChild); - var sync = this.walker.sync(sel); - var syncsync = this.walker.sync(sync); - assertEquals(true, sync.equals(syncsync)); - - sel = cvox.CursorSelection.fromNode($('a')); - sync = this.walker.sync(sel); - syncsync = this.walker.sync(sync); - assertEquals(true, sync.equals(syncsync)); - - sel = cvox.CursorSelection.fromNode($('e')); - sync = this.walker.sync(sel); - syncsync = this.walker.sync(sync); - assertEquals(true, sync.equals(syncsync)); - - sel = cvox.CursorSelection.fromBody(); - sync = this.walker.sync(sel); - syncsync = this.walker.sync(sync); - assertEquals(true, sync.equals(syncsync)); - }); - - /** - * Ensures that all operations work on an empty body. - */ - TEST_F(testFixture, 'testEmptyBody', function() { - var sel = cvox.CursorSelection.fromBody(); - - // Testing for infinite loop. If one exists, this test will fail by timing - // out. - var sync = this.walker.sync(sel); - var next = this.walker.next(sel); - }); -};
diff --git a/chrome/browser/resources/chromeos/chromevox/walkers/word_walker.js b/chrome/browser/resources/chromeos/chromevox/walkers/word_walker.js deleted file mode 100644 index 6256387f..0000000 --- a/chrome/browser/resources/chromeos/chromevox/walkers/word_walker.js +++ /dev/null
@@ -1,30 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview A class for walking one word at a time. - */ - - -goog.provide('cvox.WordWalker'); - -goog.require('cvox.AbstractSelectionWalker'); -goog.require('cvox.TraverseContent'); - -/** - * @constructor - * @extends {cvox.AbstractSelectionWalker} - */ -cvox.WordWalker = function() { - cvox.AbstractSelectionWalker.call(this); - this.grain = cvox.TraverseContent.kWord; -}; -goog.inherits(cvox.WordWalker, cvox.AbstractSelectionWalker); - -/** - * @override - */ -cvox.WordWalker.prototype.getGranularityMsg = function() { - return Msgs.getMsg('word_granularity'); -};
diff --git a/chrome/browser/resources/hats/hats.html b/chrome/browser/resources/hats/hats.html index 49eddbd..d6d7e50 100644 --- a/chrome/browser/resources/hats/hats.html +++ b/chrome/browser/resources/hats/hats.html
@@ -16,13 +16,6 @@ /* Needs to override dynamically loaded, more specific styles. */ outline-color: rgb(77, 144, 254) !important; } - /* Make sure scroll bars are added only when necessary, the overriden - * value is 'scroll' which causes scroll bars always show. - * TODO(weili): Remove this once the overriden value changed to auto. - */ - #t402-prompt.t402-prompt-websat-modal { - overflow: auto !important; - } </style> <script> /**
diff --git a/chrome/browser/resources/local_ntp/local_ntp.js b/chrome/browser/resources/local_ntp/local_ntp.js index 18a23da9..27154bc 100644 --- a/chrome/browser/resources/local_ntp/local_ntp.js +++ b/chrome/browser/resources/local_ntp/local_ntp.js
@@ -269,13 +269,6 @@ let isDeletingInput = false; /** - * The rendered autocomplete match currently being deleted, or null if there - * isn't one. - * @type {?Element} - */ -let matchElBeingDeleted = null; - -/** * The last blacklisted tile rid if any, which by definition should not be * filler. * @type {?number} @@ -761,9 +754,8 @@ realboxEl.addEventListener('cut', onRealboxCutCopy); realboxEl.addEventListener('input', onRealboxInput); - const realboxWrapper = $(IDS.REALBOX_INPUT_WRAPPER); - realboxWrapper.addEventListener('focusin', onRealboxWrapperFocusIn); - realboxWrapper.addEventListener('focusout', onRealboxWrapperFocusOut); + setRealboxWrapperListenForFocusIn(true); + setRealboxWrapperListenForFocusOut(true); searchboxApiHandle.onqueryautocompletedone = onQueryAutocompleteDone; searchboxApiHandle.ondeleteautocompletematch = onDeleteAutocompleteMatch; @@ -1076,10 +1068,7 @@ /** @param {!DeleteAutocompleteMatchResult} result */ function onDeleteAutocompleteMatch(result) { - assert(matchElBeingDeleted); - if (!result.success) { - matchElBeingDeleted = null; return; } @@ -1091,7 +1080,6 @@ const wasFocused = matchEls[selected].contains(document.activeElement); populateAutocompleteMatches(result.matches); - matchElBeingDeleted = null; if (result.matches.length === 0) { if (wasFocused) { @@ -1174,7 +1162,7 @@ return; } - $(IDS.REALBOX_MATCHES).firstElementChild.classList.add(CLASSES.SELECTED); + selectMatchEl(assert($(IDS.REALBOX_MATCHES).firstElementChild)); // If the user is deleting content, don't quickly re-suggest the same // output. @@ -1248,18 +1236,14 @@ /** @param {Event} e */ function onRealboxWrapperFocusOut(e) { - const target = /** @type {Element} */ (e.target); - if (matchElBeingDeleted && matchElBeingDeleted.contains(target)) { - // When a match is being deleted, the focus gets dropped temporariliy as the - // element is deleted from the DOM. Don't stop autocomplete in those cases. - return; - } - + // Hide the matches and stop autocomplete only when the focus goes outside of + // the realbox wrapper. const relatedTarget = /** @type {Element} */ (e.relatedTarget); const realboxWrapper = $(IDS.REALBOX_INPUT_WRAPPER); if (!realboxWrapper.contains(relatedTarget)) { setRealboxMatchesVisible(false); - // Note: intentionally leaving keydown listening and match data intact. + // Note: intentionally leaving keydown listening (see + // onRealboxWrapperKeydown) and match data intact. window.chrome.embeddedSearch.searchBox.stopAutocomplete( /*clearResult=*/ true); } @@ -1307,7 +1291,6 @@ if (key === 'Delete') { if (e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey && autocompleteMatches[selected].supportsDeletion) { - matchElBeingDeleted = matchEls[selected]; window.chrome.embeddedSearch.searchBox.deleteAutocompleteMatch(selected); e.preventDefault(); } @@ -1476,14 +1459,20 @@ renderMatchClassifications(match.contents, match.contentsClass); const descriptionEls = []; const separatorEls = []; + let separatorText = ''; if (match.description) { descriptionEls.push(...renderMatchClassifications( match.description, match.descriptionClass)); - separatorEls.push(document.createTextNode( - configData.translatedStrings.realboxSeparator)); + separatorText = configData.translatedStrings.realboxSeparator; + separatorEls.push(document.createTextNode(separatorText)); } + const ariaLabel = match.swapContentsAndDescription ? + match.description + separatorText + match.contents : + match.contents + separatorText + match.description; + matchEl.setAttribute('aria-label', ariaLabel); + const layout = match.swapContentsAndDescription ? [descriptionEls, separatorEls, contentsEls] : [contentsEls, separatorEls, descriptionEls]; @@ -1500,7 +1489,6 @@ e.preventDefault(); // Stops default browser action (focus) }; icon.onclick = e => { - matchElBeingDeleted = matchEl; window.chrome.embeddedSearch.searchBox.deleteAutocompleteMatch(i); e.preventDefault(); // Stops default browser action (navigation) }; @@ -1513,17 +1501,22 @@ realboxMatchesEl.classList.add(CLASSES.REMOVABLE); } - // TODO(crbug.com/1002689): set a more useful aria-label on |matchEl|, as - // "Remove suggestion" is now uttered when navigating through matches. - realboxMatchesEl.append(matchEl); } + // When the matches are replaced, the focus gets dropped temporariliy as the + // focused element is being deleted from the DOM. Stop listening to 'focusout' + // event and retore it immediately after since we don't want to stop + // autocomplete in those cases. + setRealboxWrapperListenForFocusOut(false); + $(IDS.REALBOX_MATCHES).remove(); realboxMatchesEl.id = IDS.REALBOX_MATCHES; $(IDS.REALBOX_INPUT_WRAPPER).appendChild(realboxMatchesEl); + setRealboxWrapperListenForFocusOut(true); + const hasMatches = matches.length > 0; setRealboxMatchesVisible(hasMatches); setRealboxWrapperListenForKeydown(hasMatches); @@ -1748,6 +1741,7 @@ Array.from($(IDS.REALBOX_MATCHES).children).forEach((matchEl, i) => { const found = matchEl === elToSelect; matchEl.classList.toggle(CLASSES.SELECTED, found); + matchEl.setAttribute('aria-selected', found); if (found) { selectedIndex = i; } @@ -1841,6 +1835,26 @@ } /** @param {boolean} listen */ +function setRealboxWrapperListenForFocusIn(listen) { + const realboxWrapper = $(IDS.REALBOX_INPUT_WRAPPER); + if (listen) { + realboxWrapper.addEventListener('focusin', onRealboxWrapperFocusIn); + } else { + realboxWrapper.removeEventListener('focusin', onRealboxWrapperFocusIn); + } +} + +/** @param {boolean} listen */ +function setRealboxWrapperListenForFocusOut(listen) { + const realboxWrapper = $(IDS.REALBOX_INPUT_WRAPPER); + if (listen) { + realboxWrapper.addEventListener('focusout', onRealboxWrapperFocusOut); + } else { + realboxWrapper.removeEventListener('focusout', onRealboxWrapperFocusOut); + } +} + +/** @param {boolean} listen */ function setRealboxWrapperListenForKeydown(listen) { const realboxWrapper = $(IDS.REALBOX_INPUT_WRAPPER); if (listen) {
diff --git a/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.html b/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.html index 070ed2d..5436aeca1 100644 --- a/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.html +++ b/chrome/browser/resources/settings/privacy_page/security_keys_credential_management_dialog.html
@@ -76,9 +76,9 @@ <div id="credentials"> <div id="header" class="list-item column-header"> + <div class="checkbox-placeholder"></div> <div class="site">$i18n{securityKeysCredentialWebsite}</div> <div class="user">$i18n{securityKeysCredentialUsername}</div> - <div class="checkbox-placeholder"></div> </div> <div id="container"> @@ -86,16 +86,16 @@ class="cr-separators list-with-header"> <template> <div class="list-item"> + <cr-checkbox on-change="checkedCredentialsChanged_" + data-id$="[[item.id]]" + checked="[[credentialIsChecked_(item.id)]]" + disabled="[[deleteInProgress_]]"></cr-checkbox> <div class="site" aria-label="[[item.relyingPartyId]]"> <site-favicon url="[[item.relyingPartyId]]"> </site-favicon> <div>[[item.relyingPartyId]]</div> </div> <div class="user">[[formatUser_(item)]]</div> - <cr-checkbox on-change="checkedCredentialsChanged_" - data-id$="[[item.id]]" - checked="[[credentialIsChecked_(item.id)]]" - disabled="[[deleteInProgress_]]"></cr-checkbox> </div> </template> </iron-list>
diff --git a/chrome/browser/resources/tab_strip/tab.html b/chrome/browser/resources/tab_strip/tab.html index 30c8de8..6825bef 100644 --- a/chrome/browser/resources/tab_strip/tab.html +++ b/chrome/browser/resources/tab_strip/tab.html
@@ -1,6 +1,5 @@ <style> :host { - --tabstrip-tab-title-height: 40px; --tabstrip-tab-transition-duration: 250ms; cursor: pointer;
diff --git a/chrome/browser/resources/tab_strip/tab.js b/chrome/browser/resources/tab_strip/tab.js index cafce9b..b9cb691 100644 --- a/chrome/browser/resources/tab_strip/tab.js +++ b/chrome/browser/resources/tab_strip/tab.js
@@ -212,7 +212,7 @@ const animation = this.animate( [ {maxWidth: 0, opacity: 0}, - {maxWidth: '280px', opacity: 1}, + {maxWidth: 'var(--tabstrip-tab-width)', opacity: 1}, ], { duration: DEFAULT_ANIMATION_DURATION, @@ -229,7 +229,7 @@ return new Promise(resolve => { const animation = this.animate( [ - {maxWidth: '280px', opacity: 1}, + {maxWidth: 'var(--tabstrip-tab-width)', opacity: 1}, {maxWidth: 0, opacity: 0}, ], {
diff --git a/chrome/browser/resources/tab_strip/tab_list.html b/chrome/browser/resources/tab_strip/tab_list.html index 94b3b51..eb6ddf5 100644 --- a/chrome/browser/resources/tab_strip/tab_list.html +++ b/chrome/browser/resources/tab_strip/tab_list.html
@@ -1,5 +1,9 @@ <style> :host { + --tabstrip-tab-height: calc(var(--tabstrip-tab-title-height) + + var(--tabstrip-tab-thumbnail-height)); + --tabstrip-tab-width: var(--tabstrip-tab-thumbnail-width); + background: var(--tabstrip-background-color); box-sizing: border-box; display: flex;
diff --git a/chrome/browser/resources/tab_strip/tab_list.js b/chrome/browser/resources/tab_strip/tab_list.js index cba61f3..5a95ed9 100644 --- a/chrome/browser/resources/tab_strip/tab_list.js +++ b/chrome/browser/resources/tab_strip/tab_list.js
@@ -73,6 +73,8 @@ /** @type {!Element} */ ( this.shadowRoot.querySelector('#tabsContainer')); + addWebUIListener( + 'layout-changed', layout => this.applyCSSDictionary_(layout)); addWebUIListener('theme-changed', () => this.fetchAndUpdateColors_()); this.tabStripEmbedderProxy_.observeThemeChanges(); @@ -114,8 +116,21 @@ this.animationPromises = this.animationPromises.then(() => promise); } + /** + * @param {!Object<string, string>} dictionary + * @private + */ + applyCSSDictionary_(dictionary) { + for (const [cssVariable, value] of Object.entries(dictionary)) { + this.style.setProperty(cssVariable, value); + } + } + connectedCallback() { + this.tabStripEmbedderProxy_.getLayout().then( + layout => this.applyCSSDictionary_(layout)); this.fetchAndUpdateColors_(); + this.tabsApi_.getTabs().then(tabs => { tabs.forEach(tab => this.onTabCreated_(tab)); this.moveOrScrollToActiveTab_(); @@ -153,11 +168,8 @@ /** @private */ fetchAndUpdateColors_() { - this.tabStripEmbedderProxy_.getColors().then(colors => { - for (const [cssVariable, rgbaValue] of Object.entries(colors)) { - this.style.setProperty(cssVariable, rgbaValue); - } - }); + this.tabStripEmbedderProxy_.getColors().then( + colors => this.applyCSSDictionary_(colors)); } /**
diff --git a/chrome/browser/resources/tab_strip/tab_strip.html b/chrome/browser/resources/tab_strip/tab_strip.html index 08df098..6939bd2 100644 --- a/chrome/browser/resources/tab_strip/tab_strip.html +++ b/chrome/browser/resources/tab_strip/tab_strip.html
@@ -14,8 +14,6 @@ --google-blue-500-rgb: 66, 133, 244; --tabstrip-background-color: $i18n{frameColor}; - --tabstrip-tab-height: 216px; - --tabstrip-tab-width: 288px; --tabstrip-tab-border-radius: 8px; --tabstrip-tab-active-border-color: rgb(var(--google-blue-500-rgb)); }
diff --git a/chrome/browser/resources/tab_strip/tab_strip_embedder_proxy.js b/chrome/browser/resources/tab_strip/tab_strip_embedder_proxy.js index 6852de8..a9bfeea 100644 --- a/chrome/browser/resources/tab_strip/tab_strip_embedder_proxy.js +++ b/chrome/browser/resources/tab_strip/tab_strip_embedder_proxy.js
@@ -18,6 +18,14 @@ return sendWithPromise('getThemeColors'); } + /** + * @return {!Promise<!Object<string, string>>} Object with CSS variables + * as keys and pixel lengths as values + */ + getLayout() { + return sendWithPromise('getLayout'); + } + observeThemeChanges() { chrome.send('observeThemeChanges'); }
diff --git a/chrome/browser/sync/wifi_configuration_sync_service_factory.cc b/chrome/browser/sync/wifi_configuration_sync_service_factory.cc index 26767a8..7083e5f5 100644 --- a/chrome/browser/sync/wifi_configuration_sync_service_factory.cc +++ b/chrome/browser/sync/wifi_configuration_sync_service_factory.cc
@@ -39,10 +39,10 @@ KeyedService* WifiConfigurationSyncServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { + Profile* profile = Profile::FromBrowserContext(context); return new chromeos::sync_wifi::WifiConfigurationSyncService( - chrome::GetChannel(), ModelTypeStoreServiceFactory::GetForProfile( - Profile::FromBrowserContext(context)) - ->GetStoreFactory()); + chrome::GetChannel(), profile->GetPrefs(), + ModelTypeStoreServiceFactory::GetForProfile(profile)->GetStoreFactory()); } void WifiConfigurationSyncServiceFactory::RegisterProfilePrefs(
diff --git a/chrome/browser/ui/android/page_info/connection_info_popup_android.cc b/chrome/browser/ui/android/page_info/connection_info_popup_android.cc index 9182a23..ebc513881 100644 --- a/chrome/browser/ui/android/page_info/connection_info_popup_android.cc +++ b/chrome/browser/ui/android/page_info/connection_info_popup_android.cc
@@ -99,8 +99,8 @@ headline = identity_info.site_identity; } - ScopedJavaLocalRef<jstring> description = - ConvertUTF8ToJavaString(env, identity_info.identity_status_description); + ScopedJavaLocalRef<jstring> description = ConvertUTF8ToJavaString( + env, identity_info.identity_status_description_android); base::string16 certificate_label; // Only show the certificate viewer link if the connection actually used a
diff --git a/chrome/browser/ui/ash/assistant/proactive_suggestions_client_impl.cc b/chrome/browser/ui/ash/assistant/proactive_suggestions_client_impl.cc index 1d7bd8f..4aaa5a0 100644 --- a/chrome/browser/ui/ash/assistant/proactive_suggestions_client_impl.cc +++ b/chrome/browser/ui/ash/assistant/proactive_suggestions_client_impl.cc
@@ -118,6 +118,14 @@ SetActiveUrl(active_contents_->GetURL()); } +void ProactiveSuggestionsClientImpl::OnAssistantFeatureAllowedChanged( + ash::mojom::AssistantAllowedState state) { + // When the Assistant feature is allowed/disallowed we may need to resume/ + // pause observation of the browser. We accomplish this by updating active + // state. + UpdateActiveState(); +} + void ProactiveSuggestionsClientImpl::OnAssistantSettingsEnabled(bool enabled) { // When Assistant is enabled/disabled in settings we may need to resume/pause // observation of the browser. We accomplish this by updating active state. @@ -209,10 +217,12 @@ auto* tab_strip_model = active_browser_->tab_strip_model(); // We never observe browsers that are off the record and we never observe - // browsers when the user has disabled either Assistant or screen context. We - // also don't observe the browser when the user has disabled history sync or - // is using a sync passphrase. + // browsers when the Assistant feature is not allowed. We also don't observe + // the browser when the user has disabled either Assistant or screen context + // or when the user has disabled history sync or is using a sync passphrase. if (active_browser_->profile()->IsOffTheRecord() || + ash::AssistantState::Get()->allowed_state() != + ash::mojom::AssistantAllowedState::ALLOWED || !ash::AssistantState::Get()->settings_enabled().value_or(false) || !ash::AssistantState::Get()->context_enabled().value_or(false) || !IsHistorySyncEnabledWithoutPassphrase(profile_)) {
diff --git a/chrome/browser/ui/ash/assistant/proactive_suggestions_client_impl.h b/chrome/browser/ui/ash/assistant/proactive_suggestions_client_impl.h index fdc1c216c..8d216dc 100644 --- a/chrome/browser/ui/ash/assistant/proactive_suggestions_client_impl.h +++ b/chrome/browser/ui/ash/assistant/proactive_suggestions_client_impl.h
@@ -51,6 +51,8 @@ content::NavigationHandle* navigation_handle) override; // AssistantStateObserver: + void OnAssistantFeatureAllowedChanged( + ash::mojom::AssistantAllowedState state) override; void OnAssistantSettingsEnabled(bool enabled) override; void OnAssistantContextEnabled(bool enabled) override;
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index fa58585..28d2608e 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc
@@ -173,6 +173,7 @@ #include "components/keep_alive_registry/scoped_keep_alive.h" #include "components/omnibox/browser/location_bar_model_impl.h" #include "components/page_load_metrics/browser/metrics_web_contents_observer.h" +#include "components/page_load_metrics/common/page_load_metrics.mojom.h" #include "components/prefs/pref_service.h" #include "components/safe_browsing/triggers/ad_redirect_trigger.h" #include "components/search/search.h" @@ -222,6 +223,7 @@ #include "extensions/common/manifest_handlers/background_info.h" #include "net/base/filename_util.h" #include "third_party/blink/public/common/frame/blocked_navigation_types.h" +#include "third_party/blink/public/mojom/web_feature/web_feature.mojom.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/window_open_disposition.h" #include "ui/gfx/geometry/point.h" @@ -639,7 +641,7 @@ find_bar_controller_.get()); find_bar_controller_->ChangeWebContents( tab_strip_model_->GetActiveWebContents()); - find_bar_controller_->find_bar()->MoveWindowIfNecessary(gfx::Rect()); + find_bar_controller_->find_bar()->MoveWindowIfNecessary(); } return find_bar_controller_.get(); } @@ -1533,6 +1535,18 @@ if (is_type_normal()) return; + page_load_metrics::mojom::PageLoadFeatures features; + features.features.push_back(blink::mojom::WebFeature::kMovedOrResizedPopup); + if (creation_timer_.Elapsed() > base::TimeDelta::FromSeconds(2)) { + // Additionally measure whether a popup was moved after creation, to + // distinguish between popups that reposition themselves after load and + // those which move popups continuously. + features.features.push_back( + blink::mojom::WebFeature::kMovedOrResizedPopup2sAfterCreation); + } + + page_load_metrics::MetricsWebContentsObserver::RecordFeatureUsage( + source->GetMainFrame(), features); window_->SetBounds(bounds); } @@ -2230,7 +2244,7 @@ if (HasFindBarController()) { find_bar_controller_->ChangeWebContents(new_contents); - find_bar_controller_->find_bar()->MoveWindowIfNecessary(gfx::Rect()); + find_bar_controller_->find_bar()->MoveWindowIfNecessary(); } // Update sessions (selected tab index and last active time). Don't force
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index 8b8ec34..7a6d155 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h
@@ -19,6 +19,7 @@ #include "base/memory/weak_ptr.h" #include "base/scoped_observer.h" #include "base/strings/string16.h" +#include "base/timer/elapsed_timer.h" #include "build/build_config.h" #include "chrome/browser/devtools/devtools_toggle_action.h" #include "chrome/browser/ui/bookmarks/bookmark_bar.h" @@ -1151,6 +1152,8 @@ extension_browser_window_helper_; #endif + const base::ElapsedTimer creation_timer_; + // The following factory is used for chrome update coalescing. base::WeakPtrFactory<Browser> chrome_updater_factory_{this};
diff --git a/chrome/browser/ui/cocoa/task_manager_mac.mm b/chrome/browser/ui/cocoa/task_manager_mac.mm index 95ba3072..5363cdd5 100644 --- a/chrome/browser/ui/cocoa/task_manager_mac.mm +++ b/chrome/browser/ui/cocoa/task_manager_mac.mm
@@ -555,11 +555,14 @@ NSButtonCell* buttonCell = static_cast<NSButtonCell*>(cell); NSString* title = [self modelTextForRow:rowIndex column:[[tableColumn identifier] intValue]]; - [buttonCell setTitle:title]; - [buttonCell - setImage:taskManagerMac_->GetImageForRow(viewToModelMap_[rowIndex])]; - [buttonCell setRefusesFirstResponder:YES]; // Don't push in like a button. - [buttonCell setHighlightsBy:NSNoCellMask]; + buttonCell.attributedTitle = [[[NSAttributedString alloc] + initWithString:title + attributes:@{NSForegroundColorAttributeName : [NSColor blackColor]}] + autorelease]; + buttonCell.image = + taskManagerMac_->GetImageForRow(viewToModelMap_[rowIndex]); + buttonCell.refusesFirstResponder = YES; // Don't push in like a button. + buttonCell.highlightsBy = NSNoCellMask; } return cell;
diff --git a/chrome/browser/ui/find_bar/find_bar.h b/chrome/browser/ui/find_bar/find_bar.h index 349f796..9305f5b 100644 --- a/chrome/browser/ui/find_bar/find_bar.h +++ b/chrome/browser/ui/find_bar/find_bar.h
@@ -46,13 +46,9 @@ // Stop the animation. virtual void StopAnimation() = 0; - // If the find bar obscures the search results we need to move the window. To - // do that we need to know what is selected on the page. We simply calculate - // where it would be if we place it on the left of the selection and if it - // doesn't fit on the screen we try the right side. The parameter - // |selection_rect| is expected to have coordinates relative to the top of - // the web page area. - virtual void MoveWindowIfNecessary(const gfx::Rect& selection_rect) = 0; + // Repaints and lays out the find bar window relative to the view layout state + // of the current browser window. + virtual void MoveWindowIfNecessary() = 0; // Set the text in the find box. virtual void SetFindTextAndSelectedRange(
diff --git a/chrome/browser/ui/page_info/page_info.cc b/chrome/browser/ui/page_info/page_info.cc index 44b18cf..283a630 100644 --- a/chrome/browser/ui/page_info/page_info.cc +++ b/chrome/browser/ui/page_info/page_info.cc
@@ -674,8 +674,10 @@ // All about: URLs except about:blank are redirected. DCHECK_EQ(url::kAboutBlankURL, url.spec()); site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; - site_details_message_ = +#if defined(OS_ANDROID) + identity_status_description_android_ = l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY); +#endif site_connection_status_ = SITE_CONNECTION_STATUS_UNENCRYPTED; site_connection_details_ = l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, @@ -685,8 +687,10 @@ if (url.SchemeIs(content::kChromeUIScheme) || is_chrome_ui_native_scheme) { site_identity_status_ = SITE_IDENTITY_STATUS_INTERNAL_PAGE; - site_details_message_ = +#if defined(OS_ANDROID) + identity_status_description_android_ = l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE); +#endif site_connection_status_ = SITE_CONNECTION_STATUS_INTERNAL_PAGE; return; } @@ -700,8 +704,6 @@ if (security_level == security_state::SECURE_WITH_POLICY_INSTALLED_CERT) { #if defined(OS_CHROMEOS) site_identity_status_ = SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT; - site_details_message_ = l10n_util::GetStringFUTF16( - IDS_CERT_POLICY_PROVIDED_CERT_MESSAGE, UTF8ToUTF16(url.host())); #else DCHECK(false) << "Policy certificates exist only on ChromeOS"; #endif @@ -720,51 +722,65 @@ IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); } - site_details_message_.assign(l10n_util::GetStringFUTF16( - IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_VERIFIED, issuer_name)); +#if defined(OS_ANDROID) + // This string is shown on all non-error HTTPS sites on Android when + // the user taps "Details" link on page info. + identity_status_description_android_.assign(l10n_util::GetStringFUTF16( + IDS_PAGE_INFO_SECURE_IDENTITY_VERIFIED, issuer_name)); +#endif } if (security_state::IsSHA1InChain(visible_security_state)) { site_identity_status_ = SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM; - site_details_message_ += + +#if defined(OS_ANDROID) + identity_status_description_android_ += UTF8ToUTF16("\n\n") + l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_DEPRECATED_SIGNATURE_ALGORITHM); +#endif } } } else { // HTTP or HTTPS with errors (not warnings). - site_details_message_.assign(l10n_util::GetStringUTF16( - IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY)); if (!security_state::IsSchemeCryptographic(visible_security_state.url) || !visible_security_state.certificate) { site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; } else { site_identity_status_ = SITE_IDENTITY_STATUS_ERROR; } - +#if defined(OS_ANDROID) const base::string16 bullet = UTF8ToUTF16("\n • "); std::vector<ssl_errors::ErrorInfo> errors; ssl_errors::ErrorInfo::GetErrorsForCertStatus( certificate_, visible_security_state.cert_status, url, &errors); - for (size_t i = 0; i < errors.size(); ++i) { - site_details_message_ += bullet; - site_details_message_ += errors[i].short_description(); + + identity_status_description_android_.assign(l10n_util::GetStringUTF16( + IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY)); + for (const ssl_errors::ErrorInfo& error : errors) { + identity_status_description_android_ += bullet; + identity_status_description_android_ += error.short_description(); } if (visible_security_state.cert_status & net::CERT_STATUS_NON_UNIQUE_NAME) { - site_details_message_ += ASCIIToUTF16("\n\n"); - site_details_message_ += + identity_status_description_android_ += ASCIIToUTF16("\n\n"); + identity_status_description_android_ += l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_NON_UNIQUE_NAME); } +#endif } if (visible_security_state.malicious_content_status != security_state::MALICIOUS_CONTENT_STATUS_NONE) { // The site has been flagged by Safe Browsing. Takes precedence over TLS. + base::string16 safe_browsing_details; GetSafeBrowsingStatusByMaliciousContentStatus( visible_security_state.malicious_content_status, &safe_browsing_status_, - &site_details_message_); + &safe_browsing_details); +#if defined(OS_ANDROID) + identity_status_description_android_ = safe_browsing_details; +#endif + #if BUILDFLAG(FULL_SAFE_BROWSING) bool old_show_change_pw_buttons = show_change_password_buttons_; #endif @@ -787,15 +803,18 @@ } safety_tip_info_ = visible_security_state.safety_tip_info; +#if defined(OS_ANDROID) if (base::FeatureList::IsEnabled(security_state::features::kSafetyTipUI)) { - // site_details_message_ is only displayed on Android when the user taps - // "Details" link on the page info. Reuse the description from page info UI. + // identity_status_description_android_ is only displayed on Android when + // the user taps "Details" link on the page info. Reuse the description from + // page info UI. std::unique_ptr<PageInfoUI::SecurityDescription> security_description = PageInfoUI::CreateSafetyTipSecurityDescription(safety_tip_info_); if (security_description) { - site_details_message_ = security_description->details; + identity_status_description_android_ = security_description->details; } } +#endif // Site Connection // We consider anything less than 80 bits encryption to be weak encryption. @@ -1012,7 +1031,11 @@ if (base::FeatureList::IsEnabled(security_state::features::kSafetyTipUI)) { info.safety_tip_info = safety_tip_info_; } - info.identity_status_description = UTF16ToUTF8(site_details_message_); +#if defined(OS_ANDROID) + info.identity_status_description_android = + UTF16ToUTF8(identity_status_description_android_); +#endif + info.certificate = certificate_; info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; info.show_change_password_buttons = show_change_password_buttons_;
diff --git a/chrome/browser/ui/page_info/page_info.h b/chrome/browser/ui/page_info/page_info.h index 2cafe15..465d401 100644 --- a/chrome/browser/ui/page_info/page_info.h +++ b/chrome/browser/ui/page_info/page_info.h
@@ -204,10 +204,6 @@ return safe_browsing_status_; } - const base::string16& site_details_message() const { - return site_details_message_; - } - private: FRIEND_TEST_ALL_PREFIXES(PageInfoTest, NonFactoryDefaultAndRecentlyChangedPermissionsShown); @@ -285,10 +281,12 @@ // strings below to the corresponding UI code, in order to prevent // unnecessary UTF-8 string conversions. +#if defined(OS_ANDROID) // Details about the website's identity. If the website's identity has been - // verified then |site_details_message_| contains who verified the identity. - // This string will be displayed in the UI. - base::string16 site_details_message_; + // verified then |identity_status_description_android_| contains who verified + // the identity. This string will be displayed in the UI. + base::string16 identity_status_description_android_; +#endif // Set when the user has explicitly bypassed an SSL error for this host or // explicitly denied it (the latter of which is not currently possible in the
diff --git a/chrome/browser/ui/page_info/page_info_ui.h b/chrome/browser/ui/page_info/page_info_ui.h index c17978b..8c55c7f 100644 --- a/chrome/browser/ui/page_info/page_info_ui.h +++ b/chrome/browser/ui/page_info/page_info_ui.h
@@ -131,9 +131,13 @@ // Site's safety tip info. Only set if the feature is enabled to show the // Safety Tip UI. security_state::SafetyTipInfo safety_tip_info; + +#if defined(OS_ANDROID) // Textual description of the site's identity status that is displayed to // the user. - std::string identity_status_description; + std::string identity_status_description_android; +#endif + // The server certificate if a secure connection. scoped_refptr<net::X509Certificate> certificate; // Status of the site's connection.
diff --git a/chrome/browser/ui/test/test_browser_dialog.cc b/chrome/browser/ui/test/test_browser_dialog.cc index 662cb218..26ec1ad 100644 --- a/chrome/browser/ui/test/test_browser_dialog.cc +++ b/chrome/browser/ui/test/test_browser_dialog.cc
@@ -23,10 +23,10 @@ #if defined(TOOLKIT_VIEWS) #include "base/strings/strcat.h" +#include "ui/compositor/test/draw_waiter_for_test.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/views/test/widget_test.h" -#include "ui/views/widget/widget_observer.h" #endif namespace { @@ -56,18 +56,6 @@ DISALLOW_COPY_AND_ASSIGN(WidgetCloser); }; -class CompositorObserverEnd : public ui::CompositorObserver { - public: - void OnCompositingEnded(ui::Compositor* compositor) override { - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - run_loop_.QuitClosure()); - } - void WaitForComplete() { run_loop_.Run(); } - - private: - base::RunLoop run_loop_; -}; - #endif // defined(TOOLKIT_VIEWS) } // namespace @@ -85,13 +73,6 @@ UpdateWidgets(); } -void CompareAsync(const BrowserSkiaGoldPixelDiff* pixel_diff, - const std::string& name, - const views::View* view, - bool* result) { - *result = pixel_diff->CompareScreenshot(name, view); -} - // This returns true if exactly one views widget was shown that is a dialog or // has a name matching the test-specified name, and if that window is in the // work area (if |should_verify_dialog_bounds_| is true). @@ -120,26 +101,15 @@ #if !defined(OS_MACOSX) if (pixel_diff_) { // Wait for painting complete. - auto* compositor = dialog_widget->GetNativeView()->layer()->GetCompositor(); - CompositorObserverEnd obend; - compositor->AddObserver(&obend); - obend.WaitForComplete(); - compositor->RemoveObserver(&obend); + auto* compositor = dialog_widget->GetCompositor(); + ui::DrawWaiterForTest::WaitForCompositingEnded(compositor); - base::ScopedAllowBlockingForTesting allow_blocking; pixel_diff_->Init(dialog_widget, "BrowserUiDialog"); auto* test_info = testing::UnitTest::GetInstance()->current_test_info(); const std::string test_name = base::StrCat({test_info->test_case_name(), "_", test_info->name()}); - bool result = false; - base::RunLoop run_loop; - base::ThreadTaskRunnerHandle::Get()->PostTaskAndReply( - FROM_HERE, - base::BindOnce(CompareAsync, pixel_diff_.get(), test_name, - dialog_widget->GetContentsView(), &result), - run_loop.QuitClosure()); - run_loop.Run(); - if (!result) + if (!pixel_diff_->CompareScreenshot(test_name, + dialog_widget->GetContentsView())) return false; } #endif // OS_MACOSX
diff --git a/chrome/browser/ui/views/find_bar_host.cc b/chrome/browser/ui/views/find_bar_host.cc index 71754f10..cddda7db 100644 --- a/chrome/browser/ui/views/find_bar_host.cc +++ b/chrome/browser/ui/views/find_bar_host.cc
@@ -102,24 +102,8 @@ DropdownBarHost::StopAnimation(); } -void FindBarHost::MoveWindowIfNecessary(const gfx::Rect& selection_rect) { - // We only move the window if one is active for the current WebContents. If we - // don't check this, then SetDialogPosition below will end up making the Find - // Bar visible. - content::WebContents* web_contents = find_bar_controller_->web_contents(); - if (!web_contents) - return; - - FindTabHelper* find_tab_helper = FindTabHelper::FromWebContents(web_contents); - if (!find_tab_helper || !find_tab_helper->find_ui_active()) - return; - - gfx::Rect new_pos = GetDialogPosition(selection_rect); - SetDialogPosition(new_pos); - - // May need to redraw our frame to accommodate bookmark bar styles. - view()->Layout(); // Bounds may have changed. - view()->SchedulePaint(); +void FindBarHost::MoveWindowIfNecessary() { + MoveWindowIfNecessaryWithRect(gfx::Rect()); } void FindBarHost::SetFindTextAndSelectedRange( @@ -144,7 +128,7 @@ find_bar_view()->ClearMatchCount(); // We now need to check if the window is obscuring the search results. - MoveWindowIfNecessary(result.selection_rect()); + MoveWindowIfNecessaryWithRect(result.selection_rect()); // Once we find a match we no longer want to keep track of what had // focus. EndFindSession will then set the focus to the page content. @@ -384,3 +368,24 @@ find_bar_controller_->web_contents()->GetViewBounds(); avoid_overlapping_rect->Offset(0, webcontents_rect.y() - frame_rect.y()); } + +void FindBarHost::MoveWindowIfNecessaryWithRect( + const gfx::Rect& selection_rect) { + // We only move the window if one is active for the current WebContents. If we + // don't check this, then SetDialogPosition below will end up making the Find + // Bar visible. + content::WebContents* web_contents = find_bar_controller_->web_contents(); + if (!web_contents) + return; + + FindTabHelper* find_tab_helper = FindTabHelper::FromWebContents(web_contents); + if (!find_tab_helper || !find_tab_helper->find_ui_active()) + return; + + gfx::Rect new_pos = GetDialogPosition(selection_rect); + SetDialogPosition(new_pos); + + // May need to redraw our frame to accommodate bookmark bar styles. + view()->Layout(); // Bounds may have changed. + view()->SchedulePaint(); +}
diff --git a/chrome/browser/ui/views/find_bar_host.h b/chrome/browser/ui/views/find_bar_host.h index a6506377..52dbcad 100644 --- a/chrome/browser/ui/views/find_bar_host.h +++ b/chrome/browser/ui/views/find_bar_host.h
@@ -54,7 +54,7 @@ void SetFocusAndSelection() override; void ClearResults(const FindNotificationDetails& results) override; void StopAnimation() override; - void MoveWindowIfNecessary(const gfx::Rect& selection_rect) override; + void MoveWindowIfNecessary() override; void SetFindTextAndSelectedRange(const base::string16& find_text, const gfx::Range& selected_range) override; base::string16 GetFindText() override; @@ -129,6 +129,14 @@ // Allows implementation to tweak widget position. void GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect); + // If the find bar obscures the search results we need to move the window. To + // do that we need to know what is selected on the page. We simply calculate + // where it would be if we place it on the left of the selection and if it + // doesn't fit on the screen we try the right side. The parameter + // |selection_rect| is expected to have coordinates relative to the top of + // the web page area. + void MoveWindowIfNecessaryWithRect(const gfx::Rect& selection_rect); + // Returns the FindBarView. FindBarView* find_bar_view() { return static_cast<FindBarView*>(view()); }
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc index 0840fa1..6b3fe7d 100644 --- a/chrome/browser/ui/views/find_bar_view.cc +++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -422,7 +422,7 @@ } else { find_tab_helper->StopFinding(FindOnPageSelectionAction::kClear); UpdateForResult(find_tab_helper->find_result(), base::string16()); - find_bar_host_->MoveWindowIfNecessary(gfx::Rect()); + find_bar_host_->MoveWindowIfNecessary(); // Clearing the text box should clear the prepopulate state so that when // we close and reopen the Find box it doesn't show the search we just
diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc index cc3a888..3136bd7 100644 --- a/chrome/browser/ui/views/frame/browser_view_layout.cc +++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -359,10 +359,8 @@ // code calls back into us to find the bounding box the find bar // must be laid out within, and that code depends on the // TabContentsContainer's bounds being up to date. - if (browser()->HasFindBarController()) { - browser()->GetFindBarController()->find_bar()->MoveWindowIfNecessary( - gfx::Rect()); - } + if (browser()->HasFindBarController()) + browser()->GetFindBarController()->find_bar()->MoveWindowIfNecessary(); // Adjust the fullscreen exit bubble bounds for |top_container_|'s new bounds. // This makes the fullscreen exit bubble look like it animates with
diff --git a/chrome/browser/ui/views/sad_tab_view.cc b/chrome/browser/ui/views/sad_tab_view.cc index f5a3ac5..37e1b10 100644 --- a/chrome/browser/ui/views/sad_tab_view.cc +++ b/chrome/browser/ui/views/sad_tab_view.cc
@@ -188,6 +188,18 @@ } } +void SadTabView::OnBoundsChanged(const gfx::Rect& previous_bounds) { + // Specify the maximum message and title width explicitly. + const int max_width = + std::min(width() - ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_UNRELATED_CONTROL_HORIZONTAL) * + 2, + kMaxContentWidth); + + message_->SizeToFit(max_width); + title_->SizeToFit(max_width); +} + void SadTabView::LinkClicked(views::Link* source, int event_flags) { PerformAction(Action::HELP_LINK); } @@ -198,18 +210,6 @@ PerformAction(Action::BUTTON); } -void SadTabView::Layout() { - // Specify the maximum message width explicitly. - const int max_width = - std::min(width() - ChromeLayoutProvider::Get()->GetDistanceMetric( - DISTANCE_UNRELATED_CONTROL_HORIZONTAL) * 2, kMaxContentWidth); - - message_->SizeToFit(max_width); - title_->SizeToFit(max_width); - - View::Layout(); -} - void SadTabView::OnPaint(gfx::Canvas* canvas) { if (!painted_) { RecordFirstPaint();
diff --git a/chrome/browser/ui/views/sad_tab_view.h b/chrome/browser/ui/views/sad_tab_view.h index 6a9c8cc..0ff2ffa 100644 --- a/chrome/browser/ui/views/sad_tab_view.h +++ b/chrome/browser/ui/views/sad_tab_view.h
@@ -48,7 +48,7 @@ void ReinstallInWebView() override; // Overridden from views::View: - void Layout() override; + void OnBoundsChanged(const gfx::Rect& previous_bounds) override; // Overridden from views::LinkListener: void LinkClicked(views::Link* source, int event_flags) override;
diff --git a/chrome/browser/ui/views/tabs/tab_group_underline.cc b/chrome/browser/ui/views/tabs/tab_group_underline.cc index 9f6340e..704b550d 100644 --- a/chrome/browser/ui/views/tabs/tab_group_underline.cc +++ b/chrome/browser/ui/views/tabs/tab_group_underline.cc
@@ -22,7 +22,11 @@ TabGroupUnderline::TabGroupUnderline(TabStrip* tab_strip, TabGroupId group) : tab_strip_(tab_strip), group_(group) { - UpdateBounds(); + // Set non-zero bounds to start with, so that painting isn't pruned. + // Needed because UpdateBounds() happens during OnPaint(), which is called + // after painting is pruned. + const int y = tab_strip_->bounds().height() - 1; + SetBounds(0, y - kStrokeThickness, kStrokeThickness * 2, kStrokeThickness); } void TabGroupUnderline::OnPaint(gfx::Canvas* canvas) { @@ -40,6 +44,12 @@ const int start_x = GetStart(); const int end_x = GetEnd(); + // The width may be zero if the group underline and header are initialized at + // the same time, as with tab restore. In this case, don't update the bounds + // and defer to the next paint cycle. + if (end_x <= start_x) + return; + const int start_y = tab_strip_->bounds().height() - 1; SetBounds(start_x, start_y - kStrokeThickness, end_x - start_x,
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc index 4591b88..d3d4dca0 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/memory/ref_counted_memory.h" +#include "base/no_destructor.h" #include "base/stl_util.h" #include "base/strings/string16.h" #include "base/strings/string_number_conversions.h" @@ -136,6 +137,15 @@ return ThemeProperties::TilingToString(repeat_mode); } +std::string ReplaceTemplateExpressions( + const scoped_refptr<base::RefCountedMemory>& bytes, + const ui::TemplateReplacements& replacements) { + return ui::ReplaceTemplateExpressions( + base::StringPiece(reinterpret_cast<const char*>(bytes->front()), + bytes->size()), + replacements); +} + } // namespace NTPResourceCache::NTPResourceCache(Profile* profile) @@ -296,12 +306,13 @@ const std::string& app_locale = g_browser_process->GetApplicationLocale(); webui::SetLoadTimeDataDefaults(app_locale, &replacements); - static const base::StringPiece incognito_tab_html( - ui::ResourceBundle::GetSharedInstance().GetRawDataResource( - IDR_INCOGNITO_TAB_HTML)); + static const base::NoDestructor<scoped_refptr<base::RefCountedMemory>> + incognito_tab_html( + ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes( + IDR_INCOGNITO_TAB_HTML)); std::string full_html = - ui::ReplaceTemplateExpressions(incognito_tab_html, replacements); + ReplaceTemplateExpressions(*incognito_tab_html, replacements); new_tab_incognito_html_ = base::RefCountedString::TakeString(&full_html); } @@ -311,13 +322,13 @@ localized_strings.SetString("title", l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); const char* guest_tab_link = kLearnMoreGuestSessionUrl; - int guest_tab_ids = IDR_GUEST_TAB_HTML; + int guest_tab_idr = IDR_GUEST_TAB_HTML; int guest_tab_description_ids = IDS_NEW_TAB_GUEST_SESSION_DESCRIPTION; int guest_tab_heading_ids = IDS_NEW_TAB_GUEST_SESSION_HEADING; int guest_tab_link_ids = IDS_LEARN_MORE; #if defined(OS_CHROMEOS) - guest_tab_ids = IDR_GUEST_SESSION_TAB_HTML; + guest_tab_idr = IDR_GUEST_SESSION_TAB_HTML; policy::BrowserPolicyConnectorChromeOS* connector = g_browser_process->platform_part()->browser_policy_connector_chromeos(); @@ -361,14 +372,14 @@ const std::string& app_locale = g_browser_process->GetApplicationLocale(); webui::SetLoadTimeDataDefaults(app_locale, &localized_strings); - static const base::StringPiece guest_tab_html( - ui::ResourceBundle::GetSharedInstance().GetRawDataResource( - guest_tab_ids)); - + static const base::NoDestructor<scoped_refptr<base::RefCountedMemory>> + guest_tab_html( + ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes( + guest_tab_idr)); ui::TemplateReplacements replacements; ui::TemplateReplacementsFromDictionaryValue(localized_strings, &replacements); std::string full_html = - ui::ReplaceTemplateExpressions(guest_tab_html, replacements); + ReplaceTemplateExpressions(*guest_tab_html, replacements); new_tab_guest_html_ = base::RefCountedString::TakeString(&full_html); } @@ -476,12 +487,15 @@ "isUserSignedIn", IdentityManagerFactory::GetForProfile(profile_)->HasPrimaryAccount()); - // Load the new tab page appropriate for this build. - base::StringPiece new_tab_html( - ui::ResourceBundle::GetSharedInstance().GetRawDataResource( - IDR_NEW_TAB_4_HTML)); - std::string full_html = - webui::GetI18nTemplateHtml(new_tab_html, &load_time_data); + // Load the new tab page template and localize it. + static const base::NoDestructor<scoped_refptr<base::RefCountedMemory>> + new_tab_html( + ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes( + IDR_NEW_TAB_4_HTML)); + std::string full_html = webui::GetI18nTemplateHtml( + base::StringPiece(reinterpret_cast<const char*>((*new_tab_html)->front()), + (*new_tab_html)->size()), + &load_time_data); new_tab_html_ = base::RefCountedString::TakeString(&full_html); } @@ -504,13 +518,14 @@ substitutions["backgroundTiling"] = GetNewTabBackgroundTilingCSS(tp); // Get our template. - static const base::StringPiece new_tab_theme_css( - ui::ResourceBundle::GetSharedInstance().GetRawDataResource( - IDR_NEW_INCOGNITO_TAB_THEME_CSS)); + static const base::NoDestructor<scoped_refptr<base::RefCountedMemory>> + new_tab_theme_css( + ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes( + IDR_NEW_INCOGNITO_TAB_THEME_CSS)); // Create the string from our template and the replacements. std::string full_css = - ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions); + ReplaceTemplateExpressions(*new_tab_theme_css, substitutions); new_tab_incognito_css_ = base::RefCountedString::TakeString(&full_css); } @@ -582,12 +597,13 @@ tp.HasCustomImage(IDR_THEME_NTP_ATTRIBUTION) ? "inline" : "none"; // Get our template. - static const base::StringPiece new_tab_theme_css( - ui::ResourceBundle::GetSharedInstance().GetRawDataResource( - IDR_NEW_TAB_4_THEME_CSS)); + static const base::NoDestructor<scoped_refptr<base::RefCountedMemory>> + new_tab_theme_css( + ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes( + IDR_NEW_TAB_4_THEME_CSS)); // Create the string from our template and the replacements. std::string css_string = - ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions); + ReplaceTemplateExpressions(*new_tab_theme_css, substitutions); new_tab_css_ = base::RefCountedString::TakeString(&css_string); }
diff --git a/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos_unittest.cc b/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos_unittest.cc index 5329108..a9828b19 100644 --- a/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos_unittest.cc +++ b/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos_unittest.cc
@@ -10,12 +10,10 @@ #include <vector> #include "base/bind.h" -#include "base/containers/flat_set.h" #include "base/json/json_string_value_serializer.h" #include "base/memory/ref_counted.h" #include "base/values.h" -#include "chrome/browser/chromeos/printing/printers_map.h" -#include "chrome/browser/chromeos/printing/printing_stubs.h" +#include "chrome/browser/chromeos/printing/test_cups_printers_manager.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_profile.h" @@ -77,33 +75,6 @@ return printer; } -class TestCupsPrintersManager : public chromeos::StubCupsPrintersManager { - public: - std::vector<Printer> GetPrinters(PrinterClass printer_class) const override { - return printers_.Get(printer_class); - } - - bool IsPrinterInstalled(const Printer& printer) const override { - return installed_.contains(printer.id()); - } - - base::Optional<Printer> GetPrinter(const std::string& id) const override { - return printers_.Get(id); - } - - // Add |printer| to the corresponding list in |printers_| bases on the given - // |printer_class|. - void AddPrinter(const Printer& printer, PrinterClass printer_class) { - printers_.Insert(printer_class, printer); - } - - void InstallPrinter(const std::string& id) { installed_.insert(id); } - - private: - chromeos::PrintersMap printers_; - base::flat_set<std::string> installed_; -}; - class TestPrinterConfigurer : public chromeos::StubPrinterConfigurer { public: void SetUpPrinter(const Printer& printer, @@ -144,7 +115,7 @@ // Must outlive |printers_manager_|. TestingProfile profile_; scoped_refptr<TestPrintBackend> test_backend_; - TestCupsPrintersManager printers_manager_; + chromeos::TestCupsPrintersManager printers_manager_; std::unique_ptr<LocalPrinterHandlerChromeos> local_printer_handler_; private:
diff --git a/chrome/browser/ui/webui/tab_strip/tab_strip_ui.cc b/chrome/browser/ui/webui/tab_strip/tab_strip_ui.cc index e3b251a..b1468ff6 100644 --- a/chrome/browser/ui/webui/tab_strip/tab_strip_ui.cc +++ b/chrome/browser/ui/webui/tab_strip/tab_strip_ui.cc
@@ -134,7 +134,7 @@ void NotifyLayoutChanged() { if (!IsJavascriptAllowed()) return; - FireWebUIListener("layout-changed"); + FireWebUIListener("layout-changed", embedder_->GetLayout().AsDictionary()); } // TabStripModelObserver:
diff --git a/chrome/browser/ui/webui/tab_strip/tab_strip_ui_layout.cc b/chrome/browser/ui/webui/tab_strip/tab_strip_ui_layout.cc index c96c7e5..64953a0c 100644 --- a/chrome/browser/ui/webui/tab_strip/tab_strip_ui_layout.cc +++ b/chrome/browser/ui/webui/tab_strip/tab_strip_ui_layout.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/webui/tab_strip/tab_strip_ui_layout.h" +#include "base/strings/string_number_conversions.h" #include "base/values.h" #include "ui/gfx/geometry/size.h" @@ -42,11 +43,14 @@ base::Value TabStripUILayout::AsDictionary() const { base::Value dict(base::Value::Type::DICTIONARY); - dict.SetIntKey("--tabstrip-tab-list-padding", padding_around_tab_list); - dict.SetIntKey("--tabstrip-tab-title-height", tab_title_height); - dict.SetIntKey("--tabstrip-tab-thumbnail-width", tab_thumbnail_size.width()); - dict.SetIntKey("--tabstrip-tab-thumbnail-height", - tab_thumbnail_size.height()); + dict.SetStringKey("--tabstrip-tab-list-padding", + base::NumberToString(padding_around_tab_list) + "px"); + dict.SetStringKey("--tabstrip-tab-title-height", + base::NumberToString(tab_title_height) + "px"); + dict.SetStringKey("--tabstrip-tab-thumbnail-width", + base::NumberToString(tab_thumbnail_size.width()) + "px"); + dict.SetStringKey("--tabstrip-tab-thumbnail-height", + base::NumberToString(tab_thumbnail_size.height()) + "px"); return dict; }
diff --git a/chrome/browser/vr/service/isolated_device_provider.cc b/chrome/browser/vr/service/isolated_device_provider.cc index c27c63fc..44cfb60 100644 --- a/chrome/browser/vr/service/isolated_device_provider.cc +++ b/chrome/browser/vr/service/isolated_device_provider.cc
@@ -7,8 +7,6 @@ #include "base/bind.h" #include "chrome/browser/vr/service/vr_ui_host.h" #include "chrome/browser/vr/service/xr_device_service.h" -#include "device/vr/buildflags/buildflags.h" -#include "device/vr/isolated_gamepad_data_fetcher.h" namespace { constexpr int kMaxRetries = 3; @@ -37,8 +35,6 @@ void IsolatedVRDeviceProvider::OnDeviceAdded( mojo::PendingRemote<device::mojom::XRRuntime> device, - mojo::PendingRemote<device::mojom::IsolatedXRGamepadProviderFactory> - gamepad_factory, mojo::PendingRemote<device::mojom::XRCompositorHost> compositor_host, device::mojom::XRDeviceId device_id) { add_device_callback_.Run(device_id, nullptr, std::move(device)); @@ -46,15 +42,11 @@ auto ui_host = (*VRUiHost::GetFactory())(device_id, std::move(compositor_host)); ui_host_map_.insert(std::make_pair(device_id, std::move(ui_host))); - - device::IsolatedGamepadDataFetcher::Factory::AddGamepad( - device_id, std::move(gamepad_factory)); } void IsolatedVRDeviceProvider::OnDeviceRemoved(device::mojom::XRDeviceId id) { remove_device_callback_.Run(id); ui_host_map_.erase(id); - device::IsolatedGamepadDataFetcher::Factory::RemoveGamepad(id); } void IsolatedVRDeviceProvider::OnServerError() { @@ -63,7 +55,6 @@ for (auto& entry : ui_host_map_) { auto id = entry.first; remove_device_callback_.Run(id); - device::IsolatedGamepadDataFetcher::Factory::RemoveGamepad(id); } ui_host_map_.clear(); @@ -107,12 +98,7 @@ IsolatedVRDeviceProvider::IsolatedVRDeviceProvider() = default; -IsolatedVRDeviceProvider::~IsolatedVRDeviceProvider() { - for (auto& entry : ui_host_map_) { - auto device_id = entry.first; - device::IsolatedGamepadDataFetcher::Factory::RemoveGamepad(device_id); - } - // Default destructor handles renderer_host_map_ cleanup. -} +// Default destructor handles renderer_host_map_ cleanup. +IsolatedVRDeviceProvider::~IsolatedVRDeviceProvider() = default; } // namespace vr
diff --git a/chrome/browser/vr/service/isolated_device_provider.h b/chrome/browser/vr/service/isolated_device_provider.h index e1f4988..89e3a8e 100644 --- a/chrome/browser/vr/service/isolated_device_provider.h +++ b/chrome/browser/vr/service/isolated_device_provider.h
@@ -41,8 +41,6 @@ // IsolatedXRRuntimeProviderClient void OnDeviceAdded( mojo::PendingRemote<device::mojom::XRRuntime> device, - mojo::PendingRemote<device::mojom::IsolatedXRGamepadProviderFactory> - gamepad_factory, mojo::PendingRemote<device::mojom::XRCompositorHost> compositor_host, device::mojom::XRDeviceId device_id) override; void OnDeviceRemoved(device::mojom::XRDeviceId id) override;
diff --git a/chrome/services/isolated_xr_device/xr_runtime_provider.cc b/chrome/services/isolated_xr_device/xr_runtime_provider.cc index 37c9000a..decc127 100644 --- a/chrome/services/isolated_xr_device/xr_runtime_provider.cc +++ b/chrome/services/isolated_xr_device/xr_runtime_provider.cc
@@ -46,8 +46,8 @@ static_cast<int>(device->GetId())); // "Device" here refers to a runtime + hardware pair, not necessarily // a physical device. - client->OnDeviceAdded(device->BindXRRuntime(), device->BindGamepadFactory(), - device->BindCompositorHost(), device->GetId()); + client->OnDeviceAdded(device->BindXRRuntime(), device->BindCompositorHost(), + device->GetId()); return device; }
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 7ae274db..142769d 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -11,7 +11,6 @@ import("//build/config/ui.gni") import("//build/toolchain/toolchain.gni") import("//build/util/version.gni") -import("//chrome/browser/media/router/features.gni") import("//chrome/chrome_repack_locales.gni") import("//chrome/common/features.gni") import("//components/feature_engagement/features.gni") @@ -3028,17 +3027,6 @@ "../browser/media/media_storage_id_salt_unittest.cc", "../browser/media/midi_permission_context_unittest.cc", "../browser/media/midi_sysex_permission_context_unittest.cc", - "../browser/media/router/issue_manager_unittest.cc", - "../browser/media/router/media_router_base_unittest.cc", - "../browser/media/router/media_router_dialog_controller_unittest.cc", - "../browser/media/router/media_router_factory_unittest.cc", - "../browser/media/router/media_router_metrics_unittest.cc", - "../browser/media/router/media_sinks_observer_unittest.cc", - "../browser/media/router/presentation/browser_presentation_connection_proxy_unittest.cc", - "../browser/media/router/presentation/local_presentation_manager_factory_unittest.cc", - "../browser/media/router/presentation/local_presentation_manager_unittest.cc", - "../browser/media/router/presentation/presentation_media_sinks_observer_unittest.cc", - "../browser/media/router/presentation/presentation_service_delegate_impl_unittest.cc", "../browser/media/webrtc/media_stream_device_permission_context_unittest.cc", "../browser/metrics/antivirus_metrics_provider_win_unittest.cc", "../browser/metrics/chrome_browser_main_extra_parts_metrics_unittest.cc", @@ -3477,7 +3465,7 @@ "//chrome:child_dependencies", "//chrome:resources", "//chrome:strings", - "//chrome/browser/media/router:test_support", + "//chrome/browser/media/router:unittests", "//chrome/browser/notifications:unit_tests", "//chrome/common:test_support", "//chrome/common/media_router:test_support", @@ -3718,11 +3706,6 @@ # Media remoting is not supported on Android for now. "../browser/media/cast_remoting_connector_unittest.cc", - - # In-browser discovery is not used by Android for now. - "../browser/media/router/discovery/discovery_network_list_unittest.cc", - "../browser/media/router/discovery/discovery_network_monitor_metric_observer_unittest.cc", - "../browser/media/router/discovery/discovery_network_monitor_unittest.cc", "../browser/media/unified_autoplay_config_unittest.cc", "../browser/media/webrtc/desktop_capture_access_handler_unittest.cc", "../browser/media/webrtc/desktop_media_picker_controller_unittest.cc", @@ -4007,47 +3990,6 @@ "../browser/devtools/protocol/cast_handler_unittest.cc", "../browser/devtools/serialize_host_descriptions_unittest.cc", "../browser/download/download_dir_policy_handler_unittest.cc", - "../browser/media/router/discovery/dial/device_description_fetcher_unittest.cc", - "../browser/media/router/discovery/dial/device_description_service_unittest.cc", - "../browser/media/router/discovery/dial/dial_app_discovery_service_unittest.cc", - "../browser/media/router/discovery/dial/dial_device_data_unittest.cc", - "../browser/media/router/discovery/dial/dial_media_sink_service_impl_unittest.cc", - "../browser/media/router/discovery/dial/dial_registry_unittest.cc", - "../browser/media/router/discovery/dial/dial_service_unittest.cc", - "../browser/media/router/discovery/dial/dial_url_fetcher_unittest.cc", - "../browser/media/router/discovery/dial/safe_dial_app_info_parser_unittest.cc", - "../browser/media/router/discovery/dial/safe_dial_device_description_parser_unittest.cc", - "../browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc", - "../browser/media/router/discovery/mdns/cast_media_sink_service_unittest.cc", - "../browser/media/router/discovery/mdns/dns_sd_registry_unittest.cc", - "../browser/media/router/discovery/media_sink_discovery_metrics_unittest.cc", - "../browser/media/router/event_page_request_manager_unittest.cc", - "../browser/media/router/media_router_feature_unittest.cc", - "../browser/media/router/mojo/media_router_desktop_unittest.cc", - "../browser/media/router/mojo/media_router_mojo_impl_unittest.cc", - "../browser/media/router/mojo/media_router_mojo_metrics_unittest.cc", - "../browser/media/router/mojo/media_sink_service_status_unittest.cc", - "../browser/media/router/providers/cast/cast_activity_manager_unittest.cc", - "../browser/media/router/providers/cast/cast_activity_record_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_internal_message_util_unittest.cc", - "../browser/media/router/providers/cast/cast_media_controller_unittest.cc", - "../browser/media/router/providers/cast/cast_media_route_provider_metrics_unittest.cc", - "../browser/media/router/providers/cast/cast_media_route_provider_unittest.cc", - "../browser/media/router/providers/cast/cast_session_client_unittest.cc", - "../browser/media/router/providers/cast/cast_session_tracker_unittest.cc", - "../browser/media/router/providers/cast/dual_media_sink_service_unittest.cc", - "../browser/media/router/providers/cast/mirroring_activity_record_unittest.cc", - "../browser/media/router/providers/cast/mock_activity_record.cc", - "../browser/media/router/providers/cast/mock_activity_record.h", - "../browser/media/router/providers/cast/test_util.cc", - "../browser/media/router/providers/cast/test_util.h", - "../browser/media/router/providers/dial/dial_activity_manager_unittest.cc", - "../browser/media/router/providers/dial/dial_internal_message_util_unittest.cc", - "../browser/media/router/providers/dial/dial_media_route_provider_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", "../browser/media/webrtc/webrtc_log_uploader_unittest.cc", "../browser/media/webrtc/webrtc_rtp_dump_handler_unittest.cc", "../browser/media/webrtc/webrtc_rtp_dump_writer_unittest.cc", @@ -5228,15 +5170,6 @@ [ "../common/media/component_widevine_cdm_hint_file_linux_unittest.cc" ] } - if (enable_openscreen) { - include_dirs = [ "//third_party/openscreen/src" ] - - sources += [ - "../browser/media/router/providers/openscreen/discovery/open_screen_listener_unittest.cc", - "../browser/media/router/providers/openscreen/network_service_quic_packet_writer_unittest.cc", - ] - } - if (enable_webui_tab_strip) { sources += [ "../browser/ui/webui/tab_strip/tab_strip_ui_layout_unittest.cc",
diff --git a/chrome/test/chromedriver/chrome_launcher.cc b/chrome/test/chromedriver/chrome_launcher.cc index 24dbf16..a4fd71f 100644 --- a/chrome/test/chromedriver/chrome_launcher.cc +++ b/chrome/test/chromedriver/chrome_launcher.cc
@@ -842,7 +842,12 @@ crx_file::Verify(extension_crx, crx_file::VerifierFormat::CRX3, {} /** required_key_hashes */, {} /** required_file_hash */, &public_key_base64, &id); - if (result != crx_file::VerifierResult::OK_FULL) { + if (result == crx_file::VerifierResult::ERROR_HEADER_INVALID) { + return Status(kUnknownError, + "CRX verification failed to parse extension header. Chrome " + "supports only CRX3 format. Does the extension need to be " + "updated?"); + } else if (result != crx_file::VerifierResult::OK_FULL) { return Status(kUnknownError, base::StringPrintf("CRX verification failed: %d", result)); } @@ -944,7 +949,7 @@ Status status = ProcessExtension(extensions[i], temp_dir, &path, &bg_page); if (status.IsError()) { return Status( - kUnknownError, + kSessionNotCreated, base::StringPrintf("cannot process extension #%" PRIuS, i + 1), status); }
diff --git a/chrome/test/data/local_ntp/realbox_browsertest.js b/chrome/test/data/local_ntp/realbox_browsertest.js index 5af7e09d..236cc3a 100644 --- a/chrome/test/data/local_ntp/realbox_browsertest.js +++ b/chrome/test/data/local_ntp/realbox_browsertest.js
@@ -111,15 +111,11 @@ queryAutocomplete(query) { test.realbox.queries.push(query); }, - stopAutocomplete(clearResult) { - test.realbox.stops.push(clearResult); - }, }, }; test.realbox.deletedLines = []; test.realbox.queries = []; - test.realbox.stops = []; initLocalNTP(/*isGooglePage=*/ true); @@ -559,14 +555,6 @@ test.realbox.realboxEl.dispatchEvent(shiftDelete); assertTrue(shiftDelete.defaultPrevented); - // Pretend like the focused match gets removed from DOM when deleted. - matchesEl.children[1].dispatchEvent(new Event('focusout', {bubbles: true})); - - // stopAutocomplete() should not be called if the focused match gets removed - // from the DOM (and focus gets dropped). There's explicit code in the - // focusout handler to deal with this case. - assertEquals(0, test.realbox.stops.length); - assertEquals(1, test.realbox.deletedLines.length); assertEquals(1, test.realbox.deletedLines[0]); @@ -629,15 +617,6 @@ assertEquals(1, test.realbox.deletedLines.length); assertEquals(0, test.realbox.deletedLines[0]); - assertEquals(0, test.realbox.stops.length); - icon.dispatchEvent(new Event('focusout', { - bubbles: true, - cancelable: true, - target: icon, - relatedTarget: document.body, - })); - assertEquals(0, test.realbox.stops.length); - chrome.embeddedSearch.searchBox.ondeleteautocompletematch( {success: true, matches: []});
diff --git a/chrome/test/data/webui/tab_strip/tab_list_test.js b/chrome/test/data/webui/tab_strip/tab_list_test.js index c9f7456a..1fca8b7f 100644 --- a/chrome/test/data/webui/tab_strip/tab_list_test.js +++ b/chrome/test/data/webui/tab_strip/tab_list_test.js
@@ -107,6 +107,10 @@ '--background-color': 'white', '--foreground-color': 'black', }); + testTabStripEmbedderProxy.setLayout({ + '--height': '100px', + '--width': '150px', + }); TabStripEmbedderProxy.instance_ = testTabStripEmbedderProxy; tabList = document.createElement('tabstrip-tab-list'); @@ -137,6 +141,38 @@ assertEquals(tabList.style.getPropertyValue('--foreground-color'), 'blue'); }); + test('sets layout variables on init', async () => { + await testTabStripEmbedderProxy.whenCalled('getLayout'); + assertEquals(tabList.style.getPropertyValue('--height'), '100px'); + assertEquals(tabList.style.getPropertyValue('--width'), '150px'); + }); + + test('updates layout variables when layout changes', async () => { + webUIListenerCallback('layout-changed', { + '--height': '10000px', + '--width': '10px', + }); + await testTabStripEmbedderProxy.whenCalled('getLayout'); + assertEquals(tabList.style.getPropertyValue('--height'), '10000px'); + assertEquals(tabList.style.getPropertyValue('--width'), '10px'); + }); + + test('calculates the correct unpinned tab width and height', async () => { + webUIListenerCallback('layout-changed', { + '--tabstrip-tab-thumbnail-height': '132px', + '--tabstrip-tab-thumbnail-width': '200px', + '--tabstrip-tab-title-height': '15px', + }); + await testTabStripEmbedderProxy.whenCalled('getLayout'); + + const tabListStyle = window.getComputedStyle(tabList); + assertEquals( + tabListStyle.getPropertyValue('--tabstrip-tab-height').trim(), + 'calc(15px + 132px)'); + assertEquals( + tabListStyle.getPropertyValue('--tabstrip-tab-width').trim(), '200px'); + }); + test('creates a tab element for each tab', () => { const tabElements = getUnpinnedTabs(); assertEquals(tabs.length, tabElements.length);
diff --git a/chrome/test/data/webui/tab_strip/tab_test.js b/chrome/test/data/webui/tab_strip/tab_test.js index bfff769..39df01d6 100644 --- a/chrome/test/data/webui/tab_strip/tab_test.js +++ b/chrome/test/data/webui/tab_strip/tab_test.js
@@ -36,6 +36,9 @@ document.body.innerHTML = ''; + // Set CSS variable for animations + document.body.style.setProperty('--tabstrip-tab-width', '280px'); + testTabStripEmbedderProxy = new TestTabStripEmbedderProxy(); TabStripEmbedderProxy.instance_ = testTabStripEmbedderProxy;
diff --git a/chrome/test/data/webui/tab_strip/test_tab_strip_embedder_proxy.js b/chrome/test/data/webui/tab_strip/test_tab_strip_embedder_proxy.js index fd84cd4..f13f39ee 100644 --- a/chrome/test/data/webui/tab_strip/test_tab_strip_embedder_proxy.js +++ b/chrome/test/data/webui/tab_strip/test_tab_strip_embedder_proxy.js
@@ -9,11 +9,14 @@ super([ 'closeContainer', 'getColors', + 'getLayout', 'isVisible', 'observeThemeChanges', 'showTabContextMenu', ]); + this.colors_ = {}; + this.layout_ = {}; this.visible_ = false; } @@ -22,6 +25,11 @@ return Promise.resolve(this.colors_); } + getLayout() { + this.methodCalled('getLayout'); + return Promise.resolve(this.layout_); + } + isVisible() { this.methodCalled('isVisible'); return this.visible_; @@ -31,6 +39,10 @@ this.colors_ = colors; } + setLayout(layout) { + this.layout_ = layout; + } + setVisible(visible) { this.visible_ = visible; }
diff --git a/chrome/test/pixel/browser_skia_gold_pixel_diff.cc b/chrome/test/pixel/browser_skia_gold_pixel_diff.cc index 3881d445..d64abef4 100644 --- a/chrome/test/pixel/browser_skia_gold_pixel_diff.cc +++ b/chrome/test/pixel/browser_skia_gold_pixel_diff.cc
@@ -5,6 +5,7 @@ #include "chrome/test/pixel/browser_skia_gold_pixel_diff.h" #include "base/logging.h" +#include "base/run_loop.h" #include "chrome/browser/ui/browser_window.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -13,6 +14,18 @@ #include "ui/views/view.h" #include "ui/views/widget/widget.h" +#if defined(USE_AURA) +#include "ui/snapshot/snapshot_aura.h" +#endif + +void SnapshotCallback(base::RunLoop* run_loop, + gfx::Image* ret_image, + gfx::Image image) { + *ret_image = image; + base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, + run_loop->QuitClosure()); +} + BrowserSkiaGoldPixelDiff::BrowserSkiaGoldPixelDiff() = default; BrowserSkiaGoldPixelDiff::~BrowserSkiaGoldPixelDiff() = default; @@ -28,12 +41,16 @@ gfx::NativeWindow window, const gfx::Rect& snapshot_bounds, gfx::Image* image) const { - bool ret = ui::GrabWindowSnapshot(window, snapshot_bounds, image); - if (!ret) { - LOG(WARNING) << "Grab snapshot failed"; - return false; - } - return true; + base::RunLoop run_loop; +#if defined(USE_AURA) + ui::GrabWindowSnapshotAsyncAura( +#else + ui::GrabWindowSnapshotAsync( +#endif + window, snapshot_bounds, + base::BindOnce(&SnapshotCallback, &run_loop, image)); + run_loop.Run(); + return !image->IsEmpty(); } bool BrowserSkiaGoldPixelDiff::CompareScreenshot( @@ -48,6 +65,7 @@ gfx::Image image; bool ret = GrabWindowSnapshotInternal(widget_->GetNativeWindow(), rc, &image); if (!ret) { + LOG(ERROR) << "Grab screenshot failed."; return false; } return SkiaGoldPixelDiff::CompareScreenshot(screenshot_name,
diff --git a/chromecast/external_mojo/public/cpp/external_mojo_broker.cc b/chromecast/external_mojo/public/cpp/external_mojo_broker.cc index f2135d5..9a9ae16 100644 --- a/chromecast/external_mojo/public/cpp/external_mojo_broker.cc +++ b/chromecast/external_mojo/public/cpp/external_mojo_broker.cc
@@ -165,8 +165,10 @@ void FilterInterfaces( const std::string& spec, const ::service_manager::Identity& source, - ::service_manager::mojom::InterfaceProviderRequest source_request, - ::service_manager::mojom::InterfaceProviderPtr target) override { + mojo::PendingReceiver<::service_manager::mojom::InterfaceProvider> + source_receiver, + mojo::PendingRemote<::service_manager::mojom::InterfaceProvider> target) + override { NOTREACHED() << "Call to deprecated FilterInterfaces"; }
diff --git a/chromecast/media/cma/base/demuxer_stream_for_test.cc b/chromecast/media/cma/base/demuxer_stream_for_test.cc index 9c585ae..99d79204 100644 --- a/chromecast/media/cma/base/demuxer_stream_for_test.cc +++ b/chromecast/media/cma/base/demuxer_stream_for_test.cc
@@ -26,12 +26,13 @@ DemuxerStreamForTest::~DemuxerStreamForTest() { } -void DemuxerStreamForTest::Read(const ReadCB& read_cb) { +void DemuxerStreamForTest::Read(ReadCB read_cb) { has_pending_read_ = true; if (!config_idx_.empty() && config_idx_.front() == frame_count_) { config_idx_.pop_front(); has_pending_read_ = false; - read_cb.Run(kConfigChanged, scoped_refptr<::media::DecoderBuffer>()); + std::move(read_cb).Run(kConfigChanged, + scoped_refptr<::media::DecoderBuffer>()); return; } @@ -39,11 +40,11 @@ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, base::BindOnce(&DemuxerStreamForTest::DoRead, base::Unretained(this), - read_cb), + std::move(read_cb)), base::TimeDelta::FromMilliseconds(20)); return; } - DoRead(read_cb); + DoRead(std::move(read_cb)); } ::media::AudioDecoderConfig DemuxerStreamForTest::audio_decoder_config() { @@ -75,12 +76,12 @@ return has_pending_read_; } -void DemuxerStreamForTest::DoRead(const ReadCB& read_cb) { +void DemuxerStreamForTest::DoRead(ReadCB read_cb) { has_pending_read_ = false; if (total_frame_count_ != -1 && frame_count_ >= total_frame_count_) { // End of stream - read_cb.Run(kOk, ::media::DecoderBuffer::CreateEOSBuffer()); + std::move(read_cb).Run(kOk, ::media::DecoderBuffer::CreateEOSBuffer()); return; } @@ -88,7 +89,7 @@ buffer->set_timestamp(frame_count_ * base::TimeDelta::FromMilliseconds( kDemuxerStreamForTestFrameDuration)); frame_count_++; - read_cb.Run(kOk, buffer); + std::move(read_cb).Run(kOk, buffer); } } // namespace media
diff --git a/chromecast/media/cma/base/demuxer_stream_for_test.h b/chromecast/media/cma/base/demuxer_stream_for_test.h index feec5ca5..f380b28 100644 --- a/chromecast/media/cma/base/demuxer_stream_for_test.h +++ b/chromecast/media/cma/base/demuxer_stream_for_test.h
@@ -41,7 +41,7 @@ ~DemuxerStreamForTest() override; // ::media::DemuxerStream implementation. - void Read(const ReadCB& read_cb) override; + void Read(ReadCB read_cb) override; ::media::AudioDecoderConfig audio_decoder_config() override; ::media::VideoDecoderConfig video_decoder_config() override; Type type() const override; @@ -52,7 +52,7 @@ static const int kDemuxerStreamForTestFrameDuration = 40; private: - void DoRead(const ReadCB& read_cb); + void DoRead(ReadCB read_cb); // Demuxer configuration. int total_frame_count_;
diff --git a/chromecast/media/cma/pipeline/media_pipeline_impl.cc b/chromecast/media/cma/pipeline/media_pipeline_impl.cc index 0b18983a..e66ab8a9 100644 --- a/chromecast/media/cma/pipeline/media_pipeline_impl.cc +++ b/chromecast/media/cma/pipeline/media_pipeline_impl.cc
@@ -78,7 +78,7 @@ struct MediaPipelineImpl::FlushTask { bool audio_flushed; bool video_flushed; - base::Closure done_cb; + base::OnceClosure done_cb; }; MediaPipelineImpl::MediaPipelineImpl() @@ -265,7 +265,7 @@ } } -void MediaPipelineImpl::Flush(const base::Closure& flush_cb) { +void MediaPipelineImpl::Flush(base::OnceClosure flush_cb) { LOG(INFO) << __FUNCTION__; DCHECK(thread_checker_.CalledOnValidThread()); DCHECK((backend_state_ == BACKEND_STATE_PLAYING) || @@ -283,7 +283,7 @@ pending_flush_task_.reset(new FlushTask); pending_flush_task_->audio_flushed = !audio_pipeline_; pending_flush_task_->video_flushed = !video_pipeline_; - pending_flush_task_->done_cb = flush_cb; + pending_flush_task_->done_cb = std::move(flush_cb); if (audio_pipeline_) { audio_pipeline_->Flush( base::Bind(&MediaPipelineImpl::OnFlushDone, weak_this_, true)); @@ -372,8 +372,8 @@ metrics::CastMetricsHelper::GetInstance()->RecordApplicationEvent( "Cast.Platform.Ended"); - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - pending_flush_task_->done_cb); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, std::move(pending_flush_task_->done_cb)); pending_flush_task_.reset(); } }
diff --git a/chromecast/media/cma/pipeline/media_pipeline_impl.h b/chromecast/media/cma/pipeline/media_pipeline_impl.h index 564db33f8..aead395b 100644 --- a/chromecast/media/cma/pipeline/media_pipeline_impl.h +++ b/chromecast/media/cma/pipeline/media_pipeline_impl.h
@@ -56,7 +56,7 @@ const VideoPipelineClient& client, std::unique_ptr<CodedFrameProvider> frame_provider); void StartPlayingFrom(base::TimeDelta time); - void Flush(const base::Closure& flush_cb); + void Flush(base::OnceClosure flush_cb); void SetPlaybackRate(double playback_rate); void SetVolume(float volume); base::TimeDelta GetMediaTime() const;
diff --git a/chromecast/media/service/cast_renderer.cc b/chromecast/media/service/cast_renderer.cc index 3a78bc7c..a9741e8f 100644 --- a/chromecast/media/service/cast_renderer.cc +++ b/chromecast/media/service/cast_renderer.cc
@@ -90,11 +90,13 @@ void CastRenderer::Initialize(::media::MediaResource* media_resource, ::media::RendererClient* client, - const ::media::PipelineStatusCB& init_cb) { + ::media::PipelineStatusCallback init_cb) { LOG(INFO) << __FUNCTION__ << ": " << this; DCHECK(task_runner_->BelongsToCurrentThread()); DCHECK(!application_media_info_manager_ptr_); + init_cb_ = std::move(init_cb); + // Retrieve application_media_info_manager_ptr_ if it is available via // CastApplicationMediaInfoManager. @@ -107,14 +109,13 @@ if (application_media_info_manager_ptr_) { application_media_info_manager_ptr_->GetCastApplicationMediaInfo( base::BindOnce(&CastRenderer::OnApplicationMediaInfoReceived, - weak_factory_.GetWeakPtr(), media_resource, client, - init_cb)); + weak_factory_.GetWeakPtr(), media_resource, client)); } else { // If a CastRenderer is created for a purpose other than a web application, // the CastApplicationMediaInfoManager interface is not available, and // default CastApplicationMediaInfo value below will be used. OnApplicationMediaInfoReceived( - media_resource, client, init_cb, + media_resource, client, ::media::mojom::CastApplicationMediaInfo::New(std::string(), true)); } } @@ -122,32 +123,30 @@ void CastRenderer::OnApplicationMediaInfoReceived( ::media::MediaResource* media_resource, ::media::RendererClient* client, - const ::media::PipelineStatusCB& init_cb, ::media::mojom::CastApplicationMediaInfoPtr application_media_info) { DCHECK(task_runner_->BelongsToCurrentThread()); if (application_media_info->application_session_id.empty()) { - OnGetMultiroomInfo(media_resource, client, init_cb, + OnGetMultiroomInfo(media_resource, client, std::move(application_media_info), chromecast::mojom::MultiroomInfo::New()); return; } connector_->Connect(chromecast::mojom::kChromecastServiceName, multiroom_manager_.BindNewPipeAndPassReceiver()); - multiroom_manager_.set_disconnect_handler(base::BindOnce( - &CastRenderer::OnGetMultiroomInfo, base::Unretained(this), media_resource, - client, init_cb, application_media_info.Clone(), - chromecast::mojom::MultiroomInfo::New())); + multiroom_manager_.set_disconnect_handler( + base::BindOnce(&CastRenderer::OnGetMultiroomInfo, base::Unretained(this), + media_resource, client, application_media_info.Clone(), + chromecast::mojom::MultiroomInfo::New())); std::string session_id = application_media_info->application_session_id; multiroom_manager_->GetMultiroomInfo( session_id, base::BindOnce(&CastRenderer::OnGetMultiroomInfo, base::Unretained(this), media_resource, client, - init_cb, std::move(application_media_info))); + std::move(application_media_info))); } void CastRenderer::OnGetMultiroomInfo( ::media::MediaResource* media_resource, ::media::RendererClient* client, - const ::media::PipelineStatusCB& init_cb, ::media::mojom::CastApplicationMediaInfoPtr application_media_info, chromecast::mojom::MultiroomInfoPtr multiroom_info) { DCHECK(task_runner_->BelongsToCurrentThread()); @@ -218,7 +217,7 @@ pipeline_->InitializeAudio(audio_stream->audio_decoder_config(), audio_client, std::move(frame_provider)); if (status != ::media::PIPELINE_OK) { - init_cb.Run(status); + RunInitCallback(status); return; } audio_stream->EnableBitstreamConverter(); @@ -247,7 +246,7 @@ ::media::PipelineStatus status = pipeline_->InitializeVideo( video_configs, video_client, std::move(frame_provider)); if (status != ::media::PIPELINE_OK) { - init_cb.Run(status); + RunInitCallback(status); return; } video_stream->EnableBitstreamConverter(); @@ -265,22 +264,26 @@ video_configs.push_back(video_stream->video_decoder_config()); auto mode_switch_completion_cb = base::Bind(&CastRenderer::OnVideoInitializationFinished, - weak_factory_.GetWeakPtr(), init_cb); + weak_factory_.GetWeakPtr()); video_mode_switcher_->SwitchMode( video_configs, base::BindOnce(&VideoModeSwitchCompletionCb, mode_switch_completion_cb)); } else if (video_stream) { // No mode switch needed. - OnVideoInitializationFinished(init_cb, ::media::PIPELINE_OK); + OnVideoInitializationFinished(::media::PIPELINE_OK); } else { - init_cb.Run(::media::PIPELINE_OK); + RunInitCallback(::media::PIPELINE_OK); } } +void CastRenderer::RunInitCallback(::media::PipelineStatus status) { + if (init_cb_) + std::move(init_cb_).Run(status); +} + void CastRenderer::OnVideoInitializationFinished( - const ::media::PipelineStatusCB& init_cb, ::media::PipelineStatus status) { - init_cb.Run(status); + RunInitCallback(status); if (status == ::media::PIPELINE_OK) { // Force compositor to treat video as opaque (needed for overlay codepath). OnVideoOpacityChange(true); @@ -305,9 +308,9 @@ cdm_attached_cb.Run(true); } -void CastRenderer::Flush(const base::Closure& flush_cb) { +void CastRenderer::Flush(base::OnceClosure flush_cb) { DCHECK(task_runner_->BelongsToCurrentThread()); - pipeline_->Flush(flush_cb); + pipeline_->Flush(std::move(flush_cb)); } void CastRenderer::StartPlayingFrom(base::TimeDelta time) {
diff --git a/chromecast/media/service/cast_renderer.h b/chromecast/media/service/cast_renderer.h index 2f5b0d0..0501682 100644 --- a/chromecast/media/service/cast_renderer.h +++ b/chromecast/media/service/cast_renderer.h
@@ -54,10 +54,10 @@ // ::media::Renderer implementation. void Initialize(::media::MediaResource* media_resource, ::media::RendererClient* client, - const ::media::PipelineStatusCB& init_cb) final; + ::media::PipelineStatusCallback init_cb) final; void SetCdm(::media::CdmContext* cdm_context, const ::media::CdmAttachedCB& cdm_attached_cb) final; - void Flush(const base::Closure& flush_cb) final; + void Flush(base::OnceClosure flush_cb) final; void StartPlayingFrom(base::TimeDelta time) final; void SetPlaybackRate(double playback_rate) final; void SetVolume(float volume) final; @@ -71,12 +71,10 @@ void OnApplicationMediaInfoReceived( ::media::MediaResource* media_resource, ::media::RendererClient* client, - const ::media::PipelineStatusCB& init_cb, ::media::mojom::CastApplicationMediaInfoPtr application_media_info); void OnGetMultiroomInfo( ::media::MediaResource* media_resource, ::media::RendererClient* client, - const ::media::PipelineStatusCB& init_cb, ::media::mojom::CastApplicationMediaInfoPtr application_media_info, chromecast::mojom::MultiroomInfoPtr multiroom_info); void OnError(::media::PipelineStatus status); @@ -88,9 +86,8 @@ void OnVideoNaturalSizeChange(const gfx::Size& size); void OnVideoOpacityChange(bool opaque); void CheckVideoResolutionPolicy(); - - void OnVideoInitializationFinished(const ::media::PipelineStatusCB& init_cb, - ::media::PipelineStatus status); + void RunInitCallback(::media::PipelineStatus status); + void OnVideoInitializationFinished(::media::PipelineStatus status); CmaBackendFactory* const backend_factory_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_; @@ -110,6 +107,7 @@ ::media::mojom::CastApplicationMediaInfoManagerPtr application_media_info_manager_ptr_; mojo::Remote<chromecast::mojom::MultiroomManager> multiroom_manager_; + ::media::PipelineStatusCallback init_cb_; base::WeakPtrFactory<CastRenderer> weak_factory_; DISALLOW_COPY_AND_ASSIGN(CastRenderer);
diff --git a/chromeos/BUILD.gn b/chromeos/BUILD.gn index b3a4492..8c7b18e 100644 --- a/chromeos/BUILD.gn +++ b/chromeos/BUILD.gn
@@ -44,6 +44,8 @@ sources = [ "hugepage_text/hugepage_text.cc", "hugepage_text/hugepage_text.h", + "memory/kstaled.cc", + "memory/kstaled.h", "policy/weekly_time/time_utils.cc", "policy/weekly_time/time_utils.h", "policy/weekly_time/weekly_time.cc",
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index 4adf42f1..65531fe 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -12622.0.0 \ No newline at end of file +12623.0.0 \ No newline at end of file
diff --git a/chromeos/components/sync_wifi/BUILD.gn b/chromeos/components/sync_wifi/BUILD.gn index 73071af6..a16ac09 100644 --- a/chromeos/components/sync_wifi/BUILD.gn +++ b/chromeos/components/sync_wifi/BUILD.gn
@@ -6,22 +6,30 @@ sources = [ "network_identifier.cc", "network_identifier.h", + "network_type_conversions.cc", + "network_type_conversions.h", "pending_network_configuration_tracker.h", "pending_network_configuration_tracker_impl.cc", "pending_network_configuration_tracker_impl.h", "pending_network_configuration_update.cc", "pending_network_configuration_update.h", "synced_network_updater.h", + "synced_network_updater_impl.cc", + "synced_network_updater_impl.h", "wifi_configuration_bridge.cc", "wifi_configuration_bridge.h", "wifi_configuration_sync_service.cc", "wifi_configuration_sync_service.h", ] deps = [ + "//ash/public/cpp", "//base", - "//chromeos/network:network", + "//chromeos/network", + "//chromeos/services/network_config/public/mojom", + "//components/device_event_log", "//components/keyed_service/core", - "//components/prefs:prefs", + "//components/prefs", + "//components/proxy_config", "//components/sync", "//components/version_info", ] @@ -30,6 +38,8 @@ source_set("test_support") { testonly = true sources = [ + "fake_pending_network_configuration_tracker.cc", + "fake_pending_network_configuration_tracker.h", "test_data_generator.cc", "test_data_generator.h", ] @@ -45,16 +55,24 @@ sources = [ "network_identifier_unittest.cc", "pending_network_configuration_tracker_impl_unittest.cc", + "synced_network_updater_impl_unittest.cc", "wifi_configuration_bridge_unittest.cc", ] deps = [ ":sync_wifi", ":test_support", + "//ash/public/cpp", "//base/test:test_support", "//chromeos/dbus/shill:test_support", + "//chromeos/login/login_state", + "//chromeos/login/login_state:test_support", "//chromeos/network:test_support", + "//chromeos/services/network_config", + "//chromeos/services/network_config:in_process_instance", + "//chromeos/services/network_config/public/cpp:test_support", "//components/sync:test_support", "//components/sync_preferences:test_support", + "//components/user_manager:test_support", "//testing/gtest", ] }
diff --git a/chromeos/components/sync_wifi/DEPS b/chromeos/components/sync_wifi/DEPS index 733d3d2a..973576fd 100644 --- a/chromeos/components/sync_wifi/DEPS +++ b/chromeos/components/sync_wifi/DEPS
@@ -1,8 +1,11 @@ include_rules = [ + "+ash/public/cpp", "+chromeos/network", "+components/keyed_service/core", "+components/prefs", + "+components/proxy_config", + "+components/user_manager", "+components/version_info", "+components/sync", - "+components/sync_preferences" + "+components/sync_preferences", ]
diff --git a/chromeos/components/sync_wifi/fake_pending_network_configuration_tracker.cc b/chromeos/components/sync_wifi/fake_pending_network_configuration_tracker.cc new file mode 100644 index 0000000..b1a6417 --- /dev/null +++ b/chromeos/components/sync_wifi/fake_pending_network_configuration_tracker.cc
@@ -0,0 +1,91 @@ +// Copyright 2019 The Chromium 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 "chromeos/components/sync_wifi/fake_pending_network_configuration_tracker.h" + +#include "base/guid.h" +#include "base/stl_util.h" +#include "chromeos/components/sync_wifi/pending_network_configuration_update.h" + +namespace chromeos { + +namespace sync_wifi { + +FakePendingNetworkConfigurationTracker:: + FakePendingNetworkConfigurationTracker() = default; + +FakePendingNetworkConfigurationTracker:: + ~FakePendingNetworkConfigurationTracker() = default; + +std::string FakePendingNetworkConfigurationTracker::TrackPendingUpdate( + const NetworkIdentifier& id, + const base::Optional<sync_pb::WifiConfigurationSpecificsData>& specifics) { + std::string change_id = base::GenerateGUID(); + id_to_pending_update_map_.emplace( + id, PendingNetworkConfigurationUpdate(id, change_id, specifics, + /*completed_attempts=*/0)); + id_to_completed_attempts_map_[id] = 0; + + return change_id; +} + +void FakePendingNetworkConfigurationTracker::MarkComplete( + const std::string& change_guid, + const NetworkIdentifier& id) { + if (base::Contains(id_to_pending_update_map_, id) && + id_to_pending_update_map_.at(id).change_guid() == change_guid) { + id_to_pending_update_map_.erase(id); + } +} + +void FakePendingNetworkConfigurationTracker::IncrementCompletedAttempts( + const std::string& change_id, + const NetworkIdentifier& id) { + base::Optional<PendingNetworkConfigurationUpdate> existing_update = + GetPendingUpdate(change_id, id); + id_to_pending_update_map_.emplace( + std::piecewise_construct, std::forward_as_tuple(id), + std::forward_as_tuple(id, change_id, existing_update->specifics(), + existing_update->completed_attempts() + 1)); + id_to_completed_attempts_map_[id]++; +} + +std::vector<PendingNetworkConfigurationUpdate> +FakePendingNetworkConfigurationTracker::GetPendingUpdates() { + std::vector<PendingNetworkConfigurationUpdate> list; + for (const auto& it : id_to_pending_update_map_) + list.emplace_back(it.second); + return list; +} + +base::Optional<PendingNetworkConfigurationUpdate> +FakePendingNetworkConfigurationTracker::GetPendingUpdate( + const std::string& change_guid, + const NetworkIdentifier& id) { + if (!base::Contains(id_to_pending_update_map_, id) || + id_to_pending_update_map_.at(id).change_guid() != change_guid) { + return base::nullopt; + } + + return id_to_pending_update_map_.at(id); +} + +PendingNetworkConfigurationUpdate* +FakePendingNetworkConfigurationTracker::GetPendingUpdateById( + const NetworkIdentifier& id) { + if (!base::Contains(id_to_pending_update_map_, id)) + return nullptr; + + return &id_to_pending_update_map_.at(id); +} + +int FakePendingNetworkConfigurationTracker::GetCompletedAttempts( + const NetworkIdentifier& id) { + DCHECK(id_to_completed_attempts_map_.count(id)); + return id_to_completed_attempts_map_[id]; +} + +} // namespace sync_wifi + +} // namespace chromeos
diff --git a/chromeos/components/sync_wifi/fake_pending_network_configuration_tracker.h b/chromeos/components/sync_wifi/fake_pending_network_configuration_tracker.h new file mode 100644 index 0000000..ca90031 --- /dev/null +++ b/chromeos/components/sync_wifi/fake_pending_network_configuration_tracker.h
@@ -0,0 +1,63 @@ +// Copyright 2019 The Chromium 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 CHROMEOS_COMPONENTS_SYNC_WIFI_FAKE_PENDING_NETWORK_CONFIGURATION_TRACKER_H_ +#define CHROMEOS_COMPONENTS_SYNC_WIFI_FAKE_PENDING_NETWORK_CONFIGURATION_TRACKER_H_ + +#include <map> + +#include "base/containers/flat_map.h" +#include "base/optional.h" +#include "chromeos/components/sync_wifi/network_identifier.h" +#include "chromeos/components/sync_wifi/pending_network_configuration_tracker.h" + +namespace chromeos { + +namespace sync_wifi { + +class FakePendingNetworkConfigurationTracker + : public PendingNetworkConfigurationTracker { + public: + FakePendingNetworkConfigurationTracker(); + ~FakePendingNetworkConfigurationTracker() override; + + // sync_wifi::PendingNetworkConfigurationtracker:: + std::string TrackPendingUpdate( + const NetworkIdentifier& id, + const base::Optional<sync_pb::WifiConfigurationSpecificsData>& specifics) + override; + void MarkComplete(const std::string& change_guid, + const NetworkIdentifier& id) override; + void IncrementCompletedAttempts(const std::string& change_id, + const NetworkIdentifier& id) override; + std::vector<PendingNetworkConfigurationUpdate> GetPendingUpdates() override; + base::Optional<PendingNetworkConfigurationUpdate> GetPendingUpdate( + const std::string& change_guid, + const NetworkIdentifier& id) override; + + // Get the matching PendingNetworkConfigurationUpdate by for a given |id|. + // This is needed because some tests don't have insight into what + // change_guids are used. + PendingNetworkConfigurationUpdate* GetPendingUpdateById( + const NetworkIdentifier& id); + + // This includes ssids which have already been removed from the tracker. + int GetCompletedAttempts(const NetworkIdentifier& id); + + private: + std::map<NetworkIdentifier, PendingNetworkConfigurationUpdate> + id_to_pending_update_map_; + + // This map is not cleared when MarkComplete is called to allow tests to + // verify that the expected number of retries were performed before removal. + std::map<NetworkIdentifier, int> id_to_completed_attempts_map_; + + DISALLOW_COPY_AND_ASSIGN(FakePendingNetworkConfigurationTracker); +}; + +} // namespace sync_wifi + +} // namespace chromeos + +#endif // CHROMEOS_COMPONENTS_SYNC_WIFI_FAKE_PENDING_NETWORK_CONFIGURATION_TRACKER_H_
diff --git a/chromeos/components/sync_wifi/network_identifier.cc b/chromeos/components/sync_wifi/network_identifier.cc index a6dcb4c4..ea8783f3 100644 --- a/chromeos/components/sync_wifi/network_identifier.cc +++ b/chromeos/components/sync_wifi/network_identifier.cc
@@ -7,8 +7,9 @@ #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" -#include "chromeos/network/network_state.h" -#include "components/sync/protocol/model_type_state.pb.h" +#include "chromeos/components/sync_wifi/network_type_conversions.h" +#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" +#include "components/sync/protocol/wifi_configuration_specifics.pb.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" namespace chromeos { @@ -19,32 +20,22 @@ const char kDelimeter[] = "_"; -std::string GetSecurityType( - sync_pb::WifiConfigurationSpecificsData_SecurityType security_type) { - switch (security_type) { - case sync_pb::WifiConfigurationSpecificsData::SECURITY_TYPE_PSK: - return shill::kSecurityPsk; - case sync_pb::WifiConfigurationSpecificsData::SECURITY_TYPE_WEP: - return shill::kSecurityWep; - default: - NOTREACHED(); - return ""; - } -} - } // namespace // static NetworkIdentifier NetworkIdentifier::FromProto( const sync_pb::WifiConfigurationSpecificsData& specifics) { - return NetworkIdentifier(specifics.hex_ssid(), - GetSecurityType(specifics.security_type())); + return NetworkIdentifier( + specifics.hex_ssid(), + SecurityTypeStringFromProto(specifics.security_type())); } // static -NetworkIdentifier NetworkIdentifier::FromNetwork( - const chromeos::NetworkState& network) { - return NetworkIdentifier(network.GetHexSsid(), network.security_class()); +NetworkIdentifier NetworkIdentifier::FromMojoNetwork( + const network_config::mojom::NetworkStatePropertiesPtr& network) { + return NetworkIdentifier( + network->type_state->get_wifi()->hex_ssid, + SecurityTypeStringFromMojo(network->type_state->get_wifi()->security)); } // static @@ -77,6 +68,18 @@ return hex_ssid_ == o.hex_ssid_ && security_type_ == o.security_type_; } +bool NetworkIdentifier::operator!=(const NetworkIdentifier& o) const { + return hex_ssid_ != o.hex_ssid_ || security_type_ != o.security_type_; +} + +bool NetworkIdentifier::operator>(const NetworkIdentifier& o) const { + return *this != o && !(*this < o); +} + +bool NetworkIdentifier::operator<(const NetworkIdentifier& o) const { + return SerializeToString() < o.SerializeToString(); +} + } // namespace sync_wifi } // namespace chromeos
diff --git a/chromeos/components/sync_wifi/network_identifier.h b/chromeos/components/sync_wifi/network_identifier.h index 3d0cc96..c54ed35 100644 --- a/chromeos/components/sync_wifi/network_identifier.h +++ b/chromeos/components/sync_wifi/network_identifier.h
@@ -7,14 +7,14 @@ #include <string> +#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h" + namespace sync_pb { class WifiConfigurationSpecificsData; } namespace chromeos { -class NetworkState; - namespace sync_wifi { // A unique identifier for synced networks which contains the properties @@ -23,7 +23,8 @@ public: static NetworkIdentifier FromProto( const sync_pb::WifiConfigurationSpecificsData& specifics); - static NetworkIdentifier FromNetwork(const chromeos::NetworkState& network); + static NetworkIdentifier FromMojoNetwork( + const network_config::mojom::NetworkStatePropertiesPtr& network); // |serialized_string| is in the format of hex_ssid and security_type // concatenated with an underscore. security_type is the shill constant // returned from NetworkState::security_class(). For example, it would be @@ -40,6 +41,9 @@ virtual ~NetworkIdentifier(); bool operator==(const NetworkIdentifier& o) const; + bool operator!=(const NetworkIdentifier& o) const; + bool operator<(const NetworkIdentifier& o) const; + bool operator>(const NetworkIdentifier& o) const; std::string SerializeToString() const;
diff --git a/chromeos/components/sync_wifi/network_identifier_unittest.cc b/chromeos/components/sync_wifi/network_identifier_unittest.cc index aef500bd..a918bf4c 100644 --- a/chromeos/components/sync_wifi/network_identifier_unittest.cc +++ b/chromeos/components/sync_wifi/network_identifier_unittest.cc
@@ -38,16 +38,6 @@ EXPECT_EQ(expected_id, id); } -TEST_F(NetworkIdentifierTest, FromNetwork) { - chromeos::NetworkState network("dummy_path"); - network.PropertyChanged(shill::kWifiHexSsid, base::Value(kHexSsid)); - network.PropertyChanged(shill::kSecurityClassProperty, - base::Value(shill::kSecurityPsk)); - NetworkIdentifier id = NetworkIdentifier::FromNetwork(network); - EXPECT_EQ(kHexSsid, id.hex_ssid()); - EXPECT_EQ(shill::kSecurityPsk, id.security_type()); -} - TEST_F(NetworkIdentifierTest, FromString) { std::string string_id("0123456789ABCDEF_psk"); NetworkIdentifier id = NetworkIdentifier::DeserializeFromString(string_id);
diff --git a/chromeos/components/sync_wifi/network_type_conversions.cc b/chromeos/components/sync_wifi/network_type_conversions.cc new file mode 100644 index 0000000..d22d69c --- /dev/null +++ b/chromeos/components/sync_wifi/network_type_conversions.cc
@@ -0,0 +1,106 @@ +// Copyright 2019 The Chromium 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 "chromeos/components/sync_wifi/network_type_conversions.h" + +#include "base/strings/string_number_conversions.h" +#include "chromeos/components/sync_wifi/network_identifier.h" +#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_state.h" +#include "chromeos/network/network_state_handler.h" +#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" +#include "third_party/cros_system_api/dbus/shill/dbus-constants.h" + +namespace chromeos { + +namespace sync_wifi { + +namespace { + +std::string DecodeHexString(const std::string& base_16) { + std::string decoded; + DCHECK_EQ(base_16.size() % 2, 0u) << "Must be a multiple of 2"; + decoded.reserve(base_16.size() / 2); + + std::vector<uint8_t> v; + if (!base::HexStringToBytes(base_16, &v)) { + NOTREACHED(); + } + decoded.assign(reinterpret_cast<const char*>(&v[0]), v.size()); + return decoded; +} + +} // namespace + +std::string SecurityTypeStringFromMojo( + const network_config::mojom::SecurityType& security_type) { + switch (security_type) { + case network_config::mojom::SecurityType::kWpaPsk: + return shill::kSecurityPsk; + case network_config::mojom::SecurityType::kWepPsk: + return shill::kSecurityWep; + default: + // Only PSK and WEP secured networks are supported by sync. + NOTREACHED(); + return ""; + } +} + +std::string SecurityTypeStringFromProto( + const sync_pb::WifiConfigurationSpecificsData_SecurityType& security_type) { + switch (security_type) { + case sync_pb::WifiConfigurationSpecificsData::SECURITY_TYPE_PSK: + return shill::kSecurityPsk; + case sync_pb::WifiConfigurationSpecificsData::SECURITY_TYPE_WEP: + return shill::kSecurityWep; + default: + // Only PSK and WEP secured networks are supported by sync. + NOTREACHED(); + return ""; + } +} + +network_config::mojom::SecurityType MojoSecurityTypeFromProto( + const sync_pb::WifiConfigurationSpecificsData_SecurityType& security_type) { + switch (security_type) { + case sync_pb::WifiConfigurationSpecificsData::SECURITY_TYPE_PSK: + return network_config::mojom::SecurityType::kWpaPsk; + case sync_pb::WifiConfigurationSpecificsData::SECURITY_TYPE_WEP: + return network_config::mojom::SecurityType::kWepPsk; + default: + // Only PSK and WEP secured networks are supported by sync. + NOTREACHED(); + return network_config::mojom::SecurityType::kNone; + } +} + +network_config::mojom::ConfigPropertiesPtr MojoNetworkConfigFromProto( + const sync_pb::WifiConfigurationSpecificsData& specifics) { + auto config = network_config::mojom::ConfigProperties::New(); + auto wifi = network_config::mojom::WiFiConfigProperties::New(); + + wifi->ssid = DecodeHexString(specifics.hex_ssid()); + wifi->security = MojoSecurityTypeFromProto(specifics.security_type()); + wifi->passphrase = specifics.passphrase(); + + config->type_config = + network_config::mojom::NetworkTypeConfigProperties::NewWifi( + std::move(wifi)); + + config->auto_connect = network_config::mojom::AutoConnectConfig::New( + specifics.automatically_connect() == + sync_pb::WifiConfigurationSpecificsData::AUTOMATICALLY_CONNECT_ENABLED); + + config->priority = network_config::mojom::PriorityConfig::New( + specifics.is_preferred() == + sync_pb::WifiConfigurationSpecificsData::IS_PREFERRED_ENABLED + ? 1 + : 0); + + return config; +} + +} // namespace sync_wifi + +} // namespace chromeos
diff --git a/chromeos/components/sync_wifi/network_type_conversions.h b/chromeos/components/sync_wifi/network_type_conversions.h new file mode 100644 index 0000000..917d7f1 --- /dev/null +++ b/chromeos/components/sync_wifi/network_type_conversions.h
@@ -0,0 +1,34 @@ +// Copyright 2019 The Chromium 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 CHROMEOS_COMPONENTS_SYNC_WIFI_NETWORK_TYPE_CONVERSIONS_H_ +#define CHROMEOS_COMPONENTS_SYNC_WIFI_NETWORK_TYPE_CONVERSIONS_H_ + +#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" +#include "components/sync/protocol/wifi_configuration_specifics.pb.h" + +namespace chromeos { + +namespace sync_wifi { + +std::string SecurityTypeStringFromMojo( + const network_config::mojom::SecurityType& security_type); + +std::string SecurityTypeStringFromProto( + const sync_pb::WifiConfigurationSpecificsData_SecurityType& security_type); + +network_config::mojom::SecurityType MojoSecurityTypeFromString( + const std::string& security_type); + +network_config::mojom::SecurityType MojoSecurityTypeFromProto( + const sync_pb::WifiConfigurationSpecificsData_SecurityType& security_type); + +network_config::mojom::ConfigPropertiesPtr MojoNetworkConfigFromProto( + const sync_pb::WifiConfigurationSpecificsData& specifics); + +} // namespace sync_wifi + +} // namespace chromeos + +#endif // CHROMEOS_COMPONENTS_SYNC_WIFI_NETWORK_TYPE_CONVERSIONS_H_
diff --git a/chromeos/components/sync_wifi/pending_network_configuration_tracker.h b/chromeos/components/sync_wifi/pending_network_configuration_tracker.h index 2268387b..e1f2a40 100644 --- a/chromeos/components/sync_wifi/pending_network_configuration_tracker.h +++ b/chromeos/components/sync_wifi/pending_network_configuration_tracker.h
@@ -28,9 +28,8 @@ // Adds an update to the list of in flight changes. |change_uuid| is a // unique identifier for each update, |id| is the identifier for the network // which is getting updated, and |specifics| should be nullopt if the network - // is being deleted. - virtual void TrackPendingUpdate( - const std::string& change_guid, + // is being deleted. Returns the change_guid. + virtual std::string TrackPendingUpdate( const NetworkIdentifier& id, const base::Optional<sync_pb::WifiConfigurationSpecificsData>& specifics) = 0;
diff --git a/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.cc b/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.cc index b54f1d4..64b7d67 100644 --- a/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.cc +++ b/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.cc
@@ -4,6 +4,7 @@ #include "chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.h" +#include "base/guid.h" #include "base/optional.h" #include "base/strings/stringprintf.h" #include "chromeos/components/sync_wifi/network_identifier.h" @@ -66,8 +67,7 @@ PendingNetworkConfigurationTrackerImpl:: ~PendingNetworkConfigurationTrackerImpl() = default; -void PendingNetworkConfigurationTrackerImpl::TrackPendingUpdate( - const std::string& change_guid, +std::string PendingNetworkConfigurationTrackerImpl::TrackPendingUpdate( const NetworkIdentifier& id, const base::Optional<sync_pb::WifiConfigurationSpecificsData>& specifics) { std::string serialized_specifics; @@ -76,11 +76,15 @@ else CHECK(specifics->SerializeToString(&serialized_specifics)); + std::string change_guid = base::GenerateGUID(); + dict_.SetPath(GeneratePath(id, kChangeGuidKey), base::Value(change_guid)); dict_.SetPath(GeneratePath(id, kSpecificsKey), base::Value(serialized_specifics)); dict_.SetPath(GeneratePath(id, kCompletedAttemptsKey), base::Value(0)); pref_service_->Set(kPendingNetworkConfigurationsPref, dict_); + + return change_guid; } void PendingNetworkConfigurationTrackerImpl::MarkComplete(
diff --git a/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.h b/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.h index ddfbec7..e66fba6 100644 --- a/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.h +++ b/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.h
@@ -28,8 +28,7 @@ static void RegisterProfilePrefs(PrefRegistrySimple* registry); // sync_wifi::PendingNetworkConfigurationTracker:: - void TrackPendingUpdate( - const std::string& change_guid, + std::string TrackPendingUpdate( const NetworkIdentifier& id, const base::Optional<sync_pb::WifiConfigurationSpecificsData>& specifics) override;
diff --git a/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl_unittest.cc b/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl_unittest.cc index 1af7a02..d9ec158 100644 --- a/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl_unittest.cc +++ b/chromeos/components/sync_wifi/pending_network_configuration_tracker_impl_unittest.cc
@@ -22,8 +22,6 @@ const char kFredSsid[] = "Fred"; const char kMangoSsid[] = "Mango"; -const char kChangeGuid1[] = "change-1"; -const char kChangeGuid2[] = "change-2"; const char kPendingNetworkConfigurationsPref[] = "sync_wifi.pending_network_configuration_updates"; @@ -100,102 +98,109 @@ }; TEST_F(PendingNetworkConfigurationTrackerImplTest, TestMarkComplete) { - tracker()->TrackPendingUpdate(kChangeGuid1, fred_network_id(), - /*specifics=*/base::nullopt); - AssertTrackerHasMatchingUpdate(kChangeGuid1, fred_network_id()); + std::string change_guid = tracker()->TrackPendingUpdate( + fred_network_id(), /*specifics=*/base::nullopt); + AssertTrackerHasMatchingUpdate(change_guid, fred_network_id()); EXPECT_EQ(1u, GetPref()->DictSize()); - EXPECT_TRUE(DoesPrefContainPendingUpdate(fred_network_id(), kChangeGuid1)); - tracker()->MarkComplete(kChangeGuid1, fred_network_id()); - EXPECT_FALSE(tracker()->GetPendingUpdate(kChangeGuid1, fred_network_id())); + EXPECT_TRUE(DoesPrefContainPendingUpdate(fred_network_id(), change_guid)); + tracker()->MarkComplete(change_guid, fred_network_id()); + EXPECT_FALSE(tracker()->GetPendingUpdate(change_guid, fred_network_id())); EXPECT_EQ(0u, GetPref()->DictSize()); } TEST_F(PendingNetworkConfigurationTrackerImplTest, TestTwoChangesSameNetwork) { - tracker()->TrackPendingUpdate(kChangeGuid1, fred_network_id(), - /*specifics=*/base::nullopt); - tracker()->IncrementCompletedAttempts(kChangeGuid1, fred_network_id()); - AssertTrackerHasMatchingUpdate(kChangeGuid1, fred_network_id(), + std::string change_guid = + tracker()->TrackPendingUpdate(fred_network_id(), + /*specifics=*/base::nullopt); + tracker()->IncrementCompletedAttempts(change_guid, fred_network_id()); + AssertTrackerHasMatchingUpdate(change_guid, fred_network_id(), /*completed_attempts=*/1); EXPECT_EQ(1u, GetPref()->DictSize()); EXPECT_EQ(1, tracker() - ->GetPendingUpdate(kChangeGuid1, fred_network_id()) + ->GetPendingUpdate(change_guid, fred_network_id()) ->completed_attempts()); - tracker()->TrackPendingUpdate(kChangeGuid2, fred_network_id(), - /*specifics=*/base::nullopt); - EXPECT_FALSE(tracker()->GetPendingUpdate(kChangeGuid1, fred_network_id())); - AssertTrackerHasMatchingUpdate(kChangeGuid2, fred_network_id()); + std::string second_change_guid = + tracker()->TrackPendingUpdate(fred_network_id(), + /*specifics=*/base::nullopt); + EXPECT_FALSE(tracker()->GetPendingUpdate(change_guid, fred_network_id())); + AssertTrackerHasMatchingUpdate(second_change_guid, fred_network_id()); EXPECT_EQ(0, tracker() - ->GetPendingUpdate(kChangeGuid2, fred_network_id()) + ->GetPendingUpdate(second_change_guid, fred_network_id()) ->completed_attempts()); EXPECT_EQ(1u, GetPref()->DictSize()); } TEST_F(PendingNetworkConfigurationTrackerImplTest, TestTwoChangesDifferentNetworks) { - tracker()->TrackPendingUpdate(kChangeGuid1, fred_network_id(), - /*specifics=*/base::nullopt); - AssertTrackerHasMatchingUpdate(kChangeGuid1, fred_network_id()); - EXPECT_TRUE(DoesPrefContainPendingUpdate(fred_network_id(), kChangeGuid1)); + std::string change_guid = + tracker()->TrackPendingUpdate(fred_network_id(), + /*specifics=*/base::nullopt); + AssertTrackerHasMatchingUpdate(change_guid, fred_network_id()); + EXPECT_TRUE(DoesPrefContainPendingUpdate(fred_network_id(), change_guid)); EXPECT_EQ(1u, GetPref()->DictSize()); - tracker()->TrackPendingUpdate(kChangeGuid2, mango_network_id(), - /*specifics=*/base::nullopt); - AssertTrackerHasMatchingUpdate(kChangeGuid1, fred_network_id()); - AssertTrackerHasMatchingUpdate(kChangeGuid2, mango_network_id()); - EXPECT_TRUE(DoesPrefContainPendingUpdate(fred_network_id(), kChangeGuid1)); - EXPECT_TRUE(DoesPrefContainPendingUpdate(mango_network_id(), kChangeGuid2)); + std::string second_change_guid = + tracker()->TrackPendingUpdate(mango_network_id(), + /*specifics=*/base::nullopt); + AssertTrackerHasMatchingUpdate(change_guid, fred_network_id()); + AssertTrackerHasMatchingUpdate(second_change_guid, mango_network_id()); + EXPECT_TRUE(DoesPrefContainPendingUpdate(fred_network_id(), change_guid)); + EXPECT_TRUE( + DoesPrefContainPendingUpdate(mango_network_id(), second_change_guid)); EXPECT_EQ(2u, GetPref()->DictSize()); } TEST_F(PendingNetworkConfigurationTrackerImplTest, TestGetPendingUpdates) { - tracker()->TrackPendingUpdate(kChangeGuid1, fred_network_id(), - /*specifics=*/base::nullopt); - tracker()->TrackPendingUpdate(kChangeGuid2, mango_network_id(), - /*specifics=*/base::nullopt); + std::string change_guid = + tracker()->TrackPendingUpdate(fred_network_id(), + /*specifics=*/base::nullopt); + std::string second_change_guid = + tracker()->TrackPendingUpdate(mango_network_id(), + /*specifics=*/base::nullopt); std::vector<PendingNetworkConfigurationUpdate> list = tracker()->GetPendingUpdates(); EXPECT_EQ(2u, list.size()); - EXPECT_EQ(kChangeGuid1, list[0].change_guid()); + EXPECT_EQ(change_guid, list[0].change_guid()); EXPECT_EQ(fred_network_id(), list[0].id()); - EXPECT_EQ(kChangeGuid2, list[1].change_guid()); + EXPECT_EQ(second_change_guid, list[1].change_guid()); EXPECT_EQ(mango_network_id(), list[1].id()); - tracker()->MarkComplete(kChangeGuid1, fred_network_id()); + tracker()->MarkComplete(change_guid, fred_network_id()); list = tracker()->GetPendingUpdates(); EXPECT_EQ(1u, list.size()); - EXPECT_EQ(kChangeGuid2, list[0].change_guid()); + EXPECT_EQ(second_change_guid, list[0].change_guid()); EXPECT_EQ(mango_network_id(), list[0].id()); } TEST_F(PendingNetworkConfigurationTrackerImplTest, TestGetPendingUpdate) { sync_pb::WifiConfigurationSpecificsData specifics = GenerateTestWifiSpecifics(fred_network_id()); - tracker()->TrackPendingUpdate(kChangeGuid1, fred_network_id(), specifics); + std::string change_guid = + tracker()->TrackPendingUpdate(fred_network_id(), specifics); - AssertTrackerHasMatchingUpdate(kChangeGuid1, fred_network_id(), + AssertTrackerHasMatchingUpdate(change_guid, fred_network_id(), /*completed_attempts=*/0, specifics); - - EXPECT_FALSE(tracker()->GetPendingUpdate(kChangeGuid2, mango_network_id())); } TEST_F(PendingNetworkConfigurationTrackerImplTest, TestRetryCounting) { - tracker()->TrackPendingUpdate(kChangeGuid1, fred_network_id(), - /*specifics=*/base::nullopt); - AssertTrackerHasMatchingUpdate(kChangeGuid1, fred_network_id()); + std::string change_guid = + tracker()->TrackPendingUpdate(fred_network_id(), + /*specifics=*/base::nullopt); + AssertTrackerHasMatchingUpdate(change_guid, fred_network_id()); EXPECT_EQ(1u, GetPref()->DictSize()); EXPECT_EQ(0, tracker() - ->GetPendingUpdate(kChangeGuid1, fred_network_id()) + ->GetPendingUpdate(change_guid, fred_network_id()) ->completed_attempts()); - tracker()->IncrementCompletedAttempts(kChangeGuid1, fred_network_id()); - tracker()->IncrementCompletedAttempts(kChangeGuid1, fred_network_id()); - tracker()->IncrementCompletedAttempts(kChangeGuid1, fred_network_id()); + tracker()->IncrementCompletedAttempts(change_guid, fred_network_id()); + tracker()->IncrementCompletedAttempts(change_guid, fred_network_id()); + tracker()->IncrementCompletedAttempts(change_guid, fred_network_id()); EXPECT_EQ(3, tracker() - ->GetPendingUpdate(kChangeGuid1, fred_network_id()) + ->GetPendingUpdate(change_guid, fred_network_id()) ->completed_attempts()); - tracker()->IncrementCompletedAttempts(kChangeGuid1, fred_network_id()); - tracker()->IncrementCompletedAttempts(kChangeGuid1, fred_network_id()); + tracker()->IncrementCompletedAttempts(change_guid, fred_network_id()); + tracker()->IncrementCompletedAttempts(change_guid, fred_network_id()); EXPECT_EQ(5, tracker() - ->GetPendingUpdate(kChangeGuid1, fred_network_id()) + ->GetPendingUpdate(change_guid, fred_network_id()) ->completed_attempts()); }
diff --git a/chromeos/components/sync_wifi/pending_network_configuration_update.cc b/chromeos/components/sync_wifi/pending_network_configuration_update.cc index 010cfe90..4d1aff7 100644 --- a/chromeos/components/sync_wifi/pending_network_configuration_update.cc +++ b/chromeos/components/sync_wifi/pending_network_configuration_update.cc
@@ -24,6 +24,9 @@ PendingNetworkConfigurationUpdate::~PendingNetworkConfigurationUpdate() = default; +PendingNetworkConfigurationUpdate& PendingNetworkConfigurationUpdate::operator=( + PendingNetworkConfigurationUpdate& update) = default; + bool PendingNetworkConfigurationUpdate::IsDeleteOperation() const { return !specifics_.has_value(); }
diff --git a/chromeos/components/sync_wifi/pending_network_configuration_update.h b/chromeos/components/sync_wifi/pending_network_configuration_update.h index 062ce1f9..2fc53fa2 100644 --- a/chromeos/components/sync_wifi/pending_network_configuration_update.h +++ b/chromeos/components/sync_wifi/pending_network_configuration_update.h
@@ -28,6 +28,8 @@ int completed_attempts); PendingNetworkConfigurationUpdate( const PendingNetworkConfigurationUpdate& update); + PendingNetworkConfigurationUpdate& operator=( + PendingNetworkConfigurationUpdate& update); virtual ~PendingNetworkConfigurationUpdate(); // The identifier for the network. @@ -49,9 +51,9 @@ bool IsDeleteOperation() const; private: - const NetworkIdentifier id_; - const std::string change_guid_; - const base::Optional<sync_pb::WifiConfigurationSpecificsData> specifics_; + NetworkIdentifier id_; + std::string change_guid_; + base::Optional<sync_pb::WifiConfigurationSpecificsData> specifics_; int completed_attempts_; };
diff --git a/chromeos/components/sync_wifi/synced_network_updater_impl.cc b/chromeos/components/sync_wifi/synced_network_updater_impl.cc new file mode 100644 index 0000000..8f98fe36 --- /dev/null +++ b/chromeos/components/sync_wifi/synced_network_updater_impl.cc
@@ -0,0 +1,149 @@ +// Copyright 2019 The Chromium 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 "chromeos/components/sync_wifi/synced_network_updater_impl.h" + +#include "base/bind.h" +#include "base/guid.h" +#include "base/values.h" +#include "chromeos/components/sync_wifi/network_type_conversions.h" +#include "chromeos/network/network_configuration_handler.h" +#include "chromeos/network/network_profile_handler.h" +#include "chromeos/network/network_state.h" +#include "components/device_event_log/device_event_log.h" +#include "components/proxy_config/proxy_config_dictionary.h" +#include "third_party/cros_system_api/dbus/shill/dbus-constants.h" + +namespace chromeos { + +namespace sync_wifi { + +SyncedNetworkUpdaterImpl::SyncedNetworkUpdaterImpl( + std::unique_ptr<PendingNetworkConfigurationTracker> tracker, + network_config::mojom::CrosNetworkConfig* cros_network_config) + : tracker_(std::move(tracker)), cros_network_config_(cros_network_config) { + cros_network_config_->AddObserver( + cros_network_config_observer_receiver_.BindNewPipeAndPassRemote()); + // Load the current list of networks. + OnNetworkStateListChanged(); +} + +SyncedNetworkUpdaterImpl::~SyncedNetworkUpdaterImpl() = default; + +void SyncedNetworkUpdaterImpl::AddOrUpdateNetwork( + const sync_pb::WifiConfigurationSpecificsData& specifics) { + auto id = NetworkIdentifier::FromProto(specifics); + network_config::mojom::NetworkStatePropertiesPtr existing_network = + FindLocalNetwork(id); + std::string change_guid = tracker_->TrackPendingUpdate(id, specifics); + network_config::mojom::ConfigPropertiesPtr config = + MojoNetworkConfigFromProto(specifics); + + if (existing_network) { + cros_network_config_->SetProperties( + existing_network->guid, std::move(config), + base::BindOnce(&SyncedNetworkUpdaterImpl::OnSetPropertiesResult, + weak_ptr_factory_.GetWeakPtr(), change_guid, id)); + return; + } + cros_network_config_->ConfigureNetwork( + std::move(config), /* shared= */ false, + base::BindOnce(&SyncedNetworkUpdaterImpl::OnConfigureNetworkResult, + weak_ptr_factory_.GetWeakPtr(), change_guid, id)); +} + +void SyncedNetworkUpdaterImpl::RemoveNetwork(const NetworkIdentifier& id) { + network_config::mojom::NetworkStatePropertiesPtr network = + FindLocalNetwork(id); + if (!network) + return; + + std::string change_guid = + tracker_->TrackPendingUpdate(id, /*specifics=*/base::nullopt); + + cros_network_config_->ForgetNetwork( + network->guid, + base::BindOnce(&SyncedNetworkUpdaterImpl::OnForgetNetworkResult, + weak_ptr_factory_.GetWeakPtr(), change_guid, id)); +} + +network_config::mojom::NetworkStatePropertiesPtr +SyncedNetworkUpdaterImpl::FindLocalNetwork(const NetworkIdentifier& id) { + for (const network_config::mojom::NetworkStatePropertiesPtr& network : + networks_) { + if (id == NetworkIdentifier::FromMojoNetwork(network)) + return network.Clone(); + } + return nullptr; +} + +void SyncedNetworkUpdaterImpl::OnNetworkStateListChanged() { + cros_network_config_->GetNetworkStateList( + network_config::mojom::NetworkFilter::New( + network_config::mojom::FilterType::kConfigured, + network_config::mojom::NetworkType::kWiFi, + /* limit= */ 0), + base::BindOnce(&SyncedNetworkUpdaterImpl::OnGetNetworkList, + base::Unretained(this))); +} + +void SyncedNetworkUpdaterImpl::OnGetNetworkList( + std::vector<network_config::mojom::NetworkStatePropertiesPtr> networks) { + networks_ = std::move(networks); +} + +void SyncedNetworkUpdaterImpl::OnError(const std::string& change_guid, + const NetworkIdentifier& id, + const std::string& error_name) { + NET_LOG(ERROR) << "Failed to update id:" << id.SerializeToString() + << " error:" << error_name; +} + +void SyncedNetworkUpdaterImpl::OnConfigureNetworkResult( + const std::string& change_guid, + const NetworkIdentifier& id, + const base::Optional<std::string>& guid, + const std::string& error_message) { + if (!guid) { + OnError(change_guid, id, "Failed to configure network."); + return; + } + VLOG(1) << "Successfully updated network with id " << id.SerializeToString(); + CleanupUpdate(change_guid, id); +} + +void SyncedNetworkUpdaterImpl::OnSetPropertiesResult( + const std::string& change_guid, + const NetworkIdentifier& id, + bool success, + const std::string& error_message) { + if (!success) { + OnError(change_guid, id, "Failed to update properties on network."); + return; + } + VLOG(1) << "Successfully updated network with id " << id.SerializeToString(); + CleanupUpdate(change_guid, id); +} + +void SyncedNetworkUpdaterImpl::OnForgetNetworkResult( + const std::string& change_guid, + const NetworkIdentifier& id, + bool success) { + if (!success) { + OnError(change_guid, id, "Failed to remove network."); + return; + } + + VLOG(1) << "Successfully deleted network with id " << id.SerializeToString(); + CleanupUpdate(change_guid, id); +} + +void SyncedNetworkUpdaterImpl::CleanupUpdate(const std::string& change_guid, + const NetworkIdentifier& id) { + tracker_->MarkComplete(change_guid, id); +} + +} // namespace sync_wifi + +} // namespace chromeos
diff --git a/chromeos/components/sync_wifi/synced_network_updater_impl.h b/chromeos/components/sync_wifi/synced_network_updater_impl.h new file mode 100644 index 0000000..bf2034e --- /dev/null +++ b/chromeos/components/sync_wifi/synced_network_updater_impl.h
@@ -0,0 +1,91 @@ +// Copyright 2019 The Chromium 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 CHROMEOS_COMPONENTS_SYNC_WIFI_SYNCED_NETWORK_UPDATER_IMPL_H_ +#define CHROMEOS_COMPONENTS_SYNC_WIFI_SYNCED_NETWORK_UPDATER_IMPL_H_ + +#include "base/memory/weak_ptr.h" +#include "base/values.h" +#include "chromeos/components/sync_wifi/network_identifier.h" +#include "chromeos/components/sync_wifi/pending_network_configuration_tracker.h" +#include "chromeos/components/sync_wifi/synced_network_updater.h" +#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" +#include "components/sync/protocol/model_type_state.pb.h" +#include "mojo/public/cpp/bindings/receiver.h" + +namespace chromeos { + +namespace sync_wifi { + +// Implementation of SyncedNetworkUpdater. This class takes add/update/delete +// requests from the sync backend and applies them to the local network stack +// using chromeos::NetworkConfigurationHandler. +class SyncedNetworkUpdaterImpl + : public SyncedNetworkUpdater, + public chromeos::network_config::mojom::CrosNetworkConfigObserver { + public: + // |cros_network_config| must outlive this class. + SyncedNetworkUpdaterImpl( + std::unique_ptr<PendingNetworkConfigurationTracker> tracker, + network_config::mojom::CrosNetworkConfig* cros_network_config); + ~SyncedNetworkUpdaterImpl() override; + + void AddOrUpdateNetwork( + const sync_pb::WifiConfigurationSpecificsData& specifics) override; + + void RemoveNetwork(const NetworkIdentifier& id) override; + + // CrosNetworkConfigObserver: + void OnNetworkStateListChanged() override; + void OnActiveNetworksChanged( + std::vector< + network_config::mojom::NetworkStatePropertiesPtr> /* networks */) + override {} + void OnNetworkStateChanged( + chromeos::network_config::mojom::NetworkStatePropertiesPtr /* network */) + override {} + void OnDeviceStateListChanged() override {} + void OnVpnProvidersChanged() override {} + void OnNetworkCertificatesChanged() override {} + + private: + void CleanupUpdate(const std::string& change_guid, + const NetworkIdentifier& id); + network_config::mojom::NetworkStatePropertiesPtr FindLocalNetwork( + const NetworkIdentifier& id); + + base::Optional<base::DictionaryValue> ConvertToDictionary( + const sync_pb::WifiConfigurationSpecificsData& specifics, + const std::string& guid); + void OnGetNetworkList( + std::vector<network_config::mojom::NetworkStatePropertiesPtr> networks); + void OnError(const std::string& change_guid, + const NetworkIdentifier& id, + const std::string& error_name); + void OnSetPropertiesResult(const std::string& change_guid, + const NetworkIdentifier& id, + bool success, + const std::string& error_message); + void OnConfigureNetworkResult(const std::string& change_guid, + const NetworkIdentifier& id, + const base::Optional<std::string>& guid, + const std::string& error_message); + void OnForgetNetworkResult(const std::string& change_guid, + const NetworkIdentifier& id, + bool success); + + std::unique_ptr<PendingNetworkConfigurationTracker> tracker_; + network_config::mojom::CrosNetworkConfig* cros_network_config_; + mojo::Receiver<chromeos::network_config::mojom::CrosNetworkConfigObserver> + cros_network_config_observer_receiver_{this}; + std::vector<network_config::mojom::NetworkStatePropertiesPtr> networks_; + + base::WeakPtrFactory<SyncedNetworkUpdaterImpl> weak_ptr_factory_{this}; +}; + +} // namespace sync_wifi + +} // namespace chromeos + +#endif // CHROMEOS_COMPONENTS_SYNC_WIFI_SYNCED_NETWORK_UPDATER_IMPL_H_
diff --git a/chromeos/components/sync_wifi/synced_network_updater_impl_unittest.cc b/chromeos/components/sync_wifi/synced_network_updater_impl_unittest.cc new file mode 100644 index 0000000..d690337 --- /dev/null +++ b/chromeos/components/sync_wifi/synced_network_updater_impl_unittest.cc
@@ -0,0 +1,247 @@ +// Copyright 2019 The Chromium 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 <memory> + +#include "ash/public/cpp/network_config_service.h" +#include "base/bind.h" +#include "base/logging.h" +#include "base/macros.h" +#include "base/optional.h" +#include "base/run_loop.h" +#include "base/test/task_environment.h" +#include "chromeos/components/sync_wifi/fake_pending_network_configuration_tracker.h" +#include "chromeos/components/sync_wifi/network_identifier.h" +#include "chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.h" +#include "chromeos/components/sync_wifi/synced_network_updater_impl.h" +#include "chromeos/components/sync_wifi/test_data_generator.h" +#include "chromeos/dbus/shill/fake_shill_simulated_result.h" +#include "chromeos/dbus/shill/shill_clients.h" +#include "chromeos/dbus/shill/shill_manager_client.h" +#include "chromeos/dbus/shill/shill_profile_client.h" +#include "chromeos/dbus/shill/shill_service_client.h" +#include "chromeos/login/login_state/login_state.h" +#include "chromeos/network/managed_network_configuration_handler.h" +#include "chromeos/network/network_cert_loader.h" +#include "chromeos/network/network_certificate_handler.h" +#include "chromeos/network/network_configuration_handler.h" +#include "chromeos/network/network_connection_handler.h" +#include "chromeos/network/network_device_handler.h" +#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_profile_handler.h" +#include "chromeos/network/network_state_handler.h" +#include "chromeos/services/network_config/cros_network_config.h" +#include "chromeos/services/network_config/in_process_instance.h" +#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h" +#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" +#include "components/user_manager/fake_user_manager.h" +#include "components/user_manager/scoped_user_manager.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/cros_system_api/dbus/shill/dbus-constants.h" + +namespace chromeos { + +class NetworkDeviceHandler; +class NetworkProfileHandler; +class NetworkConfigurationHandler; +class NetworkConnectionHandler; +class ManagedNetworkConfigurationHandler; + +namespace sync_wifi { + +namespace { + +const char kFredSsid[] = "Fred"; +const char kMangoSsid[] = "Mango"; + +const chromeos::NetworkState* FindLocalNetworkById( + const NetworkIdentifier& id) { + chromeos::NetworkStateHandler::NetworkStateList network_list; + chromeos::NetworkHandler::Get() + ->network_state_handler() + ->GetNetworkListByType( + chromeos::NetworkTypePattern::WiFi(), /* configured_only= */ true, + /* visible_only= */ false, /* limit= */ 0, &network_list); + for (const chromeos::NetworkState* network : network_list) { + if (network->GetHexSsid() == id.hex_ssid() && + network->security_class() == id.security_type()) { + return network; + } + } + return nullptr; +} + +} // namespace + +class SyncedNetworkUpdaterImplTest : public testing::Test { + public: + SyncedNetworkUpdaterImplTest() + : task_environment_(base::test::TaskEnvironment::MainThreadType::DEFAULT, + base::test::TaskEnvironment::TimeSource::MOCK_TIME) { + LoginState::Initialize(); + network_state_helper_ = std::make_unique<NetworkStateTestHelper>( + /*use_default_devices_and_services=*/false); + network_device_handler_ = + chromeos::NetworkDeviceHandler::InitializeForTesting( + network_state_helper_->network_state_handler()); + network_profile_handler_ = NetworkProfileHandler::InitializeForTesting(); + network_device_handler_ = NetworkDeviceHandler::InitializeForTesting( + network_state_helper_->network_state_handler()); + network_configuration_handler_ = + base::WrapUnique<NetworkConfigurationHandler>( + NetworkConfigurationHandler::InitializeForTest( + network_state_helper_->network_state_handler(), + network_device_handler_.get())); + managed_network_configuration_handler_ = + ManagedNetworkConfigurationHandler::InitializeForTesting( + network_state_helper_->network_state_handler(), + network_profile_handler_.get(), network_device_handler_.get(), + network_configuration_handler_.get()); + managed_network_configuration_handler_->SetPolicy( + ::onc::ONC_SOURCE_DEVICE_POLICY, + /*userhash=*/std::string(), + /*network_configs_onc=*/base::ListValue(), + /*global_network_config=*/base::DictionaryValue()); + cros_network_config_impl_ = + std::make_unique<chromeos::network_config::CrosNetworkConfig>( + network_state_helper_->network_state_handler(), + network_device_handler_.get(), + managed_network_configuration_handler_.get(), + network_connection_handler_.get(), + /*network_certificate_handler=*/nullptr); + OverrideInProcessInstanceForTesting(cros_network_config_impl_.get()); + + ash::GetNetworkConfigService( + remote_cros_network_config_.BindNewPipeAndPassReceiver()); + + auto fake_user_manager = std::make_unique<user_manager::FakeUserManager>(); + scoped_user_manager_ = std::make_unique<user_manager::ScopedUserManager>( + std::move(fake_user_manager)); + } + + ~SyncedNetworkUpdaterImplTest() override { + LoginState::Shutdown(); + network_config::OverrideInProcessInstanceForTesting(nullptr); + } + + void SetUp() override { + testing::Test::SetUp(); + NetworkHandler::Initialize(); + network_state_helper()->ResetDevicesAndServices(); + base::RunLoop().RunUntilIdle(); + + auto tracker_unique_ptr = + std::make_unique<FakePendingNetworkConfigurationTracker>(); + tracker_ = tracker_unique_ptr.get(); + updater_ = std::make_unique<SyncedNetworkUpdaterImpl>( + std::move(tracker_unique_ptr), remote_cros_network_config_.get()); + } + + void TearDown() override { + chromeos::NetworkHandler::Shutdown(); + testing::Test::TearDown(); + } + + FakePendingNetworkConfigurationTracker* tracker() { return tracker_; } + SyncedNetworkUpdaterImpl* updater() { return updater_.get(); } + chromeos::NetworkStateTestHelper* network_state_helper() { + return network_state_helper_.get(); + } + NetworkIdentifier fred_network_id() { return fred_network_id_; } + NetworkIdentifier mango_network_id() { return mango_network_id_; } + + private: + base::test::TaskEnvironment task_environment_; + FakePendingNetworkConfigurationTracker* tracker_; + std::unique_ptr<NetworkStateTestHelper> network_state_helper_; + std::unique_ptr<SyncedNetworkUpdaterImpl> updater_; + std::unique_ptr<network_config::CrosNetworkConfig> cros_network_config_impl_; + std::unique_ptr<NetworkProfileHandler> network_profile_handler_; + std::unique_ptr<NetworkDeviceHandler> network_device_handler_; + std::unique_ptr<NetworkConfigurationHandler> network_configuration_handler_; + std::unique_ptr<ManagedNetworkConfigurationHandler> + managed_network_configuration_handler_; + std::unique_ptr<NetworkConnectionHandler> network_connection_handler_; + mojo::Remote<chromeos::network_config::mojom::CrosNetworkConfig> + remote_cros_network_config_; + std::unique_ptr<user_manager::ScopedUserManager> scoped_user_manager_; + + NetworkIdentifier fred_network_id_ = GeneratePskNetworkId(kFredSsid); + NetworkIdentifier mango_network_id_ = GeneratePskNetworkId(kMangoSsid); + + DISALLOW_COPY_AND_ASSIGN(SyncedNetworkUpdaterImplTest); +}; + +TEST_F(SyncedNetworkUpdaterImplTest, TestAdd_OneNetwork) { + sync_pb::WifiConfigurationSpecificsData specifics = + GenerateTestWifiSpecifics(fred_network_id()); + NetworkIdentifier id = NetworkIdentifier::FromProto(specifics); + updater()->AddOrUpdateNetwork(specifics); + EXPECT_TRUE(tracker()->GetPendingUpdateById(id)); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(FindLocalNetworkById(id)); + EXPECT_FALSE(tracker()->GetPendingUpdateById(id)); +} + +TEST_F(SyncedNetworkUpdaterImplTest, TestAdd_ThenRemove) { + EXPECT_FALSE(FindLocalNetworkById(fred_network_id())); + updater()->AddOrUpdateNetwork(GenerateTestWifiSpecifics(fred_network_id())); + EXPECT_TRUE(tracker()->GetPendingUpdateById(fred_network_id())); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(FindLocalNetworkById(fred_network_id())); + updater()->RemoveNetwork(fred_network_id()); + PendingNetworkConfigurationUpdate* update = + tracker()->GetPendingUpdateById(fred_network_id()); + EXPECT_TRUE(update); + EXPECT_FALSE(update->specifics()); + base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(tracker()->GetPendingUpdateById(fred_network_id())); + EXPECT_FALSE(FindLocalNetworkById(fred_network_id())); +} + +TEST_F(SyncedNetworkUpdaterImplTest, TestAdd_TwoNetworks) { + updater()->AddOrUpdateNetwork(GenerateTestWifiSpecifics(fred_network_id())); + updater()->AddOrUpdateNetwork(GenerateTestWifiSpecifics(mango_network_id())); + EXPECT_TRUE(tracker()->GetPendingUpdateById(fred_network_id())); + EXPECT_TRUE(tracker()->GetPendingUpdateById(mango_network_id())); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(FindLocalNetworkById(fred_network_id())); + EXPECT_TRUE(FindLocalNetworkById(mango_network_id())); + EXPECT_FALSE(tracker()->GetPendingUpdateById(fred_network_id())); + EXPECT_FALSE(tracker()->GetPendingUpdateById(mango_network_id())); +} + +TEST_F(SyncedNetworkUpdaterImplTest, TestFailToAdd_Error) { + network_state_helper()->manager_test()->SetSimulateConfigurationResult( + chromeos::FakeShillSimulatedResult::kFailure); + + updater()->AddOrUpdateNetwork(GenerateTestWifiSpecifics(fred_network_id())); + EXPECT_TRUE(tracker()->GetPendingUpdateById(fred_network_id())); + + base::RunLoop().RunUntilIdle(); + + EXPECT_FALSE(FindLocalNetworkById(fred_network_id())); + EXPECT_TRUE(tracker()->GetPendingUpdateById(fred_network_id())); +} + +TEST_F(SyncedNetworkUpdaterImplTest, TestFailToRemove) { + network_state_helper()->profile_test()->SetSimulateDeleteResult( + chromeos::FakeShillSimulatedResult::kFailure); + updater()->AddOrUpdateNetwork(GenerateTestWifiSpecifics(fred_network_id())); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(FindLocalNetworkById(fred_network_id())); + EXPECT_FALSE(tracker()->GetPendingUpdateById(fred_network_id())); + + updater()->RemoveNetwork(fred_network_id()); + EXPECT_TRUE(tracker()->GetPendingUpdateById(fred_network_id())); + + base::RunLoop().RunUntilIdle(); + + EXPECT_TRUE(FindLocalNetworkById(fred_network_id())); + EXPECT_TRUE(tracker()->GetPendingUpdateById(fred_network_id())); +} + +} // namespace sync_wifi + +} // namespace chromeos
diff --git a/chromeos/components/sync_wifi/wifi_configuration_sync_service.cc b/chromeos/components/sync_wifi/wifi_configuration_sync_service.cc index f11023d..843551b6 100644 --- a/chromeos/components/sync_wifi/wifi_configuration_sync_service.cc +++ b/chromeos/components/sync_wifi/wifi_configuration_sync_service.cc
@@ -6,9 +6,13 @@ #include <utility> +#include "ash/public/cpp/network_config_service.h" #include "base/bind_helpers.h" #include "base/time/default_clock.h" +#include "chromeos/components/sync_wifi/pending_network_configuration_tracker_impl.h" +#include "chromeos/components/sync_wifi/synced_network_updater_impl.h" #include "chromeos/components/sync_wifi/wifi_configuration_bridge.h" +#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "components/sync/base/report_unrecoverable_error.h" #include "components/sync/model/model_type_store.h" #include "components/sync/model_impl/client_tag_based_model_type_processor.h" @@ -19,9 +23,15 @@ WifiConfigurationSyncService::WifiConfigurationSyncService( version_info::Channel channel, + PrefService* pref_service, syncer::OnceModelTypeStoreFactory create_store_callback) { + ash::GetNetworkConfigService( + remote_cros_network_config_.BindNewPipeAndPassReceiver()); + updater_ = std::make_unique<SyncedNetworkUpdaterImpl>( + std::make_unique<PendingNetworkConfigurationTrackerImpl>(pref_service), + remote_cros_network_config_.get()); bridge_ = std::make_unique<sync_wifi::WifiConfigurationBridge>( - /* synced_network_updater= */ nullptr, + updater_.get(), std::make_unique<syncer::ClientTagBasedModelTypeProcessor>( syncer::WIFI_CONFIGURATIONS, base::BindRepeating(&syncer::ReportUnrecoverableError, channel)),
diff --git a/chromeos/components/sync_wifi/wifi_configuration_sync_service.h b/chromeos/components/sync_wifi/wifi_configuration_sync_service.h index 6fd2818..63009cf4 100644 --- a/chromeos/components/sync_wifi/wifi_configuration_sync_service.h +++ b/chromeos/components/sync_wifi/wifi_configuration_sync_service.h
@@ -9,10 +9,13 @@ #include <string> #include "base/memory/weak_ptr.h" +#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "components/keyed_service/core/keyed_service.h" +#include "components/prefs/pref_service.h" #include "components/sync/model/model_type_store.h" #include "components/sync/model/model_type_store_service.h" #include "components/version_info/channel.h" +#include "mojo/public/cpp/bindings/remote.h" namespace syncer { class ModelTypeControllerDelegate; @@ -22,6 +25,7 @@ namespace sync_wifi { +class SyncedNetworkUpdaterImpl; class WifiConfigurationBridge; // A profile keyed service which instantiates and provides access to an instance @@ -30,6 +34,7 @@ public: WifiConfigurationSyncService( version_info::Channel channel, + PrefService* pref_service, syncer::OnceModelTypeStoreFactory create_store_callback); ~WifiConfigurationSyncService() override; @@ -37,6 +42,9 @@ private: std::unique_ptr<WifiConfigurationBridge> bridge_; + std::unique_ptr<SyncedNetworkUpdaterImpl> updater_; + mojo::Remote<chromeos::network_config::mojom::CrosNetworkConfig> + remote_cros_network_config_; DISALLOW_COPY_AND_ASSIGN(WifiConfigurationSyncService); };
diff --git a/chromeos/dbus/debug_daemon/debug_daemon_client.cc b/chromeos/dbus/debug_daemon/debug_daemon_client.cc index c86e445..e31044e 100644 --- a/chromeos/dbus/debug_daemon/debug_daemon_client.cc +++ b/chromeos/dbus/debug_daemon/debug_daemon_client.cc
@@ -551,6 +551,17 @@ weak_ptr_factory_.GetWeakPtr(), std::move(callback))); } + void SetKstaledRatio(uint8_t val, KstaledRatioCallback callback) override { + dbus::MethodCall method_call(debugd::kDebugdInterface, + debugd::kKstaledSetRatio); + dbus::MessageWriter writer(&method_call); + writer.AppendByte(val); + debugdaemon_proxy_->CallMethod( + &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, + base::BindOnce(&DebugDaemonClientImpl::OnSetKstaledRatio, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); + } + void SetSchedulerConfigurationV2( const std::string& config_name, bool lock_policy, @@ -844,6 +855,25 @@ std::move(callback).Run(result); } + void OnSetKstaledRatio(KstaledRatioCallback callback, + dbus::Response* response) { + if (!response) { + LOG(ERROR) << "Failed to read debugd response"; + std::move(callback).Run(false); + return; + } + + bool result = false; + dbus::MessageReader reader(response); + if (!reader.PopBool(&result)) { + LOG(ERROR) << "Debugd response did not contain a bool"; + std::move(callback).Run(false); + return; + } + + std::move(callback).Run(result); + } + void OnSetSchedulerConfigurationV2( SetSchedulerConfigurationV2Callback callback, dbus::Response* response) {
diff --git a/chromeos/dbus/debug_daemon/debug_daemon_client.h b/chromeos/dbus/debug_daemon/debug_daemon_client.h index 92b3054..e708103 100644 --- a/chromeos/dbus/debug_daemon/debug_daemon_client.h +++ b/chromeos/dbus/debug_daemon/debug_daemon_client.h
@@ -109,6 +109,12 @@ virtual void SetStopAgentTracingTaskRunner( scoped_refptr<base::TaskRunner> task_runner) = 0; + using KstaledRatioCallback = base::OnceCallback<void(bool)>; + + // Sets the kstaled ratio to the provided value, for more information + // see chromeos/memory/README.md. + virtual void SetKstaledRatio(uint8_t val, KstaledRatioCallback) = 0; + // Called once TestICMP() is complete. Takes an optional string. // - The optional string has value if information was obtained successfully. // - The string value contains information about ICMP connectivity to a
diff --git a/chromeos/dbus/debug_daemon/fake_debug_daemon_client.cc b/chromeos/dbus/debug_daemon/fake_debug_daemon_client.cc index 33a4941..fb970e76 100644 --- a/chromeos/dbus/debug_daemon/fake_debug_daemon_client.cc +++ b/chromeos/dbus/debug_daemon/fake_debug_daemon_client.cc
@@ -18,6 +18,7 @@ #include "base/optional.h" #include "base/single_thread_task_runner.h" #include "base/stl_util.h" +#include "base/strings/string_number_conversions.h" #include "base/threading/thread_task_runner_handle.h" #include "chromeos/dbus/constants/dbus_switches.h" @@ -49,6 +50,12 @@ std::move(callback).Run(false); } +void FakeDebugDaemonClient::SetKstaledRatio(uint8_t val, + KstaledRatioCallback callback) { + // We just return true. + std::move(callback).Run(true /* success */); +} + std::string FakeDebugDaemonClient::GetTracingAgentName() { return kCrOSTracingAgentName; }
diff --git a/chromeos/dbus/debug_daemon/fake_debug_daemon_client.h b/chromeos/dbus/debug_daemon/fake_debug_daemon_client.h index e2b7a19..ea1bd95 100644 --- a/chromeos/dbus/debug_daemon/fake_debug_daemon_client.h +++ b/chromeos/dbus/debug_daemon/fake_debug_daemon_client.h
@@ -45,6 +45,7 @@ bool numeric, bool ipv6, DBusMethodCallback<std::vector<std::string>> callback) override; + void SetKstaledRatio(uint8_t val, KstaledRatioCallback callback) override; void GetNetworkStatus(DBusMethodCallback<std::string> callback) override; void GetNetworkInterfaces(DBusMethodCallback<std::string> callback) override; void GetPerfOutput(base::TimeDelta duration,
diff --git a/chromeos/dbus/shill/fake_shill_manager_client.cc b/chromeos/dbus/shill/fake_shill_manager_client.cc index 77c01006..8b87142 100644 --- a/chromeos/dbus/shill/fake_shill_manager_client.cc +++ b/chromeos/dbus/shill/fake_shill_manager_client.cc
@@ -369,8 +369,20 @@ return; } - if (type == shill::kTypeWifi) + if (type == shill::kTypeWifi) { properties.GetString(shill::kSSIDProperty, &name); + + if (name.empty()) { + std::string hex_name; + properties.GetString(shill::kWifiHexSsid, &hex_name); + if (!hex_name.empty()) { + std::vector<uint8_t> bytes; + if (base::HexStringToBytes(hex_name, &bytes)) { + name.assign(reinterpret_cast<const char*>(&bytes[0]), bytes.size()); + } + } + } + } if (name.empty()) properties.GetString(shill::kNameProperty, &name); if (name.empty())
diff --git a/chromeos/memory/OWNERS b/chromeos/memory/OWNERS new file mode 100644 index 0000000..825c6ac --- /dev/null +++ b/chromeos/memory/OWNERS
@@ -0,0 +1,3 @@ +bgeffon@chromium.org +sonnyrao@chromium.org +yuzaho@chromium.org
diff --git a/chromeos/memory/README.md b/chromeos/memory/README.md new file mode 100644 index 0000000..82cf3eb --- /dev/null +++ b/chromeos/memory/README.md
@@ -0,0 +1,4 @@ +kstaled is a replacement for kswapd on ChromeOS. It will result in more +proactive swapping based on a configurable ratio. The default ratio is 4 +and a ratio of 0 will disable the feature. For more information, see +the ChromeOS kernel source include/linux/kstaled.h.
diff --git a/chromeos/memory/kstaled.cc b/chromeos/memory/kstaled.cc new file mode 100644 index 0000000..6b5b92e --- /dev/null +++ b/chromeos/memory/kstaled.cc
@@ -0,0 +1,73 @@ +// Copyright 2019 The Chromium 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 "chromeos/memory/kstaled.h" + +#include "base/bind.h" +#include "base/feature_list.h" +#include "base/files/file_util.h" +#include "base/metrics/field_trial_params.h" +#include "base/strings/string_number_conversions.h" +#include "chromeos/dbus/dbus_thread_manager.h" +#include "chromeos/dbus/debug_daemon/debug_daemon_client.h" + +namespace chromeos { + +namespace { + +constexpr char kKstaledRatioFile[] = "/sys/kernel/mm/kstaled/ratio"; + +// KernelSupportsKstaled will check if the kernel supports kstaled this is as +// easy as checking for the kstaled sysfs node. +bool KernelSupportsKstaled() { + static const bool supported = + base::PathExists(base::FilePath(kKstaledRatioFile)); + return supported; +} + +void OnRatioSet(bool success) { + if (!success) { + LOG(ERROR) << "Unable to configure kstaled"; + return; + } + + VLOG(1) << "Debugd configured kstaled with value: " << kKstaledRatio.Get(); +} + +} // namespace + +const base::Feature kKstaled{"KstaledSwap", base::FEATURE_DISABLED_BY_DEFAULT}; + +const base::FeatureParam<int> kKstaledRatio = {&kKstaled, "KstaledRatio", 4}; + +// InitializeKstaled will attempt to configure kstaled with the experimental +// parameters for this user. +void InitializeKstaled() { + bool feature_enabled = base::FeatureList::IsEnabled(kKstaled); + if (!feature_enabled) { + VLOG(1) << "Kstaled is disabled"; + return; + } + + if (!KernelSupportsKstaled()) { + LOG(ERROR) << "Unable to configure kstaled: no kernel support"; + return; + } + + int feature_ratio = kKstaledRatio.Get(); + if (feature_ratio <= 0 || feature_ratio > 255) { + LOG(ERROR) << "Configuring kstaled with a ratio of 0 disables the " + "feature, the valid range is 1-255."; + return; + } + + chromeos::DebugDaemonClient* debugd_client = + chromeos::DBusThreadManager::Get()->GetDebugDaemonClient(); + DCHECK(debugd_client); + + debugd_client->SetKstaledRatio(static_cast<uint8_t>(feature_ratio), + base::Bind(&OnRatioSet)); +} + +} // namespace chromeos
diff --git a/chromeos/memory/kstaled.h b/chromeos/memory/kstaled.h new file mode 100644 index 0000000..aab75a72 --- /dev/null +++ b/chromeos/memory/kstaled.h
@@ -0,0 +1,26 @@ +// Copyright 2019 The Chromium 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 CHROMEOS_MEMORY_KSTALED_H_ +#define CHROMEOS_MEMORY_KSTALED_H_ + +#include "base/feature_list.h" +#include "base/metrics/field_trial_params.h" +#include "chromeos/chromeos_export.h" + +namespace chromeos { + +// The Kstaled experimental feature. +extern const base::Feature kKstaled; + +// The ratio parameter used for kstaled. +extern const base::FeatureParam<int> kKstaledRatio; + +// InitializeKstaled will attempt to configure kstaled with the experimental +// parameters for this user. +CHROMEOS_EXPORT void InitializeKstaled(); + +} // namespace chromeos + +#endif // CHROMEOS_MEMORY_KSTALED_H_
diff --git a/chromeos/services/assistant/BUILD.gn b/chromeos/services/assistant/BUILD.gn index 7ecc782..675c72d 100644 --- a/chromeos/services/assistant/BUILD.gn +++ b/chromeos/services/assistant/BUILD.gn
@@ -160,9 +160,9 @@ ] sources = [ - "fake_client.cc", - "fake_client.h", "service_unittest.cc", + "test_support/fake_client.cc", + "test_support/fake_client.h", "test_support/fully_initialized_assistant_state.cc", "test_support/fully_initialized_assistant_state.h", ]
diff --git a/chromeos/services/assistant/assistant_manager_service_impl_unittest.cc b/chromeos/services/assistant/assistant_manager_service_impl_unittest.cc index 02060f3..acc7ceb 100644 --- a/chromeos/services/assistant/assistant_manager_service_impl_unittest.cc +++ b/chromeos/services/assistant/assistant_manager_service_impl_unittest.cc
@@ -3,6 +3,9 @@ // found in the LICENSE file. #include "chromeos/services/assistant/assistant_manager_service_impl.h" + +#include <utility> + #include "base/logging.h" #include "base/test/bind_test_util.h" #include "base/test/task_environment.h" @@ -12,10 +15,10 @@ #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/services/assistant/assistant_manager_service.h" #include "chromeos/services/assistant/constants.h" -#include "chromeos/services/assistant/fake_client.h" #include "chromeos/services/assistant/public/mojom/assistant.mojom.h" #include "chromeos/services/assistant/service_context.h" #include "chromeos/services/assistant/test_support/fake_assistant_manager_service_delegate.h" +#include "chromeos/services/assistant/test_support/fake_client.h" #include "chromeos/services/assistant/test_support/fully_initialized_assistant_state.h" #include "chromeos/services/assistant/test_support/mock_media_manager.h" #include "libassistant/shared/internal_api/assistant_manager_internal.h"
diff --git a/chromeos/services/assistant/platform/audio_input_impl_unittest.cc b/chromeos/services/assistant/platform/audio_input_impl_unittest.cc index 479c5f1..ddd9f12 100644 --- a/chromeos/services/assistant/platform/audio_input_impl_unittest.cc +++ b/chromeos/services/assistant/platform/audio_input_impl_unittest.cc
@@ -12,8 +12,8 @@ #include "base/test/task_environment.h" #include "chromeos/audio/cras_audio_handler.h" #include "chromeos/dbus/power/fake_power_manager_client.h" -#include "chromeos/services/assistant/fake_client.h" #include "chromeos/services/assistant/public/features.h" +#include "chromeos/services/assistant/test_support/fake_client.h" #include "services/audio/public/cpp/fake_stream_factory.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromeos/services/assistant/platform/power_manager_provider_impl_unittest.cc b/chromeos/services/assistant/platform/power_manager_provider_impl_unittest.cc index b7eddd4..5e0f2cae 100644 --- a/chromeos/services/assistant/platform/power_manager_provider_impl_unittest.cc +++ b/chromeos/services/assistant/platform/power_manager_provider_impl_unittest.cc
@@ -8,7 +8,7 @@ #include "base/run_loop.h" #include "base/test/task_environment.h" #include "chromeos/dbus/power/fake_power_manager_client.h" -#include "chromeos/services/assistant/fake_client.h" +#include "chromeos/services/assistant/test_support/fake_client.h" #include "services/device/public/cpp/test/test_wake_lock_provider.h" #include "services/device/public/mojom/constants.mojom.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromeos/services/assistant/platform/system_provider_impl_unittest.cc b/chromeos/services/assistant/platform/system_provider_impl_unittest.cc index 0638b40..9b09539c 100644 --- a/chromeos/services/assistant/platform/system_provider_impl_unittest.cc +++ b/chromeos/services/assistant/platform/system_provider_impl_unittest.cc
@@ -9,8 +9,8 @@ #include "base/logging.h" #include "base/test/task_environment.h" -#include "chromeos/services/assistant/fake_client.h" #include "chromeos/services/assistant/platform/power_manager_provider_impl.h" +#include "chromeos/services/assistant/test_support/fake_client.h" #include "mojo/public/cpp/bindings/receiver.h" #include "services/device/public/mojom/battery_monitor.mojom.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromeos/services/assistant/service_unittest.cc b/chromeos/services/assistant/service_unittest.cc index 778e7c3..2d5a4480 100644 --- a/chromeos/services/assistant/service_unittest.cc +++ b/chromeos/services/assistant/service_unittest.cc
@@ -23,9 +23,9 @@ #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/services/assistant/assistant_state_proxy.h" #include "chromeos/services/assistant/fake_assistant_manager_service_impl.h" -#include "chromeos/services/assistant/fake_client.h" #include "chromeos/services/assistant/pref_connection_delegate.h" #include "chromeos/services/assistant/public/cpp/assistant_prefs.h" +#include "chromeos/services/assistant/test_support/fake_client.h" #include "chromeos/services/assistant/test_support/fully_initialized_assistant_state.h" #include "components/prefs/testing_pref_service.h" #include "mojo/public/cpp/bindings/interface_ptr_set.h"
diff --git a/chromeos/services/assistant/fake_client.cc b/chromeos/services/assistant/test_support/fake_client.cc similarity index 83% rename from chromeos/services/assistant/fake_client.cc rename to chromeos/services/assistant/test_support/fake_client.cc index c500fe9..05cde4f5 100644 --- a/chromeos/services/assistant/fake_client.cc +++ b/chromeos/services/assistant/test_support/fake_client.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 "chromeos/services/assistant/fake_client.h" +#include "chromeos/services/assistant/test_support/fake_client.h" namespace chromeos { namespace assistant {
diff --git a/chromeos/services/assistant/fake_client.h b/chromeos/services/assistant/test_support/fake_client.h similarity index 93% rename from chromeos/services/assistant/fake_client.h rename to chromeos/services/assistant/test_support/fake_client.h index 7cb2fe8d..aa7f26b 100644 --- a/chromeos/services/assistant/fake_client.h +++ b/chromeos/services/assistant/test_support/fake_client.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 CHROMEOS_SERVICES_ASSISTANT_FAKE_CLIENT_H_ -#define CHROMEOS_SERVICES_ASSISTANT_FAKE_CLIENT_H_ +#ifndef CHROMEOS_SERVICES_ASSISTANT_TEST_SUPPORT_FAKE_CLIENT_H_ +#define CHROMEOS_SERVICES_ASSISTANT_TEST_SUPPORT_FAKE_CLIENT_H_ #include "base/macros.h" #include "chromeos/services/assistant/public/mojom/assistant.mojom.h" @@ -82,4 +82,4 @@ } // namespace assistant } // namespace chromeos -#endif // CHROMEOS_SERVICES_ASSISTANT_FAKE_CLIENT_H_ +#endif // CHROMEOS_SERVICES_ASSISTANT_TEST_SUPPORT_FAKE_CLIENT_H_
diff --git a/components/components_chromium_strings.grd b/components/components_chromium_strings.grd index 17658371..ec407f5 100644 --- a/components/components_chromium_strings.grd +++ b/components/components_chromium_strings.grd
@@ -224,9 +224,13 @@ <message name="IDS_PAGE_INFO_INTERNAL_PAGE" desc="Message to display in the page info bubble when the page you are on is a chrome:// page or about:something."> You're viewing a secure Chromium page </message> - <message name="IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_VERIFIED" desc="The text of the identity section when the page is secure and uses a valid certificate"> + + <if expr="is_android"> + <!-- Only used in the dialog shown after tapping "Details" in page info --> + <message name="IDS_PAGE_INFO_SECURE_IDENTITY_VERIFIED" desc="The text of the identity section when the page is secure and uses a valid certificate"> Chromium verified that <ph name="ISSUER">$1<ex>VeriSign</ex></ph> issued this website's certificate. </message> + </if> <!-- Session Crash --> <message name="IDS_SESSION_CRASHED_VIEW_MESSAGE" desc="Message shown when the last session didn't exit cleanly.">
diff --git a/components/components_google_chrome_strings.grd b/components/components_google_chrome_strings.grd index a590332..e1b6d53 100644 --- a/components/components_google_chrome_strings.grd +++ b/components/components_google_chrome_strings.grd
@@ -224,9 +224,13 @@ <message name="IDS_PAGE_INFO_INTERNAL_PAGE" desc="Message to display in the page info bubble when the page you are on is a chrome:// page or about:something."> You're viewing a secure Google Chrome page </message> - <message name="IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_VERIFIED" desc="The text of the identity section when the page is secure and uses a valid certificate."> + + <if expr="is_android"> + <!-- Only used in the dialog shown after tapping "Details" in page info --> + <message name="IDS_PAGE_INFO_SECURE_IDENTITY_VERIFIED" desc="The text of the identity section when the page is secure and uses a valid certificate."> Chrome verified that <ph name="ISSUER">$1<ex>VeriSign</ex></ph> issued this website's certificate. </message> + </if> <!-- Session Crash --> <message name="IDS_SESSION_CRASHED_VIEW_MESSAGE" desc="Message shown when the last session didn't exit cleanly.">
diff --git a/components/games/core/BUILD.gn b/components/games/core/BUILD.gn index 5b62bd2..c63bb888 100644 --- a/components/games/core/BUILD.gn +++ b/components/games/core/BUILD.gn
@@ -4,6 +4,8 @@ static_library("core") { sources = [ + "games_features.cc", + "games_features.h", "games_service.h", "games_service_impl.cc", "games_service_impl.h",
diff --git a/components/games/core/games_features.cc b/components/games/core/games_features.cc new file mode 100644 index 0000000..0100cba --- /dev/null +++ b/components/games/core/games_features.cc
@@ -0,0 +1,13 @@ +// Copyright 2019 The Chromium 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/games/core/games_features.h" + +namespace games { +namespace features { + +const base::Feature kGamesHub{"GamesHub", base::FEATURE_DISABLED_BY_DEFAULT}; + +} // namespace features +} // namespace games
diff --git a/components/games/core/games_features.h b/components/games/core/games_features.h new file mode 100644 index 0000000..2fd2bf48 --- /dev/null +++ b/components/games/core/games_features.h
@@ -0,0 +1,18 @@ +// Copyright 2019 The Chromium 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_GAMES_CORE_GAMES_FEATURES_H_ +#define COMPONENTS_GAMES_CORE_GAMES_FEATURES_H_ + +#include "base/feature_list.h" + +namespace games { +namespace features { + +extern const base::Feature kGamesHub; + +} // namespace features +} // namespace games + +#endif // COMPONENTS_GAMES_CORE_GAMES_FEATURES_H_
diff --git a/components/net_log/net_export_file_writer.cc b/components/net_log/net_export_file_writer.cc index 0fce53b..d8036e9 100644 --- a/components/net_log/net_export_file_writer.cc +++ b/components/net_log/net_export_file_writer.cc
@@ -54,24 +54,14 @@ return results; } -// If running on a POSIX OS, this will attempt to set all the permission flags -// of the file at |path| to 1. Will return |path| on success and the empty path -// on failure. -base::FilePath GetPathWithAllPermissions(const base::FilePath& path) { +base::FilePath GetPathIfExists(const base::FilePath& path) { if (!base::PathExists(path)) return base::FilePath(); -#if defined(OS_POSIX) - return base::SetPosixFilePermissions(path, base::FILE_PERMISSION_MASK) - ? path - : base::FilePath(); -#else return path; -#endif } scoped_refptr<base::SequencedTaskRunner> CreateFileTaskRunner() { - // The tasks posted to this sequenced task runner do synchronous File I/O for - // checking paths and setting permissions on files. + // The tasks posted to this sequenced task runner do synchronous File I/O. // // These operations can be skipped on shutdown since FileNetLogObserver's API // doesn't require things to have completed until notified of completion. @@ -287,9 +277,9 @@ DCHECK(file_task_runner_); DCHECK(!log_path_.empty()); - base::PostTaskAndReplyWithResult( - file_task_runner_.get(), FROM_HERE, - base::Bind(&GetPathWithAllPermissions, log_path_), path_callback); + base::PostTaskAndReplyWithResult(file_task_runner_.get(), FROM_HERE, + base::Bind(&GetPathIfExists, log_path_), + path_callback); } std::string NetExportFileWriter::CaptureModeToString(
diff --git a/components/net_log/net_export_file_writer.h b/components/net_log/net_export_file_writer.h index 90153f21..cd7d0dd 100644 --- a/components/net_log/net_export_file_writer.h +++ b/components/net_log/net_export_file_writer.h
@@ -133,7 +133,6 @@ // (1) The NetExportFileWriter is not initialized. // (2) The log file does not exist. // (3) The NetExportFileWriter is currently logging. - // (4) The log file's permissions could not be set to all. // // |path_callback| will be executed at the end of GetFilePathToCompletedLog() // asynchronously.
diff --git a/components/net_log/net_export_file_writer_unittest.cc b/components/net_log/net_export_file_writer_unittest.cc index 35764ae..38a9d73 100644 --- a/components/net_log/net_export_file_writer_unittest.cc +++ b/components/net_log/net_export_file_writer_unittest.cc
@@ -173,6 +173,37 @@ return ::testing::AssertionFailure() << log_path.value() << " does not exist."; } + + // Check file permissions. These tests are only done on POSIX for simplicity, + // since base has better support for the POSIX permission model. +#if defined(OS_POSIX) + int actual_permissions = 0; + if (!base::GetPosixFilePermissions(log_path, &actual_permissions)) { + return ::testing::AssertionFailure() + << "Failed getting file permissions for " << log_path.value(); + } + + // Creating the file will have requested permission 600 (or 644 on Chrome + // OS). This cannot be asserted directly since the shell's umask may further + // restrict the final permissions. For instance if your umask is 0027 and you + // try running the Chrome OS tests on Linux, the final permissions will be + // 640 rather than 644. + int expected_permissions = base::FILE_PERMISSION_READ_BY_USER | + base::FILE_PERMISSION_WRITE_BY_USER +#if defined(OS_CHROMEOS) + | base::FILE_PERMISSION_READ_BY_GROUP | + base::FILE_PERMISSION_READ_BY_OTHERS +#endif + ; + + if ((actual_permissions & expected_permissions) != actual_permissions) { + return ::testing::AssertionFailure() + << "Unexpected permissions: " + << base::StringPrintf("%o", actual_permissions) << " vs " + << base::StringPrintf("%o", expected_permissions); + } +#endif // defined(OS_POSIX) + // Parse log file contents into a dictionary std::string log_string; if (!base::ReadFileToString(log_path, &log_string)) {
diff --git a/components/omnibox/browser/autocomplete_result.cc b/components/omnibox/browser/autocomplete_result.cc index 4b50413..b797e5f 100644 --- a/components/omnibox/browser/autocomplete_result.cc +++ b/components/omnibox/browser/autocomplete_result.cc
@@ -28,6 +28,7 @@ #include "components/omnibox/browser/omnibox_pedal.h" #include "components/omnibox/browser/omnibox_pedal_provider.h" #include "components/omnibox/common/omnibox_features.h" +#include "components/search_engines/template_url_service.h" #include "components/strings/grit/components_strings.h" #include "components/url_formatter/url_fixer.h" #include "third_party/metrics_proto/omnibox_event.pb.h" @@ -296,14 +297,23 @@ : base::string16()) + base::ASCIIToUTF16(", input=") + input.text(); - // We should only get here with an empty omnibox for automatic suggestions - // on focus on the NTP; in these cases hitting enter should do nothing, so - // there should be no default match. Otherwise, we're doing automatic - // suggestions for the currently visible URL (and hitting enter should - // reload it), or the user is typing; in either of these cases, there should - // be a default match. - DCHECK_NE(input.text().empty(), default_match_->allowed_to_be_default_match) - << debug_info; + // It's unusual if |default_match_| is not |allowed_to_be_default_match|. + // This can occur in two situations: + // - Empty-textfield on-focus suggestions (i.e. NTP, ChromeOS launcher) + // - Enterprise policy prohibiting a default search provider + // + // In those cases, hitting Enter should do nothing, so there should be + // legitimately no default match. + // + // TODO(tommycli): It seems odd that we are still setting |default_match_| + // in that case. We should fix that. + if (!default_match_->allowed_to_be_default_match) { + bool default_search_provider_exists = + template_url_service && + template_url_service->GetDefaultSearchProvider(); + DCHECK(input.text().empty() || !default_search_provider_exists) + << debug_info; + } // For navigable default matches, make sure the destination type is what the // user would expect given the input. @@ -768,6 +778,10 @@ matches->begin(), matches->end(), [&](const AutocompleteMatch& match) { return match.allowed_to_be_default_match && !is_tail(match); }); + bool tail_default_exists = std::any_of( + matches->begin(), matches->end(), [&](const AutocompleteMatch& match) { + return match.allowed_to_be_default_match && is_tail(match); + }); // If the only default matches are tail suggestions, let them remain and // instead remove the non-tail suggestions. This is necessary because we do // not want to display tail suggestions mixed with other suggestions in the @@ -776,7 +790,7 @@ // default match--the non-tail ones much go. This situation though is // unlikely, as we normally would expect the search-what-you-typed suggestion // as a default match (and that's a non-tail suggestion). - if (non_tail_default == matches->end()) { + if (tail_default_exists && non_tail_default == matches->end()) { base::EraseIf(*matches, [&is_tail](const AutocompleteMatch& match) { return !is_tail(match); });
diff --git a/components/omnibox/browser/autocomplete_result_unittest.cc b/components/omnibox/browser/autocomplete_result_unittest.cc index cafbaa4..7c911fa 100644 --- a/components/omnibox/browser/autocomplete_result_unittest.cc +++ b/components/omnibox/browser/autocomplete_result_unittest.cc
@@ -552,6 +552,32 @@ result.match_at(i)->type); } +TEST_F(AutocompleteResultTest, SortAndCullNoMatchesAllowedToBeDefault) { + // clang-format off + TestData data[] = { + {1, 1, 500, false}, // Not allowed_to_be_default_match + {2, 1, 1100, false}, // Not allowed_to_be_default_match + {3, 1, 1000, false}, // Not allowed_to_be_default_match + }; + // clang-format on + + ACMatches matches; + PopulateAutocompleteMatches(data, base::size(data), &matches); + + AutocompleteInput input(base::string16(), metrics::OmniboxEventProto::OTHER, + TestSchemeClassifier()); + AutocompleteResult result; + result.AppendMatches(input, matches); + result.SortAndCull(input, template_url_service_.get()); + + EXPECT_EQ(3UL, result.size()); + EXPECT_EQ(matches[1].destination_url, result.match_at(0)->destination_url); + EXPECT_EQ(matches[2].destination_url, result.match_at(1)->destination_url); + EXPECT_EQ(matches[0].destination_url, result.match_at(2)->destination_url); + for (size_t i = 0; i < 3; ++i) + EXPECT_FALSE(result.match_at(i)->allowed_to_be_default_match); +} + TEST_F(AutocompleteResultTest, SortAndCullDuplicateSearchURLs) { // Register a template URL that corresponds to 'foo' search engine. TemplateURLData url_data;
diff --git a/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc b/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc index efe1f5b..1f75166 100644 --- a/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc +++ b/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc
@@ -140,6 +140,9 @@ WebFeature::kGetGamepadsFromCrossOriginSubframe, WebFeature::kGetGamepadsFromInsecureContext, WebFeature::kGetGamepads, + WebFeature::kMovedOrResizedPopup, + WebFeature::kMovedOrResizedPopup2sAfterCreation, + WebFeature::kDOMWindowOpenPositioningFeatures, })); return *opt_in_features; }
diff --git a/components/payments/content/android/java/src/org/chromium/components/payments/PaymentDetailsConverter.java b/components/payments/content/android/java/src/org/chromium/components/payments/PaymentDetailsConverter.java index 6c6f9e6..e83932b8 100644 --- a/components/payments/content/android/java/src/org/chromium/components/payments/PaymentDetailsConverter.java +++ b/components/payments/content/android/java/src/org/chromium/components/payments/PaymentDetailsConverter.java
@@ -7,7 +7,7 @@ import org.chromium.payments.mojom.PaymentDetails; import org.chromium.payments.mojom.PaymentHandlerMethodData; import org.chromium.payments.mojom.PaymentHandlerModifier; -import org.chromium.payments.mojom.PaymentMethodChangeResponse; +import org.chromium.payments.mojom.PaymentRequestDetailsUpdate; import org.chromium.payments.mojom.PaymentShippingOption; import java.util.ArrayList; @@ -47,13 +47,13 @@ * valid for the given payment method identifier. Should not be null. * @return The data structure that can be sent to the invoked payment handler. */ - public static PaymentMethodChangeResponse convertToPaymentMethodChangeResponse( + public static PaymentRequestDetailsUpdate convertToPaymentRequestDetailsUpdate( PaymentDetails details, boolean handlesShipping, MethodChecker methodChecker) { // Keep in sync with components/payments/content/payment_details_converter.cc. assert details != null; assert methodChecker != null; - PaymentMethodChangeResponse response = new PaymentMethodChangeResponse(); + PaymentRequestDetailsUpdate response = new PaymentRequestDetailsUpdate(); response.error = details.error; response.stringifiedPaymentMethodErrors = details.stringifiedPaymentMethodErrors; if (handlesShipping) response.shippingAddressErrors = details.shippingAddressErrors;
diff --git a/components/payments/content/android/java/src/org/chromium/components/payments/PaymentHandlerHost.java b/components/payments/content/android/java/src/org/chromium/components/payments/PaymentHandlerHost.java index da9478cc..65b79d64 100644 --- a/components/payments/content/android/java/src/org/chromium/components/payments/PaymentHandlerHost.java +++ b/components/payments/content/android/java/src/org/chromium/components/payments/PaymentHandlerHost.java
@@ -8,7 +8,7 @@ import org.chromium.base.annotations.JNINamespace; import org.chromium.base.annotations.NativeMethods; import org.chromium.content_public.browser.WebContents; -import org.chromium.payments.mojom.PaymentMethodChangeResponse; +import org.chromium.payments.mojom.PaymentRequestDetailsUpdate; import java.nio.ByteBuffer; @@ -69,10 +69,10 @@ /** * Notifies the payment handler that the merchant has updated the payment details in response to - * the payment-method-change event. - * @param response The payment method change response. Should not be null. + * the payment-method-change event or shipping-[address|option]-change events. + * @param response The payment request details update response. Should not be null. */ - public void updateWith(PaymentMethodChangeResponse response) { + public void updateWith(PaymentRequestDetailsUpdate response) { assert response != null; PaymentHandlerHostJni.get().updateWith(mNativePointer, response.serialize()); }
diff --git a/components/payments/content/android/payment_handler_host.cc b/components/payments/content/android/payment_handler_host.cc index 0bedd52..c791f7d 100644 --- a/components/payments/content/android/payment_handler_host.cc +++ b/components/payments/content/android/payment_handler_host.cc
@@ -48,8 +48,8 @@ void PaymentHandlerHost::UpdateWith( JNIEnv* env, const base::android::JavaParamRef<jobject>& response_buffer) { - mojom::PaymentMethodChangeResponsePtr response; - bool success = mojom::PaymentMethodChangeResponse::Deserialize( + mojom::PaymentRequestDetailsUpdatePtr response; + bool success = mojom::PaymentRequestDetailsUpdate::Deserialize( std::move(JavaByteBufferToNativeByteVector(env, response_buffer)), &response); DCHECK(success);
diff --git a/components/payments/content/android/payment_handler_host.h b/components/payments/content/android/payment_handler_host.h index 2ad6a67..8931baaf9 100644 --- a/components/payments/content/android/payment_handler_host.h +++ b/components/payments/content/android/payment_handler_host.h
@@ -54,7 +54,7 @@ // Notifies the payment handler that the merchant has updated the payment // details. The |response_buffer| should be a serialization of a valid - // PaymentMethodChangeResponse.java object. + // PaymentRequestDetailsUpdate.java object. void UpdateWith(JNIEnv* env, const base::android::JavaParamRef<jobject>& response_buffer);
diff --git a/components/payments/content/payment_details_converter.cc b/components/payments/content/payment_details_converter.cc index b1de5f8..758e1c6 100644 --- a/components/payments/content/payment_details_converter.cc +++ b/components/payments/content/payment_details_converter.cc
@@ -13,14 +13,14 @@ // Keep in sync with PaymentDetailsConverter.java. -mojom::PaymentMethodChangeResponsePtr -PaymentDetailsConverter::ConvertToPaymentMethodChangeResponse( +mojom::PaymentRequestDetailsUpdatePtr +PaymentDetailsConverter::ConvertToPaymentRequestDetailsUpdate( const mojom::PaymentDetailsPtr& details, bool handles_shipping, const MethodChecker& method_checker) { DCHECK(details); - auto response = mojom::PaymentMethodChangeResponse::New(); + auto response = mojom::PaymentRequestDetailsUpdate::New(); response->error = details->error; response->stringified_payment_method_errors = details->stringified_payment_method_errors;
diff --git a/components/payments/content/payment_details_converter.h b/components/payments/content/payment_details_converter.h index 62fa241..f159c1bb 100644 --- a/components/payments/content/payment_details_converter.h +++ b/components/payments/content/payment_details_converter.h
@@ -27,8 +27,8 @@ // Shipping related information is redacted when |handles_shipping| is false. // The |method_checker| is not saved. It is used only for the duration of this // call. - static mojom::PaymentMethodChangeResponsePtr - ConvertToPaymentMethodChangeResponse(const mojom::PaymentDetailsPtr& details, + static mojom::PaymentRequestDetailsUpdatePtr + ConvertToPaymentRequestDetailsUpdate(const mojom::PaymentDetailsPtr& details, bool handles_shipping, const MethodChecker& method_checker);
diff --git a/components/payments/content/payment_handler_host.cc b/components/payments/content/payment_handler_host.cc index 7fdadbb7..a697fad 100644 --- a/components/payments/content/payment_handler_host.cc +++ b/components/payments/content/payment_handler_host.cc
@@ -42,8 +42,8 @@ // callback. void RunCallbackWithError(const std::string& error, ChangePaymentRequestDetailsCallback callback) { - mojom::PaymentMethodChangeResponsePtr response = - mojom::PaymentMethodChangeResponse::New(); + mojom::PaymentRequestDetailsUpdatePtr response = + mojom::PaymentRequestDetailsUpdate::New(); response->error = error; std::move(callback).Run(std::move(response)); } @@ -72,7 +72,7 @@ } void PaymentHandlerHost::UpdateWith( - mojom::PaymentMethodChangeResponsePtr response) { + mojom::PaymentRequestDetailsUpdatePtr response) { if (!change_payment_request_details_callback_) return; @@ -161,7 +161,7 @@ return; std::move(change_payment_request_details_callback_) - .Run(mojom::PaymentMethodChangeResponse::New()); + .Run(mojom::PaymentRequestDetailsUpdate::New()); } void PaymentHandlerHost::Disconnect() {
diff --git a/components/payments/content/payment_handler_host.h b/components/payments/content/payment_handler_host.h index 0ce84ee..def9d432 100644 --- a/components/payments/content/payment_handler_host.h +++ b/components/payments/content/payment_handler_host.h
@@ -23,7 +23,7 @@ namespace payments { using ChangePaymentRequestDetailsCallback = - base::OnceCallback<void(mojom::PaymentMethodChangeResponsePtr)>; + base::OnceCallback<void(mojom::PaymentRequestDetailsUpdatePtr)>; // Handles the communication from the payment handler renderer process to the // merchant renderer process. @@ -90,7 +90,7 @@ // Notifies the payment handler of the updated details, such as updated total, // in response to the change of any of the following: payment method, shipping // address, or shipping option. - void UpdateWith(mojom::PaymentMethodChangeResponsePtr response); + void UpdateWith(mojom::PaymentRequestDetailsUpdatePtr response); // Notifies the payment handler that the merchant did not handle the payment // method, shipping option, or shipping address change events, so the payment
diff --git a/components/payments/content/payment_request.cc b/components/payments/content/payment_request.cc index 92ca939..85b9c542 100644 --- a/components/payments/content/payment_request.cc +++ b/components/payments/content/payment_request.cc
@@ -344,7 +344,7 @@ if (state()->selected_instrument() && state()->IsPaymentAppInvoked() && payment_handler_host_.is_changing()) { payment_handler_host_.UpdateWith( - PaymentDetailsConverter::ConvertToPaymentMethodChangeResponse( + PaymentDetailsConverter::ConvertToPaymentRequestDetailsUpdate( details, state()->selected_instrument()->HandlesShippingAddress(), base::BindRepeating( &PaymentInstrument::IsValidForPaymentMethodIdentifier,
diff --git a/components/subresource_filter/core/common/perftests/data/.gitattributes b/components/subresource_filter/core/common/perftests/data/.gitattributes new file mode 100644 index 0000000..5695909 --- /dev/null +++ b/components/subresource_filter/core/common/perftests/data/.gitattributes
@@ -0,0 +1 @@ +UnindexedRules* binary
diff --git a/components/url_formatter/spoof_checks/idn_spoof_checker.cc b/components/url_formatter/spoof_checks/idn_spoof_checker.cc index 25f9539..a7f7543e 100644 --- a/components/url_formatter/spoof_checks/idn_spoof_checker.cc +++ b/components/url_formatter/spoof_checks/idn_spoof_checker.cc
@@ -170,6 +170,14 @@ status); lgc_letters_n_ascii_.freeze(); + // Latin small letter thorn ("þ", U+00FE) can be used to spoof both b and p. + // It's used in modern Icelandic orthography, so allow it for the Icelandic + // ccTLD (.is) but block in any other TLD. Also block Latin small letter eth + // ("ð", U+00F0) which can be used to spoof the letter o. + icelandic_characters_ = + icu::UnicodeSet(UNICODE_STRING_SIMPLE("[\\u00fe\\u00f0]"), status); + icelandic_characters_.freeze(); + // Used for diacritics-removal before the skeleton calculation. Add // "Å‚ > l; ø > o; Ä‘ > d" that are not handled by "NFD; Nonspacing mark // removal; NFC". @@ -284,13 +292,10 @@ if (deviation_characters_.containsSome(label_string)) return false; - // Latin small letter thorn (U+00FE) can be used to spoof both b and p. It's - // used in modern Icelandic orthography, so allow it for the Icelandic ccTLD - // (.is) but block in any other TLD. - if (label_string.length() > 1 && label_string.indexOf("þ") != -1 && - top_level_domain != ".is") { + // Disallow Icelandic confusables for domains outside Iceland's ccTLD (.is). + if (label_string.length() > 1 && top_level_domain != ".is" && + icelandic_characters_.containsSome(label_string)) return false; - } // If there's no script mixing, the input is regarded as safe without any // extra check unless it falls into one of three categories:
diff --git a/components/url_formatter/spoof_checks/idn_spoof_checker.h b/components/url_formatter/spoof_checks/idn_spoof_checker.h index d91ea2f..d4f5bd9 100644 --- a/components/url_formatter/spoof_checks/idn_spoof_checker.h +++ b/components/url_formatter/spoof_checks/idn_spoof_checker.h
@@ -102,6 +102,7 @@ icu::UnicodeSet cyrillic_letters_; icu::UnicodeSet cyrillic_letters_latin_alike_; icu::UnicodeSet lgc_letters_n_ascii_; + icu::UnicodeSet icelandic_characters_; std::unique_ptr<icu::Transliterator> diacritic_remover_; std::unique_ptr<icu::Transliterator> extra_confusable_mapper_;
diff --git a/components/url_formatter/spoof_checks/idn_spoof_checker_unittest.cc b/components/url_formatter/spoof_checks/idn_spoof_checker_unittest.cc index f266325b..146d48e 100644 --- a/components/url_formatter/spoof_checks/idn_spoof_checker_unittest.cc +++ b/components/url_formatter/spoof_checks/idn_spoof_checker_unittest.cc
@@ -1091,6 +1091,11 @@ // U+05D7 can look like Latin n in many fonts. {"xn--ceba.com", L"×—×—.com", false}, + // U+00FE (þ) and U+00F0 (ð) are only allowed under the .is TLD. + {"xn--acdef-wva.com", L"aþcdef.com", false}, + {"xn--mnpqr-jta.com", L"mnðpqr.com", false}, + {"xn--acdef-wva.is", L"aþcdef.is", true}, + {"xn--mnpqr-jta.is", L"mnðpqr.is", true}, }; // namespace namespace test {
diff --git a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc index c914400..b10a18e 100644 --- a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc +++ b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc
@@ -89,16 +89,12 @@ class CopyOutputResultYUV : public CopyOutputResult { public: CopyOutputResultYUV(const gfx::Rect& rect, - const void* data[3], - size_t row_bytes[3]) - : CopyOutputResult(Format::I420_PLANES, rect) { + std::unique_ptr<const SkSurface::AsyncReadResult> result) + : CopyOutputResult(Format::I420_PLANES, rect), + result_(std::move(result)) { + DCHECK_EQ(3, result_->count()); DCHECK_EQ(0, size().width() % 2); DCHECK_EQ(0, size().height() % 2); - for (int i = 0; i < 3; ++i) { - data_[i] = std::make_unique<uint8_t[]>(row_bytes[i] * height(i)); - memcpy(data_[i].get(), data[i], row_bytes[i] * height(i)); - row_bytes_[i] = row_bytes[i]; - } } // CopyOutputResult implementation. @@ -114,11 +110,14 @@ memcpy(out, src, width); } }; - CopyPlane(data_[0].get(), row_bytes_[0], width(0), height(0), y_out, + auto* data0 = static_cast<const uint8_t*>(result_->data(0)); + auto* data1 = static_cast<const uint8_t*>(result_->data(1)); + auto* data2 = static_cast<const uint8_t*>(result_->data(2)); + CopyPlane(data0, result_->rowBytes(0), width(0), height(0), y_out, y_out_stride); - CopyPlane(data_[1].get(), row_bytes_[1], width(1), height(1), u_out, + CopyPlane(data1, result_->rowBytes(1), width(1), height(1), u_out, u_out_stride); - CopyPlane(data_[2].get(), row_bytes_[2], width(2), height(2), v_out, + CopyPlane(data2, result_->rowBytes(2), width(2), height(2), v_out, v_out_stride); return true; } @@ -138,20 +137,21 @@ return size().height() / 2; } - std::unique_ptr<uint8_t[]> data_[3]; - size_t row_bytes_[3]; + std::unique_ptr<const SkSurface::AsyncReadResult> result_; }; -void OnYUVReadbackDone(void* c, const void* data[3], size_t row_bytes[3]) { +void OnYUVReadbackDone( + void* c, + std::unique_ptr<const SkSurface::AsyncReadResult> async_result) { std::unique_ptr<ReadPixelsContext> context( static_cast<ReadPixelsContext*>(c)); - if (!data) { + if (!async_result) { // This will automatically send an empty result. return; } std::unique_ptr<CopyOutputResult> result = - std::make_unique<CopyOutputResultYUV>(context->result_rect, data, - row_bytes); + std::make_unique<CopyOutputResultYUV>(context->result_rect, + std::move(async_result)); context->request->SendResult(std::move(result)); } @@ -1080,7 +1080,7 @@ geometry.result_bounds); surface->asyncRescaleAndReadPixelsYUV420( kRec709_SkYUVColorSpace, SkColorSpace::MakeSRGB(), srcRect, - geometry.result_bounds.width(), geometry.result_bounds.height(), + {geometry.result_bounds.width(), geometry.result_bounds.height()}, SkSurface::RescaleGamma::kSrc, filter_quality, OnYUVReadbackDone, context.release()); return;
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index c87da31d..96617739 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -191,6 +191,7 @@ "//skia/public/mojom", "//sql", "//storage/browser", + "//storage/browser:mojom", "//storage/common", "//third_party/angle:angle_common", "//third_party/blink/public:blink_headers", @@ -516,6 +517,8 @@ "blob_storage/blob_internals_url_loader.h", "blob_storage/blob_registry_wrapper.cc", "blob_storage/blob_registry_wrapper.h", + "blob_storage/blob_storage_context_wrapper.cc", + "blob_storage/blob_storage_context_wrapper.h", "blob_storage/chrome_blob_storage_context.cc", "blob_storage/chrome_blob_storage_context.h", "bluetooth/bluetooth_allowed_devices.cc",
diff --git a/content/browser/accessibility/browser_accessibility_android.cc b/content/browser/accessibility/browser_accessibility_android.cc index d85a4dba..e30da2c 100644 --- a/content/browser/accessibility/browser_accessibility_android.cc +++ b/content/browser/accessibility/browser_accessibility_android.cc
@@ -231,6 +231,9 @@ return true; } + if (IsHeadingLink()) + return true; + if (!IsEnabled()) { // TalkBack won't announce a control as disabled unless it's also marked // as clickable. In other words, Talkback wants to know if the control @@ -414,6 +417,15 @@ !base::ContainsOnlyChars(GetInnerText(), base::kWhitespaceUTF16); } +bool BrowserAccessibilityAndroid::IsHeadingLink() const { + if (!(GetRole() == ax::mojom::Role::kHeading && InternalChildCount() == 1)) + return false; + + BrowserAccessibilityAndroid* child = + static_cast<BrowserAccessibilityAndroid*>(InternalChildrenBegin().get()); + return child->IsLink(); +} + const BrowserAccessibilityAndroid* BrowserAccessibilityAndroid::GetSoleInterestingNodeFromSubtree() const { if (IsInterestingOnAndroid()) @@ -556,16 +568,37 @@ content::ContentClient* content_client = content::GetContentClient(); // As a special case, if we have a heading level return a string like - // "heading level 1", etc. + // "heading level 1", etc. - and if the heading consists of a link, + // append the word link as well. if (GetRole() == ax::mojom::Role::kHeading) { + base::string16 role_description; int level = GetIntAttribute(ax::mojom::IntAttribute::kHierarchicalLevel); if (level >= 1 && level <= 6) { std::vector<base::string16> values; values.push_back(base::NumberToString16(level)); - return base::ReplaceStringPlaceholders( + role_description = base::ReplaceStringPlaceholders( content_client->GetLocalizedString(IDS_AX_ROLE_HEADING_WITH_LEVEL), values, nullptr); + } else { + role_description = + content_client->GetLocalizedString(IDS_AX_ROLE_HEADING); } + + if (IsHeadingLink()) { + role_description += base::ASCIIToUTF16(" ") + + content_client->GetLocalizedString(IDS_AX_ROLE_LINK); + } + + return role_description; + } + + // If this node is a link and the parent is a heading, return the role + // description of the parent (e.g. "heading 1 link"). + if (ui::IsLink(GetRole()) && PlatformGetParent()) { + BrowserAccessibilityAndroid* parent = + static_cast<BrowserAccessibilityAndroid*>(PlatformGetParent()); + if (parent->IsHeadingLink()) + return parent->GetRoleDescription(); } int message_id = -1;
diff --git a/content/browser/accessibility/browser_accessibility_android.h b/content/browser/accessibility/browser_accessibility_android.h index 0ba2681..a7936305 100644 --- a/content/browser/accessibility/browser_accessibility_android.h +++ b/content/browser/accessibility/browser_accessibility_android.h
@@ -60,6 +60,9 @@ // focusable or clickable aren't interesting. bool IsInterestingOnAndroid() const; + // Is a heading whose only child is a link. + bool IsHeadingLink() const; + // If this node is interesting (IsInterestingOnAndroid() returns true), // returns |this|. If not, it recursively checks all of the // platform children of this node, and if just a single one is
diff --git a/content/browser/accessibility/web_contents_accessibility_android.cc b/content/browser/accessibility/web_contents_accessibility_android.cc index adbbfd64..9577a05 100644 --- a/content/browser/accessibility/web_contents_accessibility_android.cc +++ b/content/browser/accessibility/web_contents_accessibility_android.cc
@@ -845,6 +845,13 @@ const JavaParamRef<jobject>& obj, jint unique_id) { BrowserAccessibilityAndroid* node = GetAXFromUniqueID(unique_id); + + // If it's a heading consisting of only a link, click the link. + if (node->IsHeadingLink()) { + node = static_cast<BrowserAccessibilityAndroid*>( + node->InternalChildrenBegin().get()); + } + if (node) node->manager()->DoDefaultAction(*node); }
diff --git a/content/browser/background_fetch/background_fetch_test_data_manager.cc b/content/browser/background_fetch/background_fetch_test_data_manager.cc index 2939ff48..ea27fdf 100644 --- a/content/browser/background_fetch/background_fetch_test_data_manager.cc +++ b/content/browser/background_fetch/background_fetch_test_data_manager.cc
@@ -76,8 +76,9 @@ base::MakeRefCounted<CacheStorageContextImpl::ObserverList>()); DCHECK(cache_manager_); - cache_manager_->SetBlobParametersForCache( - blob_storage_context_->context()->AsWeakPtr()); + auto context = base::MakeRefCounted<BlobStorageContextWrapper>( + blob_storage_context_->MojoContext()); + cache_manager_->SetBlobParametersForCache(std::move(context)); } BackgroundFetchTestDataManager::~BackgroundFetchTestDataManager() = default;
diff --git a/content/browser/background_fetch/storage/cache_entry_handler_impl.cc b/content/browser/background_fetch/storage/cache_entry_handler_impl.cc index d9c3b5d..86cb803 100644 --- a/content/browser/background_fetch/storage/cache_entry_handler_impl.cc +++ b/content/browser/background_fetch/storage/cache_entry_handler_impl.cc
@@ -12,8 +12,8 @@ namespace background_fetch { CacheEntryHandlerImpl::CacheEntryHandlerImpl( - base::WeakPtr<storage::BlobStorageContext> blob_context) - : CacheStorageCacheEntryHandler(std::move(blob_context)) {} + scoped_refptr<BlobStorageContextWrapper> blob_storage_context) + : CacheStorageCacheEntryHandler(std::move(blob_storage_context)) {} CacheEntryHandlerImpl::~CacheEntryHandlerImpl() = default;
diff --git a/content/browser/background_fetch/storage/cache_entry_handler_impl.h b/content/browser/background_fetch/storage/cache_entry_handler_impl.h index d6326fe4..3431fdac 100644 --- a/content/browser/background_fetch/storage/cache_entry_handler_impl.h +++ b/content/browser/background_fetch/storage/cache_entry_handler_impl.h
@@ -15,8 +15,7 @@ class CacheEntryHandlerImpl : public CacheStorageCacheEntryHandler { public: explicit CacheEntryHandlerImpl( - base::WeakPtr<storage::BlobStorageContext> blob_context); - + scoped_refptr<BlobStorageContextWrapper> blob_storage_context); ~CacheEntryHandlerImpl() override; // CacheStorageCacheEntryHandler implementation:
diff --git a/content/browser/blob_storage/blob_storage_context_wrapper.cc b/content/browser/blob_storage/blob_storage_context_wrapper.cc new file mode 100644 index 0000000..98a2e95 --- /dev/null +++ b/content/browser/blob_storage/blob_storage_context_wrapper.cc
@@ -0,0 +1,28 @@ +// Copyright 2019 The Chromium 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/blob_storage/blob_storage_context_wrapper.h" + +#include "base/task/post_task.h" +#include "content/public/browser/browser_task_traits.h" + +namespace content { + +BlobStorageContextWrapper::BlobStorageContextWrapper( + mojo::PendingRemote<storage::mojom::BlobStorageContext> context) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + context_.Bind(std::move(context)); +} + +mojo::Remote<storage::mojom::BlobStorageContext>& +BlobStorageContextWrapper::context() { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + return context_; +} + +BlobStorageContextWrapper::~BlobStorageContextWrapper() { + DCHECK_CURRENTLY_ON(BrowserThread::IO); +} + +} // namespace content
diff --git a/content/browser/blob_storage/blob_storage_context_wrapper.h b/content/browser/blob_storage/blob_storage_context_wrapper.h new file mode 100644 index 0000000..8ab0bb15b --- /dev/null +++ b/content/browser/blob_storage/blob_storage_context_wrapper.h
@@ -0,0 +1,55 @@ +// Copyright 2019 The Chromium 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_BLOB_STORAGE_BLOB_STORAGE_CONTEXT_WRAPPER_H_ +#define CONTENT_BROWSER_BLOB_STORAGE_BLOB_STORAGE_CONTEXT_WRAPPER_H_ + +#include <string> + +#include "base/macros.h" +#include "content/common/content_export.h" +#include "content/public/browser/browser_thread.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/remote.h" +#include "storage/browser/blob/mojom/blob_storage_context.mojom.h" + +namespace content { + +// An IO-thread bound wrapper for the BlobStorageContext remote. +// This gets passed through many layers of classes on different sequences +// and so it's easier to have the remote bound on the correct sequence +// and share that remote than it is to bind and clone repeatedly. +// This is also more efficient than SharedRemote as we know that everything +// will use this remote from the IO thread. +// +// TODO(enne): once cache storage and idb have been converted to talk to the +// blob system over mojo, there should be no more need for the IO thread hops +// and everything could be run on the same sequence, eliminating the need +// for this class. +class CONTENT_EXPORT BlobStorageContextWrapper + : public base::RefCountedThreadSafe<BlobStorageContextWrapper, + BrowserThread::DeleteOnIOThread> { + public: + // Must be called from the IO thread. + BlobStorageContextWrapper( + mojo::PendingRemote<storage::mojom::BlobStorageContext> context); + + // Must be called from the IO thread. + mojo::Remote<storage::mojom::BlobStorageContext>& context(); + + private: + friend class base::RefCountedThreadSafe<BlobStorageContextWrapper>; + friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; + friend class base::DeleteHelper<BlobStorageContextWrapper>; + + // Must be destroyed on the IO thread, but RefCountedThreadSafe takes + // care of that automatically. + ~BlobStorageContextWrapper(); + + mojo::Remote<storage::mojom::BlobStorageContext> context_; +}; + +} // namespace content + +#endif // CONTENT_BROWSER_BLOB_STORAGE_BLOB_STORAGE_CONTEXT_WRAPPER_H_
diff --git a/content/browser/blob_storage/chrome_blob_storage_context.cc b/content/browser/blob_storage/chrome_blob_storage_context.cc index 1ac96814..4603747 100644 --- a/content/browser/blob_storage/chrome_blob_storage_context.cc +++ b/content/browser/blob_storage/chrome_blob_storage_context.cc
@@ -160,6 +160,14 @@ return context_.get(); } +mojo::PendingRemote<storage::mojom::BlobStorageContext> +ChromeBlobStorageContext::MojoContext() const { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + mojo::PendingRemote<storage::mojom::BlobStorageContext> remote; + context_->Bind(remote.InitWithNewPipeAndPassReceiver()); + return remote; +} + std::unique_ptr<BlobHandle> ChromeBlobStorageContext::CreateMemoryBackedBlob( const char* data, size_t length,
diff --git a/content/browser/blob_storage/chrome_blob_storage_context.h b/content/browser/blob_storage/chrome_blob_storage_context.h index 93a3ce4..de23e26 100644 --- a/content/browser/blob_storage/chrome_blob_storage_context.h +++ b/content/browser/blob_storage/chrome_blob_storage_context.h
@@ -27,6 +27,9 @@ namespace storage { class BlobStorageContext; +namespace mojom { +class BlobStorageContext; +} } namespace content { @@ -55,6 +58,10 @@ storage::BlobStorageContext* context() const; + // Return a BlobStorageContext mojo interface to be used by storage apis. + // This interface should not be exposed to renderers. + mojo::PendingRemote<storage::mojom::BlobStorageContext> MojoContext() const; + // Returns a NULL scoped_ptr on failure. std::unique_ptr<BlobHandle> CreateMemoryBackedBlob( const char* data,
diff --git a/content/browser/cache_storage/cache_storage_cache_entry_handler.cc b/content/browser/cache_storage/cache_storage_cache_entry_handler.cc index 6c332f6..35beac4 100644 --- a/content/browser/cache_storage/cache_storage_cache_entry_handler.cc +++ b/content/browser/cache_storage/cache_storage_cache_entry_handler.cc
@@ -9,88 +9,172 @@ #include "base/task/post_task.h" #include "content/browser/background_fetch/storage/cache_entry_handler_impl.h" #include "content/browser/cache_storage/cache_storage_manager.h" +#include "content/browser/cache_storage/legacy/legacy_cache_storage.h" #include "content/public/browser/browser_task_traits.h" +#include "mojo/public/cpp/bindings/self_owned_receiver.h" +#include "net/filter/source_stream.h" +#include "services/network/public/cpp/source_stream_to_data_pipe.h" #include "storage/browser/blob/blob_data_builder.h" #include "storage/browser/blob/blob_impl.h" #include "storage/browser/blob/blob_storage_context.h" +#include "storage/browser/blob/mojom/blob_storage_context.mojom.h" #include "third_party/blink/public/common/blob/blob_utils.h" namespace content { namespace { -// A |BlobDataItem::DataHandle| implementation that wraps a -// |DiskCacheBlobEntry|. In addition, each |DataHandleImpl| maps the main -// and side data to particular disk_cache indices. -// -// The |DataHandleImpl| is a "readable" handle. It overrides the virtual -// size and reading methods to access the underlying disk_cache entry. -class DataHandleImpl : public storage::BlobDataItem::DataHandle { +// Adapter for a DiskCacheBlobEntry to be read as a net::SourceStream. +class DiskCacheStream : public net::SourceStream { public: - DataHandleImpl( + DiskCacheStream( + scoped_refptr<CacheStorageCacheEntryHandler::DiskCacheBlobEntry> + blob_entry, + CacheStorageCache::EntryIndex cache_index, + uint64_t offset, + uint64_t length) + : SourceStream(net::SourceStream::SourceType::TYPE_NONE), + blob_entry_(blob_entry), + cache_index_(cache_index), + orig_offset_(offset), + orig_length_(length) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + } + + int Read(net::IOBuffer* dst_buffer, + int buffer_size, + net::CompletionOnceCallback callback) override { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + + uint64_t offset = orig_offset_ + bytes_read_; + + // Finished reading. + if (!MayHaveMoreBytes()) + return 0; + + if (buffer_size < 0) + return net::ERR_INVALID_ARGUMENT; + + uint64_t length = std::min(static_cast<uint64_t>(buffer_size), + orig_length_ - bytes_read_); + int result = blob_entry_->Read( + std::move(dst_buffer), cache_index_, offset, length, + base::BindOnce( + [](DiskCacheStream* stream, net::CompletionOnceCallback callback, + int result) { + // |blob_entry_| is strongly owned by |stream| so this can be + // safely Unretained. + if (result > 0) + stream->bytes_read_ += result; + std::move(callback).Run(result); + }, + base::Unretained(this), std::move(callback))); + + if (result > 0) + bytes_read_ += result; + return result; + } + + std::string Description() const override { return "DiskCacheStream"; } + + bool MayHaveMoreBytes() const override { return bytes_read_ < orig_length_; } + + private: + const scoped_refptr<CacheStorageCacheEntryHandler::DiskCacheBlobEntry> + blob_entry_; + const CacheStorageCache::EntryIndex cache_index_; + const uint64_t orig_offset_; + const uint64_t orig_length_; + uint64_t bytes_read_ = 0; +}; + +// A |storage::mojom::BlobDataItemReader| implementation that +// wraps a |DiskCacheBlobEntry|. In addition, each |EntryReaderImpl| maps the +// main and side data to particular disk_cache indices. +class EntryReaderImpl : public storage::mojom::BlobDataItemReader { + public: + EntryReaderImpl( scoped_refptr<CacheStorageCacheEntryHandler::DiskCacheBlobEntry> blob_entry, CacheStorageCache::EntryIndex disk_cache_index, CacheStorageCache::EntryIndex side_data_disk_cache_index) : blob_entry_(std::move(blob_entry)), disk_cache_index_(disk_cache_index), - side_data_disk_cache_index_(side_data_disk_cache_index) {} - - uint64_t GetSize() const override { + side_data_disk_cache_index_(side_data_disk_cache_index) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - return blob_entry_->GetSize(disk_cache_index_); + } + ~EntryReaderImpl() override { DCHECK_CURRENTLY_ON(BrowserThread::IO); } + + void Read(uint64_t offset, + uint64_t length, + mojo::ScopedDataPipeProducerHandle pipe, + ReadCallback callback) override { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + + uint64_t size = blob_entry_->GetSize(disk_cache_index_); + if (offset > size) { + std::move(callback).Run(net::ERR_INVALID_ARGUMENT); + return; + } + if (length > size - offset) { + std::move(callback).Run(net::ERR_INVALID_ARGUMENT); + return; + } + + auto stream = std::make_unique<DiskCacheStream>( + blob_entry_, disk_cache_index_, offset, length); + auto adapter = std::make_unique<network::SourceStreamToDataPipe>( + std::move(stream), std::move(pipe)); + auto* adapter_raw = adapter.get(); + adapter_raw->Start(base::BindOnce( + [](ReadCallback callback, + std::unique_ptr<network::SourceStreamToDataPipe> adapter, + int result) { std::move(callback).Run(result); }, + std::move(callback), std::move(adapter))); } - int Read(scoped_refptr<net::IOBuffer> dst_buffer, - uint64_t src_offset, - int bytes_to_read, - base::OnceCallback<void(int)> callback) override { + void ReadSideData(ReadSideDataCallback callback) override { DCHECK_CURRENTLY_ON(BrowserThread::IO); - return blob_entry_->Read(std::move(dst_buffer), disk_cache_index_, - src_offset, bytes_to_read, std::move(callback)); - } - uint64_t GetSideDataSize() const override { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (side_data_disk_cache_index_ == CacheStorageCache::INDEX_INVALID) - return 0; - return blob_entry_->GetSize(side_data_disk_cache_index_); - } + // Use a WrappedIOBuffer so that the DiskCacheBlobEntry writes directly + // to the BigBuffer without a copy. + int length = blob_entry_->GetSize(side_data_disk_cache_index_); + mojo_base::BigBuffer output_buf(static_cast<size_t>(length)); + auto wrapped_buf = base::MakeRefCounted<net::WrappedIOBuffer>( + reinterpret_cast<char*>(output_buf.data())); - int ReadSideData(scoped_refptr<net::IOBuffer> dst_buffer, - base::OnceCallback<void(int)> callback) override { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (side_data_disk_cache_index_ == CacheStorageCache::INDEX_INVALID) - return net::ERR_FAILED; - return blob_entry_->Read(std::move(dst_buffer), side_data_disk_cache_index_, - /* offset= */ 0, GetSideDataSize(), - std::move(callback)); - } + // Because net-style functions do not call their callback if they + // complete synchronously, we have to wrap the ReadSideDataCallback into a + // repeating callback. It may be called asynchronously by Read or if Read + // succeeds or fails synchronously, we will call it manually ourselves. + auto read_callback = base::AdaptCallbackForRepeating(base::BindOnce( + [](mojo_base::BigBuffer output_buf, ReadSideDataCallback callback, + int result) { + std::move(callback).Run(result, std::move(output_buf)); + }, + std::move(output_buf), std::move(callback))); - void PrintTo(::std::ostream* os) const override { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - blob_entry_->PrintTo(os); - *os << ",disk_cache_index:" << disk_cache_index_; - } + uint64_t offset = 0; + int result = + blob_entry_->Read(std::move(wrapped_buf), side_data_disk_cache_index_, + offset, length, read_callback); - const char* BytesReadHistogramLabel() const override { - DCHECK_CURRENTLY_ON(BrowserThread::IO); - return "DiskCache.CacheStorage"; + if (result == net::ERR_IO_PENDING) + return; + read_callback.Run(result); } private: - ~DataHandleImpl() override = default; - const scoped_refptr<CacheStorageCacheEntryHandler::DiskCacheBlobEntry> blob_entry_; const CacheStorageCache::EntryIndex disk_cache_index_; const CacheStorageCache::EntryIndex side_data_disk_cache_index_; - DISALLOW_COPY_AND_ASSIGN(DataHandleImpl); + DISALLOW_COPY_AND_ASSIGN(EntryReaderImpl); }; void FinalizeBlobOnIOThread( - base::WeakPtr<storage::BlobStorageContext> blob_context, + scoped_refptr<BlobStorageContextWrapper> blob_storage_context, scoped_refptr<CacheStorageCacheEntryHandler::DiskCacheBlobEntry> blob_entry, CacheStorageCache::EntryIndex disk_cache_index, CacheStorageCache::EntryIndex side_data_disk_cache_index, @@ -98,18 +182,21 @@ mojo::PendingReceiver<blink::mojom::Blob> receiver) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - // Just allow the blob mojo message pipe to automatically close if we're - // shutting down. - if (!blob_context) - return; + auto element = storage::mojom::BlobDataItem::New(); + element->size = blob_entry->GetSize(disk_cache_index); + element->side_data_size = + side_data_disk_cache_index == CacheStorageCache::INDEX_INVALID + ? 0 + : blob_entry->GetSize(side_data_disk_cache_index); + element->type = storage::mojom::BlobDataItemType::kCacheStorage; - auto inner_handle = base::MakeRefCounted<DataHandleImpl>( + auto handle = std::make_unique<EntryReaderImpl>( std::move(blob_entry), disk_cache_index, side_data_disk_cache_index); - auto blob_data = std::make_unique<storage::BlobDataBuilder>(uuid); - blob_data->AppendReadableDataHandle(std::move(inner_handle)); - auto blob_handle = blob_context->AddFinishedBlob(std::move(blob_data)); + mojo::MakeSelfOwnedReceiver(std::move(handle), + element->reader.InitWithNewPipeAndPassReceiver()); - storage::BlobImpl::Create(std::move(blob_handle), std::move(receiver)); + blob_storage_context->context()->RegisterFromDataItem( + std::move(receiver), uuid, std::move(element)); } } // namespace @@ -272,12 +359,12 @@ PutContext::~PutContext() = default; -// Default implemetation of CacheStorageCacheEntryHandler. +// Default implementation of CacheStorageCacheEntryHandler. class CacheStorageCacheEntryHandlerImpl : public CacheStorageCacheEntryHandler { public: CacheStorageCacheEntryHandlerImpl( - base::WeakPtr<storage::BlobStorageContext> blob_context) - : CacheStorageCacheEntryHandler(std::move(blob_context)) {} + scoped_refptr<BlobStorageContextWrapper> blob_storage_context) + : CacheStorageCacheEntryHandler(std::move(blob_storage_context)) {} ~CacheStorageCacheEntryHandlerImpl() override = default; std::unique_ptr<PutContext> CreatePutContext( @@ -336,8 +423,8 @@ }; CacheStorageCacheEntryHandler::CacheStorageCacheEntryHandler( - base::WeakPtr<storage::BlobStorageContext> blob_context) - : blob_context_(blob_context) {} + scoped_refptr<BlobStorageContextWrapper> blob_storage_context) + : blob_storage_context_(std::move(blob_storage_context)) {} scoped_refptr<CacheStorageCacheEntryHandler::DiskCacheBlobEntry> CacheStorageCacheEntryHandler::CreateDiskCacheBlobEntry( @@ -375,14 +462,14 @@ std::unique_ptr<CacheStorageCacheEntryHandler> CacheStorageCacheEntryHandler::CreateCacheEntryHandler( CacheStorageOwner owner, - base::WeakPtr<storage::BlobStorageContext> blob_context) { + scoped_refptr<BlobStorageContextWrapper> blob_storage_context) { switch (owner) { case CacheStorageOwner::kCacheAPI: return std::make_unique<CacheStorageCacheEntryHandlerImpl>( - std::move(blob_context)); + std::move(blob_storage_context)); case CacheStorageOwner::kBackgroundFetch: return std::make_unique<background_fetch::CacheEntryHandlerImpl>( - std::move(blob_context)); + std::move(blob_storage_context)); } NOTREACHED(); } @@ -406,16 +493,17 @@ blob->uuid = base::GenerateGUID(); if (BrowserThread::CurrentlyOn(BrowserThread::IO)) { - FinalizeBlobOnIOThread(blob_context_, std::move(blob_entry), + FinalizeBlobOnIOThread(blob_storage_context_, std::move(blob_entry), disk_cache_index, side_data_disk_cache_index, blob->uuid, blob->blob.InitWithNewPipeAndPassReceiver()); } else { - base::PostTask(FROM_HERE, {BrowserThread::IO}, - base::BindOnce(&FinalizeBlobOnIOThread, blob_context_, - std::move(blob_entry), disk_cache_index, - side_data_disk_cache_index, blob->uuid, - blob->blob.InitWithNewPipeAndPassReceiver())); + base::PostTask( + FROM_HERE, {BrowserThread::IO}, + base::BindOnce(&FinalizeBlobOnIOThread, blob_storage_context_, + std::move(blob_entry), disk_cache_index, + side_data_disk_cache_index, blob->uuid, + blob->blob.InitWithNewPipeAndPassReceiver())); } return blob;
diff --git a/content/browser/cache_storage/cache_storage_cache_entry_handler.h b/content/browser/cache_storage/cache_storage_cache_entry_handler.h index 4450a5a..1f2de39 100644 --- a/content/browser/cache_storage/cache_storage_cache_entry_handler.h +++ b/content/browser/cache_storage/cache_storage_cache_entry_handler.h
@@ -15,6 +15,7 @@ #include "base/util/type_safety/pass_key.h" #include "content/browser/cache_storage/cache_storage_cache.h" #include "content/browser/cache_storage/cache_storage_cache_handle.h" +#include "content/browser/cache_storage/cache_storage_manager.h" #include "content/browser/cache_storage/scoped_writable_entry.h" #include "content/common/content_export.h" #include "mojo/public/cpp/bindings/pending_remote.h" @@ -66,11 +67,9 @@ public: // The DiskCacheBlobEntry is a ref-counted object containing both // a disk_cache Entry and a Handle to the cache in which it lives. This - // blob entry can then be used to create a BlobDataItem::DataHandle by - // calling CacheStorageCacheEntryHandle's MakeDataHandle(). This ensures - // both the cache and the disk_cache entry live as long as the blob. + // blob entry can then be used to create an |EntryReaderImpl|. // - // The blob DataHandle always lives on the IO thread. The DiskCacheBlobEntry + // |EntryReaderImpl| always lives on the IO thread. The DiskCacheBlobEntry // is held cross-sequence, but is always created and destroyed on the // cache_storage scheduler sequence. This ensure both the cache and the // disk_cache entry live as long as the blob. @@ -169,14 +168,14 @@ static std::unique_ptr<CacheStorageCacheEntryHandler> CreateCacheEntryHandler( CacheStorageOwner owner, - base::WeakPtr<storage::BlobStorageContext> blob_context); + scoped_refptr<BlobStorageContextWrapper> blob_storage_context); void InvalidateDiskCacheBlobEntrys(); void EraseDiskCacheBlobEntry(DiskCacheBlobEntry* blob_entry); protected: CacheStorageCacheEntryHandler( - base::WeakPtr<storage::BlobStorageContext> blob_context); + scoped_refptr<BlobStorageContextWrapper> blob_storage_context); // Create a serialized blob from the given entry and disk_cache index. This // blob will not have any side data. @@ -190,7 +189,8 @@ CacheStorageCache::EntryIndex disk_cache_index, CacheStorageCache::EntryIndex side_data_disk_cache_index); - base::WeakPtr<storage::BlobStorageContext> blob_context_; + // IO thread wrapper for storage::mojom::BlobStorageContext. + scoped_refptr<BlobStorageContextWrapper> blob_storage_context_; // Every subclass should provide its own implementation to avoid partial // destruction. @@ -198,7 +198,8 @@ // We keep track of the DiskCacheBlobEntry instances to allow us to invalidate // them if the cache has to be deleted while there are still references to - // data in it. + // data in it. DiskCacheBlobEntries are owned by EntryReaderImpl, which + // are owned by their mojo remote (which indirectly is is owned by some blob). std::set<DiskCacheBlobEntry*> blob_entries_; SEQUENCE_CHECKER(sequence_checker_);
diff --git a/content/browser/cache_storage/cache_storage_cache_unittest.cc b/content/browser/cache_storage/cache_storage_cache_unittest.cc index 21dca7f9..8310d62 100644 --- a/content/browser/cache_storage/cache_storage_cache_unittest.cc +++ b/content/browser/cache_storage/cache_storage_cache_unittest.cc
@@ -48,7 +48,6 @@ #include "storage/browser/blob/blob_data_builder.h" #include "storage/browser/blob/blob_data_handle.h" #include "storage/browser/blob/blob_data_snapshot.h" -#include "storage/browser/blob/blob_handle.h" #include "storage/browser/blob/blob_impl.h" #include "storage/browser/blob/blob_storage_context.h" #include "storage/browser/quota/quota_manager_proxy.h" @@ -273,18 +272,6 @@ return true; } -bool ResponseBodiesEqual(const std::string& expected_body, - blink::mojom::Blob* actual_blob) { - std::string actual_body = storage::BlobToString(actual_blob); - return expected_body == actual_body; -} - -bool ResponseSideDataEqual(const std::string& expected_side_data, - blink::mojom::Blob* actual_blob) { - std::string actual_body = CopySideData(actual_blob); - return expected_side_data == actual_body; -} - blink::mojom::FetchAPIResponsePtr SetCacheName( blink::mojom::FetchAPIResponsePtr response) { response->response_source = @@ -311,7 +298,7 @@ const base::FilePath& path, LegacyCacheStorage* cache_storage, const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy, - base::WeakPtr<storage::BlobStorageContext> blob_context) + scoped_refptr<BlobStorageContextWrapper> blob_storage_context) : LegacyCacheStorageCache(origin, CacheStorageOwner::kCacheAPI, cache_name, @@ -319,7 +306,7 @@ cache_storage, base::ThreadTaskRunnerHandle::Get(), quota_manager_proxy, - blob_context, + std::move(blob_storage_context), 0 /* cache_size */, 0 /* cache_padding */, CreateTestPaddingKey()), @@ -380,7 +367,7 @@ base::SequencedTaskRunner* cache_task_runner, scoped_refptr<base::SequencedTaskRunner> scheduler_task_runner, scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy, - base::WeakPtr<storage::BlobStorageContext> blob_context, + scoped_refptr<BlobStorageContextWrapper> blob_storage_context, LegacyCacheStorageManager* cache_storage_manager, const url::Origin& origin, CacheStorageOwner owner) @@ -389,7 +376,7 @@ cache_task_runner, std::move(scheduler_task_runner), std::move(quota_manager_proxy), - std::move(blob_context), + std::move(blob_storage_context), cache_storage_manager, std::move(origin), owner) {} @@ -411,7 +398,8 @@ ChromeBlobStorageContext::GetFor(&browser_context_); // Wait for chrome_blob_storage_context to finish initializing. base::RunLoop().RunUntilIdle(); - blob_storage_context_ = blob_storage_context->context(); + blob_storage_context_ = base::MakeRefCounted<BlobStorageContextWrapper>( + blob_storage_context->MojoContext()); const bool is_incognito = MemoryOnly(); if (!is_incognito) { @@ -434,10 +422,11 @@ response_time_ = base::Time::Now(); for (int i = 0; i < 100; ++i) expected_blob_data_ += kTestData; - blob_handle_ = BuildBlobHandle("blob-id:myblob", expected_blob_data_); - storage::BlobImpl::Create( - std::make_unique<storage::BlobDataHandle>(*blob_handle_), - blob_remote_.BindNewPipeAndPassReceiver()); + + blob_storage_context_->context()->RegisterFromMemory( + blob_remote_.BindNewPipeAndPassReceiver(), expected_blob_uuid_, + std::vector<uint8_t>(expected_blob_data_.begin(), + expected_blob_data_.end())); // Use a mock LegacyCacheStorage object so we can use real // CacheStorageCacheHandle reference counting. A LegacyCacheStorage @@ -445,13 +434,13 @@ mock_cache_storage_ = std::make_unique<MockLegacyCacheStorage>( temp_dir_path_, MemoryOnly(), base::ThreadTaskRunnerHandle::Get().get(), base::ThreadTaskRunnerHandle::Get(), quota_manager_proxy_, - blob_storage_context_->AsWeakPtr(), + blob_storage_context_, /* cache_storage_manager = */ nullptr, kOrigin, CacheStorageOwner::kCacheAPI); cache_ = std::make_unique<TestCacheStorageCache>( kOrigin, kCacheName, temp_dir_path_, mock_cache_storage_.get(), - quota_manager_proxy_, blob_storage_context->context()->AsWeakPtr()); + quota_manager_proxy_, blob_storage_context_); cache_->Init(); } @@ -475,7 +464,7 @@ blink::mojom::FetchAPIResponsePtr CreateBlobBodyResponse() { auto blob = blink::mojom::SerializedBlob::New(); - blob->uuid = blob_handle_->uuid(); + blob->uuid = expected_blob_uuid_; blob->size = expected_blob_data_.size(); // Use cloned blob remote for all responses with blob body. blob_remote_->Clone(blob->blob.InitWithNewPipeAndPassReceiver()); @@ -508,27 +497,16 @@ nullptr /* content_security_policy */); } - std::unique_ptr<storage::BlobDataHandle> BuildBlobHandle( - const std::string& uuid, - const std::string& data) { - std::unique_ptr<storage::BlobDataBuilder> builder = - std::make_unique<storage::BlobDataBuilder>(uuid); - builder->AppendData(data); - return blob_storage_context_->AddFinishedBlob(std::move(builder)); - } - - void CopySideDataToResponse(storage::BlobDataHandle* side_data_blob_handle, + void CopySideDataToResponse(const std::string& uuid, + const std::string& data, blink::mojom::FetchAPIResponse* response) { - response->side_data_blob_for_cache_put = - blink::mojom::SerializedBlob::New(); - response->side_data_blob_for_cache_put->uuid = - side_data_blob_handle->uuid(); - response->side_data_blob_for_cache_put->size = - side_data_blob_handle->size(); - storage::BlobImpl::Create( - std::make_unique<storage::BlobDataHandle>(*side_data_blob_handle), - response->side_data_blob_for_cache_put->blob - .InitWithNewPipeAndPassReceiver()); + auto& blob = response->side_data_blob_for_cache_put; + blob = blink::mojom::SerializedBlob::New(); + blob->uuid = uuid; + blob->size = data.size(); + blob_storage_context_->context()->RegisterFromMemory( + blob->blob.InitWithNewPipeAndPassReceiver(), uuid, + std::vector<uint8_t>(data.begin(), data.end())); } blink::mojom::FetchAPIRequestPtr CopyFetchRequest( @@ -832,7 +810,7 @@ scoped_refptr<MockSpecialStoragePolicy> quota_policy_; scoped_refptr<MockQuotaManager> mock_quota_manager_; scoped_refptr<MockQuotaManagerProxy> quota_manager_proxy_; - storage::BlobStorageContext* blob_storage_context_; + scoped_refptr<BlobStorageContextWrapper> blob_storage_context_; std::unique_ptr<MockLegacyCacheStorage> mock_cache_storage_; base::FilePath temp_dir_path_; @@ -842,8 +820,8 @@ blink::mojom::FetchAPIRequestPtr body_request_with_query_; blink::mojom::FetchAPIRequestPtr no_body_request_; blink::mojom::FetchAPIRequestPtr body_head_request_; - std::unique_ptr<storage::BlobDataHandle> blob_handle_; - // Holds a Mojo connection to the BlobImpl containing |blob_handle_|. + std::string expected_blob_uuid_ = "blob-id:myblob"; + // Holds a Mojo connection to the BlobImpl with uuid |expected_blob_uuid_|. mojo::Remote<blink::mojom::Blob> blob_remote_; base::Time response_time_; std::string expected_blob_data_; @@ -1024,9 +1002,11 @@ base::BindOnce(&CacheStorageCacheTestP::VerboseErrorTypeCallback, base::Unretained(this), base::Unretained(loop.get())), CacheStorageCache::BadMessageCallback()); + // The handle should be held by the cache now so the deref here should be // okay. - blob_handle_.reset(); + blob_remote_.reset(); + loop->Run(); EXPECT_EQ(CacheStorageError::kSuccess, callback_error_); @@ -1122,7 +1102,7 @@ *callback_response_)); mojo::Remote<blink::mojom::Blob> blob( std::move(callback_response_->blob->blob)); - EXPECT_TRUE(ResponseBodiesEqual(expected_blob_data_, blob.get())); + EXPECT_EQ(expected_blob_data_, storage::BlobToString(blob.get())); } TEST_P(CacheStorageCacheTestP, MatchBodyHead) { @@ -1158,7 +1138,7 @@ EXPECT_TRUE(ResponseMetadataEqual(*SetCacheName(CreateBlobBodyResponse()), *responses[0])); mojo::Remote<blink::mojom::Blob> blob(std::move(responses[0]->blob->blob)); - EXPECT_TRUE(ResponseBodiesEqual(expected_blob_data_, blob.get())); + EXPECT_EQ(expected_blob_data_, storage::BlobToString(blob.get())); } TEST_P(CacheStorageCacheTestP, MatchAll_TwoResponsesThenOne) { @@ -1176,7 +1156,7 @@ EXPECT_TRUE(ResponseMetadataEqual(*SetCacheName(CreateBlobBodyResponse()), *responses[1])); mojo::Remote<blink::mojom::Blob> blob(std::move(responses[1]->blob->blob)); - EXPECT_TRUE(ResponseBodiesEqual(expected_blob_data_, blob.get())); + EXPECT_EQ(expected_blob_data_, storage::BlobToString(blob.get())); responses.clear(); @@ -1245,7 +1225,7 @@ EXPECT_TRUE(ResponseMetadataEqual(*SetCacheName(CreateBlobBodyResponse()), *response)); mojo::Remote<blink::mojom::Blob> blob(std::move(response->blob->blob)); - EXPECT_TRUE(ResponseBodiesEqual(expected_blob_data_, blob.get())); + EXPECT_EQ(expected_blob_data_, storage::BlobToString(blob.get())); } TEST_P(CacheStorageCacheTestP, Keys_IgnoreSearch) { @@ -1420,7 +1400,7 @@ EXPECT_TRUE(ResponseMetadataEqual(*SetCacheName(CreateBlobBodyResponse()), *responses[0])); mojo::Remote<blink::mojom::Blob> blob(std::move(responses[0]->blob->blob)); - EXPECT_TRUE(ResponseBodiesEqual(expected_blob_data_, blob.get())); + EXPECT_EQ(expected_blob_data_, storage::BlobToString(blob.get())); } TEST_P(CacheStorageCacheTestP, Vary) { @@ -1649,18 +1629,16 @@ blink::mojom::FetchAPIResponsePtr response = CreateBlobBodyResponse(); const std::string expected_side_data = "SideData"; - std::unique_ptr<storage::BlobDataHandle> side_data_blob_handle = - BuildBlobHandle("blob-id:mysideblob", expected_side_data); - - CopySideDataToResponse(side_data_blob_handle.get(), response.get()); + CopySideDataToResponse("blob-id:mysideblob", expected_side_data, + response.get()); EXPECT_TRUE(Put(body_request_, std::move(response))); EXPECT_TRUE(Match(body_request_)); ASSERT_TRUE(callback_response_->blob); mojo::Remote<blink::mojom::Blob> blob( std::move(callback_response_->blob->blob)); - EXPECT_TRUE(ResponseBodiesEqual(expected_blob_data_, blob.get())); - EXPECT_TRUE(ResponseSideDataEqual(expected_side_data, blob.get())); + EXPECT_EQ(expected_blob_data_, storage::BlobToString(blob.get())); + EXPECT_EQ(expected_side_data, CopySideData(blob.get())); } TEST_P(CacheStorageCacheTestP, PutWithSideData_QuotaExceeded) { @@ -1672,10 +1650,8 @@ mock_quota_manager_->SetQuota(kOrigin, blink::mojom::StorageType::kTemporary, expected_entry_size - 1); const std::string expected_side_data = "SideData"; - std::unique_ptr<storage::BlobDataHandle> side_data_blob_handle = - BuildBlobHandle("blob-id:mysideblob", expected_side_data); - - CopySideDataToResponse(side_data_blob_handle.get(), response.get()); + CopySideDataToResponse("blob-id:mysideblob", expected_side_data, + response.get()); // When the available space is not enough for the body, Put operation must // fail. EXPECT_FALSE(Put(body_request_, std::move(response))); @@ -1691,10 +1667,8 @@ mock_quota_manager_->SetQuota(kOrigin, blink::mojom::StorageType::kTemporary, expected_entry_size); const std::string expected_side_data = "SideData"; - std::unique_ptr<storage::BlobDataHandle> side_data_blob_handle = - BuildBlobHandle("blob-id:mysideblob", expected_side_data); - - CopySideDataToResponse(side_data_blob_handle.get(), response.get()); + CopySideDataToResponse("blob-id:mysideblob", expected_side_data, + response.get()); // When the available space is enough for the body but not enough for the side // data, Put operation must succeed. EXPECT_TRUE(Put(body_request_, std::move(response))); @@ -1703,9 +1677,9 @@ ASSERT_TRUE(callback_response_->blob); mojo::Remote<blink::mojom::Blob> blob( std::move(callback_response_->blob->blob)); - EXPECT_TRUE(ResponseBodiesEqual(expected_blob_data_, blob.get())); + EXPECT_EQ(expected_blob_data_, storage::BlobToString(blob.get())); // The side data should not be written. - EXPECT_TRUE(ResponseSideDataEqual("", blob.get())); + EXPECT_EQ("", CopySideData(blob.get())); } TEST_P(CacheStorageCacheTestP, PutWithSideData_BadMessage) { @@ -1713,10 +1687,8 @@ blink::mojom::FetchAPIResponsePtr response = CreateBlobBodyResponse(); const std::string expected_side_data = "SideData"; - std::unique_ptr<storage::BlobDataHandle> side_data_blob_handle = - BuildBlobHandle("blob-id:mysideblob", expected_side_data); - - CopySideDataToResponse(side_data_blob_handle.get(), response.get()); + CopySideDataToResponse("blob-id:mysideblob", expected_side_data, + response.get()); blink::mojom::BatchOperationPtr operation = blink::mojom::BatchOperation::New(); @@ -1754,8 +1726,8 @@ ASSERT_TRUE(callback_response_->blob); mojo::Remote<blink::mojom::Blob> blob1( std::move(callback_response_->blob->blob)); - EXPECT_TRUE(ResponseBodiesEqual(expected_blob_data_, blob1.get())); - EXPECT_TRUE(ResponseSideDataEqual(expected_side_data1, blob1.get())); + EXPECT_EQ(expected_blob_data_, storage::BlobToString(blob1.get())); + EXPECT_EQ(expected_side_data1, CopySideData(blob1.get())); const std::string expected_side_data2 = "New data"; scoped_refptr<net::IOBuffer> buffer2 = @@ -1766,8 +1738,8 @@ ASSERT_TRUE(callback_response_->blob); mojo::Remote<blink::mojom::Blob> blob2( std::move(callback_response_->blob->blob)); - EXPECT_TRUE(ResponseBodiesEqual(expected_blob_data_, blob2.get())); - EXPECT_TRUE(ResponseSideDataEqual(expected_side_data2, blob2.get())); + EXPECT_EQ(expected_blob_data_, storage::BlobToString(blob2.get())); + EXPECT_EQ(expected_side_data2, CopySideData(blob2.get())); ASSERT_TRUE(Delete(body_request_)); } @@ -2201,7 +2173,7 @@ VerifyAllOpsFail(); // Reading blob should fail. - EXPECT_TRUE(ResponseBodiesEqual("", blob.get())); + EXPECT_EQ("", storage::BlobToString(blob.get())); } TEST_P(CacheStorageCacheTestP, OpsFailOnClosedBackend) { @@ -2248,11 +2220,9 @@ base::RunLoop().RunUntilIdle(); // Create a new Cache in the same space. - ChromeBlobStorageContext* blob_storage_context = - ChromeBlobStorageContext::GetFor(&browser_context_); cache_ = std::make_unique<TestCacheStorageCache>( kOrigin, kCacheName, temp_dir_path_, nullptr /* CacheStorage */, - quota_manager_proxy_, blob_storage_context->context()->AsWeakPtr()); + quota_manager_proxy_, blob_storage_context_); cache_->Init(); // Now attempt to read the same response from the cache. It should fail. @@ -2277,7 +2247,7 @@ EXPECT_EQ(MemoryOnly(), callback_closed_); // Reading blob should succeed. - EXPECT_TRUE(ResponseBodiesEqual(expected_blob_data_, blob.get())); + EXPECT_EQ(expected_blob_data_, storage::BlobToString(blob.get())); blob.reset(); loop.Run(); @@ -2589,6 +2559,5 @@ INSTANTIATE_TEST_SUITE_P(CacheStorageCacheTest, CacheStorageCacheTestP, ::testing::Values(false, true)); - } // namespace cache_storage_cache_unittest } // namespace content
diff --git a/content/browser/cache_storage/cache_storage_context_impl.cc b/content/browser/cache_storage/cache_storage_context_impl.cc index 09296f8..806f4e3b 100644 --- a/content/browser/cache_storage/cache_storage_context_impl.cc +++ b/content/browser/cache_storage/cache_storage_context_impl.cc
@@ -128,13 +128,15 @@ DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!blob_storage_context) return; - // We can only get a WeakPtr to the BlobStorageContext on the IO thread. + // We can only get a mojo interface for BlobStorageContext on the IO thread. // Bounce there first before setting the context on the manager. + // TODO(enne): clean this up in the future to not require this bounce and + // to have this mojo context live on the cache storage sequence. base::PostTask( FROM_HERE, {BrowserThread::IO}, base::BindOnce( - &CacheStorageContextImpl::GetBlobStorageContextWeakPtrOnIOThread, - this, base::RetainedRef(blob_storage_context))); + &CacheStorageContextImpl::GetBlobStorageMojoContextOnIOThread, this, + base::RetainedRef(blob_storage_context))); } void CacheStorageContextImpl::GetAllOriginsInfo( @@ -248,22 +250,26 @@ cache_manager_ = nullptr; } -void CacheStorageContextImpl::GetBlobStorageContextWeakPtrOnIOThread( +void CacheStorageContextImpl::GetBlobStorageMojoContextOnIOThread( ChromeBlobStorageContext* blob_storage_context) { DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(blob_storage_context); + + // TODO(enne): this receiver will need to be sent to the storage service when + // cache storage is moved. + auto context = blob_storage_context->MojoContext(); task_runner_->PostTask( FROM_HERE, base::BindOnce( &CacheStorageContextImpl::SetBlobParametersForCacheOnTaskRunner, this, - blob_storage_context->context()->AsWeakPtr())); + base::MakeRefCounted<BlobStorageContextWrapper>(std::move(context)))); } void CacheStorageContextImpl::SetBlobParametersForCacheOnTaskRunner( - base::WeakPtr<storage::BlobStorageContext> blob_storage_context) { + scoped_refptr<BlobStorageContextWrapper> blob_storage_context) { DCHECK(task_runner_->RunsTasksInCurrentSequence()); if (cache_manager_) - cache_manager_->SetBlobParametersForCache(blob_storage_context); + cache_manager_->SetBlobParametersForCache(std::move(blob_storage_context)); } void CacheStorageContextImpl::CreateQuotaClientsOnIOThread(
diff --git a/content/browser/cache_storage/cache_storage_context_impl.h b/content/browser/cache_storage/cache_storage_context_impl.h index d5e706721..04cae74 100644 --- a/content/browser/cache_storage/cache_storage_context_impl.h +++ b/content/browser/cache_storage/cache_storage_context_impl.h
@@ -12,9 +12,13 @@ #include "base/memory/scoped_refptr.h" #include "base/observer_list_threadsafe.h" #include "base/threading/sequence_bound.h" +#include "content/browser/cache_storage/cache_storage_manager.h" #include "content/common/content_export.h" #include "content/public/browser/cache_storage_context.h" #include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/remote.h" +#include "storage/browser/blob/mojom/blob_storage_context.mojom.h" #include "storage/browser/quota/special_storage_policy.h" #include "third_party/blink/public/mojom/cache_storage/cache_storage.mojom-forward.h" @@ -24,7 +28,6 @@ } namespace storage { -class BlobStorageContext; class QuotaManagerProxy; } @@ -118,11 +121,11 @@ void ShutdownOnTaskRunner(); - void GetBlobStorageContextWeakPtrOnIOThread( + void GetBlobStorageMojoContextOnIOThread( ChromeBlobStorageContext* blob_storage_context); void SetBlobParametersForCacheOnTaskRunner( - base::WeakPtr<storage::BlobStorageContext> blob_storage_context); + scoped_refptr<BlobStorageContextWrapper> blob_storage_context); void CreateQuotaClientsOnIOThread( scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy);
diff --git a/content/browser/cache_storage/cache_storage_manager.h b/content/browser/cache_storage/cache_storage_manager.h index cc14a43..d36a761 100644 --- a/content/browser/cache_storage/cache_storage_manager.h +++ b/content/browser/cache_storage/cache_storage_manager.h
@@ -8,7 +8,7 @@ #include <string> #include "base/macros.h" -#include "base/memory/ref_counted.h" +#include "content/browser/blob_storage/blob_storage_context_wrapper.h" #include "content/browser/cache_storage/cache_storage_handle.h" #include "content/common/content_export.h" #include "content/public/browser/browser_thread.h" @@ -16,10 +16,6 @@ #include "content/public/browser/storage_usage_info.h" #include "storage/browser/quota/quota_client.h" -namespace storage { -class BlobStorageContext; -} - namespace url { class Origin; } @@ -74,7 +70,7 @@ // This must be called before any of the public Cache functions above. virtual void SetBlobParametersForCache( - base::WeakPtr<storage::BlobStorageContext> blob_storage_context) = 0; + scoped_refptr<BlobStorageContextWrapper> blob_storage_context) = 0; static bool IsValidQuotaOrigin(const url::Origin& origin);
diff --git a/content/browser/cache_storage/cache_storage_manager_unittest.cc b/content/browser/cache_storage/cache_storage_manager_unittest.cc index 7ce4e94..cbd3573 100644 --- a/content/browser/cache_storage/cache_storage_manager_unittest.cc +++ b/content/browser/cache_storage/cache_storage_manager_unittest.cc
@@ -361,8 +361,8 @@ // Wait for ChromeBlobStorageContext to finish initializing. base::RunLoop().RunUntilIdle(); - blob_storage_context_ = blob_storage_context->context(); - + blob_storage_context_ = base::MakeRefCounted<BlobStorageContextWrapper>( + blob_storage_context->MojoContext()); base::FilePath temp_dir_path; if (!MemoryOnly()) temp_dir_path = temp_dir_.GetPath(); @@ -382,9 +382,7 @@ auto legacy_manager = LegacyCacheStorageManager::Create( temp_dir_path, base::ThreadTaskRunnerHandle::Get(), base::ThreadTaskRunnerHandle::Get(), quota_manager_proxy_, observers_); - - legacy_manager->SetBlobParametersForCache( - blob_storage_context->context()->AsWeakPtr()); + legacy_manager->SetBlobParametersForCache(blob_storage_context_); switch (ManagerType()) { case TestManager::kLegacy: @@ -628,21 +626,14 @@ FetchResponseType response_type = FetchResponseType::kDefault, ResponseHeaderMap response_headers = ResponseHeaderMap()) { std::string blob_uuid = base::GenerateGUID(); - std::unique_ptr<storage::BlobDataBuilder> blob_data( - new storage::BlobDataBuilder(blob_uuid)); - blob_data->AppendData(request->url.spec()); - - std::unique_ptr<storage::BlobDataHandle> blob_data_handle = - blob_storage_context_->AddFinishedBlob(std::move(blob_data)); - - mojo::PendingRemote<blink::mojom::Blob> blob_remote; - storage::BlobImpl::Create(std::move(blob_data_handle), - blob_remote.InitWithNewPipeAndPassReceiver()); auto blob = blink::mojom::SerializedBlob::New(); blob->uuid = blob_uuid; blob->size = request->url.spec().size(); - blob->blob = std::move(blob_remote); + auto& str = request->url.spec(); + blob_storage_context_->context()->RegisterFromMemory( + blob->blob.InitWithNewPipeAndPassReceiver(), blob_uuid, + std::vector<uint8_t>(str.begin(), str.end())); base::RunLoop loop; CachePutWithStatusCodeAndBlobInternal(cache, std::move(request), @@ -809,7 +800,7 @@ BrowserTaskEnvironment task_environment_; TestBrowserContext browser_context_; - storage::BlobStorageContext* blob_storage_context_; + scoped_refptr<BlobStorageContextWrapper> blob_storage_context_; scoped_refptr<MockSpecialStoragePolicy> quota_policy_; scoped_refptr<MockQuotaManager> mock_quota_manager_;
diff --git a/content/browser/cache_storage/cross_sequence/cross_sequence_cache_storage_manager.cc b/content/browser/cache_storage/cross_sequence/cross_sequence_cache_storage_manager.cc index 0b240df..b0da9b8 100644 --- a/content/browser/cache_storage/cross_sequence/cross_sequence_cache_storage_manager.cc +++ b/content/browser/cache_storage/cross_sequence/cross_sequence_cache_storage_manager.cc
@@ -130,7 +130,7 @@ } void CrossSequenceCacheStorageManager::SetBlobParametersForCache( - base::WeakPtr<storage::BlobStorageContext> blob_storage_context) { + scoped_refptr<BlobStorageContextWrapper> blob_storage_context) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // This method is used for initialization of a real manager and should not // be invoked for the cross-sequence wrapper.
diff --git a/content/browser/cache_storage/cross_sequence/cross_sequence_cache_storage_manager.h b/content/browser/cache_storage/cross_sequence/cross_sequence_cache_storage_manager.h index 976cb35..5ca0805 100644 --- a/content/browser/cache_storage/cross_sequence/cross_sequence_cache_storage_manager.h +++ b/content/browser/cache_storage/cross_sequence/cross_sequence_cache_storage_manager.h
@@ -49,7 +49,7 @@ void DeleteOriginData(const url::Origin& origin, CacheStorageOwner owner) override; void SetBlobParametersForCache( - base::WeakPtr<storage::BlobStorageContext> blob_storage_context) override; + scoped_refptr<BlobStorageContextWrapper> blob_storage_context) override; private: ~CrossSequenceCacheStorageManager() override;
diff --git a/content/browser/cache_storage/legacy/legacy_cache_storage.cc b/content/browser/cache_storage/legacy/legacy_cache_storage.cc index b1a4d62c..04d8efd 100644 --- a/content/browser/cache_storage/legacy/legacy_cache_storage.cc +++ b/content/browser/cache_storage/legacy/legacy_cache_storage.cc
@@ -93,14 +93,14 @@ CacheLoader(base::SequencedTaskRunner* cache_task_runner, scoped_refptr<base::SequencedTaskRunner> scheduler_task_runner, storage::QuotaManagerProxy* quota_manager_proxy, - base::WeakPtr<storage::BlobStorageContext> blob_context, + scoped_refptr<BlobStorageContextWrapper> blob_storage_context, LegacyCacheStorage* cache_storage, const url::Origin& origin, CacheStorageOwner owner) : cache_task_runner_(cache_task_runner), scheduler_task_runner_(std::move(scheduler_task_runner)), quota_manager_proxy_(quota_manager_proxy), - blob_context_(blob_context), + blob_storage_context_(std::move(blob_storage_context)), cache_storage_(cache_storage), origin_(origin), owner_(owner) { @@ -148,7 +148,7 @@ // Owned by CacheStorage which owns this. storage::QuotaManagerProxy* quota_manager_proxy_; - base::WeakPtr<storage::BlobStorageContext> blob_context_; + scoped_refptr<BlobStorageContextWrapper> blob_storage_context_; // Raw pointer is safe because this object is owned by cache_storage_. LegacyCacheStorage* cache_storage_; @@ -167,14 +167,14 @@ MemoryLoader(base::SequencedTaskRunner* cache_task_runner, scoped_refptr<base::SequencedTaskRunner> scheduler_task_runner, storage::QuotaManagerProxy* quota_manager_proxy, - base::WeakPtr<storage::BlobStorageContext> blob_context, + scoped_refptr<BlobStorageContextWrapper> blob_storage_context, LegacyCacheStorage* cache_storage, const url::Origin& origin, CacheStorageOwner owner) : CacheLoader(cache_task_runner, std::move(scheduler_task_runner), quota_manager_proxy, - blob_context, + std::move(blob_storage_context), cache_storage, origin, owner) {} @@ -186,7 +186,8 @@ std::unique_ptr<SymmetricKey> cache_padding_key) override { return LegacyCacheStorageCache::CreateMemoryCache( origin_, owner_, cache_name, cache_storage_, scheduler_task_runner_, - quota_manager_proxy_, blob_context_, storage::CopyDefaultPaddingKey()); + quota_manager_proxy_, blob_storage_context_, + storage::CopyDefaultPaddingKey()); } void PrepareNewCacheDestination(const std::string& cache_name, @@ -238,14 +239,14 @@ base::SequencedTaskRunner* cache_task_runner, scoped_refptr<base::SequencedTaskRunner> scheduler_task_runner, storage::QuotaManagerProxy* quota_manager_proxy, - base::WeakPtr<storage::BlobStorageContext> blob_context, + scoped_refptr<BlobStorageContextWrapper> blob_storage_context, LegacyCacheStorage* cache_storage, const url::Origin& origin, CacheStorageOwner owner) : CacheLoader(cache_task_runner, std::move(scheduler_task_runner), quota_manager_proxy, - blob_context, + std::move(blob_storage_context), cache_storage, origin, owner), @@ -263,8 +264,8 @@ base::FilePath cache_path = origin_path_.AppendASCII(cache_dir); return LegacyCacheStorageCache::CreatePersistentCache( origin_, owner_, cache_name, cache_storage_, cache_path, - scheduler_task_runner_, quota_manager_proxy_, blob_context_, cache_size, - cache_padding, std::move(cache_padding_key)); + scheduler_task_runner_, quota_manager_proxy_, blob_storage_context_, + cache_size, cache_padding, std::move(cache_padding_key)); } void PrepareNewCacheDestination(const std::string& cache_name, @@ -555,7 +556,7 @@ base::SequencedTaskRunner* cache_task_runner, scoped_refptr<base::SequencedTaskRunner> scheduler_task_runner, scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy, - base::WeakPtr<storage::BlobStorageContext> blob_context, + scoped_refptr<BlobStorageContextWrapper> blob_storage_context, LegacyCacheStorageManager* cache_storage_manager, const url::Origin& origin, CacheStorageOwner owner) @@ -569,18 +570,19 @@ origin_path_(path), cache_task_runner_(cache_task_runner), quota_manager_proxy_(quota_manager_proxy), + blob_storage_context_(std::move(blob_storage_context)), owner_(owner), cache_storage_manager_(cache_storage_manager) { if (memory_only) { cache_loader_.reset(new MemoryLoader( cache_task_runner_.get(), std::move(scheduler_task_runner), - quota_manager_proxy.get(), blob_context, this, origin, owner)); + quota_manager_proxy.get(), blob_storage_context_, this, origin, owner)); return; } cache_loader_.reset(new SimpleCacheLoader( origin_path_, cache_task_runner_.get(), std::move(scheduler_task_runner), - quota_manager_proxy.get(), blob_context, this, origin, owner)); + quota_manager_proxy.get(), blob_storage_context_, this, origin, owner)); #if defined(OS_ANDROID) app_status_listener_ = base::android::ApplicationStatusListener::New(
diff --git a/content/browser/cache_storage/legacy/legacy_cache_storage.h b/content/browser/cache_storage/legacy/legacy_cache_storage.h index 2e68fe9b..958532f 100644 --- a/content/browser/cache_storage/legacy/legacy_cache_storage.h +++ b/content/browser/cache_storage/legacy/legacy_cache_storage.h
@@ -18,8 +18,11 @@ #include "build/build_config.h" #include "content/browser/cache_storage/cache_storage.h" #include "content/browser/cache_storage/cache_storage_cache_observer.h" +#include "content/browser/cache_storage/cache_storage_manager.h" #include "content/browser/cache_storage/cache_storage_scheduler_types.h" #include "content/browser/cache_storage/legacy/legacy_cache_storage_cache.h" +#include "mojo/public/cpp/bindings/remote.h" +#include "storage/browser/blob/mojom/blob_storage_context.mojom.h" #if defined(OS_ANDROID) #include "base/android/application_status_listener.h" @@ -29,10 +32,6 @@ class SequencedTaskRunner; } -namespace storage { -class BlobStorageContext; -} - namespace content { class CacheStorageIndex; class CacheStorageScheduler; @@ -62,7 +61,7 @@ base::SequencedTaskRunner* cache_task_runner, scoped_refptr<base::SequencedTaskRunner> scheduler_task_runner, scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy, - base::WeakPtr<storage::BlobStorageContext> blob_context, + scoped_refptr<BlobStorageContextWrapper> blob_storage_context, LegacyCacheStorageManager* cache_storage_manager, const url::Origin& origin, CacheStorageOwner owner); @@ -304,6 +303,9 @@ // The quota manager. scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; + // An IO thread bound wrapper for storage.mojom.BlobStorageContext. + scoped_refptr<BlobStorageContextWrapper> blob_storage_context_; + // The owner that this CacheStorage is associated with. CacheStorageOwner owner_;
diff --git a/content/browser/cache_storage/legacy/legacy_cache_storage_cache.cc b/content/browser/cache_storage/legacy/legacy_cache_storage_cache.cc index cf52c788..2c4c4c1b 100644 --- a/content/browser/cache_storage/legacy/legacy_cache_storage_cache.cc +++ b/content/browser/cache_storage/legacy/legacy_cache_storage_cache.cc
@@ -449,13 +449,13 @@ LegacyCacheStorage* cache_storage, scoped_refptr<base::SequencedTaskRunner> scheduler_task_runner, scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy, - base::WeakPtr<storage::BlobStorageContext> blob_context, + scoped_refptr<BlobStorageContextWrapper> blob_storage_context, std::unique_ptr<crypto::SymmetricKey> cache_padding_key) { LegacyCacheStorageCache* cache = new LegacyCacheStorageCache( origin, owner, cache_name, base::FilePath(), cache_storage, std::move(scheduler_task_runner), std::move(quota_manager_proxy), - std::move(blob_context), 0 /* cache_size */, 0 /* cache_padding */, - std::move(cache_padding_key)); + std::move(blob_storage_context), 0 /* cache_size */, + 0 /* cache_padding */, std::move(cache_padding_key)); cache->SetObserver(cache_storage); cache->InitBackend(); return base::WrapUnique(cache); @@ -471,14 +471,14 @@ const base::FilePath& path, scoped_refptr<base::SequencedTaskRunner> scheduler_task_runner, scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy, - base::WeakPtr<storage::BlobStorageContext> blob_context, + scoped_refptr<BlobStorageContextWrapper> blob_storage_context, int64_t cache_size, int64_t cache_padding, std::unique_ptr<crypto::SymmetricKey> cache_padding_key) { LegacyCacheStorageCache* cache = new LegacyCacheStorageCache( origin, owner, cache_name, path, cache_storage, std::move(scheduler_task_runner), std::move(quota_manager_proxy), - std::move(blob_context), cache_size, cache_padding, + std::move(blob_storage_context), cache_size, cache_padding, std::move(cache_padding_key)); cache->SetObserver(cache_storage); cache->InitBackend(); @@ -916,7 +916,7 @@ LegacyCacheStorage* cache_storage, scoped_refptr<base::SequencedTaskRunner> scheduler_task_runner, scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy, - base::WeakPtr<storage::BlobStorageContext> blob_context, + scoped_refptr<BlobStorageContextWrapper> blob_storage_context, int64_t cache_size, int64_t cache_padding, std::unique_ptr<crypto::SymmetricKey> cache_padding_key) @@ -937,7 +937,7 @@ cache_entry_handler_( CacheStorageCacheEntryHandler::CreateCacheEntryHandler( owner, - std::move(blob_context))), + std::move(blob_storage_context))), memory_only_(path.empty()) { DCHECK(!origin_.opaque()); DCHECK(quota_manager_proxy_.get());
diff --git a/content/browser/cache_storage/legacy/legacy_cache_storage_cache.h b/content/browser/cache_storage/legacy/legacy_cache_storage_cache.h index d84b230c..78cf666f 100644 --- a/content/browser/cache_storage/legacy/legacy_cache_storage_cache.h +++ b/content/browser/cache_storage/legacy/legacy_cache_storage_cache.h
@@ -19,6 +19,7 @@ #include "base/optional.h" #include "content/browser/cache_storage/cache_storage_cache.h" #include "content/browser/cache_storage/cache_storage_handle.h" +#include "content/browser/cache_storage/cache_storage_manager.h" #include "content/browser/cache_storage/scoped_writable_entry.h" #include "net/base/completion_once_callback.h" #include "net/base/io_buffer.h" @@ -32,7 +33,6 @@ } namespace storage { -class BlobStorageContext; class QuotaManagerProxy; } // namespace storage @@ -69,7 +69,7 @@ LegacyCacheStorage* cache_storage, scoped_refptr<base::SequencedTaskRunner> scheduler_task_runner, scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy, - base::WeakPtr<storage::BlobStorageContext> blob_context, + scoped_refptr<BlobStorageContextWrapper> blob_storage_context, std::unique_ptr<crypto::SymmetricKey> cache_padding_key); static std::unique_ptr<LegacyCacheStorageCache> CreatePersistentCache( const url::Origin& origin, @@ -79,7 +79,7 @@ const base::FilePath& path, scoped_refptr<base::SequencedTaskRunner> scheduler_task_runner, scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy, - base::WeakPtr<storage::BlobStorageContext> blob_context, + scoped_refptr<BlobStorageContextWrapper> blob_storage_context, int64_t cache_size, int64_t cache_padding, std::unique_ptr<crypto::SymmetricKey> cache_padding_key); @@ -249,7 +249,7 @@ LegacyCacheStorage* cache_storage, scoped_refptr<base::SequencedTaskRunner> scheduler_task_runner, scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy, - base::WeakPtr<storage::BlobStorageContext> blob_context, + scoped_refptr<BlobStorageContextWrapper> blob_storage_context, int64_t cache_size, int64_t cache_padding, std::unique_ptr<crypto::SymmetricKey> cache_padding_key);
diff --git a/content/browser/cache_storage/legacy/legacy_cache_storage_manager.cc b/content/browser/cache_storage/legacy/legacy_cache_storage_manager.cc index 268a1e9..fd2677c 100644 --- a/content/browser/cache_storage/legacy/legacy_cache_storage_manager.cc +++ b/content/browser/cache_storage/legacy/legacy_cache_storage_manager.cc
@@ -24,6 +24,7 @@ #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" +#include "base/task/post_task.h" #include "base/threading/sequenced_task_runner_handle.h" #include "base/time/time.h" #include "content/browser/cache_storage/cache_storage.h" @@ -273,7 +274,7 @@ old_manager->root_path(), old_manager->cache_task_runner(), old_manager->scheduler_task_runner(), old_manager->quota_manager_proxy_.get(), old_manager->observers_)); - manager->SetBlobParametersForCache(old_manager->blob_storage_context()); + manager->SetBlobParametersForCache(old_manager->blob_storage_context_); return manager; } @@ -300,7 +301,7 @@ LegacyCacheStorage* cache_storage = new LegacyCacheStorage( ConstructOriginPath(root_path_, origin, owner), IsMemoryBacked(), cache_task_runner_.get(), scheduler_task_runner_, quota_manager_proxy_, - blob_context_, this, origin, owner); + blob_storage_context_, this, origin, owner); cache_storage_map_[{origin, owner}] = base::WrapUnique(cache_storage); return cache_storage->CreateHandle(); } @@ -308,11 +309,12 @@ } void LegacyCacheStorageManager::SetBlobParametersForCache( - base::WeakPtr<storage::BlobStorageContext> blob_storage_context) { + scoped_refptr<BlobStorageContextWrapper> blob_storage_context) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(cache_storage_map_.empty()); - DCHECK(!blob_context_ || blob_context_.get() == blob_storage_context.get()); - blob_context_ = blob_storage_context; + DCHECK(!blob_storage_context_ || + blob_storage_context_ == blob_storage_context); + blob_storage_context_ = std::move(blob_storage_context); } void LegacyCacheStorageManager::NotifyCacheListChanged(
diff --git a/content/browser/cache_storage/legacy/legacy_cache_storage_manager.h b/content/browser/cache_storage/legacy/legacy_cache_storage_manager.h index 591fa28..d55a1f8 100644 --- a/content/browser/cache_storage/legacy/legacy_cache_storage_manager.h +++ b/content/browser/cache_storage/legacy/legacy_cache_storage_manager.h
@@ -22,6 +22,7 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/cache_storage_context.h" #include "content/public/browser/storage_usage_info.h" +#include "mojo/public/cpp/bindings/remote.h" #include "storage/browser/quota/quota_client.h" #include "url/origin.h" @@ -82,7 +83,7 @@ CacheStorageOwner owner) override; void SetBlobParametersForCache( - base::WeakPtr<storage::BlobStorageContext> blob_storage_context) override; + scoped_refptr<BlobStorageContextWrapper> blob_storage_context) override; void NotifyCacheListChanged(const url::Origin& origin); void NotifyCacheContentChanged(const url::Origin& origin, @@ -123,10 +124,6 @@ std::unique_ptr<LegacyCacheStorage> cache_storage, int64_t origin_size); - base::WeakPtr<storage::BlobStorageContext> blob_storage_context() const { - return blob_context_; - } - scoped_refptr<base::SequencedTaskRunner> cache_task_runner() const { return cache_task_runner_; } @@ -153,7 +150,7 @@ scoped_refptr<CacheStorageContextImpl::ObserverList> observers_; - base::WeakPtr<storage::BlobStorageContext> blob_context_; + scoped_refptr<BlobStorageContextWrapper> blob_storage_context_; std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index 2e48ffd5..f0b70e9 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -7676,8 +7676,8 @@ blink::mojom::ConsoleMessageLevel level, const std::string& message, bool discard_duplicates) { - Send(new FrameMsg_AddMessageToConsole(routing_id_, level, message, - discard_duplicates)); + GetAssociatedLocalFrame()->AddMessageToConsole(level, message, + discard_duplicates); } void RenderFrameHostImpl::AddSameSiteCookieDeprecationMessage(
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc index 021df20..ef19485 100644 --- a/content/browser/frame_host/render_frame_host_manager.cc +++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -946,8 +946,8 @@ void RenderFrameHostManager::OnEnforceInsecureNavigationsSet( const std::vector<uint32_t>& insecure_navigations_set) { for (const auto& pair : proxy_hosts_) { - pair.second->Send(new FrameMsg_EnforceInsecureNavigationsSet( - pair.second->GetRoutingID(), insecure_navigations_set)); + pair.second->GetAssociatedRemoteFrame()->EnforceInsecureNavigationsSet( + insecure_navigations_set); } }
diff --git a/content/browser/indexed_db/indexed_db_connection_coordinator.cc b/content/browser/indexed_db/indexed_db_connection_coordinator.cc index 5608ead4..e291fd7 100644 --- a/content/browser/indexed_db/indexed_db_connection_coordinator.cc +++ b/content/browser/indexed_db/indexed_db_connection_coordinator.cc
@@ -475,8 +475,7 @@ int64_t old_version = db_->metadata_.version; db_->metadata_.id = kInvalidDatabaseId; db_->metadata_.version = IndexedDBDatabaseMetadata::NO_VERSION; - db_->metadata_.max_object_store_id = - blink::IndexedDBObjectStoreMetadata::kInvalidId; + db_->metadata_.max_object_store_id = 0; db_->metadata_.object_stores.clear(); // Unittests (specifically the IndexedDBDatabase unittests) can have the // backing store be a nullptr, so report deleted here.
diff --git a/content/browser/indexed_db/indexed_db_metadata_coding.cc b/content/browser/indexed_db/indexed_db_metadata_coding.cc index 0b76c60..98fe6585 100644 --- a/content/browser/indexed_db/indexed_db_metadata_coding.cc +++ b/content/browser/indexed_db/indexed_db_metadata_coding.cc
@@ -572,6 +572,7 @@ // Note: |version| is not stored on purpose. metadata->name = name; metadata->id = row_id; + metadata->max_object_store_id = 0; return s; }
diff --git a/content/browser/interface_provider_filtering.cc b/content/browser/interface_provider_filtering.cc index f6f7aa4..694e473 100644 --- a/content/browser/interface_provider_filtering.cc +++ b/content/browser/interface_provider_filtering.cc
@@ -12,6 +12,7 @@ #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" +#include "mojo/public/cpp/bindings/pending_remote.h" #include "services/service_manager/public/cpp/connector.h" namespace content { @@ -22,8 +23,8 @@ void FilterInterfacesImpl( const char* spec, int process_id, - service_manager::mojom::InterfaceProviderRequest request, - service_manager::mojom::InterfaceProviderPtr provider) { + mojo::PendingReceiver<service_manager::mojom::InterfaceProvider> receiver, + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> provider) { RenderProcessHost* process = RenderProcessHost::FromID(process_id); if (!process || !process->IsInitializedAndNotDead()) return; @@ -35,30 +36,30 @@ return; connector->FilterInterfaces(spec, process->GetChildIdentity(), - std::move(request), std::move(provider)); + std::move(receiver), std::move(provider)); } } // namespace -service_manager::mojom::InterfaceProviderRequest +mojo::PendingReceiver<service_manager::mojom::InterfaceProvider> FilterRendererExposedInterfaces( const char* spec, int process_id, - service_manager::mojom::InterfaceProviderRequest request) { + mojo::PendingReceiver<service_manager::mojom::InterfaceProvider> receiver) { if (g_bypass_interface_filtering_for_testing) - return request; + return receiver; - service_manager::mojom::InterfaceProviderPtr provider; - auto filtered_request = mojo::MakeRequest(&provider); + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> provider; + auto filtered_receiver = provider.InitWithNewPipeAndPassReceiver(); if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { base::PostTask(FROM_HERE, {BrowserThread::UI}, base::BindOnce(&FilterInterfacesImpl, spec, process_id, - std::move(request), std::move(provider))); + std::move(receiver), std::move(provider))); } else { - FilterInterfacesImpl(spec, process_id, std::move(request), + FilterInterfacesImpl(spec, process_id, std::move(receiver), std::move(provider)); } - return filtered_request; + return filtered_receiver; } namespace test {
diff --git a/content/browser/interface_provider_filtering.h b/content/browser/interface_provider_filtering.h index 9ca70474..1651fc3 100644 --- a/content/browser/interface_provider_filtering.h +++ b/content/browser/interface_provider_filtering.h
@@ -10,24 +10,26 @@ #include "base/macros.h" #include "base/strings/string_piece.h" #include "content/common/content_export.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" #include "services/service_manager/public/mojom/interface_provider.mojom.h" namespace content { // Filters interface requests received from an execution context of the type // corresponding to |spec| in the renderer process with ID |process_id|. -// |request| is the InterfaceProviderRequest from the renderer; an equivalent -// InterfaceProviderRequest where GetInterface requests have been filtered. +// |receiver| is the PendingReceiver<InterfaceProvider> from the renderer; an +// equivalent PendingReceiver<InterfaceProvider> where GetInterface receivers +// have been filtered. // // If |process_id| does not refer to a renderer process or if that renderer's // BrowserContext does not have a Connector, the connection is broken instead; -// that is, |request| and the InterfacePtr corresponding to the returned request -// are both closed. -service_manager::mojom::InterfaceProviderRequest +// that is, |receiver| and the mojo::PendingRemote<Interface> corresponding +// to the returned receiver are both closed. +mojo::PendingReceiver<service_manager::mojom::InterfaceProvider> FilterRendererExposedInterfaces( const char* spec, int process_id, - service_manager::mojom::InterfaceProviderRequest request); + mojo::PendingReceiver<service_manager::mojom::InterfaceProvider> receiver); namespace test {
diff --git a/content/browser/media/android/media_player_renderer.cc b/content/browser/media/android/media_player_renderer.cc index 760cdd6..f0bc28a 100644 --- a/content/browser/media/android/media_player_renderer.cc +++ b/content/browser/media/android/media_player_renderer.cc
@@ -73,7 +73,7 @@ void MediaPlayerRenderer::Initialize(media::MediaResource* media_resource, media::RendererClient* client, - const media::PipelineStatusCB& init_cb) { + media::PipelineStatusCallback init_cb) { DVLOG(1) << __func__; DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -82,7 +82,7 @@ if (media_resource->GetType() != media::MediaResource::Type::URL) { DLOG(ERROR) << "MediaResource is not of Type URL"; - init_cb.Run(media::PIPELINE_ERROR_INITIALIZATION_FAILED); + std::move(init_cb).Run(media::PIPELINE_ERROR_INITIALIZATION_FAILED); return; } @@ -90,7 +90,7 @@ media::MediaServiceThrottler::GetInstance()->GetDelayForClientCreation(); if (creation_delay.is_zero()) { - CreateMediaPlayer(media_resource->GetMediaUrlParams(), init_cb); + CreateMediaPlayer(media_resource->GetMediaUrlParams(), std::move(init_cb)); return; } @@ -98,20 +98,20 @@ FROM_HERE, {BrowserThread::UI}, base::BindOnce(&MediaPlayerRenderer::CreateMediaPlayer, weak_factory_.GetWeakPtr(), - media_resource->GetMediaUrlParams(), init_cb), + media_resource->GetMediaUrlParams(), std::move(init_cb)), creation_delay); } void MediaPlayerRenderer::CreateMediaPlayer( const media::MediaUrlParams& url_params, - const media::PipelineStatusCB& init_cb) { + media::PipelineStatusCallback init_cb) { DCHECK_CURRENTLY_ON(BrowserThread::UI); // Force the initialization of |media_resource_getter_| first. If it fails, // the RenderFrameHost may have been destroyed already. if (!GetMediaResourceGetter()) { DLOG(ERROR) << "Unable to retrieve MediaResourceGetter"; - init_cb.Run(media::PIPELINE_ERROR_INITIALIZATION_FAILED); + std::move(init_cb).Run(media::PIPELINE_ERROR_INITIALIZATION_FAILED); return; } @@ -132,7 +132,7 @@ media_player_->Initialize(); UpdateVolume(); - init_cb.Run(media::PIPELINE_OK); + std::move(init_cb).Run(media::PIPELINE_OK); } void MediaPlayerRenderer::SetCdm(media::CdmContext* cdm_context, @@ -140,9 +140,9 @@ NOTREACHED(); } -void MediaPlayerRenderer::Flush(const base::Closure& flush_cb) { +void MediaPlayerRenderer::Flush(base::OnceClosure flush_cb) { DVLOG(3) << __func__; - flush_cb.Run(); + std::move(flush_cb).Run(); } void MediaPlayerRenderer::StartPlayingFrom(base::TimeDelta time) {
diff --git a/content/browser/media/android/media_player_renderer.h b/content/browser/media/android/media_player_renderer.h index 8127346..3c567bd 100644 --- a/content/browser/media/android/media_player_renderer.h +++ b/content/browser/media/android/media_player_renderer.h
@@ -56,10 +56,10 @@ // media::Renderer implementation void Initialize(media::MediaResource* media_resource, media::RendererClient* client, - const media::PipelineStatusCB& init_cb) override; + media::PipelineStatusCallback init_cb) override; void SetCdm(media::CdmContext* cdm_context, const media::CdmAttachedCB& cdm_attached_cb) override; - void Flush(const base::Closure& flush_cb) override; + void Flush(base::OnceClosure flush_cb) override; void StartPlayingFrom(base::TimeDelta time) override; // N.B: MediaPlayerBridge doesn't support variable playback rates (but it @@ -97,7 +97,7 @@ private: void CreateMediaPlayer(const media::MediaUrlParams& params, - const media::PipelineStatusCB& init_cb); + media::PipelineStatusCallback init_cb); // Cancels the pending request started by InitiateScopedSurfaceRequest(), if // it exists. No-ops otherwise.
diff --git a/content/browser/media/flinging_renderer.cc b/content/browser/media/flinging_renderer.cc index 9e55c87..ed7a9274 100644 --- a/content/browser/media/flinging_renderer.cc +++ b/content/browser/media/flinging_renderer.cc
@@ -66,10 +66,10 @@ // media::Renderer implementation void FlingingRenderer::Initialize(media::MediaResource* media_resource, media::RendererClient* client, - const media::PipelineStatusCB& init_cb) { + media::PipelineStatusCallback init_cb) { DVLOG(2) << __func__; client_ = client; - init_cb.Run(media::PIPELINE_OK); + std::move(init_cb).Run(media::PIPELINE_OK); } void FlingingRenderer::SetCdm(media::CdmContext* cdm_context, @@ -78,10 +78,10 @@ NOTREACHED(); } -void FlingingRenderer::Flush(const base::Closure& flush_cb) { +void FlingingRenderer::Flush(base::OnceClosure flush_cb) { DVLOG(2) << __func__; // There is nothing to reset, we can no-op the call. - flush_cb.Run(); + std::move(flush_cb).Run(); } void FlingingRenderer::StartPlayingFrom(base::TimeDelta time) {
diff --git a/content/browser/media/flinging_renderer.h b/content/browser/media/flinging_renderer.h index 6b7c16ff..a3bf3c48 100644 --- a/content/browser/media/flinging_renderer.h +++ b/content/browser/media/flinging_renderer.h
@@ -44,10 +44,10 @@ // media::Renderer implementation void Initialize(media::MediaResource* media_resource, media::RendererClient* client, - const media::PipelineStatusCB& init_cb) override; + media::PipelineStatusCallback init_cb) override; void SetCdm(media::CdmContext* cdm_context, const media::CdmAttachedCB& cdm_attached_cb) override; - void Flush(const base::Closure& flush_cb) override; + void Flush(base::OnceClosure flush_cb) override; void StartPlayingFrom(base::TimeDelta time) override; void SetPlaybackRate(double playback_rate) override; void SetVolume(float volume) override;
diff --git a/content/browser/media/media_interface_factory_holder.cc b/content/browser/media/media_interface_factory_holder.cc index 7eb1246..404e00d 100644 --- a/content/browser/media/media_interface_factory_holder.cc +++ b/content/browser/media/media_interface_factory_holder.cc
@@ -24,10 +24,10 @@ media::mojom::InterfaceFactory* MediaInterfaceFactoryHolder::Get() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - if (!interface_factory_ptr_) + if (!interface_factory_remote_) ConnectToMediaService(); - return interface_factory_ptr_.get(); + return interface_factory_remote_.get(); } void MediaInterfaceFactoryHolder::ConnectToMediaService() { @@ -38,10 +38,11 @@ ServiceManagerConnection::GetForProcess()->GetConnector(); connector->BindInterface(service_name_, &media_service); - media_service->CreateInterfaceFactory(MakeRequest(&interface_factory_ptr_), - create_interface_provider_cb_.Run()); + media_service->CreateInterfaceFactory( + interface_factory_remote_.BindNewPipeAndPassReceiver(), + create_interface_provider_cb_.Run()); - interface_factory_ptr_.set_connection_error_handler(base::BindOnce( + interface_factory_remote_.set_disconnect_handler(base::BindOnce( &MediaInterfaceFactoryHolder::OnMediaServiceConnectionError, base::Unretained(this))); } @@ -50,7 +51,7 @@ DVLOG(1) << __func__; DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - interface_factory_ptr_.reset(); + interface_factory_remote_.reset(); } } // namespace content
diff --git a/content/browser/media/media_interface_factory_holder.h b/content/browser/media/media_interface_factory_holder.h index cfb5e71..b87d56a 100644 --- a/content/browser/media/media_interface_factory_holder.h +++ b/content/browser/media/media_interface_factory_holder.h
@@ -11,6 +11,8 @@ #include "base/macros.h" #include "base/threading/thread_checker.h" #include "media/mojo/mojom/interface_factory.mojom.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/remote.h" #include "services/service_manager/public/mojom/interface_provider.mojom.h" namespace content { @@ -19,27 +21,27 @@ // Get() lazily connects to the media service specified by |service_name_|. class MediaInterfaceFactoryHolder { public: - using CreateInterfaceProviderCB = - base::RepeatingCallback<service_manager::mojom::InterfaceProviderPtr()>; + using CreateInterfaceProviderCB = base::RepeatingCallback< + mojo::PendingRemote<service_manager::mojom::InterfaceProvider>()>; MediaInterfaceFactoryHolder( const std::string& service_name, CreateInterfaceProviderCB create_interface_provider_cb); ~MediaInterfaceFactoryHolder(); - // Gets the MediaService |interface_factory_ptr_|. The returned pointer is + // Gets the MediaService |interface_factory_remote_|. The returned pointer is // still owned by this class. media::mojom::InterfaceFactory* Get(); private: void ConnectToMediaService(); - // Callback for connection error from |interface_factory_ptr_|. + // Callback for connection error from |interface_factory_remote_|. void OnMediaServiceConnectionError(); const std::string service_name_; CreateInterfaceProviderCB create_interface_provider_cb_; - media::mojom::InterfaceFactoryPtr interface_factory_ptr_; + mojo::Remote<media::mojom::InterfaceFactory> interface_factory_remote_; THREAD_CHECKER(thread_checker_);
diff --git a/content/browser/media/media_interface_proxy.cc b/content/browser/media/media_interface_proxy.cc index 2f9977a..892f2fc 100644 --- a/content/browser/media/media_interface_proxy.cc +++ b/content/browser/media/media_interface_proxy.cc
@@ -259,16 +259,16 @@ NOTREACHED() << "The CdmProxy should only be created by a CDM."; } -service_manager::mojom::InterfaceProviderPtr +mojo::PendingRemote<service_manager::mojom::InterfaceProvider> MediaInterfaceProxy::GetFrameServices(const base::Token& cdm_guid, const std::string& cdm_file_system_id) { // Register frame services. - service_manager::mojom::InterfaceProviderPtr interfaces; + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> interfaces; // TODO(xhwang): Replace this InterfaceProvider with a dedicated media host // interface. See http://crbug.com/660573 auto provider = std::make_unique<media::MediaInterfaceProvider>( - mojo::MakeRequest(&interfaces)); + interfaces.InitWithNewPipeAndPassReceiver()); #if BUILDFLAG(ENABLE_MOJO_CDM) // TODO(slan): Wrap these into a RenderFrame specific ProvisionFetcher impl.
diff --git a/content/browser/media/media_interface_proxy.h b/content/browser/media/media_interface_proxy.h index fe04fe38..07c1327 100644 --- a/content/browser/media/media_interface_proxy.h +++ b/content/browser/media/media_interface_proxy.h
@@ -21,6 +21,7 @@ #include "media/mojo/mojom/interface_factory.mojom.h" #include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" #include "services/service_manager/public/mojom/interface_provider.mojom.h" namespace media { @@ -83,9 +84,9 @@ // Gets services provided by the browser (at RenderFrameHost level) to the // mojo media (or CDM) service running remotely. |cdm_file_system_id| is // used to register the appropriate CdmStorage interface needed by the CDM. - service_manager::mojom::InterfaceProviderPtr GetFrameServices( - const base::Token& cdm_guid, - const std::string& cdm_file_system_id); + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> + GetFrameServices(const base::Token& cdm_guid, + const std::string& cdm_file_system_id); #if BUILDFLAG(ENABLE_LIBRARY_CDMS) // Gets a CdmFactory pointer for |key_system|. Returns null if unexpected
diff --git a/content/browser/media/video_decoder_proxy.cc b/content/browser/media/video_decoder_proxy.cc index 84fbb79..f6bead6 100644 --- a/content/browser/media/video_decoder_proxy.cc +++ b/content/browser/media/video_decoder_proxy.cc
@@ -80,16 +80,16 @@ media::mojom::InterfaceFactory* VideoDecoderProxy::GetMediaInterfaceFactory() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - if (!interface_factory_ptr_) + if (!interface_factory_remote_) ConnectToMediaService(); - return interface_factory_ptr_.get(); + return interface_factory_remote_.get(); } void VideoDecoderProxy::ConnectToMediaService() { DVLOG(1) << __func__; DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - DCHECK(!interface_factory_ptr_); + DCHECK(!interface_factory_remote_); media::mojom::MediaServicePtr media_service; // TODO(slan): Use the BrowserContext Connector instead. @@ -97,12 +97,13 @@ GetSystemConnector()->BindInterface(media::mojom::kMediaServiceName, &media_service); - // TODO(sandersd): Do we need to bind an empty |interfaces| implementation? - service_manager::mojom::InterfaceProviderPtr interfaces; - media_service->CreateInterfaceFactory(MakeRequest(&interface_factory_ptr_), - std::move(interfaces)); + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> interfaces; + ignore_result(interfaces.InitWithNewPipeAndPassReceiver()); + media_service->CreateInterfaceFactory( + interface_factory_remote_.BindNewPipeAndPassReceiver(), + std::move(interfaces)); - interface_factory_ptr_.set_connection_error_handler( + interface_factory_remote_.set_disconnect_handler( base::BindOnce(&VideoDecoderProxy::OnMediaServiceConnectionError, base::Unretained(this))); } @@ -111,7 +112,7 @@ DVLOG(1) << __func__; DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - interface_factory_ptr_.reset(); + interface_factory_remote_.reset(); } } // namespace content
diff --git a/content/browser/media/video_decoder_proxy.h b/content/browser/media/video_decoder_proxy.h index 5f51b05..87b039d 100644 --- a/content/browser/media/video_decoder_proxy.h +++ b/content/browser/media/video_decoder_proxy.h
@@ -11,10 +11,13 @@ #include "base/threading/thread_checker.h" #include "base/unguessable_token.h" #include "build/build_config.h" +#include "content/common/content_export.h" #include "media/mojo/buildflags.h" #include "media/mojo/mojom/interface_factory.mojom.h" #include "mojo/public/cpp/bindings/binding_set.h" #include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/remote.h" namespace content { @@ -22,7 +25,7 @@ // RenderProcessHostImpl. Unlike MediaInterfaceProxy, only // CreateVideoDecoder() is implemented. This allows WebRTC to create // MojoVideoDecoder instances without a RenderFrame. -class VideoDecoderProxy : public media::mojom::InterfaceFactory { +class CONTENT_EXPORT VideoDecoderProxy : public media::mojom::InterfaceFactory { public: VideoDecoderProxy(); ~VideoDecoderProxy() final; @@ -66,7 +69,7 @@ void OnMediaServiceConnectionError(); // Connection to the remote media InterfaceFactory. - media::mojom::InterfaceFactoryPtr interface_factory_ptr_; + mojo::Remote<media::mojom::InterfaceFactory> interface_factory_remote_; // Connections to the renderer. mojo::BindingSet<media::mojom::InterfaceFactory> bindings_;
diff --git a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc index 8d3f8d2a..8bb51c9c 100644 --- a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc +++ b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc
@@ -12,6 +12,7 @@ #include "content/browser/bad_message.h" #include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/storage_partition_impl.h" +#include "mojo/public/cpp/bindings/pending_remote.h" #include "net/base/net_errors.h" #include "services/network/public/cpp/p2p_param_traits.h" @@ -21,7 +22,7 @@ namespace content { P2PSocketDispatcherHost::P2PSocketDispatcherHost(int render_process_id) - : render_process_id_(render_process_id), binding_(this) {} + : render_process_id_(render_process_id) {} P2PSocketDispatcherHost::~P2PSocketDispatcherHost() {} @@ -70,10 +71,8 @@ // In case the renderer was connected previously but the network process // crashed. - binding_.Close(); - network::mojom::P2PTrustedSocketManagerClientPtr - trusted_socket_manager_client; - binding_.Bind(mojo::MakeRequest(&trusted_socket_manager_client)); + receiver_.reset(); + auto trusted_socket_manager_client = receiver_.BindNewPipeAndPassRemote(); rph->GetStoragePartition()->GetNetworkContext()->CreateP2PSocketManager( std::move(trusted_socket_manager_client),
diff --git a/content/browser/renderer_host/p2p/socket_dispatcher_host.h b/content/browser/renderer_host/p2p/socket_dispatcher_host.h index 54d3f86..5c37ae6 100644 --- a/content/browser/renderer_host/p2p/socket_dispatcher_host.h +++ b/content/browser/renderer_host/p2p/socket_dispatcher_host.h
@@ -16,7 +16,7 @@ #include "base/memory/weak_ptr.h" #include "base/sequenced_task_runner.h" #include "content/public/browser/render_process_host.h" -#include "mojo/public/cpp/bindings/binding.h" +#include "mojo/public/cpp/bindings/receiver.h" #include "services/network/public/mojom/p2p.mojom.h" #include "services/network/public/mojom/p2p_trusted.mojom.h" @@ -55,7 +55,7 @@ bool dump_outgoing_rtp_packet_ = false; RenderProcessHost::WebRtcRtpPacketCallback packet_callback_; - mojo::Binding<network::mojom::P2PTrustedSocketManagerClient> binding_; + mojo::Receiver<network::mojom::P2PTrustedSocketManagerClient> receiver_{this}; network::mojom::P2PTrustedSocketManagerPtr trusted_socket_manager_; network::mojom::P2PNetworkNotificationClientPtr network_notification_client_;
diff --git a/content/browser/worker_host/dedicated_worker_host.cc b/content/browser/worker_host/dedicated_worker_host.cc index 00aa819..28d1b8a 100644 --- a/content/browser/worker_host/dedicated_worker_host.cc +++ b/content/browser/worker_host/dedicated_worker_host.cc
@@ -26,7 +26,6 @@ #include "content/public/common/network_service_util.h" #include "mojo/public/cpp/bindings/pending_associated_remote.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" -#include "mojo/public/cpp/bindings/strong_binding.h" #include "mojo/public/cpp/system/message_pipe.h" #include "net/base/network_isolation_key.h" #include "third_party/blink/public/common/features.h" @@ -594,10 +593,10 @@ creator_process_id_, ancestor_render_frame_id_, creator_render_frame_id_, origin, std::move(host_receiver)); host->BindBrowserInterfaceBrokerReceiver(std::move(broker_receiver)); - mojo::MakeStrongBinding(std::move(host), - FilterRendererExposedInterfaces( - blink::mojom::kNavigation_DedicatedWorkerSpec, - creator_process_id_, std::move(request))); + mojo::MakeSelfOwnedReceiver( + std::move(host), FilterRendererExposedInterfaces( + blink::mojom::kNavigation_DedicatedWorkerSpec, + creator_process_id_, std::move(request))); } // PlzDedicatedWorker: @@ -634,7 +633,7 @@ broker.InitWithNewPipeAndPassReceiver()); auto* host_raw = host.get(); service_manager::mojom::InterfaceProviderPtr interface_provider; - mojo::MakeStrongBinding( + mojo::MakeSelfOwnedReceiver( std::move(host), FilterRendererExposedInterfaces( blink::mojom::kNavigation_DedicatedWorkerSpec, creator_process_id_,
diff --git a/content/child/webthemeengine_impl_default_browsertest.cc b/content/child/webthemeengine_impl_default_browsertest.cc index 0430bbc0..e4eba045 100644 --- a/content/child/webthemeengine_impl_default_browsertest.cc +++ b/content/child/webthemeengine_impl_default_browsertest.cc
@@ -32,6 +32,7 @@ "<body>" "<div id='activeBorder' style='color: ActiveBorder'>ActiveBorder</div>" "<div id='activeCaption' style='color: ActiveCaption'>ActiveCaption</div>" + "<div id='activeText' style='color: ActiveText'>ActiveText</div>" "<div id='appWorkspace' style='color: AppWorkspace'>AppWorkspace</div>" "<div id='background' style='color: Background'>Background</div>" "<div id='buttonFace' style='color: ButtonFace'>ButtonFace</div>" @@ -40,6 +41,8 @@ "<div id='buttonShadow' style='color: ButtonShadow'>ButtonShadow</div>" "<div id='buttonText' style='color: ButtonText'>ButtonText</div>" "<div id='captionText' style='color: CaptionText'>CaptionText</div>" + "<div id='field' style='color: Field'>Field</div>" + "<div id='fieldText' style='color: FieldText'>FieldText</div>" "<div id='grayText' style='color: GrayText'>GrayText</div>" "<div id='highlight' style='color: Highlight'>Highlight</div>" "<div id='highlightText' style='color: HighlightText'>HighlightText</div>" @@ -73,6 +76,7 @@ std::vector<std::string> ids = {"activeBorder", "activeCaption", + "activeText", "appWorkspace", "background", "buttonFace", @@ -80,6 +84,8 @@ "buttonShadow", "buttonText", "captionText", + "field", + "fieldText", "grayText", "highlight", "highlightText", @@ -104,9 +110,10 @@ std::vector<std::string> expected_colors; if (base::win::GetVersion() <= base::win::Version::WIN8_1) { expected_colors = { - "rgb(255, 255, 255)", "rgb(204, 204, 204)", "rgb(255, 255, 255)", - "rgb(99, 99, 206)", "rgb(240, 240, 240)", "rgb(221, 221, 221)", - "rgb(136, 136, 136)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", + "rgb(255, 255, 255)", "rgb(204, 204, 204)", "rgb(0, 0, 0)", + "rgb(255, 255, 255)", "rgb(99, 99, 206)", "rgb(240, 240, 240)", + "rgb(221, 221, 221)", "rgb(136, 136, 136)", "rgb(0, 0, 0)", + "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(109, 109, 109)", "rgb(51, 153, 255)", "rgb(255, 255, 255)", "rgb(255, 255, 255)", "rgb(255, 255, 255)", "rgb(127, 127, 127)", "rgb(251, 252, 197)", "rgb(0, 0, 0)", "rgb(0, 102, 204)", @@ -116,9 +123,10 @@ "rgb(255, 255, 255)", "rgb(204, 204, 204)", "rgb(0, 0, 0)"}; } else { expected_colors = { - "rgb(255, 255, 255)", "rgb(204, 204, 204)", "rgb(255, 255, 255)", - "rgb(99, 99, 206)", "rgb(240, 240, 240)", "rgb(221, 221, 221)", - "rgb(136, 136, 136)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", + "rgb(255, 255, 255)", "rgb(204, 204, 204)", "rgb(0, 0, 0)", + "rgb(255, 255, 255)", "rgb(99, 99, 206)", "rgb(240, 240, 240)", + "rgb(221, 221, 221)", "rgb(136, 136, 136)", "rgb(0, 0, 0)", + "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(0, 0, 0)", "rgb(109, 109, 109)", "rgb(0, 120, 215)", "rgb(255, 255, 255)", "rgb(255, 255, 255)", "rgb(255, 255, 255)", "rgb(127, 127, 127)", "rgb(251, 252, 197)", "rgb(0, 0, 0)", "rgb(0, 102, 204)",
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h index 0b25355..77c4e0a 100644 --- a/content/common/frame_messages.h +++ b/content/common/frame_messages.h
@@ -731,12 +731,6 @@ // RenderFrame has completed loading. IPC_MESSAGE_ROUTED0(FrameMsg_DidStopLoading) -// Add message to the frame console. -IPC_MESSAGE_ROUTED3(FrameMsg_AddMessageToConsole, - blink::mojom::ConsoleMessageLevel /* level */, - std::string /* message */, - bool /* discard_duplicates */) - // TODO(https://crbug.com/995428): Deprecated. // Tells the renderer to reload the frame. IPC_MESSAGE_ROUTED0(FrameMsg_Reload) @@ -784,11 +778,6 @@ IPC_MESSAGE_ROUTED1(FrameMsg_EnforceInsecureRequestPolicy, blink::WebInsecureRequestPolicy) -// Update a proxy's replicated set for enforcement of insecure navigations. -// Used when the frame's set is changed in another process. -IPC_MESSAGE_ROUTED1(FrameMsg_EnforceInsecureNavigationsSet, - std::vector<uint32_t> /* set */) - // Update a proxy's replicated origin. Used when the frame is navigated to a // new origin. IPC_MESSAGE_ROUTED2(FrameMsg_DidUpdateOrigin,
diff --git a/content/public/test/fake_local_frame.cc b/content/public/test/fake_local_frame.cc new file mode 100644 index 0000000..0149f8e --- /dev/null +++ b/content/public/test/fake_local_frame.cc
@@ -0,0 +1,42 @@ +// Copyright 2019 The Chromium 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/public/test/fake_local_frame.h" + +namespace content { + +FakeLocalFrame::FakeLocalFrame() {} + +FakeLocalFrame::~FakeLocalFrame() {} + +void FakeLocalFrame::Init(blink::AssociatedInterfaceProvider* provider) { + provider->OverrideBinderForTesting( + blink::mojom::LocalFrame::Name_, + base::BindRepeating(&FakeLocalFrame::BindFrameHostReceiver, + base::Unretained(this))); +} + +void FakeLocalFrame::GetTextSurroundingSelection( + uint32_t max_length, + GetTextSurroundingSelectionCallback callback) { + std::move(callback).Run(base::string16(), 0, 0); +} + +void FakeLocalFrame::SendInterventionReport(const std::string& id, + const std::string& message) {} + +void FakeLocalFrame::NotifyUserActivation() {} + +void FakeLocalFrame::AddMessageToConsole( + blink::mojom::ConsoleMessageLevel level, + const std::string& message, + bool discard_duplicates) {} + +void FakeLocalFrame::BindFrameHostReceiver( + mojo::ScopedInterfaceEndpointHandle handle) { + receiver_.Bind(mojo::PendingAssociatedReceiver<blink::mojom::LocalFrame>( + std::move(handle))); +} + +} // namespace content
diff --git a/content/public/test/fake_local_frame.h b/content/public/test/fake_local_frame.h new file mode 100644 index 0000000..28b0740 --- /dev/null +++ b/content/public/test/fake_local_frame.h
@@ -0,0 +1,44 @@ +// Copyright 2019 The Chromium 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_PUBLIC_TEST_FAKE_LOCAL_FRAME_H_ +#define CONTENT_PUBLIC_TEST_FAKE_LOCAL_FRAME_H_ + +#include "mojo/public/cpp/bindings/associated_receiver_set.h" +#include "mojo/public/cpp/bindings/pending_associated_receiver.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" +#include "third_party/blink/public/mojom/frame/frame.mojom.h" + +namespace content { + +// This class implements a LocalFrame that can be attached to the +// AssociatedInterfaceProvider so that it will be called when the browser +// normally sends a request to the renderer process. But for a unittest +// setup it can be intercepted by this class. +class FakeLocalFrame : public blink::mojom::LocalFrame { + public: + FakeLocalFrame(); + ~FakeLocalFrame() override; + + void Init(blink::AssociatedInterfaceProvider* provider); + + void GetTextSurroundingSelection( + uint32_t max_length, + GetTextSurroundingSelectionCallback callback) override; + void SendInterventionReport(const std::string& id, + const std::string& message) override; + void NotifyUserActivation() override; + void AddMessageToConsole(blink::mojom::ConsoleMessageLevel level, + const std::string& message, + bool discard_duplicates) override; + + private: + void BindFrameHostReceiver(mojo::ScopedInterfaceEndpointHandle handle); + + mojo::AssociatedReceiver<blink::mojom::LocalFrame> receiver_{this}; +}; + +} // namespace content + +#endif // CONTENT_PUBLIC_TEST_FAKE_LOCAL_FRAME_H_
diff --git a/content/renderer/media/android/flinging_renderer_client.cc b/content/renderer/media/android/flinging_renderer_client.cc index c40ae7b..86a0c200 100644 --- a/content/renderer/media/android/flinging_renderer_client.cc +++ b/content/renderer/media/android/flinging_renderer_client.cc
@@ -25,10 +25,9 @@ FlingingRendererClient::~FlingingRendererClient() = default; -void FlingingRendererClient::Initialize( - media::MediaResource* media_resource, - media::RendererClient* client, - const media::PipelineStatusCB& init_cb) { +void FlingingRendererClient::Initialize(media::MediaResource* media_resource, + media::RendererClient* client, + media::PipelineStatusCallback init_cb) { DCHECK(media_task_runner_->BelongsToCurrentThread()); client_ = client; @@ -36,7 +35,7 @@ client_extension_binding_.Bind( std::move(delayed_bind_client_extension_request_), media_task_runner_); - MojoRendererWrapper::Initialize(media_resource, client, init_cb); + MojoRendererWrapper::Initialize(media_resource, client, std::move(init_cb)); } void FlingingRendererClient::OnRemotePlayStateChange(
diff --git a/content/renderer/media/android/flinging_renderer_client.h b/content/renderer/media/android/flinging_renderer_client.h index 9b762f0..5d0b1147 100644 --- a/content/renderer/media/android/flinging_renderer_client.h +++ b/content/renderer/media/android/flinging_renderer_client.h
@@ -43,7 +43,7 @@ // media::MojoRendererWrapper overrides. void Initialize(media::MediaResource* media_resource, media::RendererClient* client, - const media::PipelineStatusCB& init_cb) override; + media::PipelineStatusCallback init_cb) override; // media::mojom::FlingingRendererClientExtension implementation void OnRemotePlayStateChange(media::MediaStatus::State state) override;
diff --git a/content/renderer/media/android/media_player_renderer_client.cc b/content/renderer/media/android/media_player_renderer_client.cc index 9a12c93..359aee3d 100644 --- a/content/renderer/media/android/media_player_renderer_client.cc +++ b/content/renderer/media/android/media_player_renderer_client.cc
@@ -41,7 +41,7 @@ void MediaPlayerRendererClient::Initialize( media::MediaResource* media_resource, media::RendererClient* client, - const media::PipelineStatusCB& init_cb) { + media::PipelineStatusCallback init_cb) { DCHECK(media_task_runner_->BelongsToCurrentThread()); DCHECK(!init_cb_); @@ -54,7 +54,7 @@ media_resource_ = media_resource; client_ = client; - init_cb_ = init_cb; + init_cb_ = std::move(init_cb); // Initialize the StreamTexture using a 1x1 texture because we do not have // any size information from the MediaPlayer yet.
diff --git a/content/renderer/media/android/media_player_renderer_client.h b/content/renderer/media/android/media_player_renderer_client.h index 7a11e23..ee75a6c 100644 --- a/content/renderer/media/android/media_player_renderer_client.h +++ b/content/renderer/media/android/media_player_renderer_client.h
@@ -60,7 +60,7 @@ // and do not support encrypted media. void Initialize(media::MediaResource* media_resource, media::RendererClient* client, - const media::PipelineStatusCB& init_cb) override; + media::PipelineStatusCallback init_cb) override; void SetCdm(media::CdmContext* cdm_context, const media::CdmAttachedCB& cdm_attached_cb) override; @@ -97,7 +97,7 @@ // VideoFrames to |sink_| on the right thread. scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; - media::PipelineStatusCB init_cb_; + media::PipelineStatusCallback init_cb_; // This class is constructed on the main task runner, and used on // |media_task_runner_|. These member are used to delay calls to Bind() for
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 5afb45b..cbfec3c0 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -2262,7 +2262,6 @@ #endif IPC_MESSAGE_HANDLER(FrameMsg_CopyImageAt, OnCopyImageAt) IPC_MESSAGE_HANDLER(FrameMsg_SaveImageAt, OnSaveImageAt) - IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole) IPC_MESSAGE_HANDLER(FrameMsg_VisualStateRequest, OnVisualStateRequest) IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) @@ -2587,13 +2586,6 @@ frame_->SaveImageAt(WebPoint(viewport_position.x, viewport_position.y)); } -void RenderFrameImpl::OnAddMessageToConsole( - blink::mojom::ConsoleMessageLevel level, - const std::string& message, - bool discard_duplicates) { - AddMessageToConsoleImpl(level, message, discard_duplicates); -} - void RenderFrameImpl::JavaScriptExecuteRequest( const base::string16& javascript, bool wants_result,
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h index 215722a..a457885 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h
@@ -1127,9 +1127,6 @@ void OnSelectRange(const gfx::Point& base, const gfx::Point& extent); void OnCopyImageAt(int x, int y); void OnSaveImageAt(int x, int y); - void OnAddMessageToConsole(blink::mojom::ConsoleMessageLevel level, - const std::string& message, - bool discard_duplicates); void OnVisualStateRequest(uint64_t key); // TODO(https://crbug.com/995428): Deprecated. void OnReload();
diff --git a/content/renderer/render_frame_proxy.cc b/content/renderer/render_frame_proxy.cc index ed3d15b..754eb880 100644 --- a/content/renderer/render_frame_proxy.cc +++ b/content/renderer/render_frame_proxy.cc
@@ -414,8 +414,6 @@ OnAddContentSecurityPolicies) IPC_MESSAGE_HANDLER(FrameMsg_EnforceInsecureRequestPolicy, OnEnforceInsecureRequestPolicy) - IPC_MESSAGE_HANDLER(FrameMsg_EnforceInsecureNavigationsSet, - OnEnforceInsecureNavigationsSet) IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, OnSetFrameOwnerProperties) IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateOrigin, OnDidUpdateOrigin) @@ -535,11 +533,6 @@ web_frame_->SetReplicatedInsecureRequestPolicy(policy); } -void RenderFrameProxy::OnEnforceInsecureNavigationsSet( - const std::vector<uint32_t>& set) { - web_frame_->SetReplicatedInsecureNavigationsSet(set); -} - void RenderFrameProxy::OnSetFrameOwnerProperties( const FrameOwnerProperties& properties) { web_frame_->SetFrameOwnerProperties(
diff --git a/content/renderer/render_frame_proxy.h b/content/renderer/render_frame_proxy.h index 3c76c01..1be25440 100644 --- a/content/renderer/render_frame_proxy.h +++ b/content/renderer/render_frame_proxy.h
@@ -249,7 +249,6 @@ void OnAddContentSecurityPolicies( const std::vector<ContentSecurityPolicyHeader>& header); void OnEnforceInsecureRequestPolicy(blink::WebInsecureRequestPolicy policy); - void OnEnforceInsecureNavigationsSet(const std::vector<uint32_t>& set); void OnSetFrameOwnerProperties(const FrameOwnerProperties& properties); void OnDidUpdateOrigin(const url::Origin& origin, bool is_potentially_trustworthy_unique_origin);
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 5abb5b4..c2b541ca 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -127,6 +127,8 @@ "../public/test/dump_accessibility_test_helper.h", "../public/test/fake_download_item.cc", "../public/test/fake_download_item.h", + "../public/test/fake_local_frame.cc", + "../public/test/fake_local_frame.h", "../public/test/fake_service_worker_context.cc", "../public/test/fake_service_worker_context.h", "../public/test/fake_speech_recognition_manager.cc",
diff --git a/content/test/data/accessibility/html/link-inside-heading-expected-android.txt b/content/test/data/accessibility/html/link-inside-heading-expected-android.txt index a7012ec..ae3560be 100644 --- a/content/test/data/accessibility/html/link-inside-heading-expected-android.txt +++ b/content/test/data/accessibility/html/link-inside-heading-expected-android.txt
@@ -1,3 +1,3 @@ android.webkit.WebView focusable focused scrollable -++android.view.View role_description='heading 1' heading name='Link In Heading' -++++android.view.View role_description='link' clickable focusable heading link name='Link In Heading' \ No newline at end of file +++android.view.View role_description='heading 1 link' clickable heading name='Link In Heading' +++++android.view.View role_description='heading 1 link' clickable focusable heading link name='Link In Heading'
diff --git a/device/vr/BUILD.gn b/device/vr/BUILD.gn index effdd478..6aa71eb 100644 --- a/device/vr/BUILD.gn +++ b/device/vr/BUILD.gn
@@ -93,18 +93,6 @@ configs += [ "//third_party/gvr-android-sdk:libgvr_config" ] } - if (!is_android) { - sources += [ - "isolated_gamepad_data_fetcher.cc", - "isolated_gamepad_data_fetcher.h", - ] - - deps += [ - "//device/gamepad", - "//device/gamepad/public/cpp:shared_with_blink", - ] - } - if (enable_openvr) { deps += [ "//third_party/openvr:openvr" ] sources += [
diff --git a/device/vr/isolated_gamepad_data_fetcher.cc b/device/vr/isolated_gamepad_data_fetcher.cc deleted file mode 100644 index d58d3189..0000000 --- a/device/vr/isolated_gamepad_data_fetcher.cc +++ /dev/null
@@ -1,305 +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 "device/vr/isolated_gamepad_data_fetcher.h" - -#include "base/bind.h" -#include "base/strings/utf_string_conversions.h" -#include "base/trace_event/trace_event.h" -#include "build/buildflag.h" -#include "device/vr/buildflags/buildflags.h" -#include "device/vr/vr_device.h" - -namespace device { - -namespace { - -bool IsValidDeviceId(device::mojom::XRDeviceId id) { -#if BUILDFLAG(ENABLE_OPENVR) - if (id == device::mojom::XRDeviceId::OPENVR_DEVICE_ID) - return true; -#endif - -#if BUILDFLAG(ENABLE_OCULUS_VR) - if (id == device::mojom::XRDeviceId::OCULUS_DEVICE_ID) - return true; -#endif - -#if BUILDFLAG(ENABLE_WINDOWS_MR) - if (id == device::mojom::XRDeviceId::WINDOWS_MIXED_REALITY_ID) - return true; -#endif - -#if BUILDFLAG(ENABLE_OPENXR) - if (id == device::mojom::XRDeviceId::OPENXR_DEVICE_ID) - return true; -#endif - - return false; -} - -GamepadSource GamepadSourceFromDeviceId(device::mojom::XRDeviceId id) { - DCHECK(IsValidDeviceId(id)); - -#if BUILDFLAG(ENABLE_OPENVR) - if (id == device::mojom::XRDeviceId::OPENVR_DEVICE_ID) - return GAMEPAD_SOURCE_OPENVR; -#endif - -#if BUILDFLAG(ENABLE_OCULUS_VR) - if (id == device::mojom::XRDeviceId::OCULUS_DEVICE_ID) - return GAMEPAD_SOURCE_OCULUS; -#endif - -#if BUILDFLAG(ENABLE_WINDOWS_MR) - if (id == device::mojom::XRDeviceId::WINDOWS_MIXED_REALITY_ID) - return GAMEPAD_SOURCE_WIN_MR; -#endif - -#if BUILDFLAG(ENABLE_OPENXR) - if (id == device::mojom::XRDeviceId::OPENXR_DEVICE_ID) - return GAMEPAD_SOURCE_OPENXR; -#endif - - NOTREACHED(); - return GAMEPAD_SOURCE_NONE; -} - -} // namespace - -IsolatedGamepadDataFetcher::Factory::Factory( - device::mojom::XRDeviceId display_id, - mojo::PendingRemote<device::mojom::IsolatedXRGamepadProviderFactory> - factory) - : display_id_(display_id), factory_(std::move(factory)) {} - -IsolatedGamepadDataFetcher::Factory::~Factory() {} - -std::unique_ptr<GamepadDataFetcher> -IsolatedGamepadDataFetcher::Factory::CreateDataFetcher() { - mojo::PendingRemote<device::mojom::IsolatedXRGamepadProvider> provider; - factory_->GetIsolatedXRGamepadProvider( - provider.InitWithNewPipeAndPassReceiver()); - return std::make_unique<IsolatedGamepadDataFetcher>(display_id_, - std::move(provider)); -} - -GamepadSource IsolatedGamepadDataFetcher::Factory::source() { - return GamepadSourceFromDeviceId(display_id_); -} - -IsolatedGamepadDataFetcher::IsolatedGamepadDataFetcher( - device::mojom::XRDeviceId display_id, - mojo::PendingRemote<device::mojom::IsolatedXRGamepadProvider> provider) - : display_id_(display_id) { - // We bind provider_ on the poling thread, but we're created on the main UI - // thread. - pending_provider_ = std::move(provider); -} - -IsolatedGamepadDataFetcher::~IsolatedGamepadDataFetcher() = default; - -GamepadSource IsolatedGamepadDataFetcher::source() { - return GamepadSourceFromDeviceId(display_id_); -} - -void IsolatedGamepadDataFetcher::OnDataUpdated( - device::mojom::XRGamepadDataPtr data) { - data_ = std::move(data); - have_outstanding_request_ = false; -} - -GamepadPose GamepadPoseFromXRPose(device::mojom::VRPose* pose) { - GamepadPose ret = {}; - ret.not_null = pose; - if (!pose) { - return ret; - } - - if (pose->position) { - ret.position.not_null = true; - ret.position.x = pose->position->x(); - ret.position.y = pose->position->y(); - ret.position.z = pose->position->z(); - } - - if (pose->orientation) { - ret.orientation.not_null = true; - ret.orientation.x = pose->orientation->x(); - ret.orientation.y = pose->orientation->y(); - ret.orientation.z = pose->orientation->z(); - ret.orientation.w = pose->orientation->w(); - } - - if (pose->angular_velocity) { - ret.angular_velocity.not_null = true; - ret.angular_velocity.x = pose->angular_velocity->x(); - ret.angular_velocity.y = pose->angular_velocity->y(); - ret.angular_velocity.z = pose->angular_velocity->z(); - } - - if (pose->linear_velocity) { - ret.linear_velocity.not_null = true; - ret.linear_velocity.x = pose->linear_velocity->x(); - ret.linear_velocity.y = pose->linear_velocity->y(); - ret.linear_velocity.z = pose->linear_velocity->z(); - } - - if (pose->angular_acceleration) { - ret.angular_acceleration.not_null = true; - ret.angular_acceleration.x = pose->angular_acceleration->x(); - ret.angular_acceleration.y = pose->angular_acceleration->y(); - ret.angular_acceleration.z = pose->angular_acceleration->z(); - } - - if (pose->linear_acceleration) { - ret.linear_acceleration.not_null = true; - ret.linear_acceleration.x = pose->linear_acceleration->x(); - ret.linear_acceleration.y = pose->linear_acceleration->y(); - ret.linear_acceleration.z = pose->linear_acceleration->z(); - } - - return ret; -} - -void IsolatedGamepadDataFetcher::GetGamepadData(bool devices_changed_hint) { - if (!provider_ && pending_provider_) { - provider_.Bind(std::move(pending_provider_)); - } - - // If we don't have a provider, we can't give out data. - if (!provider_) { - return; - } - - // Request new data. - if (!have_outstanding_request_) { - have_outstanding_request_ = true; - provider_->RequestUpdate(base::BindOnce( - &IsolatedGamepadDataFetcher::OnDataUpdated, base::Unretained(this))); - } - - // If we have no data to give out, nothing to do. - if (!data_) { - return; - } - - // Keep track of gamepads that go missing. - std::set<unsigned int> seen_gamepads; - - // Give out data_, but we need to translate it. - for (size_t i = 0; i < data_->gamepads.size(); ++i) { - auto& source = data_->gamepads[i]; - PadState* state = GetPadState(source->controller_id); - if (!state) - continue; - Gamepad& dest = state->data; - dest.connected = true; - - seen_gamepads.insert(source->controller_id); - dest.timestamp = TimeInMicroseconds(source->timestamp); - // WebVR did not support mapping. - dest.mapping = GamepadMapping::kNone; - dest.pose = GamepadPoseFromXRPose(source->pose.get()); - dest.pose.has_position = source->can_provide_position; - dest.pose.has_orientation = source->can_provide_orientation; - dest.hand = source->hand == device::mojom::XRHandedness::LEFT - ? GamepadHand::kLeft - : source->hand == device::mojom::XRHandedness::RIGHT - ? GamepadHand::kRight - : GamepadHand::kNone; - dest.display_id = static_cast<unsigned int>(display_id_); - dest.is_xr = true; - - dest.axes_length = source->axes.size(); - for (size_t j = 0; j < source->axes.size(); ++j) { - dest.axes[j] = source->axes[j]; - } - - dest.buttons_length = source->buttons.size(); - for (size_t j = 0; j < source->buttons.size(); ++j) { - dest.buttons[j] = - GamepadButton(source->buttons[j]->pressed, - source->buttons[j]->touched, source->buttons[j]->value); - } - - // Gamepad extensions refer to display_id, corresponding to the WebVR - // VRDisplay's dipslayId property. - // As WebVR is deprecated, and we only hand out a maximum of one "display" - // per runtime, we use the XRDeviceId now to associate the controller with - // a headset. This doesn't change behavior, but the device/display naming - // could be confusing here. - if (this->source() == GAMEPAD_SOURCE_OPENXR) { - dest.SetID(base::UTF8ToUTF16("OpenXR Controller")); - } else if (this->source() == GAMEPAD_SOURCE_OPENVR) { - dest.SetID(base::UTF8ToUTF16("OpenVR Gamepad")); - } else if (this->source() == GAMEPAD_SOURCE_OCULUS) { - if (dest.hand == GamepadHand::kLeft) { - dest.SetID(base::UTF8ToUTF16("Oculus Touch (Left)")); - } else if (dest.hand == GamepadHand::kRight) { - dest.SetID(base::UTF8ToUTF16("Oculus Touch (Right)")); - } else { - dest.SetID(base::UTF8ToUTF16("Oculus Remote")); - } - } else if (this->source() == GAMEPAD_SOURCE_WIN_MR) { - // For compatibility with Edge and existing libraries, Win MR may plumb - // an input_state and corresponding gamepad up via the Pose for the - // purposes of exposing the Gamepad ID that should be used. - // If it is present, use that, otherwise, just use the same prefix as - // Edge uses. - if (source->pose && source->pose->input_state && - source->pose->input_state.value().size() > 0 && - source->pose->input_state.value()[0]->gamepad) { - Gamepad id_gamepad = - source->pose->input_state.value()[0]->gamepad.value(); - dest.SetID(id_gamepad.id); - } else { - dest.SetID(base::UTF8ToUTF16( - "Spatial Controller (Spatial Interaction Source) 0000-0000")); - } - } - - TRACE_COUNTER1( - "input", "XR gamepad sample age (ms)", - (base::TimeTicks::Now() - source->timestamp).InMilliseconds()); - } - - // Remove any gamepads that aren't connected. - for (auto id : active_gamepads_) { - if (seen_gamepads.find(id) == seen_gamepads.end()) { - PadState* state = GetPadState(id); - if (state) { - state->data.connected = false; - } - } - } - active_gamepads_ = std::move(seen_gamepads); -} - -void IsolatedGamepadDataFetcher::PauseHint(bool paused) {} - -void IsolatedGamepadDataFetcher::OnAddedToProvider() {} - -void IsolatedGamepadDataFetcher::Factory::RemoveGamepad( - device::mojom::XRDeviceId id) { - if (!IsValidDeviceId(id)) - return; - - GamepadDataFetcherManager::GetInstance()->RemoveSourceFactory( - GamepadSourceFromDeviceId(id)); -} - -void IsolatedGamepadDataFetcher::Factory::AddGamepad( - device::mojom::XRDeviceId device_id, - mojo::PendingRemote<device::mojom::IsolatedXRGamepadProviderFactory> - gamepad_factory) { - if (!IsValidDeviceId(device_id)) - return; - - device::GamepadDataFetcherManager::GetInstance()->AddFactory( - new device::IsolatedGamepadDataFetcher::Factory( - device_id, std::move(gamepad_factory))); -} - -} // namespace device
diff --git a/device/vr/isolated_gamepad_data_fetcher.h b/device/vr/isolated_gamepad_data_fetcher.h deleted file mode 100644 index cf5e1af..0000000 --- a/device/vr/isolated_gamepad_data_fetcher.h +++ /dev/null
@@ -1,65 +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 DEVICE_VR_ISOLATED_GAMEPAD_DATA_FETCHER_H_ -#define DEVICE_VR_ISOLATED_GAMEPAD_DATA_FETCHER_H_ - -#include "device/gamepad/gamepad_data_fetcher.h" -#include "device/vr/public/mojom/isolated_xr_service.mojom.h" -#include "device/vr/vr_device.h" -#include "mojo/public/cpp/bindings/pending_remote.h" -#include "mojo/public/cpp/bindings/remote.h" - -namespace device { - -class IsolatedGamepadDataFetcher : public GamepadDataFetcher { - public: - class DEVICE_VR_EXPORT Factory : public GamepadDataFetcherFactory { - public: - Factory(device::mojom::XRDeviceId display_id, - mojo::PendingRemote<device::mojom::IsolatedXRGamepadProviderFactory> - factory); - ~Factory() override; - std::unique_ptr<GamepadDataFetcher> CreateDataFetcher() override; - GamepadSource source() override; - - static void AddGamepad( - device::mojom::XRDeviceId device_id, - mojo::PendingRemote<device::mojom::IsolatedXRGamepadProviderFactory> - gamepad_factory); - static void RemoveGamepad(device::mojom::XRDeviceId device_id); - - private: - device::mojom::XRDeviceId display_id_; - mojo::Remote<device::mojom::IsolatedXRGamepadProviderFactory> factory_; - }; - - IsolatedGamepadDataFetcher( - device::mojom::XRDeviceId display_id, - mojo::PendingRemote<device::mojom::IsolatedXRGamepadProvider> provider); - ~IsolatedGamepadDataFetcher() override; - - GamepadSource source() override; - - void GetGamepadData(bool devices_changed_hint) override; - void PauseHint(bool paused) override; - void OnAddedToProvider() override; - - void OnDataUpdated(device::mojom::XRGamepadDataPtr data); - - private: - device::mojom::XRDeviceId display_id_; - bool have_outstanding_request_ = false; - std::set<unsigned int> active_gamepads_; - device::mojom::XRGamepadDataPtr data_; - mojo::Remote<device::mojom::IsolatedXRGamepadProvider> - provider_; // Bound on the polling thread. - mojo::PendingRemote<device::mojom::IsolatedXRGamepadProvider> - pending_provider_; // Received on the UI thread, bound when polled. - - DISALLOW_COPY_AND_ASSIGN(IsolatedGamepadDataFetcher); -}; - -} // namespace device -#endif // DEVICE_VR_ISOLATED_GAMEPAD_DATA_FETCHER_H_
diff --git a/device/vr/openxr/openxr_api_wrapper.cc b/device/vr/openxr/openxr_api_wrapper.cc index abf3c10..8719395 100644 --- a/device/vr/openxr/openxr_api_wrapper.cc +++ b/device/vr/openxr/openxr_api_wrapper.cc
@@ -478,7 +478,9 @@ NOTREACHED(); } - std::vector<XrView> new_views(kNumViews); + // Initialize the XrView objects' type field to XR_TYPE_VIEW. xrLocateViews + // fails validation if this isn't set. + std::vector<XrView> new_views(kNumViews, {XR_TYPE_VIEW}); uint32_t view_count; RETURN_IF_XR_FAILED(xrLocateViews(session_, &view_locate_info, &view_state, new_views.size(), &view_count,
diff --git a/device/vr/openxr/test/fake_openxr_impl_api.cc b/device/vr/openxr/test/fake_openxr_impl_api.cc index 504252b..c3142b82 100644 --- a/device/vr/openxr/test/fake_openxr_impl_api.cc +++ b/device/vr/openxr/test/fake_openxr_impl_api.cc
@@ -161,10 +161,12 @@ RETURN_IF(create_info->type != XR_TYPE_REFERENCE_SPACE_CREATE_INFO, XR_ERROR_VALIDATION_FAILURE, "XrReferenceSpaceCreateInfo type invalid"); - RETURN_IF(create_info->referenceSpaceType != XR_REFERENCE_SPACE_TYPE_LOCAL && - create_info->referenceSpaceType != XR_REFERENCE_SPACE_TYPE_VIEW, - XR_ERROR_VALIDATION_FAILURE, - "XrReferenceSpaceCreateInfo referenceSpaceType invalid"); + RETURN_IF( + create_info->referenceSpaceType != XR_REFERENCE_SPACE_TYPE_LOCAL && + create_info->referenceSpaceType != XR_REFERENCE_SPACE_TYPE_VIEW && + create_info->referenceSpaceType != XR_REFERENCE_SPACE_TYPE_STAGE, + XR_ERROR_VALIDATION_FAILURE, + "XrReferenceSpaceCreateInfo referenceSpaceType invalid"); RETURN_IF_XR_FAILED(g_test_helper.ValidateXrPosefIsIdentity( create_info->poseInReferenceSpace)); @@ -595,6 +597,8 @@ "xrLocateViews view_locate_info type invalid"); RETURN_IF_XR_FAILED(g_test_helper.ValidateSpace(view_locate_info->space)); if (view_capacity_input != 0) { + RETURN_IF_XR_FAILED( + g_test_helper.ValidateViews(view_capacity_input, views)); RETURN_IF_FALSE(g_test_helper.UpdateViewFOV(views, view_capacity_input), XR_ERROR_VALIDATION_FAILURE, "xrLocateViews UpdateViewFOV failed");
diff --git a/device/vr/openxr/test/openxr_test_helper.cc b/device/vr/openxr/test/openxr_test_helper.cc index df54939..40426236 100644 --- a/device/vr/openxr/test/openxr_test_helper.cc +++ b/device/vr/openxr/test/openxr_test_helper.cc
@@ -238,9 +238,11 @@ case XR_REFERENCE_SPACE_TYPE_LOCAL: reference_spaces_[cur_space] = "/reference_space/local"; break; + case XR_REFERENCE_SPACE_TYPE_STAGE: + reference_spaces_[cur_space] = "/reference_space/stage"; + break; default: - NOTREACHED() << "Test currently only supports to create View space and " - "local space"; + NOTREACHED() << "Unsupported XrReferenceSpaceType: " << type; } return cur_space; } @@ -753,3 +755,14 @@ return XR_SUCCESS; } + +XrResult OpenXrTestHelper::ValidateViews(uint32_t view_capacity_input, + XrView* views) const { + for (uint32_t i = 0; i < view_capacity_input; i++) { + XrView view = views[i]; + RETURN_IF_FALSE(view.type == XR_TYPE_VIEW, XR_ERROR_VALIDATION_FAILURE, + "XrView type invalid"); + } + + return XR_SUCCESS; +}
diff --git a/device/vr/openxr/test/openxr_test_helper.h b/device/vr/openxr/test/openxr_test_helper.h index aa36064..eaf4460 100644 --- a/device/vr/openxr/test/openxr_test_helper.h +++ b/device/vr/openxr/test/openxr_test_helper.h
@@ -96,6 +96,7 @@ XrResult ValidatePath(XrPath path) const; XrResult ValidatePredictedDisplayTime(XrTime time) const; XrResult ValidateXrPosefIsIdentity(const XrPosef& pose) const; + XrResult ValidateViews(uint32_t view_capacity_input, XrView* views) const; // Properties of the mock OpenXR runtime that does not change are created // as static variables.
diff --git a/device/vr/public/mojom/isolated_xr_service.mojom b/device/vr/public/mojom/isolated_xr_service.mojom index 5bb301d5..4fa29ebc 100644 --- a/device/vr/public/mojom/isolated_xr_service.mojom +++ b/device/vr/public/mojom/isolated_xr_service.mojom
@@ -198,7 +198,6 @@ // Called when runtimes are initially enumerated, or when devices are later // attached and become available. OnDeviceAdded(pending_remote<XRRuntime> runtime, - pending_remote<IsolatedXRGamepadProviderFactory> gamepad_factory, pending_remote<XRCompositorHost> compositor_host, device.mojom.XRDeviceId device_id);
diff --git a/device/vr/windows_mixed_reality/mixed_reality_device.cc b/device/vr/windows_mixed_reality/mixed_reality_device.cc index 75a546d..64303fd9 100644 --- a/device/vr/windows_mixed_reality/mixed_reality_device.cc +++ b/device/vr/windows_mixed_reality/mixed_reality_device.cc
@@ -70,11 +70,6 @@ Shutdown(); } -mojo::PendingRemote<mojom::IsolatedXRGamepadProviderFactory> -MixedRealityDevice::BindGamepadFactory() { - return gamepad_provider_factory_receiver_.BindNewPipeAndPassRemote(); -} - mojo::PendingRemote<mojom::XRCompositorHost> MixedRealityDevice::BindCompositorHost() { return compositor_host_receiver_.BindNewPipeAndPassRemote(); @@ -103,13 +98,6 @@ return; } - if (provider_receiver_) { - render_loop_->task_runner()->PostTask( - FROM_HERE, base::BindOnce(&XRCompositorCommon::RequestGamepadProvider, - base::Unretained(render_loop_.get()), - std::move(provider_receiver_))); - } - if (overlay_receiver_) { render_loop_->task_runner()->PostTask( FROM_HERE, base::BindOnce(&XRCompositorCommon::RequestOverlay, @@ -176,20 +164,6 @@ base::Unretained(this))); } -void MixedRealityDevice::GetIsolatedXRGamepadProvider( - mojo::PendingReceiver<mojom::IsolatedXRGamepadProvider> provider_receiver) { - if (!render_loop_) - CreateRenderLoop(); - if (render_loop_->IsRunning()) { - render_loop_->task_runner()->PostTask( - FROM_HERE, base::BindOnce(&XRCompositorCommon::RequestGamepadProvider, - base::Unretained(render_loop_.get()), - std::move(provider_receiver))); - } else { - provider_receiver_ = std::move(provider_receiver); - } -} - void MixedRealityDevice::CreateImmersiveOverlay( mojo::PendingReceiver<mojom::ImmersiveOverlay> overlay_receiver) { if (!render_loop_) @@ -211,15 +185,12 @@ } void MixedRealityDevice::OnPresentingControllerMojoConnectionError() { - if (!render_loop_) - CreateRenderLoop(); - render_loop_->task_runner()->PostTask( - FROM_HERE, base::BindOnce(&XRCompositorCommon::ExitPresent, - base::Unretained(render_loop_.get()))); - // Don't stop the render loop here. We need to keep the gamepad provider alive - // so that we don't lose a pending mojo gamepad_callback_. - // TODO(https://crbug.com/875187): Alternatively, we could recreate the - // provider on the next session, or look into why the callback gets lost. + if (render_loop_) { + render_loop_->task_runner()->PostTask( + FROM_HERE, base::BindOnce(&XRCompositorCommon::ExitPresent, + base::Unretained(render_loop_.get()))); + } + OnExitPresent(); exclusive_controller_receiver_.reset(); }
diff --git a/device/vr/windows_mixed_reality/mixed_reality_device.h b/device/vr/windows_mixed_reality/mixed_reality_device.h index 234dc24..4e92138 100644 --- a/device/vr/windows_mixed_reality/mixed_reality_device.h +++ b/device/vr/windows_mixed_reality/mixed_reality_device.h
@@ -22,14 +22,11 @@ class DEVICE_VR_EXPORT MixedRealityDevice : public VRDeviceBase, public mojom::XRSessionController, - public mojom::IsolatedXRGamepadProviderFactory, public mojom::XRCompositorHost { public: MixedRealityDevice(); ~MixedRealityDevice() override; - mojo::PendingRemote<mojom::IsolatedXRGamepadProviderFactory> - BindGamepadFactory(); mojo::PendingRemote<mojom::XRCompositorHost> BindCompositorHost(); private: @@ -41,11 +38,6 @@ // XRSessionController void SetFrameDataRestricted(bool restricted) override; - // mojom::IsolatedXRGamepadProviderFactory - void GetIsolatedXRGamepadProvider( - mojo::PendingReceiver<mojom::IsolatedXRGamepadProvider> provider_receiver) - override; - // XRCompositorHost void CreateImmersiveOverlay( mojo::PendingReceiver<mojom::ImmersiveOverlay> overlay_receiver) override; @@ -60,10 +52,6 @@ std::unique_ptr<XRCompositorCommon> render_loop_; - mojo::Receiver<mojom::IsolatedXRGamepadProviderFactory> - gamepad_provider_factory_receiver_{this}; - mojo::PendingReceiver<mojom::IsolatedXRGamepadProvider> provider_receiver_; - mojo::Receiver<mojom::XRCompositorHost> compositor_host_receiver_{this}; mojo::PendingReceiver<mojom::ImmersiveOverlay> overlay_receiver_;
diff --git a/device/vr/windows_mixed_reality/mixed_reality_input_helper.cc b/device/vr/windows_mixed_reality/mixed_reality_input_helper.cc index 5c3f02e..37278f6 100644 --- a/device/vr/windows_mixed_reality/mixed_reality_input_helper.cc +++ b/device/vr/windows_mixed_reality/mixed_reality_input_helper.cc
@@ -4,20 +4,13 @@ #include "device/vr/windows_mixed_reality/mixed_reality_input_helper.h" -#include <windows.perception.spatial.h> -#include <windows.ui.input.spatial.h> - -#include <wrl.h> #include <wrl/event.h> -#include <unordered_map> +#include <utility> #include <vector> -#include "base/strings/safe_sprintf.h" #include "base/threading/thread_task_runner_handle.h" #include "device/gamepad/public/cpp/gamepads.h" -#include "device/vr/public/mojom/isolated_xr_service.mojom.h" -#include "device/vr/util/gamepad_builder.h" #include "device/vr/util/xr_standard_gamepad_builder.h" #include "device/vr/windows_mixed_reality/mixed_reality_renderloop.h" #include "device/vr/windows_mixed_reality/wrappers/wmr_input_location.h" @@ -46,245 +39,37 @@ using PositionAccuracy = ABI::Windows::UI::Input::Spatial::SpatialInteractionSourcePositionAccuracy; -ParsedInputState::ParsedInputState() = default; -ParsedInputState::~ParsedInputState() = default; -ParsedInputState::ParsedInputState(ParsedInputState&& other) = default; - MixedRealityInputHelper::ControllerState::ControllerState() = default; MixedRealityInputHelper::ControllerState::~ControllerState() = default; namespace { - -// Helpers for WebVR Gamepad -constexpr double kThumbstickDeadzone = 0.15; - -double ApplyAxisDeadzone(double value, double deadzone) { - return std::fabs(value) < deadzone ? 0 : value; -} - -void AddButton(mojom::XRGamepadPtr& gamepad, - const GamepadBuilder::ButtonData* data) { - if (data) { - auto button = mojom::XRGamepadButton::New(); - button->pressed = data->pressed; - button->touched = data->touched; - button->value = data->value; - - gamepad->buttons.push_back(std::move(button)); - } else { - gamepad->buttons.push_back(mojom::XRGamepadButton::New()); - } -} - -// These methods are only called for the thumbstick and touchpad, which both -// have an X and Y. -void AddAxes(mojom::XRGamepadPtr& gamepad, - const GamepadBuilder::ButtonData& data) { - const double deadzone = - data.type == GamepadBuilder::ButtonData::Type::kThumbstick - ? kThumbstickDeadzone - : 0.0; - gamepad->axes.push_back(ApplyAxisDeadzone(data.x_axis, deadzone)); - gamepad->axes.push_back(ApplyAxisDeadzone(data.y_axis, deadzone)); -} - -void AddButtonWithAxes(mojom::XRGamepadPtr& gamepad, - const GamepadBuilder::ButtonData& data) { - AddButton(gamepad, &data); - AddAxes(gamepad, data); -} - -gfx::Point3F ConvertToPoint3F(const GamepadVector& vector) { - return gfx::Point3F(vector.x, vector.y, vector.z); -} - -gfx::Vector3dF ConvertToVector3dF(const GamepadVector& vector) { - return gfx::Vector3dF(vector.x, vector.y, vector.z); -} - -gfx::Quaternion ConvertToQuaternion(const GamepadQuaternion& quat) { - return gfx::Quaternion(quat.x, quat.y, quat.z, quat.w); -} - -mojom::VRPosePtr ConvertToVRPose(const GamepadPose& gamepad_pose) { - if (!gamepad_pose.not_null) - return nullptr; - - auto pose = mojom::VRPose::New(); - if (gamepad_pose.orientation.not_null) - pose->orientation = ConvertToQuaternion(gamepad_pose.orientation); - - if (gamepad_pose.position.not_null) - pose->position = ConvertToPoint3F(gamepad_pose.position); - - if (gamepad_pose.angular_velocity.not_null) - pose->angular_velocity = ConvertToVector3dF(gamepad_pose.angular_velocity); - - if (gamepad_pose.linear_velocity.not_null) - pose->linear_velocity = ConvertToVector3dF(gamepad_pose.linear_velocity); - - if (gamepad_pose.angular_acceleration.not_null) - pose->angular_acceleration = - ConvertToVector3dF(gamepad_pose.angular_acceleration); - - if (gamepad_pose.linear_acceleration.not_null) - pose->linear_acceleration = - ConvertToVector3dF(gamepad_pose.linear_acceleration); - - return pose; -} - -GamepadQuaternion ConvertToGamepadQuaternion(const WFN::Quaternion& quat) { - GamepadQuaternion gamepad_quaternion; - gamepad_quaternion.not_null = true; - gamepad_quaternion.x = quat.X; - gamepad_quaternion.y = quat.Y; - gamepad_quaternion.z = quat.Z; - gamepad_quaternion.w = quat.W; - return gamepad_quaternion; -} - -GamepadVector ConvertToGamepadVector(const WFN::Vector3& vec3) { - GamepadVector gamepad_vector; - gamepad_vector.not_null = true; - gamepad_vector.x = vec3.X; - gamepad_vector.y = vec3.Y; - gamepad_vector.z = vec3.Z; - return gamepad_vector; -} - -GamepadPose GetGamepadPose(const WMRInputLocation* location) { - GamepadPose gamepad_pose; - - WFN::Quaternion quat; - if (location->TryGetOrientation(&quat)) { - gamepad_pose.not_null = true; - gamepad_pose.orientation = ConvertToGamepadQuaternion(quat); - } - - WFN::Vector3 vec3; - if (location->TryGetPosition(&vec3)) { - gamepad_pose.not_null = true; - gamepad_pose.position = ConvertToGamepadVector(vec3); - } - - if (location->TryGetVelocity(&vec3)) { - gamepad_pose.not_null = true; - gamepad_pose.linear_velocity = ConvertToGamepadVector(vec3); - } - - if (location->TryGetAngularVelocity(&vec3)) { - gamepad_pose.not_null = true; - gamepad_pose.angular_velocity = ConvertToGamepadVector(vec3); - } - - return gamepad_pose; -} - -mojom::XRGamepadPtr GetWebVRGamepad(ParsedInputState input_state) { - auto gamepad = mojom::XRGamepad::New(); - // This matches the order of button trigger events from Edge. Note that we - // use the polled button state for select here. Voice (which we cannot get - // via polling), lacks enough data to be considered a "Gamepad", and if we - // used eventing the pressed state may be inconsistent. - AddButtonWithAxes(gamepad, input_state.button_data[ButtonName::kThumbstick]); - AddButton(gamepad, &input_state.button_data[ButtonName::kSelect]); - AddButton(gamepad, &input_state.button_data[ButtonName::kGrip]); - AddButton(gamepad, nullptr); // Nothing seems to trigger this button in Edge. - AddButtonWithAxes(gamepad, input_state.button_data[ButtonName::kTouchpad]); - - auto handedness = input_state.source_state->description->handedness; - - gamepad->timestamp = base::TimeTicks::Now(); - gamepad->hand = handedness; - gamepad->controller_id = input_state.source_state->source_id; - - // We need to ensure that we have a VRPose so that we can attach input_states - // and therefore a gamepad to plumb up the Gamepad Id with VendorId/ProductId. - if (input_state.gamepad_pose.not_null) { - gamepad->pose = ConvertToVRPose(input_state.gamepad_pose); - gamepad->can_provide_position = input_state.gamepad_pose.position.not_null; - gamepad->can_provide_orientation = - input_state.gamepad_pose.orientation.not_null; - } else { - gamepad->can_provide_orientation = false; - gamepad->can_provide_position = false; - gamepad->pose = mojom::VRPose::New(); - } - - // Build the gamepad id, this prefix is used for all controller types and - // VendorId-ProductId is appended after it, padded with leading 0's. - char gamepad_id[Gamepad::kIdLengthCap]; - base::strings::SafeSPrintf( - gamepad_id, "Spatial Controller (Spatial Interaction Source) %04X-%04X", - input_state.vendor_id, input_state.product_id); - - // We have to use the GamepadBuilder because the mojom serialization complains - // if some of the values are missing/invalid. - GamepadBuilder builder(gamepad_id, GamepadMapping::kNone, handedness); - - auto input_source_state = mojom::XRInputSourceState::New(); - input_source_state->gamepad = builder.GetGamepad(); - - // Typical chromium style would be to use the initializer list, but that - // doesn't seem to be compatible with the explicitly deleted move/copy - // constructors for the vector. - std::vector<mojom::XRInputSourceStatePtr> input_source_vector; - input_source_vector.push_back(std::move(input_source_state)); - gamepad->pose->input_state = std::move(input_source_vector); - - return gamepad; -} - -// Helpers for WebXRGamepad -base::Optional<Gamepad> GetWebXRGamepad(ParsedInputState& input_state) { - device::mojom::XRHandedness handedness = device::mojom::XRHandedness::NONE; - if (input_state.source_state && input_state.source_state->description) - handedness = input_state.source_state->description->handedness; - +base::Optional<Gamepad> GetWebXRGamepad(const WMRInputSourceState* source_state, + const mojom::XRHandedness& handedness) { XRStandardGamepadBuilder builder(handedness); - builder.SetPrimaryButton(input_state.button_data[ButtonName::kSelect]); - builder.SetSecondaryButton(input_state.button_data[ButtonName::kGrip]); - // button_data will either have both kTouchpad and kThumbstick, or neither. - if (input_state.button_data.find(ButtonName::kTouchpad) != - input_state.button_data.end()) { - builder.SetTouchpadData(input_state.button_data[ButtonName::kTouchpad]); - builder.SetThumbstickData(input_state.button_data[ButtonName::kThumbstick]); - } - - return builder.GetGamepad(); -} - -// Note that since this is built by polling, and so eventing changes are not -// accounted for here. -std::unordered_map<ButtonName, GamepadBuilder::ButtonData> ParseButtonState( - const WMRInputSourceState* source_state) { - std::unordered_map<ButtonName, GamepadBuilder::ButtonData> button_map; - - // Add the select button - GamepadBuilder::ButtonData data = button_map[ButtonName::kSelect]; + // Add the Select button + GamepadBuilder::ButtonData data = {}; data.pressed = source_state->IsSelectPressed(); data.touched = data.pressed; data.value = source_state->SelectPressedValue(); data.type = GamepadBuilder::ButtonData::Type::kButton; - button_map[ButtonName::kSelect] = data; + builder.SetPrimaryButton(data); // Add the grip button - data = button_map[ButtonName::kGrip]; + data = {}; data.pressed = source_state->IsGrasped(); data.touched = data.pressed; data.value = data.pressed ? 1.0 : 0.0; data.type = GamepadBuilder::ButtonData::Type::kButton; - button_map[ButtonName::kGrip] = data; + builder.SetSecondaryButton(data); // Select and grip are the only two required buttons, if we can't get the // others, we can safely return just them. if (!source_state->SupportsControllerProperties()) - return button_map; + return builder.GetGamepad(); - // Add the thumbstick - data = button_map[ButtonName::kThumbstick]; + // Add the Thumbstick + data = {}; data.pressed = source_state->IsThumbstickPressed(); data.touched = data.pressed; data.value = data.pressed ? 1.0 : 0.0; @@ -293,11 +78,10 @@ data.type = GamepadBuilder::ButtonData::Type::kThumbstick; data.x_axis = source_state->ThumbstickX(); data.y_axis = -source_state->ThumbstickY(); + builder.SetThumbstickData(data); - button_map[ButtonName::kThumbstick] = data; - - // Add the touchpad - data = button_map[ButtonName::kTouchpad]; + // Add the Touchpad + data = {}; data.pressed = source_state->IsTouchpadPressed(); data.touched = source_state->IsTouchpadTouched() || data.pressed; data.value = data.pressed ? 1.0 : 0.0; @@ -313,20 +97,20 @@ data.y_axis = 0; } - button_map[ButtonName::kTouchpad] = data; + builder.SetTouchpadData(data); - return button_map; + return builder.GetGamepad(); } -gfx::Transform CreateTransform(GamepadVector position, - GamepadQuaternion rotation) { +gfx::Transform CreateTransform(const WFN::Vector3& position, + const WFN::Quaternion& rotation) { gfx::DecomposedTransform decomposed_transform; - decomposed_transform.translate[0] = position.x; - decomposed_transform.translate[1] = position.y; - decomposed_transform.translate[2] = position.z; + decomposed_transform.translate[0] = position.X; + decomposed_transform.translate[1] = position.Y; + decomposed_transform.translate[2] = position.Z; decomposed_transform.quaternion = - gfx::Quaternion(rotation.x, rotation.y, rotation.z, rotation.w); + gfx::Quaternion(rotation.X, rotation.Y, rotation.Z, rotation.W); return gfx::ComposeTransform(decomposed_transform); } @@ -366,19 +150,18 @@ pos = pointer_pose->HeadForward(); } - gfx::Transform origin_from_pointer = CreateTransform( - ConvertToGamepadVector(pos), ConvertToGamepadQuaternion(rot)); + gfx::Transform origin_from_pointer = CreateTransform(pos, rot); return (grip_from_origin * origin_from_pointer); } -device::mojom::XRHandedness WindowsToMojoHandedness(Handedness handedness) { +mojom::XRHandedness WindowsToMojoHandedness(Handedness handedness) { switch (handedness) { case Handedness::SpatialInteractionSourceHandedness_Left: - return device::mojom::XRHandedness::LEFT; + return mojom::XRHandedness::LEFT; case Handedness::SpatialInteractionSourceHandedness_Right: - return device::mojom::XRHandedness::RIGHT; + return mojom::XRHandedness::RIGHT; default: - return device::mojom::XRHandedness::NONE; + return mojom::XRHandedness::NONE; } } @@ -389,13 +172,13 @@ // the hash table used on the blink side. To ensure that we don't have any // collisions with other ids, increment all of the ids by one. id++; - DCHECK(id != 0); + DCHECK_NE(id, 0u); return id; } -const unsigned short kSamsungVendorId = 1118; -const unsigned short kSamsungOdysseyProductId = 1629; +const uint16_t kSamsungVendorId = 1118; +const uint16_t kSamsungOdysseyProductId = 1629; } // namespace @@ -447,42 +230,19 @@ for (const auto& state : source_states) { auto parsed_source_state = ParseWindowsSourceState(state.get(), origin); - if (parsed_source_state.source_state) { - input_states.push_back(std::move(parsed_source_state.source_state)); + if (parsed_source_state) { + input_states.push_back(std::move(parsed_source_state)); } } return input_states; } -mojom::XRGamepadDataPtr MixedRealityInputHelper::GetWebVRGamepadData( - const WMRCoordinateSystem* origin, - const WMRTimestamp* timestamp) { - auto ret = mojom::XRGamepadData::New(); - - if (!timestamp || !origin || !EnsureSpatialInteractionManager()) - return ret; - - auto source_states = - input_manager_->GetDetectedSourcesAtTimestamp(timestamp->GetRawPtr()); - - for (const auto& state : source_states) { - auto parsed_source_state = ParseWindowsSourceState(state.get(), origin); - - // If we have a source_state, then we should have enough data. - if (parsed_source_state.source_state) - ret->gamepads.push_back(GetWebVRGamepad(std::move(parsed_source_state))); - } - - return ret; -} - -ParsedInputState MixedRealityInputHelper::ParseWindowsSourceState( +mojom::XRInputSourceStatePtr MixedRealityInputHelper::ParseWindowsSourceState( const WMRInputSourceState* state, const WMRCoordinateSystem* origin) { - ParsedInputState input_state; if (!origin) - return input_state; + return nullptr; std::unique_ptr<WMRInputSource> source = state->GetSource(); SourceKind source_kind = source->Kind(); @@ -493,7 +253,7 @@ (source_kind == SourceKind::SpatialInteractionSourceKind_Voice); if (!(is_controller || is_voice)) - return input_state; + return nullptr; // Hands may not have the same id especially if they are lost but since we // are only tracking controllers/voice, this id should be consistent. @@ -506,16 +266,17 @@ gfx::Transform origin_from_grip; bool is_tracked = false; bool emulated_position = false; + uint16_t product_id = 0; + uint16_t vendor_id = 0; if (is_controller) { - input_state.button_data = ParseButtonState(state); std::unique_ptr<WMRInputLocation> location_in_origin = state->TryGetLocation(origin); if (location_in_origin) { - auto gamepad_pose = GetGamepadPose(location_in_origin.get()); - if (gamepad_pose.not_null && gamepad_pose.position.not_null && - gamepad_pose.orientation.not_null) { - origin_from_grip = - CreateTransform(gamepad_pose.position, gamepad_pose.orientation); + WFN::Vector3 pos; + WFN::Quaternion rot; + if (location_in_origin->TryGetPosition(&pos) && + location_in_origin->TryGetOrientation(&rot)) { + origin_from_grip = CreateTransform(pos, rot); is_tracked = true; } @@ -527,14 +288,12 @@ // Controller lost precise tracking or has its position estimated. emulated_position = true; } - - input_state.gamepad_pose = gamepad_pose; } std::unique_ptr<WMRController> controller = source->Controller(); if (controller) { - input_state.product_id = controller->ProductId(); - input_state.vendor_id = controller->VendorId(); + product_id = controller->ProductId(); + vendor_id = controller->VendorId(); } } @@ -550,34 +309,33 @@ } // Now that we have calculated information for the object, build it. - device::mojom::XRInputSourceStatePtr source_state = - device::mojom::XRInputSourceState::New(); + mojom::XRInputSourceStatePtr input_state = mojom::XRInputSourceState::New(); - source_state->source_id = id; - source_state->primary_input_pressed = controller_states_[id].pressed; - source_state->primary_input_clicked = controller_states_[id].clicked; + input_state->source_id = id; + input_state->primary_input_pressed = controller_states_[id].pressed; + input_state->primary_input_clicked = controller_states_[id].clicked; // Grip position should *only* be specified if the controller is tracked. if (is_tracked) - source_state->grip = origin_from_grip; + input_state->grip = origin_from_grip; - device::mojom::XRInputSourceDescriptionPtr description = - device::mojom::XRInputSourceDescription::New(); + mojom::XRInputSourceDescriptionPtr description = + mojom::XRInputSourceDescription::New(); - source_state->emulated_position = emulated_position; + input_state->emulated_position = emulated_position; description->pointer_offset = grip_from_pointer; if (is_voice) { - description->target_ray_mode = device::mojom::XRTargetRayMode::GAZING; - description->handedness = device::mojom::XRHandedness::NONE; + description->target_ray_mode = mojom::XRTargetRayMode::GAZING; + description->handedness = mojom::XRHandedness::NONE; } else if (is_controller) { - description->target_ray_mode = device::mojom::XRTargetRayMode::POINTING; + description->target_ray_mode = mojom::XRTargetRayMode::POINTING; description->handedness = WindowsToMojoHandedness(source->Handedness()); // If we know the particular headset/controller model, add this to the // profiles array. - if (input_state.vendor_id == kSamsungVendorId && - input_state.product_id == kSamsungOdysseyProductId) { + if (vendor_id == kSamsungVendorId && + product_id == kSamsungOdysseyProductId) { description->profiles.push_back("samsung-odyssey"); } @@ -589,13 +347,12 @@ description->profiles.push_back( "generic-trigger-squeeze-touchpad-thumbstick"); - source_state->gamepad = GetWebXRGamepad(input_state); + input_state->gamepad = GetWebXRGamepad(state, description->handedness); } else { NOTREACHED(); } - source_state->description = std::move(description); - input_state.source_state = std::move(source_state); + input_state->description = std::move(description); return input_state; } @@ -645,9 +402,8 @@ return; auto parsed_source_state = ParseWindowsSourceState(state.get(), origin); - if (parsed_source_state.source_state) { - weak_render_loop_->OnInputSourceEvent( - std::move(parsed_source_state.source_state)); + if (parsed_source_state) { + weak_render_loop_->OnInputSourceEvent(std::move(parsed_source_state)); } // We've sent up the click, so clear it.
diff --git a/device/vr/windows_mixed_reality/mixed_reality_input_helper.h b/device/vr/windows_mixed_reality/mixed_reality_input_helper.h index 94ce765..049e44af 100644 --- a/device/vr/windows_mixed_reality/mixed_reality_input_helper.h +++ b/device/vr/windows_mixed_reality/mixed_reality_input_helper.h
@@ -13,31 +13,10 @@ #include <vector> #include "base/callback_list.h" -#include "device/gamepad/public/cpp/gamepads.h" -#include "device/vr/public/mojom/isolated_xr_service.mojom.h" #include "device/vr/public/mojom/vr_service.mojom.h" -#include "device/vr/util/gamepad_builder.h" namespace device { -enum class ButtonName { - kSelect, - kGrip, - kTouchpad, - kThumbstick, -}; - -struct ParsedInputState { - mojom::XRInputSourceStatePtr source_state; - std::unordered_map<ButtonName, GamepadBuilder::ButtonData> button_data; - GamepadPose gamepad_pose; - uint16_t vendor_id = 0; - uint16_t product_id = 0; - ParsedInputState(); - ~ParsedInputState(); - ParsedInputState(ParsedInputState&& other); -}; - class WMRCoordinateSystem; class WMRInputManager; class WMRInputSourceState; @@ -56,16 +35,14 @@ const WMRCoordinateSystem* origin, const WMRTimestamp* timestamp); - mojom::XRGamepadDataPtr GetWebVRGamepadData(const WMRCoordinateSystem* origin, - const WMRTimestamp* timestamp); - void Dispose(); private: bool EnsureSpatialInteractionManager(); - ParsedInputState ParseWindowsSourceState(const WMRInputSourceState* state, - const WMRCoordinateSystem* origin); + mojom::XRInputSourceStatePtr ParseWindowsSourceState( + const WMRInputSourceState* state, + const WMRCoordinateSystem* origin); // These event subscriptions can come back on a different thread, while // everything else is expected to come back on the same thread.
diff --git a/device/vr/windows_mixed_reality/mixed_reality_renderloop.cc b/device/vr/windows_mixed_reality/mixed_reality_renderloop.cc index 147db96..aeed4c44 100644 --- a/device/vr/windows_mixed_reality/mixed_reality_renderloop.cc +++ b/device/vr/windows_mixed_reality/mixed_reality_renderloop.cc
@@ -10,7 +10,6 @@ #include <algorithm> #include <limits> #include <utility> -#include <vector> #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -52,7 +51,7 @@ class MixedRealityWindow : public gfx::WindowImpl { public: - MixedRealityWindow(base::OnceCallback<void()> on_destroyed) + explicit MixedRealityWindow(base::OnceCallback<void()> on_destroyed) : gfx::WindowImpl(), on_destroyed_(std::move(on_destroyed)) { set_window_style(WS_OVERLAPPED); } @@ -89,8 +88,7 @@ matrix.M11, matrix.M21, matrix.M31, matrix.M41, matrix.M12, matrix.M22, matrix.M32, matrix.M42, matrix.M13, matrix.M23, matrix.M33, matrix.M43, - matrix.M14, matrix.M24, matrix.M34, matrix.M44 - ); + matrix.M14, matrix.M24, matrix.M34, matrix.M44); // clang-format on } @@ -504,21 +502,6 @@ ShowWindow(window_->hwnd(), SW_SHOW); } -mojom::XRGamepadDataPtr MixedRealityRenderLoop::GetNextGamepadData() { - if (!timestamp_) { - WMRLogging::TraceError(WMRErrorLocation::kGamepadMissingTimestamp); - return nullptr; - } - - if (!anchor_origin_) { - WMRLogging::TraceError(WMRErrorLocation::kGamepadMissingOrigin); - return nullptr; - } - - return input_helper_->GetWebVRGamepadData(anchor_origin_.get(), - timestamp_.get()); -} - struct EyeToWorldDecomposed { gfx::Quaternion world_to_eye_rotation; gfx::Point3F eye_in_world_space;
diff --git a/device/vr/windows_mixed_reality/mixed_reality_renderloop.h b/device/vr/windows_mixed_reality/mixed_reality_renderloop.h index 05f1cdf..ca76cb53 100644 --- a/device/vr/windows_mixed_reality/mixed_reality_renderloop.h +++ b/device/vr/windows_mixed_reality/mixed_reality_renderloop.h
@@ -6,6 +6,7 @@ #define DEVICE_VR_WINDOWS_MIXED_REALITY_MIXED_REALITY_RENDERLOOP_H_ #include <memory> +#include <vector> #include "base/callback.h" #include "base/callback_list.h" @@ -57,7 +58,6 @@ // XRDeviceAbstraction: mojom::XRFrameDataPtr GetNextFrameData() override; - mojom::XRGamepadDataPtr GetNextGamepadData() override; bool PreComposite() override; bool SubmitCompositedFrame() override;
diff --git a/docs/code_reviews.md b/docs/code_reviews.md index 4ebdead..380eca9 100644 --- a/docs/code_reviews.md +++ b/docs/code_reviews.md
@@ -125,11 +125,18 @@ This should be rarely used. If you want to use `set noparent` except for IPC related files, please first reach out to chrome-eng-review@google.com. -In this example, only the two listed people are owners: +You have to use `set noparent` together with a reference to a file that lists +the owners for the given use case. Approved use cases are listed in +`//build/OWNERS.setnoparent`. Owners listed in those files are expected to +execute special governance functions such as eng review or ipc security review. +Every set of owners should implement their own means of auditing membership. The +minimum expectation is that membership in those files is reevaluated on +project, or affiliation changes. + +In this example, only the eng reviewers are owners: ``` set noparent -a@chromium.org -b@chromium.org +file://ENG_REVIEW_OWNERS ``` The `per-file` directive allows owners to be added that apply only to files
diff --git a/docs/gpu/gpu_testing.md b/docs/gpu/gpu_testing.md index 2cacf23b..6c8b89e 100644 --- a/docs/gpu/gpu_testing.md +++ b/docs/gpu/gpu_testing.md
@@ -112,11 +112,11 @@ * [linux-rel], formerly on the `tryserver.chromium.linux` waterfall * [mac-rel], formerly on the `tryserver.chromium.mac` waterfall -* [win7-rel], formerly on the `tryserver.chromium.win` waterfall +* [win10_chromium_x64_rel_ng], formerly on the `tryserver.chromium.win` waterfall -[linux-rel]: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux-rel?limit=100 -[mac-rel]: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/mac-rel?limit=100 -[win7-rel]: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/win7-rel?limit=100 +[linux-rel]: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux-rel?limit=100 +[mac-rel]: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/mac-rel?limit=100 +[win10_chromium_x64_rel_ng]: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/win10_chromium_x64_rel_ng?limit=100 Scan down through the steps looking for the text "GPU"; that identifies those tests run on the GPU bots. For each test the "trigger" step can be ignored; the
diff --git a/extensions/browser/api/alarms/alarms_api_unittest.cc b/extensions/browser/api/alarms/alarms_api_unittest.cc index 5a1c56f..89b470965 100644 --- a/extensions/browser/api/alarms/alarms_api_unittest.cc +++ b/extensions/browser/api/alarms/alarms_api_unittest.cc
@@ -8,19 +8,19 @@ #include "base/bind.h" #include "base/json/json_reader.h" +#include "base/optional.h" #include "base/run_loop.h" #include "base/stl_util.h" #include "base/test/simple_test_clock.h" #include "base/values.h" #include "content/public/browser/web_contents.h" -#include "content/public/test/mock_render_process_host.h" +#include "content/public/test/fake_local_frame.h" #include "extensions/browser/api/alarms/alarm_manager.h" #include "extensions/browser/api/alarms/alarms_api.h" #include "extensions/browser/api/alarms/alarms_api_constants.h" #include "extensions/browser/api_unittest.h" #include "extensions/common/extension_builder.h" #include "extensions/common/extension_messages.h" -#include "ipc/ipc_test_sink.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -291,33 +291,41 @@ base::Bind(ExtensionAlarmsTestCreateDupeGetAllAlarmsCallback)); } +class ConsoleLogMessageLocalFrame : public content::FakeLocalFrame { + public: + void AddMessageToConsole(blink::mojom::ConsoleMessageLevel level, + const std::string& message, + bool discard_duplicates) override { + message_count_++; + last_level_ = level; + last_message_ = message; + } + unsigned message_count() const { return message_count_; } + const std::string& last_message() const { return last_message_; } + blink::mojom::ConsoleMessageLevel last_level() const { + return last_level_.value(); + } + + private: + unsigned message_count_ = 0; + base::Optional<blink::mojom::ConsoleMessageLevel> last_level_; + std::string last_message_; +}; + TEST_F(ExtensionAlarmsTest, CreateDelayBelowMinimum) { // Create an alarm with delay below the minimum accepted value. - IPC::TestSink& sink = static_cast<content::MockRenderProcessHost*>( - contents()->GetMainFrame()->GetProcess()) - ->sink(); - size_t initial_message_count = sink.message_count(); + ConsoleLogMessageLocalFrame local_frame; + local_frame.Init(contents()->GetMainFrame()->GetRemoteAssociatedInterfaces()); + base::RunLoop().RunUntilIdle(); + ASSERT_EQ(local_frame.message_count(), 0u); CreateAlarm("[\"negative\", {\"delayInMinutes\": -0.2}]"); - // A new message should have been added. - ASSERT_GT(sink.message_count(), initial_message_count); - - // All of this would be cleaner if we could read the message as a - // FrameMsg_AddMessageToConsole, but that would be a layering violation. - // Better yet would be an observer method for frames adding console messages, - // but it's not worth adding just for a test. - const IPC::Message* warning = - sink.GetMessageAt(initial_message_count /* 0-based */); - ASSERT_TRUE(warning); - - int level = 0; - base::PickleIterator iter(*warning); - ASSERT_TRUE(iter.ReadInt(&level)); - std::string message; - ASSERT_TRUE(iter.ReadString(&message)); + base::RunLoop().RunUntilIdle(); + ASSERT_EQ(local_frame.message_count(), 1u); EXPECT_EQ(blink::mojom::ConsoleMessageLevel::kWarning, - static_cast<blink::mojom::ConsoleMessageLevel>(level)); - EXPECT_THAT(message, testing::HasSubstr("delay is less than minimum of 1")); + local_frame.last_level()); + EXPECT_THAT(local_frame.last_message(), + testing::HasSubstr("delay is less than minimum of 1")); } TEST_F(ExtensionAlarmsTest, Get) {
diff --git a/extensions/browser/api/web_request/web_request_info.cc b/extensions/browser/api/web_request/web_request_info.cc index 3e84b22..f9cd845 100644 --- a/extensions/browser/api/web_request/web_request_info.cc +++ b/extensions/browser/api/web_request/web_request_info.cc
@@ -23,8 +23,8 @@ #include "net/base/upload_bytes_element_reader.h" #include "net/base/upload_data_stream.h" #include "net/base/upload_file_element_reader.h" -#include "services/network/public/cpp/resource_response.h" #include "services/network/public/mojom/network_context.mojom.h" +#include "services/network/public/mojom/url_response_head.mojom.h" #include "services/network/url_loader.h" namespace keys = extension_web_request_api_constants; @@ -244,7 +244,7 @@ WebRequestInfo::~WebRequestInfo() = default; void WebRequestInfo::AddResponseInfoFromResourceResponse( - const network::ResourceResponseHead& response) { + const network::mojom::URLResponseHead& response) { response_headers = response.headers; if (response_headers) response_code = response_headers->response_code();
diff --git a/extensions/browser/api/web_request/web_request_info.h b/extensions/browser/api/web_request/web_request_info.h index f09281c..a09259c0 100644 --- a/extensions/browser/api/web_request/web_request_info.h +++ b/extensions/browser/api/web_request/web_request_info.h
@@ -22,13 +22,10 @@ #include "ipc/ipc_message.h" #include "net/http/http_request_headers.h" #include "services/network/public/cpp/resource_request.h" +#include "services/network/public/mojom/url_response_head.mojom-forward.h" #include "url/gurl.h" #include "url/origin.h" -namespace network { -struct ResourceResponseHead; -} - namespace extensions { class ExtensionNavigationUIData; @@ -91,7 +88,7 @@ // Fill in response data for this request. void AddResponseInfoFromResourceResponse( - const network::ResourceResponseHead& response); + const network::mojom::URLResponseHead& response); // A unique identifier for this request. const uint64_t id;
diff --git a/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc b/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc index bf7518c3..faa5d8f 100644 --- a/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc +++ b/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.cc
@@ -83,6 +83,7 @@ proxied_loader_binding_(this, std::move(loader_request)), target_client_(std::move(client)), proxied_client_binding_(this), + current_response_(network::mojom::URLResponseHead::New()), has_any_extra_headers_listeners_( network_service_request_id_ != 0 && ExtensionWebRequestEventRouter::GetInstance() @@ -278,12 +279,12 @@ if (current_request_uses_header_client_) { // Use the headers we got from OnHeadersReceived as that'll contain // Set-Cookie if it existed. - auto saved_headers = current_response_.headers; - current_response_ = head; - current_response_.headers = saved_headers; + auto saved_headers = current_response_->headers; + current_response_ = std::move(head); + current_response_->headers = saved_headers; ContinueToResponseStarted(net::OK); } else { - current_response_ = head; + current_response_ = std::move(head); HandleResponseOrRedirectHeaders( base::BindOnce(&InProgressRequest::ContinueToResponseStarted, weak_factory_.GetWeakPtr())); @@ -304,16 +305,16 @@ if (current_request_uses_header_client_) { // Use the headers we got from OnHeadersReceived as that'll contain // Set-Cookie if it existed. - auto saved_headers = current_response_.headers; - current_response_ = head; + auto saved_headers = current_response_->headers; + current_response_ = std::move(head); // If this redirect is from an HSTS upgrade, OnHeadersReceived will not be // called before OnReceiveRedirect, so make sure the saved headers exist // before setting them. if (saved_headers) - current_response_.headers = saved_headers; + current_response_->headers = saved_headers; ContinueToBeforeRedirect(redirect_info, net::OK); } else { - current_response_ = head; + current_response_ = std::move(head); HandleResponseOrRedirectHeaders( base::BindOnce(&InProgressRequest::ContinueToBeforeRedirect, weak_factory_.GetWeakPtr(), redirect_info)); @@ -369,9 +370,8 @@ // Set-Cookie). So we don't use |response_headers| since it won't have the // Set-Cookie headers. if (!current_request_uses_header_client_) { - network::ResourceResponseHead head; - head.headers = response_headers; - current_response_ = head; + current_response_ = network::mojom::URLResponseHead::New(); + current_response_->headers = response_headers; } // We first need to simulate |onHeadersReceived| for the response headers // which indicated a need to authenticate. @@ -433,9 +433,10 @@ } on_headers_received_callback_ = std::move(callback); - current_response_.headers = + current_response_ = network::mojom::URLResponseHead::New(); + current_response_->headers = base::MakeRefCounted<net::HttpResponseHeaders>(headers); - current_response_.remote_endpoint = remote_endpoint; + current_response_->remote_endpoint = remote_endpoint; HandleResponseOrRedirectHeaders( base::BindOnce(&InProgressRequest::ContinueToHandleOverrideHeaders, weak_factory_.GetWeakPtr())); @@ -464,7 +465,7 @@ redirect_info.new_url = redirect_url_; redirect_info.new_site_for_cookies = redirect_url_; - network::ResourceResponseHead head; + auto head = network::mojom::URLResponseHead::New(); std::string headers = base::StringPrintf( "HTTP/1.1 %i Internal Redirect\n" "Location: %s\n" @@ -502,11 +503,11 @@ http_origin.c_str()); } } - head.headers = base::MakeRefCounted<net::HttpResponseHeaders>( + head->headers = base::MakeRefCounted<net::HttpResponseHeaders>( net::HttpUtil::AssembleRawHeaders(headers)); - head.encoded_data_length = 0; + head->encoded_data_length = 0; - current_response_ = head; + current_response_ = std::move(head); ContinueToBeforeRedirect(redirect_info, net::OK); } @@ -676,7 +677,7 @@ return; } - info_->AddResponseInfoFromResourceResponse(current_response_); + info_->AddResponseInfoFromResourceResponse(*current_response_); auto continuation = base::BindRepeating(&InProgressRequest::OnAuthRequestHandled, weak_factory_.GetWeakPtr(), base::Passed(&callback)); @@ -754,7 +755,7 @@ // Make sure to update current_response_, since when OnReceiveResponse // is called we will not use its headers as it might be missing the // Set-Cookie line (as that gets stripped over IPC). - current_response_.headers = override_headers_; + current_response_->headers = override_headers_; } } @@ -769,7 +770,7 @@ if (for_cors_preflight_) { // If this is for CORS preflight, there is no associated client. We notify // the completion here, and deletes |this|. - info_->AddResponseInfoFromResourceResponse(current_response_); + info_->AddResponseInfoFromResourceResponse(*current_response_); ExtensionWebRequestEventRouter::GetInstance()->OnResponseStarted( factory_->browser_context_, &info_.value(), net::OK); ExtensionWebRequestEventRouter::GetInstance()->OnCompleted( @@ -794,7 +795,7 @@ DCHECK(!current_request_uses_header_client_ || !override_headers_); if (override_headers_) - current_response_.headers = override_headers_; + current_response_->headers = override_headers_; std::string redirect_location; if (override_headers_ && override_headers_->IsRedirect(&redirect_location)) { @@ -824,13 +825,13 @@ return; } - info_->AddResponseInfoFromResourceResponse(current_response_); + info_->AddResponseInfoFromResourceResponse(*current_response_); proxied_client_binding_.ResumeIncomingMethodCallProcessing(); ExtensionWebRequestEventRouter::GetInstance()->OnResponseStarted( factory_->browser_context_, &info_.value(), net::OK); - target_client_->OnReceiveResponse(current_response_); + target_client_->OnReceiveResponse(std::move(current_response_)); } void WebRequestProxyingURLLoaderFactory::InProgressRequest:: @@ -841,14 +842,15 @@ return; } - info_->AddResponseInfoFromResourceResponse(current_response_); + info_->AddResponseInfoFromResourceResponse(*current_response_); if (proxied_client_binding_.is_bound()) proxied_client_binding_.ResumeIncomingMethodCallProcessing(); ExtensionWebRequestEventRouter::GetInstance()->OnBeforeRedirect( factory_->browser_context_, &info_.value(), redirect_info.new_url); - target_client_->OnReceiveRedirect(redirect_info, current_response_); + target_client_->OnReceiveRedirect(redirect_info, + std::move(current_response_)); request_.url = redirect_info.new_url; request_.method = redirect_info.new_method; request_.site_for_cookies = redirect_info.new_site_for_cookies; @@ -875,7 +877,7 @@ int result = ExtensionWebRequestEventRouter::GetInstance()->OnHeadersReceived( factory_->browser_context_, &info_.value(), copyable_callback, - current_response_.headers.get(), &override_headers_, + current_response_->headers.get(), &override_headers_, &redirect_url_); if (result == net::ERR_BLOCKED_BY_CLIENT) { OnRequestError(network::URLLoaderCompletionStatus(result));
diff --git a/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.h b/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.h index 36795938..669f6b8d 100644 --- a/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.h +++ b/extensions/browser/api/web_request/web_request_proxying_url_loader_factory.h
@@ -27,10 +27,10 @@ #include "net/base/completion_once_callback.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "services/network/public/cpp/resource_request.h" -#include "services/network/public/cpp/resource_response.h" #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/url_loader.mojom.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" +#include "services/network/public/mojom/url_response_head.mojom.h" #include "url/gurl.h" namespace extensions { @@ -153,7 +153,7 @@ // |OnHeadersReceived()| and request completion or restart. Pointers to // these fields are stored in a |BlockedRequest| (created and owned by // ExtensionWebRequestEventRouter) through much of the request's lifetime. - network::ResourceResponseHead current_response_; + network::mojom::URLResponseHeadPtr current_response_; scoped_refptr<net::HttpResponseHeaders> override_headers_; GURL redirect_url_;
diff --git a/extensions/browser/api/web_request/web_request_proxying_websocket.cc b/extensions/browser/api/web_request/web_request_proxying_websocket.cc index be0f8c4..7512b08 100644 --- a/extensions/browser/api/web_request/web_request_proxying_websocket.cc +++ b/extensions/browser/api/web_request/web_request_proxying_websocket.cc
@@ -58,6 +58,7 @@ browser_context_(browser_context), forwarding_handshake_client_(std::move(handshake_client)), request_headers_(request.headers), + response_(network::mojom::URLResponseHead::New()), has_extra_headers_(has_extra_headers), info_(WebRequestInfoInitParams(request_id_generator->Generate(), process_id, @@ -143,7 +144,7 @@ &WebRequestProxyingWebSocket::OnHeadersReceivedComplete, weak_factory_.GetWeakPtr()); int result = ExtensionWebRequestEventRouter::GetInstance()->OnHeadersReceived( - browser_context_, &info_, continuation, response_.headers.get(), + browser_context_, &info_, continuation, response_->headers.get(), &override_headers_, &redirect_url_); if (result == net::ERR_BLOCKED_BY_CLIENT) { @@ -176,23 +177,23 @@ handshake_response_ = std::move(response); readable_ = std::move(readable); - response_.remote_endpoint = handshake_response_->remote_endpoint; + response_->remote_endpoint = handshake_response_->remote_endpoint; - // response_.headers will be set in OnBeforeSendHeaders if + // response_->headers will be set in OnBeforeSendHeaders if // |receiver_as_header_client_| is set. if (receiver_as_header_client_.is_bound()) { ContinueToCompleted(); return; } - response_.headers = + response_->headers = base::MakeRefCounted<net::HttpResponseHeaders>(base::StringPrintf( "HTTP/%d.%d %d %s", handshake_response_->http_version.major_value(), handshake_response_->http_version.minor_value(), handshake_response_->status_code, handshake_response_->status_text.c_str())); for (const auto& header : handshake_response_->headers) - response_.headers->AddHeader(header->name + ": " + header->value); + response_->headers->AddHeader(header->name + ": " + header->value); ContinueToHeadersReceived(); } @@ -220,15 +221,15 @@ return; } - response_.headers = headers; - response_.remote_endpoint = remote_endpoint; + response_->headers = headers; + response_->remote_endpoint = remote_endpoint; auth_required_callback_ = std::move(callback); auto continuation = base::BindRepeating( &WebRequestProxyingWebSocket::OnHeadersReceivedCompleteForAuth, weak_factory_.GetWeakPtr(), auth_info); int result = ExtensionWebRequestEventRouter::GetInstance()->OnHeadersReceived( - browser_context_, &info_, continuation, response_.headers.get(), + browser_context_, &info_, continuation, response_->headers.get(), &override_headers_, &redirect_url_); if (result == net::ERR_BLOCKED_BY_CLIENT) { @@ -261,7 +262,7 @@ DCHECK(receiver_as_header_client_.is_bound()); on_headers_received_callback_ = std::move(callback); - response_.headers = base::MakeRefCounted<net::HttpResponseHeaders>(headers); + response_->headers = base::MakeRefCounted<net::HttpResponseHeaders>(headers); ContinueToHeadersReceived(); } @@ -409,12 +410,12 @@ } if (override_headers_) { - response_.headers = override_headers_; + response_->headers = override_headers_; override_headers_ = nullptr; } ResumeIncomingMethodCallProcessing(); - info_.AddResponseInfoFromResourceResponse(response_); + info_.AddResponseInfoFromResourceResponse(*response_); ExtensionWebRequestEventRouter::GetInstance()->OnResponseStarted( browser_context_, &info_, net::OK); @@ -453,7 +454,7 @@ return; } ResumeIncomingMethodCallProcessing(); - info_.AddResponseInfoFromResourceResponse(response_); + info_.AddResponseInfoFromResourceResponse(*response_); auto continuation = base::BindRepeating(&WebRequestProxyingWebSocket::OnAuthRequiredComplete,
diff --git a/extensions/browser/api/web_request/web_request_proxying_websocket.h b/extensions/browser/api/web_request/web_request_proxying_websocket.h index 01298621..5f65734 100644 --- a/extensions/browser/api/web_request/web_request_proxying_websocket.h +++ b/extensions/browser/api/web_request/web_request_proxying_websocket.h
@@ -20,8 +20,8 @@ #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/network/public/cpp/resource_request.h" -#include "services/network/public/cpp/resource_response.h" #include "services/network/public/mojom/network_context.mojom.h" +#include "services/network/public/mojom/url_response_head.mojom.h" #include "services/network/public/mojom/websocket.mojom.h" #include "url/gurl.h" #include "url/origin.h" @@ -128,7 +128,7 @@ receiver_as_header_client_{this}; net::HttpRequestHeaders request_headers_; - network::ResourceResponseHead response_; + network::mojom::URLResponseHeadPtr response_; net::AuthCredentials auth_credentials_; OnAuthRequiredCallback auth_required_callback_; scoped_refptr<net::HttpResponseHeaders> override_headers_;
diff --git a/extensions/browser/extension_protocols.cc b/extensions/browser/extension_protocols.cc index a733b31..e64ab89c 100644 --- a/extensions/browser/extension_protocols.cc +++ b/extensions/browser/extension_protocols.cc
@@ -77,8 +77,8 @@ #include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" #include "net/http/http_response_info.h" -#include "services/network/public/cpp/resource_response.h" #include "services/network/public/cpp/url_loader_completion_status.h" +#include "services/network/public/mojom/url_response_head.mojom.h" #include "third_party/blink/public/common/features.h" #include "url/url_util.h" @@ -460,13 +460,13 @@ // chunk of HTML. // Leave cache headers out of generated background page jobs. - network::ResourceResponseHead head; + auto head = network::mojom::URLResponseHead::New(); const bool send_cors_headers = false; - head.headers = BuildHttpHeaders(content_security_policy, - send_cors_headers, base::Time()); + head->headers = BuildHttpHeaders(content_security_policy, + send_cors_headers, base::Time()); std::string contents; - GenerateBackgroundPageContents(extension.get(), &head.mime_type, - &head.charset, &contents); + GenerateBackgroundPageContents(extension.get(), &head->mime_type, + &head->charset, &contents); uint32_t size = base::saturated_cast<uint32_t>(contents.size()); mojo::DataPipe pipe(size); MojoResult result = pipe.producer_handle->WriteData( @@ -476,7 +476,7 @@ return; } - client->OnReceiveResponse(head); + client->OnReceiveResponse(std::move(head)); client->OnStartLoadingResponseBody(std::move(pipe.consumer_handle)); client->OnComplete(network::URLLoaderCompletionStatus(net::OK)); return;
diff --git a/extensions/renderer/resources/automation/automation_node.js b/extensions/renderer/resources/automation/automation_node.js index d4caace3..c54aafc4 100644 --- a/extensions/renderer/resources/automation/automation_node.js +++ b/extensions/renderer/resources/automation/automation_node.js
@@ -1201,7 +1201,7 @@ var nodeRefAttributes = [ ['activedescendantId', 'activeDescendant', 'activeDescendantFor'], ['detailsId', 'details', 'detailsFor'], - ['errorMessageId', 'errorMessage', 'errorMessageFor'], + ['errormessageId', 'errorMessage', 'errorMessageFor'], ['inPageLinkTargetId', 'inPageLinkTarget', null], ['nextFocusId', 'nextFocus', null], ['nextOnLineId', 'nextOnLine', null],
diff --git a/fuchsia/engine/browser/cookie_manager_impl_unittest.cc b/fuchsia/engine/browser/cookie_manager_impl_unittest.cc index e25f4b9..e2ce5c9 100644 --- a/fuchsia/engine/browser/cookie_manager_impl_unittest.cc +++ b/fuchsia/engine/browser/cookie_manager_impl_unittest.cc
@@ -348,7 +348,8 @@ } } -TEST_F(CookieManagerImplTest, ReconnectToNetworkContext) { +// TODO(https://crbug.com/1018178): Flakes on GetAllCookies().has_value(). +TEST_F(CookieManagerImplTest, DISABLED_ReconnectToNetworkContext) { // Attach a cookie observer, which we expect should become disconnected with // an appropriate error if the NetworkService goes away. base::RunLoop global_changes_disconnect_loop;
diff --git a/fuchsia/fidl/cast/application_config.fidl b/fuchsia/fidl/cast/application_config.fidl index 4ea9729..03e6e5c 100644 --- a/fuchsia/fidl/cast/application_config.fidl +++ b/fuchsia/fidl/cast/application_config.fidl
@@ -28,6 +28,9 @@ /// URLs. Networking will be disabled if any directories are set. 6: vector<fuchsia.web.ContentDirectoryProvider> content_directories_for_isolated_application; + + /// The URL of the agent to handle this application. + 7: string agent_url; }; /// Service interface for working with application configurations.
diff --git a/gpu/command_buffer/service/service_discardable_manager.cc b/gpu/command_buffer/service/service_discardable_manager.cc index 65baae1b..505b1ff 100644 --- a/gpu/command_buffer/service/service_discardable_manager.cc +++ b/gpu/command_buffer/service/service_discardable_manager.cc
@@ -4,8 +4,13 @@ #include "gpu/command_buffer/service/service_discardable_manager.h" +#include <inttypes.h> + #include "base/memory/singleton.h" +#include "base/strings/stringprintf.h" #include "base/system/sys_info.h" +#include "base/threading/thread_task_runner_handle.h" +#include "base/trace_event/memory_dump_manager.h" #include "build/build_config.h" #include "gpu/command_buffer/service/texture_manager.h" @@ -77,7 +82,15 @@ ServiceDiscardableManager::ServiceDiscardableManager() : entries_(EntryCache::NO_AUTO_EVICT), - cache_size_limit_(DiscardableCacheSizeLimit()) {} + cache_size_limit_(DiscardableCacheSizeLimit()) { + // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview). + // Don't register a dump provider in these cases. + if (base::ThreadTaskRunnerHandle::IsSet()) { + base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( + this, "gpu::ServiceDiscardableManager", + base::ThreadTaskRunnerHandle::Get()); + } +} ServiceDiscardableManager::~ServiceDiscardableManager() { #if DCHECK_IS_ON() @@ -85,6 +98,49 @@ DCHECK(nullptr == entry.second.unlocked_texture_ref); } #endif + base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( + this); +} + +bool ServiceDiscardableManager::OnMemoryDump( + const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) { + using base::trace_event::MemoryAllocatorDump; + using base::trace_event::MemoryDumpLevelOfDetail; + + if (args.level_of_detail == MemoryDumpLevelOfDetail::BACKGROUND) { + std::string dump_name = + base::StringPrintf("gpu/discardable_cache/cache_0x%" PRIXPTR, + reinterpret_cast<uintptr_t>(this)); + MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name); + dump->AddScalar(MemoryAllocatorDump::kNameSize, + MemoryAllocatorDump::kUnitsBytes, total_size_); + + if (!entries_.empty()) { + MemoryAllocatorDump* dump_avg_size = + pmd->CreateAllocatorDump(base::StringPrintf( + "gpu/discardable_cache/avg_image_size/cache_0x%" PRIXPTR, + reinterpret_cast<uintptr_t>(this))); + dump_avg_size->AddScalar(MemoryAllocatorDump::kNameSize, + MemoryAllocatorDump::kUnitsBytes, + total_size_ / entries_.size()); + } + + // Early out, no need for more detail in a BACKGROUND dump. + return true; + } + + for (const auto& entry : entries_) { + std::string dump_name = base::StringPrintf( + "gpu/discardable_cache/cache_0x%" PRIXPTR "/entry_0x%" PRIXPTR, + reinterpret_cast<uintptr_t>(this), + reinterpret_cast<uintptr_t>(entry.second.unlocked_texture_ref.get())); + MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name); + dump->AddScalar(MemoryAllocatorDump::kNameSize, + MemoryAllocatorDump::kUnitsBytes, entry.second.size); + } + + return true; } void ServiceDiscardableManager::InsertLockedTexture(
diff --git a/gpu/command_buffer/service/service_discardable_manager.h b/gpu/command_buffer/service/service_discardable_manager.h index 50b23b9..4a54490 100644 --- a/gpu/command_buffer/service/service_discardable_manager.h +++ b/gpu/command_buffer/service/service_discardable_manager.h
@@ -24,10 +24,15 @@ size_t base_cache_limit, base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); -class GPU_GLES2_EXPORT ServiceDiscardableManager { +class GPU_GLES2_EXPORT ServiceDiscardableManager + : public base::trace_event::MemoryDumpProvider { public: ServiceDiscardableManager(); - ~ServiceDiscardableManager(); + ~ServiceDiscardableManager() override; + + // base::trace_event::MemoryDumpProvider implementation. + bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, + base::trace_event::ProcessMemoryDump* pmd) override; void InsertLockedTexture(uint32_t texture_id, size_t texture_size,
diff --git a/gpu/command_buffer/service/service_transfer_cache.cc b/gpu/command_buffer/service/service_transfer_cache.cc index d8fc008..fceb1d2 100644 --- a/gpu/command_buffer/service/service_transfer_cache.cc +++ b/gpu/command_buffer/service/service_transfer_cache.cc
@@ -131,7 +131,7 @@ // Don't register a dump provider in these cases. if (base::ThreadTaskRunnerHandle::IsSet()) { base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( - this, "cc::GpuImageDecodeCache", base::ThreadTaskRunnerHandle::Get()); + this, "gpu::ServiceTransferCache", base::ThreadTaskRunnerHandle::Get()); } } @@ -157,6 +157,10 @@ return false; total_size_ += entry->CachedSize(); + if (key.entry_type == cc::TransferCacheEntryType::kImage) { + total_image_count_++; + total_image_size_ += entry->CachedSize(); + } entries_.Put(key, CacheEntryInternal(handle, std::move(entry))); EnforceLimits(); return true; @@ -172,6 +176,10 @@ DeleteEntry(key); total_size_ += entry->CachedSize(); + if (key.entry_type == cc::TransferCacheEntryType::kImage) { + total_image_count_++; + total_image_size_ += entry->CachedSize(); + } entries_.Put(key, CacheEntryInternal(base::nullopt, std::move(entry))); EnforceLimits(); @@ -195,6 +203,10 @@ DCHECK_GE(total_size_, it->second.entry->CachedSize()); total_size_ -= it->second.entry->CachedSize(); + if (it->first.entry_type == cc::TransferCacheEntryType::kImage) { + total_image_count_--; + total_image_size_ -= it->second.entry->CachedSize(); + } return entries_.Erase(it); } @@ -227,6 +239,10 @@ } total_size_ -= it->second.entry->CachedSize(); + if (it->first.entry_type == cc::TransferCacheEntryType::kImage) { + total_image_count_--; + total_image_size_ -= it->second.entry->CachedSize(); + } it = entries_.Erase(it); } } @@ -285,6 +301,10 @@ // Insert it in the transfer cache. total_size_ += entry->CachedSize(); + if (key.entry_type == cc::TransferCacheEntryType::kImage) { + total_image_count_++; + total_image_size_ += entry->CachedSize(); + } entries_.Put(key, CacheEntryInternal(handle, std::move(entry))); EnforceLimits(); return true; @@ -302,7 +322,19 @@ reinterpret_cast<uintptr_t>(this)); MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name); dump->AddScalar(MemoryAllocatorDump::kNameSize, - MemoryAllocatorDump::kUnitsBytes, total_size_); + MemoryAllocatorDump::kUnitsBytes, total_image_size_); + + if (total_image_count_ > 0) { + MemoryAllocatorDump* dump_avg_size = + pmd->CreateAllocatorDump(base::StringPrintf( + "gpu/transfer_cache/avg_image_size/cache_0x%" PRIXPTR, + reinterpret_cast<uintptr_t>(this))); + const size_t avg_image_size = + total_image_size_ / (total_image_count_ * 1.0); + dump_avg_size->AddScalar(MemoryAllocatorDump::kNameSize, + MemoryAllocatorDump::kUnitsBytes, + avg_image_size); + } // Early out, no need for more detail in a BACKGROUND dump. return true;
diff --git a/gpu/command_buffer/service/service_transfer_cache.h b/gpu/command_buffer/service/service_transfer_cache.h index 61ac93b0..990152b3 100644 --- a/gpu/command_buffer/service/service_transfer_cache.h +++ b/gpu/command_buffer/service/service_transfer_cache.h
@@ -131,6 +131,10 @@ // Total size of all |entries_|. The same as summing // GpuDiscardableEntry::size for each entry. size_t total_size_ = 0; + // Total size of all |entries_| of TransferCacheEntryType::kImage. + size_t total_image_size_ = 0; + // Number of |entries_| of TransferCacheEntryType::kImage. + int total_image_count_ = 0; // The limit above which the cache will start evicting resources. size_t cache_size_limit_ = 0;
diff --git a/infra/config/buckets/ci.star b/infra/config/buckets/ci.star index d8d2540..2e6144c 100644 --- a/infra/config/buckets/ci.star +++ b/infra/config/buckets/ci.star
@@ -1183,6 +1183,29 @@ ) +def fyi_celab_builder(*, name, **kwargs): + return builder( + name = name, + mastername = 'chromium.fyi', + os = os.WINDOWS_ANY, + executable = luci.recipe(name = 'celab'), + properties = { + 'exclude': 'chrome_only', + 'pool_name': 'celab-chromium-ci', + 'pool_size': 20, + 'tests': '*', + }, + ) + +fyi_celab_builder( + name = 'win-celab-builder-rel', +) + +fyi_celab_builder( + name = 'win-celab-tester-rel', +) + + def fyi_coverage_builder( *, name, @@ -2246,25 +2269,3 @@ executable = luci.recipe(name = 'swarming/deterministic_build'), execution_timeout = 6 * time.hour, ) - - -def win_celab_builder(*, name, **kwargs): - return win_builder( - name = name, - executable = luci.recipe(name = 'celab'), - os = os.WINDOWS_ANY, - properties = { - 'exclude': 'chrome_only', - 'pool_name': 'celab-chromium-ci', - 'pool_size': 20, - 'tests': '*', - }, - ) - -win_celab_builder( - name = 'win-celab-builder-rel', -) - -win_celab_builder( - name = 'win-celab-tester-rel', -)
diff --git a/infra/config/generated/cr-buildbucket.cfg b/infra/config/generated/cr-buildbucket.cfg index a1c4218e..a1325c5 100644 --- a/infra/config/generated/cr-buildbucket.cfg +++ b/infra/config/generated/cr-buildbucket.cfg
@@ -9208,7 +9208,7 @@ cipd_version: "refs/heads/master" properties_j: "$kitchen:{\"devshell\":true,\"git_auth\":true}" properties_j: "exclude:\"chrome_only\"" - properties_j: "mastername:\"chromium.win\"" + properties_j: "mastername:\"chromium.fyi\"" properties_j: "pool_name:\"celab-chromium-ci\"" properties_j: "pool_size:20" properties_j: "tests:\"*\"" @@ -9231,7 +9231,7 @@ cipd_version: "refs/heads/master" properties_j: "$kitchen:{\"devshell\":true,\"git_auth\":true}" properties_j: "exclude:\"chrome_only\"" - properties_j: "mastername:\"chromium.win\"" + properties_j: "mastername:\"chromium.fyi\"" properties_j: "pool_name:\"celab-chromium-ci\"" properties_j: "pool_size:20" properties_j: "tests:\"*\""
diff --git a/ios/chrome/browser/ui/badges/badge_button.mm b/ios/chrome/browser/ui/badges/badge_button.mm index ed6972e..12aeb72a 100644 --- a/ios/chrome/browser/ui/badges/badge_button.mm +++ b/ios/chrome/browser/ui/badges/badge_button.mm
@@ -4,6 +4,8 @@ #import "ios/chrome/browser/ui/badges/badge_button.h" +#import "base/logging.h" +#import "ios/chrome/browser/ui/badges/badge_constants.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/common/colors/semantic_color_names.h" @@ -45,6 +47,7 @@ self.accepted = accepted; void (^changeTintColor)() = ^{ self.tintColor = accepted ? nil : [UIColor colorNamed:kToolbarButtonColor]; + self.accessibilityIdentifier = [self getAccessibilityIdentifier:accepted]; }; if (animated) { [UIView animateWithDuration:kButtonAnimationDuration @@ -73,6 +76,31 @@ #pragma mark - Private +- (NSString*)getAccessibilityIdentifier:(BOOL)accepted { + switch (self.badgeType) { + case BadgeType::kBadgeTypeNone: + NOTREACHED() << "A badge should not have kBadgeTypeNone"; + return nil; + case BadgeType::kBadgeTypePasswordSave: + return accepted ? kBadgeButtonSavePasswordAcceptedAccessibilityIdentifier + : kBadgeButtonSavePasswordAccessibilityIdentifier; + case BadgeType::kBadgeTypePasswordUpdate: + return accepted + ? kBadgeButtonUpdatePasswordAccpetedAccessibilityIdentifier + : kBadgeButtonUpdatePasswordAccessibilityIdentifier; + case BadgeType::kBadgeTypeIncognito: + return kBadgeButtonIncognitoAccessibilityIdentifier; + case BadgeType::kBadgeTypeOverflow: + return kBadgeButtonOverflowAccessibilityIdentifier; + case BadgeType::kBadgeTypeSaveCard: + return accepted ? kBadgeButtonSaveCardAcceptedAccessibilityIdentifier + : kBadgeButtonSaveCardAccessibilityIdentifier; + case BadgeType::kBadgeTypeTranslate: + return accepted ? kBadgeButtonTranslateAcceptedAccessibilityIdentifier + : kBadgeButtonTranslateAccessibilityIdentifier; + } +} + - (void)configureImage { if (self.fullScreenOn && self.fullScreenImage) { [self setImage:self.fullScreenImage forState:UIControlStateNormal];
diff --git a/ios/chrome/browser/ui/badges/badge_constants.h b/ios/chrome/browser/ui/badges/badge_constants.h index 72690c4..7736bd5 100644 --- a/ios/chrome/browser/ui/badges/badge_constants.h +++ b/ios/chrome/browser/ui/badges/badge_constants.h
@@ -9,11 +9,16 @@ // A11y identifiers so that automation can tap on BadgeButtons extern NSString* const kBadgeButtonSavePasswordAccessibilityIdentifier; +extern NSString* const kBadgeButtonSavePasswordAcceptedAccessibilityIdentifier; extern NSString* const kBadgeButtonUpdatePasswordAccessibilityIdentifier; +extern NSString* const + kBadgeButtonUpdatePasswordAccpetedAccessibilityIdentifier; extern NSString* const kBadgeButtonIncognitoAccessibilityIdentifier; extern NSString* const kBadgeButtonOverflowAccessibilityIdentifier; extern NSString* const kBadgeButtonSaveCardAccessibilityIdentifier; +extern NSString* const kBadgeButtonSaveCardAcceptedAccessibilityIdentifier; extern NSString* const kBadgeButtonTranslateAccessibilityIdentifier; +extern NSString* const kBadgeButtonTranslateAcceptedAccessibilityIdentifier; // A11y identifier for the Badge Popup Menu Table View. extern NSString* const kBadgePopupMenuTableViewAccessibilityIdentifier;
diff --git a/ios/chrome/browser/ui/badges/badge_constants.mm b/ios/chrome/browser/ui/badges/badge_constants.mm index b6c566a..65720ff 100644 --- a/ios/chrome/browser/ui/badges/badge_constants.mm +++ b/ios/chrome/browser/ui/badges/badge_constants.mm
@@ -11,9 +11,15 @@ NSString* const kBadgeButtonSavePasswordAccessibilityIdentifier = @"badgeButtonSavePasswordAXID"; +NSString* const kBadgeButtonSavePasswordAcceptedAccessibilityIdentifier = + @"badgeButtonSavePasswordAcceptedAXID"; + NSString* const kBadgeButtonUpdatePasswordAccessibilityIdentifier = @"badgeButtonUpdatePasswordAXID"; +NSString* const kBadgeButtonUpdatePasswordAccpetedAccessibilityIdentifier = + @"badgeButtonUpdatePasswordAcceptedAXID"; + NSString* const kBadgeButtonIncognitoAccessibilityIdentifier = @"badgeButtonIncognitoAXID"; @@ -23,9 +29,15 @@ NSString* const kBadgeButtonSaveCardAccessibilityIdentifier = @"badgeButtonSaveCardAXID"; +NSString* const kBadgeButtonSaveCardAcceptedAccessibilityIdentifier = + @"badgeButtonSaveCardAcceptedAXID"; + NSString* const kBadgeButtonTranslateAccessibilityIdentifier = @"badgeButtonTranslateAXID"; +NSString* const kBadgeButtonTranslateAcceptedAccessibilityIdentifier = + @"badgeButtonTranslateAcceptedAXID"; + NSString* const kBadgePopupMenuTableViewAccessibilityIdentifier = @"badgePopupMenuOverflowAXID";
diff --git a/ios/chrome/browser/ui/badges/badge_view_controller.mm b/ios/chrome/browser/ui/badges/badge_view_controller.mm index fe2314bf..e57275cf 100644 --- a/ios/chrome/browser/ui/badges/badge_view_controller.mm +++ b/ios/chrome/browser/ui/badges/badge_view_controller.mm
@@ -89,7 +89,7 @@ if (displayedBadgeItem) { BadgeButton* newButton = [self.buttonFactory getBadgeButtonForBadgeType:displayedBadgeItem.badgeType]; - [newButton setAccepted:displayedBadgeItem.badgeState == BadgeStateAccepted + [newButton setAccepted:displayedBadgeItem.badgeState & BadgeStateAccepted animated:NO]; self.displayedBadge = newButton; } @@ -116,12 +116,12 @@ if (self.displayedBadge && self.displayedBadge.badgeType == displayedBadgeItem.badgeType) { [self.displayedBadge - setAccepted:displayedBadgeItem.badgeState == BadgeStateAccepted + setAccepted:displayedBadgeItem.badgeState & BadgeStateAccepted animated:YES]; } else { BadgeButton* newButton = [self.buttonFactory getBadgeButtonForBadgeType:displayedBadgeItem.badgeType]; - [newButton setAccepted:displayedBadgeItem.badgeState == BadgeStateAccepted + [newButton setAccepted:displayedBadgeItem.badgeState & BadgeStateAccepted animated:NO]; self.displayedBadge = newButton; }
diff --git a/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator_implementation.h b/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator_implementation.h index 2ec62d7..5bc867c 100644 --- a/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator_implementation.h +++ b/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator_implementation.h
@@ -17,9 +17,7 @@ // successfully. If it returns NO no Modal should be presented. - (BOOL)configureModalViewController; -// Returns YES if the Infobar action was completed successfully. Useful for -// Infobar actions that finish asynchronously to delay marking the Infobar as -// accepted. +// Returns YES if the Infobar Accept action was completed successfully. - (BOOL)isInfobarAccepted; // Performs any actions related to an Infobar Banner presentation.
diff --git a/ios/chrome/browser/ui/infobars/coordinators/infobar_translate_coordinator.mm b/ios/chrome/browser/ui/infobars/coordinators/infobar_translate_coordinator.mm index 1e3b27f9..ee7f378 100644 --- a/ios/chrome/browser/ui/infobars/coordinators/infobar_translate_coordinator.mm +++ b/ios/chrome/browser/ui/infobars/coordinators/infobar_translate_coordinator.mm
@@ -65,8 +65,7 @@ - (void)translateInfoBarDelegate:(translate::TranslateInfoBarDelegate*)delegate didChangeTranslateStep:(translate::TranslateStep)step withErrorType:(translate::TranslateErrors::Type)errorType { - // TODO(crbug.com/1014959): Update currentStep and call - // infobarWasAccepted:forWebState: if translate finished. + // TODO(crbug.com/1014959): implement } - (BOOL)translateInfoBarDelegateDidDismissWithoutInteraction:
diff --git a/ios/showcase/badges/sc_badge_coordinator.h b/ios/showcase/badges/sc_badge_coordinator.h index 2625ab8..be66393 100644 --- a/ios/showcase/badges/sc_badge_coordinator.h +++ b/ios/showcase/badges/sc_badge_coordinator.h
@@ -9,7 +9,10 @@ // A11y identifier for button that will replace the displayed badge with the // overflow badge button. -extern NSString* const kSCDisplayedBadgeToggleButton; +extern NSString* const kSCShowOverflowDisplayedBadgeButton; + +// A11y identifier for button that will show an accepted displayed button. +extern NSString* const kSCShowAcceptedDisplayedBadgeButton; @interface SCBadgeCoordinator : NSObject <NavigationCoordinator>
diff --git a/ios/showcase/badges/sc_badge_coordinator.mm b/ios/showcase/badges/sc_badge_coordinator.mm index d96b02a..bcc565d 100644 --- a/ios/showcase/badges/sc_badge_coordinator.mm +++ b/ios/showcase/badges/sc_badge_coordinator.mm
@@ -20,8 +20,11 @@ #error "This file requires ARC support." #endif -NSString* const kSCDisplayedBadgeToggleButton = - @"kSCDisplayedBadgeToggleButtonAXID"; +NSString* const kSCShowOverflowDisplayedBadgeButton = + @"kSCShowOverflowDisplayedBadgeButtonAXID"; + +NSString* const kSCShowAcceptedDisplayedBadgeButton = + @"kSCShowAcceptedDisplayedBadgeButtonAXID"; @interface BadgeContainerViewController : UIViewController @property(nonatomic, strong) BadgeViewController* centeredChildViewController; @@ -32,44 +35,70 @@ - (void)viewDidLoad { [super viewDidLoad]; - UIStackView* stackView = [[UIStackView alloc] init]; - stackView.translatesAutoresizingMaskIntoConstraints = NO; - stackView.axis = UILayoutConstraintAxisHorizontal; - [self.view addSubview:stackView]; - [NSLayoutConstraint activateConstraints:@[ - [stackView.widthAnchor constraintEqualToConstant:400], - [stackView.heightAnchor constraintEqualToConstant:100] - ]]; - AddSameCenterConstraints(stackView, self.view); + UIStackView* containerStack = [[UIStackView alloc] init]; + containerStack.translatesAutoresizingMaskIntoConstraints = NO; + containerStack.axis = UILayoutConstraintAxisVertical; [self addChildViewController:self.centeredChildViewController]; - [stackView addArrangedSubview:self.centeredChildViewController.view]; + [containerStack addArrangedSubview:self.centeredChildViewController.view]; [self didMoveToParentViewController:self.centeredChildViewController]; - self.centeredChildViewController.view - .translatesAutoresizingMaskIntoConstraints = NO; - [NSLayoutConstraint activateConstraints:@[ - [self.centeredChildViewController.view.widthAnchor - constraintGreaterThanOrEqualToConstant:1], - [self.centeredChildViewController.view.heightAnchor - constraintEqualToConstant:100] - ]]; - UIButton* button = [UIButton buttonWithType:UIButtonTypeSystem]; - button.accessibilityIdentifier = kSCDisplayedBadgeToggleButton; - [button setTitle:@"Show Overflow badge" forState:UIControlStateNormal]; - [button addTarget:self - action:@selector(addSecondBadge:) - forControlEvents:UIControlEventTouchUpInside]; - [stackView addArrangedSubview:button]; + UIStackView* buttonStackView = [[UIStackView alloc] init]; + buttonStackView.axis = UILayoutConstraintAxisHorizontal; + UIButton* showAcceptedBadgeButton = + [UIButton buttonWithType:UIButtonTypeSystem]; + showAcceptedBadgeButton.accessibilityIdentifier = + kSCShowAcceptedDisplayedBadgeButton; + showAcceptedBadgeButton.titleLabel.lineBreakMode = NSLineBreakByWordWrapping; + showAcceptedBadgeButton.titleLabel.textAlignment = NSTextAlignmentCenter; + [showAcceptedBadgeButton setTitle:@"Show Accepted Badge" + forState:UIControlStateNormal]; + [showAcceptedBadgeButton addTarget:self + action:@selector(showAcceptedDisplayedBadge) + forControlEvents:UIControlEventTouchUpInside]; + [buttonStackView addArrangedSubview:showAcceptedBadgeButton]; + + UIButton* showOverflowBadgeButton = + [UIButton buttonWithType:UIButtonTypeSystem]; + showOverflowBadgeButton.accessibilityIdentifier = + kSCShowOverflowDisplayedBadgeButton; + showOverflowBadgeButton.titleLabel.lineBreakMode = NSLineBreakByWordWrapping; + showOverflowBadgeButton.titleLabel.textAlignment = NSTextAlignmentCenter; + [showOverflowBadgeButton setTitle:@"Show Overflow badge" + forState:UIControlStateNormal]; + [showOverflowBadgeButton addTarget:self + action:@selector(addSecondBadge:) + forControlEvents:UIControlEventTouchUpInside]; + [buttonStackView addArrangedSubview:showOverflowBadgeButton]; + + [containerStack addArrangedSubview:buttonStackView]; + [self.view addSubview:containerStack]; + AddSameCenterConstraints(containerStack, self.view); + [NSLayoutConstraint activateConstraints:@[ + [containerStack.widthAnchor constraintEqualToConstant:300], + [containerStack.heightAnchor constraintGreaterThanOrEqualToConstant:100] + ]]; UIView* containerView = self.view; containerView.backgroundColor = [UIColor whiteColor]; + self.title = @"Badges"; AddNamedGuidesToView(@[ kBadgeOverflowMenuGuide ], self.view); BadgeStaticItem* incognitoItem = [[BadgeStaticItem alloc] initWithBadgeType:BadgeType::kBadgeTypeIncognito]; InfobarBadgeModel* passwordBadgeItem = [[InfobarBadgeModel alloc] initWithInfobarType:InfobarType::kInfobarTypePasswordSave]; + passwordBadgeItem.badgeState = BadgeStateRead; + [self.consumer setupWithDisplayedBadge:passwordBadgeItem + fullScreenBadge:incognitoItem]; +} + +- (void)showAcceptedDisplayedBadge { + BadgeStaticItem* incognitoItem = [[BadgeStaticItem alloc] + initWithBadgeType:BadgeType::kBadgeTypeIncognito]; + InfobarBadgeModel* passwordBadgeItem = [[InfobarBadgeModel alloc] + initWithInfobarType:InfobarType::kInfobarTypePasswordSave]; + passwordBadgeItem.badgeState = BadgeStateRead | BadgeStateAccepted; [self.consumer setupWithDisplayedBadge:passwordBadgeItem fullScreenBadge:incognitoItem]; }
diff --git a/ios/showcase/badges/sc_badge_egtest.mm b/ios/showcase/badges/sc_badge_egtest.mm index ff5d7413..181dea1 100644 --- a/ios/showcase/badges/sc_badge_egtest.mm +++ b/ios/showcase/badges/sc_badge_egtest.mm
@@ -43,11 +43,23 @@ kBadgeButtonSavePasswordAccessibilityIdentifier), grey_sufficientlyVisible(), nil)] assertWithMatcher:grey_sufficientlyVisible()]; + + // Tap on button to show the accepted badge. + [[EarlGrey selectElementWithMatcher:grey_accessibilityID( + kSCShowAcceptedDisplayedBadgeButton)] + performAction:grey_tap()]; + [[EarlGrey selectElementWithMatcher: - grey_allOf(grey_accessibilityID( - kBadgeButtonSavePasswordAccessibilityIdentifier), - grey_sufficientlyVisible(), nil)] + grey_allOf( + grey_accessibilityID( + kBadgeButtonSavePasswordAcceptedAccessibilityIdentifier), + grey_sufficientlyVisible(), nil)] + assertWithMatcher:grey_sufficientlyVisible()]; + [[EarlGrey selectElementWithMatcher: + grey_allOf(grey_accessibilityID( + kBadgeButtonIncognitoAccessibilityIdentifier), + grey_sufficientlyVisible(), nil)] assertWithMatcher:grey_sufficientlyVisible()]; } @@ -56,7 +68,7 @@ - (void)testOverflowbadge { // Tap on button to show the overflow badge. [[EarlGrey selectElementWithMatcher:grey_accessibilityID( - kSCDisplayedBadgeToggleButton)] + kSCShowOverflowDisplayedBadgeButton)] performAction:grey_tap()]; // Assert that overflow badge and the unread indicator is shown and tap on it. @@ -86,8 +98,9 @@ // Dismiss popup menu by tapping outside of the menu. Tapping the displayed // badge is sufficient here. Assert that the unread indicator is not there // anymore. - [[EarlGrey selectElementWithMatcher:grey_accessibilityID( - kSCDisplayedBadgeToggleButton)] + [[EarlGrey + selectElementWithMatcher:grey_accessibilityID( + kBadgeButtonOverflowAccessibilityIdentifier)] performAction:grey_tap()]; [[EarlGrey selectElementWithMatcher: grey_allOf(grey_accessibilityID(
diff --git a/media/base/demuxer.h b/media/base/demuxer.h index b2a1124..820744b 100644 --- a/media/base/demuxer.h +++ b/media/base/demuxer.h
@@ -43,8 +43,8 @@ // Stops execution of the pipeline due to a fatal error. Do not call this // method with PIPELINE_OK. Stopping is not immediate so demuxers must be // prepared to soft fail on subsequent calls. E.g., if Demuxer::Seek() is - // called after an unrecoverable error the provided PipelineStatusCB must be - // called with an error. + // called after an unrecoverable error the provided PipelineStatusCallback + // must be called with an error. virtual void OnDemuxerError(PipelineStatus error) = 0; protected: @@ -84,7 +84,7 @@ // lifetime of the demuxer. Don't delete it! |status_cb| must only be run // after this method has returned. virtual void Initialize(DemuxerHost* host, - const PipelineStatusCB& status_cb) = 0; + PipelineStatusCallback status_cb) = 0; // Aborts any pending read operations that the demuxer is involved with; any // read aborted will be aborted with a status of kAborted. Future reads will @@ -119,8 +119,7 @@ // Carry out any actions required to seek to the given time, executing the // callback upon completion. - virtual void Seek(base::TimeDelta time, - const PipelineStatusCB& status_cb) = 0; + virtual void Seek(base::TimeDelta time, PipelineStatusCallback status_cb) = 0; // Stops this demuxer. //
diff --git a/media/base/demuxer_stream.h b/media/base/demuxer_stream.h index 83bdd16..1f45966 100644 --- a/media/base/demuxer_stream.h +++ b/media/base/demuxer_stream.h
@@ -70,8 +70,8 @@ // The first parameter indicates the status of the read. // The second parameter is non-NULL and contains media data // or the end of the stream if the first parameter is kOk. NULL otherwise. - typedef base::Callback<void(Status, scoped_refptr<DecoderBuffer>)> ReadCB; - virtual void Read(const ReadCB& read_cb) = 0; + typedef base::OnceCallback<void(Status, scoped_refptr<DecoderBuffer>)> ReadCB; + virtual void Read(ReadCB read_cb) = 0; // Returns true if a Read() call has been made but the |read_cb| has not yet // been run.
diff --git a/media/base/fake_demuxer_stream.cc b/media/base/fake_demuxer_stream.cc index 5f601f1..a314151b2 100644 --- a/media/base/fake_demuxer_stream.cc +++ b/media/base/fake_demuxer_stream.cc
@@ -66,11 +66,11 @@ next_read_num_ = 0; } -void FakeDemuxerStream::Read(const ReadCB& read_cb) { +void FakeDemuxerStream::Read(ReadCB read_cb) { DCHECK(task_runner_->BelongsToCurrentThread()); DCHECK(!read_cb_); - read_cb_ = BindToCurrentLoop(read_cb); + read_cb_ = BindToCurrentLoop(std::move(read_cb)); if (read_to_hold_ == next_read_num_) return;
diff --git a/media/base/fake_demuxer_stream.h b/media/base/fake_demuxer_stream.h index 590b32a..fb742c5 100644 --- a/media/base/fake_demuxer_stream.h +++ b/media/base/fake_demuxer_stream.h
@@ -29,7 +29,7 @@ ~FakeDemuxerStream() override; // DemuxerStream implementation. - void Read(const ReadCB& read_cb) override; + void Read(ReadCB read_cb) override; bool IsReadPending() const override; AudioDecoderConfig audio_decoder_config() override; VideoDecoderConfig video_decoder_config() override;
diff --git a/media/base/fake_demuxer_stream_unittest.cc b/media/base/fake_demuxer_stream_unittest.cc index bac5741..085b37a 100644 --- a/media/base/fake_demuxer_stream_unittest.cc +++ b/media/base/fake_demuxer_stream_unittest.cc
@@ -103,8 +103,8 @@ void ReadAndExpect(ReadResult result) { EXPECT_FALSE(read_pending_); read_pending_ = true; - stream_->Read(base::Bind(&FakeDemuxerStreamTest::BufferReady, - base::Unretained(this))); + stream_->Read(base::BindOnce(&FakeDemuxerStreamTest::BufferReady, + base::Unretained(this))); base::RunLoop().RunUntilIdle(); ExpectReadResult(result); } @@ -112,8 +112,8 @@ void ReadUntilPending() { while (1) { read_pending_ = true; - stream_->Read(base::Bind(&FakeDemuxerStreamTest::BufferReady, - base::Unretained(this))); + stream_->Read(base::BindOnce(&FakeDemuxerStreamTest::BufferReady, + base::Unretained(this))); base::RunLoop().RunUntilIdle(); if (read_pending_) break;
diff --git a/media/base/fake_text_track_stream.cc b/media/base/fake_text_track_stream.cc index 43178a6..b40eefc 100644 --- a/media/base/fake_text_track_stream.cc +++ b/media/base/fake_text_track_stream.cc
@@ -24,11 +24,11 @@ DCHECK(!read_cb_); } -void FakeTextTrackStream::Read(const ReadCB& read_cb) { +void FakeTextTrackStream::Read(ReadCB read_cb) { DCHECK(read_cb); DCHECK(!read_cb_); OnRead(); - read_cb_ = read_cb; + read_cb_ = std::move(read_cb); if (stopping_) { task_runner_->PostTask(
diff --git a/media/base/fake_text_track_stream.h b/media/base/fake_text_track_stream.h index 2e121c1c..2475e5c7 100644 --- a/media/base/fake_text_track_stream.h +++ b/media/base/fake_text_track_stream.h
@@ -25,7 +25,7 @@ ~FakeTextTrackStream() override; // DemuxerStream implementation. - void Read(const ReadCB&) override; + void Read(ReadCB) override; bool IsReadPending() const override; MOCK_METHOD0(audio_decoder_config, AudioDecoderConfig()); MOCK_METHOD0(video_decoder_config, VideoDecoderConfig());
diff --git a/media/base/media_url_demuxer.cc b/media/base/media_url_demuxer.cc index 2ee66cf..71e2764a 100644 --- a/media/base/media_url_demuxer.cc +++ b/media/base/media_url_demuxer.cc
@@ -48,10 +48,11 @@ } void MediaUrlDemuxer::Initialize(DemuxerHost* host, - const PipelineStatusCB& status_cb) { + PipelineStatusCallback status_cb) { DVLOG(1) << __func__; host_ = host; - task_runner_->PostTask(FROM_HERE, base::BindOnce(status_cb, PIPELINE_OK)); + task_runner_->PostTask(FROM_HERE, + base::BindOnce(std::move(status_cb), PIPELINE_OK)); } void MediaUrlDemuxer::StartWaitingForSeek(base::TimeDelta seek_time) {} @@ -59,8 +60,9 @@ void MediaUrlDemuxer::CancelPendingSeek(base::TimeDelta seek_time) {} void MediaUrlDemuxer::Seek(base::TimeDelta time, - const PipelineStatusCB& status_cb) { - task_runner_->PostTask(FROM_HERE, base::BindOnce(status_cb, PIPELINE_OK)); + PipelineStatusCallback status_cb) { + task_runner_->PostTask(FROM_HERE, + base::BindOnce(std::move(status_cb), PIPELINE_OK)); } void MediaUrlDemuxer::Stop() {}
diff --git a/media/base/media_url_demuxer.h b/media/base/media_url_demuxer.h index 408c5b0..ff0fe02a 100644 --- a/media/base/media_url_demuxer.h +++ b/media/base/media_url_demuxer.h
@@ -49,11 +49,10 @@ // Demuxer interface. std::string GetDisplayName() const override; - void Initialize(DemuxerHost* host, - const PipelineStatusCB& status_cb) override; + void Initialize(DemuxerHost* host, PipelineStatusCallback status_cb) override; void StartWaitingForSeek(base::TimeDelta seek_time) override; void CancelPendingSeek(base::TimeDelta seek_time) override; - void Seek(base::TimeDelta time, const PipelineStatusCB& status_cb) override; + void Seek(base::TimeDelta time, PipelineStatusCallback status_cb) override; void Stop() override; void AbortPendingReads() override; base::TimeDelta GetStartTime() const override;
diff --git a/media/base/media_url_demuxer_unittest.cc b/media/base/media_url_demuxer_unittest.cc index 2e7b87d..e8db5a9 100644 --- a/media/base/media_url_demuxer_unittest.cc +++ b/media/base/media_url_demuxer_unittest.cc
@@ -80,8 +80,8 @@ TEST_F(MediaUrlDemuxerTest, SeekReturnsPipelineOk) { InitializeTest(); demuxer_->Seek(base::TimeDelta(), - base::Bind(&MediaUrlDemuxerTest::VerifyCallbackOk, - base::Unretained(this))); + base::BindOnce(&MediaUrlDemuxerTest::VerifyCallbackOk, + base::Unretained(this))); base::RunLoop().RunUntilIdle(); }
diff --git a/media/base/mock_filters.h b/media/base/mock_filters.h index 24286cc..952419a 100644 --- a/media/base/mock_filters.h +++ b/media/base/mock_filters.h
@@ -151,10 +151,17 @@ // Demuxer implementation. std::string GetDisplayName() const override; - MOCK_METHOD2(Initialize, void(DemuxerHost* host, const PipelineStatusCB& cb)); + void Initialize(DemuxerHost* host, PipelineStatusCallback cb) { + OnInitialize(host, cb); + } + MOCK_METHOD2(OnInitialize, + void(DemuxerHost* host, PipelineStatusCallback& cb)); MOCK_METHOD1(StartWaitingForSeek, void(base::TimeDelta)); MOCK_METHOD1(CancelPendingSeek, void(base::TimeDelta)); - MOCK_METHOD2(Seek, void(base::TimeDelta time, const PipelineStatusCB& cb)); + void Seek(base::TimeDelta time, PipelineStatusCallback cb) { + OnSeek(time, cb); + } + MOCK_METHOD2(OnSeek, void(base::TimeDelta time, PipelineStatusCallback& cb)); MOCK_METHOD0(Stop, void()); MOCK_METHOD0(AbortPendingReads, void()); MOCK_METHOD0(GetAllStreams, std::vector<DemuxerStream*>()); @@ -183,7 +190,8 @@ // DemuxerStream implementation. Type type() const override; Liveness liveness() const override; - MOCK_METHOD1(Read, void(const ReadCB& read_cb)); + void Read(ReadCB read_cb) { OnRead(read_cb); } + MOCK_METHOD1(OnRead, void(ReadCB& read_cb)); MOCK_CONST_METHOD0(IsReadPending, bool()); AudioDecoderConfig audio_decoder_config() override; VideoDecoderConfig video_decoder_config() override; @@ -340,11 +348,17 @@ ~MockRenderer() override; // Renderer implementation. - MOCK_METHOD3(Initialize, + void Initialize(MediaResource* media_resource, + RendererClient* client, + PipelineStatusCallback init_cb) override { + OnInitialize(media_resource, client, init_cb); + } + MOCK_METHOD3(OnInitialize, void(MediaResource* media_resource, RendererClient* client, - const PipelineStatusCB& init_cb)); - MOCK_METHOD1(Flush, void(const base::Closure& flush_cb)); + PipelineStatusCallback& init_cb)); + void Flush(base::OnceClosure flush_cb) { OnFlush(flush_cb); } + MOCK_METHOD1(OnFlush, void(base::OnceClosure& flush_cb)); MOCK_METHOD1(StartPlayingFrom, void(base::TimeDelta timestamp)); MOCK_METHOD1(SetPlaybackRate, void(double playback_rate)); MOCK_METHOD1(SetVolume, void(float volume));
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc index efdf47d2..51a02cc6 100644 --- a/media/base/pipeline_impl.cc +++ b/media/base/pipeline_impl.cc
@@ -150,8 +150,8 @@ void SetState(State next_state); void CompleteSeek(base::TimeDelta seek_time, PipelineStatus status); void CompleteSuspend(PipelineStatus status); - void InitializeDemuxer(const PipelineStatusCB& done_cb); - void InitializeRenderer(const PipelineStatusCB& done_cb); + void InitializeDemuxer(PipelineStatusCallback done_cb); + void InitializeRenderer(PipelineStatusCallback done_cb); void DestroyRenderer(); void ReportMetadata(StartType start_type); @@ -416,8 +416,8 @@ fns.Push(base::BindRepeating(&Demuxer::Seek, base::Unretained(demuxer_), start_timestamp)); - fns.Push(base::BindRepeating(&RendererWrapper::InitializeRenderer, - weak_factory_.GetWeakPtr())); + fns.Push(base::BindOnce(&RendererWrapper::InitializeRenderer, + weak_factory_.GetWeakPtr())); pending_callbacks_ = SerialRunner::Run( std::move(fns), @@ -883,21 +883,21 @@ } void PipelineImpl::RendererWrapper::InitializeDemuxer( - const PipelineStatusCB& done_cb) { + PipelineStatusCallback done_cb) { DCHECK(media_task_runner_->BelongsToCurrentThread()); - demuxer_->Initialize(this, done_cb); + demuxer_->Initialize(this, std::move(done_cb)); } void PipelineImpl::RendererWrapper::InitializeRenderer( - const PipelineStatusCB& done_cb) { + PipelineStatusCallback done_cb) { DCHECK(media_task_runner_->BelongsToCurrentThread()); switch (demuxer_->GetType()) { case MediaResource::Type::STREAM: if (demuxer_->GetAllStreams().empty()) { DVLOG(1) << "Error: demuxer does not have an audio or a video stream."; - done_cb.Run(PIPELINE_ERROR_COULD_NOT_RENDER); + std::move(done_cb).Run(PIPELINE_ERROR_COULD_NOT_RENDER); return; } break; @@ -906,7 +906,7 @@ // NOTE: Empty GURL are not valid. if (!demuxer_->GetMediaUrlParams().media_url.is_valid()) { DVLOG(1) << "Error: demuxer does not have a valid URL."; - done_cb.Run(PIPELINE_ERROR_COULD_NOT_RENDER); + std::move(done_cb).Run(PIPELINE_ERROR_COULD_NOT_RENDER); return; } break; @@ -917,7 +917,7 @@ base::BindRepeating(&IgnoreCdmAttached)); } - shared_state_.renderer->Initialize(demuxer_, this, done_cb); + shared_state_.renderer->Initialize(demuxer_, this, std::move(done_cb)); } void PipelineImpl::RendererWrapper::DestroyRenderer() {
diff --git a/media/base/pipeline_impl_unittest.cc b/media/base/pipeline_impl_unittest.cc index 53ae0aa..dcb09b6 100644 --- a/media/base/pipeline_impl_unittest.cc +++ b/media/base/pipeline_impl_unittest.cc
@@ -32,8 +32,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/geometry/size.h" -using ::base::test::RunCallback; -using ::base::test::RunClosure; +using ::base::test::RunOnceCallback; +using ::base::test::RunOnceClosure; using ::testing::_; using ::testing::AnyNumber; using ::testing::CreateFunctor; @@ -75,7 +75,7 @@ HAS_1_TEMPLATE_PARAMS(int, k), AND_1_VALUE_PARAMS(p0)) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::BindOnce(std::get<k>(args), p0)); + FROM_HERE, base::BindOnce(std::move(std::get<k>(args)), p0)); } // TODO(scherkus): even though some filters are initialized on separate @@ -144,7 +144,7 @@ void SetDemuxerExpectations(MockDemuxerStreamVector* streams, const base::TimeDelta& duration) { EXPECT_CALL(callbacks_, OnDurationChange()); - EXPECT_CALL(*demuxer_, Initialize(_, _)) + EXPECT_CALL(*demuxer_, OnInitialize(_, _)) .WillOnce(DoAll(SaveArg<0>(&demuxer_host_), SetDemuxerProperties(duration), PostCallback<1>(PIPELINE_OK))); @@ -173,7 +173,7 @@ // Sets up expectations to allow the video renderer to initialize. void SetRendererExpectations() { - EXPECT_CALL(*renderer_, Initialize(_, _, _)) + EXPECT_CALL(*renderer_, OnInitialize(_, _, _)) .WillOnce( DoAll(SaveArg<1>(&renderer_client_), PostCallback<2>(PIPELINE_OK))); } @@ -240,10 +240,10 @@ void ExpectSeek(const base::TimeDelta& seek_time, bool underflowed) { EXPECT_CALL(*demuxer_, AbortPendingReads()); - EXPECT_CALL(*demuxer_, Seek(seek_time, _)) - .WillOnce(RunCallback<1>(PIPELINE_OK)); + EXPECT_CALL(*demuxer_, OnSeek(seek_time, _)) + .WillOnce(RunOnceCallback<1>(PIPELINE_OK)); - EXPECT_CALL(*renderer_, Flush(_)).WillOnce(RunClosure<0>()); + EXPECT_CALL(*renderer_, OnFlush(_)).WillOnce(RunOnceClosure<0>()); EXPECT_CALL(*renderer_, SetPlaybackRate(_)); EXPECT_CALL(*renderer_, SetVolume(_)); EXPECT_CALL(*renderer_, StartPlayingFrom(seek_time)) @@ -284,8 +284,8 @@ void ExpectResume(const base::TimeDelta& seek_time) { SetRendererExpectations(); - EXPECT_CALL(*demuxer_, Seek(seek_time, _)) - .WillOnce(RunCallback<1>(PIPELINE_OK)); + EXPECT_CALL(*demuxer_, OnSeek(seek_time, _)) + .WillOnce(RunOnceCallback<1>(PIPELINE_OK)); EXPECT_CALL(*renderer_, SetPlaybackRate(_)); EXPECT_CALL(*renderer_, SetVolume(_)); EXPECT_CALL(*renderer_, StartPlayingFrom(seek_time)) @@ -375,7 +375,7 @@ TEST_F(PipelineImplTest, NeverInitializes) { // Don't execute the callback passed into Initialize(). - EXPECT_CALL(*demuxer_, Initialize(_, _)); + EXPECT_CALL(*demuxer_, OnInitialize(_, _)); // This test hangs during initialization by never calling // InitializationComplete(). StrictMock<> will ensure that the callback is @@ -395,7 +395,7 @@ } TEST_F(PipelineImplTest, StartThenStopImmediately) { - EXPECT_CALL(*demuxer_, Initialize(_, _)) + EXPECT_CALL(*demuxer_, OnInitialize(_, _)) .WillOnce(PostCallback<1>(PIPELINE_OK)); EXPECT_CALL(*demuxer_, Stop()); EXPECT_CALL(callbacks_, OnMetadata(_)); @@ -476,7 +476,7 @@ } TEST_F(PipelineImplTest, NoStreams) { - EXPECT_CALL(*demuxer_, Initialize(_, _)) + EXPECT_CALL(*demuxer_, OnInitialize(_, _)) .WillOnce(PostCallback<1>(PIPELINE_OK)); EXPECT_CALL(callbacks_, OnMetadata(_)); @@ -654,7 +654,7 @@ } TEST_F(PipelineImplTest, BufferedTimeRangesCanChangeAfterStop) { - EXPECT_CALL(*demuxer_, Initialize(_, _)) + EXPECT_CALL(*demuxer_, OnInitialize(_, _)) .WillOnce( DoAll(SaveArg<0>(&demuxer_host_), PostCallback<1>(PIPELINE_OK))); EXPECT_CALL(*demuxer_, Stop()); @@ -701,11 +701,11 @@ base::TimeDelta seek_time = base::TimeDelta::FromSeconds(5); - EXPECT_CALL(*renderer_, Flush(_)).WillOnce(RunClosure<0>()); + EXPECT_CALL(*renderer_, OnFlush(_)).WillOnce(RunOnceClosure<0>()); EXPECT_CALL(*demuxer_, AbortPendingReads()); - EXPECT_CALL(*demuxer_, Seek(seek_time, _)) - .WillOnce(RunCallback<1>(PIPELINE_ERROR_READ)); + EXPECT_CALL(*demuxer_, OnSeek(seek_time, _)) + .WillOnce(RunOnceCallback<1>(PIPELINE_ERROR_READ)); EXPECT_CALL(*demuxer_, Stop()); pipeline_->Seek(seek_time, base::Bind(&CallbackHelper::OnSeek, @@ -752,11 +752,11 @@ base::TimeDelta seek_time = base::TimeDelta::FromSeconds(5); // Seek() isn't called as the demuxer errors out first. - EXPECT_CALL(*renderer_, Flush(_)).WillOnce(RunClosure<0>()); + EXPECT_CALL(*renderer_, OnFlush(_)).WillOnce(RunOnceClosure<0>()); EXPECT_CALL(*demuxer_, AbortPendingReads()); - EXPECT_CALL(*demuxer_, Seek(seek_time, _)) - .WillOnce(RunCallback<1>(PIPELINE_ERROR_READ)); + EXPECT_CALL(*demuxer_, OnSeek(seek_time, _)) + .WillOnce(RunOnceCallback<1>(PIPELINE_ERROR_READ)); EXPECT_CALL(*demuxer_, Stop()); pipeline_->Seek(seek_time, base::Bind(&CallbackHelper::OnSeek, @@ -975,12 +975,12 @@ StopOrError stop_or_error) { if (state == kInitDemuxer) { if (stop_or_error == kStop) { - EXPECT_CALL(*demuxer_, Initialize(_, _)) + EXPECT_CALL(*demuxer_, OnInitialize(_, _)) .WillOnce( DoAll(PostStop(pipeline_.get()), PostCallback<1>(PIPELINE_OK))); // Note: OnStart callback is not called after pipeline is stopped. } else { - EXPECT_CALL(*demuxer_, Initialize(_, _)) + EXPECT_CALL(*demuxer_, OnInitialize(_, _)) .WillOnce(PostCallback<1>(DEMUXER_ERROR_COULD_NOT_OPEN)); EXPECT_CALL(callbacks_, OnStart(DEMUXER_ERROR_COULD_NOT_OPEN)) .WillOnce(Stop(pipeline_.get())); @@ -999,12 +999,12 @@ if (state == kInitRenderer) { if (stop_or_error == kStop) { - EXPECT_CALL(*renderer_, Initialize(_, _, _)) + EXPECT_CALL(*renderer_, OnInitialize(_, _, _)) .WillOnce( DoAll(PostStop(pipeline_.get()), PostCallback<2>(PIPELINE_OK))); // Note: OnStart is not callback after pipeline is stopped. } else { - EXPECT_CALL(*renderer_, Initialize(_, _, _)) + EXPECT_CALL(*renderer_, OnInitialize(_, _, _)) .WillOnce(PostCallback<2>(PIPELINE_ERROR_INITIALIZATION_FAILED)); EXPECT_CALL(callbacks_, OnStart(PIPELINE_ERROR_INITIALIZATION_FAILED)) .WillOnce(Stop(pipeline_.get())); @@ -1015,7 +1015,7 @@ return; } - EXPECT_CALL(*renderer_, Initialize(_, _, _)) + EXPECT_CALL(*renderer_, OnInitialize(_, _, _)) .WillOnce( DoAll(SaveArg<1>(&renderer_client_), PostCallback<2>(PIPELINE_OK))); @@ -1047,35 +1047,33 @@ void SetSeekExpectations(TeardownState state, StopOrError stop_or_error) { if (state == kFlushing) { - EXPECT_CALL(*demuxer_, Seek(_, _)); + EXPECT_CALL(*demuxer_, OnSeek(_, _)); if (stop_or_error == kStop) { - EXPECT_CALL(*renderer_, Flush(_)) - .WillOnce(DoAll( - Stop(pipeline_.get()), RunClosure<0>())); + EXPECT_CALL(*renderer_, OnFlush(_)) + .WillOnce(DoAll(Stop(pipeline_.get()), RunOnceClosure<0>())); // Note: OnSeek callbacks are not called // after pipeline is stopped. } else { - EXPECT_CALL(*renderer_, Flush(_)) - .WillOnce(DoAll( - SetError(&renderer_client_, PIPELINE_ERROR_READ), - RunClosure<0>())); + EXPECT_CALL(*renderer_, OnFlush(_)) + .WillOnce(DoAll(SetError(&renderer_client_, PIPELINE_ERROR_READ), + RunOnceClosure<0>())); EXPECT_CALL(callbacks_, OnSeek(PIPELINE_ERROR_READ)) .WillOnce(Stop(pipeline_.get())); } return; } - EXPECT_CALL(*renderer_, Flush(_)).WillOnce(RunClosure<0>()); + EXPECT_CALL(*renderer_, OnFlush(_)).WillOnce(RunOnceClosure<0>()); if (state == kSeeking) { if (stop_or_error == kStop) { - EXPECT_CALL(*demuxer_, Seek(_, _)) - .WillOnce( - DoAll(PostStop(pipeline_.get()), RunCallback<1>(PIPELINE_OK))); + EXPECT_CALL(*demuxer_, OnSeek(_, _)) + .WillOnce(DoAll(PostStop(pipeline_.get()), + RunOnceCallback<1>(PIPELINE_OK))); // Note: OnSeek callback is not called after pipeline is stopped. } else { - EXPECT_CALL(*demuxer_, Seek(_, _)) - .WillOnce(RunCallback<1>(PIPELINE_ERROR_READ)); + EXPECT_CALL(*demuxer_, OnSeek(_, _)) + .WillOnce(RunOnceCallback<1>(PIPELINE_ERROR_READ)); EXPECT_CALL(callbacks_, OnSeek(PIPELINE_ERROR_READ)) .WillOnce(Stop(pipeline_.get())); } @@ -1110,13 +1108,13 @@ EXPECT_CALL(callbacks_, OnSuspend(PIPELINE_OK)); if (state == kResuming) { if (stop_or_error == kStop) { - EXPECT_CALL(*demuxer_, Seek(_, _)) - .WillOnce( - DoAll(PostStop(pipeline_.get()), RunCallback<1>(PIPELINE_OK))); + EXPECT_CALL(*demuxer_, OnSeek(_, _)) + .WillOnce(DoAll(PostStop(pipeline_.get()), + RunOnceCallback<1>(PIPELINE_OK))); // Note: OnResume callback is not called after pipeline is stopped. } else { - EXPECT_CALL(*demuxer_, Seek(_, _)) - .WillOnce(RunCallback<1>(PIPELINE_ERROR_READ)); + EXPECT_CALL(*demuxer_, OnSeek(_, _)) + .WillOnce(RunOnceCallback<1>(PIPELINE_ERROR_READ)); EXPECT_CALL(callbacks_, OnResume(PIPELINE_ERROR_READ)) .WillOnce(Stop(pipeline_.get())); }
diff --git a/media/base/pipeline_status.h b/media/base/pipeline_status.h index 5759bbd..31b001c 100644 --- a/media/base/pipeline_status.h +++ b/media/base/pipeline_status.h
@@ -58,7 +58,10 @@ PIPELINE_STATUS_MAX = DEMUXER_ERROR_DETECTED_HLS, }; +// TODO(crbug.com/1007799): Delete PipelineStatusCB once all callbacks are +// converted to PipelineStatusCallback. typedef base::RepeatingCallback<void(PipelineStatus)> PipelineStatusCB; +typedef base::OnceCallback<void(PipelineStatus)> PipelineStatusCallback; struct PipelineDecoderInfo { bool is_platform_decoder = false;
diff --git a/media/base/renderer.h b/media/base/renderer.h index 07e772b..4489f32 100644 --- a/media/base/renderer.h +++ b/media/base/renderer.h
@@ -34,7 +34,7 @@ // be run only prior to returning. virtual void Initialize(MediaResource* media_resource, RendererClient* client, - const PipelineStatusCB& init_cb) = 0; + PipelineStatusCallback init_cb) = 0; // Associates the |cdm_context| with this Renderer for decryption (and // decoding) of media data, then fires |cdm_attached_cb| with the result. @@ -44,7 +44,7 @@ // The following functions must be called after Initialize(). // Discards any buffered data, executing |flush_cb| when completed. - virtual void Flush(const base::Closure& flush_cb) = 0; + virtual void Flush(base::OnceClosure flush_cb) = 0; // Starts rendering from |time|. virtual void StartPlayingFrom(base::TimeDelta time) = 0;
diff --git a/media/base/serial_runner.cc b/media/base/serial_runner.cc index 88d8133..176a9c9 100644 --- a/media/base/serial_runner.cc +++ b/media/base/serial_runner.cc
@@ -12,29 +12,31 @@ namespace media { -// Converts a Closure into a bound function accepting a PipelineStatusCB. +// Converts a Closure into a bound function accepting a PipelineStatusCallback. static void RunClosure(base::OnceClosure closure, - const PipelineStatusCB& status_cb) { + PipelineStatusCallback status_cb) { std::move(closure).Run(); - status_cb.Run(PIPELINE_OK); + std::move(status_cb).Run(PIPELINE_OK); } // Converts a bound function accepting a Closure into a bound function -// accepting a PipelineStatusCB. Since closures have no way of reporting a +// accepting a PipelineStatusCallback. Since closures have no way of reporting a // status |status_cb| is executed with PIPELINE_OK. static void RunBoundClosure(SerialRunner::BoundClosure bound_closure, - const PipelineStatusCB& status_cb) { - std::move(bound_closure).Run(base::BindRepeating(status_cb, PIPELINE_OK)); + PipelineStatusCallback status_cb) { + std::move(bound_closure) + .Run(base::BindOnce(std::move(status_cb), PIPELINE_OK)); } // Runs |status_cb| with |last_status| on |task_runner|. static void RunOnTaskRunner( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, - const PipelineStatusCB& status_cb, + PipelineStatusCallback status_cb, PipelineStatus last_status) { // Force post to permit cancellation of a series in the scenario where all // bound functions run on the same thread. - task_runner->PostTask(FROM_HERE, base::BindRepeating(status_cb, last_status)); + task_runner->PostTask(FROM_HERE, + base::BindOnce(std::move(status_cb), last_status)); } SerialRunner::Queue::Queue() = default; @@ -50,12 +52,12 @@ base::BindOnce(&RunBoundClosure, std::move(bound_closure))); } -void SerialRunner::Queue::Push(BoundPipelineStatusCB bound_status_cb) { +void SerialRunner::Queue::Push(BoundPipelineStatusCallback bound_status_cb) { bound_fns_.push_back(std::move(bound_status_cb)); } -SerialRunner::BoundPipelineStatusCB SerialRunner::Queue::Pop() { - BoundPipelineStatusCB bound_fn = std::move(bound_fns_.front()); +SerialRunner::BoundPipelineStatusCallback SerialRunner::Queue::Pop() { + BoundPipelineStatusCallback bound_fn = std::move(bound_fns_.front()); bound_fns_.pop_front(); return bound_fn; } @@ -64,10 +66,10 @@ return bound_fns_.empty(); } -SerialRunner::SerialRunner(Queue&& bound_fns, const PipelineStatusCB& done_cb) +SerialRunner::SerialRunner(Queue&& bound_fns, PipelineStatusCallback done_cb) : task_runner_(base::ThreadTaskRunnerHandle::Get()), bound_fns_(std::move(bound_fns)), - done_cb_(done_cb) { + done_cb_(std::move(done_cb)) { // Respect both cancellation and calling stack guarantees for |done_cb| // when empty. if (bound_fns_.empty()) { @@ -84,9 +86,9 @@ std::unique_ptr<SerialRunner> SerialRunner::Run( Queue&& bound_fns, - const PipelineStatusCB& done_cb) { + PipelineStatusCallback done_cb) { std::unique_ptr<SerialRunner> callback_series( - new SerialRunner(std::move(bound_fns), done_cb)); + new SerialRunner(std::move(bound_fns), std::move(done_cb))); return callback_series; } @@ -99,7 +101,7 @@ return; } - BoundPipelineStatusCB bound_fn = bound_fns_.Pop(); + BoundPipelineStatusCallback bound_fn = bound_fns_.Pop(); std::move(bound_fn).Run( base::BindRepeating(&RunOnTaskRunner, task_runner_, base::BindRepeating(&SerialRunner::RunNextInSeries,
diff --git a/media/base/serial_runner.h b/media/base/serial_runner.h index 86830dd..da4ac1d 100644 --- a/media/base/serial_runner.h +++ b/media/base/serial_runner.h
@@ -21,14 +21,15 @@ namespace media { -// Runs a series of bound functions accepting Closures or PipelineStatusCB. -// SerialRunner doesn't use regular Closure/PipelineStatusCBs as it late binds -// the completion callback as the series progresses. +// Runs a series of bound functions accepting Closures or +// PipelineStatusCallback. SerialRunner doesn't use regular +// OnceClosure/PipelineStatusCallbacks as it late binds the completion callback +// as the series progresses. class MEDIA_EXPORT SerialRunner { public: - typedef base::OnceCallback<void(const base::Closure&)> BoundClosure; - typedef base::OnceCallback<void(const PipelineStatusCB&)> - BoundPipelineStatusCB; + typedef base::OnceCallback<void(base::OnceClosure)> BoundClosure; + typedef base::OnceCallback<void(PipelineStatusCallback)> + BoundPipelineStatusCallback; // Serial queue of bound functions to run. class MEDIA_EXPORT Queue { @@ -39,7 +40,7 @@ void Push(base::OnceClosure closure); void Push(BoundClosure bound_fn); - void Push(BoundPipelineStatusCB bound_fn); + void Push(BoundPipelineStatusCallback bound_fn); private: Queue(const Queue&) = delete; @@ -47,10 +48,10 @@ friend class SerialRunner; - BoundPipelineStatusCB Pop(); + BoundPipelineStatusCallback Pop(); bool empty(); - base::circular_deque<BoundPipelineStatusCB> bound_fns_; + base::circular_deque<BoundPipelineStatusCallback> bound_fns_; }; // Executes the bound functions in series, executing |done_cb| when finished. @@ -68,19 +69,19 @@ // Deleting the object will prevent execution of any unstarted bound // functions, including |done_cb|. static std::unique_ptr<SerialRunner> Run(Queue&& bound_fns, - const PipelineStatusCB& done_cb); + PipelineStatusCallback done_cb); private: friend std::default_delete<SerialRunner>; - SerialRunner(Queue&& bound_fns, const PipelineStatusCB& done_cb); + SerialRunner(Queue&& bound_fns, PipelineStatusCallback done_cb); ~SerialRunner(); void RunNextInSeries(PipelineStatus last_status); scoped_refptr<base::SingleThreadTaskRunner> task_runner_; Queue bound_fns_; - PipelineStatusCB done_cb_; + PipelineStatusCallback done_cb_; // NOTE: Weak pointers must be invalidated before all other member variables. base::WeakPtrFactory<SerialRunner> weak_factory_{this};
diff --git a/media/base/serial_runner_unittest.cc b/media/base/serial_runner_unittest.cc index 1510822e..f619951 100644 --- a/media/base/serial_runner_unittest.cc +++ b/media/base/serial_runner_unittest.cc
@@ -69,25 +69,24 @@ private: void RunBoundFunction(PipelineStatus status, size_t index, - const PipelineStatusCB& status_cb) { + PipelineStatusCallback status_cb) { EXPECT_EQ(index == 0u, inside_start_) << "First bound function should run on same stack as " << "SerialRunner::Run() while all others should not\n" << base::debug::StackTrace().ToString(); called_[index] = true; - status_cb.Run(status); + std::move(status_cb).Run(status); } - void RunBoundClosure(size_t index, - const base::Closure& done_cb) { + void RunBoundClosure(size_t index, base::OnceClosure done_cb) { EXPECT_EQ(index == 0u, inside_start_) << "First bound function should run on same stack as " << "SerialRunner::Run() while all others should not\n" << base::debug::StackTrace().ToString(); called_[index] = true; - done_cb.Run(); + std::move(done_cb).Run(); } void RunClosure(size_t index) { @@ -117,12 +116,12 @@ done_status_ = status; } - void CancelSerialRunner(const PipelineStatusCB& status_cb) { + void CancelSerialRunner(PipelineStatusCallback status_cb) { // Tasks run by |runner_| shouldn't reset it, hence we post a task to do so. task_environment_.GetMainThreadTaskRunner()->PostTask( FROM_HERE, base::BindOnce(&SerialRunnerTest::ResetSerialRunner, base::Unretained(this))); - status_cb.Run(PIPELINE_OK); + std::move(status_cb).Run(PIPELINE_OK); } void ResetSerialRunner() {
diff --git a/media/base/text_renderer.cc b/media/base/text_renderer.cc index 44c0eb4..38b468c 100644 --- a/media/base/text_renderer.cc +++ b/media/base/text_renderer.cc
@@ -311,8 +311,8 @@ state->read_state = TextTrackState::kReadPending; ++pending_read_count_; - text_stream->Read(base::Bind( - &TextRenderer::BufferReady, weak_factory_.GetWeakPtr(), text_stream)); + text_stream->Read(base::BindOnce(&TextRenderer::BufferReady, + weak_factory_.GetWeakPtr(), text_stream)); } TextRenderer::TextTrackState::TextTrackState(std::unique_ptr<TextTrack> tt)
diff --git a/media/filters/audio_decoder_stream_unittest.cc b/media/filters/audio_decoder_stream_unittest.cc index 98b9181..2a96da1 100644 --- a/media/filters/audio_decoder_stream_unittest.cc +++ b/media/filters/audio_decoder_stream_unittest.cc
@@ -130,8 +130,8 @@ ASSERT_NE(first_decoder, nullptr); // Make a regular DemuxerStream::Read(). - EXPECT_CALL(*demuxer_stream(), Read(_)) - .WillOnce(RunCallback<0>(DemuxerStream::kOk, new DecoderBuffer(12))); + EXPECT_CALL(*demuxer_stream(), OnRead(_)) + .WillOnce(RunOnceCallback<0>(DemuxerStream::kOk, new DecoderBuffer(12))); EXPECT_CALL(*decoder(), Decode(IsRegularDecoderBuffer(), _)) .WillOnce(Invoke(this, &AudioDecoderStreamTest::ProduceDecoderOutput)); base::RunLoop run_loop0; @@ -141,8 +141,8 @@ // Make a config-change DemuxerStream::Read(). // Expect the decoder to be flushed. Upon flushing, the decoder releases // internally buffered output. - EXPECT_CALL(*demuxer_stream(), Read(_)) - .WillOnce(RunCallback<0>(DemuxerStream::kConfigChanged, nullptr)); + EXPECT_CALL(*demuxer_stream(), OnRead(_)) + .WillOnce(RunOnceCallback<0>(DemuxerStream::kConfigChanged, nullptr)); EXPECT_CALL(*decoder(), Decode(IsEOSDecoderBuffer(), _)) .WillOnce(Invoke(this, &AudioDecoderStreamTest::ProduceDecoderOutput)); base::RunLoop run_loop1;
diff --git a/media/filters/audio_renderer_algorithm.cc b/media/filters/audio_renderer_algorithm.cc index e70d4db..88c10a8 100644 --- a/media/filters/audio_renderer_algorithm.cc +++ b/media/filters/audio_renderer_algorithm.cc
@@ -7,11 +7,13 @@ #include <algorithm> #include <cmath> +#include "base/bind.h" #include "base/logging.h" #include "cc/base/math_util.h" #include "media/base/audio_bus.h" #include "media/base/audio_timestamp_helper.h" #include "media/base/limits.h" +#include "media/base/multi_channel_resampler.h" #include "media/filters/wsola_internals.h" namespace media { @@ -157,6 +159,73 @@ CreateSearchWrappers(); } +void AudioRendererAlgorithm::OnResamplerRead(int frame_delay, + AudioBus* audio_bus) { + input_frames_read_or_buffered_ += + audio_buffer_.ReadFrames(audio_bus->frames(), 0, audio_bus); +} + +int AudioRendererAlgorithm::CalculateOutputFramesResampled( + double playback_rate, + int requested_frames) { + double input_frames_consumed = + input_frames_read_or_buffered_ - resampler_->BufferedFrames(); + + int output_frames = + static_cast<int>(input_frames_consumed / playback_rate + 0.5); + + // The first or second call to resample appears to consume more input frames + // than it actually does. This is due to the internals of |resampler_| + // treating the first data read differently, to prime internal buffers. We + // therefore appear to have read up to SincResampler::kKernelSize more frames + // when using the difference between calls to |resampler_->BufferedFrames()|. + // |resampler_| never actually writes more frames than we request out of it, + // so we can safely cap this value here. + return std::min(output_frames, requested_frames); +} + +int AudioRendererAlgorithm::ResampleAndFill(AudioBus* dest, + int dest_offset, + int requested_frames, + double playback_rate) { + if (!resampler_) { + resampler_ = std::make_unique<MultiChannelResampler>( + channels_, playback_rate, SincResampler::kDefaultRequestSize, + base::BindRepeating(&AudioRendererAlgorithm::OnResamplerRead, + base::Unretained(this))); + } + + resampler_->SetRatio(playback_rate); + + // Reset with leftover frames from previous resampling iteration. + input_frames_read_or_buffered_ = resampler_->BufferedFrames(); + + // Directly use |dest| for the most common case of having 0 offset. + if (!dest_offset) { + resampler_->Resample(requested_frames, dest); + + return CalculateOutputFramesResampled(playback_rate, requested_frames); + } + + // This is only really used once, at the beginning of a stream, which means + // we can use a temporary variable, rather than saving it as a member. + // NOTE: We don't wrap |dest|'s channel data in an AudioBus wrapper, because + // |dest_offset| isn't aligned always with AudioBus::kChannelAlignment. + std::unique_ptr<AudioBus> resampler_output = + AudioBus::Create(channels_, requested_frames); + + resampler_->Resample(requested_frames, resampler_output.get()); + + int output_frames = + CalculateOutputFramesResampled(playback_rate, requested_frames); + + DCHECK_LE(output_frames, resampler_output->frames()); + + resampler_output->CopyPartialFramesTo(0, output_frames, dest_offset, dest); + + return output_frames; +} + int AudioRendererAlgorithm::FillBuffer(AudioBus* dest, int dest_offset, int requested_frames, @@ -185,6 +254,18 @@ return frames_read; } + // WSOLA at playback rates that are close to 1.0 produces noticeable + // warbling and stuttering. We prefer resampling the audio at these speeds. + // This does results in a noticeable pitch shift. + // NOTE: The cutoff values are arbitrary, and picked based off of a tradeoff + // between "resample pitch shift" vs "WSOLA distortions". + constexpr double kLowerResampleThreshold = 0.95; + constexpr double kUpperResampleThreshold = 1.06; + if (kLowerResampleThreshold <= playback_rate && + playback_rate <= kUpperResampleThreshold) { + return ResampleAndFill(dest, dest_offset, requested_frames, playback_rate); + } + // Allocate structures on first non-1.0 playback rate; these can eat a fair // chunk of memory. ~56kB for stereo 48kHz, up to ~765kB for 7.1 192kHz. if (!ola_window_) { @@ -235,6 +316,8 @@ wsola_output_->Zero(); num_complete_frames_ = 0; + resampler_.reset(); + // Reset |capacity_| so growth triggered by underflows doesn't penalize seek // time. capacity_ = initial_capacity_;
diff --git a/media/filters/audio_renderer_algorithm.h b/media/filters/audio_renderer_algorithm.h index 05c0662..9f928d13 100644 --- a/media/filters/audio_renderer_algorithm.h +++ b/media/filters/audio_renderer_algorithm.h
@@ -35,6 +35,7 @@ namespace media { class AudioBus; +class MultiChannelResampler; class MEDIA_EXPORT AudioRendererAlgorithm { public: @@ -145,6 +146,24 @@ // mask has been specified. void CreateSearchWrappers(); + // Uses |resampler_| to speed up or slowdown audio, by using a resampling + // ratio of |playback_rate|. + int ResampleAndFill(AudioBus* dest, + int dest_offset, + int requested_frames, + double playback_rate); + + // Called by |resampler_| to get more audio data. + void OnResamplerRead(int frame_delay, AudioBus* audio_bus); + + // Calculate how many frames |resampler_| wrote to output, based off of + // |input_frames_read_or_buffered_| and |resampler_->BufferedFrames()|. + // + // NOTE: The return value is always <= |request_frames|. See comment in the + // implementation file. + int CalculateOutputFramesResampled(double playback_rate, + int requested_frames); + // Parameters. AudioRendererAlgorithmParameters audio_renderer_algorithm_params_; @@ -198,6 +217,14 @@ // specifies the index where the next WSOLA window has to overlap-and-add. int num_complete_frames_; + // Used to replace WSOLA algorithm at playback speeds close to 1.0. This is to + // prevent noticeable audio artifacts introduced by WSOLA, at the expense of + // changing the pitch of the audio. + std::unique_ptr<MultiChannelResampler> resampler_; + + // Number of input frames read or buffered by |resampler_|. + double input_frames_read_or_buffered_ = 0; + // This stores a part of the output that is created but couldn't be rendered. // Output is generated frame-by-frame which at some point might exceed the // number of requested samples. Furthermore, due to overlap-and-add,
diff --git a/media/filters/audio_renderer_algorithm_unittest.cc b/media/filters/audio_renderer_algorithm_unittest.cc index 7be7a989..7b5323c2 100644 --- a/media/filters/audio_renderer_algorithm_unittest.cc +++ b/media/filters/audio_renderer_algorithm_unittest.cc
@@ -189,13 +189,14 @@ const int kDefaultFramesRequested = kOutputDurationInSec * algorithm_.samples_per_second(); - TestPlaybackRate( - playback_rate, kDefaultBufferSize, kDefaultFramesRequested); + TestPlaybackRate(playback_rate, kDefaultBufferSize, kDefaultFramesRequested, + 0); } void TestPlaybackRate(double playback_rate, int buffer_size_in_frames, - int total_frames_requested) { + int total_frames_requested, + int dest_offset) { int initial_frames_enqueued = frames_enqueued_; int initial_frames_buffered = algorithm_.frames_buffered(); @@ -211,9 +212,10 @@ int frames_remaining = total_frames_requested; bool first_fill_buffer = true; while (frames_remaining > 0) { - int frames_requested = std::min(buffer_size_in_frames, frames_remaining); - int frames_written = - algorithm_.FillBuffer(bus.get(), 0, frames_requested, playback_rate); + int frames_requested = + std::min(buffer_size_in_frames - dest_offset, frames_remaining); + int frames_written = algorithm_.FillBuffer( + bus.get(), dest_offset, frames_requested, playback_rate); ASSERT_GT(frames_written, 0) << "Requested: " << frames_requested << ", playing at " << playback_rate; @@ -356,7 +358,7 @@ TEST_F(AudioRendererAlgorithmTest, FillBuffer_Bitstream) { Initialize(CHANNEL_LAYOUT_STEREO, kSampleFormatEac3, kSamplesPerSecond, kSamplesPerSecond / 100); - TestPlaybackRate(1.0, kFrameSize, 16 * kFrameSize); + TestPlaybackRate(1.0, kFrameSize, 16 * kFrameSize, /* dest_offset */ 0); } TEST_F(AudioRendererAlgorithmTest, FillBuffer_NormalRate) { @@ -374,6 +376,36 @@ TestPlaybackRate(0.9999); } +// This test verifies that the resampling based time stretch algorithms works. +// The range of playback rates in which we use resampling is [0.95, 1.06]. +TEST_F(AudioRendererAlgorithmTest, FillBuffer_ResamplingRates) { + Initialize(); + TestPlaybackRate(0.94); // WSOLA. + TestPlaybackRate(0.95); // Lower limit of resampling. + TestPlaybackRate(0.97); + TestPlaybackRate(1.00); + TestPlaybackRate(1.04); + TestPlaybackRate(1.06); // Upper limit of resampling. + TestPlaybackRate(1.07); // WSOLA. +} + +TEST_F(AudioRendererAlgorithmTest, FillBuffer_WithOffset) { + Initialize(); + const int kBufferSize = algorithm_.samples_per_second() / 10; + const int kOffset = kBufferSize / 10; + const int kFramesRequested = + kOutputDurationInSec * algorithm_.samples_per_second(); + + // No time-strech. + TestPlaybackRate(1.00, kBufferSize, kFramesRequested, kOffset); + + // Resampling based time-strech. + TestPlaybackRate(1.05, kBufferSize, kFramesRequested, kOffset); + + // WSOLA based time-strech. + TestPlaybackRate(1.25, kBufferSize, kFramesRequested, kOffset); +} + TEST_F(AudioRendererAlgorithmTest, FillBuffer_OneAndAQuarterRate) { Initialize(); TestPlaybackRate(1.25); @@ -447,9 +479,9 @@ Initialize(); static const int kBufferSizeInFrames = 1; static const int kFramesRequested = kOutputDurationInSec * kSamplesPerSecond; - TestPlaybackRate(1.0, kBufferSizeInFrames, kFramesRequested); - TestPlaybackRate(0.5, kBufferSizeInFrames, kFramesRequested); - TestPlaybackRate(1.5, kBufferSizeInFrames, kFramesRequested); + TestPlaybackRate(1.0, kBufferSizeInFrames, kFramesRequested, 0); + TestPlaybackRate(0.5, kBufferSizeInFrames, kFramesRequested, 0); + TestPlaybackRate(1.5, kBufferSizeInFrames, kFramesRequested, 0); } TEST_F(AudioRendererAlgorithmTest, FillBuffer_LargeBufferSize) {
diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc index 44e589d3..a1da779 100644 --- a/media/filters/chunk_demuxer.cc +++ b/media/filters/chunk_demuxer.cc
@@ -288,12 +288,12 @@ } // DemuxerStream methods. -void ChunkDemuxerStream::Read(const ReadCB& read_cb) { +void ChunkDemuxerStream::Read(ReadCB read_cb) { base::AutoLock auto_lock(lock_); DCHECK_NE(state_, UNINITIALIZED); DCHECK(!read_cb_); - read_cb_ = BindToCurrentLoop(read_cb); + read_cb_ = BindToCurrentLoop(std::move(read_cb)); if (!is_enabled_) { DVLOG(1) << "Read from disabled stream, returning EOS"; @@ -463,14 +463,14 @@ } void ChunkDemuxer::Initialize(DemuxerHost* host, - const PipelineStatusCB& init_cb) { + PipelineStatusCallback init_cb) { DVLOG(1) << "Initialize()"; TRACE_EVENT_ASYNC_BEGIN0("media", "ChunkDemuxer::Initialize", this); base::AutoLock auto_lock(lock_); if (state_ == SHUTDOWN) { // Init cb must only be run after this method returns, so post. - init_cb_ = BindToCurrentLoop(init_cb); + init_cb_ = BindToCurrentLoop(std::move(init_cb)); RunInitCB_Locked(DEMUXER_ERROR_COULD_NOT_OPEN); return; } @@ -481,7 +481,7 @@ // error after initialization, the error might be reported before init_cb // has a chance to run. This is because ChunkDemuxer::ReportError_Locked // directly calls DemuxerHost::OnDemuxerError: crbug.com/633016. - init_cb_ = init_cb; + init_cb_ = std::move(init_cb); ChangeState_Locked(INITIALIZING); @@ -493,7 +493,7 @@ Shutdown(); } -void ChunkDemuxer::Seek(TimeDelta time, const PipelineStatusCB& cb) { +void ChunkDemuxer::Seek(TimeDelta time, PipelineStatusCallback cb) { DVLOG(1) << "Seek(" << time.InSecondsF() << ")"; DCHECK(time >= TimeDelta()); TRACE_EVENT_ASYNC_BEGIN0("media", "ChunkDemuxer::Seek", this); @@ -501,7 +501,7 @@ base::AutoLock auto_lock(lock_); DCHECK(!seek_cb_); - seek_cb_ = BindToCurrentLoop(cb); + seek_cb_ = BindToCurrentLoop(std::move(cb)); if (state_ != INITIALIZED && state_ != ENDED) { RunSeekCB_Locked(PIPELINE_ERROR_INVALID_STATE); return;
diff --git a/media/filters/chunk_demuxer.h b/media/filters/chunk_demuxer.h index 214f700..65ae3a4a 100644 --- a/media/filters/chunk_demuxer.h +++ b/media/filters/chunk_demuxer.h
@@ -118,7 +118,7 @@ void UnmarkEndOfStream(); // DemuxerStream methods. - void Read(const ReadCB& read_cb) override; + void Read(ReadCB read_cb) override; bool IsReadPending() const override; Type type() const override; Liveness liveness() const override; @@ -216,9 +216,9 @@ // |enable_text| Process inband text tracks in the normal way when true, // otherwise ignore them. - void Initialize(DemuxerHost* host, const PipelineStatusCB& init_cb) override; + void Initialize(DemuxerHost* host, PipelineStatusCallback init_cb) override; void Stop() override; - void Seek(base::TimeDelta time, const PipelineStatusCB& cb) override; + void Seek(base::TimeDelta time, PipelineStatusCallback cb) override; base::Time GetTimelineOffset() const override; std::vector<DemuxerStream*> GetAllStreams() override; base::TimeDelta GetStartTime() const override; @@ -479,12 +479,12 @@ // MediaLog for reporting messages and properties to debug content and engine. MediaLog* media_log_; - PipelineStatusCB init_cb_; + PipelineStatusCallback init_cb_; // Callback to execute upon seek completion. // TODO(wolenetz/acolwell): Protect against possible double-locking by first // releasing |lock_| before executing this callback. See // http://crbug.com/308226 - PipelineStatusCB seek_cb_; + PipelineStatusCallback seek_cb_; using OwnedChunkDemuxerStreamVector = std::vector<std::unique_ptr<ChunkDemuxerStream>>;
diff --git a/media/filters/chunk_demuxer_unittest.cc b/media/filters/chunk_demuxer_unittest.cc index a52051f..42d6d790 100644 --- a/media/filters/chunk_demuxer_unittest.cc +++ b/media/filters/chunk_demuxer_unittest.cc
@@ -958,17 +958,17 @@ return nullptr; } - void Read(DemuxerStream::Type type, const DemuxerStream::ReadCB& read_cb) { - GetStream(type)->Read(read_cb); + void Read(DemuxerStream::Type type, DemuxerStream::ReadCB read_cb) { + GetStream(type)->Read(std::move(read_cb)); base::RunLoop().RunUntilIdle(); } - void ReadAudio(const DemuxerStream::ReadCB& read_cb) { - Read(DemuxerStream::AUDIO, read_cb); + void ReadAudio(DemuxerStream::ReadCB read_cb) { + Read(DemuxerStream::AUDIO, std::move(read_cb)); } - void ReadVideo(const DemuxerStream::ReadCB& read_cb) { - Read(DemuxerStream::VIDEO, read_cb); + void ReadVideo(DemuxerStream::ReadCB read_cb) { + Read(DemuxerStream::VIDEO, std::move(read_cb)); } void GenerateExpectedReads(int timecode, int block_count) { @@ -1082,8 +1082,8 @@ *last_timestamp = kNoTimestamp; do { - stream->Read(base::Bind(&ChunkDemuxerTest::StoreStatusAndBuffer, - base::Unretained(this), status, &buffer)); + stream->Read(base::BindOnce(&ChunkDemuxerTest::StoreStatusAndBuffer, + base::Unretained(this), status, &buffer)); base::RunLoop().RunUntilIdle(); if (*status == DemuxerStream::kOk && !buffer->end_of_stream()) *last_timestamp = buffer->timestamp(); @@ -1093,7 +1093,7 @@ void ExpectEndOfStream(DemuxerStream::Type type) { EXPECT_CALL(*this, ReadDone(DemuxerStream::kOk, IsEndOfStream())); GetStream(type)->Read( - base::Bind(&ChunkDemuxerTest::ReadDone, base::Unretained(this))); + base::BindOnce(&ChunkDemuxerTest::ReadDone, base::Unretained(this))); base::RunLoop().RunUntilIdle(); } @@ -1101,14 +1101,14 @@ EXPECT_CALL(*this, ReadDone(DemuxerStream::kOk, HasTimestamp(timestamp_in_ms))); GetStream(type)->Read( - base::Bind(&ChunkDemuxerTest::ReadDone, base::Unretained(this))); + base::BindOnce(&ChunkDemuxerTest::ReadDone, base::Unretained(this))); base::RunLoop().RunUntilIdle(); } void ExpectConfigChanged(DemuxerStream::Type type) { EXPECT_CALL(*this, ReadDone(DemuxerStream::kConfigChanged, _)); GetStream(type)->Read( - base::Bind(&ChunkDemuxerTest::ReadDone, base::Unretained(this))); + base::BindOnce(&ChunkDemuxerTest::ReadDone, base::Unretained(this))); base::RunLoop().RunUntilIdle(); } @@ -1123,8 +1123,8 @@ // left to return. DemuxerStream::Status status = DemuxerStream::kAborted; scoped_refptr<DecoderBuffer> buffer; - stream->Read(base::Bind(&ChunkDemuxerTest::StoreStatusAndBuffer, - base::Unretained(this), &status, &buffer)); + stream->Read(base::BindOnce(&ChunkDemuxerTest::StoreStatusAndBuffer, + base::Unretained(this), &status, &buffer)); base::RunLoop().RunUntilIdle(); if (status != DemuxerStream::kOk || buffer->end_of_stream()) break; @@ -1192,18 +1192,18 @@ bool video_read_done = false; if (timestamps[i].audio_time_ms != kSkip) { - ReadAudio(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds( - timestamps[i].audio_time_ms), - &audio_read_done)); + ReadAudio(base::BindOnce( + &OnReadDone, + base::TimeDelta::FromMilliseconds(timestamps[i].audio_time_ms), + &audio_read_done)); EXPECT_TRUE(audio_read_done); } if (timestamps[i].video_time_ms != kSkip) { - ReadVideo(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds( - timestamps[i].video_time_ms), - &video_read_done)); + ReadVideo(base::BindOnce( + &OnReadDone, + base::TimeDelta::FromMilliseconds(timestamps[i].video_time_ms), + &video_read_done)); EXPECT_TRUE(video_read_done); } } @@ -1441,8 +1441,8 @@ bool audio_read_done = false; bool video_read_done = false; - audio_stream->Read(base::Bind(&OnReadDone_EOSExpected, &audio_read_done)); - video_stream->Read(base::Bind(&OnReadDone_EOSExpected, &video_read_done)); + audio_stream->Read(base::BindOnce(&OnReadDone_EOSExpected, &audio_read_done)); + video_stream->Read(base::BindOnce(&OnReadDone_EOSExpected, &video_read_done)); base::RunLoop().RunUntilIdle(); EXPECT_FALSE(audio_read_done); @@ -1540,12 +1540,10 @@ bool audio_read_done = false; bool video_read_done = false; - ReadAudio(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(0), - &audio_read_done)); - ReadVideo(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(0), - &video_read_done)); + ReadAudio(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(0), + &audio_read_done)); + ReadVideo(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(0), + &video_read_done)); EXPECT_TRUE(audio_read_done); EXPECT_TRUE(video_read_done); @@ -1748,8 +1746,10 @@ EXPECT_FALSE(audio_read_done_); EXPECT_FALSE(video_read_done_); - audio_stream_->Read(base::Bind(&OnEndOfStreamReadDone, &audio_read_done_)); - video_stream_->Read(base::Bind(&OnEndOfStreamReadDone, &video_read_done_)); + audio_stream_->Read( + base::BindOnce(&OnEndOfStreamReadDone, &audio_read_done_)); + video_stream_->Read( + base::BindOnce(&OnEndOfStreamReadDone, &video_read_done_)); base::RunLoop().RunUntilIdle(); } @@ -1792,12 +1792,10 @@ EndOfStreamHelper end_of_stream_helper_1(audio_stream, video_stream); EndOfStreamHelper end_of_stream_helper_2(audio_stream, video_stream); - ReadAudio(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(0), - &audio_read_done_1)); - ReadVideo(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(0), - &video_read_done_1)); + ReadAudio(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(0), + &audio_read_done_1)); + ReadVideo(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(0), + &video_read_done_1)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(audio_read_done_1); @@ -1830,12 +1828,10 @@ EndOfStreamHelper end_of_stream_helper_2(audio_stream, video_stream); EndOfStreamHelper end_of_stream_helper_3(audio_stream, video_stream); - ReadAudio(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(0), - &audio_read_done_1)); - ReadVideo(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(0), - &video_read_done_1)); + ReadAudio(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(0), + &audio_read_done_1)); + ReadVideo(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(0), + &video_read_done_1)); end_of_stream_helper_1.RequestReads(); @@ -2057,12 +2053,10 @@ bool audio_read_done = false; bool video_read_done = false; - ReadAudio(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(0), - &audio_read_done)); - ReadVideo(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(0), - &video_read_done)); + ReadAudio(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(0), + &audio_read_done)); + ReadVideo(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(0), + &video_read_done)); // Make sure the reads haven't completed yet. EXPECT_FALSE(audio_read_done); @@ -2081,12 +2075,10 @@ audio_read_done = false; video_read_done = false; - ReadAudio(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(23), - &audio_read_done)); - ReadVideo(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(33), - &video_read_done)); + ReadAudio(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(23), + &audio_read_done)); + ReadVideo(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(33), + &video_read_done)); // Make sure the reads haven't completed yet. EXPECT_FALSE(audio_read_done); @@ -2270,7 +2262,7 @@ // Read() from audio should return "end of stream" buffers. bool audio_read_done = false; - audio_stream->Read(base::Bind(&OnReadDone_EOSExpected, &audio_read_done)); + audio_stream->Read(base::BindOnce(&OnReadDone_EOSExpected, &audio_read_done)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(audio_read_done); @@ -2305,8 +2297,8 @@ // Attempt to read in unbuffered area; should not fulfill the read. bool audio_read_done = false; bool video_read_done = false; - ReadAudio(base::Bind(&OnReadDone_AbortExpected, &audio_read_done)); - ReadVideo(base::Bind(&OnReadDone_AbortExpected, &video_read_done)); + ReadAudio(base::BindOnce(&OnReadDone_AbortExpected, &audio_read_done)); + ReadVideo(base::BindOnce(&OnReadDone_AbortExpected, &video_read_done)); EXPECT_FALSE(audio_read_done); EXPECT_FALSE(video_read_done); @@ -2341,8 +2333,8 @@ // Read requests should be fulfilled with empty buffers. bool audio_read_done = false; bool video_read_done = false; - ReadAudio(base::Bind(&OnReadDone_AbortExpected, &audio_read_done)); - ReadVideo(base::Bind(&OnReadDone_AbortExpected, &video_read_done)); + ReadAudio(base::BindOnce(&OnReadDone_AbortExpected, &audio_read_done)); + ReadVideo(base::BindOnce(&OnReadDone_AbortExpected, &video_read_done)); EXPECT_TRUE(audio_read_done); EXPECT_TRUE(video_read_done); @@ -2367,12 +2359,10 @@ // Read() should return buffers at 0. bool audio_read_done = false; bool video_read_done = false; - ReadAudio(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(0), - &audio_read_done)); - ReadVideo(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(0), - &video_read_done)); + ReadAudio(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(0), + &audio_read_done)); + ReadVideo(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(0), + &video_read_done)); EXPECT_TRUE(audio_read_done); EXPECT_TRUE(video_read_done); @@ -2381,12 +2371,10 @@ audio_read_done = false; video_read_done = false; - ReadAudio(base::Bind(&OnReadDone, - base::TimeDelta::FromSeconds(3), - &audio_read_done)); - ReadVideo(base::Bind(&OnReadDone, - base::TimeDelta::FromSeconds(3), - &video_read_done)); + ReadAudio(base::BindOnce(&OnReadDone, base::TimeDelta::FromSeconds(3), + &audio_read_done)); + ReadVideo(base::BindOnce(&OnReadDone, base::TimeDelta::FromSeconds(3), + &video_read_done)); // Read()s should not return until after data is appended at the Seek point. EXPECT_FALSE(audio_read_done); EXPECT_FALSE(video_read_done); @@ -3475,12 +3463,10 @@ bool audio_read_done = false; bool video_read_done = false; - ReadAudio(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(138), - &audio_read_done)); - ReadVideo(base::Bind(&OnReadDone, - base::TimeDelta::FromMilliseconds(138), - &video_read_done)); + ReadAudio(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(138), + &audio_read_done)); + ReadVideo(base::BindOnce(&OnReadDone, base::TimeDelta::FromMilliseconds(138), + &video_read_done)); // Verify that the reads didn't complete EXPECT_FALSE(audio_read_done); @@ -3511,10 +3497,8 @@ // Verify that reads block because the append cleared the end of stream state. audio_read_done = false; video_read_done = false; - ReadAudio(base::Bind(&OnReadDone_EOSExpected, - &audio_read_done)); - ReadVideo(base::Bind(&OnReadDone_EOSExpected, - &video_read_done)); + ReadAudio(base::BindOnce(&OnReadDone_EOSExpected, &audio_read_done)); + ReadVideo(base::BindOnce(&OnReadDone_EOSExpected, &video_read_done)); // Verify that the reads don't complete. EXPECT_FALSE(audio_read_done); @@ -4465,11 +4449,11 @@ // Verify stream status changes with pending read. bool read_done = false; - audio_stream->Read(base::Bind(&OnReadDone_EOSExpected, &read_done)); + audio_stream->Read(base::BindOnce(&OnReadDone_EOSExpected, &read_done)); DisableAndEnableDemuxerTracks(demuxer_.get(), &task_environment_); EXPECT_TRUE(read_done); read_done = false; - video_stream->Read(base::Bind(&OnReadDone_EOSExpected, &read_done)); + video_stream->Read(base::BindOnce(&OnReadDone_EOSExpected, &read_done)); DisableAndEnableDemuxerTracks(demuxer_.get(), &task_environment_); EXPECT_TRUE(read_done); }
diff --git a/media/filters/decoder_stream.cc b/media/filters/decoder_stream.cc index c2cf3da8..37ddc1a 100644 --- a/media/filters/decoder_stream.cc +++ b/media/filters/decoder_stream.cc
@@ -662,8 +662,8 @@ TRACE_EVENT_ASYNC_BEGIN0("media", GetDemuxerReadTraceString<StreamType>(), this); pending_demuxer_read_ = true; - stream_->Read(base::BindRepeating(&DecoderStream<StreamType>::OnBufferReady, - weak_factory_.GetWeakPtr())); + stream_->Read(base::BindOnce(&DecoderStream<StreamType>::OnBufferReady, + weak_factory_.GetWeakPtr())); } template <DemuxerStream::Type StreamType>
diff --git a/media/filters/decrypting_demuxer_stream.cc b/media/filters/decrypting_demuxer_stream.cc index b27967c..2354d1258 100644 --- a/media/filters/decrypting_demuxer_stream.cc +++ b/media/filters/decrypting_demuxer_stream.cc
@@ -71,16 +71,16 @@ std::move(init_cb_).Run(PIPELINE_OK); } -void DecryptingDemuxerStream::Read(const ReadCB& read_cb) { +void DecryptingDemuxerStream::Read(ReadCB read_cb) { DVLOG(3) << __func__; DCHECK(task_runner_->BelongsToCurrentThread()); DCHECK_EQ(state_, kIdle) << state_; DCHECK(read_cb); CHECK(!read_cb_) << "Overlapping reads are not supported."; - read_cb_ = BindToCurrentLoop(read_cb); + read_cb_ = BindToCurrentLoop(std::move(read_cb)); state_ = kPendingDemuxerRead; - demuxer_stream_->Read(base::Bind( + demuxer_stream_->Read(base::BindOnce( &DecryptingDemuxerStream::OnBufferReadFromDemuxerStream, weak_this_)); }
diff --git a/media/filters/decrypting_demuxer_stream.h b/media/filters/decrypting_demuxer_stream.h index a93011c1..9042856 100644 --- a/media/filters/decrypting_demuxer_stream.h +++ b/media/filters/decrypting_demuxer_stream.h
@@ -55,7 +55,7 @@ std::string GetDisplayName() const; // DemuxerStream implementation. - void Read(const ReadCB& read_cb) override; + void Read(ReadCB read_cb) override; bool IsReadPending() const override; AudioDecoderConfig audio_decoder_config() override; VideoDecoderConfig video_decoder_config() override;
diff --git a/media/filters/decrypting_demuxer_stream_unittest.cc b/media/filters/decrypting_demuxer_stream_unittest.cc index 4698b8c..134a24a 100644 --- a/media/filters/decrypting_demuxer_stream_unittest.cc +++ b/media/filters/decrypting_demuxer_stream_unittest.cc
@@ -23,6 +23,7 @@ #include "testing/gmock/include/gmock/gmock.h" using ::base::test::RunCallback; +using ::base::test::RunOnceCallback; using ::testing::_; using ::testing::HasSubstr; using ::testing::InSequence; @@ -33,6 +34,12 @@ namespace media { +ACTION_TEMPLATE(MoveArg, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_1_VALUE_PARAMS(out)) { + *out = std::move(::testing::get<k>(args)); +} + static const int kFakeBufferSize = 16; static const uint8_t kFakeKeyId[] = {0x4b, 0x65, 0x79, 0x20, 0x49, 0x44}; static const uint8_t kFakeIv[DecryptConfig::kDecryptionKeySize] = {0}; @@ -60,7 +67,8 @@ namespace { ACTION_P(ReturnBuffer, buffer) { - arg0.Run(buffer.get() ? DemuxerStream::kOk : DemuxerStream::kAborted, buffer); + std::move(arg0).Run( + buffer.get() ? DemuxerStream::kOk : DemuxerStream::kAborted, buffer); } } // namespace @@ -162,15 +170,15 @@ else EXPECT_CALL(*this, BufferReady(status, decrypted_buffer)); - demuxer_stream_->Read(base::Bind(&DecryptingDemuxerStreamTest::BufferReady, - base::Unretained(this))); + demuxer_stream_->Read(base::BindOnce( + &DecryptingDemuxerStreamTest::BufferReady, base::Unretained(this))); base::RunLoop().RunUntilIdle(); } void EnterClearReadingState(bool is_stream_encrypted) { // Unencrypted streams never have a DecryptConfig. EXPECT_FALSE(clear_encrypted_stream_buffer_->decrypt_config()); - EXPECT_CALL(*input_audio_stream_, Read(_)) + EXPECT_CALL(*input_audio_stream_, OnRead(_)) .WillOnce(ReturnBuffer(is_stream_encrypted ? clear_encrypted_stream_buffer_ : clear_buffer_)); @@ -180,8 +188,8 @@ scoped_refptr<DecoderBuffer> decrypted_buffer; EXPECT_CALL(*this, BufferReady(DemuxerStream::kOk, _)) .WillOnce(SaveArg<1>(&decrypted_buffer)); - demuxer_stream_->Read(base::Bind(&DecryptingDemuxerStreamTest::BufferReady, - base::Unretained(this))); + demuxer_stream_->Read(base::BindOnce( + &DecryptingDemuxerStreamTest::BufferReady, base::Unretained(this))); base::RunLoop().RunUntilIdle(); EXPECT_FALSE(decrypted_buffer->decrypt_config()); @@ -190,7 +198,7 @@ // Sets up expectations and actions to put DecryptingDemuxerStream in an // active normal reading state. void EnterNormalReadingState() { - EXPECT_CALL(*input_audio_stream_, Read(_)) + EXPECT_CALL(*input_audio_stream_, OnRead(_)) .WillOnce(ReturnBuffer(encrypted_buffer_)); EXPECT_CALL(*decryptor_, Decrypt(_, _, _)) .WillOnce(RunCallback<2>(Decryptor::kSuccess, decrypted_buffer_)); @@ -201,10 +209,10 @@ // Make the read callback pending by saving and not firing it. void EnterPendingReadState() { EXPECT_TRUE(!pending_demuxer_read_cb_); - EXPECT_CALL(*input_audio_stream_, Read(_)) - .WillOnce(SaveArg<0>(&pending_demuxer_read_cb_)); - demuxer_stream_->Read(base::Bind(&DecryptingDemuxerStreamTest::BufferReady, - base::Unretained(this))); + EXPECT_CALL(*input_audio_stream_, OnRead(_)) + .WillOnce(MoveArg<0>(&pending_demuxer_read_cb_)); + demuxer_stream_->Read(base::BindOnce( + &DecryptingDemuxerStreamTest::BufferReady, base::Unretained(this))); base::RunLoop().RunUntilIdle(); // Make sure the Read() triggers a Read() on the input demuxer stream. EXPECT_FALSE(!pending_demuxer_read_cb_); @@ -213,13 +221,13 @@ // Make the decrypt callback pending by saving and not firing it. void EnterPendingDecryptState() { EXPECT_TRUE(!pending_decrypt_cb_); - EXPECT_CALL(*input_audio_stream_, Read(_)) + EXPECT_CALL(*input_audio_stream_, OnRead(_)) .WillRepeatedly(ReturnBuffer(encrypted_buffer_)); EXPECT_CALL(*decryptor_, Decrypt(_, encrypted_buffer_, _)) .WillOnce(SaveArg<2>(&pending_decrypt_cb_)); - demuxer_stream_->Read(base::Bind(&DecryptingDemuxerStreamTest::BufferReady, - base::Unretained(this))); + demuxer_stream_->Read(base::BindOnce( + &DecryptingDemuxerStreamTest::BufferReady, base::Unretained(this))); base::RunLoop().RunUntilIdle(); // Make sure Read() triggers a Decrypt() on the decryptor. EXPECT_FALSE(!pending_decrypt_cb_); @@ -227,15 +235,15 @@ void EnterWaitingForKeyState() { InSequence s; - EXPECT_CALL(*input_audio_stream_, Read(_)) + EXPECT_CALL(*input_audio_stream_, OnRead(_)) .WillRepeatedly(ReturnBuffer(encrypted_buffer_)); EXPECT_CALL(*decryptor_, Decrypt(_, encrypted_buffer_, _)) .WillRepeatedly( RunCallback<2>(Decryptor::kNoKey, scoped_refptr<DecoderBuffer>())); EXPECT_MEDIA_LOG(HasSubstr("DecryptingDemuxerStream: no key for key ID")); EXPECT_CALL(*this, OnWaiting(WaitingReason::kNoDecryptionKey)); - demuxer_stream_->Read(base::Bind(&DecryptingDemuxerStreamTest::BufferReady, - base::Unretained(this))); + demuxer_stream_->Read(base::BindOnce( + &DecryptingDemuxerStreamTest::BufferReady, base::Unretained(this))); base::RunLoop().RunUntilIdle(); } @@ -343,7 +351,7 @@ TEST_F(DecryptingDemuxerStreamTest, Read_DecryptError) { Initialize(); - EXPECT_CALL(*input_audio_stream_, Read(_)) + EXPECT_CALL(*input_audio_stream_, OnRead(_)) .WillRepeatedly(ReturnBuffer(encrypted_buffer_)); EXPECT_CALL(*decryptor_, Decrypt(_, encrypted_buffer_, _)) .WillRepeatedly( @@ -356,7 +364,7 @@ TEST_F(DecryptingDemuxerStreamTest, Read_DecryptNeedMoreData) { Initialize(); - EXPECT_CALL(*input_audio_stream_, Read(_)) + EXPECT_CALL(*input_audio_stream_, OnRead(_)) .WillRepeatedly(ReturnBuffer(encrypted_buffer_)); EXPECT_CALL(*decryptor_, Decrypt(_, encrypted_buffer_, _)) .WillRepeatedly(RunCallback<2>(Decryptor::kNeedMoreData, @@ -371,7 +379,7 @@ EnterNormalReadingState(); // No Decryptor::Decrypt() call is expected for EOS buffer. - EXPECT_CALL(*input_audio_stream_, Read(_)) + EXPECT_CALL(*input_audio_stream_, OnRead(_)) .WillOnce(ReturnBuffer(DecoderBuffer::CreateEOSBuffer())); ReadAndExpectBufferReadyWith(DemuxerStream::kOk, @@ -469,7 +477,7 @@ Initialize(); // ReturnBuffer() with NULL triggers aborted demuxer read. - EXPECT_CALL(*input_audio_stream_, Read(_)) + EXPECT_CALL(*input_audio_stream_, OnRead(_)) .WillOnce(ReturnBuffer(scoped_refptr<DecoderBuffer>())); ReadAndExpectBufferReadyWith(DemuxerStream::kAborted, NULL); @@ -497,9 +505,9 @@ AesCtrEncryptionScheme()); input_audio_stream_->set_audio_decoder_config(new_config); - EXPECT_CALL(*input_audio_stream_, Read(_)) - .WillOnce(RunCallback<0>(DemuxerStream::kConfigChanged, - scoped_refptr<DecoderBuffer>())); + EXPECT_CALL(*input_audio_stream_, OnRead(_)) + .WillOnce(RunOnceCallback<0>(DemuxerStream::kConfigChanged, + scoped_refptr<DecoderBuffer>())); ReadAndExpectBufferReadyWith(DemuxerStream::kConfigChanged, NULL); }
diff --git a/media/filters/decrypting_media_resource_unittest.cc b/media/filters/decrypting_media_resource_unittest.cc index 5d20ddcb..22da4e4 100644 --- a/media/filters/decrypting_media_resource_unittest.cc +++ b/media/filters/decrypting_media_resource_unittest.cc
@@ -41,7 +41,8 @@ namespace { ACTION_P(ReturnBuffer, buffer) { - arg0.Run(buffer.get() ? DemuxerStream::kOk : DemuxerStream::kAborted, buffer); + std::move(arg0).Run( + buffer.get() ? DemuxerStream::kOk : DemuxerStream::kAborted, buffer); } } // namespace @@ -211,7 +212,7 @@ TEST_F(DecryptingMediaResourceTest, WaitingCallback) { AddStream(DemuxerStream::VIDEO, /* encrypted = */ true); - EXPECT_CALL(*streams_.front(), Read(_)) + EXPECT_CALL(*streams_.front(), OnRead(_)) .WillRepeatedly(ReturnBuffer(encrypted_buffer_)); EXPECT_CALL(decryptor_, Decrypt(_, encrypted_buffer_, _)) .WillRepeatedly( @@ -221,7 +222,7 @@ decrypting_media_resource_->Initialize( decrypting_media_resource_init_cb_.Get(), waiting_cb_.Get()); - decrypting_media_resource_->GetAllStreams().front()->Read(base::BindRepeating( + decrypting_media_resource_->GetAllStreams().front()->Read(base::BindOnce( &DecryptingMediaResourceTest::BufferReady, base::Unretained(this))); task_environment_.RunUntilIdle(); }
diff --git a/media/filters/demuxer_perftest.cc b/media/filters/demuxer_perftest.cc index e249b5ad..92406d1 100644 --- a/media/filters/demuxer_perftest.cc +++ b/media/filters/demuxer_perftest.cc
@@ -117,10 +117,10 @@ base::TimeDelta timestamp; base::RunLoop run_loop; - streams_[index]->Read( - base::Bind(&StreamReader::OnReadDone, base::Unretained(this), - base::ThreadTaskRunnerHandle::Get(), - run_loop.QuitWhenIdleClosure(), &end_of_stream, ×tamp)); + streams_[index]->Read(base::BindOnce( + &StreamReader::OnReadDone, base::Unretained(this), + base::ThreadTaskRunnerHandle::Get(), run_loop.QuitWhenIdleClosure(), + &end_of_stream, ×tamp)); run_loop.Run(); CHECK(end_of_stream || timestamp != media::kNoTimestamp);
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc index 2e7783d..2d9cb852 100644 --- a/media/filters/ffmpeg_demuxer.cc +++ b/media/filters/ffmpeg_demuxer.cc
@@ -721,10 +721,10 @@ return liveness_; } -void FFmpegDemuxerStream::Read(const ReadCB& read_cb) { +void FFmpegDemuxerStream::Read(ReadCB read_cb) { DCHECK(task_runner_->BelongsToCurrentThread()); CHECK(!read_cb_) << "Overlapping reads are not supported"; - read_cb_ = BindToCurrentLoop(read_cb); + read_cb_ = BindToCurrentLoop(std::move(read_cb)); // Don't accept any additional reads if we've been told to stop. // The |demuxer_| may have been destroyed in the pipeline thread. @@ -951,11 +951,11 @@ } void FFmpegDemuxer::Initialize(DemuxerHost* host, - const PipelineStatusCB& init_cb) { + PipelineStatusCallback init_cb) { DCHECK(task_runner_->BelongsToCurrentThread()); host_ = host; weak_this_ = cancel_pending_seek_factory_.GetWeakPtr(); - init_cb_ = init_cb; + init_cb_ = std::move(init_cb); // Give a WeakPtr to BlockingUrlProtocol since we'll need to release it on the // blocking thread pool. @@ -1061,11 +1061,11 @@ } } -void FFmpegDemuxer::Seek(base::TimeDelta time, const PipelineStatusCB& cb) { +void FFmpegDemuxer::Seek(base::TimeDelta time, PipelineStatusCallback cb) { DCHECK(task_runner_->BelongsToCurrentThread()); DCHECK(!pending_seek_cb_); TRACE_EVENT_ASYNC_BEGIN0("media", "FFmpegDemuxer::Seek", this); - pending_seek_cb_ = cb; + pending_seek_cb_ = std::move(cb); SeekInternal(time, base::BindOnce(&FFmpegDemuxer::OnSeekFrameSuccess, weak_factory_.GetWeakPtr())); }
diff --git a/media/filters/ffmpeg_demuxer.h b/media/filters/ffmpeg_demuxer.h index 82fc912..ecd10d60 100644 --- a/media/filters/ffmpeg_demuxer.h +++ b/media/filters/ffmpeg_demuxer.h
@@ -112,7 +112,7 @@ // DemuxerStream implementation. Type type() const override; Liveness liveness() const override; - void Read(const ReadCB& read_cb) override; + void Read(ReadCB read_cb) override; bool IsReadPending() const override; void EnableBitstreamConverter() override; bool SupportsConfigChanges() override; @@ -219,12 +219,12 @@ // Demuxer implementation. std::string GetDisplayName() const override; - void Initialize(DemuxerHost* host, const PipelineStatusCB& init_cb) override; + void Initialize(DemuxerHost* host, PipelineStatusCallback init_cb) override; void AbortPendingReads() override; void Stop() override; void StartWaitingForSeek(base::TimeDelta seek_time) override; void CancelPendingSeek(base::TimeDelta seek_time) override; - void Seek(base::TimeDelta time, const PipelineStatusCB& cb) override; + void Seek(base::TimeDelta time, PipelineStatusCallback cb) override; base::Time GetTimelineOffset() const override; std::vector<DemuxerStream*> GetAllStreams() override; base::TimeDelta GetStartTime() const override; @@ -345,7 +345,7 @@ // from base::ThreadPoolInstance. scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; - PipelineStatusCB init_cb_; + PipelineStatusCallback init_cb_; // Indicates if Stop() has been called. bool stopped_; @@ -358,7 +358,7 @@ // Tracks if there's an outstanding av_seek_frame() operation. Used to discard // results of pre-seek av_read_frame() operations. - PipelineStatusCB pending_seek_cb_; + PipelineStatusCallback pending_seek_cb_; // |streams_| mirrors the AVStream array in AVFormatContext. It contains // FFmpegDemuxerStreams encapsluating AVStream objects at the same index.
diff --git a/media/filters/ffmpeg_demuxer_unittest.cc b/media/filters/ffmpeg_demuxer_unittest.cc index 51e98a3..ba75b58 100644 --- a/media/filters/ffmpeg_demuxer_unittest.cc +++ b/media/filters/ffmpeg_demuxer_unittest.cc
@@ -244,10 +244,8 @@ struct ReadExpectation read_expectation( size, timestamp_us, discard_front_padding, is_key_frame, status); - return base::Bind(&FFmpegDemuxerTest::OnReadDone, - base::Unretained(this), - location, - read_expectation); + return base::BindOnce(&FFmpegDemuxerTest::OnReadDone, + base::Unretained(this), location, read_expectation); } MOCK_METHOD2(OnEncryptedMediaInitData, @@ -293,7 +291,7 @@ bool got_eos_buffer = false; const int kMaxBuffers = 170; for (int i = 0; !got_eos_buffer && i < kMaxBuffers; i++) { - stream->Read(base::Bind(&EosOnReadDone, &got_eos_buffer)); + stream->Read(base::BindOnce(&EosOnReadDone, &got_eos_buffer)); base::RunLoop().Run(); } @@ -1254,7 +1252,7 @@ return; } - stream->Read(base::Bind(&ValidateAnnexB, stream)); + stream->Read(base::BindOnce(&ValidateAnnexB, stream)); } TEST_F(FFmpegDemuxerTest, IsValidAnnexB) { @@ -1273,7 +1271,7 @@ ASSERT_TRUE(stream); stream->EnableBitstreamConverter(); - stream->Read(base::Bind(&ValidateAnnexB, stream)); + stream->Read(base::BindOnce(&ValidateAnnexB, stream)); base::RunLoop().Run(); demuxer_->Stop(); @@ -1759,8 +1757,8 @@ audio_stream->FlushBuffers(true); video_stream->FlushBuffers(true); - audio_stream->Read(base::Bind(&OnReadDoneExpectEos)); - video_stream->Read(base::Bind(&OnReadDoneExpectEos)); + audio_stream->Read(base::BindOnce(&OnReadDoneExpectEos)); + video_stream->Read(base::BindOnce(&OnReadDoneExpectEos)); DisableAndEnableDemuxerTracks(demuxer_.get(), &task_environment_); }
diff --git a/media/filters/frame_processor_unittest.cc b/media/filters/frame_processor_unittest.cc index 385f360..a907c1da 100644 --- a/media/filters/frame_processor_unittest.cc +++ b/media/filters/frame_processor_unittest.cc
@@ -222,8 +222,8 @@ do { read_callback_called_ = false; - stream->Read(base::Bind(&FrameProcessorTest::StoreStatusAndBuffer, - base::Unretained(this))); + stream->Read(base::BindOnce(&FrameProcessorTest::StoreStatusAndBuffer, + base::Unretained(this))); base::RunLoop().RunUntilIdle(); } while (++loop_count < 2 && read_callback_called_ && last_read_status_ == DemuxerStream::kAborted); @@ -248,8 +248,8 @@ do { read_callback_called_ = false; - stream->Read(base::Bind(&FrameProcessorTest::StoreStatusAndBuffer, - base::Unretained(this))); + stream->Read(base::BindOnce(&FrameProcessorTest::StoreStatusAndBuffer, + base::Unretained(this))); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(read_callback_called_); } while (++loop_count < 2 &&
diff --git a/media/mojo/clients/mojo_demuxer_stream_impl.cc b/media/mojo/clients/mojo_demuxer_stream_impl.cc index 04dc8ce..b988e67 100644 --- a/media/mojo/clients/mojo_demuxer_stream_impl.cc +++ b/media/mojo/clients/mojo_demuxer_stream_impl.cc
@@ -52,9 +52,9 @@ } void MojoDemuxerStreamImpl::Read(ReadCallback callback) { - stream_->Read(base::Bind(&MojoDemuxerStreamImpl::OnBufferReady, - weak_factory_.GetWeakPtr(), - base::Passed(&callback))); + stream_->Read(base::BindOnce(&MojoDemuxerStreamImpl::OnBufferReady, + weak_factory_.GetWeakPtr(), + base::Passed(&callback))); } void MojoDemuxerStreamImpl::EnableBitstreamConverter() {
diff --git a/media/mojo/clients/mojo_renderer.cc b/media/mojo/clients/mojo_renderer.cc index c3414f5..02e08b1 100644 --- a/media/mojo/clients/mojo_renderer.cc +++ b/media/mojo/clients/mojo_renderer.cc
@@ -43,20 +43,20 @@ void MojoRenderer::Initialize(MediaResource* media_resource, media::RendererClient* client, - const PipelineStatusCB& init_cb) { + PipelineStatusCallback init_cb) { DVLOG(1) << __func__; DCHECK(task_runner_->BelongsToCurrentThread()); DCHECK(media_resource); if (encountered_error_) { task_runner_->PostTask( - FROM_HERE, - base::BindOnce(init_cb, PIPELINE_ERROR_INITIALIZATION_FAILED)); + FROM_HERE, base::BindOnce(std::move(init_cb), + PIPELINE_ERROR_INITIALIZATION_FAILED)); return; } media_resource_ = media_resource; - init_cb_ = init_cb; + init_cb_ = std::move(init_cb); switch (media_resource_->GetType()) { case MediaResource::Type::STREAM: @@ -157,7 +157,7 @@ cdm_id, base::Bind(&MojoRenderer::OnCdmAttached, base::Unretained(this))); } -void MojoRenderer::Flush(const base::Closure& flush_cb) { +void MojoRenderer::Flush(base::OnceClosure flush_cb) { DVLOG(2) << __func__; DCHECK(task_runner_->BelongsToCurrentThread()); DCHECK(remote_renderer_.is_bound()); @@ -165,7 +165,7 @@ DCHECK(!flush_cb_); if (encountered_error_) { - task_runner_->PostTask(FROM_HERE, flush_cb); + task_runner_->PostTask(FROM_HERE, std::move(flush_cb)); return; } @@ -175,7 +175,7 @@ media_time_interpolator_.StopInterpolating(); } - flush_cb_ = flush_cb; + flush_cb_ = std::move(flush_cb); remote_renderer_->Flush( base::Bind(&MojoRenderer::OnFlushed, base::Unretained(this))); }
diff --git a/media/mojo/clients/mojo_renderer.h b/media/mojo/clients/mojo_renderer.h index 44e82fd..56422104 100644 --- a/media/mojo/clients/mojo_renderer.h +++ b/media/mojo/clients/mojo_renderer.h
@@ -52,10 +52,10 @@ // Renderer implementation. void Initialize(MediaResource* media_resource, media::RendererClient* client, - const PipelineStatusCB& init_cb) override; + PipelineStatusCallback init_cb) override; void SetCdm(CdmContext* cdm_context, const CdmAttachedCB& cdm_attached_cb) override; - void Flush(const base::Closure& flush_cb) override; + void Flush(base::OnceClosure flush_cb) override; void StartPlayingFrom(base::TimeDelta time) override; void SetPlaybackRate(double playback_rate) override; void SetVolume(float volume) override; @@ -145,8 +145,8 @@ bool encountered_error_ = false; - PipelineStatusCB init_cb_; - base::Closure flush_cb_; + PipelineStatusCallback init_cb_; + base::OnceClosure flush_cb_; CdmAttachedCB cdm_attached_cb_; // Lock used to serialize access for |time_interpolator_|.
diff --git a/media/mojo/clients/mojo_renderer_unittest.cc b/media/mojo/clients/mojo_renderer_unittest.cc index 53d55bf..bd5cac5 100644 --- a/media/mojo/clients/mojo_renderer_unittest.cc +++ b/media/mojo/clients/mojo_renderer_unittest.cc
@@ -33,7 +33,8 @@ #include "url/origin.h" using ::base::test::RunCallback; -using ::base::test::RunClosure; +using ::base::test::RunOnceCallback; +using ::base::test::RunOnceClosure; using ::testing::_; using ::testing::DoAll; using ::testing::Return; @@ -126,17 +127,17 @@ void InitializeAndExpect(PipelineStatus status) { DVLOG(1) << __func__ << ": " << status; EXPECT_CALL(*this, OnInitialized(status)); - mojo_renderer_->Initialize( - &demuxer_, &renderer_client_, - base::Bind(&MojoRendererTest::OnInitialized, base::Unretained(this))); + mojo_renderer_->Initialize(&demuxer_, &renderer_client_, + base::BindOnce(&MojoRendererTest::OnInitialized, + base::Unretained(this))); base::RunLoop().RunUntilIdle(); } void Initialize() { CreateAudioStream(); - EXPECT_CALL(*mock_renderer_, Initialize(_, _, _)) + EXPECT_CALL(*mock_renderer_, OnInitialize(_, _, _)) .WillOnce(DoAll(SaveArg<1>(&remote_renderer_client_), - RunCallback<2>(PIPELINE_OK))); + RunOnceCallback<2>(PIPELINE_OK))); InitializeAndExpect(PIPELINE_OK); } @@ -145,7 +146,7 @@ // Flush callback should always be fired. EXPECT_CALL(*this, OnFlushed()); mojo_renderer_->Flush( - base::Bind(&MojoRendererTest::OnFlushed, base::Unretained(this))); + base::BindOnce(&MojoRendererTest::OnFlushed, base::Unretained(this))); base::RunLoop().RunUntilIdle(); } @@ -238,14 +239,14 @@ CreateAudioStream(); // Mojo Renderer only expects a boolean result, which will be translated // to PIPELINE_OK or PIPELINE_ERROR_INITIALIZATION_FAILED. - EXPECT_CALL(*mock_renderer_, Initialize(_, _, _)) - .WillOnce(RunCallback<2>(PIPELINE_ERROR_ABORT)); + EXPECT_CALL(*mock_renderer_, OnInitialize(_, _, _)) + .WillOnce(RunOnceCallback<2>(PIPELINE_ERROR_ABORT)); InitializeAndExpect(PIPELINE_ERROR_INITIALIZATION_FAILED); } TEST_F(MojoRendererTest, Initialize_BeforeConnectionError) { CreateAudioStream(); - EXPECT_CALL(*mock_renderer_, Initialize(_, _, _)) + EXPECT_CALL(*mock_renderer_, OnInitialize(_, _, _)) .WillOnce(InvokeWithoutArgs(this, &MojoRendererTest::ConnectionError)); InitializeAndExpect(PIPELINE_ERROR_INITIALIZATION_FAILED); } @@ -259,7 +260,7 @@ TEST_F(MojoRendererTest, Flush_Success) { Initialize(); - EXPECT_CALL(*mock_renderer_, Flush(_)).WillOnce(RunClosure<0>()); + EXPECT_CALL(*mock_renderer_, OnFlush(_)).WillOnce(RunOnceClosure<0>()); Flush(); } @@ -268,7 +269,7 @@ // Upon connection error, OnError() should be called once and only once. EXPECT_CALL(renderer_client_, OnError(PIPELINE_ERROR_DECODE)).Times(1); - EXPECT_CALL(*mock_renderer_, Flush(_)) + EXPECT_CALL(*mock_renderer_, OnFlush(_)) .WillOnce(InvokeWithoutArgs(this, &MojoRendererTest::ConnectionError)); Flush(); } @@ -397,7 +398,7 @@ EXPECT_GT(mojo_renderer_->GetMediaTime(), kStartTime); // Flushing should pause media-time updates. - EXPECT_CALL(*mock_renderer_, Flush(_)).WillOnce(RunClosure<0>()); + EXPECT_CALL(*mock_renderer_, OnFlush(_)).WillOnce(RunOnceClosure<0>()); Flush(); base::TimeDelta pause_time = mojo_renderer_->GetMediaTime(); EXPECT_GT(pause_time, kStartTime); @@ -439,12 +440,12 @@ TEST_F(MojoRendererTest, Destroy_PendingInitialize) { CreateAudioStream(); - EXPECT_CALL(*mock_renderer_, Initialize(_, _, _)) - .WillRepeatedly(RunCallback<2>(PIPELINE_ERROR_ABORT)); + EXPECT_CALL(*mock_renderer_, OnInitialize(_, _, _)) + .WillRepeatedly(RunOnceCallback<2>(PIPELINE_ERROR_ABORT)); EXPECT_CALL(*this, OnInitialized(PIPELINE_ERROR_INITIALIZATION_FAILED)); mojo_renderer_->Initialize( &demuxer_, &renderer_client_, - base::Bind(&MojoRendererTest::OnInitialized, base::Unretained(this))); + base::BindOnce(&MojoRendererTest::OnInitialized, base::Unretained(this))); Destroy(); } @@ -461,10 +462,10 @@ TEST_F(MojoRendererTest, Destroy_PendingSetCdm) { Initialize(); - EXPECT_CALL(*mock_renderer_, Flush(_)).WillRepeatedly(RunClosure<0>()); + EXPECT_CALL(*mock_renderer_, OnFlush(_)).WillRepeatedly(RunOnceClosure<0>()); EXPECT_CALL(*this, OnFlushed()); mojo_renderer_->Flush( - base::Bind(&MojoRendererTest::OnFlushed, base::Unretained(this))); + base::BindOnce(&MojoRendererTest::OnFlushed, base::Unretained(this))); Destroy(); }
diff --git a/media/mojo/clients/mojo_renderer_wrapper.cc b/media/mojo/clients/mojo_renderer_wrapper.cc index 2fa912ff..ec12cae 100644 --- a/media/mojo/clients/mojo_renderer_wrapper.cc +++ b/media/mojo/clients/mojo_renderer_wrapper.cc
@@ -16,12 +16,12 @@ void MojoRendererWrapper::Initialize(media::MediaResource* media_resource, media::RendererClient* client, - const media::PipelineStatusCB& init_cb) { - mojo_renderer_->Initialize(media_resource, client, init_cb); + media::PipelineStatusCallback init_cb) { + mojo_renderer_->Initialize(media_resource, client, std::move(init_cb)); } -void MojoRendererWrapper::Flush(const base::Closure& flush_cb) { - mojo_renderer_->Flush(flush_cb); +void MojoRendererWrapper::Flush(base::OnceClosure flush_cb) { + mojo_renderer_->Flush(std::move(flush_cb)); } void MojoRendererWrapper::StartPlayingFrom(base::TimeDelta time) {
diff --git a/media/mojo/clients/mojo_renderer_wrapper.h b/media/mojo/clients/mojo_renderer_wrapper.h index 9351a4ec..85ee84e0 100644 --- a/media/mojo/clients/mojo_renderer_wrapper.h +++ b/media/mojo/clients/mojo_renderer_wrapper.h
@@ -25,10 +25,10 @@ // Renderer implementation. void Initialize(MediaResource* media_resource, media::RendererClient* client, - const PipelineStatusCB& init_cb) override; + PipelineStatusCallback init_cb) override; void SetCdm(CdmContext* cdm_context, const CdmAttachedCB& cdm_attached_cb) override; - void Flush(const base::Closure& flush_cb) override; + void Flush(base::OnceClosure flush_cb) override; void StartPlayingFrom(base::TimeDelta time) override; void SetPlaybackRate(double playback_rate) override; void SetVolume(float volume) override;
diff --git a/media/mojo/mojom/cdm_service.mojom b/media/mojo/mojom/cdm_service.mojom index 5c631ab..5cd5b1d 100644 --- a/media/mojo/mojom/cdm_service.mojom +++ b/media/mojo/mojom/cdm_service.mojom
@@ -32,7 +32,7 @@ // interfaces hosted by the caller to the remote CdmFactory implementation. CreateCdmFactory( CdmFactory& factory, - service_manager.mojom.InterfaceProvider? host_interfaces); + pending_remote<service_manager.mojom.InterfaceProvider> host_interfaces); }; // An interface to provide a sandbox seatbelt extension token synchronously.
diff --git a/media/mojo/mojom/media_service.mojom b/media/mojo/mojom/media_service.mojom index 89de3b2..995e6c5 100644 --- a/media/mojo/mojom/media_service.mojom +++ b/media/mojo/mojom/media_service.mojom
@@ -16,6 +16,6 @@ // provide interfaces hosted by the caller to the remote InterfaceFactory // implementation. CreateInterfaceFactory( - InterfaceFactory& factory, - service_manager.mojom.InterfaceProvider? host_interfaces); + pending_receiver<InterfaceFactory> factory, + pending_remote<service_manager.mojom.InterfaceProvider> host_interfaces); };
diff --git a/media/mojo/services/cdm_service.cc b/media/mojo/services/cdm_service.cc index d8de566a..005930e 100644 --- a/media/mojo/services/cdm_service.cc +++ b/media/mojo/services/cdm_service.cc
@@ -12,6 +12,7 @@ #include "media/mojo/services/mojo_cdm_service.h" #include "media/mojo/services/mojo_cdm_service_context.h" #include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/unique_receiver_set.h" #include "services/service_manager/public/cpp/connector.h" @@ -49,9 +50,10 @@ // details. class CdmFactoryImpl : public DeferredDestroy<mojom::CdmFactory> { public: - CdmFactoryImpl(CdmService::Client* client, - service_manager::mojom::InterfaceProviderPtr interfaces, - std::unique_ptr<ServiceKeepaliveRef> keepalive_ref) + CdmFactoryImpl( + CdmService::Client* client, + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> interfaces, + std::unique_ptr<ServiceKeepaliveRef> keepalive_ref) : client_(client), interfaces_(std::move(interfaces)), keepalive_ref_(std::move(keepalive_ref)) { @@ -109,7 +111,7 @@ MojoCdmServiceContext cdm_service_context_; CdmService::Client* client_; - service_manager::mojom::InterfaceProviderPtr interfaces_; + mojo::Remote<service_manager::mojom::InterfaceProvider> interfaces_; mojo::UniqueReceiverSet<mojom::ContentDecryptionModule> cdm_receivers_; std::unique_ptr<ServiceKeepaliveRef> keepalive_ref_; std::unique_ptr<media::CdmFactory> cdm_factory_; @@ -227,7 +229,8 @@ void CdmService::CreateCdmFactory( mojom::CdmFactoryRequest request, - service_manager::mojom::InterfaceProviderPtr host_interfaces) { + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> + host_interfaces) { // Ignore request if service has already stopped. if (!client_) return;
diff --git a/media/mojo/services/cdm_service.h b/media/mojo/services/cdm_service.h index dcd5dd7..abb9f6a 100644 --- a/media/mojo/services/cdm_service.h +++ b/media/mojo/services/cdm_service.h
@@ -15,6 +15,7 @@ #include "media/mojo/services/deferred_destroy_strong_binding_set.h" #include "media/mojo/services/media_mojo_export.h" #include "mojo/public/cpp/bindings/binding_set.h" +#include "mojo/public/cpp/bindings/pending_remote.h" #include "services/service_manager/public/cpp/binder_registry.h" #include "services/service_manager/public/cpp/service.h" #include "services/service_manager/public/cpp/service_binding.h" @@ -88,7 +89,8 @@ #endif // defined(OS_MACOSX) void CreateCdmFactory( mojom::CdmFactoryRequest request, - service_manager::mojom::InterfaceProviderPtr host_interfaces) final; + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> + host_interfaces) final; service_manager::ServiceBinding service_binding_; std::unique_ptr<service_manager::ServiceKeepalive> keepalive_;
diff --git a/media/mojo/services/cdm_service_unittest.cc b/media/mojo/services/cdm_service_unittest.cc index a1fb3e7..c021f34 100644 --- a/media/mojo/services/cdm_service_unittest.cc +++ b/media/mojo/services/cdm_service_unittest.cc
@@ -14,6 +14,8 @@ #include "media/mojo/mojom/constants.mojom.h" #include "media/mojo/services/cdm_service.h" #include "media/mojo/services/media_interface_provider.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/remote.h" #include "services/service_manager/public/cpp/test/test_connector_factory.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -82,16 +84,17 @@ cdm_service_ptr_.set_connection_error_handler(base::BindOnce( &CdmServiceTest::CdmServiceConnectionClosed, base::Unretained(this))); - service_manager::mojom::InterfaceProviderPtr interfaces; + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> interfaces; auto provider = std::make_unique<MediaInterfaceProvider>( - mojo::MakeRequest(&interfaces)); + interfaces.InitWithNewPipeAndPassReceiver()); - ASSERT_FALSE(cdm_factory_ptr_); - cdm_service_ptr_->CreateCdmFactory(mojo::MakeRequest(&cdm_factory_ptr_), - std::move(interfaces)); + ASSERT_FALSE(cdm_factory_remote_); + cdm_service_ptr_->CreateCdmFactory( + cdm_factory_remote_.BindNewPipeAndPassReceiver(), + std::move(interfaces)); cdm_service_ptr_.FlushForTesting(); - ASSERT_TRUE(cdm_factory_ptr_); - cdm_factory_ptr_.set_connection_error_handler(base::BindOnce( + ASSERT_TRUE(cdm_factory_remote_); + cdm_factory_remote_.set_disconnect_handler(base::BindOnce( &CdmServiceTest::CdmFactoryConnectionClosed, base::Unretained(this))); } @@ -107,7 +110,7 @@ void InitializeCdm(const std::string& key_system, bool expected_result) { base::RunLoop run_loop; - cdm_factory_ptr_->CreateCdm(key_system, mojo::MakeRequest(&cdm_ptr_)); + cdm_factory_remote_->CreateCdm(key_system, mojo::MakeRequest(&cdm_ptr_)); cdm_ptr_.set_connection_error_handler(base::BindOnce( &CdmServiceTest::CdmConnectionClosed, base::Unretained(this))); EXPECT_CALL(*this, OnCdmInitialized(MatchesResult(expected_result), _, _)) @@ -129,7 +132,7 @@ base::test::TaskEnvironment task_environment_; mojom::CdmServicePtr cdm_service_ptr_; - mojom::CdmFactoryPtr cdm_factory_ptr_; + mojo::Remote<mojom::CdmFactory> cdm_factory_remote_; mojom::ContentDecryptionModulePtr cdm_ptr_; private: @@ -194,7 +197,7 @@ EXPECT_EQ(service->BoundCdmFactorySizeForTesting(), 1u); EXPECT_EQ(service->UnboundCdmFactorySizeForTesting(), 0u); - cdm_factory_ptr_.reset(); + cdm_factory_remote_.reset(); base::RunLoop().RunUntilIdle(); EXPECT_EQ(service->BoundCdmFactorySizeForTesting(), 0u); EXPECT_EQ(service->UnboundCdmFactorySizeForTesting(), 1u); @@ -217,7 +220,7 @@ InitializeWithServiceReleaseDelay(kKeepaliveIdleTimeout); InitializeCdm(kClearKeyKeySystem, true); - cdm_factory_ptr_.reset(); + cdm_factory_remote_.reset(); base::RunLoop().RunUntilIdle(); base::RunLoop run_loop;
diff --git a/media/mojo/services/interface_factory_impl.cc b/media/mojo/services/interface_factory_impl.cc index 9d827b4..517fd728c 100644 --- a/media/mojo/services/interface_factory_impl.cc +++ b/media/mojo/services/interface_factory_impl.cc
@@ -43,7 +43,8 @@ namespace media { InterfaceFactoryImpl::InterfaceFactoryImpl( - service_manager::mojom::InterfaceProviderPtr host_interfaces, + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> + host_interfaces, std::unique_ptr<service_manager::ServiceKeepaliveRef> keepalive_ref, MojoMediaClient* mojo_media_client) : host_interfaces_(std::move(host_interfaces)),
diff --git a/media/mojo/services/interface_factory_impl.h b/media/mojo/services/interface_factory_impl.h index 5e5db22..d312125 100644 --- a/media/mojo/services/interface_factory_impl.h +++ b/media/mojo/services/interface_factory_impl.h
@@ -22,6 +22,8 @@ #include "media/mojo/services/deferred_destroy_strong_binding_set.h" #include "media/mojo/services/mojo_cdm_service_context.h" #include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/unique_receiver_set.h" #include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/service_keepalive.h" @@ -34,7 +36,8 @@ class InterfaceFactoryImpl : public DeferredDestroy<mojom::InterfaceFactory> { public: InterfaceFactoryImpl( - service_manager::mojom::InterfaceProviderPtr host_interfaces, + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> + host_interfaces, std::unique_ptr<service_manager::ServiceKeepaliveRef> keepalive_ref, MojoMediaClient* mojo_media_client); ~InterfaceFactoryImpl() final; @@ -111,7 +114,7 @@ mojo::UniqueReceiverSet<mojom::CdmProxy> cdm_proxy_receivers_; #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) - service_manager::mojom::InterfaceProviderPtr host_interfaces_; + mojo::Remote<service_manager::mojom::InterfaceProvider> host_interfaces_; mojo::UniqueReceiverSet<mojom::Decryptor> decryptor_receivers_;
diff --git a/media/mojo/services/media_service.cc b/media/mojo/services/media_service.cc index 708db95..1061a20 100644 --- a/media/mojo/services/media_service.cc +++ b/media/mojo/services/media_service.cc
@@ -41,7 +41,7 @@ } void MediaService::OnDisconnected() { - interface_factory_bindings_.CloseAllBindings(); + interface_factory_receivers_.Clear(); mojo_media_client_.reset(); Terminate(); } @@ -51,17 +51,18 @@ } void MediaService::CreateInterfaceFactory( - mojom::InterfaceFactoryRequest request, - service_manager::mojom::InterfaceProviderPtr host_interfaces) { + mojo::PendingReceiver<mojom::InterfaceFactory> receiver, + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> + host_interfaces) { // Ignore request if service has already stopped. if (!mojo_media_client_) return; - interface_factory_bindings_.AddBinding( + interface_factory_receivers_.Add( std::make_unique<InterfaceFactoryImpl>(std::move(host_interfaces), keepalive_.CreateRef(), mojo_media_client_.get()), - std::move(request)); + std::move(receiver)); } } // namespace media
diff --git a/media/mojo/services/media_service.h b/media/mojo/services/media_service.h index b569239e..8ebc56a 100644 --- a/media/mojo/services/media_service.h +++ b/media/mojo/services/media_service.h
@@ -11,9 +11,11 @@ #include "build/build_config.h" #include "media/mojo/mojom/interface_factory.mojom.h" #include "media/mojo/mojom/media_service.mojom.h" -#include "media/mojo/services/deferred_destroy_strong_binding_set.h" #include "media/mojo/services/media_mojo_export.h" #include "mojo/public/cpp/bindings/binding_set.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/unique_receiver_set.h" #include "services/service_manager/public/cpp/binder_registry.h" #include "services/service_manager/public/cpp/service.h" #include "services/service_manager/public/cpp/service_binding.h" @@ -42,8 +44,9 @@ void Create(mojom::MediaServiceRequest request); void CreateInterfaceFactory( - mojom::InterfaceFactoryRequest request, - service_manager::mojom::InterfaceProviderPtr host_interfaces) final; + mojo::PendingReceiver<mojom::InterfaceFactory> receiver, + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> + host_interfaces) final; service_manager::ServiceBinding service_binding_; service_manager::ServiceKeepalive keepalive_; @@ -56,8 +59,7 @@ // |mojo_media_client_| must be destructed before |ref_factory_|. std::unique_ptr<MojoMediaClient> mojo_media_client_; - DeferredDestroyStrongBindingSet<mojom::InterfaceFactory> - interface_factory_bindings_; + mojo::UniqueReceiverSet<mojom::InterfaceFactory> interface_factory_receivers_; service_manager::BinderRegistry registry_; mojo::BindingSet<mojom::MediaService> bindings_;
diff --git a/media/mojo/services/media_service_unittest.cc b/media/mojo/services/media_service_unittest.cc index b8fda22f6..4b0856a 100644 --- a/media/mojo/services/media_service_unittest.cc +++ b/media/mojo/services/media_service_unittest.cc
@@ -32,6 +32,7 @@ #include "media/mojo/services/media_manifest.h" #include "mojo/public/cpp/bindings/associated_binding.h" #include "mojo/public/cpp/bindings/interface_request.h" +#include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/service_manager/public/cpp/manifest_builder.h" #include "services/service_manager/public/cpp/test/test_service.h" @@ -156,16 +157,18 @@ service_manager::Connector* connector() { return test_service_.connector(); } void SetUp() override { - service_manager::mojom::InterfaceProviderPtr host_interfaces; + mojo::PendingRemote<service_manager::mojom::InterfaceProvider> + host_interfaces; auto provider = std::make_unique<MediaInterfaceProvider>( - mojo::MakeRequest(&host_interfaces)); + host_interfaces.InitWithNewPipeAndPassReceiver()); connector()->BindInterface(mojom::kMediaServiceName, &media_service_); media_service_.set_connection_error_handler( base::BindRepeating(&MediaServiceTest::MediaServiceConnectionClosed, base::Unretained(this))); media_service_->CreateInterfaceFactory( - mojo::MakeRequest(&interface_factory_), std::move(host_interfaces)); + interface_factory_.BindNewPipeAndPassReceiver(), + std::move(host_interfaces)); } MOCK_METHOD3(OnCdmInitialized, @@ -282,7 +285,7 @@ service_manager::TestService test_service_; mojom::MediaServicePtr media_service_; - mojom::InterfaceFactoryPtr interface_factory_; + mojo::Remote<mojom::InterfaceFactory> interface_factory_; mojom::ContentDecryptionModulePtr cdm_; mojo::Remote<mojom::CdmProxy> cdm_proxy_; mojom::RendererPtr renderer_;
diff --git a/media/mojo/services/mojo_demuxer_stream_adapter.cc b/media/mojo/services/mojo_demuxer_stream_adapter.cc index cc571370..8271a21f 100644 --- a/media/mojo/services/mojo_demuxer_stream_adapter.cc +++ b/media/mojo/services/mojo_demuxer_stream_adapter.cc
@@ -32,12 +32,12 @@ DVLOG(1) << __func__; } -void MojoDemuxerStreamAdapter::Read(const ReadCB& read_cb) { +void MojoDemuxerStreamAdapter::Read(ReadCB read_cb) { DVLOG(3) << __func__; // We shouldn't be holding on to a previous callback if a new Read() came in. DCHECK(!read_cb_); - read_cb_ = read_cb; + read_cb_ = std::move(read_cb); demuxer_stream_->Read(base::Bind(&MojoDemuxerStreamAdapter::OnBufferReady, weak_factory_.GetWeakPtr())); }
diff --git a/media/mojo/services/mojo_demuxer_stream_adapter.h b/media/mojo/services/mojo_demuxer_stream_adapter.h index 0b46158..63bd2ab 100644 --- a/media/mojo/services/mojo_demuxer_stream_adapter.h +++ b/media/mojo/services/mojo_demuxer_stream_adapter.h
@@ -37,7 +37,7 @@ ~MojoDemuxerStreamAdapter() override; // DemuxerStream implementation. - void Read(const ReadCB& read_cb) override; + void Read(ReadCB read_cb) override; bool IsReadPending() const override; AudioDecoderConfig audio_decoder_config() override; VideoDecoderConfig video_decoder_config() override;
diff --git a/media/mojo/services/mojo_renderer_service.cc b/media/mojo/services/mojo_renderer_service.cc index a7e085d..905be74 100644 --- a/media/mojo/services/mojo_renderer_service.cc +++ b/media/mojo/services/mojo_renderer_service.cc
@@ -89,8 +89,8 @@ media_url_params->is_hls)); renderer_->Initialize( media_resource_.get(), this, - base::Bind(&MojoRendererService::OnRendererInitializeDone, weak_this_, - base::Passed(&callback))); + base::BindOnce(&MojoRendererService::OnRendererInitializeDone, weak_this_, + base::Passed(&callback))); } void MojoRendererService::Flush(FlushCallback callback) { @@ -99,8 +99,8 @@ state_ = STATE_FLUSHING; CancelPeriodicMediaTimeUpdates(); - renderer_->Flush(base::Bind(&MojoRendererService::OnFlushCompleted, - weak_this_, base::Passed(&callback))); + renderer_->Flush(base::BindOnce(&MojoRendererService::OnFlushCompleted, + weak_this_, base::Passed(&callback))); } void MojoRendererService::StartPlayingFrom(base::TimeDelta time_delta) { @@ -202,8 +202,8 @@ renderer_->Initialize( media_resource_.get(), this, - base::Bind(&MojoRendererService::OnRendererInitializeDone, weak_this_, - base::Passed(&callback))); + base::BindOnce(&MojoRendererService::OnRendererInitializeDone, weak_this_, + base::Passed(&callback))); } void MojoRendererService::OnRendererInitializeDone(
diff --git a/media/remoting/courier_renderer.cc b/media/remoting/courier_renderer.cc index b950a08..7b6593e 100644 --- a/media/remoting/courier_renderer.cc +++ b/media/remoting/courier_renderer.cc
@@ -101,7 +101,7 @@ void CourierRenderer::Initialize(MediaResource* media_resource, RendererClient* client, - const PipelineStatusCB& init_cb) { + PipelineStatusCallback init_cb) { VLOG(2) << __func__; DCHECK(media_task_runner_->BelongsToCurrentThread()); DCHECK(media_resource); @@ -109,13 +109,14 @@ if (state_ != STATE_UNINITIALIZED) { media_task_runner_->PostTask( - FROM_HERE, base::BindOnce(init_cb, PIPELINE_ERROR_INVALID_STATE)); + FROM_HERE, + base::BindOnce(std::move(init_cb), PIPELINE_ERROR_INVALID_STATE)); return; } media_resource_ = media_resource; client_ = client; - init_workflow_done_callback_ = init_cb; + init_workflow_done_callback_ = std::move(init_cb); state_ = STATE_CREATE_PIPE; @@ -157,7 +158,7 @@ NOTIMPLEMENTED(); } -void CourierRenderer::Flush(const base::Closure& flush_cb) { +void CourierRenderer::Flush(base::OnceClosure flush_cb) { VLOG(2) << __func__; DCHECK(media_task_runner_->BelongsToCurrentThread()); DCHECK(!flush_cb_); @@ -167,7 +168,7 @@ // In the error state, this renderer will be shut down shortly. To prevent // breaking the pipeline impl, just run the done callback (interface // requirement). - media_task_runner_->PostTask(FROM_HERE, flush_cb); + media_task_runner_->PostTask(FROM_HERE, std::move(flush_cb)); return; } @@ -188,7 +189,7 @@ return; } - flush_cb_ = flush_cb; + flush_cb_ = std::move(flush_cb); // Issues RPC_R_FLUSHUNTIL RPC message. std::unique_ptr<pb::RpcMessage> rpc(new pb::RpcMessage());
diff --git a/media/remoting/courier_renderer.h b/media/remoting/courier_renderer.h index 2b9cd94..d849020 100644 --- a/media/remoting/courier_renderer.h +++ b/media/remoting/courier_renderer.h
@@ -72,10 +72,10 @@ // media::Renderer implementation. void Initialize(MediaResource* media_resource, RendererClient* client, - const PipelineStatusCB& init_cb) final; + PipelineStatusCallback init_cb) final; void SetCdm(CdmContext* cdm_context, const CdmAttachedCB& cdm_attached_cb) final; - void Flush(const base::Closure& flush_cb) final; + void Flush(base::OnceClosure flush_cb) final; void StartPlayingFrom(base::TimeDelta time) final; void SetPlaybackRate(double playback_rate) final; void SetVolume(float volume) final; @@ -172,9 +172,9 @@ int remote_renderer_handle_; // Callbacks. - PipelineStatusCB init_workflow_done_callback_; + PipelineStatusCallback init_workflow_done_callback_; CdmAttachedCB cdm_attached_cb_; - base::Closure flush_cb_; + base::OnceClosure flush_cb_; VideoRendererSink* const video_renderer_sink_; // Outlives this class.
diff --git a/media/remoting/courier_renderer_unittest.cc b/media/remoting/courier_renderer_unittest.cc index 6f37dbe..de6ed68 100644 --- a/media/remoting/courier_renderer_unittest.cc +++ b/media/remoting/courier_renderer_unittest.cc
@@ -255,9 +255,10 @@ controller_->GetRpcBroker()->SetMessageCallbackForTesting(base::Bind( &CourierRendererTest::RpcMessageResponseBot, base::Unretained(this))); RunPendingTasks(); - renderer_->Initialize(media_resource_.get(), render_client_.get(), - base::Bind(&RendererClientImpl::OnPipelineStatus, - base::Unretained(render_client_.get()))); + renderer_->Initialize( + media_resource_.get(), render_client_.get(), + base::BindOnce(&RendererClientImpl::OnPipelineStatus, + base::Unretained(render_client_.get()))); RunPendingTasks(); // Redirect RPC message back to save for later check. controller_->GetRpcBroker()->SetMessageCallbackForTesting(base::Bind( @@ -441,8 +442,8 @@ ResetReceivedRpcMessage(); EXPECT_CALL(*render_client_, OnFlushCallback()).Times(1); - renderer_->Flush(base::Bind(&RendererClientImpl::OnFlushCallback, - base::Unretained(render_client_.get()))); + renderer_->Flush(base::BindOnce(&RendererClientImpl::OnFlushCallback, + base::Unretained(render_client_.get()))); RunPendingTasks(); ASSERT_EQ(0, ReceivedRpcMessageCount()); @@ -473,8 +474,8 @@ &CourierRendererTest::RpcMessageResponseBot, base::Unretained(this))); RunPendingTasks(); EXPECT_CALL(*render_client_, OnFlushCallback()).Times(1); - renderer_->Flush(base::Bind(&RendererClientImpl::OnFlushCallback, - base::Unretained(render_client_.get()))); + renderer_->Flush(base::BindOnce(&RendererClientImpl::OnFlushCallback, + base::Unretained(render_client_.get()))); RunPendingTasks(); }
diff --git a/media/remoting/demuxer_stream_adapter.cc b/media/remoting/demuxer_stream_adapter.cc index 9af4d6e4..333bd58 100644 --- a/media/remoting/demuxer_stream_adapter.cc +++ b/media/remoting/demuxer_stream_adapter.cc
@@ -242,8 +242,9 @@ DEMUXER_VLOG(2) << "Skip actions since it's not in the reading state"; return; } - demuxer_stream_->Read(base::Bind(&DemuxerStreamAdapter::OnNewBuffer, - request_buffer_weak_factory_.GetWeakPtr())); + demuxer_stream_->Read( + base::BindOnce(&DemuxerStreamAdapter::OnNewBuffer, + request_buffer_weak_factory_.GetWeakPtr())); } void DemuxerStreamAdapter::OnNewBuffer(DemuxerStream::Status status,
diff --git a/media/remoting/end2end_test_renderer.cc b/media/remoting/end2end_test_renderer.cc index 382db77..cfd7dba 100644 --- a/media/remoting/end2end_test_renderer.cc +++ b/media/remoting/end2end_test_renderer.cc
@@ -168,8 +168,8 @@ void End2EndTestRenderer::Initialize(MediaResource* media_resource, RendererClient* client, - const PipelineStatusCB& init_cb) { - courier_renderer_->Initialize(media_resource, client, init_cb); + PipelineStatusCallback init_cb) { + courier_renderer_->Initialize(media_resource, client, std::move(init_cb)); } void End2EndTestRenderer::SetCdm(CdmContext* cdm_context, @@ -179,8 +179,8 @@ NOTIMPLEMENTED() << "Media Remoting doesn't support EME for now."; } -void End2EndTestRenderer::Flush(const base::Closure& flush_cb) { - courier_renderer_->Flush(flush_cb); +void End2EndTestRenderer::Flush(base::OnceClosure flush_cb) { + courier_renderer_->Flush(std::move(flush_cb)); } void End2EndTestRenderer::StartPlayingFrom(base::TimeDelta time) {
diff --git a/media/remoting/end2end_test_renderer.h b/media/remoting/end2end_test_renderer.h index 8a6d698b..56eb713 100644 --- a/media/remoting/end2end_test_renderer.h +++ b/media/remoting/end2end_test_renderer.h
@@ -28,10 +28,10 @@ // Renderer implementation. void Initialize(MediaResource* media_resource, RendererClient* client, - const PipelineStatusCB& init_cb) override; + PipelineStatusCallback init_cb) override; void SetCdm(CdmContext* cdm_context, const CdmAttachedCB& cdm_attached_cb) override; - void Flush(const base::Closure& flush_cb) override; + void Flush(base::OnceClosure flush_cb) override; void StartPlayingFrom(base::TimeDelta time) override; void SetPlaybackRate(double playback_rate) override; void SetVolume(float volume) override;
diff --git a/media/remoting/fake_media_resource.cc b/media/remoting/fake_media_resource.cc index 6b6c3e9..7381d167 100644 --- a/media/remoting/fake_media_resource.cc +++ b/media/remoting/fake_media_resource.cc
@@ -38,15 +38,15 @@ FakeDemuxerStream::~FakeDemuxerStream() = default; -void FakeDemuxerStream::FakeRead(const ReadCB& read_cb) { +void FakeDemuxerStream::FakeRead(ReadCB read_cb) { if (buffer_queue_.empty()) { // Silent return to simulate waiting for buffer available. - pending_read_cb_ = read_cb; + pending_read_cb_ = std::move(read_cb); return; } scoped_refptr<DecoderBuffer> buffer = buffer_queue_.front(); buffer_queue_.pop_front(); - read_cb.Run(kOk, buffer); + std::move(read_cb).Run(kOk, buffer); } bool FakeDemuxerStream::IsReadPending() const {
diff --git a/media/remoting/fake_media_resource.h b/media/remoting/fake_media_resource.h index 65db686..93b5318 100644 --- a/media/remoting/fake_media_resource.h +++ b/media/remoting/fake_media_resource.h
@@ -21,8 +21,8 @@ ~FakeDemuxerStream() override; // DemuxerStream implementation. - MOCK_METHOD1(Read, void(const ReadCB& read_cb)); - void FakeRead(const ReadCB& read_cb); + MOCK_METHOD1(Read, void(ReadCB read_cb)); + void FakeRead(ReadCB read_cb); bool IsReadPending() const override; AudioDecoderConfig audio_decoder_config() override; VideoDecoderConfig video_decoder_config() override;
diff --git a/media/remoting/receiver.cc b/media/remoting/receiver.cc index 4f2a64da..3eeb790 100644 --- a/media/remoting/receiver.cc +++ b/media/remoting/receiver.cc
@@ -110,9 +110,9 @@ void Receiver::OnStreamInitialized() { DCHECK(stream_provider_); - renderer_->Initialize( - stream_provider_.get(), this, - base::Bind(&Receiver::OnRendererInitialized, weak_factory_.GetWeakPtr())); + renderer_->Initialize(stream_provider_.get(), this, + base::BindOnce(&Receiver::OnRendererInitialized, + weak_factory_.GetWeakPtr())); } void Receiver::OnRendererInitialized(PipelineStatus status) { @@ -162,7 +162,7 @@ } time_update_timer_.Stop(); renderer_->Flush( - base::Bind(&Receiver::OnFlushDone, weak_factory_.GetWeakPtr())); + base::BindOnce(&Receiver::OnFlushDone, weak_factory_.GetWeakPtr())); } void Receiver::OnFlushDone() {
diff --git a/media/remoting/stream_provider.cc b/media/remoting/stream_provider.cc index a83bf86..a607f49 100644 --- a/media/remoting/stream_provider.cc +++ b/media/remoting/stream_provider.cc
@@ -34,7 +34,7 @@ ~MediaStream() override; // DemuxerStream implementation. - void Read(const ReadCB& read_cb) override; + void Read(ReadCB read_cb) override; bool IsReadPending() const override; AudioDecoderConfig audio_decoder_config() override; VideoDecoderConfig video_decoder_config() override; @@ -297,10 +297,10 @@ read_until_sent_ = false; } -void MediaStream::Read(const ReadCB& read_cb) { +void MediaStream::Read(ReadCB read_cb) { DCHECK(read_complete_callback_.is_null()); DCHECK(read_cb); - read_complete_callback_ = read_cb; + read_complete_callback_ = std::move(read_cb); if (buffers_.empty() && config_changed_) { CompleteRead(DemuxerStream::kConfigChanged); return;
diff --git a/media/renderers/audio_renderer_impl_unittest.cc b/media/renderers/audio_renderer_impl_unittest.cc index 0fc42e0..6ed5f91 100644 --- a/media/renderers/audio_renderer_impl_unittest.cc +++ b/media/renderers/audio_renderer_impl_unittest.cc
@@ -130,10 +130,10 @@ // Mock out demuxer reads. void ConfigureDemuxerStream(bool supports_config_changes) { - EXPECT_CALL(demuxer_stream_, Read(_)) - .WillRepeatedly( - RunCallback<0>(DemuxerStream::kOk, - scoped_refptr<DecoderBuffer>(new DecoderBuffer(0)))); + EXPECT_CALL(demuxer_stream_, OnRead(_)) + .WillRepeatedly(RunOnceCallback<0>( + DemuxerStream::kOk, + scoped_refptr<DecoderBuffer>(new DecoderBuffer(0)))); EXPECT_CALL(demuxer_stream_, SupportsConfigChanges()) .WillRepeatedly(Return(supports_config_changes)); } @@ -352,9 +352,9 @@ DCHECK(decode_cb_); // Return EOS buffer to trigger EOS frame. - EXPECT_CALL(demuxer_stream_, Read(_)) - .WillOnce(RunCallback<0>(DemuxerStream::kOk, - DecoderBuffer::CreateEOSBuffer())); + EXPECT_CALL(demuxer_stream_, OnRead(_)) + .WillOnce(RunOnceCallback<0>(DemuxerStream::kOk, + DecoderBuffer::CreateEOSBuffer())); // Satify pending |decode_cb_| to trigger a new DemuxerStream::Read(). main_thread_task_runner_->PostTask(
diff --git a/media/renderers/decrypting_renderer.cc b/media/renderers/decrypting_renderer.cc index b7f3615..20314a4 100644 --- a/media/renderers/decrypting_renderer.cc +++ b/media/renderers/decrypting_renderer.cc
@@ -42,7 +42,7 @@ // Encrypted Other InitializeRenderer() void DecryptingRenderer::Initialize(MediaResource* media_resource, RendererClient* client, - const PipelineStatusCB& init_cb) { + PipelineStatusCallback init_cb) { DCHECK(media_task_runner_->BelongsToCurrentThread()); DCHECK(media_resource); DCHECK(client); @@ -105,8 +105,8 @@ InitializeRenderer(true); } -void DecryptingRenderer::Flush(const base::Closure& flush_cb) { - renderer_->Flush(flush_cb); +void DecryptingRenderer::Flush(base::OnceClosure flush_cb) { + renderer_->Flush(std::move(flush_cb)); } void DecryptingRenderer::StartPlayingFrom(base::TimeDelta time) {
diff --git a/media/renderers/decrypting_renderer.h b/media/renderers/decrypting_renderer.h index b6745708..3a1f281 100644 --- a/media/renderers/decrypting_renderer.h +++ b/media/renderers/decrypting_renderer.h
@@ -43,11 +43,11 @@ // Renderer implementation: void Initialize(MediaResource* media_resource, RendererClient* client, - const PipelineStatusCB& init_cb) override; + PipelineStatusCallback init_cb) override; void SetCdm(CdmContext* cdm_context, const CdmAttachedCB& cdm_attached_cb) override; - void Flush(const base::Closure& flush_cb) override; + void Flush(base::OnceClosure flush_cb) override; void StartPlayingFrom(base::TimeDelta time) override; void SetPlaybackRate(double playback_rate) override; void SetVolume(float volume) override; @@ -81,7 +81,7 @@ CdmContext* cdm_context_ = nullptr; RendererClient* client_; MediaResource* media_resource_; - PipelineStatusCB init_cb_; + PipelineStatusCallback init_cb_; std::unique_ptr<DecryptingMediaResource> decrypting_media_resource_;
diff --git a/media/renderers/decrypting_renderer_unittest.cc b/media/renderers/decrypting_renderer_unittest.cc index 620eefa..5454d5cc 100644 --- a/media/renderers/decrypting_renderer_unittest.cc +++ b/media/renderers/decrypting_renderer_unittest.cc
@@ -18,6 +18,7 @@ #include "testing/gmock/include/gmock/gmock.h" using ::base::test::RunCallback; +using ::base::test::RunOnceCallback; using ::testing::_; using ::testing::AnyNumber; using ::testing::Invoke; @@ -87,7 +88,7 @@ bool use_aes_decryptor_ = false; base::test::TaskEnvironment task_environment_; base::MockCallback<CdmAttachedCB> set_cdm_cb_; - base::MockCallback<PipelineStatusCB> renderer_init_cb_; + base::MockOnceCallback<void(PipelineStatus)> renderer_init_cb_; NullMediaLog null_media_log_; StrictMock<MockCdmContext> cdm_context_; StrictMock<MockDecryptor> decryptor_; @@ -102,8 +103,8 @@ AddStream(DemuxerStream::AUDIO, /* encrypted = */ false); AddStream(DemuxerStream::VIDEO, /* encrypted = */ false); - EXPECT_CALL(*renderer_, Initialize(_, _, _)) - .WillOnce(RunCallback<2>(PIPELINE_OK)); + EXPECT_CALL(*renderer_, OnInitialize(_, _, _)) + .WillOnce(RunOnceCallback<2>(PIPELINE_OK)); EXPECT_CALL(renderer_init_cb_, Run(PIPELINE_OK)); decrypting_renderer_->Initialize(&media_resource_, &renderer_client_, @@ -118,8 +119,8 @@ AddStream(DemuxerStream::VIDEO, /* encrypted = */ false); UseAesDecryptor(true); - EXPECT_CALL(*renderer_, Initialize(_, _, _)) - .WillOnce(RunCallback<2>(PIPELINE_OK)); + EXPECT_CALL(*renderer_, OnInitialize(_, _, _)) + .WillOnce(RunOnceCallback<2>(PIPELINE_OK)); EXPECT_CALL(set_cdm_cb_, Run(true)); EXPECT_CALL(renderer_init_cb_, Run(PIPELINE_OK)); @@ -135,8 +136,8 @@ AddStream(DemuxerStream::AUDIO, /* encrypted = */ false); AddStream(DemuxerStream::VIDEO, /* encrypted = */ false); - EXPECT_CALL(*renderer_, Initialize(_, _, _)) - .WillOnce(RunCallback<2>(PIPELINE_OK)); + EXPECT_CALL(*renderer_, OnInitialize(_, _, _)) + .WillOnce(RunOnceCallback<2>(PIPELINE_OK)); EXPECT_CALL(*renderer_, SetCdm(_, _)).WillOnce(RunCallback<1>(true)); EXPECT_CALL(renderer_init_cb_, Run(PIPELINE_OK)); EXPECT_CALL(set_cdm_cb_, Run(true)); @@ -165,8 +166,8 @@ AddStream(DemuxerStream::VIDEO, /* encrypted = */ true); UseAesDecryptor(true); - EXPECT_CALL(*renderer_, Initialize(_, _, _)) - .WillOnce(RunCallback<2>(PIPELINE_OK)); + EXPECT_CALL(*renderer_, OnInitialize(_, _, _)) + .WillOnce(RunOnceCallback<2>(PIPELINE_OK)); EXPECT_CALL(renderer_init_cb_, Run(PIPELINE_OK)); EXPECT_CALL(set_cdm_cb_, Run(true)); @@ -182,8 +183,8 @@ AddStream(DemuxerStream::AUDIO, /* encrypted = */ true); AddStream(DemuxerStream::VIDEO, /* encrypted = */ true); - EXPECT_CALL(*renderer_, Initialize(_, _, _)) - .WillOnce(RunCallback<2>(PIPELINE_OK)); + EXPECT_CALL(*renderer_, OnInitialize(_, _, _)) + .WillOnce(RunOnceCallback<2>(PIPELINE_OK)); EXPECT_CALL(*renderer_, SetCdm(_, _)).WillOnce(RunCallback<1>(true)); EXPECT_CALL(renderer_init_cb_, Run(PIPELINE_OK)); EXPECT_CALL(set_cdm_cb_, Run(true)); @@ -201,8 +202,8 @@ AddStream(DemuxerStream::VIDEO, /* encrypted = */ true); UseAesDecryptor(true); - EXPECT_CALL(*renderer_, Initialize(_, _, _)) - .WillOnce(RunCallback<2>(PIPELINE_OK)); + EXPECT_CALL(*renderer_, OnInitialize(_, _, _)) + .WillOnce(RunOnceCallback<2>(PIPELINE_OK)); EXPECT_CALL(renderer_init_cb_, Run(PIPELINE_OK)); EXPECT_CALL(set_cdm_cb_, Run(true)); @@ -218,8 +219,8 @@ AddStream(DemuxerStream::AUDIO, /* encrypted = */ true); AddStream(DemuxerStream::VIDEO, /* encrypted = */ true); - EXPECT_CALL(*renderer_, Initialize(_, _, _)) - .WillOnce(RunCallback<2>(PIPELINE_OK)); + EXPECT_CALL(*renderer_, OnInitialize(_, _, _)) + .WillOnce(RunOnceCallback<2>(PIPELINE_OK)); EXPECT_CALL(*renderer_, SetCdm(_, _)).WillOnce(RunCallback<1>(true)); EXPECT_CALL(renderer_init_cb_, Run(PIPELINE_OK)); EXPECT_CALL(set_cdm_cb_, Run(true)); @@ -236,8 +237,8 @@ AddStream(DemuxerStream::AUDIO, /* encrypted = */ false); AddStream(DemuxerStream::VIDEO, /* encrypted = */ true); - EXPECT_CALL(*renderer_, Initialize(_, _, _)) - .WillOnce(RunCallback<2>(PIPELINE_OK)); + EXPECT_CALL(*renderer_, OnInitialize(_, _, _)) + .WillOnce(RunOnceCallback<2>(PIPELINE_OK)); EXPECT_CALL(*renderer_, SetCdm(_, _)).WillOnce(RunCallback<1>(true)); EXPECT_CALL(renderer_init_cb_, Run(PIPELINE_OK)); EXPECT_CALL(set_cdm_cb_, Run(true));
diff --git a/media/renderers/renderer_impl.cc b/media/renderers/renderer_impl.cc index fffc6d7b..c96fc170 100644 --- a/media/renderers/renderer_impl.cc +++ b/media/renderers/renderer_impl.cc
@@ -142,7 +142,7 @@ void RendererImpl::Initialize(MediaResource* media_resource, RendererClient* client, - const PipelineStatusCB& init_cb) { + PipelineStatusCallback init_cb) { DVLOG(1) << __func__; DCHECK(task_runner_->BelongsToCurrentThread()); DCHECK_EQ(state_, STATE_UNINITIALIZED); @@ -152,7 +152,7 @@ client_ = client; media_resource_ = media_resource; - init_cb_ = init_cb; + init_cb_ = std::move(init_cb); if (HasEncryptedStream() && !cdm_context_) { DVLOG(1) << __func__ << ": Has encrypted stream but CDM is not set."; @@ -189,7 +189,7 @@ InitializeAudioRenderer(); } -void RendererImpl::Flush(const base::Closure& flush_cb) { +void RendererImpl::Flush(base::OnceClosure flush_cb) { DVLOG(1) << __func__; DCHECK(task_runner_->BelongsToCurrentThread()); DCHECK(!flush_cb_); @@ -197,7 +197,7 @@ TRACE_EVENT_ASYNC_BEGIN0("media", "RendererImpl::Flush", this); if (state_ == STATE_FLUSHED) { - flush_cb_ = BindToCurrentLoop(flush_cb); + flush_cb_ = BindToCurrentLoop(std::move(flush_cb)); FinishFlush(); return; } @@ -207,7 +207,7 @@ return; } - flush_cb_ = flush_cb; + flush_cb_ = std::move(flush_cb); state_ = STATE_FLUSHING; // If a stream restart is pending, this Flush() will complete it. Upon flush
diff --git a/media/renderers/renderer_impl.h b/media/renderers/renderer_impl.h index 379be97..16a4c361 100644 --- a/media/renderers/renderer_impl.h +++ b/media/renderers/renderer_impl.h
@@ -55,10 +55,10 @@ // Renderer implementation. void Initialize(MediaResource* media_resource, RendererClient* client, - const PipelineStatusCB& init_cb) final; + PipelineStatusCallback init_cb) final; void SetCdm(CdmContext* cdm_context, const CdmAttachedCB& cdm_attached_cb) final; - void Flush(const base::Closure& flush_cb) final; + void Flush(base::OnceClosure flush_cb) final; void StartPlayingFrom(base::TimeDelta time) final; void SetPlaybackRate(double playback_rate) final; void SetVolume(float volume) final; @@ -208,8 +208,8 @@ RendererClient* client_; // Temporary callback used for Initialize() and Flush(). - PipelineStatusCB init_cb_; - base::Closure flush_cb_; + PipelineStatusCallback init_cb_; + base::OnceClosure flush_cb_; std::unique_ptr<RendererClientInternal> audio_renderer_client_; std::unique_ptr<RendererClientInternal> video_renderer_client_;
diff --git a/media/renderers/renderer_impl_unittest.cc b/media/renderers/renderer_impl_unittest.cc index a3aeeeb9..08cf48a 100644 --- a/media/renderers/renderer_impl_unittest.cc +++ b/media/renderers/renderer_impl_unittest.cc
@@ -136,10 +136,9 @@ renderer_impl_->set_time_source_for_testing(&time_source_); } - renderer_impl_->Initialize( - demuxer_.get(), &callbacks_, - base::BindRepeating(&CallbackHelper::OnInitialize, - base::Unretained(&callbacks_))); + renderer_impl_->Initialize(demuxer_.get(), &callbacks_, + base::BindOnce(&CallbackHelper::OnInitialize, + base::Unretained(&callbacks_))); base::RunLoop().RunUntilIdle(); if (start_status == PIPELINE_OK && audio_stream_) { @@ -272,8 +271,8 @@ SetFlushExpectationsForAVRenderers(); EXPECT_CALL(callbacks_, OnFlushed()); - renderer_impl_->Flush(base::BindRepeating(&CallbackHelper::OnFlushed, - base::Unretained(&callbacks_))); + renderer_impl_->Flush(base::BindOnce(&CallbackHelper::OnFlushed, + base::Unretained(&callbacks_))); base::RunLoop().RunUntilIdle(); } @@ -557,8 +556,8 @@ TEST_F(RendererImplTest, FlushAfterInitialization) { InitializeWithAudioAndVideo(); EXPECT_CALL(callbacks_, OnFlushed()); - renderer_impl_->Flush(base::BindRepeating(&CallbackHelper::OnFlushed, - base::Unretained(&callbacks_))); + renderer_impl_->Flush(base::BindOnce(&CallbackHelper::OnFlushed, + base::Unretained(&callbacks_))); base::RunLoop().RunUntilIdle(); } @@ -662,8 +661,8 @@ RunClosure<0>())); EXPECT_CALL(callbacks_, OnError(PIPELINE_ERROR_DECODE)); EXPECT_CALL(callbacks_, OnFlushed()); - renderer_impl_->Flush(base::BindRepeating(&CallbackHelper::OnFlushed, - base::Unretained(&callbacks_))); + renderer_impl_->Flush(base::BindOnce(&CallbackHelper::OnFlushed, + base::Unretained(&callbacks_))); base::RunLoop().RunUntilIdle(); } @@ -829,8 +828,8 @@ EXPECT_CALL(*audio_renderer_, Flush(_)).WillOnce(RunClosure<0>()); EXPECT_CALL(*video_renderer_, Flush(_)).WillOnce(RunClosure<0>()); EXPECT_CALL(callbacks_, OnFlushed()); - renderer_impl_->Flush(base::BindRepeating(&CallbackHelper::OnFlushed, - base::Unretained(&callbacks_))); + renderer_impl_->Flush(base::BindOnce(&CallbackHelper::OnFlushed, + base::Unretained(&callbacks_))); base::RunLoop().RunUntilIdle(); // Start playback after the flush, but never return BUFFERING_HAVE_ENOUGH from
diff --git a/media/renderers/video_renderer_impl_unittest.cc b/media/renderers/video_renderer_impl_unittest.cc index 87345cfb..5e00c0d 100644 --- a/media/renderers/video_renderer_impl_unittest.cc +++ b/media/renderers/video_renderer_impl_unittest.cc
@@ -37,7 +37,6 @@ #include "media/video/mock_gpu_memory_buffer_video_frame_pool.h" #include "testing/gtest/include/gtest/gtest.h" -using ::base::test::RunCallback; using ::base::test::RunClosure; using ::base::test::RunOnceCallback; using ::testing::_; @@ -103,9 +102,10 @@ demuxer_stream_.set_video_decoder_config(TestVideoConfig::Normal()); // We expect these to be called but we don't care how/when. - EXPECT_CALL(demuxer_stream_, Read(_)).WillRepeatedly( - RunCallback<0>(DemuxerStream::kOk, - scoped_refptr<DecoderBuffer>(new DecoderBuffer(0)))); + EXPECT_CALL(demuxer_stream_, OnRead(_)) + .WillRepeatedly(RunOnceCallback<0>( + DemuxerStream::kOk, + scoped_refptr<DecoderBuffer>(new DecoderBuffer(0)))); } ~VideoRendererImplTest() override = default; @@ -270,9 +270,9 @@ DCHECK(decode_cb_); // Return EOS buffer to trigger EOS frame. - EXPECT_CALL(demuxer_stream_, Read(_)) - .WillOnce(RunCallback<0>(DemuxerStream::kOk, - DecoderBuffer::CreateEOSBuffer())); + EXPECT_CALL(demuxer_stream_, OnRead(_)) + .WillOnce(RunOnceCallback<0>(DemuxerStream::kOk, + DecoderBuffer::CreateEOSBuffer())); // Satify pending |decode_cb_| to trigger a new DemuxerStream::Read(). task_environment_.GetMainThreadTaskRunner()->PostTask( @@ -912,8 +912,8 @@ .WillRepeatedly(Return(true)); // Signal a config change at the next DemuxerStream::Read(). - EXPECT_CALL(demuxer_stream_, Read(_)) - .WillOnce(RunCallback<0>(DemuxerStream::kConfigChanged, nullptr)); + EXPECT_CALL(demuxer_stream_, OnRead(_)) + .WillOnce(RunOnceCallback<0>(DemuxerStream::kConfigChanged, nullptr)); // Use LargeEncrypted config (non-default) to ensure its plumbed through to // callback.
diff --git a/net/dns/context_host_resolver_unittest.cc b/net/dns/context_host_resolver_unittest.cc index ff4467b7..516f858 100644 --- a/net/dns/context_host_resolver_unittest.cc +++ b/net/dns/context_host_resolver_unittest.cc
@@ -411,12 +411,12 @@ AddressList expected(kEndpoint); std::unique_ptr<HostCache> cache = HostCache::CreateDefaultCache(); - cache->Set( - HostCache::Key("example.com", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY), - HostCache::Entry(OK, expected, HostCache::Entry::SOURCE_DNS, - base::TimeDelta::FromDays(1)), - clock.NowTicks(), base::TimeDelta::FromDays(1)); + cache->Set(HostCache::Key("example.com", DnsQueryType::UNSPECIFIED, + 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()), + HostCache::Entry(OK, expected, HostCache::Entry::SOURCE_DNS, + base::TimeDelta::FromDays(1)), + clock.NowTicks(), base::TimeDelta::FromDays(1)); auto resolver = std::make_unique<ContextHostResolver>(manager_.get(), std::move(cache));
diff --git a/net/dns/dns_util.cc b/net/dns/dns_util.cc index 14997c4..d61f6fb0 100644 --- a/net/dns/dns_util.cc +++ b/net/dns/dns_util.cc
@@ -144,7 +144,7 @@ // DohProviderId histogram suffix list in // tools/metrics/histograms/histograms.xml. static const base::NoDestructor<std::vector<DohUpgradeEntry>> - upgradable_servers({ + upgradable_servers{{ DohUpgradeEntry( "CleanBrowsingAdult", {"185.228.168.10", "185.228.169.11", "2a0d:2a00:1::1", @@ -174,6 +174,12 @@ "1dot1dot1dot1.cloudflare-dns.com"} /* DoT hostname */, {"https://chrome.cloudflare-dns.com/dns-query", true /* use-post */}), + DohUpgradeEntry("Comcast", + {"75.75.75.75", "75.75.76.76", "2001:558:feed::1", + "2001:558:feed::2"}, + {""} /* DoT hostname */, + {"https://doh.xfinity.com/dns-query{?dns}", + false /* use_post */}), DohUpgradeEntry( "Dnssb", {"185.222.222.222", "185.184.222.222", "2a09::", "2a09::1"}, @@ -215,7 +221,7 @@ {"9.9.9.9", "149.112.112.112", "2620:fe::fe", "2620:fe::9"}, {"dns.quad9.net", "dns9.quad9.net"} /* DoT hostname */, {"https://dns.quad9.net/dns-query", true /* use_post */}), - }); + }}; return *upgradable_servers; }
diff --git a/net/dns/host_cache.cc b/net/dns/host_cache.cc index 4761b9d..de8b39d1 100644 --- a/net/dns/host_cache.cc +++ b/net/dns/host_cache.cc
@@ -38,6 +38,7 @@ const char kFlagsKey[] = "flags"; const char kHostResolverSourceKey[] = "host_resolver_source"; const char kSecureKey[] = "secure"; +const char kNetworkIsolationKeyKey[] = "network_isolation_key"; const char kExpirationKey[] = "expiration"; const char kTtlKey[] = "ttl"; const char kNetworkChangesKey[] = "network_changes"; @@ -118,13 +119,17 @@ HostCache::Key::Key(const std::string& hostname, DnsQueryType dns_query_type, HostResolverFlags host_resolver_flags, - HostResolverSource host_resolver_source) + HostResolverSource host_resolver_source, + const NetworkIsolationKey& network_isolation_key) : hostname(hostname), dns_query_type(dns_query_type), host_resolver_flags(host_resolver_flags), - host_resolver_source(host_resolver_source) {} + host_resolver_source(host_resolver_source), + network_isolation_key(network_isolation_key) {} HostCache::Key::Key() = default; +HostCache::Key::Key(const Key& key) = default; +HostCache::Key::Key(Key&& key) = default; HostCache::Entry::Entry(int error, Source source, base::TimeDelta ttl) : error_(error), source_(source), ttl_(ttl) { @@ -604,6 +609,11 @@ const Key& key = pair.first; const Entry& entry = pair.second; + base::Value network_isolation_key_value; + // Don't save entries associated with ephemeral NetworkIsolationKeys. + if (!key.network_isolation_key.ToValue(&network_isolation_key_value)) + continue; + auto entry_dict = std::make_unique<base::DictionaryValue>( entry.GetAsValue(include_staleness)); @@ -613,6 +623,8 @@ entry_dict->SetInteger(kFlagsKey, key.host_resolver_flags); entry_dict->SetInteger(kHostResolverSourceKey, static_cast<int>(key.host_resolver_source)); + entry_dict->SetKey(kNetworkIsolationKeyKey, + std::move(network_isolation_key_value)); entry_dict->SetBoolean(kSecureKey, static_cast<bool>(key.secure)); entry_list->Append(std::move(entry_dict)); @@ -667,6 +679,15 @@ host_resolver_source = static_cast<int>(HostResolverSource::ANY); } + const base::Value* network_isolation_key_value = + entry_dict->FindKey(kNetworkIsolationKeyKey); + NetworkIsolationKey network_isolation_key; + if (!network_isolation_key_value || + !NetworkIsolationKey::FromValue(*network_isolation_key_value, + &network_isolation_key)) { + return false; + } + bool secure; if (!entry_dict->GetBoolean(kSecureKey, &secure)) { secure = false; @@ -740,7 +761,8 @@ } Key key(hostname, dns_query_type, flags, - static_cast<HostResolverSource>(host_resolver_source)); + static_cast<HostResolverSource>(host_resolver_source), + network_isolation_key); key.secure = secure; // If the key is already in the cache, assume it's more recent and don't
diff --git a/net/dns/host_cache.h b/net/dns/host_cache.h index 7134cece..09d09b7e 100644 --- a/net/dns/host_cache.h +++ b/net/dns/host_cache.h
@@ -30,6 +30,7 @@ #include "net/base/host_port_pair.h" #include "net/base/net_errors.h" #include "net/base/net_export.h" +#include "net/base/network_isolation_key.h" #include "net/dns/dns_util.h" #include "net/dns/host_resolver_source.h" #include "net/dns/public/dns_query_type.h" @@ -46,24 +47,25 @@ class NET_EXPORT HostCache { public: struct NET_EXPORT Key { + // TODO(mmenke): Make |network_isolation_key| mandatory. Key(const std::string& hostname, DnsQueryType dns_query_type, HostResolverFlags host_resolver_flags, - HostResolverSource host_resolver_source); + HostResolverSource host_resolver_source, + const NetworkIsolationKey& network_isolation_key = + NetworkIsolationKey()); Key(); + Key(const Key& key); + Key(Key&& key); // This is a helper used in comparing keys. The order of comparisons of // |Key| fields is arbitrary, but the tuple is constructed with // |dns_query_type| and |host_resolver_flags| before |hostname| under the // assumption that integer comparisons are faster than string comparisons. - std::tuple<DnsQueryType, - HostResolverFlags, - const std::string&, - HostResolverSource, - bool> - GetTuple(const Key* key) const { + auto GetTuple(const Key* key) const { return std::tie(key->dns_query_type, key->host_resolver_flags, - key->hostname, key->host_resolver_source, key->secure); + key->hostname, key->host_resolver_source, + key->network_isolation_key, key->secure); } bool operator==(const Key& other) const { @@ -78,6 +80,7 @@ DnsQueryType dns_query_type = DnsQueryType::UNSPECIFIED; HostResolverFlags host_resolver_flags = 0; HostResolverSource host_resolver_source = HostResolverSource::ANY; + NetworkIsolationKey network_isolation_key; bool secure = false; }; @@ -320,7 +323,13 @@ // Fills the provided base::ListValue with the contents of the cache for // serialization. |entry_list| must be non-null and will be cleared before - // adding the cache contents. + // adding the cache contents. Entries with ephemeral NetworkIsolationKeys will + // not be written to the resulting list. + // + // TODO(mmenke): This is used both in combination with RestoreFromListValue() + // and for NetLog. Update the NetLogViewer's display to handle + // NetworkIsolationKeys, and add some way for to get a result with ephemeral + // NIKs included. void GetAsListValue(base::ListValue* entry_list, bool include_staleness) const; // Takes a base::ListValue representing cache entries and stores them in the
diff --git a/net/dns/host_cache_unittest.cc b/net/dns/host_cache_unittest.cc index a972141..c62608c 100644 --- a/net/dns/host_cache_unittest.cc +++ b/net/dns/host_cache_unittest.cc
@@ -16,6 +16,8 @@ #include "base/values.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" +#include "url/origin.h" namespace net { @@ -26,7 +28,7 @@ // Builds a key for |hostname|, defaulting the query type to unspecified. HostCache::Key Key(const std::string& hostname) { return HostCache::Key(hostname, DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); } bool FoobarIndexIsOdd(const std::string& foobarx_com) { @@ -107,6 +109,67 @@ EXPECT_FALSE(cache.Lookup(key2, now)); } +// Make sure NetworkIsolationKey is respected. +TEST(HostCacheTest, NetworkIsolationKey) { + const char kHostname[] = "hostname.test"; + const base::TimeDelta kTTL = base::TimeDelta::FromSeconds(10); + + const url::Origin kOrigin1( + url::Origin::Create(GURL("https://origin1.test/"))); + const NetworkIsolationKey kNetworkIsolationKey1(kOrigin1, kOrigin1); + const url::Origin kOrigin2( + url::Origin::Create(GURL("https://origin2.test/"))); + const NetworkIsolationKey kNetworkIsolationKey2(kOrigin2, kOrigin2); + + HostCache::Key key1(kHostname, DnsQueryType::UNSPECIFIED, 0, + HostResolverSource::ANY, kNetworkIsolationKey1); + HostCache::Key key2(kHostname, DnsQueryType::UNSPECIFIED, 0, + HostResolverSource::ANY, kNetworkIsolationKey2); + HostCache::Entry entry1 = + HostCache::Entry(OK, AddressList(), HostCache::Entry::SOURCE_UNKNOWN); + HostCache::Entry entry2 = HostCache::Entry(ERR_FAILED, AddressList(), + HostCache::Entry::SOURCE_UNKNOWN); + + HostCache cache(kMaxCacheEntries); + + // Start at t=0. + base::TimeTicks now; + + EXPECT_EQ(0U, cache.size()); + + // Add an entry for kNetworkIsolationKey1. + EXPECT_FALSE(cache.Lookup(key1, now)); + cache.Set(key1, entry1, now, kTTL); + + const std::pair<const HostCache::Key, HostCache::Entry>* result = + cache.Lookup(key1, now); + ASSERT_TRUE(result); + EXPECT_EQ(kNetworkIsolationKey1, result->first.network_isolation_key); + EXPECT_EQ(OK, result->second.error()); + EXPECT_FALSE(cache.Lookup(key2, now)); + EXPECT_EQ(1U, cache.size()); + + // Add a different entry for kNetworkIsolationKey2. + cache.Set(key2, entry2, now, 3 * kTTL); + result = cache.Lookup(key1, now); + ASSERT_TRUE(result); + EXPECT_EQ(kNetworkIsolationKey1, result->first.network_isolation_key); + EXPECT_EQ(OK, result->second.error()); + result = cache.Lookup(key2, now); + ASSERT_TRUE(result); + EXPECT_EQ(kNetworkIsolationKey2, result->first.network_isolation_key); + EXPECT_EQ(ERR_FAILED, result->second.error()); + EXPECT_EQ(2U, cache.size()); + + // Advance time so that first entry times out. Second entry should remain. + now += 2 * kTTL; + EXPECT_FALSE(cache.Lookup(key1, now)); + result = cache.Lookup(key2, now); + ASSERT_TRUE(result); + EXPECT_EQ(kNetworkIsolationKey2, result->first.network_isolation_key); + EXPECT_EQ(ERR_FAILED, result->second.error()); +} + // Try caching entries for a failed resolve attempt -- since we set the TTL of // such entries to 0 it won't store, but it will kick out the previous result. TEST(HostCacheTest, NoCacheZeroTTL) { @@ -210,9 +273,9 @@ base::TimeTicks now; HostCache::Key key1("foobar.com", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); - HostCache::Key key2("foobar.com", DnsQueryType::A, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); + HostCache::Key key2("foobar.com", DnsQueryType::A, 0, HostResolverSource::ANY, + NetworkIsolationKey()); HostCache::Entry entry = HostCache::Entry(OK, AddressList(), HostCache::Entry::SOURCE_UNKNOWN); @@ -245,12 +308,13 @@ // t=0. base::TimeTicks now; - HostCache::Key key1("foobar.com", DnsQueryType::A, 0, - HostResolverSource::ANY); + HostCache::Key key1("foobar.com", DnsQueryType::A, 0, HostResolverSource::ANY, + NetworkIsolationKey()); HostCache::Key key2("foobar.com", DnsQueryType::A, HOST_RESOLVER_CANONNAME, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Key key3("foobar.com", DnsQueryType::A, - HOST_RESOLVER_LOOPBACK_ONLY, HostResolverSource::ANY); + HOST_RESOLVER_LOOPBACK_ONLY, HostResolverSource::ANY, + NetworkIsolationKey()); HostCache::Entry entry = HostCache::Entry(OK, AddressList(), HostCache::Entry::SOURCE_UNKNOWN); @@ -292,9 +356,9 @@ base::TimeTicks now; HostCache::Key key1("foobar.com", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Key key2("foobar.com", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::DNS); + HostResolverSource::DNS, NetworkIsolationKey()); HostCache::Entry entry = HostCache::Entry(OK, AddressList(), HostCache::Entry::SOURCE_UNKNOWN); @@ -328,11 +392,11 @@ base::TimeTicks now; HostCache::EntryStaleness stale; - HostCache::Key key1("foobar.com", DnsQueryType::A, 0, - HostResolverSource::ANY); + HostCache::Key key1("foobar.com", DnsQueryType::A, 0, HostResolverSource::ANY, + NetworkIsolationKey()); key1.secure = true; - HostCache::Key key2("foobar.com", DnsQueryType::A, 0, - HostResolverSource::ANY); + HostCache::Key key2("foobar.com", DnsQueryType::A, 0, HostResolverSource::ANY, + NetworkIsolationKey()); key2.secure = false; HostCache::Entry entry = HostCache::Entry(OK, AddressList(), HostCache::Entry::SOURCE_UNKNOWN); @@ -374,9 +438,9 @@ HostCache::EntryStaleness stale; HostCache::Key insecure_key("foobar.com", DnsQueryType::A, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Key secure_key("foobar.com", DnsQueryType::A, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); secure_key.secure = true; HostCache::Entry entry = HostCache::Entry(OK, AddressList(), HostCache::Entry::SOURCE_UNKNOWN); @@ -691,51 +755,61 @@ }; std::vector<CacheTestParameters> tests = { {HostCache::Key("host1", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY), + HostResolverSource::ANY, NetworkIsolationKey()), HostCache::Key("host1", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY), + HostResolverSource::ANY, NetworkIsolationKey()), 0}, - {HostCache::Key("host1", DnsQueryType::A, 0, HostResolverSource::ANY), + {HostCache::Key("host1", DnsQueryType::A, 0, HostResolverSource::ANY, + NetworkIsolationKey()), HostCache::Key("host1", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY), + HostResolverSource::ANY, NetworkIsolationKey()), 1}, {HostCache::Key("host1", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY), - HostCache::Key("host1", DnsQueryType::A, 0, HostResolverSource::ANY), + HostResolverSource::ANY, NetworkIsolationKey()), + HostCache::Key("host1", DnsQueryType::A, 0, HostResolverSource::ANY, + NetworkIsolationKey()), -1}, {HostCache::Key("host1", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY), + HostResolverSource::ANY, NetworkIsolationKey()), HostCache::Key("host2", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY), + HostResolverSource::ANY, NetworkIsolationKey()), -1}, - {HostCache::Key("host1", DnsQueryType::A, 0, HostResolverSource::ANY), + {HostCache::Key("host1", DnsQueryType::A, 0, HostResolverSource::ANY, + NetworkIsolationKey()), HostCache::Key("host2", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY), + HostResolverSource::ANY, NetworkIsolationKey()), 1}, {HostCache::Key("host1", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY), - HostCache::Key("host2", DnsQueryType::A, 0, HostResolverSource::ANY), + HostResolverSource::ANY, NetworkIsolationKey()), + HostCache::Key("host2", DnsQueryType::A, 0, HostResolverSource::ANY, + NetworkIsolationKey()), -1}, {HostCache::Key("host1", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY), + HostResolverSource::ANY, NetworkIsolationKey()), HostCache::Key("host1", DnsQueryType::UNSPECIFIED, - HOST_RESOLVER_CANONNAME, HostResolverSource::ANY), + HOST_RESOLVER_CANONNAME, HostResolverSource::ANY, + NetworkIsolationKey()), -1}, {HostCache::Key("host1", DnsQueryType::UNSPECIFIED, - HOST_RESOLVER_CANONNAME, HostResolverSource::ANY), + HOST_RESOLVER_CANONNAME, HostResolverSource::ANY, + NetworkIsolationKey()), HostCache::Key("host1", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY), + HostResolverSource::ANY, NetworkIsolationKey()), 1}, {HostCache::Key("host1", DnsQueryType::UNSPECIFIED, - HOST_RESOLVER_CANONNAME, HostResolverSource::ANY), + HOST_RESOLVER_CANONNAME, HostResolverSource::ANY, + NetworkIsolationKey()), HostCache::Key("host2", DnsQueryType::UNSPECIFIED, - HOST_RESOLVER_CANONNAME, HostResolverSource::ANY), + HOST_RESOLVER_CANONNAME, HostResolverSource::ANY, + NetworkIsolationKey()), -1}, }; - HostCache::Key insecure_key = HostCache::Key( - "host1", DnsQueryType::UNSPECIFIED, 0, HostResolverSource::ANY); - HostCache::Key secure_key = HostCache::Key("host1", DnsQueryType::UNSPECIFIED, - 0, HostResolverSource::ANY); + HostCache::Key insecure_key = + HostCache::Key("host1", DnsQueryType::UNSPECIFIED, 0, + HostResolverSource::ANY, NetworkIsolationKey()); + HostCache::Key secure_key = + HostCache::Key("host1", DnsQueryType::UNSPECIFIED, 0, + HostResolverSource::ANY, NetworkIsolationKey()); secure_key.secure = true; tests.emplace_back(insecure_key, secure_key, -1); @@ -900,13 +974,62 @@ EXPECT_EQ(2u, restored_cache.last_restore_size()); } +TEST(HostCacheTest, SerializeAndDeserializeWithNetworkIsolationKey) { + const char kHostname[] = "hostname.test"; + const base::TimeDelta kTTL = base::TimeDelta::FromSeconds(10); + const url::Origin kOrigin(url::Origin::Create(GURL("https://origin.test/"))); + const NetworkIsolationKey kNetworkIsolationKey(kOrigin, kOrigin); + const url::Origin kOpaqueOrigin; + const NetworkIsolationKey kOpaqueNetworkIsolationKey(kOpaqueOrigin, + kOpaqueOrigin); + + HostCache::Key key1(kHostname, DnsQueryType::UNSPECIFIED, 0, + HostResolverSource::ANY, kNetworkIsolationKey); + HostCache::Key key2(kHostname, DnsQueryType::UNSPECIFIED, 0, + HostResolverSource::ANY, kOpaqueNetworkIsolationKey); + IPEndPoint endpoint(IPAddress(1, 2, 3, 4), 0); + + HostCache::Entry entry = HostCache::Entry(OK, AddressList(endpoint), + HostCache::Entry::SOURCE_UNKNOWN); + + base::TimeTicks now; + HostCache cache(kMaxCacheEntries); + + cache.Set(key1, entry, now, kTTL); + cache.Set(key2, entry, now, kTTL); + + EXPECT_TRUE(cache.Lookup(key1, now)); + EXPECT_EQ(kNetworkIsolationKey, + cache.Lookup(key1, now)->first.network_isolation_key); + EXPECT_TRUE(cache.Lookup(key2, now)); + EXPECT_EQ(kOpaqueNetworkIsolationKey, + cache.Lookup(key2, now)->first.network_isolation_key); + EXPECT_EQ(2u, cache.size()); + + base::ListValue serialized_cache; + cache.GetAsListValue(&serialized_cache, /*include_staleness=*/false); + HostCache restored_cache(kMaxCacheEntries); + EXPECT_TRUE(restored_cache.RestoreFromListValue(serialized_cache)); + EXPECT_EQ(1u, restored_cache.size()); + + HostCache::EntryStaleness stale; + const std::pair<const HostCache::Key, HostCache::Entry>* result = + restored_cache.LookupStale(key1, now, &stale); + ASSERT_TRUE(result); + EXPECT_EQ(kNetworkIsolationKey, result->first.network_isolation_key); + EXPECT_EQ(kHostname, result->first.hostname); + ASSERT_EQ(1u, result->second.addresses().value().size()); + EXPECT_EQ(endpoint, result->second.addresses().value().front()); + EXPECT_FALSE(restored_cache.Lookup(key2, now)); +} + TEST(HostCacheTest, SerializeAndDeserialize_Text) { base::TimeTicks now; base::TimeDelta ttl = base::TimeDelta::FromSeconds(99); std::vector<std::string> text_records({"foo", "bar"}); - HostCache::Key key("example.com", DnsQueryType::A, 0, - HostResolverSource::DNS); + HostCache::Key key("example.com", DnsQueryType::A, 0, HostResolverSource::DNS, + NetworkIsolationKey()); key.secure = true; HostCache::Entry entry(OK, text_records, HostCache::Entry::SOURCE_DNS, ttl); EXPECT_TRUE(entry.text_records()); @@ -920,9 +1043,10 @@ HostCache restored_cache(kMaxCacheEntries); restored_cache.RestoreFromListValue(serialized_cache); - ASSERT_EQ(1u, cache.size()); + ASSERT_EQ(1u, restored_cache.size()); + HostCache::EntryStaleness stale; const std::pair<const HostCache::Key, HostCache::Entry>* result = - cache.Lookup(key, now); + restored_cache.LookupStale(key, now, &stale); ASSERT_TRUE(result); EXPECT_TRUE(result->first.secure); EXPECT_FALSE(result->second.addresses()); @@ -937,8 +1061,8 @@ base::TimeDelta ttl = base::TimeDelta::FromSeconds(99); std::vector<HostPortPair> hostnames( {HostPortPair("example.com", 95), HostPortPair("chromium.org", 122)}); - HostCache::Key key("example.com", DnsQueryType::A, 0, - HostResolverSource::DNS); + HostCache::Key key("example.com", DnsQueryType::A, 0, HostResolverSource::DNS, + NetworkIsolationKey()); HostCache::Entry entry(OK, hostnames, HostCache::Entry::SOURCE_DNS, ttl); EXPECT_TRUE(entry.hostnames()); @@ -951,9 +1075,10 @@ HostCache restored_cache(kMaxCacheEntries); restored_cache.RestoreFromListValue(serialized_cache); - ASSERT_EQ(1u, cache.size()); + ASSERT_EQ(1u, restored_cache.size()); + HostCache::EntryStaleness stale; const std::pair<const HostCache::Key, HostCache::Entry>* result = - cache.Lookup(key, now); + restored_cache.LookupStale(key, now, &stale); ASSERT_TRUE(result); EXPECT_FALSE(result->first.secure); EXPECT_FALSE(result->second.addresses()); @@ -1222,15 +1347,17 @@ TEST(HostCacheTest, GetMatchingKey_ExactMatch) { // Should find match because this mimics the default Key struct. - GetMatchingKeyHelper(HostCache::Key("foobar.com", DnsQueryType::UNSPECIFIED, - 0, HostResolverSource::ANY), - true); + GetMatchingKeyHelper( + HostCache::Key("foobar.com", DnsQueryType::UNSPECIFIED, 0, + HostResolverSource::ANY, NetworkIsolationKey()), + true); } TEST(HostCacheTest, GetMatchingKey_IgnoreSecureField) { // Should find match because lookups ignore the secure field. - HostCache::Key secure_key = HostCache::Key( - "foobar.com", DnsQueryType::UNSPECIFIED, 0, HostResolverSource::ANY); + HostCache::Key secure_key = + HostCache::Key("foobar.com", DnsQueryType::UNSPECIFIED, 0, + HostResolverSource::ANY, NetworkIsolationKey()); secure_key.secure = true; GetMatchingKeyHelper(secure_key, true); } @@ -1238,7 +1365,8 @@ TEST(HostCacheTest, GetMatchingKey_UnsupportedDnsQueryType) { // Should not find match because the DnsQueryType field matters. GetMatchingKeyHelper( - HostCache::Key("foobar.com", DnsQueryType::A, 0, HostResolverSource::ANY), + HostCache::Key("foobar.com", DnsQueryType::A, 0, HostResolverSource::ANY, + NetworkIsolationKey()), false); } @@ -1247,22 +1375,24 @@ GetMatchingKeyHelper( HostCache::Key("foobar.com", DnsQueryType::UNSPECIFIED, HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6, - HostResolverSource::ANY), + HostResolverSource::ANY, NetworkIsolationKey()), false); } TEST(HostCacheTest, GetMatchingKey_UnsupportedHostResolverSource) { // Should not find match because the HostResolverSource field matters. - GetMatchingKeyHelper(HostCache::Key("foobar.com", DnsQueryType::UNSPECIFIED, - 0, HostResolverSource::DNS), - false); + GetMatchingKeyHelper( + HostCache::Key("foobar.com", DnsQueryType::UNSPECIFIED, 0, + HostResolverSource::DNS, NetworkIsolationKey()), + false); } TEST(HostCacheTest, GetMatchingKey_AlternativeMatch) { // Should find match because a lookup with these alternate fields is tried. - HostCache::Key secure_key = HostCache::Key( - "foobar.com", DnsQueryType::A, - HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6, HostResolverSource::ANY); + HostCache::Key secure_key = + HostCache::Key("foobar.com", DnsQueryType::A, + HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6, + HostResolverSource::ANY, NetworkIsolationKey()); secure_key.secure = true; GetMatchingKeyHelper(secure_key, true); }
diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc index d92aadd..4e6720a 100644 --- a/net/dns/host_resolver_manager.cc +++ b/net/dns/host_resolver_manager.cc
@@ -2229,6 +2229,7 @@ proc_task_ = nullptr; KillDnsTask(); mdns_task_ = nullptr; + job_running_ = false; if (dispatcher_) { // Signal dispatcher that a slot has opened.
diff --git a/net/dns/host_resolver_manager_unittest.cc b/net/dns/host_resolver_manager_unittest.cc index c9ca3d6..3d0752b 100644 --- a/net/dns/host_resolver_manager_unittest.cc +++ b/net/dns/host_resolver_manager_unittest.cc
@@ -623,7 +623,8 @@ const std::pair<const HostCache::Key, HostCache::Entry>* cache_result = GetCacheHit(HostCache::Key("just.testing", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, - HostResolverSource::ANY)); + HostResolverSource::ANY, + NetworkIsolationKey())); EXPECT_TRUE(cache_result); } @@ -820,7 +821,8 @@ const std::pair<const HostCache::Key, HostCache::Entry>* cache_result = GetCacheHit(HostCache::Key("just.testing", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, - HostResolverSource::ANY)); + HostResolverSource::ANY, + NetworkIsolationKey())); EXPECT_FALSE(cache_result); } @@ -2246,9 +2248,9 @@ // for failed entries from proc-based resolver. That said, the fixed TTL is 0, // so it should never be cached. const std::pair<const HostCache::Key, HostCache::Entry>* cache_result = - GetCacheHit(HostCache::Key("single", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, - HostResolverSource::ANY)); + GetCacheHit(HostCache::Key( + "single", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey())); EXPECT_FALSE(cache_result); ResolveHostResponseHelper multiple_response(resolver_->CreateRequest( @@ -4919,9 +4921,10 @@ ASSERT_THAT(response.result_error(), IsOk()); EXPECT_THAT(response.request()->GetAddressResults().value().endpoints(), testing::ElementsAre(CreateExpected("127.0.0.1", 80))); - HostCache::Key insecure_key = HostCache::Key( - "secure_slow_nx_insecure_4slow_ok", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key insecure_key = + HostCache::Key("secure_slow_nx_insecure_4slow_ok", + DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); const std::pair<const HostCache::Key, HostCache::Entry>* cache_result = GetCacheHit(insecure_key); EXPECT_TRUE(!!cache_result); @@ -4946,9 +4949,9 @@ response_secure.request()->GetAddressResults().value().endpoints(), testing::UnorderedElementsAre(CreateExpected("127.0.0.1", 80), CreateExpected("::1", 80))); - HostCache::Key secure_key = - HostCache::Key("automatic", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key secure_key = HostCache::Key( + "automatic", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); secure_key.secure = true; cache_result = GetCacheHit(secure_key); EXPECT_TRUE(!!cache_result); @@ -4965,7 +4968,8 @@ CreateExpected("::1", 80))); HostCache::Key insecure_key = HostCache::Key("insecure_automatic", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + 0 /* host_resolver_flags */, HostResolverSource::ANY, + NetworkIsolationKey()); cache_result = GetCacheHit(insecure_key); EXPECT_TRUE(!!cache_result); @@ -4988,7 +4992,8 @@ // Populate cache with a secure entry. HostCache::Key cached_secure_key = HostCache::Key("automatic_cached", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + 0 /* host_resolver_flags */, HostResolverSource::ANY, + NetworkIsolationKey()); cached_secure_key.secure = true; IPEndPoint kExpectedSecureIP = CreateExpected("192.168.1.102", 80); PopulateCache(cached_secure_key, kExpectedSecureIP); @@ -5014,7 +5019,8 @@ // Populate cache with an insecure entry. HostCache::Key cached_insecure_key = HostCache::Key("insecure_automatic_cached", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + 0 /* host_resolver_flags */, HostResolverSource::ANY, + NetworkIsolationKey()); IPEndPoint kExpectedInsecureIP = CreateExpected("192.168.1.103", 80); PopulateCache(cached_insecure_key, kExpectedInsecureIP); @@ -5045,13 +5051,15 @@ // Populate cache with both secure and insecure entries. HostCache::Key cached_secure_key = HostCache::Key("automatic_cached", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + 0 /* host_resolver_flags */, HostResolverSource::ANY, + NetworkIsolationKey()); cached_secure_key.secure = true; IPEndPoint kExpectedSecureIP = CreateExpected("192.168.1.102", 80); PopulateCache(cached_secure_key, kExpectedSecureIP); HostCache::Key cached_insecure_key = HostCache::Key("insecure_automatic_cached", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + 0 /* host_resolver_flags */, HostResolverSource::ANY, + NetworkIsolationKey()); IPEndPoint kExpectedInsecureIP = CreateExpected("192.168.1.103", 80); PopulateCache(cached_insecure_key, kExpectedInsecureIP); @@ -5085,9 +5093,9 @@ EXPECT_THAT(response.request()->GetAddressResults().value().endpoints(), testing::UnorderedElementsAre(CreateExpected("127.0.0.1", 80), CreateExpected("::1", 80))); - HostCache::Key key = - HostCache::Key("automatic", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key key = HostCache::Key( + "automatic", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); cache_result = GetCacheHit(key); EXPECT_TRUE(!!cache_result); } @@ -5109,17 +5117,17 @@ response_automatic.request()->GetAddressResults().value().endpoints(), testing::UnorderedElementsAre(CreateExpected("127.0.0.1", 80), CreateExpected("::1", 80))); - HostCache::Key secure_key = - HostCache::Key("automatic", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key secure_key = HostCache::Key( + "automatic", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); secure_key.secure = true; const std::pair<const HostCache::Key, HostCache::Entry>* cache_result = GetCacheHit(secure_key); EXPECT_FALSE(!!cache_result); - HostCache::Key insecure_key = - HostCache::Key("automatic", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key insecure_key = HostCache::Key( + "automatic", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); cache_result = GetCacheHit(insecure_key); EXPECT_TRUE(!!cache_result); } @@ -5138,17 +5146,17 @@ request_context_.get(), host_cache_.get())); ASSERT_THAT(response_secure.result_error(), IsError(ERR_NAME_NOT_RESOLVED)); - HostCache::Key secure_key = - HostCache::Key("secure", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key secure_key = HostCache::Key( + "secure", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); secure_key.secure = true; const std::pair<const HostCache::Key, HostCache::Entry>* cache_result = GetCacheHit(secure_key); EXPECT_FALSE(!!cache_result); - HostCache::Key insecure_key = - HostCache::Key("secure", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key insecure_key = HostCache::Key( + "secure", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); cache_result = GetCacheHit(insecure_key); EXPECT_FALSE(!!cache_result); } @@ -5160,9 +5168,9 @@ resolver_->SetDnsConfigOverrides(overrides); // Populate cache with insecure entry. - HostCache::Key cached_stale_key = - HostCache::Key("automatic_stale", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key cached_stale_key = HostCache::Key( + "automatic_stale", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); IPEndPoint kExpectedStaleIP = CreateExpected("192.168.1.102", 80); PopulateCache(cached_stale_key, kExpectedStaleIP); MakeCacheStale(); @@ -5202,9 +5210,9 @@ response_secure.request()->GetAddressResults().value().endpoints(), testing::UnorderedElementsAre(CreateExpected("127.0.0.1", 80), CreateExpected("::1", 80))); - HostCache::Key secure_key = - HostCache::Key("automatic", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key secure_key = HostCache::Key( + "automatic", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); secure_key.secure = true; cache_result = GetCacheHit(secure_key); EXPECT_TRUE(!!cache_result); @@ -5221,13 +5229,15 @@ testing::ElementsAre(CreateExpected("192.168.1.100", 80))); HostCache::Key insecure_key = HostCache::Key("insecure_automatic", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + 0 /* host_resolver_flags */, HostResolverSource::ANY, + NetworkIsolationKey()); cache_result = GetCacheHit(insecure_key); EXPECT_TRUE(!!cache_result); HostCache::Key cached_insecure_key = HostCache::Key("insecure_automatic_cached", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + 0 /* host_resolver_flags */, HostResolverSource::ANY, + NetworkIsolationKey()); IPEndPoint kExpectedInsecureIP = CreateExpected("192.168.1.101", 80); PopulateCache(cached_insecure_key, kExpectedInsecureIP); @@ -5264,9 +5274,9 @@ response_secure.request()->GetAddressResults().value().endpoints(), testing::UnorderedElementsAre(CreateExpected("127.0.0.1", 80), CreateExpected("::1", 80))); - HostCache::Key secure_key = - HostCache::Key("automatic", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key secure_key = HostCache::Key( + "automatic", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); secure_key.secure = true; cache_result = GetCacheHit(secure_key); EXPECT_TRUE(!!cache_result); @@ -5283,13 +5293,15 @@ testing::ElementsAre(CreateExpected("192.168.1.100", 80))); HostCache::Key insecure_key = HostCache::Key("insecure_automatic", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + 0 /* host_resolver_flags */, HostResolverSource::ANY, + NetworkIsolationKey()); cache_result = GetCacheHit(insecure_key); EXPECT_TRUE(!!cache_result); HostCache::Key cached_insecure_key = HostCache::Key("insecure_automatic_cached", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + 0 /* host_resolver_flags */, HostResolverSource::ANY, + NetworkIsolationKey()); IPEndPoint kExpectedInsecureIP = CreateExpected("192.168.1.101", 80); PopulateCache(cached_insecure_key, kExpectedInsecureIP); @@ -5319,9 +5331,9 @@ HostPortPair("secure", 80), NetLogWithSource(), base::nullopt, request_context_.get(), host_cache_.get())); ASSERT_THAT(response_secure.result_error(), IsOk()); - HostCache::Key secure_key = - HostCache::Key("secure", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key secure_key = HostCache::Key( + "secure", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); secure_key.secure = true; cache_result = GetCacheHit(secure_key); EXPECT_TRUE(!!cache_result); @@ -5330,9 +5342,9 @@ HostPortPair("ok", 80), NetLogWithSource(), base::nullopt, request_context_.get(), host_cache_.get())); ASSERT_THAT(response_insecure.result_error(), IsError(ERR_NAME_NOT_RESOLVED)); - HostCache::Key insecure_key = - HostCache::Key("ok", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key insecure_key = HostCache::Key( + "ok", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); cache_result = GetCacheHit(insecure_key); EXPECT_FALSE(!!cache_result); @@ -5360,9 +5372,9 @@ HostPortPair("secure", 80), NetLogWithSource(), base::nullopt, request_context_.get(), host_cache_.get())); ASSERT_THAT(response_secure.result_error(), IsOk()); - HostCache::Key secure_key = - HostCache::Key("secure", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key secure_key = HostCache::Key( + "secure", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); secure_key.secure = true; cache_result = GetCacheHit(secure_key); EXPECT_TRUE(!!cache_result); @@ -5378,9 +5390,9 @@ source_none_parameters.source = HostResolverSource::LOCAL_ONLY; // Populate cache with an insecure entry. - HostCache::Key cached_insecure_key = - HostCache::Key("automatic", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key cached_insecure_key = HostCache::Key( + "automatic", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); IPEndPoint kExpectedInsecureIP = CreateExpected("192.168.1.102", 80); PopulateCache(cached_insecure_key, kExpectedInsecureIP); @@ -5405,9 +5417,9 @@ source_none_parameters.source = HostResolverSource::LOCAL_ONLY; // Populate cache with a secure entry. - HostCache::Key cached_secure_key = - HostCache::Key("secure", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + HostCache::Key cached_secure_key = HostCache::Key( + "secure", DnsQueryType::UNSPECIFIED, 0 /* host_resolver_flags */, + HostResolverSource::ANY, NetworkIsolationKey()); cached_secure_key.secure = true; IPEndPoint kExpectedSecureIP = CreateExpected("192.168.1.103", 80); PopulateCache(cached_secure_key, kExpectedSecureIP); @@ -5888,7 +5900,7 @@ EXPECT_THAT(no_data_response.result_error(), IsError(ERR_NAME_NOT_RESOLVED)); EXPECT_FALSE(no_data_response.request()->GetAddressResults()); HostCache::Key key("empty", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::EntryStaleness staleness; const std::pair<const HostCache::Key, HostCache::Entry>* cache_result = host_cache_->Lookup(key, base::TimeTicks::Now(), @@ -5905,7 +5917,7 @@ IsError(ERR_NAME_NOT_RESOLVED)); EXPECT_FALSE(no_domain_response.request()->GetAddressResults()); HostCache::Key nxkey("nodomain", DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); cache_result = host_cache_->Lookup(nxkey, base::TimeTicks::Now(), false /* ignore_secure */); EXPECT_TRUE(!!cache_result); @@ -5979,10 +5991,12 @@ HostCache::Key insecure_key = HostCache::Key("automatic_nodomain", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + 0 /* host_resolver_flags */, HostResolverSource::ANY, + NetworkIsolationKey()); HostCache::Key secure_key = HostCache::Key("automatic_nodomain", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + 0 /* host_resolver_flags */, HostResolverSource::ANY, + NetworkIsolationKey()); secure_key.secure = true; // Expect cache initially empty. @@ -6018,10 +6032,12 @@ HostCache::Key insecure_key = HostCache::Key("automatic_nodomain", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + 0 /* host_resolver_flags */, HostResolverSource::ANY, + NetworkIsolationKey()); HostCache::Key secure_key = HostCache::Key("automatic_nodomain", DnsQueryType::UNSPECIFIED, - 0 /* host_resolver_flags */, HostResolverSource::ANY); + 0 /* host_resolver_flags */, HostResolverSource::ANY, + NetworkIsolationKey()); secure_key.secure = true; // Expect cache initially empty.
diff --git a/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc b/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc index d8a1ff7e..ba5415c 100644 --- a/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc +++ b/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc
@@ -761,7 +761,7 @@ InitializeStore(false, true); - // Add a non-samesite cookie. + // Add a non-samesite persistent cookie. store_->AddCookie(CanonicalCookie( kNoneName, kCookieValue, kDomain, kCookiePath, base::Time::Now() - base::TimeDelta::FromMinutes(1),
diff --git a/net/http/http_auth_handler_ntlm.h b/net/http/http_auth_handler_ntlm.h index b487071..9058ee53 100644 --- a/net/http/http_auth_handler_ntlm.h +++ b/net/http/http_auth_handler_ntlm.h
@@ -41,18 +41,6 @@ namespace net { -#if defined(NTLM_PORTABLE) -// These values are persisted to logs. Entries should not be renumbered and -// numeric values should never be reused. -enum class NtlmV2Usage : int { - kDisabledOverInsecure = 0, - kDisabledOverSecure, - kEnabledOverInsecure, - kEnabledOverSecure, - kMaxValue = kEnabledOverSecure -}; -#endif - class HttpAuthPreferences; // Code for handling HTTP NTLM authentication.
diff --git a/net/http/http_auth_handler_ntlm_portable.cc b/net/http/http_auth_handler_ntlm_portable.cc index 3a52b575..6bf0900 100644 --- a/net/http/http_auth_handler_ntlm_portable.cc +++ b/net/http/http_auth_handler_ntlm_portable.cc
@@ -26,14 +26,6 @@ base::RandBytes(output, n); } -void RecordNtlmV2Usage(bool is_v2, bool is_secure) { - auto bucket = is_v2 ? is_secure ? NtlmV2Usage::kEnabledOverSecure - : NtlmV2Usage::kEnabledOverInsecure - : is_secure ? NtlmV2Usage::kDisabledOverSecure - : NtlmV2Usage::kDisabledOverInsecure; - UMA_HISTOGRAM_ENUMERATION("Net.HttpAuthNtlmV2Usage", bucket); -} - } // namespace // static @@ -144,9 +136,6 @@ if (!tmp_handler->InitFromChallenge(challenge, target, ssl_info, origin, net_log)) return ERR_INVALID_RESPONSE; - RecordNtlmV2Usage( - http_auth_preferences() ? http_auth_preferences()->NtlmV2Enabled() : true, - ssl_info.is_valid()); handler->swap(tmp_handler); return OK; }
diff --git a/net/http/http_auth_handler_ntlm_portable_unittest.cc b/net/http/http_auth_handler_ntlm_portable_unittest.cc index c48b815..ff42aff 100644 --- a/net/http/http_auth_handler_ntlm_portable_unittest.cc +++ b/net/http/http_auth_handler_ntlm_portable_unittest.cc
@@ -9,7 +9,6 @@ #include "base/stl_util.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" -#include "base/test/metrics/histogram_tester.h" #include "build/build_config.h" #include "net/base/test_completion_callback.h" #include "net/dns/mock_host_resolver.h" @@ -164,11 +163,8 @@ }; TEST_F(HttpAuthHandlerNtlmPortableTest, SimpleConstruction) { - base::HistogramTester histogram_tester; ASSERT_EQ(OK, CreateHandler()); ASSERT_TRUE(GetAuthHandler() != nullptr); - histogram_tester.ExpectBucketCount("Net.HttpAuthNtlmV2Usage", - NtlmV2Usage::kDisabledOverInsecure, 1); } TEST_F(HttpAuthHandlerNtlmPortableTest, DoNotAllowDefaultCreds) { @@ -221,7 +217,6 @@ } TEST_F(HttpAuthHandlerNtlmPortableTest, NtlmV1AuthenticationSuccess) { - base::HistogramTester histogram_tester; HttpAuthHandlerNTLM::ScopedProcSetter proc_setter(MockGetMSTime, MockRandom, MockGetHostName); ASSERT_EQ(OK, CreateHandler()); @@ -241,8 +236,6 @@ ASSERT_EQ(0, memcmp(decoded.data(), ntlm::test::kExpectedAuthenticateMsgSpecResponseV1, decoded.size())); - histogram_tester.ExpectBucketCount("Net.HttpAuthNtlmV2Usage", - NtlmV2Usage::kDisabledOverInsecure, 1); } } // namespace net
diff --git a/net/http/http_stream_factory_job.cc b/net/http/http_stream_factory_job.cc index a5acdda8..a3027753 100644 --- a/net/http/http_stream_factory_job.cc +++ b/net/http/http_stream_factory_job.cc
@@ -728,53 +728,8 @@ server_ssl_config_.renego_allowed_for_protos.push_back(kProtoHTTP11); } - if (using_quic_) { - HostPortPair destination; - SSLConfig* ssl_config; - GURL url(request_info_.url); - if (proxy_info_.is_quic()) { - // A proxy's certificate is expected to be valid for the proxy hostname. - destination = proxy_info_.proxy_server().host_port_pair(); - ssl_config = &proxy_ssl_config_; - GURL::Replacements replacements; - replacements.SetSchemeStr(url::kHttpsScheme); - replacements.SetHostStr(destination.host()); - const std::string new_port = base::NumberToString(destination.port()); - replacements.SetPortStr(new_port); - replacements.ClearUsername(); - replacements.ClearPassword(); - replacements.ClearPath(); - replacements.ClearQuery(); - replacements.ClearRef(); - url = url.ReplaceComponents(replacements); - } else { - DCHECK(using_ssl_); - // The certificate of a QUIC alternative server is expected to be valid - // for the origin of the request (in addition to being valid for the - // server itself). - destination = destination_; - ssl_config = &server_ssl_config_; - } - int rv = quic_request_.Request( - destination, quic_version_, request_info_.privacy_mode, priority_, - request_info_.socket_tag, request_info_.network_isolation_key, - request_info_.disable_secure_dns, ssl_config->GetCertVerifyFlags(), url, - net_log_, &net_error_details_, - base::BindOnce(&Job::OnFailedOnDefaultNetwork, - ptr_factory_.GetWeakPtr()), - io_callback_); - if (rv == OK) { - using_existing_quic_session_ = true; - } else if (rv == ERR_IO_PENDING) { - // There's no available QUIC session. Inform the delegate how long to - // delay the main job. - delegate_->MaybeSetWaitTimeForMainJob( - quic_request_.GetTimeDelayForWaitingJob()); - expect_on_quic_host_resolution_ = quic_request_.WaitForHostResolution( - base::BindOnce(&Job::OnQuicHostResolution, base::Unretained(this))); - } - return rv; - } + if (using_quic_) + return DoInitConnectionImplQuic(); // Check first if there is a pushed stream matching the request, or an HTTP/2 // connection this request can pool to. If so, then go straight to using @@ -891,6 +846,53 @@ connection_.get(), io_callback_, proxy_auth_callback); } +int HttpStreamFactory::Job::DoInitConnectionImplQuic() { + HostPortPair destination; + SSLConfig* ssl_config; + GURL url(request_info_.url); + if (proxy_info_.is_quic()) { + // A proxy's certificate is expected to be valid for the proxy hostname. + destination = proxy_info_.proxy_server().host_port_pair(); + ssl_config = &proxy_ssl_config_; + GURL::Replacements replacements; + replacements.SetSchemeStr(url::kHttpsScheme); + replacements.SetHostStr(destination.host()); + const std::string new_port = base::NumberToString(destination.port()); + replacements.SetPortStr(new_port); + replacements.ClearUsername(); + replacements.ClearPassword(); + replacements.ClearPath(); + replacements.ClearQuery(); + replacements.ClearRef(); + url = url.ReplaceComponents(replacements); + } else { + DCHECK(using_ssl_); + // The certificate of a QUIC alternative server is expected to be valid + // for the origin of the request (in addition to being valid for the + // server itself). + destination = destination_; + ssl_config = &server_ssl_config_; + } + int rv = quic_request_.Request( + destination, quic_version_, request_info_.privacy_mode, priority_, + request_info_.socket_tag, request_info_.network_isolation_key, + request_info_.disable_secure_dns, ssl_config->GetCertVerifyFlags(), url, + net_log_, &net_error_details_, + base::BindOnce(&Job::OnFailedOnDefaultNetwork, ptr_factory_.GetWeakPtr()), + io_callback_); + if (rv == OK) { + using_existing_quic_session_ = true; + } else if (rv == ERR_IO_PENDING) { + // There's no available QUIC session. Inform the delegate how long to + // delay the main job. + delegate_->MaybeSetWaitTimeForMainJob( + quic_request_.GetTimeDelayForWaitingJob()); + expect_on_quic_host_resolution_ = quic_request_.WaitForHostResolution( + base::BindOnce(&Job::OnQuicHostResolution, base::Unretained(this))); + } + return rv; +} + void HttpStreamFactory::Job::OnQuicHostResolution(int result) { DCHECK(expect_on_quic_host_resolution_); expect_on_quic_host_resolution_ = false; @@ -1181,17 +1183,6 @@ return OK; } -void HttpStreamFactory::Job::ReturnToStateInitConnection( - bool close_connection) { - if (close_connection && connection_->socket()) - connection_->socket()->Disconnect(); - connection_->Reset(); - - spdy_session_request_.reset(); - - next_state_ = STATE_INIT_CONNECTION; -} - void HttpStreamFactory::Job::OnSpdySessionAvailable( base::WeakPtr<SpdySession> spdy_session) { DCHECK(spdy_session);
diff --git a/net/http/http_stream_factory_job.h b/net/http/http_stream_factory_job.h index 04a0b7a..bfc981c 100644 --- a/net/http/http_stream_factory_job.h +++ b/net/http/http_stream_factory_job.h
@@ -282,6 +282,7 @@ int DoLoop(int result); int StartInternal(); int DoInitConnectionImpl(); + int DoInitConnectionImplQuic(); // If this is a QUIC alt job, then this function is called when host // resolution completes. It's called with the next result after host @@ -312,9 +313,6 @@ int SetSpdyHttpStreamOrBidirectionalStreamImpl( base::WeakPtr<SpdySession> session); - // Returns to STATE_INIT_CONNECTION and resets some state. - void ReturnToStateInitConnection(bool close_connection); - // SpdySessionPool::SpdySessionRequest::Delegate implementation: void OnSpdySessionAvailable(base::WeakPtr<SpdySession> spdy_session) override;
diff --git a/net/http/transport_security_state_static.json b/net/http/transport_security_state_static.json index bb16f84..02d6b16 100644 --- a/net/http/transport_security_state_static.json +++ b/net/http/transport_security_state_static.json
@@ -87964,6 +87964,51 @@ { "name": "waverlytn.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, { "name": "wilderky.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, { "name": "williamscountyoh.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "ceredowv.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "logancountyky.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "frederickmd.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "humboldtcountynv.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "louisvillene.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "sharpsburg-ga.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "clarksburgma.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "votelevy.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "waynecountyoh.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "northbayvillage-fl.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "republicanleader.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "republicanwhip.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "woodridgeil.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "centretownshipin.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "rehobothma.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "cowcreek-nsn.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "riversideiowa.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "pickawaycountyohio.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "ohiot21.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "ohiotobacco21.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "bridgercanyonfiremt.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "militaryaviationsafety.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "landoverhillsmd.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "myoregon.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "texasready.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "clayelections.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "findtreatment.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "tiogacountyny.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "waverlypa.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "whitepinetn.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "esatn.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "lickingcounty.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "brookscountyga.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "huntsvillealtransit.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "jenkinscountyga.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "ohiostateparks.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "summitcountyboe.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "townofpolk-wi.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "aselectionoffice.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "harpersvilleal.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "whdpc.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "boonecountyfpdmo.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "votemarion.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "everykidoutdoors.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, + { "name": "medinacountyohio.gov", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, { "name": "bmoattachments.org", "policy": "public-suffix-requested", "mode": "force-https", "include_subdomains": true }, // END OF ETLD-OWNER REQUESTED ENTRIES
diff --git a/net/quic/quic_stream_factory_test.cc b/net/quic/quic_stream_factory_test.cc index 15dc87b7..6e81e251 100644 --- a/net/quic/quic_stream_factory_test.cc +++ b/net/quic/quic_stream_factory_test.cc
@@ -11458,7 +11458,7 @@ // Set up a different address in stale resolver cache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -11556,7 +11556,7 @@ // Set up the same address in the stale resolver cache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -11620,7 +11620,7 @@ // Set up the same address in the stale resolver cache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -11691,7 +11691,7 @@ // Set up the same address in the stale resolver cache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -11755,7 +11755,7 @@ // Set up a different address in the stale resolver cache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -11836,7 +11836,7 @@ // Set up a different address in the stale resolvercache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -11921,7 +11921,7 @@ // Set up a different address in the stale resolver cache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -12049,7 +12049,7 @@ // Set up an address in the stale cache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -12111,7 +12111,7 @@ // Set up the same address in the stale resolver cache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -12162,7 +12162,7 @@ // Set up a different address in stale resolver cache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -12228,7 +12228,7 @@ // Set up a different address in the stale cache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -12285,7 +12285,7 @@ // Set up an address in stale resolver cache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -12346,7 +12346,7 @@ // Set up an address in stale resolver cache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -12452,7 +12452,7 @@ // Set up the same address in the stale resolver cache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS); @@ -12529,7 +12529,7 @@ // Set up a different address in the stale resolvercache. HostCache::Key key(host_port_pair_.host(), DnsQueryType::UNSPECIFIED, 0, - HostResolverSource::ANY); + HostResolverSource::ANY, NetworkIsolationKey()); HostCache::Entry entry(OK, AddressList::CreateFromIPAddress(kCachedIPAddress, 0), HostCache::Entry::SOURCE_DNS);
diff --git a/services/network/network_context.cc b/services/network/network_context.cc index 197a62b..1a790a0 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc
@@ -1415,13 +1415,14 @@ } void NetworkContext::CreateP2PSocketManager( - mojom::P2PTrustedSocketManagerClientPtr client, - mojom::P2PTrustedSocketManagerRequest trusted_socket_manager, - mojom::P2PSocketManagerRequest socket_manager_request) { + mojo::PendingRemote<mojom::P2PTrustedSocketManagerClient> client, + mojo::PendingReceiver<mojom::P2PTrustedSocketManager> + trusted_socket_manager, + mojo::PendingReceiver<mojom::P2PSocketManager> socket_manager_receiver) { std::unique_ptr<P2PSocketManager> socket_manager = std::make_unique<P2PSocketManager>( std::move(client), std::move(trusted_socket_manager), - std::move(socket_manager_request), + std::move(socket_manager_receiver), base::Bind(&NetworkContext::DestroySocketManager, base::Unretained(this)), url_request_context_);
diff --git a/services/network/network_context.h b/services/network/network_context.h index f82018f..1ecf63f 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h
@@ -338,9 +338,11 @@ bool allow_credentials, const net::NetworkIsolationKey& network_isolation_key) override; void CreateP2PSocketManager( - mojom::P2PTrustedSocketManagerClientPtr client, - mojom::P2PTrustedSocketManagerRequest trusted_socket_manager, - mojom::P2PSocketManagerRequest socket_manager_request) override; + mojo::PendingRemote<mojom::P2PTrustedSocketManagerClient> client, + mojo::PendingReceiver<mojom::P2PTrustedSocketManager> + trusted_socket_manager, + mojo::PendingReceiver<mojom::P2PSocketManager> socket_manager_receiver) + override; void CreateMdnsResponder( mojo::PendingReceiver<mojom::MdnsResponder> responder_receiver) override; void QueueReport(const std::string& type,
diff --git a/services/network/p2p/socket_manager.cc b/services/network/p2p/socket_manager.cc index b554d1f..a505168 100644 --- a/services/network/p2p/socket_manager.cc +++ b/services/network/p2p/socket_manager.cc
@@ -144,9 +144,11 @@ }; P2PSocketManager::P2PSocketManager( - mojom::P2PTrustedSocketManagerClientPtr trusted_socket_manager_client, - mojom::P2PTrustedSocketManagerRequest trusted_socket_manager_request, - mojom::P2PSocketManagerRequest socket_manager_request, + mojo::PendingRemote<mojom::P2PTrustedSocketManagerClient> + trusted_socket_manager_client, + mojo::PendingReceiver<mojom::P2PTrustedSocketManager> + trusted_socket_manager_receiver, + mojo::PendingReceiver<mojom::P2PSocketManager> socket_manager_receiver, DeleteCallback delete_callback, net::URLRequestContext* url_request_context) : delete_callback_(std::move(delete_callback)), @@ -155,13 +157,13 @@ base::CreateSequencedTaskRunner({base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_VISIBLE})), trusted_socket_manager_client_(std::move(trusted_socket_manager_client)), - trusted_socket_manager_binding_( + trusted_socket_manager_receiver_( this, - std::move(trusted_socket_manager_request)), - socket_manager_binding_(this, std::move(socket_manager_request)) { - trusted_socket_manager_binding_.set_connection_error_handler( + std::move(trusted_socket_manager_receiver)), + socket_manager_receiver_(this, std::move(socket_manager_receiver)) { + trusted_socket_manager_receiver_.set_disconnect_handler( base::Bind(&P2PSocketManager::OnConnectionError, base::Unretained(this))); - socket_manager_binding_.set_connection_error_handler( + socket_manager_receiver_.set_disconnect_handler( base::Bind(&P2PSocketManager::OnConnectionError, base::Unretained(this))); }
diff --git a/services/network/p2p/socket_manager.h b/services/network/p2p/socket_manager.h index a014dbb..b8a2e00 100644 --- a/services/network/p2p/socket_manager.h +++ b/services/network/p2p/socket_manager.h
@@ -19,7 +19,9 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/sequenced_task_runner.h" -#include "mojo/public/cpp/bindings/binding.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "net/base/ip_address.h" #include "net/base/ip_endpoint.h" @@ -56,9 +58,11 @@ // P2PSocketManager. The P2PSocketManager must be destroyed before the // |url_request_context|. P2PSocketManager( - mojom::P2PTrustedSocketManagerClientPtr trusted_socket_manager_client, - mojom::P2PTrustedSocketManagerRequest trusted_socket_manager_request, - mojom::P2PSocketManagerRequest socket_manager_request, + mojo::PendingRemote<mojom::P2PTrustedSocketManagerClient> + trusted_socket_manager_client, + mojo::PendingReceiver<mojom::P2PTrustedSocketManager> + trusted_socket_manager_receiver, + mojo::PendingReceiver<mojom::P2PSocketManager> socket_manager_receiver, DeleteCallback delete_callback, net::URLRequestContext* url_request_context); ~P2PSocketManager() override; @@ -134,9 +138,11 @@ // default local address involves creating a dummy socket. const scoped_refptr<base::SequencedTaskRunner> network_list_task_runner_; - mojom::P2PTrustedSocketManagerClientPtr trusted_socket_manager_client_; - mojo::Binding<mojom::P2PTrustedSocketManager> trusted_socket_manager_binding_; - mojo::Binding<mojom::P2PSocketManager> socket_manager_binding_; + mojo::Remote<mojom::P2PTrustedSocketManagerClient> + trusted_socket_manager_client_; + mojo::Receiver<mojom::P2PTrustedSocketManager> + trusted_socket_manager_receiver_; + mojo::Receiver<mojom::P2PSocketManager> socket_manager_receiver_; mojo::Remote<mojom::P2PNetworkNotificationClient> network_notification_client_;
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom index 5181e23e..b5f9399 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom
@@ -1098,9 +1098,10 @@ NetworkIsolationKey network_isolation_key); // Creates a P2PSocketManager instance, used for WebRTC. - CreateP2PSocketManager(P2PTrustedSocketManagerClient client, - P2PTrustedSocketManager& trusted_socket_manager, - P2PSocketManager& socket_manager); + CreateP2PSocketManager( + pending_remote<P2PTrustedSocketManagerClient> client, + pending_receiver<P2PTrustedSocketManager> trusted_socket_manager, + pending_receiver<P2PSocketManager> socket_manager); // Creates an MdnsResponder instance. CreateMdnsResponder(pending_receiver<MdnsResponder> responder_receiver);
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h index 6afc35c..1c76fab 100644 --- a/services/network/test/test_network_context.h +++ b/services/network/test/test_network_context.h
@@ -213,9 +213,11 @@ bool allow_credentials, const net::NetworkIsolationKey& network_isolation_key) override {} void CreateP2PSocketManager( - mojom::P2PTrustedSocketManagerClientPtr client, - mojom::P2PTrustedSocketManagerRequest trusted_socket_manager, - mojom::P2PSocketManagerRequest socket_manager_request) override {} + mojo::PendingRemote<mojom::P2PTrustedSocketManagerClient> client, + mojo::PendingReceiver<mojom::P2PTrustedSocketManager> + trusted_socket_manager, + mojo::PendingReceiver<mojom::P2PSocketManager> socket_manager_receiver) + override {} void CreateMdnsResponder( mojo::PendingReceiver<mojom::MdnsResponder> responder_receiver) override { }
diff --git a/services/service_manager/public/cpp/connector.cc b/services/service_manager/public/cpp/connector.cc index a15111ae..d66047fd 100644 --- a/services/service_manager/public/cpp/connector.cc +++ b/services/service_manager/public/cpp/connector.cc
@@ -92,14 +92,15 @@ return connector_.is_bound(); } -void Connector::FilterInterfaces(const std::string& spec, - const Identity& source_identity, - mojom::InterfaceProviderRequest request, - mojom::InterfaceProviderPtr target) { +void Connector::FilterInterfaces( + const std::string& spec, + const Identity& source_identity, + mojo::PendingReceiver<mojom::InterfaceProvider> receiver, + mojo::PendingRemote<mojom::InterfaceProvider> target) { if (!BindConnectorIfNecessary()) return; DCHECK(source_identity.IsValid()); - connector_->FilterInterfaces(spec, source_identity, std::move(request), + connector_->FilterInterfaces(spec, source_identity, std::move(receiver), std::move(target)); }
diff --git a/services/service_manager/public/cpp/connector.h b/services/service_manager/public/cpp/connector.h index e7d78d5..8bda173 100644 --- a/services/service_manager/public/cpp/connector.h +++ b/services/service_manager/public/cpp/connector.h
@@ -230,10 +230,11 @@ // Returns |true| if this Connector instance is already bound to a thread. bool IsBound() const; - void FilterInterfaces(const std::string& spec, - const Identity& source_identity, - mojom::InterfaceProviderRequest request, - mojom::InterfaceProviderPtr target); + void FilterInterfaces( + const std::string& spec, + const Identity& source_identity, + mojo::PendingReceiver<mojom::InterfaceProvider> receiver, + mojo::PendingRemote<mojom::InterfaceProvider> target); // Binds a Connector request to the other end of this Connector. void BindConnectorRequest(mojom::ConnectorRequest request);
diff --git a/services/service_manager/public/cpp/standalone_connector_impl.cc b/services/service_manager/public/cpp/standalone_connector_impl.cc index fc91298..8c17f5a 100644 --- a/services/service_manager/public/cpp/standalone_connector_impl.cc +++ b/services/service_manager/public/cpp/standalone_connector_impl.cc
@@ -65,8 +65,8 @@ void StandaloneConnectorImpl::FilterInterfaces( const std::string& spec, const Identity& source, - mojom::InterfaceProviderRequest source_request, - mojom::InterfaceProviderPtr target) { + mojo::PendingReceiver<mojom::InterfaceProvider> source_receiver, + mojo::PendingRemote<mojom::InterfaceProvider> target) { NOTIMPLEMENTED() << "FilterInterfaces is not supported by StandaloneConnectorImpl."; }
diff --git a/services/service_manager/public/cpp/standalone_connector_impl.h b/services/service_manager/public/cpp/standalone_connector_impl.h index c33b0ab..fd9c7346 100644 --- a/services/service_manager/public/cpp/standalone_connector_impl.h +++ b/services/service_manager/public/cpp/standalone_connector_impl.h
@@ -8,6 +8,7 @@ #include "base/component_export.h" #include "base/macros.h" #include "mojo/public/cpp/bindings/generic_pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "services/service_manager/public/mojom/connector.mojom.h" @@ -65,10 +66,11 @@ mojo::PendingReceiver<mojom::ProcessMetadata> metadata_receiver, RegisterServiceInstanceCallback callback) override; void Clone(mojom::ConnectorRequest request) override; - void FilterInterfaces(const std::string& spec, - const Identity& source, - mojom::InterfaceProviderRequest source_request, - mojom::InterfaceProviderPtr target) override; + void FilterInterfaces( + const std::string& spec, + const Identity& source, + mojo::PendingReceiver<mojom::InterfaceProvider> source_receiver, + mojo::PendingRemote<mojom::InterfaceProvider> target) override; Delegate* const delegate_;
diff --git a/services/service_manager/public/cpp/test/test_connector_factory.cc b/services/service_manager/public/cpp/test/test_connector_factory.cc index 1142901..afe68d64 100644 --- a/services/service_manager/public/cpp/test/test_connector_factory.cc +++ b/services/service_manager/public/cpp/test/test_connector_factory.cc
@@ -13,6 +13,8 @@ #include "mojo/public/cpp/bindings/associated_binding.h" #include "mojo/public/cpp/bindings/binding_set.h" #include "mojo/public/cpp/bindings/pending_associated_receiver.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" #include "services/service_manager/public/cpp/service.h" #include "services/service_manager/public/mojom/connector.mojom.h" #include "services/service_manager/public/mojom/service.mojom.h" @@ -89,10 +91,11 @@ bindings_.AddBinding(this, std::move(request)); } - void FilterInterfaces(const std::string& spec, - const Identity& source, - mojom::InterfaceProviderRequest source_request, - mojom::InterfaceProviderPtr target) override { + void FilterInterfaces( + const std::string& spec, + const Identity& source, + mojo::PendingReceiver<mojom::InterfaceProvider> source_receiver, + mojo::PendingRemote<mojom::InterfaceProvider> target) override { NOTREACHED(); }
diff --git a/services/service_manager/public/mojom/connector.mojom b/services/service_manager/public/mojom/connector.mojom index 3918315..489e270 100644 --- a/services/service_manager/public/mojom/connector.mojom +++ b/services/service_manager/public/mojom/connector.mojom
@@ -186,12 +186,12 @@ // |spec|. // // The flow is basically - remote service wishes to (generically) request - // interfaces from this service, and so sends us an InterfaceProvider request - // (|source_request|) which it would like us to bind. We forward this request - // to the Service Manager, passing our actual InterfaceProvider implementation - // in |target|. The Service Manager will only forward interface requests that - // were permitted by intersecting |source|'s manifest requirements with the - // contents of |spec|. + // interfaces from this service, and so sends us an + // pending_receiver<InterfaceProvider>(|source_receiver|) which it would like + // us to bind. We forward this receiver to the Service Manager, passing our + // actual InterfaceProvider implementation in |target|. The Service Manager + // will only forward interface requests that were permitted by intersecting + // |source|'s manifest requirements with thecontents of |spec|. // // DEPRECATED: Please do not introduce new uses of this API, as it will be // removed soon. Please instead avoid using InterfaceProvider altogether in @@ -205,6 +205,6 @@ // FilterInterfaces(string spec, Identity source, - InterfaceProvider& source_request, - InterfaceProvider target); + pending_receiver<InterfaceProvider> source_receiver, + pending_remote<InterfaceProvider> target); };
diff --git a/services/service_manager/service_instance.cc b/services/service_manager/service_instance.cc index c3cc061..4dfdec3 100644 --- a/services/service_manager/service_instance.cc +++ b/services/service_manager/service_instance.cc
@@ -571,11 +571,11 @@ void ServiceInstance::FilterInterfaces( const std::string& filter_name, const Identity& source, - mojom::InterfaceProviderRequest source_request, - mojom::InterfaceProviderPtr target) { + mojo::PendingReceiver<mojom::InterfaceProvider> source_receiver, + mojo::PendingRemote<mojom::InterfaceProvider> target) { interface_filters_.insert(std::make_unique<InterfaceFilter>( - service_manager_, this, filter_name, source, identity_, - target.PassInterface(), std::move(source_request))); + service_manager_, this, filter_name, source, identity_, std::move(target), + std::move(source_receiver))); } void ServiceInstance::RequestQuit() {
diff --git a/services/service_manager/service_instance.h b/services/service_manager/service_instance.h index f7c9420..2d97ff3e 100644 --- a/services/service_manager/service_instance.h +++ b/services/service_manager/service_instance.h
@@ -21,6 +21,7 @@ #include "mojo/public/cpp/bindings/associated_receiver.h" #include "mojo/public/cpp/bindings/pending_associated_receiver.h" #include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote.h" @@ -145,10 +146,11 @@ mojo::PendingReceiver<mojom::ProcessMetadata> metadata_receiver, RegisterServiceInstanceCallback callback) override; void Clone(mojom::ConnectorRequest request) override; - void FilterInterfaces(const std::string& filter_name, - const Identity& source, - mojom::InterfaceProviderRequest source_request, - mojom::InterfaceProviderPtr target) override; + void FilterInterfaces( + const std::string& filter_name, + const Identity& source, + mojo::PendingReceiver<mojom::InterfaceProvider> source_receiver, + mojo::PendingRemote<mojom::InterfaceProvider> target) override; // mojom::ServiceControl: void RequestQuit() override;
diff --git a/storage/browser/BUILD.gn b/storage/browser/BUILD.gn index 40d3d549..f6305c4 100644 --- a/storage/browser/BUILD.gn +++ b/storage/browser/BUILD.gn
@@ -2,8 +2,23 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//build/config/jumbo.gni") +import("//mojo/public/tools/bindings/mojom.gni") import("//testing/test.gni") +mojom("mojom") { + sources = [ + "blob/mojom/blob_storage_context.mojom", + ] + + public_deps = [ + "//mojo/public/mojom/base", + "//third_party/blink/public/mojom:mojom_core", + ] + + overridden_deps = [ "//third_party/blink/public/mojom:mojom_core" ] + component_deps = [ "//third_party/blink/public/common" ] +} + jumbo_component("browser") { output_name = "storage_browser" sources = [ @@ -209,6 +224,7 @@ ] public_deps = [ + ":mojom", "//components/services/filesystem/public/mojom", "//storage/common", ] @@ -369,6 +385,7 @@ deps = [ ":browser", + ":mojom", "//base/test:test_support", "//net:test_support", "//services/network:network_service",
diff --git a/storage/browser/blob/blob_data_builder.cc b/storage/browser/blob/blob_data_builder.cc index bd8caad..c39e091 100644 --- a/storage/browser/blob/blob_data_builder.cc +++ b/storage/browser/blob/blob_data_builder.cc
@@ -338,10 +338,24 @@ } void BlobDataBuilder::AppendReadableDataHandle( - scoped_refptr<DataHandle> data_handle) { - uint64_t length = data_handle->GetSize(); - auto item = BlobDataItem::CreateReadableDataHandle(std::move(data_handle), 0u, - length); + scoped_refptr<DataHandle> data_handle, + uint64_t offset, + uint64_t length) { + if (length == 0ul) + return; + auto item = BlobDataItem::CreateReadableDataHandle(std::move(data_handle), + offset, length); + + total_size_ += item->length(); + auto shareable_item = base::MakeRefCounted<ShareableBlobDataItem>( + std::move(item), ShareableBlobDataItem::POPULATED_WITHOUT_QUOTA); + items_.push_back(std::move(shareable_item)); +} + +void BlobDataBuilder::AppendMojoDataItem(mojom::BlobDataItemPtr item_ptr) { + auto item = BlobDataItem::CreateMojoDataItem(std::move(item_ptr)); + if (item->length() == 0ul) + return; total_size_ += item->length(); auto shareable_item = base::MakeRefCounted<ShareableBlobDataItem>(
diff --git a/storage/browser/blob/blob_data_builder.h b/storage/browser/blob/blob_data_builder.h index e717e1c..1001c7c 100644 --- a/storage/browser/blob/blob_data_builder.h +++ b/storage/browser/blob/blob_data_builder.h
@@ -19,6 +19,7 @@ #include "storage/browser/blob/blob_data_item.h" #include "storage/browser/blob/blob_data_snapshot.h" #include "storage/browser/blob/blob_entry.h" +#include "storage/browser/blob/mojom/blob_storage_context.mojom.h" #include "storage/browser/blob/shareable_blob_data_item.h" #include "storage/browser/blob/shareable_file_reference.h" #include "storage/browser/file_system/file_system_context.h" @@ -141,7 +142,14 @@ const base::Time& expected_modification_time, scoped_refptr<FileSystemContext> file_system_context); - void AppendReadableDataHandle(scoped_refptr<DataHandle> data_handle); + void AppendReadableDataHandle(scoped_refptr<DataHandle> data_handle) { + auto length = data_handle->GetSize(); + AppendReadableDataHandle(std::move(data_handle), 0u, length); + } + void AppendReadableDataHandle(scoped_refptr<DataHandle> data_handle, + uint64_t offset, + uint64_t length); + void AppendMojoDataItem(mojom::BlobDataItemPtr item); void set_content_type(const std::string& content_type) { content_type_ = content_type;
diff --git a/storage/browser/blob/blob_data_item.cc b/storage/browser/blob/blob_data_item.cc index 54c531cc9..3f89fe3 100644 --- a/storage/browser/blob/blob_data_item.cc +++ b/storage/browser/blob/blob_data_item.cc
@@ -9,7 +9,9 @@ #include <utility> #include "base/strings/string_number_conversions.h" +#include "mojo/public/cpp/bindings/remote.h" #include "net/base/net_errors.h" +#include "services/network/public/cpp/data_pipe_to_source_stream.h" #include "storage/browser/file_system/file_system_context.h" #include "third_party/blink/public/common/blob/blob_utils.h" @@ -20,34 +22,51 @@ FILE_PATH_LITERAL("_future_name_"); } -uint64_t BlobDataItem::DataHandle::GetSize() const { - return 0; -} +class MojoDataItem : public storage::BlobDataItem::DataHandle { + public: + MojoDataItem(mojom::BlobDataItemPtr element) : item_(std::move(element)) { + reader_.Bind(std::move(item_->reader)); + } -int BlobDataItem::DataHandle::Read(scoped_refptr<net::IOBuffer> dst_buffer, - uint64_t src_offset, - int bytes_to_read, - base::OnceCallback<void(int)> callback) { - return net::ERR_FILE_NOT_FOUND; -} + // BlobDataItem::DataHandle implementation. + uint64_t GetSize() const override { return item_->size; } -uint64_t BlobDataItem::DataHandle::GetSideDataSize() const { - return 0; -} + void Read(mojo::ScopedDataPipeProducerHandle producer, + uint64_t src_offset, + uint64_t bytes_to_read, + base::OnceCallback<void(int)> callback) override { + reader_->Read(src_offset, bytes_to_read, std::move(producer), + std::move(callback)); + } -int BlobDataItem::DataHandle::ReadSideData( - scoped_refptr<net::IOBuffer> dst_buffer, - base::OnceCallback<void(int)> callback) { - return net::ERR_FILE_NOT_FOUND; -} + uint64_t GetSideDataSize() const override { return item_->side_data_size; } -void BlobDataItem::DataHandle::PrintTo(::std::ostream* os) const { - *os << "<unknown>"; -} + void ReadSideData( + base::OnceCallback<void(int, mojo_base::BigBuffer)> callback) override { + reader_->ReadSideData(std::move(callback)); + } -const char* BlobDataItem::DataHandle::BytesReadHistogramLabel() const { - return nullptr; -} + void PrintTo(::std::ostream* os) const override { + // TODO(enne): this is tricky to implement, as it's synchronous. + // PrintTo should ideally be asynchronous. See: http://crbug.com/809821 + *os << "<MojoDataItem>"; + } + + const char* BytesReadHistogramLabel() const override { + switch (item_->type) { + case mojom::BlobDataItemType::kUnknown: + return nullptr; + case mojom::BlobDataItemType::kCacheStorage: + return "DiskCache.CacheStorage"; + } + } + + protected: + ~MojoDataItem() override = default; + + mojom::BlobDataItemPtr item_; + mojo::Remote<mojom::BlobDataItemReader> reader_; +}; BlobDataItem::DataHandle::~DataHandle() = default; @@ -122,6 +141,7 @@ scoped_refptr<DataHandle> data_handle, uint64_t offset, uint64_t length) { + DCHECK(data_handle); DCHECK_LE(offset, data_handle->GetSize()); DCHECK_LE(length, (data_handle->GetSize() - offset)); auto item = base::WrapRefCounted( @@ -130,6 +150,17 @@ return item; } +// static +scoped_refptr<BlobDataItem> BlobDataItem::CreateMojoDataItem( + mojom::BlobDataItemPtr item) { + auto handle = base::MakeRefCounted<MojoDataItem>(std::move(item)); + auto data_item = base::WrapRefCounted( + new BlobDataItem(Type::kReadableDataHandle, 0, handle->GetSize())); + DCHECK_GT(handle->GetSize(), 0u); + data_item->data_handle_ = std::move(handle); + return data_item; +} + bool BlobDataItem::IsFutureFileItem() const { if (type_ != Type::kFile) return false;
diff --git a/storage/browser/blob/blob_data_item.h b/storage/browser/blob/blob_data_item.h index 4b559ed2..f34e47a 100644 --- a/storage/browser/blob/blob_data_item.h +++ b/storage/browser/blob/blob_data_item.h
@@ -16,6 +16,7 @@ #include "base/files/file_path.h" #include "base/memory/ref_counted.h" #include "net/base/io_buffer.h" +#include "storage/browser/blob/mojom/blob_storage_context.mojom.h" #include "storage/browser/blob/shareable_file_reference.h" #include "url/gurl.h" @@ -40,53 +41,39 @@ kReadableDataHandle, }; - // The DataHandle class is used to persist resources that are needed for + // The DataHandle class is used to persist an interface and resources for // reading this BlobDataItem. This object will stay around while any reads are // pending. If all blobs with this item are deleted or the item is swapped for // a different backend version (mem-to-disk or the reverse), then the item // will be destructed after all pending reads are complete. - // - // A DataHandle can also be "readable" if it overrides the size and reading - // virtual methods. If the DataHandle provides this kind of encapsulated - // implementation then it can be added to the item using the - // AppendReadableDataHandle() method. class COMPONENT_EXPORT(STORAGE_BROWSER) DataHandle : public base::RefCounted<DataHandle> { public: - // Must return the main blob data size. Returns 0 by default. - virtual uint64_t GetSize() const; + // Returns the size of the main blob data. + virtual uint64_t GetSize() const = 0; - // Reads the given data range into the given buffer. If the read is - // completed synchronously then the number of bytes read should be returned - // directly. If the read must be performed asynchronously then this - // method must return net::ERR_IO_PENDING and invoke the callback with the - // result at a later time. The default implementation returns - // net::ERR_FILE_NOT_FOUND. - virtual int Read(scoped_refptr<net::IOBuffer> dst_buffer, - uint64_t src_offset, - int bytes_to_read, - base::OnceCallback<void(int)> callback); + // Reads the given data range into the given |producer|. + // Returns the net::Error from the read operation to the callback. + virtual void Read(mojo::ScopedDataPipeProducerHandle producer, + uint64_t src_offset, + uint64_t bytes_to_read, + base::OnceCallback<void(int)> callback) = 0; - // Must return the side data size. If there is no side data, then 0 should - // be returned. Returns 0 by default. - virtual uint64_t GetSideDataSize() const; + // Returns the side data size. If there is no side data, then 0 should + // be returned. + virtual uint64_t GetSideDataSize() const = 0; - // Reads the entire side data into the given buffer. The buffer must be - // large enough to contain the entire side data. If the read is completed - // synchronously then the number of bytes read should be returned directly. - // If the read must be performed asynchronously then this method must - // return net::ERR_IO_PENDING and invoke the callback with the result at a - // later time. The default implementation returns net::ERR_FILE_NOT_FOUND. - virtual int ReadSideData(scoped_refptr<net::IOBuffer> dst_buffer, - base::OnceCallback<void(int)> callback); + // Returns the entire side data as a BigBuffer and the net::Error from + // reading. The number of bytes read is the size of the BigBuffer. + virtual void ReadSideData( + base::OnceCallback<void(int, mojo_base::BigBuffer)> callback) = 0; // Print a description of the readable DataHandle for debugging. - virtual void PrintTo(::std::ostream* os) const; + virtual void PrintTo(::std::ostream* os) const = 0; // Return the histogram label to use when calling RecordBytesRead(). If - // nullptr is returned then nothing will be recorded. Returns nullptr by - // default. - virtual const char* BytesReadHistogramLabel() const; + // nullptr is returned then nothing will be recorded. + virtual const char* BytesReadHistogramLabel() const = 0; protected: virtual ~DataHandle(); @@ -117,6 +104,8 @@ scoped_refptr<DataHandle> data_handle, uint64_t offset, uint64_t length); + static scoped_refptr<BlobDataItem> CreateMojoDataItem( + mojom::BlobDataItemPtr item); Type type() const { return type_; } uint64_t offset() const { return offset_; }
diff --git a/storage/browser/blob/blob_impl.cc b/storage/browser/blob/blob_impl.cc index d403498..2c5a34ef 100644 --- a/storage/browser/blob/blob_impl.cc +++ b/storage/browser/blob/blob_impl.cc
@@ -146,28 +146,16 @@ std::move(callback).Run(base::nullopt); return; } - auto io_buffer = base::MakeRefCounted<net::IOBufferWithSize>(body_size); - - auto io_callback = base::AdaptCallbackForRepeating(base::BindOnce( - [](scoped_refptr<net::IOBufferWithSize> io_buffer, - ReadSideDataCallback callback, int result) { + item->data_handle()->ReadSideData(base::BindOnce( + [](ReadSideDataCallback callback, int result, + mojo_base::BigBuffer buffer) { if (result < 0) { std::move(callback).Run(base::nullopt); return; } - const uint8_t* data = - reinterpret_cast<const uint8_t*>(io_buffer->data()); - std::move(callback).Run( - base::make_span(data, data + io_buffer->size())); + std::move(callback).Run(std::move(buffer)); }, - io_buffer, std::move(callback))); - - // TODO(crbug.com/867848): Plumb BigBuffer into - // BlobDataItem::DataHandle::ReadSideData(). - int rv = item->data_handle()->ReadSideData(std::move(io_buffer), - io_callback); - if (rv != net::ERR_IO_PENDING) - io_callback.Run(rv); + std::move(callback))); }, *handle_, std::move(callback))); }
diff --git a/storage/browser/blob/blob_reader.cc b/storage/browser/blob/blob_reader.cc index ed13b00..7f7f865 100644 --- a/storage/browser/blob/blob_reader.cc +++ b/storage/browser/blob/blob_reader.cc
@@ -26,6 +26,7 @@ #include "storage/browser/file_system/file_system_context.h" #include "storage/browser/file_system/file_system_url.h" #include "storage/common/storage_histograms.h" +#include "third_party/blink/public/common/blob/blob_utils.h" namespace storage { namespace { @@ -122,39 +123,38 @@ return item.data_handle()->GetSideDataSize() > 0; } -BlobReader::Status BlobReader::ReadSideData(StatusCallback done) { +void BlobReader::ReadSideData(StatusCallback done) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!has_side_data()) - return ReportError(net::ERR_FILE_NOT_FOUND); + side_data_.reset(); + if (!has_side_data()) { + std::move(done).Run(ReportError(net::ERR_FILE_NOT_FOUND)); + return; + } BlobDataItem* item = blob_data_->items()[0].get(); const int side_data_size = item->data_handle()->GetSideDataSize(); - side_data_ = base::MakeRefCounted<net::IOBufferWithSize>(side_data_size); - net_error_ = net::OK; - const int result = item->data_handle()->ReadSideData( - side_data_.get(), + item->data_handle()->ReadSideData( base::BindOnce(&BlobReader::DidReadSideData, weak_factory_.GetWeakPtr(), std::move(done), side_data_size)); - if (result >= 0) { - DCHECK_EQ(side_data_size, result); - return Status::DONE; - } - if (result == net::ERR_IO_PENDING) - return Status::IO_PENDING; - return ReportError(result); +} + +base::Optional<mojo_base::BigBuffer> BlobReader::TakeSideData() { + return std::move(side_data_); } void BlobReader::DidReadSideData(StatusCallback done, int expected_size, - int result) { + int result, + mojo_base::BigBuffer data) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (result >= 0) { DCHECK_EQ(expected_size, result); + DCHECK_EQ(static_cast<size_t>(expected_size), data.size()); RecordBytesReadFromDataHandle(/* item_index= */ 0, result); + side_data_ = std::move(data); std::move(done).Run(Status::DONE); return; } - side_data_ = nullptr; std::move(done).Run(ReportError(result)); } @@ -187,12 +187,15 @@ if (current_item_offset_ == 0) return Status::DONE; - // Adjust the offset of the first stream if it is of file type. + // Adjust the offset of the first stream if it is a file or data handle. const BlobDataItem& item = *items.at(current_item_index_); if (IsFileType(item.type())) { SetFileReaderAtIndex(current_item_index_, CreateFileStreamReader(item, offset)); } + if (item.type() == BlobDataItem::Type::kReadableDataHandle) { + SetDataPipeAtIndex(current_item_index_, CreateDataPipe(item, offset)); + } return Status::DONE; } @@ -236,10 +239,34 @@ return status; } +bool BlobReader::IsSingleMojoDataItem() const { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(total_size_calculated_); + if (!blob_data_.get()) + return false; + if (blob_data_->items().size() != 1) + return false; + if (blob_data_->items()[0]->type() != BlobDataItem::Type::kReadableDataHandle) + return false; + return true; +} + +void BlobReader::ReadSingleMojoDataItem( + mojo::ScopedDataPipeProducerHandle producer, + net::CompletionOnceCallback done) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(IsSingleMojoDataItem()); + + // Read the entire data item. + auto item = blob_data_->items()[0]; + item->data_handle()->Read(std::move(producer), item->offset(), item->length(), + std::move(done)); +} + void BlobReader::Kill() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DeleteCurrentFileReader(); + DeleteItemReaders(); weak_factory_.InvalidateWeakPtrs(); } @@ -492,8 +519,8 @@ void BlobReader::AdvanceItem() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - // Close the file if the current item is a file. - DeleteCurrentFileReader(); + // Close any files or data pipes. + DeleteItemReaders(); // Advance to the next item. current_item_index_++; @@ -577,9 +604,11 @@ } } -void BlobReader::DeleteCurrentFileReader() { +void BlobReader::DeleteItemReaders() { SetFileReaderAtIndex(current_item_index_, std::unique_ptr<FileStreamReader>()); + SetDataPipeAtIndex(current_item_index_, + std::unique_ptr<network::DataPipeToSourceStream>()); } BlobReader::Status BlobReader::ReadReadableDataHandle(const BlobDataItem& item, @@ -590,11 +619,14 @@ DCHECK_GE(read_buf_->BytesRemaining(), bytes_to_read); DCHECK_EQ(item.type(), BlobDataItem::Type::kReadableDataHandle); - const int result = item.data_handle()->Read( - read_buf_, item.offset() + current_item_offset_, bytes_to_read, - base::BindOnce(&BlobReader::DidReadReadableDataHandle, - weak_factory_.GetWeakPtr())); + network::DataPipeToSourceStream* const pipe = + GetOrCreateDataPipeAtIndex(current_item_index_); + if (!pipe) + return ReportError(net::ERR_UNEXPECTED); + int result = pipe->Read(read_buf_.get(), bytes_to_read, + base::BindOnce(&BlobReader::DidReadReadableDataHandle, + weak_factory_.GetWeakPtr())); if (result >= 0) { AdvanceBytesRead(result); return Status::DONE; @@ -723,6 +755,72 @@ index_to_reader_.erase(index); } +network::DataPipeToSourceStream* BlobReader::GetOrCreateDataPipeAtIndex( + size_t index) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + const auto& items = blob_data_->items(); + DCHECK_LT(index, items.size()); + const BlobDataItem& item = *items.at(index); + if (item.type() != BlobDataItem::Type::kReadableDataHandle) + return nullptr; + auto it = index_to_pipe_.find(index); + if (it != index_to_pipe_.end()) { + DCHECK(it->second); + return it->second.get(); + } + auto pipe = CreateDataPipe(item, 0); + auto* ret_value = pipe.get(); + index_to_pipe_[index] = std::move(pipe); + return ret_value; +} + +void BlobReader::SetDataPipeAtIndex( + size_t index, + std::unique_ptr<network::DataPipeToSourceStream> pipe) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (pipe) + index_to_pipe_[index] = std::move(pipe); + else + index_to_pipe_.erase(index); +} + +std::unique_ptr<network::DataPipeToSourceStream> BlobReader::CreateDataPipe( + const BlobDataItem& item, + uint64_t additional_offset) { + DCHECK_EQ(item.type(), BlobDataItem::Type::kReadableDataHandle); + + uint64_t blob_size = item.length(); + uint64_t max_bytes_to_read = blob_size - additional_offset; + mojo::ScopedDataPipeProducerHandle producer; + mojo::ScopedDataPipeConsumerHandle consumer; + MojoCreateDataPipeOptions options; + options.struct_size = sizeof(MojoCreateDataPipeOptions); + options.flags = MOJO_CREATE_DATA_PIPE_FLAG_NONE; + options.element_num_bytes = 1; + options.capacity_num_bytes = + blink::BlobUtils::GetDataPipeCapacity(max_bytes_to_read); + + MojoResult result = mojo::CreateDataPipe(&options, &producer, &consumer); + + if (result != MOJO_RESULT_OK) + return nullptr; + + auto adapter = + std::make_unique<network::DataPipeToSourceStream>(std::move(consumer)); + item.data_handle()->Read( + std::move(producer), additional_offset + item.offset(), max_bytes_to_read, + base::BindOnce( + [](base::WeakPtr<BlobReader> reader, int result) { + if (!reader || result >= 0) + return; + reader->InvalidateCallbacksAndDone( + result, std::move(reader->read_callback_)); + }, + weak_factory_.GetWeakPtr())); + return adapter; +} + void BlobReader::RecordBytesReadFromDataHandle(int item_index, int result) { const auto& items = blob_data_->items(); BlobDataItem& item = *items.at(item_index);
diff --git a/storage/browser/blob/blob_reader.h b/storage/browser/blob/blob_reader.h index fb8f1f3..754bb0c 100644 --- a/storage/browser/blob/blob_reader.h +++ b/storage/browser/blob/blob_reader.h
@@ -17,7 +17,10 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" +#include "mojo/public/cpp/base/big_buffer.h" +#include "mojo/public/cpp/system/data_pipe.h" #include "net/base/completion_once_callback.h" +#include "services/network/public/cpp/data_pipe_to_source_stream.h" #include "storage/browser/blob/blob_storage_constants.h" class GURL; @@ -31,7 +34,6 @@ namespace net { class DrainableIOBuffer; class IOBuffer; -class IOBufferWithSize; } namespace storage { @@ -86,24 +88,21 @@ // DataHandle entry blob. So it returns false when the blob has more than // single data item. This side data is used to pass the V8 code cache which is // stored as a side stream in the CacheStorage to the renderer. - // (crbug.com/581613) + // (crbug.com/581613). This will still return true even after TakeSideData + // has been called. bool has_side_data() const; // Reads the side data of the blob. CalculateSize must be called beforehand. - // * If the side data is read immediately, returns Status::DONE. - // * If an error happens or the blob doesn't have side data, returns - // Status::NET_ERROR and the net error code is set. - // * If this function returns Status::IO_PENDING, the done callback will be - // called with Status::DONE or Status::NET_ERROR. + // * Always calls the StatusCallback when the side data has been read. + // * This may be done synchronously or asynchronously. + // * The done callback will be called with Status::DONE or Status::NET_ERROR. + // * If the callback returns NET_ERROR, net_error() will have the value. // Currently side data is supported only for single readable DataHandle entry // blob. - Status ReadSideData(StatusCallback done); + void ReadSideData(StatusCallback done); - // Returns the side data which has been already read with ReadSideData(). - net::IOBufferWithSize* side_data() const { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - return side_data_.get(); - } + // Passes the side data (if any) from ReadSideData() to the caller. + base::Optional<mojo_base::BigBuffer> TakeSideData(); // Used to set the read position. // * This should be called after CalculateSize and before Read. @@ -123,6 +122,13 @@ int* bytes_read, net::CompletionOnceCallback done); + // Returns if this reader contains a single MojoDataItem. If so, + // ReadSingleMojoDataItem can be called instead of multiple Reads as an + // optimized path. This can only be called after CalculateSize. + bool IsSingleMojoDataItem() const; + void ReadSingleMojoDataItem(mojo::ScopedDataPipeProducerHandle producer, + net::CompletionOnceCallback done); + // Kills reading and invalidates all callbacks. The reader cannot be used // after this call. void Kill(); @@ -200,16 +206,19 @@ void ReadBytesItem(const BlobDataItem& item, int bytes_to_read); BlobReader::Status ReadFileItem(FileStreamReader* reader, int bytes_to_read); void DidReadFile(int result); - void DeleteCurrentFileReader(); + void DeleteItemReaders(); Status ReadReadableDataHandle(const BlobDataItem& item, int bytes_to_read); void DidReadReadableDataHandle(int result); void DidReadItem(int result); - void DidReadSideData(StatusCallback done, int expected_size, int result); + void DidReadSideData(StatusCallback done, + int expected_size, + int result, + mojo_base::BigBuffer data); int ComputeBytesToRead() const; int BytesReadCompleted(); // Returns a FileStreamReader for a blob item at |index|. - // If the item at |index| is not of file this returns nullptr. + // If the item at |index| is not of type kFile this returns nullptr. FileStreamReader* GetOrCreateFileReaderAtIndex(size_t index); // If the reader is null, then this basically performs a delete operation. void SetFileReaderAtIndex(size_t index, @@ -218,6 +227,16 @@ std::unique_ptr<FileStreamReader> CreateFileStreamReader( const BlobDataItem& item, uint64_t additional_offset); + // Returns a DataPipeToSourceStream for a blob item at |Index|. + // If the item at |index| is not of type kReadableDataHandle this returns + // nullptr. + network::DataPipeToSourceStream* GetOrCreateDataPipeAtIndex(size_t index); + void SetDataPipeAtIndex( + size_t index, + std::unique_ptr<network::DataPipeToSourceStream> pipe); + std::unique_ptr<network::DataPipeToSourceStream> CreateDataPipe( + const BlobDataItem& item, + uint64_t additional_offset); void RecordBytesReadFromDataHandle(int item_index, int result); @@ -225,7 +244,7 @@ std::unique_ptr<BlobDataSnapshot> blob_data_; std::unique_ptr<FileStreamReaderProvider> file_stream_provider_for_testing_; scoped_refptr<base::TaskRunner> file_task_runner_; - scoped_refptr<net::IOBufferWithSize> side_data_; + base::Optional<mojo_base::BigBuffer> side_data_; int net_error_; bool item_list_populated_ = false; @@ -238,6 +257,8 @@ uint64_t remaining_bytes_ = 0; size_t pending_get_file_info_count_ = 0; std::map<size_t, std::unique_ptr<FileStreamReader>> index_to_reader_; + std::map<size_t, std::unique_ptr<network::DataPipeToSourceStream>> + index_to_pipe_; size_t current_item_index_ = 0; uint64_t current_item_offset_ = 0;
diff --git a/storage/browser/blob/blob_reader_unittest.cc b/storage/browser/blob/blob_reader_unittest.cc index 9c8faf714..eebd799 100644 --- a/storage/browser/blob/blob_reader_unittest.cc +++ b/storage/browser/blob/blob_reader_unittest.cc
@@ -19,6 +19,7 @@ #include "base/run_loop.h" #include "base/strings/stringprintf.h" #include "base/task_runner.h" +#include "base/test/bind_test_util.h" #include "base/test/task_environment.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" @@ -420,14 +421,15 @@ CheckSizeCalculatedSynchronously(kData.size(), size_result); EXPECT_TRUE(reader_->has_side_data()); - BlobReader::Status status = BlobReader::Status::DONE; - EXPECT_EQ(BlobReader::Status::DONE, - reader_->ReadSideData( - base::BindOnce(&SetValue<BlobReader::Status>, &status))); + BlobReader::Status status = BlobReader::Status::NET_ERROR; + // As this is using a FakeBlobDataHandle, expect this to be synchronous. + reader_->ReadSideData(base::BindOnce(&SetValue<BlobReader::Status>, &status)); EXPECT_EQ(net::OK, reader_->net_error()); - EXPECT_TRUE(reader_->side_data()); - std::string result(reader_->side_data()->data(), - reader_->side_data()->size()); + EXPECT_EQ(BlobReader::Status::DONE, status); + auto side_data = reader_->TakeSideData(); + EXPECT_TRUE(side_data.has_value()); + std::string result(reinterpret_cast<const char*>(side_data->data()), + side_data->size()); EXPECT_EQ(kSideData, result); } @@ -642,14 +644,14 @@ EXPECT_EQ(0, memcmp(buffer->data(), "FileData!!!", kData.size())); } -TEST_F(BlobReaderTest, ReadableDataHandleAsync) { +TEST_F(BlobReaderTest, ReadableDataHandleSingle) { auto b = std::make_unique<BlobDataBuilder>("uuid"); - const std::string kData = "Test Blob Data"; + const std::string kOrigData = "12345 Test Blob Data 12345"; auto data_handle = - base::MakeRefCounted<storage::FakeBlobDataHandle>(kData, ""); - data_handle->EnableDelayedReading(); - b->AppendReadableDataHandle(data_handle); + base::MakeRefCounted<storage::FakeBlobDataHandle>(kOrigData, ""); + b->AppendReadableDataHandle(data_handle, 6, 14); this->InitializeReader(std::move(b)); + const std::string kData = kOrigData.substr(6, 14); int size_result = -1; EXPECT_FALSE(IsReaderTotalSizeCalculated()); @@ -657,20 +659,73 @@ &SetValue<int>, &size_result))); CheckSizeCalculatedSynchronously(kData.size(), size_result); + // This test checks the optimized single mojo data item path, where the + // data pipe passed in gets passed directly to the MojoDataItem. + EXPECT_TRUE(reader_->IsSingleMojoDataItem()); + + mojo::ScopedDataPipeProducerHandle producer; + mojo::ScopedDataPipeConsumerHandle consumer; + MojoResult pipe_result = mojo::CreateDataPipe(nullptr, &producer, &consumer); + ASSERT_EQ(MOJO_RESULT_OK, pipe_result); + + int bytes_read = net::ERR_UNEXPECTED; + reader_->ReadSingleMojoDataItem( + std::move(producer), + base::BindLambdaForTesting([&](int result) { bytes_read = result; })); + base::RunLoop().RunUntilIdle(); + + ASSERT_EQ(kData.size(), static_cast<size_t>(bytes_read)); + + std::vector<uint8_t> buffer(bytes_read); + uint32_t num_bytes = bytes_read; + MojoReadDataFlags flags = MOJO_READ_DATA_FLAG_ALL_OR_NONE; + MojoResult read_result = consumer->ReadData(buffer.data(), &num_bytes, flags); + ASSERT_EQ(MOJO_RESULT_OK, read_result); + ASSERT_EQ(kData.size(), num_bytes); + + EXPECT_EQ(0, memcmp(buffer.data(), kData.c_str(), kData.size())); +} + +TEST_F(BlobReaderTest, ReadableDataHandleMultipleSlices) { + auto b = std::make_unique<BlobDataBuilder>("uuid"); + const std::string kData1 = "Test Blob Data"; + const std::string kData2 = "Extra test blob data"; + + // Create readable data handles with various slices of data. + // It's important to test that both the first element we read and a + // non-first element that we read handle slices, as these touch different + // pieces of code. + b->AppendReadableDataHandle( + base::MakeRefCounted<storage::FakeBlobDataHandle>(kData1, ""), 5, 4); + b->AppendReadableDataHandle( + base::MakeRefCounted<storage::FakeBlobDataHandle>(kData2, ""), 6, 9); + this->InitializeReader(std::move(b)); + + std::string kData = kData1.substr(5, 4) + kData2.substr(6, 9); + + int size_result = -1; + EXPECT_FALSE(IsReaderTotalSizeCalculated()); + EXPECT_EQ(BlobReader::Status::DONE, reader_->CalculateSize(base::BindOnce( + &SetValue<int>, &size_result))); + CheckSizeCalculatedSynchronously(kData.size(), size_result); + + // Verify this condition while we are here. + EXPECT_FALSE(reader_->IsSingleMojoDataItem()); + scoped_refptr<net::IOBuffer> buffer = base::MakeRefCounted<net::IOBuffer>(kData.size()); int bytes_read = 0; int async_bytes_read = 0; - EXPECT_EQ(BlobReader::Status::IO_PENDING, - reader_->Read(buffer.get(), kData.size(), &bytes_read, - base::BindOnce(&SetValue<int>, &async_bytes_read))); - EXPECT_TRUE(data_handle->HasPendingReadCallbacks()); - data_handle->RunPendingReadCallbacks(); + BlobReader::Status result = + reader_->Read(buffer.get(), kData.size(), &bytes_read, + base::BindOnce(&SetValue<int>, &async_bytes_read)); EXPECT_EQ(net::OK, reader_->net_error()); - EXPECT_EQ(0, bytes_read); - EXPECT_EQ(kData.size(), static_cast<size_t>(async_bytes_read)); - EXPECT_EQ(0, memcmp(buffer->data(), "Test Blob Data", kData.size())); + EXPECT_EQ(result, BlobReader::Status::DONE); + EXPECT_EQ(0, async_bytes_read); + EXPECT_EQ(kData.size(), static_cast<size_t>(bytes_read)); + + EXPECT_EQ(0, memcmp(buffer->data(), kData.data(), kData.size())); } TEST_F(BlobReaderTest, FileRange) {
diff --git a/storage/browser/blob/blob_storage_context.cc b/storage/browser/blob/blob_storage_context.cc index ccbbda61..14930cfb 100644 --- a/storage/browser/blob/blob_storage_context.cc +++ b/storage/browser/blob/blob_storage_context.cc
@@ -25,13 +25,13 @@ #include "base/trace_event/memory_dump_manager.h" #include "base/trace_event/trace_event.h" #include "mojo/public/cpp/bindings/callback_helpers.h" -#include "mojo/public/cpp/bindings/remote.h" #include "storage/browser/blob/blob_data_builder.h" #include "storage/browser/blob/blob_data_item.h" #include "storage/browser/blob/blob_data_snapshot.h" #include "storage/browser/blob/blob_impl.h" #include "storage/browser/blob/shareable_blob_data_item.h" #include "third_party/blink/public/common/blob/blob_utils.h" +#include "third_party/blink/public/mojom/blob/data_element.mojom.h" #include "url/gurl.h" namespace storage { @@ -370,6 +370,11 @@ NotifyTransportCompleteInternal(entry); } +void BlobStorageContext::Bind( + mojo::PendingReceiver<mojom::BlobStorageContext> receiver) { + receivers_.Add(this, std::move(receiver)); +} + void BlobStorageContext::IncrementBlobRefCount(const std::string& uuid) { BlobEntry* entry = registry_.GetEntry(uuid); DCHECK(entry); @@ -658,4 +663,35 @@ return true; } +void BlobStorageContext::RegisterFromDataItem( + mojo::PendingReceiver<::blink::mojom::Blob> blob, + const std::string& uuid, + mojom::BlobDataItemPtr item) { + if (registry_.HasEntry(uuid)) { + receivers_.ReportBadMessage("duplicate uuid"); + return; + } + std::unique_ptr<BlobDataBuilder> builder = + std::make_unique<BlobDataBuilder>(uuid); + builder->AppendMojoDataItem(std::move(item)); + std::unique_ptr<BlobDataHandle> handle = AddFinishedBlob(std::move(builder)); + BlobImpl::Create(std::move(handle), std::move(blob)); +} + +void BlobStorageContext::RegisterFromMemory( + mojo::PendingReceiver<::blink::mojom::Blob> blob, + const std::string& uuid, + mojo_base::BigBuffer data) { + if (registry_.HasEntry(uuid)) { + receivers_.ReportBadMessage("duplicate uuid"); + return; + } + + std::unique_ptr<BlobDataBuilder> builder = + std::make_unique<BlobDataBuilder>(uuid); + builder->AppendData(reinterpret_cast<const char*>(data.data()), data.size()); + std::unique_ptr<BlobDataHandle> handle = AddFinishedBlob(std::move(builder)); + BlobImpl::Create(std::move(handle), std::move(blob)); +} + } // namespace storage
diff --git a/storage/browser/blob/blob_storage_context.h b/storage/browser/blob/blob_storage_context.h index c4fdee53..e2f71ba 100644 --- a/storage/browser/blob/blob_storage_context.h +++ b/storage/browser/blob/blob_storage_context.h
@@ -20,12 +20,15 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/trace_event/memory_dump_provider.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver_set.h" #include "storage/browser/blob/blob_data_handle.h" #include "storage/browser/blob/blob_entry.h" #include "storage/browser/blob/blob_memory_controller.h" #include "storage/browser/blob/blob_storage_constants.h" #include "storage/browser/blob/blob_storage_registry.h" +#include "storage/browser/blob/mojom/blob_storage_context.mojom.h" #include "third_party/blink/public/mojom/blob/blob.mojom.h" class GURL; @@ -46,7 +49,8 @@ // This class is not threadsafe, access on IO thread. In Chromium there is one // instance per profile. class COMPONENT_EXPORT(STORAGE_BROWSER) BlobStorageContext - : public base::trace_event::MemoryDumpProvider { + : public base::trace_event::MemoryDumpProvider, + public mojom::BlobStorageContext { public: using TransportAllowedCallback = BlobEntry::TransportAllowedCallback; using BuildAbortedCallback = BlobEntry::BuildAbortedCallback; @@ -154,6 +158,8 @@ return ptr_factory_.GetWeakPtr(); } + void Bind(mojo::PendingReceiver<mojom::BlobStorageContext> receiver); + void set_limits_for_testing(const BlobStorageLimits& limits) { mutable_memory_controller()->set_limits_for_testing(limits); } @@ -236,8 +242,17 @@ bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, base::trace_event::ProcessMemoryDump* pmd) override; + // storage::mojom::BlobStorageContext implementation. + void RegisterFromDataItem(mojo::PendingReceiver<blink::mojom::Blob> blob, + const std::string& uuid, + mojom::BlobDataItemPtr item) override; + void RegisterFromMemory(mojo::PendingReceiver<::blink::mojom::Blob> blob, + const std::string& uuid, + mojo_base::BigBuffer data) override; + BlobStorageRegistry registry_; BlobMemoryController memory_controller_; + mojo::ReceiverSet<mojom::BlobStorageContext> receivers_; base::WeakPtrFactory<BlobStorageContext> ptr_factory_{this}; DISALLOW_COPY_AND_ASSIGN(BlobStorageContext);
diff --git a/storage/browser/blob/blob_url_loader.cc b/storage/browser/blob/blob_url_loader.cc index 8e6946e..f57286c0 100644 --- a/storage/browser/blob/blob_url_loader.cc +++ b/storage/browser/blob/blob_url_loader.cc
@@ -183,12 +183,12 @@ return REQUEST_SIDE_DATA; } - HeadersCompleted(status_code, content_size, nullptr); + HeadersCompleted(status_code, content_size, base::nullopt); return DONT_REQUEST_SIDE_DATA; } -void BlobURLLoader::DidReadSideData(net::IOBufferWithSize* data) { - HeadersCompleted(net::HTTP_OK, total_size_, data); +void BlobURLLoader::DidReadSideData(base::Optional<mojo_base::BigBuffer> data) { + HeadersCompleted(net::HTTP_OK, total_size_, std::move(data)); } void BlobURLLoader::OnComplete(net::Error error_code, @@ -201,9 +201,10 @@ status.decoded_body_length = total_written_bytes; client_->OnComplete(status); } -void BlobURLLoader::HeadersCompleted(net::HttpStatusCode status_code, - uint64_t content_size, - net::IOBufferWithSize* metadata) { +void BlobURLLoader::HeadersCompleted( + net::HttpStatusCode status_code, + uint64_t content_size, + base::Optional<mojo_base::BigBuffer> metadata) { auto response = network::mojom::URLResponseHead::New(); response->content_length = 0; if (status_code == net::HTTP_OK || status_code == net::HTTP_PARTIAL_CONTENT) @@ -223,11 +224,8 @@ client_->OnReceiveResponse(std::move(response)); sent_headers_ = true; - if (metadata) { - const uint8_t* data = reinterpret_cast<const uint8_t*>(metadata->data()); - client_->OnReceiveCachedMetadata( - std::vector<uint8_t>(data, data + metadata->size())); - } + if (metadata.has_value()) + client_->OnReceiveCachedMetadata(std::move(metadata.value())); client_->OnStartLoadingResponseBody( std::move(response_body_consumer_handle_));
diff --git a/storage/browser/blob/blob_url_loader.h b/storage/browser/blob/blob_url_loader.h index a2ce67a..c4f6f88 100644 --- a/storage/browser/blob/blob_url_loader.h +++ b/storage/browser/blob/blob_url_loader.h
@@ -51,12 +51,12 @@ // storage::MojoBlobReader::Delegate implementation: RequestSideData DidCalculateSize(uint64_t total_size, uint64_t content_size) override; - void DidReadSideData(net::IOBufferWithSize* data) override; + void DidReadSideData(base::Optional<mojo_base::BigBuffer> data) override; void OnComplete(net::Error error_code, uint64_t total_written_bytes) override; void HeadersCompleted(net::HttpStatusCode status_code, uint64_t content_size, - net::IOBufferWithSize* metadata); + base::Optional<mojo_base::BigBuffer> metadata); mojo::Binding<network::mojom::URLLoader> binding_; network::mojom::URLLoaderClientPtr client_;
diff --git a/storage/browser/blob/mojo_blob_reader.cc b/storage/browser/blob/mojo_blob_reader.cc index fe897605..2b20198 100644 --- a/storage/browser/blob/mojo_blob_reader.cc +++ b/storage/browser/blob/mojo_blob_reader.cc
@@ -132,11 +132,8 @@ if (!blob_reader_->has_side_data()) { DidReadSideData(BlobReader::Status::DONE); } else { - BlobReader::Status read_status = - blob_reader_->ReadSideData(base::BindOnce( - &MojoBlobReader::DidReadSideData, base::Unretained(this))); - if (read_status != BlobReader::Status::IO_PENDING) - DidReadSideData(BlobReader::Status::DONE); + blob_reader_->ReadSideData(base::BindOnce( + &MojoBlobReader::DidReadSideData, base::Unretained(this))); } } else { StartReading(); @@ -150,13 +147,38 @@ NotifyCompletedAndDeleteIfNeeded(blob_reader_->net_error()); return; } - delegate_->DidReadSideData(blob_reader_->side_data()); + delegate_->DidReadSideData(blob_reader_->TakeSideData()); StartReading(); } void MojoBlobReader::StartReading() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + // Optimized path for reading a single data item. The data pipe for + // the read is passed directly to the MojoDataItem. + if (blob_reader_->IsSingleMojoDataItem()) { + uint64_t num_bytes = blob_reader_->remaining_bytes(); + blob_reader_->ReadSingleMojoDataItem( + std::move(response_body_stream_), + base::BindOnce( + [](base::WeakPtr<MojoBlobReader> reader, uint64_t num_bytes, + int result) { + if (!reader) + return; + // NotifyCompletedAndDeleteIfNeeded takes a net error that + // doesn't include bytes read, so pass along the net error + // and not the |result| from the callback. + if (result == net::OK) { + reader->total_written_bytes_ += num_bytes; + reader->delegate_->DidRead(num_bytes); + } + auto error = reader->blob_reader_->net_error(); + reader->NotifyCompletedAndDeleteIfNeeded(error); + }, + weak_factory_.GetWeakPtr(), num_bytes)); + return; + } + peer_closed_handle_watcher_.Watch( response_body_stream_.get(), MOJO_HANDLE_SIGNAL_PEER_CLOSED, MOJO_WATCH_CONDITION_SATISFIED,
diff --git a/storage/browser/blob/mojo_blob_reader.h b/storage/browser/blob/mojo_blob_reader.h index d311e321..3290103 100644 --- a/storage/browser/blob/mojo_blob_reader.h +++ b/storage/browser/blob/mojo_blob_reader.h
@@ -16,10 +16,6 @@ #include "net/http/http_byte_range.h" #include "storage/browser/blob/blob_reader.h" -namespace net { -class IOBufferWithSize; -} - namespace network { class NetToMojoPendingBuffer; } @@ -55,9 +51,8 @@ uint64_t content_size) = 0; // Called if DidCalculateSize returned |REQUEST_SIDE_DATA|, with the side - // data associated with the blob being read. If the blob doesn't have side - // data this method is called with null. - virtual void DidReadSideData(net::IOBufferWithSize* data) {} + // data associated with the blob being read, if any. + virtual void DidReadSideData(base::Optional<mojo_base::BigBuffer> data) {} // Called whenever some amount of data is read from the blob and about to be // written to the data pipe.
diff --git a/storage/browser/blob/mojom/OWNERS b/storage/browser/blob/mojom/OWNERS new file mode 100644 index 0000000..676a080 --- /dev/null +++ b/storage/browser/blob/mojom/OWNERS
@@ -0,0 +1,5 @@ +per-file *.mojom=set noparent +per-file *.mojom=file://ipc/SECURITY_OWNERS + +# TEAM: storage-dev@chromium.org +# COMPONENT: Blink>Storage>FileAPI
diff --git a/storage/browser/blob/mojom/blob_storage_context.mojom b/storage/browser/blob/mojom/blob_storage_context.mojom new file mode 100644 index 0000000..7de092d --- /dev/null +++ b/storage/browser/blob/mojom/blob_storage_context.mojom
@@ -0,0 +1,55 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module storage.mojom; + +import "mojo/public/mojom/base/big_buffer.mojom"; +import "third_party/blink/public/mojom/blob/blob.mojom"; + +// A reader for the data and side data in a cache storage entry. +interface BlobDataItemReader { + // Causes a subrange of the contents of this entry to be written into the + // given data pipe. Returns the net::Error result. + Read(uint64 offset, uint64 length, handle<data_pipe_producer> pipe) + => (int32 success); + // Reads the side-data (if any) associated with this entry. Returns + // a net::Error result and the data, if any. + ReadSideData() => (int32 success, mojo_base.mojom.BigBuffer data); +}; + +// The type of BlobDataItem. Used for histograms. +enum BlobDataItemType { + kUnknown, // Type not known. + kCacheStorage, // Data comes from the cache storage system. +}; + +// A remote representation of a BlobDataItem::DataHandle for cache storage. +struct BlobDataItem { + BlobDataItemType type; + + // The size of the normal data. BlobDataItem::DataHandle needs this + // synchronously, which is why it is in a struct and not the interface. + uint64 size; + + // The size of the side data. This is zero if there is no side data. + uint64 side_data_size; + + // An interface to read the normal and side data of this entry. + pending_remote<BlobDataItemReader> reader; +}; + +// This interface is the primary access point to the browser's blob system +// for chrome internals. This is a simplified version of the +// blink.mojom.BlobRegistry interface. To avoid giving the renderer +// different capabilities, this is a separate interface. +interface BlobStorageContext { + // Create a blob with a particular uuid and consisting of a single + // BlobDataItem::DataHandle constructed from |item|. + RegisterFromDataItem(pending_receiver<blink.mojom.Blob> blob, string uuid, + BlobDataItem item); + // Create a blob with a particular uuid whose contents are contained + // in |data|. + RegisterFromMemory(pending_receiver<blink.mojom.Blob> blob, string uuid, + mojo_base.mojom.BigBuffer data); +};
diff --git a/storage/browser/test/fake_blob_data_handle.cc b/storage/browser/test/fake_blob_data_handle.cc index 3add0f4..14e63fc 100644 --- a/storage/browser/test/fake_blob_data_handle.cc +++ b/storage/browser/test/fake_blob_data_handle.cc
@@ -13,63 +13,53 @@ std::string side_data) : body_data_(std::move(body_data)), side_data_(std::move(side_data)) {} -void FakeBlobDataHandle::EnableDelayedReading() { - delayed_reading_ = true; -} - -bool FakeBlobDataHandle::HasPendingReadCallbacks() const { - return !pending_read_callbacks_.empty(); -} - -void FakeBlobDataHandle::RunPendingReadCallbacks() { - std::vector<base::OnceClosure> list = std::move(pending_read_callbacks_); - for (auto& cb : list) { - std::move(cb).Run(); - } -} - uint64_t FakeBlobDataHandle::GetSize() const { return body_data_.size(); } -int FakeBlobDataHandle::Read(scoped_refptr<net::IOBuffer> dst_buffer, - uint64_t src_offset, - int bytes_to_read, - base::OnceCallback<void(int)> callback) { - if (src_offset >= body_data_.size()) - return net::ERR_FAILED; +void FakeBlobDataHandle::Read(mojo::ScopedDataPipeProducerHandle producer, + uint64_t src_offset, + uint64_t bytes_to_read, + base::OnceCallback<void(int)> callback) { + if (src_offset >= body_data_.size()) { + std::move(callback).Run(net::ERR_FAILED); + return; + } - int num_bytes = - std::min(static_cast<int>(body_data_.size() - src_offset), bytes_to_read); - memcpy(dst_buffer->data(), body_data_.data() + src_offset, num_bytes); + uint32_t num_bytes = bytes_to_read; + uint32_t orig_num_bytes = num_bytes; + MojoResult result = + producer->WriteData(body_data_.c_str() + src_offset, &num_bytes, + MOJO_WRITE_DATA_FLAG_ALL_OR_NONE); - if (delayed_reading_) - return PendingCallback(std::move(callback), num_bytes); + // This should all succeed. + DCHECK_EQ(MOJO_RESULT_OK, result); + DCHECK_EQ(orig_num_bytes, num_bytes); - return num_bytes; + std::move(callback).Run(num_bytes); } uint64_t FakeBlobDataHandle::GetSideDataSize() const { return side_data_.size(); } -int FakeBlobDataHandle::ReadSideData(scoped_refptr<net::IOBuffer> dst_buffer, - base::OnceCallback<void(int)> callback) { - memcpy(dst_buffer->data(), side_data_.data(), side_data_.size()); +void FakeBlobDataHandle::ReadSideData( + base::OnceCallback<void(int, mojo_base::BigBuffer)> callback) { + if (side_data_.size() == 0) { + std::move(callback).Run(side_data_.size(), mojo_base::BigBuffer()); + return; + } - if (delayed_reading_) - return PendingCallback(std::move(callback), side_data_.size()); + mojo_base::BigBuffer buffer(side_data_.size()); + memcpy(buffer.data(), side_data_.data(), side_data_.size()); - return side_data_.size(); + std::move(callback).Run(side_data_.size(), std::move(buffer)); +} + +const char* FakeBlobDataHandle::BytesReadHistogramLabel() const { + return nullptr; } FakeBlobDataHandle::~FakeBlobDataHandle() = default; -int FakeBlobDataHandle::PendingCallback(base::OnceCallback<void(int)> callback, - int result) { - pending_read_callbacks_.push_back( - base::BindOnce(std::move(callback), result)); - return net::ERR_IO_PENDING; -} - } // namespace storage
diff --git a/storage/browser/test/fake_blob_data_handle.h b/storage/browser/test/fake_blob_data_handle.h index 4763530..1263aba 100644 --- a/storage/browser/test/fake_blob_data_handle.h +++ b/storage/browser/test/fake_blob_data_handle.h
@@ -12,33 +12,29 @@ namespace storage { +// All callbacks in the FakeBlobDataHandle are called synchronously. class FakeBlobDataHandle : public BlobDataItem::DataHandle { public: FakeBlobDataHandle(std::string body_data, std::string side_data); - void EnableDelayedReading(); - bool HasPendingReadCallbacks() const; - void RunPendingReadCallbacks(); - + // BlobDataItem::DataHandle implementation. uint64_t GetSize() const override; - int Read(scoped_refptr<net::IOBuffer> dst_buffer, - uint64_t src_offset, - int bytes_to_read, - base::OnceCallback<void(int)> callback) override; + void Read(mojo::ScopedDataPipeProducerHandle producer, + uint64_t src_offset, + uint64_t bytes_to_read, + base::OnceCallback<void(int)> callback) override; uint64_t GetSideDataSize() const override; - int ReadSideData(scoped_refptr<net::IOBuffer> dst_buffer, - base::OnceCallback<void(int)> callback) override; + void ReadSideData( + base::OnceCallback<void(int, mojo_base::BigBuffer)> callback) override; + void PrintTo(::std::ostream* os) const override {} + const char* BytesReadHistogramLabel() const override; private: ~FakeBlobDataHandle() override; - int PendingCallback(base::OnceCallback<void(int)> callback, int result); - const std::string body_data_; const std::string side_data_; - std::vector<base::OnceClosure> pending_read_callbacks_; - bool delayed_reading_ = false; }; } // namespace storage
diff --git a/testing/buildbot/chromium.clang.json b/testing/buildbot/chromium.clang.json index 9685a08..69d5eb4 100644 --- a/testing/buildbot/chromium.clang.json +++ b/testing/buildbot/chromium.clang.json
@@ -21301,7 +21301,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -23312,7 +23312,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose"
diff --git a/testing/buildbot/chromium.dawn.json b/testing/buildbot/chromium.dawn.json index f6b63d725..a3edd727 100644 --- a/testing/buildbot/chromium.dawn.json +++ b/testing/buildbot/chromium.dawn.json
@@ -151,7 +151,7 @@ "--no-xvfb", "--additional-driver-flag=--disable-gpu-sandbox" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -320,7 +320,7 @@ "--no-xvfb", "--additional-driver-flag=--disable-gpu-sandbox" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -691,7 +691,7 @@ "--isolated-script-test-filter=wpt_internal/webgpu/*", "--platform=mac-mac10.13" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -853,7 +853,7 @@ "--isolated-script-test-filter=wpt_internal/webgpu/*", "--platform=mac-mac10.13" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -1218,7 +1218,7 @@ "--additional-driver-flag=--disable-gpu-sandbox", "--target=Release_x64" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -1386,7 +1386,7 @@ "--additional-driver-flag=--disable-gpu-sandbox", "--target=Release_x64" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -1751,7 +1751,7 @@ "--isolated-script-test-filter=wpt_internal/webgpu/*", "--additional-driver-flag=--disable-gpu-sandbox" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -1918,7 +1918,7 @@ "--isolated-script-test-filter=wpt_internal/webgpu/*", "--additional-driver-flag=--disable-gpu-sandbox" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose"
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 81c6922c..326d48bf 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -131,7 +131,7 @@ "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization", "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-gl=swiftshader" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -166,7 +166,7 @@ "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization", "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-vulkan=swiftshader" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -1099,7 +1099,7 @@ "--num-retries=3", "--additional-driver-flag=--enable-blink-features=CompositeAfterPaint" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -1150,7 +1150,7 @@ "--num-retries=3", "--additional-driver-flag=--disable-blink-features=LayoutNG" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -4125,7 +4125,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -10637,7 +10637,7 @@ "--device=aemu", "--platform=fuchsia" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -10850,7 +10850,7 @@ "--additional-driver-flag=--enable-features=BackForwardCache", "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-features=BackForwardCache" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -11548,7 +11548,7 @@ "--num-retries=3", "--debug" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -13041,7 +13041,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -13087,7 +13087,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -16178,7 +16178,7 @@ "src/third_party/blink/web_tests/FlagExpectations/disable-site-isolation-trials", "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -16212,7 +16212,7 @@ "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization", "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-gl=swiftshader" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -16329,7 +16329,7 @@ "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization", "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-vulkan=swiftshader" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -16370,7 +16370,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -21661,7 +21661,7 @@ "--additional-env-var=LLVM_PROFILE_FILE=${ISOLATED_OUTDIR}/profraw/default-%2m.profraw" ], "isolate_coverage_data": true, - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -22006,7 +22006,7 @@ "--additional-driver-flag=--enable-features=OutOfBlinkCors", "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-features=OutOfBlinkCors" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -23749,7 +23749,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -23778,7 +23778,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -23806,7 +23806,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -23834,7 +23834,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -23863,7 +23863,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -23893,7 +23893,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -23960,7 +23960,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -25141,7 +25141,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose"
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index 611a7b5..b697744 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -10317,7 +10317,7 @@ "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization", "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-gl=any" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -10403,7 +10403,7 @@ "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization", "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-vulkan=native" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -10715,7 +10715,7 @@ "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization", "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-gl=any" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -10801,7 +10801,7 @@ "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization", "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-vulkan=native" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -24883,7 +24883,7 @@ "--target", "Release_x64" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose"
diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index 712f4ef..224bb9e7 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json
@@ -2142,7 +2142,7 @@ "--num-retries=3", "--platform=fuchsia" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -3832,7 +3832,7 @@ "--additional-env-var=LLVM_PROFILE_FILE=${ISOLATED_OUTDIR}/profraw/default-%2m.profraw" ], "isolate_coverage_data": true, - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -3867,7 +3867,7 @@ "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-gl=swiftshader" ], "isolate_coverage_data": true, - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -3989,7 +3989,7 @@ "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-vulkan=swiftshader" ], "isolate_coverage_data": true, - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -4013,7 +4013,7 @@ "--additional-env-var=LLVM_PROFILE_FILE=${ISOLATED_OUTDIR}/profraw/default-%2m.profraw" ], "isolate_coverage_data": true, - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -5637,7 +5637,7 @@ "--num-retries=3", "--debug" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -7297,7 +7297,7 @@ "src/third_party/blink/web_tests/FlagExpectations/disable-site-isolation-trials", "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -7331,7 +7331,7 @@ "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization", "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-gl=swiftshader" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -7448,7 +7448,7 @@ "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization", "--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-vulkan=swiftshader" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -7489,7 +7489,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose"
diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json index 61fbda86..f38ca2b 100644 --- a/testing/buildbot/chromium.mac.json +++ b/testing/buildbot/chromium.mac.json
@@ -1495,7 +1495,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -3001,7 +3001,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -4552,7 +4552,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -6081,7 +6081,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -7573,7 +7573,7 @@ "--num-retries=3", "--debug" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -7601,7 +7601,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose"
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index 9ecd9459a..4098d4c 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -13804,7 +13804,7 @@ "48000", "--enable-sanitizer" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -13836,7 +13836,7 @@ "48000", "--enable-leak-detection" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -13868,7 +13868,7 @@ "66000", "--enable-sanitizer" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose"
diff --git a/testing/buildbot/chromium.webkit.json b/testing/buildbot/chromium.webkit.json deleted file mode 100644 index 0b11b65d..0000000 --- a/testing/buildbot/chromium.webkit.json +++ /dev/null
@@ -1,160 +0,0 @@ -{ - "AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {}, - "AAAAA2 See generate_buildbot_json.py to make changes": {}, - "WebKit Linux ASAN": { - "isolated_scripts": [ - { - "args": [ - "--num-retries=3", - "--additional-expectations", - "../../third_party/blink/web_tests/ASANExpectations", - "--time-out-ms", - "48000", - "--enable-sanitizer" - ], - "isolate_name": "blink_web_tests_exparchive", - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "webkit_layout_tests", - "results_handler": "layout tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-16.04" - } - ], - "shards": 20 - } - } - ] - }, - "WebKit Linux Leak": { - "isolated_scripts": [ - { - "args": [ - "--num-retries=3", - "--additional-expectations", - "../../third_party/blink/web_tests/LeakExpectations", - "--time-out-ms", - "48000", - "--enable-leak-detection" - ], - "isolate_name": "blink_web_tests_exparchive", - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "webkit_layout_tests", - "results_handler": "layout tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-16.04" - } - ], - "shards": 10 - } - } - ] - }, - "WebKit Linux MSAN": { - "isolated_scripts": [ - { - "args": [ - "--num-retries=3", - "--additional-expectations", - "../../third_party/blink/web_tests/MSANExpectations", - "--time-out-ms", - "66000", - "--enable-sanitizer" - ], - "isolate_name": "blink_web_tests_exparchive", - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "webkit_layout_tests", - "results_handler": "layout tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-16.04" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "io_timeout": 3600, - "shards": 20 - } - } - ] - }, - "WebKit Mac10.13 (retina)": { - "isolated_scripts": [ - { - "args": [ - "--num-retries=3" - ], - "isolate_name": "blink_web_tests_exparchive", - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "webkit_layout_tests", - "results_handler": "layout tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:6821", - "hidpi": "1", - "os": "Mac-10.13.6", - "pool": "Chrome-GPU" - } - ], - "shards": 12 - } - } - ] - }, - "WebKit Win10": { - "isolated_scripts": [ - { - "args": [ - "--num-retries=3" - ], - "isolate_name": "blink_web_tests_exparchive", - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "webkit_layout_tests", - "results_handler": "layout tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-10-15063" - } - ], - "shards": 12 - } - } - ] - } -}
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json index b1b338f..5f60df8 100644 --- a/testing/buildbot/chromium.win.json +++ b/testing/buildbot/chromium.win.json
@@ -7,7 +7,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -3069,7 +3069,7 @@ "--target", "Release_x64" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -6197,7 +6197,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -7381,7 +7381,7 @@ "60000" ], "experiment_percentage": 100, - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose"
diff --git a/testing/buildbot/client.devtools-frontend.integration.json b/testing/buildbot/client.devtools-frontend.integration.json index ad83d5b..d86ddb59 100644 --- a/testing/buildbot/client.devtools-frontend.integration.json +++ b/testing/buildbot/client.devtools-frontend.integration.json
@@ -28,7 +28,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose"
diff --git a/testing/buildbot/client.v8.fyi.json b/testing/buildbot/client.v8.fyi.json index 4312312..a42666e2 100644 --- a/testing/buildbot/client.v8.fyi.json +++ b/testing/buildbot/client.v8.fyi.json
@@ -1301,7 +1301,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -1350,7 +1350,7 @@ "--num-retries=3", "--debug" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -1399,7 +1399,7 @@ "--num-retries=3", "--additional-driver-flag=--js-flags=--future" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -1448,7 +1448,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -1497,7 +1497,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose" @@ -1524,7 +1524,7 @@ "args": [ "--num-retries=3" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose"
diff --git a/testing/buildbot/filters/pixel_browser_tests.filter b/testing/buildbot/filters/pixel_browser_tests.filter index c69e33ea..e7d2b88 100644 --- a/testing/buildbot/filters/pixel_browser_tests.filter +++ b/testing/buildbot/filters/pixel_browser_tests.filter
@@ -25,3 +25,6 @@ TabGroupEditorBubbleViewDialogBrowserTest.* TabHoverCardBubbleViewBrowserTest.* OutdatedUpgradeBubbleTest.* + +# This test uses random network port and shows it on ui. +-ContentSettingBubbleDialogTest.InvokeUi_popups
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index 2e1dcb9..679dbca 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl
@@ -363,7 +363,7 @@ "label": "//third_party/blink/renderer/controller:blink_unittests", "type": "console_test_launcher", }, - "blink_web_tests_exparchive": { + "blink_web_tests": { "args": [ "../../third_party/blink/tools/run_web_tests.py", "--seed", @@ -379,7 +379,7 @@ "--results-directory", "${ISOLATED_OUTDIR}/layout-test-results", ], - "label": "//:blink_web_tests_exparchive", + "label": "//:blink_web_tests", "script": "//testing/scripts/run_isolated_script_test.py", "type": "script", }, @@ -3008,19 +3008,6 @@ "label": "//components/webcrypto:webcrypto_rsa_import_key_spki_fuzzer", "type": "fuzzer", }, - "webkit_layout_tests": { - "args": [ - "../../third_party/blink/tools/run_web_tests.py", - "--clobber-old-results", - "--debug-rwt-logging", - "--no-show-results", - "--results-directory", - "${ISOLATED_OUTDIR}/layout-test-results", - ], - "label": "//:blink_web_tests", - "script": "//testing/scripts/run_isolated_script_test.py", - "type": "script", - }, "webusb_descriptors_fuzzer": { "label": "//services/device/usb:webusb_descriptors_fuzzer", "type": "fuzzer",
diff --git a/testing/buildbot/manage.py b/testing/buildbot/manage.py index a792a7c..76c1741 100755 --- a/testing/buildbot/manage.py +++ b/testing/buildbot/manage.py
@@ -167,11 +167,6 @@ 'webrtc_nonparallel_tests', 'xmllite_xmpp_unittests', - # isolate is currently too slow for this target. - # http://crbug.com/524758 - 'webkit_layout_tests', - 'webkit_layout_tests_exparchive', - # These are only run on V8 CI. 'pdfium_test', 'postmortem-metadata',
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 4e475fc..20269a63 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -2299,7 +2299,7 @@ '--additional-driver-flag=--no-sandbox', '--additional-env-var=LLVM_PROFILE_FILE=${ISOLATED_OUTDIR}/profraw/default-%2m.profraw', ], - 'isolate_name': 'blink_web_tests_exparchive', + 'isolate_name': 'blink_web_tests', 'merge': { 'args': [ '--verbose', @@ -2606,7 +2606,7 @@ 'args': [ '--num-retries=3', ], - 'isolate_name': 'blink_web_tests_exparchive', + 'isolate_name': 'blink_web_tests', 'merge': { 'args': [ '--verbose', @@ -2640,7 +2640,7 @@ 'args': [ '--num-retries=3', ], - 'isolate_name': 'blink_web_tests_exparchive', + 'isolate_name': 'blink_web_tests', 'merge': { 'args': [ '--verbose', @@ -2826,7 +2826,7 @@ 'args': [ '--num-retries=3', ], - 'isolate_name': 'blink_web_tests_exparchive', + 'isolate_name': 'blink_web_tests', 'merge': { 'args': [ '--verbose', @@ -3366,7 +3366,7 @@ '--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization', '--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-gl=any', ], - 'isolate_name': 'blink_web_tests_exparchive', + 'isolate_name': 'blink_web_tests', 'merge': { 'args': [ '--verbose', @@ -3403,7 +3403,7 @@ '--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization', '--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-vulkan=native', ], - 'isolate_name': 'blink_web_tests_exparchive', + 'isolate_name': 'blink_web_tests', 'merge': { 'args': [ '--verbose', @@ -4143,7 +4143,7 @@ ], 'script': '//third_party/blink/tools/merge_web_test_results.py', }, - 'isolate_name': 'blink_web_tests_exparchive', + 'isolate_name': 'blink_web_tests', }, }, @@ -4257,7 +4257,7 @@ # retry 3 times, so we explicitly specify it. '--num-retries=3', ], - 'isolate_name': 'blink_web_tests_exparchive', + 'isolate_name': 'blink_web_tests', 'merge': { 'args': [ '--verbose', @@ -4752,7 +4752,7 @@ '--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization', '--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-gl=swiftshader', ], - 'isolate_name': 'blink_web_tests_exparchive', + 'isolate_name': 'blink_web_tests', 'merge': { 'args': [ '--verbose', @@ -4781,7 +4781,7 @@ '--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/enable-gpu-rasterization', '--additional-expectations=../../third_party/blink/web_tests/FlagExpectations/use-vulkan=swiftshader', ], - 'isolate_name': 'blink_web_tests_exparchive', + 'isolate_name': 'blink_web_tests', 'merge': { 'args': [ '--verbose',
diff --git a/testing/buildbot/tryserver.chromium.android.json b/testing/buildbot/tryserver.chromium.android.json index 571ac3f3..839cfb1 100644 --- a/testing/buildbot/tryserver.chromium.android.json +++ b/testing/buildbot/tryserver.chromium.android.json
@@ -484,7 +484,7 @@ "--disable-breakpad", "--additional-driver-flag=--use-gpu-in-tests" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose"
diff --git a/testing/buildbot/tryserver.chromium.linux.json b/testing/buildbot/tryserver.chromium.linux.json index 8b40c5d..c92b361 100644 --- a/testing/buildbot/tryserver.chromium.linux.json +++ b/testing/buildbot/tryserver.chromium.linux.json
@@ -11,7 +11,7 @@ "--num-retries=3", "--additional-driver-flag=--enable-blink-features=LayoutNGFragmentItem" ], - "isolate_name": "blink_web_tests_exparchive", + "isolate_name": "blink_web_tests", "merge": { "args": [ "--verbose"
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index d47d050..a0e262d 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -1560,21 +1560,6 @@ ] } ], - "ChromeOSParentalControlsSettings": [ - { - "platforms": [ - "chromeos" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "ChromeOSParentalControlsSettings" - ] - } - ] - } - ], "ChromeSmartSelection": [ { "platforms": [ @@ -3591,6 +3576,21 @@ ] } ], + "NativeGellerizationRollout": [ + { + "platforms": [ + "chromeos" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "ChromeOSParentalControlsSettings" + ] + } + ] + } + ], "NativeNotifications": [ { "platforms": [
diff --git a/third_party/blink/public/mojom/frame/frame.mojom b/third_party/blink/public/mojom/frame/frame.mojom index 38b4e686..2c3df36 100644 --- a/third_party/blink/public/mojom/frame/frame.mojom +++ b/third_party/blink/public/mojom/frame/frame.mojom
@@ -5,6 +5,7 @@ module blink.mojom; import "mojo/public/mojom/base/string16.mojom"; +import "third_party/blink/public/mojom/devtools/console_message.mojom"; import "third_party/blink/public/mojom/frame/fullscreen.mojom"; import "url/mojom/origin.mojom"; import "url/mojom/url.mojom"; @@ -83,6 +84,10 @@ // Notifies the RenderFrame about a user activation detected in the browser side // (e.g. during Android voice search). NotifyUserActivation(); + + // Add message to the frame console. + AddMessageToConsole(ConsoleMessageLevel level, string message, + bool discard_duplicates); }; // Implemented in Blink, this interface defines frame-specific methods that will @@ -104,4 +109,9 @@ // SecurityContext. Used to reset CSP from the previous document on // a cross-document navigation. ResetReplicatedContentSecurityPolicy(); + + // Update replicated set for enforcement of insecure navigations. |set| + // is a hashed set of host/port pairs. See + // SecurityContext::SetInsecureNavigationsSet. + EnforceInsecureNavigationsSet(array<uint32> set); }; \ No newline at end of file
diff --git a/third_party/blink/public/mojom/payments/payment_handler_host.mojom b/third_party/blink/public/mojom/payments/payment_handler_host.mojom index 665a3c9..d576e2e 100644 --- a/third_party/blink/public/mojom/payments/payment_handler_host.mojom +++ b/third_party/blink/public/mojom/payments/payment_handler_host.mojom
@@ -30,7 +30,7 @@ // Constructed by the browser based on PaymentDetails from the Merchant // renderer. The browser sends this to the Payment Handler renderer. -struct PaymentMethodChangeResponse { +struct PaymentRequestDetailsUpdate { PaymentCurrencyAmount? total; array<PaymentShippingOption>? shipping_options; array<PaymentHandlerModifier>? modifiers; @@ -39,6 +39,10 @@ AddressErrors? shipping_address_errors; }; +// TODO(sahel): remove this stub after updating clank code. crbug.com/984694 +struct PaymentMethodChangeResponse { +}; + // The interface for a PaymentRequest object in the browser, so a PaymentHandler // renderer can talk to it. // @@ -69,13 +73,11 @@ // // The browser validates the |details| from the Merchant renderer and sends // their subset to the Payment Handler renderer as - // |PaymentMethodChangeResponse|, so it can show the updated details. - // Todo(sahel): Rename PaymentMethodChangeResponse to - // PaymentRequestDetailsUpdate which is a more generic name. crbug.com/984694 + // |PaymentRequestDetailsUpdate|, so it can show the updated details. ChangePaymentMethod(PaymentHandlerMethodData method_data) => - (PaymentMethodChangeResponse response_data); + (PaymentRequestDetailsUpdate response_data); ChangeShippingOption(string shipping_option_id) => - (PaymentMethodChangeResponse response_data); + (PaymentRequestDetailsUpdate response_data); ChangeShippingAddress(PaymentAddress shipping_address) => - (PaymentMethodChangeResponse response_data); + (PaymentRequestDetailsUpdate response_data); };
diff --git a/third_party/blink/public/mojom/web_feature/web_feature.mojom b/third_party/blink/public/mojom/web_feature/web_feature.mojom index 117a6bd..6062a3d 100644 --- a/third_party/blink/public/mojom/web_feature/web_feature.mojom +++ b/third_party/blink/public/mojom/web_feature/web_feature.mojom
@@ -2448,6 +2448,11 @@ kV8RegExpExecCalledOnSlowRegExp = 3064, kV8RegExpReplaceCalledOnSlowRegExp = 3065, kHasMarkerPseudoElement = 3066, + kWindowMove = 3067, + kWindowResize = 3068, + kMovedOrResizedPopup = 3069, + kMovedOrResizedPopup2sAfterCreation = 3070, + kDOMWindowOpenPositioningFeatures = 3071, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/blink/renderer/bindings/modules/BUILD.gn b/third_party/blink/renderer/bindings/modules/BUILD.gn index 7c0d280..d0ff411 100644 --- a/third_party/blink/renderer/bindings/modules/BUILD.gn +++ b/third_party/blink/renderer/bindings/modules/BUILD.gn
@@ -46,7 +46,7 @@ "//third_party/blink/renderer/modules/payments/can_make_payment_event.idl", "//third_party/blink/renderer/modules/payments/merchant_validation_event.idl", "//third_party/blink/renderer/modules/payments/payment_method_change_event.idl", - "//third_party/blink/renderer/modules/payments/payment_method_change_response.idl", + "//third_party/blink/renderer/modules/payments/payment_request_details_update.idl", "//third_party/blink/renderer/modules/payments/payment_request_event.idl", "//third_party/blink/renderer/modules/payments/payment_request_update_event.idl", "//third_party/blink/renderer/modules/peerconnection/rtc_data_channel_event.idl",
diff --git a/third_party/blink/renderer/core/css/css.dict b/third_party/blink/renderer/core/css/css.dict index c804566..d909324 100644 --- a/third_party/blink/renderer/core/css/css.dict +++ b/third_party/blink/renderer/core/css/css.dict
@@ -916,6 +916,9 @@ "linktext" "visitedtext" "back-button" +"activetext" +"field" +"fieldtext" # at-rules "@charset"
diff --git a/third_party/blink/renderer/core/css/css_style_sheet.cc b/third_party/blink/renderer/core/css/css_style_sheet.cc index 04e6099..04c18e8 100644 --- a/third_party/blink/renderer/core/css/css_style_sheet.cc +++ b/third_party/blink/renderer/core/css/css_style_sheet.cc
@@ -585,8 +585,9 @@ bool CSSStyleSheet::IsAlternate() const { if (owner_node_) { auto* owner_element = DynamicTo<Element>(owner_node_.Get()); - return owner_element && owner_element->getAttribute(html_names::kRelAttr) - .Contains("alternate"); + return owner_element && + owner_element->FastGetAttribute(html_names::kRelAttr) + .Contains("alternate"); } return alternate_from_constructor_; }
diff --git a/third_party/blink/renderer/core/css/css_value_keywords.json5 b/third_party/blink/renderer/core/css/css_value_keywords.json5 index 1010ca92..00990659 100644 --- a/third_party/blink/renderer/core/css/css_value_keywords.json5 +++ b/third_party/blink/renderer/core/css/css_value_keywords.json5
@@ -182,6 +182,7 @@ "-webkit-activelink", "activeborder", "activecaption", + "activetext", "appworkspace", "background", "buttonface", @@ -189,6 +190,8 @@ "buttonshadow", "buttontext", "captiontext", + "field", + "fieldtext", "graytext", "highlight", "highlighttext",
diff --git a/third_party/blink/renderer/core/css/parser/css_parser.cc b/third_party/blink/renderer/core/css/parser/css_parser.cc index 4c51407e..22e5721 100644 --- a/third_party/blink/renderer/core/css/parser/css_parser.cc +++ b/third_party/blink/renderer/core/css/parser/css_parser.cc
@@ -261,6 +261,10 @@ if (!RuntimeEnabledFeatures::LinkSystemColorsEnabled() && (id == CSSValueID::kLinktext || id == CSSValueID::kVisitedtext)) { return false; + } else if (!RuntimeEnabledFeatures::NewSystemColorsEnabled() && + (id == CSSValueID::kActivetext || id == CSSValueID::kField || + id == CSSValueID::kFieldtext)) { + return false; } color = LayoutTheme::GetTheme().SystemColor(id, color_scheme); return true;
diff --git a/third_party/blink/renderer/core/css/parser/css_property_parser_helpers.cc b/third_party/blink/renderer/core/css/parser/css_property_parser_helpers.cc index 6ed98f9..c091695 100644 --- a/third_party/blink/renderer/core/css/parser/css_property_parser_helpers.cc +++ b/third_party/blink/renderer/core/css/parser/css_property_parser_helpers.cc
@@ -903,6 +903,10 @@ (color->GetValueID() == CSSValueID::kLinktext || color->GetValueID() == CSSValueID::kVisitedtext)) { return nullptr; + } else if (!RuntimeEnabledFeatures::NewSystemColorsEnabled() && + (id == CSSValueID::kActivetext || id == CSSValueID::kField || + id == CSSValueID::kFieldtext)) { + return nullptr; } return color; }
diff --git a/third_party/blink/renderer/core/css/resolver/style_adjuster.cc b/third_party/blink/renderer/core/css/resolver/style_adjuster.cc index cac490f..af93d98 100644 --- a/third_party/blink/renderer/core/css/resolver/style_adjuster.cc +++ b/third_party/blink/renderer/core/css/resolver/style_adjuster.cc
@@ -569,13 +569,13 @@ if (element && RuntimeEnabledFeatures::DisplayLockingEnabled( element->GetExecutionContext()) && - element->hasAttribute(html_names::kRendersubtreeAttr)) { + element->FastHasAttribute(html_names::kRendersubtreeAttr)) { // The element has the rendersubtree attr, so we should add style and // layout containment. If the attribute contains "invisible" we should // also add size containment. Containment contain = kContainsStyle | kContainsLayout; SpaceSplitString tokens( - element->getAttribute(html_names::kRendersubtreeAttr).LowerASCII()); + element->FastGetAttribute(html_names::kRendersubtreeAttr).LowerASCII()); if (style.ContainsSize() || tokens.Contains("invisible")) { contain |= kContainsSize; }
diff --git a/third_party/blink/renderer/core/display_lock/display_lock_context.cc b/third_party/blink/renderer/core/display_lock/display_lock_context.cc index ca1c90a..a946bdc 100644 --- a/third_party/blink/renderer/core/display_lock/display_lock_context.cc +++ b/third_party/blink/renderer/core/display_lock/display_lock_context.cc
@@ -395,7 +395,7 @@ StartCommit(); // Since setting the attribute might trigger a commit if we are still locked, // we set it after we start the commit. - if (element_->hasAttribute(html_names::kRendersubtreeAttr)) + if (element_->FastHasAttribute(html_names::kRendersubtreeAttr)) element_->setAttribute(html_names::kRendersubtreeAttr, ""); }
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc index 884afa8..acf01fa 100644 --- a/third_party/blink/renderer/core/dom/element.cc +++ b/third_party/blink/renderer/core/dom/element.cc
@@ -2606,7 +2606,7 @@ } const AtomicString Element::ImageSourceURL() const { - return getAttribute(html_names::kSrcAttr); + return FastGetAttribute(html_names::kSrcAttr); } bool Element::LayoutObjectIsNeeded(const ComputedStyle& style) const { @@ -2914,7 +2914,7 @@ element_animations->CssAnimations().ClearPendingUpdate(); if (RuntimeEnabledFeatures::InvisibleDOMEnabled() && - hasAttribute(html_names::kInvisibleAttr) && !calc_invisible) { + FastHasAttribute(html_names::kInvisibleAttr) && !calc_invisible) { auto style = GetDocument().GetStyleResolver()->InitialStyleForElement(GetDocument()); style->SetDisplay(EDisplay::kNone);
diff --git a/third_party/blink/renderer/core/dom/node.cc b/third_party/blink/renderer/core/dom/node.cc index 64c9d1d..d5b41c0 100644 --- a/third_party/blink/renderer/core/dom/node.cc +++ b/third_party/blink/renderer/core/dom/node.cc
@@ -1426,7 +1426,7 @@ element = FlatTreeTraversal::ParentElement(*this); while (element) { - if (element->hasAttribute(html_names::kInertAttr)) + if (element->FastHasAttribute(html_names::kInertAttr)) return true; element = FlatTreeTraversal::ParentElement(*element); }
diff --git a/third_party/blink/renderer/core/editing/commands/apply_style_command.cc b/third_party/blink/renderer/core/editing/commands/apply_style_command.cc index d815f5b..b0ba2cac5 100644 --- a/third_party/blink/renderer/core/editing/commands/apply_style_command.cc +++ b/third_party/blink/renderer/core/editing/commands/apply_style_command.cc
@@ -654,7 +654,7 @@ // it assumes that if the 'dir' attribute is present, then removing it will // suffice, and otherwise it sets the property in the inline style // declaration. - if (element->hasAttribute(html_names::kDirAttr)) { + if (element->FastHasAttribute(html_names::kDirAttr)) { // FIXME: If this is a BDO element, we should probably just remove it if // it has no other attributes, like we (should) do with B and I elements. RemoveElementAttribute(element, html_names::kDirAttr);
diff --git a/third_party/blink/renderer/core/editing/commands/split_element_command.cc b/third_party/blink/renderer/core/editing/commands/split_element_command.cc index e063bf5..9ae01d0c 100644 --- a/third_party/blink/renderer/core/editing/commands/split_element_command.cc +++ b/third_party/blink/renderer/core/editing/commands/split_element_command.cc
@@ -88,7 +88,7 @@ element2_->InsertBefore(child, ref_child, IGNORE_EXCEPTION_FOR_TESTING); // Recover the id attribute of the original element. - const AtomicString& id = element1_->getAttribute(html_names::kIdAttr); + const AtomicString& id = element1_->FastGetAttribute(html_names::kIdAttr); if (!id.IsNull()) element2_->setAttribute(html_names::kIdAttr, id);
diff --git a/third_party/blink/renderer/core/editing/editing_utilities.cc b/third_party/blink/renderer/core/editing/editing_utilities.cc index 749319e3b..8209bf7e 100644 --- a/third_party/blink/renderer/core/editing/editing_utilities.cc +++ b/third_party/blink/renderer/core/editing/editing_utilities.cc
@@ -411,8 +411,8 @@ } if (auto* element = DynamicTo<Element>(&node)) { - return EqualIgnoringASCIICase(element->getAttribute(html_names::kRoleAttr), - "textbox"); + return EqualIgnoringASCIICase( + element->FastGetAttribute(html_names::kRoleAttr), "textbox"); } return false; @@ -1716,7 +1716,7 @@ // TODO(editing-dev): This should probably be reconciled with // HitTestResult::absoluteImageURL. if (IsHTMLImageElement(node) || IsHTMLInputElement(node)) - return To<HTMLElement>(node).getAttribute(html_names::kSrcAttr); + return To<HTMLElement>(node).FastGetAttribute(html_names::kSrcAttr); if (IsSVGImageElement(node)) return To<SVGElement>(node).ImageSourceURL(); if (IsHTMLEmbedElement(node) || IsHTMLObjectElement(node) ||
diff --git a/third_party/blink/renderer/core/editing/ime/input_method_controller.cc b/third_party/blink/renderer/core/editing/ime/input_method_controller.cc index 69746ec..5931354 100644 --- a/third_party/blink/renderer/core/editing/ime/input_method_controller.cc +++ b/third_party/blink/renderer/core/editing/ime/input_method_controller.cc
@@ -1384,14 +1384,14 @@ int flags = 0; const AtomicString& autocomplete = - element->getAttribute(html_names::kAutocompleteAttr); + element->FastGetAttribute(html_names::kAutocompleteAttr); if (autocomplete == "on") flags |= kWebTextInputFlagAutocompleteOn; else if (autocomplete == "off") flags |= kWebTextInputFlagAutocompleteOff; const AtomicString& autocorrect = - element->getAttribute(html_names::kAutocorrectAttr); + element->FastGetAttribute(html_names::kAutocorrectAttr); if (autocorrect == "on") flags |= kWebTextInputFlagAutocorrectOn; else if (autocorrect == "off")
diff --git a/third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.cc b/third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.cc index b109157..2847f25e 100644 --- a/third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.cc +++ b/third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.cc
@@ -253,7 +253,8 @@ !fully_selected_root_style->Style() || !fully_selected_root_style->Style()->GetPropertyCSSValue( CSSPropertyID::kBackgroundImage)) && - fully_selected_root->hasAttribute(html_names::kBackgroundAttr)) { + fully_selected_root->FastHasAttribute( + html_names::kBackgroundAttr)) { fully_selected_root_style->Style()->SetProperty( CSSPropertyID::kBackgroundImage, "url('" +
diff --git a/third_party/blink/renderer/core/exported/web_element.cc b/third_party/blink/renderer/core/exported/web_element.cc index fa497af4..7f553330 100644 --- a/third_party/blink/renderer/core/exported/web_element.cc +++ b/third_party/blink/renderer/core/exported/web_element.cc
@@ -65,8 +65,8 @@ return true; } - return EqualIgnoringASCIICase(element->getAttribute(html_names::kRoleAttr), - "textbox"); + return EqualIgnoringASCIICase( + element->FastGetAttribute(html_names::kRoleAttr), "textbox"); } WebString WebElement::TagName() const {
diff --git a/third_party/blink/renderer/core/exported/web_language_detection_details.cc b/third_party/blink/renderer/core/exported/web_language_detection_details.cc index d54c9a2f..92959e0 100644 --- a/third_party/blink/renderer/core/exported/web_language_detection_details.cc +++ b/third_party/blink/renderer/core/exported/web_language_detection_details.cc
@@ -19,7 +19,7 @@ Element* html_element = document.documentElement(); if (!html_element) return g_null_atom; - return html_element->getAttribute(html_names::kLangAttr); + return html_element->FastGetAttribute(html_names::kLangAttr); } bool HasNoTranslate(const Document& document) { @@ -37,7 +37,7 @@ // Check if the tag contains content="notranslate" or value="notranslate" AtomicString content = meta_element.Content(); if (content.IsNull()) - content = meta_element.getAttribute(html_names::kValueAttr); + content = meta_element.FastGetAttribute(html_names::kValueAttr); if (EqualIgnoringASCIICase(content, "notranslate")) return true; }
diff --git a/third_party/blink/renderer/core/exported/web_searchable_form_data.cc b/third_party/blink/renderer/core/exported/web_searchable_form_data.cc index 45d8b42..d6b1a961 100644 --- a/third_party/blink/renderer/core/exported/web_searchable_form_data.cc +++ b/third_party/blink/renderer/core/exported/web_searchable_form_data.cc
@@ -224,7 +224,7 @@ // Only consider forms that GET data. if (EqualIgnoringASCIICase( - form_element->getAttribute(html_names::kMethodAttr), "post")) + form_element->FastGetAttribute(html_names::kMethodAttr), "post")) return; WTF::TextEncoding encoding;
diff --git a/third_party/blink/renderer/core/exported/web_settings_impl.cc b/third_party/blink/renderer/core/exported/web_settings_impl.cc index ef2e399..1b9d61ec 100644 --- a/third_party/blink/renderer/core/exported/web_settings_impl.cc +++ b/third_party/blink/renderer/core/exported/web_settings_impl.cc
@@ -462,7 +462,8 @@ } void WebSettingsImpl::SetMockScrollbarsEnabled(bool enabled) { - settings_->SetMockScrollbarsEnabled(enabled); + // TODO(wangxianzhu): Remove this function in crrev.com/c/1879706. + // settings_->SetMockScrollbarsEnabled(enabled); } void WebSettingsImpl::SetHideScrollbars(bool enabled) {
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc index f7d5a33e..123a391 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -2146,8 +2146,8 @@ return true; } - return EqualIgnoringASCIICase(element->getAttribute(html_names::kRoleAttr), - "textbox"); + return EqualIgnoringASCIICase( + element->FastGetAttribute(html_names::kRoleAttr), "textbox"); } bool WebViewImpl::ScrollFocusedEditableElementIntoView() {
diff --git a/third_party/blink/renderer/core/frame/frame_serializer.cc b/third_party/blink/renderer/core/frame/frame_serializer.cc index 29e96a7..94583a2 100644 --- a/third_party/blink/renderer/core/frame/frame_serializer.cc +++ b/third_party/blink/renderer/core/frame/frame_serializer.cc
@@ -394,7 +394,7 @@ // Otherwise, it is single <img> element. We should get image url // contained in href attribute. ImageSourceURL() may return a different // URL from srcset attribute. - image_url_value = image->getAttribute(html_names::kSrcAttr); + image_url_value = image->FastGetAttribute(html_names::kSrcAttr); } ImageResourceContent* cached_image = image->CachedImage(); AddImageToResources(cached_image, document.CompleteURL(image_url_value)); @@ -407,7 +407,7 @@ } else if (const auto* link = ToHTMLLinkElementOrNull(element)) { if (CSSStyleSheet* sheet = link->sheet()) { KURL sheet_url = - document.CompleteURL(link->getAttribute(html_names::kHrefAttr)); + document.CompleteURL(link->FastGetAttribute(html_names::kHrefAttr)); SerializeCSSStyleSheet(*sheet, sheet_url); } } else if (const auto* style = ToHTMLStyleElementOrNull(element)) {
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc index 25a20f4..9b6a568 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -1519,6 +1519,13 @@ if (!result.frame) return nullptr; + if (window_features.x_set || window_features.y_set) { + // This runs after FindOrCreateFrameForNavigation() so blocked popups are + // not counted. + UseCounter::Count(*active_document, + WebFeature::kDOMWindowOpenPositioningFeatures); + } + if (!completed_url.IsEmpty() || result.new_window) result.frame->Navigate(frame_request, WebFrameLoadType::kStandard);
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc index 01f692f..06f6b33d 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -1825,6 +1825,15 @@ NotifyUserActivation(false); } +void LocalFrame::AddMessageToConsole(mojom::blink::ConsoleMessageLevel level, + const WTF::String& message, + bool discard_duplicates) { + GetDocument()->AddConsoleMessage( + ConsoleMessage::Create(mojom::ConsoleMessageSource::kOther, level, + message), + discard_duplicates); +} + void LocalFrame::BindToReceiver( blink::LocalFrame* frame, mojo::PendingAssociatedReceiver<mojom::blink::LocalFrame> receiver) {
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h index 1e23e2c8..f8172703 100644 --- a/third_party/blink/renderer/core/frame/local_frame.h +++ b/third_party/blink/renderer/core/frame/local_frame.h
@@ -457,6 +457,9 @@ GetTextSurroundingSelectionCallback callback) final; void SendInterventionReport(const String& id, const String& message) final; void NotifyUserActivation() final; + void AddMessageToConsole(mojom::blink::ConsoleMessageLevel level, + const WTF::String& message, + bool discard_duplicates) final; private: friend class FrameNavigationDisabler;
diff --git a/third_party/blink/renderer/core/frame/remote_frame.cc b/third_party/blink/renderer/core/frame/remote_frame.cc index 06b3d14..fd6cc56 100644 --- a/third_party/blink/renderer/core/frame/remote_frame.cc +++ b/third_party/blink/renderer/core/frame/remote_frame.cc
@@ -256,6 +256,11 @@ GetSecurityContext()->ResetReplicatedContentSecurityPolicy(); } +void RemoteFrame::EnforceInsecureNavigationsSet( + const WTF::Vector<uint32_t>& set) { + GetSecurityContext()->SetInsecureNavigationsSet(set); +} + bool RemoteFrame::IsIgnoredForHitTest() const { HTMLFrameOwnerElement* owner = DeprecatedLocalOwner(); if (!owner || !owner->GetLayoutObject())
diff --git a/third_party/blink/renderer/core/frame/remote_frame.h b/third_party/blink/renderer/core/frame/remote_frame.h index c37144b..49317063 100644 --- a/third_party/blink/renderer/core/frame/remote_frame.h +++ b/third_party/blink/renderer/core/frame/remote_frame.h
@@ -76,6 +76,7 @@ // blink::mojom::LocalFrame overrides: void WillEnterFullscreen() override; void ResetReplicatedContentSecurityPolicy() override; + void EnforceInsecureNavigationsSet(const WTF::Vector<uint32_t>& set) override; private: // Frame protected overrides:
diff --git a/third_party/blink/renderer/core/frame/window.idl b/third_party/blink/renderer/core/frame/window.idl index 7805477..dfe1bbfc 100644 --- a/third_party/blink/renderer/core/frame/window.idl +++ b/third_party/blink/renderer/core/frame/window.idl
@@ -121,10 +121,10 @@ [SameObject, Replaceable] readonly attribute Screen screen; // browsing context - void moveTo(long x, long y); - void moveBy(long x, long y); - void resizeTo(long x, long y); - void resizeBy(long x, long y); + [MeasureAs=WindowMove] void moveTo(long x, long y); + [MeasureAs=WindowMove] void moveBy(long x, long y); + [MeasureAs=WindowResize] void resizeTo(long x, long y); + [MeasureAs=WindowResize] void resizeBy(long x, long y); // viewport [Affects=Nothing, HighEntropy, MeasureAs=WindowInnerWidth, Replaceable] readonly attribute long innerWidth;
diff --git a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc index fd0f919..61e63d3 100644 --- a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc +++ b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
@@ -550,14 +550,14 @@ bool had_resource_provider = HasResourceProvider(); unsigned w = 0; - AtomicString value = getAttribute(html_names::kWidthAttr); + AtomicString value = FastGetAttribute(html_names::kWidthAttr); if (value.IsEmpty() || !ParseHTMLNonNegativeInteger(value, w) || w > 0x7fffffffu) { w = kDefaultCanvasWidth; } unsigned h = 0; - value = getAttribute(html_names::kHeightAttr); + value = FastGetAttribute(html_names::kHeightAttr); if (value.IsEmpty() || !ParseHTMLNonNegativeInteger(value, h) || h > 0x7fffffffu) { h = kDefaultCanvasHeight;
diff --git a/third_party/blink/renderer/core/html/forms/html_button_element.cc b/third_party/blink/renderer/core/html/forms/html_button_element.cc index 0235d96..bcaf2ff 100644 --- a/third_party/blink/renderer/core/html/forms/html_button_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_button_element.cc
@@ -191,7 +191,7 @@ } const AtomicString& HTMLButtonElement::Value() const { - return getAttribute(html_names::kValueAttr); + return FastGetAttribute(html_names::kValueAttr); } bool HTMLButtonElement::RecalcWillValidate() const {
diff --git a/third_party/blink/renderer/core/html/forms/html_input_element.cc b/third_party/blink/renderer/core/html/forms/html_input_element.cc index 13e9a35..17d8a85 100644 --- a/third_party/blink/renderer/core/html/forms/html_input_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_input_element.cc
@@ -875,7 +875,7 @@ DCHECK(input_type_view_); TextControlElement::FinishParsingChildren(); if (!state_restored_) { - bool checked = hasAttribute(html_names::kCheckedAttr); + bool checked = FastHasAttribute(html_names::kCheckedAttr); if (checked) setChecked(checked); dirty_checkedness_ = false; @@ -950,7 +950,7 @@ SetNeedsValidityCheck(); } - setChecked(hasAttribute(html_names::kCheckedAttr)); + setChecked(FastHasAttribute(html_names::kCheckedAttr)); dirty_checkedness_ = false; }
diff --git a/third_party/blink/renderer/core/html/forms/html_label_element.cc b/third_party/blink/renderer/core/html/forms/html_label_element.cc index ef577b5..d7f564f 100644 --- a/third_party/blink/renderer/core/html/forms/html_label_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_label_element.cc
@@ -48,7 +48,7 @@ HTMLElement* HTMLLabelElement::control() const { // https://html.spec.whatwg.org/C/#labeled-control - const AtomicString& control_id = getAttribute(html_names::kForAttr); + const AtomicString& control_id = FastGetAttribute(html_names::kForAttr); if (control_id.IsNull()) { // "If the for attribute is not specified, but the label element has a // labelable element descendant, then the first such descendant in tree
diff --git a/third_party/blink/renderer/core/html/forms/html_opt_group_element.cc b/third_party/blink/renderer/core/html/forms/html_opt_group_element.cc index dccdeebc..3c09fa5 100644 --- a/third_party/blink/renderer/core/html/forms/html_opt_group_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_opt_group_element.cc
@@ -103,7 +103,7 @@ } String HTMLOptGroupElement::GroupLabelText() const { - String item_text = getAttribute(html_names::kLabelAttr); + String item_text = FastGetAttribute(html_names::kLabelAttr); // In WinIE, leading and trailing whitespace is ignored in options and // optgroups. We match this behavior.
diff --git a/third_party/blink/renderer/core/html/forms/html_output_element_test.cc b/third_party/blink/renderer/core/html/forms/html_output_element_test.cc index a57476a..bd7c8df 100644 --- a/third_party/blink/renderer/core/html/forms/html_output_element_test.cc +++ b/third_party/blink/renderer/core/html/forms/html_output_element_test.cc
@@ -16,9 +16,9 @@ setHTMLForProperty_updatesForAttribute) { auto* document = MakeGarbageCollected<Document>(); auto* element = MakeGarbageCollected<HTMLOutputElement>(*document); - EXPECT_EQ(g_null_atom, element->getAttribute(html_names::kForAttr)); + EXPECT_EQ(g_null_atom, element->FastGetAttribute(html_names::kForAttr)); element->htmlFor()->setValue(" strawberry "); - EXPECT_EQ(" strawberry ", element->getAttribute(html_names::kForAttr)); + EXPECT_EQ(" strawberry ", element->FastGetAttribute(html_names::kForAttr)); } TEST(HTMLOutputElementTest, setForAttribute_updatesHTMLForPropertyValue) {
diff --git a/third_party/blink/renderer/core/html/forms/password_input_type.cc b/third_party/blink/renderer/core/html/forms/password_input_type.cc index ee73bd12..171ce120 100644 --- a/third_party/blink/renderer/core/html/forms/password_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/password_input_type.cc
@@ -79,13 +79,13 @@ } bool PasswordInputType::NeedsContainer() const { - return RuntimeEnabledFeatures::FormControlsRefreshEnabled(); + return RuntimeEnabledFeatures::PasswordRevealEnabled(); } void PasswordInputType::CreateShadowSubtree() { BaseTextInputType::CreateShadowSubtree(); - if (RuntimeEnabledFeatures::FormControlsRefreshEnabled()) { + if (RuntimeEnabledFeatures::PasswordRevealEnabled()) { Element* container = ContainerElement(); Element* view_port = GetElement().UserAgentShadowRoot()->getElementById( shadow_element_names::EditingViewPort()); @@ -98,7 +98,7 @@ } void PasswordInputType::DidSetValueByUserEdit() { - if (RuntimeEnabledFeatures::FormControlsRefreshEnabled()) { + if (RuntimeEnabledFeatures::PasswordRevealEnabled()) { // If the last character is deleted, we hide the reveal button. if (GetElement().value().IsEmpty()) { should_show_reveal_button_ = false; @@ -109,7 +109,7 @@ } void PasswordInputType::DidSetValue(const String& string, bool value_changed) { - if (RuntimeEnabledFeatures::FormControlsRefreshEnabled()) { + if (RuntimeEnabledFeatures::PasswordRevealEnabled()) { if (value_changed) { // Hide the password if the value is changed by script. should_show_reveal_button_ = false; @@ -122,7 +122,7 @@ void PasswordInputType::UpdateView() { BaseTextInputType::UpdateView(); - if (RuntimeEnabledFeatures::FormControlsRefreshEnabled()) + if (RuntimeEnabledFeatures::PasswordRevealEnabled()) UpdatePasswordRevealButton(); } @@ -164,7 +164,7 @@ } void PasswordInputType::HandleBlurEvent() { - if (RuntimeEnabledFeatures::FormControlsRefreshEnabled()) { + if (RuntimeEnabledFeatures::PasswordRevealEnabled()) { should_show_reveal_button_ = false; UpdatePasswordRevealButton(); } @@ -174,7 +174,7 @@ void PasswordInputType::HandleBeforeTextInsertedEvent( BeforeTextInsertedEvent& event) { - if (RuntimeEnabledFeatures::FormControlsRefreshEnabled()) { + if (RuntimeEnabledFeatures::PasswordRevealEnabled()) { // This is the only scenario we go from no reveal button to showing the // reveal button: the password is empty and we have some user input. if (GetElement().value().IsEmpty()) @@ -185,7 +185,7 @@ } void PasswordInputType::HandleKeydownEvent(KeyboardEvent& event) { - if (RuntimeEnabledFeatures::FormControlsRefreshEnabled()) { + if (RuntimeEnabledFeatures::PasswordRevealEnabled()) { if (should_show_reveal_button_) { // Alt-F8 to reveal/obscure password if (event.getModifierState("Alt") && event.key() == "F8") {
diff --git a/third_party/blink/renderer/core/html/forms/search_input_type.cc b/third_party/blink/renderer/core/html/forms/search_input_type.cc index 2330449..5b964f1 100644 --- a/third_party/blink/renderer/core/html/forms/search_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/search_input_type.cc
@@ -127,7 +127,7 @@ } bool SearchInputType::SearchEventsShouldBeDispatched() const { - return GetElement().hasAttribute(html_names::kIncrementalAttr); + return GetElement().FastHasAttribute(html_names::kIncrementalAttr); } void SearchInputType::DidSetValueByUserEdit() {
diff --git a/third_party/blink/renderer/core/html/html_anchor_element.cc b/third_party/blink/renderer/core/html/html_anchor_element.cc index b21fb6b..80dcbebf 100644 --- a/third_party/blink/renderer/core/html/html_anchor_element.cc +++ b/third_party/blink/renderer/core/html/html_anchor_element.cc
@@ -281,17 +281,17 @@ bool HTMLAnchorElement::draggable() const { // Should be draggable if we have an href attribute. - const AtomicString& value = getAttribute(html_names::kDraggableAttr); + const AtomicString& value = FastGetAttribute(html_names::kDraggableAttr); if (DeprecatedEqualIgnoringCase(value, "true")) return true; if (DeprecatedEqualIgnoringCase(value, "false")) return false; - return hasAttribute(html_names::kHrefAttr); + return FastHasAttribute(html_names::kHrefAttr); } KURL HTMLAnchorElement::Href() const { - return GetDocument().CompleteURL( - StripLeadingAndTrailingHTMLSpaces(getAttribute(html_names::kHrefAttr))); + return GetDocument().CompleteURL(StripLeadingAndTrailingHTMLSpaces( + FastGetAttribute(html_names::kHrefAttr))); } void HTMLAnchorElement::SetHref(const AtomicString& value) { @@ -307,7 +307,7 @@ } String HTMLAnchorElement::Input() const { - return getAttribute(html_names::kHrefAttr); + return FastGetAttribute(html_names::kHrefAttr); } void HTMLAnchorElement::SetInput(const String& value) { @@ -342,7 +342,7 @@ } void HTMLAnchorElement::SendPings(const KURL& destination_url) const { - const AtomicString& ping_value = getAttribute(html_names::kPingAttr); + const AtomicString& ping_value = FastGetAttribute(html_names::kPingAttr); if (ping_value.IsNull() || !GetDocument().GetSettings() || !GetDocument().GetSettings()->GetHyperlinkAuditingEnabled()) { return; @@ -397,7 +397,7 @@ ResourceRequest request(completed_url); network::mojom::ReferrerPolicy policy; - if (hasAttribute(html_names::kReferrerpolicyAttr) && + if (FastHasAttribute(html_names::kReferrerpolicyAttr) && SecurityPolicy::ReferrerPolicyFromString( FastGetAttribute(html_names::kReferrerpolicyAttr), kSupportReferrerPolicyLegacyKeywords, &policy) && @@ -409,7 +409,7 @@ // Ignore the download attribute if we either can't read the content, or // the event is an alt-click or similar. - if (hasAttribute(html_names::kDownloadAttr) && + if (FastHasAttribute(html_names::kDownloadAttr) && NavigationPolicyFromEvent(&event) != kNavigationPolicyDownload && GetDocument().GetSecurityOrigin()->CanReadContent(completed_url)) { if (ShouldInterveneDownloadByFramePolicy(frame)) @@ -425,7 +425,7 @@ request.SetRequestContext(mojom::RequestContextType::HYPERLINK); request.SetHasUserGesture(LocalFrame::HasTransientUserActivation(frame)); - const AtomicString& target = getAttribute(html_names::kTargetAttr); + const AtomicString& target = FastGetAttribute(html_names::kTargetAttr); FrameLoadRequest frame_request(&GetDocument(), request); frame_request.SetNavigationPolicy(NavigationPolicyFromEvent(&event)); if (HasRel(kRelationNoReferrer)) { @@ -435,7 +435,7 @@ if (HasRel(kRelationNoOpener)) frame_request.SetNoOpener(); if (RuntimeEnabledFeatures::HrefTranslateEnabled(&GetDocument()) && - hasAttribute(html_names::kHreftranslateAttr)) { + FastHasAttribute(html_names::kHreftranslateAttr)) { frame_request.SetHrefTranslate( FastGetAttribute(html_names::kHreftranslateAttr)); UseCounter::Count(GetDocument(),
diff --git a/third_party/blink/renderer/core/html/html_element.cc b/third_party/blink/renderer/core/html/html_element.cc index 60f9407..f447738 100644 --- a/third_party/blink/renderer/core/html/html_element.cc +++ b/third_party/blink/renderer/core/html/html_element.cc
@@ -994,8 +994,8 @@ } bool HTMLElement::draggable() const { - return DeprecatedEqualIgnoringCase(getAttribute(html_names::kDraggableAttr), - "true"); + return DeprecatedEqualIgnoringCase( + FastGetAttribute(html_names::kDraggableAttr), "true"); } void HTMLElement::setDraggable(bool value) { @@ -1038,7 +1038,7 @@ } TranslateAttributeMode HTMLElement::GetTranslateAttributeMode() const { - const AtomicString& value = getAttribute(html_names::kTranslateAttr); + const AtomicString& value = FastGetAttribute(html_names::kTranslateAttr); if (value == g_null_atom) return kTranslateAttributeInherit; @@ -1104,7 +1104,7 @@ static inline bool ElementAffectsDirectionality(const Node* node) { auto* html_element = DynamicTo<HTMLElement>(node); return html_element && (IsHTMLBDIElement(*html_element) || - html_element->hasAttribute(html_names::kDirAttr)); + html_element->FastHasAttribute(html_names::kDirAttr)); } void HTMLElement::ChildrenChanged(const ChildrenChange& change) {
diff --git a/third_party/blink/renderer/core/html/html_frame_element.cc b/third_party/blink/renderer/core/html/html_frame_element.cc index 50ac0ba..ca50bff 100644 --- a/third_party/blink/renderer/core/html/html_frame_element.cc +++ b/third_party/blink/renderer/core/html/html_frame_element.cc
@@ -47,7 +47,7 @@ } bool HTMLFrameElement::NoResize() const { - return hasAttribute(html_names::kNoresizeAttr); + return FastHasAttribute(html_names::kNoresizeAttr); } void HTMLFrameElement::AttachLayoutTree(AttachContext& context) {
diff --git a/third_party/blink/renderer/core/html/html_frame_owner_element.h b/third_party/blink/renderer/core/html/html_frame_owner_element.h index 3d73041..aed28471 100644 --- a/third_party/blink/renderer/core/html/html_frame_owner_element.h +++ b/third_party/blink/renderer/core/html/html_frame_owner_element.h
@@ -105,7 +105,7 @@ void IntrinsicSizingInfoChanged() override {} void SetNeedsOcclusionTracking(bool) override {} AtomicString BrowsingContextContainerName() const override { - return getAttribute(html_names::kNameAttr); + return FastGetAttribute(html_names::kNameAttr); } ScrollbarMode ScrollingMode() const override { return ScrollbarMode::kAuto; } int MarginWidth() const override { return -1; }
diff --git a/third_party/blink/renderer/core/html/html_hr_element.cc b/third_party/blink/renderer/core/html/html_hr_element.cc index 3547a8ac..27bbf88 100644 --- a/third_party/blink/renderer/core/html/html_hr_element.cc +++ b/third_party/blink/renderer/core/html/html_hr_element.cc
@@ -82,7 +82,7 @@ AddHTMLColorToStyle(style, CSSPropertyID::kBorderColor, value); AddHTMLColorToStyle(style, CSSPropertyID::kBackgroundColor, value); } else if (name == html_names::kNoshadeAttr) { - if (!hasAttribute(html_names::kColorAttr)) { + if (!FastHasAttribute(html_names::kColorAttr)) { AddPropertyToPresentationAttributeStyle( style, CSSPropertyID::kBorderStyle, CSSValueID::kSolid);
diff --git a/third_party/blink/renderer/core/html/html_image_element.cc b/third_party/blink/renderer/core/html/html_image_element.cc index 4d9859b..0e8937f4 100644 --- a/third_party/blink/renderer/core/html/html_image_element.cc +++ b/third_party/blink/renderer/core/html/html_image_element.cc
@@ -452,7 +452,7 @@ // check the attribute first for an explicit pixel value // TODO(cbiesinger): The attribute could be a float or percentage value... unsigned width = 0; - if (ParseHTMLNonNegativeInteger(getAttribute(html_names::kWidthAttr), + if (ParseHTMLNonNegativeInteger(FastGetAttribute(html_names::kWidthAttr), width)) return width; @@ -475,7 +475,7 @@ // check the attribute first for an explicit pixel value // TODO(cbiesinger): The attribute could be a float or percentage value... unsigned height = 0; - if (ParseHTMLNonNegativeInteger(getAttribute(html_names::kHeightAttr), + if (ParseHTMLNonNegativeInteger(FastGetAttribute(html_names::kHeightAttr), height)) return height; @@ -573,8 +573,8 @@ bool HTMLImageElement::draggable() const { // Image elements are draggable by default. - return !DeprecatedEqualIgnoringCase(getAttribute(html_names::kDraggableAttr), - "false"); + return !DeprecatedEqualIgnoringCase( + FastGetAttribute(html_names::kDraggableAttr), "false"); } void HTMLImageElement::setHeight(unsigned value) {
diff --git a/third_party/blink/renderer/core/html/html_image_fallback_helper.cc b/third_party/blink/renderer/core/html/html_image_fallback_helper.cc index b455f3b40..ca103c9 100644 --- a/third_party/blink/renderer/core/html/html_image_fallback_helper.cc +++ b/third_party/blink/renderer/core/html/html_image_fallback_helper.cc
@@ -22,7 +22,7 @@ namespace blink { static bool NoImageSourceSpecified(const Element& element) { - return element.getAttribute(html_names::kSrcAttr).IsEmpty(); + return element.FastGetAttribute(html_names::kSrcAttr).IsEmpty(); } static bool ElementRepresentsNothing(const Element& element) {
diff --git a/third_party/blink/renderer/core/html/html_link_element.cc b/third_party/blink/renderer/core/html/html_link_element.cc index 59c6354..6ab184b 100644 --- a/third_party/blink/renderer/core/html/html_link_element.cc +++ b/third_party/blink/renderer/core/html/html_link_element.cc
@@ -368,7 +368,7 @@ const QualifiedName& HTMLLinkElement::SubResourceAttributeName() const { // If the link element is not css, ignore it. - if (DeprecatedEqualIgnoringCase(getAttribute(html_names::kTypeAttr), + if (DeprecatedEqualIgnoringCase(FastGetAttribute(html_names::kTypeAttr), "text/css")) { // FIXME: Add support for extracting links of sub-resources which // are inside style-sheet such as @import, @font-face, url(), etc. @@ -378,18 +378,18 @@ } KURL HTMLLinkElement::Href() const { - const String& url = getAttribute(html_names::kHrefAttr); + const String& url = FastGetAttribute(html_names::kHrefAttr); if (url.IsEmpty()) return KURL(); return GetDocument().CompleteURL(url); } const AtomicString& HTMLLinkElement::Rel() const { - return getAttribute(html_names::kRelAttr); + return FastGetAttribute(html_names::kRelAttr); } const AtomicString& HTMLLinkElement::GetType() const { - return getAttribute(html_names::kTypeAttr); + return FastGetAttribute(html_names::kTypeAttr); } bool HTMLLinkElement::Async() const {
diff --git a/third_party/blink/renderer/core/html/html_link_element_sizes_attribute_test.cc b/third_party/blink/renderer/core/html/html_link_element_sizes_attribute_test.cc index 28e643f..d4b8216 100644 --- a/third_party/blink/renderer/core/html/html_link_element_sizes_attribute_test.cc +++ b/third_party/blink/renderer/core/html/html_link_element_sizes_attribute_test.cc
@@ -22,7 +22,7 @@ DOMTokenList* sizes = link->sizes(); EXPECT_EQ(g_null_atom, sizes->value()); sizes->setValue(" a b c "); - EXPECT_EQ(" a b c ", link->getAttribute(html_names::kSizesAttr)); + EXPECT_EQ(" a b c ", link->FastGetAttribute(html_names::kSizesAttr)); EXPECT_EQ(" a b c ", sizes->value()); }
diff --git a/third_party/blink/renderer/core/html/html_map_element.cc b/third_party/blink/renderer/core/html/html_map_element.cc index 330a1d6..5f9f55a17 100644 --- a/third_party/blink/renderer/core/html/html_map_element.cc +++ b/third_party/blink/renderer/core/html/html_map_element.cc
@@ -62,9 +62,10 @@ // The HTMLImageElement's useMap() value includes the '#' symbol at the // beginning, which has to be stripped off. HTMLImageElement& image_element = ToHTMLImageElement(*curr); - String use_map_name = image_element.getAttribute(html_names::kUsemapAttr) - .GetString() - .Substring(1); + String use_map_name = + image_element.FastGetAttribute(html_names::kUsemapAttr) + .GetString() + .Substring(1); if (use_map_name == name_) return &image_element; }
diff --git a/third_party/blink/renderer/core/html/html_meta_element.cc b/third_party/blink/renderer/core/html/html_meta_element.cc index 56df61e..91bc896 100644 --- a/third_party/blink/renderer/core/html/html_meta_element.cc +++ b/third_party/blink/renderer/core/html/html_meta_element.cc
@@ -595,11 +595,11 @@ } const AtomicString& HTMLMetaElement::Content() const { - return getAttribute(html_names::kContentAttr); + return FastGetAttribute(html_names::kContentAttr); } const AtomicString& HTMLMetaElement::HttpEquiv() const { - return getAttribute(html_names::kHttpEquivAttr); + return FastGetAttribute(html_names::kHttpEquivAttr); } const AtomicString& HTMLMetaElement::GetName() const {
diff --git a/third_party/blink/renderer/core/html/html_object_element.cc b/third_party/blink/renderer/core/html/html_object_element.cc index c5d7a49..6ef72ca 100644 --- a/third_party/blink/renderer/core/html/html_object_element.cc +++ b/third_party/blink/renderer/core/html/html_object_element.cc
@@ -330,7 +330,7 @@ } const AtomicString HTMLObjectElement::ImageSourceURL() const { - return getAttribute(html_names::kDataAttr); + return FastGetAttribute(html_names::kDataAttr); } void HTMLObjectElement::ReattachFallbackContent() { @@ -390,14 +390,14 @@ bool HTMLObjectElement::ContainsJavaApplet() const { if (MIMETypeRegistry::IsJavaAppletMIMEType( - getAttribute(html_names::kTypeAttr))) + FastGetAttribute(html_names::kTypeAttr))) return true; for (HTMLElement& child : Traversal<HTMLElement>::ChildrenOf(*this)) { if (IsHTMLParamElement(child) && DeprecatedEqualIgnoringCase(child.GetNameAttribute(), "type") && MIMETypeRegistry::IsJavaAppletMIMEType( - child.getAttribute(html_names::kValueAttr).GetString())) + child.FastGetAttribute(html_names::kValueAttr).GetString())) return true; if (IsHTMLObjectElement(child) && ToHTMLObjectElement(child).ContainsJavaApplet())
diff --git a/third_party/blink/renderer/core/html/html_script_element.cc b/third_party/blink/renderer/core/html/html_script_element.cc index 14e53c1..2422cba1 100644 --- a/third_party/blink/renderer/core/html/html_script_element.cc +++ b/third_party/blink/renderer/core/html/html_script_element.cc
@@ -158,19 +158,19 @@ } String HTMLScriptElement::SourceAttributeValue() const { - return getAttribute(html_names::kSrcAttr).GetString(); + return FastGetAttribute(html_names::kSrcAttr).GetString(); } String HTMLScriptElement::CharsetAttributeValue() const { - return getAttribute(html_names::kCharsetAttr).GetString(); + return FastGetAttribute(html_names::kCharsetAttr).GetString(); } String HTMLScriptElement::TypeAttributeValue() const { - return getAttribute(html_names::kTypeAttr).GetString(); + return FastGetAttribute(html_names::kTypeAttr).GetString(); } String HTMLScriptElement::LanguageAttributeValue() const { - return getAttribute(html_names::kLanguageAttr).GetString(); + return FastGetAttribute(html_names::kLanguageAttr).GetString(); } bool HTMLScriptElement::NomoduleAttributeValue() const { @@ -178,27 +178,27 @@ } String HTMLScriptElement::ForAttributeValue() const { - return getAttribute(html_names::kForAttr).GetString(); + return FastGetAttribute(html_names::kForAttr).GetString(); } String HTMLScriptElement::EventAttributeValue() const { - return getAttribute(html_names::kEventAttr).GetString(); + return FastGetAttribute(html_names::kEventAttr).GetString(); } String HTMLScriptElement::CrossOriginAttributeValue() const { - return getAttribute(html_names::kCrossoriginAttr); + return FastGetAttribute(html_names::kCrossoriginAttr); } String HTMLScriptElement::IntegrityAttributeValue() const { - return getAttribute(html_names::kIntegrityAttr); + return FastGetAttribute(html_names::kIntegrityAttr); } String HTMLScriptElement::ReferrerPolicyAttributeValue() const { - return getAttribute(html_names::kReferrerpolicyAttr); + return FastGetAttribute(html_names::kReferrerpolicyAttr); } String HTMLScriptElement::ImportanceAttributeValue() const { - return getAttribute(html_names::kImportanceAttr); + return FastGetAttribute(html_names::kImportanceAttr); } String HTMLScriptElement::TextFromChildren() {
diff --git a/third_party/blink/renderer/core/html/html_source_element.cc b/third_party/blink/renderer/core/html/html_source_element.cc index eb15428..5131ef0 100644 --- a/third_party/blink/renderer/core/html/html_source_element.cc +++ b/third_party/blink/renderer/core/html/html_source_element.cc
@@ -126,7 +126,7 @@ } const AtomicString& HTMLSourceElement::type() const { - return getAttribute(html_names::kTypeAttr); + return FastGetAttribute(html_names::kTypeAttr); } void HTMLSourceElement::setType(const AtomicString& type) {
diff --git a/third_party/blink/renderer/core/html/html_style_element.cc b/third_party/blink/renderer/core/html/html_style_element.cc index e57b102..7810f7a 100644 --- a/third_party/blink/renderer/core/html/html_style_element.cc +++ b/third_party/blink/renderer/core/html/html_style_element.cc
@@ -95,11 +95,11 @@ } const AtomicString& HTMLStyleElement::media() const { - return getAttribute(html_names::kMediaAttr); + return FastGetAttribute(html_names::kMediaAttr); } const AtomicString& HTMLStyleElement::type() const { - return getAttribute(html_names::kTypeAttr); + return FastGetAttribute(html_names::kTypeAttr); } void HTMLStyleElement::DispatchPendingEvent(
diff --git a/third_party/blink/renderer/core/html/html_table_col_element.cc b/third_party/blink/renderer/core/html/html_table_col_element.cc index 439dbe1..bab11e6 100644 --- a/third_party/blink/renderer/core/html/html_table_col_element.cc +++ b/third_party/blink/renderer/core/html/html_table_col_element.cc
@@ -98,7 +98,7 @@ } const AtomicString& HTMLTableColElement::Width() const { - return getAttribute(html_names::kWidthAttr); + return FastGetAttribute(html_names::kWidthAttr); } } // namespace blink
diff --git a/third_party/blink/renderer/core/html/html_table_element.cc b/third_party/blink/renderer/core/html/html_table_element.cc index 9948367..b4575fe 100644 --- a/third_party/blink/renderer/core/html/html_table_element.cc +++ b/third_party/blink/renderer/core/html/html_table_element.cc
@@ -626,11 +626,11 @@ } const AtomicString& HTMLTableElement::Rules() const { - return getAttribute(html_names::kRulesAttr); + return FastGetAttribute(html_names::kRulesAttr); } const AtomicString& HTMLTableElement::Summary() const { - return getAttribute(html_names::kSummaryAttr); + return FastGetAttribute(html_names::kSummaryAttr); } void HTMLTableElement::Trace(Visitor* visitor) {
diff --git a/third_party/blink/renderer/core/html/link_resource.cc b/third_party/blink/renderer/core/html/link_resource.cc index 468226f..ae57f6f 100644 --- a/third_party/blink/renderer/core/html/link_resource.cc +++ b/third_party/blink/renderer/core/html/link_resource.cc
@@ -59,7 +59,7 @@ } WTF::TextEncoding LinkResource::GetCharset() const { - AtomicString charset = owner_->getAttribute(html_names::kCharsetAttr); + AtomicString charset = owner_->FastGetAttribute(html_names::kCharsetAttr); if (charset.IsEmpty() && GetDocument().GetFrame()) return GetDocument().Encoding(); return WTF::TextEncoding(charset);
diff --git a/third_party/blink/renderer/core/html/media/html_media_element.cc b/third_party/blink/renderer/core/html/media/html_media_element.cc index 7d882d5e..40a63b8 100644 --- a/third_party/blink/renderer/core/html/media/html_media_element.cc +++ b/third_party/blink/renderer/core/html/media/html_media_element.cc
@@ -691,7 +691,7 @@ HTMLElement::InsertedInto(insertion_point); if (insertion_point.isConnected()) { UseCounter::Count(GetDocument(), WebFeature::kHTMLMediaElementInDocument); - if ((!getAttribute(html_names::kSrcAttr).IsEmpty() || src_object_) && + if ((!FastGetAttribute(html_names::kSrcAttr).IsEmpty() || src_object_) && network_state_ == kNetworkEmpty) { ignore_preload_none_ = false; InvokeLoadAlgorithm();
diff --git a/third_party/blink/renderer/core/html/media/html_video_element.cc b/third_party/blink/renderer/core/html/media/html_video_element.cc index 8e148ab..773c9e9 100644 --- a/third_party/blink/renderer/core/html/media/html_video_element.cc +++ b/third_party/blink/renderer/core/html/media/html_video_element.cc
@@ -267,7 +267,7 @@ } const AtomicString HTMLVideoElement::ImageSourceURL() const { - const AtomicString& url = getAttribute(html_names::kPosterAttr); + const AtomicString& url = FastGetAttribute(html_names::kPosterAttr); if (!StripLeadingAndTrailingHTMLSpaces(url).IsEmpty()) return url; return default_poster_url_;
diff --git a/third_party/blink/renderer/core/html/media/media_remoting_interstitial.cc b/third_party/blink/renderer/core/html/media/media_remoting_interstitial.cc index d255d1bd..0024ef5 100644 --- a/third_party/blink/renderer/core/html/media/media_remoting_interstitial.cc +++ b/third_party/blink/renderer/core/html/media/media_remoting_interstitial.cc
@@ -39,7 +39,8 @@ background_image_->SetShadowPseudoId( AtomicString("-internal-media-interstitial-background-image")); background_image_->setAttribute( - html_names::kSrcAttr, videoElement.getAttribute(html_names::kPosterAttr)); + html_names::kSrcAttr, + videoElement.FastGetAttribute(html_names::kPosterAttr)); AppendChild(background_image_); cast_icon_ = MakeGarbageCollected<HTMLDivElement>(GetDocument()); @@ -150,7 +151,7 @@ void MediaRemotingInterstitial::OnPosterImageChanged() { background_image_->setAttribute( html_names::kSrcAttr, - GetVideoElement().getAttribute(html_names::kPosterAttr)); + GetVideoElement().FastGetAttribute(html_names::kPosterAttr)); } void MediaRemotingInterstitial::Trace(Visitor* visitor) {
diff --git a/third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.cc b/third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.cc index e9541ec..3bee9fc 100644 --- a/third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.cc +++ b/third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.cc
@@ -73,7 +73,8 @@ background_image_->SetShadowPseudoId( AtomicString("-internal-media-interstitial-background-image")); background_image_->setAttribute( - html_names::kSrcAttr, videoElement.getAttribute(html_names::kPosterAttr)); + html_names::kSrcAttr, + videoElement.FastGetAttribute(html_names::kPosterAttr)); ParserAppendChild(background_image_); message_element_ = MakeGarbageCollected<HTMLDivElement>(GetDocument()); @@ -169,7 +170,7 @@ void PictureInPictureInterstitial::OnPosterImageChanged() { background_image_->setAttribute( html_names::kSrcAttr, - GetVideoElement().getAttribute(html_names::kPosterAttr)); + GetVideoElement().FastGetAttribute(html_names::kPosterAttr)); } void PictureInPictureInterstitial::Trace(Visitor* visitor) {
diff --git a/third_party/blink/renderer/core/inspector/inspector_page_agent.cc b/third_party/blink/renderer/core/inspector/inspector_page_agent.cc index 1cd4296..402d848 100644 --- a/third_party/blink/renderer/core/inspector/inspector_page_agent.cc +++ b/third_party/blink/renderer/core/inspector/inspector_page_agent.cc
@@ -1046,8 +1046,10 @@ if (parent_frame) { frame_object->setParentId(IdentifiersFactory::FrameId(parent_frame)); AtomicString name = frame->Tree().GetName(); - if (name.IsEmpty() && frame->DeprecatedLocalOwner()) - name = frame->DeprecatedLocalOwner()->getAttribute(html_names::kIdAttr); + if (name.IsEmpty() && frame->DeprecatedLocalOwner()) { + name = + frame->DeprecatedLocalOwner()->FastGetAttribute(html_names::kIdAttr); + } frame_object->setName(name); } if (loader && !loader->UnreachableURL().IsEmpty())
diff --git a/third_party/blink/renderer/core/layout/hit_test_result.cc b/third_party/blink/renderer/core/layout/hit_test_result.cc index c13d2ddd..0de6c15 100644 --- a/third_party/blink/renderer/core/layout/hit_test_result.cc +++ b/third_party/blink/renderer/core/layout/hit_test_result.cc
@@ -291,7 +291,7 @@ return g_null_atom; if (auto* image = ToHTMLImageElementOrNull(*inner_node_or_image_map_image)) - return image->getAttribute(html_names::kAltAttr); + return image->FastGetAttribute(html_names::kAltAttr); if (auto* input = ToHTMLInputElementOrNull(*inner_node_or_image_map_image)) return input->Alt();
diff --git a/third_party/blink/renderer/core/layout/layout_details_marker.cc b/third_party/blink/renderer/core/layout/layout_details_marker.cc index 9b6e044..3bbce5a 100644 --- a/third_party/blink/renderer/core/layout/layout_details_marker.cc +++ b/third_party/blink/renderer/core/layout/layout_details_marker.cc
@@ -55,8 +55,11 @@ const auto* node = layout_object->GetNode(); if (!node) continue; - if (IsHTMLDetailsElement(*node)) - return !To<Element>(node)->getAttribute(html_names::kOpenAttr).IsNull(); + if (IsHTMLDetailsElement(*node)) { + return !To<Element>(node) + ->FastGetAttribute(html_names::kOpenAttr) + .IsNull(); + } if (IsHTMLInputElement(*node)) return true; }
diff --git a/third_party/blink/renderer/core/layout/layout_table_cell.cc b/third_party/blink/renderer/core/layout/layout_table_cell.cc index fd11296..02b873d3 100644 --- a/third_party/blink/renderer/core/layout/layout_table_cell.cc +++ b/third_party/blink/renderer/core/layout/layout_table_cell.cc
@@ -201,7 +201,7 @@ // See if nowrap was set. Length w = StyleOrColLogicalWidth(); const AtomicString& nowrap = - To<Element>(GetNode())->getAttribute(html_names::kNowrapAttr); + To<Element>(GetNode())->FastGetAttribute(html_names::kNowrapAttr); if (!nowrap.IsNull() && w.IsFixed()) { // Nowrap is set, but we didn't actually use it because of the fixed width // set on the cell. Even so, it is a WinIE/Moz trait to make the minwidth
diff --git a/third_party/blink/renderer/core/layout/layout_theme.cc b/third_party/blink/renderer/core/layout/layout_theme.cc index d48db917..336c53d 100644 --- a/third_party/blink/renderer/core/layout/layout_theme.cc +++ b/third_party/blink/renderer/core/layout/layout_theme.cc
@@ -735,6 +735,8 @@ return 0xFFFFFFFF; case CSSValueID::kActivecaption: return 0xFFCCCCCC; + case CSSValueID::kActivetext: + return 0xFFFF0000; case CSSValueID::kAppworkspace: return color_scheme == WebColorScheme::kDark ? 0xFF000000 : 0xFFFFFFFF; case CSSValueID::kBackground: @@ -749,6 +751,10 @@ return color_scheme == WebColorScheme::kDark ? 0xFFFFFFFF : 0xFF000000; case CSSValueID::kCaptiontext: return color_scheme == WebColorScheme::kDark ? 0xFFFFFFFF : 0xFF000000; + case CSSValueID::kField: + return color_scheme == WebColorScheme::kDark ? 0xFF000000 : 0xFFFFFFFF; + case CSSValueID::kFieldtext: + return color_scheme == WebColorScheme::kDark ? 0xFFFFFFFF : 0xFF000000; case CSSValueID::kGraytext: return 0xFF808080; case CSSValueID::kHighlight:
diff --git a/third_party/blink/renderer/core/layout/layout_theme_mac.mm b/third_party/blink/renderer/core/layout/layout_theme_mac.mm index c51e536..a8acb03 100644 --- a/third_party/blink/renderer/core/layout/layout_theme_mac.mm +++ b/third_party/blink/renderer/core/layout/layout_theme_mac.mm
@@ -379,6 +379,12 @@ case CSSValueID::kCaptiontext: color = GetSystemColor(MacSystemColorID::kText); break; + case CSSValueID::kField: + color = GetSystemColor(MacSystemColorID::kControlBackground); + break; + case CSSValueID::kFieldtext: + color = GetSystemColor(MacSystemColorID::kText); + break; case CSSValueID::kGraytext: color = GetSystemColor(MacSystemColorID::kDisabledControlText); break;
diff --git a/third_party/blink/renderer/core/layout/layout_theme_win.cc b/third_party/blink/renderer/core/layout/layout_theme_win.cc index 3e4d9f02..20d051d 100644 --- a/third_party/blink/renderer/core/layout/layout_theme_win.cc +++ b/third_party/blink/renderer/core/layout/layout_theme_win.cc
@@ -28,6 +28,11 @@ blink::WebThemeEngine::SystemThemeColor theme_color; switch (css_value_id) { + case CSSValueID::kActivetext: + case CSSValueID::kLinktext: + case CSSValueID::kVisitedtext: + theme_color = blink::WebThemeEngine::SystemThemeColor::kHotlight; + break; case CSSValueID::kButtonface: theme_color = blink::WebThemeEngine::SystemThemeColor::kButtonFace; break; @@ -43,14 +48,12 @@ case CSSValueID::kHighlighttext: theme_color = blink::WebThemeEngine::SystemThemeColor::kHighlightText; break; - case CSSValueID::kLinktext: - case CSSValueID::kVisitedtext: - theme_color = blink::WebThemeEngine::SystemThemeColor::kHotlight; - break; case CSSValueID::kWindow: + case CSSValueID::kField: theme_color = blink::WebThemeEngine::SystemThemeColor::kWindow; break; case CSSValueID::kWindowtext: + case CSSValueID::kFieldtext: theme_color = blink::WebThemeEngine::SystemThemeColor::kWindowText; break; default:
diff --git a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc index 07cd3576..d1b68e19 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
@@ -238,7 +238,28 @@ info.phase = PaintPhase::kDescendantOutlinesOnly; } else if (ShouldPaintSelfBlockBackground(original_phase)) { info.phase = PaintPhase::kSelfBlockBackgroundOnly; - PaintObject(info, paint_offset); + // With CompositeAfterPaint we need to call PaintObject twice: once for the + // background painting that does not scroll, and a second time for the + // background painting that scrolls. + // Without CompositeAfterPaint, this happens as the main graphics layer + // paints the background, and then the scrolling contents graphics layer + // paints the background. + if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { + auto paint_location = ToLayoutBox(*box_fragment_.GetLayoutObject()) + .GetBackgroundPaintLocation(); + if (!(paint_location & kBackgroundPaintInGraphicsLayer)) + info.SetSkipsBackground(true); + PaintObject(info, paint_offset); + info.SetSkipsBackground(false); + + if (paint_location & kBackgroundPaintInScrollingContents) { + info.SetIsPaintingScrollingBackground(true); + PaintObject(info, paint_offset); + info.SetIsPaintingScrollingBackground(false); + } + } else { + PaintObject(info, paint_offset); + } if (ShouldPaintDescendantBlockBackgrounds(original_phase)) info.phase = PaintPhase::kDescendantBlockBackgroundsOnly; } @@ -1213,6 +1234,9 @@ bool NGBoxFragmentPainter::IsPaintingScrollingBackground( const PaintInfo& paint_info) { + if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) + return paint_info.IsPaintingScrollingBackground(); + // TODO(layout-dev): Change paint_info.PaintContainer to accept fragments // once LayoutNG supports scrolling containers. return paint_info.PaintFlags() & kPaintLayerPaintingOverflowContents &&
diff --git a/third_party/blink/renderer/core/scroll/scrollbar_theme_aura.cc b/third_party/blink/renderer/core/scroll/scrollbar_theme_aura.cc index f4f516994..e228257 100644 --- a/third_party/blink/renderer/core/scroll/scrollbar_theme_aura.cc +++ b/third_party/blink/renderer/core/scroll/scrollbar_theme_aura.cc
@@ -49,9 +49,12 @@ namespace { -static bool UseMockTheme() { - return WebTestSupport::IsRunningWebTest(); -} +// Use fixed scrollbar thickness for web_tests because many tests are +// expecting that. Rebaselining is relatively easy for platform differences, +// but tens of testharness tests will fail without this on Windows. +// TODO(crbug.com/953847): Adapt testharness tests to native themes and remove +// this. +constexpr int kScrollbarThicknessForWebTests = 15; // Contains a flag indicating whether WebThemeEngine should paint a UI widget // for a scrollbar part, and if so, what part and state apply. @@ -93,8 +96,6 @@ if (part == kBackButtonStartPart) { paint_part = WebThemeEngine::kPartScrollbarLeftArrow; check_min = true; - } else if (UseMockTheme() && part != kForwardButtonEndPart) { - return PartPaintingParams(); } else { paint_part = WebThemeEngine::kPartScrollbarRightArrow; check_max = true; @@ -103,19 +104,14 @@ if (part == kBackButtonStartPart) { paint_part = WebThemeEngine::kPartScrollbarUpArrow; check_min = true; - } else if (UseMockTheme() && part != kForwardButtonEndPart) { - return PartPaintingParams(); } else { paint_part = WebThemeEngine::kPartScrollbarDownArrow; check_max = true; } } - if (UseMockTheme() && !scrollbar.Enabled()) { - state = WebThemeEngine::kStateDisabled; - } else if (!UseMockTheme() && - ((check_min && (position <= 0)) || - (check_max && position >= scrollbar.Maximum()))) { + if ((check_min && (position <= 0)) || + (check_max && position >= scrollbar.Maximum())) { state = WebThemeEngine::kStateDisabled; } else { if (part == scrollbar.PressedPart()) @@ -160,11 +156,10 @@ } int ScrollbarThemeAura::ScrollbarThickness(ScrollbarControlSize control_size) { + if (WebTestSupport::IsRunningWebTest()) + return kScrollbarThicknessForWebTests; + // Horiz and Vert scrollbars are the same thickness. - // In unit tests we don't have the mock theme engine (because of layering - // violations), so we hard code the size (see bug 327470). - if (UseMockTheme()) - return 15; IntSize scrollbar_size = Platform::Current()->ThemeEngine()->GetSize( WebThemeEngine::kPartScrollbarVerticalTrack); return scrollbar_size.Width(); @@ -250,9 +245,6 @@ ? WebThemeEngine::kStateHover : WebThemeEngine::kStateNormal; - if (UseMockTheme() && !scrollbar.Enabled()) - state = WebThemeEngine::kStateDisabled; - IntRect align_rect = TrackRect(scrollbar); WebThemeEngine::ExtraParams extra_params; extra_params.scrollbar_track.is_back = (part_type == kBackTrackPart);
diff --git a/third_party/blink/renderer/core/svg/properties/svg_property.h b/third_party/blink/renderer/core/svg/properties/svg_property.h index 00a712e..55a0f2ea 100644 --- a/third_party/blink/renderer/core/svg/properties/svg_property.h +++ b/third_party/blink/renderer/core/svg/properties/svg_property.h
@@ -65,7 +65,7 @@ // WebAnimations transition. virtual void Add(SVGPropertyBase*, SVGElement*) = 0; virtual void CalculateAnimatedValue( - SVGAnimationElement*, + const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_angle.cc b/third_party/blink/renderer/core/svg/svg_angle.cc index ea00e69..0f70fba 100644 --- a/third_party/blink/renderer/core/svg/svg_angle.cc +++ b/third_party/blink/renderer/core/svg/svg_angle.cc
@@ -63,7 +63,7 @@ } void SVGMarkerOrientEnumeration::CalculateAnimatedValue( - SVGAnimationElement*, + const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from, @@ -381,15 +381,15 @@ orient_type_->SetEnumValue(other_orient_type); } -void SVGAngle::CalculateAnimatedValue(SVGAnimationElement* animation_element, - float percentage, - unsigned repeat_count, - SVGPropertyBase* from, - SVGPropertyBase* to, - SVGPropertyBase* to_at_end_of_duration, - SVGElement*) { - DCHECK(animation_element); - bool is_to_animation = animation_element->GetAnimationMode() == kToAnimation; +void SVGAngle::CalculateAnimatedValue( + const SVGAnimationElement& animation_element, + float percentage, + unsigned repeat_count, + SVGPropertyBase* from, + SVGPropertyBase* to, + SVGPropertyBase* to_at_end_of_duration, + SVGElement*) { + bool is_to_animation = animation_element.GetAnimationMode() == kToAnimation; SVGAngle* from_angle = is_to_animation ? this : ToSVGAngle(from); SVGAngle* to_angle = ToSVGAngle(to); @@ -415,7 +415,7 @@ float animated_value = Value(); SVGAngle* to_at_end_of_duration_angle = ToSVGAngle(to_at_end_of_duration); - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, from_angle->Value(), to_angle->Value(), to_at_end_of_duration_angle->Value(), animated_value); OrientType()->SetEnumValue(kSVGMarkerOrientAngle);
diff --git a/third_party/blink/renderer/core/svg/svg_angle.h b/third_party/blink/renderer/core/svg/svg_angle.h index 04c0617..94e8735 100644 --- a/third_party/blink/renderer/core/svg/svg_angle.h +++ b/third_party/blink/renderer/core/svg/svg_angle.h
@@ -47,7 +47,7 @@ ~SVGMarkerOrientEnumeration() override; void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float, unsigned, SVGPropertyBase*, @@ -118,7 +118,7 @@ SVGParsingError SetValueAsString(const String&); void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_animate_element.cc b/third_party/blink/renderer/core/svg/svg_animate_element.cc index e73be4a..9ef53a3 100644 --- a/third_party/blink/renderer/core/svg/svg_animate_element.cc +++ b/third_party/blink/renderer/core/svg/svg_animate_element.cc
@@ -326,9 +326,21 @@ return CreatePropertyForAnimation(value); } -void SVGAnimateElement::CalculateAnimatedValue(float percentage, - unsigned repeat_count, - SVGSMILElement* result_element) { +static SVGPropertyBase* DiscreteSelectValue(AnimationMode animation_mode, + float percentage, + SVGPropertyBase* from, + SVGPropertyBase* to) { + if ((animation_mode == kFromToAnimation && percentage > 0.5) || + animation_mode == kToAnimation || percentage == 1) { + return to; + } + return from; +} + +void SVGAnimateElement::CalculateAnimatedValue( + float percentage, + unsigned repeat_count, + SVGSMILElement* result_element) const { DCHECK(result_element); DCHECK(targetElement()); if (!IsSVGAnimateElement(*result_element)) @@ -369,8 +381,16 @@ from_value = AdjustForInheritance(from_value, from_property_value_type_); to_value = AdjustForInheritance(to_value, to_property_value_type_); + // If the animated type can only be animated discretely, then do that here, + // replacing |result_element|s animated value. + if (!AnimatedPropertyTypeSupportsAddition()) { + result_animation_element->animated_value_ = DiscreteSelectValue( + GetAnimationMode(), percentage, from_value, to_value); + return; + } + animated_value->CalculateAnimatedValue( - this, percentage, repeat_count, from_value, to_value, + *this, percentage, repeat_count, from_value, to_value, to_at_end_of_duration_value, target_element); } @@ -424,7 +444,6 @@ // SVG DOM animVal animation code-path. animated_value_ = target_property_->CreateAnimatedValue(); DCHECK_EQ(animated_value_->GetType(), type_); - target_element->SetAnimatedAttribute(AttributeName(), animated_value_); return; } DCHECK(IsAnimatingCSSProperty()); @@ -448,8 +467,8 @@ } bool should_apply = ShouldApplyAnimation(*target_element); + // CSS properties animation code-path. if (IsAnimatingCSSProperty()) { - // CSS properties animation code-path. if (should_apply) { MutableCSSPropertyValueSet* property_set = target_element->EnsureAnimatedSMILStyleProperties(); @@ -460,12 +479,9 @@ } } } - if (IsAnimatingSVGDom()) { - // SVG DOM animVal animation code-path. + // SVG DOM animVal animation code-path. + if (IsAnimatingSVGDom()) target_element->ClearAnimatedAttribute(AttributeName()); - if (should_apply) - target_element->InvalidateAnimatedAttribute(AttributeName()); - } animated_value_.Clear(); } @@ -484,8 +500,9 @@ // We do update the style and the animation property independent of each // other. + + // CSS properties animation code-path. if (IsAnimatingCSSProperty()) { - // CSS properties animation code-path. // Convert the result of the animation to a String and apply it as CSS // property on the target_element. MutableCSSPropertyValueSet* properties = @@ -502,12 +519,9 @@ StyleChangeReasonForTracing::Create(style_change_reason::kAnimation)); } } - if (IsAnimatingSVGDom()) { - // SVG DOM animVal animation code-path. - // At this point the SVG DOM values are already changed, unlike for CSS. - // We only have to trigger update notifications here. - targetElement()->InvalidateAnimatedAttribute(AttributeName()); - } + // SVG DOM animVal animation code-path. + if (IsAnimatingSVGDom()) + target_element->SetAnimatedAttribute(AttributeName(), animated_value_); } bool SVGAnimateElement::AnimatedPropertyTypeSupportsAddition() const {
diff --git a/third_party/blink/renderer/core/svg/svg_animate_element.h b/third_party/blink/renderer/core/svg/svg_animate_element.h index 91dad7aa..0ffab60 100644 --- a/third_party/blink/renderer/core/svg/svg_animate_element.h +++ b/third_party/blink/renderer/core/svg/svg_animate_element.h
@@ -69,7 +69,7 @@ const String& by_string) final; void CalculateAnimatedValue(float percentage, unsigned repeat_count, - SVGSMILElement* result_element) final; + SVGSMILElement* result_element) const final; void ApplyResultsToTarget() final; float CalculateDistance(const String& from_string, const String& to_string) final;
diff --git a/third_party/blink/renderer/core/svg/svg_animate_motion_element.cc b/third_party/blink/renderer/core/svg/svg_animate_motion_element.cc index d2815ff..3f501d5 100644 --- a/third_party/blink/renderer/core/svg/svg_animate_motion_element.cc +++ b/third_party/blink/renderer/core/svg/svg_animate_motion_element.cc
@@ -197,16 +197,13 @@ void SVGAnimateMotionElement::CalculateAnimatedValue(float percentage, unsigned repeat_count, - SVGSMILElement*) { + SVGSMILElement*) const { SVGElement* target_element = targetElement(); DCHECK(target_element); AffineTransform* transform = target_element->AnimateMotionTransform(); if (!transform) return; - if (LayoutObject* target_layout_object = target_element->GetLayoutObject()) - InvalidateForAnimateMotionTransformChange(*target_layout_object); - if (!IsAdditive()) transform->MakeIdentity(); @@ -264,6 +261,9 @@ if (!target_transform) return; + if (LayoutObject* target_layout_object = target_element->GetLayoutObject()) + InvalidateForAnimateMotionTransformChange(*target_layout_object); + // ...except in case where we have additional instances in <use> trees. const auto& instances = target_element->InstancesForElement(); for (SVGElement* shadow_tree_element : instances) {
diff --git a/third_party/blink/renderer/core/svg/svg_animate_motion_element.h b/third_party/blink/renderer/core/svg/svg_animate_motion_element.h index 6ccda14..76183e1 100644 --- a/third_party/blink/renderer/core/svg/svg_animate_motion_element.h +++ b/third_party/blink/renderer/core/svg/svg_animate_motion_element.h
@@ -50,7 +50,7 @@ const String& by_string) override; void CalculateAnimatedValue(float percentage, unsigned repeat_count, - SVGSMILElement* result_element) override; + SVGSMILElement* result_element) const override; void ApplyResultsToTarget() override; float CalculateDistance(const String& from_string, const String& to_string) override;
diff --git a/third_party/blink/renderer/core/svg/svg_animated_color.cc b/third_party/blink/renderer/core/svg/svg_animated_color.cc index 906aca8..e3f7adf 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_color.cc +++ b/third_party/blink/renderer/core/svg/svg_animated_color.cc
@@ -66,7 +66,7 @@ } void SVGColorProperty::CalculateAnimatedValue( - SVGAnimationElement* animation_element, + const SVGAnimationElement& animation_element, float percentage, unsigned repeat_count, SVGPropertyBase* from_value, @@ -87,24 +87,23 @@ to_at_end_of_duration_style_color.Resolve(fallback_color); Color animated_color = style_color_.Resolve(fallback_color); - DCHECK(animation_element); float animated_red = animated_color.Red(); - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, from_color.Red(), to_color.Red(), to_at_end_of_duration_color.Red(), animated_red); float animated_green = animated_color.Green(); - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, from_color.Green(), to_color.Green(), to_at_end_of_duration_color.Green(), animated_green); float animated_blue = animated_color.Blue(); - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, from_color.Blue(), to_color.Blue(), to_at_end_of_duration_color.Blue(), animated_blue); float animated_alpha = animated_color.Alpha(); - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, from_color.Alpha(), to_color.Alpha(), to_at_end_of_duration_color.Alpha(), animated_alpha);
diff --git a/third_party/blink/renderer/core/svg/svg_animated_color.h b/third_party/blink/renderer/core/svg/svg_animated_color.h index 2bd1e68..fdcaf58 100644 --- a/third_party/blink/renderer/core/svg/svg_animated_color.h +++ b/third_party/blink/renderer/core/svg/svg_animated_color.h
@@ -49,7 +49,7 @@ String ValueAsString() const override; void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_animation_element.h b/third_party/blink/renderer/core/svg/svg_animation_element.h index 63ad1ee..ad38dc4 100644 --- a/third_party/blink/renderer/core/svg/svg_animation_element.h +++ b/third_party/blink/renderer/core/svg/svg_animation_element.h
@@ -76,25 +76,12 @@ bool OverwritesUnderlyingAnimationValue() const override; - template <typename AnimatedType> - void AnimateDiscreteType(float percentage, - const AnimatedType& from_type, - const AnimatedType& to_type, - AnimatedType& animated_type) { - if ((GetAnimationMode() == kFromToAnimation && percentage > 0.5) || - GetAnimationMode() == kToAnimation || percentage == 1) { - animated_type = AnimatedType(to_type); - return; - } - animated_type = AnimatedType(from_type); - } - void AnimateAdditiveNumber(float percentage, unsigned repeat_count, float from_number, float to_number, float to_at_end_of_duration_number, - float& animated_number) { + float& animated_number) const { float number; if (GetCalcMode() == kCalcModeDiscrete) number = percentage < 0.5 ? from_number : to_number; @@ -155,7 +142,7 @@ const String& by_string) = 0; virtual void CalculateAnimatedValue(float percent, unsigned repeat_count, - SVGSMILElement* result_element) = 0; + SVGSMILElement* result_element) const = 0; virtual float CalculateDistance(const String& /*fromString*/, const String& /*toString*/) { return -1.f;
diff --git a/third_party/blink/renderer/core/svg/svg_boolean.cc b/third_party/blink/renderer/core/svg/svg_boolean.cc index a110540..52e9c30 100644 --- a/third_party/blink/renderer/core/svg/svg_boolean.cc +++ b/third_party/blink/renderer/core/svg/svg_boolean.cc
@@ -30,8 +30,6 @@ #include "third_party/blink/renderer/core/svg/svg_boolean.h" -#include "third_party/blink/renderer/core/svg/svg_animation_element.h" - namespace blink { String SVGBoolean::ValueAsString() const { @@ -54,21 +52,15 @@ NOTREACHED(); } -void SVGBoolean::CalculateAnimatedValue(SVGAnimationElement* animation_element, - float percentage, - unsigned repeat_count, - SVGPropertyBase* from, - SVGPropertyBase* to, - SVGPropertyBase*, - SVGElement*) { - DCHECK(animation_element); - bool from_boolean = animation_element->GetAnimationMode() == kToAnimation - ? value_ - : ToSVGBoolean(from)->Value(); - bool to_boolean = ToSVGBoolean(to)->Value(); - - animation_element->AnimateDiscreteType<bool>(percentage, from_boolean, - to_boolean, value_); +void SVGBoolean::CalculateAnimatedValue( + const SVGAnimationElement& animation_element, + float percentage, + unsigned repeat_count, + SVGPropertyBase* from, + SVGPropertyBase* to, + SVGPropertyBase*, + SVGElement*) { + NOTREACHED(); } float SVGBoolean::CalculateDistance(SVGPropertyBase*, SVGElement*) {
diff --git a/third_party/blink/renderer/core/svg/svg_boolean.h b/third_party/blink/renderer/core/svg/svg_boolean.h index 878ae33..e69391f 100644 --- a/third_party/blink/renderer/core/svg/svg_boolean.h +++ b/third_party/blink/renderer/core/svg/svg_boolean.h
@@ -51,7 +51,7 @@ SVGParsingError SetValueAsString(const String&); void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_element.cc b/third_party/blink/renderer/core/svg/svg_element.cc index c38dc8b..71f3bf0 100644 --- a/third_party/blink/renderer/core/svg/svg_element.cc +++ b/third_party/blink/renderer/core/svg/svg_element.cc
@@ -232,13 +232,7 @@ void SVGElement::SetWebAnimatedAttribute(const QualifiedName& attribute, SVGPropertyBase* value) { - ForSelfAndInstances(this, [&attribute, &value](SVGElement* element) { - if (SVGAnimatedPropertyBase* animated_property = - element->PropertyFromAttribute(attribute)) { - animated_property->SetAnimatedValue(value); - NotifyAnimValChanged(element, attribute); - } - }); + SetAnimatedAttribute(attribute, value); EnsureSVGRareData()->WebAnimatedAttributes().insert(&attribute); } @@ -247,13 +241,7 @@ return; for (const QualifiedName* attribute : SvgRareData()->WebAnimatedAttributes()) { - ForSelfAndInstances(this, [&attribute](SVGElement* element) { - if (SVGAnimatedPropertyBase* animated_property = - element->PropertyFromAttribute(*attribute)) { - animated_property->AnimationEnded(); - NotifyAnimValChanged(element, *attribute); - } - }); + ClearAnimatedAttribute(*attribute); } SvgRareData()->WebAnimatedAttributes().clear(); } @@ -262,22 +250,20 @@ SVGPropertyBase* value) { ForSelfAndInstances(this, [&attribute, &value](SVGElement* element) { if (SVGAnimatedPropertyBase* animated_property = - element->PropertyFromAttribute(attribute)) + element->PropertyFromAttribute(attribute)) { animated_property->SetAnimatedValue(value); - }); -} - -void SVGElement::InvalidateAnimatedAttribute(const QualifiedName& attribute) { - ForSelfAndInstances(this, [&attribute](SVGElement* element) { - NotifyAnimValChanged(element, attribute); + NotifyAnimValChanged(element, attribute); + } }); } void SVGElement::ClearAnimatedAttribute(const QualifiedName& attribute) { ForSelfAndInstances(this, [&attribute](SVGElement* element) { if (SVGAnimatedPropertyBase* animated_property = - element->PropertyFromAttribute(attribute)) + element->PropertyFromAttribute(attribute)) { animated_property->AnimationEnded(); + NotifyAnimValChanged(element, attribute); + } }); }
diff --git a/third_party/blink/renderer/core/svg/svg_element.h b/third_party/blink/renderer/core/svg/svg_element.h index 256997e..e012ae9 100644 --- a/third_party/blink/renderer/core/svg/svg_element.h +++ b/third_party/blink/renderer/core/svg/svg_element.h
@@ -103,7 +103,6 @@ void ClearWebAnimatedAttributes(); void SetAnimatedAttribute(const QualifiedName&, SVGPropertyBase*); - void InvalidateAnimatedAttribute(const QualifiedName&); void ClearAnimatedAttribute(const QualifiedName&); SVGSVGElement* ownerSVGElement() const;
diff --git a/third_party/blink/renderer/core/svg/svg_enumeration.cc b/third_party/blink/renderer/core/svg/svg_enumeration.cc index 2f5954a..cb606b658 100644 --- a/third_party/blink/renderer/core/svg/svg_enumeration.cc +++ b/third_party/blink/renderer/core/svg/svg_enumeration.cc
@@ -30,7 +30,6 @@ #include "third_party/blink/renderer/core/svg/svg_enumeration.h" -#include "third_party/blink/renderer/core/svg/svg_animation_element.h" #include "third_party/blink/renderer/core/svg/svg_enumeration_map.h" namespace blink { @@ -75,22 +74,14 @@ } void SVGEnumerationBase::CalculateAnimatedValue( - SVGAnimationElement* animation_element, + const SVGAnimationElement& animation_element, float percentage, unsigned repeat_count, SVGPropertyBase* from, SVGPropertyBase* to, SVGPropertyBase*, SVGElement*) { - DCHECK(animation_element); - uint16_t from_enumeration = - animation_element->GetAnimationMode() == kToAnimation - ? value_ - : ToSVGEnumerationBase(from)->Value(); - uint16_t to_enumeration = ToSVGEnumerationBase(to)->Value(); - - animation_element->AnimateDiscreteType<uint16_t>(percentage, from_enumeration, - to_enumeration, value_); + NOTREACHED(); } float SVGEnumerationBase::CalculateDistance(SVGPropertyBase*, SVGElement*) {
diff --git a/third_party/blink/renderer/core/svg/svg_enumeration.h b/third_party/blink/renderer/core/svg/svg_enumeration.h index ffc9a87..4bc75c4 100644 --- a/third_party/blink/renderer/core/svg/svg_enumeration.h +++ b/third_party/blink/renderer/core/svg/svg_enumeration.h
@@ -60,7 +60,7 @@ SVGParsingError SetValueAsString(const String&); void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_integer.cc b/third_party/blink/renderer/core/svg/svg_integer.cc index ef6fb4c8..b4a4593 100644 --- a/third_party/blink/renderer/core/svg/svg_integer.cc +++ b/third_party/blink/renderer/core/svg/svg_integer.cc
@@ -62,22 +62,21 @@ SetValue(value_ + ToSVGInteger(other)->Value()); } -void SVGInteger::CalculateAnimatedValue(SVGAnimationElement* animation_element, - float percentage, - unsigned repeat_count, - SVGPropertyBase* from, - SVGPropertyBase* to, - SVGPropertyBase* to_at_end_of_duration, - SVGElement*) { - DCHECK(animation_element); - +void SVGInteger::CalculateAnimatedValue( + const SVGAnimationElement& animation_element, + float percentage, + unsigned repeat_count, + SVGPropertyBase* from, + SVGPropertyBase* to, + SVGPropertyBase* to_at_end_of_duration, + SVGElement*) { SVGInteger* from_integer = ToSVGInteger(from); SVGInteger* to_integer = ToSVGInteger(to); SVGInteger* to_at_end_of_duration_integer = ToSVGInteger(to_at_end_of_duration); float animated_float = value_; - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, from_integer->Value(), to_integer->Value(), to_at_end_of_duration_integer->Value(), animated_float); value_ = clampTo<int>(roundf(animated_float));
diff --git a/third_party/blink/renderer/core/svg/svg_integer.h b/third_party/blink/renderer/core/svg/svg_integer.h index 9eb66c2..6824c9c5 100644 --- a/third_party/blink/renderer/core/svg/svg_integer.h +++ b/third_party/blink/renderer/core/svg/svg_integer.h
@@ -52,7 +52,7 @@ SVGParsingError SetValueAsString(const String&); void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_integer_optional_integer.cc b/third_party/blink/renderer/core/svg/svg_integer_optional_integer.cc index e14dea7..609425c 100644 --- a/third_party/blink/renderer/core/svg/svg_integer_optional_integer.cc +++ b/third_party/blink/renderer/core/svg/svg_integer_optional_integer.cc
@@ -30,7 +30,6 @@ #include "third_party/blink/renderer/core/svg/svg_integer_optional_integer.h" -#include "third_party/blink/renderer/core/svg/svg_animation_element.h" #include "third_party/blink/renderer/core/svg/svg_parser_utilities.h" #include "third_party/blink/renderer/platform/heap/heap.h" @@ -88,45 +87,36 @@ second_integer_->SetInitial(value); } -void SVGIntegerOptionalInteger::Add(SVGPropertyBase* other, SVGElement*) { - SVGIntegerOptionalInteger* other_integer_optional_integer = - ToSVGIntegerOptionalInteger(other); - - first_integer_->SetValue( - first_integer_->Value() + - other_integer_optional_integer->first_integer_->Value()); - second_integer_->SetValue( - second_integer_->Value() + - other_integer_optional_integer->second_integer_->Value()); +void SVGIntegerOptionalInteger::Add(SVGPropertyBase* other, + SVGElement* context_element) { + auto* other_integer_optional_integer = ToSVGIntegerOptionalInteger(other); + first_integer_->Add(other_integer_optional_integer->FirstInteger(), + context_element); + second_integer_->Add(other_integer_optional_integer->SecondInteger(), + context_element); } void SVGIntegerOptionalInteger::CalculateAnimatedValue( - SVGAnimationElement* animation_element, + const SVGAnimationElement& animation_element, float percentage, unsigned repeat_count, SVGPropertyBase* from, SVGPropertyBase* to, SVGPropertyBase* to_at_end_of_duration, - SVGElement*) { - DCHECK(animation_element); - - SVGIntegerOptionalInteger* from_integer = ToSVGIntegerOptionalInteger(from); - SVGIntegerOptionalInteger* to_integer = ToSVGIntegerOptionalInteger(to); - SVGIntegerOptionalInteger* to_at_end_of_duration_integer = + SVGElement* context_element) { + auto* from_integer = ToSVGIntegerOptionalInteger(from); + auto* to_integer = ToSVGIntegerOptionalInteger(to); + auto* to_at_end_of_duration_integer = ToSVGIntegerOptionalInteger(to_at_end_of_duration); - float x = first_integer_->Value(); - float y = second_integer_->Value(); - animation_element->AnimateAdditiveNumber( - percentage, repeat_count, from_integer->FirstInteger()->Value(), - to_integer->FirstInteger()->Value(), - to_at_end_of_duration_integer->FirstInteger()->Value(), x); - animation_element->AnimateAdditiveNumber( - percentage, repeat_count, from_integer->SecondInteger()->Value(), - to_integer->SecondInteger()->Value(), - to_at_end_of_duration_integer->SecondInteger()->Value(), y); - first_integer_->SetValue(clampTo<int>(roundf(x))); - second_integer_->SetValue(clampTo<int>(roundf(y))); + first_integer_->CalculateAnimatedValue( + animation_element, percentage, repeat_count, from_integer->FirstInteger(), + to_integer->FirstInteger(), to_at_end_of_duration_integer->FirstInteger(), + context_element); + second_integer_->CalculateAnimatedValue( + animation_element, percentage, repeat_count, + from_integer->SecondInteger(), to_integer->SecondInteger(), + to_at_end_of_duration_integer->SecondInteger(), context_element); } float SVGIntegerOptionalInteger::CalculateDistance(SVGPropertyBase* other,
diff --git a/third_party/blink/renderer/core/svg/svg_integer_optional_integer.h b/third_party/blink/renderer/core/svg/svg_integer_optional_integer.h index f04ac9b8..30e518b 100644 --- a/third_party/blink/renderer/core/svg/svg_integer_optional_integer.h +++ b/third_party/blink/renderer/core/svg/svg_integer_optional_integer.h
@@ -55,7 +55,7 @@ static constexpr int kInitialValueBits = SVGInteger::kInitialValueBits; void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_length.cc b/third_party/blink/renderer/core/svg/svg_length.cc index a7e66c3..1418708 100644 --- a/third_party/blink/renderer/core/svg/svg_length.cc +++ b/third_party/blink/renderer/core/svg/svg_length.cc
@@ -331,7 +331,7 @@ } void SVGLength::CalculateAnimatedValue( - SVGAnimationElement* animation_element, + const SVGAnimationElement& animation_element, float percentage, unsigned repeat_count, SVGPropertyBase* from_value, @@ -345,13 +345,13 @@ SVGLengthContext length_context(context_element); float animated_number = Value(length_context); - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, from_length->Value(length_context), to_length->Value(length_context), to_at_end_of_duration_length->Value(length_context), animated_number); DCHECK_EQ(UnitMode(), LengthModeForAnimatedLengthAttribute( - animation_element->AttributeName())); + animation_element.AttributeName())); // TODO(shanmuga.m): Construct a calc() expression if the units fall in // different categories.
diff --git a/third_party/blink/renderer/core/svg/svg_length.h b/third_party/blink/renderer/core/svg/svg_length.h index 8838f824..4ee7803 100644 --- a/third_party/blink/renderer/core/svg/svg_length.h +++ b/third_party/blink/renderer/core/svg/svg_length.h
@@ -126,7 +126,7 @@ const QualifiedName&); void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_length_list.cc b/third_party/blink/renderer/core/svg/svg_length_list.cc index 9ed70d9..d56ba8ef 100644 --- a/third_party/blink/renderer/core/svg/svg_length_list.cc +++ b/third_party/blink/renderer/core/svg/svg_length_list.cc
@@ -107,7 +107,7 @@ } void SVGLengthList::CalculateAnimatedValue( - SVGAnimationElement* animation_element, + const SVGAnimationElement& animation_element, float percentage, unsigned repeat_count, SVGPropertyBase* from_value, @@ -121,7 +121,7 @@ SVGLengthContext length_context(context_element); DCHECK_EQ(mode_, SVGLength::LengthModeForAnimatedLengthAttribute( - animation_element->AttributeName())); + animation_element.AttributeName())); uint32_t from_length_list_size = from_list->length(); uint32_t to_length_list_size = to_list->length(); @@ -129,7 +129,7 @@ to_at_end_of_duration_list->length(); if (!AdjustFromToListValues(from_list, to_list, percentage, - animation_element->GetAnimationMode())) + animation_element.GetAnimationMode())) return; for (uint32_t i = 0; i < to_length_list_size; ++i) { @@ -148,7 +148,7 @@ ? to_at_end_of_duration_list->at(i)->Value(length_context) : 0; - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, effective_from, effective_to, effective_to_at_end, animated_number); // |animated_number| is in user units.
diff --git a/third_party/blink/renderer/core/svg/svg_length_list.h b/third_party/blink/renderer/core/svg/svg_length_list.h index dbc1900..c6c8223 100644 --- a/third_party/blink/renderer/core/svg/svg_length_list.h +++ b/third_party/blink/renderer/core/svg/svg_length_list.h
@@ -56,7 +56,7 @@ SVGLengthMode UnitMode() const { return mode_; } void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from_value,
diff --git a/third_party/blink/renderer/core/svg/svg_number.cc b/third_party/blink/renderer/core/svg/svg_number.cc index 47e9bff..b3fc8fe3 100644 --- a/third_party/blink/renderer/core/svg/svg_number.cc +++ b/third_party/blink/renderer/core/svg/svg_number.cc
@@ -78,20 +78,19 @@ SetValue(value_ + ToSVGNumber(other)->Value()); } -void SVGNumber::CalculateAnimatedValue(SVGAnimationElement* animation_element, - float percentage, - unsigned repeat_count, - SVGPropertyBase* from, - SVGPropertyBase* to, - SVGPropertyBase* to_at_end_of_duration, - SVGElement*) { - DCHECK(animation_element); - +void SVGNumber::CalculateAnimatedValue( + const SVGAnimationElement& animation_element, + float percentage, + unsigned repeat_count, + SVGPropertyBase* from, + SVGPropertyBase* to, + SVGPropertyBase* to_at_end_of_duration, + SVGElement*) { SVGNumber* from_number = ToSVGNumber(from); SVGNumber* to_number = ToSVGNumber(to); SVGNumber* to_at_end_of_duration_number = ToSVGNumber(to_at_end_of_duration); - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, from_number->Value(), to_number->Value(), to_at_end_of_duration_number->Value(), value_); }
diff --git a/third_party/blink/renderer/core/svg/svg_number.h b/third_party/blink/renderer/core/svg/svg_number.h index 6d8aed8d..be69246f 100644 --- a/third_party/blink/renderer/core/svg/svg_number.h +++ b/third_party/blink/renderer/core/svg/svg_number.h
@@ -55,7 +55,7 @@ virtual SVGParsingError SetValueAsString(const String&); void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_number_list.cc b/third_party/blink/renderer/core/svg/svg_number_list.cc index 37cb6bd3..9fc73a9 100644 --- a/third_party/blink/renderer/core/svg/svg_number_list.cc +++ b/third_party/blink/renderer/core/svg/svg_number_list.cc
@@ -79,7 +79,7 @@ } void SVGNumberList::CalculateAnimatedValue( - SVGAnimationElement* animation_element, + const SVGAnimationElement& animation_element, float percentage, unsigned repeat_count, SVGPropertyBase* from_value, @@ -97,7 +97,7 @@ to_at_end_of_duration_list->length(); if (!AdjustFromToListValues(from_list, to_list, percentage, - animation_element->GetAnimationMode())) + animation_element.GetAnimationMode())) return; for (uint32_t i = 0; i < to_list_size; ++i) { @@ -108,9 +108,9 @@ : 0; float animated = at(i)->Value(); - animation_element->AnimateAdditiveNumber(percentage, repeat_count, - effective_from, effective_to, - effective_to_at_end, animated); + animation_element.AnimateAdditiveNumber(percentage, repeat_count, + effective_from, effective_to, + effective_to_at_end, animated); at(i)->SetValue(animated); } }
diff --git a/third_party/blink/renderer/core/svg/svg_number_list.h b/third_party/blink/renderer/core/svg/svg_number_list.h index 19906730..ef8ee16 100644 --- a/third_party/blink/renderer/core/svg/svg_number_list.h +++ b/third_party/blink/renderer/core/svg/svg_number_list.h
@@ -53,7 +53,7 @@ String ValueAsString() const override; void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from_value,
diff --git a/third_party/blink/renderer/core/svg/svg_number_optional_number.cc b/third_party/blink/renderer/core/svg/svg_number_optional_number.cc index e9c58c3..35745568 100644 --- a/third_party/blink/renderer/core/svg/svg_number_optional_number.cc +++ b/third_party/blink/renderer/core/svg/svg_number_optional_number.cc
@@ -30,7 +30,6 @@ #include "third_party/blink/renderer/core/svg/svg_number_optional_number.h" -#include "third_party/blink/renderer/core/svg/svg_animation_element.h" #include "third_party/blink/renderer/core/svg/svg_parser_utilities.h" #include "third_party/blink/renderer/platform/heap/heap.h" @@ -90,44 +89,36 @@ second_number_->SetInitial(value); } -void SVGNumberOptionalNumber::Add(SVGPropertyBase* other, SVGElement*) { - SVGNumberOptionalNumber* other_number_optional_number = - ToSVGNumberOptionalNumber(other); - - first_number_->SetValue(first_number_->Value() + - other_number_optional_number->first_number_->Value()); - second_number_->SetValue( - second_number_->Value() + - other_number_optional_number->second_number_->Value()); +void SVGNumberOptionalNumber::Add(SVGPropertyBase* other, + SVGElement* context_element) { + auto* other_number_optional_number = ToSVGNumberOptionalNumber(other); + first_number_->Add(other_number_optional_number->FirstNumber(), + context_element); + second_number_->Add(other_number_optional_number->SecondNumber(), + context_element); } void SVGNumberOptionalNumber::CalculateAnimatedValue( - SVGAnimationElement* animation_element, + const SVGAnimationElement& animation_element, float percentage, unsigned repeat_count, SVGPropertyBase* from, SVGPropertyBase* to, SVGPropertyBase* to_at_end_of_duration, - SVGElement*) { - DCHECK(animation_element); - - SVGNumberOptionalNumber* from_number = ToSVGNumberOptionalNumber(from); - SVGNumberOptionalNumber* to_number = ToSVGNumberOptionalNumber(to); - SVGNumberOptionalNumber* to_at_end_of_duration_number = + SVGElement* context_element) { + auto* from_number = ToSVGNumberOptionalNumber(from); + auto* to_number = ToSVGNumberOptionalNumber(to); + auto* to_at_end_of_duration_number = ToSVGNumberOptionalNumber(to_at_end_of_duration); - float x = first_number_->Value(); - float y = second_number_->Value(); - animation_element->AnimateAdditiveNumber( - percentage, repeat_count, from_number->FirstNumber()->Value(), - to_number->FirstNumber()->Value(), - to_at_end_of_duration_number->FirstNumber()->Value(), x); - animation_element->AnimateAdditiveNumber( - percentage, repeat_count, from_number->SecondNumber()->Value(), - to_number->SecondNumber()->Value(), - to_at_end_of_duration_number->SecondNumber()->Value(), y); - first_number_->SetValue(x); - second_number_->SetValue(y); + first_number_->CalculateAnimatedValue( + animation_element, percentage, repeat_count, from_number->FirstNumber(), + to_number->FirstNumber(), to_at_end_of_duration_number->FirstNumber(), + context_element); + second_number_->CalculateAnimatedValue( + animation_element, percentage, repeat_count, from_number->SecondNumber(), + to_number->SecondNumber(), to_at_end_of_duration_number->SecondNumber(), + context_element); } float SVGNumberOptionalNumber::CalculateDistance(SVGPropertyBase* other,
diff --git a/third_party/blink/renderer/core/svg/svg_number_optional_number.h b/third_party/blink/renderer/core/svg/svg_number_optional_number.h index 752e627d..e7d99efe 100644 --- a/third_party/blink/renderer/core/svg/svg_number_optional_number.h +++ b/third_party/blink/renderer/core/svg/svg_number_optional_number.h
@@ -54,7 +54,7 @@ static constexpr int kInitialValueBits = SVGNumber::kInitialValueBits; void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_path.cc b/third_party/blink/renderer/core/svg/svg_path.cc index 5a042fb..fa38c71 100644 --- a/third_party/blink/renderer/core/svg/svg_path.cc +++ b/third_party/blink/renderer/core/svg/svg_path.cc
@@ -125,15 +125,14 @@ } void SVGPath::CalculateAnimatedValue( - SVGAnimationElement* animation_element, + const SVGAnimationElement& animation_element, float percentage, unsigned repeat_count, SVGPropertyBase* from_value, SVGPropertyBase* to_value, SVGPropertyBase* to_at_end_of_duration_value, SVGElement*) { - DCHECK(animation_element); - bool is_to_animation = animation_element->GetAnimationMode() == kToAnimation; + bool is_to_animation = animation_element.GetAnimationMode() == kToAnimation; const SVGPath& to = ToSVGPath(*to_value); const SVGPathByteStream& to_stream = to.ByteStream(); @@ -169,16 +168,17 @@ BlendPathByteStreams(*from_stream, to_stream, percentage); // Handle additive='sum'. - if (animation_element->IsAdditive() && !is_to_animation) + if (animation_element.IsAdditive() && !is_to_animation) { new_stream = ConditionallyAddPathByteStreams(std::move(new_stream), ByteStream()); + } // Handle accumulate='sum'. - if (animation_element->IsAccumulated() && repeat_count) + if (animation_element.IsAccumulated() && repeat_count) { new_stream = ConditionallyAddPathByteStreams( std::move(new_stream), ToSVGPath(to_at_end_of_duration_value)->ByteStream(), repeat_count); - + } path_value_ = MakeGarbageCollected<CSSPathValue>(std::move(new_stream)); }
diff --git a/third_party/blink/renderer/core/svg/svg_path.h b/third_party/blink/renderer/core/svg/svg_path.h index 68e719e..300dac4c 100644 --- a/third_party/blink/renderer/core/svg/svg_path.h +++ b/third_party/blink/renderer/core/svg/svg_path.h
@@ -59,7 +59,7 @@ SVGParsingError SetValueAsString(const String&); void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from_value,
diff --git a/third_party/blink/renderer/core/svg/svg_point.cc b/third_party/blink/renderer/core/svg/svg_point.cc index bcd08edb..38ce417 100644 --- a/third_party/blink/renderer/core/svg/svg_point.cc +++ b/third_party/blink/renderer/core/svg/svg_point.cc
@@ -101,7 +101,7 @@ } void SVGPoint::CalculateAnimatedValue( - SVGAnimationElement* animation_element, + const SVGAnimationElement& animation_element, float percentage, unsigned repeat_count, SVGPropertyBase* from_value,
diff --git a/third_party/blink/renderer/core/svg/svg_point.h b/third_party/blink/renderer/core/svg/svg_point.h index 0186fbb..5f338f3 100644 --- a/third_party/blink/renderer/core/svg/svg_point.h +++ b/third_party/blink/renderer/core/svg/svg_point.h
@@ -63,7 +63,7 @@ SVGParsingError SetValueAsString(const String&); void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_point_list.cc b/third_party/blink/renderer/core/svg/svg_point_list.cc index e43720d7..9d88da80 100644 --- a/third_party/blink/renderer/core/svg/svg_point_list.cc +++ b/third_party/blink/renderer/core/svg/svg_point_list.cc
@@ -93,7 +93,7 @@ } void SVGPointList::CalculateAnimatedValue( - SVGAnimationElement* animation_element, + const SVGAnimationElement& animation_element, float percentage, unsigned repeat_count, SVGPropertyBase* from_value, @@ -111,7 +111,7 @@ to_at_end_of_duration_list->length(); if (!AdjustFromToListValues(from_list, to_list, percentage, - animation_element->GetAnimationMode())) + animation_element.GetAnimationMode())) return; for (uint32_t i = 0; i < to_point_list_size; ++i) { @@ -126,10 +126,10 @@ if (i < to_at_end_of_duration_list_size) effective_to_at_end = to_at_end_of_duration_list->at(i)->Value(); - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, effective_from.X(), effective_to.X(), effective_to_at_end.X(), animated_x); - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, effective_from.Y(), effective_to.Y(), effective_to_at_end.Y(), animated_y); at(i)->SetValue(FloatPoint(animated_x, animated_y));
diff --git a/third_party/blink/renderer/core/svg/svg_point_list.h b/third_party/blink/renderer/core/svg/svg_point_list.h index a25b1b2..9f1a22e4 100644 --- a/third_party/blink/renderer/core/svg/svg_point_list.h +++ b/third_party/blink/renderer/core/svg/svg_point_list.h
@@ -53,7 +53,7 @@ String ValueAsString() const override; void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from_value,
diff --git a/third_party/blink/renderer/core/svg/svg_preserve_aspect_ratio.cc b/third_party/blink/renderer/core/svg/svg_preserve_aspect_ratio.cc index 3e1f1d5c4..3fd431b 100644 --- a/third_party/blink/renderer/core/svg/svg_preserve_aspect_ratio.cc +++ b/third_party/blink/renderer/core/svg/svg_preserve_aspect_ratio.cc
@@ -21,7 +21,6 @@ #include "third_party/blink/renderer/core/svg/svg_preserve_aspect_ratio.h" -#include "third_party/blink/renderer/core/svg/svg_animation_element.h" #include "third_party/blink/renderer/core/svg/svg_parser_utilities.h" #include "third_party/blink/renderer/platform/geometry/float_rect.h" #include "third_party/blink/renderer/platform/heap/heap.h" @@ -440,24 +439,14 @@ } void SVGPreserveAspectRatio::CalculateAnimatedValue( - SVGAnimationElement* animation_element, + const SVGAnimationElement& animation_element, float percentage, unsigned repeat_count, SVGPropertyBase* from_value, SVGPropertyBase* to_value, SVGPropertyBase*, SVGElement*) { - DCHECK(animation_element); - - bool use_to_value; - animation_element->AnimateDiscreteType(percentage, false, true, use_to_value); - - SVGPreserveAspectRatio* preserve_aspect_ratio_to_use = - use_to_value ? ToSVGPreserveAspectRatio(to_value) - : ToSVGPreserveAspectRatio(from_value); - - align_ = preserve_aspect_ratio_to_use->align_; - meet_or_slice_ = preserve_aspect_ratio_to_use->meet_or_slice_; + NOTREACHED(); } float SVGPreserveAspectRatio::CalculateDistance(SVGPropertyBase* to_value,
diff --git a/third_party/blink/renderer/core/svg/svg_preserve_aspect_ratio.h b/third_party/blink/renderer/core/svg/svg_preserve_aspect_ratio.h index 9d3c7e5b..939771a 100644 --- a/third_party/blink/renderer/core/svg/svg_preserve_aspect_ratio.h +++ b/third_party/blink/renderer/core/svg/svg_preserve_aspect_ratio.h
@@ -87,7 +87,7 @@ bool Parse(const LChar*& ptr, const LChar* end, bool validate); void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_rect.cc b/third_party/blink/renderer/core/svg/svg_rect.cc index 7183c881..32b33b57 100644 --- a/third_party/blink/renderer/core/svg/svg_rect.cc +++ b/third_party/blink/renderer/core/svg/svg_rect.cc
@@ -95,15 +95,14 @@ } void SVGRect::CalculateAnimatedValue( - SVGAnimationElement* animation_element, + const SVGAnimationElement& animation_element, float percentage, unsigned repeat_count, SVGPropertyBase* from_value, SVGPropertyBase* to_value, SVGPropertyBase* to_at_end_of_duration_value, SVGElement*) { - DCHECK(animation_element); - SVGRect* from_rect = animation_element->GetAnimationMode() == kToAnimation + SVGRect* from_rect = animation_element.GetAnimationMode() == kToAnimation ? this : ToSVGRect(from_value); SVGRect* to_rect = ToSVGRect(to_value); @@ -113,16 +112,16 @@ float animated_y = Y(); float animated_width = Width(); float animated_height = Height(); - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, from_rect->X(), to_rect->X(), to_at_end_of_duration_rect->X(), animated_x); - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, from_rect->Y(), to_rect->Y(), to_at_end_of_duration_rect->Y(), animated_y); - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, from_rect->Width(), to_rect->Width(), to_at_end_of_duration_rect->Width(), animated_width); - animation_element->AnimateAdditiveNumber( + animation_element.AnimateAdditiveNumber( percentage, repeat_count, from_rect->Height(), to_rect->Height(), to_at_end_of_duration_rect->Height(), animated_height);
diff --git a/third_party/blink/renderer/core/svg/svg_rect.h b/third_party/blink/renderer/core/svg/svg_rect.h index e579b27..1a6da379 100644 --- a/third_party/blink/renderer/core/svg/svg_rect.h +++ b/third_party/blink/renderer/core/svg/svg_rect.h
@@ -60,7 +60,7 @@ SVGParsingError SetValueAsString(const String&); void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_string.cc b/third_party/blink/renderer/core/svg/svg_string.cc index 0380f5c..cd34d49 100644 --- a/third_party/blink/renderer/core/svg/svg_string.cc +++ b/third_party/blink/renderer/core/svg/svg_string.cc
@@ -19,28 +19,21 @@ #include "third_party/blink/renderer/core/svg/svg_string.h" -#include "third_party/blink/renderer/core/svg/svg_animate_element.h" - namespace blink { void SVGString::Add(SVGPropertyBase*, SVGElement*) { NOTREACHED(); } -void SVGString::CalculateAnimatedValue(SVGAnimationElement* animation_element, - float percentage, - unsigned repeat_count, - SVGPropertyBase* from, - SVGPropertyBase* to, - SVGPropertyBase*, - SVGElement*) { - DCHECK(animation_element); - - String from_string = ToSVGString(from)->value_; - String to_string = ToSVGString(to)->value_; - - animation_element->AnimateDiscreteType<String>(percentage, from_string, - to_string, value_); +void SVGString::CalculateAnimatedValue( + const SVGAnimationElement& animation_element, + float percentage, + unsigned repeat_count, + SVGPropertyBase* from, + SVGPropertyBase* to, + SVGPropertyBase*, + SVGElement*) { + NOTREACHED(); } float SVGString::CalculateDistance(SVGPropertyBase*, SVGElement*) {
diff --git a/third_party/blink/renderer/core/svg/svg_string.h b/third_party/blink/renderer/core/svg/svg_string.h index 428a40a..84873c2 100644 --- a/third_party/blink/renderer/core/svg/svg_string.h +++ b/third_party/blink/renderer/core/svg/svg_string.h
@@ -58,7 +58,7 @@ } void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_string_list.cc b/third_party/blink/renderer/core/svg/svg_string_list.cc index a1c08705..1dc8ba2 100644 --- a/third_party/blink/renderer/core/svg/svg_string_list.cc +++ b/third_party/blink/renderer/core/svg/svg_string_list.cc
@@ -157,7 +157,7 @@ NOTREACHED(); } -void SVGStringListBase::CalculateAnimatedValue(SVGAnimationElement*, +void SVGStringListBase::CalculateAnimatedValue(const SVGAnimationElement&, float, unsigned, SVGPropertyBase*,
diff --git a/third_party/blink/renderer/core/svg/svg_string_list.h b/third_party/blink/renderer/core/svg/svg_string_list.h index 7c11786..2f592ee8 100644 --- a/third_party/blink/renderer/core/svg/svg_string_list.h +++ b/third_party/blink/renderer/core/svg/svg_string_list.h
@@ -77,7 +77,7 @@ virtual SVGParsingError SetValueAsString(const String&) = 0; void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from_value,
diff --git a/third_party/blink/renderer/core/svg/svg_transform.cc b/third_party/blink/renderer/core/svg/svg_transform.cc index 9931b63..ea365a0c 100644 --- a/third_party/blink/renderer/core/svg/svg_transform.cc +++ b/third_party/blink/renderer/core/svg/svg_transform.cc
@@ -222,7 +222,7 @@ NOTREACHED(); } -void SVGTransform::CalculateAnimatedValue(SVGAnimationElement*, +void SVGTransform::CalculateAnimatedValue(const SVGAnimationElement&, float, unsigned, SVGPropertyBase*,
diff --git a/third_party/blink/renderer/core/svg/svg_transform.h b/third_party/blink/renderer/core/svg/svg_transform.h index 7c06b79..16e2a46 100644 --- a/third_party/blink/renderer/core/svg/svg_transform.h +++ b/third_party/blink/renderer/core/svg/svg_transform.h
@@ -88,7 +88,7 @@ String ValueAsString() const override; void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from,
diff --git a/third_party/blink/renderer/core/svg/svg_transform_list.cc b/third_party/blink/renderer/core/svg/svg_transform_list.cc index c85f8ec..7fdc0af 100644 --- a/third_party/blink/renderer/core/svg/svg_transform_list.cc +++ b/third_party/blink/renderer/core/svg/svg_transform_list.cc
@@ -448,15 +448,14 @@ } void SVGTransformList::CalculateAnimatedValue( - SVGAnimationElement* animation_element, + const SVGAnimationElement& animation_element, float percentage, unsigned repeat_count, SVGPropertyBase* from_value, SVGPropertyBase* to_value, SVGPropertyBase* to_at_end_of_duration_value, SVGElement* context_element) { - DCHECK(animation_element); - bool is_to_animation = animation_element->GetAnimationMode() == kToAnimation; + bool is_to_animation = animation_element.GetAnimationMode() == kToAnimation; // Spec: To animations provide specific functionality to get a smooth change // from the underlying value to the 'to' attribute value, which conflicts @@ -489,14 +488,14 @@ // Never resize the animatedTransformList to the toList size, instead either // clear the list or append to it. - if (!IsEmpty() && (!animation_element->IsAdditive() || is_to_animation)) + if (!IsEmpty() && (!animation_element.IsAdditive() || is_to_animation)) Clear(); SVGTransform* current_transform = SVGTransformDistance(effective_from, to_transform) .ScaledDistance(percentage) .AddToSVGTransform(effective_from); - if (animation_element->IsAccumulated() && repeat_count) { + if (animation_element.IsAccumulated() && repeat_count) { SVGTransform* effective_to_at_end = !to_at_end_of_duration_list->IsEmpty() ? to_at_end_of_duration_list->at(0)
diff --git a/third_party/blink/renderer/core/svg/svg_transform_list.h b/third_party/blink/renderer/core/svg/svg_transform_list.h index 3e582d69..139f7a3 100644 --- a/third_party/blink/renderer/core/svg/svg_transform_list.h +++ b/third_party/blink/renderer/core/svg/svg_transform_list.h
@@ -60,7 +60,7 @@ bool Parse(const LChar*& ptr, const LChar* end); void Add(SVGPropertyBase*, SVGElement*) override; - void CalculateAnimatedValue(SVGAnimationElement*, + void CalculateAnimatedValue(const SVGAnimationElement&, float percentage, unsigned repeat_count, SVGPropertyBase* from_value,
diff --git a/third_party/blink/renderer/core/testing/core_unit_test_helper.cc b/third_party/blink/renderer/core/testing/core_unit_test_helper.cc index 55a35cd6..d43b8c6 100644 --- a/third_party/blink/renderer/core/testing/core_unit_test_helper.cc +++ b/third_party/blink/renderer/core/testing/core_unit_test_helper.cc
@@ -43,7 +43,7 @@ } RenderingTest::RenderingTest(LocalFrameClient* local_frame_client) - : UseMockScrollbarSettings(), local_frame_client_(local_frame_client) {} + : local_frame_client_(local_frame_client) {} const Node* RenderingTest::HitTest(int x, int y) { HitTestLocation location(PhysicalOffset(x, y));
diff --git a/third_party/blink/renderer/core/testing/core_unit_test_helper.h b/third_party/blink/renderer/core/testing/core_unit_test_helper.h index d5c0d3d..c2ddac1 100644 --- a/third_party/blink/renderer/core/testing/core_unit_test_helper.h +++ b/third_party/blink/renderer/core/testing/core_unit_test_helper.h
@@ -21,7 +21,6 @@ #include "third_party/blink/renderer/core/loader/empty_clients.h" #include "third_party/blink/renderer/core/paint/ng/ng_paint_fragment.h" #include "third_party/blink/renderer/core/testing/page_test_base.h" -#include "third_party/blink/renderer/core/testing/use_mock_scrollbar_settings.h" #include "third_party/blink/renderer/platform/testing/layer_tree_host_embedder.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" @@ -103,7 +102,7 @@ TransformationMatrix device_emulation_transform_; }; -class RenderingTest : public PageTestBase, public UseMockScrollbarSettings { +class RenderingTest : public PageTestBase { USING_FAST_MALLOC(RenderingTest); public:
diff --git a/third_party/blink/renderer/core/testing/internal_settings.cc b/third_party/blink/renderer/core/testing/internal_settings.cc index e80353e..b3333e2 100644 --- a/third_party/blink/renderer/core/testing/internal_settings.cc +++ b/third_party/blink/renderer/core/testing/internal_settings.cc
@@ -70,7 +70,6 @@ settings->GetAccessibilityFontScaleFactor()), original_media_type_override_(settings->GetMediaTypeOverride()), original_display_mode_override_(settings->GetDisplayModeOverride()), - original_mock_scrollbars_enabled_(settings->MockScrollbarsEnabled()), original_mock_gesture_tap_highlights_enabled_( settings->GetMockGestureTapHighlightsEnabled()), lang_attribute_aware_form_control_ui_enabled_( @@ -94,7 +93,6 @@ original_accessibility_font_scale_factor_); settings->SetMediaTypeOverride(original_media_type_override_); settings->SetDisplayModeOverride(original_display_mode_override_); - settings->SetMockScrollbarsEnabled(original_mock_scrollbars_enabled_); settings->SetMockGestureTapHighlightsEnabled( original_mock_gesture_tap_highlights_enabled_); RuntimeEnabledFeatures::SetLangAttributeAwareFormControlUIEnabled( @@ -138,13 +136,6 @@ return &GetPage()->GetSettings(); } -void InternalSettings::setMockScrollbarsEnabled( - bool enabled, - ExceptionState& exception_state) { - InternalSettingsGuardForSettings(); - GetSettings()->SetMockScrollbarsEnabled(enabled); -} - void InternalSettings::setHideScrollbars(bool enabled, ExceptionState& exception_state) { InternalSettingsGuardForSettings();
diff --git a/third_party/blink/renderer/core/testing/internal_settings.h b/third_party/blink/renderer/core/testing/internal_settings.h index 998c92f..1c289ab7 100644 --- a/third_party/blink/renderer/core/testing/internal_settings.h +++ b/third_party/blink/renderer/core/testing/internal_settings.h
@@ -64,7 +64,6 @@ float original_accessibility_font_scale_factor_; String original_media_type_override_; blink::mojom::DisplayMode original_display_mode_override_; - bool original_mock_scrollbars_enabled_; bool original_mock_gesture_tap_highlights_enabled_; bool lang_attribute_aware_form_control_ui_enabled_; bool images_enabled_; @@ -107,7 +106,6 @@ void setImagesEnabled(bool, ExceptionState&); void setMediaTypeOverride(const String& media_type, ExceptionState&); void setDisplayModeOverride(const String& display_mode, ExceptionState&); - void setMockScrollbarsEnabled(bool, ExceptionState&); void setHideScrollbars(bool, ExceptionState&); void setMockGestureTapHighlightsEnabled(bool, ExceptionState&); void setTextAutosizingEnabled(bool, ExceptionState&);
diff --git a/third_party/blink/renderer/core/testing/internal_settings.idl b/third_party/blink/renderer/core/testing/internal_settings.idl index e9e2905..c49c136 100644 --- a/third_party/blink/renderer/core/testing/internal_settings.idl +++ b/third_party/blink/renderer/core/testing/internal_settings.idl
@@ -26,7 +26,6 @@ interface InternalSettings : InternalSettingsGenerated { // All methods which access Page::settings() can raise an exception // when the page cannot be accessed. (Such as during page tear-down.) - [RaisesException] void setMockScrollbarsEnabled(boolean enabled); [RaisesException] void setHideScrollbars(boolean enabled); [RaisesException] void setMockGestureTapHighlightsEnabled(boolean enabled); [RaisesException] void setStandardFontFamily(DOMString family, DOMString script);
diff --git a/third_party/blink/renderer/core/testing/internals.cc b/third_party/blink/renderer/core/testing/internals.cc index 85fdf7a..9cbaeab 100644 --- a/third_party/blink/renderer/core/testing/internals.cc +++ b/third_party/blink/renderer/core/testing/internals.cc
@@ -300,6 +300,7 @@ OverrideCapsLockState::kDefault); IntersectionObserver::SetThrottleDelayEnabledForTesting(true); + ScrollbarTheme::SetMockScrollbarsEnabled(false); } Internals::Internals(ExecutionContext* context) @@ -3499,4 +3500,13 @@ return String::Number(process_id) + ":" + String::Number(agent_address); } +void Internals::useMockOverlayScrollbars() { + ScrollbarTheme::SetMockScrollbarsEnabled(true); + RuntimeEnabledFeatures::SetOverlayScrollbarsEnabled(true); +} + +bool Internals::overlayScrollbarsEnabled() const { + return RuntimeEnabledFeatures::OverlayScrollbarsEnabled(); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/testing/internals.h b/third_party/blink/renderer/core/testing/internals.h index c682b872..11d9990 100644 --- a/third_party/blink/renderer/core/testing/internals.h +++ b/third_party/blink/renderer/core/testing/internals.h
@@ -601,6 +601,9 @@ String getDocumentAgentId(Document*); + void useMockOverlayScrollbars(); + bool overlayScrollbarsEnabled() const; + private: Document* ContextDocument() const; Vector<String> IconURLs(Document*, int icon_types_mask) const;
diff --git a/third_party/blink/renderer/core/testing/internals.idl b/third_party/blink/renderer/core/testing/internals.idl index bac34db..74f0c30 100644 --- a/third_party/blink/renderer/core/testing/internals.idl +++ b/third_party/blink/renderer/core/testing/internals.idl
@@ -440,4 +440,7 @@ // The returned string is composed of the process ID and the memory address // of the Agent object. DOMString getDocumentAgentId(Document document); + + void useMockOverlayScrollbars(); + readonly attribute boolean overlayScrollbarsEnabled; };
diff --git a/third_party/blink/renderer/core/testing/page_test_base.h b/third_party/blink/renderer/core/testing/page_test_base.h index 0a76fef..d66cdef62 100644 --- a/third_party/blink/renderer/core/testing/page_test_base.h +++ b/third_party/blink/renderer/core/testing/page_test_base.h
@@ -7,6 +7,7 @@ #include <gtest/gtest.h> #include "third_party/blink/renderer/core/testing/dummy_page_holder.h" +#include "third_party/blink/renderer/core/testing/use_mock_scrollbar_settings.h" #include "third_party/blink/renderer/platform/testing/testing_platform_support_with_mock_scheduler.h" namespace base { @@ -18,7 +19,7 @@ class Document; class LocalFrame; -class PageTestBase : public testing::Test { +class PageTestBase : public testing::Test, public UseMockScrollbarSettings { USING_FAST_MALLOC(PageTestBase); public:
diff --git a/third_party/blink/renderer/modules/BUILD.gn b/third_party/blink/renderer/modules/BUILD.gn index c4bb00e..3be889b 100644 --- a/third_party/blink/renderer/modules/BUILD.gn +++ b/third_party/blink/renderer/modules/BUILD.gn
@@ -457,6 +457,7 @@ "//third_party/blink/renderer/core", "//third_party/blink/renderer/modules/gamepad:unit_tests", "//third_party/blink/renderer/modules/hid:unit_tests", + "//third_party/blink/renderer/modules/native_file_system:unit_tests", "//third_party/blink/renderer/modules/storage:unit_tests", "//third_party/blink/renderer/modules/webtransport:unit_tests", "//third_party/blink/renderer/platform",
diff --git a/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc b/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc index dd4f45e..43a8a8e 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc
@@ -873,7 +873,7 @@ auto* element = DynamicTo<Element>(layout_object_->GetNode()); if (!element) return g_null_atom; - return element->getAttribute(html_names::kAccesskeyAttr); + return element->FastGetAttribute(html_names::kAccesskeyAttr); } RGBA32 AXLayoutObject::ComputeBackgroundColor() const {
diff --git a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc index 5b2ea42..0892aad 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
@@ -1257,7 +1257,7 @@ if (GetNode()->parentNode() && IsA<HTMLDetailsElement>(GetNode()->parentNode())) return To<Element>(GetNode()->parentNode()) - ->hasAttribute(html_names::kOpenAttr) + ->FastHasAttribute(html_names::kOpenAttr) ? kExpandedExpanded : kExpandedCollapsed; } @@ -2936,8 +2936,8 @@ ++label_index) { Element* label = labels->item(label_index); if (name_sources) { - if (!label->getAttribute(html_names::kForAttr).IsEmpty() && - label->getAttribute(html_names::kForAttr) == + if (!label->FastGetAttribute(html_names::kForAttr).IsEmpty() && + label->FastGetAttribute(html_names::kForAttr) == html_element->GetIdAttribute()) { name_sources->back().native_source = kAXTextFromNativeHTMLLabelFor; } else {
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.cc b/third_party/blink/renderer/modules/accessibility/ax_object.cc index 9337b5a..bf48b3aa 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object.cc
@@ -1099,7 +1099,7 @@ element = FlatTreeTraversal::ParentElement(*node); while (element) { - if (element->hasAttribute(html_names::kInertAttr)) + if (element->FastHasAttribute(html_names::kInertAttr)) return AXObjectCache().GetOrCreate(element); element = FlatTreeTraversal::ParentElement(*element); }
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc index 64c9761..a42a061 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc
@@ -391,8 +391,8 @@ return false; // TODO(accessibility) support role strings with multiple roles. - return EqualIgnoringASCIICase(element->getAttribute(html_names::kRoleAttr), - role); + return EqualIgnoringASCIICase( + element->FastGetAttribute(html_names::kRoleAttr), role); } AXObject* AXObjectCacheImpl::CreateFromRenderer(LayoutObject* layout_object) {
diff --git a/third_party/blink/renderer/modules/document_metadata/copyless_paste_extractor.cc b/third_party/blink/renderer/modules/document_metadata/copyless_paste_extractor.cc index 9eb5c313..bc164eb 100644 --- a/third_party/blink/renderer/modules/document_metadata/copyless_paste_extractor.cc +++ b/third_party/blink/renderer/modules/document_metadata/copyless_paste_extractor.cc
@@ -256,7 +256,8 @@ Vector<EntityPtr>& entities) { for (Element& element : ElementTraversal::DescendantsOf(root)) { if (element.HasTagName(html_names::kScriptTag) && - element.getAttribute(html_names::kTypeAttr) == "application/ld+json") { + element.FastGetAttribute(html_names::kTypeAttr) == + "application/ld+json") { std::unique_ptr<JSONValue> json = ParseJSON(element.textContent()); if (!json) { LOG(ERROR) << "Failed to parse json.";
diff --git a/third_party/blink/renderer/modules/media_controls/elements/media_control_input_element.cc b/third_party/blink/renderer/modules/media_controls/elements/media_control_input_element.cc index 9ed5969..6be5a7ee 100644 --- a/third_party/blink/renderer/modules/media_controls/elements/media_control_input_element.cc +++ b/third_party/blink/renderer/modules/media_controls/elements/media_control_input_element.cc
@@ -82,7 +82,7 @@ MakeGarbageCollected<HTMLDivElement>(GetDocument()); overflow_menu_container_->ParserAppendChild(overflow_menu_text_); overflow_menu_container_->setAttribute(html_names::kAriaHiddenAttr, "true"); - aria_label_ = button->getAttribute(html_names::kAriaLabelAttr) + " " + + aria_label_ = button->FastGetAttribute(html_names::kAriaLabelAttr) + " " + button->GetOverflowMenuString(); UpdateOverflowSubtitleElement(button->GetOverflowMenuSubtitleString()); overflow_label_element_->ParserAppendChild(overflow_menu_container_); @@ -293,7 +293,7 @@ } bool MediaControlInputElement::IsDisabled() const { - return hasAttribute(html_names::kDisabledAttr); + return FastHasAttribute(html_names::kDisabledAttr); } void MediaControlInputElement::Trace(blink::Visitor* visitor) {
diff --git a/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc b/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc index cefff9b..41030d18 100644 --- a/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc +++ b/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc
@@ -736,35 +736,35 @@ if (state == kNoSource) { // Check if the play button or overflow menu has the "disabled" attribute // set so we avoid unnecessarily resetting it. - if (!play_button_->hasAttribute(html_names::kDisabledAttr)) { + if (!play_button_->FastHasAttribute(html_names::kDisabledAttr)) { play_button_->setAttribute(html_names::kDisabledAttr, ""); updated = true; } if (ShouldShowVideoControls() && - !overflow_menu_->hasAttribute(html_names::kDisabledAttr)) { + !overflow_menu_->FastHasAttribute(html_names::kDisabledAttr)) { overflow_menu_->setAttribute(html_names::kDisabledAttr, ""); updated = true; } } else { - if (play_button_->hasAttribute(html_names::kDisabledAttr)) { + if (play_button_->FastHasAttribute(html_names::kDisabledAttr)) { play_button_->removeAttribute(html_names::kDisabledAttr); updated = true; } - if (overflow_menu_->hasAttribute(html_names::kDisabledAttr)) { + if (overflow_menu_->FastHasAttribute(html_names::kDisabledAttr)) { overflow_menu_->removeAttribute(html_names::kDisabledAttr); updated = true; } } if (state == kNoSource || state == kNotLoaded) { - if (!timeline_->hasAttribute(html_names::kDisabledAttr)) { + if (!timeline_->FastHasAttribute(html_names::kDisabledAttr)) { timeline_->setAttribute(html_names::kDisabledAttr, ""); updated = true; } } else { - if (timeline_->hasAttribute(html_names::kDisabledAttr)) { + if (timeline_->FastHasAttribute(html_names::kDisabledAttr)) { timeline_->removeAttribute(html_names::kDisabledAttr); updated = true; } @@ -1195,7 +1195,7 @@ bool MediaControlsImpl::IsFullscreenEnabled() const { return fullscreen_button_->IsWanted() && - !fullscreen_button_->hasAttribute(html_names::kDisabledAttr); + !fullscreen_button_->FastHasAttribute(html_names::kDisabledAttr); } void MediaControlsImpl::RemotePlaybackStateChanged() { @@ -1314,7 +1314,7 @@ // The overflow menu is always wanted if it has the "disabled" attr set. overflow_wanted = overflow_wanted || - overflow_menu_->hasAttribute(html_names::kDisabledAttr); + overflow_menu_->FastHasAttribute(html_names::kDisabledAttr); overflow_menu_->SetDoesFit(overflow_wanted); overflow_menu_->SetIsWanted(overflow_wanted);
diff --git a/third_party/blink/renderer/modules/media_controls/media_controls_impl_test.cc b/third_party/blink/renderer/modules/media_controls/media_controls_impl_test.cc index 45a2ca0..09d7d83d 100644 --- a/third_party/blink/renderer/modules/media_controls/media_controls_impl_test.cc +++ b/third_party/blink/renderer/modules/media_controls/media_controls_impl_test.cc
@@ -1352,10 +1352,10 @@ TEST_F(MediaControlsImplTest, MediaControlsDisabledWithNoSource) { EXPECT_EQ(MediaControls().State(), MediaControlsImpl::kNoSource); - EXPECT_TRUE(PlayButtonElement()->hasAttribute(html_names::kDisabledAttr)); + EXPECT_TRUE(PlayButtonElement()->FastHasAttribute(html_names::kDisabledAttr)); EXPECT_TRUE( - OverflowMenuButtonElement()->hasAttribute(html_names::kDisabledAttr)); - EXPECT_TRUE(TimelineElement()->hasAttribute(html_names::kDisabledAttr)); + OverflowMenuButtonElement()->FastHasAttribute(html_names::kDisabledAttr)); + EXPECT_TRUE(TimelineElement()->FastHasAttribute(html_names::kDisabledAttr)); MediaControls().MediaElement().setAttribute(html_names::kPreloadAttr, "none"); MediaControls().MediaElement().SetSrc("https://example.com/foo.mp4"); @@ -1364,20 +1364,22 @@ EXPECT_EQ(MediaControls().State(), MediaControlsImpl::kNotLoaded); - EXPECT_FALSE(PlayButtonElement()->hasAttribute(html_names::kDisabledAttr)); EXPECT_FALSE( - OverflowMenuButtonElement()->hasAttribute(html_names::kDisabledAttr)); - EXPECT_TRUE(TimelineElement()->hasAttribute(html_names::kDisabledAttr)); + PlayButtonElement()->FastHasAttribute(html_names::kDisabledAttr)); + EXPECT_FALSE( + OverflowMenuButtonElement()->FastHasAttribute(html_names::kDisabledAttr)); + EXPECT_TRUE(TimelineElement()->FastHasAttribute(html_names::kDisabledAttr)); MediaControls().MediaElement().removeAttribute(html_names::kPreloadAttr); SimulateLoadedMetadata(); EXPECT_EQ(MediaControls().State(), MediaControlsImpl::kLoadingMetadataPaused); - EXPECT_FALSE(PlayButtonElement()->hasAttribute(html_names::kDisabledAttr)); EXPECT_FALSE( - OverflowMenuButtonElement()->hasAttribute(html_names::kDisabledAttr)); - EXPECT_FALSE(TimelineElement()->hasAttribute(html_names::kDisabledAttr)); + PlayButtonElement()->FastHasAttribute(html_names::kDisabledAttr)); + EXPECT_FALSE( + OverflowMenuButtonElement()->FastHasAttribute(html_names::kDisabledAttr)); + EXPECT_FALSE(TimelineElement()->FastHasAttribute(html_names::kDisabledAttr)); } TEST_F(MediaControlsImplTest, DoubleTouchChangesTime) {
diff --git a/third_party/blink/renderer/modules/modules_idl_files.gni b/third_party/blink/renderer/modules/modules_idl_files.gni index 5926682..855b532 100644 --- a/third_party/blink/renderer/modules/modules_idl_files.gni +++ b/third_party/blink/renderer/modules/modules_idl_files.gni
@@ -713,9 +713,9 @@ "payments/payment_instrument.idl", "payments/payment_item.idl", "payments/payment_method_change_event_init.idl", - "payments/payment_method_change_response.idl", "payments/payment_method_data.idl", "payments/payment_options.idl", + "payments/payment_request_details_update.idl", "payments/payment_request_event_init.idl", "payments/payment_request_update_event_init.idl", "payments/payment_shipping_option.idl",
diff --git a/third_party/blink/renderer/modules/native_file_system/BUILD.gn b/third_party/blink/renderer/modules/native_file_system/BUILD.gn index 40f5865..6f07c5a 100644 --- a/third_party/blink/renderer/modules/native_file_system/BUILD.gn +++ b/third_party/blink/renderer/modules/native_file_system/BUILD.gn
@@ -26,3 +26,23 @@ "//third_party/blink/renderer/platform", ] } + +jumbo_source_set("unit_tests") { + testonly = true + sources = [ + "window_native_file_system_test.cc", + ] + + configs += [ + "//third_party/blink/renderer:config", + "//third_party/blink/renderer:inside_blink", + "//third_party/blink/renderer/core:blink_core_pch", + ] + + deps = [ + "//testing/gtest", + "//third_party/blink/renderer/modules", + "//third_party/blink/renderer/platform", + "//third_party/blink/renderer/platform/wtf", + ] +}
diff --git a/third_party/blink/renderer/modules/native_file_system/window_native_file_system.cc b/third_party/blink/renderer/modules/native_file_system/window_native_file_system.cc index c4218a1..9e58736 100644 --- a/third_party/blink/renderer/modules/native_file_system/window_native_file_system.cc +++ b/third_party/blink/renderer/modules/native_file_system/window_native_file_system.cc
@@ -12,8 +12,10 @@ #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/dom_exception.h" +#include "third_party/blink/renderer/core/dom/user_gesture_indicator.h" #include "third_party/blink/renderer/core/fileapi/file_error.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" +#include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/modules/native_file_system/choose_file_system_entries_options.h" #include "third_party/blink/renderer/modules/native_file_system/choose_file_system_entries_options_accepts.h" #include "third_party/blink/renderer/modules/native_file_system/native_file_system_directory_handle.h" @@ -75,7 +77,8 @@ MakeGarbageCollected<DOMException>(DOMExceptionCode::kAbortError)); } - if (!window.GetFrame() || window.GetFrame()->IsCrossOriginSubframe()) { + LocalFrame* local_frame = window.GetFrame(); + if (!local_frame || local_frame->IsCrossOriginSubframe()) { return ScriptPromise::RejectWithDOMException( script_state, MakeGarbageCollected<DOMException>( @@ -83,7 +86,7 @@ "Cross origin sub frames aren't allowed to show a file picker.")); } - if (!LocalFrame::HasTransientUserActivation(window.GetFrame())) { + if (!LocalFrame::HasTransientUserActivation(local_frame)) { return ScriptPromise::RejectWithDOMException( script_state, MakeGarbageCollected<DOMException>( @@ -119,6 +122,7 @@ [](ScriptPromiseResolver* resolver, mojo::Remote<mojom::blink::NativeFileSystemManager>, const ChooseFileSystemEntriesOptions* options, + LocalFrame* local_frame, mojom::blink::NativeFileSystemErrorPtr file_operation_result, Vector<mojom::blink::NativeFileSystemEntryPtr> entries) { ExecutionContext* context = resolver->GetExecutionContext(); @@ -130,6 +134,17 @@ *file_operation_result); return; } + + // While it would be better to not trust the renderer process, + // we're doing this here to avoid potential mojo message pipe + // ordering problems, where the frame activation state + // reconciliation messages would compete with concurrent Native File + // System messages to the browser. + // TODO(https://crbug.com/1017270): Remove this after spec change, + // or when activation moves to browser. + LocalFrame::NotifyUserActivation(local_frame, + UserGestureToken::kNewGesture); + if (options->multiple()) { HeapVector<Member<NativeFileSystemHandle>> results; results.ReserveInitialCapacity(entries.size()); @@ -144,8 +159,8 @@ std::move(entries[0]), context)); } }, - WrapPersistent(resolver), std::move(manager), - WrapPersistent(options))); + WrapPersistent(resolver), std::move(manager), WrapPersistent(options), + WrapPersistent(local_frame))); return resolver_result; }
diff --git a/third_party/blink/renderer/modules/native_file_system/window_native_file_system_test.cc b/third_party/blink/renderer/modules/native_file_system/window_native_file_system_test.cc new file mode 100644 index 0000000..843eb9e --- /dev/null +++ b/third_party/blink/renderer/modules/native_file_system/window_native_file_system_test.cc
@@ -0,0 +1,226 @@ +// Copyright 2019 The Chromium 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 "third_party/blink/renderer/modules/native_file_system/window_native_file_system.h" + +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/receiver_set.h" +#include "services/service_manager/public/cpp/interface_provider.h" +#include "third_party/blink/public/common/browser_interface_broker_proxy.h" +#include "third_party/blink/public/mojom/native_file_system/native_file_system_directory_handle.mojom-blink.h" +#include "third_party/blink/public/mojom/native_file_system/native_file_system_error.mojom-blink.h" +#include "third_party/blink/public/mojom/native_file_system/native_file_system_file_handle.mojom-blink.h" +#include "third_party/blink/public/mojom/native_file_system/native_file_system_manager.mojom-blink.h" +#include "third_party/blink/renderer/bindings/core/v8/script_controller.h" +#include "third_party/blink/renderer/core/dom/user_gesture_indicator.h" +#include "third_party/blink/renderer/core/frame/local_frame.h" +#include "third_party/blink/renderer/core/frame/settings.h" +#include "third_party/blink/renderer/core/html/forms/html_button_element.h" +#include "third_party/blink/renderer/core/html/html_element.h" +#include "third_party/blink/renderer/core/testing/page_test_base.h" +#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h" + +namespace blink { + +class MockNativeFileSystemManager + : public mojom::blink::NativeFileSystemManager { + public: + MockNativeFileSystemManager(service_manager::InterfaceProvider* provider, + base::OnceClosure reached_callback) + : reached_callback_(std::move(reached_callback)), provider_(provider) { + service_manager::InterfaceProvider::TestApi(provider_).SetBinderForName( + mojom::blink::NativeFileSystemManager::Name_, + WTF::BindRepeating( + &MockNativeFileSystemManager::BindNativeFileSystemManager, + WTF::Unretained(this))); + } + MockNativeFileSystemManager(service_manager::InterfaceProvider* provider) + : provider_(provider) { + service_manager::InterfaceProvider::TestApi(provider_).SetBinderForName( + mojom::blink::NativeFileSystemManager::Name_, + WTF::BindRepeating( + &MockNativeFileSystemManager::BindNativeFileSystemManager, + WTF::Unretained(this))); + } + ~MockNativeFileSystemManager() override { + service_manager::InterfaceProvider::TestApi(provider_).SetBinderForName( + mojom::blink::NativeFileSystemManager::Name_, {}); + } + + using ChooseEntriesResponseCallback = + base::OnceCallback<void(ChooseEntriesCallback callback)>; + + void SetQuitClosure(base::OnceClosure reached_callback) { + reached_callback_ = std::move(reached_callback); + } + + // Unused for these tests. + void GetSandboxedFileSystem( + GetSandboxedFileSystemCallback callback) override {} + + void ChooseEntries( + mojom::ChooseFileSystemEntryType type, + WTF::Vector<mojom::blink::ChooseFileSystemEntryAcceptsOptionPtr> accepts, + bool include_accepts_all, + ChooseEntriesCallback callback) override { + if (choose_entries_response_callback_) { + std::move(choose_entries_response_callback_).Run(std::move(callback)); + } + + if (reached_callback_) + std::move(reached_callback_).Run(); + } + + void SetChooseEntriesResponse(ChooseEntriesResponseCallback callback) { + choose_entries_response_callback_ = std::move(callback); + } + + void GetFileHandleFromToken( + mojo::PendingRemote<mojom::blink::NativeFileSystemTransferToken>, + mojo::PendingReceiver<mojom::blink::NativeFileSystemFileHandle>) + override {} + + void GetDirectoryHandleFromToken( + mojo::PendingRemote<mojom::blink::NativeFileSystemTransferToken>, + mojo::PendingReceiver<mojom::blink::NativeFileSystemDirectoryHandle>) + override {} + + private: + void BindNativeFileSystemManager(mojo::ScopedMessagePipeHandle handle) { + receivers_.Add(this, + mojo::PendingReceiver<mojom::blink::NativeFileSystemManager>( + std::move(handle))); + } + + base::OnceClosure reached_callback_; + ChooseEntriesResponseCallback choose_entries_response_callback_; + mojo::ReceiverSet<mojom::blink::NativeFileSystemManager> receivers_; + service_manager::InterfaceProvider* provider_; +}; + +class WindowNativeFileSystemTest : public PageTestBase { + public: + void SetUp() override { + PageTestBase::SetUp(); + Navigate("http://localhost"); + GetDocument().GetSettings()->SetScriptEnabled(true); + } + + void Navigate(const String& destinationUrl) { + const KURL& url = KURL(NullURL(), destinationUrl); + auto navigation_params = + WebNavigationParams::CreateWithHTMLBuffer(SharedBuffer::Create(), url); + GetDocument().GetFrame()->Loader().CommitNavigation( + std::move(navigation_params), /*extra_data=*/nullptr); + blink::test::RunPendingTasks(); + ASSERT_EQ(url.GetString(), GetDocument().Url().GetString()); + } +}; + +TEST_F(WindowNativeFileSystemTest, UserActivationRequiredOtherwiseDenied) { + LocalFrame* frame = &GetFrame(); + EXPECT_FALSE(frame->HasBeenActivated()); + + MockNativeFileSystemManager manager(&frame->GetInterfaceProvider()); + manager.SetChooseEntriesResponse(WTF::Bind( + [](MockNativeFileSystemManager::ChooseEntriesCallback callback) { + FAIL(); + })); + GetFrame().GetScriptController().ExecuteScriptInMainWorld( + "window.chooseFileSystemEntries({type: 'openFile'});"); + base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(frame->HasBeenActivated()); +} + +TEST_F(WindowNativeFileSystemTest, UserActivationChooseEntriesSuccessful) { + LocalFrame* frame = &GetFrame(); + EXPECT_FALSE(frame->HasBeenActivated()); + + LocalFrame::NotifyUserActivation(frame, UserGestureToken::kNewGesture); + EXPECT_TRUE(frame->HasBeenActivated()); + + base::RunLoop manager_run_loop; + MockNativeFileSystemManager manager(&frame->GetInterfaceProvider(), + manager_run_loop.QuitClosure()); + manager.SetChooseEntriesResponse(WTF::Bind( + [](MockNativeFileSystemManager::ChooseEntriesCallback callback) { + auto error = mojom::blink::NativeFileSystemError::New(); + error->status = mojom::blink::NativeFileSystemStatus::kOk; + error->message = ""; + + mojo::PendingRemote<mojom::blink::NativeFileSystemFileHandle> + pending_remote; + ignore_result(pending_remote.InitWithNewPipeAndPassReceiver()); + auto handle = mojom::blink::NativeFileSystemHandle::NewFile( + std::move(pending_remote)); + auto entry = mojom::blink::NativeFileSystemEntry::New(std::move(handle), + "foo.txt"); + Vector<mojom::blink::NativeFileSystemEntryPtr> entries; + entries.push_back(std::move(entry)); + + std::move(callback).Run(std::move(error), std::move(entries)); + })); + GetFrame().GetScriptController().ExecuteScriptInMainWorld( + "window.chooseFileSystemEntries({type: 'openFile'});"); + manager_run_loop.Run(); + + // Mock Manager finished sending data over the mojo pipe. + // Clearing the user activation. + frame->ClearActivation(); + EXPECT_FALSE(frame->HasBeenActivated()); + + // Let blink-side receiver process the response and set the user activation + // again. + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(frame->HasBeenActivated()); +} + +TEST_F(WindowNativeFileSystemTest, UserActivationChooseEntriesErrors) { + LocalFrame* frame = &GetFrame(); + EXPECT_FALSE(frame->HasBeenActivated()); + + using mojom::blink::NativeFileSystemStatus; + + NativeFileSystemStatus statuses[] = { + NativeFileSystemStatus::kPermissionDenied, + NativeFileSystemStatus::kInvalidState, + NativeFileSystemStatus::kInvalidArgument, + NativeFileSystemStatus::kOperationFailed, + // kOperationAborted is when the user cancels the file selection. + NativeFileSystemStatus::kOperationAborted, + }; + MockNativeFileSystemManager manager(&frame->GetInterfaceProvider()); + + for (const NativeFileSystemStatus& status : statuses) { + LocalFrame::NotifyUserActivation(frame, UserGestureToken::kNewGesture); + EXPECT_TRUE(frame->HasBeenActivated()); + + base::RunLoop manager_run_loop; + manager.SetQuitClosure(manager_run_loop.QuitClosure()); + manager.SetChooseEntriesResponse(WTF::Bind( + [](mojom::blink::NativeFileSystemStatus status, + MockNativeFileSystemManager::ChooseEntriesCallback callback) { + auto error = mojom::blink::NativeFileSystemError::New(); + error->status = status; + error->message = ""; + Vector<mojom::blink::NativeFileSystemEntryPtr> entries; + + std::move(callback).Run(std::move(error), std::move(entries)); + }, + status)); + GetFrame().GetScriptController().ExecuteScriptInMainWorld( + "window.chooseFileSystemEntries({type: 'openFile'});"); + manager_run_loop.Run(); + + // Mock Manager finished sending data over the mojo pipe. + // Clearing the user activation. + frame->ClearActivation(); + EXPECT_FALSE(frame->HasBeenActivated()); + + base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(frame->HasBeenActivated()); + } +} + +} // namespace blink
diff --git a/third_party/blink/renderer/modules/payments/payment_method_change_response.idl b/third_party/blink/renderer/modules/payments/payment_method_change_response.idl deleted file mode 100644 index 46100b01..0000000 --- a/third_party/blink/renderer/modules/payments/payment_method_change_response.idl +++ /dev/null
@@ -1,17 +0,0 @@ -// Copyright 2019 The Chromium 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/payment-handler/#dom-paymentmethodchangeresponse -// Todo(sahel): Change the link to the updated spec. crbug.com/984694 -// Todo(sahel): Rename PaymentMethodChangeResponse to -// PaymentRequestDetailsUpdate which is a more generic name. crbug.com/984694 - -dictionary PaymentMethodChangeResponse { - DOMString error; - PaymentCurrencyAmount total; - FrozenArray<PaymentDetailsModifier> modifiers; - FrozenArray<PaymentShippingOption> shippingOptions; - object paymentMethodErrors; - AddressErrors shippingAddressErrors; -};
diff --git a/third_party/blink/renderer/modules/payments/payment_request_details_update.idl b/third_party/blink/renderer/modules/payments/payment_request_details_update.idl new file mode 100644 index 0000000..5654d80c --- /dev/null +++ b/third_party/blink/renderer/modules/payments/payment_request_details_update.idl
@@ -0,0 +1,14 @@ +// Copyright 2019 The Chromium 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/payment-handler/#the-paymentrequestdetailsupdate + +dictionary PaymentRequestDetailsUpdate { + DOMString error; + PaymentCurrencyAmount total; + FrozenArray<PaymentDetailsModifier> modifiers; + FrozenArray<PaymentShippingOption> shippingOptions; + object paymentMethodErrors; + AddressErrors shippingAddressErrors; +};
diff --git a/third_party/blink/renderer/modules/payments/payment_request_event.cc b/third_party/blink/renderer/modules/payments/payment_request_event.cc index 163e87e..5b284b4 100644 --- a/third_party/blink/renderer/modules/payments/payment_request_event.cc +++ b/third_party/blink/renderer/modules/payments/payment_request_event.cc
@@ -13,7 +13,7 @@ #include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/core/workers/worker_global_scope.h" #include "third_party/blink/renderer/core/workers/worker_location.h" -#include "third_party/blink/renderer/modules/payments/payment_method_change_response.h" +#include "third_party/blink/renderer/modules/payments/payment_request_details_update.h" #include "third_party/blink/renderer/modules/payments/payments_validators.h" #include "third_party/blink/renderer/modules/service_worker/respond_with_observer.h" #include "third_party/blink/renderer/modules/service_worker/service_worker_global_scope.h" @@ -338,11 +338,11 @@ } void PaymentRequestEvent::OnChangePaymentRequestDetailsResponse( - payments::mojom::blink::PaymentMethodChangeResponsePtr response) { + payments::mojom::blink::PaymentRequestDetailsUpdatePtr response) { if (!change_payment_request_details_resolver_) return; - auto* dictionary = MakeGarbageCollected<PaymentMethodChangeResponse>(); + auto* dictionary = MakeGarbageCollected<PaymentRequestDetailsUpdate>(); if (!response->error.IsNull() && !response->error.IsEmpty()) { dictionary->setError(response->error); }
diff --git a/third_party/blink/renderer/modules/payments/payment_request_event.h b/third_party/blink/renderer/modules/payments/payment_request_event.h index 6d65dbf..868d5c99 100644 --- a/third_party/blink/renderer/modules/payments/payment_request_event.h +++ b/third_party/blink/renderer/modules/payments/payment_request_event.h
@@ -79,7 +79,7 @@ private: void OnChangePaymentRequestDetailsResponse( - payments::mojom::blink::PaymentMethodChangeResponsePtr); + payments::mojom::blink::PaymentRequestDetailsUpdatePtr); void OnHostConnectionError(); String top_origin_;
diff --git a/third_party/blink/renderer/modules/payments/payment_request_event.idl b/third_party/blink/renderer/modules/payments/payment_request_event.idl index 2aac585f..21608ee 100644 --- a/third_party/blink/renderer/modules/payments/payment_request_event.idl +++ b/third_party/blink/renderer/modules/payments/payment_request_event.idl
@@ -20,8 +20,8 @@ [RuntimeEnabled=PaymentHandlerHandlesShippingAndContact] readonly attribute FrozenArray<PaymentShippingOption>? shippingOptions; [CallWith=ScriptState] Promise<WindowClient?> openWindow(USVString url); - [CallWith=ScriptState, RaisesException, RuntimeEnabled=PaymentHandlerChangePaymentMethod] Promise<PaymentMethodChangeResponse?> changePaymentMethod(DOMString methodName, optional object? methodDetails = null); + [CallWith=ScriptState, RaisesException, RuntimeEnabled=PaymentHandlerChangePaymentMethod] Promise<PaymentRequestDetailsUpdate?> changePaymentMethod(DOMString methodName, optional object? methodDetails = null); [CallWith=ScriptState, RaisesException] void respondWith(Promise<PaymentResponse> response); - [CallWith=ScriptState, RuntimeEnabled=PaymentHandlerHandlesShippingAndContact] Promise<PaymentMethodChangeResponse?> changeShippingAddress(PaymentAddressInit shippingAddress); - [CallWith=ScriptState, RuntimeEnabled=PaymentHandlerHandlesShippingAndContact] Promise<PaymentMethodChangeResponse?> changeShippingOption(DOMString shippingOption); + [CallWith=ScriptState, RuntimeEnabled=PaymentHandlerHandlesShippingAndContact] Promise<PaymentRequestDetailsUpdate?> changeShippingAddress(PaymentAddressInit shippingAddress); + [CallWith=ScriptState, RuntimeEnabled=PaymentHandlerHandlesShippingAndContact] Promise<PaymentRequestDetailsUpdate> changeShippingOption(DOMString shippingOption); };
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 7e4ab84..81f077d 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1090,6 +1090,9 @@ name: "NewRemotePlaybackPipeline", }, { + name: "NewSystemColors", + }, + { name: "NoIdleEncodingForWebTests", status: "test", }, @@ -1171,7 +1174,6 @@ }, { name: "OverlayScrollbars", - settable_from_internals: true, }, { name: "OverscrollCustomization", @@ -1211,6 +1213,11 @@ { name: "PassPaintVisualRectToCompositor", }, + // This is to add an option to enable the Reveal button on password inputs while waiting ::reveal gets standardized. + { + name: "PasswordReveal", + depends_on: ["FormControlsRefresh"], + }, { name: "PaymentApp", status: "experimental",
diff --git a/third_party/blink/web_tests/FlagExpectations/enable-blink-features=CompositeAfterPaint b/third_party/blink/web_tests/FlagExpectations/enable-blink-features=CompositeAfterPaint index f219e19..26430d1 100644 --- a/third_party/blink/web_tests/FlagExpectations/enable-blink-features=CompositeAfterPaint +++ b/third_party/blink/web_tests/FlagExpectations/enable-blink-features=CompositeAfterPaint
@@ -177,6 +177,7 @@ Bug(none) paint/invalidation/compositing/should-not-repaint-composited-opacity.html [ Failure ] Bug(none) paint/invalidation/compositing/should-not-repaint-move-backface-hidden.html [ Failure ] Bug(none) paint/invalidation/scroll/iframe-scroll-repaint.html [ Failure ] +Bug(none) paint/invalidation/scroll/repaint-composited-child-in-scrolled-container.html [ Failure ] Bug(none) paint/invalidation/position/layout-state-only-positioned.html [ Failure ] Bug(none) paint/invalidation/position/relative-positioned-movement-repaint.html [ Failure ]
diff --git a/third_party/blink/web_tests/NeverFixTests b/third_party/blink/web_tests/NeverFixTests index 6e0d8207..6de96f8 100644 --- a/third_party/blink/web_tests/NeverFixTests +++ b/third_party/blink/web_tests/NeverFixTests
@@ -2090,6 +2090,9 @@ crbug.com/870173 virtual/omt-worker-fetch/external/wpt/resource-timing/cors-preflight.any.worker.html [ WontFix ] crbug.com/870173 virtual/omt-worker-fetch/http/tests/workers/worker-redirect.html [ WontFix ] +# Windows doesn't have native overlay scrollbar +[ Win ] virtual/overlay-scrollbar [ WontFix ] + # Blink implements additional privacy measures that cause the regular test in # WPT to time out. # There is a version in wpt_internal that performs the same checks but works
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index e075468e..e369614c 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -349,6 +349,37 @@ Bug(intentional) external/wpt/webgpu/ [ Skip ] Bug(intentional) wpt_internal/webgpu/ [ Skip ] +crbug.com/1018273 [ Mac ] compositing/gestures/gesture-tapHighlight-1-iframe-scrolled.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/gestures/gesture-tapHighlight-1-iframe.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/gestures/gesture-tapHighlight-2-iframe-composited-inner.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/gestures/gesture-tapHighlight-2-iframe-composited-outer.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-inner-late-composite.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-inner.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-outer-late-composite.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-outer.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/gestures/gesture-tapHighlight-2-iframe.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/iframe-graphics-tree-changes-parents-does-not.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/low-dpi-non-stacking-context-scrolled-content.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/overflow/ancestor-overflow-layer-of-sticky-child-of-compositing-container.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/overflow/composited-scroller-can-be-normal-flow.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/overflow/nested-vertical-rl-overflow.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/overflow/overflow-scroll-background-fractional-offset.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/overflow/overflow-scroll-content-fractional-offset.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/overflow/overflow-scroll-with-local-background-and-child.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/overflow/overflow-scroll-with-negative-offset-translucent-outline.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/overflow/overlap-testing-ancestor-scroller-high-dpi.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/overflow/scroll-children-do-not-paint-comp-scroll-phase.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/rtl/rtl-and-writing-mode-scrolling.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/squashing/attempting-to-squash-into-compositing-container.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/squashing/attempting-to-squash-into-stacking-ancestor.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/squashing/squashing-does-not-stop-transform-propagation.html [ Failure ] +crbug.com/1018273 [ Mac ] compositing/squashing/universal-accelerated-overflow-scrolling.html [ Failure ] +crbug.com/1018273 [ Mac ] paint/invalidation/compositing/iframe-clip-removed.html [ Failure ] +crbug.com/1018273 [ Mac ] paint/invalidation/compositing/should-not-paint-outline-on-foreground-layer.html [ Failure ] +crbug.com/1018273 [ Mac ] paint/invalidation/compositing/should-not-repaint-scrolling-contents-outline-change.html [ Failure ] +crbug.com/1018273 [ Mac ] paint/invalidation/compositing/stop-painting-onto-scrolling-contents.html [ Failure ] +crbug.com/1018273 [ Mac ] paint/overflow/composited-scroll-vertical-rl.html [ Failure ] + # ====== Paint team owned tests to here ====== crbug.com/922249 virtual/android/fullscreen/compositor-touch-hit-rects-fullscreen-video-controls.html [ Failure Pass ] @@ -2633,6 +2664,18 @@ crbug.com/1012627 [ Win7 ] external/wpt/css/css-text/line-breaking/line-breaking-021.html [ Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 [ Linux ] external/wpt/css/css-overflow/dynamic-visible-to-clip-001.html [ Failure ] +crbug.com/626703 [ Mac ] external/wpt/css/css-overflow/dynamic-visible-to-clip-001.html [ Failure ] +crbug.com/626703 [ Win ] external/wpt/css/css-overflow/dynamic-visible-to-clip-001.html [ Failure ] +crbug.com/626703 [ Linux ] external/wpt/css/css-overflow/clip-001.html [ Failure ] +crbug.com/626703 [ Mac ] external/wpt/css/css-overflow/clip-001.html [ Failure ] +crbug.com/626703 [ Win ] external/wpt/css/css-overflow/clip-001.html [ Failure ] +crbug.com/626703 [ Linux ] external/wpt/css/cssom-view/MediaQueryList-addListener-handleEvent.html [ Timeout ] +crbug.com/626703 [ Mac ] external/wpt/css/cssom-view/MediaQueryList-addListener-handleEvent.html [ Timeout ] +crbug.com/626703 [ Win ] external/wpt/css/cssom-view/MediaQueryList-addListener-handleEvent.html [ Timeout ] +crbug.com/626703 [ Linux ] external/wpt/css/css-grid/grid-child-percent-basis-resize-1.html [ Failure ] +crbug.com/626703 [ Mac ] external/wpt/css/css-grid/grid-child-percent-basis-resize-1.html [ Failure ] +crbug.com/626703 [ Win ] external/wpt/css/css-grid/grid-child-percent-basis-resize-1.html [ Failure ] crbug.com/626703 [ Linux ] external/wpt/fetch/corb/script-resource-with-nonsniffable-types.tentative.sub.html [ Timeout ] crbug.com/626703 [ Mac ] external/wpt/fetch/corb/script-resource-with-nonsniffable-types.tentative.sub.html [ Timeout ] crbug.com/626703 [ Win ] external/wpt/fetch/corb/script-resource-with-nonsniffable-types.tentative.sub.html [ Timeout ] @@ -3466,7 +3509,6 @@ crbug.com/626703 external/wpt/css/css-tables/floats/floats-wrap-bfc-006b.xht [ Failure ] crbug.com/626703 external/wpt/css/css-tables/floats/floats-wrap-bfc-006c.xht [ Failure ] crbug.com/626703 external/wpt/css/css-ui/text-overflow-021.html [ Failure ] -crbug.com/626703 external/wpt/css/cssom-view/matchMedia.xht [ Timeout ] crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-align-self-baseline-horiz-001a.xhtml [ Failure ] crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-align-self-baseline-horiz-001b.xhtml [ Failure ] crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-align-self-baseline-horiz-006.xhtml [ Failure ] @@ -5722,10 +5764,10 @@ crbug.com/1008218 http/tests/devtools/security/security-state-comparator.js [ Failure ] # Sheriff 2019-10-25 -crbug.com/1018027 [ Mac ] virtual/threaded-no-composited-antialiasing/animations/custom-properties/registered-var-to-unregistered.html [ Pass Crash ] -crbug.com/1018027 [ Mac ] virtual/threaded-no-composited-antialiasing/animations/custom-properties/registered-var-fallback.html [ Pass Crash ] -crbug.com/1018027 [ Mac ] virtual/threaded-no-composited-antialiasing/animations/custom-properties/registered-var-to-registered-animating.html [ Pass Crash ] -crbug.com/1018027 [ Mac ] virtual/threaded-no-composited-antialiasing/animations/custom-properties/registered-var-to-unregistered-animating.html [ Pass Crash ] +crbug.com/1018027 virtual/threaded-no-composited-antialiasing/animations/custom-properties/registered-var-to-unregistered.html [ Pass Crash ] +crbug.com/1018027 virtual/threaded-no-composited-antialiasing/animations/custom-properties/registered-var-fallback.html [ Pass Crash ] +crbug.com/1018027 virtual/threaded-no-composited-antialiasing/animations/custom-properties/registered-var-to-registered-animating.html [ Pass Crash ] +crbug.com/1018027 virtual/threaded-no-composited-antialiasing/animations/custom-properties/registered-var-to-unregistered-animating.html [ Pass Crash ] crbug.com/1018064 [ Mac10.13 ] virtual/threaded/http/tests/devtools/tracing/timeline-js/timeline-js-line-level-profile-end-to-end.js [ Pass Timeout ] # Temporarily disabled for landing coverage changes in DevTools
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 39a176b..29802f8 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -1140,5 +1140,15 @@ "prefix": "import-maps-without-builtin-modules", "base": "external/wpt/import-maps", "args": ["--enable-blink-features=ImportMaps", "--disable-blink-features=ExperimentalProductivityFeatures"] + }, + { + "prefix": "overlay-scrollbar", + "base": "tests", + "args": ["--enable-features=OverlayScrollbar"] + }, + { + "prefix": "non-overlay-scrollbar", + "base": "tests", + "args": ["--disable-features=OverlayScrollbar"] } ]
diff --git a/third_party/blink/web_tests/compositing/culling/filter-occlusion-alpha-large-expected.png b/third_party/blink/web_tests/compositing/culling/filter-occlusion-alpha-large-expected.png index 11304d4..a792814 100644 --- a/third_party/blink/web_tests/compositing/culling/filter-occlusion-alpha-large-expected.png +++ b/third_party/blink/web_tests/compositing/culling/filter-occlusion-alpha-large-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/draws-content/canvas-background-layer.html b/third_party/blink/web_tests/compositing/draws-content/canvas-background-layer.html index 3b18b1b..a0d5a06 100644 --- a/third_party/blink/web_tests/compositing/draws-content/canvas-background-layer.html +++ b/third_party/blink/web_tests/compositing/draws-content/canvas-background-layer.html
@@ -22,6 +22,8 @@ <script> if (window.testRunner) testRunner.dumpAsText(); + if (window.internals) + internals.runtimeFlags.accelerated2dCanvasEnabled = true; function drawCanvas(canvasID, hasAlpha) { var canvas = document.getElementById(canvasID);
diff --git a/third_party/blink/web_tests/compositing/draws-content/canvas-simple-background.html b/third_party/blink/web_tests/compositing/draws-content/canvas-simple-background.html index 7c4aa19b..814919b 100644 --- a/third_party/blink/web_tests/compositing/draws-content/canvas-simple-background.html +++ b/third_party/blink/web_tests/compositing/draws-content/canvas-simple-background.html
@@ -13,6 +13,9 @@ } </style> <script> + if (window.internals) + internals.runtimeFlags.accelerated2dCanvasEnabled = true; + function drawCanvas(canvasID) { var canvas = document.getElementById(canvasID); var context = canvas.getContext("2d");
diff --git a/third_party/blink/web_tests/compositing/fixed-background-after-style-recalc-expected.png b/third_party/blink/web_tests/compositing/fixed-background-after-style-recalc-expected.png index e6a183b..bc39150 100644 --- a/third_party/blink/web_tests/compositing/fixed-background-after-style-recalc-expected.png +++ b/third_party/blink/web_tests/compositing/fixed-background-after-style-recalc-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/fixed-body-background-positioned-expected.png b/third_party/blink/web_tests/compositing/fixed-body-background-positioned-expected.png index 54e022a..dd307e379 100644 --- a/third_party/blink/web_tests/compositing/fixed-body-background-positioned-expected.png +++ b/third_party/blink/web_tests/compositing/fixed-body-background-positioned-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/geometry/fixed-position.html b/third_party/blink/web_tests/compositing/geometry/fixed-position.html index 41e36ac..8fe05f3b 100644 --- a/third_party/blink/web_tests/compositing/geometry/fixed-position.html +++ b/third_party/blink/web_tests/compositing/geometry/fixed-position.html
@@ -5,7 +5,6 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Position fixed</title> - <script src="../resources/mock_scrollbars.js"></script> <style type="text/css" media="screen"> ::-webkit-scrollbar { width: 0px;
diff --git a/third_party/blink/web_tests/compositing/geometry/horizontal-scroll-composited-expected.png b/third_party/blink/web_tests/compositing/geometry/horizontal-scroll-composited-expected.png index 4c4b1ce5..87cfd7c6 100644 --- a/third_party/blink/web_tests/compositing/geometry/horizontal-scroll-composited-expected.png +++ b/third_party/blink/web_tests/compositing/geometry/horizontal-scroll-composited-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/geometry/horizontal-scroll-composited.html b/third_party/blink/web_tests/compositing/geometry/horizontal-scroll-composited.html index 8b9e345..a44facef 100644 --- a/third_party/blink/web_tests/compositing/geometry/horizontal-scroll-composited.html +++ b/third_party/blink/web_tests/compositing/geometry/horizontal-scroll-composited.html
@@ -5,7 +5,6 @@ if (window.testRunner) testRunner.waitUntilDone(); </script> - <script src="../resources/mock_scrollbars.js"></script> </head> <body style="width: 600px"> <div style="transform: translatez(0); width: 1000px; height: 800px; border-style: solid; border-color: Red; border-width: 3px; background-image: url(../resources/apple.jpg); background-repeat:repeat"></div>
diff --git a/third_party/blink/web_tests/compositing/geometry/tall-page-composited-expected.png b/third_party/blink/web_tests/compositing/geometry/tall-page-composited-expected.png index feaeecc..30cd326 100644 --- a/third_party/blink/web_tests/compositing/geometry/tall-page-composited-expected.png +++ b/third_party/blink/web_tests/compositing/geometry/tall-page-composited-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/gestures/gesture-tapHighlight-on-promoted-overflow-div-scrolled-expected.html b/third_party/blink/web_tests/compositing/gestures/gesture-tapHighlight-on-promoted-overflow-div-scrolled-expected.html index 39aaee6..35e3aa60 100644 --- a/third_party/blink/web_tests/compositing/gestures/gesture-tapHighlight-on-promoted-overflow-div-scrolled-expected.html +++ b/third_party/blink/web_tests/compositing/gestures/gesture-tapHighlight-on-promoted-overflow-div-scrolled-expected.html
@@ -2,18 +2,19 @@ <html> <head> <link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css"> - <script src="../../compositing/overflow/resources/automatically-opt-into-composited-scrolling.js"></script> + <script src="resources/link-highlight-helper.js"></script> <script> + if (window.internals) + internals.settings.setPreferCompositingToLCDTextEnabled(true); function runTest() { var targetDiv = document.getElementById('targetDiv'); targetDiv.scrollTop += 20; createCompositedHighlight(document.getElementById('targetLink')); } </script> - <script src="resources/link-highlight-helper.js"></script> </head> <body onload="runTest();"> - <div style="transform: translateZ(0); position: relative; left: 10px; top: 10px"></div> + <div style="will-change: transform; position: relative; left: 10px; top: 10px"></div> <div id="targetDiv" style="position: relative; left: 10px; top: 40px; width: 200px; height: 100px; overflow-y: scroll; overflow-x: scroll;"> <a href="">AAAAAA</a><br> <a href="">AAAAAA</a><br>
diff --git a/third_party/blink/web_tests/compositing/gestures/gesture-tapHighlight-on-promoted-overflow-div-scrolled.html b/third_party/blink/web_tests/compositing/gestures/gesture-tapHighlight-on-promoted-overflow-div-scrolled.html index 02da16c2..1549f609 100644 --- a/third_party/blink/web_tests/compositing/gestures/gesture-tapHighlight-on-promoted-overflow-div-scrolled.html +++ b/third_party/blink/web_tests/compositing/gestures/gesture-tapHighlight-on-promoted-overflow-div-scrolled.html
@@ -34,7 +34,7 @@ </script> </head> <body onload="runTest();"> - <div style="transform: translateZ(0); position: relative; left: 10px; top: 10px"></div> + <div style="will-change: transform; position: relative; left: 10px; top: 10px"></div> <div id="targetDiv" style="position: relative; left: 10px; top: 40px; width: 200px; height: 100px; overflow-y: scroll; overflow-x: scroll;"> <a href="">AAAAAA</a><br> <a href="">AAAAAA</a><br>
diff --git a/third_party/blink/web_tests/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png b/third_party/blink/web_tests/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png deleted file mode 100644 index f55d9fc..0000000 --- a/third_party/blink/web_tests/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/compositing/gestures/resources/1-frame-composited-expected.html b/third_party/blink/web_tests/compositing/gestures/resources/1-frame-composited-expected.html index 8b8636f..9e77ee70 100644 --- a/third_party/blink/web_tests/compositing/gestures/resources/1-frame-composited-expected.html +++ b/third_party/blink/web_tests/compositing/gestures/resources/1-frame-composited-expected.html
@@ -1,12 +1,12 @@ <!DOCTYPE html> <head> <link rel="stylesheet" type="text/css" href="link-highlight-style.css"> -</head> <style> #divToControlCompositing { font-family: sans-serif; } </style> +</head> <body> -<div id="divToControlCompositing" style="transform: translateZ(0);"> +<div id="divToControlCompositing" style="will-change: transform;"> <a href="">Link 1</a><br> <a href="">Link 2</a><br> <a href="">Link 3</a><br>
diff --git a/third_party/blink/web_tests/compositing/iframes/iframe-in-composited-layer-expected.png b/third_party/blink/web_tests/compositing/iframes/iframe-in-composited-layer-expected.png index d104b76..4f2e006 100644 --- a/third_party/blink/web_tests/compositing/iframes/iframe-in-composited-layer-expected.png +++ b/third_party/blink/web_tests/compositing/iframes/iframe-in-composited-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/iframes/resources/scrollgrandchild-inner.html b/third_party/blink/web_tests/compositing/iframes/resources/scrollgrandchild-inner.html index f7a15d1..2a9a249b 100644 --- a/third_party/blink/web_tests/compositing/iframes/resources/scrollgrandchild-inner.html +++ b/third_party/blink/web_tests/compositing/iframes/resources/scrollgrandchild-inner.html
@@ -23,9 +23,6 @@ } </style> <script> - if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); - function doTest() { runAfterLayoutAndPaint(function() {
diff --git a/third_party/blink/web_tests/compositing/img-layer-grow.html b/third_party/blink/web_tests/compositing/img-layer-grow.html index 57f9b03..c951ed5 100644 --- a/third_party/blink/web_tests/compositing/img-layer-grow.html +++ b/third_party/blink/web_tests/compositing/img-layer-grow.html
@@ -2,7 +2,6 @@ <html> <head> <script src="../resources/run-after-layout-and-paint.js"></script> -<script src="resources/mock_scrollbars.js"></script> <script type="text/javascript" charset="utf-8"> function doTest() {
diff --git a/third_party/blink/web_tests/compositing/layer-creation/spanOverlapsCanvas.html b/third_party/blink/web_tests/compositing/layer-creation/spanOverlapsCanvas.html index 6cee04a..a8e3f41 100644 --- a/third_party/blink/web_tests/compositing/layer-creation/spanOverlapsCanvas.html +++ b/third_party/blink/web_tests/compositing/layer-creation/spanOverlapsCanvas.html
@@ -5,6 +5,8 @@ <meta name="viewport" content="width=480"/> <script> + if (window.internals) + internals.runtimeFlags.accelerated2dCanvasEnabled = true; function init() { var ctx = document.getElementById("world").getContext("2d");
diff --git a/third_party/blink/web_tests/compositing/overflow/accelerated-scrolling-with-clip-path-expected.png b/third_party/blink/web_tests/compositing/overflow/accelerated-scrolling-with-clip-path-expected.png index ab83797..d8c812c2 100644 --- a/third_party/blink/web_tests/compositing/overflow/accelerated-scrolling-with-clip-path-expected.png +++ b/third_party/blink/web_tests/compositing/overflow/accelerated-scrolling-with-clip-path-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/overflow/ancestor-overflow-layer-of-sticky-child-of-compositing-container-expected.html b/third_party/blink/web_tests/compositing/overflow/ancestor-overflow-layer-of-sticky-child-of-compositing-container-expected.html index 7747a43..9a34724 100644 --- a/third_party/blink/web_tests/compositing/overflow/ancestor-overflow-layer-of-sticky-child-of-compositing-container-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/ancestor-overflow-layer-of-sticky-child-of-compositing-container-expected.html
@@ -18,7 +18,7 @@ <div class="composited"> Ref text. - <div class="container"> + <div class="composited container"> <div> This line should line up with the text above. </div>
diff --git a/third_party/blink/web_tests/compositing/overflow/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.png b/third_party/blink/web_tests/compositing/overflow/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.png index 6ad0c16..aaf620f 100644 --- a/third_party/blink/web_tests/compositing/overflow/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.png +++ b/third_party/blink/web_tests/compositing/overflow/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-deep-expected.html b/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-deep-expected.html index fb8b67c..75ca3b9 100644 --- a/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-deep-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-deep-expected.html
@@ -4,6 +4,8 @@ } .scroller { + will-change: transform; + overflow: auto; width: 200px; height: 500px;
diff --git a/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-left-expected.html b/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-left-expected.html index c738c0f..3363636 100644 --- a/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-left-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-left-expected.html
@@ -10,6 +10,8 @@ } .scroller { + will-change: transform; + overflow: auto; width: 350px; height: 180px;
diff --git a/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-table-expected.html b/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-table-expected.html index 53be703..853a9f5b 100644 --- a/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-table-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-table-expected.html
@@ -4,6 +4,8 @@ } .scroller { + will-change: transform; + overflow: auto; width: 100px; height: 200px;
diff --git a/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-top-expected.html b/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-top-expected.html index 03a4030..e75c1bc 100644 --- a/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-top-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/composited-nested-sticky-top-expected.html
@@ -11,6 +11,8 @@ } .scroller { + will-change: transform; + overflow: auto; width: 200px; height: 350px;
diff --git a/third_party/blink/web_tests/compositing/overflow/composited-scroll-background-obscured-expected.html b/third_party/blink/web_tests/compositing/overflow/composited-scroll-background-obscured-expected.html index 44c97e5..993c4a1 100644 --- a/third_party/blink/web_tests/compositing/overflow/composited-scroll-background-obscured-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/composited-scroll-background-obscured-expected.html
@@ -1,5 +1,5 @@ <!doctype HTML> -<div id="target" style="height: 100%; overflow-y:scroll; background-color: yellow; width: 200px; height: 200px;"> +<div id="target" style="height: 100%; overflow-y:scroll; background-color: yellow; will-change: transform; width: 200px; height: 200px;"> <div style="width: 200px; height: 400px;"></div> </div> <script>
diff --git a/third_party/blink/web_tests/compositing/overflow/composited-scroll-background-obscured.html b/third_party/blink/web_tests/compositing/overflow/composited-scroll-background-obscured.html index 4fdf6c05..c4ab9d49 100644 --- a/third_party/blink/web_tests/compositing/overflow/composited-scroll-background-obscured.html +++ b/third_party/blink/web_tests/compositing/overflow/composited-scroll-background-obscured.html
@@ -1,5 +1,5 @@ <!doctype HTML> -<div id="target" style="height: 100%; overflow-y:scroll; background-color: yellow; transform: translateZ(0); width: 200px; height: 200px;"> +<div id="target" style="height: 100%; overflow-y:scroll; background-color: yellow; will-change: transform; width: 200px; height: 200px;"> <div style="background: lightgray; width: 200px; height: 200px;"></div> <div style="width: 200px; height: 200px"></div> </div>
diff --git a/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-enclosing-layers-expected.html b/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-enclosing-layers-expected.html index 0f62daf9..4102505b 100644 --- a/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-enclosing-layers-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-enclosing-layers-expected.html
@@ -4,6 +4,11 @@ } </script> <style> +.composited { + /* Triggers promotion without creating stacking context. */ + backface-visibility: hidden; +} + #scroller { overflow: scroll; height: 200px; @@ -22,7 +27,7 @@ background: green; } </style> -<div id="scroller"> +<div id="scroller" class="composited"> <div class="container"> <div class="relative"></div> </div>
diff --git a/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-enclosing-layers-stacking-context-expected.html b/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-enclosing-layers-stacking-context-expected.html index 0f62daf9..ae5c8c0 100644 --- a/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-enclosing-layers-stacking-context-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-enclosing-layers-stacking-context-expected.html
@@ -4,6 +4,11 @@ } </script> <style> +.composited { + /* Triggers promotion and creates a stacking context */ + will-change: transform; +} + #scroller { overflow: scroll; height: 200px; @@ -22,7 +27,7 @@ background: green; } </style> -<div id="scroller"> +<div id="scroller" class="composited"> <div class="container"> <div class="relative"></div> </div>
diff --git a/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-expected.html b/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-expected.html index 356061f..81ac496 100644 --- a/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-expected.html
@@ -4,6 +4,11 @@ } </script> <style> +.composited { + /* Triggers promotion without creating stacking context. */ + backface-visibility: hidden; +} + #scroller { background: white; height: 200px; @@ -20,7 +25,7 @@ height: 2000px; } </style> -<div id="scroller"> +<div id="scroller" class="composited"> <div class="sticky"></div> <div class="spacer"></div> </div>
diff --git a/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-in-composited-ancestor-with-content-offset-expected.html b/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-in-composited-ancestor-with-content-offset-expected.html index d31eecd..ff9cde0b 100644 --- a/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-in-composited-ancestor-with-content-offset-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-in-composited-ancestor-with-content-offset-expected.html
@@ -17,10 +17,14 @@ height: 200px; top: 0; } + +.composited { + backface-visibility: hidden; +} </style> <div class="container"> - <div class="scroller"> + <div class="composited scroller"> <div class="sticky"></div> </div> </div>
diff --git a/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-perspective-child-layer-expected.html b/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-perspective-child-layer-expected.html index 7afac4de..f397b71 100644 --- a/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-perspective-child-layer-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-perspective-child-layer-expected.html
@@ -2,6 +2,10 @@ <title>Reference for a composited child of a perspective sticky element should work correctly</title> <style> +.composited { + backface-visibility: hidden; +} + .scroller { overflow-y: scroll; height: 100px; @@ -26,7 +30,7 @@ }); </script> -<div class="scroller"> +<div class="composited scroller"> <div class="marker"></div> <div class="padding"></div> </div>
diff --git a/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-stacking-context-expected.html b/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-stacking-context-expected.html index 356061f..4837d54 100644 --- a/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-stacking-context-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/composited-sticky-element-stacking-context-expected.html
@@ -4,6 +4,11 @@ } </script> <style> +.composited { + /* Triggers promotion and creates a stacking context */ + will-change: transform; +} + #scroller { background: white; height: 200px; @@ -20,7 +25,7 @@ height: 2000px; } </style> -<div id="scroller"> +<div id="scroller" class="composited"> <div class="sticky"></div> <div class="spacer"></div> </div>
diff --git a/third_party/blink/web_tests/compositing/overflow/fixed-position-ancestor-clip.html b/third_party/blink/web_tests/compositing/overflow/fixed-position-ancestor-clip.html index 69cbb35..2f8394f 100644 --- a/third_party/blink/web_tests/compositing/overflow/fixed-position-ancestor-clip.html +++ b/third_party/blink/web_tests/compositing/overflow/fixed-position-ancestor-clip.html
@@ -38,7 +38,6 @@ window.scrollBy(50, 50); }, false); </script> - <script src="../resources/mock_scrollbars.js"></script> </head> <body>
diff --git a/third_party/blink/web_tests/compositing/overflow/fractional-sized-scrolling-layer-expected.png b/third_party/blink/web_tests/compositing/overflow/fractional-sized-scrolling-layer-expected.png index 0b35de8..f292ad5 100644 --- a/third_party/blink/web_tests/compositing/overflow/fractional-sized-scrolling-layer-expected.png +++ b/third_party/blink/web_tests/compositing/overflow/fractional-sized-scrolling-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/overflow/image-load-overflow-scrollbars-expected.png b/third_party/blink/web_tests/compositing/overflow/image-load-overflow-scrollbars-expected.png index 07f16ba9..bc8dda99 100644 --- a/third_party/blink/web_tests/compositing/overflow/image-load-overflow-scrollbars-expected.png +++ b/third_party/blink/web_tests/compositing/overflow/image-load-overflow-scrollbars-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/overflow/nested-render-surfaces-expected.png b/third_party/blink/web_tests/compositing/overflow/nested-render-surfaces-expected.png index 825aa9b6..cb166b1 100644 --- a/third_party/blink/web_tests/compositing/overflow/nested-render-surfaces-expected.png +++ b/third_party/blink/web_tests/compositing/overflow/nested-render-surfaces-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/overflow/nested-render-surfaces-with-intervening-clip-expected.png b/third_party/blink/web_tests/compositing/overflow/nested-render-surfaces-with-intervening-clip-expected.png index c1a22d1c..e933d031 100644 --- a/third_party/blink/web_tests/compositing/overflow/nested-render-surfaces-with-intervening-clip-expected.png +++ b/third_party/blink/web_tests/compositing/overflow/nested-render-surfaces-with-intervening-clip-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/overflow/non-reparented-overlay-scrollbars-expected.html b/third_party/blink/web_tests/compositing/overflow/non-reparented-overlay-scrollbars-expected.html index e5721202..33b577a9 100644 --- a/third_party/blink/web_tests/compositing/overflow/non-reparented-overlay-scrollbars-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/non-reparented-overlay-scrollbars-expected.html
@@ -1,4 +1,10 @@ <!DOCTYPE HTML> +<script> +if (window.internals) { + internals.useMockOverlayScrollbars(); + internals.settings.setPreferCompositingToLCDTextEnabled(false); +} +</script> <style> #scroller { overflow: scroll; @@ -21,12 +27,6 @@ height: 500px; } </style> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setPreferCompositingToLCDTextEnabled(false); -} -</script> <div id='scroller'> <div id='fixed'></div> <div id='scrolled'></div>
diff --git a/third_party/blink/web_tests/compositing/overflow/non-reparented-overlay-scrollbars.html b/third_party/blink/web_tests/compositing/overflow/non-reparented-overlay-scrollbars.html index 2d02874..1ebb61a2 100644 --- a/third_party/blink/web_tests/compositing/overflow/non-reparented-overlay-scrollbars.html +++ b/third_party/blink/web_tests/compositing/overflow/non-reparented-overlay-scrollbars.html
@@ -1,4 +1,8 @@ <!DOCTYPE HTML> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <style> #scroller { overflow: scroll; @@ -21,10 +25,6 @@ height: 500px; } </style> -<script> -if (window.internals) - internals.runtimeFlags.overlayScrollbarsEnabled = true; -</script> <div id='scroller'> <div id='fixed'></div> <div id='scrolled'></div>
diff --git a/third_party/blink/web_tests/compositing/overflow/overflow-clip-with-accelerated-scrolling-ancestor-expected.png b/third_party/blink/web_tests/compositing/overflow/overflow-clip-with-accelerated-scrolling-ancestor-expected.png index 85626c6..b5788b8 100644 --- a/third_party/blink/web_tests/compositing/overflow/overflow-clip-with-accelerated-scrolling-ancestor-expected.png +++ b/third_party/blink/web_tests/compositing/overflow/overflow-clip-with-accelerated-scrolling-ancestor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/overflow/overflow-scroll-with-local-image-background-expected.png b/third_party/blink/web_tests/compositing/overflow/overflow-scroll-with-local-image-background-expected.png index 5707b23..84b4e0f 100644 --- a/third_party/blink/web_tests/compositing/overflow/overflow-scroll-with-local-image-background-expected.png +++ b/third_party/blink/web_tests/compositing/overflow/overflow-scroll-with-local-image-background-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-appear-without-compositing-expected.html b/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-appear-without-compositing-expected.html index 8d3b5c1..2a0951b1 100644 --- a/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-appear-without-compositing-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-appear-without-compositing-expected.html
@@ -1,4 +1,10 @@ <!DOCTYPE HTML> +<script> +if (window.internals) { + internals.useMockOverlayScrollbars(); + internals.settings.setPreferCompositingToLCDTextEnabled(true); +} +</script> <style> #container { -webkit-box-reflect: below; @@ -34,11 +40,6 @@ } </style> <script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setPreferCompositingToLCDTextEnabled(true); -} - if (window.testRunner) testRunner.dumpAsTextWithPixelResults();
diff --git a/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-appear-without-compositing.html b/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-appear-without-compositing.html index 90a1d09..c9d7a4d4 100644 --- a/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-appear-without-compositing.html +++ b/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-appear-without-compositing.html
@@ -1,4 +1,10 @@ <!DOCTYPE HTML> +<script> +if (window.internals) { + internals.useMockOverlayScrollbars(); + internals.settings.setPreferCompositingToLCDTextEnabled(false); +} +</script> <style> #container { -webkit-box-reflect: below; @@ -33,12 +39,6 @@ background: green; } </style> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setPreferCompositingToLCDTextEnabled(false); -} -</script> <div id="container"> <div id="clipper"> <div id="scroller">
diff --git a/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip-expected.html b/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip-expected.html index ded912a..f9c6f1f6 100644 --- a/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip-expected.html
@@ -1,4 +1,10 @@ <!DOCTYPE HTML> +<script> +if (window.internals) { + internals.useMockOverlayScrollbars(); + internals.settings.setPreferCompositingToLCDTextEnabled(false); +} +</script> <style> #container { -webkit-box-reflect: below; @@ -35,11 +41,6 @@ } </style> <script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setPreferCompositingToLCDTextEnabled(false); -} - if (window.testRunner) testRunner.dumpAsTextWithPixelResults();
diff --git a/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html b/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html index 0ccc041..12656dba 100644 --- a/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html +++ b/third_party/blink/web_tests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html
@@ -3,6 +3,12 @@ This test ensures that reflected overlay scrollbars still render correctly when reflected. --> +<script> +if (window.internals) { + internals.useMockOverlayScrollbars(); + internals.settings.setPreferCompositingToLCDTextEnabled(true); +} +</script> <style> #container { -webkit-box-reflect: below; @@ -39,12 +45,6 @@ background: green; } </style> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setPreferCompositingToLCDTextEnabled(true); -} -</script> <div id="container"> <div id="clipper"> <div id="scroller">
diff --git a/third_party/blink/web_tests/compositing/overflow/reparented-overlay-scrollbars-should-respect-ancestor-clip-expected.html b/third_party/blink/web_tests/compositing/overflow/reparented-overlay-scrollbars-should-respect-ancestor-clip-expected.html index fea7e5d..34a0473 100644 --- a/third_party/blink/web_tests/compositing/overflow/reparented-overlay-scrollbars-should-respect-ancestor-clip-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/reparented-overlay-scrollbars-should-respect-ancestor-clip-expected.html
@@ -1,4 +1,10 @@ <!DOCTYPE HTML> +<script> +if (window.internals) { + internals.useMockOverlayScrollbars(); + internals.settings.setPreferCompositingToLCDTextEnabled(false); +} +</script> <style> #clipper { overflow: hidden; @@ -30,12 +36,6 @@ height: 500px; } </style> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setPreferCompositingToLCDTextEnabled(false); -} -</script> <div id='clipper'> <div id='scroller'> <div id='fixed'></div>
diff --git a/third_party/blink/web_tests/compositing/overflow/reparented-overlay-scrollbars-should-respect-ancestor-clip.html b/third_party/blink/web_tests/compositing/overflow/reparented-overlay-scrollbars-should-respect-ancestor-clip.html index 75c97fb..7442f11 100644 --- a/third_party/blink/web_tests/compositing/overflow/reparented-overlay-scrollbars-should-respect-ancestor-clip.html +++ b/third_party/blink/web_tests/compositing/overflow/reparented-overlay-scrollbars-should-respect-ancestor-clip.html
@@ -4,6 +4,12 @@ clips applied by a tree-order ancestor, even if that ancestor is not an ancestor in the compositing layer tree. --> +<script> +if (window.internals) { + internals.useMockOverlayScrollbars(); + internals.settings.setPreferCompositingToLCDTextEnabled(true); +} +</script> <style> #clipper { overflow: hidden; @@ -35,12 +41,6 @@ height: 500px; } </style> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setPreferCompositingToLCDTextEnabled(true); -} -</script> <div id='clipper'> <div id='scroller'> <div id='fixed'></div>
diff --git a/third_party/blink/web_tests/compositing/overflow/reparented-scrollbars-non-sc-anc.html b/third_party/blink/web_tests/compositing/overflow/reparented-scrollbars-non-sc-anc.html index eb40cea..b94c34ce 100644 --- a/third_party/blink/web_tests/compositing/overflow/reparented-scrollbars-non-sc-anc.html +++ b/third_party/blink/web_tests/compositing/overflow/reparented-scrollbars-non-sc-anc.html
@@ -4,6 +4,12 @@ correctly when the compositing container and the ancestor compositing stacking context differ. --> +<script> +if (window.internals) { + internals.useMockOverlayScrollbars(); + internals.settings.setPreferCompositingToLCDTextEnabled(true); +} +</script> <style> #container { margin-right: auto; @@ -41,11 +47,6 @@ if (window.testRunner) testRunner.dumpAsText(); -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setPreferCompositingToLCDTextEnabled(true); -} - onload = function() { if (window.internals) { document.getElementById('console').innerHTML = internals.layerTreeAsText(document);
diff --git a/third_party/blink/web_tests/compositing/overflow/reparented-unclipped-overlay-scrollbars-with-offset-from-renderer-expected.html b/third_party/blink/web_tests/compositing/overflow/reparented-unclipped-overlay-scrollbars-with-offset-from-renderer-expected.html index f994034..00e7cec7 100644 --- a/third_party/blink/web_tests/compositing/overflow/reparented-unclipped-overlay-scrollbars-with-offset-from-renderer-expected.html +++ b/third_party/blink/web_tests/compositing/overflow/reparented-unclipped-overlay-scrollbars-with-offset-from-renderer-expected.html
@@ -1,4 +1,10 @@ <!DOCTYPE HTML> +<script> +if (window.internals) { + internals.useMockOverlayScrollbars(); + internals.settings.setPreferCompositingToLCDTextEnabled(false); +} +</script> <style> #scroller { overflow: scroll; @@ -21,12 +27,6 @@ height: 500px; } </style> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setPreferCompositingToLCDTextEnabled(false); -} -</script> <div id='scroller'> <div id='fixed'></div> <div id='scrolled'></div>
diff --git a/third_party/blink/web_tests/compositing/overflow/reparented-unclipped-overlay-scrollbars-with-offset-from-renderer.html b/third_party/blink/web_tests/compositing/overflow/reparented-unclipped-overlay-scrollbars-with-offset-from-renderer.html index 0ba49a8..493d7a9e 100644 --- a/third_party/blink/web_tests/compositing/overflow/reparented-unclipped-overlay-scrollbars-with-offset-from-renderer.html +++ b/third_party/blink/web_tests/compositing/overflow/reparented-unclipped-overlay-scrollbars-with-offset-from-renderer.html
@@ -3,6 +3,12 @@ This test ensures that the offset from renderer is correctly applied to reparented overflow controls, even if they are unclipped. --> +<script> +if (window.internals) { + internals.useMockOverlayScrollbars(); + internals.settings.setPreferCompositingToLCDTextEnabled(true); +} +</script> <style> #scroller { overflow: scroll; @@ -27,12 +33,6 @@ height: 500px; } </style> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setPreferCompositingToLCDTextEnabled(true); -} -</script> <div id='scroller'> <div id='fixed'></div> <div id='scrolled'></div>
diff --git a/third_party/blink/web_tests/compositing/overflow/scroll-parent-with-non-stacking-context-composited-ancestor.html b/third_party/blink/web_tests/compositing/overflow/scroll-parent-with-non-stacking-context-composited-ancestor.html index d2bcab8..66ce9631 100644 --- a/third_party/blink/web_tests/compositing/overflow/scroll-parent-with-non-stacking-context-composited-ancestor.html +++ b/third_party/blink/web_tests/compositing/overflow/scroll-parent-with-non-stacking-context-composited-ancestor.html
@@ -6,6 +6,12 @@ scrollbars are correctly positioned on top of the scroller and the scrolled contents. --> +<script> +if (window.internals) { + internals.useMockOverlayScrollbars(); + internals.settings.setPreferCompositingToLCDTextEnabled(true); +} +</script> <style> #scroller { overflow: scroll; @@ -49,11 +55,6 @@ </div> </div> <script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setPreferCompositingToLCDTextEnabled(true); -} - if (window.testRunner) testRunner.dumpAsTextWithPixelResults();
diff --git a/third_party/blink/web_tests/compositing/overflow/scrollbar-layer-placement-negative-z-index-child-positioned.html b/third_party/blink/web_tests/compositing/overflow/scrollbar-layer-placement-negative-z-index-child-positioned.html index e64fb00..d94b58b 100644 --- a/third_party/blink/web_tests/compositing/overflow/scrollbar-layer-placement-negative-z-index-child-positioned.html +++ b/third_party/blink/web_tests/compositing/overflow/scrollbar-layer-placement-negative-z-index-child-positioned.html
@@ -5,7 +5,7 @@ --> <script> if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; + internals.useMockOverlayScrollbars(); internals.settings.setPreferCompositingToLCDTextEnabled(true); } </script>
diff --git a/third_party/blink/web_tests/compositing/overflow/scrollbar-layer-placement-negative-z-index-child.html b/third_party/blink/web_tests/compositing/overflow/scrollbar-layer-placement-negative-z-index-child.html index 54f3f8b..d30f2a97 100644 --- a/third_party/blink/web_tests/compositing/overflow/scrollbar-layer-placement-negative-z-index-child.html +++ b/third_party/blink/web_tests/compositing/overflow/scrollbar-layer-placement-negative-z-index-child.html
@@ -5,7 +5,7 @@ --> <script> if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; + internals.useMockOverlayScrollbars(); internals.settings.setPreferCompositingToLCDTextEnabled(true); } </script>
diff --git a/third_party/blink/web_tests/compositing/overflow/scrollbar-layer-placement.html b/third_party/blink/web_tests/compositing/overflow/scrollbar-layer-placement.html index cc5ad90..ca56653 100644 --- a/third_party/blink/web_tests/compositing/overflow/scrollbar-layer-placement.html +++ b/third_party/blink/web_tests/compositing/overflow/scrollbar-layer-placement.html
@@ -19,7 +19,7 @@ --> <script> if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; + internals.useMockOverlayScrollbars(); internals.settings.setPreferCompositingToLCDTextEnabled(true); } </script>
diff --git a/third_party/blink/web_tests/compositing/overflow/scrollbars-with-clipped-owner-expected.png b/third_party/blink/web_tests/compositing/overflow/scrollbars-with-clipped-owner-expected.png index 2cc0269..7bb5aaa6 100644 --- a/third_party/blink/web_tests/compositing/overflow/scrollbars-with-clipped-owner-expected.png +++ b/third_party/blink/web_tests/compositing/overflow/scrollbars-with-clipped-owner-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/overflow/tiled-mask-expected.png b/third_party/blink/web_tests/compositing/overflow/tiled-mask-expected.png index 3461086..36c210b 100644 --- a/third_party/blink/web_tests/compositing/overflow/tiled-mask-expected.png +++ b/third_party/blink/web_tests/compositing/overflow/tiled-mask-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/perspective-interest-rect-expected.png b/third_party/blink/web_tests/compositing/perspective-interest-rect-expected.png index 403b68b..68a9220 100644 --- a/third_party/blink/web_tests/compositing/perspective-interest-rect-expected.png +++ b/third_party/blink/web_tests/compositing/perspective-interest-rect-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/rtl/rtl-absolute-overflow-expected.png b/third_party/blink/web_tests/compositing/rtl/rtl-absolute-overflow-expected.png index 1e34e81..664329c1 100644 --- a/third_party/blink/web_tests/compositing/rtl/rtl-absolute-overflow-expected.png +++ b/third_party/blink/web_tests/compositing/rtl/rtl-absolute-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/rtl/rtl-absolute-overflow-scrolled-expected.png b/third_party/blink/web_tests/compositing/rtl/rtl-absolute-overflow-scrolled-expected.png index d7951a5d..2edf12af 100644 --- a/third_party/blink/web_tests/compositing/rtl/rtl-absolute-overflow-scrolled-expected.png +++ b/third_party/blink/web_tests/compositing/rtl/rtl-absolute-overflow-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/rtl/rtl-fixed-overflow-expected.png b/third_party/blink/web_tests/compositing/rtl/rtl-fixed-overflow-expected.png index 1e34e81..664329c1 100644 --- a/third_party/blink/web_tests/compositing/rtl/rtl-fixed-overflow-expected.png +++ b/third_party/blink/web_tests/compositing/rtl/rtl-fixed-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/rtl/rtl-fixed-overflow-scrolled-expected.png b/third_party/blink/web_tests/compositing/rtl/rtl-fixed-overflow-scrolled-expected.png index d7951a5d..2edf12af 100644 --- a/third_party/blink/web_tests/compositing/rtl/rtl-fixed-overflow-scrolled-expected.png +++ b/third_party/blink/web_tests/compositing/rtl/rtl-fixed-overflow-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/rtl/rtl-iframe-absolute-overflow-expected.png b/third_party/blink/web_tests/compositing/rtl/rtl-iframe-absolute-overflow-expected.png index b37b180..12824045 100644 --- a/third_party/blink/web_tests/compositing/rtl/rtl-iframe-absolute-overflow-expected.png +++ b/third_party/blink/web_tests/compositing/rtl/rtl-iframe-absolute-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/rtl/rtl-iframe-absolute-overflow-scrolled-expected.png b/third_party/blink/web_tests/compositing/rtl/rtl-iframe-absolute-overflow-scrolled-expected.png index d034ccea..8c561116 100644 --- a/third_party/blink/web_tests/compositing/rtl/rtl-iframe-absolute-overflow-scrolled-expected.png +++ b/third_party/blink/web_tests/compositing/rtl/rtl-iframe-absolute-overflow-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/rtl/rtl-iframe-fixed-overflow-expected.png b/third_party/blink/web_tests/compositing/rtl/rtl-iframe-fixed-overflow-expected.png index b37b180..12824045 100644 --- a/third_party/blink/web_tests/compositing/rtl/rtl-iframe-fixed-overflow-expected.png +++ b/third_party/blink/web_tests/compositing/rtl/rtl-iframe-fixed-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/rtl/rtl-iframe-fixed-overflow-scrolled-expected.png b/third_party/blink/web_tests/compositing/rtl/rtl-iframe-fixed-overflow-scrolled-expected.png index d034ccea..8c561116 100644 --- a/third_party/blink/web_tests/compositing/rtl/rtl-iframe-fixed-overflow-scrolled-expected.png +++ b/third_party/blink/web_tests/compositing/rtl/rtl-iframe-fixed-overflow-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/rtl/rtl-overflow-invalidation-expected.png b/third_party/blink/web_tests/compositing/rtl/rtl-overflow-invalidation-expected.png index 244ce2e..5ed92e8 100644 --- a/third_party/blink/web_tests/compositing/rtl/rtl-overflow-invalidation-expected.png +++ b/third_party/blink/web_tests/compositing/rtl/rtl-overflow-invalidation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/rtl/rtl-overflow-scrolling-expected.png b/third_party/blink/web_tests/compositing/rtl/rtl-overflow-scrolling-expected.png index cf7d2698..6105183 100644 --- a/third_party/blink/web_tests/compositing/rtl/rtl-overflow-scrolling-expected.png +++ b/third_party/blink/web_tests/compositing/rtl/rtl-overflow-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/scroll-with-ancestor-clip-expected.png b/third_party/blink/web_tests/compositing/scroll-with-ancestor-clip-expected.png index f00c217..2d1ddbf 100644 --- a/third_party/blink/web_tests/compositing/scroll-with-ancestor-clip-expected.png +++ b/third_party/blink/web_tests/compositing/scroll-with-ancestor-clip-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/scrollbars/custom-composited-different-track-parts.html b/third_party/blink/web_tests/compositing/scrollbars/custom-composited-different-track-parts.html index ab9ae6d..2a9e673 100644 --- a/third_party/blink/web_tests/compositing/scrollbars/custom-composited-different-track-parts.html +++ b/third_party/blink/web_tests/compositing/scrollbars/custom-composited-different-track-parts.html
@@ -38,10 +38,6 @@ } </style> <script> - if (window.internals) { - internals.settings.setMockScrollbarsEnabled(false); - } - function doTest() { window.scrollTo(400,300);
diff --git a/third_party/blink/web_tests/compositing/scrollbars/nested-overlay-scrollbars.html b/third_party/blink/web_tests/compositing/scrollbars/nested-overlay-scrollbars.html index 990230a..4622093 100644 --- a/third_party/blink/web_tests/compositing/scrollbars/nested-overlay-scrollbars.html +++ b/third_party/blink/web_tests/compositing/scrollbars/nested-overlay-scrollbars.html
@@ -1,4 +1,10 @@ <!DOCTYPE HTML> +<script> +if (window.internals) { + internals.useMockOverlayScrollbars(); + internals.settings.setPreferCompositingToLCDTextEnabled(true); +} +</script> <style> #outer { position: absolute; @@ -39,11 +45,6 @@ } </style> <script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setPreferCompositingToLCDTextEnabled(true); -} - if (window.testRunner) testRunner.dumpAsTextWithPixelResults();
diff --git a/third_party/blink/web_tests/compositing/squashing/frame-clip-squashed-scrolled-expected.png b/third_party/blink/web_tests/compositing/squashing/frame-clip-squashed-scrolled-expected.png index a9eac14..f0522aaa 100644 --- a/third_party/blink/web_tests/compositing/squashing/frame-clip-squashed-scrolled-expected.png +++ b/third_party/blink/web_tests/compositing/squashing/frame-clip-squashed-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/compositing/squashing/squashing-inside-perspective-with-reparented-scrolling-expected.html b/third_party/blink/web_tests/compositing/squashing/squashing-inside-perspective-with-reparented-scrolling-expected.html index 8fc7839..c82da3c 100644 --- a/third_party/blink/web_tests/compositing/squashing/squashing-inside-perspective-with-reparented-scrolling-expected.html +++ b/third_party/blink/web_tests/compositing/squashing/squashing-inside-perspective-with-reparented-scrolling-expected.html
@@ -3,6 +3,10 @@ This test ensures that the offset from renderer is correctly applied to reparented overflow controls, even if they are unclipped. --> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <style> #scroller { overflow: scroll; @@ -30,7 +34,3 @@ <div id='fixed'></div> <div id='scrolled'></div> </div> -<script> -if (window.internals) - internals.runtimeFlags.overlayScrollbarsEnabled = true; -</script>
diff --git a/third_party/blink/web_tests/compositing/squashing/squashing-inside-perspective-with-reparented-scrolling.html b/third_party/blink/web_tests/compositing/squashing/squashing-inside-perspective-with-reparented-scrolling.html index a4bc5893..bc623a4 100644 --- a/third_party/blink/web_tests/compositing/squashing/squashing-inside-perspective-with-reparented-scrolling.html +++ b/third_party/blink/web_tests/compositing/squashing/squashing-inside-perspective-with-reparented-scrolling.html
@@ -3,6 +3,14 @@ This test ensures that the offset from renderer is correctly applied to reparented overflow controls, even if they are unclipped. --> +<script> +// Check that a case with a reparented overflow control and a containing perspective node +// paints the same with and without layer squashing. +if (window.internals) { + internals.useMockOverlayScrollbars(); + internals.settings.setPreferCompositingToLCDTextEnabled(true); +} +</script> <style> #scroller { overflow: scroll; @@ -34,11 +42,3 @@ <div id='scrolled'></div> </div> </div> -<script> -// Check that a case with a reparented overflow control and a containing perspective node -// paints the same with and without layer squashing. -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setPreferCompositingToLCDTextEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/css3/blending/background-blend-mode-data-uri-svg-image-expected.png b/third_party/blink/web_tests/css3/blending/background-blend-mode-data-uri-svg-image-expected.png index dd9a170..8e78cee4 100644 --- a/third_party/blink/web_tests/css3/blending/background-blend-mode-data-uri-svg-image-expected.png +++ b/third_party/blink/web_tests/css3/blending/background-blend-mode-data-uri-svg-image-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/css3/blending/background-blend-mode-data-uri-svg-image.html b/third_party/blink/web_tests/css3/blending/background-blend-mode-data-uri-svg-image.html index 3477604d..ac53fee 100644 --- a/third_party/blink/web_tests/css3/blending/background-blend-mode-data-uri-svg-image.html +++ b/third_party/blink/web_tests/css3/blending/background-blend-mode-data-uri-svg-image.html
@@ -10,10 +10,6 @@ height: 200px; } </style> -<script> - if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); -</script> <!-- This file should contain an svg circle on top of a solid color green background, with every type of blending. The container should have a visible border. --> <body> <div style="background-blend-mode: normal, normal"></div>
diff --git a/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-expected.png b/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-expected.png index 508817df2..479f7c8 100644 --- a/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-expected.png +++ b/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-parents-expected.png b/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-parents-expected.png index 004d3103..70827f4d 100644 --- a/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-parents-expected.png +++ b/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-parents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-parents.html b/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-parents.html index 2c5220a..478bbb9 100644 --- a/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-parents.html +++ b/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-parents.html
@@ -11,7 +11,6 @@ testRunner.waitUntilDone(); </script> <!-- Make sure the mock scrollbars are enabled after the call to overridePreference, otherwise the setting will be overwritten. --> - <script src="../../compositing/resources/mock_scrollbars.js"></script> <style> body { margin: 0px;
diff --git a/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-self-expected.png b/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-self-expected.png index bd724c5..435df40 100644 --- a/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-self-expected.png +++ b/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-self-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-self.html b/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-self.html index ca1c7d1..42c4cf8 100644 --- a/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-self.html +++ b/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll-self.html
@@ -11,7 +11,6 @@ testRunner.waitUntilDone(); </script> <!-- Make sure the mock scrollbars are enabled after the call to overridePreference, otherwise the setting will be overwritten. --> - <script src="../../compositing/resources/mock_scrollbars.js"></script> <style> body { margin: 0px;
diff --git a/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll.html b/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll.html index ebb402e..1fe0489d 100644 --- a/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll.html +++ b/third_party/blink/web_tests/css3/filters/blur-filter-page-scroll.html
@@ -11,7 +11,6 @@ testRunner.waitUntilDone(); </script> <!-- Make sure the mock scrollbars are enabled after the call to overridePreference, otherwise the setting will be overwritten. --> - <script src="../../compositing/resources/mock_scrollbars.js"></script> <style> body { margin: 0px;
diff --git a/third_party/blink/web_tests/css3/viewport-percentage-lengths/viewport-percentage-lengths-scaled-overlay-scrollbars.html b/third_party/blink/web_tests/css3/viewport-percentage-lengths/viewport-percentage-lengths-scaled-overlay-scrollbars.html index c1c7531..e6f018f 100644 --- a/third_party/blink/web_tests/css3/viewport-percentage-lengths/viewport-percentage-lengths-scaled-overlay-scrollbars.html +++ b/third_party/blink/web_tests/css3/viewport-percentage-lengths/viewport-percentage-lengths-scaled-overlay-scrollbars.html
@@ -1,5 +1,9 @@ <!DOCTYPE> <html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <style> #element-container-vw-vh { background: green; @@ -8,8 +12,6 @@ } </style> <script> -if (window.internals) - internals.runtimeFlags.overlayScrollbarsEnabled = true; if (window.testRunner) testRunner.dumpAsText(); if (window.eventSender)
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json index ddb99a9..e9becd7 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json
@@ -4207,6 +4207,18 @@ {} ] ], + "css/selectors/focus-visible-008-manual.html": [ + [ + "css/selectors/focus-visible-008-manual.html", + {} + ] + ], + "css/selectors/focus-visible-012-manual.html": [ + [ + "css/selectors/focus-visible-012-manual.html", + {} + ] + ], "css/selectors/hover-001-manual.html": [ [ "css/selectors/hover-001-manual.html", @@ -7431,6 +7443,18 @@ {} ] ], + "compat/webkit-box-fieldset.html": [ + [ + "compat/webkit-box-fieldset.html", + [ + [ + "/compat/webkit-box-fieldset-ref.html", + "==" + ] + ], + {} + ] + ], "compat/webkit-linear-gradient-line-bottom.html": [ [ "compat/webkit-linear-gradient-line-bottom.html", @@ -42871,6 +42895,18 @@ {} ] ], + "css/css-flexbox/flex-child-percent-basis-resize-1.html": [ + [ + "css/css-flexbox/flex-child-percent-basis-resize-1.html", + [ + [ + "/css/css-flexbox/flex-child-percent-basis-resize-1-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-flexbox/flex-container-margin.html": [ [ "css/css-flexbox/flex-container-margin.html", @@ -50141,6 +50177,18 @@ {} ] ], + "css/css-grid/grid-child-percent-basis-resize-1.html": [ + [ + "css/css-grid/grid-child-percent-basis-resize-1.html", + [ + [ + "/css/css-grid/grid-child-percent-basis-resize-1-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-grid/grid-definition/fr-unit-with-percentage.html": [ [ "css/css-grid/grid-definition/fr-unit-with-percentage.html", @@ -54809,6 +54857,18 @@ {} ] ], + "css/css-lists/list-style-type-string-007.html": [ + [ + "css/css-lists/list-style-type-string-007.html", + [ + [ + "/css/css-lists/list-style-type-string-007-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-lists/list-type-none-style-image.html": [ [ "css/css-lists/list-type-none-style-image.html", @@ -57401,6 +57461,18 @@ {} ] ], + "css/css-multicol/multicol-clip-scrolled-content-001.html": [ + [ + "css/css-multicol/multicol-clip-scrolled-content-001.html", + [ + [ + "/css/css-multicol/reference/multicol-clip-scrolled-content-001-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-multicol/multicol-collapsing-001.xht": [ [ "css/css-multicol/multicol-collapsing-001.xht", @@ -59885,6 +59957,30 @@ {} ] ], + "css/css-overflow/clip-001.html": [ + [ + "css/css-overflow/clip-001.html", + [ + [ + "/css/css-overflow/clip-001-ref.html", + "==" + ] + ], + {} + ] + ], + "css/css-overflow/dynamic-visible-to-clip-001.html": [ + [ + "css/css-overflow/dynamic-visible-to-clip-001.html", + [ + [ + "/css/css-overflow/clip-001-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-overflow/float-with-relpos-and-transform.html": [ [ "css/css-overflow/float-with-relpos-and-transform.html", @@ -125677,6 +125773,9 @@ "compat/webkit-background-origin-text-ref.html": [ [] ], + "compat/webkit-box-fieldset-ref.html": [ + [] + ], "compat/webkit-gradient-comma-expected.txt": [ [] ], @@ -132682,6 +132781,9 @@ "css/css-flexbox/dynamic-bsize-change-ref.html": [ [] ], + "css/css-flexbox/flex-child-percent-basis-resize-1-ref.html": [ + [] + ], "css/css-flexbox/flex-direction-row-vertical-ref.html": [ [] ], @@ -138862,6 +138964,9 @@ "css/css-grid/animation/grid-template-rows-interpolation-expected.txt": [ [] ], + "css/css-grid/grid-child-percent-basis-resize-1-ref.html": [ + [] + ], "css/css-grid/grid-definition/grid-auto-repeat-max-size-001-expected.txt": [ [] ], @@ -139576,6 +139681,9 @@ "css/css-lists/list-style-type-string-006-ref.html": [ [] ], + "css/css-lists/list-style-type-string-007-ref.html": [ + [] + ], "css/css-lists/list-type-none-style-image-ref.html": [ [] ], @@ -140377,6 +140485,9 @@ "css/css-multicol/reference/multicol-basic-ref.html": [ [] ], + "css/css-multicol/reference/multicol-clip-scrolled-content-001-ref.html": [ + [] + ], "css/css-multicol/support/1x1-green.png": [ [] ], @@ -140548,6 +140659,9 @@ "css/css-overflow/META.yml": [ [] ], + "css/css-overflow/clip-001-ref.html": [ + [] + ], "css/css-overflow/inheritance-expected.txt": [ [] ], @@ -141139,9 +141253,6 @@ "css/css-scoping/resources/host-green-box.css": [ [] ], - "css/css-scoping/slotted-parsing-expected.txt": [ - [] - ], "css/css-scoping/slotted-placeholder-ref.html": [ [] ], @@ -164974,6 +165085,30 @@ "native-file-system/README.md": [ [] ], + "native-file-system/resources/message-target-dedicated-worker.js": [ + [] + ], + "native-file-system/resources/message-target-service-worker.js": [ + [] + ], + "native-file-system/resources/message-target-shared-worker.js": [ + [] + ], + "native-file-system/resources/message-target.html": [ + [] + ], + "native-file-system/resources/message-target.js": [ + [] + ], + "native-file-system/resources/messaging-blob-helpers.js": [ + [] + ], + "native-file-system/resources/messaging-helpers.js": [ + [] + ], + "native-file-system/resources/messaging-serialize-helpers.js": [ + [] + ], "native-file-system/resources/native-fs-test-helpers.js": [ [] ], @@ -164983,6 +165118,18 @@ "native-file-system/resources/test-helpers.js": [ [] ], + "native-file-system/script-tests/FileSystemBaseHandle-postMessage-BroadcastChannel.js": [ + [] + ], + "native-file-system/script-tests/FileSystemBaseHandle-postMessage-Error.js": [ + [] + ], + "native-file-system/script-tests/FileSystemBaseHandle-postMessage-MessagePort.js": [ + [] + ], + "native-file-system/script-tests/FileSystemBaseHandle-postMessage.js": [ + [] + ], "native-file-system/script-tests/FileSystemDirectoryHandle-getDirectory.js": [ [] ], @@ -171730,6 +171877,9 @@ "tools/ci/commands.json": [ [] ], + "tools/ci/epochs_update.sh": [ + [] + ], "tools/ci/jobs.py": [ [] ], @@ -212012,6 +212162,12 @@ {} ] ], + "css/css-pseudo/parsing/tree-abiding-pseudo-elements.html": [ + [ + "css/css-pseudo/parsing/tree-abiding-pseudo-elements.html", + {} + ] + ], "css/css-rhythm/inheritance.html": [ [ "css/css-rhythm/inheritance.html", @@ -220496,15 +220652,15 @@ {} ] ], - "css/cssom-view/MediaQueryList-001.html": [ + "css/cssom-view/MediaQueryList-addListener-handleEvent.html": [ [ - "css/cssom-view/MediaQueryList-001.html", + "css/cssom-view/MediaQueryList-addListener-handleEvent.html", {} ] ], - "css/cssom-view/MediaQueryList-with-empty-string.html": [ + "css/cssom-view/MediaQueryList-addListener-removeListener.html": [ [ - "css/cssom-view/MediaQueryList-with-empty-string.html", + "css/cssom-view/MediaQueryList-addListener-removeListener.html", {} ] ], @@ -220802,23 +220958,9 @@ {} ] ], - "css/cssom-view/matchMedia.xht": [ + "css/cssom-view/matchMedia.html": [ [ - "css/cssom-view/matchMedia.xht", - { - "timeout": "long" - } - ] - ], - "css/cssom-view/matchMediaAddListener-handleEvent.html": [ - [ - "css/cssom-view/matchMediaAddListener-handleEvent.html", - {} - ] - ], - "css/cssom-view/matchMediaAddListener.html": [ - [ - "css/cssom-view/matchMediaAddListener.html", + "css/cssom-view/matchMedia.html", {} ] ], @@ -222472,12 +222614,6 @@ } ] ], - "css/selectors/focus-visible-008.html": [ - [ - "css/selectors/focus-visible-008.html", - {} - ] - ], "css/selectors/focus-visible-009.html": [ [ "css/selectors/focus-visible-009.html", @@ -262004,6 +262140,154 @@ } ] ], + "native-file-system/native_FileSystemBaseHandle-postMessage-BroadcastChannel.tentative.https.manual.window.js": [ + [ + "native-file-system/native_FileSystemBaseHandle-postMessage-BroadcastChannel.tentative.https.manual.window.html", + { + "script_metadata": [ + [ + "script", + "/service-workers/service-worker/resources/test-helpers.sub.js" + ], + [ + "script", + "resources/test-helpers.js" + ], + [ + "script", + "resources/native-fs-test-helpers.js" + ], + [ + "script", + "resources/messaging-helpers.js" + ], + [ + "script", + "resources/messaging-serialize-helpers.js" + ], + [ + "script", + "script-tests/FileSystemBaseHandle-postMessage-BroadcastChannel.js" + ] + ] + } + ] + ], + "native-file-system/native_FileSystemBaseHandle-postMessage-Error.tentative.https.manual.window.js": [ + [ + "native-file-system/native_FileSystemBaseHandle-postMessage-Error.tentative.https.manual.window.html", + { + "script_metadata": [ + [ + "script", + "/common/get-host-info.sub.js" + ], + [ + "script", + "/service-workers/service-worker/resources/test-helpers.sub.js" + ], + [ + "script", + "resources/test-helpers.js" + ], + [ + "script", + "resources/native-fs-test-helpers.js" + ], + [ + "script", + "resources/messaging-helpers.js" + ], + [ + "script", + "resources/messaging-blob-helpers.js" + ], + [ + "script", + "resources/messaging-serialize-helpers.js" + ], + [ + "script", + "script-tests/FileSystemBaseHandle-postMessage-Error.js" + ] + ] + } + ] + ], + "native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort.tentative.https.manual.window.js": [ + [ + "native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort.tentative.https.manual.window.html", + { + "script_metadata": [ + [ + "script", + "/service-workers/service-worker/resources/test-helpers.sub.js" + ], + [ + "script", + "resources/test-helpers.js" + ], + [ + "script", + "resources/native-fs-test-helpers.js" + ], + [ + "script", + "resources/messaging-helpers.js" + ], + [ + "script", + "resources/messaging-blob-helpers.js" + ], + [ + "script", + "resources/messaging-serialize-helpers.js" + ], + [ + "script", + "script-tests/FileSystemBaseHandle-postMessage-MessagePort.js" + ] + ] + } + ] + ], + "native-file-system/native_FileSystemBaseHandle-postMessage.tentative.https.manual.window.js": [ + [ + "native-file-system/native_FileSystemBaseHandle-postMessage.tentative.https.manual.window.html", + { + "script_metadata": [ + [ + "script", + "/service-workers/service-worker/resources/test-helpers.sub.js" + ], + [ + "script", + "resources/test-helpers.js" + ], + [ + "script", + "resources/native-fs-test-helpers.js" + ], + [ + "script", + "resources/messaging-helpers.js" + ], + [ + "script", + "resources/messaging-blob-helpers.js" + ], + [ + "script", + "resources/messaging-serialize-helpers.js" + ], + [ + "script", + "script-tests/FileSystemBaseHandle-postMessage.js" + ] + ] + } + ] + ], "native-file-system/native_FileSystemDirectoryHandle-getDirectory.tentative.https.manual.window.js": [ [ "native-file-system/native_FileSystemDirectoryHandle-getDirectory.tentative.https.manual.window.html", @@ -262154,6 +262438,154 @@ } ] ], + "native-file-system/sandboxed_FileSystemBaseHandle-postMessage-BroadcastChannel.tentative.https.window.js": [ + [ + "native-file-system/sandboxed_FileSystemBaseHandle-postMessage-BroadcastChannel.tentative.https.window.html", + { + "script_metadata": [ + [ + "script", + "/service-workers/service-worker/resources/test-helpers.sub.js" + ], + [ + "script", + "resources/test-helpers.js" + ], + [ + "script", + "resources/sandboxed-fs-test-helpers.js" + ], + [ + "script", + "resources/messaging-helpers.js" + ], + [ + "script", + "resources/messaging-serialize-helpers.js" + ], + [ + "script", + "script-tests/FileSystemBaseHandle-postMessage-BroadcastChannel.js" + ] + ] + } + ] + ], + "native-file-system/sandboxed_FileSystemBaseHandle-postMessage-Error.tentative.https.window.js": [ + [ + "native-file-system/sandboxed_FileSystemBaseHandle-postMessage-Error.tentative.https.window.html", + { + "script_metadata": [ + [ + "script", + "/common/get-host-info.sub.js" + ], + [ + "script", + "/service-workers/service-worker/resources/test-helpers.sub.js" + ], + [ + "script", + "resources/test-helpers.js" + ], + [ + "script", + "resources/sandboxed-fs-test-helpers.js" + ], + [ + "script", + "resources/messaging-helpers.js" + ], + [ + "script", + "resources/messaging-blob-helpers.js" + ], + [ + "script", + "resources/messaging-serialize-helpers.js" + ], + [ + "script", + "script-tests/FileSystemBaseHandle-postMessage-Error.js" + ] + ] + } + ] + ], + "native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort.tentative.https.window.js": [ + [ + "native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort.tentative.https.window.html", + { + "script_metadata": [ + [ + "script", + "/service-workers/service-worker/resources/test-helpers.sub.js" + ], + [ + "script", + "resources/test-helpers.js" + ], + [ + "script", + "resources/sandboxed-fs-test-helpers.js" + ], + [ + "script", + "resources/messaging-helpers.js" + ], + [ + "script", + "resources/messaging-blob-helpers.js" + ], + [ + "script", + "resources/messaging-serialize-helpers.js" + ], + [ + "script", + "script-tests/FileSystemBaseHandle-postMessage-MessagePort.js" + ] + ] + } + ] + ], + "native-file-system/sandboxed_FileSystemBaseHandle-postMessage.tentative.https.window.js": [ + [ + "native-file-system/sandboxed_FileSystemBaseHandle-postMessage.tentative.https.window.html", + { + "script_metadata": [ + [ + "script", + "/service-workers/service-worker/resources/test-helpers.sub.js" + ], + [ + "script", + "resources/test-helpers.js" + ], + [ + "script", + "resources/sandboxed-fs-test-helpers.js" + ], + [ + "script", + "resources/messaging-helpers.js" + ], + [ + "script", + "resources/messaging-blob-helpers.js" + ], + [ + "script", + "resources/messaging-serialize-helpers.js" + ], + [ + "script", + "script-tests/FileSystemBaseHandle-postMessage.js" + ] + ] + } + ] + ], "native-file-system/sandboxed_FileSystemDirectoryHandle-getDirectory.tentative.https.any.js": [ [ "native-file-system/sandboxed_FileSystemDirectoryHandle-getDirectory.tentative.https.any.html", @@ -292169,6 +292601,12 @@ {} ] ], + "service-workers/service-worker/referer-toplevel-script-fetch.https.html": [ + [ + "service-workers/service-worker/referer-toplevel-script-fetch.https.html", + {} + ] + ], "service-workers/service-worker/referer.https.html": [ [ "service-workers/service-worker/referer.https.html", @@ -340719,6 +341157,14 @@ "06e728342cdb63a72b420423b40b6e32ae3e2162", "reftest" ], + "compat/webkit-box-fieldset-ref.html": [ + "b5d7176150d0403a87dfd2b9e59af219ddb6b9bb", + "support" + ], + "compat/webkit-box-fieldset.html": [ + "c3a2e64c114ef78507213ab95f5cde91cac3bbbe", + "reftest" + ], "compat/webkit-box-ignore-box-pack.html": [ "80b52fbf1fe13a7c9ec5288f301194e40a381430", "testharness" @@ -369795,6 +370241,14 @@ "2a1ab9c00cda7b78026eb04e31894bda43392a5d", "reftest" ], + "css/css-flexbox/flex-child-percent-basis-resize-1-ref.html": [ + "2ee6b077d3c6a9375029209a6ce202478db437a4", + "support" + ], + "css/css-flexbox/flex-child-percent-basis-resize-1.html": [ + "7631e02a2261211aee6156d81cac9fdc4c2aea6d", + "reftest" + ], "css/css-flexbox/flex-container-margin.html": [ "4ea7441cb07dbc419d562092e00d08f9d4e13e2e", "reftest" @@ -382651,6 +383105,14 @@ "c9ea9332a1e49f300c0520b798653869ad82b5c6", "testharness" ], + "css/css-grid/grid-child-percent-basis-resize-1-ref.html": [ + "2ee6b077d3c6a9375029209a6ce202478db437a4", + "support" + ], + "css/css-grid/grid-child-percent-basis-resize-1.html": [ + "7fb5d8e117d9f0b7e23bf3921843e8ea29ef4522", + "reftest" + ], "css/css-grid/grid-definition/fr-unit-with-percentage.html": [ "82c97abdd5740d466f049d8b45b67e241f204899", "reftest" @@ -385803,6 +386265,14 @@ "7f6904b777f9a76fa405c36b58148bfb521523a1", "reftest" ], + "css/css-lists/list-style-type-string-007-ref.html": [ + "8c523a968c1050b93ee90f2cfd7de0fe2bd31cf2", + "support" + ], + "css/css-lists/list-style-type-string-007.html": [ + "55c883ff4c377b33660f4b45cdbc73c886d6081d", + "reftest" + ], "css/css-lists/list-type-none-style-image-ref.html": [ "9e72fb310233145c5a6c014c3febb2975586d76d", "support" @@ -387707,6 +388177,10 @@ "6b97ad4811e7c6554d5dc84e1d8b45a2d3efbe1d", "reftest" ], + "css/css-multicol/multicol-clip-scrolled-content-001.html": [ + "868e91de345cc7d27cb0690f49aa8db53bd33e29", + "reftest" + ], "css/css-multicol/multicol-collapsing-001-ref.xht": [ "b5cd90c4704ed5cced1b741b42b71fabd850fe18", "support" @@ -389123,6 +389597,10 @@ "7d88977b059defbe00f1b7dbbb37b58f607cf28b", "support" ], + "css/css-multicol/reference/multicol-clip-scrolled-content-001-ref.html": [ + "d19ec1b93a14cc030c5b97de775438d8cebb94c9", + "support" + ], "css/css-multicol/support/1x1-green.png": [ "b98ca0ba0a03c580ac339e4a3653539cfa8edc71", "support" @@ -389463,6 +389941,18 @@ "b9ba7acd150e5022de5c5208cd7f5f7d4dde93c3", "support" ], + "css/css-overflow/clip-001-ref.html": [ + "9ccdbf93c615f6078b82add5362e6032e9efe583", + "support" + ], + "css/css-overflow/clip-001.html": [ + "84bf8cdae55431f00f01358c93712074029fa815", + "reftest" + ], + "css/css-overflow/dynamic-visible-to-clip-001.html": [ + "08114d73b8bf6364d2ad647236fe5388f9eef1b2", + "reftest" + ], "css/css-overflow/float-with-relpos-and-transform.html": [ "6024b7261750e0c5dc4a681dccee2ab72b83abca", "reftest" @@ -391759,6 +392249,10 @@ "94d0c42eca8cffbd5637a1039028925c19e1f851", "reftest" ], + "css/css-pseudo/parsing/tree-abiding-pseudo-elements.html": [ + "4997ae4f564d382fafd03e742a4b706d7e98fc80", + "testharness" + ], "css/css-pseudo/placeholder-input-number-notref.html": [ "92ae71d83fcbea52e4120ed28af5438dd54d4509", "support" @@ -392135,12 +392629,8 @@ "c7139fea4c280585197db5bd432931bcf53c2e53", "testharness" ], - "css/css-scoping/slotted-parsing-expected.txt": [ - "a23c947e96e1639f3aec3a459eff35f8780216f5", - "support" - ], "css/css-scoping/slotted-parsing.html": [ - "6888693bbf40932d62a19b535adba22adbd43b19", + "2c55a0ded0918b585443f255e81a2d3a2eaa3350", "testharness" ], "css/css-scoping/slotted-placeholder-ref.html": [ @@ -421143,16 +421633,16 @@ "a6644945910fc83ca079c93507b21117b91de9c3", "support" ], - "css/cssom-view/MediaQueryList-001.html": [ - "06c81d5de4c67efaba23f18abcbf8532257a54eb", + "css/cssom-view/MediaQueryList-addListener-handleEvent.html": [ + "5bdd9dfc9ced8459b459970cf187456c3f82fbe4", "testharness" ], - "css/cssom-view/MediaQueryList-with-empty-string.html": [ - "3d5a5316566411c49895e845d8dd0df8e7553a1e", + "css/cssom-view/MediaQueryList-addListener-removeListener.html": [ + "5446e48e6cfcf20d5005ecfa4f75523f61ab83e2", "testharness" ], "css/cssom-view/MediaQueryListEvent.html": [ - "6631039d248b757b3b423929a8fa4a290ec22287", + "24cce3cc0973cf7478c92ce05137926ea0b78f77", "testharness" ], "css/cssom-view/OWNERS": [ @@ -421391,22 +421881,14 @@ "08fcb3c5386228b167cc76e9cd02a34903c86912", "testharness" ], - "css/cssom-view/matchMedia.xht": [ - "202a3b738dd0d7c83ed9b4cdff8c7212ae09f61e", + "css/cssom-view/matchMedia.html": [ + "14df3d02425ddf32caa904cfcfe3d8e2fae0c803", "testharness" ], "css/cssom-view/matchMediaAddListener-handleEvent-expected.txt": [ "7ee5f624fb9c7e8671695050da2473634084ddbe", "support" ], - "css/cssom-view/matchMediaAddListener-handleEvent.html": [ - "8bc665693d8f722fcd8a1f6fde9d6c36e4ecfd23", - "testharness" - ], - "css/cssom-view/matchMediaAddListener.html": [ - "7236be7febc985a9432e3127b78acf352bb91fa1", - "testharness" - ], "css/cssom-view/mouseEvent-expected.txt": [ "f0f5a0868c97f6f48fd0e8f1f9c85fa84a3f002c", "support" @@ -421488,7 +421970,7 @@ "support" ], "css/cssom-view/resources/matchMedia.js": [ - "93f4a31505098033dfe55d8075d7315c590703bb", + "8013699b7dee114da3313ccfba61d57e7e860e5b", "support" ], "css/cssom-view/screenLeftTop.html": [ @@ -424683,9 +425165,9 @@ "2dcb3e34b21fb7251d5df0a85b00e9ca77f872f1", "testharness" ], - "css/selectors/focus-visible-008.html": [ - "b7f61d2fa804f801abcc59f81645e07431de3463", - "testharness" + "css/selectors/focus-visible-008-manual.html": [ + "53306a90bbcae67ca65feefce3e4d3758d1a4ecd", + "manual" ], "css/selectors/focus-visible-009.html": [ "4dae6407adac3971db6064822643332cf7f1722d", @@ -424699,6 +425181,10 @@ "f95458fc4d3e4a538ecf8788b87528a9a138db5c", "testharness" ], + "css/selectors/focus-visible-012-manual.html": [ + "c659a728986fd01f47e252b2fe06cce8c91175ac", + "manual" + ], "css/selectors/focus-within-001-ref.html": [ "2913775a2204eb173ba45251a84ab2c01cda35bc", "support" @@ -426588,7 +427074,7 @@ "support" ], "css/support/parsing-testcommon.js": [ - "7ecd588aaf5160f121b9eb240f58d2739135c829", + "647bc125df9a877f8299de43ff1c83f7d7dea167", "support" ], "css/support/pattern-grg-rgr-grg.png": [ @@ -431656,7 +432142,7 @@ "testharness" ], "custom-elements/form-associated/ElementInternals-accessibility.html": [ - "f5d96643ba23e6549d854649912626668f6118a1", + "c98d771b502ea346e4131569c836282fbfa54d58", "testharness" ], "custom-elements/form-associated/ElementInternals-labels.html": [ @@ -439772,7 +440258,7 @@ "testharness" ], "fetch/corb/script-resource-with-nonsniffable-types.tentative.sub.html": [ - "f83eff82b5e4b21adfaf20915632e3ed6e6b9ba6", + "592a33ef3baf49b02812d49bbba1105b7766b302", "testharness" ], "fetch/corb/style-css-mislabeled-as-html-nosniff.sub.html": [ @@ -440020,11 +440506,11 @@ "testharness" ], "fetch/metadata/iframe.tentative.https.sub.html": [ - "b8f11c66b7edeedeab85b947e0a0138e5dd0f333", + "60ccbba721ba3d11f78c9cf84d7e22fe02724d3f", "testharness" ], "fetch/metadata/iframe.tentative.sub.html": [ - "c5469f458d37bed0ce43ddbf1011085879e9f743", + "be57362e9f0505b36d1faf58cb91af1b237a94e4", "testharness" ], "fetch/metadata/img.tentative.https.sub.html": [ @@ -440040,7 +440526,7 @@ "testharness" ], "fetch/metadata/portal.tentative.https.sub.html": [ - "ee24b5ecbb90c7f0d2892d4f5abeb3c5d1d6acf3", + "f9e370c67fbcbea20fc4fac2957fd50608fca13c", "testharness" ], "fetch/metadata/prefetch.tentative.https.sub.html": [ @@ -440072,11 +440558,11 @@ "testharness" ], "fetch/metadata/redirect/redirect-https-downgrade.tentative.sub-expected.txt": [ - "f6bcb6a644e174c4ff9d355088acb06d97adc0e3", + "5587c493393b81222ce9bbe66d2aef7e5b1a4ba0", "support" ], "fetch/metadata/redirect/redirect-https-downgrade.tentative.sub.html": [ - "eee21dafcac42c5074f786b2b76f12d08735f0ef", + "760ed3a2998f70ce51da2cadc3ba5c997d639370", "testharness" ], "fetch/metadata/redirect/same-origin-redirect.tentative.https.sub.html": [ @@ -450692,7 +451178,7 @@ "support" ], "html/interaction/focus/sequential-focus-navigation-and-the-tabindex-attribute/tabindex-getter-expected.txt": [ - "25e2da07f6ca5e45b9b43818aabb29713c72a284", + "5abff0f224dba7d0f29cb07ef5b426fb18733e3f", "support" ], "html/interaction/focus/sequential-focus-navigation-and-the-tabindex-attribute/tabindex-getter-frame.html": [ @@ -470375,6 +470861,22 @@ "6905a68e7901ce26bc1a363062304e1536604400", "support" ], + "native-file-system/native_FileSystemBaseHandle-postMessage-BroadcastChannel.tentative.https.manual.window.js": [ + "4bfe84e9c4abf8738002168832fe59b7e6d72896", + "testharness" + ], + "native-file-system/native_FileSystemBaseHandle-postMessage-Error.tentative.https.manual.window.js": [ + "e45271c779341513de5a4400560012d68998f8dd", + "testharness" + ], + "native-file-system/native_FileSystemBaseHandle-postMessage-MessagePort.tentative.https.manual.window.js": [ + "408b32f13a317e060e88baee4ccca6a5f292a3a4", + "testharness" + ], + "native-file-system/native_FileSystemBaseHandle-postMessage.tentative.https.manual.window.js": [ + "6045812bff57037de8b1f4972059e8d8e0ee06db", + "testharness" + ], "native-file-system/native_FileSystemDirectoryHandle-getDirectory.tentative.https.manual.window.js": [ "cfe729cd1f1dd4b53f00b3b13cd53f64f84ca409", "testharness" @@ -470399,6 +470901,38 @@ "25d8ee995857fa67be2c41f048e882ec473f739d", "testharness" ], + "native-file-system/resources/message-target-dedicated-worker.js": [ + "26ff23ef8ac65009c3c5efd4bdeda3970ae93910", + "support" + ], + "native-file-system/resources/message-target-service-worker.js": [ + "4a6174ae3b5539300954f6f36782a96a066b4889", + "support" + ], + "native-file-system/resources/message-target-shared-worker.js": [ + "6829c61d4cf9f32f4834ae09ffba1d614b0430a0", + "support" + ], + "native-file-system/resources/message-target.html": [ + "32c7f0c56c61d4d2f6e432dd3c38f8afe91f9762", + "support" + ], + "native-file-system/resources/message-target.js": [ + "b9c0e4f8565e647577cad859129257fa447bd8dc", + "support" + ], + "native-file-system/resources/messaging-blob-helpers.js": [ + "852f2e2d3213075ce738fbc2bb5ac4a1f4008ad6", + "support" + ], + "native-file-system/resources/messaging-helpers.js": [ + "aae6e25d861c6c207133ebdf3778c134aee8c4e6", + "support" + ], + "native-file-system/resources/messaging-serialize-helpers.js": [ + "4a4b350cf91c3cc3555bdc133a36f415e7f7b5c3", + "support" + ], "native-file-system/resources/native-fs-test-helpers.js": [ "5ad8c04724b7a2e7743b43a84efaa05b7e6b703d", "support" @@ -470411,6 +470945,22 @@ "d0360921f1d8ce7257bd7d6586d333b8534c620d", "support" ], + "native-file-system/sandboxed_FileSystemBaseHandle-postMessage-BroadcastChannel.tentative.https.window.js": [ + "1995ab9b1f99aefa5715f36fec3a83e3efd72d3f", + "testharness" + ], + "native-file-system/sandboxed_FileSystemBaseHandle-postMessage-Error.tentative.https.window.js": [ + "f44957e2000143509206c93e9c334cb401e4a173", + "testharness" + ], + "native-file-system/sandboxed_FileSystemBaseHandle-postMessage-MessagePort.tentative.https.window.js": [ + "043c6b392622df65a7ad92f422bc74a5c8329ee2", + "testharness" + ], + "native-file-system/sandboxed_FileSystemBaseHandle-postMessage.tentative.https.window.js": [ + "e010f6599e890f0eeaffd01a4bae962a8aa8b950", + "testharness" + ], "native-file-system/sandboxed_FileSystemDirectoryHandle-getDirectory.tentative.https.any.js": [ "6fcf566e31fbf061e7545280198562d9e41cad11", "testharness" @@ -470435,6 +470985,22 @@ "8352e2487fe0823a2d353372757d833d85e98c4b", "testharness" ], + "native-file-system/script-tests/FileSystemBaseHandle-postMessage-BroadcastChannel.js": [ + "7daf65e39b6f7776c46eb90d671c192b0ba4aca0", + "support" + ], + "native-file-system/script-tests/FileSystemBaseHandle-postMessage-Error.js": [ + "914b47bcf4060131efd6f47777681add302607ab", + "support" + ], + "native-file-system/script-tests/FileSystemBaseHandle-postMessage-MessagePort.js": [ + "aa1e9b200c806d3bb4e4360178c042aa66e4ac8c", + "support" + ], + "native-file-system/script-tests/FileSystemBaseHandle-postMessage.js": [ + "d2b333a9057d017dc56880d4899b004cdc2bc86e", + "support" + ], "native-file-system/script-tests/FileSystemDirectoryHandle-getDirectory.js": [ "c2c128f5eded06f440e634051fac021e20061e0d", "support" @@ -495727,6 +496293,10 @@ "176fcb494b664bae43feba0c793e52845df35257", "testharness" ], + "service-workers/service-worker/referer-toplevel-script-fetch.https.html": [ + "f0dd843eef8f8549430b78ce2606d83a59e2fb42", + "testharness" + ], "service-workers/service-worker/referer.https.html": [ "0957e4c5330168b08236ff7c431706a1d92cc1a4", "testharness" @@ -497432,7 +498002,7 @@ "testharness" ], "shadow-dom/focus/focus-method-delegatesFocus-expected.txt": [ - "ae3eaa3ce88df34d132ca6b727e6af5cf0936e8e", + "d4cbbc7315cbd1899f184c14230eb3617295caad", "support" ], "shadow-dom/focus/focus-method-delegatesFocus.html": [ @@ -502384,15 +502954,19 @@ "support" ], "tools/ci/ci_wptrunner_infrastructure.sh": [ - "e5b485dbff8040d797af4d9ce6b0681c6b3d9574", + "8db08794ade26bef899f05c4890c2b88e68df292", "support" ], "tools/ci/commands.json": [ "841fd855c8056829afd347e3067e55804ca65139", "support" ], + "tools/ci/epochs_update.sh": [ + "c95f9ca0f13481589ee1358c7ad8fdf94d13328b", + "support" + ], "tools/ci/jobs.py": [ - "b7ada2a5b621236d97d4e87a8d7e0960327bc01d", + "3d809efa37ccff2c258343b64791762fc507a90f", "support" ], "tools/ci/make_hosts_file.py": [ @@ -502408,7 +502982,7 @@ "support" ], "tools/ci/taskcluster-run.py": [ - "ad33cb532d2e82cc28a42d75e856709dc53fa22a", + "8a60012d09b4d5be9845cf4ab74e5f87bf4b58ce", "support" ], "tools/ci/tcdownload.py": [ @@ -506772,7 +507346,7 @@ "support" ], "tools/wptrunner/requirements.txt": [ - "dbed37ccdcdd132993ccda93c235125920096984", + "f8cce782f931a14f87de3eacfd4fe056d35926ee", "support" ], "tools/wptrunner/requirements_android_webview.txt": [ @@ -506804,7 +507378,7 @@ "support" ], "tools/wptrunner/requirements_firefox.txt": [ - "2021f550f488860500a053463970350525c15c0c", + "85efd35486d8d9a3724c9cf37aa231dfcdac72ec", "support" ], "tools/wptrunner/requirements_ie.txt": [ @@ -506888,7 +507462,7 @@ "support" ], "tools/wptrunner/wptrunner/browsers/firefox.py": [ - "6cf784fd01049a24ad6c8253179ad61d62073774", + "5e3e41eb55fc82567ba9543c283e34635bd8b112", "support" ], "tools/wptrunner/wptrunner/browsers/firefox_android.py": [ @@ -507156,7 +507730,7 @@ "support" ], "tools/wptrunner/wptrunner/wptcommandline.py": [ - "3fc0f6d6b537938f76b99c7122229a6a3deb2713", + "7919121f9595f1abef3b057ca6be387e515a779e", "support" ], "tools/wptrunner/wptrunner/wptlogging.py": [ @@ -508036,7 +508610,7 @@ "support" ], "update-built-tests.sh": [ - "1a33154898d7adfdff6194d4632b28548cc4c9f8", + "a45058c18f89aa25a577aad817b45f6a1bcbfa6e", "support" ], "upgrade-insecure-requests/META.yml": [ @@ -512348,7 +512922,7 @@ "testharness" ], "web-animations/interfaces/Animatable/animate-expected.txt": [ - "f6ee77bdfee98097baa3469b6df1734b0f45a873", + "a69448468b1eb5de8f6fbb6df1fad60c14d27aab", "support" ], "web-animations/interfaces/Animatable/animate-no-browsing-context-expected.txt": [ @@ -523336,11 +523910,11 @@ "support" ], "workers/semantics/interface-objects/003.any.js": [ - "1942a4658dfb8e2ecab52c914af9aff8cf79cc2a", + "ea95deda29889254e0e1c83bebb58cdc04363c2d", "testharness" ], "workers/semantics/interface-objects/003.any.sharedworker-expected.txt": [ - "c20fb7c8107257ae1da5d1f8ad498671c2bfcd64", + "e72a68ecc1b03d21f201b48630cea1a481978c8d", "support" ], "workers/semantics/interface-objects/004-expected.txt": [
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-child-percent-basis-resize-1-ref.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-child-percent-basis-resize-1-ref.html new file mode 100644 index 0000000..2ee6b07 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-child-percent-basis-resize-1-ref.html
@@ -0,0 +1,43 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Test Reference: bug 1584018</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="https://mozilla.org"> + +<style> + .container { + width: 100px; + height: 100px; + } + + .scroll-inner { + overflow:scroll; + height:100%; + } + +</style> + +<div class="container"> + <div class="scroll-inner"> + <div>0</div> + <div>1</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> + <div>6</div> + <div>7</div> + <div>8</div> + <div>9</div> + <div>0</div> + <div>1</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> + <div>6</div> + <div>7</div> + <div>8</div> + <div>9</div> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-child-percent-basis-resize-1.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-child-percent-basis-resize-1.html new file mode 100644 index 0000000..7631e02 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-child-percent-basis-resize-1.html
@@ -0,0 +1,62 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Testcase, bug 1584018</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="https://mozilla.org"> +<link rel="help" href="https://drafts.csswg.org/css-flexbox"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1584018"> +<link rel="match" href="flex-child-percent-basis-resize-1-ref.html"> + +<style> + .flex-container { + display: flex; + flex-direction: row; + width: 100px; + } + + .flex-item { + flex: 1 0 auto; + } + + .scroll-outer { + overflow:hidden; + /* this combination is important */ + height: 100%; + max-height: 100px; + } + + .scroll-inner { + overflow:scroll; + height:100%; + } + +</style> + +<div class="flex-container"> + <div class="flex-item"> + <div class="scroll-outer"> + <div class="scroll-inner"> + <div>0</div> + <div>1</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> + <div>6</div> + <div>7</div> + <div>8</div> + <div>9</div> + <div>0</div> + <div>1</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> + <div>6</div> + <div>7</div> + <div>8</div> + <div>9</div> + </div> + </div> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/grid-child-percent-basis-resize-1-ref.html b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-child-percent-basis-resize-1-ref.html new file mode 100644 index 0000000..2ee6b07 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-child-percent-basis-resize-1-ref.html
@@ -0,0 +1,43 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Test Reference: bug 1584018</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="https://mozilla.org"> + +<style> + .container { + width: 100px; + height: 100px; + } + + .scroll-inner { + overflow:scroll; + height:100%; + } + +</style> + +<div class="container"> + <div class="scroll-inner"> + <div>0</div> + <div>1</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> + <div>6</div> + <div>7</div> + <div>8</div> + <div>9</div> + <div>0</div> + <div>1</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> + <div>6</div> + <div>7</div> + <div>8</div> + <div>9</div> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/grid-child-percent-basis-resize-1.html b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-child-percent-basis-resize-1.html new file mode 100644 index 0000000..7fb5d8e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-grid/grid-child-percent-basis-resize-1.html
@@ -0,0 +1,60 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Testcase, bug 1584018</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="https://mozilla.org"> +<link rel="help" href="https://drafts.csswg.org/css-grid"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1584018"> +<link rel="match" href="grid-child-percent-basis-resize-1-ref.html"> + +<style> + .grid-container { + display: grid; + width: 100px; + } + + .grid-item { + } + + .scroll-outer { + overflow:hidden; + /* this combination is important */ + height: 100%; + max-height: 100px; + } + + .scroll-inner { + overflow:scroll; + height:100%; + } + +</style> + +<div class="grid-container"> + <div class="grid-item"> + <div class="scroll-outer"> + <div class="scroll-inner"> + <div>0</div> + <div>1</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> + <div>6</div> + <div>7</div> + <div>8</div> + <div>9</div> + <div>0</div> + <div>1</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> + <div>6</div> + <div>7</div> + <div>8</div> + <div>9</div> + </div> + </div> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-overflow/clip-001-ref.html b/third_party/blink/web_tests/external/wpt/css/css-overflow/clip-001-ref.html new file mode 100644 index 0000000..9ccdbf9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-overflow/clip-001-ref.html
@@ -0,0 +1,27 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSS Test Reference</title> +<style> + #target { + width: 100px; + height: 100px; + background: red; + /* For this simple case, hidden and clip are equivalent */ + overflow: hidden; + } + + #container { + overflow: auto; + height: 300px; + } + + #fill { + background: blue; + height: 5000px; + } +</style> +<div id="container"> + <div id="target"> + <div id="fill"></div> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-overflow/clip-001.html b/third_party/blink/web_tests/external/wpt/css/css-overflow/clip-001.html new file mode 100644 index 0000000..84bf8cd --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-overflow/clip-001.html
@@ -0,0 +1,31 @@ +<!doctype html> +<meta charset="utf-8"> +<title>overflow: clip clips its contents and doesn't cause scrollable overflow</title> +<link rel="help" href="https://drafts.csswg.org/css-overflow/#valdef-overflow-clip"> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> +<link rel="author" title="Mozilla" href="https://mozilla.org"> +<link rel="match" href="clip-001-ref.html"> +<style> + #target { + width: 100px; + height: 100px; + background: red; + overflow: -moz-hidden-unscrollable; + overflow: clip; + } + + #container { + overflow: auto; + height: 300px; + } + + #fill { + background: blue; + height: 5000px; + } +</style> +<div id="container"> + <div id="target"> + <div id="fill"></div> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-overflow/dynamic-visible-to-clip-001.html b/third_party/blink/web_tests/external/wpt/css/css-overflow/dynamic-visible-to-clip-001.html new file mode 100644 index 0000000..08114d7 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-overflow/dynamic-visible-to-clip-001.html
@@ -0,0 +1,36 @@ +<!doctype html> +<meta charset="utf-8"> +<title>Overflow areas are updated when dynamically changed to overflow: clip</title> +<link rel="help" href="https://drafts.csswg.org/css-overflow/#valdef-overflow-clip"> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> +<link rel="author" title="Mozilla" href="https://mozilla.org"> +<link rel="match" href="clip-001-ref.html"> +<style> + #target { + width: 100px; + height: 100px; + overflow: visible; + } + + #container { + overflow: auto; + height: 300px; + } + #fill { + height: 5000px; + background: blue; + } +</style> +<div id="container"> + <div id="target"> + <div id="fill"></div> + </div> +</div> +<script> +onload = function() { + let target = document.getElementById("target"); + window.unused = target.getBoundingClientRect(); // Update layout + target.style.overflow = "-moz-hidden-unscrollable"; + target.style.overflow = "clip"; +} +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/outline-018-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-ui/outline-018-expected.txt deleted file mode 100644 index dd3fe0ad..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/outline-018-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -FAIL outline-style is animated as a discrete type assert_equals: expected "dotted" but got "solid" -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/outline-018.html b/third_party/blink/web_tests/external/wpt/css/css-ui/outline-018.html index ff79144..c2db6f9 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/outline-018.html +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/outline-018.html
@@ -29,7 +29,7 @@ outline: solid 1px black; } #test4 { - animation: outline-anim 3s 0s paused reverse-linear; + animation: outline-anim 3s 0s paused reverse linear; outline: solid 1px black; } </style>
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryList-001.html b/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryList-001.html deleted file mode 100644 index 06c81d5..0000000 --- a/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryList-001.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <title>CSSOM View Module test:MediaQueryList</title> - <link rel="author" title="unbug" href="mailto:tidelgl@gmail.com" /> - <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface"> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - <style type="text/css"> - </style> -</head> -<body> - <p>This case tests the MediaQueryList</p> - <div id="log"></div> - <script> - test(function(){ - assert_equals(window.matchMedia('(min-width: 1px)').matches, true, "Expected any device to match min-width: 1px"); - },'matchMedia'); - </script> -</body> -</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryList-addListener-handleEvent.html b/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryList-addListener-handleEvent.html new file mode 100644 index 0000000..5bdd9df --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryList-addListener-handleEvent.html
@@ -0,0 +1,106 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<meta name="flags" content="dom"> +<title>CSS Test: CSSOM View MediaQueryList::addListener with handleEvent</title> +<link rel="help" href="https://dom.spec.whatwg.org/#callbackdef-eventlistener"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/matchMedia.js"></script> +<div id="log"></div> +<script> +"use strict"; +setup({ allow_uncaught_exception: true }); + +promise_test(async t => { + const mql = await createMQL(t); + + let _this; + let _event; + const listener = { + handleEvent(event) { + _this = this; + _event = event; + }, + }; + + mql.addListener(listener); + triggerMQLEvent(mql); + await waitForChangesReported(); + + assert_equals(_this, listener); + assert_equals(_event.media, mql.media); + assert_equals(_event.matches, mql.matches); +}, "calls handleEvent method of event listener"); + +promise_test(async t => { + const mql = await createMQL(t); + + let calls = 0; + mql.addListener({ + get handleEvent() { + calls++; + return function() {}; + }, + }); + assert_equals(calls, 0); + + triggerMQLEvent(mql); + await waitForChangesReported(); + assert_equals(calls, 1); + + triggerMQLEvent(mql); + await waitForChangesReported(); + assert_equals(calls, 2); +}, "looks up handleEvent method on every event dispatch"); + +promise_test(async t => { + const mql = await createMQL(t); + + let calls = 0; + const listener = () => { + calls++; + }; + + Object.defineProperty(listener, "handleEvent", { + get: t.unreached_func("handleEvent method should not be looked up on functions"), + }); + mql.addListener(listener); + + triggerMQLEvent(mql); + await waitForChangesReported(); + assert_equals(calls, 1); +}, "doesn't look up handleEvent method on callable event listeners"); + +const uncaught_error_test = async (t, listener) => { + const mql = await createMQL(t); + mql.addListener(listener); + + const eventWatcher = new EventWatcher(t, window, "error"); + const errorPromise = eventWatcher.wait_for("error"); + triggerMQLEvent(mql); + + const event = await errorPromise; + throw event.error; +}; + +promise_test(t => { + const error = { name: "test" }; + const listener = { + get handleEvent() { + throw error; + }, + }; + + return promise_rejects_exactly(t, error, uncaught_error_test(t, listener)); +}, "rethrows errors when getting handleEvent"); + +promise_test(t => { + const listener = { handleEvent: null }; + return promise_rejects(t, new TypeError(), uncaught_error_test(t, listener)); +}, "throws if handleEvent is falsy and not callable"); + +promise_test(t => { + const listener = { handleEvent: "str" }; + return promise_rejects(t, new TypeError(), uncaught_error_test(t, listener)); +}, "throws if handleEvent is thruthy and not callable"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryList-addListener-removeListener.html b/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryList-addListener-removeListener.html new file mode 100644 index 0000000..5446e48 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryList-addListener-removeListener.html
@@ -0,0 +1,121 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<meta name="flags" content="dom"> +<title>CSS Test: CSSOM View MediaQueryList::{add,remove}Listener</title> +<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com"> +<link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/matchMedia.js"></script> +<div id="log"></div> +<script> +"use strict"; + +test(function() { + const mql = window.matchMedia("all"); + assert_inherits(mql, "addListener"); + assert_equals(typeof mql.addListener, "function"); +}, "MediaQueryList::addListener is a function"); + +promise_test(async t => { + const iframe = await createIFrame(t, 200, 100); + const heightMQL = iframe.contentWindow.matchMedia("(max-height: 50px)"); + const widthMQL = iframe.contentWindow.matchMedia("(min-width: 150px)"); + + let heightEvent; + let widthEvent; + + heightMQL.addListener(event => { + heightEvent = event; + }); + widthMQL.addListener(event => { + widthEvent = event; + }); + + assert_false(heightMQL.matches); + assert_true(widthMQL.matches); + + iframe.height = "50"; // 200x100 => 200x50 + await waitForChangesReported(); + + assert_equals(heightEvent.media, heightMQL.media); + assert_true(heightEvent.matches); + assert_true(heightMQL.matches); + assert_true(widthMQL.matches); + + iframe.width = "100"; // 200x50 => 100x50 + await waitForChangesReported(); + + assert_equals(widthEvent.media, widthMQL.media); + assert_false(widthEvent.matches); + assert_false(widthMQL.matches); + assert_true(heightMQL.matches); +}, "listeners are called when <iframe> is resized"); + +promise_test(async t => { + const mql = await createMQL(t); + + let eventsCount = 0; + mql.addListener(() => { + eventsCount++; + }); + + for (let i = 1; i <= 10; i++) { + triggerMQLEvent(mql); + await waitForChangesReported(); + assert_equals(eventsCount, i); + } +}, "listeners are called correct number of times"); + +promise_test(async t => { + const mql = await createMQL(t); + const calls = []; + + mql.addListener(() => { + calls.push("1st"); + }); + mql.addListener(() => { + calls.push("2nd"); + }); + + triggerMQLEvent(mql); + await waitForChangesReported(); + + assert_equals(calls[0], "1st"); + assert_equals(calls[1], "2nd"); +}, "listeners are called in order they were added"); + +promise_test(async t => { + const mql = await createMQL(t); + + let called = 0; + const listener = () => { + called++; + }; + + mql.addListener(listener); + mql.addListener(listener); + + triggerMQLEvent(mql); + await waitForChangesReported(); + + assert_equals(called, 1); +}, "listener that was added twice is called only once"); + +test(function() { + const mql = window.matchMedia("all"); + assert_inherits(mql, "removeListener"); + assert_equals(typeof mql.removeListener, "function"); +}, "MediaQueryList::removeListener is a function"); + +promise_test(async t => { + const mql = await createMQL(t); + const listener = t.unreached_func("should not be called"); + + mql.addListener(listener); + mql.removeListener(listener); + + triggerMQLEvent(mql); + await waitForChangesReported(); +}, "MediaQueryList::removeListener removes added listener"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryList-with-empty-string.html b/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryList-with-empty-string.html deleted file mode 100644 index 3d5a5316..0000000 --- a/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryList-with-empty-string.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>cssom-view - MediaQueryList with empty string</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script> -test(function () { - var mql = window.matchMedia(''); - assert_equals(mql.media, '', "This should be an empty media query list"); - assert_equals(mql.matches, true, "Empty media query list should evaluate to true"); -}); -</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryListEvent.html b/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryListEvent.html index 6631039d..24cce3c 100644 --- a/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryListEvent.html +++ b/third_party/blink/web_tests/external/wpt/css/cssom-view/MediaQueryListEvent.html
@@ -10,22 +10,10 @@ "use strict"; test(t => { - assert_equals(MediaQueryListEvent.length, 1); - assert_throws(new TypeError(), () => { - new MediaQueryListEvent(); - }); -}, "type argument is required"); - -test(t => { assert_equals(new MediaQueryListEvent("test").type, "test"); }, 'type can be different from "change"'); test(t => { - assert_equals(Object.getPrototypeOf(MediaQueryListEvent), Event); - assert_true(new MediaQueryListEvent("change") instanceof Event); -}, "extends Event"); - -test(t => { const event = new MediaQueryListEvent("change"); assert_equals(event.media, ""); @@ -47,16 +35,4 @@ assert_true(event.bubbles); assert_true(event.cancelable); }, "init dictionary overrides"); - -test(t => { - const event = new MediaQueryListEvent("change"); - assert_idl_attribute(event, "media"); - assert_readonly(event, "media"); -}, "MediaQueryListEvent::media is read-only IDL attribute"); - -test(t => { - const event = new MediaQueryListEvent("change"); - assert_idl_attribute(event, "matches"); - assert_readonly(event, "matches"); -}, "MediaQueryListEvent::matches is read-only IDL attribute"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom-view/matchMedia.html b/third_party/blink/web_tests/external/wpt/css/cssom-view/matchMedia.html new file mode 100644 index 0000000..14df3d02 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/cssom-view/matchMedia.html
@@ -0,0 +1,79 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<meta name="flags" content="dom"> +<title>CSS Test: CSSOM View matchMedia and MediaQueryList</title> +<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com"> +<link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-window-matchmedia"> +<link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface"> +<link rel="help" href="http://www.w3.org/TR/cssom-1/#serializing-media-queries"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/matchMedia.js"></script> +<div id="log"></div> +<script> +"use strict"; + +test(() => { + assert_equals( + typeof window.matchMedia, + "function", + "FATAL ERROR: The window.matchMedia function is not present. The rest of the testsuite will fail to run." + ); +}, "window.matchMedia is a function"); + +test(() => { + const mql = window.matchMedia("all"); + assert_equals(mql.media, "all"); + assert_true(mql.matches); +}, 'window.matchMedia("all") matches'); + +test(() => { + const mql = window.matchMedia(""); + assert_equals(mql.media, ""); + assert_true(mql.matches); +}, 'window.matchMedia("") matches'); + +test(() => { + const mql = window.matchMedia("(min-width: 1px)"); + assert_equals(mql.media, "(min-width: 1px)"); + assert_true(mql.matches); +}, 'window.matchMedia("(min-width: 1px)") matches'); + +test(() => { + const mql = window.matchMedia("::"); + assert_true(mql instanceof MediaQueryList); + assert_equals(mql.media, "not all"); + assert_false(mql.matches); +}, 'media query with syntax error is serialized as "not all"'); + +promise_test(async t => { + const iframe = await createIFrame(t, 200); + const mql = iframe.contentWindow.matchMedia("(max-width: 199px), all and (min-width: 200px)"); + assert_equals(mql.media, "(max-width: 199px), (min-width: 200px)"); + assert_true(mql.matches); +}, 'iframe.matchMedia("(max-width: 199px), all and (min-width: 200px)") is serialized w/o "all"'); + +promise_test(async t => { + const iframe = await createIFrame(t); + const mql = iframe.contentWindow.matchMedia("(min-aspect-ratio: 1/1)"); + assert_true(mql.matches); +}, 'iframe.matchMedia("(min-aspect-ratio: 1/1)") matches'); + +promise_test(async t => { + const iframe = await createIFrame(t, 200); + const mql = iframe.contentWindow.matchMedia("(width: 200px)"); + assert_true(mql.matches); +}, 'iframe.matchMedia("(width: 200px)") matches'); + +promise_test(async t => { + const iframe = await createIFrame(t, 200, 100); + const mql = iframe.contentWindow.matchMedia("(max-height: 50px)"); + assert_false(mql.matches); +}, 'iframe.matchMedia("(max-height: 50px)") matches'); + +promise_test(async t => { + const iframe = await createIFrame(t, 200, 100); + const mql = iframe.contentWindow.matchMedia("(min-width: 150px)"); + assert_true(mql.matches); +}, 'iframe.matchMedia("(min-width: 150px)") matches'); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom-view/matchMedia.xht b/third_party/blink/web_tests/external/wpt/css/cssom-view/matchMedia.xht deleted file mode 100644 index 202a3b7..0000000 --- a/third_party/blink/web_tests/external/wpt/css/cssom-view/matchMedia.xht +++ /dev/null
@@ -1,188 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>CSS Test: CSSOM View matchMedia and MediaQueryList</title> - <meta name="timeout" content="long"/> - <link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com" /> - <link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-window-matchmedia" /> - <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface" /> - <link rel="help" href="http://www.w3.org/TR/cssom-1/#serializing-media-queries" /> - <meta name="flags" content="dom" /> - <script src="/resources/testharness.js" type="text/javascript" /> - <script src="/resources/testharnessreport.js" type="text/javascript" /> - <style type="text/css"><![CDATA[ - iframe { border: none; } - ]]></style> - </head> - <body> - <noscript>Test not run - javascript required.</noscript> - <div id="log" /> - <iframe width="200" height="100" /> - <script type="text/javascript"><![CDATA[ - function reflow(doc) { - doc.body.offsetWidth; - } - - var iframe = document.querySelector("iframe"); - var iframe_window = window.frames[0]; - - reflow(iframe_window.document); - - test(function(){ - assert_inherits(window, "matchMedia"); - }, "window.matchMedia exists"); - - test(function(){ - assert_true(window.matchMedia instanceof Function, "FATAL ERROR: The window.matchMedia function is not present. The rest of the testsuite will fail to run."); - }, "window.matchMedia is a Function"); - - var mql, mql1, mql2, mql3; - - test(function(){ - mql = window.matchMedia("all"); - assert_true(mql instanceof MediaQueryList, "matchMedia(\"all\") returned MediaQueryList object."); - }, "window.matchMedia(\"all\")"); - - test(function(){ - assert_idl_attribute(mql, "media", "Check that MediaQueryList.media exists."); - }, "MediaQueryList.media exists"); - - test(function(){ - assert_readonly(mql, "media", "Check that MediaQueryList.media is readonly."); - }, "MediaQueryList.media is readonly"); - - test(function(){ - assert_equals(mql.media, "all"); - }, "MediaQueryList.media for \"all\""); - - test(function(){ - assert_idl_attribute(mql, "matches", "Check that MediaQueryList.matches exists."); - }, "MediaQueryList.matches exists"); - - test(function(){ - assert_readonly(mql, "matches", "Check that MediaQueryList.matches is readonly."); - }, "MediaQueryList.matches is readonly"); - - test(function(){ - assert_true(mql.matches); - }, "MediaQueryList.matches for \"all\""); - - test(function(){ - assert_inherits(mql, "addListener"); - }, "MediaQueryList.addListener exists"); - - test(function(){ - assert_true(mql.addListener instanceof Function); - }, "MediaQueryList.addListener is a Function"); - - test(function(){ - assert_inherits(mql, "removeListener"); - }, "MediaQueryList.removeListener exists"); - - test(function(){ - assert_true(mql.removeListener instanceof Function); - }, "MediaQueryList.removeListener is a Function"); - - test(function(){ - mql = window.matchMedia("::"); - assert_true(mql instanceof MediaQueryList, "window.matchMedia(\"::\") returned MediaQueryList object."); - assert_equals(mql.media, "not all", "MediaQueryList.media serialized as \"not all\" from original string with syntax error."); - }, "MediaQueryList.media syntax error"); - - test(function(){ - assert_false(mql.matches); - }, "MediaQueryList.matches for \"not all\""); - - test(function(){ - mql = iframe_window.matchMedia("(max-width: 199px), all and (min-width: 200px)"); - assert_equals(mql.media, "(max-width: 199px), (min-width: 200px)"); - assert_true(mql.matches); - }, "MediaQueryList.matches for \"(max-width: 199px), all and (min-width: 200px)\"") - - test(function(){ - mql = iframe_window.matchMedia("(min-aspect-ratio: 1/1)"); - assert_true(mql.matches); - }, "MediaQueryList.matches for \"(min-aspect-ratio: 1/1)\""); - - test(function(){ - mql = iframe_window.matchMedia("(width: 200px)"); - assert_true(mql.matches); - }, "MediaQueryList.matches for \"(width: 200px)\""); - - test(function(){ - mql1 = iframe_window.matchMedia("(max-height: 50px)"); - assert_false(mql1.matches); - }, "MediaQueryList.matches for \"(max-height: 50px)\""); - - test(function(){ - mql2 = iframe_window.matchMedia("(min-width: 150px)"); - assert_true(mql2.matches); - }, "MediaQueryList.matches for \"(min-width: 150px)\""); - - var resizeTest = async_test("Resize iframe from 200x100 to 200x50, then to 100x50"); - var listenerOrderTest = async_test("Listeners are called in the order which they have been added"); - var duplicateListenerTest = async_test("Listener added twice is only called once."); - - window.onload = function(){ - - var rmListener = function(x){ - resizeTest.step(function(){ - assert_unreached("removeListener was not successful."); - }); - }; - - var dupListener = function(x){ - duplicateListenerTest.step(function(){ - assert_false(mql1.dupListenerCalled, "Check that this listener has not been called before."); - mql1.dupListenerCalled = true; - }); - }; - - mql1.firstListenerCalled = false; - mql1.dupListenerCalled = false; - // Add listener twice and remove it below. Should not be called. - mql1.addListener(rmListener); - mql1.addListener(rmListener); - // Add listener twice. Should only be called once. - mql1.addListener(dupListener); - mql1.addListener(dupListener); - - mql1.addListener(function(x){ - resizeTest.step(function(){ - assert_equals(x, mql1, "Check that the MediaQueryList passed to the handler is the same that addListener was invoked on."); - assert_true(x.matches, "(max-height: 50px) should now pass."); - assert_true(mql2.matches, "(min-width: 150px) should still pass."); - iframe.width = "100"; - }); - - listenerOrderTest.step(function(){ - assert_false(mql1.firstListenerCalled, "Check that this listener is only called once."); - mql1.firstListenerCalled = true; - }); - }); - - mql1.addListener(function(x){ - listenerOrderTest.step(function(){ - assert_true(mql1.firstListenerCalled, "Check that the listener added last is called last."); - }); - listenerOrderTest.done(); - }); - - mql1.removeListener(rmListener); - - mql2.addListener(function(x){ - duplicateListenerTest.done(); - resizeTest.step(function(){ - assert_equals(x, mql2, "Check that the MediaQueryList passed to the handler is the same that addListener was invoked on."); - assert_true(mql1.matches, "(max-height: 50px) should still pass."); - assert_false(x.matches, "(min-width: 150px) should now fail."); - }); - resizeTest.done(); - }); - - iframe.height = "50"; - };]]> - </script> - </body> -</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom-view/matchMediaAddListener-handleEvent.html b/third_party/blink/web_tests/external/wpt/css/cssom-view/matchMediaAddListener-handleEvent.html deleted file mode 100644 index 8bc66569..0000000 --- a/third_party/blink/web_tests/external/wpt/css/cssom-view/matchMediaAddListener-handleEvent.html +++ /dev/null
@@ -1,136 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>CSS Test: CSSOM View matchMedia handleEvent via addListener</title> -<link rel="help" href="https://dom.spec.whatwg.org/#callbackdef-eventlistener"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/matchMedia.js"></script> -<div id="log"></div> -<script> -setup({ allow_uncaught_exception: true }); - -promise_test(async t => { - const iframe = await createIframe(t); - const mql = iframe.contentWindow.matchMedia(MEDIA_QUERY); - - let _this; - let _event; - const eventListener = { - handleEvent(event) { - _this = this; - _event = event; - }, - }; - - mql.addListener(eventListener); - triggerMQLEvent(iframe); - await waitForChangesReported(); - - assert_equals(_this, eventListener); - assert_equals(_event.matches, mql.matches); - assert_equals(_event.media, MEDIA_QUERY); -}, "calls handleEvent method of event listener"); - -promise_test(async t => { - const iframe = await createIframe(t); - const mql = iframe.contentWindow.matchMedia(MEDIA_QUERY); - - let uncaughtError; - const errorHandler = event => { - uncaughtError = event.error; - }; - window.addEventListener("error", errorHandler); - t.add_cleanup(() => { - window.removeEventListener("error", errorHandler); - }); - - const thrownError = { name: "test" }; - mql.addListener({ - get handleEvent() { - throw thrownError; - }, - }); - - triggerMQLEvent(iframe); - await waitForChangesReported(); - assert_equals(uncaughtError, thrownError); -}, "rethrows errors when getting handleEvent"); - -promise_test(async t => { - const iframe = await createIframe(t); - const mql = iframe.contentWindow.matchMedia(MEDIA_QUERY); - - let calls = 0; - mql.addListener({ - get handleEvent() { - calls++; - return function() {}; - }, - }); - assert_equals(calls, 0); - - triggerMQLEvent(iframe); - await waitForChangesReported(); - assert_equals(calls, 1); - - triggerMQLEvent(iframe); - await waitForChangesReported(); - assert_equals(calls, 2); -}, "looks up handleEvent method on every event dispatch"); - -promise_test(async t => { - const iframe = await createIframe(t); - const mql = iframe.contentWindow.matchMedia(MEDIA_QUERY); - - let calls = 0; - const eventListener = function() { calls++; }; - Object.defineProperty(eventListener, "handleEvent", { - get: t.unreached_func("handleEvent method should not be looked up on functions"), - }); - mql.addListener(eventListener); - - triggerMQLEvent(iframe); - await waitForChangesReported(); - assert_equals(calls, 1); -}, "doesn't look up handleEvent method on callable event listeners"); - -promise_test(async t => { - const iframe = await createIframe(t); - const mql = iframe.contentWindow.matchMedia(MEDIA_QUERY); - - let uncaughtError; - const errorHandler = event => { - uncaughtError = event.error; - }; - window.addEventListener("error", errorHandler); - t.add_cleanup(() => { - window.removeEventListener("error", errorHandler); - }); - - mql.addListener({ handleEvent: null }); - triggerMQLEvent(iframe); - await waitForChangesReported(); - - assert_equals(uncaughtError.name, "TypeError"); -}, "throws if handleEvent is falsy and not callable"); - -promise_test(async t => { - const iframe = await createIframe(t); - const mql = iframe.contentWindow.matchMedia(MEDIA_QUERY); - - let uncaughtError; - const errorHandler = event => { - uncaughtError = event.error; - }; - window.addEventListener("error", errorHandler); - t.add_cleanup(() => { - window.removeEventListener("error", errorHandler); - }); - - mql.addListener({ handleEvent: "str" }); - triggerMQLEvent(iframe); - await waitForChangesReported(); - - assert_equals(uncaughtError.name, "TypeError"); -}, "throws if handleEvent is thruthy and not callable"); -</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom-view/matchMediaAddListener.html b/third_party/blink/web_tests/external/wpt/css/cssom-view/matchMediaAddListener.html deleted file mode 100644 index 7236be7..0000000 --- a/third_party/blink/web_tests/external/wpt/css/cssom-view/matchMediaAddListener.html +++ /dev/null
@@ -1,65 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <title>CSS Test: CSSOM View matchMedia addListener</title> - <link rel="author" title="Chris Wu" href="mailto:pwx.frontend@gmail.com" /> - <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface" /> - <meta name="flags" content="dom" /> - <script src="/resources/testharness.js" type="text/javascript"></script> - <script src="/resources/testharnessreport.js" type="text/javascript"></script> - <style type="text/css"> - iframe { border: none; } - </style> - </head> - <body> - <div id="log"></div> - <iframe width="200" height="100" id="iframe1"></iframe> - <script> - function reflow(doc) { - doc.body.offsetWidth; - } - - var iframe = document.querySelector("iframe"); - var iframe_window = window.frames[0]; - var iframe1 = document.getElementById("iframe1"); - reflow(iframe_window.document); - - var i = 0; - var totalCount = 10; - var count = 0; - var divineCount = 10; - var width_list = [201,199]; - var mq1 = iframe_window.matchMedia("(max-width:200px)"); - mq1.addListener(function(mql){ - - count = count + 1; - - }); - - var equalAssert = async_test("Check for the correct number of event triggers"); - - var changeFrameWidth = function(iWidth) { - iframe1.style.width = iWidth + "px"; - i = (i === 0) ? 1 : 0; - totalCount = totalCount - 1; - if(totalCount > 0) - { - step_timeout(function(){ - changeFrameWidth(width_list[i]); - }, 100); - } - else - { - step_timeout(function(){ - equalAssert.step(function(){ - assert_equals(divineCount, count, "this will be 10 times of event triggers by change width"); - }); - equalAssert.done(); - }, 100); - } - }; - - changeFrameWidth(width_list[0]); - </script> - </body> -</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom-view/resources/matchMedia.js b/third_party/blink/web_tests/external/wpt/css/cssom-view/resources/matchMedia.js index 93f4a31..8013699b 100644 --- a/third_party/blink/web_tests/external/wpt/css/cssom-view/resources/matchMedia.js +++ b/third_party/blink/web_tests/external/wpt/css/cssom-view/resources/matchMedia.js
@@ -1,11 +1,21 @@ -const IFRAME_BASE_WIDTH = "200"; -const MEDIA_QUERY = `(max-width: ${IFRAME_BASE_WIDTH}px)`; +const IFRAME_DEFAULT_SIZE = "200"; +const iframes = new WeakMap(); -function createIframe(t) { +async function createMQL(t) { + const iframe = await createIFrame(t); + const mql = iframe.contentWindow.matchMedia(`(max-width: ${IFRAME_DEFAULT_SIZE}px)`); + assert_true(mql.matches, "MQL should match on newly created <iframe>"); + iframes.set(mql, iframe); + return mql; +} + +function createIFrame(t, width = IFRAME_DEFAULT_SIZE, height = width) { + assert_not_equals(document.body, null, "<body> element is missing"); + const iframe = document.createElement("iframe"); iframe.srcdoc = ""; - iframe.width = IFRAME_BASE_WIDTH; - iframe.height = "100"; + iframe.width = String(width); + iframe.height = String(height); iframe.style.border = "none"; t.add_cleanup(() => { @@ -14,6 +24,7 @@ return new Promise(resolve => { iframe.addEventListener("load", () => { + iframe.contentDocument.body.offsetWidth; // reflow resolve(iframe); }); @@ -21,8 +32,10 @@ }); } -function triggerMQLEvent(iframe) { - iframe.width = iframe.width === IFRAME_BASE_WIDTH ? "250" : IFRAME_BASE_WIDTH; +function triggerMQLEvent(mql) { + const iframe = iframes.get(mql); + assert_not_equals(iframe, undefined, "Passed MQL instance was not created with createMQL"); + iframe.width = iframe.width === IFRAME_DEFAULT_SIZE ? "250" : IFRAME_DEFAULT_SIZE; } function waitForChangesReported() {
diff --git a/third_party/blink/web_tests/external/wpt/fetch/corb/script-resource-with-nonsniffable-types.tentative.sub.html b/third_party/blink/web_tests/external/wpt/fetch/corb/script-resource-with-nonsniffable-types.tentative.sub.html index f83eff8..592a33ef 100644 --- a/third_party/blink/web_tests/external/wpt/fetch/corb/script-resource-with-nonsniffable-types.tentative.sub.html +++ b/third_party/blink/web_tests/external/wpt/fetch/corb/script-resource-with-nonsniffable-types.tentative.sub.html
@@ -17,6 +17,8 @@ setup({allow_uncaught_exception : true}); function test(mime_type, is_blocking_expected) { + var action = is_blocking_expected ? "blocks" : "does not block"; + async_test(function(t) { var script = document.createElement("script") var script_has_run_token = "script_has_run" + token(); @@ -49,7 +51,7 @@ body = `window['${script_has_run_token}'] = true;` script.src = src_prefix + "?type=" + mime_type + "&body=" + encodeURIComponent(body); document.body.appendChild(script) - }, "CORB-blocks '" + mime_type + "' that starts with the following JSON parser breaker: " + body); + }, "CORB " + action + " '" + mime_type + "'"); } // Some mime types should be protected by CORB without any kind
diff --git a/third_party/blink/web_tests/external/wpt/fetch/metadata/redirect/redirect-https-downgrade.tentative.sub-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/metadata/redirect/redirect-https-downgrade.tentative.sub-expected.txt index f6bcb6a..5587c493 100644 --- a/third_party/blink/web_tests/external/wpt/fetch/metadata/redirect/redirect-https-downgrade.tentative.sub-expected.txt +++ b/third_party/blink/web_tests/external/wpt/fetch/metadata/redirect/redirect-https-downgrade.tentative.sub-expected.txt
@@ -1,4 +1,15 @@ This is a testharness.js-based test. -FAIL redirect-https-downgrade Uncaught SyntaxError: Unexpected token 'return' +PASS Https downgrade iframe +PASS Https downgrade top level navigation +PASS Https downgrade embed +PASS Https downgrade fetch() api +PASS Https downgrade object +PASS Https downgrade prefetch => No headers +PASS Https downgrade preload +PASS Https downgrade stylesheet +PASS Https downgrade track +PASS Https downgrade image => No headers +FAIL Https downgrade script => No headers assert_equals: mode expected "no-cors" but got "" +PASS Https downgrade font => No headers Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/fetch/metadata/redirect/redirect-https-downgrade.tentative.sub.html b/third_party/blink/web_tests/external/wpt/fetch/metadata/redirect/redirect-https-downgrade.tentative.sub.html index eee21da..760ed3a2 100644 --- a/third_party/blink/web_tests/external/wpt/fetch/metadata/redirect/redirect-https-downgrade.tentative.sub.html +++ b/third_party/blink/web_tests/external/wpt/fetch/metadata/redirect/redirect-https-downgrade.tentative.sub.html
@@ -37,7 +37,7 @@ }, "Https downgrade font => No headers"); }); - promise_test(() => + promise_test(() => { return requestViaImage(secureRedirectURL + encodeURIComponent("http://{{host}}:{{ports[http][0]}}/common/security-features/subresource/image.py")) .then(result => { headers = result.headers; @@ -53,7 +53,8 @@ "user": undefined, "mode": undefined, }); - }), "Https downgrade image => No headers"); + }); + }, "Https downgrade image => No headers"); </script> <script src="https://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=http%3A%2F%2F{{host}}%3A{{ports[http][0]}}%2Ffetch%2Fmetadata%2Fresources%2Fecho-as-script.py"></script>
diff --git a/third_party/blink/web_tests/external/wpt/tools/ci/ci_wptrunner_infrastructure.sh b/third_party/blink/web_tests/external/wpt/tools/ci/ci_wptrunner_infrastructure.sh index e5b485d..8db0879 100755 --- a/third_party/blink/web_tests/external/wpt/tools/ci/ci_wptrunner_infrastructure.sh +++ b/third_party/blink/web_tests/external/wpt/tools/ci/ci_wptrunner_infrastructure.sh
@@ -16,7 +16,7 @@ else ARGS=$1 fi - ./wpt run --log-tbpl - --yes --manifest ~/meta/MANIFEST.json --metadata infrastructure/metadata/ --install-fonts $ARGS $PRODUCT infrastructure/ + TERM=dumb ./wpt run --log-mach - --yes --manifest ~/meta/MANIFEST.json --metadata infrastructure/metadata/ --install-fonts $ARGS $PRODUCT infrastructure/ } main() {
diff --git a/third_party/blink/web_tests/external/wpt/tools/ci/epochs_update.sh b/third_party/blink/web_tests/external/wpt/tools/ci/epochs_update.sh new file mode 100755 index 0000000..c95f9ca --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/tools/ci/epochs_update.sh
@@ -0,0 +1,18 @@ +#!/bin/bash +set -ex + +SCRIPT_DIR=$(cd $(dirname "$0") && pwd -P) +WPT_ROOT=$SCRIPT_DIR/../.. +cd $WPT_ROOT + +if [ -z "$GITHUB_TOKEN" ]; then + echo "GITHUB_TOKEN must be set as an environment variable" + exit 1 +fi + +REMOTE=https://x-access-token:$GITHUB_TOKEN@github.com/web-platform-tests/wpt.git + +git branch epochs/three_hourly $(./wpt rev-list --epoch 3h) +# This is safe because `git push` will by default fail for a non-fast-forward +# push, for example if the remote branch is ahead of the local branch. +git push $REMOTE epochs/three_hourly
diff --git a/third_party/blink/web_tests/external/wpt/tools/ci/jobs.py b/third_party/blink/web_tests/external/wpt/tools/ci/jobs.py index b7ada2a..3d809ef 100644 --- a/third_party/blink/web_tests/external/wpt/tools/ci/jobs.py +++ b/third_party/blink/web_tests/external/wpt/tools/ci/jobs.py
@@ -32,9 +32,14 @@ "tools_unittest": ["tools/"], "wptrunner_unittest": ["tools/"], "build_css": ["css/"], - "update_built": ["2dcontext/", + "update_built": ["update-built-tests\\.sh", + "2dcontext/", + "infrastructure/", "html/", - "offscreen-canvas/"], + "offscreen-canvas/", + "mimesniff/", + "css/css-ui/", + "WebIDL"], "wpt_integration": ["tools/"], "wptrunner_infrastructure": ["infrastructure/", "tools/", "resources/"], }
diff --git a/third_party/blink/web_tests/external/wpt/tools/ci/taskcluster-run.py b/third_party/blink/web_tests/external/wpt/tools/ci/taskcluster-run.py index ad33cb53..8a60012 100755 --- a/third_party/blink/web_tests/external/wpt/tools/ci/taskcluster-run.py +++ b/third_party/blink/web_tests/external/wpt/tools/ci/taskcluster-run.py
@@ -56,8 +56,8 @@ logger.info("Running all tests") wpt_args += [ - "--log-tbpl-level=info", - "--log-tbpl=-", + "--log-mach-level=info", + "--log-mach=-", "-y", "--no-pause", "--no-restart-on-unexpected", @@ -70,8 +70,7 @@ command = ["python", "./wpt", "run"] + wpt_args + [product] logger.info("Executing command: %s" % " ".join(command)) - - retcode = subprocess.call(command) + retcode = subprocess.call(command, env=dict(os.environ, TERM="dumb")) if retcode != 0: sys.exit(retcode)
diff --git a/third_party/blink/web_tests/external/wpt/tools/wptrunner/requirements.txt b/third_party/blink/web_tests/external/wpt/tools/wptrunner/requirements.txt index dbed37cc..f8cce78 100644 --- a/third_party/blink/web_tests/external/wpt/tools/wptrunner/requirements.txt +++ b/third_party/blink/web_tests/external/wpt/tools/wptrunner/requirements.txt
@@ -1,6 +1,6 @@ html5lib==1.0.1 mozinfo==1.1.0 -mozlog==4.2.0 +mozlog==5.0 mozdebug==0.1.1 pillow==6.2.0 urllib3[secure]==1.25.6
diff --git a/third_party/blink/web_tests/external/wpt/tools/wptrunner/requirements_firefox.txt b/third_party/blink/web_tests/external/wpt/tools/wptrunner/requirements_firefox.txt index 2021f55..85efd35 100644 --- a/third_party/blink/web_tests/external/wpt/tools/wptrunner/requirements_firefox.txt +++ b/third_party/blink/web_tests/external/wpt/tools/wptrunner/requirements_firefox.txt
@@ -5,7 +5,7 @@ mozleak==0.2 moznetwork==0.27 mozprocess==1.0.0 -mozprofile==2.3.0 -mozrunner==7.5.1 -mozversion==2.1.0 +mozprofile==2.4.0 +mozrunner==7.7.0 +mozversion==2.2.0 psutil==5.6.3
diff --git a/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/browsers/firefox.py b/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/browsers/firefox.py index 6cf784f..5e3e41eb 100644 --- a/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/browsers/firefox.py +++ b/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/browsers/firefox.py
@@ -80,7 +80,6 @@ "ca_certificate_path": config.ssl_config["ca_cert_path"], "e10s": kwargs["gecko_e10s"], "enable_webrender": kwargs["enable_webrender"], - "lsan_dir": kwargs["lsan_dir"], "stackfix_dir": kwargs["stackfix_dir"], "binary_args": kwargs["binary_args"], "timeout_multiplier": get_timeout_multiplier(test_type, @@ -208,7 +207,7 @@ def __init__(self, logger, binary, prefs_root, test_type, extra_prefs=None, debug_info=None, symbols_path=None, stackwalk_binary=None, certutil_binary=None, - ca_certificate_path=None, e10s=False, enable_webrender=False, lsan_dir=None, stackfix_dir=None, + ca_certificate_path=None, e10s=False, enable_webrender=False, stackfix_dir=None, binary_args=None, timeout_multiplier=None, leak_check=False, asan=False, stylo_threads=1, chaos_mode_flags=None, config=None, browser_channel="nightly", headless=None, **kwargs): Browser.__init__(self, logger) @@ -238,7 +237,6 @@ self.init_timeout = self.init_timeout * timeout_multiplier self.asan = asan - self.lsan_dir = lsan_dir self.lsan_allowed = None self.lsan_max_stack_depth = None self.mozleak_allowed = None @@ -279,8 +277,7 @@ env = test_environment(xrePath=os.path.dirname(self.binary), debugger=self.debug_info is not None, - log=self.logger, - lsanPath=self.lsan_dir) + useLSan=True, log=self.logger) env["STYLO_THREADS"] = str(self.stylo_threads) if self.chaos_mode_flags is not None:
diff --git a/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/wptcommandline.py b/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/wptcommandline.py index 3fc0f6d6..7919121f 100644 --- a/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/wptcommandline.py +++ b/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/wptcommandline.py
@@ -263,8 +263,6 @@ help="Disable the WebRender compositor in Gecko.") gecko_group.add_argument("--stackfix-dir", dest="stackfix_dir", action="store", help="Path to directory containing assertion stack fixing scripts") - gecko_group.add_argument("--lsan-dir", dest="lsan_dir", action="store", - help="Path to directory containing LSAN suppressions file") gecko_group.add_argument("--setpref", dest="extra_prefs", action='append', default=[], metavar="PREF=VALUE", help="Defines an extra user preference (overrides those in prefs_root)") @@ -549,9 +547,6 @@ if kwargs["reftest_internal"] is None: kwargs["reftest_internal"] = True - if kwargs["lsan_dir"] is None: - kwargs["lsan_dir"] = kwargs["prefs_root"] - if kwargs["reftest_screenshot"] is None: kwargs["reftest_screenshot"] = "unexpected"
diff --git a/third_party/blink/web_tests/external/wpt/update-built-tests.sh b/third_party/blink/web_tests/external/wpt/update-built-tests.sh index 1a33154..a45058c 100755 --- a/third_party/blink/web_tests/external/wpt/update-built-tests.sh +++ b/third_party/blink/web_tests/external/wpt/update-built-tests.sh
@@ -7,4 +7,4 @@ offscreen-canvas/tools/build.sh python mimesniff/mime-types/resources/generated-mime-types.py python3 css/css-ui/tools/appearance-build-webkit-reftests.py -python3 WebIDL/generate-setlike.py +python3 WebIDL/tools/generate-setlike.py
diff --git a/third_party/blink/web_tests/external/wpt/workers/semantics/interface-objects/003.any.js b/third_party/blink/web_tests/external/wpt/workers/semantics/interface-objects/003.any.js index 1942a46..ea95ded 100644 --- a/third_party/blink/web_tests/external/wpt/workers/semantics/interface-objects/003.any.js +++ b/third_party/blink/web_tests/external/wpt/workers/semantics/interface-objects/003.any.js
@@ -76,8 +76,8 @@ "IDBTransaction", ]; -for (var i = 0; i < unexpected.length; ++i) { +for (var i = 0; i < expected.length; ++i) { test(function() { - assert_true(unexpected[i] in self); - }, "The " + unexpected[i] + " interface object should not be exposed"); + assert_true(expected[i] in self); + }, "The " + expected[i] + " interface object should be exposed"); }
diff --git a/third_party/blink/web_tests/external/wpt/workers/semantics/interface-objects/003.any.sharedworker-expected.txt b/third_party/blink/web_tests/external/wpt/workers/semantics/interface-objects/003.any.sharedworker-expected.txt index c20fb7c..e72a68e 100644 --- a/third_party/blink/web_tests/external/wpt/workers/semantics/interface-objects/003.any.sharedworker-expected.txt +++ b/third_party/blink/web_tests/external/wpt/workers/semantics/interface-objects/003.any.sharedworker-expected.txt
@@ -1,4 +1,68 @@ This is a testharness.js-based test. -FAIL 003 Uncaught ReferenceError: unexpected is not defined +Found 64 tests; 60 PASS, 4 FAIL, 0 TIMEOUT, 0 NOTRUN. +FAIL The ApplicationCache interface object should be exposed assert_true: expected true got false +PASS The WorkerGlobalScope interface object should be exposed +PASS The SharedWorkerGlobalScope interface object should be exposed +FAIL The Worker interface object should be exposed assert_true: expected true got false +FAIL The SharedWorker interface object should be exposed assert_true: expected true got false +PASS The MessagePort interface object should be exposed +PASS The MessageEvent interface object should be exposed +PASS The WorkerNavigator interface object should be exposed +PASS The MessageChannel interface object should be exposed +PASS The WorkerLocation interface object should be exposed +PASS The ImageData interface object should be exposed +PASS The ImageBitmap interface object should be exposed +PASS The CanvasGradient interface object should be exposed +PASS The CanvasPattern interface object should be exposed +FAIL The CanvasPath interface object should be exposed assert_true: expected true got false +PASS The Path2D interface object should be exposed +PASS The PromiseRejectionEvent interface object should be exposed +PASS The EventSource interface object should be exposed +PASS The WebSocket interface object should be exposed +PASS The CloseEvent interface object should be exposed +PASS The BroadcastChannel interface object should be exposed +PASS The ArrayBuffer interface object should be exposed +PASS The Int8Array interface object should be exposed +PASS The Uint8Array interface object should be exposed +PASS The Uint8ClampedArray interface object should be exposed +PASS The Int16Array interface object should be exposed +PASS The Uint16Array interface object should be exposed +PASS The Int32Array interface object should be exposed +PASS The Uint32Array interface object should be exposed +PASS The Float32Array interface object should be exposed +PASS The Float64Array interface object should be exposed +PASS The DataView interface object should be exposed +PASS The XMLHttpRequestEventTarget interface object should be exposed +PASS The XMLHttpRequestUpload interface object should be exposed +PASS The XMLHttpRequest interface object should be exposed +PASS The ProgressEvent interface object should be exposed +PASS The FormData interface object should be exposed +PASS The URL interface object should be exposed +PASS The URLSearchParams interface object should be exposed +PASS The File interface object should be exposed +PASS The Blob interface object should be exposed +PASS The FileList interface object should be exposed +PASS The FileReader interface object should be exposed +PASS The FileReaderSync interface object should be exposed +PASS The EventTarget interface object should be exposed +PASS The ErrorEvent interface object should be exposed +PASS The Event interface object should be exposed +PASS The CustomEvent interface object should be exposed +PASS The DOMException interface object should be exposed +PASS The ReadableStream interface object should be exposed +PASS The WritableStream interface object should be exposed +PASS The ByteLengthQueuingStrategy interface object should be exposed +PASS The CountQueuingStrategy interface object should be exposed +PASS The IDBRequest interface object should be exposed +PASS The IDBOpenDBRequest interface object should be exposed +PASS The IDBVersionChangeEvent interface object should be exposed +PASS The IDBFactory interface object should be exposed +PASS The IDBDatabase interface object should be exposed +PASS The IDBObjectStore interface object should be exposed +PASS The IDBIndex interface object should be exposed +PASS The IDBKeyRange interface object should be exposed +PASS The IDBCursor interface object should be exposed +PASS The IDBCursorWithValue interface object should be exposed +PASS The IDBTransaction interface object should be exposed Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/fast/block/float/float-change-composited-scrolling.html b/third_party/blink/web_tests/fast/block/float/float-change-composited-scrolling.html index ddbea9b..03c3e8a 100644 --- a/third_party/blink/web_tests/fast/block/float/float-change-composited-scrolling.html +++ b/third_party/blink/web_tests/fast/block/float/float-change-composited-scrolling.html
@@ -3,8 +3,7 @@ <script> if (window.internals) { internals.settings.setPreferCompositingToLCDTextEnabled(true); - internals.settings.setMockScrollbarsEnabled(true); - internals.runtimeFlags.overlayScrollbarsEnabled = true; + internals.useMockOverlayScrollbars(); } if (window.testRunner)
diff --git a/third_party/blink/web_tests/fast/css/css2-system-color-expected.html b/third_party/blink/web_tests/fast/css/css2-system-color-expected.html index 9182282..86416fd 100644 --- a/third_party/blink/web_tests/fast/css/css2-system-color-expected.html +++ b/third_party/blink/web_tests/fast/css/css2-system-color-expected.html
@@ -25,6 +25,7 @@ <body> <div class="box"><div class="text">ActiveBorder</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> <div class="box"><div class="text">ActiveCaption</div><div class="inner" style="background-color: rgb(204, 204, 204)"> </div></div> + <div class="box"><div class="text">ActiveText</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> <div class="box"><div class="text">AppWorkspace</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> <div class="box"><div class="text">Background</div><div class="inner" style="background-color: rgb(99, 99, 206)"> </div></div> <div class="box"><div class="text">ButtonFace</div><div class="inner" style="background-color: rgb(221, 221, 221)"> </div></div> @@ -32,6 +33,8 @@ <div class="box"><div class="text">ButtonShadow</div><div class="inner" style="background-color: rgb(136, 136, 136)"> </div></div> <div class="box"><div class="text">ButtonText</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div> <div class="box"><div class="text">CaptionText</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div> + <div class="box"><div class="text">Field</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> + <div class="box"><div class="text">FieldText</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> <div class="box"><div class="text">GrayText</div><div class="inner" style="background-color: rgb(128, 128, 128)"> </div></div> <div class="box"><div class="text">Highlight</div><div class="inner" style="background-color: rgb(181, 213, 255)"> </div></div> <div class="box"><div class="text">HighlightText</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div>
diff --git a/third_party/blink/web_tests/fast/css/css2-system-color.html b/third_party/blink/web_tests/fast/css/css2-system-color.html index 0b2f2f15..a958f62 100644 --- a/third_party/blink/web_tests/fast/css/css2-system-color.html +++ b/third_party/blink/web_tests/fast/css/css2-system-color.html
@@ -27,6 +27,7 @@ <body> <div class="box"><div class="text">ActiveBorder</div><div class="inner" style="background-color: ActiveBorder"> </div></div> <div class="box"><div class="text">ActiveCaption</div><div class="inner" style="background-color: ActiveCaption"> </div></div> + <div class="box"><div class="text">ActiveText</div><div class="inner" style="background-color: ActiveText"> </div></div> <div class="box"><div class="text">AppWorkspace</div><div class="inner" style="background-color: AppWorkspace"> </div></div> <div class="box"><div class="text">Background</div><div class="inner" style="background-color: Background"> </div></div> <div class="box"><div class="text">ButtonFace</div><div class="inner" style="background-color: ButtonFace"> </div></div> @@ -34,6 +35,8 @@ <div class="box"><div class="text">ButtonShadow</div><div class="inner" style="background-color: ButtonShadow"> </div></div> <div class="box"><div class="text">ButtonText</div><div class="inner" style="background-color: ButtonText"> </div></div> <div class="box"><div class="text">CaptionText</div><div class="inner" style="background-color: CaptionText"> </div></div> + <div class="box"><div class="text">Field</div><div class="inner" style="background-color: Field"> </div></div> + <div class="box"><div class="text">FieldText</div><div class="inner" style="background-color: FieldText"> </div></div> <div class="box"><div class="text">GrayText</div><div class="inner" style="background-color: GrayText"> </div></div> <div class="box"><div class="text">Highlight</div><div class="inner" style="background-color: Highlight"> </div></div> <div class="box"><div class="text">HighlightText</div><div class="inner" style="background-color: HighlightText"> </div></div>
diff --git a/third_party/blink/web_tests/fast/css/test-setting-canvas-color-expected.txt b/third_party/blink/web_tests/fast/css/test-setting-canvas-color-expected.txt index b51ef5d3..ae4770f 100644 --- a/third_party/blink/web_tests/fast/css/test-setting-canvas-color-expected.txt +++ b/third_party/blink/web_tests/fast/css/test-setting-canvas-color-expected.txt
@@ -6,6 +6,8 @@ PASS Setting color to activeborder was successfully set. PASS Setting color to ActiveCaption was successfully set. PASS Setting color to activecaption was successfully set. +FAIL Setting color to ActiveText was not set but should! +FAIL Setting color to activetext was not set but should! PASS Setting color to AppWorkspace was successfully set. PASS Setting color to appworkspace was successfully set. PASS Setting color to Background was successfully set. @@ -20,6 +22,10 @@ PASS Setting color to buttontext was successfully set. PASS Setting color to CaptionText was successfully set. PASS Setting color to captiontext was successfully set. +FAIL Setting color to Field was not set but should! +FAIL Setting color to field was not set but should! +FAIL Setting color to FieldText was not set but should! +FAIL Setting color to fieldtext was not set but should! PASS Setting color to GrayText was successfully set. PASS Setting color to graytext was successfully set. PASS Setting color to Highlight was successfully set.
diff --git a/third_party/blink/web_tests/fast/css/test-setting-canvas-color.html b/third_party/blink/web_tests/fast/css/test-setting-canvas-color.html index e1e3409..a709b62c 100644 --- a/third_party/blink/web_tests/fast/css/test-setting-canvas-color.html +++ b/third_party/blink/web_tests/fast/css/test-setting-canvas-color.html
@@ -41,6 +41,7 @@ var deprecatedSystemColors = [ "ActiveBorder", "ActiveCaption", + "ActiveText", "AppWorkspace", "Background", "ButtonFace", @@ -48,6 +49,8 @@ "ButtonShadow", "ButtonText", "CaptionText", + "Field", + "FieldText", "GrayText", "Highlight", "HighlightText",
diff --git a/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-iframes.html b/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-iframes.html index 54eb7756..ae50597 100644 --- a/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-iframes.html +++ b/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-iframes.html
@@ -33,9 +33,6 @@ if (window.testRunner) testRunner.dumpAsText(); -if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); - onload = function() { checkElementsFromPointFourCorners('document', 'iframe'); checkElementsFromPointFourCorners('document.getElementById(\'iframe\').contentDocument', 'document.getElementById(\'iframe\').contentDocument.getElementById(\'div\')');
diff --git a/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-invalid-cases.html b/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-invalid-cases.html index 925104ed..3fbf3ac 100644 --- a/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-invalid-cases.html +++ b/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-invalid-cases.html
@@ -39,9 +39,6 @@ if (window.testRunner) testRunner.dumpAsText(); -if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); - onload = function() { // Verify the document root element is the last element returned for empty queries. shouldBe('document.elementsFromPoint(300, 300)[0]', 'document.body.parentElement'); @@ -66,4 +63,4 @@ finishJSTest(); } </script> -</body> \ No newline at end of file +</body>
diff --git a/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-simple.html b/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-simple.html index ebeecc5..885153e 100644 --- a/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-simple.html +++ b/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-simple.html
@@ -84,9 +84,6 @@ if (window.testRunner) testRunner.dumpAsText(); -if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); - onload = function() { // Iterate through each of the elements and verify that they are present in // elementsFromPoint(x, y) where (x, y) is any of the four corners. @@ -105,4 +102,4 @@ finishJSTest(); } -</script> \ No newline at end of file +</script>
diff --git a/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-svg.html b/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-svg.html index 27159c79..b9dda86d 100644 --- a/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-svg.html +++ b/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-svg.html
@@ -62,9 +62,6 @@ if (window.testRunner) testRunner.dumpAsText(); -if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); - onload = function() { // Verify two overlapping rects can be hit. assertElementsFromPoint('document.elementsFromPoint(125, 125)', [topLeftRect3, topLeftRect1, svg, sandbox, document.body, document.documentElement]);
diff --git a/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-table.html b/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-table.html index 188cd15..68014c0c 100644 --- a/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-table.html +++ b/third_party/blink/web_tests/fast/dom/elementsFromPoint/elementsFromPoint-table.html
@@ -60,9 +60,6 @@ if (window.testRunner) testRunner.dumpAsText(); -if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); - onload = function() { // Check area hits fully inside table cells. assertElementsFromPoint('document.elementsFromPoint(125, 125)', [td11, testtable, sandbox, document.body, document.documentElement]); @@ -90,4 +87,4 @@ finishJSTest(); } -</script> \ No newline at end of file +</script>
diff --git a/third_party/blink/web_tests/fast/dom/partial-layout-block.html b/third_party/blink/web_tests/fast/dom/partial-layout-block.html index ac98643..27b73b5 100644 --- a/third_party/blink/web_tests/fast/dom/partial-layout-block.html +++ b/third_party/blink/web_tests/fast/dom/partial-layout-block.html
@@ -1,5 +1,9 @@ <!DOCTYPE HTML> <html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <link rel="stylesheet" href="../../resources/testharness.css"> @@ -27,9 +31,6 @@ if (window.testRunner) testRunner.dumpAsText(); - if (window.internals) - internals.runtimeFlags.overlayScrollbarsEnabled = true; - test(function() { var measure = document.getElementById('measure');
diff --git a/third_party/blink/web_tests/fast/dom/partial-layout-non-overlay-scrollbars.html b/third_party/blink/web_tests/fast/dom/partial-layout-non-overlay-scrollbars.html index 339fa51..4290009a 100644 --- a/third_party/blink/web_tests/fast/dom/partial-layout-non-overlay-scrollbars.html +++ b/third_party/blink/web_tests/fast/dom/partial-layout-non-overlay-scrollbars.html
@@ -1,5 +1,10 @@ <!DOCTYPE HTML> <html> +<script> +// Note: We force non-overlay scrollbars with CSS. +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <link rel="stylesheet" href="../../resources/testharness.css"> @@ -27,9 +32,6 @@ if (window.testRunner) testRunner.dumpAsText(); - if (window.internals) - internals.runtimeFlags.overlayScrollbarsEnabled = true; // Note: We force non-overlay scrollbars with CSS. - var test = async_test("Test that partial layout works with non-overlay scrollbars."); setTimeout(function() { test.step(function() {
diff --git a/third_party/blink/web_tests/fast/dom/partial-layout-overlay-scrollbars.html b/third_party/blink/web_tests/fast/dom/partial-layout-overlay-scrollbars.html index 2d921f1..3a6c8444 100644 --- a/third_party/blink/web_tests/fast/dom/partial-layout-overlay-scrollbars.html +++ b/third_party/blink/web_tests/fast/dom/partial-layout-overlay-scrollbars.html
@@ -1,5 +1,9 @@ <!DOCTYPE HTML> <html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <link rel="stylesheet" href="../../resources/testharness.css"> @@ -22,9 +26,6 @@ if (window.testRunner) testRunner.dumpAsText(); - if (window.internals) - internals.runtimeFlags.overlayScrollbarsEnabled = true; - var test = async_test("Test that partial layout works with overlay scrollbars."); setTimeout(function() { test.step(function() {
diff --git a/third_party/blink/web_tests/fast/dom/root-client-size-iframe.html b/third_party/blink/web_tests/fast/dom/root-client-size-iframe.html index dbf1a33..c7fd5da 100644 --- a/third_party/blink/web_tests/fast/dom/root-client-size-iframe.html +++ b/third_party/blink/web_tests/fast/dom/root-client-size-iframe.html
@@ -1,4 +1,8 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <script src="../../resources/js-test.js"></script> <style> iframe { width: 100px; height: 100px; } @@ -12,9 +16,6 @@ shouldBeDefined(window.internals); - var originalOverlayScrollbars = internals.runtimeFlags.overlayScrollbarsEnabled; - internals.runtimeFlags.overlayScrollbarsEnabled = true; - function runTests() { clientWidthBefore = frame.contentDocument.documentElement.clientWidth; frame.className = "wider"; @@ -24,7 +25,6 @@ shouldBe("clientWidthBefore", "100"); shouldBe("clientWidthAfter", "200"); - internals.runtimeFlags.overlayScrollbarsEnabled = originalOverlayScrollbars; finishJSTest(); } </script>
diff --git a/third_party/blink/web_tests/fast/dom/window-scroll-scaling.html b/third_party/blink/web_tests/fast/dom/window-scroll-scaling.html index 50d62a9..53680a4 100644 --- a/third_party/blink/web_tests/fast/dom/window-scroll-scaling.html +++ b/third_party/blink/web_tests/fast/dom/window-scroll-scaling.html
@@ -4,9 +4,6 @@ <script> description("This test ensures that document content width (height) as reported by scrollWidth (scrollHeight) is invariant to changes in page scale factor."); - if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); - var body = document.body; // According to CSSOM (http://dev.w3.org/csswg/cssom-view/#dom-element-scrollwidth)
diff --git a/third_party/blink/web_tests/fast/events/hit-test-cache-scrollbar-no-crash.html b/third_party/blink/web_tests/fast/events/hit-test-cache-scrollbar-no-crash.html index a59fedf2..6981008 100644 --- a/third_party/blink/web_tests/fast/events/hit-test-cache-scrollbar-no-crash.html +++ b/third_party/blink/web_tests/fast/events/hit-test-cache-scrollbar-no-crash.html
@@ -1,5 +1,9 @@ <!DOCTYPE html> <meta name="viewport" content="width=device-width, initial-scale=1"> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <style> #parent { overflow: scroll; @@ -18,8 +22,6 @@ description("Ensure hit test cache works in correct scenarios of overlay scrollbars."); if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - var parentDiv = document.getElementById("parent"); var rect = parentDiv.getBoundingClientRect();
diff --git a/third_party/blink/web_tests/fast/events/hit-test-cache.html b/third_party/blink/web_tests/fast/events/hit-test-cache.html index 6e096aa..093fff4e 100644 --- a/third_party/blink/web_tests/fast/events/hit-test-cache.html +++ b/third_party/blink/web_tests/fast/events/hit-test-cache.html
@@ -37,10 +37,8 @@ <script> setPrintTestResultsLazily(); -if (window.internals) { +if (window.internals) internals.settings.setViewportEnabled(true); - internals.settings.setMockScrollbarsEnabled(true); -} description("Ensure hit test cache works in correct scenarios of scrolling, dom and style changes.");
diff --git a/third_party/blink/web_tests/fast/events/hit-test-counts.html b/third_party/blink/web_tests/fast/events/hit-test-counts.html index 23725a58a..82bc28d 100644 --- a/third_party/blink/web_tests/fast/events/hit-test-counts.html +++ b/third_party/blink/web_tests/fast/events/hit-test-counts.html
@@ -27,10 +27,9 @@ <script src="../../resources/js-test.js"></script> <script> setPrintTestResultsLazily(); -if (window.internals) { +if (window.internals) internals.settings.setViewportEnabled(true); - internals.settings.setMockScrollbarsEnabled(true); -} + var unique_event_id = 1; description("Count how many hit tests are required for various event scenarios. Hit tests can be expensive and it's often tempting to add more. These values should only ever be changed to go down, not up.");
diff --git a/third_party/blink/web_tests/fast/events/pointerevents/mouse-pointer-on-scrollbar.html b/third_party/blink/web_tests/fast/events/pointerevents/mouse-pointer-on-scrollbar.html index ea9e716..dcb18ff 100644 --- a/third_party/blink/web_tests/fast/events/pointerevents/mouse-pointer-on-scrollbar.html +++ b/third_party/blink/web_tests/fast/events/pointerevents/mouse-pointer-on-scrollbar.html
@@ -32,7 +32,6 @@ } function runTests() { - internals.settings.setMockScrollbarsEnabled(true); var rect = targetDiv.getBoundingClientRect(); var x1 = rect.right - 5; var y1 = rect.top + 20;
diff --git a/third_party/blink/web_tests/fast/events/touch/gesture/gesture-scrollbar-touchpad-fling.html b/third_party/blink/web_tests/fast/events/touch/gesture/gesture-scrollbar-touchpad-fling.html index 07ac9ce2..6bdd596 100644 --- a/third_party/blink/web_tests/fast/events/touch/gesture/gesture-scrollbar-touchpad-fling.html +++ b/third_party/blink/web_tests/fast/events/touch/gesture/gesture-scrollbar-touchpad-fling.html
@@ -46,7 +46,6 @@ <script type="text/javascript"> setAnimationRequiresRaster(); -internals.settings.setMockScrollbarsEnabled(true); promise_test (async () => { var movingDiv = document.getElementById('scrollable');
diff --git a/third_party/blink/web_tests/fast/events/touch/gesture/gesture-scrollbar-touchscreen-fling.html b/third_party/blink/web_tests/fast/events/touch/gesture/gesture-scrollbar-touchscreen-fling.html index 3d3e8a7b..4db17d7 100644 --- a/third_party/blink/web_tests/fast/events/touch/gesture/gesture-scrollbar-touchscreen-fling.html +++ b/third_party/blink/web_tests/fast/events/touch/gesture/gesture-scrollbar-touchscreen-fling.html
@@ -46,7 +46,6 @@ <script type="text/javascript"> setAnimationRequiresRaster(); -internals.settings.setMockScrollbarsEnabled(true); promise_test (async () => { var movingDiv = document.getElementById('scrollable');
diff --git a/third_party/blink/web_tests/fast/events/touch/gesture/gesture-scrollbar.html b/third_party/blink/web_tests/fast/events/touch/gesture/gesture-scrollbar.html index 5eda1cc..6e7dfb9f 100644 --- a/third_party/blink/web_tests/fast/events/touch/gesture/gesture-scrollbar.html +++ b/third_party/blink/web_tests/fast/events/touch/gesture/gesture-scrollbar.html
@@ -36,8 +36,6 @@ </div> <script type="text/javascript"> -internals.settings.setMockScrollbarsEnabled(true); - var movingDiv = document.getElementById('scrollable'); promise_test (async () => { var scrollbarX = movingDiv.offsetLeft + movingDiv.offsetWidth - 5;
diff --git a/third_party/blink/web_tests/fast/events/touch/gesture/gesture-tap-frame-scrollbar.html b/third_party/blink/web_tests/fast/events/touch/gesture/gesture-tap-frame-scrollbar.html index c37ed31..4de1b5fe 100644 --- a/third_party/blink/web_tests/fast/events/touch/gesture/gesture-tap-frame-scrollbar.html +++ b/third_party/blink/web_tests/fast/events/touch/gesture/gesture-tap-frame-scrollbar.html
@@ -63,10 +63,6 @@ if (window.eventSender) { jsTestIsAsync = true; - // Some versions of MacOS native scrollbars intercept events differently, so - // use mock scrollbars for consistency. - internals.settings.setMockScrollbarsEnabled(true); - target.onload = function() { doTap() .then(function() { return doTap('mousemove'); })
diff --git a/third_party/blink/web_tests/fast/events/touch/resources/compositor-touch-hit-rects.js b/third_party/blink/web_tests/fast/events/touch/resources/compositor-touch-hit-rects.js index 38110e3f..1fae323 100644 --- a/third_party/blink/web_tests/fast/events/touch/resources/compositor-touch-hit-rects.js +++ b/third_party/blink/web_tests/fast/events/touch/resources/compositor-touch-hit-rects.js
@@ -76,10 +76,6 @@ document.documentElement.setAttribute('dumpRenderTree', 'true'); } -if (window.internals) { - internals.settings.setMockScrollbarsEnabled(true); -} - window.onload = function() { // Run each general test case. var tests = document.querySelectorAll('.testcase');
diff --git a/third_party/blink/web_tests/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png deleted file mode 100644 index 3ae94cd1..0000000 --- a/third_party/blink/web_tests/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/fast/forms/select-popup/popup-menu-scrollbar-button-scrolls.html b/third_party/blink/web_tests/fast/forms/select-popup/popup-menu-scrollbar-button-scrolls.html index aca1142..16d6634 100644 --- a/third_party/blink/web_tests/fast/forms/select-popup/popup-menu-scrollbar-button-scrolls.html +++ b/third_party/blink/web_tests/fast/forms/select-popup/popup-menu-scrollbar-button-scrolls.html
@@ -38,7 +38,6 @@ <option>option28</option> </select> <script> -internals.settings.setMockScrollbarsEnabled(true); internals.settings.setScrollAnimatorEnabled(false); let test = async_test(function(test) {
diff --git a/third_party/blink/web_tests/fast/forms/select/listbox-overlay-scrollbar.html b/third_party/blink/web_tests/fast/forms/select/listbox-overlay-scrollbar.html index 564c7f1db..fa1a358 100644 --- a/third_party/blink/web_tests/fast/forms/select/listbox-overlay-scrollbar.html +++ b/third_party/blink/web_tests/fast/forms/select/listbox-overlay-scrollbar.html
@@ -1,6 +1,10 @@ <!DOCTYPE html> <html> <head> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <style> html, body { margin: 0; @@ -16,12 +20,6 @@ font-size : 12pt; } </style> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script> </head> <body> <p>You should see 2 green boxes with overlay scrollbar. The second box
diff --git a/third_party/blink/web_tests/fast/scrolling/overlay-scrollbars.html b/third_party/blink/web_tests/fast/scrolling/overlay-scrollbars.html index b5c9949..81feaa7 100644 --- a/third_party/blink/web_tests/fast/scrolling/overlay-scrollbars.html +++ b/third_party/blink/web_tests/fast/scrolling/overlay-scrollbars.html
@@ -1,6 +1,10 @@ <!DOCTYPE html> <html> <head> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <style> html, body { margin: 0; @@ -17,12 +21,6 @@ height: 500px; } </style> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script> </head> <body> <p>You should see first 2 green boxes with overlay scrollbars.
diff --git a/third_party/blink/web_tests/fast/scrolling/scrollbar-prevent-default.html b/third_party/blink/web_tests/fast/scrolling/scrollbar-prevent-default.html index 2d15cf4..63b1a3d 100644 --- a/third_party/blink/web_tests/fast/scrolling/scrollbar-prevent-default.html +++ b/third_party/blink/web_tests/fast/scrolling/scrollbar-prevent-default.html
@@ -27,10 +27,8 @@ </div> <script> -if (window.internals) { - internals.settings.setMockScrollbarsEnabled(true) +if (window.internals) internals.settings.setScrollAnimatorEnabled(false); -} var receivedMousedownEvent = false; document.addEventListener('mousedown', function(e) {
diff --git a/third_party/blink/web_tests/fast/scrolling/scrollbar-tickmarks-hittest.html b/third_party/blink/web_tests/fast/scrolling/scrollbar-tickmarks-hittest.html index f34a6ac..2a850b08 100644 --- a/third_party/blink/web_tests/fast/scrolling/scrollbar-tickmarks-hittest.html +++ b/third_party/blink/web_tests/fast/scrolling/scrollbar-tickmarks-hittest.html
@@ -13,10 +13,8 @@ <span id='elt'> </span> <script> - if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; + if (window.internals) internals.settings.setScrollAnimatorEnabled(false); - } window.onload = async () => { await waitForCompositorCommit(); @@ -32,7 +30,7 @@ await waitForCompositorCommit(); promise_test(async () => { - await mouseDragAndDrop(window.innerWidth - 1, 10, window.innerWidth - 1, 100); + await mouseDragAndDrop(window.innerWidth - 1, 50, window.innerWidth - 1, 100); // Will throw exception if window.scrollY not greater than 0. await waitFor(() => { return window.scrollY > 0; }); }, 'Checks that clicking on overlay scrollbar works when tickmarks are added.');
diff --git a/third_party/blink/web_tests/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html b/third_party/blink/web_tests/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html index 53612f6b..5009b09 100644 --- a/third_party/blink/web_tests/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html +++ b/third_party/blink/web_tests/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html
@@ -12,10 +12,8 @@ </style> <script src="../../resources/run-after-layout-and-paint.js" type="text/javascript"></script> <script> -if (window.testRunner) { +if (window.testRunner) testRunner.waitUntilDone(); - internals.settings.setMockScrollbarsEnabled(true); -} function setupIframes() { setupIframe(document.getElementById('iframe1').contentWindow.document);
diff --git a/third_party/blink/web_tests/fast/sub-pixel/transformed-iframe-copy-on-scroll.html b/third_party/blink/web_tests/fast/sub-pixel/transformed-iframe-copy-on-scroll.html index 5dbd567..88c68310 100644 --- a/third_party/blink/web_tests/fast/sub-pixel/transformed-iframe-copy-on-scroll.html +++ b/third_party/blink/web_tests/fast/sub-pixel/transformed-iframe-copy-on-scroll.html
@@ -19,10 +19,8 @@ </style> <script src="../../resources/run-after-layout-and-paint.js" type="text/javascript"></script> <script> -if (window.testRunner) { +if (window.testRunner) testRunner.waitUntilDone(); - internals.settings.setMockScrollbarsEnabled(true); -} function setupIframes() { setupIframe(document.getElementById('iframe1').contentWindow.document);
diff --git a/third_party/blink/web_tests/flag-specific/enable-blink-features=NewSystemColors/fast/css/css2-system-color-expected.html b/third_party/blink/web_tests/flag-specific/enable-blink-features=NewSystemColors/fast/css/css2-system-color-expected.html new file mode 100644 index 0000000..86dc5d0 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/enable-blink-features=NewSystemColors/fast/css/css2-system-color-expected.html
@@ -0,0 +1,60 @@ +<!DOCTYPE html> +<html> +<head> +<title>Color Test</title> +<style> + html { + font-size: 12px; + width: 750px; + } + .box:after { + content: " "; + clear: both; + display: block; + } + .inner { + border-top: solid 1px; + float: right; + width: 620px; + } + .text { + float: left; + } +</style> +</head> +<body> + <div class="box"><div class="text">ActiveBorder</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> + <div class="box"><div class="text">ActiveCaption</div><div class="inner" style="background-color: rgb(204, 204, 204)"> </div></div> + <div class="box"><div class="text">ActiveText</div><div class="inner" style="background-color: rgb(255, 0, 0)"> </div></div> + <div class="box"><div class="text">AppWorkspace</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> + <div class="box"><div class="text">Background</div><div class="inner" style="background-color: rgb(99, 99, 206)"> </div></div> + <div class="box"><div class="text">ButtonFace</div><div class="inner" style="background-color: rgb(221, 221, 221)"> </div></div> + <div class="box"><div class="text">ButtonHighlight</div><div class="inner" style="background-color: rgb(221, 221, 221)"> </div></div> + <div class="box"><div class="text">ButtonShadow</div><div class="inner" style="background-color: rgb(136, 136, 136)"> </div></div> + <div class="box"><div class="text">ButtonText</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div> + <div class="box"><div class="text">CaptionText</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div> + <div class="box"><div class="text">Field</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> + <div class="box"><div class="text">FieldText</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div> + <div class="box"><div class="text">GrayText</div><div class="inner" style="background-color: rgb(128, 128, 128)"> </div></div> + <div class="box"><div class="text">Highlight</div><div class="inner" style="background-color: rgb(181, 213, 255)"> </div></div> + <div class="box"><div class="text">HighlightText</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div> + <div class="box"><div class="text">InactiveBorder</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> + <div class="box"><div class="text">InactiveCaption</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> + <div class="box"><div class="text">InactiveCaptionText</div><div class="inner" style="background-color: rgb(127, 127, 127)"> </div></div> + <div class="box"><div class="text">InfoBackground</div><div class="inner" style="background-color: rgb(251, 252, 197)"> </div></div> + <div class="box"><div class="text">InfoText</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div> + <div class="box"><div class="text">LinkText</div><div class="inner" style="background-color: rgb(0, 0, 238)"> </div></div> + <div class="box"><div class="text">Menu</div><div class="inner" style="background-color: rgb(247, 247, 247)"> </div></div> + <div class="box"><div class="text">MenuText</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div> + <div class="box"><div class="text">Scrollbar</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> + <div class="box"><div class="text">ThreeDDarkShadow</div><div class="inner" style="background-color: rgb(102, 102, 102)"> </div></div> + <div class="box"><div class="text">ThreeDFace</div><div class="inner" style="background-color: rgb(192, 192, 192)"> </div></div> + <div class="box"><div class="text">ThreeDHighlight</div><div class="inner" style="background-color: rgb(221, 221, 221)"> </div></div> + <div class="box"><div class="text">ThreeDLightShadow</div><div class="inner" style="background-color: rgb(192, 192, 192)"> </div></div> + <div class="box"><div class="text">ThreeDShadow</div><div class="inner" style="background-color: rgb(136, 136, 136)"> </div></div> + <div class="box"><div class="text">VisitedText</div><div class="inner" style="background-color: rgb(85, 26, 139)"> </div></div> + <div class="box"><div class="text">Window</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> + <div class="box"><div class="text">WindowFrame</div><div class="inner" style="background-color: rgb(204, 204, 204)"> </div></div> + <div class="box"><div class="text">WindowText</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div> +</body> +</html>
diff --git a/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/compositing/fixed-background-after-style-recalc-expected.png b/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/compositing/fixed-background-after-style-recalc-expected.png index 3433773..3c5231f 100644 --- a/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/compositing/fixed-background-after-style-recalc-expected.png +++ b/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/compositing/fixed-background-after-style-recalc-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/compositing/masks/mask-with-added-filters-expected.png b/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/compositing/masks/mask-with-added-filters-expected.png index c7c40d0..7ba74ff 100644 --- a/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/compositing/masks/mask-with-added-filters-expected.png +++ b/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/compositing/masks/mask-with-added-filters-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/compositing/masks/mask-with-removed-filters-expected.png b/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/compositing/masks/mask-with-removed-filters-expected.png index ee4ec3e1..e14e4c9 100644 --- a/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/compositing/masks/mask-with-removed-filters-expected.png +++ b/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/compositing/masks/mask-with-removed-filters-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/css3/filters/blur-filter-page-scroll-expected.png b/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/css3/filters/blur-filter-page-scroll-expected.png index 7e7c6123..13199ce 100644 --- a/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/css3/filters/blur-filter-page-scroll-expected.png +++ b/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/css3/filters/blur-filter-page-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/css3/filters/blur-filter-page-scroll-parents-expected.png b/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/css3/filters/blur-filter-page-scroll-parents-expected.png index af6b558..40e36254 100644 --- a/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/css3/filters/blur-filter-page-scroll-parents-expected.png +++ b/third_party/blink/web_tests/flag-specific/enable-gpu-rasterization/css3/filters/blur-filter-page-scroll-parents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/fullscreen/rendering/overflow-root.html b/third_party/blink/web_tests/fullscreen/rendering/overflow-root.html index 64294f3..fd78a1e 100644 --- a/third_party/blink/web_tests/fullscreen/rendering/overflow-root.html +++ b/third_party/blink/web_tests/fullscreen/rendering/overflow-root.html
@@ -15,7 +15,7 @@ { // The scrollbar should remain. assert_equals(getComputedStyle(root).overflow, "scroll"); - if (window.internals && window.internals.runtimeFlags.overlayScrollbarsEnabled) + if (window.internals && internals.overlayScrollbarsEnabled) assert_equals(root.clientWidth, window.innerWidth); else assert_less_than(root.clientWidth, window.innerWidth);
diff --git a/third_party/blink/web_tests/http/tests/misc/resources/cross-origin-subframe-for-scrolling.html b/third_party/blink/web_tests/http/tests/misc/resources/cross-origin-subframe-for-scrolling.html index d1030b6..6d6bf0cb 100644 --- a/third_party/blink/web_tests/http/tests/misc/resources/cross-origin-subframe-for-scrolling.html +++ b/third_party/blink/web_tests/http/tests/misc/resources/cross-origin-subframe-for-scrolling.html
@@ -11,7 +11,6 @@ return; } internals.settings.setScrollAnimatorEnabled(true); - internals.settings.setMockScrollbarsEnabled(true); }); function handleMessage(event) {
diff --git a/third_party/blink/web_tests/http/tests/misc/scroll-cross-origin-iframes-scrollbar.html b/third_party/blink/web_tests/http/tests/misc/scroll-cross-origin-iframes-scrollbar.html index 37dcc8d..838c75d 100644 --- a/third_party/blink/web_tests/http/tests/misc/scroll-cross-origin-iframes-scrollbar.html +++ b/third_party/blink/web_tests/http/tests/misc/scroll-cross-origin-iframes-scrollbar.html
@@ -14,7 +14,6 @@ var scroll_test = async_test("Verify that two sibling cross-origin iframes " + "both correctly scroll on scrollbar mouse clicks."); - internals.settings.setMockScrollbarsEnabled(true); var last_frame_scrolled; var iframe1 = document.getElementById("target-iframe1"); var iframe2 = document.getElementById("target-iframe2");
diff --git a/third_party/blink/web_tests/media/controls/video-controls-with-cast-rendering.html b/third_party/blink/web_tests/media/controls/video-controls-with-cast-rendering.html index ead172b8..f66c925 100644 --- a/third_party/blink/web_tests/media/controls/video-controls-with-cast-rendering.html +++ b/third_party/blink/web_tests/media/controls/video-controls-with-cast-rendering.html
@@ -17,9 +17,6 @@ <video controls style="position: absolute; width: 320px;"></video> </div> <script> - if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); - var videos = document.getElementsByTagName('video'); for (var i = 0; i < videos.length; ++i) { enableTestMode(videos[i]);
diff --git a/third_party/blink/web_tests/media/controls/video-overlay-cast-dark-rendering.html b/third_party/blink/web_tests/media/controls/video-overlay-cast-dark-rendering.html index ee88b3c..ccea70e 100644 --- a/third_party/blink/web_tests/media/controls/video-overlay-cast-dark-rendering.html +++ b/third_party/blink/web_tests/media/controls/video-overlay-cast-dark-rendering.html
@@ -16,9 +16,6 @@ <video style="position: absolute; width: 320px;"></video> </div> <script> - if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); - var videos = document.getElementsByTagName('video'); waitForMultipleEvents("canplaythrough", videos.length, function() { for (var i = 0; i < videos.length; ++i) { @@ -38,4 +35,4 @@ setSrcByTagName('video', '../content/test.ogv'); </script> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/media/controls/video-overlay-cast-light-rendering.html b/third_party/blink/web_tests/media/controls/video-overlay-cast-light-rendering.html index 72f6d40e..637a7fd 100644 --- a/third_party/blink/web_tests/media/controls/video-overlay-cast-light-rendering.html +++ b/third_party/blink/web_tests/media/controls/video-overlay-cast-light-rendering.html
@@ -16,9 +16,6 @@ <video style="position: absolute; width: 320px;"></video> </div> <script> - if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); - var videos = document.getElementsByTagName('video'); waitForMultipleEvents("canplaythrough", videos.length, function() { for (var i = 0; i < videos.length; ++i) { @@ -38,4 +35,4 @@ setSrcByTagName('video', '../content/counting.ogv'); </script> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/media/video-controls-rendering.html b/third_party/blink/web_tests/media/video-controls-rendering.html index efb2a61..b580742 100644 --- a/third_party/blink/web_tests/media/video-controls-rendering.html +++ b/third_party/blink/web_tests/media/video-controls-rendering.html
@@ -13,8 +13,6 @@ <video controls style="position: absolute; width: 320px;"></video> </div> <script> -if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); const videos = document.getElementsByTagName('video'); for (var i = 0; i < videos.length; ++i) { enableTestMode(videos[i]);
diff --git a/third_party/blink/web_tests/media/video-zoom.html b/third_party/blink/web_tests/media/video-zoom.html index 3c008be..c4d7059 100644 --- a/third_party/blink/web_tests/media/video-zoom.html +++ b/third_party/blink/web_tests/media/video-zoom.html
@@ -3,9 +3,6 @@ <style> video { zoom: 150%; border: 3px solid red; } </style> <script src=media-file.js></script> <script> - if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); - function init() { setSrcByTagName("video", "content/test.ogv");
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/fixed-scroll-in-empty-root-layer-expected.png b/third_party/blink/web_tests/paint/invalidation/compositing/fixed-scroll-in-empty-root-layer-expected.png index f011d5f2..4f6fcd3b 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/fixed-scroll-in-empty-root-layer-expected.png +++ b/third_party/blink/web_tests/paint/invalidation/compositing/fixed-scroll-in-empty-root-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/invalidations-with-large-negative-margin-expected.png b/third_party/blink/web_tests/paint/invalidation/compositing/invalidations-with-large-negative-margin-expected.png index b0a6bbd..e2a9e50f 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/invalidations-with-large-negative-margin-expected.png +++ b/third_party/blink/web_tests/paint/invalidation/compositing/invalidations-with-large-negative-margin-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/repaint-overflow-scrolled-squashed-content-expected.png b/third_party/blink/web_tests/paint/invalidation/compositing/repaint-overflow-scrolled-squashed-content-expected.png deleted file mode 100644 index cb1d299f..0000000 --- a/third_party/blink/web_tests/paint/invalidation/compositing/repaint-overflow-scrolled-squashed-content-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/scroll-fixed-layer-no-content-expected.png b/third_party/blink/web_tests/paint/invalidation/compositing/scroll-fixed-layer-no-content-expected.png index daa7c15..17926d02 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/scroll-fixed-layer-no-content-expected.png +++ b/third_party/blink/web_tests/paint/invalidation/compositing/scroll-fixed-layer-no-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/scroll-fixed-layer-out-of-view-expected.png b/third_party/blink/web_tests/paint/invalidation/compositing/scroll-fixed-layer-out-of-view-expected.png index daa7c15..17926d02 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/scroll-fixed-layer-out-of-view-expected.png +++ b/third_party/blink/web_tests/paint/invalidation/compositing/scroll-fixed-layer-out-of-view-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/scroll-fixed-squahed-layer-expected.png b/third_party/blink/web_tests/paint/invalidation/compositing/scroll-fixed-squahed-layer-expected.png index 73c94650..701bf92 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/scroll-fixed-squahed-layer-expected.png +++ b/third_party/blink/web_tests/paint/invalidation/compositing/scroll-fixed-squahed-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/should-invoke-deferred-compositing.html b/third_party/blink/web_tests/paint/invalidation/compositing/should-invoke-deferred-compositing.html index 7d31719a..1b3f957b 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/should-invoke-deferred-compositing.html +++ b/third_party/blink/web_tests/paint/invalidation/compositing/should-invoke-deferred-compositing.html
@@ -37,6 +37,9 @@ </style> <script> + if (window.internals) + internals.runtimeFlags.accelerated2dCanvasEnabled = true; + function repaintTest() { var canvasElement = document.createElement("canvas"); canvasElement.width = 200;
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.png b/third_party/blink/web_tests/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.png index e0e219c..b29e8db5 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.png +++ b/third_party/blink/web_tests/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/should-not-clip-composited-viewport-scrolling-layer-expected.png b/third_party/blink/web_tests/paint/invalidation/compositing/should-not-clip-composited-viewport-scrolling-layer-expected.png index 2f06caa..115aa99e 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/should-not-clip-composited-viewport-scrolling-layer-expected.png +++ b/third_party/blink/web_tests/paint/invalidation/compositing/should-not-clip-composited-viewport-scrolling-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/scroll/destroy-overlay-scrollbar.html b/third_party/blink/web_tests/paint/invalidation/scroll/destroy-overlay-scrollbar.html index 3ce2a7ec..8ba8ab3 100644 --- a/third_party/blink/web_tests/paint/invalidation/scroll/destroy-overlay-scrollbar.html +++ b/third_party/blink/web_tests/paint/invalidation/scroll/destroy-overlay-scrollbar.html
@@ -1,10 +1,8 @@ <!DOCTYPE html> <script src="../resources/text-based-repaint.js"></script> <script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} +if (window.internals) + internals.useMockOverlayScrollbars(); function repaintTest() { document.getElementById('content').style.height = '100px'; }
diff --git a/third_party/blink/web_tests/paint/overflow/composited-scroll-vertical-rl-expected.html b/third_party/blink/web_tests/paint/overflow/composited-scroll-vertical-rl-expected.html index d80d1e2..e4ac586f 100644 --- a/third_party/blink/web_tests/paint/overflow/composited-scroll-vertical-rl-expected.html +++ b/third_party/blink/web_tests/paint/overflow/composited-scroll-vertical-rl-expected.html
@@ -1,7 +1,5 @@ <!DOCTYPE html> <script> -if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); onload = function() { container.scrollLeft = 2000; };
diff --git a/third_party/blink/web_tests/paint/overflow/composited-scroll-vertical-rl.html b/third_party/blink/web_tests/paint/overflow/composited-scroll-vertical-rl.html index 6271146..fab21fa1 100644 --- a/third_party/blink/web_tests/paint/overflow/composited-scroll-vertical-rl.html +++ b/third_party/blink/web_tests/paint/overflow/composited-scroll-vertical-rl.html
@@ -1,8 +1,4 @@ <!DOCTYPE html> -<script> -if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); -</script> There should be a green square. <div style="width: 200px; height: 200px; overflow: scroll; will-change: transform; writing-mode: vertical-rl"> <div style="width: 2000px">
diff --git a/third_party/blink/web_tests/platform/fuchsia/tables/mozilla/bugs/bug2479-3-expected.png b/third_party/blink/web_tests/platform/fuchsia/tables/mozilla/bugs/bug2479-3-expected.png index 0d9bff31..f72d480 100644 --- a/third_party/blink/web_tests/platform/fuchsia/tables/mozilla/bugs/bug2479-3-expected.png +++ b/third_party/blink/web_tests/platform/fuchsia/tables/mozilla/bugs/bug2479-3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/direct-image-compositing-expected.png b/third_party/blink/web_tests/platform/linux/compositing/direct-image-compositing-expected.png index 729099e..f5d54f3b 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/direct-image-compositing-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/direct-image-compositing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/geometry/fixed-in-composited-expected.png b/third_party/blink/web_tests/platform/linux/compositing/geometry/fixed-in-composited-expected.png index b049280..2bf63d5e 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/geometry/fixed-in-composited-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/geometry/fixed-in-composited-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/geometry/video-fixed-scrolling-expected.png b/third_party/blink/web_tests/platform/linux/compositing/geometry/video-fixed-scrolling-expected.png index 8736adc..8cfed5d 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/geometry/video-fixed-scrolling-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/geometry/video-fixed-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.png b/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.png index 4f14a79..102f237 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png b/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png index 55f76324..58169a9 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png b/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png index 8b26ca8..f03244d 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png b/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png index 9f81350..f542799c 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/iframes/iframe-copy-on-scroll-expected.png b/third_party/blink/web_tests/platform/linux/compositing/iframes/iframe-copy-on-scroll-expected.png index b5ab3172..b7110b2 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/iframes/iframe-copy-on-scroll-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/iframes/iframe-copy-on-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/layers-inside-overflow-scroll-expected.png b/third_party/blink/web_tests/platform/linux/compositing/layers-inside-overflow-scroll-expected.png index 72d2d37..abdb727 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/layers-inside-overflow-scroll-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/layers-inside-overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/layout-width-change-expected.png b/third_party/blink/web_tests/platform/linux/compositing/layout-width-change-expected.png index 3da3bc7..62f1347b 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/layout-width-change-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/layout-width-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/masks/mask-with-added-filters-expected.png b/third_party/blink/web_tests/platform/linux/compositing/masks/mask-with-added-filters-expected.png index b5f6655..46ac9c4 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/masks/mask-with-added-filters-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/masks/mask-with-added-filters-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/masks/mask-with-removed-filters-expected.png b/third_party/blink/web_tests/platform/linux/compositing/masks/mask-with-removed-filters-expected.png index 297dbc4..f4c04b8 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/masks/mask-with-removed-filters-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/masks/mask-with-removed-filters-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/masks/masked-ancestor-expected.png b/third_party/blink/web_tests/platform/linux/compositing/masks/masked-ancestor-expected.png index 6a1a25d..015c81c2 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/masks/masked-ancestor-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/masks/masked-ancestor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/masks/multiple-masks-expected.png b/third_party/blink/web_tests/platform/linux/compositing/masks/multiple-masks-expected.png index 0989690..d01220c 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/masks/multiple-masks-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/masks/multiple-masks-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/masks/simple-composited-mask-expected.png b/third_party/blink/web_tests/platform/linux/compositing/masks/simple-composited-mask-expected.png index 97c3286..7591c4a 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/masks/simple-composited-mask-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/masks/simple-composited-mask-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png index a9dfa22..24ea3c6 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/nested-border-radius-clipping-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/nested-border-radius-clipping-expected.png index c84ef1b..3516f965 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overflow/nested-border-radius-clipping-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/nested-border-radius-clipping-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/nested-scrolling-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/nested-scrolling-expected.png index bd0686c9..ab5a37f 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overflow/nested-scrolling-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/nested-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png index 484a39c..e8597db0c 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png index 43ff136..3e79da8 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/overflow-scroll-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/overflow-scroll-expected.png index 9e9e782..1184b11 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overflow/overflow-scroll-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png index 8cf4c695..ebbf758 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/remove-overflow-crash2-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/remove-overflow-crash2-expected.png index f350eb3a..9a965109 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overflow/remove-overflow-crash2-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/remove-overflow-crash2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/scroll-ancestor-update-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/scroll-ancestor-update-expected.png index 83951000..0045f761 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overflow/scroll-ancestor-update-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/scroll-ancestor-update-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/scrollbar-painting-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/scrollbar-painting-expected.png index 4c72d915..6de8a01e 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overflow/scrollbar-painting-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/scrollbar-painting-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/universal-accelerated-overflow-scroll-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/universal-accelerated-overflow-scroll-expected.png deleted file mode 100644 index a31226e..0000000 --- a/third_party/blink/web_tests/platform/linux/compositing/overflow/universal-accelerated-overflow-scroll-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png index 459948dd..6b84ae4 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overlap-blending/children-opacity-huge-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overlap-blending/children-opacity-huge-expected.png index 3b6f150..d96888ab 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overlap-blending/children-opacity-huge-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overlap-blending/children-opacity-huge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overlap-blending/reflection-opacity-huge-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overlap-blending/reflection-opacity-huge-expected.png index 1a40260..2ac9f16 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overlap-blending/reflection-opacity-huge-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overlap-blending/reflection-opacity-huge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/reflections/nested-reflection-on-overflow-expected.png b/third_party/blink/web_tests/platform/linux/compositing/reflections/nested-reflection-on-overflow-expected.png index 54685771..bca977f 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/reflections/nested-reflection-on-overflow-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/reflections/nested-reflection-on-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/self-painting-layers-expected.png b/third_party/blink/web_tests/platform/linux/compositing/self-painting-layers-expected.png index 3932cd0de..b820e6e 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/self-painting-layers-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/self-painting-layers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/squashing/vertical-writing-mode-squashed-expected.png b/third_party/blink/web_tests/platform/linux/compositing/squashing/vertical-writing-mode-squashed-expected.png index 07b475f..503decf 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/squashing/vertical-writing-mode-squashed-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/squashing/vertical-writing-mode-squashed-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/basic/comments-expected.png b/third_party/blink/web_tests/platform/linux/css1/basic/comments-expected.png index 62366fc0b..c5737a14 100644 --- a/third_party/blink/web_tests/platform/linux/css1/basic/comments-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/basic/comments-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/basic/containment-expected.png b/third_party/blink/web_tests/platform/linux/css1/basic/containment-expected.png index 5b0ee67..0543cae 100644 --- a/third_party/blink/web_tests/platform/linux/css1/basic/containment-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/basic/containment-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/basic/id_as_selector-expected.png b/third_party/blink/web_tests/platform/linux/css1/basic/id_as_selector-expected.png index c241b10..edcb050 100644 --- a/third_party/blink/web_tests/platform/linux/css1/basic/id_as_selector-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/basic/id_as_selector-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/border-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/border-expected.png index 33e0fee..1fec9663 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/border-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_bottom-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_bottom-expected.png index 8f55d747..22694491 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_bottom-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_bottom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_bottom_width-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_bottom_width-expected.png index 212134c..1b2f01a 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_bottom_width-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_bottom_width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_left-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_left-expected.png index 9a53a280..d226d5b 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_left-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_left-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_left_width-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_left_width-expected.png index 8ba69c13..a5bb07a 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_left_width-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_left_width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_right_inline-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_right_inline-expected.png index 924f67f7..ea9e8f9 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_right_inline-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_right_inline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_right_width-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_right_width-expected.png index 7863ba2f..cc26cf19 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_right_width-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_right_width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_style-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_style-expected.png index e18a65f..3ac2348 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_style-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_style-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_top-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_top-expected.png index 7a0e5e1..b9a619e2 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_top-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_top-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_top_width-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_top_width-expected.png index 61d5f9f1..f913183 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_top_width-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_top_width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_width-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_width-expected.png index db8aa64..72724dd 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/border_width-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/border_width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/clear-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/clear-expected.png index 03f394d6..25e16f2 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/clear-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/clear-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/float_elements_in_series-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/float_elements_in_series-expected.png index efc6708..e2584b2 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/float_elements_in_series-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/float_elements_in_series-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/float_margin-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/float_margin-expected.png index 64d4510..3821d47 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/float_margin-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/float_margin-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/float_on_text_elements-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/float_on_text_elements-expected.png index a79b0ed6..20b415b 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/float_on_text_elements-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/float_on_text_elements-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/height-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/height-expected.png index a15ca700..2db0b3a 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/height-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/margin_bottom-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/margin_bottom-expected.png index 0402b050..dd82a744 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/margin_bottom-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/margin_bottom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/margin_left-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/margin_left-expected.png index d3b0fef1..cd8e204 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/margin_left-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/margin_left-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/margin_top-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/margin_top-expected.png index 1a79227..a00c77f 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/margin_top-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/margin_top-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/padding-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/padding-expected.png index e9ea75b..b1ab3fe 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/padding-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/padding-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_bottom-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_bottom-expected.png index 7c64ad89..03ea94e 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_bottom-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_bottom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_inline-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_inline-expected.png index 63735aec..4e50c4b 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_inline-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_inline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_left-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_left-expected.png index 11a4975..9820de2ce 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_left-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_left-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_right-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_right-expected.png index 2abf512..a80e16bf 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_right-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_right-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_top-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_top-expected.png index 4538edd..ab3214007 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_top-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/padding_top-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/box_properties/width-expected.png b/third_party/blink/web_tests/platform/linux/css1/box_properties/width-expected.png index db6db777..51fd4f2d 100644 --- a/third_party/blink/web_tests/platform/linux/css1/box_properties/width-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/box_properties/width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/cascade/cascade_order-expected.png b/third_party/blink/web_tests/platform/linux/css1/cascade/cascade_order-expected.png index b709191..c094029f 100644 --- a/third_party/blink/web_tests/platform/linux/css1/cascade/cascade_order-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/cascade/cascade_order-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/classification/display-expected.png b/third_party/blink/web_tests/platform/linux/css1/classification/display-expected.png index 6f58fff..f9159ad 100644 --- a/third_party/blink/web_tests/platform/linux/css1/classification/display-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/classification/display-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/classification/list_style_type-expected.png b/third_party/blink/web_tests/platform/linux/css1/classification/list_style_type-expected.png index cf22662..b8bda69 100644 --- a/third_party/blink/web_tests/platform/linux/css1/classification/list_style_type-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/classification/list_style_type-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/color_and_background/background-expected.png b/third_party/blink/web_tests/platform/linux/css1/color_and_background/background-expected.png index d340740..9cd9867 100644 --- a/third_party/blink/web_tests/platform/linux/css1/color_and_background/background-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/color_and_background/background-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/color_and_background/background_position-expected.png b/third_party/blink/web_tests/platform/linux/css1/color_and_background/background_position-expected.png index 2a553dbd..4b089c42 100644 --- a/third_party/blink/web_tests/platform/linux/css1/color_and_background/background_position-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/color_and_background/background_position-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/conformance/forward_compatible_parsing-expected.png b/third_party/blink/web_tests/platform/linux/css1/conformance/forward_compatible_parsing-expected.png index 96a25477..963ee36 100644 --- a/third_party/blink/web_tests/platform/linux/css1/conformance/forward_compatible_parsing-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/conformance/forward_compatible_parsing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/font_properties/font-expected.png b/third_party/blink/web_tests/platform/linux/css1/font_properties/font-expected.png index 1259d5e..16a1910 100644 --- a/third_party/blink/web_tests/platform/linux/css1/font_properties/font-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/font_properties/font-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/font_properties/font_family-expected.png b/third_party/blink/web_tests/platform/linux/css1/font_properties/font_family-expected.png index 9cde9c3..5e24a2a0 100644 --- a/third_party/blink/web_tests/platform/linux/css1/font_properties/font_family-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/font_properties/font_family-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/font_properties/font_size-expected.png b/third_party/blink/web_tests/platform/linux/css1/font_properties/font_size-expected.png index 8c799a09..04e61bf9 100644 --- a/third_party/blink/web_tests/platform/linux/css1/font_properties/font_size-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/font_properties/font_size-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/font_properties/font_weight-expected.png b/third_party/blink/web_tests/platform/linux/css1/font_properties/font_weight-expected.png index 3ff342db..cc9084b 100644 --- a/third_party/blink/web_tests/platform/linux/css1/font_properties/font_weight-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/font_properties/font_weight-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/formatting_model/floating_elements-expected.png b/third_party/blink/web_tests/platform/linux/css1/formatting_model/floating_elements-expected.png index 6de8936..53554ba7 100644 --- a/third_party/blink/web_tests/platform/linux/css1/formatting_model/floating_elements-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/formatting_model/floating_elements-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/formatting_model/height_of_lines-expected.png b/third_party/blink/web_tests/platform/linux/css1/formatting_model/height_of_lines-expected.png index d3061cea..9567e46 100644 --- a/third_party/blink/web_tests/platform/linux/css1/formatting_model/height_of_lines-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/formatting_model/height_of_lines-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/formatting_model/inline_elements-expected.png b/third_party/blink/web_tests/platform/linux/css1/formatting_model/inline_elements-expected.png index dd9dff1..b3a50fe 100644 --- a/third_party/blink/web_tests/platform/linux/css1/formatting_model/inline_elements-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/formatting_model/inline_elements-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/formatting_model/replaced_elements-expected.png b/third_party/blink/web_tests/platform/linux/css1/formatting_model/replaced_elements-expected.png index f159986..bc609e1 100644 --- a/third_party/blink/web_tests/platform/linux/css1/formatting_model/replaced_elements-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/formatting_model/replaced_elements-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/formatting_model/vertical_formatting-expected.png b/third_party/blink/web_tests/platform/linux/css1/formatting_model/vertical_formatting-expected.png index 0b6626ac..49a4e37 100644 --- a/third_party/blink/web_tests/platform/linux/css1/formatting_model/vertical_formatting-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/formatting_model/vertical_formatting-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/pseudo/anchor-expected.png b/third_party/blink/web_tests/platform/linux/css1/pseudo/anchor-expected.png index 8865446..c6e0a6e4 100644 --- a/third_party/blink/web_tests/platform/linux/css1/pseudo/anchor-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/pseudo/anchor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/pseudo/firstletter-expected.png b/third_party/blink/web_tests/platform/linux/css1/pseudo/firstletter-expected.png index 85a21c3..d26466a 100644 --- a/third_party/blink/web_tests/platform/linux/css1/pseudo/firstletter-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/pseudo/firstletter-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/pseudo/firstline-expected.png b/third_party/blink/web_tests/platform/linux/css1/pseudo/firstline-expected.png index 43670b7..f22fb58e 100644 --- a/third_party/blink/web_tests/platform/linux/css1/pseudo/firstline-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/pseudo/firstline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/pseudo/multiple_pseudo_elements-expected.png b/third_party/blink/web_tests/platform/linux/css1/pseudo/multiple_pseudo_elements-expected.png index c233634..e9cead4 100644 --- a/third_party/blink/web_tests/platform/linux/css1/pseudo/multiple_pseudo_elements-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/pseudo/multiple_pseudo_elements-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/pseudo/pseudo_elements_in_selectors-expected.png b/third_party/blink/web_tests/platform/linux/css1/pseudo/pseudo_elements_in_selectors-expected.png index b00607f..e2070f9 100644 --- a/third_party/blink/web_tests/platform/linux/css1/pseudo/pseudo_elements_in_selectors-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/pseudo/pseudo_elements_in_selectors-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/text_properties/letter_spacing-expected.png b/third_party/blink/web_tests/platform/linux/css1/text_properties/letter_spacing-expected.png index fbfe5ef..d976b83 100644 --- a/third_party/blink/web_tests/platform/linux/css1/text_properties/letter_spacing-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/text_properties/letter_spacing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/text_properties/line_height-expected.png b/third_party/blink/web_tests/platform/linux/css1/text_properties/line_height-expected.png index 0844093..50c32ae 100644 --- a/third_party/blink/web_tests/platform/linux/css1/text_properties/line_height-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/text_properties/line_height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/text_properties/text_decoration-expected.png b/third_party/blink/web_tests/platform/linux/css1/text_properties/text_decoration-expected.png index 0ff64e4..896e98e 100644 --- a/third_party/blink/web_tests/platform/linux/css1/text_properties/text_decoration-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/text_properties/text_decoration-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/text_properties/text_indent-expected.png b/third_party/blink/web_tests/platform/linux/css1/text_properties/text_indent-expected.png index 9e84ce3..f0352c1a 100644 --- a/third_party/blink/web_tests/platform/linux/css1/text_properties/text_indent-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/text_properties/text_indent-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/text_properties/text_transform-expected.png b/third_party/blink/web_tests/platform/linux/css1/text_properties/text_transform-expected.png index 93c70769..43006bf 100644 --- a/third_party/blink/web_tests/platform/linux/css1/text_properties/text_transform-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/text_properties/text_transform-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/text_properties/vertical_align-expected.png b/third_party/blink/web_tests/platform/linux/css1/text_properties/vertical_align-expected.png index 79e5fdc..8c741b8 100644 --- a/third_party/blink/web_tests/platform/linux/css1/text_properties/vertical_align-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/text_properties/vertical_align-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/text_properties/word_spacing-expected.png b/third_party/blink/web_tests/platform/linux/css1/text_properties/word_spacing-expected.png index 797ca930..1d52be6 100644 --- a/third_party/blink/web_tests/platform/linux/css1/text_properties/word_spacing-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/text_properties/word_spacing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/units/color_units-expected.png b/third_party/blink/web_tests/platform/linux/css1/units/color_units-expected.png index 496d65d..2752c275 100644 --- a/third_party/blink/web_tests/platform/linux/css1/units/color_units-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/units/color_units-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/units/length_units-expected.png b/third_party/blink/web_tests/platform/linux/css1/units/length_units-expected.png index b58a135..3f31a36 100644 --- a/third_party/blink/web_tests/platform/linux/css1/units/length_units-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/units/length_units-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css1/units/percentage_units-expected.png b/third_party/blink/web_tests/platform/linux/css1/units/percentage_units-expected.png index 1e9e486..a7ec2c4 100644 --- a/third_party/blink/web_tests/platform/linux/css1/units/percentage_units-expected.png +++ b/third_party/blink/web_tests/platform/linux/css1/units/percentage_units-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css2.1/t0803-c5502-mrgn-r-02-c-expected.png b/third_party/blink/web_tests/platform/linux/css2.1/t0803-c5502-mrgn-r-02-c-expected.png index f2db280..99572977 100644 --- a/third_party/blink/web_tests/platform/linux/css2.1/t0803-c5502-mrgn-r-02-c-expected.png +++ b/third_party/blink/web_tests/platform/linux/css2.1/t0803-c5502-mrgn-r-02-c-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css2.1/t0803-c5505-mrgn-02-c-expected.png b/third_party/blink/web_tests/platform/linux/css2.1/t0803-c5505-mrgn-02-c-expected.png index 7c40fa4..d6164a3 100644 --- a/third_party/blink/web_tests/platform/linux/css2.1/t0803-c5505-mrgn-02-c-expected.png +++ b/third_party/blink/web_tests/platform/linux/css2.1/t0803-c5505-mrgn-02-c-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css2.1/t080301-c411-vt-mrgn-00-b-expected.png b/third_party/blink/web_tests/platform/linux/css2.1/t080301-c411-vt-mrgn-00-b-expected.png index ae2687c..c60540f3 100644 --- a/third_party/blink/web_tests/platform/linux/css2.1/t080301-c411-vt-mrgn-00-b-expected.png +++ b/third_party/blink/web_tests/platform/linux/css2.1/t080301-c411-vt-mrgn-00-b-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png b/third_party/blink/web_tests/platform/linux/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png index edb57f3e..84bcbe1 100644 --- a/third_party/blink/web_tests/platform/linux/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png +++ b/third_party/blink/web_tests/platform/linux/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css2.1/t1002-c5523-width-02-b-g-expected.png b/third_party/blink/web_tests/platform/linux/css2.1/t1002-c5523-width-02-b-g-expected.png index 20bb3c1e..5af4103 100644 --- a/third_party/blink/web_tests/platform/linux/css2.1/t1002-c5523-width-02-b-g-expected.png +++ b/third_party/blink/web_tests/platform/linux/css2.1/t1002-c5523-width-02-b-g-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css2.1/t140201-c535-bg-fixd-00-b-g-expected.png b/third_party/blink/web_tests/platform/linux/css2.1/t140201-c535-bg-fixd-00-b-g-expected.png index 2ea0995..a2525e5 100644 --- a/third_party/blink/web_tests/platform/linux/css2.1/t140201-c535-bg-fixd-00-b-g-expected.png +++ b/third_party/blink/web_tests/platform/linux/css2.1/t140201-c535-bg-fixd-00-b-g-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css2.1/t140201-c537-bgfxps-00-c-ag-expected.png b/third_party/blink/web_tests/platform/linux/css2.1/t140201-c537-bgfxps-00-c-ag-expected.png index e6bbdf3..adf3aee 100644 --- a/third_party/blink/web_tests/platform/linux/css2.1/t140201-c537-bgfxps-00-c-ag-expected.png +++ b/third_party/blink/web_tests/platform/linux/css2.1/t140201-c537-bgfxps-00-c-ag-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css3/flexbox/flexbox-baseline-expected.png b/third_party/blink/web_tests/platform/linux/css3/flexbox/flexbox-baseline-expected.png index 1ab5a28..7bb27e8 100644 --- a/third_party/blink/web_tests/platform/linux/css3/flexbox/flexbox-baseline-expected.png +++ b/third_party/blink/web_tests/platform/linux/css3/flexbox/flexbox-baseline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css3/masking/mask-repeat-space-padding-expected.png b/third_party/blink/web_tests/platform/linux/css3/masking/mask-repeat-space-padding-expected.png index 8ad5f0de..250a28f 100644 --- a/third_party/blink/web_tests/platform/linux/css3/masking/mask-repeat-space-padding-expected.png +++ b/third_party/blink/web_tests/platform/linux/css3/masking/mask-repeat-space-padding-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/backgrounds/background-inherit-color-bug-expected.png b/third_party/blink/web_tests/platform/linux/fast/backgrounds/background-inherit-color-bug-expected.png index 4af0d6b..dfdf85b2 100644 --- a/third_party/blink/web_tests/platform/linux/fast/backgrounds/background-inherit-color-bug-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/backgrounds/background-inherit-color-bug-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/basic/016-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/basic/016-expected.png index 6b91ac7..b17d5cbc 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/basic/016-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/basic/016-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/float/021-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/float/021-expected.png index 04ae0ed..c2b90e2 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/float/021-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/float/021-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/float/025-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/float/025-expected.png index 12a7d74..02aeb20 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/float/025-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/float/025-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/float/026-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/float/026-expected.png index 80b4fc2d..fdb7be0 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/float/026-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/float/026-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/float/027-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/float/027-expected.png index 12a7d74..02aeb20 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/float/027-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/float/027-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/float/028-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/float/028-expected.png index 80b4fc2d..fdb7be0 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/float/028-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/float/028-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/float/centered-float-avoidance-complexity-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/float/centered-float-avoidance-complexity-expected.png index 755f3a3..aa26b2d 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/float/centered-float-avoidance-complexity-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/float/centered-float-avoidance-complexity-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/float/float-avoidance-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/float/float-avoidance-expected.png index d3bc289..007cf99 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/float/float-avoidance-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/float/float-avoidance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/float/shrink-to-avoid-float-complexity-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/float/shrink-to-avoid-float-complexity-expected.png index 83549a8..431f1321 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/float/shrink-to-avoid-float-complexity-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/float/shrink-to-avoid-float-complexity-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/margin-collapse/103-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/margin-collapse/103-expected.png index 47056a2..70fefa4 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/margin-collapse/103-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/margin-collapse/103-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/margin-collapse/104-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/margin-collapse/104-expected.png index 147a7e4..c0852b99 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/margin-collapse/104-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/margin-collapse/104-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/margin-collapse/empty-clear-blocks-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/margin-collapse/empty-clear-blocks-expected.png index 443aaee..1712d2e 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/margin-collapse/empty-clear-blocks-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/margin-collapse/empty-clear-blocks-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/positioning/047-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/positioning/047-expected.png index 6de3722..8bea268 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/positioning/047-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/positioning/047-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/positioning/051-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/positioning/051-expected.png index 9c348634d..fdb7663 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/positioning/051-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/positioning/051-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/positioning/055-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/positioning/055-expected.png index b3882bc..dadd3e3 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/positioning/055-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/positioning/055-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/positioning/auto/007-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/positioning/auto/007-expected.png index 43895e9e..096641d 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/positioning/auto/007-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/positioning/auto/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.png index 7b6a1cf6..ee5e341 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/positioning/relative-overflow-block-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/positioning/relative-overflow-block-expected.png index db09c27c..0129e73 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/positioning/relative-overflow-block-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/positioning/relative-overflow-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/positioning/relative-overflow-replaced-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/positioning/relative-overflow-replaced-expected.png index 02908d8..b0a4134 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/positioning/relative-overflow-replaced-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/positioning/relative-overflow-replaced-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/block/positioning/relative-overflow-replaced-float-expected.png b/third_party/blink/web_tests/platform/linux/fast/block/positioning/relative-overflow-replaced-float-expected.png index 21462ec..80b20bbd6 100644 --- a/third_party/blink/web_tests/platform/linux/fast/block/positioning/relative-overflow-replaced-float-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/block/positioning/relative-overflow-replaced-float-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/002-expected.png b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/002-expected.png index 03bafccb..36f57b48 100644 --- a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/002-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/002-xhtml-expected.png b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/002-xhtml-expected.png index 03bafccb..36f57b48 100644 --- a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/002-xhtml-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/002-xhtml-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/003-declarative-expected.png b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/003-declarative-expected.png index 03bafccb..36f57b48 100644 --- a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/003-declarative-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/003-declarative-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/003-expected.png b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/003-expected.png index 03bafccb..36f57b48 100644 --- a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/003-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/003-xhtml-expected.png b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/003-xhtml-expected.png index 03bafccb..36f57b48 100644 --- a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/003-xhtml-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/003-xhtml-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/004-declarative-expected.png b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/004-declarative-expected.png index 94a99ef..c1874ab 100644 --- a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/004-declarative-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/004-declarative-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/004-expected.png b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/004-expected.png index 94a99ef..c1874ab 100644 --- a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/004-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/004-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/004-xhtml-expected.png b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/004-xhtml-expected.png index 94a99ef..c1874ab 100644 --- a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/004-xhtml-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/004-xhtml-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/007-declarative-expected.png b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/007-declarative-expected.png index 03bafccb..36f57b48 100644 --- a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/007-declarative-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/007-declarative-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/007-expected.png b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/007-expected.png index 03bafccb..36f57b48 100644 --- a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/007-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/007-xhtml-expected.png b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/007-xhtml-expected.png index 03bafccb..36f57b48 100644 --- a/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/007-xhtml-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/body-propagation/overflow/007-xhtml-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/borders/inline-mask-overlay-image-expected.png b/third_party/blink/web_tests/platform/linux/fast/borders/inline-mask-overlay-image-expected.png index 398ff9f..b50942d 100644 --- a/third_party/blink/web_tests/platform/linux/fast/borders/inline-mask-overlay-image-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/borders/inline-mask-overlay-image-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/borders/rtl-border-01-expected.png b/third_party/blink/web_tests/platform/linux/fast/borders/rtl-border-01-expected.png index f18f93e..0d2e66c 100644 --- a/third_party/blink/web_tests/platform/linux/fast/borders/rtl-border-01-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/borders/rtl-border-01-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/borders/rtl-border-02-expected.png b/third_party/blink/web_tests/platform/linux/fast/borders/rtl-border-02-expected.png index cfbb53f28..eec1e7f 100644 --- a/third_party/blink/web_tests/platform/linux/fast/borders/rtl-border-02-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/borders/rtl-border-02-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/borders/rtl-border-03-expected.png b/third_party/blink/web_tests/platform/linux/fast/borders/rtl-border-03-expected.png index c372a7d9..410c46e 100644 --- a/third_party/blink/web_tests/platform/linux/fast/borders/rtl-border-03-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/borders/rtl-border-03-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/box-shadow/basic-shadows-expected.png b/third_party/blink/web_tests/platform/linux/fast/box-shadow/basic-shadows-expected.png index ed8c943..f3bb197 100644 --- a/third_party/blink/web_tests/platform/linux/fast/box-shadow/basic-shadows-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/box-shadow/basic-shadows-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/box-sizing/box-sizing-expected.png b/third_party/blink/web_tests/platform/linux/fast/box-sizing/box-sizing-expected.png index ae86f48..5cd0ed0 100644 --- a/third_party/blink/web_tests/platform/linux/fast/box-sizing/box-sizing-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/box-sizing/box-sizing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/canvas/canvas-composite-video-expected.png b/third_party/blink/web_tests/platform/linux/fast/canvas/canvas-composite-video-expected.png index a3006f05f..091db4b6 100644 --- a/third_party/blink/web_tests/platform/linux/fast/canvas/canvas-composite-video-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/canvas/canvas-composite-video-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/blink/web_tests/platform/linux/fast/canvas/canvas-composite-video-shadow-expected.png index 903d2982..12861ae 100644 --- a/third_party/blink/web_tests/platform/linux/fast/canvas/canvas-composite-video-shadow-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/canvas/canvas-composite-video-shadow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/clip/014-expected.png b/third_party/blink/web_tests/platform/linux/fast/clip/014-expected.png index 69dac32..094be35 100644 --- a/third_party/blink/web_tests/platform/linux/fast/clip/014-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/clip/014-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css-generated-content/014-expected.png b/third_party/blink/web_tests/platform/linux/fast/css-generated-content/014-expected.png index e4658d9..7e38dd8 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css-generated-content/014-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css-generated-content/014-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/bidi-override-in-anonymous-block-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/bidi-override-in-anonymous-block-expected.png index 8322517..50493f5 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/bidi-override-in-anonymous-block-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/bidi-override-in-anonymous-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/border-height-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/border-height-expected.png index 41fe98b4..21541036 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/border-height-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/border-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/color-correction-backgrounds-and-text-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/color-correction-backgrounds-and-text-expected.png index db110d50..c9db85c 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/color-correction-backgrounds-and-text-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/color-correction-backgrounds-and-text-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/color-correction-on-background-image-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/color-correction-on-background-image-expected.png index b3c82625..7ab6352 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/color-correction-on-background-image-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/color-correction-on-background-image-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/first-child-pseudo-class-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/first-child-pseudo-class-expected.png index 2f9c523..5476300 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/first-child-pseudo-class-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/first-child-pseudo-class-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/first-of-type-pseudo-class-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/first-of-type-pseudo-class-expected.png index d3fb3cc..57abf7b 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/first-of-type-pseudo-class-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/first-of-type-pseudo-class-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/hsl-color-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/hsl-color-expected.png index 428a940..9b05696 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/hsl-color-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/hsl-color-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/last-child-pseudo-class-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/last-child-pseudo-class-expected.png index 9115789..aaafcc0 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/last-child-pseudo-class-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/last-child-pseudo-class-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/last-of-type-pseudo-class-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/last-of-type-pseudo-class-expected.png index 1f48aae..1e23479 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/last-of-type-pseudo-class-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/last-of-type-pseudo-class-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/line-height-overflow-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/line-height-overflow-expected.png index 696e646..bbf8bf3 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/line-height-overflow-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/line-height-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/only-child-pseudo-class-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/only-child-pseudo-class-expected.png index 27c4bb2c..75a2229c 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/only-child-pseudo-class-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/only-child-pseudo-class-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/only-of-type-pseudo-class-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/only-of-type-pseudo-class-expected.png index 0f53e6a..4322e748 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/only-of-type-pseudo-class-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/only-of-type-pseudo-class-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.png index fd378ce..a5436fe9 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-justify-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-justify-expected.png index a0f644a..5cd31f0 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-justify-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-justify-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-left-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-left-expected.png index bef4edb..b066a28 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-left-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-left-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.png index 394eaf3e..82308fc 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png index be36a63..8cf69d8 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-justify-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-justify-expected.png index be36a63..8cf69d8 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-justify-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-justify-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.png index be36a63..8cf69d8 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png b/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png index be36a63..8cf69d8 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-expected.png b/third_party/blink/web_tests/platform/linux/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-expected.png index a2dcc933..9eade24 100644 --- a/third_party/blink/web_tests/platform/linux/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/deprecated-flexbox/009-expected.png b/third_party/blink/web_tests/platform/linux/fast/deprecated-flexbox/009-expected.png index 96805b645..6aa607b 100644 --- a/third_party/blink/web_tests/platform/linux/fast/deprecated-flexbox/009-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/deprecated-flexbox/009-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/deprecated-flexbox/009-horizontal-expected.png b/third_party/blink/web_tests/platform/linux/fast/deprecated-flexbox/009-horizontal-expected.png index 26de6b6..2b05ed94 100644 --- a/third_party/blink/web_tests/platform/linux/fast/deprecated-flexbox/009-horizontal-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/deprecated-flexbox/009-horizontal-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/dom/34176-expected.png b/third_party/blink/web_tests/platform/linux/fast/dom/34176-expected.png index c0c5328..b409b61 100644 --- a/third_party/blink/web_tests/platform/linux/fast/dom/34176-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/dom/34176-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/dom/52776-expected.png b/third_party/blink/web_tests/platform/linux/fast/dom/52776-expected.png index 4e9b49bc..42ba6bf 100644 --- a/third_party/blink/web_tests/platform/linux/fast/dom/52776-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/dom/52776-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/dom/rtl-scroll-to-leftmost-and-resize-expected.png b/third_party/blink/web_tests/platform/linux/fast/dom/rtl-scroll-to-leftmost-and-resize-expected.png index b6a7dbc..a9e75c6 100644 --- a/third_party/blink/web_tests/platform/linux/fast/dom/rtl-scroll-to-leftmost-and-resize-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/dom/rtl-scroll-to-leftmost-and-resize-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/events/reveal-link-when-focused-expected.png b/third_party/blink/web_tests/platform/linux/fast/events/reveal-link-when-focused-expected.png index 5bfe6ec..512dd18 100644 --- a/third_party/blink/web_tests/platform/linux/fast/events/reveal-link-when-focused-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/events/reveal-link-when-focused-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/button-default-title-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/button-default-title-expected.png index a3198f5..1d4a882 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/button-default-title-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/button-default-title-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/color/color-suggestion-picker-with-scrollbar-appearance-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/color/color-suggestion-picker-with-scrollbar-appearance-expected.png index 6f4272d..8825f57 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/color/color-suggestion-picker-with-scrollbar-appearance-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/color/color-suggestion-picker-with-scrollbar-appearance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/control-clip-overflow-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/control-clip-overflow-expected.png index 50708f1..b96b5142 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/control-clip-overflow-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/control-clip-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/controls-new-ui/color/color-suggestion-picker-appearance-with-scrollbar-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/controls-new-ui/color/color-suggestion-picker-appearance-with-scrollbar-expected.png index 6f4272d..8825f57 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/controls-new-ui/color/color-suggestion-picker-appearance-with-scrollbar-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/controls-new-ui/color/color-suggestion-picker-appearance-with-scrollbar-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png index 2da3403f8..3391945 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png index 950b740..91a0f1d5 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/fieldset/fieldset-align-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/fieldset/fieldset-align-expected.png index c8aa7d2c4..486e910 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/fieldset/fieldset-align-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/fieldset/fieldset-align-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/form-element-geometry-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/form-element-geometry-expected.png index 0037d33..521f5e3 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/form-element-geometry-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/form-element-geometry-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/huge-mac-input-clamped-height-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/huge-mac-input-clamped-height-expected.png index 0f1fe4c..a9d062a 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/huge-mac-input-clamped-height-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/huge-mac-input-clamped-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/select-popup/popup-menu-appearance-long-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/select-popup/popup-menu-appearance-long-expected.png index 2cb2712..5c02af2 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/select-popup/popup-menu-appearance-long-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/select-popup/popup-menu-appearance-long-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/select-popup/popup-menu-appearance-rtl-default-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/select-popup/popup-menu-appearance-rtl-default-expected.png index 20010afdc..a98f4e30 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/select-popup/popup-menu-appearance-rtl-default-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/select-popup/popup-menu-appearance-rtl-default-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/select-popup/popup-menu-appearance-rtl-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/select-popup/popup-menu-appearance-rtl-expected.png index 829ea544..8ead546 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/select-popup/popup-menu-appearance-rtl-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/select-popup/popup-menu-appearance-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/select/listbox-appearance-basic-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/select/listbox-appearance-basic-expected.png index 2c30eee..5202c33 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/select/listbox-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/select/listbox-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/select/listbox-scrollbar-incremental-load-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/select/listbox-scrollbar-incremental-load-expected.png index 0ab149d..8f00ed4 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/select/listbox-scrollbar-incremental-load-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/select/listbox-scrollbar-incremental-load-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/select/menulist-appearance-basic-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/select/menulist-appearance-basic-expected.png index 9282f64..25648bd 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/select/menulist-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/select/menulist-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/select/select-item-background-clip-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/select/select-item-background-clip-expected.png index 5cfdd87..cfa0129 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/select/select-item-background-clip-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/select/select-item-background-clip-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/select/select-overflow-scroll-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/select/select-overflow-scroll-expected.png index 8be07fd..66de285 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/select/select-overflow-scroll-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/select/select-overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/select/select-overflow-scroll-inherited-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/select/select-overflow-scroll-inherited-expected.png index 4375120d..5fcb0991 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/select/select-overflow-scroll-inherited-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/select/select-overflow-scroll-inherited-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/date-suggestion-picker-appearance-rtl-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/date-suggestion-picker-appearance-rtl-expected.png index 4273eed..52dd3946 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/date-suggestion-picker-appearance-rtl-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/date-suggestion-picker-appearance-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar-expected.png index 7c77443..dfa34c9 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl-expected.png index 9aaefe0..877e8e6 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/time-suggestion-picker-appearance-with-scroll-bar-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/time-suggestion-picker-appearance-with-scroll-bar-expected.png index 4ed55c57..b21baa1 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/time-suggestion-picker-appearance-with-scroll-bar-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/time-suggestion-picker-appearance-with-scroll-bar-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/week-suggestion-picker-appearance-rtl-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/week-suggestion-picker-appearance-rtl-expected.png index d5e8706..55defa2 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/week-suggestion-picker-appearance-rtl-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/suggestion-picker/week-suggestion-picker-appearance-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/text/input-appearance-selection-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/text/input-appearance-selection-expected.png index 8be800b1..4c02a86 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/text/input-appearance-selection-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/text/input-appearance-selection-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/text/input-table-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/text/input-table-expected.png index e86021d..c225248 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/text/input-table-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/text/input-table-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/basic-textareas-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/basic-textareas-expected.png index c8acf756..88fcedce 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/basic-textareas-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/basic-textareas-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/basic-textareas-quirks-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/basic-textareas-quirks-expected.png index 410e910..17bac48b2 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/basic-textareas-quirks-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/basic-textareas-quirks-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textAreaLineHeight-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textAreaLineHeight-expected.png index 8af3298..1e18f49 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textAreaLineHeight-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textAreaLineHeight-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scroll-height-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scroll-height-expected.png index d5a722d7..48059050d 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scroll-height-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scroll-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scrollbar-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scrollbar-expected.png index 3b4ad0d4..ddf9dd4 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scrollbar-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scrollbar-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scrolled-focus-ring-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scrolled-focus-ring-expected.png index f4dd223a..0b2658db 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scrolled-focus-ring-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scrolled-focus-ring-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scrolled-type-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scrolled-type-expected.png index 4623ffe..20b19f3 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scrolled-type-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/textarea/textarea-scrolled-type-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/frames/frame-scrolling-attribute-expected.png b/third_party/blink/web_tests/platform/linux/fast/frames/frame-scrolling-attribute-expected.png index c7c0ad78..5f42c28c 100644 --- a/third_party/blink/web_tests/platform/linux/fast/frames/frame-scrolling-attribute-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/frames/frame-scrolling-attribute-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/frames/iframe-scrolling-attribute-expected.png b/third_party/blink/web_tests/platform/linux/fast/frames/iframe-scrolling-attribute-expected.png index ee516786..6a342e65 100644 --- a/third_party/blink/web_tests/platform/linux/fast/frames/iframe-scrolling-attribute-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/frames/iframe-scrolling-attribute-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/frames/onlyCommentInIFrame-expected.png b/third_party/blink/web_tests/platform/linux/fast/frames/onlyCommentInIFrame-expected.png index 7d637455..0c7413b 100644 --- a/third_party/blink/web_tests/platform/linux/fast/frames/onlyCommentInIFrame-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/frames/onlyCommentInIFrame-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/gradients/css3-color-stop-units-expected.png b/third_party/blink/web_tests/platform/linux/fast/gradients/css3-color-stop-units-expected.png index 878b0b3..7b0b1bf 100644 --- a/third_party/blink/web_tests/platform/linux/fast/gradients/css3-color-stop-units-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/gradients/css3-color-stop-units-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/hidpi/scrollbar-appearance-decrease-device-scale-factor-expected.png b/third_party/blink/web_tests/platform/linux/fast/hidpi/scrollbar-appearance-decrease-device-scale-factor-expected.png index 7511fa2..5c98e2f 100644 --- a/third_party/blink/web_tests/platform/linux/fast/hidpi/scrollbar-appearance-decrease-device-scale-factor-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/hidpi/scrollbar-appearance-decrease-device-scale-factor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/hidpi/scrollbar-appearance-increase-device-scale-factor-expected.png b/third_party/blink/web_tests/platform/linux/fast/hidpi/scrollbar-appearance-increase-device-scale-factor-expected.png index 84b82ba..ff922e2 100644 --- a/third_party/blink/web_tests/platform/linux/fast/hidpi/scrollbar-appearance-increase-device-scale-factor-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/hidpi/scrollbar-appearance-increase-device-scale-factor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/inline-block/tricky-baseline-expected.png b/third_party/blink/web_tests/platform/linux/fast/inline-block/tricky-baseline-expected.png index 032ed8cf..ac69f31f 100644 --- a/third_party/blink/web_tests/platform/linux/fast/inline-block/tricky-baseline-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/inline-block/tricky-baseline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/inline/inline-borders-with-bidi-override-expected.png b/third_party/blink/web_tests/platform/linux/fast/inline/inline-borders-with-bidi-override-expected.png index 45c4bbe7..36f92ad 100644 --- a/third_party/blink/web_tests/platform/linux/fast/inline/inline-borders-with-bidi-override-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/inline/inline-borders-with-bidi-override-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/inline/inline-continuation-borders-expected.png b/third_party/blink/web_tests/platform/linux/fast/inline/inline-continuation-borders-expected.png index 6185e685..24f7b75 100644 --- a/third_party/blink/web_tests/platform/linux/fast/inline/inline-continuation-borders-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/inline/inline-continuation-borders-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/layers/overflow-scroll-auto-switch-expected.png b/third_party/blink/web_tests/platform/linux/fast/layers/overflow-scroll-auto-switch-expected.png index dba0be7..5015c6c 100644 --- a/third_party/blink/web_tests/platform/linux/fast/layers/overflow-scroll-auto-switch-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/layers/overflow-scroll-auto-switch-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/layers/scroll-rect-to-visible-expected.png b/third_party/blink/web_tests/platform/linux/fast/layers/scroll-rect-to-visible-expected.png index c6efa51..b2ad13e 100644 --- a/third_party/blink/web_tests/platform/linux/fast/layers/scroll-rect-to-visible-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/layers/scroll-rect-to-visible-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/layers/scroll-with-transform-composited-layer-expected.png b/third_party/blink/web_tests/platform/linux/fast/layers/scroll-with-transform-composited-layer-expected.png index 4e0d6b19..1df96b9 100644 --- a/third_party/blink/web_tests/platform/linux/fast/layers/scroll-with-transform-composited-layer-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/layers/scroll-with-transform-composited-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/layers/scroll-with-transform-layer-expected.png b/third_party/blink/web_tests/platform/linux/fast/layers/scroll-with-transform-layer-expected.png index 4e0d6b19..1df96b9 100644 --- a/third_party/blink/web_tests/platform/linux/fast/layers/scroll-with-transform-layer-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/layers/scroll-with-transform-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/lists/008-expected.png b/third_party/blink/web_tests/platform/linux/fast/lists/008-expected.png index d09ebd2..9fd0371 100644 --- a/third_party/blink/web_tests/platform/linux/fast/lists/008-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/lists/008-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/lists/ol-start-parsing-expected.png b/third_party/blink/web_tests/platform/linux/fast/lists/ol-start-parsing-expected.png index 547b34d..cbf4e15 100644 --- a/third_party/blink/web_tests/platform/linux/fast/lists/ol-start-parsing-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/lists/ol-start-parsing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/lists/olstart-expected.png b/third_party/blink/web_tests/platform/linux/fast/lists/olstart-expected.png index 34fd18a..05619d11 100644 --- a/third_party/blink/web_tests/platform/linux/fast/lists/olstart-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/lists/olstart-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/002-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/002-expected.png index 4f5b64e..659c80e 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/002-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/003-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/003-expected.png index cb0279f..9088ed5 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/003-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/005-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/005-expected.png index 2b0eab0..c5a66ad 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/005-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/005-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/006-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/006-expected.png index c66bd09..936bbe7 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/006-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/006-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/007-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/007-expected.png index 563d7f9..d60f328 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/007-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/childFocusRingClip-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/childFocusRingClip-expected.png index 251ef86..65eae44 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/childFocusRingClip-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/childFocusRingClip-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/float-in-relpositioned-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/float-in-relpositioned-expected.png index efc1b62..57fc639 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/float-in-relpositioned-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/float-in-relpositioned-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-auto-position-absolute-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-auto-position-absolute-expected.png index 83aa61f..bbd1563 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-auto-position-absolute-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-auto-position-absolute-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-float-stacking-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-float-stacking-expected.png index 41908f5..af88aba 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-float-stacking-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-float-stacking-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-rtl-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-rtl-expected.png index 7b5659a..6e7991c 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-rtl-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-rtl-vertical-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-rtl-vertical-expected.png index 5e5fe53a..85ce549b 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-rtl-vertical-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-rtl-vertical-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-stacking-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-stacking-expected.png index 679f9e8b..684d25d 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-stacking-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-stacking-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-text-hit-testing-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-text-hit-testing-expected.png index bdca2f04..fb0c6941 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-text-hit-testing-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-text-hit-testing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-with-local-background-attachment-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-with-local-background-attachment-expected.png index 84cb2e0..a97e1ea 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-with-local-background-attachment-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-with-local-background-attachment-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-x-y-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-x-y-expected.png index 14c1a3d..1268e77 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-x-y-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/overflow-x-y-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.png index 8749de8..6f7e513 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/table-overflow-float-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/table-overflow-float-expected.png index 9683555..d9046f5 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/table-overflow-float-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/table-overflow-float-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/overflow/unreachable-overflow-rtl-bug-expected.png b/third_party/blink/web_tests/platform/linux/fast/overflow/unreachable-overflow-rtl-bug-expected.png index 7d77ac5..62a3b63 100644 --- a/third_party/blink/web_tests/platform/linux/fast/overflow/unreachable-overflow-rtl-bug-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/overflow/unreachable-overflow-rtl-bug-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/parser/open-comment-in-textarea-expected.png b/third_party/blink/web_tests/platform/linux/fast/parser/open-comment-in-textarea-expected.png index 67c86d6..9506af8b 100644 --- a/third_party/blink/web_tests/platform/linux/fast/parser/open-comment-in-textarea-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/parser/open-comment-in-textarea-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/replaced/border-radius-clip-expected.png b/third_party/blink/web_tests/platform/linux/fast/replaced/border-radius-clip-expected.png index 57a767ba..cc33ad7 100644 --- a/third_party/blink/web_tests/platform/linux/fast/replaced/border-radius-clip-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/replaced/border-radius-clip-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/selectors/166-expected.png b/third_party/blink/web_tests/platform/linux/fast/selectors/166-expected.png index 84dc82cd..52d5040a 100644 --- a/third_party/blink/web_tests/platform/linux/fast/selectors/166-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/selectors/166-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png b/third_party/blink/web_tests/platform/linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png index c50d3b7..58c4831 100644 --- a/third_party/blink/web_tests/platform/linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png b/third_party/blink/web_tests/platform/linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png index 25af309..a8be8f0 100644 --- a/third_party/blink/web_tests/platform/linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/023-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/023-expected.png index 98e3bdca..0c736807 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/023-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/023-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/027-vertical-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/027-vertical-expected.png index 0cab2bc..b0fa9ed 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/027-vertical-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/027-vertical-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/040-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/040-expected.png index d86e0d1c8..cbcccdf7 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/040-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/040-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/040-vertical-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/040-vertical-expected.png index 5543ba8..1374b8d 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/040-vertical-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/040-vertical-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-cell-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-cell-collapsed-border-expected.png index 8eb7c90..5fc2d1c 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-cell-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-cell-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-cell-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-cell-expected.png index f9e9f09..f85cc4b 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-cell-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-cell-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-collapsed-border-expected.png index 5ef8c8f0..2f1311e 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-expected.png index 05aa74e..1717b4c 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-group-collapsed-border-expected.png index de440c7..adfbaec 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-group-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-group-expected.png index 5bdd05b..6372301 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-group-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-column-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-expected.png index e9a4f0f..2643014a 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-quirks-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-quirks-expected.png index 553473f..51640e42 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-quirks-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-quirks-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-collapsed-border-expected.png index 6896e80..7b96f12 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-expected.png index f8687139..ac82f94 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-group-collapsed-border-expected.png index 14cda614..10acd4ec 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-group-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-group-expected.png index e031db09..e3e0029 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-group-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_border-table-row-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_layers-hide-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_layers-hide-expected.png index 87bacfe..a30563b 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_layers-hide-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_layers-hide-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_layers-show-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_layers-show-collapsed-border-expected.png index 83130d1..fcf7a8e 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_layers-show-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_layers-show-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_layers-show-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_layers-show-expected.png index be86ad5..eb9a43f 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_layers-show-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_layers-show-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-cell-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-cell-collapsed-border-expected.png index 276fd291..0eb2c47b 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-cell-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-cell-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-cell-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-cell-expected.png index bea2734..63fcf8b 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-cell-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-cell-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-collapsed-border-expected.png index cca42ef..cb356f2 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-expected.png index 4d5f54c..8928bb88 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-group-collapsed-border-expected.png index 83627f031..b9e1a08 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-group-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-group-expected.png index 47d134c..f8dfbd9f 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-group-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-column-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-expected.png index f72aea13..c05032b 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-collapsed-border-expected.png index 99ec010..0cbecf3 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-expected.png index 0998ef0..48bfce2 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-group-collapsed-border-expected.png index 82b2d29..f66c4d5 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-group-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-group-expected.png index a9e1cf2..e7f53a1 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-group-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_position-table-row-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-cell-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-cell-collapsed-border-expected.png index 34d581f..f8940df 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-cell-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-cell-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-cell-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-cell-expected.png index 74b3b4701..ff69b1db 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-cell-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-cell-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-collapsed-border-expected.png index b172b6c..7bc9b17 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-collapsed-border-expected.png index 63925fd..56071b2 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-expected.png index d511542..ba9838ef 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-group-collapsed-border-expected.png index 0a6ca5e..624104c4 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-group-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-group-expected.png index 6d8d990..70d0371 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-group-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-column-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-expected.png index eeffcf3..16f1aa9 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-collapsed-border-expected.png index 8353b2b6..9712e7b 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-expected.png index 8be70852..5899d36 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-group-collapsed-border-expected.png index c93737c..e1083fc4 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-group-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-group-expected.png index 92e94c1..c630fcb 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-group-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/backgr_simple-table-row-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/border-collapsing/004-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/border-collapsing/004-expected.png index 72bd206..55a141de 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/border-collapsing/004-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/border-collapsing/004-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/edge-offsets-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/edge-offsets-expected.png index a8ea6b45..cce90dd 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/edge-offsets-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/edge-offsets-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/empty-cells-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/empty-cells-expected.png index 7a072fd5..b6fb7784 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/empty-cells-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/empty-cells-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/frame-and-rules-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/frame-and-rules-expected.png index d1d02181..692da6c4 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/frame-and-rules-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/frame-and-rules-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/overflowHidden-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/overflowHidden-expected.png index dc189b1..d92bf244 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/overflowHidden-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/overflowHidden-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/prepend-in-anonymous-table-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/prepend-in-anonymous-table-expected.png index 393533f..2fd8d18 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/prepend-in-anonymous-table-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/prepend-in-anonymous-table-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/table/table-display-types-vertical-expected.png b/third_party/blink/web_tests/platform/linux/fast/table/table-display-types-vertical-expected.png index 1b06f6b..ac45a219 100644 --- a/third_party/blink/web_tests/platform/linux/fast/table/table-display-types-vertical-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/table/table-display-types-vertical-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/text-autosizing/hackernews-comments-expected.png b/third_party/blink/web_tests/platform/linux/fast/text-autosizing/hackernews-comments-expected.png index 76fc67f..c8f41e46 100644 --- a/third_party/blink/web_tests/platform/linux/fast/text-autosizing/hackernews-comments-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/text-autosizing/hackernews-comments-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/text/capitalize-boundaries-expected.png b/third_party/blink/web_tests/platform/linux/fast/text/capitalize-boundaries-expected.png index de0ba09b..f6569d7f 100644 --- a/third_party/blink/web_tests/platform/linux/fast/text/capitalize-boundaries-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/text/capitalize-boundaries-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/text/font-format-support-color-cff2-expected.png b/third_party/blink/web_tests/platform/linux/fast/text/font-format-support-color-cff2-expected.png index 0c2e0cd..b0b1dbd 100644 --- a/third_party/blink/web_tests/platform/linux/fast/text/font-format-support-color-cff2-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/text/font-format-support-color-cff2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/text/font-stretch-variant-expected.png b/third_party/blink/web_tests/platform/linux/fast/text/font-stretch-variant-expected.png index 895a648..b820d58d 100644 --- a/third_party/blink/web_tests/platform/linux/fast/text/font-stretch-variant-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/text/font-stretch-variant-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/text/font-weight-variant-expected.png b/third_party/blink/web_tests/platform/linux/fast/text/font-weight-variant-expected.png index a231a8c..bd71f43 100644 --- a/third_party/blink/web_tests/platform/linux/fast/text/font-weight-variant-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/text/font-weight-variant-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/text/international/003-expected.png b/third_party/blink/web_tests/platform/linux/fast/text/international/003-expected.png index 7b222fc3..d4ec5fc 100644 --- a/third_party/blink/web_tests/platform/linux/fast/text/international/003-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/text/international/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/text/international/bidi-neutral-run-expected.png b/third_party/blink/web_tests/platform/linux/fast/text/international/bidi-neutral-run-expected.png index 1a0bbfab..20bb85f6e 100644 --- a/third_party/blink/web_tests/platform/linux/fast/text/international/bidi-neutral-run-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/text/international/bidi-neutral-run-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/text/letter-spacing-leading-and-trailing-expected.png b/third_party/blink/web_tests/platform/linux/fast/text/letter-spacing-leading-and-trailing-expected.png index dfb998f..7398e9e 100644 --- a/third_party/blink/web_tests/platform/linux/fast/text/letter-spacing-leading-and-trailing-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/text/letter-spacing-leading-and-trailing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/text/softHyphen-expected.png b/third_party/blink/web_tests/platform/linux/fast/text/softHyphen-expected.png index 0de13ab..8e82e7cfa 100644 --- a/third_party/blink/web_tests/platform/linux/fast/text/softHyphen-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/text/softHyphen-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/text/unicode-fallback-font-expected.png b/third_party/blink/web_tests/platform/linux/fast/text/unicode-fallback-font-expected.png index 344c2bb3..c935f49c 100644 --- a/third_party/blink/web_tests/platform/linux/fast/text/unicode-fallback-font-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/text/unicode-fallback-font-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/text/whitespace/024-expected.png b/third_party/blink/web_tests/platform/linux/fast/text/whitespace/024-expected.png index 785fee0..f796c6f 100644 --- a/third_party/blink/web_tests/platform/linux/fast/text/whitespace/024-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/text/whitespace/024-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/text/word-break-expected.png b/third_party/blink/web_tests/platform/linux/fast/text/word-break-expected.png index bbe13ebe..4d034baa 100644 --- a/third_party/blink/web_tests/platform/linux/fast/text/word-break-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/text/word-break-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/writing-mode/border-radius-clipping-vertical-lr-expected.png b/third_party/blink/web_tests/platform/linux/fast/writing-mode/border-radius-clipping-vertical-lr-expected.png index ed575dc6..2954e54a 100644 --- a/third_party/blink/web_tests/platform/linux/fast/writing-mode/border-radius-clipping-vertical-lr-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/writing-mode/border-radius-clipping-vertical-lr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/writing-mode/fieldsets-expected.png b/third_party/blink/web_tests/platform/linux/fast/writing-mode/fieldsets-expected.png index df8dbae..d187fd97 100644 --- a/third_party/blink/web_tests/platform/linux/fast/writing-mode/fieldsets-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/writing-mode/fieldsets-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fonts/cursive-expected.png b/third_party/blink/web_tests/platform/linux/fonts/cursive-expected.png index c7476e4..a68c034 100644 --- a/third_party/blink/web_tests/platform/linux/fonts/cursive-expected.png +++ b/third_party/blink/web_tests/platform/linux/fonts/cursive-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fonts/default-expected.png b/third_party/blink/web_tests/platform/linux/fonts/default-expected.png index aa5be0c..5e8682d2 100644 --- a/third_party/blink/web_tests/platform/linux/fonts/default-expected.png +++ b/third_party/blink/web_tests/platform/linux/fonts/default-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fonts/fantasy-expected.png b/third_party/blink/web_tests/platform/linux/fonts/fantasy-expected.png index 5d1a7be..717c30f 100644 --- a/third_party/blink/web_tests/platform/linux/fonts/fantasy-expected.png +++ b/third_party/blink/web_tests/platform/linux/fonts/fantasy-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fonts/monospace-expected.png b/third_party/blink/web_tests/platform/linux/fonts/monospace-expected.png index 9d4c11c..4cc77b9 100644 --- a/third_party/blink/web_tests/platform/linux/fonts/monospace-expected.png +++ b/third_party/blink/web_tests/platform/linux/fonts/monospace-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fonts/sans-serif-expected.png b/third_party/blink/web_tests/platform/linux/fonts/sans-serif-expected.png index 87dd5a7..286a920 100644 --- a/third_party/blink/web_tests/platform/linux/fonts/sans-serif-expected.png +++ b/third_party/blink/web_tests/platform/linux/fonts/sans-serif-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fonts/serif-expected.png b/third_party/blink/web_tests/platform/linux/fonts/serif-expected.png index 5084f46..f265b5ec 100644 --- a/third_party/blink/web_tests/platform/linux/fonts/serif-expected.png +++ b/third_party/blink/web_tests/platform/linux/fonts/serif-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fragmentation/outline-crossing-columns-expected.png b/third_party/blink/web_tests/platform/linux/fragmentation/outline-crossing-columns-expected.png index a5d4da55..37342ad 100644 --- a/third_party/blink/web_tests/platform/linux/fragmentation/outline-crossing-columns-expected.png +++ b/third_party/blink/web_tests/platform/linux/fragmentation/outline-crossing-columns-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.png b/third_party/blink/web_tests/platform/linux/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.png index a53c33788..345eed5 100644 --- a/third_party/blink/web_tests/platform/linux/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.png +++ b/third_party/blink/web_tests/platform/linux/ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/ietestcenter/css3/bordersbackgrounds/background-size-aspect-ratio-expected.png b/third_party/blink/web_tests/platform/linux/ietestcenter/css3/bordersbackgrounds/background-size-aspect-ratio-expected.png index 5aa7bbc..d30d0c41 100644 --- a/third_party/blink/web_tests/platform/linux/ietestcenter/css3/bordersbackgrounds/background-size-aspect-ratio-expected.png +++ b/third_party/blink/web_tests/platform/linux/ietestcenter/css3/bordersbackgrounds/background-size-aspect-ratio-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/ietestcenter/css3/bordersbackgrounds/background_position_three_four_values-expected.png b/third_party/blink/web_tests/platform/linux/ietestcenter/css3/bordersbackgrounds/background_position_three_four_values-expected.png index 0eaf4b99..8f001f3 100644 --- a/third_party/blink/web_tests/platform/linux/ietestcenter/css3/bordersbackgrounds/background_position_three_four_values-expected.png +++ b/third_party/blink/web_tests/platform/linux/ietestcenter/css3/bordersbackgrounds/background_position_three_four_values-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/images/rendering-broken-0px-images-expected.png b/third_party/blink/web_tests/platform/linux/images/rendering-broken-0px-images-expected.png index fd39a85..b3b23a2 100644 --- a/third_party/blink/web_tests/platform/linux/images/rendering-broken-0px-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/images/rendering-broken-0px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/images/rendering-broken-0px-images-quirk-expected.png b/third_party/blink/web_tests/platform/linux/images/rendering-broken-0px-images-quirk-expected.png index 72d0857..44f50dc 100644 --- a/third_party/blink/web_tests/platform/linux/images/rendering-broken-0px-images-quirk-expected.png +++ b/third_party/blink/web_tests/platform/linux/images/rendering-broken-0px-images-quirk-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/images/rendering-broken-10px-images-expected.png b/third_party/blink/web_tests/platform/linux/images/rendering-broken-10px-images-expected.png index 87823d94..07c9cbd9 100644 --- a/third_party/blink/web_tests/platform/linux/images/rendering-broken-10px-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/images/rendering-broken-10px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/images/rendering-broken-16px-images-expected.png b/third_party/blink/web_tests/platform/linux/images/rendering-broken-16px-images-expected.png index 66d5b23..32ddd25 100644 --- a/third_party/blink/web_tests/platform/linux/images/rendering-broken-16px-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/images/rendering-broken-16px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/images/rendering-broken-1px-images-expected.png b/third_party/blink/web_tests/platform/linux/images/rendering-broken-1px-images-expected.png index 08c81f73..0464af21 100644 --- a/third_party/blink/web_tests/platform/linux/images/rendering-broken-1px-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/images/rendering-broken-1px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/images/rendering-broken-block-flow-images-expected.png b/third_party/blink/web_tests/platform/linux/images/rendering-broken-block-flow-images-expected.png index 83f8001..4f99e35d 100644 --- a/third_party/blink/web_tests/platform/linux/images/rendering-broken-block-flow-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/images/rendering-broken-block-flow-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/images/rendering-broken-images-empty-alt-expected.png b/third_party/blink/web_tests/platform/linux/images/rendering-broken-images-empty-alt-expected.png index 4d9978b79d..e013554 100644 --- a/third_party/blink/web_tests/platform/linux/images/rendering-broken-images-empty-alt-expected.png +++ b/third_party/blink/web_tests/platform/linux/images/rendering-broken-images-empty-alt-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/images/rendering-broken-images-expected.png b/third_party/blink/web_tests/platform/linux/images/rendering-broken-images-expected.png index 81c7884..5044e77 100644 --- a/third_party/blink/web_tests/platform/linux/images/rendering-broken-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/images/rendering-broken-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/controls/video-controls-with-cast-rendering-expected.png b/third_party/blink/web_tests/platform/linux/media/controls/video-controls-with-cast-rendering-expected.png index 423924c..ad3cbcfb 100644 --- a/third_party/blink/web_tests/platform/linux/media/controls/video-controls-with-cast-rendering-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/controls/video-controls-with-cast-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/controls/video-overlay-cast-dark-rendering-expected.png b/third_party/blink/web_tests/platform/linux/media/controls/video-overlay-cast-dark-rendering-expected.png index 9ccff31..2b35717 100644 --- a/third_party/blink/web_tests/platform/linux/media/controls/video-overlay-cast-dark-rendering-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/controls/video-overlay-cast-dark-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/controls/video-overlay-cast-light-rendering-expected.png b/third_party/blink/web_tests/platform/linux/media/controls/video-overlay-cast-light-rendering-expected.png index 0916cbe..ed33271 100644 --- a/third_party/blink/web_tests/platform/linux/media/controls/video-overlay-cast-light-rendering-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/controls/video-overlay-cast-light-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/video-controls-rendering-expected.png b/third_party/blink/web_tests/platform/linux/media/video-controls-rendering-expected.png index 8ebba7e4..b54739b7 100644 --- a/third_party/blink/web_tests/platform/linux/media/video-controls-rendering-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/video-controls-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/video-zoom-expected.png b/third_party/blink/web_tests/platform/linux/media/video-zoom-expected.png index e090223..0c352d48 100644 --- a/third_party/blink/web_tests/platform/linux/media/video-zoom-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/video-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/overflow/overflow-transform-perspective-expected.png b/third_party/blink/web_tests/platform/linux/overflow/overflow-transform-perspective-expected.png index b5c0edf..c900905 100644 --- a/third_party/blink/web_tests/platform/linux/overflow/overflow-transform-perspective-expected.png +++ b/third_party/blink/web_tests/platform/linux/overflow/overflow-transform-perspective-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/fixed-pos-inside-composited-intermediate-layer-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/fixed-pos-inside-composited-intermediate-layer-expected.png new file mode 100644 index 0000000..edcf245 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/fixed-pos-inside-composited-intermediate-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/newly-composited-repaint-rect-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/newly-composited-repaint-rect-expected.png new file mode 100644 index 0000000..12d1ce3 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/newly-composited-repaint-rect-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/repaint-overflow-scrolled-squashed-content-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/repaint-overflow-scrolled-squashed-content-expected.png new file mode 100644 index 0000000..eebe901 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/repaint-overflow-scrolled-squashed-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/scrolling-without-painting-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/scrolling-without-painting-expected.png new file mode 100644 index 0000000..24dcc6f --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/scrolling-without-painting-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/text-color-change-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/text-color-change-expected.png index 7459bf2..d97406bc 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/text-color-change-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/text-color-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/text-match-highlight-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/text-match-highlight-expected.png index 8a4708f..1937746 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/text-match-highlight-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/text-match-highlight-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.png index 92c57c8d..756c574 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/updating-scrolling-container-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/updating-scrolling-container-expected.png index eb780c1..d199eb4 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/updating-scrolling-container-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/updating-scrolling-container-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/updating-scrolling-content-expected.png similarity index 70% copy from third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.png copy to third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/updating-scrolling-content-expected.png index 6091c85..4b512b5 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/compositing/updating-scrolling-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/forms/textarea-caret-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/forms/textarea-caret-expected.png index aabf046..acaa154e 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/forms/textarea-caret-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/forms/textarea-caret-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/invalidation-after-opacity-change-subtree-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/invalidation-after-opacity-change-subtree-expected.png index 657cd8c9..7e124bf 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/invalidation-after-opacity-change-subtree-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/invalidation-after-opacity-change-subtree-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-1-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-1-expected.png index 50118f35..d4bdc365 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-1-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-10-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-10-expected.png index 09c0c6d7f..0021963 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-10-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-10-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-2-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-2-expected.png index 63562c5..5dd33d84 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-2-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-3-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-3-expected.png index dd84045..73abb97 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-3-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-4-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-4-expected.png index 0a51cfb..34b7b2b 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-4-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-4-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-5-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-5-expected.png index a228f49..0fdf35d410 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-5-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-5-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-6-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-6-expected.png index 5263f73..f3f3390 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-6-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-6-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-7-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-7-expected.png index 8bb18915..7106cf3c 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-7-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-7-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-8-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-8-expected.png index 48071d5..d8bb28d 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-8-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-9-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-9-expected.png index f4514494..8ed51bf 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-9-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/line-flow-with-floats-9-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/overflow/vertical-overflow-child-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/overflow/vertical-overflow-child-expected.png index ff63dfd..3ef6b69 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/overflow/vertical-overflow-child-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/overflow/vertical-overflow-child-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/overflow/vertical-overflow-parent-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/overflow/vertical-overflow-parent-expected.png index 57969c78..7dbfc36 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/overflow/vertical-overflow-parent-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/overflow/vertical-overflow-parent-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/overflow/vertical-overflow-same-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/overflow/vertical-overflow-same-expected.png index 2b9b916..6c66c76 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/overflow/vertical-overflow-same-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/overflow/vertical-overflow-same-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/fixed-child-of-transformed-scrolled-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/fixed-child-of-transformed-scrolled-expected.png index 83d5b4ee..0ca7189b 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/fixed-child-of-transformed-scrolled-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/fixed-child-of-transformed-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/fixed-descendant-of-transformed-scrolled-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/fixed-descendant-of-transformed-scrolled-expected.png index 0328ff7..c073f74 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/fixed-descendant-of-transformed-scrolled-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/fixed-descendant-of-transformed-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/flipped-blocks-writing-mode-scroll-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/flipped-blocks-writing-mode-scroll-expected.png index a4fb313..6aaf628 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/flipped-blocks-writing-mode-scroll-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/flipped-blocks-writing-mode-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/overflow-scroll-body-appear-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/overflow-scroll-body-appear-expected.png index 6fecad9..cbb03a2 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/overflow-scroll-body-appear-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/overflow-scroll-body-appear-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/overflow-scroll-local-background-text-color-change-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/overflow-scroll-local-background-text-color-change-expected.png index 7907b9e6..8811490 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/overflow-scroll-local-background-text-color-change-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/overflow-scroll-local-background-text-color-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/resize-scrollable-iframe-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/resize-scrollable-iframe-expected.png index 83dbcae5..7aff008 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/resize-scrollable-iframe-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/resize-scrollable-iframe-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/scrollbar-damage-and-full-viewport-repaint-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/scrollbar-damage-and-full-viewport-repaint-expected.png index f7265d7..e7205b4 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/scrollbar-damage-and-full-viewport-repaint-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/scrollbar-damage-and-full-viewport-repaint-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/scrollbar-parts-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/scrollbar-parts-expected.png index 33d57b9a..fe7ed25 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/scrollbar-parts-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/scroll/scrollbar-parts-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/selection/selection-within-composited-scroller-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/selection/selection-within-composited-scroller-expected.png index 5d591be..513e519 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/selection/selection-within-composited-scroller-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/selection/selection-within-composited-scroller-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem-expected.png index cac26045..6612fa82 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/svg/text-xy-updates-SVGList-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/svg/text-xy-updates-SVGList-expected.png index db1b69fc..a3bd59f 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/svg/text-xy-updates-SVGList-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/svg/text-xy-updates-SVGList-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/table/single-line-cells-repeating-thead-break-inside-on-thead-only-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/table/single-line-cells-repeating-thead-break-inside-on-thead-only-expected.png index 4dc167e..003921c 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/table/single-line-cells-repeating-thead-break-inside-on-thead-only-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/table/single-line-cells-repeating-thead-break-inside-on-thead-only-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/paint/invalidation/text-match-document-change-expected.png b/third_party/blink/web_tests/platform/linux/paint/invalidation/text-match-document-change-expected.png index 164dbf0..784bef86 100644 --- a/third_party/blink/web_tests/platform/linux/paint/invalidation/text-match-document-change-expected.png +++ b/third_party/blink/web_tests/platform/linux/paint/invalidation/text-match-document-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/plugins/webview-plugin-nested-iframe-scroll-expected.png b/third_party/blink/web_tests/platform/linux/plugins/webview-plugin-nested-iframe-scroll-expected.png index 5526df7..0704bfc0 100644 --- a/third_party/blink/web_tests/platform/linux/plugins/webview-plugin-nested-iframe-scroll-expected.png +++ b/third_party/blink/web_tests/platform/linux/plugins/webview-plugin-nested-iframe-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/printing/return-from-printing-mode-expected.png b/third_party/blink/web_tests/platform/linux/printing/return-from-printing-mode-expected.png index 92288b5..fdead9f4 100644 --- a/third_party/blink/web_tests/platform/linux/printing/return-from-printing-mode-expected.png +++ b/third_party/blink/web_tests/platform/linux/printing/return-from-printing-mode-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/blink/web_tests/platform/linux/scrollbars/border-box-rect-clips-scrollbars-expected.png index fb11eac4..29f1f13 100644 --- a/third_party/blink/web_tests/platform/linux/scrollbars/border-box-rect-clips-scrollbars-expected.png +++ b/third_party/blink/web_tests/platform/linux/scrollbars/border-box-rect-clips-scrollbars-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/scrollbars/scrollbar-corner-colors-expected.png b/third_party/blink/web_tests/platform/linux/scrollbars/scrollbar-corner-colors-expected.png index 870d5d27..a831a230 100644 --- a/third_party/blink/web_tests/platform/linux/scrollbars/scrollbar-corner-colors-expected.png +++ b/third_party/blink/web_tests/platform/linux/scrollbars/scrollbar-corner-colors-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/scrollbars/scrollbars-on-positioned-content-expected.png b/third_party/blink/web_tests/platform/linux/scrollbars/scrollbars-on-positioned-content-expected.png index 8cbbfbea..2cde23e 100644 --- a/third_party/blink/web_tests/platform/linux/scrollbars/scrollbars-on-positioned-content-expected.png +++ b/third_party/blink/web_tests/platform/linux/scrollbars/scrollbars-on-positioned-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/custom/bug45331-expected.png b/third_party/blink/web_tests/platform/linux/svg/custom/bug45331-expected.png index 218c896..d09e65c 100644 --- a/third_party/blink/web_tests/platform/linux/svg/custom/bug45331-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/custom/bug45331-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/custom/invisible-text-after-scrolling-expected.png b/third_party/blink/web_tests/platform/linux/svg/custom/invisible-text-after-scrolling-expected.png index 6cd2f94..62a15e5 100644 --- a/third_party/blink/web_tests/platform/linux/svg/custom/invisible-text-after-scrolling-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/custom/invisible-text-after-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/custom/junk-data-expected.png b/third_party/blink/web_tests/platform/linux/svg/custom/junk-data-expected.png index 1efa6ba..cbeb6bcc 100644 --- a/third_party/blink/web_tests/platform/linux/svg/custom/junk-data-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/custom/junk-data-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/custom/load-non-wellformed-expected.png b/third_party/blink/web_tests/platform/linux/svg/custom/load-non-wellformed-expected.png index 61fa7de..7d2c445 100644 --- a/third_party/blink/web_tests/platform/linux/svg/custom/load-non-wellformed-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/custom/load-non-wellformed-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/custom/missing-xlink-expected.png b/third_party/blink/web_tests/platform/linux/svg/custom/missing-xlink-expected.png index fd7d3d3..7ed0243 100644 --- a/third_party/blink/web_tests/platform/linux/svg/custom/missing-xlink-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/custom/missing-xlink-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/custom/path-bad-data-expected.png b/third_party/blink/web_tests/platform/linux/svg/custom/path-bad-data-expected.png index 010d38c..87e0ad5 100644 --- a/third_party/blink/web_tests/platform/linux/svg/custom/path-bad-data-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/custom/path-bad-data-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/custom/use-font-face-crash-expected.png b/third_party/blink/web_tests/platform/linux/svg/custom/use-font-face-crash-expected.png index ffc5334..c0c7ce2d 100644 --- a/third_party/blink/web_tests/platform/linux/svg/custom/use-font-face-crash-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/custom/use-font-face-crash-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/dom/SVGStringList-basics-expected.png b/third_party/blink/web_tests/platform/linux/svg/dom/SVGStringList-basics-expected.png index f323ff1..f302388 100644 --- a/third_party/blink/web_tests/platform/linux/svg/dom/SVGStringList-basics-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/dom/SVGStringList-basics-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/dom/css-transforms-expected.png b/third_party/blink/web_tests/platform/linux/svg/dom/css-transforms-expected.png index d3c160e..83a233d 100644 --- a/third_party/blink/web_tests/platform/linux/svg/dom/css-transforms-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/dom/css-transforms-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/hixie/error/012-expected.png b/third_party/blink/web_tests/platform/linux/svg/hixie/error/012-expected.png index 922d5e9e..1639889c 100644 --- a/third_party/blink/web_tests/platform/linux/svg/hixie/error/012-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/hixie/error/012-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/wicd/test-scalable-background-image1-expected.png b/third_party/blink/web_tests/platform/linux/svg/wicd/test-scalable-background-image1-expected.png index ef09558..35e0a51d 100644 --- a/third_party/blink/web_tests/platform/linux/svg/wicd/test-scalable-background-image1-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/wicd/test-scalable-background-image1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/zoom/page/zoom-hixie-mixed-008-expected.png b/third_party/blink/web_tests/platform/linux/svg/zoom/page/zoom-hixie-mixed-008-expected.png index 77685a68..7d781bd 100644 --- a/third_party/blink/web_tests/platform/linux/svg/zoom/page/zoom-hixie-mixed-008-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/zoom/page/zoom-hixie-mixed-008-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/zoom/page/zoom-mask-with-percentages-expected.png b/third_party/blink/web_tests/platform/linux/svg/zoom/page/zoom-mask-with-percentages-expected.png index 599a85b6..9806a59 100644 --- a/third_party/blink/web_tests/platform/linux/svg/zoom/page/zoom-mask-with-percentages-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/zoom/page/zoom-mask-with-percentages-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/zoom/page/zoom-svg-float-border-padding-expected.png b/third_party/blink/web_tests/platform/linux/svg/zoom/page/zoom-svg-float-border-padding-expected.png index 3e37716..9b7787b 100644 --- a/third_party/blink/web_tests/platform/linux/svg/zoom/page/zoom-svg-float-border-padding-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/zoom/page/zoom-svg-float-border-padding-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug101674-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug101674-expected.png index f4cb6f0..734dc2f 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug101674-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug101674-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug10269-2-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug10269-2-expected.png index 9777c6c..f7e205a 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug10269-2-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug10269-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug10296-1-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug10296-1-expected.png index 91a80fc..dfc4cce 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug10296-1-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug10296-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug1055-1-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug1055-1-expected.png index 35465f88..03eb993b 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug1055-1-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug1055-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug113235-1-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug113235-1-expected.png index 617e91d..defe31a 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug113235-1-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug113235-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug113235-3-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug113235-3-expected.png index 1b611ec..2254c898 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug113235-3-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug113235-3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug11944-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug11944-expected.png index 856ba4e..e051279 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug11944-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug11944-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug120364-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug120364-expected.png index da527dc..e0ac2fb3 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug120364-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug120364-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug12384-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug12384-expected.png index 119ba8e6..b78a9f0 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug12384-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug12384-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug1302-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug1302-expected.png index 84e3798..91803f9 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug1302-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug1302-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug131020-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug131020-expected.png index 9c5b1d1..2b520823 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug131020-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug131020-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug131020_iframe-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug131020_iframe-expected.png index 2e2dfea..8f440c17 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug131020_iframe-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug131020_iframe-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug137388-2-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug137388-2-expected.png index 5bcb9c8..03cef70 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug137388-2-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug137388-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug149275-1-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug149275-1-expected.png index e7d20edb..3c64555 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug149275-1-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug149275-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug22019-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug22019-expected.png index c93b363..46060e6 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug22019-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug22019-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2479-1-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2479-1-expected.png index 9eeb6da..aa2cd22 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2479-1-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2479-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2479-3-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2479-3-expected.png index 9fb3b5a..659b30d2c 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2479-3-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2479-3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2479-4-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2479-4-expected.png index de87238..9380528b 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2479-4-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2479-4-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug27038-2-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug27038-2-expected.png index 5ff87d7..d8d4352 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug27038-2-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug27038-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2947-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2947-expected.png index ecc06ea..f8f1e57 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2947-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug2947-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug32205-2-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug32205-2-expected.png index 6617f59..9630469 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug32205-2-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug32205-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug38916-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug38916-expected.png index ab179b32..b7233b2 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug38916-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug38916-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug3977-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug3977-expected.png index 3e50261..c1bf939 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug3977-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug3977-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug46480-1-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug46480-1-expected.png index 795e197c..4dbde19 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug46480-1-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug46480-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug50695-1-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug50695-1-expected.png index 993ca4a..f0923bae 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug50695-1-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug50695-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug5835-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug5835-expected.png index e8c5fb7..89eb144 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug5835-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug5835-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug650-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug650-expected.png index 866e98f7..0ddcde9 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug650-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug650-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug67915-1-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug67915-1-expected.png index 3c1fff1..b194f1a 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug67915-1-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug67915-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug7112-1-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug7112-1-expected.png index e05a8f4..e0ed8a0 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug7112-1-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug7112-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug7112-2-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug7112-2-expected.png index 0628ddb..52eeca1b 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug7112-2-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug7112-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug73321-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug73321-expected.png index 20a6df43..ca57a91 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug73321-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug73321-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug96343-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug96343-expected.png index 0f025fc..26bd916 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug96343-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug96343-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/bloomberg-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/bloomberg-expected.png index 86954c96..75269aef 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/bloomberg-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/bloomberg-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/captions-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/captions-expected.png index e153a59..4536f26 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/captions-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/captions-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/cell_heights-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/cell_heights-expected.png index 90e9371..4f080e38 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/cell_heights-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/cell_heights-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/col_widths_fix_fixPer-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/col_widths_fix_fixPer-expected.png index 414d8ca9..c346579 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/col_widths_fix_fixPer-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/col_widths_fix_fixPer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/row_span-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/row_span-expected.png index 5e5f786..f94dc762 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/row_span-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/row_span-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_table_bgcolor_name-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_table_bgcolor_name-expected.png index 8bc6ebe..c29b79d 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_table_bgcolor_name-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_table_bgcolor_name-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_table_bgcolor_rgb-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_table_bgcolor_rgb-expected.png index 8bc6ebe..c29b79d 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_table_bgcolor_rgb-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_table_bgcolor_rgb-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_td_bgcolor_name-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_td_bgcolor_name-expected.png index 1e14fd4..02bbbe4 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_td_bgcolor_name-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_td_bgcolor_name-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_td_bgcolor_rgb-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_td_bgcolor_rgb-expected.png index 1e14fd4..02bbbe4 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_td_bgcolor_rgb-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_td_bgcolor_rgb-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_td_height-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_td_height-expected.png index eb1e062..064d24c 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_td_height-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_td_height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_th_bgcolor_name-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_th_bgcolor_name-expected.png index 496c5b91a..eb064a3d 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_th_bgcolor_name-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_th_bgcolor_name-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_th_bgcolor_rgb-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_th_bgcolor_rgb-expected.png index 496c5b91a..eb064a3d 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_th_bgcolor_rgb-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_th_bgcolor_rgb-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_th_height-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_th_height-expected.png index 5ee9970..43fcaec8 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_th_height-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_th_height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_tr_bgcolor_name-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_tr_bgcolor_name-expected.png index 1e14fd4..02bbbe4 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_tr_bgcolor_name-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_tr_bgcolor_name-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_tr_bgcolor_rgb-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_tr_bgcolor_rgb-expected.png index 1e14fd4..02bbbe4 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_tr_bgcolor_rgb-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/marvin/x_tr_bgcolor_rgb-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/other/cell_widths-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/other/cell_widths-expected.png index b12d5f32..9678999 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/other/cell_widths-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/other/cell_widths-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/other/nestedTables-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/other/nestedTables-expected.png index adab559..7c05d0c 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/other/nestedTables-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/other/nestedTables-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/other/test3-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/other/test3-expected.png index c30208c..7abf19b 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/other/test3-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/other/test3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/other/test6-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/other/test6-expected.png index 0c46d5b..935e72c 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/other/test6-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/other/test6-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/other/wa_table_thtd_rowspan-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/other/wa_table_thtd_rowspan-expected.png index cf017e4..0c6d82e 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/other/wa_table_thtd_rowspan-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/other/wa_table_thtd_rowspan-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/other/wa_table_tr_align-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/other/wa_table_tr_align-expected.png index 020303b..04931c9b 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/other/wa_table_tr_align-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/other/wa_table_tr_align-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug10140-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug10140-expected.png index 426fd64..25de2f5 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug10140-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug10140-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug101759-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug101759-expected.png index 6c36d38..505d11b 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug101759-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug101759-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug10216-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug10216-expected.png index 05b191d..d612020 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug10216-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug10216-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug1055-2-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug1055-2-expected.png index ecad1f9..c82deef 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug1055-2-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug1055-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug106966-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug106966-expected.png index 79872d3a..0f961ca 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug106966-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug106966-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png index af276b1..b8d70f6 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug14007-1-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug14007-1-expected.png index bec6f632..4e94b5f 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug14007-1-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug14007-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug14007-2-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug14007-2-expected.png index 9d3ed21..94ddde8 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug14007-2-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug14007-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug19526-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug19526-expected.png index b67b8769..739253e 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug19526-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug19526-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug22122-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug22122-expected.png index 0c935ca..3445e34 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug22122-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug22122-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug2479-5-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug2479-5-expected.png index cb0954e..968e4ad 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug2479-5-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug2479-5-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug32205-1-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug32205-1-expected.png index 03dc19c..75011a0 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug32205-1-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug32205-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug80762-2-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug80762-2-expected.png index 48197e58..da82b370 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug80762-2-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug80762-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug89315-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug89315-expected.png index 20943097..548eea5 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug89315-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug89315-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug91057-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug91057-expected.png index 6a3fb422..bf9fd01 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug91057-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug91057-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/backgrounds-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/backgrounds-expected.png index 5f48165..0369bdf 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/backgrounds-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/backgrounds-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/captions1-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/captions1-expected.png index b42d47b90..1c805f77 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/captions1-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/captions1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/captions2-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/captions2-expected.png index 0bb563a9..cbddd94 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/captions2-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/captions2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/captions3-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/captions3-expected.png index 1a9064f..cd39778 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/captions3-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/captions3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/col_span2-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/col_span2-expected.png index 818bb12..dd67078 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/col_span2-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/col_span2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/columns-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/columns-expected.png index c7189e8..4f343e42 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/columns-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/columns-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/conflicts-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/conflicts-expected.png index 904ed7b..8f6a835 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/conflicts-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/conflicts-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/standards1-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/standards1-expected.png index 75319b20..7d3ea23f 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/standards1-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/core/standards1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png index 51f3a3d..fbd14a9a 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_row_sibling-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_row_sibling-expected.png index 968af804..45f8a7c0 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_row_sibling-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_row_sibling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_tbody_sibling-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_tbody_sibling-expected.png index ef2631f..ff6f41e 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_tbody_sibling-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_tbody_sibling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/other/empty_cells-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/other/empty_cells-expected.png index c717a3c..e9ca9c2 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/other/empty_cells-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/other/empty_cells-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/other/test4-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/other/test4-expected.png index d8ab617..0bee4163 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/other/test4-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/other/test4-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/transforms/2d/hindi-rotated-expected.png b/third_party/blink/web_tests/platform/linux/transforms/2d/hindi-rotated-expected.png index 9127b5ea..110569a 100644 --- a/third_party/blink/web_tests/platform/linux/transforms/2d/hindi-rotated-expected.png +++ b/third_party/blink/web_tests/platform/linux/transforms/2d/hindi-rotated-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-expected.png b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-expected.png index b0f4515..a19569f7 100644 --- a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-expected.png +++ b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png index a77628c..57ff53d 100644 --- a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png +++ b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png index c45a55b..52866e4 100644 --- a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png +++ b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/audio-service/http/tests/media/video-frame-size-change-expected.png b/third_party/blink/web_tests/platform/linux/virtual/audio-service/http/tests/media/video-frame-size-change-expected.png index 28e9abd..5f16050 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/audio-service/http/tests/media/video-frame-size-change-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/audio-service/http/tests/media/video-frame-size-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/audio-service/media/controls/video-overlay-cast-dark-rendering-expected.png b/third_party/blink/web_tests/platform/linux/virtual/audio-service/media/controls/video-overlay-cast-dark-rendering-expected.png new file mode 100644 index 0000000..2b35717 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/audio-service/media/controls/video-overlay-cast-dark-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/audio-service/media/video-controls-rendering-expected.png b/third_party/blink/web_tests/platform/linux/virtual/audio-service/media/video-controls-rendering-expected.png new file mode 100644 index 0000000..b54739b7 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/audio-service/media/video-controls-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/audio-service/media/video-zoom-expected.png b/third_party/blink/web_tests/platform/linux/virtual/audio-service/media/video-zoom-expected.png new file mode 100644 index 0000000..0c352d48 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/audio-service/media/video-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/composite-after-paint/compositing/overlap-blending/children-opacity-huge-expected.png b/third_party/blink/web_tests/platform/linux/virtual/composite-after-paint/compositing/overlap-blending/children-opacity-huge-expected.png new file mode 100644 index 0000000..d96888ab --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/composite-after-paint/compositing/overlap-blending/children-opacity-huge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png index 670157cf..77c516cf 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png index bfd8a63..c696e021 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png index 13378729..4b89f778 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png index 018faab..4b89f778 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png index c23bd15..184e4e95 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png index 7151697..671e3180 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png index 1ba15f3..0c6c878 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png index 4e8fd80..71b1d9c 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png index 018faab..4b89f778 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png index 6132a29..d3e5474 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png index 018faab..4b89f778 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png index b22840c..3ee3707 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/disable-deferred-rendering/fast/canvas/canvas-composite-video-expected.png b/third_party/blink/web_tests/platform/linux/virtual/disable-deferred-rendering/fast/canvas/canvas-composite-video-expected.png index a3006f05f..091db4b6 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/disable-deferred-rendering/fast/canvas/canvas-composite-video-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/disable-deferred-rendering/fast/canvas/canvas-composite-video-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/disable-deferred-rendering/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/blink/web_tests/platform/linux/virtual/disable-deferred-rendering/fast/canvas/canvas-composite-video-shadow-expected.png index 903d2982..12861ae 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/disable-deferred-rendering/fast/canvas/canvas-composite-video-shadow-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/disable-deferred-rendering/fast/canvas/canvas-composite-video-shadow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-0px-images-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-0px-images-expected.png index b5e7e79..36e5e92 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-0px-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-0px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-0px-images-quirk-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-0px-images-quirk-expected.png index 9c28867b..447f7ce 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-0px-images-quirk-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-0px-images-quirk-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-10px-images-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-10px-images-expected.png index 3184c8c..749d893 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-10px-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-10px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-16px-images-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-16px-images-expected.png index 93ed38e0..0dd83fa 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-16px-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-16px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-1px-images-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-1px-images-expected.png index 5cae7cfc..c4aef03 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-1px-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-1px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-block-flow-images-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-block-flow-images-expected.png index 73de6f7..f48229f6 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-block-flow-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-block-flow-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-images-empty-alt-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-images-empty-alt-expected.png index 246ff86..58575bf9 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-images-empty-alt-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-images-empty-alt-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-images-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-images-expected.png index 6e770d6..9a04579 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/rendering-broken-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-0px-images-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-0px-images-expected.png index d174e13..bc6b47d 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-0px-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-0px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-0px-images-quirk-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-0px-images-quirk-expected.png index cae7420..dba9dae 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-0px-images-quirk-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-0px-images-quirk-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-10px-images-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-10px-images-expected.png index bf07ed00..98d4d5ab 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-10px-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-10px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-16px-images-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-16px-images-expected.png index 3f328b9..7f79a8e 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-16px-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-16px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-1px-images-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-1px-images-expected.png index 190b2d7..ef3fd79 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-1px-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-1px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-block-flow-images-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-block-flow-images-expected.png index 5d73602..3f4c5396 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-block-flow-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-block-flow-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-images-empty-alt-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-images-empty-alt-expected.png index 65e05d3..c333e04 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-images-empty-alt-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-images-empty-alt-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-images-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-images-expected.png index 2b8d00a7..31b33ab 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-images-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rendering-broken-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-expected.png index 7af60dd..66fbcc68 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png index ec321a9a..6aebe80 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/layout_ng_block_frag/fragmentation/outline-crossing-columns-expected.png b/third_party/blink/web_tests/platform/linux/virtual/layout_ng_block_frag/fragmentation/outline-crossing-columns-expected.png index a5d4da55..37342ad 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/layout_ng_block_frag/fragmentation/outline-crossing-columns-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/layout_ng_block_frag/fragmentation/outline-crossing-columns-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/layout_ng_block_frag/printing/return-from-printing-mode-expected.png b/third_party/blink/web_tests/platform/linux/virtual/layout_ng_block_frag/printing/return-from-printing-mode-expected.png index 92288b5..fdead9f4 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/layout_ng_block_frag/printing/return-from-printing-mode-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/layout_ng_block_frag/printing/return-from-printing-mode-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/mouseevent_fractional/fast/events/reveal-link-when-focused-expected.png b/third_party/blink/web_tests/platform/linux/virtual/mouseevent_fractional/fast/events/reveal-link-when-focused-expected.png index 5bfe6ec..512dd18 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/mouseevent_fractional/fast/events/reveal-link-when-focused-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/mouseevent_fractional/fast/events/reveal-link-when-focused-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png index a9dfa22..24ea3c6 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-border-radius-clipping-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-border-radius-clipping-expected.png index c84ef1b..3516f965 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-border-radius-clipping-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-border-radius-clipping-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-scrolling-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-scrolling-expected.png index bd0686c9..ab5a37f 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-scrolling-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scroll-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scroll-expected.png index 9e9e782..1184b11 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scroll-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png index 8cf4c695..ebbf758 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/remove-overflow-crash2-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/remove-overflow-crash2-expected.png index f546fd89..814ae75f 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/remove-overflow-crash2-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/remove-overflow-crash2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-ancestor-update-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-ancestor-update-expected.png index 83951000..0045f761 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-ancestor-update-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-ancestor-update-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrollbar-painting-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrollbar-painting-expected.png index 4c72d915..6de8a01e 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrollbar-painting-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrollbar-painting-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.png deleted file mode 100644 index a31226e..0000000 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png index 459948dd..6b84ae4 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png index fb11eac4..29f1f13 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/border-box-rect-clips-scrollbars-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbar-corner-colors-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbar-corner-colors-expected.png index f6137ce..992abad1d 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbar-corner-colors-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbar-corner-colors-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbars-on-positioned-content-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbars-on-positioned-content-expected.png index 8cbbfbea..2cde23e 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbars-on-positioned-content-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/scrollbars/scrollbars-on-positioned-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/threaded/printing/return-from-printing-mode-expected.png b/third_party/blink/web_tests/platform/linux/virtual/threaded/printing/return-from-printing-mode-expected.png index 92288b5..fdead9f4 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/threaded/printing/return-from-printing-mode-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/threaded/printing/return-from-printing-mode-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png index bc549723..00307280 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png index d7a3577..37446c5 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/paint/invalidation/compositing/text-color-change-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/paint/invalidation/compositing/text-color-change-expected.png index 6abfcf0..4e6d00b 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/paint/invalidation/compositing/text-color-change-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/paint/invalidation/compositing/text-color-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png index 32c81b0..451da6fc 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png deleted file mode 100644 index 268ebf8..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png new file mode 100644 index 0000000..ef426e5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png new file mode 100644 index 0000000..527065b --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png new file mode 100644 index 0000000..7912dfd --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png new file mode 100644 index 0000000..c84cbdd --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png new file mode 100644 index 0000000..a3c2b66e --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png deleted file mode 100644 index 0c1509b..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png index bc549723..00307280 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.png deleted file mode 100644 index 7969a03..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png index d7a3577..37446c5 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png index 34916b6..fcc80f5e 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png index 2d26010..5584d3b 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png index 32c81b0..451da6fc 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png deleted file mode 100644 index 268ebf8..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png new file mode 100644 index 0000000..ef426e5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png new file mode 100644 index 0000000..527065b --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png new file mode 100644 index 0000000..7912dfd --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png new file mode 100644 index 0000000..c84cbdd --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png new file mode 100644 index 0000000..a3c2b66e --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png deleted file mode 100644 index 0c1509b..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png index 34916b6..fcc80f5e 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.png deleted file mode 100644 index a31226e..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/prefer_compositing_to_lcd_text/compositing/overflow/universal-accelerated-overflow-scroll-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png index 2d26010..5584d3b 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png index a5dba05..e7217b9 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/compositing/overflow/overflow-scroll-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/compositing/overflow/overflow-scroll-expected.png index 1927a6c..ae1d6b7 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/compositing/overflow/overflow-scroll-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/compositing/overflow/overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png index 40840209..ee40260 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/media/video-controls-rendering-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/media/video-controls-rendering-expected.png index ff025e5..782f72d 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/media/video-controls-rendering-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/media/video-controls-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/audio-service/media/video-controls-rendering-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/audio-service/media/video-controls-rendering-expected.png new file mode 100644 index 0000000..782f72d --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/audio-service/media/video-controls-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png index 32c81b0..451da6fc 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png deleted file mode 100644 index 268ebf8..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png new file mode 100644 index 0000000..ef426e5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png new file mode 100644 index 0000000..527065b --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png new file mode 100644 index 0000000..7912dfd --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png new file mode 100644 index 0000000..c84cbdd --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png new file mode 100644 index 0000000..a3c2b66e --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png deleted file mode 100644 index 0c1509b..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png index a5dba05..e7217b9 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/prefer_compositing_to_lcd_text/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scroll-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scroll-expected.png index 1927a6c..524bc44 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scroll-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png index 40840209..ee40260 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/prefer_compositing_to_lcd_text/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-retina/media/video-zoom-expected.png b/third_party/blink/web_tests/platform/mac-retina/media/video-zoom-expected.png new file mode 100644 index 0000000..974f227 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-retina/media/video-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png index 32c81b0..451da6fc 100644 --- a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png +++ b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png deleted file mode 100644 index 268ebf8..0000000 --- a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png new file mode 100644 index 0000000..ef426e5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png new file mode 100644 index 0000000..527065b --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png new file mode 100644 index 0000000..7912dfd --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png new file mode 100644 index 0000000..c84cbdd --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png new file mode 100644 index 0000000..a3c2b66e --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png new file mode 100644 index 0000000..b19ef2d5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png deleted file mode 100644 index 0c1509b..0000000 --- a/third_party/blink/web_tests/platform/mac-retina/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/fixed-pos-inside-composited-intermediate-layer-expected.png b/third_party/blink/web_tests/platform/mac/compositing/culling/filter-occlusion-alpha-large-expected.png similarity index 62% rename from third_party/blink/web_tests/paint/invalidation/compositing/fixed-pos-inside-composited-intermediate-layer-expected.png rename to third_party/blink/web_tests/platform/mac/compositing/culling/filter-occlusion-alpha-large-expected.png index 28c4a50..9b96b29 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/fixed-pos-inside-composited-intermediate-layer-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/culling/filter-occlusion-alpha-large-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/direct-image-compositing-expected.png b/third_party/blink/web_tests/platform/mac/compositing/direct-image-compositing-expected.png index f4c7cf1..f9efac9 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/direct-image-compositing-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/direct-image-compositing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/fixed-background-after-style-recalc-expected.png b/third_party/blink/web_tests/platform/mac/compositing/fixed-background-after-style-recalc-expected.png new file mode 100644 index 0000000..d47f8c43 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/fixed-background-after-style-recalc-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/fixed-body-background-positioned-expected.png b/third_party/blink/web_tests/platform/mac/compositing/fixed-body-background-positioned-expected.png new file mode 100644 index 0000000..c99a078 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/fixed-body-background-positioned-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/geometry/fixed-in-composited-expected.png b/third_party/blink/web_tests/platform/mac/compositing/geometry/fixed-in-composited-expected.png index 8a5734b..11c659c 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/geometry/fixed-in-composited-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/geometry/fixed-in-composited-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/geometry/horizontal-scroll-composited-expected.png b/third_party/blink/web_tests/platform/mac/compositing/geometry/horizontal-scroll-composited-expected.png new file mode 100644 index 0000000..51a8cb9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/geometry/horizontal-scroll-composited-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/geometry/tall-page-composited-expected.png b/third_party/blink/web_tests/platform/mac/compositing/geometry/tall-page-composited-expected.png new file mode 100644 index 0000000..b0c94961 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/geometry/tall-page-composited-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/geometry/video-fixed-scrolling-expected.png b/third_party/blink/web_tests/platform/mac/compositing/geometry/video-fixed-scrolling-expected.png index 25267c40..a58aecd3 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/geometry/video-fixed-scrolling-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/geometry/video-fixed-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.png b/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.png index 9dd9f3d..85055f32 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png b/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png index 8a9e6c7..17da38b7 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png b/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png index c32f8b5..e2b7441 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png b/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png index f8fe3c0a..9d0c615 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/iframes/iframe-copy-on-scroll-expected.png b/third_party/blink/web_tests/platform/mac/compositing/iframes/iframe-copy-on-scroll-expected.png index accf985..f3cc54a 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/iframes/iframe-copy-on-scroll-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/iframes/iframe-copy-on-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/iframes/iframe-in-composited-layer-expected.png b/third_party/blink/web_tests/platform/mac/compositing/iframes/iframe-in-composited-layer-expected.png new file mode 100644 index 0000000..97cfaf7 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/iframes/iframe-in-composited-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/iframes/scroll-fixed-transformed-element-expected.png b/third_party/blink/web_tests/platform/mac/compositing/iframes/scroll-fixed-transformed-element-expected.png index 328f1e9..67e939a9 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/iframes/scroll-fixed-transformed-element-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/iframes/scroll-fixed-transformed-element-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/iframes/scroll-grandchild-iframe-expected.png b/third_party/blink/web_tests/platform/mac/compositing/iframes/scroll-grandchild-iframe-expected.png index d0a12df..f46ea9b 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/iframes/scroll-grandchild-iframe-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/iframes/scroll-grandchild-iframe-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/img-layer-grow-expected.png b/third_party/blink/web_tests/platform/mac/compositing/img-layer-grow-expected.png index e501f66f3..bc80e39a 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/img-layer-grow-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/img-layer-grow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-and-transform-expected.png b/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-and-transform-expected.png index 1bb73f41..30b4d6f 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-and-transform-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-and-transform-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-scroll-expected.png b/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-scroll-expected.png index 2cda65f6..1f4b9c8 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-scroll-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-under-transform-expected.png b/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-under-transform-expected.png index 1bb73f41..30b4d6f 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-under-transform-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/layer-creation/fixed-position-under-transform-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/layers-inside-overflow-scroll-expected.png b/third_party/blink/web_tests/platform/mac/compositing/layers-inside-overflow-scroll-expected.png index 15fe5933..5f6b6b27 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/layers-inside-overflow-scroll-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/layers-inside-overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/layout-width-change-expected.png b/third_party/blink/web_tests/platform/mac/compositing/layout-width-change-expected.png index 19fb9a2..812eb53 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/layout-width-change-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/layout-width-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/masks/mask-with-added-filters-expected.png b/third_party/blink/web_tests/platform/mac/compositing/masks/mask-with-added-filters-expected.png index eb9f5b8..f5a2966 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/masks/mask-with-added-filters-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/masks/mask-with-added-filters-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/masks/mask-with-removed-filters-expected.png b/third_party/blink/web_tests/platform/mac/compositing/masks/mask-with-removed-filters-expected.png index aa0f6173..7d05a947 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/masks/mask-with-removed-filters-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/masks/mask-with-removed-filters-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/masks/masked-ancestor-expected.png b/third_party/blink/web_tests/platform/mac/compositing/masks/masked-ancestor-expected.png index a2f62e48..5040c8e 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/masks/masked-ancestor-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/masks/masked-ancestor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/masks/multiple-masks-expected.png b/third_party/blink/web_tests/platform/mac/compositing/masks/multiple-masks-expected.png index 996a5560..1ad314e 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/masks/multiple-masks-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/masks/multiple-masks-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/masks/simple-composited-mask-expected.png b/third_party/blink/web_tests/platform/mac/compositing/masks/simple-composited-mask-expected.png index dca2a9ff..bccb921a 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/masks/simple-composited-mask-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/masks/simple-composited-mask-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/accelerated-scrolling-with-clip-path-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/accelerated-scrolling-with-clip-path-expected.png new file mode 100644 index 0000000..54db4c47 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/accelerated-scrolling-with-clip-path-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.png new file mode 100644 index 0000000..86b34f6 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png index 2ee36e6f..cf10fb96 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/fractional-sized-scrolling-layer-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/fractional-sized-scrolling-layer-expected.png new file mode 100644 index 0000000..6c23125 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/fractional-sized-scrolling-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/image-load-overflow-scrollbars-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/image-load-overflow-scrollbars-expected.png new file mode 100644 index 0000000..8d7b10b --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/image-load-overflow-scrollbars-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-border-radius-clipping-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-border-radius-clipping-expected.png index b90fb09..dfec6f129 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-border-radius-clipping-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-border-radius-clipping-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-expected.png new file mode 100644 index 0000000..289f19c --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-with-intervening-clip-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-with-intervening-clip-expected.png new file mode 100644 index 0000000..4132afd7 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-with-intervening-clip-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-with-rotation-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-with-rotation-expected.png index 1600edb..3bd990a5 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-with-rotation-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-render-surfaces-with-rotation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-scrolling-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-scrolling-expected.png index 613356f48..8cc69cfb 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-scrolling-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/nested-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-clip-with-accelerated-scrolling-ancestor-expected.png similarity index 64% copy from third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.png copy to third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-clip-with-accelerated-scrolling-ancestor-expected.png index 6091c85..32e381a 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-clip-with-accelerated-scrolling-ancestor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png index 1e7d8dcf..57a1418 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png index be405160..272d8b8 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-expected.png index bc871a5..6dfa210 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-with-local-image-background-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-with-local-image-background-expected.png new file mode 100644 index 0000000..521c32e8 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/overflow-scroll-with-local-image-background-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png index 95b07b2..262540c2 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/remove-overflow-crash2-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/remove-overflow-crash2-expected.png index 24ba4b4..cbd835c 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/remove-overflow-crash2-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/remove-overflow-crash2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/scroll-ancestor-update-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/scroll-ancestor-update-expected.png index f6a4f8a..b7ba46e 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/scroll-ancestor-update-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/scroll-ancestor-update-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/scrollbar-painting-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/scrollbar-painting-expected.png index 24788b35..03bb3fe 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/scrollbar-painting-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/scrollbar-painting-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/scrollbars-with-clipped-owner-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/scrollbars-with-clipped-owner-expected.png new file mode 100644 index 0000000..be71cde --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/scrollbars-with-clipped-owner-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/tiled-mask-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/tiled-mask-expected.png new file mode 100644 index 0000000..7fa1996b --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/tiled-mask-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/universal-accelerated-overflow-scroll-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/universal-accelerated-overflow-scroll-expected.png index 7969a03..667c6f88 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/universal-accelerated-overflow-scroll-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/universal-accelerated-overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png index 532a1a4c..2bcf751 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overlap-blending/children-opacity-huge-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overlap-blending/children-opacity-huge-expected.png index aba2f1b..82df909 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overlap-blending/children-opacity-huge-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overlap-blending/children-opacity-huge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/overlap-blending/reflection-opacity-huge-expected.png b/third_party/blink/web_tests/platform/mac/compositing/overlap-blending/reflection-opacity-huge-expected.png index 422646f4..c638f80d 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/overlap-blending/reflection-opacity-huge-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/overlap-blending/reflection-opacity-huge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/perspective-interest-rect-expected.png b/third_party/blink/web_tests/platform/mac/compositing/perspective-interest-rect-expected.png new file mode 100644 index 0000000..7942d33 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/perspective-interest-rect-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/reflections/nested-reflection-on-overflow-expected.png b/third_party/blink/web_tests/platform/mac/compositing/reflections/nested-reflection-on-overflow-expected.png index b0e6363..b28012b 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/reflections/nested-reflection-on-overflow-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/reflections/nested-reflection-on-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-absolute-overflow-expected.png b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-absolute-overflow-expected.png new file mode 100644 index 0000000..d77c5939 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-absolute-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-absolute-overflow-scrolled-expected.png b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-absolute-overflow-scrolled-expected.png new file mode 100644 index 0000000..fbb8996 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-absolute-overflow-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-fixed-overflow-expected.png b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-fixed-overflow-expected.png new file mode 100644 index 0000000..d77c5939 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-fixed-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-fixed-overflow-scrolled-expected.png b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-fixed-overflow-scrolled-expected.png new file mode 100644 index 0000000..fbb8996 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-fixed-overflow-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-iframe-absolute-overflow-expected.png b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-iframe-absolute-overflow-expected.png new file mode 100644 index 0000000..b5cecc0 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-iframe-absolute-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-iframe-absolute-overflow-scrolled-expected.png b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-iframe-absolute-overflow-scrolled-expected.png new file mode 100644 index 0000000..96a79b3 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-iframe-absolute-overflow-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-iframe-fixed-overflow-expected.png b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-iframe-fixed-overflow-expected.png new file mode 100644 index 0000000..b5cecc0 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-iframe-fixed-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-iframe-fixed-overflow-scrolled-expected.png b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-iframe-fixed-overflow-scrolled-expected.png new file mode 100644 index 0000000..96a79b3 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-iframe-fixed-overflow-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/fractional-sized-scrolling-layer-expected.png b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-overflow-invalidation-expected.png similarity index 64% rename from third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/fractional-sized-scrolling-layer-expected.png rename to third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-overflow-invalidation-expected.png index 0b35de8..9a19a02 100644 --- a/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/fractional-sized-scrolling-layer-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-overflow-invalidation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-overflow-scrolling-expected.png b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-overflow-scrolling-expected.png index 946af111..26444ca 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-overflow-scrolling-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/rtl/rtl-overflow-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/scroll-with-ancestor-clip-expected.png b/third_party/blink/web_tests/platform/mac/compositing/scroll-with-ancestor-clip-expected.png new file mode 100644 index 0000000..10c3a09 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/scroll-with-ancestor-clip-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/self-painting-layers-expected.png b/third_party/blink/web_tests/platform/mac/compositing/self-painting-layers-expected.png index f86fbf6..b3d933c 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/self-painting-layers-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/self-painting-layers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/squashing/frame-clip-squashed-scrolled-expected.png b/third_party/blink/web_tests/platform/mac/compositing/squashing/frame-clip-squashed-scrolled-expected.png new file mode 100644 index 0000000..5245cb40 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/compositing/squashing/frame-clip-squashed-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/compositing/squashing/vertical-writing-mode-squashed-expected.png b/third_party/blink/web_tests/platform/mac/compositing/squashing/vertical-writing-mode-squashed-expected.png index fbc6bcf..d2d27cd 100644 --- a/third_party/blink/web_tests/platform/mac/compositing/squashing/vertical-writing-mode-squashed-expected.png +++ b/third_party/blink/web_tests/platform/mac/compositing/squashing/vertical-writing-mode-squashed-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/css3/blending/background-blend-mode-data-uri-svg-image-expected.png b/third_party/blink/web_tests/platform/mac/css3/blending/background-blend-mode-data-uri-svg-image-expected.png new file mode 100644 index 0000000..0b720367 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/css3/blending/background-blend-mode-data-uri-svg-image-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/css3/filters/blur-filter-page-scroll-expected.png b/third_party/blink/web_tests/platform/mac/css3/filters/blur-filter-page-scroll-expected.png new file mode 100644 index 0000000..0954821 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/css3/filters/blur-filter-page-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/css3/filters/blur-filter-page-scroll-parents-expected.png b/third_party/blink/web_tests/platform/mac/css3/filters/blur-filter-page-scroll-parents-expected.png new file mode 100644 index 0000000..558693de --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/css3/filters/blur-filter-page-scroll-parents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/css3/filters/blur-filter-page-scroll-self-expected.png b/third_party/blink/web_tests/platform/mac/css3/filters/blur-filter-page-scroll-self-expected.png new file mode 100644 index 0000000..1dfb1d87 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/css3/filters/blur-filter-page-scroll-self-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/css/css2-system-color-expected.html b/third_party/blink/web_tests/platform/mac/fast/css/css2-system-color-expected.html index 014a58a2..27f5945 100644 --- a/third_party/blink/web_tests/platform/mac/fast/css/css2-system-color-expected.html +++ b/third_party/blink/web_tests/platform/mac/fast/css/css2-system-color-expected.html
@@ -25,6 +25,7 @@ <body> <div class="box"><div class="text">ActiveBorder</div><div class="inner" style="background-color: rgb(59, 153, 252)"> </div></div> <div class="box"><div class="text">ActiveCaption</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div> + <div class="box"><div class="text">ActiveText</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> <div class="box"><div class="text">AppWorkspace</div><div class="inner" style="background-color: rgb(170, 170, 170)"> </div></div> <div class="box"><div class="text">Background</div><div class="inner" style="background-color: rgb(99, 99, 206)"> </div></div> <div class="box"><div class="text">ButtonFace</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> @@ -32,6 +33,8 @@ <div class="box"><div class="text">ButtonShadow</div><div class="inner" style="background-color: rgba(159, 160, 159)"> </div></div> <div class="box"><div class="text">ButtonText</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div> <div class="box"><div class="text">CaptionText</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div> + <div class="box"><div class="text">Field</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> + <div class="box"><div class="text">FieldText</div><div class="inner" style="background-color: rgb(255, 255, 255)"> </div></div> <div class="box"><div class="text">GrayText</div><div class="inner" style="background-color: rgb(127, 127, 127)"> </div></div> <div class="box"><div class="text">Highlight</div><div class="inner" style="background-color: rgb(181, 213, 255)"> </div></div> <div class="box"><div class="text">HighlightText</div><div class="inner" style="background-color: rgb(0, 0, 0)"> </div></div>
diff --git a/third_party/blink/web_tests/platform/mac/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png b/third_party/blink/web_tests/platform/mac/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png index f11b988..e53ce263 100644 --- a/third_party/blink/web_tests/platform/mac/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png b/third_party/blink/web_tests/platform/mac/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png index ecc71241..e06cb6e 100644 --- a/third_party/blink/web_tests/platform/mac/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/media/controls/video-overlay-cast-dark-rendering-expected.png b/third_party/blink/web_tests/platform/mac/media/controls/video-overlay-cast-dark-rendering-expected.png index f90c99db..efaa7b9 100644 --- a/third_party/blink/web_tests/platform/mac/media/controls/video-overlay-cast-dark-rendering-expected.png +++ b/third_party/blink/web_tests/platform/mac/media/controls/video-overlay-cast-dark-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/media/video-controls-rendering-expected.png b/third_party/blink/web_tests/platform/mac/media/video-controls-rendering-expected.png index b63bb46..98fb723 100644 --- a/third_party/blink/web_tests/platform/mac/media/video-controls-rendering-expected.png +++ b/third_party/blink/web_tests/platform/mac/media/video-controls-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/media/video-zoom-expected.png b/third_party/blink/web_tests/platform/mac/media/video-zoom-expected.png index 568bd7e..34743ab 100644 --- a/third_party/blink/web_tests/platform/mac/media/video-zoom-expected.png +++ b/third_party/blink/web_tests/platform/mac/media/video-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/fixed-pos-inside-composited-intermediate-layer-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/fixed-pos-inside-composited-intermediate-layer-expected.png new file mode 100644 index 0000000..d8eaabfe --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/fixed-pos-inside-composited-intermediate-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/fixed-scroll-in-empty-root-layer-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/fixed-scroll-in-empty-root-layer-expected.png new file mode 100644 index 0000000..06557db --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/fixed-scroll-in-empty-root-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/invalidations-with-large-negative-margin-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/invalidations-with-large-negative-margin-expected.png new file mode 100644 index 0000000..9db510c --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/invalidations-with-large-negative-margin-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/newly-composited-on-scroll-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/newly-composited-on-scroll-expected.png index 91f66ad..510a53c 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/newly-composited-on-scroll-expected.png +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/newly-composited-on-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/newly-composited-repaint-rect-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/newly-composited-repaint-rect-expected.png index 59a7de0..3e2cdab 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/newly-composited-repaint-rect-expected.png +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/newly-composited-repaint-rect-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/repaint-overflow-scrolled-squashed-content-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/repaint-overflow-scrolled-squashed-content-expected.png new file mode 100644 index 0000000..f1f76bff --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/repaint-overflow-scrolled-squashed-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/requires-backing-repaint-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/requires-backing-repaint-expected.png index 367fa4a1..8ad3ddf 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/requires-backing-repaint-expected.png +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/requires-backing-repaint-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/scroll-fixed-layer-no-content-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/scroll-fixed-layer-no-content-expected.png new file mode 100644 index 0000000..f6251a2 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/scroll-fixed-layer-no-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/scroll-fixed-layer-out-of-view-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/scroll-fixed-layer-out-of-view-expected.png new file mode 100644 index 0000000..f6251a2 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/scroll-fixed-layer-out-of-view-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/scroll-fixed-squahed-layer-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/scroll-fixed-squahed-layer-expected.png new file mode 100644 index 0000000..55043c1 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/scroll-fixed-squahed-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/updating-scrolling-content-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/scrolling-without-painting-expected.png similarity index 68% rename from third_party/blink/web_tests/paint/invalidation/compositing/updating-scrolling-content-expected.png rename to third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/scrolling-without-painting-expected.png index 1268a1f1..c528c56 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/updating-scrolling-content-expected.png +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/scrolling-without-painting-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.png similarity index 60% copy from third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.png copy to third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.png index 6091c85..0f95275 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.png +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/should-not-clip-composited-overflow-scrolling-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/should-not-clip-composited-viewport-scrolling-layer-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/should-not-clip-composited-viewport-scrolling-layer-expected.png new file mode 100644 index 0000000..b532dbf1 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/should-not-clip-composited-viewport-scrolling-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/text-color-change-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/text-color-change-expected.png index a136b3b0..cdc23eb 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/text-color-change-expected.png +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/text-color-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/text-match-highlight-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/text-match-highlight-expected.png index f6e9a8f..c23a5ff9 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/text-match-highlight-expected.png +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/text-match-highlight-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.png index 6081da932..3bed833 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.png +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-container-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-container-expected.png index 10c3de6..2883658 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-container-expected.png +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-container-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-content-expected.png b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-content-expected.png new file mode 100644 index 0000000..77ea58ff --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/compositing/updating-scrolling-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/scrollbars/composited-platform-overlay-scrollbars-initially-invisible.html b/third_party/blink/web_tests/platform/mac/scrollbars/composited-platform-overlay-scrollbars-initially-invisible.html index 791dc01..7d99039 100644 --- a/third_party/blink/web_tests/platform/mac/scrollbars/composited-platform-overlay-scrollbars-initially-invisible.html +++ b/third_party/blink/web_tests/platform/mac/scrollbars/composited-platform-overlay-scrollbars-initially-invisible.html
@@ -1,10 +1,7 @@ <!DOCTYPE html> <script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(false); +if (window.internals) internals.settings.setPreferCompositingToLCDTextEnabled(true); -} </script> The overlay scrollbars should be hidden initially. <div style="width: 200px; height: 200px; border: 1px solid black; overflow: auto">
diff --git a/third_party/blink/web_tests/platform/mac/scrollbars/non-composited-platform-overlay-scrollbars-initially-invisible.html b/third_party/blink/web_tests/platform/mac/scrollbars/non-composited-platform-overlay-scrollbars-initially-invisible.html index 47a87ddb..5b9e0fd 100644 --- a/third_party/blink/web_tests/platform/mac/scrollbars/non-composited-platform-overlay-scrollbars-initially-invisible.html +++ b/third_party/blink/web_tests/platform/mac/scrollbars/non-composited-platform-overlay-scrollbars-initially-invisible.html
@@ -1,10 +1,7 @@ <!DOCTYPE html> <script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(false); +if (window.internals) internals.settings.setPreferCompositingToLCDTextEnabled(false); -} </script> The overlay scrollbars should be hidden initially. <div style="width: 200px; height: 200px; border: 1px solid black; overflow: auto">
diff --git a/third_party/blink/web_tests/platform/mac/scrollbars/rtl/overflow-scroll-rtl-expected.png b/third_party/blink/web_tests/platform/mac/scrollbars/rtl/overflow-scroll-rtl-expected.png new file mode 100644 index 0000000..973e92c --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/scrollbars/rtl/overflow-scroll-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/composite-after-paint/compositing/geometry/tall-page-composited-expected.png b/third_party/blink/web_tests/platform/mac/virtual/composite-after-paint/compositing/geometry/tall-page-composited-expected.png new file mode 100644 index 0000000..efdbbb1 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/composite-after-paint/compositing/geometry/tall-page-composited-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/composite-after-paint/compositing/overlap-blending/children-opacity-huge-expected.png b/third_party/blink/web_tests/platform/mac/virtual/composite-after-paint/compositing/overlap-blending/children-opacity-huge-expected.png new file mode 100644 index 0000000..a684954 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/composite-after-paint/compositing/overlap-blending/children-opacity-huge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/composite-after-paint/compositing/rtl/rtl-overflow-scrolling-expected.png b/third_party/blink/web_tests/platform/mac/virtual/composite-after-paint/compositing/rtl/rtl-overflow-scrolling-expected.png new file mode 100644 index 0000000..d8e7c62 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/composite-after-paint/compositing/rtl/rtl-overflow-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png index 32c81b0..451da6fc 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png index bf7fa6b71..b19ef2d5 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png index 481760b..b19ef2d5 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png index f7f80f3e..ef426e5 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png index 7f079205..527065b 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png index 51a6c40..7912dfd 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png index a4d150e..c84cbdd 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png index 481760b..b19ef2d5 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png index 30f1a450..a3c2b66e 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png index 481760b..b19ef2d5 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/fractional-sized-scrolling-layer-expected.png b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/fractional-sized-scrolling-layer-expected.png new file mode 100644 index 0000000..c142e00 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/fractional-sized-scrolling-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png new file mode 100644 index 0000000..f8cb965 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scroll-expected.png b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scroll-expected.png new file mode 100644 index 0000000..cfeca0a --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/remove-overflow-crash2-expected.png b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/remove-overflow-crash2-expected.png new file mode 100644 index 0000000..3da5ea8 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/remove-overflow-crash2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-ancestor-update-expected.png b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-ancestor-update-expected.png new file mode 100644 index 0000000..a44f15d --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-ancestor-update-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrollbar-painting-expected.png b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrollbar-painting-expected.png new file mode 100644 index 0000000..1f7dc01d --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrollbar-painting-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrollbars-with-clipped-owner-expected.png b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrollbars-with-clipped-owner-expected.png new file mode 100644 index 0000000..0966d74 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scrollbars-with-clipped-owner-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-expected.png b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-expected.png new file mode 100644 index 0000000..dfffb5c --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-parents-expected.png b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-parents-expected.png new file mode 100644 index 0000000..93cd653 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-parents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-self-expected.png b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-self-expected.png new file mode 100644 index 0000000..9493d6a --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-self-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/direct-image-compositing-expected.png b/third_party/blink/web_tests/platform/win/compositing/direct-image-compositing-expected.png index c6e23ba..2116e33 100644 --- a/third_party/blink/web_tests/platform/win/compositing/direct-image-compositing-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/direct-image-compositing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/geometry/fixed-in-composited-expected.png b/third_party/blink/web_tests/platform/win/compositing/geometry/fixed-in-composited-expected.png index f5b1bb6..67f1e67 100644 --- a/third_party/blink/web_tests/platform/win/compositing/geometry/fixed-in-composited-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/geometry/fixed-in-composited-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/geometry/video-fixed-scrolling-expected.png b/third_party/blink/web_tests/platform/win/compositing/geometry/video-fixed-scrolling-expected.png index 9d081a6..49a7e11 100644 --- a/third_party/blink/web_tests/platform/win/compositing/geometry/video-fixed-scrolling-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/geometry/video-fixed-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.png b/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.png index 2331128f..5deea60 100644 --- a/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png b/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png index 0b626cd..d0e28572 100644 --- a/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-skew-matrix-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png b/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png index 9edac7b..d259a5b 100644 --- a/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-with-box-shadow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png b/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png index 278117a..e3de082 100644 --- a/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/gestures/gesture-tapHighlight-with-squashing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/iframes/iframe-copy-on-scroll-expected.png b/third_party/blink/web_tests/platform/win/compositing/iframes/iframe-copy-on-scroll-expected.png index f089fc5..dd71cb23 100644 --- a/third_party/blink/web_tests/platform/win/compositing/iframes/iframe-copy-on-scroll-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/iframes/iframe-copy-on-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/iframes/scroll-fixed-transformed-element-expected.png b/third_party/blink/web_tests/platform/win/compositing/iframes/scroll-fixed-transformed-element-expected.png index 946d7c8..4c091e9 100644 --- a/third_party/blink/web_tests/platform/win/compositing/iframes/scroll-fixed-transformed-element-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/iframes/scroll-fixed-transformed-element-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/iframes/scroll-grandchild-iframe-expected.png b/third_party/blink/web_tests/platform/win/compositing/iframes/scroll-grandchild-iframe-expected.png index 85238c6..3f2c373 100644 --- a/third_party/blink/web_tests/platform/win/compositing/iframes/scroll-grandchild-iframe-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/iframes/scroll-grandchild-iframe-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/img-layer-grow-expected.png b/third_party/blink/web_tests/platform/win/compositing/img-layer-grow-expected.png index 7343b211..a42b61fb 100644 --- a/third_party/blink/web_tests/platform/win/compositing/img-layer-grow-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/img-layer-grow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-and-transform-expected.png b/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-and-transform-expected.png index bc99b47..a5527dbc 100644 --- a/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-and-transform-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-and-transform-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-scroll-expected.png b/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-scroll-expected.png index d9773c3..9a0f41e 100644 --- a/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-scroll-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-under-transform-expected.png b/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-under-transform-expected.png index bc99b47..a5527dbc 100644 --- a/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-under-transform-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/layer-creation/fixed-position-under-transform-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/layers-inside-overflow-scroll-expected.png b/third_party/blink/web_tests/platform/win/compositing/layers-inside-overflow-scroll-expected.png index 2d0f26d..5d8f56d5 100644 --- a/third_party/blink/web_tests/platform/win/compositing/layers-inside-overflow-scroll-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/layers-inside-overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/layout-width-change-expected.png b/third_party/blink/web_tests/platform/win/compositing/layout-width-change-expected.png index 4fb2ffc..621bda8 100644 --- a/third_party/blink/web_tests/platform/win/compositing/layout-width-change-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/layout-width-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/masks/mask-with-added-filters-expected.png b/third_party/blink/web_tests/platform/win/compositing/masks/mask-with-added-filters-expected.png index ac55d93..866ef03e 100644 --- a/third_party/blink/web_tests/platform/win/compositing/masks/mask-with-added-filters-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/masks/mask-with-added-filters-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/masks/mask-with-removed-filters-expected.png b/third_party/blink/web_tests/platform/win/compositing/masks/mask-with-removed-filters-expected.png index 7064ec9..629ad2d 100644 --- a/third_party/blink/web_tests/platform/win/compositing/masks/mask-with-removed-filters-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/masks/mask-with-removed-filters-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/masks/masked-ancestor-expected.png b/third_party/blink/web_tests/platform/win/compositing/masks/masked-ancestor-expected.png index 26bb7b56..cae409c 100644 --- a/third_party/blink/web_tests/platform/win/compositing/masks/masked-ancestor-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/masks/masked-ancestor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/masks/multiple-masks-expected.png b/third_party/blink/web_tests/platform/win/compositing/masks/multiple-masks-expected.png index d6f7bdb9..599f99c 100644 --- a/third_party/blink/web_tests/platform/win/compositing/masks/multiple-masks-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/masks/multiple-masks-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/masks/simple-composited-mask-expected.png b/third_party/blink/web_tests/platform/win/compositing/masks/simple-composited-mask-expected.png index 321aff9..97fc1793 100644 --- a/third_party/blink/web_tests/platform/win/compositing/masks/simple-composited-mask-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/masks/simple-composited-mask-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png b/third_party/blink/web_tests/platform/win/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png index 1f9ec15..b4272dc 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/nested-border-radius-clipping-expected.png b/third_party/blink/web_tests/platform/win/compositing/overflow/nested-border-radius-clipping-expected.png index 27a585e0..7ff9f83 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/nested-border-radius-clipping-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/nested-border-radius-clipping-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/nested-render-surfaces-with-rotation-expected.png b/third_party/blink/web_tests/platform/win/compositing/overflow/nested-render-surfaces-with-rotation-expected.png index bf3c809..a1dd703 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/nested-render-surfaces-with-rotation-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/nested-render-surfaces-with-rotation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/nested-scrolling-expected.png b/third_party/blink/web_tests/platform/win/compositing/overflow/nested-scrolling-expected.png index 7807ac66..f62daf1 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/nested-scrolling-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/nested-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png b/third_party/blink/web_tests/platform/win/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png index b5e411f..99d645a 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png b/third_party/blink/web_tests/platform/win/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png index e674d7aa..eecb0e8 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/overflow-scroll-expected.png b/third_party/blink/web_tests/platform/win/compositing/overflow/overflow-scroll-expected.png index 78dcd6b1..944d3d8 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/overflow-scroll-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png b/third_party/blink/web_tests/platform/win/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png index 4f80d80f..9684896b 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/remove-overflow-crash2-expected.png b/third_party/blink/web_tests/platform/win/compositing/overflow/remove-overflow-crash2-expected.png index 5a45474..0ba70fd 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/remove-overflow-crash2-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/remove-overflow-crash2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/scroll-ancestor-update-expected.png b/third_party/blink/web_tests/platform/win/compositing/overflow/scroll-ancestor-update-expected.png index e602257..a1f22266 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/scroll-ancestor-update-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/scroll-ancestor-update-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/scrollbar-painting-expected.png b/third_party/blink/web_tests/platform/win/compositing/overflow/scrollbar-painting-expected.png index adf9e3f..2e63b082 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/scrollbar-painting-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/scrollbar-painting-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/universal-accelerated-overflow-scroll-expected.png b/third_party/blink/web_tests/platform/win/compositing/overflow/universal-accelerated-overflow-scroll-expected.png index 6659ccf..7161ab5 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/universal-accelerated-overflow-scroll-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/universal-accelerated-overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png b/third_party/blink/web_tests/platform/win/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png index 3557a59..408337ae 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overlap-blending/children-opacity-huge-expected.png b/third_party/blink/web_tests/platform/win/compositing/overlap-blending/children-opacity-huge-expected.png index a0923d0..4122c871 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overlap-blending/children-opacity-huge-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overlap-blending/children-opacity-huge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/overlap-blending/reflection-opacity-huge-expected.png b/third_party/blink/web_tests/platform/win/compositing/overlap-blending/reflection-opacity-huge-expected.png index 7db3198..84e980a8 100644 --- a/third_party/blink/web_tests/platform/win/compositing/overlap-blending/reflection-opacity-huge-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/overlap-blending/reflection-opacity-huge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/reflections/nested-reflection-on-overflow-expected.png b/third_party/blink/web_tests/platform/win/compositing/reflections/nested-reflection-on-overflow-expected.png index 0b7cda5..20d71c08 100644 --- a/third_party/blink/web_tests/platform/win/compositing/reflections/nested-reflection-on-overflow-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/reflections/nested-reflection-on-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/self-painting-layers-expected.png b/third_party/blink/web_tests/platform/win/compositing/self-painting-layers-expected.png index 5dd82d329..54d4a4a 100644 --- a/third_party/blink/web_tests/platform/win/compositing/self-painting-layers-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/self-painting-layers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/compositing/squashing/vertical-writing-mode-squashed-expected.png b/third_party/blink/web_tests/platform/win/compositing/squashing/vertical-writing-mode-squashed-expected.png index 1d9d5e9..f2a51c1 100644 --- a/third_party/blink/web_tests/platform/win/compositing/squashing/vertical-writing-mode-squashed-expected.png +++ b/third_party/blink/web_tests/platform/win/compositing/squashing/vertical-writing-mode-squashed-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/basic/comments-expected.png b/third_party/blink/web_tests/platform/win/css1/basic/comments-expected.png index b598f7c1..66c6917 100644 --- a/third_party/blink/web_tests/platform/win/css1/basic/comments-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/basic/comments-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/basic/containment-expected.png b/third_party/blink/web_tests/platform/win/css1/basic/containment-expected.png index 99c7422f..4d9baa7 100644 --- a/third_party/blink/web_tests/platform/win/css1/basic/containment-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/basic/containment-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/basic/id_as_selector-expected.png b/third_party/blink/web_tests/platform/win/css1/basic/id_as_selector-expected.png index e96d2e8..99c64d7 100644 --- a/third_party/blink/web_tests/platform/win/css1/basic/id_as_selector-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/basic/id_as_selector-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/border-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/border-expected.png index 7a30516..4fbae6d6 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/border-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/border_bottom-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/border_bottom-expected.png index 5d7f6de..c9b4fdc 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/border_bottom-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/border_bottom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/border_bottom_width-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/border_bottom_width-expected.png index 3467b38..a1c81ba9 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/border_bottom_width-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/border_bottom_width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/border_left-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/border_left-expected.png index df074fe..64c1eb7 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/border_left-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/border_left-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/border_left_width-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/border_left_width-expected.png index 5441df61..45fbeb1c 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/border_left_width-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/border_left_width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/border_right_inline-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/border_right_inline-expected.png index 3fb3d8d..e8937cdf 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/border_right_inline-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/border_right_inline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/border_right_width-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/border_right_width-expected.png index 3c6a6f83..0d36dc4b 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/border_right_width-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/border_right_width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/border_style-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/border_style-expected.png index 59336db..2e4b4d4 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/border_style-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/border_style-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/border_top-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/border_top-expected.png index 9c7a50a..dc96718 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/border_top-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/border_top-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/border_top_width-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/border_top_width-expected.png index 69e1b28..a786a3e4 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/border_top_width-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/border_top_width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/border_width-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/border_width-expected.png index 760ad6e..c01e2c76 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/border_width-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/border_width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/clear-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/clear-expected.png index f46ca30..5cd85f1 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/clear-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/clear-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/float_elements_in_series-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/float_elements_in_series-expected.png index 211d77c..cc629c7 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/float_elements_in_series-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/float_elements_in_series-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/float_margin-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/float_margin-expected.png index b14fcf09..573b6aa 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/float_margin-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/float_margin-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/float_on_text_elements-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/float_on_text_elements-expected.png index b272616..f8bd9c84 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/float_on_text_elements-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/float_on_text_elements-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/height-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/height-expected.png index f8fbbbc7..e93a2df 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/height-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/margin_bottom-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/margin_bottom-expected.png index 3611642..e932bf4 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/margin_bottom-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/margin_bottom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/margin_left-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/margin_left-expected.png index 0cb027ec..93fea93 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/margin_left-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/margin_left-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/margin_top-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/margin_top-expected.png index c832fbf..0c9ffc8 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/margin_top-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/margin_top-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/padding-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/padding-expected.png index 13f5137..bc6310e5 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/padding-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/padding-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/padding_bottom-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/padding_bottom-expected.png index 3319bbc..52e25e2f 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/padding_bottom-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/padding_bottom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/padding_inline-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/padding_inline-expected.png index c0e6551..7c2acfb 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/padding_inline-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/padding_inline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/padding_left-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/padding_left-expected.png index 0c729cfcf..19bf73ee 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/padding_left-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/padding_left-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/padding_right-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/padding_right-expected.png index 21261172..ebecf48 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/padding_right-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/padding_right-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/padding_top-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/padding_top-expected.png index 5ef6479..0f33c3a 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/padding_top-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/padding_top-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/box_properties/width-expected.png b/third_party/blink/web_tests/platform/win/css1/box_properties/width-expected.png index a57f45f9..f4fba15 100644 --- a/third_party/blink/web_tests/platform/win/css1/box_properties/width-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/box_properties/width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/cascade/cascade_order-expected.png b/third_party/blink/web_tests/platform/win/css1/cascade/cascade_order-expected.png index ce24cb0..efa207c 100644 --- a/third_party/blink/web_tests/platform/win/css1/cascade/cascade_order-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/cascade/cascade_order-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/classification/display-expected.png b/third_party/blink/web_tests/platform/win/css1/classification/display-expected.png index d9d1e35..7fab26d0 100644 --- a/third_party/blink/web_tests/platform/win/css1/classification/display-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/classification/display-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/classification/list_style_type-expected.png b/third_party/blink/web_tests/platform/win/css1/classification/list_style_type-expected.png index c3f708f..df3113e 100644 --- a/third_party/blink/web_tests/platform/win/css1/classification/list_style_type-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/classification/list_style_type-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/color_and_background/background-expected.png b/third_party/blink/web_tests/platform/win/css1/color_and_background/background-expected.png index d93bd1d..df5b487 100644 --- a/third_party/blink/web_tests/platform/win/css1/color_and_background/background-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/color_and_background/background-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/color_and_background/background_position-expected.png b/third_party/blink/web_tests/platform/win/css1/color_and_background/background_position-expected.png index 8517b18..e4e5222 100644 --- a/third_party/blink/web_tests/platform/win/css1/color_and_background/background_position-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/color_and_background/background_position-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/conformance/forward_compatible_parsing-expected.png b/third_party/blink/web_tests/platform/win/css1/conformance/forward_compatible_parsing-expected.png index 6d6b279..00abfc2 100644 --- a/third_party/blink/web_tests/platform/win/css1/conformance/forward_compatible_parsing-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/conformance/forward_compatible_parsing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/font_properties/font-expected.png b/third_party/blink/web_tests/platform/win/css1/font_properties/font-expected.png index a5f7f4d8..0b40cc29 100644 --- a/third_party/blink/web_tests/platform/win/css1/font_properties/font-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/font_properties/font-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/font_properties/font_family-expected.png b/third_party/blink/web_tests/platform/win/css1/font_properties/font_family-expected.png index f01758fa..4f0f308 100644 --- a/third_party/blink/web_tests/platform/win/css1/font_properties/font_family-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/font_properties/font_family-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/font_properties/font_size-expected.png b/third_party/blink/web_tests/platform/win/css1/font_properties/font_size-expected.png index a60d013..cd2dee2 100644 --- a/third_party/blink/web_tests/platform/win/css1/font_properties/font_size-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/font_properties/font_size-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/font_properties/font_weight-expected.png b/third_party/blink/web_tests/platform/win/css1/font_properties/font_weight-expected.png index 5e49ce2..678d216 100644 --- a/third_party/blink/web_tests/platform/win/css1/font_properties/font_weight-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/font_properties/font_weight-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/formatting_model/floating_elements-expected.png b/third_party/blink/web_tests/platform/win/css1/formatting_model/floating_elements-expected.png index 95621b7..0172a38 100644 --- a/third_party/blink/web_tests/platform/win/css1/formatting_model/floating_elements-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/formatting_model/floating_elements-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/formatting_model/height_of_lines-expected.png b/third_party/blink/web_tests/platform/win/css1/formatting_model/height_of_lines-expected.png index f5a25d7..e31a74b 100644 --- a/third_party/blink/web_tests/platform/win/css1/formatting_model/height_of_lines-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/formatting_model/height_of_lines-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/formatting_model/inline_elements-expected.png b/third_party/blink/web_tests/platform/win/css1/formatting_model/inline_elements-expected.png index 635ca62..12227ce 100644 --- a/third_party/blink/web_tests/platform/win/css1/formatting_model/inline_elements-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/formatting_model/inline_elements-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/formatting_model/replaced_elements-expected.png b/third_party/blink/web_tests/platform/win/css1/formatting_model/replaced_elements-expected.png index 8bcf0bbf..d3775eb 100644 --- a/third_party/blink/web_tests/platform/win/css1/formatting_model/replaced_elements-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/formatting_model/replaced_elements-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/formatting_model/vertical_formatting-expected.png b/third_party/blink/web_tests/platform/win/css1/formatting_model/vertical_formatting-expected.png index ff528fb..f7c2a45 100644 --- a/third_party/blink/web_tests/platform/win/css1/formatting_model/vertical_formatting-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/formatting_model/vertical_formatting-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/pseudo/anchor-expected.png b/third_party/blink/web_tests/platform/win/css1/pseudo/anchor-expected.png index c00c3ee..ef4a6030 100644 --- a/third_party/blink/web_tests/platform/win/css1/pseudo/anchor-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/pseudo/anchor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/pseudo/firstletter-expected.png b/third_party/blink/web_tests/platform/win/css1/pseudo/firstletter-expected.png index edbae50..28ed84f 100644 --- a/third_party/blink/web_tests/platform/win/css1/pseudo/firstletter-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/pseudo/firstletter-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/pseudo/firstline-expected.png b/third_party/blink/web_tests/platform/win/css1/pseudo/firstline-expected.png index c35abd4d..46dbf20 100644 --- a/third_party/blink/web_tests/platform/win/css1/pseudo/firstline-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/pseudo/firstline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/pseudo/multiple_pseudo_elements-expected.png b/third_party/blink/web_tests/platform/win/css1/pseudo/multiple_pseudo_elements-expected.png index 7f1fb448..6a440f9 100644 --- a/third_party/blink/web_tests/platform/win/css1/pseudo/multiple_pseudo_elements-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/pseudo/multiple_pseudo_elements-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/pseudo/pseudo_elements_in_selectors-expected.png b/third_party/blink/web_tests/platform/win/css1/pseudo/pseudo_elements_in_selectors-expected.png index e2a21fbd..5c59d53 100644 --- a/third_party/blink/web_tests/platform/win/css1/pseudo/pseudo_elements_in_selectors-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/pseudo/pseudo_elements_in_selectors-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/text_properties/letter_spacing-expected.png b/third_party/blink/web_tests/platform/win/css1/text_properties/letter_spacing-expected.png index ada944b..db1887b 100644 --- a/third_party/blink/web_tests/platform/win/css1/text_properties/letter_spacing-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/text_properties/letter_spacing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/text_properties/line_height-expected.png b/third_party/blink/web_tests/platform/win/css1/text_properties/line_height-expected.png index f335a47..daed9b2 100644 --- a/third_party/blink/web_tests/platform/win/css1/text_properties/line_height-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/text_properties/line_height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/text_properties/text_decoration-expected.png b/third_party/blink/web_tests/platform/win/css1/text_properties/text_decoration-expected.png index a68f8b4..191766d 100644 --- a/third_party/blink/web_tests/platform/win/css1/text_properties/text_decoration-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/text_properties/text_decoration-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/text_properties/text_indent-expected.png b/third_party/blink/web_tests/platform/win/css1/text_properties/text_indent-expected.png index 067d151..98de315 100644 --- a/third_party/blink/web_tests/platform/win/css1/text_properties/text_indent-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/text_properties/text_indent-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/text_properties/text_transform-expected.png b/third_party/blink/web_tests/platform/win/css1/text_properties/text_transform-expected.png index cc0747abc..bf32db2f 100644 --- a/third_party/blink/web_tests/platform/win/css1/text_properties/text_transform-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/text_properties/text_transform-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/text_properties/vertical_align-expected.png b/third_party/blink/web_tests/platform/win/css1/text_properties/vertical_align-expected.png index d518b21..7417522 100644 --- a/third_party/blink/web_tests/platform/win/css1/text_properties/vertical_align-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/text_properties/vertical_align-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/text_properties/word_spacing-expected.png b/third_party/blink/web_tests/platform/win/css1/text_properties/word_spacing-expected.png index fb53973..4aea345 100644 --- a/third_party/blink/web_tests/platform/win/css1/text_properties/word_spacing-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/text_properties/word_spacing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/units/color_units-expected.png b/third_party/blink/web_tests/platform/win/css1/units/color_units-expected.png index a803ed1..bd195be 100644 --- a/third_party/blink/web_tests/platform/win/css1/units/color_units-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/units/color_units-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css1/units/length_units-expected.png b/third_party/blink/web_tests/platform/win/css1/units/length_units-expected.png index 9677dc07..565708d 100644 --- a/third_party/blink/web_tests/platform/win/css1/units/length_units-expected.png +++ b/third_party/blink/web_tests/platform/win/css1/units/length_units-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css2.1/t0803-c5502-mrgn-r-02-c-expected.png b/third_party/blink/web_tests/platform/win/css2.1/t0803-c5502-mrgn-r-02-c-expected.png index a7497068..723624b 100644 --- a/third_party/blink/web_tests/platform/win/css2.1/t0803-c5502-mrgn-r-02-c-expected.png +++ b/third_party/blink/web_tests/platform/win/css2.1/t0803-c5502-mrgn-r-02-c-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css2.1/t0803-c5505-mrgn-02-c-expected.png b/third_party/blink/web_tests/platform/win/css2.1/t0803-c5505-mrgn-02-c-expected.png index 5506b976..a4947d2 100644 --- a/third_party/blink/web_tests/platform/win/css2.1/t0803-c5505-mrgn-02-c-expected.png +++ b/third_party/blink/web_tests/platform/win/css2.1/t0803-c5505-mrgn-02-c-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css2.1/t080301-c411-vt-mrgn-00-b-expected.png b/third_party/blink/web_tests/platform/win/css2.1/t080301-c411-vt-mrgn-00-b-expected.png index eb7e67dc..554c416 100644 --- a/third_party/blink/web_tests/platform/win/css2.1/t080301-c411-vt-mrgn-00-b-expected.png +++ b/third_party/blink/web_tests/platform/win/css2.1/t080301-c411-vt-mrgn-00-b-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png b/third_party/blink/web_tests/platform/win/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png index 8c9f4ec..5dc754b 100644 --- a/third_party/blink/web_tests/platform/win/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png +++ b/third_party/blink/web_tests/platform/win/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css2.1/t1002-c5523-width-02-b-g-expected.png b/third_party/blink/web_tests/platform/win/css2.1/t1002-c5523-width-02-b-g-expected.png index 5cd3f13..465053a 100644 --- a/third_party/blink/web_tests/platform/win/css2.1/t1002-c5523-width-02-b-g-expected.png +++ b/third_party/blink/web_tests/platform/win/css2.1/t1002-c5523-width-02-b-g-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css2.1/t140201-c535-bg-fixd-00-b-g-expected.png b/third_party/blink/web_tests/platform/win/css2.1/t140201-c535-bg-fixd-00-b-g-expected.png index 6e8aca6c..a2c87e5 100644 --- a/third_party/blink/web_tests/platform/win/css2.1/t140201-c535-bg-fixd-00-b-g-expected.png +++ b/third_party/blink/web_tests/platform/win/css2.1/t140201-c535-bg-fixd-00-b-g-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css2.1/t140201-c537-bgfxps-00-c-ag-expected.png b/third_party/blink/web_tests/platform/win/css2.1/t140201-c537-bgfxps-00-c-ag-expected.png index 5e89e56..49244a3 100644 --- a/third_party/blink/web_tests/platform/win/css2.1/t140201-c537-bgfxps-00-c-ag-expected.png +++ b/third_party/blink/web_tests/platform/win/css2.1/t140201-c537-bgfxps-00-c-ag-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-auto1-expected.png b/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-auto1-expected.png index a7e2b88d..47c98ee 100644 --- a/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-auto1-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-auto1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-border-expected.png b/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-border-expected.png index 02348fb5..5171b8c2 100644 --- a/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-border-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-content-expected.png b/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-content-expected.png index 67d3f14..5be518af 100644 --- a/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-content-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-padding-expected.png b/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-padding-expected.png index 861ef92..844b50b53 100644 --- a/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-padding-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/background/background-repeat-round-padding-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/filters/backdrop-filter-plus-mask-large-expected.png b/third_party/blink/web_tests/platform/win/css3/filters/backdrop-filter-plus-mask-large-expected.png index 69feb8c..9842d61 100644 --- a/third_party/blink/web_tests/platform/win/css3/filters/backdrop-filter-plus-mask-large-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/filters/backdrop-filter-plus-mask-large-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/flexbox/flexbox-baseline-expected.png b/third_party/blink/web_tests/platform/win/css3/flexbox/flexbox-baseline-expected.png index 0a0df404..ff3917f5 100644 --- a/third_party/blink/web_tests/platform/win/css3/flexbox/flexbox-baseline-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/flexbox/flexbox-baseline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/masking/mask-luminance-gradient-expected.png b/third_party/blink/web_tests/platform/win/css3/masking/mask-luminance-gradient-expected.png index 29f70ea..c685b7a 100644 --- a/third_party/blink/web_tests/platform/win/css3/masking/mask-luminance-gradient-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/masking/mask-luminance-gradient-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/masking/mask-luminance-svg-expected.png b/third_party/blink/web_tests/platform/win/css3/masking/mask-luminance-svg-expected.png index 842f4da3..eaf678a 100644 --- a/third_party/blink/web_tests/platform/win/css3/masking/mask-luminance-svg-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/masking/mask-luminance-svg-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-auto1-expected.png b/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-auto1-expected.png index bd218ef5..d0893c9 100644 --- a/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-auto1-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-auto1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-border-expected.png b/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-border-expected.png index 04e0dda..21b3bce 100644 --- a/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-border-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-content-expected.png b/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-content-expected.png index 9ab478c..986e3548 100644 --- a/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-content-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-padding-expected.png b/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-padding-expected.png index 5c24191..5d2e30d 100644 --- a/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-padding-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-round-padding-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-space-border-expected.png b/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-space-border-expected.png index 2af624b0..11004d9 100644 --- a/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-space-border-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-space-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-space-content-expected.png b/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-space-content-expected.png index 1b1ad769..acaf0232 100644 --- a/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-space-content-expected.png +++ b/third_party/blink/web_tests/platform/win/css3/masking/mask-repeat-space-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/backgrounds/background-inherit-color-bug-expected.png b/third_party/blink/web_tests/platform/win/fast/backgrounds/background-inherit-color-bug-expected.png index eab44d8..2629e71a 100644 --- a/third_party/blink/web_tests/platform/win/fast/backgrounds/background-inherit-color-bug-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/backgrounds/background-inherit-color-bug-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/backgrounds/background-leakage-transforms-expected.png b/third_party/blink/web_tests/platform/win/fast/backgrounds/background-leakage-transforms-expected.png index 5b1cc32..c9d9b41 100644 --- a/third_party/blink/web_tests/platform/win/fast/backgrounds/background-leakage-transforms-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/backgrounds/background-leakage-transforms-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/basic/016-expected.png b/third_party/blink/web_tests/platform/win/fast/block/basic/016-expected.png index 3c255ac..d755dbf64 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/basic/016-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/basic/016-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/basic/fieldset-stretch-to-legend-expected.png b/third_party/blink/web_tests/platform/win/fast/block/basic/fieldset-stretch-to-legend-expected.png index d8a439c3..fb10fe5 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/basic/fieldset-stretch-to-legend-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/basic/fieldset-stretch-to-legend-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/008-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/008-expected.png index cd49c57..3b46072 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/008-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/008-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/021-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/021-expected.png index 34b7d16..12ebf29fc 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/021-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/021-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/025-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/025-expected.png index a4f129c9..d1f2567 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/025-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/025-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/026-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/026-expected.png index 3083d43e..21b7f0c7 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/026-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/026-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/027-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/027-expected.png index a4f129c9..d1f2567 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/027-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/027-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/028-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/028-expected.png index 3083d43e..21b7f0c7 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/028-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/028-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/032-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/032-expected.png index 05028a4..fa3ddb5 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/032-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/032-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/033-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/033-expected.png index 5a162766..7d2f47e 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/033-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/033-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/035-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/035-expected.png index 52ff50a..6fe5219 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/035-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/035-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/br-with-clear-2-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/br-with-clear-2-expected.png index 812fe50..d0e8f55 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/br-with-clear-2-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/br-with-clear-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/centered-float-avoidance-complexity-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/centered-float-avoidance-complexity-expected.png index 521e1cb..eb77d1f9 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/centered-float-avoidance-complexity-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/centered-float-avoidance-complexity-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/float-avoidance-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/float-avoidance-expected.png index f88f8e2..cc01841 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/float-avoidance-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/float-avoidance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/nested-clearance-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/nested-clearance-expected.png index f2e97ae..38803fa 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/nested-clearance-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/nested-clearance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/relative-painted-twice-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/relative-painted-twice-expected.png index bcff0dc..5eab829 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/relative-painted-twice-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/relative-painted-twice-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/float/shrink-to-avoid-float-complexity-expected.png b/third_party/blink/web_tests/platform/win/fast/block/float/shrink-to-avoid-float-complexity-expected.png index ba4949af..25b8665 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/float/shrink-to-avoid-float-complexity-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/float/shrink-to-avoid-float-complexity-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/margin-collapse/103-expected.png b/third_party/blink/web_tests/platform/win/fast/block/margin-collapse/103-expected.png index 189a6f8a..1b33dc75 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/margin-collapse/103-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/margin-collapse/103-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/margin-collapse/104-expected.png b/third_party/blink/web_tests/platform/win/fast/block/margin-collapse/104-expected.png index e8607d49..32467db 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/margin-collapse/104-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/margin-collapse/104-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/margin-collapse/empty-clear-blocks-expected.png b/third_party/blink/web_tests/platform/win/fast/block/margin-collapse/empty-clear-blocks-expected.png index 7bd480e..3affd5b 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/margin-collapse/empty-clear-blocks-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/margin-collapse/empty-clear-blocks-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/positioning/047-expected.png b/third_party/blink/web_tests/platform/win/fast/block/positioning/047-expected.png index 2904790f..56326d6 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/positioning/047-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/positioning/047-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/positioning/051-expected.png b/third_party/blink/web_tests/platform/win/fast/block/positioning/051-expected.png index 87645f2..cb77917c 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/positioning/051-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/positioning/051-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/positioning/055-expected.png b/third_party/blink/web_tests/platform/win/fast/block/positioning/055-expected.png index 6e3873f..cb3db43 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/positioning/055-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/positioning/055-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/positioning/auto/007-expected.png b/third_party/blink/web_tests/platform/win/fast/block/positioning/auto/007-expected.png index b078c4c..6453124 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/positioning/auto/007-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/positioning/auto/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/positioning/auto/vertical-lr/005-expected.png b/third_party/blink/web_tests/platform/win/fast/block/positioning/auto/vertical-lr/005-expected.png index cc70f86d..242f3e5 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/positioning/auto/vertical-lr/005-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/positioning/auto/vertical-lr/005-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/positioning/auto/vertical-rl/005-expected.png b/third_party/blink/web_tests/platform/win/fast/block/positioning/auto/vertical-rl/005-expected.png index 6375a6b..d4adaff5 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/positioning/auto/vertical-rl/005-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/positioning/auto/vertical-rl/005-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.png b/third_party/blink/web_tests/platform/win/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.png index a44531d2..9ed1ed23 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/positioning/relative-overflow-block-expected.png b/third_party/blink/web_tests/platform/win/fast/block/positioning/relative-overflow-block-expected.png index dc4edfd..64adee1 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/positioning/relative-overflow-block-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/positioning/relative-overflow-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/positioning/relative-overflow-replaced-expected.png b/third_party/blink/web_tests/platform/win/fast/block/positioning/relative-overflow-replaced-expected.png index 91b57392..6bd7801 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/positioning/relative-overflow-replaced-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/positioning/relative-overflow-replaced-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/positioning/relative-overflow-replaced-float-expected.png b/third_party/blink/web_tests/platform/win/fast/block/positioning/relative-overflow-replaced-float-expected.png index 04bfb9e..3a7d6134 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/positioning/relative-overflow-replaced-float-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/positioning/relative-overflow-replaced-float-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/positioning/vertical-lr/002-expected.png b/third_party/blink/web_tests/platform/win/fast/block/positioning/vertical-lr/002-expected.png index 4aa94af..a5e2a99 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/positioning/vertical-lr/002-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/positioning/vertical-lr/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/block/positioning/vertical-rl/002-expected.png b/third_party/blink/web_tests/platform/win/fast/block/positioning/vertical-rl/002-expected.png index 24e82b0..956c01a 100644 --- a/third_party/blink/web_tests/platform/win/fast/block/positioning/vertical-rl/002-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/block/positioning/vertical-rl/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/002-expected.png b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/002-expected.png index f8c54f0..e601bf1 100644 --- a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/002-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/002-xhtml-expected.png b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/002-xhtml-expected.png index f8c54f0..e601bf1 100644 --- a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/002-xhtml-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/002-xhtml-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/003-declarative-expected.png b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/003-declarative-expected.png index f8c54f0..e601bf1 100644 --- a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/003-declarative-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/003-declarative-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/003-expected.png b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/003-expected.png index f8c54f0..e601bf1 100644 --- a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/003-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/003-xhtml-expected.png b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/003-xhtml-expected.png index f8c54f0..e601bf1 100644 --- a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/003-xhtml-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/003-xhtml-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/004-declarative-expected.png b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/004-declarative-expected.png index d08ffee1..bb3b93e 100644 --- a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/004-declarative-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/004-declarative-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/004-expected.png b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/004-expected.png index d08ffee1..bb3b93e 100644 --- a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/004-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/004-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/004-xhtml-expected.png b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/004-xhtml-expected.png index d08ffee1..bb3b93e 100644 --- a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/004-xhtml-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/004-xhtml-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/007-declarative-expected.png b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/007-declarative-expected.png index f8c54f0..e601bf1 100644 --- a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/007-declarative-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/007-declarative-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/007-expected.png b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/007-expected.png index f8c54f0..e601bf1 100644 --- a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/007-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/007-xhtml-expected.png b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/007-xhtml-expected.png index f8c54f0..e601bf1 100644 --- a/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/007-xhtml-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/body-propagation/overflow/007-xhtml-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/borders/inline-mask-overlay-image-expected.png b/third_party/blink/web_tests/platform/win/fast/borders/inline-mask-overlay-image-expected.png index b00ab52..205f365 100644 --- a/third_party/blink/web_tests/platform/win/fast/borders/inline-mask-overlay-image-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/borders/inline-mask-overlay-image-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/borders/rtl-border-01-expected.png b/third_party/blink/web_tests/platform/win/fast/borders/rtl-border-01-expected.png index b0060b53..ea54882c 100644 --- a/third_party/blink/web_tests/platform/win/fast/borders/rtl-border-01-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/borders/rtl-border-01-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/borders/rtl-border-02-expected.png b/third_party/blink/web_tests/platform/win/fast/borders/rtl-border-02-expected.png index 5914d18..da557b5 100644 --- a/third_party/blink/web_tests/platform/win/fast/borders/rtl-border-02-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/borders/rtl-border-02-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/borders/rtl-border-03-expected.png b/third_party/blink/web_tests/platform/win/fast/borders/rtl-border-03-expected.png index 63da09d..0572187 100644 --- a/third_party/blink/web_tests/platform/win/fast/borders/rtl-border-03-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/borders/rtl-border-03-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/box-shadow/basic-shadows-expected.png b/third_party/blink/web_tests/platform/win/fast/box-shadow/basic-shadows-expected.png index ab76695..4012d021 100644 --- a/third_party/blink/web_tests/platform/win/fast/box-shadow/basic-shadows-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/box-shadow/basic-shadows-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/box-sizing/box-sizing-expected.png b/third_party/blink/web_tests/platform/win/fast/box-sizing/box-sizing-expected.png index a1823a3..014940f 100644 --- a/third_party/blink/web_tests/platform/win/fast/box-sizing/box-sizing-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/box-sizing/box-sizing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/canvas/canvas-composite-video-expected.png b/third_party/blink/web_tests/platform/win/fast/canvas/canvas-composite-video-expected.png index 38e6d6d..282ff9f 100644 --- a/third_party/blink/web_tests/platform/win/fast/canvas/canvas-composite-video-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/canvas/canvas-composite-video-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/blink/web_tests/platform/win/fast/canvas/canvas-composite-video-shadow-expected.png index 595a3f0..4b6a1c4 100644 --- a/third_party/blink/web_tests/platform/win/fast/canvas/canvas-composite-video-shadow-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/canvas/canvas-composite-video-shadow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/clip/014-expected.png b/third_party/blink/web_tests/platform/win/fast/clip/014-expected.png index 8e9e7db9..edea9147 100644 --- a/third_party/blink/web_tests/platform/win/fast/clip/014-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/clip/014-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css-generated-content/014-expected.png b/third_party/blink/web_tests/platform/win/fast/css-generated-content/014-expected.png index bf833bf..92608a71 100644 --- a/third_party/blink/web_tests/platform/win/fast/css-generated-content/014-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css-generated-content/014-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css-generated-content/table-parts-before-and-after-expected.png b/third_party/blink/web_tests/platform/win/fast/css-generated-content/table-parts-before-and-after-expected.png index 38fc0bc..535920a 100644 --- a/third_party/blink/web_tests/platform/win/fast/css-generated-content/table-parts-before-and-after-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css-generated-content/table-parts-before-and-after-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/bidi-override-in-anonymous-block-expected.png b/third_party/blink/web_tests/platform/win/fast/css/bidi-override-in-anonymous-block-expected.png index c2c9f28..f15f9b80 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/bidi-override-in-anonymous-block-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/bidi-override-in-anonymous-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/border-height-expected.png b/third_party/blink/web_tests/platform/win/fast/css/border-height-expected.png index a16187a..1b5ad3f6 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/border-height-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/border-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/color-correction-backgrounds-and-text-expected.png b/third_party/blink/web_tests/platform/win/fast/css/color-correction-backgrounds-and-text-expected.png index 2b4079e..c740f9a6 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/color-correction-backgrounds-and-text-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/color-correction-backgrounds-and-text-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/color-correction-on-background-image-expected.png b/third_party/blink/web_tests/platform/win/fast/css/color-correction-on-background-image-expected.png index 68bc7fc..739a38b 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/color-correction-on-background-image-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/color-correction-on-background-image-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/first-child-pseudo-class-expected.png b/third_party/blink/web_tests/platform/win/fast/css/first-child-pseudo-class-expected.png index 0e20754c..b8337ac 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/first-child-pseudo-class-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/first-child-pseudo-class-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/first-of-type-pseudo-class-expected.png b/third_party/blink/web_tests/platform/win/fast/css/first-of-type-pseudo-class-expected.png index c55592c..f76b0379 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/first-of-type-pseudo-class-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/first-of-type-pseudo-class-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/hsl-color-expected.png b/third_party/blink/web_tests/platform/win/fast/css/hsl-color-expected.png index 68795e3..e954e648 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/hsl-color-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/hsl-color-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/last-child-pseudo-class-expected.png b/third_party/blink/web_tests/platform/win/fast/css/last-child-pseudo-class-expected.png index 132a30c3..e0f3c9e 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/last-child-pseudo-class-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/last-child-pseudo-class-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/last-of-type-pseudo-class-expected.png b/third_party/blink/web_tests/platform/win/fast/css/last-of-type-pseudo-class-expected.png index 9316b006..ae0d4b7 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/last-of-type-pseudo-class-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/last-of-type-pseudo-class-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/line-height-overflow-expected.png b/third_party/blink/web_tests/platform/win/fast/css/line-height-overflow-expected.png index 0dc7027..80a5d094 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/line-height-overflow-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/line-height-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/only-child-pseudo-class-expected.png b/third_party/blink/web_tests/platform/win/fast/css/only-child-pseudo-class-expected.png index a148a260..4b8719d 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/only-child-pseudo-class-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/only-child-pseudo-class-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/only-of-type-pseudo-class-expected.png b/third_party/blink/web_tests/platform/win/fast/css/only-of-type-pseudo-class-expected.png index 98cadd2..e6598a9 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/only-of-type-pseudo-class-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/only-of-type-pseudo-class-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.png b/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.png index c0ed3f6..e1391f6e 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-justify-expected.png b/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-justify-expected.png index c9cc628d..cac14821 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-justify-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-justify-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-left-expected.png b/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-left-expected.png index 677148f..52844aeb 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-left-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-left-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.png b/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.png index b96b5141..704a281 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png b/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png index 1ed9359..8988a17 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-justify-expected.png b/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-justify-expected.png index 1ed9359..8988a17 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-justify-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-justify-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.png b/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.png index 1ed9359..8988a17 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png b/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png index 1ed9359..8988a17 100644 --- a/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-expected.png b/third_party/blink/web_tests/platform/win/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-expected.png index 9d41a09..ceaed92 100644 --- a/third_party/blink/web_tests/platform/win/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/deprecated-flexbox/009-expected.png b/third_party/blink/web_tests/platform/win/fast/deprecated-flexbox/009-expected.png index 89b4adc1..6fa7570 100644 --- a/third_party/blink/web_tests/platform/win/fast/deprecated-flexbox/009-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/deprecated-flexbox/009-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/deprecated-flexbox/009-horizontal-expected.png b/third_party/blink/web_tests/platform/win/fast/deprecated-flexbox/009-horizontal-expected.png index 16f904c..9791516 100644 --- a/third_party/blink/web_tests/platform/win/fast/deprecated-flexbox/009-horizontal-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/deprecated-flexbox/009-horizontal-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/dom/34176-expected.png b/third_party/blink/web_tests/platform/win/fast/dom/34176-expected.png index 90477c35..403603c 100644 --- a/third_party/blink/web_tests/platform/win/fast/dom/34176-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/dom/34176-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/dom/52776-expected.png b/third_party/blink/web_tests/platform/win/fast/dom/52776-expected.png index 6b6f166..745540df 100644 --- a/third_party/blink/web_tests/platform/win/fast/dom/52776-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/dom/52776-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/dom/rtl-scroll-to-leftmost-and-resize-expected.png b/third_party/blink/web_tests/platform/win/fast/dom/rtl-scroll-to-leftmost-and-resize-expected.png index b28a5573..ac2a91f 100644 --- a/third_party/blink/web_tests/platform/win/fast/dom/rtl-scroll-to-leftmost-and-resize-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/dom/rtl-scroll-to-leftmost-and-resize-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/events/reveal-link-when-focused-expected.png b/third_party/blink/web_tests/platform/win/fast/events/reveal-link-when-focused-expected.png index 3bb5511..8a3696f 100644 --- a/third_party/blink/web_tests/platform/win/fast/events/reveal-link-when-focused-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/events/reveal-link-when-focused-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/button-default-title-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/button-default-title-expected.png index dfe29dd..daca0c3 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/button-default-title-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/button-default-title-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/color/color-suggestion-picker-with-scrollbar-appearance-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/color/color-suggestion-picker-with-scrollbar-appearance-expected.png index c144e4a0..4d63ccb 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/color/color-suggestion-picker-with-scrollbar-appearance-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/color/color-suggestion-picker-with-scrollbar-appearance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/control-clip-overflow-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/control-clip-overflow-expected.png index dc76caf..8d6817fa 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/control-clip-overflow-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/control-clip-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/controls-new-ui/color/color-suggestion-picker-appearance-with-scrollbar-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/controls-new-ui/color/color-suggestion-picker-appearance-with-scrollbar-expected.png index c144e4a0..4d63ccb 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/controls-new-ui/color/color-suggestion-picker-appearance-with-scrollbar-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/controls-new-ui/color/color-suggestion-picker-appearance-with-scrollbar-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png new file mode 100644 index 0000000..a4393c3 --- /dev/null +++ b/third_party/blink/web_tests/platform/win/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png index ba932fa..0a6ca0d5 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/fieldset/fieldset-align-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/fieldset/fieldset-align-expected.png index 27d841d..5b30881a 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/fieldset/fieldset-align-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/fieldset/fieldset-align-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/form-element-geometry-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/form-element-geometry-expected.png index 5211331d..ee239e6 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/form-element-geometry-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/form-element-geometry-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/huge-mac-input-clamped-height-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/huge-mac-input-clamped-height-expected.png index 876603f..3ab014c 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/huge-mac-input-clamped-height-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/huge-mac-input-clamped-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/huge-mac-input-clamped-width-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/huge-mac-input-clamped-width-expected.png index 374b4e3..a177963 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/huge-mac-input-clamped-width-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/huge-mac-input-clamped-width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/select-popup/popup-menu-appearance-long-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/select-popup/popup-menu-appearance-long-expected.png index 6960a30b7..e96dfcd 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/select-popup/popup-menu-appearance-long-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/select-popup/popup-menu-appearance-long-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/select-popup/popup-menu-appearance-rtl-default-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/select-popup/popup-menu-appearance-rtl-default-expected.png index f31395b..b740d46 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/select-popup/popup-menu-appearance-rtl-default-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/select-popup/popup-menu-appearance-rtl-default-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/select-popup/popup-menu-appearance-rtl-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/select-popup/popup-menu-appearance-rtl-expected.png index 7543f25c..388d1981 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/select-popup/popup-menu-appearance-rtl-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/select-popup/popup-menu-appearance-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/select/listbox-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/select/listbox-appearance-basic-expected.png index be22a0f..63df4f1c 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/select/listbox-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/select/listbox-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/select/listbox-clip-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/select/listbox-clip-expected.png index b1b0e29..657156d4 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/select/listbox-clip-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/select/listbox-clip-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/select/listbox-scrollbar-incremental-load-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/select/listbox-scrollbar-incremental-load-expected.png index a929b83a3..ea44e78 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/select/listbox-scrollbar-incremental-load-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/select/listbox-scrollbar-incremental-load-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/select/menulist-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/select/menulist-appearance-basic-expected.png index 29fb86c..6d4e8c06 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/select/menulist-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/select/menulist-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/select/select-item-background-clip-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/select/select-item-background-clip-expected.png index d46cc39..b5ae3cb 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/select/select-item-background-clip-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/select/select-item-background-clip-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/select/select-overflow-scroll-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/select/select-overflow-scroll-expected.png index ff0f20f5..6090fa8 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/select/select-overflow-scroll-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/select/select-overflow-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/select/select-overflow-scroll-inherited-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/select/select-overflow-scroll-inherited-expected.png index 5ade25a..4553560e 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/select/select-overflow-scroll-inherited-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/select/select-overflow-scroll-inherited-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/date-suggestion-picker-appearance-rtl-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/date-suggestion-picker-appearance-rtl-expected.png index 778fc4a5..8d4e05cf 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/date-suggestion-picker-appearance-rtl-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/date-suggestion-picker-appearance-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar-expected.png index db5becf..96e1f485 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl-expected.png index baefd39..6c71e8b 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/time-suggestion-picker-appearance-with-scroll-bar-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/time-suggestion-picker-appearance-with-scroll-bar-expected.png index b26438d5..005c9bba 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/time-suggestion-picker-appearance-with-scroll-bar-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/time-suggestion-picker-appearance-with-scroll-bar-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/week-suggestion-picker-appearance-rtl-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/week-suggestion-picker-appearance-rtl-expected.png index f656637..7824a7c 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/week-suggestion-picker-appearance-rtl-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/suggestion-picker/week-suggestion-picker-appearance-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/text/input-appearance-selection-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/text/input-appearance-selection-expected.png index 77e5b5b9..a78e200 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/text/input-appearance-selection-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/text/input-appearance-selection-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/text/input-table-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/text/input-table-expected.png index 9975da38..c5481b9 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/text/input-table-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/text/input-table-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/textarea/basic-textareas-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/textarea/basic-textareas-expected.png index 8c231975..c041028 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/textarea/basic-textareas-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/textarea/basic-textareas-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/textarea/basic-textareas-quirks-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/textarea/basic-textareas-quirks-expected.png index fb36fa8..e4ecaa7 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/textarea/basic-textareas-quirks-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/textarea/basic-textareas-quirks-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/textarea/textAreaLineHeight-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/textarea/textAreaLineHeight-expected.png index 782aea0..5341b877 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/textarea/textAreaLineHeight-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/textarea/textAreaLineHeight-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scroll-height-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scroll-height-expected.png index e99ced4..a223e3c6a 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scroll-height-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scroll-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scrollbar-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scrollbar-expected.png index ea57da9..bdf8e4f 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scrollbar-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scrollbar-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scrolled-focus-ring-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scrolled-focus-ring-expected.png index ac4af11..7f42831 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scrolled-focus-ring-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scrolled-focus-ring-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scrolled-type-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scrolled-type-expected.png index 68cfa4d..b0d5e7c 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scrolled-type-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/textarea/textarea-scrolled-type-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/frames/frame-scrolling-attribute-expected.png b/third_party/blink/web_tests/platform/win/fast/frames/frame-scrolling-attribute-expected.png index ae8a65a2..50a67d5 100644 --- a/third_party/blink/web_tests/platform/win/fast/frames/frame-scrolling-attribute-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/frames/frame-scrolling-attribute-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/frames/iframe-scaling-with-scroll-expected.png b/third_party/blink/web_tests/platform/win/fast/frames/iframe-scaling-with-scroll-expected.png index 81fb38a..3970207 100644 --- a/third_party/blink/web_tests/platform/win/fast/frames/iframe-scaling-with-scroll-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/frames/iframe-scaling-with-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/frames/iframe-scrolling-attribute-expected.png b/third_party/blink/web_tests/platform/win/fast/frames/iframe-scrolling-attribute-expected.png index 0c02db55..2c897e4 100644 --- a/third_party/blink/web_tests/platform/win/fast/frames/iframe-scrolling-attribute-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/frames/iframe-scrolling-attribute-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/frames/invalid-expected.png b/third_party/blink/web_tests/platform/win/fast/frames/invalid-expected.png index 3c34b4a..8264aff2 100644 --- a/third_party/blink/web_tests/platform/win/fast/frames/invalid-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/frames/invalid-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/frames/onlyCommentInIFrame-expected.png b/third_party/blink/web_tests/platform/win/fast/frames/onlyCommentInIFrame-expected.png index 994e6ac..c203458d 100644 --- a/third_party/blink/web_tests/platform/win/fast/frames/onlyCommentInIFrame-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/frames/onlyCommentInIFrame-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/frames/valid-expected.png b/third_party/blink/web_tests/platform/win/fast/frames/valid-expected.png index 3c34b4a..8264aff2 100644 --- a/third_party/blink/web_tests/platform/win/fast/frames/valid-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/frames/valid-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/gradients/css3-color-stop-units-expected.png b/third_party/blink/web_tests/platform/win/fast/gradients/css3-color-stop-units-expected.png index 41679cd3..76e6e86e 100644 --- a/third_party/blink/web_tests/platform/win/fast/gradients/css3-color-stop-units-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/gradients/css3-color-stop-units-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/hidpi/scrollbar-appearance-decrease-device-scale-factor-expected.png b/third_party/blink/web_tests/platform/win/fast/hidpi/scrollbar-appearance-decrease-device-scale-factor-expected.png index eb1b93b..897afd7 100644 --- a/third_party/blink/web_tests/platform/win/fast/hidpi/scrollbar-appearance-decrease-device-scale-factor-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/hidpi/scrollbar-appearance-decrease-device-scale-factor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/hidpi/scrollbar-appearance-increase-device-scale-factor-expected.png b/third_party/blink/web_tests/platform/win/fast/hidpi/scrollbar-appearance-increase-device-scale-factor-expected.png index 905cb127..9e354f3 100644 --- a/third_party/blink/web_tests/platform/win/fast/hidpi/scrollbar-appearance-increase-device-scale-factor-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/hidpi/scrollbar-appearance-increase-device-scale-factor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/inline-block/tricky-baseline-expected.png b/third_party/blink/web_tests/platform/win/fast/inline-block/tricky-baseline-expected.png index a2f6671..cf3e57c1 100644 --- a/third_party/blink/web_tests/platform/win/fast/inline-block/tricky-baseline-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/inline-block/tricky-baseline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/inline/inline-borders-with-bidi-override-expected.png b/third_party/blink/web_tests/platform/win/fast/inline/inline-borders-with-bidi-override-expected.png index 59c326b..9abe2267 100644 --- a/third_party/blink/web_tests/platform/win/fast/inline/inline-borders-with-bidi-override-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/inline/inline-borders-with-bidi-override-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/inline/inline-continuation-borders-expected.png b/third_party/blink/web_tests/platform/win/fast/inline/inline-continuation-borders-expected.png index 35716af..01f5b9bc 100644 --- a/third_party/blink/web_tests/platform/win/fast/inline/inline-continuation-borders-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/inline/inline-continuation-borders-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/layers/overflow-scroll-auto-switch-expected.png b/third_party/blink/web_tests/platform/win/fast/layers/overflow-scroll-auto-switch-expected.png index 8f89dce..7624ff7 100644 --- a/third_party/blink/web_tests/platform/win/fast/layers/overflow-scroll-auto-switch-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/layers/overflow-scroll-auto-switch-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/layers/scroll-rect-to-visible-expected.png b/third_party/blink/web_tests/platform/win/fast/layers/scroll-rect-to-visible-expected.png index cdd03b5..0420e20 100644 --- a/third_party/blink/web_tests/platform/win/fast/layers/scroll-rect-to-visible-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/layers/scroll-rect-to-visible-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/layers/scroll-with-transform-composited-layer-expected.png b/third_party/blink/web_tests/platform/win/fast/layers/scroll-with-transform-composited-layer-expected.png index 209d13b..ef720ee 100644 --- a/third_party/blink/web_tests/platform/win/fast/layers/scroll-with-transform-composited-layer-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/layers/scroll-with-transform-composited-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/layers/scroll-with-transform-layer-expected.png b/third_party/blink/web_tests/platform/win/fast/layers/scroll-with-transform-layer-expected.png index 209d13b..ef720ee 100644 --- a/third_party/blink/web_tests/platform/win/fast/layers/scroll-with-transform-layer-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/layers/scroll-with-transform-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/lists/008-expected.png b/third_party/blink/web_tests/platform/win/fast/lists/008-expected.png index fed5bdec..8ef3d40 100644 --- a/third_party/blink/web_tests/platform/win/fast/lists/008-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/lists/008-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/lists/ol-start-parsing-expected.png b/third_party/blink/web_tests/platform/win/fast/lists/ol-start-parsing-expected.png index 7c9edf98..a3ed0aed 100644 --- a/third_party/blink/web_tests/platform/win/fast/lists/ol-start-parsing-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/lists/ol-start-parsing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/lists/olstart-expected.png b/third_party/blink/web_tests/platform/win/fast/lists/olstart-expected.png index 161cee0..62344c0 100644 --- a/third_party/blink/web_tests/platform/win/fast/lists/olstart-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/lists/olstart-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/002-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/002-expected.png index 5c49292..a66f7fd 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/002-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/003-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/003-expected.png index fc06cf6..0a9b744 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/003-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/005-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/005-expected.png index 5825c3f..d78662a 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/005-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/005-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/006-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/006-expected.png index 8411e6969..fcee86f 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/006-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/006-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/007-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/007-expected.png index 26803c1a..58f301d 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/007-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/childFocusRingClip-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/childFocusRingClip-expected.png index c5ccd8f..833577b 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/childFocusRingClip-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/childFocusRingClip-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/float-in-relpositioned-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/float-in-relpositioned-expected.png index 1a81d68..742ceed 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/float-in-relpositioned-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/float-in-relpositioned-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-auto-position-absolute-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-auto-position-absolute-expected.png index 4c60a62..c113fb2 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-auto-position-absolute-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-auto-position-absolute-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-float-stacking-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-float-stacking-expected.png index d5a39889..31ac325 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-float-stacking-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-float-stacking-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-rtl-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-rtl-expected.png index 5e162d0a..7ef0f38e 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-rtl-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-rtl-vertical-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-rtl-vertical-expected.png index 6ddbc8b..5da8bc96 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-rtl-vertical-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-rtl-vertical-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-stacking-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-stacking-expected.png index 6663a0c..afc1cad6 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-stacking-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-stacking-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-text-hit-testing-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-text-hit-testing-expected.png index aa336932..44ebd0e 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-text-hit-testing-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-text-hit-testing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-update-transform-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-update-transform-expected.png index dd92256..7620000 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-update-transform-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-update-transform-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-with-local-background-attachment-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-with-local-background-attachment-expected.png index fd7e5234..2830a56 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-with-local-background-attachment-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-with-local-background-attachment-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-x-y-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-x-y-expected.png index 82f4f19..2e8d2a9 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/overflow-x-y-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/overflow-x-y-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.png index b944ec9..4ab2e37 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/table-overflow-float-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/table-overflow-float-expected.png index 1392d351..dcf5526c 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/table-overflow-float-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/table-overflow-float-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/overflow/unreachable-overflow-rtl-bug-expected.png b/third_party/blink/web_tests/platform/win/fast/overflow/unreachable-overflow-rtl-bug-expected.png index 0114783..e7212246e 100644 --- a/third_party/blink/web_tests/platform/win/fast/overflow/unreachable-overflow-rtl-bug-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/overflow/unreachable-overflow-rtl-bug-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/parser/open-comment-in-textarea-expected.png b/third_party/blink/web_tests/platform/win/fast/parser/open-comment-in-textarea-expected.png index 4f552b17..9249670 100644 --- a/third_party/blink/web_tests/platform/win/fast/parser/open-comment-in-textarea-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/parser/open-comment-in-textarea-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/replaced/border-radius-clip-expected.png b/third_party/blink/web_tests/platform/win/fast/replaced/border-radius-clip-expected.png index 517e299e..fc91ec5 100644 --- a/third_party/blink/web_tests/platform/win/fast/replaced/border-radius-clip-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/replaced/border-radius-clip-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/selectors/166-expected.png b/third_party/blink/web_tests/platform/win/fast/selectors/166-expected.png index 91a4f426..84b2255b 100644 --- a/third_party/blink/web_tests/platform/win/fast/selectors/166-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/selectors/166-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png b/third_party/blink/web_tests/platform/win/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png index bb7f304..5fa752fb 100644 --- a/third_party/blink/web_tests/platform/win/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png b/third_party/blink/web_tests/platform/win/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png index ea71d005..7aee1fb7 100644 --- a/third_party/blink/web_tests/platform/win/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/023-expected.png b/third_party/blink/web_tests/platform/win/fast/table/023-expected.png index f6d55b8..0f9b994 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/023-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/023-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/027-vertical-expected.png b/third_party/blink/web_tests/platform/win/fast/table/027-vertical-expected.png index b8f11af..a1ac60d 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/027-vertical-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/027-vertical-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/040-expected.png b/third_party/blink/web_tests/platform/win/fast/table/040-expected.png index 8795eb0..219037d 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/040-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/040-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/040-vertical-expected.png b/third_party/blink/web_tests/platform/win/fast/table/040-vertical-expected.png index 8e7c2f4c..6b69c7c2 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/040-vertical-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/040-vertical-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-cell-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-cell-collapsed-border-expected.png index 7c0ad94..05cc2de 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-cell-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-cell-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-cell-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-cell-expected.png index c3205e1..717be35 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-cell-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-cell-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-collapsed-border-expected.png index 33a0c6d5..9d483a3e8 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-expected.png index ee9016e..2a042d13 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-group-collapsed-border-expected.png index 2cb4b512..2562057 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-group-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-group-expected.png index f441839..6d6c8c4d 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-group-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-column-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-expected.png index 42590a5c..fd68f30 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-quirks-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-quirks-expected.png index 89a4dfc..08d78d23 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-quirks-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-quirks-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-collapsed-border-expected.png index 39e874d..ddc2e33b 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-expected.png index 77923df..255fcba 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-group-collapsed-border-expected.png index dc7977b..1ab37030 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-group-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-group-expected.png index 5bbba04..6a3b7c97 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-group-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_border-table-row-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-hide-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-hide-collapsed-border-expected.png index bdf6b3d..9e5e009 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-hide-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-hide-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-hide-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-hide-expected.png index 9a0d402..cb709a9 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-hide-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-hide-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-show-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-show-collapsed-border-expected.png index e58c5f7..bcc270e 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-show-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-show-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-show-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-show-expected.png index 3b4e98f..6fd10e0 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-show-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_layers-show-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-cell-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-cell-collapsed-border-expected.png index baf0cb4a..fb259cea 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-cell-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-cell-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-cell-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-cell-expected.png index d928d18..894b85bc 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-cell-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-cell-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-collapsed-border-expected.png index 6bb3563..474afeb1 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-expected.png index d6bc803..385f34a 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-group-collapsed-border-expected.png index d7597274..fab63589 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-group-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-group-expected.png index 349f048..b10b4802 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-group-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-column-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-expected.png index bdeedb9..9d809c0 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-collapsed-border-expected.png index 9438f72..5ad33e560 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-expected.png index aa44dd0f..402a091d 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-group-collapsed-border-expected.png index 3edd8e6..ce9582a 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-group-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-group-expected.png index 88b244be..7b4941b 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-group-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_position-table-row-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-cell-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-cell-collapsed-border-expected.png index 01e94134..b7281db 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-cell-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-cell-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-cell-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-cell-expected.png index 9fee0d5..ee1f615 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-cell-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-cell-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-collapsed-border-expected.png index abaff72..8cbf0e0d7 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-collapsed-border-expected.png index bd6fb72..b4696e9 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-expected.png index ab23bad..f37dc27 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-group-collapsed-border-expected.png index fd26b19..2424c23 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-group-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-group-expected.png index 514d7c89..873a937b 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-group-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-column-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-expected.png index e939297..4798f5c5 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-collapsed-border-expected.png index 1ddd6b5..ff114fe5 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-expected.png index b8357b24..c6de8de 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-group-collapsed-border-expected.png index 2c4af4d..3d92040 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-group-expected.png b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-group-expected.png index e6c4e2f..1a65b616 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-group-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/backgr_simple-table-row-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/border-collapsing/004-expected.png b/third_party/blink/web_tests/platform/win/fast/table/border-collapsing/004-expected.png index ae5aa74..378ef84 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/border-collapsing/004-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/border-collapsing/004-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/edge-offsets-expected.png b/third_party/blink/web_tests/platform/win/fast/table/edge-offsets-expected.png index a47a966b..eb9b2b0 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/edge-offsets-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/edge-offsets-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/empty-cells-expected.png b/third_party/blink/web_tests/platform/win/fast/table/empty-cells-expected.png index 511bb21..e26827b1 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/empty-cells-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/empty-cells-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/frame-and-rules-expected.png b/third_party/blink/web_tests/platform/win/fast/table/frame-and-rules-expected.png index 2110ed1..996b226e 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/frame-and-rules-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/frame-and-rules-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/height-percent-test-expected.png b/third_party/blink/web_tests/platform/win/fast/table/height-percent-test-expected.png index a6c3468..30afa44 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/height-percent-test-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/height-percent-test-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/overflowHidden-expected.png b/third_party/blink/web_tests/platform/win/fast/table/overflowHidden-expected.png index c8cd027c..03e045c 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/overflowHidden-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/overflowHidden-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/prepend-in-anonymous-table-expected.png b/third_party/blink/web_tests/platform/win/fast/table/prepend-in-anonymous-table-expected.png index 8fcdd3f..015d9372 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/prepend-in-anonymous-table-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/prepend-in-anonymous-table-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/table/table-display-types-vertical-expected.png b/third_party/blink/web_tests/platform/win/fast/table/table-display-types-vertical-expected.png index 09affc20d..a81474b 100644 --- a/third_party/blink/web_tests/platform/win/fast/table/table-display-types-vertical-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/table/table-display-types-vertical-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/text-autosizing/hackernews-comments-expected.png b/third_party/blink/web_tests/platform/win/fast/text-autosizing/hackernews-comments-expected.png index 6b5c7f8..64983472 100644 --- a/third_party/blink/web_tests/platform/win/fast/text-autosizing/hackernews-comments-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/text-autosizing/hackernews-comments-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/text/capitalize-boundaries-expected.png b/third_party/blink/web_tests/platform/win/fast/text/capitalize-boundaries-expected.png index 1e205cb..b80f72a 100644 --- a/third_party/blink/web_tests/platform/win/fast/text/capitalize-boundaries-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/text/capitalize-boundaries-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/text/font-format-support-color-cff2-expected.png b/third_party/blink/web_tests/platform/win/fast/text/font-format-support-color-cff2-expected.png index fc45fd4..d79ed64f 100644 --- a/third_party/blink/web_tests/platform/win/fast/text/font-format-support-color-cff2-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/text/font-format-support-color-cff2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/text/font-weight-variant-expected.png b/third_party/blink/web_tests/platform/win/fast/text/font-weight-variant-expected.png index aaa93c0..efa99ff 100644 --- a/third_party/blink/web_tests/platform/win/fast/text/font-weight-variant-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/text/font-weight-variant-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/text/international/003-expected.png b/third_party/blink/web_tests/platform/win/fast/text/international/003-expected.png index ee61a80..16b6e46 100644 --- a/third_party/blink/web_tests/platform/win/fast/text/international/003-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/text/international/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/text/international/bidi-neutral-run-expected.png b/third_party/blink/web_tests/platform/win/fast/text/international/bidi-neutral-run-expected.png index 33ec803..a83d3f0 100644 --- a/third_party/blink/web_tests/platform/win/fast/text/international/bidi-neutral-run-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/text/international/bidi-neutral-run-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/text/letter-spacing-leading-and-trailing-expected.png b/third_party/blink/web_tests/platform/win/fast/text/letter-spacing-leading-and-trailing-expected.png index d3052667..3d1fa623 100644 --- a/third_party/blink/web_tests/platform/win/fast/text/letter-spacing-leading-and-trailing-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/text/letter-spacing-leading-and-trailing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/text/softHyphen-expected.png b/third_party/blink/web_tests/platform/win/fast/text/softHyphen-expected.png index 5349697..881fb75 100644 --- a/third_party/blink/web_tests/platform/win/fast/text/softHyphen-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/text/softHyphen-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/text/unicode-fallback-font-expected.png b/third_party/blink/web_tests/platform/win/fast/text/unicode-fallback-font-expected.png index ed12a333..cd77a9ce 100644 --- a/third_party/blink/web_tests/platform/win/fast/text/unicode-fallback-font-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/text/unicode-fallback-font-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/text/whitespace/024-expected.png b/third_party/blink/web_tests/platform/win/fast/text/whitespace/024-expected.png index f787b84..3748502 100644 --- a/third_party/blink/web_tests/platform/win/fast/text/whitespace/024-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/text/whitespace/024-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/text/word-break-expected.png b/third_party/blink/web_tests/platform/win/fast/text/word-break-expected.png index 6f1337a..6af5fb4 100644 --- a/third_party/blink/web_tests/platform/win/fast/text/word-break-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/text/word-break-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/writing-mode/border-radius-clipping-vertical-lr-expected.png b/third_party/blink/web_tests/platform/win/fast/writing-mode/border-radius-clipping-vertical-lr-expected.png index 5532c41..ba8d6da 100644 --- a/third_party/blink/web_tests/platform/win/fast/writing-mode/border-radius-clipping-vertical-lr-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/writing-mode/border-radius-clipping-vertical-lr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/writing-mode/fieldsets-expected.png b/third_party/blink/web_tests/platform/win/fast/writing-mode/fieldsets-expected.png index 86544a8c..73f2de8 100644 --- a/third_party/blink/web_tests/platform/win/fast/writing-mode/fieldsets-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/writing-mode/fieldsets-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fonts/cursive-expected.png b/third_party/blink/web_tests/platform/win/fonts/cursive-expected.png index 8537bb0db..0d2b34e2 100644 --- a/third_party/blink/web_tests/platform/win/fonts/cursive-expected.png +++ b/third_party/blink/web_tests/platform/win/fonts/cursive-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fonts/default-expected.png b/third_party/blink/web_tests/platform/win/fonts/default-expected.png index 4c686e8..b226b23 100644 --- a/third_party/blink/web_tests/platform/win/fonts/default-expected.png +++ b/third_party/blink/web_tests/platform/win/fonts/default-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fonts/fantasy-expected.png b/third_party/blink/web_tests/platform/win/fonts/fantasy-expected.png index 48ca903..d3ed76e 100644 --- a/third_party/blink/web_tests/platform/win/fonts/fantasy-expected.png +++ b/third_party/blink/web_tests/platform/win/fonts/fantasy-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fonts/monospace-expected.png b/third_party/blink/web_tests/platform/win/fonts/monospace-expected.png index 5245e89..dcb470f6 100644 --- a/third_party/blink/web_tests/platform/win/fonts/monospace-expected.png +++ b/third_party/blink/web_tests/platform/win/fonts/monospace-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fonts/sans-serif-expected.png b/third_party/blink/web_tests/platform/win/fonts/sans-serif-expected.png index d04fcd9..901bab3 100644 --- a/third_party/blink/web_tests/platform/win/fonts/sans-serif-expected.png +++ b/third_party/blink/web_tests/platform/win/fonts/sans-serif-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fonts/serif-expected.png b/third_party/blink/web_tests/platform/win/fonts/serif-expected.png index 5307af3..5a8389d3 100644 --- a/third_party/blink/web_tests/platform/win/fonts/serif-expected.png +++ b/third_party/blink/web_tests/platform/win/fonts/serif-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fragmentation/outline-crossing-columns-expected.png b/third_party/blink/web_tests/platform/win/fragmentation/outline-crossing-columns-expected.png index 9d99fba..eba9d78 100644 --- a/third_party/blink/web_tests/platform/win/fragmentation/outline-crossing-columns-expected.png +++ b/third_party/blink/web_tests/platform/win/fragmentation/outline-crossing-columns-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/http/tests/media/video-frame-size-change-expected.png b/third_party/blink/web_tests/platform/win/http/tests/media/video-frame-size-change-expected.png index 28e9abd..5f16050 100644 --- a/third_party/blink/web_tests/platform/win/http/tests/media/video-frame-size-change-expected.png +++ b/third_party/blink/web_tests/platform/win/http/tests/media/video-frame-size-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/http/tests/misc/object-embedding-svg-delayed-size-negotiation-expected.png b/third_party/blink/web_tests/platform/win/http/tests/misc/object-embedding-svg-delayed-size-negotiation-expected.png index 75570f2..e4cae18e 100644 --- a/third_party/blink/web_tests/platform/win/http/tests/misc/object-embedding-svg-delayed-size-negotiation-expected.png +++ b/third_party/blink/web_tests/platform/win/http/tests/misc/object-embedding-svg-delayed-size-negotiation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/ietestcenter/css3/bordersbackgrounds/background-size-aspect-ratio-expected.png b/third_party/blink/web_tests/platform/win/ietestcenter/css3/bordersbackgrounds/background-size-aspect-ratio-expected.png index 2f9e836..69d9315 100644 --- a/third_party/blink/web_tests/platform/win/ietestcenter/css3/bordersbackgrounds/background-size-aspect-ratio-expected.png +++ b/third_party/blink/web_tests/platform/win/ietestcenter/css3/bordersbackgrounds/background-size-aspect-ratio-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/ietestcenter/css3/bordersbackgrounds/background_position_three_four_values-expected.png b/third_party/blink/web_tests/platform/win/ietestcenter/css3/bordersbackgrounds/background_position_three_four_values-expected.png index 3126a9c..45a2afd 100644 --- a/third_party/blink/web_tests/platform/win/ietestcenter/css3/bordersbackgrounds/background_position_three_four_values-expected.png +++ b/third_party/blink/web_tests/platform/win/ietestcenter/css3/bordersbackgrounds/background_position_three_four_values-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/images/rendering-broken-0px-images-expected.png b/third_party/blink/web_tests/platform/win/images/rendering-broken-0px-images-expected.png index aa0501c..b103a95 100644 --- a/third_party/blink/web_tests/platform/win/images/rendering-broken-0px-images-expected.png +++ b/third_party/blink/web_tests/platform/win/images/rendering-broken-0px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/images/rendering-broken-0px-images-quirk-expected.png b/third_party/blink/web_tests/platform/win/images/rendering-broken-0px-images-quirk-expected.png index 114eec3..3c67b37c 100644 --- a/third_party/blink/web_tests/platform/win/images/rendering-broken-0px-images-quirk-expected.png +++ b/third_party/blink/web_tests/platform/win/images/rendering-broken-0px-images-quirk-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/images/rendering-broken-10px-images-expected.png b/third_party/blink/web_tests/platform/win/images/rendering-broken-10px-images-expected.png index d76809f..d2a31cd 100644 --- a/third_party/blink/web_tests/platform/win/images/rendering-broken-10px-images-expected.png +++ b/third_party/blink/web_tests/platform/win/images/rendering-broken-10px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/images/rendering-broken-16px-images-expected.png b/third_party/blink/web_tests/platform/win/images/rendering-broken-16px-images-expected.png index 48b59dab..43084948 100644 --- a/third_party/blink/web_tests/platform/win/images/rendering-broken-16px-images-expected.png +++ b/third_party/blink/web_tests/platform/win/images/rendering-broken-16px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/images/rendering-broken-1px-images-expected.png b/third_party/blink/web_tests/platform/win/images/rendering-broken-1px-images-expected.png index f04621a..6689b49 100644 --- a/third_party/blink/web_tests/platform/win/images/rendering-broken-1px-images-expected.png +++ b/third_party/blink/web_tests/platform/win/images/rendering-broken-1px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/images/rendering-broken-block-flow-images-expected.png b/third_party/blink/web_tests/platform/win/images/rendering-broken-block-flow-images-expected.png index 4222d57..4a05aaa 100644 --- a/third_party/blink/web_tests/platform/win/images/rendering-broken-block-flow-images-expected.png +++ b/third_party/blink/web_tests/platform/win/images/rendering-broken-block-flow-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/images/rendering-broken-images-empty-alt-expected.png b/third_party/blink/web_tests/platform/win/images/rendering-broken-images-empty-alt-expected.png index 5ebb07d1..2c50b1e 100644 --- a/third_party/blink/web_tests/platform/win/images/rendering-broken-images-empty-alt-expected.png +++ b/third_party/blink/web_tests/platform/win/images/rendering-broken-images-empty-alt-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/images/rendering-broken-images-expected.png b/third_party/blink/web_tests/platform/win/images/rendering-broken-images-expected.png index 90f1162..1ac5621 100644 --- a/third_party/blink/web_tests/platform/win/images/rendering-broken-images-expected.png +++ b/third_party/blink/web_tests/platform/win/images/rendering-broken-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/media/controls/video-overlay-cast-dark-rendering-expected.png b/third_party/blink/web_tests/platform/win/media/controls/video-overlay-cast-dark-rendering-expected.png index 33887fd..ee830488 100644 --- a/third_party/blink/web_tests/platform/win/media/controls/video-overlay-cast-dark-rendering-expected.png +++ b/third_party/blink/web_tests/platform/win/media/controls/video-overlay-cast-dark-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/media/video-controls-rendering-expected.png b/third_party/blink/web_tests/platform/win/media/video-controls-rendering-expected.png index 7bdf0327..d650d05d 100644 --- a/third_party/blink/web_tests/platform/win/media/video-controls-rendering-expected.png +++ b/third_party/blink/web_tests/platform/win/media/video-controls-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/media/video-poster-scale-expected.png b/third_party/blink/web_tests/platform/win/media/video-poster-scale-expected.png index 7607428..cc44af8 100644 --- a/third_party/blink/web_tests/platform/win/media/video-poster-scale-expected.png +++ b/third_party/blink/web_tests/platform/win/media/video-poster-scale-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/media/video-zoom-expected.png b/third_party/blink/web_tests/platform/win/media/video-zoom-expected.png index 0fe48d7..93248ae 100644 --- a/third_party/blink/web_tests/platform/win/media/video-zoom-expected.png +++ b/third_party/blink/web_tests/platform/win/media/video-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/overflow/overflow-transform-perspective-expected.png b/third_party/blink/web_tests/platform/win/overflow/overflow-transform-perspective-expected.png index 4bf4902..3a4af30 100644 --- a/third_party/blink/web_tests/platform/win/overflow/overflow-transform-perspective-expected.png +++ b/third_party/blink/web_tests/platform/win/overflow/overflow-transform-perspective-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/dark-mode/grayscale-images/desaturate-before-inversion-expected.png b/third_party/blink/web_tests/platform/win/paint/dark-mode/grayscale-images/desaturate-before-inversion-expected.png index 6a896e9..7200fd1 100644 --- a/third_party/blink/web_tests/platform/win/paint/dark-mode/grayscale-images/desaturate-before-inversion-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/dark-mode/grayscale-images/desaturate-before-inversion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/dark-mode/svg-invert-all/svg-as-image-expected.png b/third_party/blink/web_tests/platform/win/paint/dark-mode/svg-invert-all/svg-as-image-expected.png index f4665b5..cfb4781 100644 --- a/third_party/blink/web_tests/platform/win/paint/dark-mode/svg-invert-all/svg-as-image-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/dark-mode/svg-invert-all/svg-as-image-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/dark-mode/svg-invert-all/svg-in-html-expected.png b/third_party/blink/web_tests/platform/win/paint/dark-mode/svg-invert-all/svg-in-html-expected.png index f4665b5..cfb4781 100644 --- a/third_party/blink/web_tests/platform/win/paint/dark-mode/svg-invert-all/svg-in-html-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/dark-mode/svg-invert-all/svg-in-html-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/fixed-pos-inside-composited-intermediate-layer-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/fixed-pos-inside-composited-intermediate-layer-expected.png new file mode 100644 index 0000000..4a6b35f --- /dev/null +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/fixed-pos-inside-composited-intermediate-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/newly-composited-on-scroll-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/newly-composited-on-scroll-expected.png index 70a05c2..61dea42 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/newly-composited-on-scroll-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/newly-composited-on-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/newly-composited-repaint-rect-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/newly-composited-repaint-rect-expected.png index f8f3d04..99a4fa3e 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/newly-composited-repaint-rect-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/newly-composited-repaint-rect-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/repaint-overflow-scrolled-squashed-content-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/repaint-overflow-scrolled-squashed-content-expected.png new file mode 100644 index 0000000..2230c97e --- /dev/null +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/repaint-overflow-scrolled-squashed-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/requires-backing-repaint-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/requires-backing-repaint-expected.png index 9f69293..503226b 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/requires-backing-repaint-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/requires-backing-repaint-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/scrolling-without-painting-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/scrolling-without-painting-expected.png new file mode 100644 index 0000000..5b6a3707 --- /dev/null +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/scrolling-without-painting-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/text-color-change-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/text-color-change-expected.png index 819c83ab0..b797e14 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/text-color-change-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/text-color-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/text-match-highlight-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/text-match-highlight-expected.png index 9f37224..876e109b 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/text-match-highlight-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/text-match-highlight-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.png index 016ce90..4e7f9778 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/updating-scrolling-container-and-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/updating-scrolling-container-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/updating-scrolling-container-expected.png index 5e29acee..e8fb56d 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/updating-scrolling-container-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/updating-scrolling-container-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/updating-scrolling-content-expected.png similarity index 73% rename from third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.png rename to third_party/blink/web_tests/platform/win/paint/invalidation/compositing/updating-scrolling-content-expected.png index 6091c85..ccfb12e0 100644 --- a/third_party/blink/web_tests/paint/invalidation/compositing/scrolling-without-painting-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/compositing/updating-scrolling-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/forms/textarea-caret-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/forms/textarea-caret-expected.png index 21d9fb7..170eaf7 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/forms/textarea-caret-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/forms/textarea-caret-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/invalidation-after-opacity-change-subtree-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/invalidation-after-opacity-change-subtree-expected.png index f9973d39..1b85d1e7a 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/invalidation-after-opacity-change-subtree-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/invalidation-after-opacity-change-subtree-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/invalidation-on-foreground-graphics-layer-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/invalidation-on-foreground-graphics-layer-expected.png index a023c8a..af51f23 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/invalidation-on-foreground-graphics-layer-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/invalidation-on-foreground-graphics-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-1-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-1-expected.png index 55aeb68..baedc53 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-1-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-10-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-10-expected.png index 59078d9..f7eec41d 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-10-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-10-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-2-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-2-expected.png index 8d7db75..d5cf5fa 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-2-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-3-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-3-expected.png index 769943c..d397491 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-3-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-4-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-4-expected.png index 4cadd201..ac09b2831 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-4-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-4-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-5-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-5-expected.png index b67ca9b..0c4f124 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-5-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-5-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-6-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-6-expected.png index e17daf6..ac0edae 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-6-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-6-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-7-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-7-expected.png index dd5a3d1..966230a 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-7-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-7-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-8-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-8-expected.png index e9bdf9a..9cc58b7 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-8-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-9-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-9-expected.png index 1883d25..339e4a1 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-9-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/line-flow-with-floats-9-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/composited-overflow-with-borderbox-background-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/composited-overflow-with-borderbox-background-expected.png index 77788ce..cb247de7 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/composited-overflow-with-borderbox-background-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/composited-overflow-with-borderbox-background-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/composited-overflow-with-local-background-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/composited-overflow-with-local-background-expected.png index 00f64dc..0623480 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/composited-overflow-with-local-background-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/composited-overflow-with-local-background-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/composited-overflow-with-negative-offset-outline-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/composited-overflow-with-negative-offset-outline-expected.png index 63b5df9..2cc9533 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/composited-overflow-with-negative-offset-outline-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/composited-overflow-with-negative-offset-outline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/vertical-overflow-child-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/vertical-overflow-child-expected.png index 699111d..2a2eff34 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/vertical-overflow-child-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/vertical-overflow-child-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/vertical-overflow-parent-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/vertical-overflow-parent-expected.png index 2129c32..c170bf68 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/vertical-overflow-parent-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/vertical-overflow-parent-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/vertical-overflow-same-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/vertical-overflow-same-expected.png index 14426c9..57c608d 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/vertical-overflow-same-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/overflow/vertical-overflow-same-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/document-flipped-blocks-writing-mode-scroll-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/document-flipped-blocks-writing-mode-scroll-expected.png index 0b0ec86..41844275 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/document-flipped-blocks-writing-mode-scroll-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/document-flipped-blocks-writing-mode-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/fixed-child-of-transformed-scrolled-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/fixed-child-of-transformed-scrolled-expected.png index ae8f83f..3eae2cd 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/fixed-child-of-transformed-scrolled-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/fixed-child-of-transformed-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/fixed-descendant-of-transformed-scrolled-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/fixed-descendant-of-transformed-scrolled-expected.png index 994a6a9f..287cb48 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/fixed-descendant-of-transformed-scrolled-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/fixed-descendant-of-transformed-scrolled-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/flipped-blocks-writing-mode-scroll-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/flipped-blocks-writing-mode-scroll-expected.png index 0124ecc..41765c8 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/flipped-blocks-writing-mode-scroll-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/flipped-blocks-writing-mode-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/overflow-scroll-body-appear-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/overflow-scroll-body-appear-expected.png index 7c4beed7..c9798c5 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/overflow-scroll-body-appear-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/overflow-scroll-body-appear-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/overflow-scroll-local-background-text-color-change-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/overflow-scroll-local-background-text-color-change-expected.png index 753a39c..84ac797 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/overflow-scroll-local-background-text-color-change-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/overflow-scroll-local-background-text-color-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/repaint-composited-child-in-scrolled-container-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/repaint-composited-child-in-scrolled-container-expected.png index d518204..56c1f70 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/repaint-composited-child-in-scrolled-container-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/repaint-composited-child-in-scrolled-container-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/resize-scrollable-iframe-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/resize-scrollable-iframe-expected.png index 2c3d63fb..1dd13ffc 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/resize-scrollable-iframe-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/resize-scrollable-iframe-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/scrollbar-damage-and-full-viewport-repaint-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/scrollbar-damage-and-full-viewport-repaint-expected.png index 44ea2e7..71b37017 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/scrollbar-damage-and-full-viewport-repaint-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/scrollbar-damage-and-full-viewport-repaint-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/scrollbar-parts-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/scrollbar-parts-expected.png index 0c8eaeb..3143c3f 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/scrollbar-parts-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/scroll/scrollbar-parts-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/selection/selection-within-composited-scroller-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/selection/selection-within-composited-scroller-expected.png index 11ebc2c..cc702728 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/selection/selection-within-composited-scroller-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/selection/selection-within-composited-scroller-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem-expected.png index 149b424..1368e0d 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/svg/text-xy-updates-SVGList-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/svg/text-xy-updates-SVGList-expected.png index f6d093a..af2f693 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/svg/text-xy-updates-SVGList-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/svg/text-xy-updates-SVGList-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/table/scroll-inside-table-cell-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/table/scroll-inside-table-cell-expected.png index e6079d8..b5fa093 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/table/scroll-inside-table-cell-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/table/scroll-inside-table-cell-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/table/scroll-relative-table-inside-table-cell-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/table/scroll-relative-table-inside-table-cell-expected.png index 9860950..949220c 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/table/scroll-relative-table-inside-table-cell-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/table/scroll-relative-table-inside-table-cell-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/table/single-line-cells-repeating-thead-break-inside-on-thead-only-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/table/single-line-cells-repeating-thead-break-inside-on-thead-only-expected.png index 1819032..f6544fb4 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/table/single-line-cells-repeating-thead-break-inside-on-thead-only-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/table/single-line-cells-repeating-thead-break-inside-on-thead-only-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/invalidation/text-match-document-change-expected.png b/third_party/blink/web_tests/platform/win/paint/invalidation/text-match-document-change-expected.png index 95b2356..245fe5e 100644 --- a/third_party/blink/web_tests/platform/win/paint/invalidation/text-match-document-change-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/invalidation/text-match-document-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/paint/selection/image-writing-modes-expected.png b/third_party/blink/web_tests/platform/win/paint/selection/image-writing-modes-expected.png index 249984be..f51131f 100644 --- a/third_party/blink/web_tests/platform/win/paint/selection/image-writing-modes-expected.png +++ b/third_party/blink/web_tests/platform/win/paint/selection/image-writing-modes-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/plugins/webview-plugin-nested-iframe-scroll-expected.png b/third_party/blink/web_tests/platform/win/plugins/webview-plugin-nested-iframe-scroll-expected.png index 80ae069..ac953bd 100644 --- a/third_party/blink/web_tests/platform/win/plugins/webview-plugin-nested-iframe-scroll-expected.png +++ b/third_party/blink/web_tests/platform/win/plugins/webview-plugin-nested-iframe-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/printing/return-from-printing-mode-expected.png b/third_party/blink/web_tests/platform/win/printing/return-from-printing-mode-expected.png index 1a90a73..100e910 100644 --- a/third_party/blink/web_tests/platform/win/printing/return-from-printing-mode-expected.png +++ b/third_party/blink/web_tests/platform/win/printing/return-from-printing-mode-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/blink/web_tests/platform/win/scrollbars/border-box-rect-clips-scrollbars-expected.png index 1e9c66a..f003d204 100644 --- a/third_party/blink/web_tests/platform/win/scrollbars/border-box-rect-clips-scrollbars-expected.png +++ b/third_party/blink/web_tests/platform/win/scrollbars/border-box-rect-clips-scrollbars-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/scrollbars/scrollbar-corner-colors-expected.png b/third_party/blink/web_tests/platform/win/scrollbars/scrollbar-corner-colors-expected.png index 36c23a48..e9d7c798 100644 --- a/third_party/blink/web_tests/platform/win/scrollbars/scrollbar-corner-colors-expected.png +++ b/third_party/blink/web_tests/platform/win/scrollbars/scrollbar-corner-colors-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/scrollbars/scrollbars-on-positioned-content-expected.png b/third_party/blink/web_tests/platform/win/scrollbars/scrollbars-on-positioned-content-expected.png index 67c2274..becd7e1 100644 --- a/third_party/blink/web_tests/platform/win/scrollbars/scrollbars-on-positioned-content-expected.png +++ b/third_party/blink/web_tests/platform/win/scrollbars/scrollbars-on-positioned-content-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/scrollbars/short-scrollbar-expected.png b/third_party/blink/web_tests/platform/win/scrollbars/short-scrollbar-expected.png index f8a35cd..91df8f5b 100644 --- a/third_party/blink/web_tests/platform/win/scrollbars/short-scrollbar-expected.png +++ b/third_party/blink/web_tests/platform/win/scrollbars/short-scrollbar-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/custom/bug45331-expected.png b/third_party/blink/web_tests/platform/win/svg/custom/bug45331-expected.png index 1cf4664..64ab52b 100644 --- a/third_party/blink/web_tests/platform/win/svg/custom/bug45331-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/custom/bug45331-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/custom/invisible-text-after-scrolling-expected.png b/third_party/blink/web_tests/platform/win/svg/custom/invisible-text-after-scrolling-expected.png index 4db96cb..51d04ad 100644 --- a/third_party/blink/web_tests/platform/win/svg/custom/invisible-text-after-scrolling-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/custom/invisible-text-after-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/custom/junk-data-expected.png b/third_party/blink/web_tests/platform/win/svg/custom/junk-data-expected.png index 502104c..9464bab4 100644 --- a/third_party/blink/web_tests/platform/win/svg/custom/junk-data-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/custom/junk-data-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/custom/load-non-wellformed-expected.png b/third_party/blink/web_tests/platform/win/svg/custom/load-non-wellformed-expected.png index fcd42361..a2de67c 100644 --- a/third_party/blink/web_tests/platform/win/svg/custom/load-non-wellformed-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/custom/load-non-wellformed-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/custom/missing-xlink-expected.png b/third_party/blink/web_tests/platform/win/svg/custom/missing-xlink-expected.png index 729e599..fe78ef5 100644 --- a/third_party/blink/web_tests/platform/win/svg/custom/missing-xlink-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/custom/missing-xlink-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/custom/object-sizing-no-width-height-expected.png b/third_party/blink/web_tests/platform/win/svg/custom/object-sizing-no-width-height-expected.png index 75570f2..e4cae18e 100644 --- a/third_party/blink/web_tests/platform/win/svg/custom/object-sizing-no-width-height-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/custom/object-sizing-no-width-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/custom/path-bad-data-expected.png b/third_party/blink/web_tests/platform/win/svg/custom/path-bad-data-expected.png index 5886a48..ad8c5f99 100644 --- a/third_party/blink/web_tests/platform/win/svg/custom/path-bad-data-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/custom/path-bad-data-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/custom/use-font-face-crash-expected.png b/third_party/blink/web_tests/platform/win/svg/custom/use-font-face-crash-expected.png index 1652db1..c458866 100644 --- a/third_party/blink/web_tests/platform/win/svg/custom/use-font-face-crash-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/custom/use-font-face-crash-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/dom/SVGStringList-basics-expected.png b/third_party/blink/web_tests/platform/win/svg/dom/SVGStringList-basics-expected.png index 27197cd9..7c7eb07 100644 --- a/third_party/blink/web_tests/platform/win/svg/dom/SVGStringList-basics-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/dom/SVGStringList-basics-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/dom/css-transforms-expected.png b/third_party/blink/web_tests/platform/win/svg/dom/css-transforms-expected.png index d0d5a18..df6ad042 100644 --- a/third_party/blink/web_tests/platform/win/svg/dom/css-transforms-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/dom/css-transforms-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.png b/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.png index 536f4ff..4feb2fa2 100644 --- a/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.png b/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.png index d7b2047..45a14be5 100644 --- a/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.png b/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.png index 536f4ff..4feb2fa2 100644 --- a/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-objectBoundingBox-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.png b/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.png index d7b2047..45a14be5 100644 --- a/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/filters/feImage-filterUnits-userSpaceOnUse-primitiveUnits-userSpaceOnUse-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/hixie/error/012-expected.png b/third_party/blink/web_tests/platform/win/svg/hixie/error/012-expected.png index 8a60135..98fa05e0 100644 --- a/third_party/blink/web_tests/platform/win/svg/hixie/error/012-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/hixie/error/012-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-defaults-expected.png b/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-defaults-expected.png index 0315a600..b59d507 100644 --- a/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-defaults-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-defaults-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-2-expected.png b/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-2-expected.png index 0315a600..b59d507 100644 --- a/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-2-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-3-expected.png b/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-3-expected.png index 0315a600..b59d507 100644 --- a/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-3-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults-expected.png b/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults-expected.png index 84edb2b..6bf6dcfc 100644 --- a/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/transforms/transformed-text-fill-pattern-expected.png b/third_party/blink/web_tests/platform/win/svg/transforms/transformed-text-fill-pattern-expected.png index 668852e..4b2b727 100644 --- a/third_party/blink/web_tests/platform/win/svg/transforms/transformed-text-fill-pattern-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/transforms/transformed-text-fill-pattern-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/wicd/test-scalable-background-image1-expected.png b/third_party/blink/web_tests/platform/win/svg/wicd/test-scalable-background-image1-expected.png index a4a1cf62..dd23b71 100644 --- a/third_party/blink/web_tests/platform/win/svg/wicd/test-scalable-background-image1-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/wicd/test-scalable-background-image1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/zoom/page/absolute-sized-document-scrollbars-expected.png b/third_party/blink/web_tests/platform/win/svg/zoom/page/absolute-sized-document-scrollbars-expected.png index d3ac7e96..02585de 100644 --- a/third_party/blink/web_tests/platform/win/svg/zoom/page/absolute-sized-document-scrollbars-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/zoom/page/absolute-sized-document-scrollbars-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/zoom/page/zoom-hixie-mixed-008-expected.png b/third_party/blink/web_tests/platform/win/svg/zoom/page/zoom-hixie-mixed-008-expected.png index 34c3c394..5ca6ab60 100644 --- a/third_party/blink/web_tests/platform/win/svg/zoom/page/zoom-hixie-mixed-008-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/zoom/page/zoom-hixie-mixed-008-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/zoom/page/zoom-mask-with-percentages-expected.png b/third_party/blink/web_tests/platform/win/svg/zoom/page/zoom-mask-with-percentages-expected.png index d458508..c5235051 100644 --- a/third_party/blink/web_tests/platform/win/svg/zoom/page/zoom-mask-with-percentages-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/zoom/page/zoom-mask-with-percentages-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/zoom/page/zoom-svg-float-border-padding-expected.png b/third_party/blink/web_tests/platform/win/svg/zoom/page/zoom-svg-float-border-padding-expected.png index 406e7fa..00ec1bc 100644 --- a/third_party/blink/web_tests/platform/win/svg/zoom/page/zoom-svg-float-border-padding-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/zoom/page/zoom-svg-float-border-padding-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug101674-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug101674-expected.png index 88534bc..b6474b23 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug101674-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug101674-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug10269-2-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug10269-2-expected.png index 7fb1687..4c5cb4e 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug10269-2-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug10269-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug10296-1-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug10296-1-expected.png index 868fdc6..3011682 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug10296-1-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug10296-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug1055-1-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug1055-1-expected.png index 418017d..389af64 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug1055-1-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug1055-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug113235-1-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug113235-1-expected.png index 03d48803..6ded32ea 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug113235-1-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug113235-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug113235-3-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug113235-3-expected.png index 1595d84..4396b948 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug113235-3-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug113235-3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug11944-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug11944-expected.png index 86434a5..4098312 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug11944-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug11944-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug120364-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug120364-expected.png index f7b7388..76a7b80 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug120364-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug120364-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug1302-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug1302-expected.png index 20b7ae4..c2dd50a 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug1302-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug1302-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug131020-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug131020-expected.png index 5661fcb1..c925c473 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug131020-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug131020-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug131020_iframe-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug131020_iframe-expected.png index 42d84ba0..fc89d1e 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug131020_iframe-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug131020_iframe-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug137388-2-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug137388-2-expected.png index b961b40a..2e6f51d 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug137388-2-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug137388-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug149275-1-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug149275-1-expected.png index 83c46fe..0030ffd 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug149275-1-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug149275-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug22019-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug22019-expected.png index 41ee722..4f0ca886 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug22019-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug22019-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2479-1-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2479-1-expected.png index f22b007e..839999d 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2479-1-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2479-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2479-3-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2479-3-expected.png index f45fe78e..d1effd488 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2479-3-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2479-3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2479-4-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2479-4-expected.png index f6b604e..31fd8e76 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2479-4-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2479-4-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug27038-2-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug27038-2-expected.png index 3eb93cbb..f06ef5f 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug27038-2-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug27038-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2947-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2947-expected.png index f2e01a8..1e3d7425 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2947-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug2947-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug32205-2-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug32205-2-expected.png index 9add53f..95802a8f0 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug32205-2-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug32205-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug38916-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug38916-expected.png index a757585..fc3135fc 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug38916-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug38916-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug3977-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug3977-expected.png index 1d0cfc6..511af6b 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug3977-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug3977-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug46480-1-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug46480-1-expected.png index e1e10a82..cc6b055 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug46480-1-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug46480-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug50695-1-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug50695-1-expected.png index 7f827650..c41e6c97 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug50695-1-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug50695-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug56405-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug56405-expected.png index 5e33016..7c1999a 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug56405-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug56405-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug5835-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug5835-expected.png index f43c9f4e..df436dc 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug5835-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug5835-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug650-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug650-expected.png index d2adad50..492489e 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug650-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug650-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug67915-1-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug67915-1-expected.png index 6d127a4..20ecd75 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug67915-1-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug67915-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug7112-1-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug7112-1-expected.png index 325dee77..cbb0ff1 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug7112-1-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug7112-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug7112-2-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug7112-2-expected.png index c97070a4..8350c94 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug7112-2-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug7112-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug73321-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug73321-expected.png index ec50dcc..f78a5e3 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug73321-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug73321-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug96343-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug96343-expected.png index ad43e1dd..146720f 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug96343-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug96343-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/core/bloomberg-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/core/bloomberg-expected.png index 7f63416..b0eaa46 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/core/bloomberg-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/core/bloomberg-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/core/captions-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/core/captions-expected.png index 3c8cee07..09252cc4 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/core/captions-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/core/captions-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/core/cell_heights-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/core/cell_heights-expected.png index d38b86ff..62003f0 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/core/cell_heights-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/core/cell_heights-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/core/col_widths_fix_fixPer-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/core/col_widths_fix_fixPer-expected.png index 6b227a1..99f5032 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/core/col_widths_fix_fixPer-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/core/col_widths_fix_fixPer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/core/row_span-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/core/row_span-expected.png index b16beac..e6e1a72 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/core/row_span-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/core/row_span-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_table_bgcolor_name-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_table_bgcolor_name-expected.png index 0c72fc8..569e9b23 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_table_bgcolor_name-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_table_bgcolor_name-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_table_bgcolor_rgb-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_table_bgcolor_rgb-expected.png index 0c72fc8..569e9b23 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_table_bgcolor_rgb-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_table_bgcolor_rgb-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_td_bgcolor_name-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_td_bgcolor_name-expected.png index a693a69..c1bd0bb 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_td_bgcolor_name-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_td_bgcolor_name-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_td_bgcolor_rgb-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_td_bgcolor_rgb-expected.png index a693a69..c1bd0bb 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_td_bgcolor_rgb-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_td_bgcolor_rgb-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_td_height-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_td_height-expected.png index 03268582..8b057c8e 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_td_height-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_td_height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_th_bgcolor_name-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_th_bgcolor_name-expected.png index aa41b96d..fe9dbab 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_th_bgcolor_name-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_th_bgcolor_name-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_th_bgcolor_rgb-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_th_bgcolor_rgb-expected.png index aa41b96d..fe9dbab 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_th_bgcolor_rgb-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_th_bgcolor_rgb-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_th_height-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_th_height-expected.png index 3e05d9e..16ac0485 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_th_height-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_th_height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_tr_bgcolor_name-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_tr_bgcolor_name-expected.png index a693a69..c1bd0bb 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_tr_bgcolor_name-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_tr_bgcolor_name-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_tr_bgcolor_rgb-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_tr_bgcolor_rgb-expected.png index a693a69..c1bd0bb 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_tr_bgcolor_rgb-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/marvin/x_tr_bgcolor_rgb-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/other/cell_widths-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/other/cell_widths-expected.png index b3ba1f17..8cbc199f 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/other/cell_widths-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/other/cell_widths-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/other/nestedTables-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/other/nestedTables-expected.png index 7938073..a87d401 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/other/nestedTables-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/other/nestedTables-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/other/test3-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/other/test3-expected.png index d93cecf..db2ddbf 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/other/test3-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/other/test3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/other/test6-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/other/test6-expected.png index 5b21d67..e00ba4c 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/other/test6-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/other/test6-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/other/wa_table_thtd_rowspan-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/other/wa_table_thtd_rowspan-expected.png index e82100f7..71b79d9f 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/other/wa_table_thtd_rowspan-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/other/wa_table_thtd_rowspan-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/other/wa_table_tr_align-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/other/wa_table_tr_align-expected.png index 66192abc..3dcb4b2 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/other/wa_table_tr_align-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/other/wa_table_tr_align-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug10140-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug10140-expected.png index 20f5d5d..4c7a883 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug10140-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug10140-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug101759-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug101759-expected.png index 643699f4..c21d98e 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug101759-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug101759-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug10216-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug10216-expected.png index 1007baf5..09a5035 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug10216-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug10216-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug1055-2-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug1055-2-expected.png index 6f4222be..03c55ae 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug1055-2-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug1055-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug106966-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug106966-expected.png index 1699ee5..ae307bde 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug106966-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug106966-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png index b565a41..36a0710 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug131020-3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug14007-1-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug14007-1-expected.png index f5efd219..6b774b9 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug14007-1-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug14007-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug14007-2-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug14007-2-expected.png index 8fbbc746..b2e3c73 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug14007-2-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug14007-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug19526-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug19526-expected.png index 118848620..bd083e1c 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug19526-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug19526-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug22122-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug22122-expected.png index c4d479b..1a4be3b 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug22122-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug22122-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug2479-5-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug2479-5-expected.png index f160d6b..d3a2e5e 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug2479-5-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug2479-5-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug32205-1-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug32205-1-expected.png index cc95c7e..0d23d8f6 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug32205-1-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug32205-1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug80762-2-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug80762-2-expected.png index 26c9873..194c2658 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug80762-2-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug80762-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug89315-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug89315-expected.png index 6549dc1..bf75878 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug89315-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug89315-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug91057-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug91057-expected.png index 178ceb2..bc85f8a 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug91057-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug91057-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/backgrounds-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/backgrounds-expected.png index 7a516d9..1b76b11 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/backgrounds-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/backgrounds-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/captions1-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/captions1-expected.png index 56b576a6..5697f8f 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/captions1-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/captions1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/captions2-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/captions2-expected.png index 17f90f3..f5a566d5 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/captions2-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/captions2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/captions3-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/captions3-expected.png index 77695f0d..2330ac3 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/captions3-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/captions3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/col_span2-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/col_span2-expected.png index 7d2bc37..b86cef59 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/col_span2-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/col_span2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/columns-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/columns-expected.png index 0f53dafd..2a869cf 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/columns-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/columns-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/conflicts-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/conflicts-expected.png index f8153081..dad1f38 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/conflicts-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/conflicts-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/standards1-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/standards1-expected.png index ddc0ddf..6b235e7 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/standards1-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/core/standards1-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png index 0bdbb52..c1a1b7e 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_row_sibling-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_row_sibling-expected.png index 1366f7a..de1b1db5 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_row_sibling-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_row_sibling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_tbody_sibling-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_tbody_sibling-expected.png index 97540f2..2a5a7d6 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_tbody_sibling-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/marvin/table_overflow_style_reflow_tbody_sibling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/other/empty_cells-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/other/empty_cells-expected.png index 1734a5e..99a8db0 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/other/empty_cells-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/other/empty_cells-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/other/test4-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/other/test4-expected.png index 3a5ba03c..6d54680 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/other/test4-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/other/test4-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-deep-expected.png b/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-deep-expected.png index 84a5f11..e7cdb87 100644 --- a/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-deep-expected.png +++ b/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-deep-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-expected.png b/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-expected.png index 18201437..a9f231d 100644 --- a/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-expected.png +++ b/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png b/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png index 88005609..621e08d 100644 --- a/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png +++ b/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png b/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png index bb8d3498..76a8510 100644 --- a/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png +++ b/third_party/blink/web_tests/platform/win/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png index d5a1751..8ec8ece 100644 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png new file mode 100644 index 0000000..f3cef2d --- /dev/null +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png index 3dbf9855..d80992b 100644 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png index f260d92..d80992b 100644 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-alt-f8-twice-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png index a70060fd..639312e6 100644 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-48px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png index c30672d..8a739bd 100644 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-font-size-4px-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png index 7ceb144..e58188c 100644 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-0.5x-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png deleted file mode 100644 index 13c847ac..0000000 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-eye-icon-zoom-4x-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png index f260d92..d80992b 100644 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-mismatched_glyph-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png index 5122698b..1f3834f 100644 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-small-size-alt-f8-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png index f260d92..d80992b 100644 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/password/password-with-reveal-button-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png new file mode 100644 index 0000000..e8e450f --- /dev/null +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/dark-mode-grayscale-images/paint/dark-mode/grayscale-images/desaturate-before-inversion-expected.png b/third_party/blink/web_tests/platform/win/virtual/dark-mode-grayscale-images/paint/dark-mode/grayscale-images/desaturate-before-inversion-expected.png index 0a7a991d..98c7512 100644 --- a/third_party/blink/web_tests/platform/win/virtual/dark-mode-grayscale-images/paint/dark-mode/grayscale-images/desaturate-before-inversion-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/dark-mode-grayscale-images/paint/dark-mode/grayscale-images/desaturate-before-inversion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/dark-mode-svg-invert-all/paint/dark-mode/svg-invert-all/svg-as-image-expected.png b/third_party/blink/web_tests/platform/win/virtual/dark-mode-svg-invert-all/paint/dark-mode/svg-invert-all/svg-as-image-expected.png index 3c5bbf87..41ba597 100644 --- a/third_party/blink/web_tests/platform/win/virtual/dark-mode-svg-invert-all/paint/dark-mode/svg-invert-all/svg-as-image-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/dark-mode-svg-invert-all/paint/dark-mode/svg-invert-all/svg-as-image-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/dark-mode-svg-invert-all/paint/dark-mode/svg-invert-all/svg-in-html-expected.png b/third_party/blink/web_tests/platform/win/virtual/dark-mode-svg-invert-all/paint/dark-mode/svg-invert-all/svg-in-html-expected.png index 5b85c77..1c5dba6 100644 --- a/third_party/blink/web_tests/platform/win/virtual/dark-mode-svg-invert-all/paint/dark-mode/svg-invert-all/svg-in-html-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/dark-mode-svg-invert-all/paint/dark-mode/svg-invert-all/svg-in-html-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-0px-images-expected.png b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-0px-images-expected.png index e6f310a5..dd0f960 100644 --- a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-0px-images-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-0px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-0px-images-quirk-expected.png b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-0px-images-quirk-expected.png index 5d0be18..b3eca42 100644 --- a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-0px-images-quirk-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-0px-images-quirk-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-10px-images-expected.png b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-10px-images-expected.png index e77ba05b..5ead56b1 100644 --- a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-10px-images-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-10px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-16px-images-expected.png b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-16px-images-expected.png index 2db0994..33c6c9cf 100644 --- a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-16px-images-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-16px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-1px-images-expected.png b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-1px-images-expected.png index c473c75..80487d8 100644 --- a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-1px-images-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-1px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-block-flow-images-expected.png b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-block-flow-images-expected.png index 54e8d17..adbea2e 100644 --- a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-block-flow-images-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-block-flow-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-images-empty-alt-expected.png b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-images-empty-alt-expected.png index abed1752..93f43b78 100644 --- a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-images-empty-alt-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-images-empty-alt-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-images-expected.png b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-images-expected.png index fa9ac90..c48127a 100644 --- a/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-images-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/exotic-color-space/images/rendering-broken-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-0px-images-expected.png b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-0px-images-expected.png index a323aa0..c08e056 100644 --- a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-0px-images-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-0px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-0px-images-quirk-expected.png b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-0px-images-quirk-expected.png index 3c2377b..2dedc937 100644 --- a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-0px-images-quirk-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-0px-images-quirk-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-10px-images-expected.png b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-10px-images-expected.png index 6503402..b0db035 100644 --- a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-10px-images-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-10px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-16px-images-expected.png b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-16px-images-expected.png index 1ab2b79fa..cf0276d 100644 --- a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-16px-images-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-16px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-1px-images-expected.png b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-1px-images-expected.png index 5040ec7..3548d10 100644 --- a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-1px-images-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-1px-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-block-flow-images-expected.png b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-block-flow-images-expected.png index d6bef43..7dc7e18 100644 --- a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-block-flow-images-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-block-flow-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-images-expected.png b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-images-expected.png index c2b7b76e..b15eef0 100644 --- a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-images-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/rendering-broken-images-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-expected.png b/third_party/blink/web_tests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-expected.png index 35f64e32..14e07c0 100644 --- a/third_party/blink/web_tests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/blink/web_tests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png index 3ae3a0d..a5a61cb1 100644 --- a/third_party/blink/web_tests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/backdrop-filter-plus-mask-large-expected.png b/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/backdrop-filter-plus-mask-large-expected.png index 1164437..d5845fb 100644 --- a/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/backdrop-filter-plus-mask-large-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/scalefactor200/css3/filters/backdrop-filter-plus-mask-large-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/css1/font_properties/font-expected.png b/third_party/blink/web_tests/platform/win7/css1/font_properties/font-expected.png index 01cedfb..7bbd214 100644 --- a/third_party/blink/web_tests/platform/win7/css1/font_properties/font-expected.png +++ b/third_party/blink/web_tests/platform/win7/css1/font_properties/font-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/css1/pseudo/firstline-expected.png b/third_party/blink/web_tests/platform/win7/css1/pseudo/firstline-expected.png index ebe4721..fc4fd055 100644 --- a/third_party/blink/web_tests/platform/win7/css1/pseudo/firstline-expected.png +++ b/third_party/blink/web_tests/platform/win7/css1/pseudo/firstline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/css1/pseudo/multiple_pseudo_elements-expected.png b/third_party/blink/web_tests/platform/win7/css1/pseudo/multiple_pseudo_elements-expected.png index 592b2e115..1cc8b8ef 100644 --- a/third_party/blink/web_tests/platform/win7/css1/pseudo/multiple_pseudo_elements-expected.png +++ b/third_party/blink/web_tests/platform/win7/css1/pseudo/multiple_pseudo_elements-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png b/third_party/blink/web_tests/platform/win7/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png index 2cb8aefe1..4e1183f0 100644 --- a/third_party/blink/web_tests/platform/win7/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png +++ b/third_party/blink/web_tests/platform/win7/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/block/positioning/047-expected.png b/third_party/blink/web_tests/platform/win7/fast/block/positioning/047-expected.png index 5a591578..70e731b 100644 --- a/third_party/blink/web_tests/platform/win7/fast/block/positioning/047-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/block/positioning/047-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl-expected.png b/third_party/blink/web_tests/platform/win7/fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl-expected.png index be7f769..61751f5 100644 --- a/third_party/blink/web_tests/platform/win7/fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/overflow/003-expected.png b/third_party/blink/web_tests/platform/win7/fast/overflow/003-expected.png index eaf048fa..306eace 100644 --- a/third_party/blink/web_tests/platform/win7/fast/overflow/003-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/overflow/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-cell-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-cell-collapsed-border-expected.png index c3233ba..2694cc7 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-cell-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-cell-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-cell-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-cell-expected.png index f915db34..2a698f8 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-cell-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-cell-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-collapsed-border-expected.png index 3da2639..99e15ca 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-expected.png index 4d34745..49a74f2 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-group-collapsed-border-expected.png index a38b3b8..5d9e3c9 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-group-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-group-expected.png index e7eb288..4f28a4e2 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-group-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-column-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-expected.png index 42d0e07..a996425 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-quirks-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-quirks-expected.png index 48cf455..9b1c432 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-quirks-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-quirks-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-collapsed-border-expected.png index 5b58cf5..d77dde5 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-expected.png index 703b65d8..354c6266 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-group-collapsed-border-expected.png index 294db27..a0a0556 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-group-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-group-expected.png index 12333a0..604d034 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-group-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_border-table-row-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_layers-hide-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_layers-hide-collapsed-border-expected.png index 86f0688..040b767 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_layers-hide-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_layers-hide-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_layers-hide-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_layers-hide-expected.png index 3a73b2e..e5b22d3 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_layers-hide-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_layers-hide-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-cell-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-cell-collapsed-border-expected.png index 1ad7eb3..8013a71 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-cell-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-cell-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-cell-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-cell-expected.png index 6c0ba19..16cfb1f 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-cell-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-cell-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-collapsed-border-expected.png index 187ff4f8..473e3352 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-expected.png index c02cc52..8aafe3e 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-group-collapsed-border-expected.png index 7619e7c..5f37830d 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-group-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-group-expected.png index 215bc3f..b0de710 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-group-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-column-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-expected.png index a7330f5..04787d6 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-collapsed-border-expected.png index c256278..2fb736af 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-expected.png index c0a8659..a75779e 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-group-collapsed-border-expected.png index e05879a..a0aee7e 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-group-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-group-expected.png index 3fc7218..f79bb5d 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-group-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_position-table-row-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-cell-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-cell-collapsed-border-expected.png index 569dca2..83a83c9 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-cell-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-cell-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-cell-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-cell-expected.png index 9244d03..2b211da 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-cell-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-cell-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-collapsed-border-expected.png index a32d550..b488667 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-collapsed-border-expected.png index a946321..d20313c 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-expected.png index 492f6a9..2e29741 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-group-collapsed-border-expected.png index 5f75bd0..67c5ddf 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-group-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-group-expected.png index 0c4d9eb2..a4544cf 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-group-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-column-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-expected.png index 5eb441e..a231292d 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-collapsed-border-expected.png index 3274b92..20a4617 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-expected.png index c2da8a2..4378fd6a 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-group-collapsed-border-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-group-collapsed-border-expected.png index e72d093..d73fd9c 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-group-collapsed-border-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-group-expected.png b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-group-expected.png index c2b64f0..2efa803 100644 --- a/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-group-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/table/backgr_simple-table-row-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/text-autosizing/hackernews-comments-expected.png b/third_party/blink/web_tests/platform/win7/fast/text-autosizing/hackernews-comments-expected.png index 7eccb263..b9219b2 100644 --- a/third_party/blink/web_tests/platform/win7/fast/text-autosizing/hackernews-comments-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/text-autosizing/hackernews-comments-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/text/capitalize-boundaries-expected.png b/third_party/blink/web_tests/platform/win7/fast/text/capitalize-boundaries-expected.png index b8281a71..93c0e93 100644 --- a/third_party/blink/web_tests/platform/win7/fast/text/capitalize-boundaries-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/text/capitalize-boundaries-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/text/font-format-support-color-cff2-expected.png b/third_party/blink/web_tests/platform/win7/fast/text/font-format-support-color-cff2-expected.png index a54d7321..fb25a12 100644 --- a/third_party/blink/web_tests/platform/win7/fast/text/font-format-support-color-cff2-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/text/font-format-support-color-cff2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/text/font-weight-variant-expected.png b/third_party/blink/web_tests/platform/win7/fast/text/font-weight-variant-expected.png index fb792c9..0cc5da57 100644 --- a/third_party/blink/web_tests/platform/win7/fast/text/font-weight-variant-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/text/font-weight-variant-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/text/international/003-expected.png b/third_party/blink/web_tests/platform/win7/fast/text/international/003-expected.png index 56d6af82..96c873c 100644 --- a/third_party/blink/web_tests/platform/win7/fast/text/international/003-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/text/international/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/text/international/bidi-neutral-run-expected.png b/third_party/blink/web_tests/platform/win7/fast/text/international/bidi-neutral-run-expected.png index e43ce69..a892d74 100644 --- a/third_party/blink/web_tests/platform/win7/fast/text/international/bidi-neutral-run-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/text/international/bidi-neutral-run-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/text/international/complex-character-based-fallback-expected.png b/third_party/blink/web_tests/platform/win7/fast/text/international/complex-character-based-fallback-expected.png index b874043..3fc1fa19 100644 --- a/third_party/blink/web_tests/platform/win7/fast/text/international/complex-character-based-fallback-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/text/international/complex-character-based-fallback-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/text/letter-spacing-leading-and-trailing-expected.png b/third_party/blink/web_tests/platform/win7/fast/text/letter-spacing-leading-and-trailing-expected.png index c2affb0..18442e7 100644 --- a/third_party/blink/web_tests/platform/win7/fast/text/letter-spacing-leading-and-trailing-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/text/letter-spacing-leading-and-trailing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/text/softHyphen-expected.png b/third_party/blink/web_tests/platform/win7/fast/text/softHyphen-expected.png index 60b3492..a418df7 100644 --- a/third_party/blink/web_tests/platform/win7/fast/text/softHyphen-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/text/softHyphen-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/text/unicode-fallback-font-expected.png b/third_party/blink/web_tests/platform/win7/fast/text/unicode-fallback-font-expected.png index 607c190..a9cf073 100644 --- a/third_party/blink/web_tests/platform/win7/fast/text/unicode-fallback-font-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/text/unicode-fallback-font-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/text/whitespace/024-expected.png b/third_party/blink/web_tests/platform/win7/fast/text/whitespace/024-expected.png index e6696c9e..61074e56 100644 --- a/third_party/blink/web_tests/platform/win7/fast/text/whitespace/024-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/text/whitespace/024-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/text/word-break-expected.png b/third_party/blink/web_tests/platform/win7/fast/text/word-break-expected.png index 3c5a216..b77a1168 100644 --- a/third_party/blink/web_tests/platform/win7/fast/text/word-break-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/text/word-break-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fonts/fantasy-expected.png b/third_party/blink/web_tests/platform/win7/fonts/fantasy-expected.png index 41e57de..1d5af29 100644 --- a/third_party/blink/web_tests/platform/win7/fonts/fantasy-expected.png +++ b/third_party/blink/web_tests/platform/win7/fonts/fantasy-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem-expected.png b/third_party/blink/web_tests/platform/win7/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem-expected.png index e1088a5..9f5f13b 100644 --- a/third_party/blink/web_tests/platform/win7/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem-expected.png +++ b/third_party/blink/web_tests/platform/win7/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png b/third_party/blink/web_tests/platform/win7/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png index 6a820ad..7560b2d9 100644 --- a/third_party/blink/web_tests/platform/win7/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png +++ b/third_party/blink/web_tests/platform/win7/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/transforms/2d/hindi-rotated-expected.png b/third_party/blink/web_tests/platform/win7/transforms/2d/hindi-rotated-expected.png index bb4f5fc..ae876c32 100644 --- a/third_party/blink/web_tests/platform/win7/transforms/2d/hindi-rotated-expected.png +++ b/third_party/blink/web_tests/platform/win7/transforms/2d/hindi-rotated-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png b/third_party/blink/web_tests/platform/win7/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png index d5a1751..8ec8ece 100644 --- a/third_party/blink/web_tests/platform/win7/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png +++ b/third_party/blink/web_tests/platform/win7/virtual/controls-refresh-high-contrast/fast/forms/controls-new-ui-high-contrast/text_number_password_button_submit-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win7/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png deleted file mode 100644 index 86f92be..0000000 --- a/third_party/blink/web_tests/platform/win7/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/scrollbars/auto-scrollbar-fades-out.html b/third_party/blink/web_tests/scrollbars/auto-scrollbar-fades-out.html index 68906bf..41a6805 100644 --- a/third_party/blink/web_tests/scrollbars/auto-scrollbar-fades-out.html +++ b/third_party/blink/web_tests/scrollbars/auto-scrollbar-fades-out.html
@@ -1,8 +1,7 @@ <!DOCTYPE html> <script> if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); + internals.useMockOverlayScrollbars(); window.onload = function() { var div = document.getElementById('iframe')
diff --git a/third_party/blink/web_tests/scrollbars/hidden-scrollbars-invisible.html b/third_party/blink/web_tests/scrollbars/hidden-scrollbars-invisible.html index 1328554..036d3d5 100644 --- a/third_party/blink/web_tests/scrollbars/hidden-scrollbars-invisible.html +++ b/third_party/blink/web_tests/scrollbars/hidden-scrollbars-invisible.html
@@ -1,9 +1,7 @@ <!DOCTYPE html> <script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} +if (window.internals) + internals.useMockOverlayScrollbars(); </script> <div id="div" style="overflow: scroll; width: 200px; height: 200px;"> <div style="background-color: green; height: 3000px; width: 100px"></div> @@ -15,8 +13,6 @@ <script> window.onload = function() { if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - var div = document.querySelector('#div'); var iframe = document.querySelector('#iframe'); internals.setScrollbarVisibilityInScrollableArea(div, true);
diff --git a/third_party/blink/web_tests/scrollbars/nested-scroll-overlay-scrollbar-expected.html b/third_party/blink/web_tests/scrollbars/nested-scroll-overlay-scrollbar-expected.html index 337c2f68..88f9812 100644 --- a/third_party/blink/web_tests/scrollbars/nested-scroll-overlay-scrollbar-expected.html +++ b/third_party/blink/web_tests/scrollbars/nested-scroll-overlay-scrollbar-expected.html
@@ -1,11 +1,9 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div id="outer" style="width: 200px; height: 200px; overflow: scroll"> <div style="background: green; height: 100px"></div> <div style="height: 110px"></div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/nested-scroll-overlay-scrollbar.html b/third_party/blink/web_tests/scrollbars/nested-scroll-overlay-scrollbar.html index 9a9eba03..7df89743 100644 --- a/third_party/blink/web_tests/scrollbars/nested-scroll-overlay-scrollbar.html +++ b/third_party/blink/web_tests/scrollbars/nested-scroll-overlay-scrollbar.html
@@ -1,13 +1,11 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div style="width: 200px; height: 200px; overflow: scroll"> <!-- The intermediate div doesn't have layout overflow. --> <div style="height: 210px; overflow: scroll"> <div style="background: green; width: 300px; height: 100px"></div> </div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-interleaving-z-order-expected.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-interleaving-z-order-expected.html index be7860a2..76704ca 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-interleaving-z-order-expected.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-interleaving-z-order-expected.html
@@ -1,13 +1,11 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div id="container" style="width: 200px; height: 200px; overflow: scroll"> <div id="content" style="background: green; width: 210px; height: 150px"></div> <div style="height: 60px"></div> </div> <div style="position: absolute; top: 80px; left: 80px; z-index: -1; background: blue; width: 200px; height: 200px"></div> <div style="position: absolute; top: 120px; left: 120px; z-index: 20; background: yellow; width: 200px; height: 200px"></div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-interleaving-z-order.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-interleaving-z-order.html index fe92316..4775b50e 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-interleaving-z-order.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-interleaving-z-order.html
@@ -1,13 +1,11 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div id="container" style="width: 200px; height: 200px; overflow: scroll; position: relative"> <div id="content" style="position: absolute; z-index: 10; background: green; width: 210px; height: 150px"></div> <div style="height: 210px"></div> </div> <div style="position: absolute; top: 80px; left: 80px; z-index: 5; background: blue; width: 200px; height: 200px"></div> <div style="position: absolute; top: 120px; left: 120px; z-index: 20; background: yellow; width: 200px; height: 200px"></div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-expected.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-expected.html index 49c1ce68..3d46e64 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-expected.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-expected.html
@@ -1,11 +1,9 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div style="width: 200px; height: 200px; overflow: scroll"> <div style="background: green; width: 300px; height: 100px"></div> <div style="height: 210px"></div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-1-expected.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-1-expected.html index 0b104dd8..674f872 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-1-expected.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-1-expected.html
@@ -1,12 +1,10 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div style="width: 200px; height: 200px; overflow: scroll"> <div style="background: green; width: 200px; height: 70px"></div> <!-- This div let the top-level div have the same layout overflow as in the test. --> <div style="width: 210px; height: 220px"></div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-1.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-1.html index 26445a4c..0d6cec0 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-1.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-1.html
@@ -1,4 +1,8 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div style="position: relative; width: 200px; height: 200px; overflow: scroll"> <!-- the intermediate div doesn't have layout overflow. --> <div style="position: relative; width: 210px; height: 80px; overflow: scroll"> @@ -6,9 +10,3 @@ </div> <div style="height: 210px"></div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-2-expected.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-2-expected.html index e4b3bae..02e2eb9 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-2-expected.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-2-expected.html
@@ -1,11 +1,9 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div style="width: 200px; height: 200px; overflow: scroll"> <div style="background: green; width: 210px; height: 80px"></div> <div style="height: 210px"></div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-2.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-2.html index 30fdcc3..5ece48c8 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-2.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-2.html
@@ -1,4 +1,8 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <style> #intermediate::-webkit-scrollbar { display: none; } </style> @@ -9,9 +13,3 @@ </div> <div style="height: 210px"></div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-3-expected.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-3-expected.html index e4b3bae..02e2eb9 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-3-expected.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-3-expected.html
@@ -1,11 +1,9 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div style="width: 200px; height: 200px; overflow: scroll"> <div style="background: green; width: 210px; height: 80px"></div> <div style="height: 210px"></div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-3.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-3.html index e3b043e2..16ab6191 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-3.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-3.html
@@ -1,4 +1,8 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div style="position: relative; width: 200px; height: 200px; overflow: scroll"> <!-- The intermediate div's overflow is hidden. --> <div style="position: relative; width: 210px; height: 80px; overflow: hidden"> @@ -6,9 +10,3 @@ </div> <div style="height: 210px"></div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-expected.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-expected.html index 447fcfb6..79fe7c6 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-expected.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested-expected.html
@@ -1,13 +1,11 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div style="width: 200px; height: 200px; overflow: scroll"> <div style="width: 210px; height: 80px; overflow: scroll"> <div style="background: green; width: 300px; height: 200px"></div> </div> <div style="height: 210px"></div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested.html index a915f1c..7253fcb6 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer-nested.html
@@ -1,13 +1,11 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div style="position: relative; width: 200px; height: 200px; overflow: scroll"> <div style="position: relative; width: 210px; height: 80px; overflow: scroll"> <div style="position: absolute; z-index: 5; background: green; width: 300px; height: 100px"></div> </div> <div style="height: 210px"></div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer.html index 4220153..de0b296 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-child-layer.html
@@ -1,11 +1,9 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div id="container" style="width: 200px; height: 200px; overflow: scroll"> <div id="content" style="position: relative; background: green; width: 300px; height: 100px"></div> <div style="height: 210px"></div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-negative-z-child-layer-expected.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-negative-z-child-layer-expected.html index b136cfb..e314255 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-negative-z-child-layer-expected.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-negative-z-child-layer-expected.html
@@ -1,11 +1,9 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div id="container" style="width: 200px; height: 200px; overflow: scroll"> <div id="content" style="background: green; width: 300px; height: 100px"></div> <div style="height: 210px"></div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-negative-z-child-layer.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-negative-z-child-layer.html index a8adb7f..709d85f5 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-negative-z-child-layer.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbar-over-negative-z-child-layer.html
@@ -1,11 +1,9 @@ <!DOCTYPE html> +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <div id="container" style="width: 200px; height: 200px; overflow: scroll"> <div id="content" style="position: relative; z-index: -1; background: green; width: 300px; height: 100px"></div> <div style="height: 210px"></div> </div> -<script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} -</script>
diff --git a/third_party/blink/web_tests/scrollbars/overlay-scrollbars-within-overflow-scroll.html b/third_party/blink/web_tests/scrollbars/overlay-scrollbars-within-overflow-scroll.html index d539c16..d786220 100644 --- a/third_party/blink/web_tests/scrollbars/overlay-scrollbars-within-overflow-scroll.html +++ b/third_party/blink/web_tests/scrollbars/overlay-scrollbars-within-overflow-scroll.html
@@ -4,7 +4,10 @@ The scrollbar within the inner (blue) box should be visible and positioned at the top, even though the outer (green) box has been scrolled. --> - +<script> +if (window.internals) + internals.useMockOverlayScrollbars(); +</script> <style> html, body { margin: 0; padding: 0; } #outer { @@ -30,10 +33,6 @@ </div> <script> -if (window.internals) { - internals.runtimeFlags.overlayScrollbarsEnabled = true; - internals.settings.setMockScrollbarsEnabled(true); -} const outer = document.getElementById('outer'); outer.scrollTop = outer.scrollHeight - outer.clientHeight; if (window.testRunner) {
diff --git a/third_party/blink/web_tests/scrollbars/rtl/overflow-scroll-rtl-expected.png b/third_party/blink/web_tests/scrollbars/rtl/overflow-scroll-rtl-expected.png index cfa439a..72e23bad 100644 --- a/third_party/blink/web_tests/scrollbars/rtl/overflow-scroll-rtl-expected.png +++ b/third_party/blink/web_tests/scrollbars/rtl/overflow-scroll-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/scrollbars/rtl/overflow-scroll-rtl.html b/third_party/blink/web_tests/scrollbars/rtl/overflow-scroll-rtl.html index 347eacdc0..49ad07d 100644 --- a/third_party/blink/web_tests/scrollbars/rtl/overflow-scroll-rtl.html +++ b/third_party/blink/web_tests/scrollbars/rtl/overflow-scroll-rtl.html
@@ -2,14 +2,8 @@ <html style="font-family: ahem; font-size: 10px; -webkit-font-smoothing: none;"> <head> <script src="../../resources/ahem.js"></script> -<script> -function runTest() { - if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); -} -</script> </head> -<body onload="runTest();"> +<body> <p>All the digits from 0 to 9 should be visible.</p> <div id="outer" style="direction: rtl; background-color: blue; width: 200px; height: 200px; overflow: scroll;"> <div id="inner" style="background-color: lightgreen;">0123456789</div>
diff --git a/third_party/blink/web_tests/scrollingcoordinator/resources/non-fast-scrollable-region-testing.js b/third_party/blink/web_tests/scrollingcoordinator/resources/non-fast-scrollable-region-testing.js index 9ed252a..9cbc7ed 100644 --- a/third_party/blink/web_tests/scrollingcoordinator/resources/non-fast-scrollable-region-testing.js +++ b/third_party/blink/web_tests/scrollingcoordinator/resources/non-fast-scrollable-region-testing.js
@@ -1,9 +1,3 @@ -// setMockScrollbarsEnabled doesn't actually invalidate scrollbars -// so if we don't set it immediately, they won't repaint/relayout -// correctly! http://crbug.com/365509 -if (window.internals) - internals.settings.setMockScrollbarsEnabled(true); - // Draws green overlays for non-fast scrollable regions. This provides a visual // feedback that is useful when running the test interactively. function drawNonFastScrollableRegionOverlays() {
diff --git a/third_party/blink/web_tests/svg/css/css-systemcolors-expected.svg b/third_party/blink/web_tests/svg/css/css-systemcolors-expected.svg index a67c15a9..8c18008 100644 --- a/third_party/blink/web_tests/svg/css/css-systemcolors-expected.svg +++ b/third_party/blink/web_tests/svg/css/css-systemcolors-expected.svg
@@ -363,6 +363,42 @@ </feDiffuseLighting> <feComposite in="SourceGraphic" in2="light" k1="1" k2="0" k3="0" k4="0" operator="arithmetic" /> </filter> + <filter x="0" y="0" width="1" height="1" id="f32"> + <feFlood flood-color="currentColor" color="ActiveText" /> + </filter> + <linearGradient id="g32"> + <stop stop-color="currentColor" color="ActiveText" /> + </linearGradient> + <filter x="0" y="0" width="1" height="1" id="fl32"> + <feDiffuseLighting color="ActiveText" lighting-color="currentColor" in="SourceAlpha" result="light"> + <feDistantLight azimuth="45" elevation="45" /> + </feDiffuseLighting> + <feComposite in="SourceGraphic" in2="light" k1="1" k2="0" k3="0" k4="0" operator="arithmetic" /> + </filter> + <filter x="0" y="0" width="1" height="1" id="f33"> + <feFlood flood-color="currentColor" color="Field" /> + </filter> + <linearGradient id="g33"> + <stop stop-color="currentColor" color="Field" /> + </linearGradient> + <filter x="0" y="0" width="1" height="1" id="fl33"> + <feDiffuseLighting color="Field" lighting-color="currentColor" in="SourceAlpha" result="light"> + <feDistantLight azimuth="45" elevation="45" /> + </feDiffuseLighting> + <feComposite in="SourceGraphic" in2="light" k1="1" k2="0" k3="0" k4="0" operator="arithmetic" /> + </filter> + <filter x="0" y="0" width="1" height="1" id="f34"> + <feFlood flood-color="currentColor" color="FieldText" /> + </filter> + <linearGradient id="g34"> + <stop stop-color="currentColor" color="FieldText" /> + </linearGradient> + <filter x="0" y="0" width="1" height="1" id="fl34"> + <feDiffuseLighting color="FieldText" lighting-color="currentColor" in="SourceAlpha" result="light"> + <feDistantLight azimuth="45" elevation="45" /> + </feDiffuseLighting> + <feComposite in="SourceGraphic" in2="light" k1="1" k2="0" k3="0" k4="0" operator="arithmetic" /> + </filter> </defs> <rect width="28" height="28" x="0" filter="url(#f0)" /> <rect width="28" height="28" x="0" y="28" fill="url(#g0)" /> @@ -454,4 +490,13 @@ <rect width="28" height="28" x="756" filter="url(#f29)" /> <rect width="28" height="28" x="756" y="28" fill="url(#g29)" /> <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl29)" /> + <rect width="28" height="28" x="756" filter="url(#f32)" /> + <rect width="28" height="28" x="756" y="28" fill="url(#g32)" /> + <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl32)" /> + <rect width="28" height="28" x="756" filter="url(#f33)" /> + <rect width="28" height="28" x="756" y="28" fill="url(#g33)" /> + <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl33)" /> + <rect width="28" height="28" x="756" filter="url(#f34)" /> + <rect width="28" height="28" x="756" y="28" fill="url(#g34)" /> + <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl34)" /> </svg>
diff --git a/third_party/blink/web_tests/svg/css/css-systemcolors.svg b/third_party/blink/web_tests/svg/css/css-systemcolors.svg index c044f00..632a762 100644 --- a/third_party/blink/web_tests/svg/css/css-systemcolors.svg +++ b/third_party/blink/web_tests/svg/css/css-systemcolors.svg
@@ -363,6 +363,42 @@ </feDiffuseLighting> <feComposite in="SourceGraphic" in2="light" k1="1" k2="0" k3="0" k4="0" operator="arithmetic" /> </filter> + <filter x="0" y="0" width="1" height="1" id="f32"> + <feFlood flood-color="currentColor" color="ActiveText" /> + </filter> + <linearGradient id="g32"> + <stop stop-color="currentColor" color="ActiveText" /> + </linearGradient> + <filter x="0" y="0" width="1" height="1" id="fl32"> + <feDiffuseLighting color="ActiveText" lighting-color="currentColor" in="SourceAlpha" result="light"> + <feDistantLight azimuth="45" elevation="45" /> + </feDiffuseLighting> + <feComposite in="SourceGraphic" in2="light" k1="1" k2="0" k3="0" k4="0" operator="arithmetic" /> + </filter> + <filter x="0" y="0" width="1" height="1" id="f33"> + <feFlood flood-color="currentColor" color="Field" /> + </filter> + <linearGradient id="g33"> + <stop stop-color="currentColor" color="Field" /> + </linearGradient> + <filter x="0" y="0" width="1" height="1" id="fl33"> + <feDiffuseLighting color="Field" lighting-color="currentColor" in="SourceAlpha" result="light"> + <feDistantLight azimuth="45" elevation="45" /> + </feDiffuseLighting> + <feComposite in="SourceGraphic" in2="light" k1="1" k2="0" k3="0" k4="0" operator="arithmetic" /> + </filter> + <filter x="0" y="0" width="1" height="1" id="f34"> + <feFlood flood-color="currentColor" color="FieldText" /> + </filter> + <linearGradient id="g34"> + <stop stop-color="currentColor" color="FieldText" /> + </linearGradient> + <filter x="0" y="0" width="1" height="1" id="fl34"> + <feDiffuseLighting color="FieldText" lighting-color="currentColor" in="SourceAlpha" result="light"> + <feDistantLight azimuth="45" elevation="45" /> + </feDiffuseLighting> + <feComposite in="SourceGraphic" in2="light" k1="1" k2="0" k3="0" k4="0" operator="arithmetic" /> + </filter> </defs> <rect width="28" height="28" x="0" filter="url(#f0)" /> <rect width="28" height="28" x="0" y="28" fill="url(#g0)" /> @@ -454,4 +490,13 @@ <rect width="28" height="28" x="756" filter="url(#f29)" /> <rect width="28" height="28" x="756" y="28" fill="url(#g29)" /> <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl29)" /> + <rect width="28" height="28" x="756" filter="url(#f32)" /> + <rect width="28" height="28" x="756" y="28" fill="url(#g32)" /> + <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl32)" /> + <rect width="28" height="28" x="756" filter="url(#f33)" /> + <rect width="28" height="28" x="756" y="28" fill="url(#g33)" /> + <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl33)" /> + <rect width="28" height="28" x="756" filter="url(#f34)" /> + <rect width="28" height="28" x="756" y="28" fill="url(#g34)" /> + <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl34)" /> </svg>
diff --git a/third_party/blink/web_tests/svg/css/rect-system-color-expected.txt b/third_party/blink/web_tests/svg/css/rect-system-color-expected.txt index efc23b3..4c65580 100644 --- a/third_party/blink/web_tests/svg/css/rect-system-color-expected.txt +++ b/third_party/blink/web_tests/svg/css/rect-system-color-expected.txt
@@ -10,6 +10,9 @@ Testing system colorActiveCaption PASS computedStyleText.fill is computedStyleDiv.color PASS computedStyleText.stroke is computedStyleDiv.color +Testing system colorActiveText +PASS computedStyleText.fill is computedStyleDiv.color +FAIL computedStyleText.stroke should be rgb(0, 0, 0). Was rgb(255, 0, 0). Testing system colorAppWorkspace PASS computedStyleText.fill is computedStyleDiv.color PASS computedStyleText.stroke is computedStyleDiv.color @@ -31,6 +34,12 @@ Testing system colorCaptionText PASS computedStyleText.fill is computedStyleDiv.color PASS computedStyleText.stroke is computedStyleDiv.color +Testing system colorField +PASS computedStyleText.fill is computedStyleDiv.color +FAIL computedStyleText.stroke should be rgb(0, 0, 0). Was rgb(255, 255, 255). +Testing system colorFieldText +PASS computedStyleText.fill is computedStyleDiv.color +PASS computedStyleText.stroke is computedStyleDiv.color Testing system colorGrayText PASS computedStyleText.fill is computedStyleDiv.color PASS computedStyleText.stroke is computedStyleDiv.color
diff --git a/third_party/blink/web_tests/svg/css/rect-system-color.xhtml b/third_party/blink/web_tests/svg/css/rect-system-color.xhtml index 6b9b3da..84d0fa797 100644 --- a/third_party/blink/web_tests/svg/css/rect-system-color.xhtml +++ b/third_party/blink/web_tests/svg/css/rect-system-color.xhtml
@@ -24,11 +24,13 @@ description('Test that fill and stroke properties accept system colors'); debug(''); -var systemColors = new Array("ActiveBorder", "ActiveCaption", "AppWorkspace", "Background", "ButtonFace", "ButtonHighlight", - "ButtonShadow", "ButtonText", "CaptionText", "GrayText", "Highlight", "HighlightText", - "InactiveBorder", "InactiveCaption", "InactiveCaptionText", "InfoBackground", "InfoText", - "LinkText", "Menu", "MenuText", "Scrollbar", "ThreeDDarkShadow", "ThreeDFace", "ThreeDHighlight", - "ThreeDLightShadow", "ThreeDShadow", "VisitedText", "Window", "WindowFrame", "WindowText"); +var systemColors = new Array("ActiveBorder", "ActiveCaption", "ActiveText", "AppWorkspace", "Background", + "ButtonFace", "ButtonHighlight", "ButtonShadow", "ButtonText", + "CaptionText", "Field", "FieldText", "GrayText", "Highlight", "HighlightText", + "InactiveBorder", "InactiveCaption", "InactiveCaptionText", "InfoBackground", + "InfoText", "LinkText", "Menu", "MenuText", "Scrollbar", "ThreeDDarkShadow", + "ThreeDFace", "ThreeDHighlight", "ThreeDLightShadow", "ThreeDShadow", "VisitedText", + "Window", "WindowFrame", "WindowText"); var svgElement = document.getElementsByTagName("svg")[0]; for (i = 0; i < systemColors.length; ++i) { var textElement = document.createElementNS(SVG_NS, "text");
diff --git a/third_party/blink/web_tests/svg/custom/percent-height.svg b/third_party/blink/web_tests/svg/custom/percent-height.svg index 57044a4..544179a2 100644 --- a/third_party/blink/web_tests/svg/custom/percent-height.svg +++ b/third_party/blink/web_tests/svg/custom/percent-height.svg
@@ -1,7 +1,7 @@ <svg xmlns="http://www.w3.org/2000/svg" onload="startTest()"> <script> if (self.internals) - internals.runtimeFlags.overlayScrollbarsEnabled = true; + internals.useMockOverlayScrollbars(); function startTest() { if (!window.testRunner)
diff --git a/third_party/blink/web_tests/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png deleted file mode 100644 index 8e6ebae..0000000 --- a/third_party/blink/web_tests/virtual/controls-refresh/fast/forms/controls-new-ui/file/file-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png b/third_party/blink/web_tests/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png deleted file mode 100644 index 86f92be..0000000 --- a/third_party/blink/web_tests/virtual/controls-refresh/fast/forms/controls-new-ui/select/select-multiple-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/README.txt b/third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/README.txt new file mode 100644 index 0000000..5f6dc75 --- /dev/null +++ b/third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/README.txt
@@ -0,0 +1 @@ +This directory contains tests that require non-mocked non-overlay scrollbars.
diff --git a/third_party/blink/web_tests/html/sections/body-quirk-client-size-expected.txt b/third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/body-quirk-client-size-expected.txt similarity index 69% rename from third_party/blink/web_tests/html/sections/body-quirk-client-size-expected.txt rename to third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/body-quirk-client-size-expected.txt index f51c3a6..2a77e24 100644 --- a/third_party/blink/web_tests/html/sections/body-quirk-client-size-expected.txt +++ b/third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/body-quirk-client-size-expected.txt
@@ -3,12 +3,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS [object Internals] is defined. -PASS internals.updateStyleAndReturnAffectedElementCount() is 1 -PASS 800 is 800 -PASS 600 is 600 -PASS internals.updateStyleAndReturnAffectedElementCount() is 1 -PASS 800 is 800 -PASS 600 is 600 +PASS internals.overlayScrollbarsEnabled is false PASS internals.updateStyleAndReturnAffectedElementCount() is 0 PASS 800 is 800 PASS 600 is > 585
diff --git a/third_party/blink/web_tests/html/sections/body-quirk-client-size.html b/third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/body-quirk-client-size.html similarity index 75% rename from third_party/blink/web_tests/html/sections/body-quirk-client-size.html rename to third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/body-quirk-client-size.html index 8973954..dec49cd 100644 --- a/third_party/blink/web_tests/html/sections/body-quirk-client-size.html +++ b/third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/body-quirk-client-size.html
@@ -1,5 +1,5 @@ <!-- quirks mode --> -<script src="../../resources/js-test.js"></script> +<script src="../../../resources/js-test.js"></script> <style> :root, body { width: 100%; height: 100%; margin: 0 } #container.wide { width: 5000px; height: 10px; } @@ -10,6 +10,7 @@ description("Style recalc when reading clientWidth/clientHeight of body in quirks mode."); shouldBeDefined(window.internals); + shouldBeFalse("internals.overlayScrollbarsEnabled"); function runClientSizeTest(testClass, expectWidthChange, expectHeightChange, expectedRecalcCount) { @@ -37,17 +38,6 @@ container.classList.remove(testClass) } - var originalOverlayScrollbars = internals.runtimeFlags.overlayScrollbarsEnabled; - - internals.runtimeFlags.overlayScrollbarsEnabled = true; - - runClientSizeTest("wide", false, false, 1); - runClientSizeTest("tall", false, false, 1); - - internals.runtimeFlags.overlayScrollbarsEnabled = false; - runClientSizeTest("wide", false, true, 0); runClientSizeTest("tall", true, false, 0); - - internals.runtimeFlags.overlayScrollbarsEnabled = originalOverlayScrollbars; </script>
diff --git a/third_party/blink/web_tests/fast/dom/root-client-size-expected.txt b/third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/root-client-size-expected.txt similarity index 70% rename from third_party/blink/web_tests/fast/dom/root-client-size-expected.txt rename to third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/root-client-size-expected.txt index f452cc5..8ebd17a 100644 --- a/third_party/blink/web_tests/fast/dom/root-client-size-expected.txt +++ b/third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/root-client-size-expected.txt
@@ -3,12 +3,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS [object Internals] is defined. -PASS internals.updateStyleAndReturnAffectedElementCount() is 1 -PASS 800 is 800 -PASS 600 is 600 -PASS internals.updateStyleAndReturnAffectedElementCount() is 1 -PASS 800 is 800 -PASS 600 is 600 +PASS internals.overlayScrollbarsEnabled is false PASS internals.updateStyleAndReturnAffectedElementCount() is 0 PASS 800 is 800 PASS 600 is > 585
diff --git a/third_party/blink/web_tests/fast/dom/root-client-size.html b/third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/root-client-size.html similarity index 76% rename from third_party/blink/web_tests/fast/dom/root-client-size.html rename to third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/root-client-size.html index 7a387306..34c0d51 100644 --- a/third_party/blink/web_tests/fast/dom/root-client-size.html +++ b/third_party/blink/web_tests/virtual/non-overlay-scrollbar/tests/root-client-size.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<script src="../../resources/js-test.js"></script> +<script src="../../../resources/js-test.js"></script> <style> :root { width: 100%; height: 100% } #container.wide { width: 5000px; height: 10px; } @@ -10,6 +10,7 @@ description("Style recalc when reading clientWidth/clientHeight of documentElement in strict mode."); shouldBeDefined(window.internals); + shouldBeFalse("internals.overlayScrollbarsEnabled"); function runClientSizeTest(testClass, expectWidthChange, expectHeightChange, expectedRecalcCount) { @@ -37,17 +38,6 @@ container.classList.remove(testClass) } - var originalOverlayScrollbars = internals.runtimeFlags.overlayScrollbarsEnabled; - - internals.runtimeFlags.overlayScrollbarsEnabled = true; - - runClientSizeTest("wide", false, false, 1); - runClientSizeTest("tall", false, false, 1); - - internals.runtimeFlags.overlayScrollbarsEnabled = false; - runClientSizeTest("wide", false, true, 0); runClientSizeTest("tall", true, false, 0); - - internals.runtimeFlags.overlayScrollbarsEnabled = originalOverlayScrollbars; </script>
diff --git a/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/README.txt b/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/README.txt new file mode 100644 index 0000000..50ec427 --- /dev/null +++ b/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/README.txt
@@ -0,0 +1 @@ +This directory contains tests that require non-mocked overlay scrollbars.
diff --git a/third_party/blink/web_tests/html/sections/body-quirk-client-size-expected.txt b/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/body-quirk-client-size-expected.txt similarity index 69% copy from third_party/blink/web_tests/html/sections/body-quirk-client-size-expected.txt copy to third_party/blink/web_tests/virtual/overlay-scrollbar/tests/body-quirk-client-size-expected.txt index f51c3a6..8a5ba635 100644 --- a/third_party/blink/web_tests/html/sections/body-quirk-client-size-expected.txt +++ b/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/body-quirk-client-size-expected.txt
@@ -3,18 +3,13 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS [object Internals] is defined. +PASS internals.overlayScrollbarsEnabled is true PASS internals.updateStyleAndReturnAffectedElementCount() is 1 PASS 800 is 800 PASS 600 is 600 PASS internals.updateStyleAndReturnAffectedElementCount() is 1 PASS 800 is 800 PASS 600 is 600 -PASS internals.updateStyleAndReturnAffectedElementCount() is 0 -PASS 800 is 800 -PASS 600 is > 585 -PASS internals.updateStyleAndReturnAffectedElementCount() is 0 -PASS 800 is > 785 -PASS 600 is 600 PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/body-quirk-client-size.html b/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/body-quirk-client-size.html new file mode 100644 index 0000000..542307e1 --- /dev/null +++ b/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/body-quirk-client-size.html
@@ -0,0 +1,35 @@ +<!-- quirks mode --> +<script src="../../../resources/js-test.js"></script> +<style> + :root, body { width: 100%; height: 100%; margin: 0 } + #container.wide { width: 5000px; height: 10px; } + #container.tall { height: 5000px; width: 10px; } +</style> +<div id="container"></div> +<script> + description("Style recalc when reading clientWidth/clientHeight of body in quirks mode."); + + shouldBeDefined(window.internals); + shouldBeTrue("internals.overlayScrollbarsEnabled"); + + function runClientSizeTest(testClass) { + + var origWidth = document.body.clientWidth; + var origHeight = document.body.clientHeight; + internals.updateStyleAndReturnAffectedElementCount(); + + container.classList.add(testClass) + + var afterWidth = document.body.clientWidth; + var afterHeight = document.body.clientHeight; + + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); + shouldBe(""+origWidth, ""+afterWidth); + shouldBe(""+origHeight, ""+afterHeight); + + container.classList.remove(testClass) + } + + runClientSizeTest("wide"); + runClientSizeTest("tall"); +</script>
diff --git a/third_party/blink/web_tests/plugins/overlay-scrollbar-mouse-capture-expected.txt b/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/plugin-overlay-scrollbar-mouse-capture-expected.txt similarity index 100% rename from third_party/blink/web_tests/plugins/overlay-scrollbar-mouse-capture-expected.txt rename to third_party/blink/web_tests/virtual/overlay-scrollbar/tests/plugin-overlay-scrollbar-mouse-capture-expected.txt
diff --git a/third_party/blink/web_tests/plugins/overlay-scrollbar-mouse-capture.html b/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/plugin-overlay-scrollbar-mouse-capture.html similarity index 83% rename from third_party/blink/web_tests/plugins/overlay-scrollbar-mouse-capture.html rename to third_party/blink/web_tests/virtual/overlay-scrollbar/tests/plugin-overlay-scrollbar-mouse-capture.html index c3519d2..5455bbe 100644 --- a/third_party/blink/web_tests/plugins/overlay-scrollbar-mouse-capture.html +++ b/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/plugin-overlay-scrollbar-mouse-capture.html
@@ -1,5 +1,5 @@ <head> - <script src="../resources/js-test.js"></script> + <script src="../../../resources/js-test.js"></script> <style> body { /* Hide the horizontal-scrollbar so that clicking right at the @@ -27,8 +27,7 @@ function runTest() { // Mouse down on the scrollbar thumb which is over the plugin. - eventSender.mouseMoveTo(window.innerWidth - 1, - 15); + eventSender.mouseMoveTo(window.innerWidth - 1, 50); eventSender.mouseDown(); // Drag the thumb down but move off the thumb, the plugin shouldn't // receive any events because there shouldn't be any mouse capture. @@ -52,13 +51,7 @@ finishJSTest(); return; } - - // TODO(bokan): This doesn't really enable overlays since it flips the - // RuntimeEnabledFeature after the ScrollbarTheme is initialized. It - // makes the non overlay scrollbars think they're overlay so it works - // for this test but it should probably be in a unit test. - internals.runtimeFlags.overlayScrollbarsEnabled = true; - + var d = document.getElementById('container'); internals.setScrollbarVisibilityInScrollableArea(d, true);
diff --git a/third_party/blink/web_tests/fast/dom/root-client-size-expected.txt b/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/root-client-size-expected.txt similarity index 69% copy from third_party/blink/web_tests/fast/dom/root-client-size-expected.txt copy to third_party/blink/web_tests/virtual/overlay-scrollbar/tests/root-client-size-expected.txt index f452cc5..9a124a2 100644 --- a/third_party/blink/web_tests/fast/dom/root-client-size-expected.txt +++ b/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/root-client-size-expected.txt
@@ -3,18 +3,13 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS [object Internals] is defined. +PASS internals.overlayScrollbarsEnabled is true PASS internals.updateStyleAndReturnAffectedElementCount() is 1 PASS 800 is 800 PASS 600 is 600 PASS internals.updateStyleAndReturnAffectedElementCount() is 1 PASS 800 is 800 PASS 600 is 600 -PASS internals.updateStyleAndReturnAffectedElementCount() is 0 -PASS 800 is 800 -PASS 600 is > 585 -PASS internals.updateStyleAndReturnAffectedElementCount() is 0 -PASS 800 is > 785 -PASS 600 is 600 PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/root-client-size.html b/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/root-client-size.html new file mode 100644 index 0000000..b16acba --- /dev/null +++ b/third_party/blink/web_tests/virtual/overlay-scrollbar/tests/root-client-size.html
@@ -0,0 +1,35 @@ +<!DOCTYPE html> +<script src="../../../resources/js-test.js"></script> +<style> + :root { width: 100%; height: 100% } + #container.wide { width: 5000px; height: 10px; } + #container.tall { height: 5000px; width: 10px; } +</style> +<div id="container"></div> +<script> + description("Style recalc when reading clientWidth/clientHeight of documentElement in strict mode."); + + shouldBeDefined(window.internals); + shouldBeTrue("internals.overlayScrollbarsEnabled"); + + function runClientSizeTest(testClass) { + + var origWidth = document.documentElement.clientWidth; + var origHeight = document.documentElement.clientHeight; + internals.updateStyleAndReturnAffectedElementCount(); + + container.classList.add(testClass) + + var afterWidth = document.documentElement.clientWidth; + var afterHeight = document.documentElement.clientHeight; + + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); + shouldBe(""+origWidth, ""+afterWidth); + shouldBe(""+origHeight, ""+afterHeight); + + container.classList.remove(testClass) + } + + runClientSizeTest("wide"); + runClientSizeTest("tall"); +</script>
diff --git a/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-expected.png b/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-expected.png deleted file mode 100644 index 825aa9b6..0000000 --- a/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png b/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png index 146fc4e..4fbd2b3e 100644 --- a/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png +++ b/third_party/blink/web_tests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-expected.png b/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-expected.png index b372409d..f8e7ba7 100644 --- a/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-expected.png +++ b/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-parents-expected.png b/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-parents-expected.png index 652f574..ed09e86 100644 --- a/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-parents-expected.png +++ b/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-parents-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-self-expected.png b/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-self-expected.png index adc09f2..dae4c98 100644 --- a/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-self-expected.png +++ b/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/blur-filter-page-scroll-self-expected.png Binary files differ
diff --git a/third_party/instrumented_libraries/BUILD.gn b/third_party/instrumented_libraries/BUILD.gn index cd69cf3..3d9c15d 100644 --- a/third_party/instrumented_libraries/BUILD.gn +++ b/third_party/instrumented_libraries/BUILD.gn
@@ -11,7 +11,11 @@ } group("deps") { - if (use_prebuilt_instrumented_libraries) { + if (use_locally_built_instrumented_libraries) { + deps = [ + ":locally_built", + ] + } else if (use_prebuilt_instrumented_libraries) { assert(prebuilt_instrumented_libraries_available, "Prebuilt instrumented libraries are only available when " + "is_msan = true and msan_track_origins = {0, 2}") @@ -22,11 +26,6 @@ ":prebuilt", ] } - if (use_locally_built_instrumented_libraries) { - deps = [ - ":locally_built", - ] - } } if (is_msan) { @@ -105,6 +104,7 @@ ":libasound2", ":libatk-bridge2.0-0", ":libatspi2.0-0", + ":libavahi-client3", ":libcairo2", ":libcap2", ":libcredentialkit_pkcs11", @@ -123,6 +123,8 @@ ":libgtk-3-0", ":libido3-0.1-0", ":libindicator3-7", + ":libjasper1", + ":libjpeg-turbo8", ":libnspr4", ":libp11-kit0", ":libpci3", @@ -363,6 +365,22 @@ ] } + instrumented_library("libavahi-client3") { + extra_configure_flags = [ + "--disable-static", + "--disable-introspection", + "--disable-gtk3", + + # From debian/rules. + "--enable-compat-libdns_sd", + "--disable-mono", + "--disable-monodoc", + "--disable-qt3", + "--with-systemdsystemunitdir=/lib/systemd/system", + ] + patch = "patches/libavahi-client3.diff" + } + instrumented_library("libcairo2") { extra_configure_flags = [ "--disable-gtk-doc", @@ -604,6 +622,24 @@ pre_build = "scripts/pre-build/autogen.sh" } + instrumented_library("libjasper1") { + extra_configure_flags = [ + "--disable-static", + + # From debian/rules. + "--enable-shared=yes", + ] + } + + instrumented_library("libjpeg-turbo8") { + extra_configure_flags = [ + "--disable-static", + + # From debian/rules. + "--with-jpeg8", + ] + } + instrumented_library("libnih1") { extra_configure_flags = [ "--disable-static" ]
diff --git a/third_party/instrumented_libraries/README.chromium b/third_party/instrumented_libraries/README.chromium index 222a25c..9659490 100644 --- a/third_party/instrumented_libraries/README.chromium +++ b/third_party/instrumented_libraries/README.chromium
@@ -7,8 +7,4 @@ Description: Scripts which can download and build several third party libraries -using different instrumentation tools (AddressSanitizer, etc.). - -Flag "use_instrumented_libraries=1" in GYP_DEFINES enables usage of -instrumented libraries and final binary will use them instead of standard -system shared libraries. +using different instrumentation tools (MemorySanitizer, etc.).
diff --git a/third_party/instrumented_libraries/binaries/msan-chained-origins-trusty.tgz.sha1 b/third_party/instrumented_libraries/binaries/msan-chained-origins-trusty.tgz.sha1 index 0f37fb8..7404ff2a 100644 --- a/third_party/instrumented_libraries/binaries/msan-chained-origins-trusty.tgz.sha1 +++ b/third_party/instrumented_libraries/binaries/msan-chained-origins-trusty.tgz.sha1
@@ -1 +1 @@ -8b12274d9abf6245670d4893f6d25aa916b051a1 \ No newline at end of file +8f2b76a50436632a9b1498940f06687e6150ecf3 \ No newline at end of file
diff --git a/third_party/instrumented_libraries/binaries/msan-no-origins-trusty.tgz.sha1 b/third_party/instrumented_libraries/binaries/msan-no-origins-trusty.tgz.sha1 index 19b73595..f256d409 100644 --- a/third_party/instrumented_libraries/binaries/msan-no-origins-trusty.tgz.sha1 +++ b/third_party/instrumented_libraries/binaries/msan-no-origins-trusty.tgz.sha1
@@ -1 +1 @@ -c7a988dae7eb3391e446a932de7f690698cf3a31 \ No newline at end of file +8de9f9d81d9df7034b0d037f372c63e80aff17e5 \ No newline at end of file
diff --git a/third_party/instrumented_libraries/patches/libavahi-client3.diff b/third_party/instrumented_libraries/patches/libavahi-client3.diff new file mode 100644 index 0000000..f5344a6d --- /dev/null +++ b/third_party/instrumented_libraries/patches/libavahi-client3.diff
@@ -0,0 +1,12 @@ +--- ./configure 2019-10-23 01:30:58.573430728 +0000 ++++ ../avahi-0.6.31-patched/configure 2019-10-23 01:30:44.741426407 +0000 +@@ -16892,7 +16892,8 @@ test -n "$PTHREAD_CC" || PTHREAD_CC="${C + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to check for GCC pthread/shared inconsistencies" >&5 + $as_echo_n "checking whether to check for GCC pthread/shared inconsistencies... " >&6; } +- check_inconsistencies=yes ++ # Necessary to make ./configure compatible with clang. ++ check_inconsistencies=no + case "${host_cpu}-${host_os}" in + *-darwin*) check_inconsistencies=no ;; + esac
diff --git a/third_party/instrumented_libraries/patches/nss.diff b/third_party/instrumented_libraries/patches/nss.diff index 5fef216..4fff2bab 100644 --- a/third_party/instrumented_libraries/patches/nss.diff +++ b/third_party/instrumented_libraries/patches/nss.diff
@@ -28,3 +28,28 @@ endif ifeq ($(CPU_ARCH),x86) ASFILES = mpi_x86.s +es +--- ./nss/lib/sysinit/nsssysinit.c 2019-10-23 01:27:12.205366237 +0000 ++++ ../nss-3.17.1-patched/nss/lib/sysinit/nsssysinit.c 2019-10-23 01:26:49.045359974 +0000 +@@ -42,7 +42,9 @@ testdir(char *dir) + static char * + getUserDB(void) + { +- char *userdir = PR_GetEnvSecure("HOME"); ++ # Prevent nss from trying to pull in PR_GetEnvSecure from libnspr4, which ++ # the latter library doesn't seem to export. ++ char *userdir = secure_getenv("HOME"); + char *nssdir = NULL; + + if (userdir == NULL) { +@@ -134,7 +134,7 @@ userCanModifySystemDB() + static PRBool + getFIPSEnv(void) + { +- char *fipsEnv = PR_GetEnvSecure("NSS_FIPS"); ++ # Prevent nss from trying to pull in PR_GetEnvSecure from libnspr4, which ++ # the latter library doesn't seem to export. ++ char *fipsEnv = secure_getenv("NSS_FIPS"); + if (!fipsEnv) { + return PR_FALSE; + }
diff --git a/third_party/instrumented_libraries/scripts/install-build-deps.sh b/third_party/instrumented_libraries/scripts/install-build-deps.sh index 5dc8f80..e53686e 100755 --- a/third_party/instrumented_libraries/scripts/install-build-deps.sh +++ b/third_party/instrumented_libraries/scripts/install-build-deps.sh
@@ -23,6 +23,7 @@ libasound2 \ libatk-bridge2.0-0 \ libatspi2.0-0 \ +libavahi-client3 \ libcairo2 \ libcap2 \ libcups2 \ @@ -42,6 +43,8 @@ libgtk2.0-bin \ libido3-0.1-0 \ libindicator3-7 \ +libjasper1 \ +libjpeg-turbo8 \ libnspr4 \ libp11-kit0 \ libpci3 \
diff --git a/tools/binary_size/libsupersize/caspian/caspian_web.cc b/tools/binary_size/libsupersize/caspian/caspian_web.cc index 3d4cc74..176d03d0 100644 --- a/tools/binary_size/libsupersize/caspian/caspian_web.cc +++ b/tools/binary_size/libsupersize/caspian/caspian_web.cc
@@ -18,43 +18,26 @@ #include "tools/binary_size/libsupersize/caspian/file_format.h" #include "tools/binary_size/libsupersize/caspian/model.h" +namespace caspian { namespace { -caspian::SizeInfo info; +SizeInfo info; -caspian::TreeNode root; +TreeNode root; // TODO: A full hash table might be overkill here - could walk tree to find // node. -std::unordered_map<std::string_view, caspian::TreeNode*> parents; +std::unordered_map<std::string_view, TreeNode*> parents; std::unique_ptr<Json::StreamWriter> writer; /** Name used by a directory created to hold symbols with no name. */ -const char* _NO_NAME = "(No path)"; +const char* NO_NAME = "(No path)"; -std::string ToJson(const Json::Value& value) { +std::string JsonSerialize(const Json::Value& value) { std::stringstream s; writer->write(value, &s); return s.str(); } -void OpenIntoJson(const caspian::TreeNode* node, Json::Value* out, int depth) { - (*out)["idPath"] = std::string(node->id_path); - (*out)["shortNameIndex"] = node->short_name_index; - // TODO: Put correct information. - (*out)["type"] = "D"; - (*out)["size"] = node->size; - (*out)["flags"] = node->flags; - (*out)["childStats"] = Json::Value(Json::objectValue); - if (depth < 0) { - (*out)["children"] = Json::Value(); // null - } else { - (*out)["children"] = Json::Value(Json::arrayValue); - for (unsigned int i = 0; i < node->children.size(); i++) { - OpenIntoJson(node->children[i], &(*out)["children"][i], depth - 1); - } - } -} - std::string_view DirName(std::string_view path, char sep) { auto end = path.find_last_of(sep); if (end != std::string_view::npos) { @@ -65,7 +48,7 @@ return ""; } -void AttachToParent(caspian::TreeNode* child, caspian::TreeNode* parent) { +void AttachToParent(TreeNode* child, TreeNode* parent) { if (child->parent != nullptr) { std::cerr << "Child " << child->id_path << " already attached to parent " << child->parent->id_path << std::endl; @@ -77,28 +60,29 @@ child->parent = parent; // Update size information along tree. - caspian::TreeNode* node = child; + TreeNode* node = child; while (node->parent) { node->parent->size += child->size; + node->parent->node_stats += child->node_stats; node = node->parent; } } -caspian::TreeNode* GetOrMakeParentNode(caspian::TreeNode* child_node) { +TreeNode* GetOrMakeParentNode(TreeNode* child_node) { std::string_view parent_path; if (child_node->id_path.empty()) { - parent_path = _NO_NAME; + parent_path = NO_NAME; } else { parent_path = DirName(child_node->id_path, '/'); } - caspian::TreeNode*& parent = parents[parent_path]; + TreeNode*& parent = parents[parent_path]; if (parent == nullptr) { - parent = new caspian::TreeNode(); + parent = new TreeNode(); parent->id_path = parent_path; parent->short_name_index = parent_path.find_last_of('/') + 1; - // TODO: Set parent type to directory or component. - parents[parent_path] = parent; + // TODO: Container type might be a component instead of a directory. + parent->containerType = ContainerType::kDirectory; } if (child_node->parent != parent) { AttachToParent(child_node, parent); @@ -107,36 +91,40 @@ } void AddFileEntry(const std::string_view source_path, - const std::vector<const caspian::Symbol*>& symbols) { + const std::vector<const Symbol*>& symbols) { // Creates a single file node with a child for each symbol in that file. - caspian::TreeNode* file_node = new caspian::TreeNode(); + TreeNode* file_node = new TreeNode(); + file_node->containerType = ContainerType::kFile; if (source_path.empty()) { - file_node->id_path = _NO_NAME; + file_node->id_path = NO_NAME; } else { file_node->id_path = source_path; } file_node->short_name_index = source_path.find_last_of('/') + 1; + parents[file_node->id_path] = file_node; // TODO: Initialize file type, source path, component // Create symbol nodes. for (const auto sym : symbols) { - caspian::TreeNode* symbol_node = new caspian::TreeNode(); + TreeNode* symbol_node = new TreeNode(); + symbol_node->containerType = ContainerType::kSymbol; symbol_node->id_path = sym->full_name; symbol_node->size = sym->size; + symbol_node->node_stats = + NodeStats(info.ShortSectionName(sym->section_name), 1, 0, sym->size); AttachToParent(symbol_node, file_node); } // TODO: Only add if there are unfiltered symbols in this file. - caspian::TreeNode* orphan_node = file_node; + TreeNode* orphan_node = file_node; while (orphan_node != &root) { orphan_node = GetOrMakeParentNode(orphan_node); } } -void AddSymbolsAndFileNodes(caspian::SizeInfo* size_info) { +void AddSymbolsAndFileNodes(SizeInfo* size_info) { // Group symbols by source path. - std::unordered_map<std::string_view, std::vector<const caspian::Symbol*>> - symbols; + std::unordered_map<std::string_view, std::vector<const Symbol*>> symbols; for (auto& sym : size_info->raw_symbols) { std::string_view key = sym.source_path; if (key == nullptr) { @@ -153,8 +141,9 @@ extern "C" { bool LoadSizeFile(const char* compressed, size_t size) { writer.reset(Json::StreamWriterBuilder().newStreamWriter()); - caspian::ParseSizeInfo(compressed, size, &info); + ParseSizeInfo(compressed, size, &info); // Build tree + root.containerType = ContainerType::kDirectory; root.id_path = "/"; parents[""] = &root; AddSymbolsAndFileNodes(&info); @@ -168,8 +157,8 @@ if (node != parents.end()) { Json::Value v; - OpenIntoJson(node->second, &v, 1); - result = ToJson(v); + node->second->WriteIntoJson(&v, 1); + result = JsonSerialize(v); return result.c_str(); } else { std::cerr << "Tried to open nonexistent node with path: " << path @@ -178,3 +167,4 @@ } } } // extern "C" +} // namespace caspian
diff --git a/tools/binary_size/libsupersize/caspian/model.cc b/tools/binary_size/libsupersize/caspian/model.cc index f8191ff..9b561f9 100644 --- a/tools/binary_size/libsupersize/caspian/model.cc +++ b/tools/binary_size/libsupersize/caspian/model.cc
@@ -4,6 +4,10 @@ #include "tools/binary_size/libsupersize/caspian/model.h" +#include <algorithm> +#include <iostream> +#include <string> + #include "tools/binary_size/libsupersize/caspian/file_format.h" using namespace caspian; @@ -16,3 +20,111 @@ SizeInfo::SizeInfo() = default; SizeInfo::~SizeInfo() = default; + +SectionId SizeInfo::ShortSectionName(const char* section_name) { + static std::map<const char*, SectionId> short_section_name_cache; + SectionId& ret = short_section_name_cache[section_name]; + if (ret == SectionId::kNone) { + if (!strcmp(section_name, ".text")) { + ret = SectionId::kText; + } else if (!strcmp(section_name, ".dex")) { + ret = SectionId::kDex; + } else if (!strcmp(section_name, ".dex.method")) { + ret = SectionId::kDex; + } else if (!strcmp(section_name, ".other")) { + ret = SectionId::kOther; + } else if (!strcmp(section_name, ".rodata")) { + ret = SectionId::kRoData; + } else if (!strcmp(section_name, ".data")) { + ret = SectionId::kData; + } else if (!strcmp(section_name, ".data.rel.ro")) { + ret = SectionId::kDataRelRo; + } else if (!strcmp(section_name, ".bss")) { + ret = SectionId::kBss; + } else if (!strcmp(section_name, ".bss.rel.ro")) { + ret = SectionId::kBss; + } else if (!strcmp(section_name, ".pak.nontranslated")) { + ret = SectionId::kPakNontranslated; + } else if (!strcmp(section_name, ".pak.translations")) { + ret = SectionId::kPakTranslations; + } else { + std::cerr << "Attributing unrecognized section name to .other: " + << section_name << std::endl; + ret = SectionId::kOther; + } + } + return ret; +} + +void TreeNode::WriteIntoJson(Json::Value* out, int depth) { + (*out)["idPath"] = std::string(this->id_path); + (*out)["shortNameIndex"] = this->short_name_index; + // TODO: Put correct information. + std::string type; + if (containerType != ContainerType::kSymbol) { + type += static_cast<char>(containerType); + } + SectionId biggest_section = this->node_stats.ComputeBiggestSection(); + type += static_cast<char>(biggest_section); + (*out)["type"] = type; + + (*out)["size"] = this->size; + (*out)["flags"] = this->flags; + this->node_stats.WriteIntoJson(&(*out)["childStats"]); + if (depth < 0 && this->children.size() > 1) { + (*out)["children"] = Json::Value(); // null + } else { + (*out)["children"] = Json::Value(Json::arrayValue); + // Reorder children for output. + // TODO: Support additional compare functions. + auto compare_func = [](const TreeNode* const& l, + const TreeNode* const& r) -> bool { + return l->size > r->size; + }; + std::sort(this->children.begin(), this->children.end(), compare_func); + for (unsigned int i = 0; i < this->children.size(); i++) { + this->children[i]->WriteIntoJson(&(*out)["children"][i], depth - 1); + } + } +} + +NodeStats::NodeStats() = default; +NodeStats::~NodeStats() = default; + +NodeStats::NodeStats(SectionId sectionId, + int32_t count, + int32_t highlight, + int32_t size) { + childStats[sectionId] = {count, highlight, size}; +} + +void NodeStats::WriteIntoJson(Json::Value* out) const { + (*out) = Json::Value(Json::objectValue); + for (const auto kv : this->childStats) { + const std::string sectionId = std::string(1, static_cast<char>(kv.first)); + const Stat stats = kv.second; + (*out)[sectionId] = Json::Value(Json::objectValue); + (*out)[sectionId]["size"] = stats.size; + (*out)[sectionId]["count"] = stats.count; + (*out)[sectionId]["highlight"] = stats.highlight; + } +} + +NodeStats& NodeStats::operator+=(const NodeStats& other) { + for (const auto& it : other.childStats) { + childStats[it.first] += it.second; + } + return *this; +} + +SectionId NodeStats::ComputeBiggestSection() const { + SectionId ret = SectionId::kNone; + int32_t max = 0; + for (auto& pair : childStats) { + if (pair.second.size > max) { + ret = pair.first; + max = pair.second.size; + } + } + return ret; +}
diff --git a/tools/binary_size/libsupersize/caspian/model.h b/tools/binary_size/libsupersize/caspian/model.h index 1c6fc713..9f4d409 100644 --- a/tools/binary_size/libsupersize/caspian/model.h +++ b/tools/binary_size/libsupersize/caspian/model.h
@@ -8,6 +8,7 @@ #include <stdlib.h> #include <deque> +#include <map> #include <vector> #include "third_party/jsoncpp/source/include/json/json.h" @@ -16,6 +17,29 @@ namespace caspian { +enum class ContainerType : char { + kSymbol = '\0', + kDirectory = 'D', + kComponent = 'C', + kFile = 'F', + kJavaClass = 'J', +}; + +enum class SectionId : char { + // kNone is unused except for default-initializing in containers + kNone = '\0', + kBss = 'b', + kData = 'd', + kDataRelRo = 'R', + kDex = 'x', + kDexMethod = 'm', + kOther = 'o', + kRoData = 'r', + kText = 't', + kPakNontranslated = 'P', + kPakTranslations = 'p', +}; + struct Symbol { Symbol(); Symbol(const Symbol& other); @@ -24,41 +48,21 @@ int32_t size = 0; int32_t flags = 0; int32_t padding = 0; - const char* full_name = nullptr; + // Pointers into SizeInfo->raw_decompressed; const char* section_name = nullptr; + const char* full_name = nullptr; const char* object_path = nullptr; const char* source_path = nullptr; const char* component = nullptr; std::vector<Symbol*>* aliases = nullptr; }; -struct TreeNode { - TreeNode(); - ~TreeNode(); - - std::string_view id_path; - const char* src_path = nullptr; - const char* component = nullptr; - int32_t size = 0; - int32_t flags = 0; - int32_t short_name_index = 0; - - /* - type, - numAliases, - childStats, - */ - - std::deque<TreeNode*> children; - TreeNode* parent = nullptr; - Symbol* symbol = nullptr; -}; - struct SizeInfo { SizeInfo(); ~SizeInfo(); SizeInfo(const SizeInfo& other) = delete; SizeInfo& operator=(const SizeInfo& other) = delete; + SectionId ShortSectionName(const char* section_name); std::vector<caspian::Symbol> raw_symbols; Json::Value metadata; @@ -74,5 +78,54 @@ std::deque<std::vector<Symbol*>> alias_groups; }; +struct Stat { + int32_t count = 0; + int32_t highlight = 0; + int32_t size = 0; + + void operator+=(const Stat& other) { + count += other.count; + highlight += other.highlight; + size += other.size; + } +}; + +struct NodeStats { + NodeStats(); + ~NodeStats(); + NodeStats(SectionId section, int32_t count, int32_t highlight, int32_t size); + void WriteIntoJson(Json::Value* out) const; + NodeStats& operator+=(const NodeStats& other); + SectionId ComputeBiggestSection() const; + + std::map<SectionId, Stat> childStats; +}; + +struct TreeNode { + TreeNode(); + ~TreeNode(); + void WriteIntoJson(Json::Value* out, int depth); + + std::string_view id_path; + const char* src_path = nullptr; + const char* component = nullptr; + int32_t size = 0; + NodeStats node_stats; + int32_t flags = 0; + int32_t short_name_index = 0; + + /* + type, + numAliases, + childStats, + */ + + ContainerType containerType = ContainerType::kSymbol; + + std::vector<TreeNode*> children; + TreeNode* parent = nullptr; + Symbol* symbol = nullptr; +}; + } // namespace caspian #endif // TOOLS_BINARY_SIZE_LIBSUPERSIZE_CASPIAN_MODEL_H_
diff --git a/tools/binary_size/trybot_commit_size_checker.py b/tools/binary_size/trybot_commit_size_checker.py index 515c9c9..ef673b3 100755 --- a/tools/binary_size/trybot_commit_size_checker.py +++ b/tools/binary_size/trybot_commit_size_checker.py
@@ -114,12 +114,25 @@ def _CreateMethodCountDelta(symbols): - symbols = symbols.WhereInSection(models.SECTION_DEX_METHOD) - lines, net_added = _SymbolDiffHelper(symbols) - details = 'Refer to Dex Method Diff for list of added/removed methods.' + method_symbols = symbols.WhereInSection(models.SECTION_DEX_METHOD) + method_lines, net_method_added = _SymbolDiffHelper(method_symbols) + class_symbols = symbols.WhereInSection( + models.SECTION_DEX).WhereNameMatches('#').Inverted() + class_lines, _ = _SymbolDiffHelper(class_symbols) + details = ( + 'Refer to Dex Class and Method Diff for list of added/removed methods.') + lines = [] + if class_lines: + lines.append('===== Classes Added & Removed =====') + lines.extend(class_lines) + lines.extend(['', '']) # empty lines added for clarity + if method_lines: + lines.append('===== Methods Added & Removed =====') + lines.extend(method_lines) return lines, _SizeDelta('Dex Methods Count', 'methods', - _MAX_DEX_METHOD_COUNT_INCREASE, net_added, details) + _MAX_DEX_METHOD_COUNT_INCREASE, net_method_added, + details) def _CreateResourceSizesDelta(apk_name, before_dir, after_dir): @@ -158,6 +171,14 @@ ] +def _CreateTestingSymbolssDeltas(symbols): + testing_symbols = symbols.WhereNameMatches('ForTest').WhereDiffStatusIs( + models.DIFF_STATUS_ADDED) + lines = list(describe.GenerateLines(testing_symbols, summarize=False)) + return lines, _SizeDelta('Added symbols named "ForTest"', 'symbols', 0, + len(testing_symbols), None) + + def _FormatSign(number): if number > 0: return '+{}'.format(number) @@ -214,6 +235,12 @@ _CreateMutableConstantsDelta(changed_symbols)) size_deltas.add(mutable_constants_delta) + # Look for symbols with 'ForTesting' in their name. + logging.info('Checking for symbols named "ForTest"') + testing_symbols_lines, test_symbols_delta = ( + _CreateTestingSymbolssDeltas(changed_symbols)) + size_deltas.add(test_symbols_delta) + # Check for uncompressed .pak file entries being added to avoid unnecessary # bloat. logging.info('Checking pak symbols') @@ -273,7 +300,11 @@ 'lines': mutable_constants_lines, }, { - 'name': '>>> Dex Method Diff <<<', + 'name': '>>> "ForTest" Symbols Diff <<<', + 'lines': testing_symbols_lines, + }, + { + 'name': '>>> Dex Class and Method Diff <<<', 'lines': dex_delta_lines, }, { @@ -285,7 +316,7 @@ 'url': _HTML_REPORT_BASE_URL + '{{' + _NDJSON_FILENAME + '}}', }, ] - # Remove empty diffs (Mutable Constants or Dex Method). + # Remove empty diffs (Mutable Constants, Dex Method, ...). links_json = [o for o in links_json if o.get('lines') or o.get('url')] binary_size_listings = []
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 8f21890..d94d84b 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -322,6 +322,7 @@ 'Win 10 Fast Ring': 'release_trybot', 'win-annotator-rel': 'release_bot', 'win-autofill-captured-sites-rel': 'release_bot', + 'win-celab-builder-rel': 'celab_release_bot', 'win-password-manager-captured-sites-rel': 'release_bot', 'win-pixel-builder-rel': 'release_bot', 'win32-arm64-rel': 'win32_arm64_release_bot', @@ -611,7 +612,6 @@ 'Win x64 Builder': 'gpu_tests_release_bot_minimal_symbols', 'Win x64 Builder (dbg)': 'gpu_tests_debug_bot', 'Windows deterministic': 'release_bot_x86_minimal_symbols', - 'win-celab-builder-rel': 'celab_release_bot', }, 'internal.chrome.fyi': { @@ -1594,7 +1594,7 @@ ], 'gpu_fyi_tests_dx12vk_release_trybot': [ - 'gpu_fyi_tests', 'dx12vk', + 'gpu_fyi_tests', 'dx12vk', 'release_trybot', ], 'gpu_tests_android_release_bot_minimal_symbols_arm64': [
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index a6faebe1..8a8eb982 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -25188,6 +25188,11 @@ <int value="3064" label="V8RegExpExecCalledOnSlowRegExp"/> <int value="3065" label="V8RegExpReplaceCalledOnSlowRegExp"/> <int value="3066" label="HasMarkerPseudoElement"/> + <int value="3067" label="WindowMove"/> + <int value="3068" label="WindowResize"/> + <int value="3069" label="MovedOrResizedPopup"/> + <int value="3070" label="MovedOrResizedPopup2sAfterCreation"/> + <int value="3071" label="DOMWindowOpenPositioningFeatures"/> </enum> <enum name="FeaturePolicyAllowlistType"> @@ -35310,6 +35315,7 @@ <int value="-2106960993" label="HarfBuzzPDFSubsetter:disabled"/> <int value="-2105133782" label="GesturePropertiesDBusService:enabled"/> <int value="-2104950596" label="HandwritingGesture:enabled"/> + <int value="-2104654357" label="GamesHub:enabled"/> <int value="-2101682955" label="EnableNotificationIndicator:enabled"/> <int value="-2101337189" label="AutofillOffNoServerData:disabled"/> <int value="-2099457894" label="Mash:enabled"/> @@ -38192,6 +38198,7 @@ label="OmniboxUIExperimentWhiteBackgroundOnBlur:disabled"/> <int value="1617187093" label="enable-improved-a2hs"/> <int value="1618633341" label="MashOopViz:enabled"/> + <int value="1619516032" label="GamesHub:disabled"/> <int value="1620369597" label="enable-unsafe-webgpu"/> <int value="1621298798" label="VrBrowserKeyboard:enabled"/> <int value="1622131033" label="ozone-test-single-overlay-support"/>
diff --git a/tools/metrics/histograms/expand_owners.py b/tools/metrics/histograms/expand_owners.py index 5967ed4..0e5ff3f 100644 --- a/tools/metrics/histograms/expand_owners.py +++ b/tools/metrics/histograms/expand_owners.py
@@ -303,9 +303,10 @@ Error: Raised if the OWNERS file with the given path does not exist. """ email_pattern = re.compile(_EMAIL_PATTERN) + iter_matches = extract_histograms.IterElementsWithTag - for histogram in histograms.getElementsByTagName('histogram'): - owners = histogram.getElementsByTagName('owner') + for histogram in iter_matches(histograms, 'histogram'): + owners = [owner for owner in iter_matches(histogram, 'owner', 1)] # owner is a DOM Element with a single child, which is a DOM Text Node. emails_with_dom_elements = set([ @@ -316,12 +317,10 @@ # component is a DOM Element with a single child, which is a DOM Text Node. components_with_dom_elements = set([ extract_histograms.NormalizeString(component.childNodes[0].data) - for component in histogram.getElementsByTagName('component')]) + for component in iter_matches(histogram, 'component', 1)]) - for index in range(len(owners)): - owner = owners[index] + for index, owner in enumerate(owners): owner_text = owner.childNodes[0].data - name = histogram.getAttribute('name') if _IsEmailOrPlaceholder(index == 0, owner_text, name): continue
diff --git a/tools/metrics/histograms/extract_histograms.py b/tools/metrics/histograms/extract_histograms.py index 003314f9..fdb9b6d5 100644 --- a/tools/metrics/histograms/extract_histograms.py +++ b/tools/metrics/histograms/extract_histograms.py
@@ -55,6 +55,7 @@ </histogram-configuration> """ +import bisect import copy import datetime @@ -82,10 +83,59 @@ EXPIRY_MILESTONE_RE = re.compile(r'M[0-9]{2,3}\Z') +_ELEMENT_NODE = xml.dom.minidom.Node.ELEMENT_NODE + +# List of fields that need to copied by copy.copy to suffixed histogram. +# Other fields may be copied by reference. +_HISTOGRAM_COPY_FIELDS = [ + 'fieldtrial_groups', 'fieldtrial_names', 'fieldtrial_labels'] + + class Error(Exception): pass +def IterElementsWithTag(root, tag, depth=-1): + """Iterates over DOM tree and yields elements matching tag name. + + It's meant to be replacement for `getElementsByTagName`, + (which does recursive search) but without recursive search + (nested tags are not supported in histograms files). + + Note: This generator stops going deeper in the tree when it detects + that there are elements with given tag. + + Args: + root: XML dom tree. + tag: Element's tag name. + depth: Defines how deep in the tree function should search for a match. + + Yields: + xml.dom.minidom.Node: Element matching criteria. + """ + if depth == 0 and root.nodeType == _ELEMENT_NODE and root.tagName == tag: + yield root + return + + had_tag = False + + skipped = 0 + + for child in root.childNodes: + if child.nodeType == _ELEMENT_NODE and child.tagName == tag: + had_tag = True + yield child + else: + skipped += 1 + + depth -= 1 + + if not had_tag and depth != 0: + for child in root.childNodes: + for match in IterElementsWithTag(child, tag, depth): + yield match + + def _GetTextFromChildNodes(node): """Returns a string concatenation of the text of the given node's children. @@ -160,7 +210,7 @@ Returns: The normalized minidom node. """ - if node.nodeType == xml.dom.minidom.Node.ELEMENT_NODE: + if node.nodeType == _ELEMENT_NODE: for a in node.attributes.keys(): node.attributes[a].value = NormalizeString(node.attributes[a].value) @@ -234,7 +284,7 @@ have_errors = False last_name = None - for enum in tree.getElementsByTagName('enum'): + for enum in IterElementsWithTag(tree, 'enum'): name = enum.getAttribute('name') if last_name is not None and name.lower() < last_name.lower(): logging.error('Enums %s and %s are not in alphabetical order', last_name, @@ -251,7 +301,9 @@ enum_dict['name'] = name enum_dict['values'] = {} - for int_tag in enum.getElementsByTagName('int'): + nodes = list(IterElementsWithTag(enum, 'int')) + + for int_tag in nodes: value_dict = {} int_value = int(int_tag.getAttribute('value')) if int_value in enum_dict['values']: @@ -265,7 +317,7 @@ enum_int_values = sorted(enum_dict['values'].keys()) last_int_value = None - for int_tag in enum.getElementsByTagName('int'): + for int_tag in nodes: int_value = int(int_tag.getAttribute('value')) if last_int_value is not None and int_value < last_int_value: logging.error('Enum %s int values %d and %d are not in numerical order', @@ -282,9 +334,9 @@ else: last_int_value = int_value - summary_nodes = enum.getElementsByTagName('summary') - if summary_nodes: - enum_dict['summary'] = _GetTextFromChildNodes(summary_nodes[0]) + for summary in IterElementsWithTag(enum, 'summary'): + enum_dict['summary'] = _GetTextFromChildNodes(summary) + break enums[name] = enum_dict @@ -309,8 +361,9 @@ owners = [] has_owner = False - for owner_node in histogram.getElementsByTagName('owner'): - owner_text = _GetTextFromChildNodes(owner_node) + for owner_node in IterElementsWithTag(histogram, 'owner', 1): + child = owner_node.firstChild + owner_text = (child and child.nodeValue) or '' is_email = email_pattern.match(owner_text) if owner_text and (is_email or OWNER_PLACEHOLDER in owner_text): @@ -355,7 +408,7 @@ histograms = {} have_errors = False last_name = None - for histogram in tree.getElementsByTagName('histogram'): + for histogram in IterElementsWithTag(tree, 'histogram'): name = histogram.getAttribute('name') if last_name is not None and name.lower() < last_name.lower(): logging.error('Histograms %s and %s are not in alphabetical order', @@ -382,12 +435,12 @@ have_errors = True # Find <owner> tag. - owners, hasOwner = _ExtractOwners(histogram) + owners, has_owner = _ExtractOwners(histogram) if owners: histogram_entry['owners'] = owners # Find <summary> tag. - summary_nodes = histogram.getElementsByTagName('summary') + summary_nodes = list(IterElementsWithTag(histogram, 'summary')) if summary_nodes: histogram_entry['summary'] = _GetTextFromChildNodes(summary_nodes[0]) @@ -395,7 +448,7 @@ histogram_entry['summary'] = 'TBD' # Find <obsolete> tag. - obsolete_nodes = histogram.getElementsByTagName('obsolete') + obsolete_nodes = list(IterElementsWithTag(histogram, 'obsolete', 1)) if obsolete_nodes: reason = _GetTextFromChildNodes(obsolete_nodes[0]) histogram_entry['obsolete'] = reason @@ -406,7 +459,7 @@ have_errors = True # Non-obsolete histograms should specify <owner>s. - if not obsolete_nodes and not hasOwner: + if not obsolete_nodes and not has_owner: logging.error('histogram %s should specify <owner>s', name) have_errors = True @@ -421,9 +474,9 @@ histogram_entry['units'] = histogram.getAttribute('units') # Find <details> tag. - details_nodes = histogram.getElementsByTagName('details') - if details_nodes: - histogram_entry['details'] = _GetTextFromChildNodes(details_nodes[0]) + for node in IterElementsWithTag(histogram, 'details'): + histogram_entry['details'] = _GetTextFromChildNodes(node) + break # Handle enum types. if histogram.hasAttribute('enum'): @@ -476,7 +529,9 @@ # Verify order of histogram_suffixes fields first. last_name = None - for histogram_suffixes in tree.getElementsByTagName(histogram_suffix_tag): + + for histogram_suffixes in IterElementsWithTag( + tree, histogram_suffix_tag, depth=1): name = histogram_suffixes.getAttribute('name') if last_name is not None and name.lower() < last_name.lower(): logging.error('histogram_suffixes %s and %s are not in alphabetical ' @@ -491,7 +546,7 @@ reprocess_queue = [] def GenerateHistogramSuffixes(): - for f in tree.getElementsByTagName(histogram_suffix_tag): + for f in IterElementsWithTag(tree, histogram_suffix_tag): yield 0, f for r, f in reprocess_queue: yield r, f @@ -499,8 +554,8 @@ for reprocess_count, histogram_suffixes in GenerateHistogramSuffixes(): # Check dependencies first dependencies_valid = True - affected_histograms = histogram_suffixes.getElementsByTagName( - 'affected-histogram') + affected_histograms = list(IterElementsWithTag( + histogram_suffixes, 'affected-histogram', 1)) for affected_histogram in affected_histograms: histogram_name = affected_histogram.getAttribute('name') if histogram_name not in histograms: @@ -524,7 +579,7 @@ group_obsolete_reason = _GetObsoleteReason(histogram_suffixes) name = histogram_suffixes.getAttribute('name') - suffix_nodes = histogram_suffixes.getElementsByTagName(suffix_tag) + suffix_nodes = list(IterElementsWithTag(histogram_suffixes, suffix_tag, 1)) suffix_labels = {} for suffix in suffix_nodes: suffix_name = suffix.getAttribute('name') @@ -546,7 +601,7 @@ histogram_name, name) have_errors = True last_histogram_name = histogram_name - with_suffixes = affected_histogram.getElementsByTagName(with_tag) + with_suffixes = list(IterElementsWithTag(affected_histogram, with_tag, 1)) if with_suffixes: suffixes_to_add = with_suffixes else: @@ -571,26 +626,20 @@ suffix_label = suffix_labels.get(suffix_name, '') + histogram_entry = histograms[new_histogram_name] + for field_name in _HISTOGRAM_COPY_FIELDS: + histogram_entry.setdefault(field_name, []) + # TODO(yiyaoliu): Rename these to be consistent with the new naming. # It is kept unchanged for now to be it's used by dashboards. - if 'fieldtrial_groups' not in histograms[new_histogram_name]: - histograms[new_histogram_name]['fieldtrial_groups'] = [] - histograms[new_histogram_name]['fieldtrial_groups'].append( - suffix_name) - - if 'fieldtrial_names' not in histograms[new_histogram_name]: - histograms[new_histogram_name]['fieldtrial_names'] = [] - histograms[new_histogram_name]['fieldtrial_names'].append(name) - - if 'fieldtrial_labels' not in histograms[new_histogram_name]: - histograms[new_histogram_name]['fieldtrial_labels'] = [] - histograms[new_histogram_name]['fieldtrial_labels'].append( - suffix_label) + histogram_entry['fieldtrial_groups'].append(suffix_name) + histogram_entry['fieldtrial_names'].append(name) + histogram_entry['fieldtrial_labels'].append(suffix_label) # If no owners are added for this histogram-suffixes, it inherits the # owners of its parents. if owners: - histograms[new_histogram_name]['owners'] = owners + histogram_entry['owners'] = owners # If a suffix has an obsolete node, it's marked as obsolete for the # specified reason, overwriting its group's obsoletion reason if the @@ -602,9 +651,9 @@ # If the suffix has an obsolete tag, all histograms it generates # inherit it. if obsolete_reason: - histograms[new_histogram_name]['obsolete'] = obsolete_reason + histogram_entry['obsolete'] = obsolete_reason - _ProcessBaseHistogramAttribute(suffix, histograms[new_histogram_name]) + _ProcessBaseHistogramAttribute(suffix, histogram_entry) except Error: have_errors = True @@ -612,6 +661,26 @@ return have_errors +def _GetTagSubTree(tree, tag, depth): + """Returns sub tree with tag element as a root. + + When no element with tag name is found or there are many of them + original tree is returned. + + Args: + tree: XML dom tree. + tag: Element's tag name. + depth: Defines how deep in the tree function should search for a match. + + Returns: + xml.dom.minidom.Node: Sub tree (matching criteria) or original one. + """ + entries = list(IterElementsWithTag(tree, tag, depth)) + if len(entries) == 1: + tree = entries[0] + return tree + + def ExtractHistogramsFromDom(tree): """Computes the histogram names and descriptions from the XML representation. @@ -621,13 +690,18 @@ Returns: a tuple of (histograms, status) where histograms is a dictionary mapping histogram names to dictionaries containing histogram descriptions and status - is a boolean indicating if errros were encoutered in processing. + is a boolean indicating if errros were encountered in processing. """ _NormalizeAllAttributeValues(tree) - enums, enum_errors = ExtractEnumsFromXmlTree(tree) - histograms, histogram_errors = _ExtractHistogramsFromXmlTree(tree, enums) - update_errors = _UpdateHistogramsWithSuffixes(tree, histograms) + enums_tree = _GetTagSubTree(tree, 'enums', 2) + histograms_tree = _GetTagSubTree(tree, 'histograms', 2) + histogram_suffixes_tree = _GetTagSubTree(tree, 'histogram_suffixes_list', 2) + enums, enum_errors = ExtractEnumsFromXmlTree(enums_tree) + histograms, histogram_errors = _ExtractHistogramsFromXmlTree( + histograms_tree, enums) + update_errors = _UpdateHistogramsWithSuffixes( + histogram_suffixes_tree, histograms) return histograms, enum_errors or histogram_errors or update_errors
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index d8a9998..5d620bb 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -43686,7 +43686,7 @@ </histogram> <histogram name="Extensions.CorruptPolicyExtensionDetected2" enum="BooleanHit" - expires_after="2019-11-30"> + expires_after="2020-05-31"> <owner>burunduk@chromium.org</owner> <owner>lazyboy@chromium.org</owner> <owner>poromov@chromium.org</owner> @@ -43699,9 +43699,10 @@ </histogram> <histogram name="Extensions.CorruptPolicyExtensionResolved" units="ms" - expires_after="2019-11-30"> + expires_after="2020-05-31"> <owner>burunduk@chromium.org</owner> <owner>lazyboy@chromium.org</owner> + <owner>poromov@chromium.org</owner> <owner>extensions-core@chromium.org</owner> <summary> Fires when we've successfully resinstalled a corrupt enterprise policy @@ -61167,9 +61168,9 @@ </histogram> <histogram name="Media.Audio.Processing.CaptureDelayMs" units="ms" - expires_after="2019-12-01"> - <owner>ossu@chromium.org</owner> - <owner>grunell@chromium.org</owner> + expires_after="2020-04-01"> + <owner>armax@chromium.org</owner> + <owner>guidou@chromium.org</owner> <summary> The time, in milliseconds, between when a block of audio is read from the soundcard and when it's presented to the audio processor. Used in @@ -61178,9 +61179,9 @@ </histogram> <histogram name="Media.Audio.Processing.CaptureDelayVarianceMs" - units="ms squared" expires_after="2019-12-01"> - <owner>ossu@chromium.org</owner> - <owner>grunell@chromium.org</owner> + units="ms squared" expires_after="2020-04-01"> + <owner>armax@chromium.org</owner> + <owner>guidou@chromium.org</owner> <summary> The variance of the capture delay in milliseconds (see Media.Audio.Processing.CaptureDelayMs). Logged once every second and @@ -61189,9 +61190,9 @@ </histogram> <histogram name="Media.Audio.Processing.RenderDelayMs" units="ms" - expires_after="2019-12-01"> - <owner>ossu@chromium.org</owner> - <owner>grunell@chromium.org</owner> + expires_after="2020-04-01"> + <owner>armax@chromium.org</owner> + <owner>guidou@chromium.org</owner> <summary> The time, in milliseconds, between when a block of audio is presented to the audio processor and the time it's played out on the soundcard. Used in @@ -61200,9 +61201,9 @@ </histogram> <histogram name="Media.Audio.Processing.RenderDelayVarianceMs" - units="ms squared" expires_after="2019-12-01"> - <owner>ossu@chromium.org</owner> - <owner>grunell@chromium.org</owner> + units="ms squared" expires_after="2020-04-01"> + <owner>armax@chromium.org</owner> + <owner>guidou@chromium.org</owner> <summary> The variance of the render delay in milliseconds (see Media.Audio.Processing.RenderDelayMs). Logged once every second and @@ -61211,9 +61212,9 @@ </histogram> <histogram name="Media.Audio.Processing.TotalDelayMs" units="ms" - expires_after="2019-12-01"> - <owner>ossu@chromium.org</owner> - <owner>grunell@chromium.org</owner> + expires_after="2020-04-01"> + <owner>armax@chromium.org</owner> + <owner>guidou@chromium.org</owner> <summary> The estimated total audio system delay presented to the audio processor. The sum of the individual capture and render delays at similar points in time. @@ -61221,9 +61222,9 @@ </histogram> <histogram name="Media.Audio.Processing.TotalDelayVarianceMs" - units="ms squared" expires_after="2019-12-01"> - <owner>ossu@chromium.org</owner> - <owner>grunell@chromium.org</owner> + units="ms squared" expires_after="2020-04-01"> + <owner>armax@chromium.org</owner> + <owner>guidou@chromium.org</owner> <summary> The variance of the total delay in milliseconds (see Media.Audio.Processing.TotalDelayMs). Logged once every second and @@ -169745,6 +169746,7 @@ <suffix name="CleanBrowsingFamily" label="CleanBrowsing family filter."/> <suffix name="CleanBrowsingSecure" label="CleanBrowsing secure filter."/> <suffix name="Cloudflare" label="Cloudflare."/> + <suffix name="Comcast" label="Comcast."/> <suffix name="Dnssb" label="Dns.sb."/> <suffix name="Google" label="Google."/> <suffix name="OpenDNS" label="OpenDNS standard service."/> @@ -177486,6 +177488,16 @@ cache."/> <suffix name="OmniboxSuggestions" label="Only counting memory used by Omnibox suggestions provider."/> + <suffix name="ServiceDiscardableManager" + label="Only counting memory used by the gpu discardable cache."/> + <suffix name="ServiceDiscardableManager.AvgImageSize" + label="Only counting the average image size of entries in the gpu + discardable cache"/> + <suffix name="ServiceTransferCache" + label="Only counting memory used by images in the gpu transfer cache."/> + <suffix name="ServiceTransferCache.AvgImageSize" + label="Only counting the average size of image entries in the gpu + transfer cache"/> <suffix name="SiteStorage.IndexDB" label="Only counting memory used by IndexedDB API."/> <suffix name="SiteStorage.LocalStorage" @@ -181181,23 +181193,37 @@ <histogram_suffixes name="ThreadPoolTaskType" separator="."> <suffix name="BackgroundTaskPriority" - label="Applies to tasks posted with a BACKGROUND priority and neither - of MayBlock() nor WithBaseSyncPrimitives()."/> + label="Applies to tasks posted with a BACKGROUND priority."/> <suffix name="BackgroundTaskPriority_MayBlock" - label="Applies to tasks posted with a BACKGROUND priority and - MayBlock() or WithBaseSyncPrimitives()."/> + label="Applies to tasks posted with a BACKGROUND priority and MayBlock() + or WithBaseSyncPrimitives()."> + <obsolete> + Deprecated 09/2019. Merged with BackgroundTaskPriority, because both + histograms effectively record the same thing since we merged pools. + </obsolete> + </suffix> <suffix name="UserBlockingTaskPriority" label="Applies to tasks posted with a USER_BLOCKING priority and neither of MayBlock() nor WithBaseSyncPrimitives()."/> <suffix name="UserBlockingTaskPriority_MayBlock" label="Applies to tasks posted with a USER_BLOCKING priority and - MayBlock() or WithBaseSyncPrimitives()."/> + MayBlock() or WithBaseSyncPrimitives()."> + <obsolete> + Deprecated 09/2019. Merged with UserBlockingTaskPriority, because both + histograms effectively record the same thing since we merged pools. + </obsolete> + </suffix> <suffix name="UserVisibleTaskPriority" label="Applies to tasks posted with a USER_VISIBLE priority and neither of MayBlock() nor WithBaseSyncPrimitives()."/> <suffix name="UserVisibleTaskPriority_MayBlock" label="Applies to tasks posted with a USER_VISIBLE priority and - MayBlock() or WithBaseSyncPrimitives()."/> + MayBlock() or WithBaseSyncPrimitives()."> + <obsolete> + Deprecated 09/2019. Merged with UserVisibleTaskPriority, because both + histograms effectively record the same thing since we merged pools. + </obsolete> + </suffix> <affected-histogram name="ThreadPool.HeartbeatLatencyMicroseconds.Browser"/> <affected-histogram name="ThreadPool.HeartbeatLatencyMicroseconds.ContentChild"/>
diff --git a/tools/metrics/histograms/merge_xml.py b/tools/metrics/histograms/merge_xml.py index 2f25dab..71fc1327 100755 --- a/tools/metrics/histograms/merge_xml.py +++ b/tools/metrics/histograms/merge_xml.py
@@ -6,9 +6,11 @@ """A script to merge multiple source xml files into a single histograms.xml.""" import argparse -import expand_owners import xml.dom.minidom +import expand_owners +import extract_histograms + def GetElementsByTagName(trees, tag): """Gets all elements with the specified tag from a set of DOM trees. @@ -19,7 +21,8 @@ Returns: A list of DOM nodes with the specified tag. """ - return [e for t in trees for e in t.getElementsByTagName(tag)] + iterator = extract_histograms.IterElementsWithTag + return list(e for t in trees for e in iterator(t, tag, 2)) def MakeNodeWithChildren(doc, tag, children):
diff --git a/tools/perf/core/results_processor/formatters/csv_output.py b/tools/perf/core/results_processor/formatters/csv_output.py index 3f5e19e..ec5fd8e 100644 --- a/tools/perf/core/results_processor/formatters/csv_output.py +++ b/tools/perf/core/results_processor/formatters/csv_output.py
@@ -54,3 +54,5 @@ with open(output_file, 'w') as output_stream: _WriteCsv(csv_dicts, output_stream) + + return output_file
diff --git a/tools/perf/core/results_processor/formatters/histograms_output.py b/tools/perf/core/results_processor/formatters/histograms_output.py index 1d0f815..6a86114 100644 --- a/tools/perf/core/results_processor/formatters/histograms_output.py +++ b/tools/perf/core/results_processor/formatters/histograms_output.py
@@ -30,3 +30,5 @@ with open(output_file, 'w') as output_stream: json.dump(histogram_dicts, output_stream) + + return output_file
diff --git a/tools/perf/core/results_processor/formatters/html_output.py b/tools/perf/core/results_processor/formatters/html_output.py index f48d58b..0293a2cd 100644 --- a/tools/perf/core/results_processor/formatters/html_output.py +++ b/tools/perf/core/results_processor/formatters/html_output.py
@@ -20,3 +20,4 @@ with codecs.open(output_file, mode='r+', encoding='utf-8') as output_stream: vulcanize_histograms_viewer.VulcanizeAndRenderHistogramsViewer( histogram_dicts, output_stream, options.reset_results) + return output_file
diff --git a/tools/perf/core/results_processor/formatters/json3_output.py b/tools/perf/core/results_processor/formatters/json3_output.py index 378156c1..45550a5 100644 --- a/tools/perf/core/results_processor/formatters/json3_output.py +++ b/tools/perf/core/results_processor/formatters/json3_output.py
@@ -23,8 +23,10 @@ def ProcessIntermediateResults(test_results, options): """Process intermediate results and write output in output_dir.""" results = Convert(test_results, options.output_dir) - with open(os.path.join(options.output_dir, OUTPUT_FILENAME), 'w') as f: + output_file = os.path.join(options.output_dir, OUTPUT_FILENAME) + with open(output_file, 'w') as f: json.dump(results, f, sort_keys=True, indent=4, separators=(',', ': ')) + return output_file def Convert(test_results, base_dir):
diff --git a/tools/perf/core/results_processor/processor.py b/tools/perf/core/results_processor/processor.py index 210f57b..cbeb894 100644 --- a/tools/perf/core/results_processor/processor.py +++ b/tools/perf/core/results_processor/processor.py
@@ -8,6 +8,8 @@ the standalone version of Results Processor. """ +from __future__ import print_function + import datetime import json import logging @@ -84,9 +86,10 @@ logging.info('Processing format: %s', output_format) formatter = formatters.FORMATTERS[output_format] if output_format in FORMATS_WITH_METRICS: - formatter.ProcessHistogramDicts(histogram_dicts, options) + output_file = formatter.ProcessHistogramDicts(histogram_dicts, options) else: - formatter.ProcessIntermediateResults(test_results, options) + output_file = formatter.ProcessIntermediateResults(test_results, options) + print('View results at file://', output_file, sep='') return GenerateExitCode(test_results)
diff --git a/tools/perf/page_sets/data/system_health_desktop.json b/tools/perf/page_sets/data/system_health_desktop.json index 37b680a..d024061 100644 --- a/tools/perf/page_sets/data/system_health_desktop.json +++ b/tools/perf/page_sets/data/system_health_desktop.json
@@ -27,6 +27,10 @@ "mac": "system_health_desktop_040.wprgo", "win": "system_health_desktop_047.wprgo" }, + "browse:media:youtube:2019": { + "DEFAULT": "system_health_desktop_d48f7fff0a.wprgo", + "linux": "system_health_desktop_d48f7fff0a.wprgo" + }, "browse:media:youtubetv:2019": { "DEFAULT": "system_health_desktop_e53598d1f4.wprgo" },
diff --git a/tools/perf/page_sets/data/system_health_desktop_d48f7fff0a.wprgo.sha1 b/tools/perf/page_sets/data/system_health_desktop_d48f7fff0a.wprgo.sha1 new file mode 100644 index 0000000..8f22565 --- /dev/null +++ b/tools/perf/page_sets/data/system_health_desktop_d48f7fff0a.wprgo.sha1
@@ -0,0 +1 @@ +d48f7fff0a37d4fcbfc5e430f15232996d52460d \ No newline at end of file
diff --git a/tools/perf/page_sets/system_health/browsing_stories.py b/tools/perf/page_sets/system_health/browsing_stories.py index e019b9d7..659bfb87 100644 --- a/tools/perf/page_sets/system_health/browsing_stories.py +++ b/tools/perf/page_sets/system_health/browsing_stories.py
@@ -604,6 +604,23 @@ story_tags.HEALTH_CHECK, story_tags.YEAR_2016] +class YouTubeDesktopStory2019(_MediaBrowsingStory): + """Load a typical YouTube video then navigate to a next few videos. Stop and + watch each video for a few seconds. + """ + NAME = 'browse:media:youtube:2019' + URL = 'https://www.youtube.com/watch?v=QGfhS1hfTWw&autoplay=0' + ITEM_SELECTOR = 'ytd-compact-video-renderer.ytd-watch-next-secondary-results-renderer a' + SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY + IS_SINGLE_PAGE_APP = True + # A longer view time allows videos to load and play. + ITEM_VIEW_TIME_IN_SECONDS = 5 + ITEMS_TO_VISIT = 8 + ITEM_SELECTOR_INDEX = 3 + PLATFORM_SPECIFIC = True + TAGS = [story_tags.JAVASCRIPT_HEAVY, story_tags.YEAR_2019] + + class YouTubeTVDesktopStory2019(_MediaBrowsingStory): """Load a typical YouTube TV video then navigate to a next few videos. Stop and watch each video for a few seconds.
diff --git a/ui/accessibility/extensions/chromevoxclassic/BUILD.gn b/ui/accessibility/extensions/chromevoxclassic/BUILD.gn index c7c8590..d2a9a22 100644 --- a/ui/accessibility/extensions/chromevoxclassic/BUILD.gn +++ b/ui/accessibility/extensions/chromevoxclassic/BUILD.gn
@@ -598,7 +598,6 @@ "common/math_semantic_tree_test.unitjs", "common/page_selection_test.unitjs", "common/selection_util_test.unitjs", - "common/spannable_test.unitjs", "common/string_util_test.unitjs", "walkers/character_walker_test.unitjs", "walkers/group_walker_test.unitjs", @@ -613,7 +612,7 @@ gen_include_files = [ "//chrome/browser/resources/chromeos/chromevox/testing/assert_additions.js", "//chrome/browser/resources/chromeos/chromevox/testing/callback_helper.js", - "testing/chromevox_unittest_base.js", + "//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js", ] test_deps_js_outputs = get_target_outputs(":chromevox_test_deps_js")
diff --git a/ui/accessibility/extensions/chromevoxclassic/chromevox/injected/live_regions_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/chromevox/injected/live_regions_test.unitjs index 115b6f53..c115de8 100644 --- a/ui/accessibility/extensions/chromevoxclassic/chromevox/injected/live_regions_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/chromevox/injected/live_regions_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/chromevox/injected/navigation_manager_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/chromevox/injected/navigation_manager_test.unitjs index ea2c5b7..03721b0cc 100644 --- a/ui/accessibility/extensions/chromevoxclassic/chromevox/injected/navigation_manager_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/chromevox/injected/navigation_manager_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/chromevox/injected/user_commands_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/chromevox/injected/user_commands_test.unitjs index c1b02d8..e3f4fbb 100644 --- a/ui/accessibility/extensions/chromevoxclassic/chromevox/injected/user_commands_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/chromevox/injected/user_commands_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/aria_util_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/aria_util_test.unitjs index 9718fe7..708f45416 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/aria_util_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/aria_util_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture for aria_util.js.
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/braille_text_handler_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/braille_text_handler_test.unitjs index 8c4c921..79f0a3a 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/braille_text_handler_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/braille_text_handler_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * @extends {cvox.BrailleInterface}
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/braille_util_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/braille_util_test.unitjs index 917dcc0..14ee1e2 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/braille_util_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/braille_util_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/content_editable_extractor_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/content_editable_extractor_test.unitjs index 4bd87f5..d07663f 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/content_editable_extractor_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/content_editable_extractor_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/cursor_selection_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/cursor_selection_test.unitjs index 10222433..167148b 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/cursor_selection_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/cursor_selection_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/dom_util_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/dom_util_test.unitjs index 6d7c587..27cef1bd 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/dom_util_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/dom_util_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/editable_text_area_shadow_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/editable_text_area_shadow_test.unitjs index 369741e..4881018 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/editable_text_area_shadow_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/editable_text_area_shadow_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/editable_text_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/editable_text_test.unitjs index 4ae2ee1..35a6ba7 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/editable_text_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/editable_text_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * A TTS class implementing speak and stop methods intended only for testing.
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/find_util_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/find_util_test.unitjs index cf52c99..8589a6d 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/find_util_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/find_util_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/key_sequence_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/key_sequence_test.unitjs index eb35fda..beb8283 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/key_sequence_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/key_sequence_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/math_semantic_tree_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/math_semantic_tree_test.unitjs index ea1c7b96..106b7723 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/math_semantic_tree_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/math_semantic_tree_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/page_selection_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/page_selection_test.unitjs index 02d8ed2d..9d3170aa 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/page_selection_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/page_selection_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/selection_util_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/selection_util_test.unitjs index 8ceb277..865abd41 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/selection_util_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/selection_util_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/common/string_util_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/common/string_util_test.unitjs index c9becbf..9b3c74b 100644 --- a/ui/accessibility/extensions/chromevoxclassic/common/string_util_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/common/string_util_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js b/ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js index 2f5b582e..2d2da41a 100644 --- a/ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js +++ b/ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js
@@ -2,8 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -GEN_INCLUDE(['assert_additions.js']); -GEN_INCLUDE(['common.js', 'callback_helper.js']); +GEN_INCLUDE([ + '//chrome/browser/resources/chromeos/chromevox/testing/assert_additions.js' +]); +GEN_INCLUDE([ + '//chrome/browser/resources/chromeos/chromevox/testing/common.js', + '//chrome/browser/resources/chromeos/chromevox/testing/callback_helper.js' +]); /** * Base test fixture for ChromeVox unit tests.
diff --git a/ui/accessibility/extensions/chromevoxclassic/walkers/layout_line_walker_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/walkers/layout_line_walker_test.unitjs index d0ba4d0..ccaabbf2 100644 --- a/ui/accessibility/extensions/chromevoxclassic/walkers/layout_line_walker_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/walkers/layout_line_walker_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/walkers/math_shifter_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/walkers/math_shifter_test.unitjs index 75fb2126..b4344ea 100644 --- a/ui/accessibility/extensions/chromevoxclassic/walkers/math_shifter_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/walkers/math_shifter_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/extensions/chromevoxclassic/walkers/structural_line_walker_test.unitjs b/ui/accessibility/extensions/chromevoxclassic/walkers/structural_line_walker_test.unitjs index 02379386..2e196b3 100644 --- a/ui/accessibility/extensions/chromevoxclassic/walkers/structural_line_walker_test.unitjs +++ b/ui/accessibility/extensions/chromevoxclassic/walkers/structural_line_walker_test.unitjs
@@ -3,7 +3,7 @@ // found in the LICENSE file. // Include test fixture. -GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']); +GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); /** * Test fixture.
diff --git a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc index 6f9f211..dc068c1 100644 --- a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc +++ b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc
@@ -421,10 +421,10 @@ base::win::ScopedVariant attribute_value_variant; // The range is inclusive, so advance our endpoint to the next position - auto end = end_->CreateNextAnchorPosition(); + auto end = end_->AsLeafTextPosition()->CreateNextAnchorPosition(); // Iterate over anchor positions - for (auto it = start_->Clone(); + for (auto it = start_->AsLeafTextPosition(); it->anchor_id() != end->anchor_id() || it->tree_id() != end->tree_id(); it = it->CreateNextAnchorPosition()) { AXPlatformNodeDelegate* delegate = GetDelegate(it.get());
diff --git a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc index 0799761..57d795d 100644 --- a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc +++ b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc
@@ -3736,6 +3736,73 @@ UIA_UnderlineColorAttributeId); } +TEST_F(AXPlatformNodeTextRangeProviderTest, + TestITextRangeProviderGetAttributeValueWithAncestorTextPosition) { + ui::AXTreeUpdate initial_state; + ui::AXTreeID tree_id = ui::AXTreeID::CreateNewAXTreeID(); + initial_state.tree_data.tree_id = tree_id; + initial_state.has_tree_data = true; + initial_state.root_id = 1; + initial_state.nodes.resize(5); + initial_state.nodes[0].id = 1; + initial_state.nodes[0].child_ids = {2}; + initial_state.nodes[0].role = ax::mojom::Role::kRootWebArea; + initial_state.nodes[1].id = 2; + initial_state.nodes[1].child_ids = {3}; + initial_state.nodes[1].role = ax::mojom::Role::kGenericContainer; + initial_state.nodes[2].id = 3; + initial_state.nodes[2].child_ids = {4, 5}; + initial_state.nodes[2].role = ax::mojom::Role::kGenericContainer; + initial_state.nodes[3].id = 4; + initial_state.nodes[3].role = ax::mojom::Role::kStaticText; + initial_state.nodes[3].SetName("some text"); + initial_state.nodes[3].AddIntAttribute( + ax::mojom::IntAttribute::kBackgroundColor, 0xDEADBEEFU); + initial_state.nodes[4].id = 5; + initial_state.nodes[4].role = ax::mojom::Role::kStaticText; + initial_state.nodes[4].SetName("more text"); + initial_state.nodes[4].AddIntAttribute( + ax::mojom::IntAttribute::kBackgroundColor, 0xDEADBEEFU); + + Init(initial_state); + AXNodePosition::SetTree(tree_.get()); + + ComPtr<AXPlatformNodeTextRangeProviderWin> text_range_provider_win; + { + // Making |owner| AXID:2 so that |TestAXNodeWrapper::BuildAllWrappers| + // will build the entire subtree, and not only AXID:3 for example. + AXPlatformNodeWin* owner = static_cast<AXPlatformNodeWin*>( + AXPlatformNodeFromNode(GetNodeFromTree(tree_id, 2))); + + AXNodePosition::AXPositionInstance range_start = + AXNodePosition::CreateTextPosition( + tree_id, /*anchor_id=*/4, /*text_offset=*/0, + ax::mojom::TextAffinity::kDownstream); + AXNodePosition::AXPositionInstance range_end = + AXNodePosition::CreateTextPosition( + tree_id, /*anchor_id=*/2, /*text_offset=*/17, + ax::mojom::TextAffinity::kDownstream); + + ComPtr<ITextRangeProvider> text_range_provider = + AXPlatformNodeTextRangeProviderWin::CreateTextRangeProvider( + owner, std::move(range_start), std::move(range_end)); + text_range_provider->QueryInterface(IID_PPV_ARGS(&text_range_provider_win)); + } + + ASSERT_TRUE(GetStart(text_range_provider_win.Get())->IsTextPosition()); + ASSERT_EQ(4, GetStart(text_range_provider_win.Get())->anchor_id()); + ASSERT_EQ(0, GetStart(text_range_provider_win.Get())->text_offset()); + ASSERT_TRUE(GetEnd(text_range_provider_win.Get())->IsTextPosition()); + ASSERT_EQ(2, GetEnd(text_range_provider_win.Get())->anchor_id()); + ASSERT_EQ(17, GetEnd(text_range_provider_win.Get())->text_offset()); + + base::win::ScopedVariant expected_variant; + // SkColor is ARGB, COLORREF is 0BGR + expected_variant.Set(static_cast<int32_t>(0x00EFBEADU)); + EXPECT_UIA_TEXTATTRIBUTE_EQ(text_range_provider_win, + UIA_BackgroundColorAttributeId, expected_variant); +} + TEST_F(AXPlatformNodeTextRangeProviderTest, TestITextRangeProviderSelect) { Init(BuildTextDocument({"some text", "more text2"})); AXNodePosition::SetTree(tree_.get());
diff --git a/ui/gfx/font_fallback_skia_impl.cc b/ui/gfx/font_fallback_skia_impl.cc index 2000d3fa..eea3e01 100644 --- a/ui/gfx/font_fallback_skia_impl.cc +++ b/ui/gfx/font_fallback_skia_impl.cc
@@ -7,6 +7,7 @@ #include <set> #include <string> +#include "third_party/icu/source/common/unicode/normalizer2.h" #include "third_party/icu/source/common/unicode/uchar.h" #include "third_party/icu/source/common/unicode/utf16.h" #include "third_party/skia/include/core/SkFontMgr.h" @@ -14,6 +15,89 @@ namespace gfx { +namespace { + +// Returns true when the codepoint has an unicode decomposition and store +// the decomposed string into |output|. +bool UnicodeDecomposeCodepoint(UChar32 codepoint, icu::UnicodeString* output) { + static const icu::Normalizer2* normalizer = nullptr; + + UErrorCode error = U_ZERO_ERROR; + if (!normalizer) { + normalizer = icu::Normalizer2::getNFDInstance(error); + if (U_FAILURE(error)) + return false; + DCHECK(normalizer); + } + + return normalizer->getDecomposition(codepoint, *output); +} + +// Extracts every codepoint and its decomposed codepoints from unicode +// decomposition. Inserts in |codepoints| the set of codepoints in |text|. +void RetrieveCodepointsAndDecomposedCodepoints(base::StringPiece16 text, + std::set<UChar32>* codepoints) { + size_t offset = 0; + while (offset < text.length()) { + UChar32 codepoint; + U16_NEXT(text.data(), offset, text.length(), codepoint); + + if (codepoints->insert(codepoint).second) { + // For each codepoint, add the decomposed codepoints. + icu::UnicodeString decomposed_text; + if (UnicodeDecomposeCodepoint(codepoint, &decomposed_text)) { + for (int i = 0; i < decomposed_text.length(); ++i) { + codepoints->insert(decomposed_text[i]); + } + } + } + } +} + +// Returns the amount of codepoint in |text| without a glyph representation in +// |typeface|. A codepoint is present if there is a corresponding glyph in +// typeface, or if there are glyphs for each of its decomposed codepoints. +size_t ComputeMissingGlyphsForGivenTypeface(base::StringPiece16 text, + sk_sp<SkTypeface> typeface) { + // Validate that every character has a known glyph in the font. + size_t missing_glyphs = 0; + size_t i = 0; + while (i < text.length()) { + UChar32 codepoint; + U16_NEXT(text.data(), i, text.length(), codepoint); + + // The glyph is present in the font. + if (typeface->unicharToGlyph(codepoint) != 0) + continue; + + // No glyph is present in the font for the codepoint. Try the decomposed + // codepoints instead. + icu::UnicodeString decomposed_text; + if (UnicodeDecomposeCodepoint(codepoint, &decomposed_text) && + !decomposed_text.isEmpty()) { + // Check that every decomposed codepoint is in the font. + bool every_codepoint_found = true; + for (int offset = 0; offset < decomposed_text.length(); ++offset) { + if (typeface->unicharToGlyph(decomposed_text[offset]) == 0) { + every_codepoint_found = false; + break; + } + } + + // The decomposed codepoints can be mapped to glyphs by the font. + if (every_codepoint_found) + continue; + } + + // The current glyphs can't be find. + ++missing_glyphs; + } + + return missing_glyphs; +} + +} // namespace + sk_sp<SkTypeface> GetSkiaFallbackTypeface(const Font& template_font, const std::string& locale, base::StringPiece16 text) { @@ -38,28 +122,23 @@ sk_sp<SkTypeface> fallback_typeface; size_t fewest_missing_glyphs = text.length() + 1; - size_t offset = 0; - while (offset < text.length()) { - UChar32 code_point; - U16_NEXT(text.data(), offset, text.length(), code_point); + // Retrieve the set of codepoints (or unicode decomposed codepoints) from + // the input text. + std::set<UChar32> codepoints; + RetrieveCodepointsAndDecomposedCodepoints(text, &codepoints); + // Determine which fallback font is given the fewer missing glyphs. + for (UChar32 codepoint : codepoints) { sk_sp<SkTypeface> typeface(font_mgr->matchFamilyStyleCharacter( template_font.GetFontName().c_str(), skia_style, locales, num_locales, - code_point)); + codepoint)); // If the typeface is not found or was already tested, skip it. if (!typeface || !tested_typeface.insert(typeface->uniqueID()).second) continue; - // Validate that every character has a known glyph in the font. - size_t missing_glyphs = 0; - size_t i = 0; - while (i < text.length()) { - UChar32 c; - U16_NEXT(text.data(), i, text.length(), c); - if (typeface->unicharToGlyph(c) == 0) - ++missing_glyphs; - } - + // Validate that every codepoint has a known glyph in the font. + size_t missing_glyphs = + ComputeMissingGlyphsForGivenTypeface(text, typeface); if (missing_glyphs < fewest_missing_glyphs) { fewest_missing_glyphs = missing_glyphs; fallback_typeface = typeface;
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc index a4e9827..7bc38e67 100644 --- a/ui/gfx/render_text_unittest.cc +++ b/ui/gfx/render_text_unittest.cc
@@ -5060,6 +5060,55 @@ } } +struct FallbackFontCase { + const char* test_name; + const wchar_t* text; +}; + +class RenderTextTestWithFallbackFontCase + : public RenderTextTest, + public ::testing::WithParamInterface<FallbackFontCase> { + public: + static std::string ParamInfoToString( + ::testing::TestParamInfo<FallbackFontCase> param_info) { + return param_info.param.test_name; + } +}; + +TEST_P(RenderTextTestWithFallbackFontCase, FallbackFont) { + FallbackFontCase param = GetParam(); + RenderTextHarfBuzz* render_text = GetRenderText(); + render_text->SetText(WideToUTF16(param.text)); + test_api()->EnsureLayout(); + + int missing_glyphs = 0; + const internal::TextRunList* run_list = GetHarfBuzzRunList(); + for (const auto& run : run_list->runs()) + missing_glyphs += run->CountMissingGlyphs(); + + EXPECT_EQ(missing_glyphs, 0); +} + +const FallbackFontCase kUnicodeDecomposeCases[] = { + // Decompose to "\u0041\u0300". + {"letter_A_with_grave", L"\u00c0"}, + // Decompose to "\u004f\u0328\u0304". + {"letter_O_with_ogonek_macron", L"\u01ec"}, + // Decompose to "\u0041\u030a". + {"angstrom_sign", L"\u212b"}, + // Decompose to "\u1100\u1164\u11b6". + {"hangul_syllable_gyaelh", L"\uac63"}, + // Decompose to "\u1107\u1170\u11af". + {"hangul_syllable_bwel", L"\ubdc0"}, + // Decompose to "\U00044039". + {"cjk_ideograph_fad4", L"\ufad4"}, +}; + +INSTANTIATE_TEST_SUITE_P(FallbackFontUnicodeDecompose, + RenderTextTestWithFallbackFontCase, + ::testing::ValuesIn(kUnicodeDecomposeCases), + RenderTextTestWithFallbackFontCase::ParamInfoToString); + #if defined(OS_WIN) // Ensures that locale is used for fonts selection. TEST_F(RenderTextTest, CJKFontWithLocale) {
diff --git a/ui/views/controls/separator.cc b/ui/views/controls/separator.cc index 325ba7e9..576dc4c 100644 --- a/ui/views/controls/separator.cc +++ b/ui/views/controls/separator.cc
@@ -55,21 +55,11 @@ } void Separator::OnPaint(gfx::Canvas* canvas) { - SkColor color = overridden_color_ - ? *overridden_color_ - : GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_SeparatorColor); - - float dsf = canvas->UndoDeviceScaleFactor(); - - // The separator fills its bounds, but avoid filling partial pixels. - gfx::Rect aligned = gfx::ScaleToEnclosedRect(GetContentsBounds(), dsf, dsf); - - // At least 1 pixel should be drawn to make the separator visible. - aligned.set_width(std::max(1, aligned.width())); - aligned.set_height(std::max(1, aligned.height())); - canvas->FillRect(aligned, color); - + const SkColor color = overridden_color_ + ? *overridden_color_ + : GetNativeTheme()->GetSystemColor( + ui::NativeTheme::kColorId_SeparatorColor); + canvas->DrawColor(color); View::OnPaint(canvas); }
diff --git a/weblayer/app/DEPS b/weblayer/app/DEPS index 30479e1..ddf7e6d 100644 --- a/weblayer/app/DEPS +++ b/weblayer/app/DEPS
@@ -1,6 +1,7 @@ include_rules = [ "+components/version_info", "+content/public", + "+media/base/media_switches.h", "+sandbox", "+ui/base", ]
diff --git a/weblayer/app/content_main_delegate_impl.cc b/weblayer/app/content_main_delegate_impl.cc index 70f804f..491d657 100644 --- a/weblayer/app/content_main_delegate_impl.cc +++ b/weblayer/app/content_main_delegate_impl.cc
@@ -14,8 +14,10 @@ #include "base/path_service.h" #include "build/build_config.h" #include "content/public/browser/browser_main_runner.h" +#include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/common/url_constants.h" +#include "media/base/media_switches.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_paths.h" #include "weblayer/browser/content_browser_client_impl.h" @@ -57,6 +59,34 @@ true /* Timestamp */, false /* Tick count */); } +// Disables each feature in |features_to_disable| unless it is already set in +// the command line. +void DisableFeaturesIfNotSet( + const std::vector<base::Feature>& features_to_disable) { + auto* cl = base::CommandLine::ForCurrentProcess(); + std::vector<std::string> enabled_features; + for (const auto& f : base::FeatureList::SplitFeatureListString( + cl->GetSwitchValueASCII(switches::kEnableFeatures))) { + enabled_features.emplace_back(f); + } + + std::vector<std::string> disabled_features; + for (const auto& f : base::FeatureList::SplitFeatureListString( + cl->GetSwitchValueASCII(switches::kDisableFeatures))) { + disabled_features.emplace_back(f); + } + + for (const auto& feature : features_to_disable) { + if (!base::Contains(disabled_features, feature.name) && + !base::Contains(enabled_features, feature.name)) { + disabled_features.push_back(feature.name); + } + } + + cl->AppendSwitchASCII(switches::kDisableFeatures, + base::JoinString(disabled_features, ",")); +} + } // namespace ContentMainDelegateImpl::ContentMainDelegateImpl(MainParams params) @@ -69,6 +99,27 @@ if (!exit_code) exit_code = &dummy; + // Disable features which are not currently supported in WebLayer. This allows + // sites to do feature detection, and prevents crashes in some not fully + // implemented features. + base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); + cl->AppendSwitch(switches::kDisableNotifications); + cl->AppendSwitch(switches::kDisableSpeechSynthesisAPI); + cl->AppendSwitch(switches::kDisableSpeechAPI); + cl->AppendSwitch(switches::kDisablePermissionsAPI); + cl->AppendSwitch(switches::kDisablePresentationAPI); + cl->AppendSwitch(switches::kDisableRemotePlaybackAPI); +#if defined(OS_ANDROID) + cl->AppendSwitch(switches::kDisableMediaSessionAPI); +#endif + DisableFeaturesIfNotSet({ + ::features::kWebPayments, ::features::kWebAuth, ::features::kSmsReceiver, + ::features::kWebXr, +#if defined(OS_ANDROID) + media::kPictureInPictureAPI, +#endif + }); + #if defined(OS_ANDROID) content::Compositor::Initialize(); #endif
diff --git a/weblayer/browser/browser_controller_impl.cc b/weblayer/browser/browser_controller_impl.cc index 4311f49..b33edfa 100644 --- a/weblayer/browser/browser_controller_impl.cc +++ b/weblayer/browser/browser_controller_impl.cc
@@ -12,6 +12,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/browser_controls_state.h" #include "weblayer/browser/file_select_helper.h" +#include "weblayer/browser/isolated_world_ids.h" #include "weblayer/browser/navigation_controller_impl.h" #include "weblayer/browser/profile_impl.h" #include "weblayer/public/browser_observer.h" @@ -27,7 +28,6 @@ #include "base/android/jni_string.h" #include "base/json/json_writer.h" #include "components/embedder_support/android/delegate/color_chooser_android.h" -#include "weblayer/browser/isolated_world_ids.h" #include "weblayer/browser/java/jni/BrowserControllerImpl_jni.h" #include "weblayer/browser/top_controls_container_view.h" #endif @@ -47,7 +47,7 @@ #if defined(OS_ANDROID) BrowserController* g_last_browser_controller; -void JavaScriptResultCallback( +void HandleJavaScriptResult( const base::android::ScopedJavaGlobalRef<jobject>& callback, base::Value result) { std::string json; @@ -58,6 +58,15 @@ } // namespace +#if defined(OS_ANDROID) +BrowserControllerImpl::BrowserControllerImpl( + ProfileImpl* profile, + const base::android::JavaParamRef<jobject>& java_impl) + : BrowserControllerImpl(profile) { + java_impl_ = java_impl; +} +#endif + BrowserControllerImpl::BrowserControllerImpl(ProfileImpl* profile) : profile_(profile) { #if defined(OS_ANDROID) @@ -128,6 +137,12 @@ return navigation_controller_.get(); } +void BrowserControllerImpl::ExecuteScript(const base::string16& script, + JavaScriptResultCallback callback) { + web_contents_->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld( + script, std::move(callback), ISOLATED_WORLD_ID_WEBLAYER); +} + #if !defined(OS_ANDROID) void BrowserControllerImpl::AttachToView(views::WebView* web_view) { web_view->SetWebContents(web_contents_.get()); @@ -136,10 +151,12 @@ #endif #if defined(OS_ANDROID) -static jlong JNI_BrowserControllerImpl_CreateBrowserController(JNIEnv* env, - jlong profile) { - return reinterpret_cast<intptr_t>( - new BrowserControllerImpl(reinterpret_cast<ProfileImpl*>(profile))); +static jlong JNI_BrowserControllerImpl_CreateBrowserController( + JNIEnv* env, + jlong profile, + const base::android::JavaParamRef<jobject>& java_impl) { + return reinterpret_cast<intptr_t>(new BrowserControllerImpl( + reinterpret_cast<ProfileImpl*>(profile), java_impl)); } static void JNI_BrowserControllerImpl_DeleteBrowserController( @@ -168,10 +185,8 @@ const base::android::JavaParamRef<jstring>& script, const base::android::JavaParamRef<jobject>& callback) { base::android::ScopedJavaGlobalRef<jobject> jcallback(env, callback); - web_contents_->GetMainFrame()->ExecuteJavaScriptInIsolatedWorld( - base::android::ConvertJavaStringToUTF16(script), - base::BindOnce(&JavaScriptResultCallback, jcallback), - ISOLATED_WORLD_ID_WEBLAYER); + ExecuteScript(base::android::ConvertJavaStringToUTF16(script), + base::BindOnce(&HandleJavaScriptResult, jcallback)); } #endif @@ -212,7 +227,12 @@ bool BrowserControllerImpl::DoBrowserControlsShrinkRendererSize( const content::WebContents* web_contents) { - return true; +#if defined(OS_ANDROID) + return Java_BrowserControllerImpl_doBrowserControlsShrinkRendererSize( + base::android::AttachCurrentThread(), java_impl_); +#else + return false; +#endif } bool BrowserControllerImpl::EmbedsFullscreenWidget() {
diff --git a/weblayer/browser/browser_controller_impl.h b/weblayer/browser/browser_controller_impl.h index 6ec9df3..983d6eec 100644 --- a/weblayer/browser/browser_controller_impl.h +++ b/weblayer/browser/browser_controller_impl.h
@@ -36,6 +36,11 @@ public content::WebContentsDelegate, public content::WebContentsObserver { public: + // TODO(sky): investigate a better way to not have so many ifdefs. +#if defined(OS_ANDROID) + BrowserControllerImpl(ProfileImpl* profile, + const base::android::JavaParamRef<jobject>& java_impl); +#endif explicit BrowserControllerImpl(ProfileImpl* profile); ~BrowserControllerImpl() override; @@ -69,6 +74,8 @@ void AddObserver(BrowserObserver* observer) override; void RemoveObserver(BrowserObserver* observer) override; NavigationController* GetNavigationController() override; + void ExecuteScript(const base::string16& script, + JavaScriptResultCallback callback) override; #if !defined(OS_ANDROID) void AttachToView(views::WebView* web_view) override; #endif @@ -113,6 +120,7 @@ base::ObserverList<BrowserObserver>::Unchecked observers_; #if defined(OS_ANDROID) TopControlsContainerView* top_controls_container_view_ = nullptr; + base::android::ScopedJavaGlobalRef<jobject> java_impl_; #endif bool is_fullscreen_ = false;
diff --git a/weblayer/browser/java/BUILD.gn b/weblayer/browser/java/BUILD.gn index d1e0320..0704435 100644 --- a/weblayer/browser/java/BUILD.gn +++ b/weblayer/browser/java/BUILD.gn
@@ -21,6 +21,7 @@ "org/chromium/weblayer_private/BrowserFragmentControllerImpl.java", "org/chromium/weblayer_private/BrowserFragmentImpl.java", "org/chromium/weblayer_private/BrowserObserverProxy.java", + "org/chromium/weblayer_private/ChildProcessServiceImpl.java", "org/chromium/weblayer_private/ContentView.java", "org/chromium/weblayer_private/ContentViewRenderView.java", "org/chromium/weblayer_private/DownloadDelegateProxy.java", @@ -30,10 +31,10 @@ "org/chromium/weblayer_private/ProfileImpl.java", "org/chromium/weblayer_private/FragmentWindowAndroid.java", "org/chromium/weblayer_private/ProfileManager.java", + "org/chromium/weblayer_private/RemoteFragmentImpl.java", + "org/chromium/weblayer_private/WebContentsGestureStateTracker.java", "org/chromium/weblayer_private/TopControlsContainerView.java", "org/chromium/weblayer_private/WebLayerImpl.java", - "org/chromium/weblayer_private/ChildProcessServiceImpl.java", - "org/chromium/weblayer_private/RemoteFragmentImpl.java", ] deps = [
diff --git a/weblayer/browser/java/org/chromium/weblayer_private/BrowserControllerImpl.java b/weblayer/browser/java/org/chromium/weblayer_private/BrowserControllerImpl.java index b5b0d23..bc38d767 100644 --- a/weblayer/browser/java/org/chromium/weblayer_private/BrowserControllerImpl.java +++ b/weblayer/browser/java/org/chromium/weblayer_private/BrowserControllerImpl.java
@@ -14,6 +14,7 @@ import android.widget.FrameLayout; import org.chromium.base.Callback; +import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; import org.chromium.base.annotations.NativeMethods; import org.chromium.content_public.browser.ViewEventSink; @@ -28,8 +29,13 @@ import org.chromium.weblayer_private.aidl.IObjectWrapper; import org.chromium.weblayer_private.aidl.ObjectWrapper; +/** + * Implementation of IBrowserController. + */ @JNINamespace("weblayer") -public final class BrowserControllerImpl extends IBrowserController.Stub { +public final class BrowserControllerImpl extends IBrowserController.Stub + implements TopControlsContainerView.Listener, + WebContentsGestureStateTracker.OnGestureStateChangedListener { private long mNativeBrowserController; // TODO: move mContentViewRenderView, mContentView, mTopControlsContainerView to @@ -46,6 +52,13 @@ private NavigationControllerImpl mNavigationController; private DownloadDelegateProxy mDownloadDelegateProxy; private FullscreenDelegateProxy mFullscreenDelegateProxy; + private WebContentsGestureStateTracker mGestureStateTracker; + /** + * The value of mCachedDoBrowserControlsShrinkRendererSize is set when + * WebContentsGestureStateTracker begins a gesture. This is necessary as the values should only + * change once a gesture is no longer under way. + */ + private boolean mCachedDoBrowserControlsShrinkRendererSize; private static class InternalAccessDelegateImpl implements ViewEventSink.InternalAccessDelegate { @@ -77,12 +90,12 @@ mContentViewRenderView.onNativeLibraryLoaded( windowAndroid, ContentViewRenderView.MODE_SURFACE_VIEW); - mNativeBrowserController = - BrowserControllerImplJni.get().createBrowserController(profile.getNativeProfile()); + mNativeBrowserController = BrowserControllerImplJni.get().createBrowserController( + profile.getNativeProfile(), this); mWebContents = BrowserControllerImplJni.get().getWebContents( mNativeBrowserController, BrowserControllerImpl.this); mTopControlsContainerView = - new TopControlsContainerView(context, mWebContents, mContentViewRenderView); + new TopControlsContainerView(context, mWebContents, mContentViewRenderView, this); mContentView = ContentView.createContentView( context, mWebContents, mTopControlsContainerView.getEventOffsetHandler()); ViewAndroidDelegate viewAndroidDelegate = new ViewAndroidDelegate(mContentView) { @@ -109,6 +122,8 @@ mWebContents.onShow(); mContentView.requestFocus(); + + mGestureStateTracker = new WebContentsGestureStateTracker(mContentView, mWebContents, this); } long getNativeBrowserController() { @@ -124,6 +139,29 @@ } @Override + public void onTopControlsCompletelyShownOrHidden() { + adjustWebContentsHeightIfNecessary(); + } + + @Override + public void onGestureStateChanged() { + if (mGestureStateTracker.isInGestureOrScroll()) { + mCachedDoBrowserControlsShrinkRendererSize = + mTopControlsContainerView.isTopControlVisible(); + } + adjustWebContentsHeightIfNecessary(); + } + + private void adjustWebContentsHeightIfNecessary() { + if (mGestureStateTracker.isInGestureOrScroll() + || !mTopControlsContainerView.isTopControlsCompletelyShownOrHidden()) { + return; + } + mContentViewRenderView.setWebContentsHeightDelta( + mTopControlsContainerView.getTopContentOffset()); + } + + @Override public void setClient(IBrowserControllerClient client) { mBrowserObserverProxy = new BrowserObserverProxy(mNativeBrowserController, client); } @@ -191,6 +229,7 @@ mFullscreenDelegateProxy.destroy(); mFullscreenDelegateProxy = null; } + mGestureStateTracker.destroy(); mNavigationController = null; BrowserControllerImplJni.get().deleteBrowserController(mNativeBrowserController); mNativeBrowserController = 0; @@ -212,9 +251,16 @@ (ValueCallback<Boolean>) ObjectWrapper.unwrap(callback, ValueCallback.class)); } + @CalledByNative + private boolean doBrowserControlsShrinkRendererSize() { + return (mGestureStateTracker.isInGestureOrScroll()) + ? mCachedDoBrowserControlsShrinkRendererSize + : mTopControlsContainerView.isTopControlVisible(); + } + @NativeMethods interface Natives { - long createBrowserController(long profile); + long createBrowserController(long profile, BrowserControllerImpl caller); void setTopControlsContainerView(long nativeBrowserControllerImpl, BrowserControllerImpl caller, long nativeTopControlsContainerView); void deleteBrowserController(long browserController);
diff --git a/weblayer/browser/java/org/chromium/weblayer_private/ContentViewRenderView.java b/weblayer/browser/java/org/chromium/weblayer_private/ContentViewRenderView.java index 247561b..f13c0a15 100644 --- a/weblayer/browser/java/org/chromium/weblayer_private/ContentViewRenderView.java +++ b/weblayer/browser/java/org/chromium/weblayer_private/ContentViewRenderView.java
@@ -62,6 +62,8 @@ private int mWidth; private int mHeight; + private int mWebContentsHeightDelta; + // Common interface to listen to surface related events. private interface SurfaceEventListener { void surfaceCreated(); @@ -514,11 +516,25 @@ mRequested.addCallback(callback); } + /** + * Sets how much to decrease the height of the WebContents by. + */ + public void setWebContentsHeightDelta(int delta) { + if (delta == mWebContentsHeightDelta) return; + mWebContentsHeightDelta = delta; + updateWebContentsSize(); + } + + private void updateWebContentsSize() { + if (mWebContents == null) return; + mWebContents.setSize(mWidth, mHeight - mWebContentsHeightDelta); + } + @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { mWidth = w; mHeight = h; - if (mWebContents != null) mWebContents.setSize(w, h); + updateWebContentsSize(); } /** @@ -581,7 +597,7 @@ mWebContents = webContents; if (webContents != null) { - webContents.setSize(mWidth, mHeight); + updateWebContentsSize(); ContentViewRenderViewJni.get().onPhysicalBackingSizeChanged( mNativeContentViewRenderView, webContents, mWidth, mHeight); }
diff --git a/weblayer/browser/java/org/chromium/weblayer_private/TopControlsContainerView.java b/weblayer/browser/java/org/chromium/weblayer_private/TopControlsContainerView.java index 3974653..c75911d 100644 --- a/weblayer/browser/java/org/chromium/weblayer_private/TopControlsContainerView.java +++ b/weblayer/browser/java/org/chromium/weblayer_private/TopControlsContainerView.java
@@ -26,6 +26,30 @@ * bitmap is placed in a cc::Layer and the layer is shown while scrolling the top-view. * ViewResourceAdapter is always kept in sync, as to do otherwise results in a noticeable delay * between when the scroll starts the content is available. + * + * There are many parts involved in orchestrating top-controls scrolling. The key things to know + * are: + * . TopControlsContainerView (in native code) keeps a cc::Layer that shows a bitmap rendered by + * the top-view. The bitmap is updated anytime the top-view changes. This is done as otherwise + * there is a noticable delay between when the scroll starts and the bitmap is available. + * . When scrolling, the cc::Layer for the WebContents and TopControlsContainerView is moved. + * . The size of the WebContents is only changed after the user releases a touch point. Otherwise + * the scrollbar bounces around. + * . WebContentsDelegate::DoBrowserControlsShrinkRendererSize() only changes when the WebContents + * size change. + * . WebContentsGestureStateTracker is responsible for determining when a scroll/touch is underway. + * . ContentViewRenderView.Delegate is used to adjust the size of the webcontents when the + * top-controls are fully visible (and a scroll is not underway). + * + * The flow of this code is roughly: + * . WebContentsGestureStateTracker generally detects a touch first + * . BrowserControllerImpl is notified and caches state. + * . onTopControlsChanged() is called. This triggers hiding the real view and calling to native code + * to move the cc::Layers. + * . the move continues. + * . when the move completes and both WebContentsGestureStateTracker and TopControlsContainerView + * no longer believe a move/gesture/scroll is underway the size of the WebContents is adjusted + * (if necessary). */ @JNINamespace("weblayer") class TopControlsContainerView extends FrameLayout { @@ -50,7 +74,9 @@ private EventOffsetHandler mEventOffsetHandler; private int mTopContentOffset; - // True if scrolling. + // Set to true if |mView| is hidden because the user has scrolled or triggered some action such + // that mView is not visible. While |mView| is not visible if this is true, the bitmap from + // |mView| may be partially visible. private boolean mInTopControlsScroll; private boolean mIsFullscreen; @@ -58,6 +84,15 @@ // Used to delay processing fullscreen requests. private Runnable mSystemUiFullscreenResizeRunnable; + private final Listener mListener; + + public interface Listener { + /** + * Called when the top-controls are either completely showing, or completely hiding. + */ + public void onTopControlsCompletelyShownOrHidden(); + } + // Used to delay updating the image for the layer. private final Runnable mRefreshResourceIdRunnable = () -> { if (mView == null) return; @@ -65,8 +100,8 @@ mNativeTopControlsContainerView, TopControlsContainerView.this); }; - TopControlsContainerView( - Context context, WebContents webContents, ContentViewRenderView contentViewRenderView) { + TopControlsContainerView(Context context, WebContents webContents, + ContentViewRenderView contentViewRenderView, Listener listener) { super(context); mContentViewRenderView = contentViewRenderView; mWebContents = webContents; @@ -85,6 +120,7 @@ mNativeTopControlsContainerView = TopControlsContainerViewJni.get().createTopControlsContainerView( this, webContents, contentViewRenderView.getNativeHandle()); + mListener = listener; } public void destroy() { @@ -102,6 +138,21 @@ } /** + * Returns the vertical offset for the WebContents. + */ + public int getTopContentOffset() { + return mView == null ? 0 : mTopContentOffset; + } + + /** + * Returns true if the top control is visible to the user. + */ + public boolean isTopControlVisible() { + // Don't check the visibility of the View itself as it's hidden while scrolling. + return mView != null && mTopContentOffset != 0; + } + + /** * Sets the view from the client. */ public void setView(View view) { @@ -216,8 +267,19 @@ mContentViewRenderView.postOnAnimation(() -> showTopControls()); } + /** + * Returns true if the top-controls are completely shown or completely hidden. A return value + * of false indicates the top-controls are being moved. + */ + public boolean isTopControlsCompletelyShownOrHidden() { + return mTopContentOffset == 0 || mTopContentOffset == getHeight(); + } + private void setTopControlsOffset(int topControlsOffsetY, int topContentOffsetY) { mTopContentOffset = topContentOffsetY; + if (isTopControlsCompletelyShownOrHidden()) { + mListener.onTopControlsCompletelyShownOrHidden(); + } TopControlsContainerViewJni.get().setTopControlsOffset(mNativeTopControlsContainerView, TopControlsContainerView.this, topControlsOffsetY, topContentOffsetY); }
diff --git a/weblayer/browser/java/org/chromium/weblayer_private/WebContentsGestureStateTracker.java b/weblayer/browser/java/org/chromium/weblayer_private/WebContentsGestureStateTracker.java new file mode 100644 index 0000000..eb9ca9b1 --- /dev/null +++ b/weblayer/browser/java/org/chromium/weblayer_private/WebContentsGestureStateTracker.java
@@ -0,0 +1,110 @@ +// Copyright 2019 The Chromium 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.weblayer_private; + +import android.view.MotionEvent; +import android.view.View; + +import org.chromium.content_public.browser.GestureListenerManager; +import org.chromium.content_public.browser.GestureStateListener; +import org.chromium.content_public.browser.WebContents; + +/** + * WebContentsGestureStateTracker is responsible for tracking when a scroll/gesture is in progress + * and notifying when the state changes. + */ +// TODO(sky): refactor TabGestureStateListener and this to a common place. +public final class WebContentsGestureStateTracker { + private GestureListenerManager mGestureListenerManager; + private GestureStateListener mGestureListener; + private final OnGestureStateChangedListener mListener; + private boolean mScrolling; + private boolean mIsInGesture; + + /** + * The View events are tracked on. + */ + private View mContentView; + + /** + * Notified when the gesture state changes. + */ + public interface OnGestureStateChangedListener { + /** + * Called when the value of isInGestureOrScroll() changes. + */ + public void onGestureStateChanged(); + } + + public WebContentsGestureStateTracker( + View contentView, WebContents webContents, OnGestureStateChangedListener listener) { + mListener = listener; + mGestureListenerManager = GestureListenerManager.fromWebContents(webContents); + mContentView = contentView; + mContentView.setOnTouchListener(new View.OnTouchListener() { + @Override + public boolean onTouch(View view, MotionEvent event) { + final int eventAction = event.getActionMasked(); + final boolean oldState = isInGestureOrScroll(); + if (eventAction == MotionEvent.ACTION_DOWN + || eventAction == MotionEvent.ACTION_POINTER_DOWN) { + mIsInGesture = true; + } else if (eventAction == MotionEvent.ACTION_CANCEL + || eventAction == MotionEvent.ACTION_UP) { + mIsInGesture = false; + } + if (isInGestureOrScroll() != oldState) { + mListener.onGestureStateChanged(); + } + return false; + } + }); + + mGestureListener = new GestureStateListener() { + @Override + public void onFlingStartGesture(int scrollOffsetY, int scrollExtentY) { + onScrollingStateChanged(); + } + + @Override + public void onFlingEndGesture(int scrollOffsetY, int scrollExtentY) { + onScrollingStateChanged(); + } + + @Override + public void onScrollStarted(int scrollOffsetY, int scrollExtentY) { + onScrollingStateChanged(); + } + + @Override + public void onScrollEnded(int scrollOffsetY, int scrollExtentY) { + onScrollingStateChanged(); + } + + private void onScrollingStateChanged() { + final boolean oldState = isInGestureOrScroll(); + mScrolling = mGestureListenerManager.isScrollInProgress(); + if (oldState != isInGestureOrScroll()) { + mListener.onGestureStateChanged(); + } + } + }; + mGestureListenerManager.addListener(mGestureListener); + } + + public void destroy() { + mGestureListenerManager.removeListener(mGestureListener); + mGestureListener = null; + mGestureListenerManager = null; + mContentView.setOnTouchListener(null); + } + + /** + * Returns true if the user has touched the target view, or is scrolling. + */ + public boolean isInGestureOrScroll() { + return mIsInGesture || mScrolling; + } +}
diff --git a/weblayer/browser/webui/webui_browsertest.cc b/weblayer/browser/webui/webui_browsertest.cc new file mode 100644 index 0000000..ee26f57 --- /dev/null +++ b/weblayer/browser/webui/webui_browsertest.cc
@@ -0,0 +1,29 @@ +// Copyright 2019 The Chromium 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 "weblayer/test/weblayer_browser_test.h" + +#include "build/build_config.h" +#include "weblayer/test/weblayer_browser_test_utils.h" + +namespace weblayer { + +using WebLayerWebUIBrowserTest = WebLayerBrowserTest; + +IN_PROC_BROWSER_TEST_F(WebLayerWebUIBrowserTest, WebUI) { + NavigateAndWaitForCompletion(GURL("chrome://weblayer"), shell()); + base::RunLoop run_loop; + bool result = + ExecuteScript(shell(), + "document.getElementById('remote-debug-label').hidden") + .GetBool(); + // The remote debug checkbox should only be visible on Android. +#if defined(OS_ANDROID) + EXPECT_FALSE(result); +#else + EXPECT_TRUE(result); +#endif +} + +} // namespace weblayer
diff --git a/weblayer/public/browser_controller.h b/weblayer/public/browser_controller.h index 5dbddc39..284c74f 100644 --- a/weblayer/public/browser_controller.h +++ b/weblayer/public/browser_controller.h
@@ -7,8 +7,14 @@ #include <algorithm> +#include "base/callback_forward.h" +#include "base/strings/string16.h" #include "build/build_config.h" +namespace base { +class Value; +} + #if !defined(OS_ANDROID) namespace views { class WebView; @@ -46,6 +52,10 @@ virtual NavigationController* GetNavigationController() = 0; + using JavaScriptResultCallback = base::OnceCallback<void(base::Value)>; + virtual void ExecuteScript(const base::string16& script, + JavaScriptResultCallback callback) = 0; + #if !defined(OS_ANDROID) // TODO: this isn't a stable API, so use it now for expediency in the C++ API, // but if we ever want to have backward or forward compatibility in C++ this
diff --git a/weblayer/shell/android/BUILD.gn b/weblayer/shell/android/BUILD.gn index 143cdd7..9d204c3 100644 --- a/weblayer/shell/android/BUILD.gn +++ b/weblayer/shell/android/BUILD.gn
@@ -149,56 +149,6 @@ } } -demo_apk_manifest = "$target_gen_dir/demo_apk_manifest/AndroidManifest.xml" - -jinja_template("demo_apk_manifest") { - input = "demo_apk/AndroidManifest.xml" - output = demo_apk_manifest -} - -android_assets("demo_apk_assets") { - testonly = true - - sources = [ - "$root_out_dir/weblayer_shell.pak", - ] - disable_compression = true - deps = [ - "//weblayer/shell:shell_pak", - ] -} - -android_library("demo_apk_java") { - testonly = true - - deps = [ - ":demo_apk_manifest", - "//third_party/android_deps:android_support_v4_java", - "//weblayer/public/java", - ] - java_files = [ "demo_apk/src/org/chromium/weblayer/demo/WebLayerAnimationDemoActivity.java" ] - - android_manifest_for_lint = demo_apk_manifest -} - -android_apk("weblayer_demo_apk") { - testonly = true - - deps = [ - ":demo_apk_assets", - ":demo_apk_java", - ":demo_apk_manifest", - ] - apk_name = "WebLayerDemo" - android_manifest = demo_apk_manifest - min_sdk_version = 21 - target_sdk_version = 28 - android_manifest_dep = ":demo_apk_manifest" - - # Add a native lib so the ABI is compatible with the implementation APK. - native_lib_placeholders = [ "libdummy.so" ] -} - weblayer_support_manifest = "$target_gen_dir/weblayer_support_manifest/AndroidManifest.xml" @@ -209,7 +159,7 @@ android_apk("weblayer_support_apk") { testonly = true - + # Test runner does not support having "additional apks" that are incremental. never_incremental = true @@ -268,6 +218,7 @@ "javatests/src/org/chromium/weblayer/test/EventUtils.java", "javatests/src/org/chromium/weblayer/test/ExecuteScriptTest.java", "javatests/src/org/chromium/weblayer/test/RenderingTest.java", + "javatests/src/org/chromium/weblayer/test/TopControlsTest.java", "javatests/src/org/chromium/weblayer/test/WebLayerShellActivityTestRule.java", "javatests/src/org/chromium/weblayer/test/FragmentRestoreTest.java", "javatests/src/org/chromium/weblayer/test/InputTypesTest.java",
diff --git a/weblayer/shell/android/demo_apk/AndroidManifest.xml b/weblayer/shell/android/demo_apk/AndroidManifest.xml deleted file mode 100644 index 314ec4a..0000000 --- a/weblayer/shell/android/demo_apk/AndroidManifest.xml +++ /dev/null
@@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- Copyright 2019 The Chromium Authors. All rights reserved. - - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. - --> - -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="org.chromium.weblayer.demo"> - - <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> - <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> - <uses-permission android:name="android.permission.CAMERA"/> - <uses-permission android:name="android.permission.INTERNET"/> - <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> - <uses-permission android:name="android.permission.RECORD_AUDIO"/> - <uses-permission android:name="android.permission.VIBRATE"/> - <uses-permission android:name="android.permission.WAKE_LOCK"/> - <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> - - <application android:label="Demo"> - <activity android:name="WebLayerAnimationDemoActivity" - android:launchMode="singleTask" - android:theme="@android:style/Theme.Holo.Light.NoActionBar" - android:configChanges="orientation|keyboardHidden|keyboard|screenSize" - android:windowSoftInputMode="adjustPan|stateUnspecified"> - <intent-filter> - <action android:name="android.intent.action.MAIN"/> - <category android:name="android.intent.category.LAUNCHER"/> - </intent-filter> - </activity> - - <meta-data android:name="org.chromium.weblayer.WebLayerPackage" - android:value="org.chromium.weblayer.support"/> - </application> -</manifest>
diff --git a/weblayer/shell/android/demo_apk/DEPS b/weblayer/shell/android/demo_apk/DEPS deleted file mode 100644 index fd9e2a83..0000000 --- a/weblayer/shell/android/demo_apk/DEPS +++ /dev/null
@@ -1,4 +0,0 @@ -noparent = True -include_rules = [ - "+weblayer/public/java", -]
diff --git a/weblayer/shell/android/demo_apk/README.md b/weblayer/shell/android/demo_apk/README.md deleted file mode 100644 index 5b91539..0000000 --- a/weblayer/shell/android/demo_apk/README.md +++ /dev/null
@@ -1,11 +0,0 @@ -# WebLayer Shell - -This directory contains a demo app to demonstrate capabilities of WebLayer. - -To build and run on Android: -``` -autoninja -C out/Default weblayer_support_apk weblayer_demo_apk -out/Default/bin/weblayer_support_apk install -out/Default/bin/weblayer_demo_apk install -adb shell am start org.chromium.weblayer.demo/.WebLayerAnimationDemoActivity -```
diff --git a/weblayer/shell/android/demo_apk/src/org/chromium/weblayer/demo/WebLayerAnimationDemoActivity.java b/weblayer/shell/android/demo_apk/src/org/chromium/weblayer/demo/WebLayerAnimationDemoActivity.java deleted file mode 100644 index 2df0e8b..0000000 --- a/weblayer/shell/android/demo_apk/src/org/chromium/weblayer/demo/WebLayerAnimationDemoActivity.java +++ /dev/null
@@ -1,366 +0,0 @@ -// Copyright 2019 The Chromium 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.weblayer.demo; - -import android.content.Context; -import android.net.Uri; -import android.os.Bundle; -import android.support.v4.app.FragmentActivity; -import android.support.v4.app.FragmentTransaction; -import android.text.InputType; -import android.view.KeyEvent; -import android.view.MotionEvent; -import android.view.View; -import android.view.inputmethod.EditorInfo; -import android.webkit.WebSettings; -import android.webkit.WebView; -import android.webkit.WebViewClient; -import android.widget.EditText; -import android.widget.FrameLayout; -import android.widget.TextView; -import android.widget.TextView.OnEditorActionListener; - -import org.chromium.weblayer.BrowserController; -import org.chromium.weblayer.BrowserFragment; -import org.chromium.weblayer.BrowserFragmentController; -import org.chromium.weblayer.BrowserObserver; -import org.chromium.weblayer.NavigationController; -import org.chromium.weblayer.Profile; -import org.chromium.weblayer.WebLayer; - -/** - * Activity for managing the Demo Shell. - */ -public class WebLayerAnimationDemoActivity extends FragmentActivity { - private static final String TAG = "AnimationDemo"; - - private static final boolean USE_WEBVIEW = false; - - private Profile mProfile; - private final BrowserFragment mBrowserFragments[] = new BrowserFragment[4]; - private final ContainerFrameLayout mContainerViews[] = new ContainerFrameLayout[4]; - private final MyWebView mWebViews[] = new MyWebView[4]; - private FrameLayout mMainView; - private WebLayer mWebLayer; - - public static class ContainerFrameLayout extends FrameLayout { - private final BrowserFragmentController mFragmentController; - private int mIndex; - private boolean mInterceptTouchEvent; - - public ContainerFrameLayout(Context context, BrowserFragmentController fragmentController, - int index) { - super(context); - mFragmentController = fragmentController; - mIndex = index; - } - - public BrowserFragmentController getFragmentController() { - return mFragmentController; - } - - public void setInterceptTouchEvent(boolean intercept) { - mInterceptTouchEvent = intercept; - } - - public int getIndex() { - return mIndex; - } - - @Override - public boolean onInterceptTouchEvent(MotionEvent ev) { - return mInterceptTouchEvent; - } - - @Override - public boolean onTouchEvent(MotionEvent event) { - if (!mInterceptTouchEvent) return super.onTouchEvent(event); - if (event.getAction() == KeyEvent.ACTION_UP) { - performClick(); - } - return true; - } - } - - private static class MyWebView extends WebView { - private int mIndex; - private boolean mInterceptTouchEvent; - - public MyWebView(Context context, int index) { - super(context); - mIndex = index; - } - - public void setInterceptTouchEvent(boolean intercept) { - mInterceptTouchEvent = intercept; - } - - public int getIndex() { - return mIndex; - } - - @Override - public boolean onInterceptTouchEvent(MotionEvent ev) { - return mInterceptTouchEvent; - } - - @Override - public boolean onTouchEvent(MotionEvent event) { - if (!mInterceptTouchEvent) return super.onTouchEvent(event); - if (event.getAction() == KeyEvent.ACTION_UP) { - performClick(); - } - return true; - } - } - - private void createNewFragment(int index) { - int viewId = View.generateViewId(); - - mBrowserFragments[index] = WebLayer.createBrowserFragment(null); - FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); - transaction.add(viewId, mBrowserFragments[index]); - transaction.commitNow(); - - final BrowserController controller = getFragmentController(index).getBrowserController(); - - ContainerFrameLayout container = - new ContainerFrameLayout(this, getFragmentController(index), index); - mContainerViews[index] = container; - container.setId(viewId); - mMainView.addView(container); - - - - EditText urlView = new EditText(this); - urlView.setSelectAllOnFocus(true); - urlView.setInputType(InputType.TYPE_TEXT_VARIATION_URI); - urlView.setImeOptions(EditorInfo.IME_ACTION_GO); - // The background of the top-view must be opaque, otherwise it bleeds through to the - // cc::Layer that mirrors the contents of the top-view. - urlView.setBackgroundColor(0xFFa9a9a9); - urlView.setOnEditorActionListener(new OnEditorActionListener() { - @Override - public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { - if ((actionId != EditorInfo.IME_ACTION_GO) - && (event == null || event.getKeyCode() != KeyEvent.KEYCODE_ENTER - || event.getAction() != KeyEvent.ACTION_DOWN)) { - return false; - } - String url = urlView.getText().toString(); - controller.getNavigationController().navigate(Uri.parse(sanitizeUrl(url))); - return true; - } - }); - getFragmentController(index).setTopView(urlView); - - controller.addObserver(new BrowserObserver() { - @Override - public void visibleUrlChanged(Uri uri) { - urlView.setText(uri.toString()); - } - }); - } - - @Override - protected void onCreate(final Bundle savedInstanceState) { - if (USE_WEBVIEW) { - super.onCreate(savedInstanceState); - - FrameLayout mainView = new FrameLayout(this); - mMainView = mainView; - setContentView(mainView); - - for (int i = 0; i < 3; ++i) { - mWebViews[i] = new MyWebView(this, i); - mWebViews[i].setWebViewClient(new WebViewClient() { - @Override - public boolean shouldOverrideUrlLoading(WebView webView, String url) { - return false; - } - }); - mMainView.addView(mWebViews[i]); - WebSettings settings = mWebViews[i].getSettings(); - settings.setJavaScriptEnabled(true); - - // Default layout behavior for chrome on android. - settings.setUseWideViewPort(true); - settings.setLoadWithOverviewMode(true); - settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING); - } - } else { - // Only call init for main process. - try { - mWebLayer = WebLayer.create(getApplication()).get(); - } catch (Exception e) { - throw new RuntimeException("failed loading WebLayer", e); - } - if (savedInstanceState != null) { - // This prevents FragmentManager from restoring fragments. - // TODO(pshmakov): restore fragments properly, as in WebLayerShellActivity. - savedInstanceState.remove("android:support:fragments"); - } - - super.onCreate(savedInstanceState); - - FrameLayout mainView = new FrameLayout(this); - mMainView = mainView; - setContentView(mainView); - - createNewFragment(0); - createNewFragment(1); - createNewFragment(2); - mProfile = getFragmentController(0).getProfile(); - - getNavigationController(0).navigate(Uri.parse(sanitizeUrl("https://www.google.com"))); - getNavigationController(1).navigate(Uri.parse(sanitizeUrl("https://en.wikipedia.org"))); - getNavigationController(2).navigate(Uri.parse(sanitizeUrl("https://www.chromium.org"))); - } - } - - @Override - protected void onStart() { - super.onStart(); - } - - @Override - protected void onResume() { - super.onResume(); - - if (USE_WEBVIEW) { - mWebViews[0].post(() -> { - mWebViews[0].loadUrl("https://www.google.com"); - mWebViews[1].loadUrl("https://en.wikipedia.org"); - mWebViews[2].loadUrl("https://www.chromium.org"); - for (int i = 0; i < 3; ++i) { - mWebViews[i].setOnClickListener(new OnClickImpl()); - animateDown(mWebViews[i]); - } - }); - } else { - mContainerViews[0].setOnClickListener(new OnClickImpl()); - mContainerViews[1].setOnClickListener(new OnClickImpl()); - mContainerViews[2].setOnClickListener(new OnClickImpl()); - mContainerViews[0].post(() -> { - getFragmentController(0).setSupportsEmbedding(true).addCallback( - (Boolean result) -> animateDown(mContainerViews[0])); - getFragmentController(1).setSupportsEmbedding(true).addCallback( - (Boolean result) -> animateDown(mContainerViews[1])); - getFragmentController(2).setSupportsEmbedding(true).addCallback( - (Boolean result) -> animateDown(mContainerViews[2])); - }); - } - } - - private BrowserFragmentController getFragmentController(int index) { - return mBrowserFragments[index].getController(); - } - - private NavigationController getNavigationController(int index) { - return getFragmentController(index).getBrowserController().getNavigationController(); - } - - private ContainerFrameLayout mFullscreenContainer; - private MyWebView mFullscreenWebView; - public class OnClickImpl implements View.OnClickListener { - @Override - public void onClick(View v) { - if (USE_WEBVIEW) { - MyWebView webview = (MyWebView) v; - if (mFullscreenWebView == webview) return; - - mMainView.removeView(webview); - mMainView.addView(webview, 0); - - if (mFullscreenWebView != null) { - animateDown(mFullscreenWebView); - } - animateUp(webview); - mFullscreenWebView = webview; - } else { - ContainerFrameLayout container = (ContainerFrameLayout) v; - if (mFullscreenContainer == container) return; - - // Move to back by bringing others to the front. - // This avoids detaching and reattaching any views. - for (int i = 0; i < 3; ++i) { - if (mContainerViews[i] == container) continue; - mMainView.bringChildToFront(mContainerViews[i]); - } - - if (mFullscreenContainer != null) { - animateDown(mFullscreenContainer); - } - animateUp(container); - mFullscreenContainer = container; - } - } - } - - private static void animateDown(ContainerFrameLayout container) { - // Start animation after fullying switched from SurfaceView to TextureView. - int index = container.getIndex(); - container.getFragmentController().setSupportsEmbedding(true) - .addCallback((Boolean result) -> { - container.animate() - .scaleX(1.0f / 3) - .scaleY(1.0f / 3) - .translationX(-container.getWidth() / 3.0f - + (container.getWidth() / 3.0f * index)) - .translationY(container.getHeight() / 3.0f) - .alpha(0.8f) - .setDuration(500); - container.setInterceptTouchEvent(true); - }); - } - - private static void animateUp(ContainerFrameLayout container) { - container.animate() - .scaleX(1.0f) - .scaleY(1.0f) - .translationX(0) - .translationY(0) - .alpha(1.0f) - .setDuration(500) - .withEndAction(() -> { - container.getFragmentController().setSupportsEmbedding(false); - container.setInterceptTouchEvent(false); - }); - } - - private static void animateDown(MyWebView webview) { - int index = webview.getIndex(); - webview.animate() - .scaleX(1.0f / 3) - .scaleY(1.0f / 3) - .translationX(-webview.getWidth() / 3.0f + (webview.getWidth() / 3.0f * index)) - .translationY(webview.getHeight() / 3.0f) - .alpha(0.8f) - .setDuration(500); - webview.setInterceptTouchEvent(true); - } - - private static void animateUp(MyWebView webview) { - webview.animate() - .scaleX(1.0f) - .scaleY(1.0f) - .translationX(0) - .translationY(0) - .alpha(1.0f) - .setDuration(500); - webview.setInterceptTouchEvent(false); - } - - /** - * Given an URL, this performs minimal sanitizing to ensure it will be valid. - * @param url The url to be sanitized. - * @return The sanitized URL. - */ - public static String sanitizeUrl(String url) { - if (url == null) return null; - if (url.startsWith("www.") || url.indexOf(":") == -1) url = "http://" + url; - return url; - } -}
diff --git a/weblayer/shell/android/javatests/src/org/chromium/weblayer/test/EventUtils.java b/weblayer/shell/android/javatests/src/org/chromium/weblayer/test/EventUtils.java index 5a4485d3..e306cae 100644 --- a/weblayer/shell/android/javatests/src/org/chromium/weblayer/test/EventUtils.java +++ b/weblayer/shell/android/javatests/src/org/chromium/weblayer/test/EventUtils.java
@@ -18,14 +18,27 @@ * Asynchronously posts a touch-down and touch-up event at the center of the supplied View. */ public static void simulateTouchCenterOfView(final View view) { + simulateDragFromCenterOfView(view, 0, 0); + } + + /** + * Asynchronously posts a touch-down and touch-up event at the center of the supplied View. If + * deltaX or deltaY is non-zero a touch-move is generated between the down/up. + */ + public static void simulateDragFromCenterOfView( + final View view, final float deltaX, final float deltaY) { view.post(() -> { long eventTime = SystemClock.uptimeMillis(); float x = (float) (view.getRight() - view.getLeft()) / 2; float y = (float) (view.getBottom() - view.getTop()) / 2; view.dispatchTouchEvent( MotionEvent.obtain(eventTime, eventTime, MotionEvent.ACTION_DOWN, x, y, 0)); - view.dispatchTouchEvent( - MotionEvent.obtain(eventTime, eventTime, MotionEvent.ACTION_UP, x, y, 0)); + if (deltaX != 0 || deltaY != 0) { + view.dispatchTouchEvent(MotionEvent.obtain( + eventTime, eventTime, MotionEvent.ACTION_MOVE, x + deltaX, y + deltaY, 0)); + } + view.dispatchTouchEvent(MotionEvent.obtain( + eventTime, eventTime, MotionEvent.ACTION_UP, x + deltaX, y + deltaY, 0)); }); } }
diff --git a/weblayer/shell/android/javatests/src/org/chromium/weblayer/test/TopControlsTest.java b/weblayer/shell/android/javatests/src/org/chromium/weblayer/test/TopControlsTest.java new file mode 100644 index 0000000..f4848ef --- /dev/null +++ b/weblayer/shell/android/javatests/src/org/chromium/weblayer/test/TopControlsTest.java
@@ -0,0 +1,103 @@ +// Copyright 2019 The Chromium 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.weblayer.test; + +import android.support.test.filters.SmallTest; +import android.view.View; + +import org.json.JSONObject; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.base.test.BaseJUnit4ClassRunner; +import org.chromium.base.test.util.UrlUtils; +import org.chromium.content_public.browser.test.util.Criteria; +import org.chromium.content_public.browser.test.util.CriteriaHelper; +import org.chromium.content_public.browser.test.util.TestThreadUtils; +import org.chromium.weblayer.BrowserController; +import org.chromium.weblayer.shell.WebLayerShellActivity; + +/** + * Test for top-controls. + */ +@RunWith(BaseJUnit4ClassRunner.class) +public class TopControlsTest { + @Rule + public WebLayerShellActivityTestRule mActivityTestRule = new WebLayerShellActivityTestRule(); + + private int mTopControlsHeight; + private int mInitialVisiblePageHeight; + + /** + * Returns the visible height of the page as determined by JS. The returned value is in CSS + * pixels (which are most likely not the same as device pixels). + */ + private int getVisiblePageHeight() { + try { + JSONObject result = mActivityTestRule.executeScriptSync("window.innerHeight"); + return result.getInt(BrowserController.SCRIPT_RESULT_KEY); + } catch (Exception e) { + return -1; + } + } + + @Test + @SmallTest + public void testBasic() throws Exception { + final String url = UrlUtils.encodeHtmlDataUri("<body><p style='height:5000px'>"); + WebLayerShellActivity activity = mActivityTestRule.launchShellWithUrl(url); + + TestThreadUtils.runOnUiThreadBlocking(() -> { + mTopControlsHeight = activity.getTopContentsContainer().getHeight(); + Assert.assertTrue(mTopControlsHeight > 0); + Assert.assertEquals(View.VISIBLE, activity.getTopContentsContainer().getVisibility()); + }); + + // Get the size of the page. + mInitialVisiblePageHeight = getVisiblePageHeight(); + Assert.assertTrue(mInitialVisiblePageHeight > 0); + + // Move by the size of the top-controls. + EventUtils.simulateDragFromCenterOfView( + activity.getWindow().getDecorView(), 0, -mTopControlsHeight); + + // Moving should change the size of the page. Don't attempt to correlate the size as the + // page doesn't see pixels, and to attempt to compare may result in rounding errors. Poll + // for this value as there is no good way to detect when done. + CriteriaHelper.pollInstrumentationThread(new Criteria() { + @Override + public boolean isSatisfied() { + return mInitialVisiblePageHeight != getVisiblePageHeight(); + } + }); + + // Moving should also hide the top-controls View. + TestThreadUtils.runOnUiThreadBlocking(() -> { + Assert.assertEquals(View.INVISIBLE, activity.getTopContentsContainer().getVisibility()); + }); + + // Move so top-controls are shown again. + EventUtils.simulateDragFromCenterOfView( + activity.getWindow().getDecorView(), 0, mTopControlsHeight); + + // Wait for the page height to match initial height. + CriteriaHelper.pollInstrumentationThread(new Criteria() { + @Override + public boolean isSatisfied() { + return mInitialVisiblePageHeight == getVisiblePageHeight(); + } + }); + + // top-controls are shown async. + CriteriaHelper.pollUiThread(new Criteria() { + @Override + public boolean isSatisfied() { + return activity.getTopContentsContainer().getVisibility() == View.VISIBLE; + } + }); + } +}
diff --git a/weblayer/shell/android/shell_apk/src/org/chromium/weblayer/shell/WebLayerShellActivity.java b/weblayer/shell/android/shell_apk/src/org/chromium/weblayer/shell/WebLayerShellActivity.java index 42f25db..c5190c9 100644 --- a/weblayer/shell/android/shell_apk/src/org/chromium/weblayer/shell/WebLayerShellActivity.java +++ b/weblayer/shell/android/shell_apk/src/org/chromium/weblayer/shell/WebLayerShellActivity.java
@@ -89,6 +89,10 @@ super.startActivityFromFragment(fragment, intent, requestCode, options); } + public View getTopContentsContainer() { + return mTopContentsContainer; + } + @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState);
diff --git a/weblayer/test/BUILD.gn b/weblayer/test/BUILD.gn index 824c690..500906ad 100644 --- a/weblayer/test/BUILD.gn +++ b/weblayer/test/BUILD.gn
@@ -84,6 +84,7 @@ ] sources = [ + "../browser/webui/webui_browsertest.cc", "browsertests_main.cc", "ssl_browsertest.cc", "test_launcher_delegate_impl.cc",
diff --git a/weblayer/test/weblayer_browser_test_utils.cc b/weblayer/test/weblayer_browser_test_utils.cc index 28b6437..09244d2 100644 --- a/weblayer/test/weblayer_browser_test_utils.cc +++ b/weblayer/test/weblayer_browser_test_utils.cc
@@ -5,6 +5,8 @@ #include "weblayer/test/weblayer_browser_test_utils.h" #include "base/run_loop.h" +#include "base/strings/utf_string_conversions.h" +#include "base/test/bind_test_util.h" #include "url/gurl.h" #include "weblayer/public/browser_controller.h" #include "weblayer/public/navigation.h" @@ -40,8 +42,10 @@ // NavigationObserver implementation: void NavigationCompleted(Navigation* navigation) override { if (navigation->GetURL() == url_ && - event_ == NavigationEventToObserve::Completion) - std::move(closure_).Run(); + event_ == NavigationEventToObserve::Completion) { + navigation_complete_ = true; + CheckComplete(); + } } void NavigationFailed(Navigation* navigation) override { @@ -51,10 +55,22 @@ } } + void LoadStateChanged(bool is_loading, bool to_different_document) override { + done_loading_ = !is_loading; + CheckComplete(); + } + + void CheckComplete() { + if (done_loading_ && navigation_complete_) + std::move(closure_).Run(); + } + base::OnceClosure closure_; const GURL url_; NavigationEventToObserve event_; BrowserController* browser_; + bool done_loading_ = false; + bool navigation_complete_ = false; }; // Navigates to |url| in |shell| and waits for |event| to occur. @@ -82,4 +98,18 @@ url, shell, TestNavigationObserver::NavigationEventToObserve::Failure); } +base::Value ExecuteScript(Shell* shell, const std::string& script) { + base::Value final_result; + base::RunLoop run_loop; + shell->browser_controller()->ExecuteScript( + base::ASCIIToUTF16(script), + base::BindLambdaForTesting( + [&run_loop, &final_result](base::Value result) { + final_result = std::move(result); + run_loop.Quit(); + })); + run_loop.Run(); + return final_result; +} + } // namespace weblayer
diff --git a/weblayer/test/weblayer_browser_test_utils.h b/weblayer/test/weblayer_browser_test_utils.h index d87a1380..4919d9e 100644 --- a/weblayer/test/weblayer_browser_test_utils.h +++ b/weblayer/test/weblayer_browser_test_utils.h
@@ -5,6 +5,8 @@ #ifndef WEBLAYER_TEST_WEBLAYER_BROWSER_TEST_UTILS_H_ #define WEBLAYER_TEST_WEBLAYER_BROWSER_TEST_UTILS_H_ +#include "base/values.h" + class GURL; namespace weblayer { @@ -16,6 +18,9 @@ // Navigates |shell| to |url| and wait for failed navigation. void NavigateAndWaitForFailure(const GURL& url, Shell* shell); +// Executes |script| in |shell| and returns the result. +base::Value ExecuteScript(Shell* shell, const std::string& script); + } // namespace weblayer #endif // WEBLAYER_TEST_WEBLAYER_BROWSER_TEST_UTILS_H_