diff --git a/AUTHORS b/AUTHORS index be619ba..a0d8a0a 100644 --- a/AUTHORS +++ b/AUTHORS
@@ -727,6 +727,7 @@ William Xie <william.xie@intel.com> Xiang Long <xiang.long@intel.com> Xiangze Zhang <xiangze.zhang@intel.com> +Xiaofeng Zhang <xiaofeng.zhang@intel.com> Xiaolei Yu <dreifachstein@gmail.com> Xiaoyin Liu <xiaoyin.l@outlook.com> Xinchao He <hexinchao@gmail.com>
diff --git a/DEPS b/DEPS index 11c0a22c..17910c2 100644 --- a/DEPS +++ b/DEPS
@@ -44,7 +44,7 @@ # 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': 'a011eb0a6c8d22602afe15a104dd76363371b8cb', + 'v8_revision': '75c2c8d4282f6948697447b4c98d55b25098687d', # 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.
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 9bdeacb2..201c1460 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -5358,6 +5358,12 @@ <message name="IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG"> Debug only if manifest URL ends with debug.nmf. </message> + <message name="IDS_ENABLE_HTTP_FORM_WARNING_NAME" desc="Name of the 'HTTP form warning' feature."> + Show in-form warnings for sensitive fields when the top-level page is not HTTPS + </message> + <message name="IDS_ENABLE_HTTP_FORM_WARNING_DESCRIPTION" desc="Description of the 'HTTP form warning' feature."> + Attaches a warning UI to any password or credit card fields detected when the top-level page is not HTTPS + </message> <message name="IDS_MARK_HTTP_AS_NAME" desc="Name of the 'Mark Non-Secure Origins As' lab."> Mark non-secure origins as non-secure </message> @@ -5373,9 +5379,6 @@ <message name="IDS_MARK_HTTP_WITH_PASSWORDS_OR_CC_WITH_CHIP"> Display a verbose state when password or credit card fields are detected on an HTTP page </message> - <message name="IDS_MARK_HTTP_WITH_PASSWORDS_OR_CC_WITH_CHIP_AND_FORM_WARNING"> - Display a verbose state and form warning when password or credit card fields are detected on an HTTP page - </message> <message name="IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME" desc="Name of the 'Save Page as MHTML' lab."> Save Page as MHTML </message> @@ -6706,14 +6709,6 @@ <message name="IDS_FLAGS_EXTENSION_ACTION_REDESIGN_DESCRIPTION" desc="Description for the flag to enable the extension toolbar redesign"> Enables the (in development) new extension toolbar toolbar design. </message> - <if expr="use_ash"> - <message name="IDS_FLAGS_WEB_APP_FRAME_NAME" desc="Name of the flag that enables the web app style frame for hosted apps."> - Enables the web app style frame for hosted apps - </message> - </if> - <message name="IDS_FLAGS_WEB_APP_FRAME_DESCRIPTION" desc="Description of the flag that enables the web app style frame for hosted apps."> - Enables the web app style frame for hosted apps, including bookmark apps. This is currently only available for Ash. - </message> <message name="IDS_FLAGS_TAB_AUDIO_MUTING_NAME" desc="Name of the flag that enables the tab audio muting UI experiment in chrome://extensions."> Tab audio muting UI control </message> @@ -12865,11 +12860,11 @@ </message> <!-- Backspace shortcut notification strings --> - <message name="IDS_PRESS_ALT_LEFT_TO_GO_BACK" desc="Text displayed in the bubble to explain the keyboard shortcut to go back to the previous web page in history. The accelerators are names of keyboard keys. Please surround the names of the keys (e.g. 'Alt' and '←') in pipe characters so they can be rendered correctly."> - Press |<ph name="ACCELERATOR1">$1<ex>Alt</ex></ph>|+|<ph name="ACCELERATOR2">$2<ex>←</ex></ph>| to go back + <message name="IDS_PRESS_SHORTCUT_TO_GO_BACK" desc="Text displayed in the bubble to explain the keyboard shortcut to go back to the previous web page in history. The shortcut names a keyboard key or key chord. Please surround the shortcut in pipe characters so it can be rendered correctly."> + Press |<ph name="SHORTCUT">$1<ex>Alt-Left</ex></ph>| to go back </message> - <message name="IDS_PRESS_ALT_RIGHT_TO_GO_FORWARD" desc="Text displayed in the bubble to explain the keyboard shortcut to go forward to the next web page in history. The accelerators are names of keyboard keys. Please surround the names of the keys (e.g. 'Alt' and '→') in pipe characters so they can be rendered correctly."> - Press |<ph name="ACCELERATOR1">$1<ex>Alt</ex></ph>|+|<ph name="ACCELERATOR2">$2<ex>→</ex></ph>| to go forward + <message name="IDS_PRESS_SHORTCUT_TO_GO_FORWARD" desc="Text displayed in the bubble to explain the keyboard shortcut to go forward to the next web page in history. The accelerators are names of keyboard keys. The shortcut names a keyboard key or key chord. Please surround the shortcut in pipe characters so it can be rendered correctly."> + Press |<ph name="SHORTCUT">$1<ex>Alt-Right</ex></ph>| to go forward </message> <!-- Register Protocol Handler Strings -->
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 7da76db..8c316fa7 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -52,6 +52,7 @@ #include "components/omnibox/browser/omnibox_switches.h" #include "components/password_manager/core/common/password_manager_features.h" #include "components/proximity_auth/switches.h" +#include "components/security_state/core/security_state.h" #include "components/security_state/core/switches.h" #include "components/signin/core/common/signin_switches.h" #include "components/spellcheck/common/spellcheck_features.h" @@ -210,11 +211,7 @@ security_state::switches::kMarkHttpAsDangerous}, {IDS_MARK_HTTP_WITH_PASSWORDS_OR_CC_WITH_CHIP, security_state::switches::kMarkHttpAs, - security_state::switches::kMarkHttpWithPasswordsOrCcWithChip}, - {IDS_MARK_HTTP_WITH_PASSWORDS_OR_CC_WITH_CHIP_AND_FORM_WARNING, - security_state::switches::kMarkHttpAs, - security_state::switches:: - kMarkHttpWithPasswordsOrCcWithChipAndFormWarning}}; + security_state::switches::kMarkHttpWithPasswordsOrCcWithChip}}; const FeatureEntry::Choice kDataReductionProxyLoFiChoices[] = { { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, @@ -1409,11 +1406,6 @@ IDS_FLAGS_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION, kOsDesktop, SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions)}, #endif // ENABLE_EXTENSIONS -#if defined(USE_ASH) - {"enable-web-app-frame", IDS_FLAGS_WEB_APP_FRAME_NAME, - IDS_FLAGS_WEB_APP_FRAME_DESCRIPTION, kOsWin | kOsCrOS, - SINGLE_VALUE_TYPE(switches::kEnableWebAppFrame)}, -#endif // USE_ASH {"drop-sync-credential", IDS_FLAGS_DROP_SYNC_CREDENTIAL_NAME, IDS_FLAGS_DROP_SYNC_CREDENTIAL_DESCRIPTION, kOsAll, FEATURE_VALUE_TYPE(password_manager::features::kDropSyncCredential)}, @@ -1493,6 +1485,9 @@ #endif // OS_CHROMEOS {"mark-non-secure-as", IDS_MARK_HTTP_AS_NAME, IDS_MARK_HTTP_AS_DESCRIPTION, kOsAll, MULTI_VALUE_TYPE(kMarkHttpAsChoices)}, + {"enable-http-form-warning", IDS_ENABLE_HTTP_FORM_WARNING_NAME, + IDS_ENABLE_HTTP_FORM_WARNING_DESCRIPTION, kOsAll, + FEATURE_VALUE_TYPE(security_state::kHttpFormWarningFeature)}, {"enable-site-per-process", IDS_FLAGS_SITE_PER_PROCESS_NAME, IDS_FLAGS_SITE_PER_PROCESS_DESCRIPTION, kOsAll, SINGLE_VALUE_TYPE(switches::kSitePerProcess)}, @@ -2137,14 +2132,13 @@ {"enable-expanded-autofill-credit-card-popup", IDS_FLAGS_ENABLE_EXPANDED_AUTOFILL_CREDIT_CARD_POPUP_LAYOUT, IDS_FLAGS_ENABLE_EXPANDED_AUTOFILL_CREDIT_CARD_POPUP_LAYOUT_DESCRIPTION, - kOsAndroid, - FEATURE_WITH_VARIATIONS_VALUE_TYPE( - autofill::kAutofillCreditCardPopupLayout, - kAutofillCreditCardPopupLayoutFeatureVariations, - "AutofillCreditCardPopupLayout")}, - {"native-android-history-manager", IDS_NATIVE_ANDROID_HISTORY_MANAGER, - IDS_NATIVE_ANDROID_HISTORY_MANAGER_DESCRIPTION, kOsAndroid, - FEATURE_VALUE_TYPE(chrome::android::kNativeAndroidHistoryManager)}, + kOsAndroid, FEATURE_WITH_VARIATIONS_VALUE_TYPE( + autofill::kAutofillCreditCardPopupLayout, + kAutofillCreditCardPopupLayoutFeatureVariations, + "AutofillCreditCardPopupLayout")}, + {"native-android-history-manager", IDS_NATIVE_ANDROID_HISTORY_MANAGER, + IDS_NATIVE_ANDROID_HISTORY_MANAGER_DESCRIPTION, kOsAndroid, + FEATURE_VALUE_TYPE(chrome::android::kNativeAndroidHistoryManager)}, #endif // OS_ANDROID {"enable-faster-location-reload", IDS_FLAGS_FASTER_LOCATION_RELOAD_NAME, IDS_FLAGS_FASTER_LOCATION_RELOAD_DESCRIPTION, kOsAll,
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index a7546ac..b436041 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -1613,7 +1613,6 @@ "../../common/extensions/api/file_browser_handlers/file_browser_handler_manifest_unittest.cc", "../../common/extensions/api/file_system_provider/file_system_provider_handler_unittest.cc", "../ui/views/frame/immersive_mode_controller_ash_unittest.cc", - "../ui/views/frame/web_app_left_header_view_ash_unittest.cc", "../ui/views/intent_picker_bubble_view_unittest.cc", "../ui/views/select_file_dialog_extension_unittest.cc", "../ui/webui/chromeos/login/l10n_util_test_util.cc",
diff --git a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc index c67b8de..20f1b8e 100644 --- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc +++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc
@@ -44,16 +44,29 @@ DCHECK(data_use_recorders_.empty()); } -ChromeDataUseRecorder* ChromeDataUseAscriber::GetDataUseRecorder( - net::URLRequest* request, - bool can_create_new) { - DataUseRecorderEntry entry = GetDataUseRecorderEntry(request, can_create_new); +ChromeDataUseRecorder* ChromeDataUseAscriber::GetOrCreateDataUseRecorder( + net::URLRequest* request) { + DataUseRecorderEntry entry = GetOrCreateDataUseRecorderEntry(request); return entry == data_use_recorders_.end() ? nullptr : &(*entry); } +ChromeDataUseRecorder* ChromeDataUseAscriber::GetDataUseRecorder( + const net::URLRequest& request) { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + + // TODO(ryansturm): Handle PlzNavigate (http://crbug/664233). + if (content::IsBrowserSideNavigationEnabled()) + return nullptr; + + // If a DataUseRecorder has already been set as user data, then return that. + auto user_data = static_cast<DataUseRecorderEntryAsUserData*>( + request.GetUserData(DataUseRecorderEntryAsUserData::kUserDataKey)); + return user_data ? &(*user_data->recorder_entry()) : nullptr; +} + ChromeDataUseAscriber::DataUseRecorderEntry -ChromeDataUseAscriber::GetDataUseRecorderEntry(net::URLRequest* request, - bool can_create_new) { +ChromeDataUseAscriber::GetOrCreateDataUseRecorderEntry( + net::URLRequest* request) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); // TODO(ryansturm): Handle PlzNavigate (http://crbug/664233). @@ -66,9 +79,6 @@ if (user_data) return user_data->recorder_entry(); - if (!can_create_new) - return data_use_recorders_.end(); - // If request is associated with a ChromeService, create a new // DataUseRecorder for it. There is no reason to aggregate URLRequests // from ChromeServices into the same DataUseRecorder instance. @@ -143,7 +153,7 @@ void ChromeDataUseAscriber::OnUrlRequestDestroyed(net::URLRequest* request) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - DataUseRecorderEntry entry = GetDataUseRecorderEntry(request, true); + DataUseRecorderEntry entry = GetOrCreateDataUseRecorderEntry(request); if (entry == data_use_recorders_.end()) return;
diff --git a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h index a05d8a8b..39a3ef1a8 100644 --- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h +++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h
@@ -55,8 +55,10 @@ ~ChromeDataUseAscriber() override; // DataUseAscriber implementation: - ChromeDataUseRecorder* GetDataUseRecorder(net::URLRequest* request, - bool can_create_new) override; + ChromeDataUseRecorder* GetOrCreateDataUseRecorder( + net::URLRequest* request) override; + ChromeDataUseRecorder* GetDataUseRecorder( + const net::URLRequest& request) override; void OnUrlRequestDestroyed(net::URLRequest* request) override; std::unique_ptr<URLRequestClassifier> CreateURLRequestClassifier() const override; @@ -131,8 +133,8 @@ DataUseRecorderEntry entry_; }; - DataUseRecorderEntry GetDataUseRecorderEntry(net::URLRequest* request, - bool can_create_new); + DataUseRecorderEntry GetOrCreateDataUseRecorderEntry( + net::URLRequest* request); void OnDataUseCompleted(DataUseRecorderEntry entry);
diff --git a/chrome/browser/data_use_measurement/chrome_data_use_ascriber_unittest.cc b/chrome/browser/data_use_measurement/chrome_data_use_ascriber_unittest.cc index d6933aa..4221ac07 100644 --- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber_unittest.cc +++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber_unittest.cc
@@ -115,13 +115,11 @@ kRenderProcessId, kRenderFrameId, true, (void*)request.get()); ascriber()->WasShownOrHidden(kRenderProcessId, kRenderFrameId, true); - EXPECT_TRUE( - ascriber()->GetDataUseRecorder(request.get(), true)->is_visible()); + EXPECT_TRUE(ascriber()->GetDataUseRecorder(*request)->is_visible()); // Hide the frame, and the visibility should be updated. ascriber()->WasShownOrHidden(kRenderProcessId, kRenderFrameId, false); - EXPECT_FALSE( - ascriber()->GetDataUseRecorder(request.get(), true)->is_visible()); + EXPECT_FALSE(ascriber()->GetDataUseRecorder(*request)->is_visible()); ascriber()->RenderFrameDeleted(kRenderProcessId, kRenderFrameId, -1, -1); } @@ -140,13 +138,11 @@ kRenderProcessId, kRenderFrameId, true, (void*)request.get()); ascriber()->WasShownOrHidden(kRenderProcessId, kRenderFrameId, false); - EXPECT_FALSE( - ascriber()->GetDataUseRecorder(request.get(), true)->is_visible()); + EXPECT_FALSE(ascriber()->GetDataUseRecorder(*request)->is_visible()); // Show the frame, and the visibility should be updated. ascriber()->WasShownOrHidden(kRenderProcessId, kRenderFrameId, true); - EXPECT_TRUE( - ascriber()->GetDataUseRecorder(request.get(), true)->is_visible()); + EXPECT_TRUE(ascriber()->GetDataUseRecorder(*request)->is_visible()); ascriber()->RenderFrameDeleted(kRenderProcessId, kRenderFrameId, -1, -1); } @@ -164,8 +160,7 @@ GURL("http://test.com"), content::GlobalRequestID(kRenderProcessId, 0), kRenderProcessId, kRenderFrameId, true, (void*)request.get()); ascriber()->WasShownOrHidden(kRenderProcessId, kRenderFrameId, true); - EXPECT_TRUE( - ascriber()->GetDataUseRecorder(request.get(), true)->is_visible()); + EXPECT_TRUE(ascriber()->GetDataUseRecorder(*request)->is_visible()); // Create a new render frame and swap it. ascriber()->RenderFrameCreated(kRenderProcessId + 1, kRenderFrameId + 1, -1,
diff --git a/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc b/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc index 7e2e435..de3332f3 100644 --- a/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc +++ b/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc
@@ -327,16 +327,9 @@ void SetUpCommandLine(base::CommandLine* command_line) override { SecurityStateTabHelperTest::SetUpCommandLine(command_line); - if (GetParam()) { - command_line->AppendSwitchASCII( - security_state::switches::kMarkHttpAs, - security_state::switches:: - kMarkHttpWithPasswordsOrCcWithChipAndFormWarning); - } else { - command_line->AppendSwitchASCII( - security_state::switches::kMarkHttpAs, - security_state::switches::kMarkHttpWithPasswordsOrCcWithChip); - } + command_line->AppendSwitchASCII( + security_state::switches::kMarkHttpAs, + security_state::switches::kMarkHttpWithPasswordsOrCcWithChip); } private: @@ -906,7 +899,7 @@ // Tests that when a visible password field is detected on an HTTP page // load, and when the command-line flag is set, the security level is // downgraded to HTTP_SHOW_WARNING. -IN_PROC_BROWSER_TEST_P(SecurityStateTabHelperTestWithPasswordCcSwitch, +IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTestWithPasswordCcSwitch, PasswordSecurityLevelDowngraded) { content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); @@ -933,7 +926,7 @@ // Tests that when an invisible password field is present on an HTTP page // load, and when the command-line flag is set, the security level is // *not* downgraded to HTTP_SHOW_WARNING. -IN_PROC_BROWSER_TEST_P(SecurityStateTabHelperTestWithPasswordCcSwitch, +IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTestWithPasswordCcSwitch, PasswordSecurityLevelNotDowngradedForInvisibleInput) { content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); @@ -961,7 +954,7 @@ // Tests that when a visible password field is detected inside an iframe // on an HTTP page load, and when the command-line flag is set, the // security level is downgraded to HTTP_SHOW_WARNING. -IN_PROC_BROWSER_TEST_P(SecurityStateTabHelperTestWithPasswordCcSwitch, +IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTestWithPasswordCcSwitch, PasswordSecurityLevelDowngradedFromIframe) { content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); @@ -998,7 +991,7 @@ #define MAYBE_PasswordSecurityLevelDowngradedFromHttpsIframe \ PasswordSecurityLevelDowngradedFromHttpsIframe #endif -IN_PROC_BROWSER_TEST_P(SecurityStateTabHelperTestWithPasswordCcSwitch, +IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTestWithPasswordCcSwitch, MAYBE_PasswordSecurityLevelDowngradedFromHttpsIframe) { content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); @@ -1064,7 +1057,7 @@ // Tests that when a visible password field is detected on an HTTPS page // load, and when the command-line flag is set, the security level is // *not* downgraded to HTTP_SHOW_WARNING. -IN_PROC_BROWSER_TEST_P(SecurityStateTabHelperTestWithPasswordCcSwitch, +IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTestWithPasswordCcSwitch, PasswordSecurityLevelNotDowngradedOnHttps) { content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); @@ -1160,7 +1153,7 @@ // Tests that console messages are printed upon a call to // GetSecurityInfo() on an HTTP_SHOW_WARNING page, exactly once per // main-frame navigation. -IN_PROC_BROWSER_TEST_P(SecurityStateTabHelperTestWithPasswordCcSwitch, +IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTestWithPasswordCcSwitch, ConsoleMessage) { ConsoleWebContentsDelegate* delegate = new ConsoleWebContentsDelegate( Browser::CreateParams(browser()->profile())); @@ -1319,7 +1312,7 @@ // Tests that additional HTTP_SHOW_WARNING console messages are not // printed after subframe navigations. -IN_PROC_BROWSER_TEST_P(SecurityStateTabHelperTestWithPasswordCcSwitch, +IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTestWithPasswordCcSwitch, ConsoleMessageNotPrintedForFrameNavigation) { ConsoleWebContentsDelegate* delegate = new ConsoleWebContentsDelegate( Browser::CreateParams(browser()->profile())); @@ -1400,7 +1393,7 @@ // Tests that additional HTTP_SHOW_WARNING console messages are not // printed after pushState navigations. -IN_PROC_BROWSER_TEST_P(SecurityStateTabHelperTestWithPasswordCcSwitch, +IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTestWithPasswordCcSwitch, ConsoleMessageNotPrintedForPushStateNavigation) { ConsoleWebContentsDelegate* delegate = new ConsoleWebContentsDelegate( Browser::CreateParams(browser()->profile())); @@ -1474,13 +1467,6 @@ ASSERT_NO_FATAL_FAILURE(CheckForOneHttpWarningConsoleMessage(delegate)); } -INSTANTIATE_TEST_CASE_P(SecurityStateTabHelperTestWithPasswordCcSwitch, - SecurityStateTabHelperTestWithPasswordCcSwitch, - // Here 'true' means that the omnibox warning + form - // warning are enabled, and 'false' means just the - // omnibox warning is enabled. - testing::Bool()); - // Tests that the security state for a WebContents is up to date when the // WebContents is inserted into a Browser's TabStripModel. IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, AddedTab) {
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 2585910..755c8b5 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -1931,8 +1931,6 @@ "views/frame/immersive_handler_factory_mus.h", "views/frame/immersive_mode_controller_ash.cc", "views/frame/immersive_mode_controller_ash.h", - "views/frame/web_app_left_header_view_ash.cc", - "views/frame/web_app_left_header_view_ash.h", "views/tabs/window_finder_ash.cc", ] }
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 09923f0..57561ce 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc
@@ -583,10 +583,6 @@ // |contents| can be NULL because GetWindowTitleForCurrentTab is called by the // window during the window's creation (before tabs have been added). if (contents) { - // The web app frame uses the host instead of the title. - if (ShouldUseWebAppFrame()) - return base::UTF8ToUTF16(contents->GetURL().host()); - title = contents->GetTitle(); FormatTitleForDisplay(&title); } @@ -2408,20 +2404,9 @@ if (!is_app()) return !is_trusted_source(); + // Hosted apps always support a location bar. if (hosted_app_controller_) - return hosted_app_controller_->SupportsLocationBar(); - - return false; -} - -bool Browser::ShouldUseWebAppFrame() const { - // Only use the web app frame for apps in ash, and only if the web app frame - // is enabled. - if (!is_app()) - return false; - - if (hosted_app_controller_) - return hosted_app_controller_->should_use_web_app_frame(); + return true; return false; } @@ -2447,9 +2432,6 @@ if (SupportsLocationBar()) features |= FEATURE_LOCATIONBAR; - - if (ShouldUseWebAppFrame()) - features |= FEATURE_WEBAPPFRAME; } return !!(features & feature); }
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index 3fe7f3b..253be0c9 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h
@@ -138,7 +138,6 @@ FEATURE_BOOKMARKBAR = 16, FEATURE_INFOBAR = 32, FEATURE_DOWNLOADSHELF = 64, - FEATURE_WEBAPPFRAME = 128 }; // The context for a download blocked notification from @@ -832,9 +831,6 @@ // Returns true if the Browser window should show the location bar. bool ShouldShowLocationBar() const; - // Returns true if the Browser window should use a web app style frame. - bool ShouldUseWebAppFrame() const; - // Implementation of SupportsWindowFeature and CanSupportWindowFeature. If // |check_fullscreen| is true, the set of features reflect the actual state of // the browser, otherwise the set of features reflect the possible state of
diff --git a/chrome/browser/ui/extensions/hosted_app_browser_controller.cc b/chrome/browser/ui/extensions/hosted_app_browser_controller.cc index 25aec3a..58bc0e0 100644 --- a/chrome/browser/ui/extensions/hosted_app_browser_controller.cc +++ b/chrome/browser/ui/extensions/hosted_app_browser_controller.cc
@@ -4,7 +4,6 @@ #include "chrome/browser/ui/extensions/hosted_app_browser_controller.h" -#include "base/command_line.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ssl/security_state_tab_helper.h" #include "chrome/browser/ui/browser.h" @@ -12,7 +11,6 @@ #include "chrome/browser/ui/location_bar/location_bar.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/web_applications/web_app.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" #include "components/security_state/core/security_state.h" #include "content/public/browser/web_contents.h" @@ -32,14 +30,6 @@ www + app_url.host() == page_url.host_piece()) && app_url.port() == page_url.port(); } - -#if defined(USE_ASH) -bool IsWebAppFrameEnabled() { - return base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableWebAppFrame); -} -#endif // USE_ASH - } // namespace // static @@ -55,25 +45,9 @@ HostedAppBrowserController::HostedAppBrowserController(Browser* browser) : browser_(browser), extension_id_( - web_app::GetExtensionIdFromApplicationName(browser->app_name())) { - const Extension* extension = - ExtensionRegistry::Get(browser->profile())->GetExtensionById( - extension_id_, ExtensionRegistry::EVERYTHING); - DCHECK(extension); -#if defined(USE_ASH) - should_use_web_app_frame_ = - extension->from_bookmark() && IsWebAppFrameEnabled(); -#else - should_use_web_app_frame_ = false; -#endif -} + web_app::GetExtensionIdFromApplicationName(browser->app_name())) {} -HostedAppBrowserController::~HostedAppBrowserController() { -} - -bool HostedAppBrowserController::SupportsLocationBar() const { - return !should_use_web_app_frame(); -} +HostedAppBrowserController::~HostedAppBrowserController() {} bool HostedAppBrowserController::ShouldShowLocationBar() const { const Extension* extension = @@ -113,9 +87,6 @@ void HostedAppBrowserController::UpdateLocationBarVisibility( bool animate) const { - if (!SupportsLocationBar()) - return; - browser_->window()->GetLocationBar()->UpdateLocationBarVisibility( ShouldShowLocationBar(), animate); }
diff --git a/chrome/browser/ui/extensions/hosted_app_browser_controller.h b/chrome/browser/ui/extensions/hosted_app_browser_controller.h index c3db914b..ae4044e 100644 --- a/chrome/browser/ui/extensions/hosted_app_browser_controller.h +++ b/chrome/browser/ui/extensions/hosted_app_browser_controller.h
@@ -22,9 +22,6 @@ explicit HostedAppBrowserController(Browser* browser); ~HostedAppBrowserController(); - // Whether the browser being controlled can ever show the location bar. - bool SupportsLocationBar() const; - // Whether the browser being controlled should be currently showing the // location bar. bool ShouldShowLocationBar() const; @@ -34,13 +31,9 @@ // animated. void UpdateLocationBarVisibility(bool animate) const; - // Whether the controlled browser should use the web app style frame. - bool should_use_web_app_frame() const { return should_use_web_app_frame_; } - private: Browser* browser_; const std::string extension_id_; - bool should_use_web_app_frame_; DISALLOW_COPY_AND_ASSIGN(HostedAppBrowserController); };
diff --git a/chrome/browser/ui/extensions/hosted_app_browsertest.cc b/chrome/browser/ui/extensions/hosted_app_browsertest.cc index 48b387a..97e0218 100644 --- a/chrome/browser/ui/extensions/hosted_app_browsertest.cc +++ b/chrome/browser/ui/extensions/hosted_app_browsertest.cc
@@ -6,11 +6,9 @@ #include "base/command_line.h" #include "base/compiler_specific.h" -#include "chrome/browser/devtools/devtools_window_testing.h" #include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_util.h" -#include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/extensions/app_launch_params.h" #include "chrome/browser/ui/extensions/application_launch.h" @@ -180,87 +178,3 @@ NavigateAndCheckForLocationBar( app_browser_, "http://www.foo.com/blah", true); } - -// Open a normal browser window, a hosted app window, a legacy packaged app -// window and a dev tools window, and check that the web app frame feature is -// supported correctly. -IN_PROC_BROWSER_TEST_F(HostedAppTest, ShouldUseWebAppFrame) { - base::CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kEnableWebAppFrame); - - // Load a hosted app. - const Extension* bookmark_app = InstallExtensionWithSourceAndFlags( - test_data_dir_.AppendASCII("app"), - 1, - extensions::Manifest::INTERNAL, - extensions::Extension::FROM_BOOKMARK); - ASSERT_TRUE(bookmark_app); - - // Launch it in a window, as AppLauncherHandler::HandleLaunchApp() would. - WebContents* bookmark_app_window = OpenApplication(AppLaunchParams( - browser()->profile(), bookmark_app, extensions::LAUNCH_CONTAINER_WINDOW, - WindowOpenDisposition::NEW_WINDOW, extensions::SOURCE_UNTRACKED)); - ASSERT_TRUE(bookmark_app_window); - - // Load a packaged app. - ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("packaged_app"))); - const Extension* packaged_app = nullptr; - extensions::ExtensionRegistry* registry = - extensions::ExtensionRegistry::Get(browser()->profile()); - for (const scoped_refptr<const extensions::Extension>& extension : - registry->enabled_extensions()) { - if (extension->name() == "Packaged App Test") - packaged_app = extension.get(); - } - ASSERT_TRUE(packaged_app); - - // Launch it in a window, as AppLauncherHandler::HandleLaunchApp() would. - WebContents* packaged_app_window = OpenApplication(AppLaunchParams( - browser()->profile(), packaged_app, extensions::LAUNCH_CONTAINER_WINDOW, - WindowOpenDisposition::NEW_WINDOW, extensions::SOURCE_UNTRACKED)); - ASSERT_TRUE(packaged_app_window); - - DevToolsWindow* devtools_window = - DevToolsWindowTesting::OpenDevToolsWindowSync(browser(), false); - - // The launch should have created a new app browser and a dev tools browser. - ASSERT_EQ(4u, chrome::GetBrowserCount(browser()->profile())); - - // Find the new browsers. - Browser* bookmark_app_browser = nullptr; - Browser* packaged_app_browser = nullptr; - Browser* dev_tools_browser = nullptr; - for (auto* b : *BrowserList::GetInstance()) { - if (b == browser()) { - continue; - } else if (b->app_name() == DevToolsWindow::kDevToolsApp) { - dev_tools_browser = b; - } else if (b->tab_strip_model()->GetActiveWebContents() == - bookmark_app_window) { - bookmark_app_browser = b; - } else { - packaged_app_browser = b; - } - } - ASSERT_TRUE(dev_tools_browser); - ASSERT_TRUE(bookmark_app_browser); - ASSERT_TRUE(bookmark_app_browser != browser()); - ASSERT_TRUE(packaged_app_browser); - ASSERT_TRUE(packaged_app_browser != browser()); - ASSERT_TRUE(packaged_app_browser != bookmark_app_browser); - - EXPECT_FALSE(browser()->SupportsWindowFeature(Browser::FEATURE_WEBAPPFRAME)); - EXPECT_FALSE( - dev_tools_browser->SupportsWindowFeature(Browser::FEATURE_WEBAPPFRAME)); -#if defined(USE_ASH) - const bool kIsAsh = true; -#else - const bool kIsAsh = false; -#endif // USE_ASH - EXPECT_EQ(kIsAsh, bookmark_app_browser->SupportsWindowFeature( - Browser::FEATURE_WEBAPPFRAME)); - EXPECT_FALSE(packaged_app_browser->SupportsWindowFeature( - Browser::FEATURE_WEBAPPFRAME)); - - DevToolsWindowTesting::CloseDevToolsWindowSync(devtools_window); -}
diff --git a/chrome/browser/ui/views/frame/browser_frame.cc b/chrome/browser/ui/views/frame/browser_frame.cc index 1772495..643b739 100644 --- a/chrome/browser/ui/views/frame/browser_frame.cc +++ b/chrome/browser/ui/views/frame/browser_frame.cc
@@ -125,14 +125,6 @@ browser_frame_view_->UpdateThrobber(running); } -void BrowserFrame::UpdateToolbar() { - browser_frame_view_->UpdateToolbar(); -} - -views::View* BrowserFrame::GetLocationIconView() const { - return browser_frame_view_->GetLocationIconView(); -} - BrowserNonClientFrameView* BrowserFrame::GetFrameView() const { return browser_frame_view_; }
diff --git a/chrome/browser/ui/views/frame/browser_frame.h b/chrome/browser/ui/views/frame/browser_frame.h index da102990..8ff0448 100644 --- a/chrome/browser/ui/views/frame/browser_frame.h +++ b/chrome/browser/ui/views/frame/browser_frame.h
@@ -73,15 +73,6 @@ // Tells the frame to update the throbber. void UpdateThrobber(bool running); - // Tells the frame to update any toolbar elements it has. - void UpdateToolbar(); - - // Returns the location icon, if there is a location icon embedded into the - // frame. This is the case for web app frames, which do not have a visible - // toolbar. Instead of using the normal location icon from the location bar - // in the toolbar, these windows have a location icon in the frame. - views::View* GetLocationIconView() const; - // Returns the NonClientFrameView of this frame. BrowserNonClientFrameView* GetFrameView() const;
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc index b50fc04..4353e75 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
@@ -65,13 +65,6 @@ color_id, browser_view_->IsIncognito()); } -void BrowserNonClientFrameView::UpdateToolbar() { -} - -views::View* BrowserNonClientFrameView::GetLocationIconView() const { - return nullptr; -} - views::View* BrowserNonClientFrameView::GetProfileSwitcherView() const { return nullptr; }
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view.h index c09ae08..8009b70 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.h +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.h
@@ -54,13 +54,6 @@ // Updates the throbber. virtual void UpdateThrobber(bool running) = 0; - // Updates any toolbar components in the frame. The default implementation - // does nothing. - virtual void UpdateToolbar(); - - // Returns the location icon, if this frame has any. - virtual views::View* GetLocationIconView() const; - // Returns the profile switcher button, if this frame has any. virtual views::View* GetProfileSwitcherView() const;
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc index 8dde249..1a36534 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
@@ -24,7 +24,6 @@ #include "chrome/browser/ui/views/frame/browser_header_painter_ash.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" -#include "chrome/browser/ui/views/frame/web_app_left_header_view_ash.h" #include "chrome/browser/ui/views/profiles/profile_indicator_icon.h" #include "chrome/browser/ui/views/tab_icon_view.h" #include "chrome/browser/ui/views/tabs/tab_strip.h" @@ -60,18 +59,6 @@ // to hit easily. const int kTabShadowHeight = 4; -// Combines View::ConvertPointToTarget() and View::HitTest() for a given -// |point|. Converts |point| from |src| to |dst| and hit tests it against |dst|. -bool ConvertedHitTest(views::View* src, - views::View* dst, - const gfx::Point& point) { - DCHECK(src); - DCHECK(dst); - gfx::Point converted_point(point); - views::View::ConvertPointToTarget(src, dst, &converted_point); - return dst->HitTestPoint(converted_point); -} - } // namespace /////////////////////////////////////////////////////////////////////////////// @@ -82,7 +69,6 @@ BrowserView* browser_view) : BrowserNonClientFrameView(frame, browser_view), caption_button_container_(nullptr), - web_app_left_header_view_(nullptr), window_icon_(nullptr) { ash::WmLookup::Get() ->GetWindowForWidget(frame) @@ -107,17 +93,12 @@ window_icon_->Update(); } - if (UsePackagedAppHeaderStyle() || UseWebAppHeaderStyle()) { + if (UsePackagedAppHeaderStyle()) { ash::DefaultHeaderPainter* header_painter = new ash::DefaultHeaderPainter; header_painter_.reset(header_painter); header_painter->Init(frame(), this, caption_button_container_); - if (UseWebAppHeaderStyle()) { - web_app_left_header_view_ = new WebAppLeftHeaderView(browser_view()); - AddChildView(web_app_left_header_view_); - header_painter->UpdateLeftHeaderView(web_app_left_header_view_); - } else if (window_icon_) { + if (window_icon_) header_painter->UpdateLeftHeaderView(window_icon_); - } } else { BrowserHeaderPainterAsh* header_painter = new BrowserHeaderPainterAsh; header_painter_.reset(header_painter); @@ -160,7 +141,7 @@ return 0; if (!browser_view()->IsTabStripVisible()) { - return (UsePackagedAppHeaderStyle() || UseWebAppHeaderStyle()) + return (UsePackagedAppHeaderStyle()) ? header_painter_->GetHeaderHeight() : caption_button_container_->bounds().bottom(); } @@ -181,16 +162,6 @@ window_icon_->Update(); } -void BrowserNonClientFrameViewAsh::UpdateToolbar() { - if (web_app_left_header_view_) - web_app_left_header_view_->Update(); -} - -views::View* BrowserNonClientFrameViewAsh::GetLocationIconView() const { - return web_app_left_header_view_ ? - web_app_left_header_view_->GetLocationIconView() : nullptr; -} - /////////////////////////////////////////////////////////////////////////////// // views::NonClientFrameView: @@ -213,12 +184,6 @@ const int hit_test = ash::FrameBorderNonClientHitTest(this, caption_button_container_, point); - // See if the point is actually within the web app back button. - if (hit_test == HTCAPTION && web_app_left_header_view_ && - ConvertedHitTest(this, web_app_left_header_view_, point)) { - return HTCLIENT; - } - // When the window is restored we want a large click target above the tabs // to drag the window, so redirect clicks in the tab's shadow to caption. if (hit_test == HTCLIENT && !frame()->IsMaximized() && @@ -278,8 +243,6 @@ const bool should_paint_as_active = ShouldPaintAsActive(); caption_button_container_->SetPaintAsActive(should_paint_as_active); - if (web_app_left_header_view_) - web_app_left_header_view_->SetPaintAsActive(should_paint_as_active); const ash::HeaderPainter::Mode header_mode = should_paint_as_active ? ash::HeaderPainter::MODE_ACTIVE : ash::HeaderPainter::MODE_INACTIVE; @@ -429,16 +392,10 @@ } bool BrowserNonClientFrameViewAsh::UsePackagedAppHeaderStyle() const { - // Use for non tabbed trusted source windows, e.g. Settings, as well as apps - // that aren't using the newer WebApp style. + // Use for non tabbed trusted source windows, e.g. Settings, as well as apps. const Browser* const browser = browser_view()->browser(); return (!browser->is_type_tabbed() && browser->is_trusted_source()) || - (browser->is_app() && !UseWebAppHeaderStyle()); -} - -bool BrowserNonClientFrameViewAsh::UseWebAppHeaderStyle() const { - return browser_view()->browser()->SupportsWindowFeature( - Browser::FEATURE_WEBAPPFRAME); + browser->is_app(); } void BrowserNonClientFrameViewAsh::LayoutProfileIndicatorIcon() {
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h index b67adf1..400aa8b 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h
@@ -14,7 +14,6 @@ #include "chrome/browser/ui/views/tab_icon_view_model.h" class TabIconView; -class WebAppLeftHeaderView; namespace ash { class FrameCaptionButtonContainerView; @@ -35,8 +34,6 @@ int GetTopInset(bool restored) const override; int GetThemeBackgroundXInset() const override; void UpdateThrobber(bool running) override; - void UpdateToolbar() override; - views::View* GetLocationIconView() const override; // views::NonClientFrameView: gfx::Rect GetBoundsForClientView() const override; @@ -81,8 +78,6 @@ ToggleMaximizeModeRelayout); FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, AvatarDisplayOnTeleportedWindow); - FRIEND_TEST_ALL_PREFIXES(WebAppLeftHeaderViewTest, BackButton); - FRIEND_TEST_ALL_PREFIXES(WebAppLeftHeaderViewTest, LocationIcon); friend class BrowserHeaderPainterAsh; // Distance between the left edge of the NonClientFrameView and the tab strip. @@ -102,11 +97,6 @@ // scheme than browser windows. bool UsePackagedAppHeaderStyle() const; - // Returns true if the header should be painted with a WebApp header style. - // The WebApp header style has a back button and title along with the usual - // accoutrements. - bool UseWebAppHeaderStyle() const; - void LayoutProfileIndicatorIcon(); // Returns true if there is anything to paint. Some fullscreen windows do not @@ -118,10 +108,6 @@ // View which contains the window controls. ash::FrameCaptionButtonContainerView* caption_button_container_; - // The holder for the buttons on the left side of the header. This is included - // for web app style frames, and includes a back button and location icon. - WebAppLeftHeaderView* web_app_left_header_view_; - // For popups, the window icon. TabIconView* window_icon_;
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc index 0125b5b9..6ea7c1c 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc
@@ -15,7 +15,6 @@ #include "chrome/browser/ui/views/frame/browser_header_painter_ash.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" -#include "chrome/browser/ui/views/frame/web_app_left_header_view_ash.h" #include "chrome/browser/ui/views/profiles/profile_indicator_icon.h" #include "chrome/browser/ui/views/tab_icon_view.h" #include "chrome/browser/ui/views/tabs/tab_strip.h" @@ -175,13 +174,6 @@ window_icon_->Update(); } -void BrowserNonClientFrameViewMus::UpdateToolbar() { -} - -views::View* BrowserNonClientFrameViewMus::GetLocationIconView() const { - return nullptr; -} - views::View* BrowserNonClientFrameViewMus::GetProfileSwitcherView() const { #if defined(FRAME_AVATAR_BUTTON) return profile_switcher_.view(); @@ -266,7 +258,7 @@ if (browser_view()->IsToolbarVisible()) PaintToolbarBackground(canvas); - else if (!UsePackagedAppHeaderStyle() && !UseWebAppHeaderStyle()) + else if (!UsePackagedAppHeaderStyle()) PaintContentEdge(canvas); } @@ -401,19 +393,10 @@ } bool BrowserNonClientFrameViewMus::UsePackagedAppHeaderStyle() const { - Browser* browser = browser_view()->browser(); - // For non tabbed trusted source windows, e.g. Settings, use the packaged - // app style frame. - if (!browser->is_type_tabbed() && browser->is_trusted_source()) - return true; - // Use the packaged app style for apps that aren't using the newer WebApp - // style. - return browser->is_app() && !UseWebAppHeaderStyle(); -} - -bool BrowserNonClientFrameViewMus::UseWebAppHeaderStyle() const { - return browser_view()->browser()->SupportsWindowFeature( - Browser::FEATURE_WEBAPPFRAME); + // Use for non tabbed trusted source windows, e.g. Settings, as well as apps. + const Browser* const browser = browser_view()->browser(); + return (!browser->is_type_tabbed() && browser->is_trusted_source()) || + browser->is_app(); } void BrowserNonClientFrameViewMus::LayoutIncognitoButton() { @@ -506,7 +489,7 @@ } void BrowserNonClientFrameViewMus::PaintContentEdge(gfx::Canvas* canvas) { - DCHECK(!UsePackagedAppHeaderStyle() && !UseWebAppHeaderStyle()); + DCHECK(!UsePackagedAppHeaderStyle()); const int bottom = frame_values().normal_insets.bottom(); canvas->FillRect( gfx::Rect(0, bottom, width(), kClientEdgeThickness),
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.h index bdd84f79..4ead067 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.h +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.h
@@ -18,7 +18,6 @@ #endif class TabIconView; -class WebAppLeftHeaderView; class BrowserNonClientFrameViewMus : public BrowserNonClientFrameView, public TabIconViewModel, @@ -37,8 +36,6 @@ int GetTopInset(bool restored) const override; int GetThemeBackgroundXInset() const override; void UpdateThrobber(bool running) override; - void UpdateToolbar() override; - views::View* GetLocationIconView() const override; views::View* GetProfileSwitcherView() const override; // views::NonClientFrameView: @@ -92,11 +89,6 @@ // scheme than browser windows. bool UsePackagedAppHeaderStyle() const; - // Returns true if the header should be painted with a WebApp header style. - // The WebApp header style has a back button and title along with the usual - // accoutrements. - bool UseWebAppHeaderStyle() const; - // Layout the incognito button. void LayoutIncognitoButton();
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index f2a776f..e34983da 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1035,7 +1035,6 @@ // We may end up here during destruction. if (toolbar_) toolbar_->Update(contents); - frame_->UpdateToolbar(); } void BrowserView::ResetToolbarTabState(content::WebContents* contents) { @@ -1283,14 +1282,10 @@ content::WebContents* web_contents, const GURL& virtual_url, const security_state::SecurityInfo& security_info) { - // Some browser windows have a location icon embedded in the frame. Try to - // use that if it exists. If it doesn't exist, use the location icon from - // the location bar. - views::View* popup_anchor = - ui::MaterialDesignController::IsSecondaryUiMaterial() - ? toolbar_->location_bar() - : frame_->GetLocationIconView(); - if (!popup_anchor) + views::View* popup_anchor = nullptr; + if (ui::MaterialDesignController::IsSecondaryUiMaterial()) + popup_anchor = toolbar_->location_bar(); + else popup_anchor = GetLocationBarView()->location_icon_view()->GetImageView(); WebsiteSettingsPopupView::ShowPopup(popup_anchor, gfx::Rect(), profile, @@ -1611,8 +1606,7 @@ #if defined(USE_ASH) // For Ash only, trusted windows (apps and settings) do not show a title, // crbug.com/119411. Child windows (i.e. popups) do show a title. - if (browser_->is_trusted_source() && - !browser_->SupportsWindowFeature(Browser::FEATURE_WEBAPPFRAME)) + if (browser_->is_trusted_source()) return false; #endif // USE_ASH @@ -1646,8 +1640,7 @@ #if defined(USE_ASH) // For Ash only, trusted windows (apps and settings) do not show an icon, // crbug.com/119411. Child windows (i.e. popups) do show an icon. - if (browser_->is_trusted_source() && - !browser_->SupportsWindowFeature(Browser::FEATURE_WEBAPPFRAME)) + if (browser_->is_trusted_source()) return false; #endif // USE_ASH
diff --git a/chrome/browser/ui/views/frame/web_app_left_header_view_ash.cc b/chrome/browser/ui/views/frame/web_app_left_header_view_ash.cc deleted file mode 100644 index c57e05a..0000000 --- a/chrome/browser/ui/views/frame/web_app_left_header_view_ash.cc +++ /dev/null
@@ -1,99 +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 "chrome/browser/ui/views/frame/web_app_left_header_view_ash.h" - -#include "ash/common/frame/caption_buttons/frame_caption_button.h" -#include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h" -#include "chrome/app/chrome_command_ids.h" -#include "chrome/browser/ssl/security_state_tab_helper.h" -#include "chrome/browser/ui/browser_commands.h" -#include "chrome/browser/ui/views/frame/browser_view.h" -#include "components/security_state/core/security_state.h" -#include "components/toolbar/toolbar_model.h" -#include "content/public/browser/navigation_entry.h" -#include "ui/gfx/vector_icons_public.h" -#include "ui/views/layout/box_layout.h" - -// static -const char WebAppLeftHeaderView::kViewClassName[] = "WebAppLeftHeaderView"; - -WebAppLeftHeaderView::WebAppLeftHeaderView(BrowserView* browser_view) - : browser_view_(browser_view) { - SetLayoutManager( - new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); - - back_button_ = - new ash::FrameCaptionButton(this, ash::CAPTION_BUTTON_ICON_BACK); - back_button_->SetImage(ash::CAPTION_BUTTON_ICON_BACK, - ash::FrameCaptionButton::ANIMATE_NO, - gfx::VectorIconId::WINDOW_CONTROL_BACK); - AddChildView(back_button_); - - location_icon_ = - new ash::FrameCaptionButton(this, ash::CAPTION_BUTTON_ICON_LOCATION); - AddChildView(location_icon_); - - Update(); -} - -WebAppLeftHeaderView::~WebAppLeftHeaderView() { -} - -void WebAppLeftHeaderView::Update() { - location_icon_->SetImage( - ash::CAPTION_BUTTON_ICON_LOCATION, ash::FrameCaptionButton::ANIMATE_NO, - browser_view_->browser()->toolbar_model()->GetVectorIcon()); - - back_button_->SetState( - chrome::IsCommandEnabled(browser_view_->browser(), IDC_BACK) - ? views::Button::STATE_NORMAL - : views::Button::STATE_DISABLED); -} - -void WebAppLeftHeaderView::SetPaintAsActive(bool active) { - // TODO(benwells): Check that the disabled and inactive states should be - // drawn in the same way. - back_button_->set_paint_as_active( - active && chrome::IsCommandEnabled(browser_view_->browser(), IDC_BACK)); - location_icon_->set_paint_as_active(active); -} - -views::View* WebAppLeftHeaderView::GetLocationIconView() const { - return location_icon_; -} - -const char* WebAppLeftHeaderView::GetClassName() const { - return kViewClassName; -} - -void WebAppLeftHeaderView::ButtonPressed(views::Button* sender, - const ui::Event& event) { - if (sender == back_button_) - chrome::ExecuteCommand(browser_view_->browser(), IDC_BACK); - else if (sender == location_icon_) - ShowWebsiteSettings(); - else - NOTREACHED(); -} - -void WebAppLeftHeaderView::ShowWebsiteSettings() const { - content::WebContents* tab = browser_view_->GetActiveWebContents(); - if (!tab) - return; - - // Important to use GetVisibleEntry to match what's showing in the title area. - content::NavigationEntry* nav_entry = tab->GetController().GetVisibleEntry(); - // The visible entry can be NULL in the case of window.open(""). - if (!nav_entry) - return; - - SecurityStateTabHelper* helper = SecurityStateTabHelper::FromWebContents(tab); - DCHECK(helper); - - security_state::SecurityInfo security_info; - helper->GetSecurityInfo(&security_info); - chrome::ShowWebsiteSettings(browser_view_->browser(), tab, - nav_entry->GetVirtualURL(), security_info); -}
diff --git a/chrome/browser/ui/views/frame/web_app_left_header_view_ash.h b/chrome/browser/ui/views/frame/web_app_left_header_view_ash.h deleted file mode 100644 index b7c04f7d..0000000 --- a/chrome/browser/ui/views/frame/web_app_left_header_view_ash.h +++ /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. - -#ifndef CHROME_BROWSER_UI_VIEWS_FRAME_WEB_APP_LEFT_HEADER_VIEW_ASH_H_ -#define CHROME_BROWSER_UI_VIEWS_FRAME_WEB_APP_LEFT_HEADER_VIEW_ASH_H_ - -#include "base/gtest_prod_util.h" -#include "base/macros.h" -#include "ui/views/controls/button/button.h" - -class BrowserView; - -namespace ash { -class FrameCaptionButton; -} - -// WebAppLeftHeaderView is a container view for any icons on the left of the -// frame used for web app style windows. It contains a back button and a -// location icon. -class WebAppLeftHeaderView : public views::View, - public views::ButtonListener { - public: - static const char kViewClassName[]; - - explicit WebAppLeftHeaderView(BrowserView* browser_view); - ~WebAppLeftHeaderView() override; - - // Updates the view. - void Update(); - - // Update whether to paint the header view as active or not. - void SetPaintAsActive(bool active); - - views::View* GetLocationIconView() const; - - private: - FRIEND_TEST_ALL_PREFIXES(WebAppLeftHeaderViewTest, BackButton); - FRIEND_TEST_ALL_PREFIXES(WebAppLeftHeaderViewTest, LocationIcon); - - // views::View: - const char* GetClassName() const override; - - // views::ButtonListener: - void ButtonPressed(views::Button* sender, const ui::Event& event) override; - - // Ask the browser to show the website settings dialog. - void ShowWebsiteSettings() const; - - // Update the state of the back button. - void UpdateBackButtonState(bool enabled); - - // The BrowserView for the frame. - BrowserView* browser_view_; - - // The back button. - ash::FrameCaptionButton* back_button_; - - // The location icon indicator. Shows the connection security status and - // allows the user to bring up the website settings dialog. - ash::FrameCaptionButton* location_icon_; - - DISALLOW_COPY_AND_ASSIGN(WebAppLeftHeaderView); -}; - -#endif // CHROME_BROWSER_UI_VIEWS_FRAME_WEB_APP_LEFT_HEADER_VIEW_ASH_H_
diff --git a/chrome/browser/ui/views/frame/web_app_left_header_view_ash_unittest.cc b/chrome/browser/ui/views/frame/web_app_left_header_view_ash_unittest.cc deleted file mode 100644 index ac35ba3..0000000 --- a/chrome/browser/ui/views/frame/web_app_left_header_view_ash_unittest.cc +++ /dev/null
@@ -1,128 +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 "chrome/browser/ui/views/frame/web_app_left_header_view_ash.h" - -#include "ash/common/frame/caption_buttons/frame_caption_button.h" -#include "base/command_line.h" -#include "base/macros.h" -#include "base/values.h" -#include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" -#include "chrome/browser/ui/views/frame/browser_view.h" -#include "chrome/browser/ui/views/frame/test_with_browser_view.h" -#include "chrome/common/chrome_switches.h" -#include "components/toolbar/test_toolbar_model.h" -#include "extensions/browser/extension_registry.h" -#include "extensions/common/extension.h" -#include "extensions/common/manifest_constants.h" -#include "ui/aura/window.h" -#include "ui/gfx/vector_icons_public.h" -#include "ui/views/controls/button/button.h" -#include "url/gurl.h" - -class WebAppLeftHeaderViewTest : public TestWithBrowserView { - public: - WebAppLeftHeaderViewTest() - : TestWithBrowserView(Browser::TYPE_TABBED, true), - frame_view_(nullptr), - test_toolbar_model_(nullptr) {} - ~WebAppLeftHeaderViewTest() override {} - - // TestWithBrowserView override: - void SetUp() override { - base::CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kEnableWebAppFrame); - - TestWithBrowserView::SetUp(); - - // Setup a fake toolbar to enable testing. - test_toolbar_model_ = new TestToolbarModel(); - std::unique_ptr<ToolbarModel> toolbar_model(test_toolbar_model_); - browser()->swap_toolbar_models(&toolbar_model); - test_toolbar_model_->set_icon(gfx::VectorIconId::LOCATION_BAR_HTTP); - - AddTab(browser(), GURL("about:blank")); - NavigateAndCommitActiveTab(GURL("http://www.google.com")); - browser()->window()->Show(); - - views::Widget* widget = browser_view()->GetWidget(); - frame_view_ = static_cast<BrowserNonClientFrameViewAsh*>( - widget->non_client_view()->frame_view()); - } - - Browser* CreateBrowser(Profile* profile, - Browser::Type browser_type, - bool hosted_app, - BrowserWindow* browser_window) override { - RegisterExtension(profile); - - Browser::CreateParams params(profile); - params = Browser::CreateParams::CreateForApp( - "_crx_abc", false /* trusted_source */, gfx::Rect(), profile); - params.window = browser_window; - return new Browser(params); - } - - protected: - // Owned by the browser view. - BrowserNonClientFrameViewAsh* frame_view_; - - // Owned by the browser. - TestToolbarModel* test_toolbar_model_; - - private: - void RegisterExtension(Profile* profile) { - base::DictionaryValue manifest; - manifest.SetString(extensions::manifest_keys::kName, "Test"); - manifest.SetString(extensions::manifest_keys::kVersion, "1"); - manifest.SetString(extensions::manifest_keys::kLaunchWebURL, - "http://www.google.com"); - - std::string error; - scoped_refptr<extensions::Extension> extension( - extensions::Extension::Create( - base::FilePath(), extensions::Manifest::UNPACKED, manifest, - extensions::Extension::FROM_BOOKMARK, "abc", &error)); - - ASSERT_TRUE(extension.get()) << error; - - extensions::ExtensionRegistry::Get(profile)-> - AddEnabled(extension); - } - - DISALLOW_COPY_AND_ASSIGN(WebAppLeftHeaderViewTest); -}; - -TEST_F(WebAppLeftHeaderViewTest, BackButton) { - WebAppLeftHeaderView* view = frame_view_->web_app_left_header_view_; - - // The left header view should not be null or our test is broken. - ASSERT_TRUE(view); - - // The back button should be inactive until a navigate happens. - EXPECT_EQ(views::Button::STATE_DISABLED, view->back_button_->state()); - - NavigateAndCommitActiveTab(GURL("www2.google.com")); - - // The back button should be active now that a navigation happened. - EXPECT_EQ(views::Button::STATE_NORMAL, view->back_button_->state()); -} - -TEST_F(WebAppLeftHeaderViewTest, LocationIcon) { - WebAppLeftHeaderView* view = frame_view_->web_app_left_header_view_; - - // The left header view should not be null or our test is broken. - ASSERT_TRUE(view); - - // The location icon should be non-secure one. - EXPECT_EQ(gfx::VectorIconId::LOCATION_BAR_HTTP, - view->location_icon_->icon_image_id()); - - test_toolbar_model_->set_icon(gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID); - NavigateAndCommitActiveTab(GURL("https://secure.google.com")); - - // The location icon should now be the secure one. - EXPECT_EQ(gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID, - view->location_icon_->icon_image_id()); -}
diff --git a/chrome/browser/ui/views/new_back_shortcut_bubble.cc b/chrome/browser/ui/views/new_back_shortcut_bubble.cc index 21a6238..4c5528c 100644 --- a/chrome/browser/ui/views/new_back_shortcut_bubble.cc +++ b/chrome/browser/ui/views/new_back_shortcut_bubble.cc
@@ -10,6 +10,7 @@ #include "base/single_thread_task_runner.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_task_runner_handle.h" +#include "chrome/app/chrome_command_ids.h" #include "chrome/browser/ui/views/exclusive_access_bubble_views_context.h" #include "chrome/browser/ui/views/subtle_notification_view.h" #include "chrome/grit/generated_resources.h" @@ -55,23 +56,16 @@ } void NewBackShortcutBubble::UpdateContent(bool forward) { - // Note: The key names are parameters so that we can vary by operating system - // or change the direction of the arrow as necessary (see - // https://crbug.com/612685). - -#if defined(OS_MACOSX) - // U+2318 = PLACE OF INTEREST SIGN (Mac Command symbol). - base::string16 accelerator = base::WideToUTF16(L"\x2318"); -#else - base::string16 accelerator = l10n_util::GetStringUTF16(IDS_APP_ALT_KEY); -#endif - - int message_id = forward ? IDS_PRESS_ALT_RIGHT_TO_GO_FORWARD - : IDS_PRESS_ALT_LEFT_TO_GO_BACK; - // U+2192 = RIGHTWARDS ARROW; U+2190 = LEFTWARDS ARROW. - base::string16 arrow_key = base::WideToUTF16(forward ? L"\x2192" : L"\x2190"); + const int command_id = forward ? IDC_FORWARD : IDC_BACK; + ui::Accelerator accelerator; + const bool got_accelerator = + bubble_view_context_->GetAcceleratorProvider() + ->GetAcceleratorForCommandId(command_id, &accelerator); + DCHECK(got_accelerator); + const int message_id = forward ? IDS_PRESS_SHORTCUT_TO_GO_FORWARD + : IDS_PRESS_SHORTCUT_TO_GO_BACK; view_->UpdateContent( - l10n_util::GetStringFUTF16(message_id, accelerator, arrow_key), + l10n_util::GetStringFUTF16(message_id, accelerator.GetShortcutText()), base::string16()); view_->SetSize(GetPopupRect(true).size());
diff --git a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc index a1e948e..f03fa02c 100644 --- a/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc
@@ -70,6 +70,7 @@ void ValidateOrigin( const std::string& expected_origin, + const std::string& expected_display_name, const std::string& expected_embedding, const std::string& expected_setting, const std::string& expected_source, @@ -91,9 +92,12 @@ EXPECT_EQ(1U, exceptions->GetSize()); const base::DictionaryValue* exception; ASSERT_TRUE(exceptions->GetDictionary(0, &exception)); - std::string origin, embedding_origin, setting, source; + std::string origin, embedding_origin, display_name, setting, source; ASSERT_TRUE(exception->GetString(site_settings::kOrigin, &origin)); ASSERT_EQ(expected_origin, origin); + ASSERT_TRUE( + exception->GetString(site_settings::kDisplayName, &display_name)); + ASSERT_EQ(expected_display_name, display_name); ASSERT_TRUE(exception->GetString( site_settings::kEmbeddingOrigin, &embedding_origin)); ASSERT_EQ(expected_embedding, embedding_origin); @@ -249,7 +253,7 @@ listArgs.AppendString(kCallbackId); listArgs.AppendString("notifications"); handler()->HandleGetExceptionList(&listArgs); - ValidateOrigin(google, google, "block", "preference", 2U); + ValidateOrigin(google, google, google, "block", "preference", 2U); // Reset things back to how they were. base::ListValue resetArgs; @@ -273,9 +277,10 @@ CONTENT_SETTING_BLOCK, "preference", false); - std::string primary_pattern, secondary_pattern, type; + std::string primary_pattern, secondary_pattern, display_name, type; bool incognito; CHECK(exception->GetString(site_settings::kOrigin, &primary_pattern)); + CHECK(exception->GetString(site_settings::kDisplayName, &display_name)); CHECK(exception->GetString(site_settings::kEmbeddingOrigin, &secondary_pattern)); CHECK(exception->GetString(site_settings::kSetting, &type)); @@ -309,6 +314,7 @@ const base::DictionaryValue* dictionary; CHECK(exceptions->GetDictionary(0, &dictionary)); CHECK(dictionary->GetString(site_settings::kOrigin, &primary_pattern)); + CHECK(dictionary->GetString(site_settings::kDisplayName, &display_name)); CHECK(dictionary->GetString(site_settings::kEmbeddingOrigin, &secondary_pattern)); CHECK(dictionary->GetString(site_settings::kSetting, &type));
diff --git a/chrome/browser/ui/webui/site_settings_helper.cc b/chrome/browser/ui/webui/site_settings_helper.cc index ef0a5fed..9cba22a 100644 --- a/chrome/browser/ui/webui/site_settings_helper.cc +++ b/chrome/browser/ui/webui/site_settings_helper.cc
@@ -118,6 +118,7 @@ exception->SetString(site_settings::kSetting, setting_string); exception->SetString(site_settings::kOrigin, url_pattern); + exception->SetString(site_settings::kDisplayName, url_pattern); exception->SetString(site_settings::kEmbeddingOrigin, url_pattern); exception->SetString(site_settings::kSource, "HostedApp"); exception->SetBoolean(site_settings::kIncognito, false); @@ -355,6 +356,7 @@ exception->SetString(site_settings::kSetting, setting_string); exception->SetString(site_settings::kOrigin, requesting_origin.spec()); + exception->SetString(site_settings::kDisplayName, requesting_origin.spec()); exception->SetString( site_settings::kEmbeddingOrigin, embedding_origin.spec()); exception->SetString(site_settings::kSource, provider_name);
diff --git a/chrome/browser/ui/webui/site_settings_helper_unittest.cc b/chrome/browser/ui/webui/site_settings_helper_unittest.cc index 7ea98848..e49013b0 100644 --- a/chrome/browser/ui/webui/site_settings_helper_unittest.cc +++ b/chrome/browser/ui/webui/site_settings_helper_unittest.cc
@@ -30,6 +30,9 @@ std::string actual_pattern; dict->GetString("origin", &actual_pattern); EXPECT_EQ(pattern, actual_pattern); + std::string actual_display_name; + dict->GetString("displayName", &actual_display_name); + EXPECT_EQ(pattern, actual_display_name); std::string actual_setting; dict->GetString("setting", &actual_setting); EXPECT_EQ(setting, actual_setting);
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index f68f672a..38a4a889 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc
@@ -450,10 +450,6 @@ const char kEnableUserAlternateProtocolPorts[] = "enable-user-controlled-alternate-protocol-ports"; -// Enables a new "web app" style frame for hosted apps (including bookmark -// apps). -const char kEnableWebAppFrame[] = "enable-web-app-frame"; - // Enables Web Notification custom layouts. const char kEnableWebNotificationCustomLayouts[] = "enable-web-notification-custom-layouts";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 95daaf2..983e84a 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h
@@ -140,7 +140,6 @@ extern const char kEnableTabAudioMuting[]; extern const char kEnableThumbnailRetargeting[]; extern const char kEnableUserAlternateProtocolPorts[]; -extern const char kEnableWebAppFrame[]; extern const char kEnableWebNotificationCustomLayouts[]; extern const char kEnableWebRtcEventLoggingFromExtension[]; extern const char kExtensionContentVerification[];
diff --git a/chromeos/components/tether/BUILD.gn b/chromeos/components/tether/BUILD.gn index 8406725a6..6856664 100644 --- a/chromeos/components/tether/BUILD.gn +++ b/chromeos/components/tether/BUILD.gn
@@ -8,6 +8,8 @@ sources = [ "ble_advertisement_device_queue.cc", "ble_advertisement_device_queue.h", + "ble_constants.cc", + "ble_constants.h", "host_scan_scheduler.cc", "host_scan_scheduler.h", "host_scanner.cc",
diff --git a/chromeos/components/tether/ble_advertisement_device_queue.cc b/chromeos/components/tether/ble_advertisement_device_queue.cc index 4f53fcf..9e36aa0 100644 --- a/chromeos/components/tether/ble_advertisement_device_queue.cc +++ b/chromeos/components/tether/ble_advertisement_device_queue.cc
@@ -8,14 +8,13 @@ #include <string> #include "base/logging.h" +#include "chromeos/components/tether/ble_constants.h" #include "components/proximity_auth/logging/logging.h" namespace chromeos { namespace tether { -const int BleAdvertisementDeviceQueue::kMaxConcurrentAdvertisements = 2; - BleAdvertisementDeviceQueue::BleAdvertisementDeviceQueue() {} BleAdvertisementDeviceQueue::~BleAdvertisementDeviceQueue() {}
diff --git a/chromeos/components/tether/ble_advertisement_device_queue.h b/chromeos/components/tether/ble_advertisement_device_queue.h index 84cff21..27ef00d 100644 --- a/chromeos/components/tether/ble_advertisement_device_queue.h +++ b/chromeos/components/tether/ble_advertisement_device_queue.h
@@ -20,14 +20,6 @@ // fair share of time spent contacting it. class BleAdvertisementDeviceQueue { public: - // The maximum number of devices to which to advertise concurrently. If more - // than this number of devices are registered, some advertisement must be - // stopped before new ones can be added. - // - // Note that this upper limit on concurrent advertisements is imposed due to a - // hardware limit of advertisements. - static const int kMaxConcurrentAdvertisements; - BleAdvertisementDeviceQueue(); virtual ~BleAdvertisementDeviceQueue();
diff --git a/chromeos/components/tether/ble_advertisement_device_queue_unittest.cc b/chromeos/components/tether/ble_advertisement_device_queue_unittest.cc index 6ba67b8..e24bba4 100644 --- a/chromeos/components/tether/ble_advertisement_device_queue_unittest.cc +++ b/chromeos/components/tether/ble_advertisement_device_queue_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "chromeos/components/tether/ble_constants.h" #include "components/cryptauth/remote_device_test_util.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -94,9 +95,9 @@ } TEST_F(BleAdvertisementDeviceQueueTest, TestThreeDevices) { - // Note: These tests need to be rewritten if MAX_CONCURRENT_ADVERTISEMENTS is + // Note: These tests need to be rewritten if |kMaxConcurrentAdvertisements| is // ever changed. - ASSERT_GT(3, BleAdvertisementDeviceQueue::kMaxConcurrentAdvertisements); + ASSERT_GT(3, kMaxConcurrentAdvertisements); std::vector<cryptauth::RemoteDevice> devices = cryptauth::GenerateTestRemoteDevices(3); @@ -121,9 +122,9 @@ } TEST_F(BleAdvertisementDeviceQueueTest, TestAddingDevices) { - // Note: These tests need to be rewritten if MAX_CONCURRENT_ADVERTISEMENTS is + // Note: These tests need to be rewritten if |kMaxConcurrentAdvertisements| is // ever changed. - ASSERT_GT(3, BleAdvertisementDeviceQueue::kMaxConcurrentAdvertisements); + ASSERT_GT(3, kMaxConcurrentAdvertisements); std::vector<cryptauth::RemoteDevice> all_devices = cryptauth::GenerateTestRemoteDevices(5);
diff --git a/chromeos/components/tether/ble_constants.cc b/chromeos/components/tether/ble_constants.cc new file mode 100644 index 0000000..48ca0c09 --- /dev/null +++ b/chromeos/components/tether/ble_constants.cc
@@ -0,0 +1,16 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chromeos/components/tether/ble_constants.h" + +namespace chromeos { + +namespace tether { + +const int kMaxConcurrentAdvertisements = 2; +const char kAdvertisingServiceUuid[] = "0000fe50-0000-1000-8000-00805f9b34fb"; + +} // namespace tether + +} // namespace chromeos
diff --git a/chromeos/components/tether/ble_constants.h b/chromeos/components/tether/ble_constants.h new file mode 100644 index 0000000..25f4b01c --- /dev/null +++ b/chromeos/components/tether/ble_constants.h
@@ -0,0 +1,30 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMEOS_COMPONENTS_TETHER_BLE_CONSTANTS_H_ +#define CHROMEOS_COMPONENTS_TETHER_BLE_CONSTANTS_H_ + +#include <string> + +namespace chromeos { + +namespace tether { + +// The maximum number of devices to which to advertise concurrently. If more +// than this number of devices are registered, other advertisements must be +// stopped before new ones can be added. +// +// Note that this upper limit on concurrent advertisements is imposed due to a +// hardware limit of advertisements (many devices have <10 total advertisement +// slots). +extern const int kMaxConcurrentAdvertisements; + +// The service UUID used for BLE advertisements. +extern const char kAdvertisingServiceUuid[]; + +} // namespace tether + +} // namespace chromeos + +#endif // CHROMEOS_COMPONENTS_TETHER_BLE_CONSTANTS_H_
diff --git a/components/autofill/core/browser/autofill_experiments.cc b/components/autofill/core/browser/autofill_experiments.cc index 28fdc27b..4c2070c 100644 --- a/components/autofill/core/browser/autofill_experiments.cc +++ b/components/autofill/core/browser/autofill_experiments.cc
@@ -16,7 +16,6 @@ #include "components/autofill/core/common/autofill_pref_names.h" #include "components/autofill/core/common/autofill_switches.h" #include "components/prefs/pref_service.h" -#include "components/security_state/core/switches.h" #include "components/sync/driver/sync_service.h" #include "components/variations/variations_associated_data.h" #include "google_apis/gaia/gaia_auth_util.h" @@ -228,12 +227,4 @@ return !group_name.empty() && group_name != "Disabled"; } -bool IsCreditCardAutofillHttpWarningEnabled() { - std::string choice = - base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - security_state::switches::kMarkHttpAs); - return choice == security_state::switches:: - kMarkHttpWithPasswordsOrCcWithChipAndFormWarning; -} - } // namespace autofill
diff --git a/components/autofill/core/browser/autofill_experiments.h b/components/autofill/core/browser/autofill_experiments.h index fc02866..02e891b 100644 --- a/components/autofill/core/browser/autofill_experiments.h +++ b/components/autofill/core/browser/autofill_experiments.h
@@ -67,10 +67,6 @@ const syncer::SyncService* sync_service, const std::string& user_email); -// Returns true if the http warning switch is on, which will display a warning -// in the autofill dropdown when credit card fields are on an HTTP page. -bool IsCreditCardAutofillHttpWarningEnabled(); - // Returns whether the new Autofill credit card popup layout experiment is // enabled. bool IsAutofillCreditCardPopupLayoutExperimentEnabled();
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc index 61a3e6f..f8b7aa0 100644 --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc
@@ -62,6 +62,7 @@ #include "components/prefs/pref_service.h" #include "components/rappor/public/rappor_utils.h" #include "components/rappor/rappor_service_impl.h" +#include "components/security_state/core/security_state.h" #include "google_apis/gaia/identity_provider.h" #include "grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" @@ -589,7 +590,8 @@ // provide them for secure pages with passive mixed content (see impl. of // IsContextSecure). if (is_filling_credit_card && !is_context_secure) { - bool is_http_warning_enabled = IsCreditCardAutofillHttpWarningEnabled(); + bool is_http_warning_enabled = + security_state::IsHttpWarningInFormEnabled(); // Replace the suggestion content with a warning message explaining why // Autofill is disabled for a website. The string is different if the // credit card autofill HTTP warning experiment is enabled.
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc index 07679d9..7274dd6 100644 --- a/components/autofill/core/browser/autofill_manager_unittest.cc +++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -49,7 +49,7 @@ #include "components/autofill/core/common/form_field_data.h" #include "components/prefs/pref_service.h" #include "components/rappor/test_rappor_service.h" -#include "components/security_state/core/switches.h" +#include "components/security_state/core/security_state.h" #include "components/variations/variations_associated_data.h" #include "grit/components_strings.h" #include "net/url_request/url_request_test_util.h" @@ -1019,10 +1019,8 @@ } void SetHttpWarningEnabled() { - base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( - security_state::switches::kMarkHttpAs, - security_state::switches:: - kMarkHttpWithPasswordsOrCcWithChipAndFormWarning); + scoped_feature_list_.InitAndEnableFeature( + security_state::kHttpFormWarningFeature); } protected:
diff --git a/components/data_use_measurement/core/data_use_ascriber.cc b/components/data_use_measurement/core/data_use_ascriber.cc index 2d1c11a..48d0adf 100644 --- a/components/data_use_measurement/core/data_use_ascriber.cc +++ b/components/data_use_measurement/core/data_use_ascriber.cc
@@ -22,21 +22,21 @@ } void DataUseAscriber::OnBeforeUrlRequest(net::URLRequest* request) { - DataUseRecorder* recorder = GetDataUseRecorder(request, true); + DataUseRecorder* recorder = GetOrCreateDataUseRecorder(request); if (recorder) recorder->OnBeforeUrlRequest(request); } void DataUseAscriber::OnNetworkBytesSent(net::URLRequest* request, int64_t bytes_sent) { - DataUseRecorder* recorder = GetDataUseRecorder(request, false); + DataUseRecorder* recorder = GetDataUseRecorder(*request); if (recorder) recorder->OnNetworkBytesSent(request, bytes_sent); } void DataUseAscriber::OnNetworkBytesReceived(net::URLRequest* request, int64_t bytes_received) { - DataUseRecorder* recorder = GetDataUseRecorder(request, false); + DataUseRecorder* recorder = GetDataUseRecorder(*request); if (recorder) recorder->OnNetworkBytesReceived(request, bytes_received); } @@ -45,7 +45,7 @@ bool started) {} void DataUseAscriber::OnUrlRequestDestroyed(net::URLRequest* request) { - DataUseRecorder* recorder = GetDataUseRecorder(request, true); + DataUseRecorder* recorder = GetOrCreateDataUseRecorder(request); if (recorder) recorder->OnUrlRequestDestroyed(request); }
diff --git a/components/data_use_measurement/core/data_use_ascriber.h b/components/data_use_measurement/core/data_use_ascriber.h index eb591e1..78f2b38 100644 --- a/components/data_use_measurement/core/data_use_ascriber.h +++ b/components/data_use_measurement/core/data_use_ascriber.h
@@ -39,9 +39,14 @@ // Returns the DataUseRecorder to which data usage for the given URL should // be ascribed. If no existing DataUseRecorder exists, a new one will be - // created only if |can_create_new| is true. - virtual DataUseRecorder* GetDataUseRecorder(net::URLRequest* request, - bool can_create_new) = 0; + // created. + virtual DataUseRecorder* GetOrCreateDataUseRecorder( + net::URLRequest* request) = 0; + + // Returns the existing DataUseRecorder to which data usage for the given URL + // should be ascribed. + virtual DataUseRecorder* GetDataUseRecorder( + const net::URLRequest& request) = 0; // Returns a URLRequestClassifier that can classify requests for metrics // recording.
diff --git a/components/data_use_measurement/core/data_use_measurement.cc b/components/data_use_measurement/core/data_use_measurement.cc index c7f1f695..6508f99 100644 --- a/components/data_use_measurement/core/data_use_measurement.cc +++ b/components/data_use_measurement/core/data_use_measurement.cc
@@ -8,6 +8,8 @@ #include "base/metrics/sparse_histogram.h" #include "base/strings/stringprintf.h" #include "build/build_config.h" +#include "components/data_use_measurement/core/data_use_ascriber.h" +#include "components/data_use_measurement/core/data_use_recorder.h" #include "components/data_use_measurement/core/data_use_user_data.h" #include "components/data_use_measurement/core/url_request_classifier.h" #include "components/domain_reliability/uploader.h" @@ -66,9 +68,11 @@ DataUseMeasurement::DataUseMeasurement( std::unique_ptr<URLRequestClassifier> url_request_classifier, - const metrics::UpdateUsagePrefCallbackType& metrics_data_use_forwarder) + const metrics::UpdateUsagePrefCallbackType& metrics_data_use_forwarder, + DataUseAscriber* ascriber) : url_request_classifier_(std::move(url_request_classifier)), - metrics_data_use_forwarder_(metrics_data_use_forwarder) + metrics_data_use_forwarder_(metrics_data_use_forwarder), + ascriber_(ascriber) #if defined(OS_ANDROID) , app_state_(base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES), @@ -81,6 +85,7 @@ no_reads_since_background_(false) #endif { + DCHECK(ascriber_); DCHECK(url_request_classifier_); } @@ -190,6 +195,14 @@ } } #endif + + if (is_user_traffic) { + const DataUseRecorder* recorder = ascriber_->GetDataUseRecorder(request); + if (recorder) { + RecordTabStateHistogram(dir, new_app_state, recorder->is_visible(), + bytes); + } + } } void DataUseMeasurement::UpdateDataUsePrefs( @@ -330,4 +343,24 @@ } } +void DataUseMeasurement::RecordTabStateHistogram( + TrafficDirection dir, + DataUseUserData::AppState app_state, + bool is_tab_visible, + int64_t bytes) { + if (app_state == DataUseUserData::UNKNOWN) + return; + + std::string histogram_name = "DataUse.AppTabState."; + histogram_name.append(dir == UPSTREAM ? "Upstream." : "Downstream."); + if (app_state == DataUseUserData::BACKGROUND) { + histogram_name.append("AppBackground"); + } else if (is_tab_visible) { + histogram_name.append("AppForeground.TabForeground"); + } else { + histogram_name.append("AppForeground.TabBackground"); + } + RecordUMAHistogramCount(histogram_name, bytes); +} + } // namespace data_use_measurement
diff --git a/components/data_use_measurement/core/data_use_measurement.h b/components/data_use_measurement/core/data_use_measurement.h index 1422ea5..ffd64f71 100644 --- a/components/data_use_measurement/core/data_use_measurement.h +++ b/components/data_use_measurement/core/data_use_measurement.h
@@ -29,6 +29,7 @@ namespace data_use_measurement { +class DataUseAscriber; class URLRequestClassifier; // Records the data use of user traffic and various services in UMA histograms. @@ -41,7 +42,8 @@ public: DataUseMeasurement( std::unique_ptr<URLRequestClassifier> url_request_classifier, - const metrics::UpdateUsagePrefCallbackType& metrics_data_use_forwarder); + const metrics::UpdateUsagePrefCallbackType& metrics_data_use_forwarder, + DataUseAscriber* ascriber); ~DataUseMeasurement(); // Called before a request is sent. @@ -115,9 +117,9 @@ // Reports the message size of the service requests. void ReportServicesMessageSizeUMA(const net::URLRequest& request); - // A helper function used to record data use of services. It gets the size of - // exchanged message, its direction (which is upstream or downstream) and - // reports to two histogram groups. DataUse.MessageSize.ServiceName and + // Records data use histograms of services. It gets the size of exchanged + // message, its direction (which is upstream or downstream) and reports to two + // histogram groups. DataUse.MessageSize.ServiceName and // DataUse.Services.{Dimensions}. In the second one, services are buckets. // |app_state| indicates the app state which can be foreground, background, or // unknown. @@ -128,6 +130,13 @@ bool is_connection_cellular, int64_t message_size) const; + // Records data use histograms split on TrafficDirection, AppState and + // TabState. + void RecordTabStateHistogram(TrafficDirection dir, + DataUseUserData::AppState app_state, + bool is_tab_visible, + int64_t bytes); + // Classifier for identifying if an URL request is user initiated. std::unique_ptr<URLRequestClassifier> url_request_classifier_; @@ -137,6 +146,9 @@ // class to support registering arbitrary observers. crbug.com/601185 metrics::UpdateUsagePrefCallbackType metrics_data_use_forwarder_; + // DataUseAscriber used to get the attributes of data use. + DataUseAscriber* ascriber_; + #if defined(OS_ANDROID) // Application listener store the last known state of the application in this // field.
diff --git a/components/data_use_measurement/core/data_use_measurement_unittest.cc b/components/data_use_measurement/core/data_use_measurement_unittest.cc index 6f0f66d..e478605 100644 --- a/components/data_use_measurement/core/data_use_measurement_unittest.cc +++ b/components/data_use_measurement/core/data_use_measurement_unittest.cc
@@ -12,6 +12,8 @@ #include "base/run_loop.h" #include "base/test/histogram_tester.h" #include "build/build_config.h" +#include "components/data_use_measurement/core/data_use_ascriber.h" +#include "components/data_use_measurement/core/data_use_recorder.h" #include "components/data_use_measurement/core/url_request_classifier.h" #include "net/base/network_change_notifier.h" #include "net/base/request_priority.h" @@ -41,6 +43,30 @@ } }; +class TestDataUseAscriber : public DataUseAscriber { + public: + TestDataUseAscriber() {} + + DataUseRecorder* GetOrCreateDataUseRecorder( + net::URLRequest* request) override { + return &recorder_; + } + + DataUseRecorder* GetDataUseRecorder(const net::URLRequest& request) override { + return &recorder_; + } + + std::unique_ptr<URLRequestClassifier> CreateURLRequestClassifier() + const override { + return nullptr; + } + + void SetTabVisibility(bool visible) { recorder_.set_is_visible(visible); } + + private: + DataUseRecorder recorder_; +}; + // The more usual initialization of kUserDataKey would be along the lines of // const void* const UserRequestUserDataForTesting::kUserDataKey = // &UserRequestUserDataForTesting::kUserDataKey; @@ -63,7 +89,8 @@ : data_use_measurement_( base::MakeUnique<UserRequestUserDataForTesting>(), base::Bind(&DataUseMeasurementTest::FakeDataUseforwarder, - base::Unretained(this))) { + base::Unretained(this)), + &ascriber_) { // During the test it is expected to not have cellular connection. DCHECK(!net::NetworkChangeNotifier::IsConnectionCellular( net::NetworkChangeNotifier::GetConnectionType())); @@ -165,7 +192,10 @@ } base::MessageLoopForIO loop_; + + TestDataUseAscriber ascriber_; DataUseMeasurement data_use_measurement_; + std::unique_ptr<net::MockClientSocketFactory> socket_factory_; std::unique_ptr<net::TestURLRequestContext> context_; const std::string kConnectionType = "NotCellular"; @@ -342,6 +372,48 @@ "DataUse.BackgroundToFirstDownstream.User", 0); } } + +TEST_F(DataUseMeasurementTest, AppTabState) { + base::HistogramTester histogram_tester; + std::unique_ptr<net::URLRequest> request = CreateTestRequest(kUserRequest); + + // App in foreground, Tab in background. + data_use_measurement_.OnBeforeURLRequest(request.get()); + data_use_measurement_.OnNetworkBytesReceived(*request, 1000); + data_use_measurement_.OnNetworkBytesSent(*request, 100); + + histogram_tester.ExpectTotalCount( + "DataUse.AppTabState.Upstream.AppForeground.TabBackground", 1); + histogram_tester.ExpectTotalCount( + "DataUse.AppTabState.Downstream.AppForeground.TabBackground", 1); + + // App and Tab in foreground. + ascriber_.SetTabVisibility(true); + data_use_measurement_.OnBeforeURLRequest(request.get()); + data_use_measurement_.OnNetworkBytesReceived(*request, 1000); + data_use_measurement_.OnNetworkBytesSent(*request, 100); + + histogram_tester.ExpectTotalCount( + "DataUse.AppTabState.Upstream.AppForeground.TabForeground", 1); + histogram_tester.ExpectTotalCount( + "DataUse.AppTabState.Downstream.AppForeground.TabForeground", 1); + + // App and Tab in background. + data_use_measurement()->OnApplicationStateChangeForTesting( + base::android::APPLICATION_STATE_HAS_STOPPED_ACTIVITIES); + ascriber_.SetTabVisibility(false); + data_use_measurement_.OnBeforeURLRequest(request.get()); + // First network access changes the app state to UNKNOWN and the next nextwork + // access changes to BACKGROUND. + data_use_measurement_.OnNetworkBytesReceived(*request, 1000); + data_use_measurement_.OnNetworkBytesReceived(*request, 1000); + data_use_measurement_.OnNetworkBytesSent(*request, 100); + + histogram_tester.ExpectTotalCount( + "DataUse.AppTabState.Upstream.AppBackground", 1); + histogram_tester.ExpectTotalCount( + "DataUse.AppTabState.Downstream.AppBackground", 1); +} #endif } // namespace data_use_measurement
diff --git a/components/data_use_measurement/core/data_use_network_delegate.cc b/components/data_use_measurement/core/data_use_network_delegate.cc index d4c5b284..87836dc 100644 --- a/components/data_use_measurement/core/data_use_network_delegate.cc +++ b/components/data_use_measurement/core/data_use_network_delegate.cc
@@ -20,7 +20,8 @@ : net::LayeredNetworkDelegate(std::move(nested_network_delegate)), ascriber_(ascriber), data_use_measurement_(std::move(url_request_classifier), - metrics_data_use_forwarder) { + metrics_data_use_forwarder, + ascriber_) { DCHECK(ascriber); }
diff --git a/components/data_use_measurement/core/data_use_network_delegate_unittest.cc b/components/data_use_measurement/core/data_use_network_delegate_unittest.cc index a7a82d3e..eef737f 100644 --- a/components/data_use_measurement/core/data_use_network_delegate_unittest.cc +++ b/components/data_use_measurement/core/data_use_network_delegate_unittest.cc
@@ -38,8 +38,11 @@ public: TestDataUseAscriber() {} - DataUseRecorder* GetDataUseRecorder(net::URLRequest* request, - bool can_create_new) override { + DataUseRecorder* GetOrCreateDataUseRecorder( + net::URLRequest* request) override { + return nullptr; + } + DataUseRecorder* GetDataUseRecorder(const net::URLRequest& request) override { return nullptr; }
diff --git a/components/password_manager/core/browser/password_autofill_manager.cc b/components/password_manager/core/browser/password_autofill_manager.cc index 56f3efc..ffe19fe 100644 --- a/components/password_manager/core/browser/password_autofill_manager.cc +++ b/components/password_manager/core/browser/password_autofill_manager.cc
@@ -12,6 +12,7 @@ #include "base/command_line.h" #include "base/i18n/case_conversion.h" #include "base/logging.h" +#include "base/metrics/field_trial.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string16.h" #include "base/strings/string_util.h" @@ -26,7 +27,7 @@ #include "components/password_manager/core/browser/affiliation_utils.h" #include "components/password_manager/core/browser/password_manager_driver.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h" -#include "components/security_state/core/switches.h" +#include "components/security_state/core/security_state.h" #include "components/strings/grit/components_strings.h" #include "grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" @@ -212,12 +213,7 @@ bool is_context_secure = autofill_client_->IsContextSecure(origin) && (!origin.is_valid() || !origin.SchemeIs("http")); - std::string choice = - base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - security_state::switches::kMarkHttpAs); - if (!is_context_secure && - choice == security_state::switches:: - kMarkHttpWithPasswordsOrCcWithChipAndFormWarning) { + if (!is_context_secure && security_state::IsHttpWarningInFormEnabled()) { std::string icon_str; // Show http info icon for http sites.
diff --git a/components/password_manager/core/browser/password_autofill_manager_unittest.cc b/components/password_manager/core/browser/password_autofill_manager_unittest.cc index 617c5ca..577bc63 100644 --- a/components/password_manager/core/browser/password_autofill_manager_unittest.cc +++ b/components/password_manager/core/browser/password_autofill_manager_unittest.cc
@@ -8,6 +8,7 @@ #include "base/compiler_specific.h" #include "base/message_loop/message_loop.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_feature_list.h" #include "components/autofill/core/browser/popup_item_ids.h" #include "components/autofill/core/browser/suggestion_test_helpers.h" #include "components/autofill/core/browser/test_autofill_client.h" @@ -18,7 +19,7 @@ #include "components/autofill/core/common/password_form_fill_data.h" #include "components/password_manager/core/browser/stub_password_manager_client.h" #include "components/password_manager/core/browser/stub_password_manager_driver.h" -#include "components/security_state/core/switches.h" +#include "components/security_state/core/security_state.h" #include "components/strings/grit/components_strings.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -109,6 +110,11 @@ int fill_data_id() { return fill_data_id_; } autofill::PasswordFormFillData& fill_data() { return fill_data_; } + void SetHttpWarningEnabled() { + scoped_feature_list_.InitAndEnableFeature( + security_state::kHttpFormWarningFeature); + } + std::unique_ptr<PasswordAutofillManager> password_autofill_manager_; base::string16 test_username_; @@ -117,6 +123,7 @@ private: autofill::PasswordFormFillData fill_data_; const int fill_data_id_; + base::test::ScopedFeatureList scoped_feature_list_; // The TestAutofillDriver uses a SequencedWorkerPool which expects the // existence of a MessageLoop. @@ -613,10 +620,7 @@ dummy_key, base::i18n::RIGHT_TO_LEFT, test_username_, autofill::IS_PASSWORD_FIELD, element_bounds); - base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( - security_state::switches::kMarkHttpAs, - security_state::switches:: - kMarkHttpWithPasswordsOrCcWithChipAndFormWarning); + SetHttpWarningEnabled(); // Http warning message shows for non-secure context and switch flag on, so // there are 3 suggestions (+ 1 separator on desktop) in total, and the @@ -672,10 +676,7 @@ dummy_key, base::i18n::RIGHT_TO_LEFT, test_username_, autofill::IS_PASSWORD_FIELD, element_bounds); - base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( - security_state::switches::kMarkHttpAs, - security_state::switches:: - kMarkHttpWithPasswordsOrCcWithChipAndFormWarning); + SetHttpWarningEnabled(); // Http warning message won't show for secure context, even with switch flag // on.
diff --git a/components/security_state/core/security_state.cc b/components/security_state/core/security_state.cc index e0da8bd..328871f5 100644 --- a/components/security_state/core/security_state.cc +++ b/components/security_state/core/security_state.cc
@@ -42,9 +42,7 @@ } if (switch_or_field_trial_group == - switches::kMarkHttpWithPasswordsOrCcWithChip || - switch_or_field_trial_group == - switches::kMarkHttpWithPasswordsOrCcWithChipAndFormWarning) { + switches::kMarkHttpWithPasswordsOrCcWithChip) { if (displayed_sensitive_input_on_http) { *level = security_state::HTTP_SHOW_WARNING; } else { @@ -256,6 +254,9 @@ } // namespace +const base::Feature kHttpFormWarningFeature{"HttpFormWarning", + base::FEATURE_DISABLED_BY_DEFAULT}; + SecurityInfo::SecurityInfo() : security_level(NONE), malicious_content_status(MALICIOUS_CONTENT_STATUS_NONE), @@ -284,6 +285,10 @@ is_origin_secure_callback, result); } +bool IsHttpWarningInFormEnabled() { + return base::FeatureList::IsEnabled(kHttpFormWarningFeature); +} + VisibleSecurityState::VisibleSecurityState() : malicious_content_status(MALICIOUS_CONTENT_STATUS_NONE), connection_info_initialized(false),
diff --git a/components/security_state/core/security_state.h b/components/security_state/core/security_state.h index c7d36a6c..a6b79e8 100644 --- a/components/security_state/core/security_state.h +++ b/components/security_state/core/security_state.h
@@ -9,6 +9,7 @@ #include <memory> #include "base/callback.h" +#include "base/feature_list.h" #include "base/macros.h" #include "net/cert/cert_status_flags.h" #include "net/cert/sct_status_flags.h" @@ -24,6 +25,10 @@ // the form of a VisibleSecurityState struct. namespace security_state { +// A feature for showing a warning in autofill dropdowns for password +// and credit cards fields when the top-level page is not HTTPS. +extern const base::Feature kHttpFormWarningFeature; + // Describes the overall security state of the page. // // If you reorder, add, or delete values from this enum, you must also @@ -216,6 +221,11 @@ IsOriginSecureCallback is_origin_secure_callback, SecurityInfo* result); +// Returns true if an experimental form warning UI about HTTP passwords +// and credit cards is enabled. This warning UI can be enabled with the +// |kHttpFormWarningFeature| feature. +bool IsHttpWarningInFormEnabled(); + } // namespace security_state #endif // COMPONENTS_SECURITY_STATE_SECURITY_STATE_H_
diff --git a/components/security_state/core/switches.cc b/components/security_state/core/switches.cc index 89c35e31f..ced029d 100644 --- a/components/security_state/core/switches.cc +++ b/components/security_state/core/switches.cc
@@ -13,8 +13,6 @@ const char kMarkHttpAsDangerous[] = "non-secure"; const char kMarkHttpWithPasswordsOrCcWithChip[] = "show-non-secure-passwords-cc-ui"; -const char kMarkHttpWithPasswordsOrCcWithChipAndFormWarning[] = - "show-non-secure-passwords-cc-chip-and-form-warning"; } // namespace switches } // namespace security_state
diff --git a/components/security_state/core/switches.h b/components/security_state/core/switches.h index 91a33bec..1c6ba29 100644 --- a/components/security_state/core/switches.h +++ b/components/security_state/core/switches.h
@@ -12,7 +12,6 @@ extern const char kMarkHttpAsNeutral[]; extern const char kMarkHttpAsDangerous[]; extern const char kMarkHttpWithPasswordsOrCcWithChip[]; -extern const char kMarkHttpWithPasswordsOrCcWithChipAndFormWarning[]; } } // namespace security_state
diff --git a/content/browser/accessibility/accessibility_mode_browsertest.cc b/content/browser/accessibility/accessibility_mode_browsertest.cc index 195362e..610bf85 100644 --- a/content/browser/accessibility/accessibility_mode_browsertest.cc +++ b/content/browser/accessibility/accessibility_mode_browsertest.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "content/browser/accessibility/browser_accessibility_state_impl.h" #include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" @@ -28,30 +29,35 @@ return static_cast<WebContentsImpl*>(shell()->web_contents()); } - void ExpectBrowserAccessibilityManager(bool expect_bam, - std::string message = "") { - if (expect_bam) { - EXPECT_NE( - (BrowserAccessibilityManager*)NULL, - web_contents()->GetRootBrowserAccessibilityManager()) << message; - } else { - EXPECT_EQ( - (BrowserAccessibilityManager*)NULL, - web_contents()->GetRootBrowserAccessibilityManager()) << message; - } + protected: + const BrowserAccessibility* FindNode(ui::AXRole role, + const std::string& name) { + const BrowserAccessibility* root = GetManager()->GetRoot(); + CHECK(root); + return FindNodeInSubtree(*root, role, name); } - bool ShouldBeBrowserAccessibilityManager(AccessibilityMode mode) { - switch (mode) { - case AccessibilityModeOff: - case ACCESSIBILITY_MODE_WEB_CONTENTS_ONLY: - return false; - case ACCESSIBILITY_MODE_COMPLETE: - return true; - default: - NOTREACHED(); + BrowserAccessibilityManager* GetManager() { + WebContentsImpl* web_contents = + static_cast<WebContentsImpl*>(shell()->web_contents()); + return web_contents->GetRootBrowserAccessibilityManager(); + } + + private: + const BrowserAccessibility* FindNodeInSubtree( + const BrowserAccessibility& node, + ui::AXRole role, + const std::string& name) { + if (node.GetRole() == role && + node.GetStringAttribute(ui::AX_ATTR_NAME) == name) + return &node; + for (unsigned int i = 0; i < node.PlatformChildCount(); ++i) { + const BrowserAccessibility* result = FindNodeInSubtree( + *node.PlatformGetChild(i), role, name); + if (result) + return result; } - return false; + return nullptr; } }; @@ -59,11 +65,10 @@ NavigateToURL(shell(), GURL(kMinimalPageDataURL)); EXPECT_EQ(AccessibilityModeOff, web_contents()->GetAccessibilityMode()); - ExpectBrowserAccessibilityManager( - ShouldBeBrowserAccessibilityManager(AccessibilityModeOff)); + EXPECT_EQ(nullptr, GetManager()); } -IN_PROC_BROWSER_TEST_F(AccessibilityModeTest, ACCESSIBILITY_MODE_COMPLETE) { +IN_PROC_BROWSER_TEST_F(AccessibilityModeTest, AccessibilityModeComplete) { NavigateToURL(shell(), GURL(kMinimalPageDataURL)); ASSERT_EQ(AccessibilityModeOff, web_contents()->GetAccessibilityMode()); @@ -72,12 +77,11 @@ EXPECT_EQ(ACCESSIBILITY_MODE_COMPLETE, web_contents()->GetAccessibilityMode()); waiter.WaitForNotification(); - ExpectBrowserAccessibilityManager( - ShouldBeBrowserAccessibilityManager(ACCESSIBILITY_MODE_COMPLETE)); + EXPECT_NE(nullptr, GetManager()); } IN_PROC_BROWSER_TEST_F(AccessibilityModeTest, - ACCESSIBILITY_MODE_WEB_CONTENTS_ONLY) { + AccessibilityModeWebContentsOnly) { NavigateToURL(shell(), GURL(kMinimalPageDataURL)); ASSERT_EQ(AccessibilityModeOff, web_contents()->GetAccessibilityMode()); @@ -86,10 +90,8 @@ EXPECT_EQ(ACCESSIBILITY_MODE_WEB_CONTENTS_ONLY, web_contents()->GetAccessibilityMode()); waiter.WaitForNotification(); - // No BrowserAccessibilityManager expected for - // ACCESSIBILITY_MODE_WEB_CONTENTS_ONLY - ExpectBrowserAccessibilityManager(ShouldBeBrowserAccessibilityManager( - ACCESSIBILITY_MODE_WEB_CONTENTS_ONLY)); + // No BrowserAccessibilityManager expected for this mode. + EXPECT_EQ(nullptr, GetManager()); } IN_PROC_BROWSER_TEST_F(AccessibilityModeTest, AddingModes) { @@ -100,20 +102,89 @@ EXPECT_EQ(ACCESSIBILITY_MODE_WEB_CONTENTS_ONLY, web_contents()->GetAccessibilityMode()); waiter.WaitForNotification(); - ExpectBrowserAccessibilityManager( - ShouldBeBrowserAccessibilityManager(ACCESSIBILITY_MODE_WEB_CONTENTS_ONLY), - "Should be no BrowserAccessibilityManager " - "for ACCESSIBILITY_MODE_WEB_CONTENTS_ONLY"); + EXPECT_EQ(nullptr, GetManager()); AccessibilityNotificationWaiter waiter2(shell()->web_contents()); web_contents()->AddAccessibilityMode(ACCESSIBILITY_MODE_COMPLETE); EXPECT_EQ(ACCESSIBILITY_MODE_COMPLETE, web_contents()->GetAccessibilityMode()); waiter2.WaitForNotification(); - ExpectBrowserAccessibilityManager( - ShouldBeBrowserAccessibilityManager(ACCESSIBILITY_MODE_COMPLETE), - "Should be a BrowserAccessibilityManager " - "for ACCESSIBILITY_MODE_COMPLETE"); + EXPECT_NE(nullptr, GetManager()); +} + +IN_PROC_BROWSER_TEST_F(AccessibilityModeTest, + FullAccessibilityHasInlineTextBoxes) { + // TODO(dmazzoni): On Android we use an ifdef to disable inline text boxes, + // we should do it with accessibility flags instead. http://crbug.com/672205 +#if !defined(OS_ANDROID) + NavigateToURL(shell(), GURL(url::kAboutBlankURL)); + + AccessibilityNotificationWaiter waiter(shell()->web_contents(), + ACCESSIBILITY_MODE_COMPLETE, + ui::AX_EVENT_LOAD_COMPLETE); + GURL url("data:text/html,<p>Para</p>"); + NavigateToURL(shell(), url); + waiter.WaitForNotification(); + + const BrowserAccessibility* text = FindNode(ui::AX_ROLE_STATIC_TEXT, "Para"); + ASSERT_NE(nullptr, text); + ASSERT_EQ(1U, text->InternalChildCount()); + BrowserAccessibility* inline_text = text->InternalGetChild(0); + ASSERT_NE(nullptr, inline_text); + EXPECT_EQ(ui::AX_ROLE_INLINE_TEXT_BOX, inline_text->GetRole()); +#endif // !defined(OS_ANDROID) +} + +IN_PROC_BROWSER_TEST_F(AccessibilityModeTest, + MinimalAccessibilityModeHasNoInlineTextBoxes) { + // TODO(dmazzoni): On Android we use an ifdef to disable inline text boxes, + // we should do it with accessibility flags instead. http://crbug.com/672205 +#if !defined(OS_ANDROID) + NavigateToURL(shell(), GURL(url::kAboutBlankURL)); + + AccessibilityNotificationWaiter waiter( + shell()->web_contents(), + ACCESSIBILITY_MODE_FLAG_NATIVE_APIS | + ACCESSIBILITY_MODE_FLAG_WEB_CONTENTS, + ui::AX_EVENT_LOAD_COMPLETE); + GURL url("data:text/html,<p>Para</p>"); + NavigateToURL(shell(), url); + waiter.WaitForNotification(); + + const BrowserAccessibility* text = FindNode(ui::AX_ROLE_STATIC_TEXT, "Para"); + ASSERT_NE(nullptr, text); + EXPECT_EQ(0U, text->InternalChildCount()); +#endif // !defined(OS_ANDROID) +} + +IN_PROC_BROWSER_TEST_F(AccessibilityModeTest, AddScreenReaderModeFlag) { + NavigateToURL(shell(), GURL(url::kAboutBlankURL)); + + AccessibilityNotificationWaiter waiter( + shell()->web_contents(), + ACCESSIBILITY_MODE_FLAG_NATIVE_APIS | + ACCESSIBILITY_MODE_FLAG_WEB_CONTENTS, + ui::AX_EVENT_LOAD_COMPLETE); + GURL url("data:text/html,<input aria-label=Foo placeholder=Bar>"); + NavigateToURL(shell(), url); + waiter.WaitForNotification(); + + const BrowserAccessibility* textbox = FindNode(ui::AX_ROLE_TEXT_FIELD, "Foo"); + ASSERT_NE(nullptr, textbox); + EXPECT_FALSE(textbox->HasStringAttribute(ui::AX_ATTR_PLACEHOLDER)); + int original_id = textbox->GetId(); + + AccessibilityNotificationWaiter waiter2( + shell()->web_contents(), 0, ui::AX_EVENT_LAYOUT_COMPLETE); + BrowserAccessibilityStateImpl::GetInstance()->AddAccessibilityModeFlags( + ACCESSIBILITY_MODE_FLAG_SCREEN_READER); + waiter2.WaitForNotification(); + + const BrowserAccessibility* textbox2 = FindNode( + ui::AX_ROLE_TEXT_FIELD, "Foo"); + ASSERT_NE(nullptr, textbox2); + EXPECT_TRUE(textbox2->HasStringAttribute(ui::AX_ATTR_PLACEHOLDER)); + EXPECT_NE(original_id, textbox2->GetId()); } } // namespace content
diff --git a/content/browser/accessibility/browser_accessibility_state_impl.cc b/content/browser/accessibility/browser_accessibility_state_impl.cc index 4c50bb3..fcd5ba5 100644 --- a/content/browser/accessibility/browser_accessibility_state_impl.cc +++ b/content/browser/accessibility/browser_accessibility_state_impl.cc
@@ -17,8 +17,30 @@ namespace content { +// IMPORTANT! +// These values are written to logs. Do not renumber or delete +// existing items; add new entries to the end of the list. +enum ModeFlagHistogramValue { + UMA_AX_MODE_FLAG_NATIVE_APIS = 0, + UMA_AX_MODE_FLAG_WEB_CONTENTS = 1, + UMA_AX_MODE_FLAG_INLINE_TEXT_BOXES = 2, + UMA_AX_MODE_FLAG_SCREEN_READER = 3, + UMA_AX_MODE_FLAG_HTML = 4, + + // This must always be the last enum. It's okay for its value to + // increase, but none of the other enum values may change. + UMA_AX_MODE_FLAG_MAX +}; + +// Record a histograms for an accessibility mode when it's enabled. +void RecordNewAccessibilityModeFlags(ModeFlagHistogramValue mode_flag) { + UMA_HISTOGRAM_ENUMERATION("Accessibility.ModeFlag", + mode_flag, + UMA_AX_MODE_FLAG_MAX); +} + // Update the accessibility histogram 45 seconds after initialization. -static const int kAccessibilityHistogramDelaySecs = 45; +static const int ACCESSIBILITY_HISTOGRAM_DELAY_SECS = 45; // static BrowserAccessibilityState* BrowserAccessibilityState::GetInstance() { @@ -54,7 +76,7 @@ BrowserThread::PostDelayedTask( update_histogram_thread, FROM_HERE, base::Bind(&BrowserAccessibilityStateImpl::UpdateHistograms, this), - base::TimeDelta::FromSeconds(kAccessibilityHistogramDelaySecs)); + base::TimeDelta::FromSeconds(ACCESSIBILITY_HISTOGRAM_DELAY_SECS)); } BrowserAccessibilityStateImpl::~BrowserAccessibilityStateImpl() { @@ -113,7 +135,10 @@ for (size_t i = 0; i < histogram_callbacks_.size(); ++i) histogram_callbacks_[i].Run(); + // TODO(dmazzoni): remove this in M59 since Accessibility.ModeFlag + // supercedes it. http://crbug.com/672205 UMA_HISTOGRAM_BOOLEAN("Accessibility.State", IsAccessibleBrowser()); + UMA_HISTOGRAM_BOOLEAN("Accessibility.InvertedColors", color_utils::IsInvertedColorScheme()); UMA_HISTOGRAM_BOOLEAN("Accessibility.ManuallyEnabled", @@ -133,7 +158,24 @@ return; } + AccessibilityMode previous_mode = accessibility_mode_; accessibility_mode_ |= mode; + if (accessibility_mode_ == previous_mode) + return; + + // Retrieve only newly added modes for the purposes of logging. + AccessibilityMode new_mode_flags = accessibility_mode_ & (~previous_mode); + if (new_mode_flags & ACCESSIBILITY_MODE_FLAG_NATIVE_APIS) + RecordNewAccessibilityModeFlags(UMA_AX_MODE_FLAG_NATIVE_APIS); + if (new_mode_flags & ACCESSIBILITY_MODE_FLAG_WEB_CONTENTS) + RecordNewAccessibilityModeFlags(UMA_AX_MODE_FLAG_WEB_CONTENTS); + if (new_mode_flags & ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES) + RecordNewAccessibilityModeFlags(UMA_AX_MODE_FLAG_INLINE_TEXT_BOXES); + if (new_mode_flags & ACCESSIBILITY_MODE_FLAG_SCREEN_READER) + RecordNewAccessibilityModeFlags(UMA_AX_MODE_FLAG_SCREEN_READER); + if (new_mode_flags & ACCESSIBILITY_MODE_FLAG_HTML) + RecordNewAccessibilityModeFlags(UMA_AX_MODE_FLAG_HTML); + std::vector<WebContentsImpl*> web_contents_vector = WebContentsImpl::GetAllWebContents(); for (size_t i = 0; i < web_contents_vector.size(); ++i)
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc index d40a576..53cd159 100644 --- a/content/browser/accessibility/browser_accessibility_win.cc +++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -222,6 +222,11 @@ const base::char16 BrowserAccessibilityWin::kEmbeddedCharacter = L'\xfffc'; +void AddAccessibilityModeFlags(AccessibilityMode mode_flags) { + BrowserAccessibilityStateImpl::GetInstance()->AddAccessibilityModeFlags( + mode_flags); +} + // // BrowserAccessibilityRelation // @@ -898,6 +903,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_attributes(BSTR* attributes) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_IA2_GET_ATTRIBUTES); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!attributes) return E_INVALIDARG; *attributes = nullptr; @@ -919,6 +925,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_states(AccessibleStates* states) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_STATES); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -972,6 +979,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_nRelations(LONG* n_relations) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_RELATIONS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -986,6 +994,7 @@ LONG relation_index, IAccessibleRelation** relation) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_RELATION); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1007,6 +1016,7 @@ IAccessibleRelation** relations, LONG* n_relations) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_RELATIONS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1096,6 +1106,7 @@ LONG* similar_items_in_group, LONG* position_in_group) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_GROUP_POSITION); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1117,17 +1128,20 @@ STDMETHODIMP BrowserAccessibilityWin::get_extendedRole(BSTR* extended_role) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_EXTENDED_ROLE); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return E_NOTIMPL; } STDMETHODIMP BrowserAccessibilityWin::get_localizedExtendedRole( BSTR* localized_extended_role) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_LOCALIZED_EXTENDED_ROLE); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return E_NOTIMPL; } STDMETHODIMP BrowserAccessibilityWin::get_nExtendedStates(LONG* n_extended_states) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_EXTENDED_STATES); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return E_NOTIMPL; } STDMETHODIMP @@ -1135,6 +1149,7 @@ BSTR** extended_states, LONG* n_extended_states) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_EXTENDED_STATES); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return E_NOTIMPL; } STDMETHODIMP @@ -1143,10 +1158,12 @@ BSTR** localized_extended_states, LONG* n_localized_extended_states) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_LOCALIZED_EXTENDED_STATES); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return E_NOTIMPL; } STDMETHODIMP BrowserAccessibilityWin::get_locale(IA2Locale* locale) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_LOCALE); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return E_NOTIMPL; } @@ -1299,6 +1316,7 @@ long column, IUnknown** accessible) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACCESSIBLE_AT); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1336,6 +1354,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_caption(IUnknown** accessible) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CAPTION); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1350,6 +1369,7 @@ long column, long* cell_index) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CHILD_INDEX); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1389,6 +1409,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_columnDescription(long column, BSTR* description) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_COLUMN_DESCRIPTION); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1436,6 +1457,7 @@ long column, long* n_columns_spanned) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_COLUMN_EXTENT_AT); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1475,6 +1497,7 @@ IAccessibleTable** accessible_table, long* starting_row_index) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_COLUMN_HEADER); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); // TODO(dmazzoni): implement return E_NOTIMPL; } @@ -1482,6 +1505,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_columnIndex(long cell_index, long* column_index) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_COLUMN_INDEX); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1511,6 +1535,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_nColumns(long* column_count) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_COLUMNS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1529,6 +1554,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_nRows(long* row_count) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_ROWS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1546,6 +1572,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_nSelectedChildren(long* cell_count) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_SELECTED_CHILDREN); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1559,6 +1586,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_nSelectedColumns(long* column_count) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_SELECTED_COLUMNS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1571,6 +1599,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_nSelectedRows(long* row_count) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_SELECTED_ROWS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1584,6 +1613,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_rowDescription(long row, BSTR* description) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ROW_DESCRIPTION); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1630,6 +1660,7 @@ long column, long* n_rows_spanned) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ROW_EXTENT_AT); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1669,6 +1700,7 @@ IAccessibleTable** accessible_table, long* starting_column_index) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ROW_HEADER); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); // TODO(dmazzoni): implement return E_NOTIMPL; } @@ -1676,6 +1708,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_rowIndex(long cell_index, long* row_index) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ROW_INDEX); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1707,6 +1740,7 @@ long** children, long* n_children) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_SELECTED_CHILDREN); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1722,6 +1756,7 @@ long** columns, long* n_columns) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_SELECTED_COLUMNS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1737,6 +1772,7 @@ long** rows, long* n_rows) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_SELECTED_ROWS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1750,6 +1786,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_summary(IUnknown** accessible) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_SUMMARY); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1764,6 +1801,7 @@ long column, boolean* is_selected) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_IS_COLUMN_SELECTED); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1778,6 +1816,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_isRowSelected(long row, boolean* is_selected) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_IS_ROW_SELECTED); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1793,6 +1832,7 @@ long column, boolean* is_selected) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_IS_SELECTED); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1812,6 +1852,7 @@ long* column_extents, boolean* is_selected) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ROW_COLUMN_EXTENTS_AT_INDEX); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1847,21 +1888,25 @@ STDMETHODIMP BrowserAccessibilityWin::selectRow(long row) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SELECT_ROW); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return E_NOTIMPL; } STDMETHODIMP BrowserAccessibilityWin::selectColumn(long column) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SELECT_COLUMN); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return E_NOTIMPL; } STDMETHODIMP BrowserAccessibilityWin::unselectRow(long row) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_UNSELECT_ROW); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return E_NOTIMPL; } STDMETHODIMP BrowserAccessibilityWin::unselectColumn(long column) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_UNSELECT_COLUMN); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return E_NOTIMPL; } @@ -1878,11 +1923,13 @@ long column, IUnknown** cell) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CELL_AT); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return get_accessibleAt(row, column, cell); } STDMETHODIMP BrowserAccessibilityWin::get_nSelectedCells(long* cell_count) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_SELECTED_CELLS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return get_nSelectedChildren(cell_count); } @@ -1890,6 +1937,7 @@ IUnknown*** cells, long* n_selected_cells) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_SELECTED_CELLS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1904,6 +1952,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_selectedColumns(long** columns, long* n_columns) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_TABLE2_GET_SELECTED_COLUMNS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1918,6 +1967,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_selectedRows(long** rows, long* n_rows) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_TABLE2_GET_SELECTED_ROWS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1937,6 +1987,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_columnExtent( long* n_columns_spanned) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_COLUMN_EXTENT); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -1958,6 +2009,7 @@ IUnknown*** cell_accessibles, long* n_column_header_cells) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_COLUMN_HEADER_CELLS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2019,6 +2071,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_columnIndex(long* column_index) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_TABLECELL_GET_COLUMN_INDEX); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2037,6 +2090,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_rowExtent(long* n_rows_spanned) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ROW_EXTENT); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2058,6 +2112,7 @@ IUnknown*** cell_accessibles, long* n_row_header_cells) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ROW_HEADER_CELLS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2119,6 +2174,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_rowIndex(long* row_index) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_TABLECELL_GET_ROW_INDEX); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2135,6 +2191,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_isSelected(boolean* is_selected) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_TABLECELL_GET_IS_SELECTED); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2152,6 +2209,7 @@ long* column_extents, boolean* is_selected) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ROW_COLUMN_EXTENTS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2187,6 +2245,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_table(IUnknown** table) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_TABLE); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2219,6 +2278,8 @@ STDMETHODIMP BrowserAccessibilityWin::get_nCharacters(LONG* n_characters) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_CHARACTERS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER | + ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES); if (!instance_active()) return E_FAIL; @@ -2231,6 +2292,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_caretOffset(LONG* offset) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CARET_OFFSET); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2258,6 +2320,8 @@ LONG* out_width, LONG* out_height) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CHARACTER_EXTENTS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER | + ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES); if (!instance_active()) return E_FAIL; @@ -2291,6 +2355,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_nSelections(LONG* n_selections) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_SELECTIONS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2312,6 +2377,7 @@ LONG* start_offset, LONG* end_offset) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_SELECTION); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2345,6 +2411,7 @@ LONG end_offset, BSTR* text) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_TEXT); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2388,6 +2455,8 @@ LONG* end_offset, BSTR* text) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_TEXT_AT_OFFSET); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER | + ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES); if (!instance_active()) return E_FAIL; @@ -2439,6 +2508,8 @@ LONG* end_offset, BSTR* text) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_TEXT_BEFORE_OFFSET); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER | + ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES); if (!instance_active()) return E_FAIL; @@ -2469,6 +2540,8 @@ LONG* end_offset, BSTR* text) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_TEXT_AFTER_OFFSET); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER | + ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES); if (!instance_active()) return E_FAIL; @@ -2494,6 +2567,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_newText(IA2TextSegment* new_text) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_NEW_TEXT); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2517,6 +2591,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_oldText(IA2TextSegment* old_text) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_OLD_TEXT); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2545,6 +2620,8 @@ IA2CoordinateType coord_type, LONG* offset) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_OFFSET_AT_POINT); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER | + ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES); if (!instance_active()) return E_FAIL; @@ -2563,6 +2640,8 @@ LONG end_index, IA2ScrollType scroll_type) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SCROLL_SUBSTRING_TO); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER | + ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES); // TODO(dmazzoni): adjust this for the start and end index, too. return scrollTo(scroll_type); } @@ -2574,13 +2653,16 @@ LONG x, LONG y) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SCROLL_SUBSTRING_TO_POINT); - // TODO(dmazzoni): adjust this for the start and end index, too. + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER | + ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES); + // TODO(dmazzoni): adjust this for the start and end index, too. return scrollToPoint(coordinate_type, x, y); } STDMETHODIMP BrowserAccessibilityWin::addSelection(LONG start_offset, LONG end_offset) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_ADD_SELECTION); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2594,6 +2676,7 @@ STDMETHODIMP BrowserAccessibilityWin::removeSelection(LONG selection_index) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_REMOVE_SELECTION); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2606,6 +2689,7 @@ STDMETHODIMP BrowserAccessibilityWin::setCaretOffset(LONG offset) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SET_CARET_OFFSET); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2619,6 +2703,7 @@ LONG start_offset, LONG end_offset) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SET_SELECTION); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2638,6 +2723,7 @@ LONG* end_offset, BSTR* text_attributes) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_IATEXT_GET_ATTRIBUTES); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!start_offset || !end_offset || !text_attributes) return E_INVALIDARG; @@ -2676,6 +2762,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_nHyperlinks(long* hyperlink_count) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_N_HYPERLINKS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2690,6 +2777,7 @@ long index, IAccessibleHyperlink** hyperlink) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_HYPERLINK); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2713,6 +2801,7 @@ long char_index, long* hyperlink_index) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_HYPERLINK_INDEX); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2741,6 +2830,7 @@ // Currently, only text links are supported. STDMETHODIMP BrowserAccessibilityWin::get_anchor(long index, VARIANT* anchor) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ANCHOR); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active() || !IsHyperlink()) return E_FAIL; @@ -2765,6 +2855,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_anchorTarget(long index, VARIANT* anchor_target) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ANCHOR_TARGET); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active() || !IsHyperlink()) return E_FAIL; @@ -2792,6 +2883,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_startIndex(long* index) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_START_INDEX); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active() || !IsHyperlink()) return E_FAIL; @@ -2810,6 +2902,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_endIndex(long* index) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_END_INDEX); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); LONG start_index; HRESULT hr = get_startIndex(&start_index); if (hr == S_OK) @@ -2820,6 +2913,7 @@ // This method is deprecated in the IA2 Spec. STDMETHODIMP BrowserAccessibilityWin::get_valid(boolean* valid) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_VALID); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return E_NOTIMPL; } @@ -2829,6 +2923,7 @@ STDMETHODIMP BrowserAccessibilityWin::nActions(long* n_actions) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_N_ACTIONS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2849,6 +2944,7 @@ STDMETHODIMP BrowserAccessibilityWin::doAction(long action_index) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_DO_ACTION); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2862,6 +2958,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_description(long action_index, BSTR* description) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_IAACTION_GET_DESCRIPTION); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return E_NOTIMPL; } @@ -2870,11 +2967,13 @@ BSTR** key_bindings, long* n_bindings) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_KEY_BINDING); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); return E_NOTIMPL; } STDMETHODIMP BrowserAccessibilityWin::get_name(long action_index, BSTR* name) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_NAME); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2903,6 +3002,7 @@ BrowserAccessibilityWin::get_localizedName(long action_index, BSTR* localized_name) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_LOCALIZED_NAME); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2933,6 +3033,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_currentValue(VARIANT* value) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CURRENT_VALUE); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2953,6 +3054,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_minimumValue(VARIANT* value) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_MINIMUM_VALUE); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2973,6 +3075,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_maximumValue(VARIANT* value) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_MAXIMUM_VALUE); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -2993,6 +3096,7 @@ STDMETHODIMP BrowserAccessibilityWin::setCurrentValue(VARIANT new_value) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SET_CURRENT_VALUE); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); // TODO(dmazzoni): Implement this. return E_NOTIMPL; } @@ -3102,6 +3206,7 @@ unsigned int* unique_id, unsigned short* node_type) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_NODE_INFO); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_HTML); if (!instance_active()) return E_FAIL; @@ -3140,6 +3245,7 @@ BSTR* attrib_values, unsigned short* num_attribs) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_ISIMPLEDOMNODE_GET_ATTRIBUTES); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_HTML); if (!instance_active()) return E_FAIL; @@ -3166,6 +3272,7 @@ short* name_space_id, BSTR* attrib_values) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ATTRIBUTES_FOR_NAMES); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_HTML); if (!instance_active()) return E_FAIL; @@ -3198,6 +3305,7 @@ BSTR* style_values, unsigned short *num_style_properties) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_COMPUTED_STYLE); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_HTML); if (!instance_active()) return E_FAIL; @@ -3226,6 +3334,7 @@ BSTR* style_properties, BSTR* style_values) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_COMPUTED_STYLE_FOR_PROPERTIES); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_HTML); if (!instance_active()) return E_FAIL; @@ -3367,17 +3476,20 @@ STDMETHODIMP BrowserAccessibilityWin::get_innerHTML(BSTR* innerHTML) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_INNER_HTML); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_HTML); return E_NOTIMPL; } STDMETHODIMP BrowserAccessibilityWin::get_localInterface(void** local_interface) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_LOCAL_INTERFACE); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_HTML); return E_NOTIMPL; } STDMETHODIMP BrowserAccessibilityWin::get_language(BSTR* language) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_LANGUAGE); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!language) return E_INVALIDARG; *language = nullptr; @@ -3400,6 +3512,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_domText(BSTR* dom_text) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_DOM_TEXT); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!instance_active()) return E_FAIL; @@ -3418,6 +3531,8 @@ int* out_width, int* out_height) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_CLIPPED_SUBSTRING_BOUNDS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER | + ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES); // TODO(dmazzoni): fully support this API by intersecting the // rect with the container's rect. return get_unclippedSubstringBounds( @@ -3432,6 +3547,8 @@ int* out_width, int* out_height) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_UNCLIPPED_SUBSTRING_BOUNDS); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER | + ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES); if (!instance_active()) return E_FAIL; @@ -3457,6 +3574,8 @@ unsigned int start_index, unsigned int end_index) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SCROLL_TO_SUBSTRING); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER | + ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES); if (!instance_active()) return E_FAIL; @@ -3475,6 +3594,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_fontFamily(BSTR* font_family) { WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_FONT_FAMILY); + AddAccessibilityModeFlags(ACCESSIBILITY_MODE_FLAG_SCREEN_READER); if (!font_family) return E_INVALIDARG; *font_family = nullptr;
diff --git a/content/browser/memory/memory_coordinator_impl.cc b/content/browser/memory/memory_coordinator_impl.cc index 92a519f..22e1390 100644 --- a/content/browser/memory/memory_coordinator_impl.cc +++ b/content/browser/memory/memory_coordinator_impl.cc
@@ -195,9 +195,9 @@ } bool MemoryCoordinatorImpl::SetChildMemoryState(int render_process_id, - mojom::MemoryState memory_state) { + MemoryState memory_state) { // Can't set an invalid memory state. - if (memory_state == mojom::MemoryState::UNKNOWN) + if (memory_state == MemoryState::UNKNOWN) return false; // Can't send a message to a child that doesn't exist. @@ -216,21 +216,21 @@ return true; // Can't suspend the given renderer. - if (memory_state == mojom::MemoryState::SUSPENDED && + if (memory_state == MemoryState::SUSPENDED && !CanSuspendRenderer(render_process_id)) return false; // Update the internal state and send the message. iter->second.memory_state = memory_state; - iter->second.handle->child()->OnStateChange(memory_state); + iter->second.handle->child()->OnStateChange(ToMojomMemoryState(memory_state)); return true; } -mojom::MemoryState MemoryCoordinatorImpl::GetChildMemoryState( +base::MemoryState MemoryCoordinatorImpl::GetChildMemoryState( int render_process_id) const { auto iter = children_.find(render_process_id); if (iter == children_.end()) - return mojom::MemoryState::UNKNOWN; + return base::MemoryState::UNKNOWN; return iter->second.memory_state; } @@ -292,7 +292,7 @@ if (iter == children().end()) return; iter->second.is_visible = *Details<bool>(details).ptr(); - auto new_state = ToMojomMemoryState(GetGlobalMemoryState()); + auto new_state = GetGlobalMemoryState(); SetChildMemoryState(iter->first, new_state); } @@ -345,22 +345,22 @@ void MemoryCoordinatorImpl::OnChildAdded(int render_process_id) { // Populate the global state as an initial state of a newly created process. - auto new_state = ToMojomMemoryState(GetGlobalMemoryState()); + auto new_state = GetGlobalMemoryState(); SetChildMemoryState(render_process_id, new_state); } -mojom::MemoryState MemoryCoordinatorImpl::OverrideGlobalState( - mojom::MemoryState memory_state, +base::MemoryState MemoryCoordinatorImpl::OverrideGlobalState( + MemoryState memory_state, const ChildInfo& child) { // We don't suspend foreground renderers. Throttle them instead. - if (child.is_visible && memory_state == mojom::MemoryState::SUSPENDED) - return mojom::MemoryState::THROTTLED; + if (child.is_visible && memory_state == MemoryState::SUSPENDED) + return MemoryState::THROTTLED; #if defined(OS_ANDROID) // On Android, we throttle background renderers immediately. // TODO(bashi): Create a specialized class of MemoryCoordinator for Android // and move this ifdef to the class. - if (!child.is_visible && memory_state == mojom::MemoryState::NORMAL) - return mojom::MemoryState::THROTTLED; + if (!child.is_visible && memory_state == MemoryState::NORMAL) + return MemoryState::THROTTLED; // TODO(bashi): Suspend background renderers after a certain period of time. #endif // defined(OS_ANDROID) return memory_state; @@ -380,7 +380,7 @@ // We'll set renderer's memory state to the current global state when the // corresponding renderer process is ready to communicate. Renderer processes // call AddChild() when they are ready. - child_info.memory_state = mojom::MemoryState::NORMAL; + child_info.memory_state = MemoryState::NORMAL; child_info.is_visible = true; child_info.handle = std::move(handle); } @@ -391,11 +391,10 @@ } void MemoryCoordinatorImpl::NotifyStateToChildren() { - auto mojo_state = ToMojomMemoryState(current_state_); // It's OK to call SetChildMemoryState() unconditionally because it checks // whether this state transition is valid. for (auto& iter : children()) - SetChildMemoryState(iter.first, mojo_state); + SetChildMemoryState(iter.first, current_state_); } void MemoryCoordinatorImpl::RecordStateChange(MemoryState prev_state,
diff --git a/content/browser/memory/memory_coordinator_impl.h b/content/browser/memory/memory_coordinator_impl.h index d95ab53a..b63bc4fa 100644 --- a/content/browser/memory/memory_coordinator_impl.h +++ b/content/browser/memory/memory_coordinator_impl.h
@@ -57,12 +57,11 @@ // Dispatches a memory state change to the provided process. Returns true if // the process is tracked by this coordinator and successfully dispatches, // returns false otherwise. - bool SetChildMemoryState( - int render_process_id, mojom::MemoryState memory_state); + bool SetChildMemoryState(int render_process_id, MemoryState memory_state); // Returns the memory state of the specified render process. Returns UNKNOWN // if the process is not tracked by this coordinator. - mojom::MemoryState GetChildMemoryState(int render_process_id) const; + MemoryState GetChildMemoryState(int render_process_id) const; // Records memory pressure notifications. Called by MemoryPressureMonitor. // TODO(bashi): Remove this when MemoryPressureMonitor is retired. @@ -115,7 +114,7 @@ ChildInfo(const ChildInfo& rhs); ~ChildInfo(); - mojom::MemoryState memory_state; + MemoryState memory_state; bool is_visible = false; std::unique_ptr<MemoryCoordinatorHandleImpl> handle; }; @@ -146,8 +145,8 @@ // Called by SetChildMemoryState() to determine a child memory state based on // the current status of the child process. - mojom::MemoryState OverrideGlobalState(mojom::MemoryState memroy_state, - const ChildInfo& child); + MemoryState OverrideGlobalState(MemoryState memroy_state, + const ChildInfo& child); void SetDelegateForTesting( std::unique_ptr<MemoryCoordinatorDelegate> delegate);
diff --git a/content/browser/memory/memory_coordinator_impl_unittest.cc b/content/browser/memory/memory_coordinator_impl_unittest.cc index 0aa49d7a..e52b303 100644 --- a/content/browser/memory/memory_coordinator_impl_unittest.cc +++ b/content/browser/memory/memory_coordinator_impl_unittest.cc
@@ -116,7 +116,7 @@ // Wrapper of MemoryCoordinator::SetMemoryState that also calls RunUntilIdle. bool SetChildMemoryState( - int render_process_id, mojom::MemoryState memory_state) { + int render_process_id, MemoryState memory_state) { bool result = MemoryCoordinatorImpl::SetChildMemoryState( render_process_id, memory_state); RunUntilIdle(); @@ -130,6 +130,8 @@ class MemoryCoordinatorImplTest : public testing::Test { public: + using MemoryState = base::MemoryState; + void SetUp() override { scoped_feature_list_.InitAndEnableFeature(features::kMemoryCoordinator); @@ -168,7 +170,7 @@ auto cmc1 = coordinator_->CreateChildMemoryCoordinator(1); EXPECT_FALSE( - coordinator_->SetChildMemoryState(1, mojom::MemoryState::UNKNOWN)); + coordinator_->SetChildMemoryState(1, MemoryState::UNKNOWN)); EXPECT_EQ(0, cmc1->on_state_change_calls()); } @@ -176,7 +178,7 @@ auto cmc1 = coordinator_->CreateChildMemoryCoordinator(1); EXPECT_FALSE( - coordinator_->SetChildMemoryState(2, mojom::MemoryState::THROTTLED)); + coordinator_->SetChildMemoryState(2, MemoryState::THROTTLED)); EXPECT_EQ(0, cmc1->on_state_change_calls()); } @@ -184,7 +186,7 @@ auto cmc1 = coordinator_->CreateChildMemoryCoordinator(1); EXPECT_FALSE( - coordinator_->SetChildMemoryState(2, mojom::MemoryState::NORMAL)); + coordinator_->SetChildMemoryState(2, MemoryState::NORMAL)); EXPECT_EQ(0, cmc1->on_state_change_calls()); } @@ -193,12 +195,12 @@ auto cmc2 = coordinator_->CreateChildMemoryCoordinator(2); EXPECT_TRUE( - coordinator_->SetChildMemoryState(1, mojom::MemoryState::THROTTLED)); + coordinator_->SetChildMemoryState(1, MemoryState::THROTTLED)); EXPECT_EQ(1, cmc1->on_state_change_calls()); EXPECT_EQ(mojom::MemoryState::THROTTLED, cmc1->state()); EXPECT_TRUE( - coordinator_->SetChildMemoryState(2, mojom::MemoryState::SUSPENDED)); + coordinator_->SetChildMemoryState(2, MemoryState::SUSPENDED)); EXPECT_EQ(1, cmc2->on_state_change_calls()); // Child processes are considered as visible (foreground) by default, // and visible ones won't be suspended but throttled. @@ -212,28 +214,28 @@ // Foreground iter->second.is_visible = true; - EXPECT_TRUE(coordinator_->SetChildMemoryState(1, mojom::MemoryState::NORMAL)); + EXPECT_TRUE(coordinator_->SetChildMemoryState(1, MemoryState::NORMAL)); EXPECT_EQ(mojom::MemoryState::NORMAL, cmc->state()); EXPECT_TRUE( - coordinator_->SetChildMemoryState(1, mojom::MemoryState::THROTTLED)); + coordinator_->SetChildMemoryState(1, MemoryState::THROTTLED)); EXPECT_EQ(mojom::MemoryState::THROTTLED, cmc->state()); EXPECT_TRUE( - coordinator_->SetChildMemoryState(1, mojom::MemoryState::SUSPENDED)); + coordinator_->SetChildMemoryState(1, MemoryState::SUSPENDED)); EXPECT_EQ(mojom::MemoryState::THROTTLED, cmc->state()); // Background iter->second.is_visible = false; - EXPECT_TRUE(coordinator_->SetChildMemoryState(1, mojom::MemoryState::NORMAL)); + EXPECT_TRUE(coordinator_->SetChildMemoryState(1, MemoryState::NORMAL)); #if defined(OS_ANDROID) EXPECT_EQ(mojom::MemoryState::THROTTLED, cmc->state()); #else EXPECT_EQ(mojom::MemoryState::NORMAL, cmc->state()); #endif EXPECT_TRUE( - coordinator_->SetChildMemoryState(1, mojom::MemoryState::THROTTLED)); + coordinator_->SetChildMemoryState(1, MemoryState::THROTTLED)); EXPECT_EQ(mojom::MemoryState::THROTTLED, cmc->state()); EXPECT_TRUE( - coordinator_->SetChildMemoryState(1, mojom::MemoryState::SUSPENDED)); + coordinator_->SetChildMemoryState(1, MemoryState::SUSPENDED)); EXPECT_EQ(mojom::MemoryState::SUSPENDED, cmc->state()); }
diff --git a/content/browser/push_messaging/push_messaging_router.cc b/content/browser/push_messaging/push_messaging_router.cc index f6ff797ff..c512cff 100644 --- a/content/browser/push_messaging/push_messaging_router.cc +++ b/content/browser/push_messaging/push_messaging_router.cc
@@ -123,8 +123,10 @@ deliver_message_callback, service_worker_registration), base::TimeDelta::FromSeconds(kPushMessageTimeoutSeconds), ServiceWorkerVersion::KILL_ON_TIMEOUT); - service_worker->DispatchSimpleEvent<ServiceWorkerHostMsg_PushEventFinished>( - request_id, ServiceWorkerMsg_PushEvent(request_id, payload)); + + service_worker->event_dispatcher()->DispatchPushEvent( + payload, base::Bind(&ServiceWorkerVersion::OnSimpleEventFinished, + service_worker, request_id)); } // static
diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc index 663ea7666..8d3f11cb 100644 --- a/content/browser/renderer_host/legacy_render_widget_host_win.cc +++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc
@@ -10,10 +10,10 @@ #include "base/win/win_util.h" #include "base/win/windows_version.h" #include "content/browser/accessibility/browser_accessibility_manager_win.h" +#include "content/browser/accessibility/browser_accessibility_state_impl.h" #include "content/browser/accessibility/browser_accessibility_win.h" #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_view_aura.h" -#include "content/public/browser/browser_accessibility_state.h" #include "content/public/common/content_switches.h" #include "ui/base/view_prop.h" #include "ui/base/win/internal_constants.h" @@ -119,7 +119,9 @@ reinterpret_cast<void **>(window_accessible_.Receive())); DCHECK(SUCCEEDED(hr)); - if (!BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser()) { + AccessibilityMode mode = + BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode(); + if (!(mode & ACCESSIBILITY_MODE_FLAG_NATIVE_APIS)) { // Attempt to detect screen readers or other clients who want full // accessibility support, by seeing if they respond to this event. NotifyWinEvent(EVENT_SYSTEM_ALERT, hwnd(), kIdScreenReaderHoneyPot, @@ -161,8 +163,11 @@ if (kIdScreenReaderHoneyPot == obj_id) { // When an MSAA client has responded to our fake event on this id, - // enable screen reader support. - BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected(); + // enable basic accessibility support. (Full screen reader support is + // detected later when specific more advanced APIs are accessed.) + BrowserAccessibilityStateImpl::GetInstance()->AddAccessibilityModeFlags( + ACCESSIBILITY_MODE_FLAG_NATIVE_APIS | + ACCESSIBILITY_MODE_FLAG_WEB_CONTENTS); return static_cast<LRESULT>(0L); }
diff --git a/content/browser/service_worker/embedded_worker_test_helper.cc b/content/browser/service_worker/embedded_worker_test_helper.cc index 90ec433..5c62c8d7 100644 --- a/content/browser/service_worker/embedded_worker_test_helper.cc +++ b/content/browser/service_worker/embedded_worker_test_helper.cc
@@ -179,6 +179,13 @@ std::move(preload_handle), callback); } + void DispatchPushEvent(const PushEventPayload& payload, + const DispatchPushEventCallback& callback) override { + if (!helper_) + return; + helper_->OnPushEventStub(payload, callback); + } + void DispatchSyncEvent( const std::string& tag, blink::mojom::BackgroundSyncEventLastChance last_chance, @@ -325,7 +332,6 @@ IPC_BEGIN_MESSAGE_MAP(EmbeddedWorkerTestHelper, message) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ActivateEvent, OnActivateEventStub) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_InstallEvent, OnInstallEventStub) - IPC_MESSAGE_HANDLER(ServiceWorkerMsg_PushEvent, OnPushEventStub) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() // Record all messages directed to inner script context. @@ -386,12 +392,11 @@ callback.Run(SERVICE_WORKER_OK, base::Time::Now()); } -void EmbeddedWorkerTestHelper::OnPushEvent(int embedded_worker_id, - int request_id, - const PushEventPayload& payload) { - SimulateSend(new ServiceWorkerHostMsg_PushEventFinished( - embedded_worker_id, request_id, - blink::WebServiceWorkerEventResultCompleted, base::Time::Now())); +void EmbeddedWorkerTestHelper::OnPushEvent( + const PushEventPayload& payload, + const mojom::ServiceWorkerEventDispatcher::DispatchPushEventCallback& + callback) { + callback.Run(SERVICE_WORKER_OK, base::Time::Now()); } void EmbeddedWorkerTestHelper::SimulateWorkerReadyForInspection( @@ -543,11 +548,12 @@ } void EmbeddedWorkerTestHelper::OnPushEventStub( - int request_id, - const PushEventPayload& payload) { + const PushEventPayload& payload, + const mojom::ServiceWorkerEventDispatcher::DispatchPushEventCallback& + callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&EmbeddedWorkerTestHelper::OnPushEvent, AsWeakPtr(), - current_embedded_worker_id_, request_id, payload)); + payload, callback)); } EmbeddedWorkerRegistry* EmbeddedWorkerTestHelper::registry() {
diff --git a/content/browser/service_worker/embedded_worker_test_helper.h b/content/browser/service_worker/embedded_worker_test_helper.h index 26ad3905..c52c692 100644 --- a/content/browser/service_worker/embedded_worker_test_helper.h +++ b/content/browser/service_worker/embedded_worker_test_helper.h
@@ -196,9 +196,10 @@ const ServiceWorkerFetchRequest& request, mojom::FetchEventPreloadHandlePtr preload_handle, const FetchCallback& callback); - virtual void OnPushEvent(int embedded_worker_id, - int request_id, - const PushEventPayload& payload); + virtual void OnPushEvent( + const PushEventPayload& payload, + const mojom::ServiceWorkerEventDispatcher::DispatchPushEventCallback& + callback); // These functions simulate sending an EmbeddedHostMsg message to the // browser. @@ -238,7 +239,10 @@ const ServiceWorkerFetchRequest& request, mojom::FetchEventPreloadHandlePtr preload_handle, const FetchCallback& callback); - void OnPushEventStub(int request_id, const PushEventPayload& payload); + void OnPushEventStub( + const PushEventPayload& payload, + const mojom::ServiceWorkerEventDispatcher::DispatchPushEventCallback& + callback); MessagePortMessageFilter* NewMessagePortMessageFilter();
diff --git a/content/common/service_worker/service_worker_event_dispatcher.mojom b/content/common/service_worker/service_worker_event_dispatcher.mojom index d878916e..6d11ed8b0 100644 --- a/content/common/service_worker/service_worker_event_dispatcher.mojom +++ b/content/common/service_worker/service_worker_event_dispatcher.mojom
@@ -12,6 +12,9 @@ import "url/mojo/origin.mojom"; [Native] +struct PushEventPayload; + +[Native] struct ServiceWorkerFetchRequest; [Native] @@ -39,6 +42,9 @@ FetchEventPreloadHandle? preload_handle) => (blink.mojom.ServiceWorkerEventStatus status, mojo.common.mojom.Time dispatch_event_time); + DispatchPushEvent(PushEventPayload payload) + => (blink.mojom.ServiceWorkerEventStatus status, + mojo.common.mojom.Time dispatch_event_time); // Arguments are passed to the event handler as parameters of SyncEvent. // Ref: https://wicg.github.io/BackgroundSync/spec/#sync-event DispatchSyncEvent(string tag,
diff --git a/content/common/service_worker/service_worker_event_dispatcher.typemap b/content/common/service_worker/service_worker_event_dispatcher.typemap index e191392..b46220c 100644 --- a/content/common/service_worker/service_worker_event_dispatcher.typemap +++ b/content/common/service_worker/service_worker_event_dispatcher.typemap
@@ -6,6 +6,7 @@ public_headers = [ "//content/common/service_worker/service_worker_status_code.h", "//content/common/service_worker/service_worker_types.h", + "//content/public/common/push_event_payload.h", ] sources = [ "//content/common/service_worker/service_worker_status_code_traits.cc", @@ -15,7 +16,8 @@ "//content/common/service_worker/service_worker_status_code_traits.h", ] type_mappings = [ - "content.mojom.ExtendableMessageEventSource=::content::ExtendableMessageEventSource", - "content.mojom.ServiceWorkerFetchRequest=::content::ServiceWorkerFetchRequest", "blink.mojom.ServiceWorkerEventStatus=::content::ServiceWorkerStatusCode", + "content.mojom.ExtendableMessageEventSource=::content::ExtendableMessageEventSource", + "content.mojom.PushEventPayload=::content::PushEventPayload", + "content.mojom.ServiceWorkerFetchRequest=::content::ServiceWorkerFetchRequest", ]
diff --git a/content/common/service_worker/service_worker_messages.h b/content/common/service_worker/service_worker_messages.h index 27ba8d19..603bc02 100644 --- a/content/common/service_worker/service_worker_messages.h +++ b/content/common/service_worker/service_worker_messages.h
@@ -299,10 +299,6 @@ int /* request_id */, blink::WebServiceWorkerEventResult, base::Time /* dispatch_event_time */) -IPC_MESSAGE_ROUTED3(ServiceWorkerHostMsg_PushEventFinished, - int /* request_id */, - blink::WebServiceWorkerEventResult, - base::Time /* dispatch_event_time */) // Responds to a Ping from the browser. // Routed to the target ServiceWorkerVersion. @@ -536,9 +532,6 @@ int /* request_id */, std::string /* notification_id */, content::PlatformNotificationData /* notification_data */) -IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_PushEvent, - int /* request_id */, - content::PushEventPayload /* data */) IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidSkipWaiting, int /* request_id */)
diff --git a/content/public/common/browser_side_navigation_policy.cc b/content/public/common/browser_side_navigation_policy.cc index aaf6f60..a94eff1 100644 --- a/content/public/common/browser_side_navigation_policy.cc +++ b/content/public/common/browser_side_navigation_policy.cc
@@ -10,7 +10,8 @@ namespace content { bool IsBrowserSideNavigationEnabled() { - return true; + return base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableBrowserSideNavigation); } } // namespace content
diff --git a/content/renderer/accessibility/blink_ax_tree_source.cc b/content/renderer/accessibility/blink_ax_tree_source.cc index bd9b01c..0b4f56c3 100644 --- a/content/renderer/accessibility/blink_ax_tree_source.cc +++ b/content/renderer/accessibility/blink_ax_tree_source.cc
@@ -128,8 +128,10 @@ tree_source_->Thaw(); } -BlinkAXTreeSource::BlinkAXTreeSource(RenderFrameImpl* render_frame) +BlinkAXTreeSource::BlinkAXTreeSource(RenderFrameImpl* render_frame, + AccessibilityMode mode) : render_frame_(render_frame), + accessibility_mode_(mode), frozen_(false) {} BlinkAXTreeSource::~BlinkAXTreeSource() { @@ -341,10 +343,6 @@ ui::AX_ATTR_DESCRIBEDBY_IDS, descriptionObjects, dst); } - blink::WebString web_placeholder = src.placeholder(nameFrom); - if (!web_placeholder.isEmpty()) - dst->AddStringAttribute(ui::AX_ATTR_PLACEHOLDER, web_placeholder.utf8()); - std::string value; if (src.valueDescription().length()) { dst->AddStringAttribute(ui::AX_ATTR_VALUE, src.valueDescription().utf8()); @@ -352,178 +350,300 @@ dst->AddStringAttribute(ui::AX_ATTR_VALUE, src.stringValue().utf8()); } - if (dst->role == ui::AX_ROLE_COLOR_WELL) - dst->AddIntAttribute(ui::AX_ATTR_COLOR_VALUE, src.colorValue()); - - - // Text attributes. - if (src.backgroundColor()) - dst->AddIntAttribute(ui::AX_ATTR_BACKGROUND_COLOR, src.backgroundColor()); - - if (src.color()) - dst->AddIntAttribute(ui::AX_ATTR_COLOR, src.color()); - - WebAXObject parent = ParentObjectUnignored(src); - if (src.fontFamily().length()) { - if (parent.isNull() || parent.fontFamily() != src.fontFamily()) - dst->AddStringAttribute(ui::AX_ATTR_FONT_FAMILY, src.fontFamily().utf8()); - } - - // Font size is in pixels. - if (src.fontSize()) - dst->AddFloatAttribute(ui::AX_ATTR_FONT_SIZE, src.fontSize()); - - if (src.ariaCurrentState()) { - dst->AddIntAttribute(ui::AX_ATTR_ARIA_CURRENT_STATE, - AXAriaCurrentStateFromBlink(src.ariaCurrentState())); - } - - if (src.invalidState()) { - dst->AddIntAttribute(ui::AX_ATTR_INVALID_STATE, - AXInvalidStateFromBlink(src.invalidState())); - } - if (src.invalidState() == blink::WebAXInvalidStateOther && - src.ariaInvalidValue().length()) { - dst->AddStringAttribute( - ui::AX_ATTR_ARIA_INVALID_VALUE, src.ariaInvalidValue().utf8()); - } - - if (src.textDirection()) { - dst->AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION, - AXTextDirectionFromBlink(src.textDirection())); - } - - if (src.textStyle()) { - dst->AddIntAttribute(ui::AX_ATTR_TEXT_STYLE, - AXTextStyleFromBlink(src.textStyle())); - } - - - if (dst->role == ui::AX_ROLE_INLINE_TEXT_BOX) { - WebVector<int> src_character_offsets; - src.characterOffsets(src_character_offsets); - std::vector<int32_t> character_offsets; - character_offsets.reserve(src_character_offsets.size()); - for (size_t i = 0; i < src_character_offsets.size(); ++i) - character_offsets.push_back(src_character_offsets[i]); - dst->AddIntListAttribute(ui::AX_ATTR_CHARACTER_OFFSETS, character_offsets); - - WebVector<int> src_word_starts; - WebVector<int> src_word_ends; - src.wordBoundaries(src_word_starts, src_word_ends); - std::vector<int32_t> word_starts; - std::vector<int32_t> word_ends; - word_starts.reserve(src_word_starts.size()); - word_ends.reserve(src_word_starts.size()); - for (size_t i = 0; i < src_word_starts.size(); ++i) { - word_starts.push_back(src_word_starts[i]); - word_ends.push_back(src_word_ends[i]); - } - dst->AddIntListAttribute(ui::AX_ATTR_WORD_STARTS, word_starts); - dst->AddIntListAttribute(ui::AX_ATTR_WORD_ENDS, word_ends); - } - - if (src.accessKey().length()) { - dst->AddStringAttribute(ui::AX_ATTR_ACCESS_KEY, src.accessKey().utf8()); - } - - if (src.action() != blink::WebAXSupportedAction::None) { - dst->AddIntAttribute(ui::AX_ATTR_ACTION, - AXSupportedActionFromBlink(src.action())); - } - - if (src.ariaAutoComplete().length()) { - dst->AddStringAttribute( - ui::AX_ATTR_AUTO_COMPLETE, - src.ariaAutoComplete().utf8()); - } - - if (src.isAriaReadOnly()) - dst->AddBoolAttribute(ui::AX_ATTR_ARIA_READONLY, true); - if (src.isButtonStateMixed()) dst->AddBoolAttribute(ui::AX_ATTR_STATE_MIXED, true); if (src.canSetValueAttribute()) dst->AddBoolAttribute(ui::AX_ATTR_CAN_SET_VALUE, true); - if (src.hasComputedStyle()) { - dst->AddStringAttribute( - ui::AX_ATTR_DISPLAY, src.computedStyleDisplay().utf8()); - } - - if (src.language().length()) { - if (parent.isNull() || parent.language() != src.language()) - dst->AddStringAttribute(ui::AX_ATTR_LANGUAGE, src.language().utf8()); - } - - if (src.keyboardShortcut().length()) { - dst->AddStringAttribute( - ui::AX_ATTR_SHORTCUT, - src.keyboardShortcut().utf8()); - } - - if (!src.nextOnLine().isDetached()) { - dst->AddIntAttribute(ui::AX_ATTR_NEXT_ON_LINE_ID, src.nextOnLine().axID()); - } - - if (!src.previousOnLine().isDetached()) { - dst->AddIntAttribute(ui::AX_ATTR_PREVIOUS_ON_LINE_ID, - src.previousOnLine().axID()); - } - - if (!src.ariaActiveDescendant().isDetached()) { - dst->AddIntAttribute(ui::AX_ATTR_ACTIVEDESCENDANT_ID, - src.ariaActiveDescendant().axID()); - } - if (!src.url().isEmpty()) dst->AddStringAttribute(ui::AX_ATTR_URL, src.url().string().utf8()); - if (dst->role == ui::AX_ROLE_HEADING && src.headingLevel()) { - dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, src.headingLevel()); - } else if ((dst->role == ui::AX_ROLE_TREE_ITEM || - dst->role == ui::AX_ROLE_ROW) && - src.hierarchicalLevel()) { - dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, - src.hierarchicalLevel()); - } + // The following set of attributes are only accessed when the accessibility + // mode is set to screen reader mode, otherwise only the more basic + // attributes are populated. + if (accessibility_mode_ & ACCESSIBILITY_MODE_FLAG_SCREEN_READER) { + blink::WebString web_placeholder = src.placeholder(nameFrom); + if (!web_placeholder.isEmpty()) + dst->AddStringAttribute(ui::AX_ATTR_PLACEHOLDER, web_placeholder.utf8()); - if (src.setSize()) - dst->AddIntAttribute(ui::AX_ATTR_SET_SIZE, src.setSize()); + if (dst->role == ui::AX_ROLE_COLOR_WELL) + dst->AddIntAttribute(ui::AX_ATTR_COLOR_VALUE, src.colorValue()); - if (src.posInSet()) - dst->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, src.posInSet()); + // Text attributes. + if (src.backgroundColor()) + dst->AddIntAttribute(ui::AX_ATTR_BACKGROUND_COLOR, src.backgroundColor()); - if (src.canvasHasFallbackContent()) - dst->AddBoolAttribute(ui::AX_ATTR_CANVAS_HAS_FALLBACK, true); + if (src.color()) + dst->AddIntAttribute(ui::AX_ATTR_COLOR, src.color()); - // Spelling, grammar and other document markers. - WebVector<blink::WebAXMarkerType> src_marker_types; - WebVector<int> src_marker_starts; - WebVector<int> src_marker_ends; - src.markers(src_marker_types, src_marker_starts, src_marker_ends); - DCHECK_EQ(src_marker_types.size(), src_marker_starts.size()); - DCHECK_EQ(src_marker_starts.size(), src_marker_ends.size()); - - if (src_marker_types.size()) { - std::vector<int32_t> marker_types; - std::vector<int32_t> marker_starts; - std::vector<int32_t> marker_ends; - marker_types.reserve(src_marker_types.size()); - marker_starts.reserve(src_marker_starts.size()); - marker_ends.reserve(src_marker_ends.size()); - for (size_t i = 0; i < src_marker_types.size(); ++i) { - marker_types.push_back( - static_cast<int32_t>(AXMarkerTypeFromBlink(src_marker_types[i]))); - marker_starts.push_back(src_marker_starts[i]); - marker_ends.push_back(src_marker_ends[i]); + WebAXObject parent = ParentObjectUnignored(src); + if (src.fontFamily().length()) { + if (parent.isNull() || parent.fontFamily() != src.fontFamily()) + dst->AddStringAttribute(ui::AX_ATTR_FONT_FAMILY, + src.fontFamily().utf8()); } - dst->AddIntListAttribute(ui::AX_ATTR_MARKER_TYPES, marker_types); - dst->AddIntListAttribute(ui::AX_ATTR_MARKER_STARTS, marker_starts); - dst->AddIntListAttribute(ui::AX_ATTR_MARKER_ENDS, marker_ends); + + // Font size is in pixels. + if (src.fontSize()) + dst->AddFloatAttribute(ui::AX_ATTR_FONT_SIZE, src.fontSize()); + + if (src.ariaCurrentState()) { + dst->AddIntAttribute(ui::AX_ATTR_ARIA_CURRENT_STATE, + AXAriaCurrentStateFromBlink(src.ariaCurrentState())); + } + + if (src.invalidState()) { + dst->AddIntAttribute(ui::AX_ATTR_INVALID_STATE, + AXInvalidStateFromBlink(src.invalidState())); + } + if (src.invalidState() == blink::WebAXInvalidStateOther && + src.ariaInvalidValue().length()) { + dst->AddStringAttribute( + ui::AX_ATTR_ARIA_INVALID_VALUE, src.ariaInvalidValue().utf8()); + } + + if (src.textDirection()) { + dst->AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION, + AXTextDirectionFromBlink(src.textDirection())); + } + + if (src.textStyle()) { + dst->AddIntAttribute(ui::AX_ATTR_TEXT_STYLE, + AXTextStyleFromBlink(src.textStyle())); + } + + if (dst->role == ui::AX_ROLE_INLINE_TEXT_BOX) { + WebVector<int> src_character_offsets; + src.characterOffsets(src_character_offsets); + std::vector<int32_t> character_offsets; + character_offsets.reserve(src_character_offsets.size()); + for (size_t i = 0; i < src_character_offsets.size(); ++i) + character_offsets.push_back(src_character_offsets[i]); + dst->AddIntListAttribute(ui::AX_ATTR_CHARACTER_OFFSETS, + character_offsets); + + WebVector<int> src_word_starts; + WebVector<int> src_word_ends; + src.wordBoundaries(src_word_starts, src_word_ends); + std::vector<int32_t> word_starts; + std::vector<int32_t> word_ends; + word_starts.reserve(src_word_starts.size()); + word_ends.reserve(src_word_starts.size()); + for (size_t i = 0; i < src_word_starts.size(); ++i) { + word_starts.push_back(src_word_starts[i]); + word_ends.push_back(src_word_ends[i]); + } + dst->AddIntListAttribute(ui::AX_ATTR_WORD_STARTS, word_starts); + dst->AddIntListAttribute(ui::AX_ATTR_WORD_ENDS, word_ends); + } + + if (src.accessKey().length()) { + dst->AddStringAttribute(ui::AX_ATTR_ACCESS_KEY, src.accessKey().utf8()); + } + + if (src.ariaAutoComplete().length()) { + dst->AddStringAttribute( + ui::AX_ATTR_AUTO_COMPLETE, + src.ariaAutoComplete().utf8()); + } + + if (src.action() != blink::WebAXSupportedAction::None) { + dst->AddIntAttribute(ui::AX_ATTR_ACTION, + AXSupportedActionFromBlink(src.action())); + } + + if (src.isAriaReadOnly()) + dst->AddBoolAttribute(ui::AX_ATTR_ARIA_READONLY, true); + + if (src.hasComputedStyle()) { + dst->AddStringAttribute( + ui::AX_ATTR_DISPLAY, src.computedStyleDisplay().utf8()); + } + + if (src.language().length()) { + if (parent.isNull() || parent.language() != src.language()) + dst->AddStringAttribute(ui::AX_ATTR_LANGUAGE, src.language().utf8()); + } + + if (src.keyboardShortcut().length()) { + dst->AddStringAttribute( + ui::AX_ATTR_SHORTCUT, + src.keyboardShortcut().utf8()); + } + + if (!src.nextOnLine().isDetached()) { + dst->AddIntAttribute(ui::AX_ATTR_NEXT_ON_LINE_ID, + src.nextOnLine().axID()); + } + + if (!src.previousOnLine().isDetached()) { + dst->AddIntAttribute(ui::AX_ATTR_PREVIOUS_ON_LINE_ID, + src.previousOnLine().axID()); + } + + if (!src.ariaActiveDescendant().isDetached()) { + dst->AddIntAttribute(ui::AX_ATTR_ACTIVEDESCENDANT_ID, + src.ariaActiveDescendant().axID()); + } + + if (dst->role == ui::AX_ROLE_HEADING && src.headingLevel()) { + dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, src.headingLevel()); + } else if ((dst->role == ui::AX_ROLE_TREE_ITEM || + dst->role == ui::AX_ROLE_ROW) && + src.hierarchicalLevel()) { + dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, + src.hierarchicalLevel()); + } + + if (src.setSize()) + dst->AddIntAttribute(ui::AX_ATTR_SET_SIZE, src.setSize()); + + if (src.posInSet()) + dst->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, src.posInSet()); + + if (src.canvasHasFallbackContent()) + dst->AddBoolAttribute(ui::AX_ATTR_CANVAS_HAS_FALLBACK, true); + + // Spelling, grammar and other document markers. + WebVector<blink::WebAXMarkerType> src_marker_types; + WebVector<int> src_marker_starts; + WebVector<int> src_marker_ends; + src.markers(src_marker_types, src_marker_starts, src_marker_ends); + DCHECK_EQ(src_marker_types.size(), src_marker_starts.size()); + DCHECK_EQ(src_marker_starts.size(), src_marker_ends.size()); + + if (src_marker_types.size()) { + std::vector<int32_t> marker_types; + std::vector<int32_t> marker_starts; + std::vector<int32_t> marker_ends; + marker_types.reserve(src_marker_types.size()); + marker_starts.reserve(src_marker_starts.size()); + marker_ends.reserve(src_marker_ends.size()); + for (size_t i = 0; i < src_marker_types.size(); ++i) { + marker_types.push_back( + static_cast<int32_t>(AXMarkerTypeFromBlink(src_marker_types[i]))); + marker_starts.push_back(src_marker_starts[i]); + marker_ends.push_back(src_marker_ends[i]); + } + dst->AddIntListAttribute(ui::AX_ATTR_MARKER_TYPES, marker_types); + dst->AddIntListAttribute(ui::AX_ATTR_MARKER_STARTS, marker_starts); + dst->AddIntListAttribute(ui::AX_ATTR_MARKER_ENDS, marker_ends); + } + + if (src.isInLiveRegion()) { + dst->AddBoolAttribute(ui::AX_ATTR_LIVE_ATOMIC, src.liveRegionAtomic()); + dst->AddBoolAttribute(ui::AX_ATTR_LIVE_BUSY, src.liveRegionBusy()); + if (src.liveRegionBusy()) + dst->state |= (1 << ui::AX_STATE_BUSY); + if (!src.liveRegionStatus().isEmpty()) { + dst->AddStringAttribute( + ui::AX_ATTR_LIVE_STATUS, + src.liveRegionStatus().utf8()); + } + dst->AddStringAttribute( + ui::AX_ATTR_LIVE_RELEVANT, + src.liveRegionRelevant().utf8()); + // If we are not at the root of an atomic live region. + if (src.containerLiveRegionAtomic() && + !src.liveRegionRoot().isDetached() && + !src.liveRegionAtomic()) { + dst->AddIntAttribute(ui::AX_ATTR_MEMBER_OF_ID, + src.liveRegionRoot().axID()); + } + dst->AddBoolAttribute(ui::AX_ATTR_CONTAINER_LIVE_ATOMIC, + src.containerLiveRegionAtomic()); + dst->AddBoolAttribute(ui::AX_ATTR_CONTAINER_LIVE_BUSY, + src.containerLiveRegionBusy()); + dst->AddStringAttribute( + ui::AX_ATTR_CONTAINER_LIVE_STATUS, + src.containerLiveRegionStatus().utf8()); + dst->AddStringAttribute( + ui::AX_ATTR_CONTAINER_LIVE_RELEVANT, + src.containerLiveRegionRelevant().utf8()); + } + + if (dst->role == ui::AX_ROLE_PROGRESS_INDICATOR || + dst->role == ui::AX_ROLE_METER || + dst->role == ui::AX_ROLE_SCROLL_BAR || + dst->role == ui::AX_ROLE_SLIDER || + dst->role == ui::AX_ROLE_SPIN_BUTTON) { + dst->AddFloatAttribute(ui::AX_ATTR_VALUE_FOR_RANGE, src.valueForRange()); + dst->AddFloatAttribute(ui::AX_ATTR_MAX_VALUE_FOR_RANGE, + src.maxValueForRange()); + dst->AddFloatAttribute(ui::AX_ATTR_MIN_VALUE_FOR_RANGE, + src.minValueForRange()); + } + + if (dst->role == ui::AX_ROLE_ROOT_WEB_AREA) + dst->AddStringAttribute(ui::AX_ATTR_HTML_TAG, "#document"); + + if (dst->role == ui::AX_ROLE_TABLE) { + int column_count = src.columnCount(); + int row_count = src.rowCount(); + if (column_count > 0 && row_count > 0) { + std::set<int32_t> unique_cell_id_set; + std::vector<int32_t> cell_ids; + std::vector<int32_t> unique_cell_ids; + dst->AddIntAttribute(ui::AX_ATTR_TABLE_COLUMN_COUNT, column_count); + dst->AddIntAttribute(ui::AX_ATTR_TABLE_ROW_COUNT, row_count); + WebAXObject header = src.headerContainerObject(); + if (!header.isDetached()) + dst->AddIntAttribute(ui::AX_ATTR_TABLE_HEADER_ID, header.axID()); + for (int i = 0; i < column_count * row_count; ++i) { + WebAXObject cell = src.cellForColumnAndRow( + i % column_count, i / column_count); + int cell_id = -1; + if (!cell.isDetached()) { + cell_id = cell.axID(); + if (unique_cell_id_set.find(cell_id) == unique_cell_id_set.end()) { + unique_cell_id_set.insert(cell_id); + unique_cell_ids.push_back(cell_id); + } + } + cell_ids.push_back(cell_id); + } + dst->AddIntListAttribute(ui::AX_ATTR_CELL_IDS, cell_ids); + dst->AddIntListAttribute(ui::AX_ATTR_UNIQUE_CELL_IDS, unique_cell_ids); + } + } + + if (dst->role == ui::AX_ROLE_ROW) { + dst->AddIntAttribute(ui::AX_ATTR_TABLE_ROW_INDEX, src.rowIndex()); + WebAXObject header = src.rowHeader(); + if (!header.isDetached()) + dst->AddIntAttribute(ui::AX_ATTR_TABLE_ROW_HEADER_ID, header.axID()); + } + + if (dst->role == ui::AX_ROLE_COLUMN) { + dst->AddIntAttribute(ui::AX_ATTR_TABLE_COLUMN_INDEX, src.columnIndex()); + WebAXObject header = src.columnHeader(); + if (!header.isDetached()) + dst->AddIntAttribute(ui::AX_ATTR_TABLE_COLUMN_HEADER_ID, header.axID()); + } + + if (dst->role == ui::AX_ROLE_CELL || + dst->role == ui::AX_ROLE_ROW_HEADER || + dst->role == ui::AX_ROLE_COLUMN_HEADER) { + dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, + src.cellColumnIndex()); + dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, + src.cellColumnSpan()); + dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_INDEX, + src.cellRowIndex()); + dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_SPAN, src.cellRowSpan()); + } + + if ((dst->role == ui::AX_ROLE_ROW_HEADER || + dst->role == ui::AX_ROLE_COLUMN_HEADER) && src.sortDirection()) { + dst->AddIntAttribute(ui::AX_ATTR_SORT_DIRECTION, + AXSortDirectionFromBlink(src.sortDirection())); + } } + // The majority of the rest of this code computes attributes needed for + // all modes, not just for screen readers. + WebNode node = src.node(); bool is_iframe = false; @@ -531,17 +651,19 @@ WebElement element = node.to<WebElement>(); is_iframe = element.hasHTMLTagName("iframe"); - // TODO(ctguil): The tagName in WebKit is lower cased but - // HTMLElement::nodeName calls localNameUpper. Consider adding - // a WebElement method that returns the original lower cased tagName. - dst->AddStringAttribute( - ui::AX_ATTR_HTML_TAG, - base::ToLowerASCII(element.tagName().utf8())); - for (unsigned i = 0; i < element.attributeCount(); ++i) { - std::string name = base::ToLowerASCII( - element.attributeLocalName(i).utf8()); - std::string value = element.attributeValue(i).utf8(); - dst->html_attributes.push_back(std::make_pair(name, value)); + if (accessibility_mode_ & ACCESSIBILITY_MODE_FLAG_HTML) { + // TODO(ctguil): The tagName in WebKit is lower cased but + // HTMLElement::nodeName calls localNameUpper. Consider adding + // a WebElement method that returns the original lower cased tagName. + dst->AddStringAttribute( + ui::AX_ATTR_HTML_TAG, + base::ToLowerASCII(element.tagName().utf8())); + for (unsigned i = 0; i < element.attributeCount(); ++i) { + std::string name = base::ToLowerASCII( + element.attributeLocalName(i).utf8()); + std::string value = element.attributeValue(i).utf8(); + dst->html_attributes.push_back(std::make_pair(name, value)); + } } if (src.isEditable()) { @@ -592,113 +714,6 @@ } } - if (src.isInLiveRegion()) { - dst->AddBoolAttribute(ui::AX_ATTR_LIVE_ATOMIC, src.liveRegionAtomic()); - dst->AddBoolAttribute(ui::AX_ATTR_LIVE_BUSY, src.liveRegionBusy()); - if (src.liveRegionBusy()) - dst->state |= (1 << ui::AX_STATE_BUSY); - if (!src.liveRegionStatus().isEmpty()) { - dst->AddStringAttribute( - ui::AX_ATTR_LIVE_STATUS, - src.liveRegionStatus().utf8()); - } - dst->AddStringAttribute( - ui::AX_ATTR_LIVE_RELEVANT, - src.liveRegionRelevant().utf8()); - // If we are not at the root of an atomic live region. - if (src.containerLiveRegionAtomic() && !src.liveRegionRoot().isDetached() && - !src.liveRegionAtomic()) { - dst->AddIntAttribute(ui::AX_ATTR_MEMBER_OF_ID, - src.liveRegionRoot().axID()); - } - dst->AddBoolAttribute(ui::AX_ATTR_CONTAINER_LIVE_ATOMIC, - src.containerLiveRegionAtomic()); - dst->AddBoolAttribute(ui::AX_ATTR_CONTAINER_LIVE_BUSY, - src.containerLiveRegionBusy()); - dst->AddStringAttribute( - ui::AX_ATTR_CONTAINER_LIVE_STATUS, - src.containerLiveRegionStatus().utf8()); - dst->AddStringAttribute( - ui::AX_ATTR_CONTAINER_LIVE_RELEVANT, - src.containerLiveRegionRelevant().utf8()); - } - - if (dst->role == ui::AX_ROLE_PROGRESS_INDICATOR || - dst->role == ui::AX_ROLE_METER || - dst->role == ui::AX_ROLE_SCROLL_BAR || - dst->role == ui::AX_ROLE_SLIDER || - dst->role == ui::AX_ROLE_SPIN_BUTTON) { - dst->AddFloatAttribute(ui::AX_ATTR_VALUE_FOR_RANGE, src.valueForRange()); - dst->AddFloatAttribute(ui::AX_ATTR_MAX_VALUE_FOR_RANGE, - src.maxValueForRange()); - dst->AddFloatAttribute(ui::AX_ATTR_MIN_VALUE_FOR_RANGE, - src.minValueForRange()); - } - - if (dst->role == ui::AX_ROLE_ROOT_WEB_AREA) - dst->AddStringAttribute(ui::AX_ATTR_HTML_TAG, "#document"); - - if (dst->role == ui::AX_ROLE_TABLE) { - int column_count = src.columnCount(); - int row_count = src.rowCount(); - if (column_count > 0 && row_count > 0) { - std::set<int32_t> unique_cell_id_set; - std::vector<int32_t> cell_ids; - std::vector<int32_t> unique_cell_ids; - dst->AddIntAttribute(ui::AX_ATTR_TABLE_COLUMN_COUNT, column_count); - dst->AddIntAttribute(ui::AX_ATTR_TABLE_ROW_COUNT, row_count); - WebAXObject header = src.headerContainerObject(); - if (!header.isDetached()) - dst->AddIntAttribute(ui::AX_ATTR_TABLE_HEADER_ID, header.axID()); - for (int i = 0; i < column_count * row_count; ++i) { - WebAXObject cell = src.cellForColumnAndRow( - i % column_count, i / column_count); - int cell_id = -1; - if (!cell.isDetached()) { - cell_id = cell.axID(); - if (unique_cell_id_set.find(cell_id) == unique_cell_id_set.end()) { - unique_cell_id_set.insert(cell_id); - unique_cell_ids.push_back(cell_id); - } - } - cell_ids.push_back(cell_id); - } - dst->AddIntListAttribute(ui::AX_ATTR_CELL_IDS, cell_ids); - dst->AddIntListAttribute(ui::AX_ATTR_UNIQUE_CELL_IDS, unique_cell_ids); - } - } - - if (dst->role == ui::AX_ROLE_ROW) { - dst->AddIntAttribute(ui::AX_ATTR_TABLE_ROW_INDEX, src.rowIndex()); - WebAXObject header = src.rowHeader(); - if (!header.isDetached()) - dst->AddIntAttribute(ui::AX_ATTR_TABLE_ROW_HEADER_ID, header.axID()); - } - - if (dst->role == ui::AX_ROLE_COLUMN) { - dst->AddIntAttribute(ui::AX_ATTR_TABLE_COLUMN_INDEX, src.columnIndex()); - WebAXObject header = src.columnHeader(); - if (!header.isDetached()) - dst->AddIntAttribute(ui::AX_ATTR_TABLE_COLUMN_HEADER_ID, header.axID()); - } - - if (dst->role == ui::AX_ROLE_CELL || - dst->role == ui::AX_ROLE_ROW_HEADER || - dst->role == ui::AX_ROLE_COLUMN_HEADER) { - dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, - src.cellColumnIndex()); - dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, - src.cellColumnSpan()); - dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_INDEX, src.cellRowIndex()); - dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_SPAN, src.cellRowSpan()); - } - - if ((dst->role == ui::AX_ROLE_ROW_HEADER || - dst->role == ui::AX_ROLE_COLUMN_HEADER) && src.sortDirection()) { - dst->AddIntAttribute(ui::AX_ATTR_SORT_DIRECTION, - AXSortDirectionFromBlink(src.sortDirection())); - } - // Add the ids of *indirect* children - those who are children of this node, // but whose parent is *not* this node. One example is a table // cell, which is a child of both a row and a column. Because the cell's
diff --git a/content/renderer/accessibility/blink_ax_tree_source.h b/content/renderer/accessibility/blink_ax_tree_source.h index aecc61f..ce62b609 100644 --- a/content/renderer/accessibility/blink_ax_tree_source.h +++ b/content/renderer/accessibility/blink_ax_tree_source.h
@@ -7,6 +7,7 @@ #include <stdint.h> +#include "content/common/accessibility_mode_enums.h" #include "content/common/ax_content_node_data.h" #include "third_party/WebKit/public/web/WebAXObject.h" #include "third_party/WebKit/public/web/WebDocument.h" @@ -36,7 +37,8 @@ AXContentNodeData, AXContentTreeData> { public: - BlinkAXTreeSource(RenderFrameImpl* render_frame); + BlinkAXTreeSource(RenderFrameImpl* render_frame, + AccessibilityMode mode); ~BlinkAXTreeSource() override; // Freeze caches the document, accessibility root, and current focused @@ -108,6 +110,8 @@ RenderFrameImpl* render_frame_; + AccessibilityMode accessibility_mode_; + // An explicit root to use, otherwise it's taken from the WebDocument. blink::WebAXObject explicit_root_;
diff --git a/content/renderer/accessibility/render_accessibility_impl.cc b/content/renderer/accessibility/render_accessibility_impl.cc index 7a7cf23..6c1a9f72 100644 --- a/content/renderer/accessibility/render_accessibility_impl.cc +++ b/content/renderer/accessibility/render_accessibility_impl.cc
@@ -68,7 +68,7 @@ WebAXObject root = context.root(); if (!root.updateLayoutAndCheckValidity()) return; - BlinkAXTreeSource tree_source(render_frame); + BlinkAXTreeSource tree_source(render_frame, ACCESSIBILITY_MODE_COMPLETE); tree_source.SetRoot(root); ScopedFreezeBlinkAXTreeSource freeze(&tree_source); BlinkAXTreeSerializer serializer(&tree_source); @@ -76,10 +76,11 @@ serializer.SerializeChanges(context.root(), response); } -RenderAccessibilityImpl::RenderAccessibilityImpl(RenderFrameImpl* render_frame) +RenderAccessibilityImpl::RenderAccessibilityImpl(RenderFrameImpl* render_frame, + AccessibilityMode mode) : RenderFrameObserver(render_frame), render_frame_(render_frame), - tree_source_(render_frame), + tree_source_(render_frame, mode), serializer_(&tree_source_), plugin_tree_source_(nullptr), last_scroll_offset_(gfx::Size()), @@ -98,8 +99,10 @@ #endif #if !defined(OS_ANDROID) - // Inline text boxes are enabled for all nodes on all except Android. - settings->setInlineTextBoxAccessibilityEnabled(true); + // Inline text boxes can be enabled globally on all except Android. + // On Android they can be requested for just a specific node. + if (mode & ACCESSIBILITY_MODE_FLAG_INLINE_TEXT_BOXES) + settings->setInlineTextBoxAccessibilityEnabled(true); #endif const WebDocument& document = GetMainDocument();
diff --git a/content/renderer/accessibility/render_accessibility_impl.h b/content/renderer/accessibility/render_accessibility_impl.h index 21d5c09..795c4c2 100644 --- a/content/renderer/accessibility/render_accessibility_impl.h +++ b/content/renderer/accessibility/render_accessibility_impl.h
@@ -65,7 +65,8 @@ RenderFrameImpl* render_frame, AXContentTreeUpdate* response); - explicit RenderAccessibilityImpl(RenderFrameImpl* render_frame); + RenderAccessibilityImpl(RenderFrameImpl* render_frame, + AccessibilityMode mode); ~RenderAccessibilityImpl() override; // RenderAccessibility implementation.
diff --git a/content/renderer/accessibility/render_accessibility_impl_browsertest.cc b/content/renderer/accessibility/render_accessibility_impl_browsertest.cc index 040268d3..0f8ab1c5 100644 --- a/content/renderer/accessibility/render_accessibility_impl_browsertest.cc +++ b/content/renderer/accessibility/render_accessibility_impl_browsertest.cc
@@ -32,7 +32,7 @@ class TestRenderAccessibilityImpl : public RenderAccessibilityImpl { public: explicit TestRenderAccessibilityImpl(RenderFrameImpl* render_frame) - : RenderAccessibilityImpl(render_frame) { + : RenderAccessibilityImpl(render_frame, ACCESSIBILITY_MODE_COMPLETE) { } void SendPendingAccessibilityEvents() {
diff --git a/content/renderer/media/canvas_capture_handler.cc b/content/renderer/media/canvas_capture_handler.cc index e289fd4..822da6a 100644 --- a/content/renderer/media/canvas_capture_handler.cc +++ b/content/renderer/media/canvas_capture_handler.cc
@@ -257,7 +257,7 @@ blink::WebMediaStreamTrack* web_track) { std::string str_track_id; base::Base64Encode(base::RandBytesAsString(64), &str_track_id); - const blink::WebString track_id = base::UTF8ToUTF16(str_track_id); + const blink::WebString track_id = blink::WebString::fromASCII(str_track_id); blink::WebMediaStreamSource webkit_source; std::unique_ptr<MediaStreamVideoSource> media_stream_source( new MediaStreamVideoCapturerSource(
diff --git a/content/renderer/media/media_stream_renderer_factory_impl.cc b/content/renderer/media/media_stream_renderer_factory_impl.cc index 31492c62..984acde 100644 --- a/content/renderer/media/media_stream_renderer_factory_impl.cc +++ b/content/renderer/media/media_stream_renderer_factory_impl.cc
@@ -68,7 +68,7 @@ DCHECK(!web_stream.isNull()); DVLOG(1) << "MediaStreamRendererFactoryImpl::GetVideoRenderer stream:" - << base::UTF16ToUTF8(base::StringPiece16(web_stream.id())); + << web_stream.id().utf8(); blink::WebVector<blink::WebMediaStreamTrack> video_tracks; web_stream.videoTracks(video_tracks); @@ -95,7 +95,7 @@ return NULL; DVLOG(1) << "MediaStreamRendererFactoryImpl::GetAudioRenderer stream:" - << base::UTF16ToUTF8(base::StringPiece16(web_stream.id())); + << web_stream.id().utf8(); // TODO(tommi): We need to fix the data flow so that // it works the same way for all track implementations, local, remote or what
diff --git a/content/renderer/media/midi_message_filter.cc b/content/renderer/media/midi_message_filter.cc index 9adeca77..bed8d0e 100644 --- a/content/renderer/media/midi_message_filter.cc +++ b/content/renderer/media/midi_message_filter.cc
@@ -15,6 +15,7 @@ #include "ipc/ipc_logging.h" using base::AutoLock; +using blink::WebString; using midi::mojom::PortState; using midi::mojom::Result; @@ -211,17 +212,17 @@ if (result == Result::OK) { // Add the client's input and output ports. for (const auto& info : inputs_) { - client->didAddInputPort(base::UTF8ToUTF16(info.id), - base::UTF8ToUTF16(info.manufacturer), - base::UTF8ToUTF16(info.name), - base::UTF8ToUTF16(info.version), info.state); + client->didAddInputPort(WebString::fromUTF8(info.id), + WebString::fromUTF8(info.manufacturer), + WebString::fromUTF8(info.name), + WebString::fromUTF8(info.version), info.state); } for (const auto& info : outputs_) { - client->didAddOutputPort(base::UTF8ToUTF16(info.id), - base::UTF8ToUTF16(info.manufacturer), - base::UTF8ToUTF16(info.name), - base::UTF8ToUTF16(info.version), info.state); + client->didAddOutputPort(WebString::fromUTF8(info.id), + WebString::fromUTF8(info.manufacturer), + WebString::fromUTF8(info.name), + WebString::fromUTF8(info.version), info.state); } } client->didStartSession(result); @@ -232,10 +233,10 @@ void MidiMessageFilter::HandleAddInputPort(midi::MidiPortInfo info) { DCHECK(main_task_runner_->BelongsToCurrentThread()); inputs_.push_back(info); - const base::string16 id = base::UTF8ToUTF16(info.id); - const base::string16 manufacturer = base::UTF8ToUTF16(info.manufacturer); - const base::string16 name = base::UTF8ToUTF16(info.name); - const base::string16 version = base::UTF8ToUTF16(info.version); + const WebString id = WebString::fromUTF8(info.id); + const WebString manufacturer = WebString::fromUTF8(info.manufacturer); + const WebString name = WebString::fromUTF8(info.name); + const WebString version = WebString::fromUTF8(info.version); for (auto* client : clients_) client->didAddInputPort(id, manufacturer, name, version, info.state); } @@ -243,10 +244,10 @@ void MidiMessageFilter::HandleAddOutputPort(midi::MidiPortInfo info) { DCHECK(main_task_runner_->BelongsToCurrentThread()); outputs_.push_back(info); - const base::string16 id = base::UTF8ToUTF16(info.id); - const base::string16 manufacturer = base::UTF8ToUTF16(info.manufacturer); - const base::string16 name = base::UTF8ToUTF16(info.name); - const base::string16 version = base::UTF8ToUTF16(info.version); + const WebString id = WebString::fromUTF8(info.id); + const WebString manufacturer = WebString::fromUTF8(info.manufacturer); + const WebString name = WebString::fromUTF8(info.name); + const WebString version = WebString::fromUTF8(info.version); for (auto* client : clients_) client->didAddOutputPort(id, manufacturer, name, version, info.state); }
diff --git a/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc b/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc index 825a212f..0180f58a 100644 --- a/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc +++ b/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc
@@ -32,10 +32,9 @@ void MockWebRTCPeerConnectionHandlerClient::didGenerateICECandidateWorker( const blink::WebRTCICECandidate& candidate) { if (!candidate.isNull()) { - candidate_sdp_ = - base::UTF16ToUTF8(base::StringPiece16(candidate.candidate())); + candidate_sdp_ = candidate.candidate().utf8(); candidate_mline_index_ = candidate.sdpMLineIndex(); - candidate_mid_ = base::UTF16ToUTF8(base::StringPiece16(candidate.sdpMid())); + candidate_mid_ = candidate.sdpMid().utf8(); } else { candidate_sdp_ = ""; candidate_mline_index_ = -1;
diff --git a/content/renderer/media/peer_connection_tracker.cc b/content/renderer/media/peer_connection_tracker.cc index eadf8d4..1b92e23 100644 --- a/content/renderer/media/peer_connection_tracker.cc +++ b/content/renderer/media/peer_connection_tracker.cc
@@ -85,12 +85,12 @@ static std::string SerializeMediaStreamComponent( const blink::WebMediaStreamTrack& component) { - return base::UTF16ToUTF8(base::StringPiece16(component.source().id())); + return component.source().id().utf8(); } static std::string SerializeMediaDescriptor( const blink::WebMediaStream& stream) { - std::string id = base::UTF16ToUTF8(base::StringPiece16(stream.id())); + std::string id = stream.id().utf8(); std::string result = "id: " + id; blink::WebVector<blink::WebMediaStreamTrack> tracks; stream.audioTracks(tracks); @@ -551,11 +551,10 @@ int id = GetLocalIDForHandler(pc_handler); if (id == -1) return; - std::string value = - "sdpMid: " + base::UTF16ToUTF8(base::StringPiece16(candidate.sdpMid())) + - ", " + "sdpMLineIndex: " + base::UintToString(candidate.sdpMLineIndex()) + - ", " + "candidate: " + - base::UTF16ToUTF8(base::StringPiece16(candidate.candidate())); + std::string value = "sdpMid: " + candidate.sdpMid().utf8() + ", " + + "sdpMLineIndex: " + + base::UintToString(candidate.sdpMLineIndex()) + ", " + + "candidate: " + candidate.candidate().utf8(); // OnIceCandidate always succeeds as it's a callback from the browser. DCHECK(source != SOURCE_LOCAL || succeeded); @@ -701,8 +700,7 @@ int id = GetLocalIDForHandler(pc_handler); if (id == -1) return; - SendPeerConnectionUpdate(id, "createDTMFSender", - base::UTF16ToUTF8(base::StringPiece16(track.id()))); + SendPeerConnectionUpdate(id, "createDTMFSender", track.id().utf8()); } void PeerConnectionTracker::TrackGetUserMedia(
diff --git a/content/renderer/media/pepper_to_video_track_adapter.cc b/content/renderer/media/pepper_to_video_track_adapter.cc index 8535dca..5282026a 100644 --- a/content/renderer/media/pepper_to_video_track_adapter.cc +++ b/content/renderer/media/pepper_to_video_track_adapter.cc
@@ -257,7 +257,7 @@ blink::WebMediaStreamSource webkit_source; blink::WebMediaStreamSource::Type type = blink::WebMediaStreamSource::TypeVideo; - blink::WebString webkit_track_id = base::UTF8ToUTF16(track_id); + blink::WebString webkit_track_id = blink::WebString::fromUTF8(track_id); webkit_source.initialize(webkit_track_id, type, webkit_track_id, false /* remote */); webkit_source.setExtraData(writer);
diff --git a/content/renderer/media/remote_media_stream_impl.cc b/content/renderer/media/remote_media_stream_impl.cc index 8dca0e66..b56c2ab 100644 --- a/content/renderer/media/remote_media_stream_impl.cc +++ b/content/renderer/media/remote_media_stream_impl.cc
@@ -100,7 +100,7 @@ DCHECK(main_thread_->BelongsToCurrentThread()); DCHECK(webkit_track_.isNull()); - blink::WebString webkit_track_id(base::UTF8ToUTF16(id_)); + blink::WebString webkit_track_id(blink::WebString::fromUTF8(id_)); blink::WebMediaStreamSource webkit_source; webkit_source.initialize(webkit_track_id, type, webkit_track_id, true /* remote */); @@ -369,7 +369,7 @@ webkit_video_tracks[i] = *video_track_observers_[i]->webkit_track(); } - webkit_stream_.initialize(base::UTF8ToUTF16(label), + webkit_stream_.initialize(blink::WebString::fromUTF8(label), webkit_audio_tracks, webkit_video_tracks); webkit_stream_.setExtraData(new MediaStream()); }
diff --git a/content/renderer/media/rtc_data_channel_handler.cc b/content/renderer/media/rtc_data_channel_handler.cc index 531c9d58..5e850cc 100644 --- a/content/renderer/media/rtc_data_channel_handler.cc +++ b/content/renderer/media/rtc_data_channel_handler.cc
@@ -177,7 +177,7 @@ blink::WebString RtcDataChannelHandler::label() { DCHECK(thread_checker_.CalledOnValidThread()); - return base::UTF8ToUTF16(channel()->label()); + return blink::WebString::fromUTF8(channel()->label()); } bool RtcDataChannelHandler::isReliable() { @@ -202,7 +202,7 @@ blink::WebString RtcDataChannelHandler::protocol() const { DCHECK(thread_checker_.CalledOnValidThread()); - return base::UTF8ToUTF16(channel()->protocol()); + return blink::WebString::fromUTF8(channel()->protocol()); } bool RtcDataChannelHandler::negotiated() const { @@ -254,7 +254,7 @@ bool RtcDataChannelHandler::sendStringData(const blink::WebString& data) { DCHECK(thread_checker_.CalledOnValidThread()); - std::string utf8_buffer = base::UTF16ToUTF8(base::StringPiece16(data)); + std::string utf8_buffer = data.utf8(); webrtc::DataBuffer data_buffer(utf8_buffer); RecordMessageSent(data_buffer.size()); return channel()->Send(data_buffer); @@ -335,7 +335,7 @@ LOG(ERROR) << "Failed convert received data to UTF16"; return; } - webkit_client_->didReceiveStringData(utf16); + webkit_client_->didReceiveStringData(blink::WebString::fromUTF16(utf16)); } }
diff --git a/content/renderer/media/rtc_dtmf_sender_handler.cc b/content/renderer/media/rtc_dtmf_sender_handler.cc index 5548f0da..bfc21e61 100644 --- a/content/renderer/media/rtc_dtmf_sender_handler.cc +++ b/content/renderer/media/rtc_dtmf_sender_handler.cc
@@ -69,7 +69,7 @@ } blink::WebString RtcDtmfSenderHandler::currentToneBuffer() { - return base::UTF8ToUTF16(dtmf_sender_->tones()); + return blink::WebString::fromUTF8(dtmf_sender_->tones()); } bool RtcDtmfSenderHandler::canInsertDTMF() { @@ -79,7 +79,7 @@ bool RtcDtmfSenderHandler::insertDTMF(const blink::WebString& tones, long duration, long interToneGap) { - std::string utf8_tones = base::UTF16ToUTF8(base::StringPiece16(tones)); + std::string utf8_tones = tones.utf8(); return dtmf_sender_->InsertDtmf(utf8_tones, static_cast<int>(duration), static_cast<int>(interToneGap)); } @@ -89,8 +89,7 @@ LOG(ERROR) << "WebRTCDTMFSenderHandlerClient not set."; return; } - webkit_client_->didPlayTone(base::UTF8ToUTF16(tone)); + webkit_client_->didPlayTone(blink::WebString::fromUTF8(tone)); } } // namespace content -
diff --git a/content/renderer/media/rtc_peer_connection_handler.cc b/content/renderer/media/rtc_peer_connection_handler.cc index ed4898f..3485bdf1 100644 --- a/content/renderer/media/rtc_peer_connection_handler.cc +++ b/content/renderer/media/rtc_peer_connection_handler.cc
@@ -138,7 +138,8 @@ blink::WebRTCSessionDescription CreateWebKitSessionDescription( const std::string& sdp, const std::string& type) { blink::WebRTCSessionDescription description; - description.initialize(base::UTF8ToUTF16(type), base::UTF8ToUTF16(sdp)); + description.initialize(blink::WebString::fromUTF8(type), + blink::WebString::fromUTF8(sdp)); return description; } @@ -200,10 +201,8 @@ webrtc_config->servers.clear(); for (const blink::WebRTCIceServer& blink_server : blink_config.iceServers) { webrtc::PeerConnectionInterface::IceServer server; - server.username = - base::UTF16ToUTF8(base::StringPiece16(blink_server.username)); - server.password = - base::UTF16ToUTF8(base::StringPiece16(blink_server.credential)); + server.username = blink_server.username.utf8(); + server.password = blink_server.credential.utf8(); server.uri = blink_server.url.string().utf8(); webrtc_config->servers.push_back(server); } @@ -389,7 +388,7 @@ } tracker_.TrackOnFailure(error); - webkit_request_.requestFailed(base::UTF8ToUTF16(error)); + webkit_request_.requestFailed(blink::WebString::fromUTF8(error)); webkit_request_.reset(); } @@ -442,7 +441,7 @@ return; } tracker_.TrackOnFailure(error); - webkit_request_.requestFailed(base::UTF8ToUTF16(error)); + webkit_request_.requestFailed(blink::WebString::fromUTF8(error)); webkit_request_.reset(); } @@ -1243,9 +1242,8 @@ DCHECK(thread_checker_.CalledOnValidThread()); TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::setLocalDescription"); - std::string sdp = base::UTF16ToUTF8(base::StringPiece16(description.sdp())); - std::string type = - base::UTF16ToUTF8(base::StringPiece16(description.type())); + std::string sdp = description.sdp().utf8(); + std::string type = description.type().utf8(); webrtc::SdpParseError error; // Since CreateNativeSessionDescription uses the dependency factory, we need @@ -1297,9 +1295,8 @@ const blink::WebRTCSessionDescription& description) { DCHECK(thread_checker_.CalledOnValidThread()); TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::setRemoteDescription"); - std::string sdp = base::UTF16ToUTF8(base::StringPiece16(description.sdp())); - std::string type = - base::UTF16ToUTF8(base::StringPiece16(description.type())); + std::string sdp = description.sdp().utf8(); + std::string type = description.type().utf8(); webrtc::SdpParseError error; // Since CreateNativeSessionDescription uses the dependency factory, we need @@ -1427,10 +1424,9 @@ DCHECK(thread_checker_.CalledOnValidThread()); TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::addICECandidate"); std::unique_ptr<webrtc::IceCandidateInterface> native_candidate( - dependency_factory_->CreateIceCandidate( - base::UTF16ToUTF8(base::StringPiece16(candidate.sdpMid())), - candidate.sdpMLineIndex(), - base::UTF16ToUTF8(base::StringPiece16(candidate.candidate())))); + dependency_factory_->CreateIceCandidate(candidate.sdpMid().utf8(), + candidate.sdpMLineIndex(), + candidate.candidate().utf8())); bool return_value = false; if (native_candidate) { @@ -1456,7 +1452,7 @@ // We don't have the actual error code from the libjingle, so for now // using a generic error string. return webkit_request.requestFailed( - base::UTF8ToUTF16("Error processing ICE candidate")); + blink::WebString::fromUTF8("Error processing ICE candidate")); } return webkit_request.requestSucceeded(); @@ -1608,8 +1604,7 @@ const blink::WebString& label, const blink::WebRTCDataChannelInit& init) { DCHECK(thread_checker_.CalledOnValidThread()); TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::createDataChannel"); - DVLOG(1) << "createDataChannel label " - << base::UTF16ToUTF8(base::StringPiece16(label)); + DVLOG(1) << "createDataChannel label " << label.utf8(); webrtc::DataChannelInit config; // TODO(jiayl): remove the deprecated reliable field once Libjingle is updated @@ -1620,11 +1615,10 @@ config.negotiated = init.negotiated; config.maxRetransmits = init.maxRetransmits; config.maxRetransmitTime = init.maxRetransmitTime; - config.protocol = base::UTF16ToUTF8(base::StringPiece16(init.protocol)); + config.protocol = init.protocol.utf8(); rtc::scoped_refptr<webrtc::DataChannelInterface> webrtc_channel( - native_peer_connection_->CreateDataChannel( - base::UTF16ToUTF8(base::StringPiece16(label)), &config)); + native_peer_connection_->CreateDataChannel(label.utf8(), &config)); if (!webrtc_channel) { DLOG(ERROR) << "Could not create native data channel."; return NULL; @@ -1853,8 +1847,8 @@ DCHECK(thread_checker_.CalledOnValidThread()); TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::OnIceCandidateImpl"); blink::WebRTCICECandidate web_candidate; - web_candidate.initialize(base::UTF8ToUTF16(sdp), - base::UTF8ToUTF16(sdp_mid), + web_candidate.initialize(blink::WebString::fromUTF8(sdp), + blink::WebString::fromUTF8(sdp_mid), sdp_mline_index); if (peer_connection_tracker_) { peer_connection_tracker_->TrackAddIceCandidate(
diff --git a/content/renderer/media/user_media_client_impl.cc b/content/renderer/media/user_media_client_impl.cc index b7cccf7..dfe6f24 100644 --- a/content/renderer/media/user_media_client_impl.cc +++ b/content/renderer/media/user_media_client_impl.cc
@@ -443,7 +443,7 @@ CreateVideoTracks(video_array, request_info->request.videoConstraints(), &video_track_vector, request_info); - blink::WebString webkit_id = base::UTF8ToUTF16(label); + blink::WebString webkit_id = blink::WebString::fromUTF8(label); blink::WebMediaStream* web_stream = &(request_info->web_stream); web_stream->initialize(webkit_id, audio_track_vector, @@ -554,11 +554,9 @@ return; } - webkit_source->initialize( - base::UTF8ToUTF16(device.device.id), - type, - base::UTF8ToUTF16(device.device.name), - false /* remote */); + webkit_source->initialize(blink::WebString::fromUTF8(device.device.id), type, + blink::WebString::fromUTF8(device.device.name), + false /* remote */); DVLOG(1) << "Initialize source object :" << "id = " << webkit_source->id().utf8()
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 9f1f38d..050b89e 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -2123,8 +2123,10 @@ render_accessibility_ = NULL; } - if (accessibility_mode_ & ACCESSIBILITY_MODE_FLAG_WEB_CONTENTS) - render_accessibility_ = new RenderAccessibilityImpl(this); + if (accessibility_mode_ & ACCESSIBILITY_MODE_FLAG_WEB_CONTENTS) { + render_accessibility_ = new RenderAccessibilityImpl( + this, accessibility_mode_); + } for (auto& observer : observers_) observer.AccessibilityModeChanged();
diff --git a/content/renderer/service_worker/service_worker_context_client.cc b/content/renderer/service_worker/service_worker_context_client.cc index ce0bce7..3e82bf5 100644 --- a/content/renderer/service_worker/service_worker_context_client.cc +++ b/content/renderer/service_worker/service_worker_context_client.cc
@@ -165,6 +165,15 @@ return web_client_info; } +// Use this template in willDestroyWorkerContext to abort all the pending +// events callbacks. +template <typename T> +void AbortPendingEventCallbacks(T& callbacks) { + for (typename T::iterator it(&callbacks); !it.IsAtEnd(); it.Advance()) { + it.GetCurrentValue()->Run(SERVICE_WORKER_ERROR_ABORT, base::Time::Now()); + } +} + } // namespace // Holding data that needs to be bound to the worker context on the @@ -179,6 +188,8 @@ using SkipWaitingCallbacksMap = IDMap<std::unique_ptr<blink::WebServiceWorkerSkipWaitingCallbacks>>; using SyncEventCallbacksMap = IDMap<std::unique_ptr<const SyncCallback>>; + using PushEventCallbacksMap = + IDMap<std::unique_ptr<const DispatchPushEventCallback>>; using FetchEventCallbacksMap = IDMap<std::unique_ptr<const FetchCallback>>; using ExtendableMessageEventCallbacksMap = IDMap<std::unique_ptr<const DispatchExtendableMessageEventCallback>>; @@ -211,6 +222,9 @@ // Pending callbacks for Background Sync Events. SyncEventCallbacksMap sync_event_callbacks; + // Pending callbacks for Push Events. + PushEventCallbacksMap push_event_callbacks; + // Pending callbacks for Fetch Events. FetchEventCallbacksMap fetch_event_callbacks; @@ -410,7 +424,6 @@ OnNotificationClickEvent) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_NotificationCloseEvent, OnNotificationCloseEvent) - IPC_MESSAGE_HANDLER(ServiceWorkerMsg_PushEvent, OnPushEvent) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidGetClient, OnDidGetClient) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidGetClients, OnDidGetClients) IPC_MESSAGE_HANDLER(ServiceWorkerMsg_OpenWindowResponse, @@ -572,24 +585,11 @@ // (while we're still on the worker thread). proxy_ = NULL; - // Aborts the all pending sync event callbacks. - for (WorkerContextData::SyncEventCallbacksMap::iterator it( - &context_->sync_event_callbacks); - !it.IsAtEnd(); it.Advance()) { - it.GetCurrentValue()->Run(SERVICE_WORKER_ERROR_ABORT, base::Time::Now()); - } - // Aborts the all pending fetch event callbacks. - for (WorkerContextData::FetchEventCallbacksMap::iterator it( - &context_->fetch_event_callbacks); - !it.IsAtEnd(); it.Advance()) { - it.GetCurrentValue()->Run(SERVICE_WORKER_ERROR_ABORT, base::Time::Now()); - } - // Aborts the all pending extendable message event callbacks. - for (WorkerContextData::ExtendableMessageEventCallbacksMap::iterator it( - &context_->message_event_callbacks); - !it.IsAtEnd(); it.Advance()) { - it.GetCurrentValue()->Run(SERVICE_WORKER_ERROR_ABORT, base::Time::Now()); - } + // Aborts all the pending events callbacks. + AbortPendingEventCallbacks(context_->sync_event_callbacks); + AbortPendingEventCallbacks(context_->push_event_callbacks); + AbortPendingEventCallbacks(context_->fetch_event_callbacks); + AbortPendingEventCallbacks(context_->message_event_callbacks); // We have to clear callbacks now, as they need to be freed on the // same thread. @@ -765,9 +765,14 @@ int request_id, blink::WebServiceWorkerEventResult result, double event_dispatch_time) { - Send(new ServiceWorkerHostMsg_PushEventFinished( - GetRoutingID(), request_id, result, - base::Time::FromDoubleT(event_dispatch_time))); + const DispatchPushEventCallback* callback = + context_->push_event_callbacks.Lookup(request_id); + DCHECK(callback); + callback->Run(result == blink::WebServiceWorkerEventResultCompleted + ? SERVICE_WORKER_OK + : SERVICE_WORKER_ERROR_EVENT_WAITUNTIL_REJECTED, + base::Time::FromDoubleT(event_dispatch_time)); + context_->push_event_callbacks.Remove(request_id); } void ServiceWorkerContextClient::didHandleSyncEvent( @@ -1060,10 +1065,14 @@ ToWebNotificationData(notification_data)); } -void ServiceWorkerContextClient::OnPushEvent(int request_id, - const PushEventPayload& payload) { +void ServiceWorkerContextClient::DispatchPushEvent( + const PushEventPayload& payload, + const DispatchPushEventCallback& callback) { TRACE_EVENT0("ServiceWorker", - "ServiceWorkerContextClient::OnPushEvent"); + "ServiceWorkerContextClient::DispatchPushEvent"); + int request_id = context_->push_event_callbacks.Add( + base::MakeUnique<DispatchPushEventCallback>(callback)); + // Only set data to be a valid string if the payload had decrypted data. blink::WebString data; if (!payload.is_null)
diff --git a/content/renderer/service_worker/service_worker_context_client.h b/content/renderer/service_worker/service_worker_context_client.h index 2686e31..79410a6 100644 --- a/content/renderer/service_worker/service_worker_context_client.h +++ b/content/renderer/service_worker/service_worker_context_client.h
@@ -220,6 +220,8 @@ const ServiceWorkerFetchRequest& request, mojom::FetchEventPreloadHandlePtr preload_handle, const DispatchFetchEventCallback& callback) override; + void DispatchPushEvent(const PushEventPayload& payload, + const DispatchPushEventCallback& callback) override; void DispatchSyncEvent( const std::string& tag, blink::mojom::BackgroundSyncEventLastChance last_chance, @@ -233,7 +235,6 @@ const PlatformNotificationData& notification_data, int action_index, const base::NullableString16& reply); - void OnPushEvent(int request_id, const PushEventPayload& payload); void OnNotificationCloseEvent( int request_id, const std::string& notification_id,
diff --git a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py index 58f7445..63ae0cc 100644 --- a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py +++ b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
@@ -405,6 +405,13 @@ self.Flaky('deqp/functional/gles3/shaderindexing/mat_02.html', ['mac', 'amd'], bug=644360) + # These seem to be provoking intermittent GPU process crashes on + # the MacBook Pros with AMD GPUs. + self.Flaky('deqp/functional/gles3/texturefiltering/*', + ['mac', 'amd'], bug=663601) + self.Flaky('deqp/functional/gles3/textureshadow/*', + ['mac', 'amd'], bug=663601) + self.Fail('conformance2/rendering/clipping-wide-points.html', ['mac', 'amd'], bug=642822) self.Fail('conformance2/reading/read-pixels-from-rgb8-into-pbo-bug.html',
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 9abbd4af..a9e5d3c 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -5920,7 +5920,7 @@ framebuffer->HasDepthStencilFormatAttachment(); bool invalidate_depth = false; bool invalidate_stencil = false; - std::unique_ptr<GLenum[]> validated_attachments(new GLenum[count]); + std::unique_ptr<GLenum[]> validated_attachments(new GLenum[count+1]); GLsizei validated_count = 0; // Validates the attachments. If one of them fails, the whole command fails. @@ -5963,7 +5963,10 @@ validated_attachments[validated_count++] = attachment; } if (invalidate_depth && invalidate_stencil) { - validated_attachments[validated_count++] = GL_DEPTH_STENCIL_ATTACHMENT; + // We do not use GL_DEPTH_STENCIL_ATTACHMENT here because + // it is not a valid token for glDiscardFramebufferEXT. + validated_attachments[validated_count++] = GL_DEPTH_ATTACHMENT; + validated_attachments[validated_count++] = GL_STENCIL_ATTACHMENT; } // If the default framebuffer is bound but we are still rendering to an
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc index 8094910a..40ca073a 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
@@ -3876,7 +3876,7 @@ EXPECT_FALSE(framebuffer->HasUnclearedAttachment(GL_STENCIL_ATTACHMENT)); attachments[0] = GL_DEPTH_STENCIL_ATTACHMENT; - EXPECT_CALL(*gl_, InvalidateFramebuffer(target, 1, _)) + EXPECT_CALL(*gl_, InvalidateFramebuffer(target, 2, _)) .Times(1) .RetiresOnSaturation(); cmd.Init(target, count, attachments);
diff --git a/ios/chrome/browser/share_extension/share_extension_item_receiver.mm b/ios/chrome/browser/share_extension/share_extension_item_receiver.mm index 677f1ec9..a6333406 100644 --- a/ios/chrome/browser/share_extension/share_extension_item_receiver.mm +++ b/ios/chrome/browser/share_extension/share_extension_item_receiver.mm
@@ -98,13 +98,9 @@ DCHECK(!_readingListModel); DCHECK(!_bookmarkModel); -#if TARGET_IPHONE_SIMULATOR if (![self presentedItemURL]) { return; } -#else - DCHECK([self presentedItemURL]); -#endif _readingListModel = readingListModel; _bookmarkModel = bookmarkModel;
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index da87296d..d0e173d 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -1989,16 +1989,17 @@ [self removeWebViewAllowingCachedReconstruction:NO]; web::NavigationItem* item = [self currentNavItem]; - const GURL targetURL = item ? item->GetVirtualURL() : GURL::EmptyGURL(); + const GURL virtualURL = item ? item->GetVirtualURL() : GURL::EmptyGURL(); const web::Referrer referrer; id<CRWNativeContent> nativeContent = - [_nativeProvider controllerForURL:targetURL]; + [_nativeProvider controllerForURL:virtualURL]; // Unlike the WebView case, always create a new controller and view. // TODO(pinkerton): What to do if this does return nil? [self setNativeController:nativeContent]; if ([nativeContent respondsToSelector:@selector(virtualURL)]) { item->SetVirtualURL([nativeContent virtualURL]); } + const GURL targetURL = item ? item->GetURL() : GURL::EmptyGURL(); [self registerLoadRequest:targetURL referrer:referrer transition:[self currentTransition]]; @@ -5629,7 +5630,7 @@ [request setHTTPBody:POSTData]; [request setAllHTTPHeaderFields:[self currentHTTPHeaders]]; GURL navigationURL = - currentItem ? currentItem->GetVirtualURL() : GURL::EmptyGURL(); + currentItem ? currentItem->GetURL() : GURL::EmptyGURL(); [self registerLoadRequest:navigationURL referrer:[self currentSessionEntryReferrer] transition:[self currentTransition]]; @@ -5639,7 +5640,7 @@ ProceduralBlock defaultNavigationBlock = ^{ web::NavigationItem* item = [self currentNavItem]; - GURL navigationURL = item ? item->GetVirtualURL() : GURL::EmptyGURL(); + GURL navigationURL = item ? item->GetURL() : GURL::EmptyGURL(); [self registerLoadRequest:navigationURL referrer:[self currentSessionEntryReferrer] transition:[self currentTransition]]; @@ -5674,7 +5675,7 @@ // will be a no-op when it is passed the current back forward list item, // so |reload| must be explicitly called. web::NavigationItem* item = [self currentNavItem]; - GURL navigationURL = item ? item->GetVirtualURL() : GURL::EmptyGURL(); + GURL navigationURL = item ? item->GetURL() : GURL::EmptyGURL(); [self registerLoadRequest:navigationURL referrer:[self currentSessionEntryReferrer] transition:[self currentTransition]];
diff --git a/media/blink/key_system_config_selector.cc b/media/blink/key_system_config_selector.cc index a4f2b27b..1da8ca0 100644 --- a/media/blink/key_system_config_selector.cc +++ b/media/blink/key_system_config_selector.cc
@@ -400,8 +400,8 @@ // 3.4-3.11. (Implemented by IsSupportedContentType().) ConfigState proposed_config_state = *config_state; - if (!base::IsStringASCII(capability.mimeType) || - !base::IsStringASCII(capability.codecs) || + if (!capability.mimeType.containsOnlyASCII() || + !capability.codecs.containsOnlyASCII() || !IsSupportedContentType( key_system, media_type, capability.mimeType.ascii(), capability.codecs.ascii(), &proposed_config_state)) { @@ -412,7 +412,7 @@ // 3.12.1. If robustness is an unrecognized value or not supported by // implementation, continue to the next iteration. String // comparison is case-sensitive. - if (!base::IsStringASCII(capability.robustness)) + if (!capability.robustness.containsOnlyASCII()) continue; EmeConfigRule robustness_rule = key_systems_->GetRobustnessConfigRule( key_system, media_type, capability.robustness.ascii());
diff --git a/media/blink/webencryptedmediaclient_impl.cc b/media/blink/webencryptedmediaclient_impl.cc index 6b3e8949..3584f6ce 100644 --- a/media/blink/webencryptedmediaclient_impl.cc +++ b/media/blink/webencryptedmediaclient_impl.cc
@@ -128,8 +128,9 @@ const blink::WebSecurityOrigin& security_origin, const CdmConfig& cdm_config, std::unique_ptr<blink::WebContentDecryptionModuleResult> result) { - WebContentDecryptionModuleImpl::Create( - cdm_factory_, key_system, security_origin, cdm_config, std::move(result)); + WebContentDecryptionModuleImpl::Create(cdm_factory_, key_system.utf16(), + security_origin, cdm_config, + std::move(result)); } void WebEncryptedMediaClientImpl::OnRequestSucceeded(
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 index a7a8748..0718b2d 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
@@ -12,6 +12,7 @@ Bug(none) crypto/ [ Skip ] Bug(none) css-parser/ [ Skip ] Bug(none) css1/ [ Skip ] +Bug(none) virtual/mojo-loading/css1/ [ Skip ] Bug(none) css2.1/ [ Skip ] Bug(none) css3/ [ Skip ] Bug(none) css3/blending [ Pass ]
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/root-layer-scrolls b/third_party/WebKit/LayoutTests/FlagExpectations/root-layer-scrolls index 189a2de..0da8683 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/root-layer-scrolls +++ b/third_party/WebKit/LayoutTests/FlagExpectations/root-layer-scrolls
@@ -141,6 +141,64 @@ Bug(none) css1/text_properties/word_spacing.html [ Failure ] Bug(none) css1/units/color_units.html [ Failure ] Bug(none) css1/units/length_units.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/basic/comments.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/basic/containment.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/basic/id_as_selector.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/border.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/border_bottom.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/border_bottom_width.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/border_left.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/border_left_width.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/border_right_inline.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/border_right_width.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/border_style.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/border_top.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/border_top_width.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/border_width.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/clear.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/float_elements_in_series.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/float_margin.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/float_on_text_elements.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/height.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/margin_bottom.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/margin_left.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/margin_top.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/padding.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/padding_bottom.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/padding_inline.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/padding_left.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/padding_right.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/padding_top.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/box_properties/width.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/cascade/cascade_order.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/classification/display.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/classification/list_style_type.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/color_and_background/background.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/color_and_background/background_position.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/conformance/forward_compatible_parsing.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/font_properties/font.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/font_properties/font_family.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/font_properties/font_size.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/font_properties/font_weight.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/formatting_model/floating_elements.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/formatting_model/height_of_lines.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/formatting_model/inline_elements.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/formatting_model/replaced_elements.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/formatting_model/vertical_formatting.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/pseudo/anchor.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/pseudo/firstletter.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/pseudo/firstline.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/pseudo/multiple_pseudo_elements.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/pseudo/pseudo_elements_in_selectors.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/text_properties/letter_spacing.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/text_properties/line_height.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/text_properties/text_decoration.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/text_properties/text_indent.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/text_properties/text_transform.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/text_properties/vertical_align.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/text_properties/word_spacing.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/units/color_units.html [ Failure ] +Bug(none) virtual/mojo-loading/css1/units/length_units.html [ Failure ] Bug(none) css2.1/20110323/abspos-containing-block-initial-001.htm [ Failure ] Bug(none) css2.1/20110323/block-non-replaced-height-002.htm [ Failure ] Bug(none) css2.1/20110323/block-non-replaced-height-004.htm [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index a24375ee..7e3a723 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1637,8 +1637,13 @@ crbug.com/596752 virtual/threaded/inspector/tracing/decode-resize.html [ Pass Failure ] +crbug.com/610300 css3/fonts/font-style-matching-0.html [ Failure Pass ] +crbug.com/610300 css3/fonts/font-style-matching-1.html [ Failure Pass ] +crbug.com/610300 css3/fonts/font-style-matching-2.html [ Failure Pass ] +crbug.com/610300 css3/fonts/font-style-matching-3.html [ Failure Pass ] crbug.com/610300 css3/fonts/font-style-matching-4.html [ Failure Pass ] crbug.com/610300 css3/fonts/font-style-matching-5.html [ Failure Pass ] +crbug.com/610300 css3/fonts/font-style-matching-6.html [ Failure Pass ] crbug.com/610300 css3/fonts/font-style-matching-7.html [ Failure Pass ] crbug.com/610300 css3/fonts/font-style-matching-8.html [ Failure Pass ] crbug.com/524646 [ Mac10.10 ] fast/dom/shadow/shadowdom-for-button.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites index 647c0fc..a4fee8c 100644 --- a/third_party/WebKit/LayoutTests/VirtualTestSuites +++ b/third_party/WebKit/LayoutTests/VirtualTestSuites
@@ -291,6 +291,11 @@ "args": ["--enable-blink-features=LoadingWithMojo"] }, { + "prefix": "mojo-loading", + "base": "css1", + "args": ["--enable-blink-features=LoadingWithMojo"] + }, + { "prefix": "scalefactor150", "base": "fast/events/synthetic-events", "args": ["--force-device-scale-factor=1.5"]
diff --git a/third_party/WebKit/LayoutTests/css1/basic/class_as_selector.html b/third_party/WebKit/LayoutTests/css1/basic/class_as_selector.html index 979a231..ed36ebe5 100644 --- a/third_party/WebKit/LayoutTests/css1/basic/class_as_selector.html +++ b/third_party/WebKit/LayoutTests/css1/basic/class_as_selector.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> body {overflow: hidden;} .one {color: green;}
diff --git a/third_party/WebKit/LayoutTests/css1/basic/comments.html b/third_party/WebKit/LayoutTests/css1/basic/comments.html index b6aebf9b..1b3d00316 100644 --- a/third_party/WebKit/LayoutTests/css1/basic/comments.html +++ b/third_party/WebKit/LayoutTests/css1/basic/comments.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> /* This is a CSS1 comment. */ .one {color: green;} /* Another comment */
diff --git a/third_party/WebKit/LayoutTests/css1/basic/containment.html b/third_party/WebKit/LayoutTests/css1/basic/containment.html index d2a37bc..161baa9d 100644 --- a/third_party/WebKit/LayoutTests/css1/basic/containment.html +++ b/third_party/WebKit/LayoutTests/css1/basic/containment.html
@@ -3,7 +3,8 @@ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> -<link rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<script src="../resources/base.js"></script> +<link rel="stylesheet" type="text/css" href="../resources/base.css"> <link rel="stylesheet" type="text/css" href="../resources/linktest.css" title="Default SS"> <link rel="alternate stylesheet" type="text/css" href="../resources/linktest2.css" title="Alternate SS"> <style type="text/css"> @@ -97,4 +98,4 @@ <p class="six"> This paragraph should be green. </p> -</td></tr></tbody></table></body></html> \ No newline at end of file +</td></tr></tbody></table></body></html>
diff --git a/third_party/WebKit/LayoutTests/css1/basic/contextual_selectors.html b/third_party/WebKit/LayoutTests/css1/basic/contextual_selectors.html index eb64493b..297184f2 100644 --- a/third_party/WebKit/LayoutTests/css1/basic/contextual_selectors.html +++ b/third_party/WebKit/LayoutTests/css1/basic/contextual_selectors.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P {color: navy; font-family: serif;} HTML BODY TABLE P {color: purple; font-family: sans-serif;}
diff --git a/third_party/WebKit/LayoutTests/css1/basic/grouping.html b/third_party/WebKit/LayoutTests/css1/basic/grouping.html index 3f1e40f..507b1e4 100644 --- a/third_party/WebKit/LayoutTests/css1/basic/grouping.html +++ b/third_party/WebKit/LayoutTests/css1/basic/grouping.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one, .two, .three {color: green;} </STYLE>
diff --git a/third_party/WebKit/LayoutTests/css1/basic/id_as_selector.html b/third_party/WebKit/LayoutTests/css1/basic/id_as_selector.html index afcb9c2..45f79ed 100644 --- a/third_party/WebKit/LayoutTests/css1/basic/id_as_selector.html +++ b/third_party/WebKit/LayoutTests/css1/basic/id_as_selector.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> #one {color: green;} #a1 {color: green;}
diff --git a/third_party/WebKit/LayoutTests/css1/basic/inheritance.html b/third_party/WebKit/LayoutTests/css1/basic/inheritance.html index 0891d8d..f06b110 100644 --- a/third_party/WebKit/LayoutTests/css1/basic/inheritance.html +++ b/third_party/WebKit/LayoutTests/css1/basic/inheritance.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> BODY { color: green;
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border.html b/third_party/WebKit/LayoutTests/css1/box_properties/border.html index 03fca75..2dabe917 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border: medium black solid;} .two {border: thin maroon ridge;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom.html index 2ba3b01..213a511 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border-bottom: purple double 10px;} .two {border-bottom: purple thin solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom_inline.html index 63e4509..5c2f276f 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border-bottom: purple double 10px;} .two {border-bottom: purple thin solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom_width.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom_width.html index 6933a14..a9f52b0 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom_width.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom_width.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; border-bottom-width: 0;} .one {border-bottom-width: 50px; border-style: solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom_width_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom_width_inline.html index 36ae563..ac60d78 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom_width_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_bottom_width_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border-bottom-width: 25px; border-style: solid;} .two {border-bottom-width: thin; border-style: solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_color.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_color.html index 4d99eed..a5f3862 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_color.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_color.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border-color: purple; border-style: solid;} .two {border-color: purple; border-width: medium; border-style: solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_color_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_color_inline.html index 97a1f74..87354ec 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_color_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_color_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border-color: purple; border-style: solid;} .two {border-color: purple; border-width: medium; border-style: solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_inline.html index ca769cb..5bf4838 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border: 10px teal outset;} .two {border: 10px olive inset;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_left.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_left.html index 2c0e4967..d266ab2 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_left.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_left.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P {margin-left: 20px;} .one {border-left: purple double 10px;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_left_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_left_inline.html index c66ed6f..ba63210f 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_left_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_left_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P {margin-left: 20px;} .one {border-left: purple double 10px;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_left_width.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_left_width.html index d0730fe..05f20ed 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_left_width.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_left_width.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; border-left-width: 0;} .one {border-left-width: 50px; border-style: solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_left_width_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_left_width_inline.html index c1cc7f2..eb3dc3d2 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_left_width_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_left_width_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border-left-width: 25px; border-style: solid;} .two {border-left-width: thin; border-style: solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_right.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_right.html index ca57578..7cc67c7 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_right.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_right.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P {margin-right: 20px;} .one {border-right: purple double 10px;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_right_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_right_inline.html index ec8e58a3..fb9a2483 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_right_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_right_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P {margin-right: 20px;} .one {border-right: purple double 10px;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_right_width.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_right_width.html index 8544974..f7b1483 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_right_width.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_right_width.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; border-right-width: 0;} .one {border-right-width: 25px; border-style: solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_right_width_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_right_width_inline.html index ab159dd..b2bcd58f 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_right_width_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_right_width_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border-right-width: 25px; border-style: solid;} .two {border-right-width: thin; border-style: solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_style.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_style.html index faa3535..0d7d3bd 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_style.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_style.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border-style: dotted; border-color: black; border-width: thick;} .two {border-style: dashed; border-color: black; border-width: thick;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_style_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_style_inline.html index d665fa05..de404c0 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_style_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_style_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border-style: dashed; border-color: black; border-width: thick;} .two {border-style: groove; border-color: red; border-width: thick;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_top.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_top.html index 57fedcf..0ab3d22 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_top.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_top.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border-top: purple double 10px;} .two {border-top: purple thin solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_top_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_top_inline.html index de133c1..9e3d1b3 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_top_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_top_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border-top: purple double 10px;} .two {border-top: purple thin solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_top_width.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_top_width.html index 14533d2a..480b081f 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_top_width.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_top_width.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; border-top-width: 0;} .one {border-top-width: 25px; border-style: solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_top_width_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_top_width_inline.html index d47809a7..6bb0936d 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_top_width_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_top_width_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border-top-width: 25px; border-style: solid;} .two {border-top-width: thin; border-style: solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_width.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_width.html index 889247f..cde41db 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_width.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_width.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; border-width: 0;} .one {border-width: 50px; border-style: solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/border_width_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/border_width_inline.html index 9ceb5bd..5a4d6e5 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/border_width_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/border_width_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {border-width: 25px; border-style: solid;} .two {border-width: thin; border-style: solid;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/clear.html b/third_party/WebKit/LayoutTests/css1/box_properties/clear.html index acbc21d..c13adf2 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/clear.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/clear.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {clear: left;} .two {clear: right;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/clear_float.html b/third_party/WebKit/LayoutTests/css1/box_properties/clear_float.html index 3556387..7638b5e5 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/clear_float.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/clear_float.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> body {overflow: hidden;} P { margin: 0; padding: 0; text-align: justify;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/float.html b/third_party/WebKit/LayoutTests/css1/box_properties/float.html index 45824a9b..5830e9b 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/float.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/float.html
@@ -4,6 +4,7 @@ <meta http-equiv="Content-Style-Type" content="text/css"> <link rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<script src="../resources/base.js"></script> <style type="text/css"> .one {float: left;} .two {float: right;} @@ -41,4 +42,4 @@ <p> This text should be flowing past a tall orange rectangle on the right side of the browser window. In this case, it is the image which has been floated to the right. </p> -</td></tr></tbody></table></body></html> \ No newline at end of file +</td></tr></tbody></table></body></html>
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/float_elements_in_series.html b/third_party/WebKit/LayoutTests/css1/box_properties/float_elements_in_series.html index 500ff02..481cee8 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/float_elements_in_series.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/float_elements_in_series.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P { margin: 0; padding: 0; text-align: justify;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/float_margin.html b/third_party/WebKit/LayoutTests/css1/box_properties/float_margin.html index d02a7e2..460322cd 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/float_margin.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/float_margin.html
@@ -4,6 +4,7 @@ <meta http-equiv="Content-Style-Type" content="text/css"> <link rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<script src="../resources/base.js"></script> <style type="text/css"> P.test {background: white; font-size: 20px; margin-left: 30px; margin-right: 10px; padding: 0; border: 0;} @@ -129,4 +130,4 @@ the image. This paragraph should have a white background, first of all, which extends to the edges of the element's box. There is no padding set on this paragraph whatsoever. </p> -</td></tr></tbody></table></body></html> \ No newline at end of file +</td></tr></tbody></table></body></html>
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/float_on_text_elements.html b/third_party/WebKit/LayoutTests/css1/box_properties/float_on_text_elements.html index 7099af91..a2d75eb 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/float_on_text_elements.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/float_on_text_elements.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P { margin: 0; padding: 0; text-align: justify;} .one {float: left; width: 50%; background-color: yellow; padding: 0; margin: 0;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/height.html b/third_party/WebKit/LayoutTests/css1/box_properties/height.html index 931777a..17f6eff 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/height.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/height.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {height: 50px;} .two {height: 100px;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/margin.html b/third_party/WebKit/LayoutTests/css1/box_properties/margin.html index 7288f216..9aada16 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/margin.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/margin.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> body {overflow: hidden;} .zero {background-color: silver; margin: 0;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/margin_bottom.html b/third_party/WebKit/LayoutTests/css1/box_properties/margin_bottom.html index fca5b856..90277de 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/margin_bottom.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/margin_bottom.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; margin-bottom: 0;} .one {margin-bottom: 0.5in; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/margin_bottom_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/margin_bottom_inline.html index ce7e78a5..85a0b68 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/margin_bottom_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/margin_bottom_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {margin-bottom: 25px; background-color: aqua;} .two {margin-bottom: -10px; background-color: aqua;}</STYLE>
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/margin_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/margin_inline.html index 452dc958..23ed2e30 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/margin_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/margin_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> body {overflow: hidden;} .zero {background-color: silver; margin: 0;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/margin_left.html b/third_party/WebKit/LayoutTests/css1/box_properties/margin_left.html index c646405..9b056712f 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/margin_left.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/margin_left.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; margin-left: 0;} .one {margin-left: 0.5in; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/margin_left_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/margin_left_inline.html index 34d1b2e..fed341982 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/margin_left_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/margin_left_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {margin-left: 25px; background-color: aqua;} .two {margin-left: -10px; background-color: aqua;}</STYLE>
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/margin_right.html b/third_party/WebKit/LayoutTests/css1/box_properties/margin_right.html index 7fe4233..2f2676ce 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/margin_right.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/margin_right.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> body {overflow: hidden;} .zero {background-color: silver; margin-right: 0; text-align: right;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/margin_right_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/margin_right_inline.html index 3e812b5f..6bff9c45 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/margin_right_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/margin_right_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {margin-right: 25px; text-align: right; background-color: aqua;} .two {margin-right: -10px; background-color: aqua;}</STYLE>
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/margin_top.html b/third_party/WebKit/LayoutTests/css1/box_properties/margin_top.html index 2af0b78a..466305b 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/margin_top.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/margin_top.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; margin-top: 0;} .one {margin-top: 0.5in; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/margin_top_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/margin_top_inline.html index 3de5d8c..b597ef11 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/margin_top_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/margin_top_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; margin-top: 0;} .one {margin-top: 25px; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/padding.html b/third_party/WebKit/LayoutTests/css1/box_properties/padding.html index dbc9757..4c24cf9 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/padding.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/padding.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; padding: 0;} .one {padding: 0.5in; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/padding_bottom.html b/third_party/WebKit/LayoutTests/css1/box_properties/padding_bottom.html index a689c60..096b16a9 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/padding_bottom.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/padding_bottom.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; padding-bottom: 0;} .one {padding-bottom: 0.5in; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/padding_bottom_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/padding_bottom_inline.html index 8e4cedc..ec36d5e 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/padding_bottom_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/padding_bottom_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {padding-bottom: 25px; background-color: aqua;} .two {padding-bottom: -10px; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/padding_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/padding_inline.html index aaa1403..6daa56a 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/padding_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/padding_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; padding: 0;} .one {padding: 25px; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/padding_left.html b/third_party/WebKit/LayoutTests/css1/box_properties/padding_left.html index c9f8b4d..b3bb98a 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/padding_left.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/padding_left.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; padding-left: 0;} .one {padding-left: 0.5in; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/padding_left_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/padding_left_inline.html index 8c3347c..d9909d8 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/padding_left_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/padding_left_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {padding-left: 25px; background-color: aqua;} .two {padding-left: -10px; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/padding_right.html b/third_party/WebKit/LayoutTests/css1/box_properties/padding_right.html index 2bcb33c..be14b52 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/padding_right.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/padding_right.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; padding-right: 0;} .one {padding-right: 0.5in; text-align: right; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/padding_right_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/padding_right_inline.html index 1d6bdfb..898aab8 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/padding_right_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/padding_right_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {padding-right: 25px; text-align: right; background-color: aqua;} .two {padding-right: -10px; text-align: right; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/padding_top.html b/third_party/WebKit/LayoutTests/css1/box_properties/padding_top.html index 401995f5..df8131f 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/padding_top.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/padding_top.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {background-color: silver; padding-top: 0;} .one {padding-top: 0.5in; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/padding_top_inline.html b/third_party/WebKit/LayoutTests/css1/box_properties/padding_top_inline.html index c8ffaffa..fb0f349 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/padding_top_inline.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/padding_top_inline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {padding-top: 25px; background-color: aqua;} .two {padding-top: -10px; background-color: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/box_properties/width.html b/third_party/WebKit/LayoutTests/css1/box_properties/width.html index 5c799b3..1d58942e 100644 --- a/third_party/WebKit/LayoutTests/css1/box_properties/width.html +++ b/third_party/WebKit/LayoutTests/css1/box_properties/width.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {width: 50px;} .two {width: 50%;}
diff --git a/third_party/WebKit/LayoutTests/css1/cascade/cascade_order.html b/third_party/WebKit/LayoutTests/css1/cascade/cascade_order.html index dd33132..15562c4 100644 --- a/third_party/WebKit/LayoutTests/css1/cascade/cascade_order.html +++ b/third_party/WebKit/LayoutTests/css1/cascade/cascade_order.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <LINK rel="stylesheet" type="text/css" HREF="../resources/linktest.css"> <STYLE type="text/css"> LI {color: purple;}
diff --git a/third_party/WebKit/LayoutTests/css1/cascade/important.html b/third_party/WebKit/LayoutTests/css1/cascade/important.html index b57b5d5..7272af5 100644 --- a/third_party/WebKit/LayoutTests/css1/cascade/important.html +++ b/third_party/WebKit/LayoutTests/css1/cascade/important.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P {color: green ! important;} P {color: red;}
diff --git a/third_party/WebKit/LayoutTests/css1/classification/display.html b/third_party/WebKit/LayoutTests/css1/classification/display.html index a6a36d2..66a41cd 100644 --- a/third_party/WebKit/LayoutTests/css1/classification/display.html +++ b/third_party/WebKit/LayoutTests/css1/classification/display.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {display: block;} .two {display: inline;}
diff --git a/third_party/WebKit/LayoutTests/css1/classification/list_style.html b/third_party/WebKit/LayoutTests/css1/classification/list_style.html index 8729067..488bc4c 100644 --- a/third_party/WebKit/LayoutTests/css1/classification/list_style.html +++ b/third_party/WebKit/LayoutTests/css1/classification/list_style.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {list-style: upper-alpha inside;} .two {list-style: url(../resources/oransqr.gif) disc outside;}</STYLE>
diff --git a/third_party/WebKit/LayoutTests/css1/classification/list_style_image.html b/third_party/WebKit/LayoutTests/css1/classification/list_style_image.html index 443de35..591479c 100644 --- a/third_party/WebKit/LayoutTests/css1/classification/list_style_image.html +++ b/third_party/WebKit/LayoutTests/css1/classification/list_style_image.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {list-style-image: url(../resources/oransqr.gif);} .two {list-style-image: none;}
diff --git a/third_party/WebKit/LayoutTests/css1/classification/list_style_position.html b/third_party/WebKit/LayoutTests/css1/classification/list_style_position.html index 1788524..e3dfa6d 100644 --- a/third_party/WebKit/LayoutTests/css1/classification/list_style_position.html +++ b/third_party/WebKit/LayoutTests/css1/classification/list_style_position.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {list-style-position: outside;} .two {list-style-position: inside;}
diff --git a/third_party/WebKit/LayoutTests/css1/classification/list_style_type.html b/third_party/WebKit/LayoutTests/css1/classification/list_style_type.html index 4ad82eb..76a8f83 100644 --- a/third_party/WebKit/LayoutTests/css1/classification/list_style_type.html +++ b/third_party/WebKit/LayoutTests/css1/classification/list_style_type.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {list-style-type: disc;} .two {list-style-type: circle;}
diff --git a/third_party/WebKit/LayoutTests/css1/classification/white_space.html b/third_party/WebKit/LayoutTests/css1/classification/white_space.html index a53e238..7c98ad8 100644 --- a/third_party/WebKit/LayoutTests/css1/classification/white_space.html +++ b/third_party/WebKit/LayoutTests/css1/classification/white_space.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> body {overflow: hidden;} .one {white-space: pre;}
diff --git a/third_party/WebKit/LayoutTests/css1/color_and_background/background.html b/third_party/WebKit/LayoutTests/css1/color_and_background/background.html index fbd38ed..8a518789 100644 --- a/third_party/WebKit/LayoutTests/css1/color_and_background/background.html +++ b/third_party/WebKit/LayoutTests/css1/color_and_background/background.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> BODY {background: green url(../resources/oransqr.gif) repeat-x center top fixed;} .one {background: lime url(../resources/oransqr.gif) repeat-y 100% 0%;}
diff --git a/third_party/WebKit/LayoutTests/css1/color_and_background/background_attachment.html b/third_party/WebKit/LayoutTests/css1/color_and_background/background_attachment.html index 90f6521..b3c136f 100644 --- a/third_party/WebKit/LayoutTests/css1/color_and_background/background_attachment.html +++ b/third_party/WebKit/LayoutTests/css1/color_and_background/background_attachment.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> BODY { background-image: url(../resources/bg.gif);
diff --git a/third_party/WebKit/LayoutTests/css1/color_and_background/background_color.html b/third_party/WebKit/LayoutTests/css1/color_and_background/background_color.html index 56a3a44a..a313c36a 100644 --- a/third_party/WebKit/LayoutTests/css1/color_and_background/background_color.html +++ b/third_party/WebKit/LayoutTests/css1/color_and_background/background_color.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P {background-color: green;} .one {background-color: lime;}
diff --git a/third_party/WebKit/LayoutTests/css1/color_and_background/background_image.html b/third_party/WebKit/LayoutTests/css1/color_and_background/background_image.html index 048001ea..812cc51 100644 --- a/third_party/WebKit/LayoutTests/css1/color_and_background/background_image.html +++ b/third_party/WebKit/LayoutTests/css1/color_and_background/background_image.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P {background-image: url(../resources/bg.gif);} .one {background-image: none;}
diff --git a/third_party/WebKit/LayoutTests/css1/color_and_background/background_position.html b/third_party/WebKit/LayoutTests/css1/color_and_background/background_position.html index af418e3d..45a67d6 100644 --- a/third_party/WebKit/LayoutTests/css1/color_and_background/background_position.html +++ b/third_party/WebKit/LayoutTests/css1/color_and_background/background_position.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> BODY {background-image: url(../resources/bg.gif); background-position: right top; background-repeat: no-repeat;}
diff --git a/third_party/WebKit/LayoutTests/css1/color_and_background/background_repeat.html b/third_party/WebKit/LayoutTests/css1/color_and_background/background_repeat.html index 5bba68c..a938494 100644 --- a/third_party/WebKit/LayoutTests/css1/color_and_background/background_repeat.html +++ b/third_party/WebKit/LayoutTests/css1/color_and_background/background_repeat.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> body {overflow: hidden;} .one {background-image: url(../resources/oransqr.gif); background-repeat: repeat-y;}
diff --git a/third_party/WebKit/LayoutTests/css1/color_and_background/color.html b/third_party/WebKit/LayoutTests/css1/color_and_background/color.html index 8a7963d5..eab46f5 100644 --- a/third_party/WebKit/LayoutTests/css1/color_and_background/color.html +++ b/third_party/WebKit/LayoutTests/css1/color_and_background/color.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {color: green;} </STYLE>
diff --git a/third_party/WebKit/LayoutTests/css1/conformance/forward_compatible_parsing.html b/third_party/WebKit/LayoutTests/css1/conformance/forward_compatible_parsing.html index 72967ef..dd44177 100644 --- a/third_party/WebKit/LayoutTests/css1/conformance/forward_compatible_parsing.html +++ b/third_party/WebKit/LayoutTests/css1/conformance/forward_compatible_parsing.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P.one {color: green; rotation: 70deg;} P.oneb {color: green;}
diff --git a/third_party/WebKit/LayoutTests/css1/font_properties/font.html b/third_party/WebKit/LayoutTests/css1/font_properties/font.html index 596b57a..f3b4326 100644 --- a/third_party/WebKit/LayoutTests/css1/font_properties/font.html +++ b/third_party/WebKit/LayoutTests/css1/font_properties/font.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> BODY {font-size: 12px;} .one {font: italic small-caps 13pt Helvetica;}
diff --git a/third_party/WebKit/LayoutTests/css1/font_properties/font_family.html b/third_party/WebKit/LayoutTests/css1/font_properties/font_family.html index 09ff556..24f2f65 100644 --- a/third_party/WebKit/LayoutTests/css1/font_properties/font_family.html +++ b/third_party/WebKit/LayoutTests/css1/font_properties/font_family.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> DIV.a {font-family: serif;} DIV.b {font-family: monospace;}
diff --git a/third_party/WebKit/LayoutTests/css1/font_properties/font_size.html b/third_party/WebKit/LayoutTests/css1/font_properties/font_size.html index d85235cd..9523d5a 100644 --- a/third_party/WebKit/LayoutTests/css1/font_properties/font_size.html +++ b/third_party/WebKit/LayoutTests/css1/font_properties/font_size.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {font-size: medium;} .two {font-size: larger;}
diff --git a/third_party/WebKit/LayoutTests/css1/font_properties/font_style.html b/third_party/WebKit/LayoutTests/css1/font_properties/font_style.html index 49711f5..eb5646d 100644 --- a/third_party/WebKit/LayoutTests/css1/font_properties/font_style.html +++ b/third_party/WebKit/LayoutTests/css1/font_properties/font_style.html
@@ -4,6 +4,7 @@ <meta http-equiv="Content-Style-Type" content="text/css"> <link rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <style type="text/css"> .one {font-style: italic;} .two {font-style: oblique;} @@ -43,4 +44,4 @@ <p> <i>This paragraph should be normal.</i> </p> -</td></tr></tbody></table></body></html> \ No newline at end of file +</td></tr></tbody></table></body></html>
diff --git a/third_party/WebKit/LayoutTests/css1/font_properties/font_variant.html b/third_party/WebKit/LayoutTests/css1/font_properties/font_variant.html index 3a3e383..1de2b29 100644 --- a/third_party/WebKit/LayoutTests/css1/font_properties/font_variant.html +++ b/third_party/WebKit/LayoutTests/css1/font_properties/font_variant.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {font-variant: small-caps;} .two {font-variant: normal;}
diff --git a/third_party/WebKit/LayoutTests/css1/font_properties/font_weight.html b/third_party/WebKit/LayoutTests/css1/font_properties/font_weight.html index 8dbc4c4..dd197694 100644 --- a/third_party/WebKit/LayoutTests/css1/font_properties/font_weight.html +++ b/third_party/WebKit/LayoutTests/css1/font_properties/font_weight.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {font-weight: bold;} .two {font-weight: bolder;}
diff --git a/third_party/WebKit/LayoutTests/css1/formatting_model/canvas.html b/third_party/WebKit/LayoutTests/css1/formatting_model/canvas.html index 54d43d93a..6864f554 100644 --- a/third_party/WebKit/LayoutTests/css1/formatting_model/canvas.html +++ b/third_party/WebKit/LayoutTests/css1/formatting_model/canvas.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> HTML {background-color: aqua;} BODY {background-color: green; background-image: none; margin: 25px;}</STYLE>
diff --git a/third_party/WebKit/LayoutTests/css1/formatting_model/floating_elements.html b/third_party/WebKit/LayoutTests/css1/formatting_model/floating_elements.html index f9ad0dd..cacddab 100644 --- a/third_party/WebKit/LayoutTests/css1/formatting_model/floating_elements.html +++ b/third_party/WebKit/LayoutTests/css1/formatting_model/floating_elements.html
@@ -4,6 +4,7 @@ <meta http-equiv="Content-Style-Type" content="text/css"> <link rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<script src="../resources/base.js"></script> <style type="text/css"> HR.minor {clear: both; width: 5%;} HR.major {clear: both; width: 75%; margin: 1.5em;} @@ -391,4 +392,4 @@ before text which precedes it in the source document. </div> <hr class="major"> -</td></tr></tbody></table></body></html> \ No newline at end of file +</td></tr></tbody></table></body></html>
diff --git a/third_party/WebKit/LayoutTests/css1/formatting_model/height_of_lines.html b/third_party/WebKit/LayoutTests/css1/formatting_model/height_of_lines.html index c62b8ca..2d5878a5 100644 --- a/third_party/WebKit/LayoutTests/css1/formatting_model/height_of_lines.html +++ b/third_party/WebKit/LayoutTests/css1/formatting_model/height_of_lines.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P.one {font-size: 14px; line-height: 20px;} IMG.onea {vertical-align: text-bottom;
diff --git a/third_party/WebKit/LayoutTests/css1/formatting_model/horizontal_formatting.html b/third_party/WebKit/LayoutTests/css1/formatting_model/horizontal_formatting.html index 99eef1b..b619817 100644 --- a/third_party/WebKit/LayoutTests/css1/formatting_model/horizontal_formatting.html +++ b/third_party/WebKit/LayoutTests/css1/formatting_model/horizontal_formatting.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> body {overflow: hidden;} .ruler {padding: 0px; margin: 0px; border-width: 0px;}
diff --git a/third_party/WebKit/LayoutTests/css1/formatting_model/inline_elements.html b/third_party/WebKit/LayoutTests/css1/formatting_model/inline_elements.html index 90d0c63..77b29cae 100644 --- a/third_party/WebKit/LayoutTests/css1/formatting_model/inline_elements.html +++ b/third_party/WebKit/LayoutTests/css1/formatting_model/inline_elements.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P.one {line-height: 200%;} SPAN.two {border-style: solid; border-width: 10px; border-color: red;
diff --git a/third_party/WebKit/LayoutTests/css1/formatting_model/replaced_elements.html b/third_party/WebKit/LayoutTests/css1/formatting_model/replaced_elements.html index 3a9066e..08243dd 100644 --- a/third_party/WebKit/LayoutTests/css1/formatting_model/replaced_elements.html +++ b/third_party/WebKit/LayoutTests/css1/formatting_model/replaced_elements.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> IMG.one {display: inline;} IMG.two {display: block;}
diff --git a/third_party/WebKit/LayoutTests/css1/formatting_model/vertical_formatting.html b/third_party/WebKit/LayoutTests/css1/formatting_model/vertical_formatting.html index bfdadf0..f72dbb9 100644 --- a/third_party/WebKit/LayoutTests/css1/formatting_model/vertical_formatting.html +++ b/third_party/WebKit/LayoutTests/css1/formatting_model/vertical_formatting.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P.one {margin-bottom: 2cm; padding-bottom: 0;} P.two {margin-top: 2cm; padding-top: 0;}
diff --git a/third_party/WebKit/LayoutTests/css1/pseudo/anchor.html b/third_party/WebKit/LayoutTests/css1/pseudo/anchor.html index cb28b52..993696e 100644 --- a/third_party/WebKit/LayoutTests/css1/pseudo/anchor.html +++ b/third_party/WebKit/LayoutTests/css1/pseudo/anchor.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> A {color: green;} A:link {color: purple;}
diff --git a/third_party/WebKit/LayoutTests/css1/pseudo/firstletter.html b/third_party/WebKit/LayoutTests/css1/pseudo/firstletter.html index 9557666..4ab7c8d1 100644 --- a/third_party/WebKit/LayoutTests/css1/pseudo/firstletter.html +++ b/third_party/WebKit/LayoutTests/css1/pseudo/firstletter.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P:first-letter {color: maroon;} .two:first-letter {font-size: 200%;}
diff --git a/third_party/WebKit/LayoutTests/css1/pseudo/firstline.html b/third_party/WebKit/LayoutTests/css1/pseudo/firstline.html index e4ec069c..b02775b 100644 --- a/third_party/WebKit/LayoutTests/css1/pseudo/firstline.html +++ b/third_party/WebKit/LayoutTests/css1/pseudo/firstline.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P:first-line {color: green;} .two:first-line {font-size: 200%;}
diff --git a/third_party/WebKit/LayoutTests/css1/pseudo/multiple_pseudo_elements.html b/third_party/WebKit/LayoutTests/css1/pseudo/multiple_pseudo_elements.html index 2500550e..40eeea7 100644 --- a/third_party/WebKit/LayoutTests/css1/pseudo/multiple_pseudo_elements.html +++ b/third_party/WebKit/LayoutTests/css1/pseudo/multiple_pseudo_elements.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P:first-line {color: green;} P:first-letter {color: maroon;}
diff --git a/third_party/WebKit/LayoutTests/css1/pseudo/pseudo_elements_in_selectors.html b/third_party/WebKit/LayoutTests/css1/pseudo/pseudo_elements_in_selectors.html index e0c55f0..9fbf2c9 100644 --- a/third_party/WebKit/LayoutTests/css1/pseudo/pseudo_elements_in_selectors.html +++ b/third_party/WebKit/LayoutTests/css1/pseudo/pseudo_elements_in_selectors.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P:first-line {font-weight: bold;} P.two:first-line {color: green;}
diff --git a/third_party/WebKit/LayoutTests/css1/resources/base.js b/third_party/WebKit/LayoutTests/css1/resources/base.js new file mode 100644 index 0000000..af2d8bc --- /dev/null +++ b/third_party/WebKit/LayoutTests/css1/resources/base.js
@@ -0,0 +1,17 @@ +if (window.testRunner) { + // This is a workaroud for an issue that the load event may be dispatched + // before loading ../resources/basebg.gif which is linked from + // ../resources/base.css. + testRunner.waitUntilDone(); + window.addEventListener('load', () => { + const id = setInterval(() => { + // Force layout. + document.body.offsetTop; + if (internals.isLoading('../resources/basebg.gif')) + return; + + clearInterval(id); + testRunner.notifyDone(); + }, 50); + }); +}
diff --git a/third_party/WebKit/LayoutTests/css1/text_properties/letter_spacing.html b/third_party/WebKit/LayoutTests/css1/text_properties/letter_spacing.html index 8b3fbc796..addb2e45 100644 --- a/third_party/WebKit/LayoutTests/css1/text_properties/letter_spacing.html +++ b/third_party/WebKit/LayoutTests/css1/text_properties/letter_spacing.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {letter-spacing: 0.3in;} .two {letter-spacing: 0.5cm;}
diff --git a/third_party/WebKit/LayoutTests/css1/text_properties/line_height.html b/third_party/WebKit/LayoutTests/css1/text_properties/line_height.html index 5744685..9aceead 100644 --- a/third_party/WebKit/LayoutTests/css1/text_properties/line_height.html +++ b/third_party/WebKit/LayoutTests/css1/text_properties/line_height.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {line-height: 0.5in; font-size: 12px;} .two {line-height: 2cm; font-size: 12px;}
diff --git a/third_party/WebKit/LayoutTests/css1/text_properties/text_align.html b/third_party/WebKit/LayoutTests/css1/text_properties/text_align.html index c1fde75..f8be29c 100644 --- a/third_party/WebKit/LayoutTests/css1/text_properties/text_align.html +++ b/third_party/WebKit/LayoutTests/css1/text_properties/text_align.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {text-align: left;} .two {text-align: right;}
diff --git a/third_party/WebKit/LayoutTests/css1/text_properties/text_decoration.html b/third_party/WebKit/LayoutTests/css1/text_properties/text_decoration.html index d95c6f5..935cf4b 100644 --- a/third_party/WebKit/LayoutTests/css1/text_properties/text_decoration.html +++ b/third_party/WebKit/LayoutTests/css1/text_properties/text_decoration.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {text-decoration: underline;} .two {text-decoration: overline;}
diff --git a/third_party/WebKit/LayoutTests/css1/text_properties/text_indent.html b/third_party/WebKit/LayoutTests/css1/text_properties/text_indent.html index 16e5990..21e16952 100644 --- a/third_party/WebKit/LayoutTests/css1/text_properties/text_indent.html +++ b/third_party/WebKit/LayoutTests/css1/text_properties/text_indent.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {text-indent: 0.5in; background: aqua;} .two {text-indent: 2cm; background: aqua;}
diff --git a/third_party/WebKit/LayoutTests/css1/text_properties/text_transform.html b/third_party/WebKit/LayoutTests/css1/text_properties/text_transform.html index 08bf26d..4c018a8 100644 --- a/third_party/WebKit/LayoutTests/css1/text_properties/text_transform.html +++ b/third_party/WebKit/LayoutTests/css1/text_properties/text_transform.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .ttn {text-transform: none;} .cap {text-transform: capitalize;}
diff --git a/third_party/WebKit/LayoutTests/css1/text_properties/vertical_align.html b/third_party/WebKit/LayoutTests/css1/text_properties/vertical_align.html index 8092e9b..3dc6262 100644 --- a/third_party/WebKit/LayoutTests/css1/text_properties/vertical_align.html +++ b/third_party/WebKit/LayoutTests/css1/text_properties/vertical_align.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> P {font-size: 12pt;} .one {vertical-align: sub;}
diff --git a/third_party/WebKit/LayoutTests/css1/text_properties/word_spacing.html b/third_party/WebKit/LayoutTests/css1/text_properties/word_spacing.html index a1d7079..033c61c2 100644 --- a/third_party/WebKit/LayoutTests/css1/text_properties/word_spacing.html +++ b/third_party/WebKit/LayoutTests/css1/text_properties/word_spacing.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .one {word-spacing: 0.3in;} .two {word-spacing: 0.5cm;}
diff --git a/third_party/WebKit/LayoutTests/css1/units/color_units.html b/third_party/WebKit/LayoutTests/css1/units/color_units.html index f847243e..088f8c7 100644 --- a/third_party/WebKit/LayoutTests/css1/units/color_units.html +++ b/third_party/WebKit/LayoutTests/css1/units/color_units.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> BODY {color: black;} .one {color: #080;}
diff --git a/third_party/WebKit/LayoutTests/css1/units/length_units.html b/third_party/WebKit/LayoutTests/css1/units/length_units.html index af6972f..4e0a5a2 100644 --- a/third_party/WebKit/LayoutTests/css1/units/length_units.html +++ b/third_party/WebKit/LayoutTests/css1/units/length_units.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero {margin-left: 0;} .one {margin-left: 3em;}
diff --git a/third_party/WebKit/LayoutTests/css1/units/percentage_units.html b/third_party/WebKit/LayoutTests/css1/units/percentage_units.html index 78f2745f..1ecb5a22 100644 --- a/third_party/WebKit/LayoutTests/css1/units/percentage_units.html +++ b/third_party/WebKit/LayoutTests/css1/units/percentage_units.html
@@ -6,6 +6,7 @@ <META http-equiv="Content-Style-Type" content="text/css"> <LINK rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<SCRIPT src="../resources/base.js"></SCRIPT> <STYLE type="text/css"> .zero { background: yellow } .one { margin-left: 25%; margin-right: 25%; background: white }
diff --git a/third_party/WebKit/LayoutTests/css1/units/urls.html b/third_party/WebKit/LayoutTests/css1/units/urls.html index e94890c..cd87407 100644 --- a/third_party/WebKit/LayoutTests/css1/units/urls.html +++ b/third_party/WebKit/LayoutTests/css1/units/urls.html
@@ -4,6 +4,7 @@ <meta http-equiv="Content-Style-Type" content="text/css"> <link rel="stylesheet" type="text/css" media="screen" href="../resources/base.css"> +<script src="../resources/base.js"></script> <link rel="stylesheet" type="text/css" media="screen" href="../resources/sec64.css"> <style type="text/css"> @import url(../resources/sec642.css); @@ -51,4 +52,4 @@ square-- or, indeed, any red at all-- is seen there, then the browser has incorrectly interpreted a URL in relation to the document's URL, not the stylesheet's URL. </p> -</td></tr></tbody></table></body></html> \ No newline at end of file +</td></tr></tbody></table></body></html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/headers.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/headers.js index d9af65c..7c36bb3 100644 --- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/headers.js +++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/headers.js
@@ -136,7 +136,7 @@ headers.append('X-FETCH-TEST-2', 'response test field - append'); assert_equals(size(headers), 5, 'headers size should increase by 1.'); assert_equals(headers.get('X-FETCH-Test'), - 'response test field - updated', + 'response test field - updated,response test field - append', 'the value of the first header added should be returned.'); allValues = headers.getAll('X-FETch-TEST'); assert_equals(allValues.length, 2); @@ -156,7 +156,7 @@ headers = new Headers([['a', 'b'], ['c', 'd'], ['c', 'e']]); assert_equals(size(headers), 2, 'headers size should match'); assert_equals(headers.get('a'), 'b'); - assert_equals(headers.get('c'), 'd'); + assert_equals(headers.get('c'), 'd,e'); assert_equals(headers.getAll('c')[0], 'd'); assert_equals(headers.getAll('c')[1], 'e'); @@ -164,13 +164,25 @@ var headers2 = new Headers(headers); assert_equals(size(headers2), 2, 'headers size should match'); assert_equals(headers2.get('a'), 'b'); - assert_equals(headers2.get('c'), 'd'); + assert_equals(headers2.get('c'), 'd,e'); assert_equals(headers2.getAll('c')[0], 'd'); assert_equals(headers2.getAll('c')[1], 'e'); headers.set('a', 'x'); assert_equals(headers.get('a'), 'x'); assert_equals(headers2.get('a'), 'b'); + var headers3 = new Headers(); + headers3.append('test', 'a'); + headers3.append('test', ''); + headers3.append('test', 'b'); + assert_equals(headers3.get('test'), 'a,,b'); + headers3.set('test', ''); + assert_equals(headers3.get('test'), ''); + + var headers4 = new Headers(); + headers4.append('foo', ''); + headers4.append('foo', 'a'); + assert_equals(headers4.get('foo'), ',a'); // new Headers with Dictionary headers = new Headers({'a': 'b', 'c': 'd'}); assert_equals(size(headers), 2, 'headers size should match');
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction-expected.txt b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction-expected.txt index c1bdb260..46e0b02 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction-expected.txt +++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/animation-direction-expected.txt
@@ -24,7 +24,7 @@ FAIL Getting animation-direction when it is set to unset assert_true: result instanceof CSSKeywordValue: expected true got false FAIL getAll for single-valued animation-direction assert_equals: Returned type is incorrect: expected "CSSKeywordValue" but got "CSSStyleValue" FAIL getAll for list-valued animation-direction assert_equals: Expected getAll to return an array containing two instances of CSSStyleValue expected 2 but got 1 -PASS Delete animation-direction removes the value form the styleMap +PASS Delete animation-direction removes the value from the styleMap PASS animation-direction shows up in getProperties FAIL Set animation-direction to a sequence assert_equals: expected "normal, normal" but got "normal normal" PASS Set animation-direction to a sequence containing an invalid type
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/bottom-expected.txt b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/bottom-expected.txt index bdef0da3..1cb38a58 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/bottom-expected.txt +++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/bottom-expected.txt
@@ -25,7 +25,7 @@ PASS Getting bottom with a CSSSimpleLength whose value is 3em FAIL Getting bottom with a CSSCalcLength whose value is calc(10% + 1px) assert_equals: typeof result expected "CSSCalcLength" but got "CSSStyleValue" PASS getAll for single-valued bottom -PASS Delete bottom removes the value form the styleMap +PASS Delete bottom removes the value from the styleMap PASS bottom shows up in getProperties PASS Setting bottom to a sequence throws PASS Appending to bottom throws
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js index a27f676..04551e0 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js +++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js
@@ -7,6 +7,9 @@ * validKeywords: array of strings, * validObjects: array of CSSStyleValue instances that are valid for the * property, + * validStringMappings: object containing a mapping of string to + * CSSStyleValues for things expressable in string CSS, but are expressed + * the same as something else in Typed OM. * supportsMultiple: boolean; whether the property supports a list of * properties, * invalidObjects: array of CSSStyleValue instances that are invalid for the @@ -32,6 +35,8 @@ 'unset' ]); let validObjects = config.validObjects; + let validStringMappings = config.validStringMappings ? + config.validStringMappings : {}; let invalidObjects = config.invalidObjects.concat([ // No properties should take these values null, @@ -49,7 +54,8 @@ let styleMap = element.styleMap; runSetterTests( config.property, validKeywords, validObjects, invalidObjects, element); - runGetterTests(config.property, validKeywords, validObjects, element); + runGetterTests(config.property, validKeywords, validObjects, + validStringMappings, element); runGetAllTests( config.property, validObject, element, config.supportsMultiple); runDeletionTests(config.property, validObject, element); @@ -97,7 +103,7 @@ } function runGetterTests( - propertyName, validKeywords, validObjects, element) { + propertyName, validKeywords, validObjects, validStringMappings, element) { for (let keyword of validKeywords) { test(function() { element.style[propertyName] = keyword; @@ -119,6 +125,18 @@ }, 'Getting ' + propertyName + ' with a ' + validObject.constructor.name + ' whose value is ' + validObject.cssText); } + for (let cssText in validStringMappings) { + test(function() { + element.style[propertyName] = cssText; + + let result = element.styleMap.get(propertyName); + assert_equals(result.constructor.name, + validStringMappings[cssText].constructor.name, + 'typeof result'); + assert_equals(result.cssText, validStringMappings[cssText].cssText); + }, 'Getting ' + propertyName + ' when it is set to "' + + cssText + '" via a string'); + } } function runSequenceSetterTests( @@ -202,9 +220,9 @@ assert_equals(result.length, 2, 'Expected getAll to return an array containing two instances ' + 'of CSSStyleValue'); - assert_true(result[0] instanceof CSSStyleValue, + assert_equals(result[0].constructor, CSSStyleValue, 'Expected first result to be an instance of CSSStyleValue'); - assert_true(result[1] instanceof CSSStyleValue, + assert_equals(result[1].constructor, CSSStyleValue, 'Expected second result to be an instance of CSSStyleValue'); assert_equals(result[0].constructor.name, validObject.constructor.name); assert_equals(result[1].constructor.name, validObject.constructor.name); @@ -223,7 +241,7 @@ element.styleMap.delete(propertyName); assert_equals(element.style[propertyName], ''); assert_equals(element.styleMap.get(propertyName), null); - }, 'Delete ' + propertyName + ' removes the value form the styleMap'); + }, 'Delete ' + propertyName + ' removes the value from the styleMap'); } function runGetPropertiesTests(propertyName, validObject, element) {
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/transform-expected.txt b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/transform-expected.txt index a14b2626..c69cea0b 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/transform-expected.txt +++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/transform-expected.txt
@@ -32,11 +32,24 @@ PASS Getting transform with a CSSTransformValue whose value is rotate3d(1, 2, 3, 10rad) PASS Getting transform with a CSSTransformValue whose value is rotate3d(1, 2, 3, 2grad) PASS Getting transform with a CSSTransformValue whose value is rotate3d(1, 2, 3, 0.2turn) +PASS Getting transform when it is set to "rotateX(45deg)" via a string +PASS Getting transform when it is set to "rotateX(1rad)" via a string +PASS Getting transform when it is set to "rotateX(6.2grad)" via a string +PASS Getting transform when it is set to "rotateX(0.31turn)" via a string +PASS Getting transform when it is set to "rotateY(45deg)" via a string +PASS Getting transform when it is set to "rotateY(1rad)" via a string +PASS Getting transform when it is set to "rotateY(6.2grad)" via a string +PASS Getting transform when it is set to "rotateY(0.31turn)" via a string +PASS Getting transform when it is set to "rotateZ(45deg)" via a string +PASS Getting transform when it is set to "rotateZ(1rad)" via a string +PASS Getting transform when it is set to "rotateZ(6.2grad)" via a string +PASS Getting transform when it is set to "rotateZ(0.31turn)" via a string PASS getAll for single-valued transform -PASS Delete transform removes the value form the styleMap +PASS Delete transform removes the value from the styleMap PASS transform shows up in getProperties PASS Setting transform to a sequence throws PASS Appending to transform throws +PASS Unhandled case doesn't crash. PASS Getting transform when it has a rotate with a calc angle does not crash PASS Getting transform when it has a rotate3d with a calc angle does not crash Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/transform.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/transform.html index e084c82..5b8b1be 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/transform.html +++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/transform.html
@@ -41,10 +41,45 @@ // Perspectives // TODO(meade) ], + // Values with these strings aren't used in Typed OM, but can also be + // represented by the specified values. + validStringMappings: { + // Rotations + 'rotateX(45deg)': + cssTransformWithRotate3D(1, 0, 0, new CSSAngleValue(45, 'deg')), + 'rotateX(1rad)': + cssTransformWithRotate3D(1, 0, 0, new CSSAngleValue(1, 'rad')), + 'rotateX(6.2grad)': + cssTransformWithRotate3D(1, 0, 0, new CSSAngleValue(6.2, 'grad')), + 'rotateX(0.31turn)': + cssTransformWithRotate3D(1, 0, 0, new CSSAngleValue(0.31, 'turn')), + 'rotateY(45deg)': + cssTransformWithRotate3D(0, 1, 0, new CSSAngleValue(45, 'deg')), + 'rotateY(1rad)': + cssTransformWithRotate3D(0, 1, 0, new CSSAngleValue(1, 'rad')), + 'rotateY(6.2grad)': + cssTransformWithRotate3D(0, 1, 0, new CSSAngleValue(6.2, 'grad')), + 'rotateY(0.31turn)': + cssTransformWithRotate3D(0, 1, 0, new CSSAngleValue(0.31, 'turn')), + 'rotateZ(45deg)': + cssTransformWithRotate3D(0, 0, 1, new CSSAngleValue(45, 'deg')), + 'rotateZ(1rad)': + cssTransformWithRotate3D(0, 0, 1, new CSSAngleValue(1, 'rad')), + 'rotateZ(6.2grad)': + cssTransformWithRotate3D(0, 0, 1, new CSSAngleValue(6.2, 'grad')), + 'rotateZ(0.31turn)': + cssTransformWithRotate3D(0, 0, 1, new CSSAngleValue(0.31, 'turn')), + }, supportsMultiple: false, invalidObjects: [new CSSSimpleLength(4, 'px')] }); +// TODO(meade): Remove/update this test once translate is supported. +test(function() { + testElement.style.transform = 'translateY(50px)'; + testElement.styleMap.entries(); +}, "Unhandled case doesn't crash."); + test(function() { testElement.style.transform = 'rotate(calc(45deg + 1rad))'; let result = testElement.styleMap.get('transform');
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/transform-rotation.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/transform-rotation.html deleted file mode 100644 index 08c65b4..0000000 --- a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/transform-rotation.html +++ /dev/null
@@ -1,75 +0,0 @@ -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> - -<div id="testElement"></div> - -<script> - -var EPSILON = 1e-6; // float epsilon - -function validateTransformWithSingleRotation(transform, x, y, z, angle, cssText) { - assert_equals(transform.cssText, cssText); - - // Shouldn't be base StyleValue as for unsupported values. - assert_true(transform instanceof CSSTransformValue); - - var components = [...transform.values()]; - assert_equals(components.length, 1); - assert_true(components[0] instanceof CSSRotation); - assert_equals(components[0].cssText, cssText); - - assert_approx_equals(components[0].angle.degrees, angle, EPSILON); - assert_approx_equals(components[0].x, x, EPSILON); - assert_approx_equals(components[0].y, y, EPSILON); - assert_approx_equals(components[0].z, z, EPSILON); -} - -test(function() { - testElement.style.transform = "rotateX(45deg)"; - validateTransformWithSingleRotation( - testElement.styleMap.get("transform"), - 1, 0, 0, 45, - "rotate3d(1, 0, 0, 45deg)"); -}, "rotateX read from a StyleMap results in a rotate3d"); - -test(function() { - testElement.style.transform = "rotateX(1rad)"; - validateTransformWithSingleRotation( - testElement.styleMap.get("transform"), - 1, 0, 0, 57.29578, - "rotate3d(1, 0, 0, 1rad)"); -}, "rotateX with units other than degrees"); - -test(function() { - testElement.style.transform = "rotateY(80deg)"; - validateTransformWithSingleRotation( - testElement.styleMap.get("transform"), - 0, 1, 0, 80, - "rotate3d(0, 1, 0, 80deg)"); -}, "rotateY read from a StyleMap results in a rotate3d"); - -test(function() { - testElement.style.transform = "rotateY(2grad)"; - validateTransformWithSingleRotation( - testElement.styleMap.get("transform"), - 0, 1, 0, 1.8, - "rotate3d(0, 1, 0, 2grad)"); -}, "rotateY with units other than degrees"); - -test(function() { - testElement.style.transform = "rotateZ(100deg)"; - validateTransformWithSingleRotation( - testElement.styleMap.get("transform"), - 0, 0, 1, 100, - "rotate3d(0, 0, 1, 100deg)"); -}, "rotateZ read from a StyleMap results in a rotate3d"); - -test(function() { - testElement.style.transform = "rotateZ(1turn)"; - validateTransformWithSingleRotation( - testElement.styleMap.get("transform"), - 0, 0, 1, 360, - "rotate3d(0, 0, 1, 1turn)"); -}, "rotateZ with units other than degrees"); - -</script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/transform.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/transform.html deleted file mode 100644 index 49ed32c0..0000000 --- a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/transform.html +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> - -<div id="testElement"></div> - -<script> - -test(function() { - var transform = new CSSTransformValue([new CSSRotation(new CSSAngleValue(20, 'deg'))]); - - assert_equals(testElement.styleMap.get('transform'), null); - - testElement.styleMap.set('transform', transform); - assert_equals(testElement.style.transform, 'rotate(20deg)'); -}, "Setting transform works on a regular element."); - -test(function() { - var transform = new CSSTransformValue([new CSSRotation(new CSSAngleValue(30, 'deg'))]); - - testElement.styleMap.set('transform', transform); - assert_equals(testElement.styleMap.get('transform').cssText, 'rotate(30deg)'); -}, "Getting transform works on a regular element."); - -test(function() { - testElement.style.transform = 'translateY(50px)'; - testElement.styleMap.entries(); -}, "Unhandled case doesn't crash."); - -</script>
diff --git a/third_party/WebKit/LayoutTests/virtual/mojo-loading/css1/README.txt b/third_party/WebKit/LayoutTests/virtual/mojo-loading/css1/README.txt new file mode 100644 index 0000000..1865f21 --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/mojo-loading/css1/README.txt
@@ -0,0 +1,4 @@ +This directory is for testing loading with mojo. + +This directory was added because css1 tests once relied on a unspecified timing +and were broken with mojo-loading.
diff --git a/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp b/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp index b9c7e51..ed38715 100644 --- a/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp +++ b/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp
@@ -191,6 +191,7 @@ DEFINE_TRACE(CSSSegmentedFontFace) { visitor->trace(m_fontSelector); + visitor->trace(m_firstNonCssConnectedFace); visitor->trace(m_fontFaces); }
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h index 7a075a3..05fcb7c 100644 --- a/third_party/WebKit/Source/core/frame/UseCounter.h +++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -1384,6 +1384,7 @@ V8AudioContext_Constructor = 1698, V8OfflineAudioContext_Constructor = 1699, AppInstalledEventAddListener = 1700, + AudioContextGetOutputTimestamp = 1701, // 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/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp b/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp index 7d25134..6044f69 100644 --- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp
@@ -474,8 +474,9 @@ // Convert the visual point to a flow thread point. const MultiColumnFragmentainerGroup& row = fragmentainerGroupAtVisualPoint(point); - LayoutPoint flowThreadPoint = - row.visualPointToFlowThreadPoint(point + row.offsetFromColumnSet()); + LayoutPoint flowThreadPoint = row.visualPointToFlowThreadPoint( + point + row.offsetFromColumnSet(), + MultiColumnFragmentainerGroup::SnapToColumn); // Then drill into the flow thread, where we'll find the actual content. return flowThread()->positionForPoint(flowThreadPoint); }
diff --git a/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp b/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp index 7da5803..4ceb94b 100644 --- a/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp +++ b/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp
@@ -855,6 +855,36 @@ EXPECT_EQ(FloatPoint(10, 120), mappedPoint); } +TEST_P(MapCoordinatesTest, MulticolWithBlockAbove) { + setBodyInnerHTML( + "<div id='container' style='columns:3; column-gap:0; " + "column-fill:auto; width:300px; height:200px;'>" + " <div id='target' style='margin-top:-50px; height:100px;'></div>" + "</div>"); + + LayoutBox* target = toLayoutBox(getLayoutObjectByElementId("target")); + LayoutBox* container = toLayoutBox(getLayoutObjectByElementId("container")); + + FloatPoint mappedPoint = mapLocalToAncestor(target, container, FloatPoint()); + EXPECT_EQ(FloatPoint(0, -50), mappedPoint); + mappedPoint = mapAncestorToLocal(target, container, mappedPoint); + EXPECT_EQ(FloatPoint(), mappedPoint); + + // Walk each ancestor in the chain separately, to verify each step on the way. + LayoutBox* flowThread = target->parentBox(); + ASSERT_TRUE(flowThread->isLayoutFlowThread()); + + mappedPoint = mapLocalToAncestor(target, flowThread, FloatPoint()); + EXPECT_EQ(FloatPoint(0, -50), mappedPoint); + mappedPoint = mapAncestorToLocal(target, flowThread, mappedPoint); + EXPECT_EQ(FloatPoint(), mappedPoint); + + mappedPoint = mapLocalToAncestor(flowThread, container, FloatPoint(0, -50)); + EXPECT_EQ(FloatPoint(0, -50), mappedPoint); + mappedPoint = mapAncestorToLocal(flowThread, container, mappedPoint); + EXPECT_EQ(FloatPoint(0, -50), mappedPoint); +} + TEST_P(MapCoordinatesTest, NestedMulticolWithBlock) { setBodyInnerHTML( "<div id='outerMulticol' style='columns:2; column-gap:0; "
diff --git a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp index d2154a7..ceba040 100644 --- a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp +++ b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp
@@ -181,36 +181,34 @@ } LayoutPoint MultiColumnFragmentainerGroup::visualPointToFlowThreadPoint( - const LayoutPoint& visualPoint) const { + const LayoutPoint& visualPoint, + SnapToColumnPolicy snap) const { unsigned columnIndex = columnIndexAtVisualPoint(visualPoint); LayoutRect columnRect = columnRectAt(columnIndex); LayoutPoint localPoint(visualPoint); localPoint.moveBy(-columnRect.location()); - // Before converting to a flow thread position, if the block direction - // coordinate is outside the column, snap to the bounds of the column, and - // reset the inline direction coordinate to the start position in the column. - // The effect of this is that if the block position is before the column - // rectangle, we'll get to the beginning of this column, while if the block - // position is after the column rectangle, we'll get to the beginning of the - // next column. if (!m_columnSet.isHorizontalWritingMode()) { - LayoutUnit columnStart = m_columnSet.style()->isLeftToRightDirection() - ? LayoutUnit() - : columnRect.height(); - if (localPoint.x() < 0) - localPoint = LayoutPoint(LayoutUnit(), columnStart); - else if (localPoint.x() > logicalHeight()) - localPoint = LayoutPoint(logicalHeight(), columnStart); + if (snap == SnapToColumn) { + LayoutUnit columnStart = m_columnSet.style()->isLeftToRightDirection() + ? LayoutUnit() + : columnRect.height(); + if (localPoint.x() < 0) + localPoint = LayoutPoint(LayoutUnit(), columnStart); + else if (localPoint.x() > logicalHeight()) + localPoint = LayoutPoint(logicalHeight(), columnStart); + } return LayoutPoint(localPoint.x() + logicalTopInFlowThreadAt(columnIndex), localPoint.y()); } - LayoutUnit columnStart = m_columnSet.style()->isLeftToRightDirection() - ? LayoutUnit() - : columnRect.width(); - if (localPoint.y() < 0) - localPoint = LayoutPoint(columnStart, LayoutUnit()); - else if (localPoint.y() > logicalHeight()) - localPoint = LayoutPoint(columnStart, logicalHeight()); + if (snap == SnapToColumn) { + LayoutUnit columnStart = m_columnSet.style()->isLeftToRightDirection() + ? LayoutUnit() + : columnRect.width(); + if (localPoint.y() < 0) + localPoint = LayoutPoint(columnStart, LayoutUnit()); + else if (localPoint.y() > logicalHeight()) + localPoint = LayoutPoint(columnStart, logicalHeight()); + } return LayoutPoint(localPoint.x(), localPoint.y() + logicalTopInFlowThreadAt(columnIndex)); }
diff --git a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h index bb625de..5fdf6402 100644 --- a/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h +++ b/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h
@@ -79,8 +79,21 @@ LayoutBox::PageBoundaryRule, CoordinateSpaceConversion) const; LayoutUnit columnLogicalTopForOffset(LayoutUnit offsetInFlowThread) const; + + // If SnapToColumnPolicy is SnapToColumn, visualPointToFlowThreadPoint() won't + // return points that lie outside the bounds of the columns: Before converting + // to a flow thread position, if the block direction coordinate is outside the + // column, snap to the bounds of the column, and reset the inline direction + // coordinate to the start position in the column. The effect of this is that + // if the block position is before the column rectangle, we'll get to the + // beginning of this column, while if the block position is after the column + // rectangle, we'll get to the beginning of the next column. This is behavior + // that positionForPoint() depends on. + enum SnapToColumnPolicy { DontSnapToColumn, SnapToColumn }; LayoutPoint visualPointToFlowThreadPoint( - const LayoutPoint& visualPoint) const; + const LayoutPoint& visualPoint, + SnapToColumnPolicy = DontSnapToColumn) const; + LayoutRect fragmentsBoundingBox( const LayoutRect& boundingBoxInFlowThread) const;
diff --git a/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp b/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp index ca24581..f87594ea0 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp +++ b/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp
@@ -87,13 +87,20 @@ bool FetchHeaderList::get(const String& name, String& result) const { const String lowercasedName = name.lower(); - for (size_t i = 0; i < m_headerList.size(); ++i) { - if (m_headerList[i]->first == lowercasedName) { - result = m_headerList[i]->second; - return true; + bool found = false; + for (const auto& header : m_headerList) { + if (header->first == lowercasedName) { + if (!found) { + result = ""; + result.append(header->second); + found = true; + } else { + result.append(","); + result.append(header->second); + } } } - return false; + return found; } void FetchHeaderList::getAll(const String& name, Vector<String>& result) const {
diff --git a/third_party/WebKit/Source/modules/fetch/Headers.cpp b/third_party/WebKit/Source/modules/fetch/Headers.cpp index 5511d78..17d2d55 100644 --- a/third_party/WebKit/Source/modules/fetch/Headers.cpp +++ b/third_party/WebKit/Source/modules/fetch/Headers.cpp
@@ -177,8 +177,9 @@ exceptionState.throwTypeError("Invalid name"); return String(); } - // "2. Return the value of the first header in header list whose name is - // |name|, and null otherwise." + // "2. If there is no header in header list whose name is |name|, + // return null." + // "3. Return the combined value given |name| and header list." String result; m_headerList->get(name, result); return result;
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContext.idl b/third_party/WebKit/Source/modules/webaudio/AudioContext.idl index 55ceb77..bd5f9ed7 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioContext.idl +++ b/third_party/WebKit/Source/modules/webaudio/AudioContext.idl
@@ -37,7 +37,7 @@ [MeasureAs=AudioContextClose, CallWith=ScriptState, ImplementedAs=closeContext] Promise<void> close(); // Output timestamp - [CallWith=ScriptState] AudioTimestamp getOutputTimestamp(); + [MeasureAs=AudioContextGetOutputTimestamp, CallWith=ScriptState] AudioTimestamp getOutputTimestamp(); // Sources // TODO(rtoy): The following methods should be here instead of in BaseAudioContext:
diff --git a/third_party/WebKit/Source/platform/heap/HeapAllocator.h b/third_party/WebKit/Source/platform/heap/HeapAllocator.h index 7d23b2c..004de05 100644 --- a/third_party/WebKit/Source/platform/heap/HeapAllocator.h +++ b/third_party/WebKit/Source/platform/heap/HeapAllocator.h
@@ -737,6 +737,26 @@ static const bool value = true; }; +template <typename Set> +struct IsGarbageCollectedType<ListHashSetIterator<Set>> { + static const bool value = IsGarbageCollectedType<Set>::value; +}; + +template <typename Set> +struct IsGarbageCollectedType<ListHashSetConstIterator<Set>> { + static const bool value = IsGarbageCollectedType<Set>::value; +}; + +template <typename Set> +struct IsGarbageCollectedType<ListHashSetReverseIterator<Set>> { + static const bool value = IsGarbageCollectedType<Set>::value; +}; + +template <typename Set> +struct IsGarbageCollectedType<ListHashSetConstReverseIterator<Set>> { + static const bool value = IsGarbageCollectedType<Set>::value; +}; + template <typename T, typename H> struct HandleHashTraits : SimpleClassHashTraits<H> { STATIC_ONLY(HandleHashTraits);
diff --git a/third_party/WebKit/Source/wtf/ListHashSet.h b/third_party/WebKit/Source/wtf/ListHashSet.h index d3bc0ab..b3676a4 100644 --- a/third_party/WebKit/Source/wtf/ListHashSet.h +++ b/third_party/WebKit/Source/wtf/ListHashSet.h
@@ -535,6 +535,11 @@ operator const_iterator() const { return m_iterator; } + template <typename VisitorDispatcher> + void trace(VisitorDispatcher visitor) { + m_iterator.trace(visitor); + } + private: Node* getNode() { return m_iterator.getNode(); } @@ -592,6 +597,12 @@ return m_position != other.m_position; } + template <typename VisitorDispatcher> + void trace(VisitorDispatcher visitor) { + visitor->trace(*m_set); + visitor->trace(m_position); + } + private: Node* getNode() { return m_position; } @@ -646,6 +657,11 @@ operator const_reverse_iterator() const { return m_iterator; } + template <typename VisitorDispatcher> + void trace(VisitorDispatcher visitor) { + m_iterator.trace(visitor); + } + private: Node* getNode() { return m_iterator.node(); } @@ -703,6 +719,12 @@ return m_position != other.m_position; } + template <typename VisitorDispatcher> + void trace(VisitorDispatcher visitor) { + visitor->trace(*m_set); + visitor->trace(m_position); + } + private: Node* getNode() { return m_position; }
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index ff4e704..e3e89d6 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -265,7 +265,23 @@ </summary> </histogram> +<histogram name="Accessibility.ModeFlag" enum="AccessibilityModeFlagEnum"> + <owner>dmazzoni@chromium.org</owner> + <owner>aboxhall@chromium.org</owner> + <summary> + Whether individual accessibility mode flags are set. Tracked when each mode + flag is flipped from false to true. These flags are flipped automatically + when software communicates with Chrome via accessibility APIs. Flags can + only be flipped off by advanced users or for debugging using + chrome://accessibility/ - and that isn't tracked in this histogram. + </summary> +</histogram> + <histogram name="Accessibility.State" enum="BooleanEnabled"> + <obsolete> + Deprecated 12/2016 in Issue 672205 with the addition of + Accessibility.ModeFlag. + </obsolete> <owner>dmazzoni@chromium.org</owner> <owner>kenjibaheux@google.com</owner> <summary> @@ -9385,6 +9401,15 @@ </summary> </histogram> +<histogram name="DataUse.AppTabState" units="bytes"> + <owner>rajendrant@chromium.org</owner> + <owner>bengr@chromium.org</owner> + <summary> + Records the data use of Chrome user traffic by the foregound vs. background + state of the app and tab. + </summary> +</histogram> + <histogram name="DataUse.BackgroundToDataRecievedPerByte" units="ms"> <owner>rajendrant@chromium.org</owner> <owner>bengr@chromium.org</owner> @@ -75334,6 +75359,15 @@ <int value="2" label="ScrolledMainFrameWithUnacceleratedFixedRootBackground"/> </enum> +<enum name="AccessibilityModeFlagEnum" type="int"> + <summary>Track individual accessibility mode flags that are enabled.</summary> + <int value="0" label="Native APIs"/> + <int value="1" label="Web Contents"/> + <int value="2" label="Inline Text Boxes"/> + <int value="3" label="Screen Reader"/> + <int value="4" label="HTML"/> +</enum> + <enum name="AccessibilityWinAPIEnum" type="int"> <summary> Track which Windows accessibility APIs are being called by clients. @@ -87957,6 +87991,7 @@ <int value="1698" label="V8AudioContext_Constructor"/> <int value="1699" label="V8OfflineAudioContext_Constructor"/> <int value="1700" label="AppInstalledEventAddListener"/> + <int value="1701" label="AudioContextGetOutputTimestamp"/> </enum> <enum name="FetchRequestMode" type="int"> @@ -93261,6 +93296,7 @@ <int value="-2143328006" label="enable-fill-on-account-select-no-highlighting"/> <int value="-2143113994" label="enable-ephemeral-apps-in-webstore"/> + <int value="-2134244069" label="HttpFormWarning:enabled"/> <int value="-2132591642" label="enable-input-view"/> <int value="-2122048316" label="DisplayPersistenceToggleInPermissionPrompts:enabled"/> @@ -93317,6 +93353,7 @@ <int value="-1941852572" label="floating-virtual-keyboard"/> <int value="-1940806558" label="enable-syncfs-directory-operation"/> <int value="-1938263248" label="enable-extension-info-dialog"/> + <int value="-1937077699" label="http-form-warning"/> <int value="-1934673791" label="gl-composited-texture-quad-border"/> <int value="-1930720286" label="nacl-debug-mask"/> <int value="-1928198763" label="enable-async-dns"/> @@ -93566,6 +93603,7 @@ <int value="-856915246" label="enable-new-audio-rendering-mixing-strategy"/> <int value="-856016114" label="NTPOfflinePages:disabled"/> <int value="-853594220" label="disable-new-avatar-menu"/> + <int value="-844537521" label="HttpFormWarning:disabled"/> <int value="-842438090" label="enable-md-feedback"/> <int value="-836123854" label="wallet-service-use-sandbox"/> <int value="-835672415" label="PointerEventV1SpecCapturing:disabled"/> @@ -109371,6 +109409,16 @@ <affected-histogram name="DataUsage.ReportSubmission.Bytes"/> </histogram_suffixes> +<histogram_suffixes name="DataUse.AppTabState.Dimensions" separator="."> + <suffix name="Upstream.AppBackground"/> + <suffix name="Upstream.AppForeground.TabBackground"/> + <suffix name="Upstream.AppForeground.TabForeground"/> + <suffix name="Downstream.AppBackground"/> + <suffix name="Downstream.AppForeground.TabBackground"/> + <suffix name="Downstream.AppForeground.TabForeground"/> + <affected-histogram name="DataUse.AppTabState"/> +</histogram_suffixes> + <histogram_suffixes name="DataUse.Bytes" separator="."> <suffix name="Delegate" label="As reported by the network delegate."/> <suffix name="OS" @@ -110047,6 +110095,11 @@ label="Total load time from the moment the Javascript started parsing till the moment the empty file list is displayed."/> <suffix name="Script" label="Time to parse Javascript and CSS."/> + <suffix name="BackgroundScript" + label="Time to initialize backend script to wait for events."/> + <suffix name="BackgroundLaunch" + label="Time from onLaunched event is called to the window is created."/> + <suffix name="BackgroundRestart" label="Time to create a window on restart."/> <affected-histogram name="FileBrowser.Load"/> </histogram_suffixes>
diff --git a/ui/file_manager/file_manager/background/js/background.js b/ui/file_manager/file_manager/background/js/background.js index ee0414d..251150d 100644 --- a/ui/file_manager/file_manager/background/js/background.js +++ b/ui/file_manager/file_manager/background/js/background.js
@@ -462,6 +462,7 @@ * @override */ FileBrowserBackground.prototype.onLaunched_ = function() { + metrics.startInterval('Load.BackgroundLaunch'); this.initializationPromise_.then(function() { if (nextFileManagerWindowID == 0) { // The app just launched. Remove window state records that are not needed @@ -475,7 +476,9 @@ } }); } - launchFileManager(null, undefined, LaunchType.FOCUS_ANY_OR_CREATE); + launchFileManager( + null, undefined, LaunchType.FOCUS_ANY_OR_CREATE, + function() { metrics.recordInterval('Load.BackgroundLaunch'); }); }); }; @@ -507,10 +510,13 @@ if (items.hasOwnProperty(key)) { var match = key.match(FILES_ID_PATTERN); if (match) { + metrics.startInterval('Load.BackgroundRestart'); var id = Number(match[1]); try { var appState = /** @type {Object} */ (JSON.parse(items[key])); - launchFileManager(appState, id); + launchFileManager(appState, id, undefined, function() { + metrics.recordInterval('Load.BackgroundRestart'); + }); } catch (e) { console.error('Corrupt launch data for ' + id); } @@ -626,3 +632,4 @@ * @type {FileBrowserBackground} */ window.background = new FileBrowserBackground(); +metrics.recordInterval('Load.BackgroundScript');
diff --git a/ui/file_manager/file_manager/background/js/background_scripts.js b/ui/file_manager/file_manager/background/js/background_scripts.js index ad94bffa..463a6f7 100644 --- a/ui/file_manager/file_manager/background/js/background_scripts.js +++ b/ui/file_manager/file_manager/background/js/background_scripts.js
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +<include src="metrics_start.js"> <include src="../../common/js/lru_cache.js"> <include src="../../common/js/progress_center_common.js"> <include src="../../common/js/importer_common.js">
diff --git a/ui/file_manager/file_manager/background/js/metrics_start.js b/ui/file_manager/file_manager/background/js/metrics_start.js new file mode 100644 index 0000000..e3f75ca --- /dev/null +++ b/ui/file_manager/file_manager/background/js/metrics_start.js
@@ -0,0 +1,11 @@ +// 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 Metrics calls to start measurement of script loading. Include + * this as the first script in background_scripts.js (i.e. after the common + * scripts that define the metrics namespace). + */ + +metrics.startInterval('Load.BackgroundScript');