diff --git a/DEPS b/DEPS index 39f6eede7..fdfc483 100644 --- a/DEPS +++ b/DEPS
@@ -96,7 +96,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': 'de3ade508f3ff869e7bc63bd6b9a6765afb74774', + 'catapult_revision': '861d4a17413608f1a3f93f3dc503c7d2f3305cfa', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java index 823307d..5f0b8cb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java
@@ -834,7 +834,7 @@ : R.drawable.ic_drive_text_white_36dp; default: return iconSize == ICON_SIZE_24_DP ? R.drawable.ic_drive_file_white_24dp - : R.drawable.ic_drive_text_white_36dp; + : R.drawable.ic_drive_file_white_36dp; } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/VideoFullscreenOrientationLockChromeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/VideoFullscreenOrientationLockChromeTest.java index 063d20e3..e5b63098 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/VideoFullscreenOrientationLockChromeTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/VideoFullscreenOrientationLockChromeTest.java
@@ -44,7 +44,8 @@ @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, ChromeActivityTestRule.DISABLE_NETWORK_PREDICTION_FLAG, MediaSwitches.IGNORE_AUTOPLAY_RESTRICTIONS_FOR_TESTS, - "enable-features=VideoFullscreenOrientationLock"}) + "enable-features=VideoFullscreenOrientationLock", + "disable-features=" + ChromeFeatureList.FULLSCREEN_ACTIVITY}) public class VideoFullscreenOrientationLockChromeTest { @Rule public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java index cb4421c..1a1ad2b 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
@@ -42,6 +42,7 @@ import org.chromium.base.test.util.RetryOnFailure; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; +import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.compositor.bottombar.OverlayContentDelegate; @@ -97,7 +98,8 @@ @RunWith(ChromeJUnit4ClassRunner.class) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, ChromeActivityTestRule.DISABLE_NETWORK_PREDICTION_FLAG, - ContextualSearchFieldTrial.ONLINE_DETECTION_DISABLED}) + ContextualSearchFieldTrial.ONLINE_DETECTION_DISABLED, + "disable-features=" + ChromeFeatureList.FULLSCREEN_ACTIVITY}) @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) @RetryOnFailure public class ContextualSearchManagerTest {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTest.java index 913cd89..239f430 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTest.java
@@ -32,6 +32,7 @@ import org.chromium.base.test.util.RetryOnFailure; import org.chromium.base.test.util.UrlUtils; import org.chromium.chrome.R; +import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager.FullscreenListener; import org.chromium.chrome.browser.omnibox.UrlBar; @@ -62,10 +63,9 @@ * Test suite for verifying the behavior of various fullscreen actions. */ @RunWith(ChromeJUnit4ClassRunner.class) -@CommandLineFlags.Add({ - ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, +@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, ChromeActivityTestRule.DISABLE_NETWORK_PREDICTION_FLAG, -}) + "disable-features=" + ChromeFeatureList.FULLSCREEN_ACTIVITY}) @RetryOnFailure public class FullscreenManagerTest { @Rule
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc index 04a5a00..c173f2e 100644 --- a/chrome/browser/android/chrome_feature_list.cc +++ b/chrome/browser/android/chrome_feature_list.cc
@@ -172,7 +172,7 @@ "DownloadHomeShowStorageInfo", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kFullscreenActivity{"FullscreenActivity", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; // Makes "Add to Home screen" in the app menu generate an APK for the shortcut // URL which opens Chrome in fullscreen.
diff --git a/chrome/browser/autofill/autofill_interactive_uitest.cc b/chrome/browser/autofill/autofill_interactive_uitest.cc index e26e65216..d151972 100644 --- a/chrome/browser/autofill/autofill_interactive_uitest.cc +++ b/chrome/browser/autofill/autofill_interactive_uitest.cc
@@ -647,7 +647,8 @@ } // crbug.com/516052 -#if defined(OS_CHROMEOS) +// Flaky on Windows http://crbug.com/728488 +#if defined(OS_CHROMEOS) || defined(OS_WIN) #define MAYBE_AutofillViaClick DISABLED_AutofillViaClick #else #define MAYBE_AutofillViaClick AutofillViaClick @@ -678,7 +679,14 @@ } // Makes sure that the first click does *not* activate the popup. -IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, DontAutofillForFirstClick) { +// Flaky on Windows http://crbug.com/728488 +#if defined(OS_WIN) +#define MAYBE_DontAutofillForFirstClick DISABLED_DontAutofillForFirstClick +#else +#define MAYBE_DontAutofillForFirstClick DontAutofillForFirstClick +#endif +IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, + MAYBE_DontAutofillForFirstClick) { CreateTestProfile(); // Load the test page. @@ -700,7 +708,14 @@ // Makes sure that clicking outside the focused field doesn't activate // the popup. -IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, DontAutofillForOutsideClick) { +// Flaky on Windows http://crbug.com/728488 +#if defined(OS_WIN) +#define MAYBE_DontAutofillForOutsideClick DISABLED_DontAutofillForOutsideClick +#else +#define MAYBE_DontAutofillForOutsideClick DontAutofillForOutsideClick +#endif +IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, + MAYBE_DontAutofillForOutsideClick) { CreateTestProfile(); // Load the test page. @@ -725,7 +740,8 @@ // Test that a field is still autofillable after the previously autofilled // value is deleted. // TODO(crbug.com/603488) Test is timing out flakily on CrOS. -#if defined(OS_CHROMEOS) +// Flaky on Windows http://crbug.com/728488 +#if defined(OS_CHROMEOS) || defined(OS_WIN) #define MAYBE_OnDeleteValueAfterAutofill DISABLED_OnDeleteValueAfterAutofill #else #define MAYBE_OnDeleteValueAfterAutofill OnDeleteValueAfterAutofill @@ -961,7 +977,8 @@ } // Flakily times out on ChromeOS http://crbug.com/585885 -#if defined(OS_CHROMEOS) +// Flaky on Windows http://crbug.com/728488 +#if defined(OS_CHROMEOS) || defined(OS_WIN) #define MAYBE_InputFiresBeforeChange DISABLED_InputFiresBeforeChange #else #define MAYBE_InputFiresBeforeChange InputFiresBeforeChange @@ -1134,7 +1151,8 @@ } // TODO(crbug.com/603488) Test is timing out flakily on CrOS. -#if defined(OS_CHROMEOS) +// Flaky on Windows http://crbug.com/728488 +#if defined(OS_CHROMEOS) || defined(OS_WIN) #define MAYBE_AutofillFormWithNonAutofillableField \ DISABLED_AutofillFormWithNonAutofillableField #else @@ -1306,7 +1324,8 @@ // Test that filling a form sends all the expected events to the different // fields being filled. // Flakily fails on ChromeOS (crbug.com/646576). -#if defined(OS_CHROMEOS) +// Flaky on Windows http://crbug.com/728488 +#if defined(OS_CHROMEOS) || defined(OS_WIN) #define MAYBE_AutofillEvents DISABLED_AutofillEvents #else #define MAYBE_AutofillEvents AutofillEvents @@ -1712,7 +1731,8 @@ // is interacting with the form. This is a regression test for // http://crbug.com/160476 // Flakily times out on ChromeOS http://crbug.com/585885 -#if defined(OS_CHROMEOS) +// Flaky on Windows http://crbug.com/728488 +#if defined(OS_CHROMEOS) || defined(OS_WIN) #define MAYBE_DisableAutocompleteWhileFilling \ DISABLED_DisableAutocompleteWhileFilling #else @@ -1840,8 +1860,13 @@ // This test verifies that credit card (payment card list) popup works when the // form is inside an OOPIF. -IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, CrossSitePaymentForms) { - +// Flaky on Windows http://crbug.com/728488 +#if defined(OS_WIN) +#define MAYBE_CrossSitePaymentForms DISABLED_MAYBE_CrossSitePaymentForms +#else +#define MAYBE_CrossSitePaymentForms CrossSitePaymentForms +#endif +IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, MAYBE_CrossSitePaymentForms) { // Main frame is on a.com, iframe is on b.com. GURL url = embedded_test_server()->GetURL( "a.com", "/autofill/cross_origin_iframe.html");
diff --git a/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc b/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc index d362a04a..3e738c8 100644 --- a/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc +++ b/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc
@@ -55,36 +55,6 @@ return int_value; } -// Returns whether the auto-enrollment check is required. When -// kCheckEnrollmentKey VPD entry is present, it is explicitly stating whether -// the forced re-enrollment is required or not. Otherwise, for backward -// compatibility with devices upgrading from an older version of Chrome OS, the -// kActivateDateKey VPD entry is queried. If it's missing, FRE is not required. -// This enables factories to start full guest sessions for testing, see -// http://crbug.com/397354 for more context. The requirement for the machine -// serial number to be present is a sanity-check to ensure that the VPD has -// actually been read successfully. If VPD read failed, the FRE check is -// required. -AutoEnrollmentController::FRERequirement GetFRERequirement() { - std::string check_enrollment_value; - system::StatisticsProvider* provider = - system::StatisticsProvider::GetInstance(); - bool fre_flag_found = provider->GetMachineStatistic( - system::kCheckEnrollmentKey, &check_enrollment_value); - - if (fre_flag_found) { - if (check_enrollment_value == "0") - return AutoEnrollmentController::EXPLICITLY_NOT_REQUIRED; - if (check_enrollment_value == "1") - return AutoEnrollmentController::EXPLICITLY_REQUIRED; - } - if (!provider->GetMachineStatistic(system::kActivateDateKey, nullptr) && - !provider->GetEnterpriseMachineID().empty()) { - return AutoEnrollmentController::NOT_REQUIRED; - } - return AutoEnrollmentController::REQUIRED; -} - std::string FRERequirementToString( AutoEnrollmentController::FRERequirement requirement) { switch (requirement) { @@ -109,6 +79,7 @@ const char AutoEnrollmentController::kForcedReEnrollmentOfficialBuild[] = "official"; +// static AutoEnrollmentController::Mode AutoEnrollmentController::GetMode() { base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -136,6 +107,28 @@ return MODE_NONE; } +// static +AutoEnrollmentController::FRERequirement +AutoEnrollmentController::GetFRERequirement() { + std::string check_enrollment_value; + system::StatisticsProvider* provider = + system::StatisticsProvider::GetInstance(); + bool fre_flag_found = provider->GetMachineStatistic( + system::kCheckEnrollmentKey, &check_enrollment_value); + + if (fre_flag_found) { + if (check_enrollment_value == "0") + return AutoEnrollmentController::EXPLICITLY_NOT_REQUIRED; + if (check_enrollment_value == "1") + return AutoEnrollmentController::EXPLICITLY_REQUIRED; + } + if (!provider->GetMachineStatistic(system::kActivateDateKey, nullptr) && + !provider->GetEnterpriseMachineID().empty()) { + return AutoEnrollmentController::NOT_REQUIRED; + } + return AutoEnrollmentController::REQUIRED; +} + AutoEnrollmentController::AutoEnrollmentController() {} AutoEnrollmentController::~AutoEnrollmentController() {}
diff --git a/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h b/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h index b16deff..e903279e 100644 --- a/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h +++ b/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h
@@ -61,6 +61,18 @@ // build status. static Mode GetMode(); + // Returns whether the auto-enrollment check is required. When + // kCheckEnrollmentKey VPD entry is present, it is explicitly stating whether + // the forced re-enrollment is required or not. Otherwise, for backward + // compatibility with devices upgrading from an older version of Chrome OS, + // the kActivateDateKey VPD entry is queried. If it's missing, FRE is not + // required. This enables factories to start full guest sessions for testing, + // see http://crbug.com/397354 for more context. The requirement for the + // machine serial number to be present is a sanity-check to ensure that the + // VPD has actually been read successfully. If VPD read failed, the FRE check + // is required. + static FRERequirement GetFRERequirement(); + AutoEnrollmentController(); ~AutoEnrollmentController();
diff --git a/chrome/browser/chromeos/login/ui/webui_login_view.cc b/chrome/browser/chromeos/login/ui/webui_login_view.cc index 78e038c8..958970c9 100644 --- a/chrome/browser/chromeos/login/ui/webui_login_view.cc +++ b/chrome/browser/chromeos/login/ui/webui_login_view.cc
@@ -20,6 +20,7 @@ #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chromeos/accessibility/accessibility_util.h" #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" +#include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" #include "chrome/browser/chromeos/login/ui/preloaded_web_view.h" #include "chrome/browser/chromeos/login/ui/preloaded_web_view_factory.h" @@ -60,6 +61,7 @@ #include "ui/views/controls/webview/webview.h" #include "ui/views/widget/widget.h" +using chromeos::AutoEnrollmentController; using content::NativeWebKeyboardEvent; using content::RenderViewHost; using content::WebContents; @@ -141,9 +143,17 @@ } accel_map_[ui::Accelerator(ui::VKEY_V, ui::EF_ALT_DOWN)] = kAccelNameVersion; - accel_map_[ui::Accelerator(ui::VKEY_R, - ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] = - kAccelNameReset; + + // Devices with forced re-enrollment enabled shouldn't be able to powerwash. + const AutoEnrollmentController::FRERequirement requirement = + AutoEnrollmentController::GetFRERequirement(); + if (requirement == AutoEnrollmentController::NOT_REQUIRED || + requirement == AutoEnrollmentController::EXPLICITLY_NOT_REQUIRED) { + accel_map_[ui::Accelerator(ui::VKEY_R, + ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | + ui::EF_SHIFT_DOWN)] = kAccelNameReset; + } + accel_map_[ui::Accelerator(ui::VKEY_X, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] = kAccelNameEnableDebugging;
diff --git a/chrome/browser/chromeos/settings/device_settings_provider.cc b/chrome/browser/chromeos/settings/device_settings_provider.cc index de64b1a..6e0e106 100644 --- a/chrome/browser/chromeos/settings/device_settings_provider.cc +++ b/chrome/browser/chromeos/settings/device_settings_provider.cc
@@ -742,8 +742,18 @@ TrustedStatus trusted_status) { PrefValueMap new_values_cache; + // Determine whether device is managed. See PolicyData::management_mode docs + // for details. + bool managed = false; + if (policy_data.has_management_mode()) { + managed = + (policy_data.management_mode() == em::PolicyData::ENTERPRISE_MANAGED); + } else { + managed = policy_data.has_request_token(); + } + // If the device is not managed, we set the device owner value. - if (policy_data.has_username() && !policy_data.has_request_token()) + if (policy_data.has_username() && !managed) new_values_cache.SetString(kDeviceOwner, policy_data.username()); if (policy_data.has_service_account_identity()) {
diff --git a/chrome/browser/content_settings/content_settings_internal_extension_provider.cc b/chrome/browser/content_settings/content_settings_internal_extension_provider.cc index d15d0b6f..71b11b58 100644 --- a/chrome/browser/content_settings/content_settings_internal_extension_provider.cc +++ b/chrome/browser/content_settings/content_settings_internal_extension_provider.cc
@@ -195,8 +195,8 @@ const extensions::Extension* extension, const ResourceIdentifier& resource, ContentSetting setting) { - std::unique_ptr<ContentSettingsPattern::BuilderInterface> pattern_builder( - ContentSettingsPattern::CreateBuilder(false)); + std::unique_ptr<ContentSettingsPattern::BuilderInterface> pattern_builder = + ContentSettingsPattern::CreateBuilder(); pattern_builder->WithScheme(extensions::kExtensionScheme); pattern_builder->WithHost(extension->id()); pattern_builder->WithPathWildcard();
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc b/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc index c463d6d..e2f2a000 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc
@@ -45,8 +45,8 @@ *error = URLPattern::GetParseResultString(result); return ContentSettingsPattern(); } else { - std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder( - ContentSettingsPattern::CreateBuilder(false)); + std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder = + ContentSettingsPattern::CreateBuilder(); builder->WithHost(url_pattern.host()); if (url_pattern.match_subdomains()) builder->WithDomainWildcard();
diff --git a/chrome/browser/signin/account_reconcilor_unittest.cc b/chrome/browser/signin/account_reconcilor_unittest.cc index 8c9304c..3ba0a16 100644 --- a/chrome/browser/signin/account_reconcilor_unittest.cc +++ b/chrome/browser/signin/account_reconcilor_unittest.cc
@@ -473,8 +473,8 @@ AccountReconcilorFactory::GetForProfile(profile()); ASSERT_TRUE(reconcilor); - std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder( - ContentSettingsPattern::CreateBuilder(false)); + std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder = + ContentSettingsPattern::CreateBuilder(); builder->Invalid(); SimulateCookieContentSettingsChanged(reconcilor, builder->Build());
diff --git a/chrome/browser/ui/webui/options/pepper_flash_content_settings_utils.cc b/chrome/browser/ui/webui/options/pepper_flash_content_settings_utils.cc index 9dbab9f53..542498b 100644 --- a/chrome/browser/ui/webui/options/pepper_flash_content_settings_utils.cc +++ b/chrome/browser/ui/webui/options/pepper_flash_content_settings_utils.cc
@@ -57,8 +57,8 @@ MediaExceptions* media_exceptions) { media_exceptions->clear(); - std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder( - ContentSettingsPattern::CreateBuilder(false)); + std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder = + ContentSettingsPattern::CreateBuilder(); builder->WithSchemeWildcard()->WithPortWildcard(); for (ppapi::FlashSiteSettings::const_iterator iter = site_settings.begin(); iter != site_settings.end(); ++iter) {
diff --git a/components/content_settings/core/common/content_settings_pattern.cc b/components/content_settings/core/common/content_settings_pattern.cc index a83a6959a..e88351a5 100644 --- a/components/content_settings/core/common/content_settings_pattern.cc +++ b/components/content_settings/core/common/content_settings_pattern.cc
@@ -10,6 +10,7 @@ #include <vector> #include "base/macros.h" +#include "base/memory/ptr_util.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "components/content_settings/core/common/content_settings_pattern_parser.h" @@ -100,7 +101,7 @@ class ContentSettingsPattern::Builder : public ContentSettingsPattern::BuilderInterface { public: - explicit Builder(bool use_legacy_validate); + explicit Builder(); ~Builder() override; // BuilderInterface: @@ -124,20 +125,14 @@ // Returns true when the pattern |parts| represent a valid pattern. static bool Validate(const PatternParts& parts); - static bool LegacyValidate(const PatternParts& parts); - bool is_valid_; - bool use_legacy_validate_; - PatternParts parts_; DISALLOW_COPY_AND_ASSIGN(Builder); }; -ContentSettingsPattern::Builder::Builder(bool use_legacy_validate) - : is_valid_(true), - use_legacy_validate_(use_legacy_validate) {} +ContentSettingsPattern::Builder::Builder() : is_valid_(true) {} ContentSettingsPattern::Builder::~Builder() {} @@ -201,17 +196,11 @@ return ContentSettingsPattern(); if (!Canonicalize(&parts_)) return ContentSettingsPattern(); - if (use_legacy_validate_) { - is_valid_ = LegacyValidate(parts_); - } else { - is_valid_ = Validate(parts_); - } + is_valid_ = Validate(parts_); if (!is_valid_) return ContentSettingsPattern(); // A pattern is invalid if canonicalization is not idempotent. - // This check is here because it should be checked no matter - // use_legacy_validate_ is. PatternParts parts(parts_); if (!Canonicalize(&parts)) return ContentSettingsPattern(); @@ -302,41 +291,6 @@ return true; } -// static -bool ContentSettingsPattern::Builder::LegacyValidate( - const PatternParts& parts) { - // If the pattern is for a "file-pattern" test if it is valid. - if (parts.scheme == std::string(url::kFileScheme) && - !parts.is_scheme_wildcard && - parts.host.empty() && - parts.port.empty()) - return true; - - // If the pattern is for an extension URL test if it is valid. - if (IsNonWildcardDomainNonPortScheme(parts.scheme) && - !parts.is_scheme_wildcard && - !parts.host.empty() && - !parts.has_domain_wildcard && - parts.port.empty() && - !parts.is_port_wildcard) - return true; - - // Non-file patterns are invalid if either the scheme, host or port part is - // empty. - if ((!parts.is_scheme_wildcard) || - (parts.host.empty() && !parts.has_domain_wildcard) || - (!parts.is_port_wildcard)) - return false; - - // Test if the scheme is supported or a wildcard. - if (!parts.is_scheme_wildcard && - parts.scheme != std::string(url::kHttpScheme) && - parts.scheme != std::string(url::kHttpsScheme)) { - return false; - } - return true; -} - // //////////////////////////////////////////////////////////////////////////// // ContentSettingsPattern::PatternParts // @@ -367,9 +321,8 @@ const int ContentSettingsPattern::kContentSettingsPatternVersion = 1; // static -BuilderInterface* ContentSettingsPattern::CreateBuilder( - bool validate) { - return new Builder(validate); +std::unique_ptr<BuilderInterface> ContentSettingsPattern::CreateBuilder() { + return base::MakeUnique<Builder>(); } // static @@ -385,71 +338,67 @@ // static ContentSettingsPattern ContentSettingsPattern::FromURL( const GURL& url) { - std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder( - ContentSettingsPattern::CreateBuilder(false)); + ContentSettingsPattern::Builder builder; const GURL* local_url = &url; if (url.SchemeIsFileSystem() && url.inner_url()) { local_url = url.inner_url(); } if (local_url->SchemeIsFile()) { - builder->WithScheme(local_url->scheme())->WithPath(local_url->path()); + builder.WithScheme(local_url->scheme())->WithPath(local_url->path()); } else { // Please keep the order of the ifs below as URLs with an IP as host can // also have a "http" scheme. if (local_url->HostIsIPAddress()) { - builder->WithScheme(local_url->scheme())->WithHost(local_url->host()); + builder.WithScheme(local_url->scheme())->WithHost(local_url->host()); } else if (local_url->SchemeIs(url::kHttpScheme)) { - builder->WithSchemeWildcard()->WithDomainWildcard()->WithHost( + builder.WithSchemeWildcard()->WithDomainWildcard()->WithHost( local_url->host()); } else if (local_url->SchemeIs(url::kHttpsScheme)) { - builder->WithScheme(local_url->scheme())->WithDomainWildcard()->WithHost( - local_url->host()); + builder.WithScheme(local_url->scheme()) + ->WithDomainWildcard() + ->WithHost(local_url->host()); } else { // Unsupported scheme } if (local_url->port().empty()) { if (local_url->SchemeIs(url::kHttpsScheme)) - builder->WithPort(GetDefaultPort(url::kHttpsScheme)); + builder.WithPort(GetDefaultPort(url::kHttpsScheme)); else - builder->WithPortWildcard(); + builder.WithPortWildcard(); } else { - builder->WithPort(local_url->port()); + builder.WithPort(local_url->port()); } } - return builder->Build(); + return builder.Build(); } // static ContentSettingsPattern ContentSettingsPattern::FromURLNoWildcard( const GURL& url) { - std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder( - ContentSettingsPattern::CreateBuilder(false)); - + ContentSettingsPattern::Builder builder; const GURL* local_url = &url; if (url.SchemeIsFileSystem() && url.inner_url()) { local_url = url.inner_url(); } if (local_url->SchemeIsFile()) { - builder->WithScheme(local_url->scheme())->WithPath(local_url->path()); + builder.WithScheme(local_url->scheme())->WithPath(local_url->path()); } else { - builder->WithScheme(local_url->scheme())->WithHost(local_url->host()); + builder.WithScheme(local_url->scheme())->WithHost(local_url->host()); if (local_url->port().empty()) { - builder->WithPort(GetDefaultPort(local_url->scheme())); + builder.WithPort(GetDefaultPort(local_url->scheme())); } else { - builder->WithPort(local_url->port()); + builder.WithPort(local_url->port()); } } - return builder->Build(); + return builder.Build(); } // static ContentSettingsPattern ContentSettingsPattern::FromString( const std::string& pattern_spec) { - std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder( - ContentSettingsPattern::CreateBuilder(false)); - content_settings::PatternParser::Parse(pattern_spec, - builder.get()); - return builder->Build(); + ContentSettingsPattern::Builder builder; + content_settings::PatternParser::Parse(pattern_spec, &builder); + return builder.Build(); } // static @@ -481,27 +430,25 @@ if (domain_pattern.parts_.host.empty()) return false; - std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder( - ContentSettingsPattern::CreateBuilder(false)); - + ContentSettingsPattern::Builder builder; if (domain_pattern.parts_.is_scheme_wildcard) - builder->WithScheme(url::kHttpScheme); + builder.WithScheme(url::kHttpScheme); else - builder->WithScheme(domain_pattern.parts_.scheme); + builder.WithScheme(domain_pattern.parts_.scheme); - builder->WithHost(domain_pattern.parts_.host); + builder.WithHost(domain_pattern.parts_.host); if (domain_pattern.parts_.is_port_wildcard) { if (domain_pattern.parts_.scheme == url::kHttpsScheme) { - builder->WithPort(GetDefaultPort(url::kHttpsScheme)); + builder.WithPort(GetDefaultPort(url::kHttpsScheme)); } else { - builder->WithPort(GetDefaultPort(url::kHttpScheme)); + builder.WithPort(GetDefaultPort(url::kHttpScheme)); } } else { - builder->WithPort(domain_pattern.parts_.port); + builder.WithPort(domain_pattern.parts_.port); } - *origin_pattern = builder->Build(); + *origin_pattern = builder.Build(); return true; }
diff --git a/components/content_settings/core/common/content_settings_pattern.h b/components/content_settings/core/common/content_settings_pattern.h index 7d6fc8d..fe292d53 100644 --- a/components/content_settings/core/common/content_settings_pattern.h +++ b/components/content_settings/core/common/content_settings_pattern.h
@@ -7,6 +7,7 @@ #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PATTERN_H_ #define COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PATTERN_H_ +#include <memory> #include <string> #include "base/gtest_prod_util.h" @@ -136,7 +137,7 @@ virtual ContentSettingsPattern Build() = 0; }; - static BuilderInterface* CreateBuilder(bool use_legacy_validate); + static std::unique_ptr<BuilderInterface> CreateBuilder(); // The version of the pattern format implemented. static const int kContentSettingsPatternVersion;
diff --git a/components/content_settings/core/common/content_settings_pattern_unittest.cc b/components/content_settings/core/common/content_settings_pattern_unittest.cc index d5aab80..0a39384 100644 --- a/components/content_settings/core/common/content_settings_pattern_unittest.cc +++ b/components/content_settings/core/common/content_settings_pattern_unittest.cc
@@ -184,8 +184,8 @@ // The static Wildcard() method goes through a fast path and avoids the Builder // pattern. Ensure that it yields the exact same behavior. TEST(ContentSettingsPatternTest, ValidWildcardFastPath) { - std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder( - ContentSettingsPattern::CreateBuilder(true)); + std::unique_ptr<ContentSettingsPattern::BuilderInterface> builder = + ContentSettingsPattern::CreateBuilder(); builder->WithSchemeWildcard()->WithDomainWildcard()->WithPortWildcard()-> WithPathWildcard(); ContentSettingsPattern built_wildcard = builder->Build();
diff --git a/components/policy/proto/device_management_backend.proto b/components/policy/proto/device_management_backend.proto index 12180ff..46946fa 100644 --- a/components/policy/proto/device_management_backend.proto +++ b/components/policy/proto/device_management_backend.proto
@@ -292,10 +292,13 @@ // anything like that. optional int64 timestamp = 2; - // The DM token that was used by the client in the HTTP POST header - // for authenticating the request. It is included here again so that - // the client can verify that the response is meant for them (and not - // issued by a replay or man-in-the-middle attack). + // The DM token that was used by the client in the HTTP POST header for + // authenticating the request. It is included here again so that the client + // can verify that the response is meant for them (and not issued by a replay + // or man-in-the-middle attack). + // Note that the existence or non-existence of the DM token is not the correct + // way to determine whether the device is managed. Cf. |management_mode| below + // for details. optional string request_token = 3; // The serialized value of the actual policy protobuf. This can be @@ -370,8 +373,8 @@ // The device is owned locally. The policies are set by the local owner of // the device. LOCAL_OWNER = 0; - // The device is enterprise-managed. The policies come from the enterprise - // server. See the comment above for backward compatibility. + // The device is enterprise-managed (either via DM server or through Active + // Directory). See the comment above for backward compatibility. ENTERPRISE_MANAGED = 1; // Obsolete. Don't use. OBSOLETE_CONSUMER_MANAGED = 2;
diff --git a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc index 6c9033f..b308661 100644 --- a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc +++ b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
@@ -1422,10 +1422,10 @@ params->SetString("expression", "console.log('done')"); SendCommand("Runtime.evaluate", std::move(params), true); - // The second timer shold not fire. - EXPECT_THAT(console_messages_, ElementsAre("before", "done")); + // The third timer should not fire. + EXPECT_THAT(console_messages_, ElementsAre("before", "at", "done")); - // Let virtual time advance for another second, which should make the second + // Let virtual time advance for another second, which should make the third // timer fire. params.reset(new base::DictionaryValue()); params->SetString("policy", "advance"); @@ -1434,7 +1434,7 @@ WaitForNotification("Emulation.virtualTimeBudgetExpired"); - EXPECT_THAT(console_messages_, ElementsAre("before", "done", "at", "after")); + EXPECT_THAT(console_messages_, ElementsAre("before", "at", "done", "after")); } // Tests that the Security.showCertificateViewer command shows the
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc index 7129807..64eaa78 100644 --- a/content/renderer/browser_plugin/browser_plugin.cc +++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -173,7 +173,7 @@ RenderFrameImpl::FromRoutingID(render_frame_routing_id()); if (render_frame && render_frame->render_accessibility() && Container()) { blink::WebElement element = Container()->GetElement(); - blink::WebAXObject ax_element = element.AccessibilityObject(); + blink::WebAXObject ax_element = blink::WebAXObject::FromWebNode(element); if (!ax_element.IsDetached()) { render_frame->render_accessibility()->HandleAXEvent( ax_element,
diff --git a/extensions/renderer/api/automation/automation_api_helper.cc b/extensions/renderer/api/automation/automation_api_helper.cc index f74527c..45a5d27f 100644 --- a/extensions/renderer/api/automation/automation_api_helper.cc +++ b/extensions/renderer/api/automation/automation_api_helper.cc
@@ -77,7 +77,7 @@ blink::WebElement result_element = start_node.QuerySelector(web_selector); int result_acc_obj_id = 0; if (!result_element.IsNull()) { - blink::WebAXObject result_acc_obj = result_element.AccessibilityObject(); + auto result_acc_obj = blink::WebAXObject::FromWebNode(result_element); if (!result_acc_obj.IsDetached()) { while (result_acc_obj.AccessibilityIsIgnored()) result_acc_obj = result_acc_obj.ParentObject();
diff --git a/google_apis/gaia/gaia_oauth_client.cc b/google_apis/gaia/gaia_oauth_client.cc index 8947febb..62418f6 100644 --- a/google_apis/gaia/gaia_oauth_client.cc +++ b/google_apis/gaia/gaia_oauth_client.cc
@@ -16,6 +16,7 @@ #include "net/base/escape.h" #include "net/base/load_flags.h" #include "net/http/http_status_code.h" +#include "net/traffic_annotation/network_traffic_annotation.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_request_context_getter.h" @@ -89,10 +90,12 @@ const std::string& oauth_access_token, int max_retries, Delegate* delegate); - void MakeGaiaRequest(const GURL& url, - const std::string& post_body, - int max_retries, - GaiaOAuthClient::Delegate* delegate); + void MakeGaiaRequest( + const GURL& url, + const std::string& post_body, + int max_retries, + GaiaOAuthClient::Delegate* delegate, + const net::NetworkTrafficAnnotationTag& traffic_annotation); void HandleResponse(const net::URLFetcher* source, bool* should_retry_request); @@ -119,8 +122,38 @@ "&redirect_uri=" + net::EscapeUrlEncodedData(oauth_client_info.redirect_uri, true) + "&grant_type=authorization_code"; - MakeGaiaRequest(GURL(GaiaUrls::GetInstance()->oauth2_token_url()), - post_body, max_retries, delegate); + net::NetworkTrafficAnnotationTag traffic_annotation = + net::DefineNetworkTrafficAnnotation("gaia_oauth_client_get_tokens", R"( + semantics { + sender: "OAuth 2.0 calls" + description: + "This request exchanges an authorization code for an OAuth 2.0 " + "refresh token and an OAuth 2.0 access token." + trigger: + "This request is triggered when a Chrome service requires an " + "access token and a refresh token (e.g. Cloud Print, Chrome Remote " + "Desktop etc.) See https://developers.google.com/identity/protocols" + "/OAuth2 for more information about the Google implementation of " + "the OAuth 2.0 protocol." + data: + "The Google console client ID and client secret of the caller, the " + "OAuth authorization code and the redirect URI." + destination: GOOGLE_OWNED_SERVICE + } + policy { + cookies_allowed: false + setting: + "This feature cannot be disabled in settings, but if the user " + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } + })"); + MakeGaiaRequest(GURL(GaiaUrls::GetInstance()->oauth2_token_url()), post_body, + max_retries, delegate, traffic_annotation); } void GaiaOAuthClient::Core::RefreshToken( @@ -144,8 +177,36 @@ post_body += "&scope=" + net::EscapeUrlEncodedData(scopes_string, true); } - MakeGaiaRequest(GURL(GaiaUrls::GetInstance()->oauth2_token_url()), - post_body, max_retries, delegate); + net::NetworkTrafficAnnotationTag traffic_annotation = + net::DefineNetworkTrafficAnnotation("gaia_oauth_client_refresh_token", R"( + semantics { + sender: "OAuth 2.0 calls" + description: + "This request fetches a fresh access token that can be used to " + "authenticate an API call to a Google web endpoint." + trigger: + "This is called whenever the caller needs a fresh OAuth 2.0 access " + "token." + data: + "The OAuth 2.0 refresh token, the Google console client ID and " + "client secret of the caller, and optionally the scopes of the API " + "for which the access token should be authorized." + destination: GOOGLE_OWNED_SERVICE + } + policy { + cookies_allowed: false + setting: + "This feature cannot be disabled in settings, but if the user " + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } + })"); + MakeGaiaRequest(GURL(GaiaUrls::GetInstance()->oauth2_token_url()), post_body, + max_retries, delegate, traffic_annotation); } void GaiaOAuthClient::Core::GetUserEmail(const std::string& oauth_access_token, @@ -176,9 +237,36 @@ request_type_ = type; delegate_ = delegate; num_retries_ = 0; + net::NetworkTrafficAnnotationTag traffic_annotation = + net::DefineNetworkTrafficAnnotation("gaia_core_get_user_info", R"( + semantics { + sender: "OAuth 2.0 calls" + description: + "This request is used to fetch profile information about the user, " + "like the email, the ID of the account, the full name, and the " + "profile picture." + trigger: + "The main trigger for this request is in the AccountTrackerService " + "that fetches the user info soon after the user signs in." + data: + "The OAuth 2.0 access token of the account." + destination: GOOGLE_OWNED_SERVICE + } + policy { + cookies_allowed: false + setting: + "This feature cannot be disabled in settings, but if the user " + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } + })"); request_ = net::URLFetcher::Create( kUrlFetcherId, GURL(GaiaUrls::GetInstance()->oauth_user_info_url()), - net::URLFetcher::GET, this); + net::URLFetcher::GET, this, traffic_annotation); request_->SetRequestContext(request_context_getter_.get()); request_->AddExtraRequestHeader("Authorization: OAuth " + oauth_access_token); request_->SetMaxRetriesOn5xx(max_retries); @@ -203,22 +291,53 @@ request_type_ = TOKEN_INFO; std::string post_body = qualifier + "=" + net::EscapeUrlEncodedData(query, true); + net::NetworkTrafficAnnotationTag traffic_annotation = + net::DefineNetworkTrafficAnnotation("...", R"( + semantics { + sender: "OAuth 2.0 calls" + description: + "This request fetches information about an OAuth 2.0 access token. " + "The response is a dictionary of response values. The provided " + "access token may have any scope, and basic results will be " + "returned: issued_to, audience, scope, expires_in, access_type. In " + "addition, if the https://www.googleapis.com/auth/userinfo.email " + "scope is present, the email and verified_email fields will be " + "returned. If the https://www.googleapis.com/auth/userinfo.profile " + "scope is present, the user_id field will be returned." + trigger: + "This is triggered after a Google account is added to the browser. " + "It it also triggered after each successful fetch of an OAuth 2.0 " + "access token." + data: "The OAuth 2.0 access token." + destination: GOOGLE_OWNED_SERVICE + } + policy { + cookies_allowed: false + setting: + "This feature cannot be disabled in settings, but if the user " + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } + })"); MakeGaiaRequest(GURL(GaiaUrls::GetInstance()->oauth2_token_info_url()), - post_body, - max_retries, - delegate); + post_body, max_retries, delegate, traffic_annotation); } void GaiaOAuthClient::Core::MakeGaiaRequest( const GURL& url, const std::string& post_body, int max_retries, - GaiaOAuthClient::Delegate* delegate) { + GaiaOAuthClient::Delegate* delegate, + const net::NetworkTrafficAnnotationTag& traffic_annotation) { DCHECK(!request_.get()) << "Tried to fetch two things at once!"; delegate_ = delegate; num_retries_ = 0; - request_ = - net::URLFetcher::Create(kUrlFetcherId, url, net::URLFetcher::POST, this); + request_ = net::URLFetcher::Create(kUrlFetcherId, url, net::URLFetcher::POST, + this, traffic_annotation); request_->SetRequestContext(request_context_getter_.get()); request_->SetUploadData("application/x-www-form-urlencoded", post_body); request_->SetMaxRetriesOn5xx(max_retries);
diff --git a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc index 1393f55..4d10e84 100644 --- a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc +++ b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
@@ -21,6 +21,7 @@ #include "net/base/escape.h" #include "net/base/load_flags.h" #include "net/http/http_status_code.h" +#include "net/traffic_annotation/network_traffic_annotation.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_status.h" @@ -96,8 +97,36 @@ const std::string& body, URLFetcherDelegate* delegate) { bool empty_body = body.empty(); + net::NetworkTrafficAnnotationTag traffic_annotation = + net::DefineNetworkTrafficAnnotation("oauth2_access_token_fetcher", R"( + semantics { + sender: "OAuth 2.0 Access Token Fetcher" + description: + "This request is used by the Token Service to fetch an OAuth 2.0 " + "access token for a known Google account." + trigger: + "This request can be triggered at any moment when any service " + "requests an OAuth 2.0 access token from the Token Service." + data: + "Chrome OAuth 2.0 client id and secret, the set of OAuth 2.0 " + "scopes and the OAuth 2.0 refresh token." + destination: GOOGLE_OWNED_SERVICE + } + policy { + cookies_allowed: false + setting: + "This feature cannot be disabled in settings, but if user signs " + "out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } + })"); std::unique_ptr<URLFetcher> result = net::URLFetcher::Create( - 0, url, empty_body ? URLFetcher::GET : URLFetcher::POST, delegate); + 0, url, empty_body ? URLFetcher::GET : URLFetcher::POST, delegate, + traffic_annotation); gaia::MarkURLFetcherAsGaia(result.get()); result->SetRequestContext(getter);
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG index 416640b..bd322ac 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -9387,7 +9387,6 @@ crbug.com/591099 fast/dom/HTMLElement/class-list-gc.html [ Failure ] crbug.com/591099 fast/dom/HTMLElement/class-list.html [ Failure ] crbug.com/591099 fast/dom/HTMLElement/class-list-quirks.html [ Failure ] -crbug.com/591099 fast/dom/HTMLElement/contextmenu.html [ Failure ] crbug.com/591099 fast/dom/HTMLElement/innerHTML-selection-crash.html [ Crash Failure ] crbug.com/591099 fast/dom/HTMLElement/insertAdjacentHTML-errors.html [ Failure ] crbug.com/591099 fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit.html [ Failure ] @@ -10341,7 +10340,6 @@ crbug.com/591099 fast/events/constructors/pointer-event-constructor.html [ Failure Timeout ] crbug.com/591099 fast/events/constructors/pop-state-event-constructor.html [ Failure ] crbug.com/591099 fast/events/constructors/progress-event-constructor.html [ Failure ] -crbug.com/591099 fast/events/constructors/related-event-constructor.html [ Failure ] crbug.com/591099 fast/events/constructors/security-policy-violation-event-constructor.html [ Failure ] crbug.com/591099 fast/events/constructors/speech-recognition-error-constructor.html [ Failure ] crbug.com/591099 fast/events/constructors/speech-recognition-event-constructor.html [ Failure ] @@ -10685,7 +10683,6 @@ crbug.com/591099 fast/events/popup-forwarded-gesture.html [ Failure ] crbug.com/591099 fast/events/programmatic-check-no-change-event.html [ Failure ] crbug.com/591099 fast/events/recorded-keydown-event.html [ Crash ] -crbug.com/591099 fast/events/relatedevent.html [ Failure ] crbug.com/591099 fast/events/related-target-focusevent.html [ Failure Timeout ] crbug.com/591099 fast/events/related-target.html [ Failure ] crbug.com/591099 fast/events/relative-offset-of-simulated-click.html [ Failure ] @@ -13697,7 +13694,6 @@ crbug.com/591099 fast/parser/object-with-textarea-fallback.html [ Crash ] crbug.com/591099 fast/parser/open-comment-in-style.html [ Failure ] crbug.com/591099 fast/parser/open-comment-in-textarea.html [ Crash Failure ] -crbug.com/591099 fast/parser/parse-menuitem.html [ Failure ] crbug.com/591099 fast/parser/parse-wbr.html [ Failure ] crbug.com/591099 fast/parser/p-in-scope.html [ Failure ] crbug.com/591099 fast/parser/p-in-scope-strict.html [ Failure ] @@ -15492,9 +15488,6 @@ crbug.com/591099 html/grouping_content/main-element.html [ Failure ] crbug.com/591099 html/marquee/marquee-element.html [ Failure ] crbug.com/591099 html/marquee/marquee-shadow-root-no-access.html [ Crash ] -crbug.com/591099 html/menu_menuitem/custom-context-menu.html [ Failure ] -crbug.com/591099 html/menu_menuitem/menuitem-click.html [ Failure ] -crbug.com/591099 html/menu_menuitem/menu-type-context.html [ Failure Pass ] crbug.com/591099 html/sections/article-element.html [ Failure ] crbug.com/591099 html/sections/aside-element.html [ Failure ] crbug.com/591099 html/sections/body-quirk-client-size.html [ Failure ] @@ -16205,7 +16198,6 @@ crbug.com/591099 http/tests/misc/copy-resolves-urls.html [ Failure ] crbug.com/591099 http/tests/misc/crash-multiple-family-fontface.html [ Failure ] crbug.com/591099 http/tests/misc/css-reject-any-type-in-strict-mode.html [ Failure ] -crbug.com/591099 http/tests/misc/custom-context-menu.html [ Failure ] crbug.com/591099 http/tests/misc/delete-frame-during-readystatechange.html [ Crash ] crbug.com/591099 http/tests/misc/delete-frame-during-readystatechange-with-gc-after-video-removal.html [ Crash ] crbug.com/591099 http/tests/misc/detach-during-notifyDone.html [ Crash ] @@ -23583,7 +23575,6 @@ crbug.com/591099 virtual/off-main-thread-fetch/http/tests/misc/copy-resolves-urls.html [ Crash Failure ] crbug.com/591099 virtual/off-main-thread-fetch/http/tests/misc/crash-multiple-family-fontface.html [ Failure ] crbug.com/591099 virtual/off-main-thread-fetch/http/tests/misc/css-reject-any-type-in-strict-mode.html [ Failure ] -crbug.com/591099 virtual/off-main-thread-fetch/http/tests/misc/custom-context-menu.html [ Failure ] crbug.com/591099 virtual/off-main-thread-fetch/http/tests/misc/delete-frame-during-readystatechange.html [ Crash ] crbug.com/591099 virtual/off-main-thread-fetch/http/tests/misc/delete-frame-during-readystatechange-with-gc-after-video-removal.html [ Crash ] crbug.com/591099 virtual/off-main-thread-fetch/http/tests/misc/detach-during-notifyDone.html [ Crash ]
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 index c1a47b6..efe5829 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
@@ -107,7 +107,7 @@ Bug(none) paint/transparency/compositing-alpha-fold-crash.html [ Failure ] Bug(none) paint/invalidation/table/row-change-background-rowspan-cell.html [ Failure ] -Bug(none) paint/invalidation/clip-flex-text.html [ Failure ] +Bug(none) paint/invalidation/clip-flex-text.html [ Pass Failure ] Bug(none) virtual/new-remote-playback-pipeline/media/controls/video-controls-with-cast-rendering.html [ Failure ] Bug(none) virtual/new-remote-playback-pipeline/media/controls/video-overlay-cast-dark-rendering.html [ Failure ] Bug(none) virtual/new-remote-playback-pipeline/media/controls/video-overlay-cast-light-rendering.html [ Failure ] @@ -1089,6 +1089,7 @@ Bug(none) paint/invalidation/compositing/invalidations-with-large-negative-margin.html [ Failure ] Bug(none) paint/invalidation/compositing/new-stacking-context.html [ Failure ] Bug(none) paint/invalidation/compositing/newly-composited-on-scroll.html [ Failure ] +Bug(none) paint/invalidation/compositing/newly-composited-repaint-rect.html [ Pass Failure ] Bug(none) paint/invalidation/compositing/overlap-test-with-filter.html [ Failure ] Bug(none) paint/invalidation/compositing/remove-squashed-layer-plus-move.html [ Failure ] Bug(none) paint/invalidation/compositing/repaint-overflow-scrolled-squashed-content.html [ Failure ] @@ -1154,15 +1155,11 @@ Bug(none) paint/invalidation/filters/effect-reference-repaint-composite-4.html [ Failure ] Bug(none) paint/invalidation/filters/effect-reference-repaint-composite-5.html [ Failure ] Bug(none) paint/invalidation/filters/effect-reference-repaint-composite-6.html [ Failure ] -Bug(none) paint/invalidation/filters/effect-reference-repaint-displacement.html [ Failure ] Bug(none) paint/invalidation/filters/effect-reference-repaint-gaussianblur-xonly.html [ Failure ] Bug(none) paint/invalidation/filters/effect-reference-repaint-gaussianblur-yonly.html [ Failure ] Bug(none) paint/invalidation/filters/effect-reference-repaint-gaussianblur.html [ Failure ] Bug(none) paint/invalidation/filters/effect-reference-repaint-lighting.html [ Failure ] Bug(none) paint/invalidation/filters/effect-reference-repaint-merge.html [ Failure ] -Bug(none) paint/invalidation/filters/effect-reference-repaint-morphology-xonly.html [ Failure ] -Bug(none) paint/invalidation/filters/effect-reference-repaint-morphology-yonly.html [ Failure ] -Bug(none) paint/invalidation/filters/effect-reference-repaint-morphology.html [ Failure ] Bug(none) paint/invalidation/filters/effect-reference-repaint-offset.html [ Failure ] Bug(none) paint/invalidation/fixed-after-scroll.html [ Failure ] Bug(none) paint/invalidation/fixed-and-absolute-position-scrolled.html [ Failure ] @@ -1207,10 +1204,8 @@ Bug(none) paint/invalidation/hover-pseudo-borders.html [ Failure ] Bug(none) paint/invalidation/iframe-display-block-to-display-none.html [ Failure ] Bug(none) paint/invalidation/iframe-display-none-to-display-block.html [ Failure ] -Bug(none) paint/invalidation/iframe-rounding.html [ Failure ] Bug(none) paint/invalidation/iframe-scrollbar-hover.html [ Failure ] Bug(none) paint/invalidation/image-resize.html [ Failure ] -Bug(none) paint/invalidation/in-scaled-iframe.html [ Failure ] Bug(none) paint/invalidation/inline-block-resize.html [ Failure ] Bug(none) paint/invalidation/inline-color-change.html [ Failure ] Bug(none) paint/invalidation/inline-focus.html [ Failure ] @@ -1235,11 +1230,9 @@ Bug(none) paint/invalidation/invalidate-cell-in-row-with-offset.html [ Failure ] Bug(none) paint/invalidation/invalidate-descendants-when-receiving-paint-layer.html [ Failure ] Bug(none) paint/invalidation/invalidate-invisible-element.html [ Failure ] -Bug(none) paint/invalidation/invalidate-paint-for-fixed-pos-inside-iframe.html [ Failure ] Bug(none) paint/invalidation/invalidate-paint-in-iframe-in-composited-layer.html [ Failure ] Bug(none) paint/invalidation/invalidation-after-opacity-change-subtree.html [ Failure ] Bug(none) paint/invalidation/invalidation-on-foreground-graphics-layer.html [ Failure ] -Bug(none) paint/invalidation/invalidation-with-scale-transform.html [ Failure ] Bug(none) paint/invalidation/japanese-rl-selection-clear.html [ Failure ] Bug(none) paint/invalidation/japanese-rl-selection-repaint.html [ Failure ] Bug(none) paint/invalidation/layer-hide-when-needs-layout.html [ Failure ] @@ -1320,7 +1313,6 @@ Bug(none) paint/invalidation/paint-invalidation-with-opacity.html [ Failure ] Bug(none) paint/invalidation/paint-invalidation-with-reparent-across-frame-boundaries.html [ Failure ] Bug(none) paint/invalidation/percent-size-image-resize-container.html [ Failure ] -Bug(none) paint/invalidation/percentage-transform-paint-offset.html [ Failure ] Bug(none) paint/invalidation/position-change-keeping-geometry.html [ Failure ] Bug(none) paint/invalidation/positioned-document-element.html [ Failure ] Bug(none) paint/invalidation/positioned-great-grandparent-change-location.html [ Failure ] @@ -1343,7 +1335,6 @@ Bug(none) paint/invalidation/repaint-descandant-on-ancestor-layer-move.html [ Failure ] Bug(none) paint/invalidation/repaint-during-scroll-with-zoom.html [ Failure ] Bug(none) paint/invalidation/repaint-during-scroll.html [ Failure ] -Bug(none) paint/invalidation/repaint-in-iframe.html [ Failure ] Bug(none) paint/invalidation/repaint-resized-overflow.html [ Failure ] Bug(none) paint/invalidation/repaint-table-row-in-composited-document.html [ Failure ] Bug(none) paint/invalidation/replaced-clipped-positioned-not-wrong-incremental-repainting.html [ Failure ] @@ -1352,7 +1343,7 @@ Bug(none) paint/invalidation/resize-scrollable-div.html [ Failure ] Bug(none) paint/invalidation/resize-scrollable-iframe.html [ Failure ] Bug(none) paint/invalidation/resize-skewed.html [ Failure ] -Bug(none) paint/invalidation/resize-with-border-clipped.html [ Failure ] +Bug(none) paint/invalidation/resize-with-border-clipped.html [ Pass Failure ] Bug(none) paint/invalidation/resize-with-border.html [ Failure ] Bug(none) paint/invalidation/ruby-flipped-blocks.html [ Failure ] Bug(none) paint/invalidation/scroll-absolute-layer-with-reflection.html [ Failure ] @@ -1420,34 +1411,18 @@ Bug(none) paint/invalidation/svg/embedded-svg-size-changes-no-layout-triggers.html [ Failure ] Bug(none) paint/invalidation/svg/ems-display-none.svg [ Failure ] Bug(none) paint/invalidation/svg/exs-display-none.svg [ Failure ] -Bug(none) paint/invalidation/svg/feImage-change-target-id.svg [ Failure ] -Bug(none) paint/invalidation/svg/feImage-multiple-targets-id-change.svg [ Failure ] -Bug(none) paint/invalidation/svg/feImage-reference-invalidation.svg [ Failure ] -Bug(none) paint/invalidation/svg/feImage-remove-target.svg [ Failure ] Bug(none) paint/invalidation/svg/feImage-target-add-to-document.svg [ Failure ] -Bug(none) paint/invalidation/svg/feImage-target-attribute-change-with-use-indirection-2.svg [ Failure ] -Bug(none) paint/invalidation/svg/feImage-target-attribute-change-with-use-indirection.svg [ Failure ] -Bug(none) paint/invalidation/svg/feImage-target-attribute-change.svg [ Failure ] -Bug(none) paint/invalidation/svg/feImage-target-changes-id.svg [ Failure ] -Bug(none) paint/invalidation/svg/feImage-target-id-change.svg [ Failure ] Bug(none) paint/invalidation/svg/feImage-target-inline-style-change.svg [ Failure ] -Bug(none) paint/invalidation/svg/feImage-target-property-change.svg [ Failure ] Bug(none) paint/invalidation/svg/feImage-target-reappend-to-document.svg [ Failure ] -Bug(none) paint/invalidation/svg/feImage-target-remove-from-document.svg [ Failure ] Bug(none) paint/invalidation/svg/feImage-target-style-change.svg [ Failure ] -Bug(none) paint/invalidation/svg/fecomponenttransfer-in1-change.svg [ Failure ] -Bug(none) paint/invalidation/svg/filter-child-repaint.svg [ Failure ] Bug(none) paint/invalidation/svg/filter-refresh.svg [ Failure ] -Bug(none) paint/invalidation/svg/filter-width-update.svg [ Failure ] -Bug(none) paint/invalidation/svg/focus-element.html [ Failure ] Bug(none) paint/invalidation/svg/foreign-object-repaint.svg [ Failure ] Bug(none) paint/invalidation/svg/hairline-stroke-squarecap.svg [ Failure ] -Bug(none) paint/invalidation/svg/image-animation-with-zoom.html [ Failure ] +Bug(none) paint/invalidation/svg/image-animation-with-zoom.html [ Pass Failure ] Bug(none) paint/invalidation/svg/image-with-clip-path.svg [ Failure ] Bug(none) paint/invalidation/svg/inner-svg-change-viewBox-contract.svg [ Failure ] Bug(none) paint/invalidation/svg/inner-svg-change-viewBox.svg [ Failure ] Bug(none) paint/invalidation/svg/inner-svg-change-viewPort-relative.svg [ Failure ] -Bug(none) paint/invalidation/svg/invalidate-on-child-layout.svg [ Failure ] Bug(none) paint/invalidation/svg/js-late-clipPath-and-object-creation.svg [ Failure ] Bug(none) paint/invalidation/svg/js-late-clipPath-creation.svg [ Failure ] Bug(none) paint/invalidation/svg/js-late-gradient-and-object-creation.svg [ Failure ] @@ -1472,11 +1447,9 @@ Bug(none) paint/invalidation/svg/modify-inserted-listitem.html [ Failure ] Bug(none) paint/invalidation/svg/modify-text-node-in-tspan.html [ Failure ] Bug(none) paint/invalidation/svg/modify-transferred-listitem-different-attr.html [ Failure ] -Bug(none) paint/invalidation/svg/modify-transferred-listitem.html [ Failure ] Bug(none) paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-1.html [ Failure ] Bug(none) paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-2.html [ Failure ] Bug(none) paint/invalidation/svg/object-sizing-no-width-height-change-content-box-size.xhtml [ Failure ] -Bug(none) paint/invalidation/svg/outline-offset-shape.html [ Failure ] Bug(none) paint/invalidation/svg/outline-offset-text.html [ Failure ] Bug(none) paint/invalidation/svg/paintorder-filtered.svg [ Failure ] Bug(none) paint/invalidation/svg/path-pathlength-change.html [ Failure ] @@ -1503,13 +1476,11 @@ Bug(none) paint/invalidation/svg/repaint-stroke-width-changes.svg [ Failure ] Bug(none) paint/invalidation/svg/resize-svg-invalidate-children-2.html [ Failure ] Bug(none) paint/invalidation/svg/resize-svg-invalidate-children.html [ Failure ] -Bug(none) paint/invalidation/svg/rounded-rect-height-change.html [ Failure ] Bug(none) paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem.html [ Failure ] Bug(none) paint/invalidation/svg/shape-transform-change.html [ Failure ] Bug(none) paint/invalidation/svg/shape-with-nested-outline.html [ Failure ] Bug(none) paint/invalidation/svg/stroke-opacity-update.svg [ Failure ] Bug(none) paint/invalidation/svg/svg-image-change-content-size.xhtml [ Failure ] -Bug(none) paint/invalidation/svg/svg-image-par-resize.html [ Failure ] Bug(none) paint/invalidation/svg/svgsvgelement-repaint-children.html [ Failure ] Bug(none) paint/invalidation/svg/tabgroup.svg [ Failure ] Bug(none) paint/invalidation/svg/text-dom-removal.svg [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 991f99e..2a19876 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1971,7 +1971,6 @@ # Failing because of module-related implementation/test issues. crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/crossorigin.html [ Failure ] crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/errorhandling.html [ Failure ] -crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/imports.html [ Failure ] crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/compilation-error-1.html [ Failure ] crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/compilation-error-2.html [ Failure ] crbug.com/594639 external/wpt/html/semantics/scripting-1/the-script-element/module/evaluation-error-1.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/external/wpt/custom-elements/reactions/HTMLElement-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/custom-elements/reactions/HTMLElement-expected.txt index 4c0d293..002ceb9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/custom-elements/reactions/HTMLElement-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/custom-elements/reactions/HTMLElement-expected.txt
@@ -17,8 +17,8 @@ PASS draggable on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute FAIL dropzone on HTMLElement must enqueue an attributeChanged reaction when adding dropzone content attribute assert_array_equals: lengths differ, expected 1 got 0 FAIL dropzone on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1 -FAIL contextMenu on HTMLElement must enqueue an attributeChanged reaction when adding contextmenu content attribute Failed to set the 'contextMenu' property on 'HTMLElement': The provided value is not of type 'HTMLMenuElement'. -FAIL contextMenu on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute Failed to set the 'contextMenu' property on 'HTMLElement': The provided value is not of type 'HTMLMenuElement'. +FAIL contextMenu on HTMLElement must enqueue an attributeChanged reaction when adding contextmenu content attribute assert_array_equals: lengths differ, expected 1 got 0 +FAIL contextMenu on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute assert_array_equals: lengths differ, expected 2 got 1 PASS spellcheck on HTMLElement must enqueue an attributeChanged reaction when adding spellcheck content attribute PASS spellcheck on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute PASS innerText on HTMLElement must enqueue a disconnected reaction
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-misc-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-misc-expected.txt index 732ec7e3..1d9348ac 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-misc-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-misc-expected.txt
@@ -109,8 +109,90 @@ PASS menu.hidden: 33 tests PASS menu.accessKey: 32 tests PASS menu.tabIndex: 24 tests -PASS menu.type: 52 tests -PASS menu.label: 32 tests +FAIL menu.type: typeof IDL attribute assert_equals: expected "string" but got "undefined" +FAIL menu.type: IDL get with DOM attribute unset assert_equals: expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to "" assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to undefined assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to 7 assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to 1.5 assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to true assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to false assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to object "[object Object]" assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to NaN assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to Infinity assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to -Infinity assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to "\0" assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to null assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to object "test-toString" assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to "context" assert_equals: IDL get expected (string) "context" but got (undefined) undefined +FAIL menu.type: setAttribute() to "xcontext" assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to "context\0" assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to "ontext" assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to "CONTEXT" assert_equals: IDL get expected (string) "context" but got (undefined) undefined +FAIL menu.type: setAttribute() to "toolbar" assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to "xtoolbar" assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to "toolbar\0" assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to "oolbar" assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: setAttribute() to "TOOLBAR" assert_equals: IDL get expected (string) "toolbar" but got (undefined) undefined +FAIL menu.type: IDL set to "" assert_equals: getAttribute() expected "" but got "TOOLBAR" +FAIL menu.type: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: getAttribute() expected " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " but got "TOOLBAR" +FAIL menu.type: IDL set to undefined assert_equals: getAttribute() expected "undefined" but got "TOOLBAR" +FAIL menu.type: IDL set to 7 assert_equals: getAttribute() expected "7" but got "TOOLBAR" +FAIL menu.type: IDL set to 1.5 assert_equals: getAttribute() expected "1.5" but got "TOOLBAR" +FAIL menu.type: IDL set to true assert_equals: getAttribute() expected "true" but got "TOOLBAR" +FAIL menu.type: IDL set to false assert_equals: getAttribute() expected "false" but got "TOOLBAR" +FAIL menu.type: IDL set to object "[object Object]" assert_equals: getAttribute() expected "[object Object]" but got "TOOLBAR" +FAIL menu.type: IDL set to NaN assert_equals: getAttribute() expected "NaN" but got "TOOLBAR" +FAIL menu.type: IDL set to Infinity assert_equals: getAttribute() expected "Infinity" but got "TOOLBAR" +FAIL menu.type: IDL set to -Infinity assert_equals: getAttribute() expected "-Infinity" but got "TOOLBAR" +FAIL menu.type: IDL set to "\0" assert_equals: getAttribute() expected "\0" but got "TOOLBAR" +FAIL menu.type: IDL set to null assert_equals: IDL get expected (string) "toolbar" but got (object) null +FAIL menu.type: IDL set to object "test-toString" assert_equals: getAttribute() expected "test-toString" but got "TOOLBAR" +FAIL menu.type: IDL set to object "test-valueOf" assert_equals: getAttribute() expected "test-valueOf" but got "TOOLBAR" +FAIL menu.type: IDL set to "context" assert_equals: getAttribute() expected "context" but got "TOOLBAR" +FAIL menu.type: IDL set to "xcontext" assert_equals: getAttribute() expected "xcontext" but got "TOOLBAR" +FAIL menu.type: IDL set to "context\0" assert_equals: getAttribute() expected "context\0" but got "TOOLBAR" +FAIL menu.type: IDL set to "ontext" assert_equals: getAttribute() expected "ontext" but got "TOOLBAR" +FAIL menu.type: IDL set to "CONTEXT" assert_equals: getAttribute() expected "CONTEXT" but got "TOOLBAR" +FAIL menu.type: IDL set to "toolbar" assert_equals: getAttribute() expected "toolbar" but got "TOOLBAR" +FAIL menu.type: IDL set to "xtoolbar" assert_equals: getAttribute() expected "xtoolbar" but got "TOOLBAR" +FAIL menu.type: IDL set to "toolbar\0" assert_equals: getAttribute() expected "toolbar\0" but got "TOOLBAR" +FAIL menu.type: IDL set to "oolbar" assert_equals: getAttribute() expected "oolbar" but got "TOOLBAR" +FAIL menu.type: IDL set to "TOOLBAR" assert_equals: IDL get expected "toolbar" but got "TOOLBAR" +FAIL menu.label: typeof IDL attribute assert_equals: expected "string" but got "undefined" +FAIL menu.label: IDL get with DOM attribute unset assert_equals: expected (string) "" but got (undefined) undefined +FAIL menu.label: setAttribute() to "" assert_equals: IDL get expected (string) "" but got (undefined) undefined +FAIL menu.label: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: IDL get expected (string) " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " but got (undefined) undefined +FAIL menu.label: setAttribute() to undefined assert_equals: IDL get expected (string) "undefined" but got (undefined) undefined +FAIL menu.label: setAttribute() to 7 assert_equals: IDL get expected (string) "7" but got (undefined) undefined +FAIL menu.label: setAttribute() to 1.5 assert_equals: IDL get expected (string) "1.5" but got (undefined) undefined +FAIL menu.label: setAttribute() to true assert_equals: IDL get expected (string) "true" but got (undefined) undefined +FAIL menu.label: setAttribute() to false assert_equals: IDL get expected (string) "false" but got (undefined) undefined +FAIL menu.label: setAttribute() to object "[object Object]" assert_equals: IDL get expected (string) "[object Object]" but got (undefined) undefined +FAIL menu.label: setAttribute() to NaN assert_equals: IDL get expected (string) "NaN" but got (undefined) undefined +FAIL menu.label: setAttribute() to Infinity assert_equals: IDL get expected (string) "Infinity" but got (undefined) undefined +FAIL menu.label: setAttribute() to -Infinity assert_equals: IDL get expected (string) "-Infinity" but got (undefined) undefined +FAIL menu.label: setAttribute() to "\0" assert_equals: IDL get expected (string) "\0" but got (undefined) undefined +FAIL menu.label: setAttribute() to null assert_equals: IDL get expected (string) "null" but got (undefined) undefined +FAIL menu.label: setAttribute() to object "test-toString" assert_equals: IDL get expected (string) "test-toString" but got (undefined) undefined +FAIL menu.label: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (string) "test-valueOf" but got (undefined) undefined +FAIL menu.label: IDL set to "" assert_equals: getAttribute() expected "" but got "test-valueOf" +FAIL menu.label: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: getAttribute() expected " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " but got "test-valueOf" +FAIL menu.label: IDL set to undefined assert_equals: getAttribute() expected "undefined" but got "test-valueOf" +FAIL menu.label: IDL set to 7 assert_equals: getAttribute() expected "7" but got "test-valueOf" +FAIL menu.label: IDL set to 1.5 assert_equals: getAttribute() expected "1.5" but got "test-valueOf" +FAIL menu.label: IDL set to true assert_equals: getAttribute() expected "true" but got "test-valueOf" +FAIL menu.label: IDL set to false assert_equals: getAttribute() expected "false" but got "test-valueOf" +FAIL menu.label: IDL set to object "[object Object]" assert_equals: getAttribute() expected "[object Object]" but got "test-valueOf" +FAIL menu.label: IDL set to NaN assert_equals: getAttribute() expected "NaN" but got "test-valueOf" +FAIL menu.label: IDL set to Infinity assert_equals: getAttribute() expected "Infinity" but got "test-valueOf" +FAIL menu.label: IDL set to -Infinity assert_equals: getAttribute() expected "-Infinity" but got "test-valueOf" +FAIL menu.label: IDL set to "\0" assert_equals: getAttribute() expected "\0" but got "test-valueOf" +FAIL menu.label: IDL set to null assert_equals: getAttribute() expected "null" but got "test-valueOf" +FAIL menu.label: IDL set to object "test-toString" assert_equals: getAttribute() expected "test-toString" but got "test-valueOf" +FAIL menu.label: IDL set to object "test-valueOf" assert_equals: IDL get expected (string) "test-valueOf" but got (object) object "test-valueOf" PASS menu.compact: 33 tests PASS menuitem.title: 32 tests PASS menuitem.lang: 32 tests @@ -119,13 +201,269 @@ PASS menuitem.hidden: 33 tests PASS menuitem.accessKey: 32 tests PASS menuitem.tabIndex: 24 tests -PASS menuitem.type: 62 tests -PASS menuitem.label: 32 tests -PASS menuitem.icon: 38 tests -PASS menuitem.disabled: 33 tests -PASS menuitem.checked: 33 tests -PASS menuitem.radiogroup: 32 tests -PASS menuitem.default: 33 tests +FAIL menuitem.type: typeof IDL attribute assert_equals: expected "string" but got "undefined" +FAIL menuitem.type: IDL get with DOM attribute unset assert_equals: expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to undefined assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to 7 assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to 1.5 assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to true assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to false assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to object "[object Object]" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to NaN assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to Infinity assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to -Infinity assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "\0" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to null assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to object "test-toString" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "command" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "xcommand" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "command\0" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "ommand" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "COMMAND" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "checkbox" assert_equals: IDL get expected (string) "checkbox" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "xcheckbox" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "checkbox\0" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "heckbox" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "CHECKBOX" assert_equals: IDL get expected (string) "checkbox" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "radio" assert_equals: IDL get expected (string) "radio" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "xradio" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "radio\0" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "adio" assert_equals: IDL get expected (string) "command" but got (undefined) undefined +FAIL menuitem.type: setAttribute() to "RADIO" assert_equals: IDL get expected (string) "radio" but got (undefined) undefined +FAIL menuitem.type: IDL set to "" assert_equals: getAttribute() expected "" but got "RADIO" +FAIL menuitem.type: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: getAttribute() expected " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " but got "RADIO" +FAIL menuitem.type: IDL set to undefined assert_equals: getAttribute() expected "undefined" but got "RADIO" +FAIL menuitem.type: IDL set to 7 assert_equals: getAttribute() expected "7" but got "RADIO" +FAIL menuitem.type: IDL set to 1.5 assert_equals: getAttribute() expected "1.5" but got "RADIO" +FAIL menuitem.type: IDL set to true assert_equals: getAttribute() expected "true" but got "RADIO" +FAIL menuitem.type: IDL set to false assert_equals: getAttribute() expected "false" but got "RADIO" +FAIL menuitem.type: IDL set to object "[object Object]" assert_equals: getAttribute() expected "[object Object]" but got "RADIO" +FAIL menuitem.type: IDL set to NaN assert_equals: getAttribute() expected "NaN" but got "RADIO" +FAIL menuitem.type: IDL set to Infinity assert_equals: getAttribute() expected "Infinity" but got "RADIO" +FAIL menuitem.type: IDL set to -Infinity assert_equals: getAttribute() expected "-Infinity" but got "RADIO" +FAIL menuitem.type: IDL set to "\0" assert_equals: getAttribute() expected "\0" but got "RADIO" +FAIL menuitem.type: IDL set to null assert_equals: IDL get expected (string) "command" but got (object) null +FAIL menuitem.type: IDL set to object "test-toString" assert_equals: getAttribute() expected "test-toString" but got "RADIO" +FAIL menuitem.type: IDL set to object "test-valueOf" assert_equals: getAttribute() expected "test-valueOf" but got "RADIO" +FAIL menuitem.type: IDL set to "command" assert_equals: getAttribute() expected "command" but got "RADIO" +FAIL menuitem.type: IDL set to "xcommand" assert_equals: getAttribute() expected "xcommand" but got "RADIO" +FAIL menuitem.type: IDL set to "command\0" assert_equals: getAttribute() expected "command\0" but got "RADIO" +FAIL menuitem.type: IDL set to "ommand" assert_equals: getAttribute() expected "ommand" but got "RADIO" +FAIL menuitem.type: IDL set to "COMMAND" assert_equals: getAttribute() expected "COMMAND" but got "RADIO" +FAIL menuitem.type: IDL set to "checkbox" assert_equals: getAttribute() expected "checkbox" but got "RADIO" +FAIL menuitem.type: IDL set to "xcheckbox" assert_equals: getAttribute() expected "xcheckbox" but got "RADIO" +FAIL menuitem.type: IDL set to "checkbox\0" assert_equals: getAttribute() expected "checkbox\0" but got "RADIO" +FAIL menuitem.type: IDL set to "heckbox" assert_equals: getAttribute() expected "heckbox" but got "RADIO" +FAIL menuitem.type: IDL set to "CHECKBOX" assert_equals: getAttribute() expected "CHECKBOX" but got "RADIO" +FAIL menuitem.type: IDL set to "radio" assert_equals: getAttribute() expected "radio" but got "RADIO" +FAIL menuitem.type: IDL set to "xradio" assert_equals: getAttribute() expected "xradio" but got "RADIO" +FAIL menuitem.type: IDL set to "radio\0" assert_equals: getAttribute() expected "radio\0" but got "RADIO" +FAIL menuitem.type: IDL set to "adio" assert_equals: getAttribute() expected "adio" but got "RADIO" +FAIL menuitem.type: IDL set to "RADIO" assert_equals: IDL get expected "radio" but got "RADIO" +FAIL menuitem.label: typeof IDL attribute assert_equals: expected "string" but got "undefined" +FAIL menuitem.label: IDL get with DOM attribute unset assert_equals: expected (string) "" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to "" assert_equals: IDL get expected (string) "" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: IDL get expected (string) " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " but got (undefined) undefined +FAIL menuitem.label: setAttribute() to undefined assert_equals: IDL get expected (string) "undefined" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to 7 assert_equals: IDL get expected (string) "7" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to 1.5 assert_equals: IDL get expected (string) "1.5" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to true assert_equals: IDL get expected (string) "true" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to false assert_equals: IDL get expected (string) "false" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to object "[object Object]" assert_equals: IDL get expected (string) "[object Object]" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to NaN assert_equals: IDL get expected (string) "NaN" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to Infinity assert_equals: IDL get expected (string) "Infinity" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to -Infinity assert_equals: IDL get expected (string) "-Infinity" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to "\0" assert_equals: IDL get expected (string) "\0" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to null assert_equals: IDL get expected (string) "null" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to object "test-toString" assert_equals: IDL get expected (string) "test-toString" but got (undefined) undefined +FAIL menuitem.label: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (string) "test-valueOf" but got (undefined) undefined +FAIL menuitem.label: IDL set to "" assert_equals: getAttribute() expected "" but got "test-valueOf" +FAIL menuitem.label: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: getAttribute() expected " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " but got "test-valueOf" +FAIL menuitem.label: IDL set to undefined assert_equals: getAttribute() expected "undefined" but got "test-valueOf" +FAIL menuitem.label: IDL set to 7 assert_equals: getAttribute() expected "7" but got "test-valueOf" +FAIL menuitem.label: IDL set to 1.5 assert_equals: getAttribute() expected "1.5" but got "test-valueOf" +FAIL menuitem.label: IDL set to true assert_equals: getAttribute() expected "true" but got "test-valueOf" +FAIL menuitem.label: IDL set to false assert_equals: getAttribute() expected "false" but got "test-valueOf" +FAIL menuitem.label: IDL set to object "[object Object]" assert_equals: getAttribute() expected "[object Object]" but got "test-valueOf" +FAIL menuitem.label: IDL set to NaN assert_equals: getAttribute() expected "NaN" but got "test-valueOf" +FAIL menuitem.label: IDL set to Infinity assert_equals: getAttribute() expected "Infinity" but got "test-valueOf" +FAIL menuitem.label: IDL set to -Infinity assert_equals: getAttribute() expected "-Infinity" but got "test-valueOf" +FAIL menuitem.label: IDL set to "\0" assert_equals: getAttribute() expected "\0" but got "test-valueOf" +FAIL menuitem.label: IDL set to null assert_equals: getAttribute() expected "null" but got "test-valueOf" +FAIL menuitem.label: IDL set to object "test-toString" assert_equals: getAttribute() expected "test-toString" but got "test-valueOf" +FAIL menuitem.label: IDL set to object "test-valueOf" assert_equals: IDL get expected (string) "test-valueOf" but got (object) object "test-valueOf" +FAIL menuitem.icon: typeof IDL attribute assert_equals: expected "string" but got "undefined" +FAIL menuitem.icon: IDL get with DOM attribute unset assert_equals: expected (string) "" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to "" assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/reflection-misc.html" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to " foo " assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/foo" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to "http://site.example/" assert_equals: IDL get expected (string) "http://site.example/" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to "//site.example/path???@#l" assert_equals: IDL get expected (string) "http://site.example/path???@#l" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to "\0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f " assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/reflection-misc.html" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to undefined assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/undefined" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to 7 assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/7" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to 1.5 assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/1.5" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to true assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/true" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to false assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/false" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to object "[object Object]" assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/[object%20Object]" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to NaN assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/NaN" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to Infinity assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/Infinity" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to -Infinity assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/-Infinity" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to "\0" assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/reflection-misc.html" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to null assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/null" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to object "test-toString" assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/test-toString" but got (undefined) undefined +FAIL menuitem.icon: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/test-valueOf" but got (undefined) undefined +FAIL menuitem.icon: IDL set to "" assert_equals: getAttribute() expected "" but got "test-valueOf" +FAIL menuitem.icon: IDL set to " foo " assert_equals: getAttribute() expected " foo " but got "test-valueOf" +FAIL menuitem.icon: IDL set to "http://site.example/" assert_equals: getAttribute() expected "http://site.example/" but got "test-valueOf" +FAIL menuitem.icon: IDL set to "//site.example/path???@#l" assert_equals: getAttribute() expected "//site.example/path???@#l" but got "test-valueOf" +FAIL menuitem.icon: IDL set to "\0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f " assert_equals: getAttribute() expected "\0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f " but got "test-valueOf" +FAIL menuitem.icon: IDL set to undefined assert_equals: getAttribute() expected "undefined" but got "test-valueOf" +FAIL menuitem.icon: IDL set to 7 assert_equals: getAttribute() expected "7" but got "test-valueOf" +FAIL menuitem.icon: IDL set to 1.5 assert_equals: getAttribute() expected "1.5" but got "test-valueOf" +FAIL menuitem.icon: IDL set to true assert_equals: getAttribute() expected "true" but got "test-valueOf" +FAIL menuitem.icon: IDL set to false assert_equals: getAttribute() expected "false" but got "test-valueOf" +FAIL menuitem.icon: IDL set to object "[object Object]" assert_equals: getAttribute() expected "[object Object]" but got "test-valueOf" +FAIL menuitem.icon: IDL set to NaN assert_equals: getAttribute() expected "NaN" but got "test-valueOf" +FAIL menuitem.icon: IDL set to Infinity assert_equals: getAttribute() expected "Infinity" but got "test-valueOf" +FAIL menuitem.icon: IDL set to -Infinity assert_equals: getAttribute() expected "-Infinity" but got "test-valueOf" +FAIL menuitem.icon: IDL set to "\0" assert_equals: getAttribute() expected "\0" but got "test-valueOf" +FAIL menuitem.icon: IDL set to null assert_equals: getAttribute() expected "null" but got "test-valueOf" +FAIL menuitem.icon: IDL set to object "test-toString" assert_equals: getAttribute() expected "test-toString" but got "test-valueOf" +FAIL menuitem.icon: IDL set to object "test-valueOf" assert_equals: IDL get expected (string) "http://web-platform.test:8001/html/dom/test-valueOf" but got (object) object "test-valueOf" +FAIL menuitem.disabled: typeof IDL attribute assert_equals: expected "boolean" but got "undefined" +FAIL menuitem.disabled: IDL get with DOM attribute unset assert_equals: expected (boolean) false but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to "" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to " foo " assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to undefined assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to null assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to 7 assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to 1.5 assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to true assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to false assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to NaN assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to -Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to "\0" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to object "test-toString" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: setAttribute() to "disabled" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.disabled: IDL set to "" assert_equals: hasAttribute() expected false but got true +FAIL menuitem.disabled: IDL set to " foo " assert_equals: IDL get expected (boolean) true but got (string) " foo " +FAIL menuitem.disabled: IDL set to undefined assert_equals: hasAttribute() expected false but got true +FAIL menuitem.disabled: IDL set to null assert_equals: hasAttribute() expected false but got true +FAIL menuitem.disabled: IDL set to 7 assert_equals: IDL get expected (boolean) true but got (number) 7 +FAIL menuitem.disabled: IDL set to 1.5 assert_equals: IDL get expected (boolean) true but got (number) 1.5 +PASS menuitem.disabled: IDL set to true +FAIL menuitem.disabled: IDL set to false assert_equals: hasAttribute() expected false but got true +FAIL menuitem.disabled: IDL set to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (object) object "[object Object]" +FAIL menuitem.disabled: IDL set to NaN assert_equals: hasAttribute() expected false but got true +FAIL menuitem.disabled: IDL set to Infinity assert_equals: IDL get expected (boolean) true but got (number) Infinity +FAIL menuitem.disabled: IDL set to -Infinity assert_equals: IDL get expected (boolean) true but got (number) -Infinity +FAIL menuitem.disabled: IDL set to "\0" assert_equals: IDL get expected (boolean) true but got (string) "\0" +FAIL menuitem.disabled: IDL set to object "test-toString" assert_equals: IDL get expected (boolean) true but got (object) object "test-toString" +FAIL menuitem.disabled: IDL set to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (object) object "test-valueOf" +FAIL menuitem.checked: typeof IDL attribute assert_equals: expected "boolean" but got "undefined" +FAIL menuitem.checked: IDL get with DOM attribute unset assert_equals: expected (boolean) false but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to "" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to " foo " assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to undefined assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to null assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to 7 assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to 1.5 assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to true assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to false assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to NaN assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to -Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to "\0" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to object "test-toString" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: setAttribute() to "checked" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.checked: IDL set to "" assert_equals: hasAttribute() expected false but got true +FAIL menuitem.checked: IDL set to " foo " assert_equals: IDL get expected (boolean) true but got (string) " foo " +FAIL menuitem.checked: IDL set to undefined assert_equals: hasAttribute() expected false but got true +FAIL menuitem.checked: IDL set to null assert_equals: hasAttribute() expected false but got true +FAIL menuitem.checked: IDL set to 7 assert_equals: IDL get expected (boolean) true but got (number) 7 +FAIL menuitem.checked: IDL set to 1.5 assert_equals: IDL get expected (boolean) true but got (number) 1.5 +PASS menuitem.checked: IDL set to true +FAIL menuitem.checked: IDL set to false assert_equals: hasAttribute() expected false but got true +FAIL menuitem.checked: IDL set to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (object) object "[object Object]" +FAIL menuitem.checked: IDL set to NaN assert_equals: hasAttribute() expected false but got true +FAIL menuitem.checked: IDL set to Infinity assert_equals: IDL get expected (boolean) true but got (number) Infinity +FAIL menuitem.checked: IDL set to -Infinity assert_equals: IDL get expected (boolean) true but got (number) -Infinity +FAIL menuitem.checked: IDL set to "\0" assert_equals: IDL get expected (boolean) true but got (string) "\0" +FAIL menuitem.checked: IDL set to object "test-toString" assert_equals: IDL get expected (boolean) true but got (object) object "test-toString" +FAIL menuitem.checked: IDL set to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (object) object "test-valueOf" +FAIL menuitem.radiogroup: typeof IDL attribute assert_equals: expected "string" but got "undefined" +FAIL menuitem.radiogroup: IDL get with DOM attribute unset assert_equals: expected (string) "" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to "" assert_equals: IDL get expected (string) "" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: IDL get expected (string) " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to undefined assert_equals: IDL get expected (string) "undefined" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to 7 assert_equals: IDL get expected (string) "7" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to 1.5 assert_equals: IDL get expected (string) "1.5" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to true assert_equals: IDL get expected (string) "true" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to false assert_equals: IDL get expected (string) "false" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to object "[object Object]" assert_equals: IDL get expected (string) "[object Object]" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to NaN assert_equals: IDL get expected (string) "NaN" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to Infinity assert_equals: IDL get expected (string) "Infinity" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to -Infinity assert_equals: IDL get expected (string) "-Infinity" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to "\0" assert_equals: IDL get expected (string) "\0" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to null assert_equals: IDL get expected (string) "null" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to object "test-toString" assert_equals: IDL get expected (string) "test-toString" but got (undefined) undefined +FAIL menuitem.radiogroup: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (string) "test-valueOf" but got (undefined) undefined +FAIL menuitem.radiogroup: IDL set to "" assert_equals: getAttribute() expected "" but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: getAttribute() expected " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to undefined assert_equals: getAttribute() expected "undefined" but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to 7 assert_equals: getAttribute() expected "7" but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to 1.5 assert_equals: getAttribute() expected "1.5" but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to true assert_equals: getAttribute() expected "true" but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to false assert_equals: getAttribute() expected "false" but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to object "[object Object]" assert_equals: getAttribute() expected "[object Object]" but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to NaN assert_equals: getAttribute() expected "NaN" but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to Infinity assert_equals: getAttribute() expected "Infinity" but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to -Infinity assert_equals: getAttribute() expected "-Infinity" but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to "\0" assert_equals: getAttribute() expected "\0" but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to null assert_equals: getAttribute() expected "null" but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to object "test-toString" assert_equals: getAttribute() expected "test-toString" but got "test-valueOf" +FAIL menuitem.radiogroup: IDL set to object "test-valueOf" assert_equals: IDL get expected (string) "test-valueOf" but got (object) object "test-valueOf" +FAIL menuitem.default: typeof IDL attribute assert_equals: expected "boolean" but got "undefined" +FAIL menuitem.default: IDL get with DOM attribute unset assert_equals: expected (boolean) false but got (undefined) undefined +FAIL menuitem.default: setAttribute() to "" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to " foo " assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to undefined assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to null assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to 7 assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to 1.5 assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to true assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to false assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to NaN assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to -Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to "\0" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to object "test-toString" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: setAttribute() to "default" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL menuitem.default: IDL set to "" assert_equals: hasAttribute() expected false but got true +FAIL menuitem.default: IDL set to " foo " assert_equals: IDL get expected (boolean) true but got (string) " foo " +FAIL menuitem.default: IDL set to undefined assert_equals: hasAttribute() expected false but got true +FAIL menuitem.default: IDL set to null assert_equals: hasAttribute() expected false but got true +FAIL menuitem.default: IDL set to 7 assert_equals: IDL get expected (boolean) true but got (number) 7 +FAIL menuitem.default: IDL set to 1.5 assert_equals: IDL get expected (boolean) true but got (number) 1.5 +PASS menuitem.default: IDL set to true +FAIL menuitem.default: IDL set to false assert_equals: hasAttribute() expected false but got true +FAIL menuitem.default: IDL set to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (object) object "[object Object]" +FAIL menuitem.default: IDL set to NaN assert_equals: hasAttribute() expected false but got true +FAIL menuitem.default: IDL set to Infinity assert_equals: IDL get expected (boolean) true but got (number) Infinity +FAIL menuitem.default: IDL set to -Infinity assert_equals: IDL get expected (boolean) true but got (number) -Infinity +FAIL menuitem.default: IDL set to "\0" assert_equals: IDL get expected (boolean) true but got (string) "\0" +FAIL menuitem.default: IDL set to object "test-toString" assert_equals: IDL get expected (boolean) true but got (object) object "test-toString" +FAIL menuitem.default: IDL set to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (object) object "test-valueOf" PASS dialog.title: 32 tests PASS dialog.lang: 32 tests PASS dialog.dir: 62 tests
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/interactive-elements/the-menu-element/menuitem-label-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/interactive-elements/the-menu-element/menuitem-label-expected.txt new file mode 100644 index 0000000..5b43566 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/interactive-elements/the-menu-element/menuitem-label-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Menuitem.label should be the label attribute content or the result of stripping and collapsing ASCII whitespace from the child text content. assert_equals: expected (string) "item1" but got (undefined) undefined +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/interfaces-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/interfaces-expected.txt index b7d1d30..f55c54fa 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/interfaces-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/interfaces-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 295 tests; 286 PASS, 9 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 295 tests; 284 PASS, 11 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Interfaces for a PASS Interfaces for A PASS Interfaces for abbr @@ -167,8 +167,8 @@ PASS Interfaces for MARQUEE PASS Interfaces for menu PASS Interfaces for MENU -PASS Interfaces for menuitem -PASS Interfaces for MENUITEM +FAIL Interfaces for menuitem assert_equals: Element menuitem should have HTMLMenuItemElement as its primary interface. expected "[object HTMLMenuItemElement]" but got "[object HTMLUnknownElement]" +FAIL Interfaces for MENUITEM assert_equals: Element MENUITEM should have HTMLMenuItemElement as its primary interface. expected "[object HTMLMenuItemElement]" but got "[object HTMLUnknownElement]" PASS Interfaces for meta PASS Interfaces for META PASS Interfaces for meter
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/imports-cycle.js b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/imports-cycle.js index 9f452e4..88a77a4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/imports-cycle.js +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/imports-cycle.js
@@ -1,5 +1,6 @@ import { CycleA } from "./imports-cycle-a.js"; test_importCycle.step(function () { - assert_unreached("This module should not have loaded!"); + assert_equals(CycleA, "CycleA"); + test_importCycle.done(); });
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/imports-self.js b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/imports-self.js index 32eb7b6..05fa60e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/imports-self.js +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/imports-self.js
@@ -1,5 +1,6 @@ import { SelfInner } from "./imports-self-inner.js"; test_importSelf.step(function () { - assert_unreached("This module should not have loaded!"); + assert_equals(SelfInner, "SelfInner"); + test_importSelf.done(); });
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/imports.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/imports.html index 91a0fd35..ca69007 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/imports.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/imports.html
@@ -52,13 +52,13 @@ </script> <script> - var test_importSelf = async_test("Import a module that tries to import itself"); + var test_importSelf = async_test("Import a module that validly imports itself"); </script> - <script type="module" src="imports-self.js" onerror="test_importSelf.done();"></script> + <script type="module" src="imports-self.js"></script> <script> - var test_importCycle = async_test("Import a module with a cyclical module dependency"); + var test_importCycle = async_test("Import a module with a valid cyclical module dependency"); </script> - <script type="module" src="imports-cycle.js" onerror="test_importCycle.done();"></script> + <script type="module" src="imports-cycle.js"></script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/contextmenu-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/contextmenu-expected.txt deleted file mode 100644 index c5909c3..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/contextmenu-expected.txt +++ /dev/null
@@ -1,65 +0,0 @@ -Tests the contextmenu attribute. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -Test with valid contextmenu attribute -PASS document.getElementById('container1').contextMenu.id is "menu1" -PASS document.getElementById('container1').contextMenu.type is "context" -PASS document.getElementById('container1').contextMenu.label is "menu 1" -Test with invalid contextmenu attribute -PASS document.getElementById('container2').contextMenu is null -Test setting contextmenu attribute to non-context type menu element -PASS container11.contextMenu.id is "menu11" -PASS container11.contextMenu.type is "toolbar" -PASS container11.contextMenu.label is "menu 11" -Test setting contextmenu attribute to non-menu element -PASS container12.contextMenu is null -Test setting contextmenu attribute to an ID which multiple elements have -PASS container13.contextMenu is null -PASS container14.contextMenu.id is "menu14" -PASS container14.contextMenu.type is "context" -PASS container14.contextMenu.label is "menu 14" -Test setting contextmenu attribute -PASS container3.contextMenu.id is "menu3" -PASS container3.contextMenu.type is "context" -PASS container3.contextMenu.label is "menu 3" -Test setting contextmenu attribute with menu element without id -PASS container4.contextMenu is null -PASS container4.hasAttribute('contextmenu') is true -PASS container4.getAttribute('contextmenu') is "" -Test setting contextmenu attribute with multiple menu element with same id -PASS container5.contextMenu is null -PASS container5.contextMenu is menu2 -Test setting contextmenu attribute to null -PASS container6.contextMenu is null -PASS container6.hasAttribute('contextmenu') is true -PASS container6.getAttribute('contextmenu') is "" -Test setting contextmenu attribute to some text -PASS container7.contextMenu = 'foobar' threw exception TypeError: Failed to set the 'contextMenu' property on 'HTMLElement': The provided value is not of type 'HTMLMenuElement'.. -PASS container7.contextMenu is null -Test setting contextmenu attribute to comment -PASS container8.contextMenu = document.createComment('foo') threw exception TypeError: Failed to set the 'contextMenu' property on 'HTMLElement': The provided value is not of type 'HTMLMenuElement'.. -PASS container8.contextMenu is null -Test setting contextmenu attribute to menu without type -PASS container9.contextMenu.id is "menu_without_type" -PASS container9.contextMenu.type is "toolbar" -PASS container9.contextMenu.label is "menu without type" -Test setting contextmenu attribute to menu element which is in shadow dom -PASS container10.contextMenu is null -Test contextmenu attribute of an element with no contextmenu attribute but parent has valid contextmenu -PASS inner.contextMenu is null -Test setting menu type when parent is contextmenu -PASS menu15.type is "context" -PASS menu16.type is "context" -PASS menu16.type is "context" -PASS menu15.type is "toolbar" -PASS menu16.type is "toolbar" -PASS successfullyParsed is true - -TEST COMPLETE - - - - -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/contextmenu.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/contextmenu.html deleted file mode 100644 index 2167e55..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/contextmenu.html +++ /dev/null
@@ -1,146 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<script> - -description("Tests the contextmenu attribute."); - -debug("Test with valid contextmenu attribute"); -document.write("<div id='container1' contextmenu='menu1'><menu id='menu1' type='context' label='menu 1'></menu></div>"); -shouldBeEqualToString("document.getElementById('container1').contextMenu.id", "menu1"); -shouldBeEqualToString("document.getElementById('container1').contextMenu.type", "context"); -shouldBeEqualToString("document.getElementById('container1').contextMenu.label", "menu 1"); - -debug("Test with invalid contextmenu attribute"); -document.write("<div id='container2' contextmenu='nonexistent_menu'><menu id='menu2' type='context' label='menu 2'></menu></div>"); -shouldBeNull("document.getElementById('container2').contextMenu"); - -debug("Test setting contextmenu attribute to non-context type menu element"); -document.write("<div id='container11' contextmenu='menu11'><menu id='menu11' type='toolbar' label='menu 11'></menu></div>"); -var container11 = document.getElementById('container11'); -shouldBeEqualToString("container11.contextMenu.id", "menu11"); -shouldBeEqualToString("container11.contextMenu.type", "toolbar"); -shouldBeEqualToString("container11.contextMenu.label", "menu 11"); - -debug("Test setting contextmenu attribute to non-menu element"); -document.write("<div id='container12' contextmenu='button'><button id='button'></button></div>"); -var container12 = document.getElementById('container12'); -shouldBeNull("container12.contextMenu"); - -debug("Test setting contextmenu attribute to an ID which multiple elements have"); -document.write("<div id='container13' contextmenu='menu13'><button id='menu13'></button><menu id='menu13' type='context' label='menu 13'></menu></div>"); -var container13 = document.getElementById('container13'); -shouldBeNull("container13.contextMenu"); -document.write("<div id='container14' contextmenu='menu14'><menu id='menu14' type='context' label='menu 14'></menu><button id='menu14'></button></div>"); -var container14 = document.getElementById('container14'); -shouldBeEqualToString("container14.contextMenu.id", "menu14"); -shouldBeEqualToString("container14.contextMenu.type", "context"); -shouldBeEqualToString("container14.contextMenu.label", "menu 14"); - -debug("Test setting contextmenu attribute"); -document.write("<div id='container3'></div>"); -var menu = document.createElement('menu'); -menu.id = 'menu3'; -menu.type = 'context'; -menu.label = 'menu 3'; -document.getElementById('container3').appendChild(menu); -var container3 = document.getElementById('container3'); -container3.contextMenu = menu; -shouldBeEqualToString("container3.contextMenu.id", "menu3"); -shouldBeEqualToString("container3.contextMenu.type", "context"); -shouldBeEqualToString("container3.contextMenu.label", "menu 3"); - -debug("Test setting contextmenu attribute with menu element without id"); -document.write("<div id='container4'></div>"); -var menu1 = document.createElement('menu'); -menu1.type = 'context'; -menu1.label = 'menu 4'; -document.getElementById('container4').appendChild(menu1); -var container4 = document.getElementById('container4'); -container4.contextMenu = menu1; -shouldBeNull("container4.contextMenu"); -shouldBeTrue("container4.hasAttribute('contextmenu')"); -shouldBeEqualToString("container4.getAttribute('contextmenu')", ""); - -debug("Test setting contextmenu attribute with multiple menu element with same id"); -document.write("<div id='container5'></div>"); -var menu2 = document.createElement('menu'); -menu2.id = 'menu5'; -menu2.type = 'context'; -menu2.label = 'menu 5'; -var menu3 = document.createElement('menu'); -menu3.id = 'menu5'; -menu3.type = 'context'; -menu3.label = 'menu 6'; -document.getElementById('container5').appendChild(menu2); -document.getElementById('container5').appendChild(menu3); -var container5 = document.getElementById('container5'); -container5.contextMenu = menu3; -shouldBeNull("container5.contextMenu"); -container5.contextMenu = menu2; -shouldBe("container5.contextMenu", "menu2"); - -debug("Test setting contextmenu attribute to null"); -document.write("<div id='container6' contextmenu='menu6'><menu id='menu6'></menu></div>"); -var container6 = document.getElementById('container6'); -container6.contextMenu = null; -shouldBeNull("container6.contextMenu"); -shouldBeTrue("container6.hasAttribute('contextmenu')"); -shouldBeEqualToString("container6.getAttribute('contextmenu')", ""); - -debug("Test setting contextmenu attribute to some text"); -document.write("<div id='container7'></div>"); -var container7 = document.getElementById('container7'); -shouldThrow("container7.contextMenu = 'foobar'"); -shouldBeNull("container7.contextMenu"); - -debug("Test setting contextmenu attribute to comment"); -document.write("<div id='container8'></div>"); -var container8 = document.getElementById('container8'); -shouldThrow("container8.contextMenu = document.createComment('foo')"); -shouldBeNull("container8.contextMenu"); - -debug("Test setting contextmenu attribute to menu without type"); -document.write("<div id='container9'></div>"); -var menu4 = document.createElement('menu'); -menu4.id = 'menu_without_type'; -menu4.label = 'menu without type'; -document.getElementById('container9').appendChild(menu4); -var container9 = document.getElementById('container9'); -container9.contextMenu = menu4; -shouldBeEqualToString("container9.contextMenu.id", "menu_without_type"); -shouldBeEqualToString("container9.contextMenu.type", "toolbar"); -shouldBeEqualToString("container9.contextMenu.label", "menu without type"); - -debug("Test setting contextmenu attribute to menu element which is in shadow dom"); -document.write("<div id='container10'></div>"); -var menu5 = document.createElement('menu'); -menu5.id = 'menu_in_shadow_dom'; -menu5.label = 'menu in shadow dom'; -var container10 = document.getElementById('container10'); -container10.createShadowRoot().appendChild(menu5); -container10.contextMenu = menu5; -shouldBeNull("container10.contextMenu"); - -debug("Test contextmenu attribute of an element with no contextmenu attribute but parent has valid contextmenu"); -document.write("<div contextmenu='menu7'><button id='inner'></button><menu id='menu7' type='context' label='menu 7'></menu></div>"); -var inner = document.getElementById('inner'); -shouldBeNull("inner.contextMenu"); - -debug("Test setting menu type when parent is contextmenu"); -document.write("<menu id='menu15' type='context'></menu>"); -var menu15 = document.getElementById('menu15'); -var menu16 = document.createElement('menu'); -menu16.id = 'menu16'; -menu15.appendChild(menu16); -shouldBeEqualToString("menu15.type", "context"); -shouldBeEqualToString("menu16.type", "context"); -menu16.type = 'popup'; -shouldBeEqualToString("menu16.type", "context"); -menu15.type = 'toolbar'; -shouldBeEqualToString("menu15.type", "toolbar"); -shouldBeEqualToString("menu16.type", "toolbar"); -</script> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection-expected.txt index cd9c9e0..f74d535 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection-expected.txt
@@ -71,18 +71,6 @@ PASS e = make('menu'); e.setAttribute('compact', ''); e.compact is true PASS e = make('menu'); e.setAttribute('compact', 'x'); e.compact = false; e.getAttribute('compact') is null PASS e = make('menu'); e.setAttribute('compact', 'x'); e.compact = true; e.getAttribute('compact') is '' -PASS e = make('menuitem'); e.removeAttribute('checked'); e.checked is false -PASS e = make('menuitem'); e.setAttribute('checked', ''); e.checked is true -PASS e = make('menuitem'); e.setAttribute('checked', 'x'); e.checked = false; e.getAttribute('checked') is null -PASS e = make('menuitem'); e.setAttribute('checked', 'x'); e.checked = true; e.getAttribute('checked') is '' -PASS e = make('menuitem'); e.removeAttribute('default'); e.default is false -PASS e = make('menuitem'); e.setAttribute('default', ''); e.default is true -PASS e = make('menuitem'); e.setAttribute('default', 'x'); e.default = false; e.getAttribute('default') is null -PASS e = make('menuitem'); e.setAttribute('default', 'x'); e.default = true; e.getAttribute('default') is '' -PASS e = make('menuitem'); e.removeAttribute('disabled'); e.disabled is false -PASS e = make('menuitem'); e.setAttribute('disabled', ''); e.disabled is true -PASS e = make('menuitem'); e.setAttribute('disabled', 'x'); e.disabled = false; e.getAttribute('disabled') is null -PASS e = make('menuitem'); e.setAttribute('disabled', 'x'); e.disabled = true; e.getAttribute('disabled') is '' PASS e = make('object'); e.removeAttribute('declare'); e.declare is false PASS e = make('object'); e.setAttribute('declare', ''); e.declare is true PASS e = make('object'); e.setAttribute('declare', 'x'); e.declare = false; e.getAttribute('declare') is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection.html b/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection.html index b62a38c3..320684a 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection.html +++ b/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection.html
@@ -25,9 +25,6 @@ [ "input", "required" ], [ "link", "disabled" ], [ "menu", "compact" ], - [ "menuitem", "checked" ], - [ "menuitem", "default" ], - [ "menuitem", "disabled" ], [ "object", "declare" ], [ "ol", "compact" ], [ "option", "defaultSelected", "selected" ],
diff --git a/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt index 96c2f77..cf14816 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt
@@ -148,66 +148,6 @@ PASS element.getAttribute("step") is "456" -Reflected DOMString attribute test for menu/@label -Initial value: -PASS element.label is "" -PASS element.getAttribute("label") is null -Setting a value via the IDL attribute: -PASS element.label = "foo"; element.label is "foo" -PASS element.getAttribute("label") is "foo" -Setting a value via the content attribute: -PASS element.setAttribute("label", " bar\n"); element.label is " bar\n" -PASS element.getAttribute("label") is " bar\n" -Setting null via the IDL attribute: -PASS element.label = null; element.label is "null" -PASS element.getAttribute("label") is "null" -Setting null via the content attribute: -PASS element.setAttribute("label", null); element.label is "null" -PASS element.getAttribute("label") is "null" -Setting undefined via the IDL attribute: -PASS element.label = undefined; element.label is "undefined" -PASS element.getAttribute("label") is "undefined" -Setting undefined via the content attribute: -PASS element.setAttribute("label", undefined); element.label is "undefined" -PASS element.getAttribute("label") is "undefined" -Setting non-string via the IDL attribute: -PASS element.label = 123; element.label is "123" -PASS element.getAttribute("label") is "123" -Setting non-string via the content attribute: -PASS element.setAttribute("label", 456); element.label is "456" -PASS element.getAttribute("label") is "456" - - -Reflected DOMString attribute test for menuitem/@label -Initial value: -PASS element.label is "" -PASS element.getAttribute("label") is null -Setting a value via the IDL attribute: -PASS element.label = "foo"; element.label is "foo" -PASS element.getAttribute("label") is "foo" -Setting a value via the content attribute: -PASS element.setAttribute("label", " bar\n"); element.label is " bar\n" -PASS element.getAttribute("label") is " bar\n" -Setting null via the IDL attribute: -PASS element.label = null; element.label is "null" -PASS element.getAttribute("label") is "null" -Setting null via the content attribute: -PASS element.setAttribute("label", null); element.label is "null" -PASS element.getAttribute("label") is "null" -Setting undefined via the IDL attribute: -PASS element.label = undefined; element.label is "undefined" -PASS element.getAttribute("label") is "undefined" -Setting undefined via the content attribute: -PASS element.setAttribute("label", undefined); element.label is "undefined" -PASS element.getAttribute("label") is "undefined" -Setting non-string via the IDL attribute: -PASS element.label = 123; element.label is "123" -PASS element.getAttribute("label") is "123" -Setting non-string via the content attribute: -PASS element.setAttribute("label", 456); element.label is "456" -PASS element.getAttribute("label") is "456" - - Reflected DOMString attribute test for object/@name Initial value: PASS element.name is ""
diff --git a/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection.html b/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection.html index 0b9704a..9eef09c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection.html +++ b/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection.html
@@ -58,8 +58,6 @@ testDOMStringReflection('form', 'name'); testDOMStringReflection('input', 'name'); testDOMStringReflection('input', 'step'); -testDOMStringReflection('menu', 'label'); -testDOMStringReflection('menuitem', 'label'); testDOMStringReflection('object', 'name'); testDOMStringReflection('output', 'name'); testDOMStringReflection('select', 'name');
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/related-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/related-event-constructor-expected.txt deleted file mode 100644 index 9e10cd8f..0000000 --- a/third_party/WebKit/LayoutTests/fast/events/constructors/related-event-constructor-expected.txt +++ /dev/null
@@ -1,32 +0,0 @@ -This tests the constructor for the RelatedEvent DOM class. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS new RelatedEvent('eventType').bubbles is false -PASS new RelatedEvent('eventType').cancelable is false -PASS new RelatedEvent('eventType').relatedTarget is null -PASS new RelatedEvent('eventType', { bubbles: false }).bubbles is false -PASS new RelatedEvent('eventType', { bubbles: true }).bubbles is true -PASS new RelatedEvent('eventType', { cancelable: false }).cancelable is false -PASS new RelatedEvent('eventType', { cancelable: true }).cancelable is true -PASS new RelatedEvent('eventType', { relatedTarget: testDiv }).relatedTarget is testDiv -PASS new RelatedEvent('eventType', { relatedTarget: document }).relatedTarget is document -PASS new RelatedEvent('eventType', { relatedTarget: window }).relatedTarget is window -PASS new RelatedEvent('eventType', { relatedTarget: testObject }).relatedTarget threw exception TypeError: Failed to construct 'RelatedEvent': member relatedTarget is not of type EventTarget.. -PASS new RelatedEvent('eventType', { relatedTarget: false }).relatedTarget threw exception TypeError: Failed to construct 'RelatedEvent': member relatedTarget is not of type EventTarget.. -PASS new RelatedEvent('eventType', { relatedTarget: true }).relatedTarget threw exception TypeError: Failed to construct 'RelatedEvent': member relatedTarget is not of type EventTarget.. -PASS new RelatedEvent('eventType', { relatedTarget: '' }).relatedTarget threw exception TypeError: Failed to construct 'RelatedEvent': member relatedTarget is not of type EventTarget.. -PASS new RelatedEvent('eventType', { relatedTarget: 'chocolate' }).relatedTarget threw exception TypeError: Failed to construct 'RelatedEvent': member relatedTarget is not of type EventTarget.. -PASS new RelatedEvent('eventType', { relatedTarget: 12345 }).relatedTarget threw exception TypeError: Failed to construct 'RelatedEvent': member relatedTarget is not of type EventTarget.. -PASS new RelatedEvent('eventType', { relatedTarget: 18446744073709551615 }).relatedTarget threw exception TypeError: Failed to construct 'RelatedEvent': member relatedTarget is not of type EventTarget.. -PASS new RelatedEvent('eventType', { relatedTarget: NaN }).relatedTarget threw exception TypeError: Failed to construct 'RelatedEvent': member relatedTarget is not of type EventTarget.. -PASS new RelatedEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }).relatedTarget == testDiv threw exception TypeError: Failed to construct 'RelatedEvent': member relatedTarget is not of type EventTarget.. -PASS new RelatedEvent('eventType', { get relatedTarget() { return testDiv; } }).relatedTarget == testDiv is true -PASS new RelatedEvent('eventType', { get relatedTarget() { return 123; } }).relatedTarget threw exception TypeError: Failed to construct 'RelatedEvent': member relatedTarget is not of type EventTarget.. -PASS new RelatedEvent('eventType', { get relatedTarget() { throw 'RelatedEvent Error'; } }) threw exception RelatedEvent Error. -PASS new RelatedEvent('eventType', { bubbles: true, cancelable: true, relatedTarget: testDiv }).relatedTarget is testDiv -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/related-event-constructor.html b/third_party/WebKit/LayoutTests/fast/events/constructors/related-event-constructor.html deleted file mode 100644 index 726d66d..0000000 --- a/third_party/WebKit/LayoutTests/fast/events/constructors/related-event-constructor.html +++ /dev/null
@@ -1,56 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script> - -description("This tests the constructor for the RelatedEvent DOM class."); - -var testObject = {nyannyan: 123}; -var testDiv = document.createElement("div"); - -// No initializer is passed. -shouldBeFalse("new RelatedEvent('eventType').bubbles"); -shouldBeFalse("new RelatedEvent('eventType').cancelable"); -shouldBeNull("new RelatedEvent('eventType').relatedTarget"); - -// bubbles is passed. -shouldBeFalse("new RelatedEvent('eventType', { bubbles: false }).bubbles"); -shouldBeTrue("new RelatedEvent('eventType', { bubbles: true }).bubbles"); - -// cancelable is passed. -shouldBeFalse("new RelatedEvent('eventType', { cancelable: false }).cancelable"); -shouldBeTrue("new RelatedEvent('eventType', { cancelable: true }).cancelable"); - -// relatedTarget is passed. -// Valid objects. -shouldBe("new RelatedEvent('eventType', { relatedTarget: testDiv }).relatedTarget", "testDiv"); -shouldBe("new RelatedEvent('eventType', { relatedTarget: document }).relatedTarget", "document"); -shouldBe("new RelatedEvent('eventType', { relatedTarget: window }).relatedTarget", "window"); - -// Invalid objects. -shouldThrow("new RelatedEvent('eventType', { relatedTarget: testObject }).relatedTarget"); -shouldBeNull("new RelatedEvent('eventType', { relatedTarget: undefined }).relatedTarget", "null"); -shouldBeNull("new RelatedEvent('eventType', { relatedTarget: null }).relatedTarget", "null"); -shouldThrow("new RelatedEvent('eventType', { relatedTarget: false }).relatedTarget"); -shouldThrow("new RelatedEvent('eventType', { relatedTarget: true }).relatedTarget"); -shouldThrow("new RelatedEvent('eventType', { relatedTarget: '' }).relatedTarget"); -shouldThrow("new RelatedEvent('eventType', { relatedTarget: 'chocolate' }).relatedTarget"); -shouldThrow("new RelatedEvent('eventType', { relatedTarget: 12345 }).relatedTarget"); -shouldThrow("new RelatedEvent('eventType', { relatedTarget: 18446744073709551615 }).relatedTarget"); -shouldThrow("new RelatedEvent('eventType', { relatedTarget: NaN }).relatedTarget"); -// Note that valueOf() is not called, when the left hand side is evaluated. -shouldThrow("new RelatedEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }).relatedTarget == testDiv"); -shouldBeTrue("new RelatedEvent('eventType', { get relatedTarget() { return testDiv; } }).relatedTarget == testDiv"); -shouldThrow("new RelatedEvent('eventType', { get relatedTarget() { return 123; } }).relatedTarget"); -shouldThrow("new RelatedEvent('eventType', { get relatedTarget() { throw 'RelatedEvent Error'; } })"); - -// All initializers are passed. -shouldBeTrue("new RelatedEvent('eventType', { bubbles: true, cancelable: true, relatedTarget: testDiv }).bubbles", "true"); -shouldBeTrue("new RelatedEvent('eventType', { bubbles: true, cancelable: true, relatedTarget: testDiv }).cancelable", "true"); -shouldBe("new RelatedEvent('eventType', { bubbles: true, cancelable: true, relatedTarget: testDiv }).relatedTarget", "testDiv"); -</script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/events/relatedevent-expected.txt b/third_party/WebKit/LayoutTests/fast/events/relatedevent-expected.txt deleted file mode 100644 index 2ee7a06..0000000 --- a/third_party/WebKit/LayoutTests/fast/events/relatedevent-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -Tests to confirm behavior of updating IDL attributes of RelatedEvent. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS relatedEvent.type is "foo" -PASS relatedEvent.bubbles is false -PASS relatedEvent.cancelable is false -PASS relatedEvent.relatedTarget is null -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/fast/events/relatedevent.html b/third_party/WebKit/LayoutTests/fast/events/relatedevent.html deleted file mode 100644 index b746f74..0000000 --- a/third_party/WebKit/LayoutTests/fast/events/relatedevent.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../resources/js-test.js"></script> -</head> -<script> - -description("Tests to confirm behavior of updating IDL attributes of RelatedEvent."); - -var relatedEvent = new RelatedEvent("foo"); - -// We should not be able to update readonly attributes. -relatedEvent.type = "bar"; -relatedEvent.bubbles = true; -relatedEvent.cancelable = true; -relatedEvent.relatedTarget = document; - -shouldBeEqualToString("relatedEvent.type", "foo"); -shouldBeFalse("relatedEvent.bubbles"); -shouldBeFalse("relatedEvent.cancelable"); -shouldBeNull("relatedEvent.relatedTarget"); -</script> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/parser/parse-menuitem-expected.txt b/third_party/WebKit/LayoutTests/fast/parser/parse-menuitem-expected.txt deleted file mode 100644 index b48c5b0..0000000 --- a/third_party/WebKit/LayoutTests/fast/parser/parse-menuitem-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -This test checks parsing of menuitem tag which has an end tag. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS document.getElementById('div').innerHTML is "<menuitem></menuitem>" -PASS document.getElementById('menu').innerHTML is "<menuitem id=\"first_item\"></menuitem><menuitem id=\"second_item\"></menuitem>" -PASS document.getElementById('first_item').firstChild is null -PASS document.getElementById('menu').firstChild.nextSibling is document.getElementById('second_item') -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/fast/parser/parse-menuitem.html b/third_party/WebKit/LayoutTests/fast/parser/parse-menuitem.html deleted file mode 100644 index 58348ce..0000000 --- a/third_party/WebKit/LayoutTests/fast/parser/parse-menuitem.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<head> -<script src="../../resources/js-test.js"></script> -</head> -<div id="div"><menuitem></menuitem></div> -<menu id="menu" type=context><menuitem id="first_item"></menuitem><menuitem id="second_item"></menuitem></menu> -<script> -description("This test checks parsing of menuitem tag which has an end tag."); -shouldBeEqualToString("document.getElementById('div').innerHTML", "<menuitem></menuitem>"); -shouldBeEqualToString("document.getElementById('menu').innerHTML", "<menuitem id=\"first_item\"></menuitem><menuitem id=\"second_item\"></menuitem>"); -shouldBeNull("document.getElementById('first_item').firstChild"); -shouldBe("document.getElementById('menu').firstChild.nextSibling", "document.getElementById('second_item')"); -</script>
diff --git a/third_party/WebKit/LayoutTests/html/menu_menuitem/custom-context-menu-expected.txt b/third_party/WebKit/LayoutTests/html/menu_menuitem/custom-context-menu-expected.txt deleted file mode 100644 index 2510deb..0000000 --- a/third_party/WebKit/LayoutTests/html/menu_menuitem/custom-context-menu-expected.txt +++ /dev/null
@@ -1,43 +0,0 @@ -Tests the custom context menu items. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS itemsWithCustomContextMenu.length - items.length is 23 -PASS itemsWithCustomContextMenu[0] is "Item1" -PASS itemsWithCustomContextMenu[1] is "#Item2" -PASS itemsWithCustomContextMenu[2] is "---------" -PASS itemsWithCustomContextMenu[3] is "Item3" -PASS itemsWithCustomContextMenu[4] is "Submenu >" -PASS itemsWithCustomContextMenu[5] is "_Item4" -PASS itemsWithCustomContextMenu[6] is "_Deeper submenu >" -PASS itemsWithCustomContextMenu[7] is "__Item5" -PASS itemsWithCustomContextMenu[8] is "__---------" -PASS itemsWithCustomContextMenu[9] is "__Item6" -PASS itemsWithCustomContextMenu[10] is "Item7" -PASS itemsWithCustomContextMenu[11] is "---------" -PASS itemsWithCustomContextMenu[12] is "Item8" -PASS itemsWithCustomContextMenu[13] is "Item11" -PASS itemsWithCustomContextMenu[14] is "Item12" -PASS itemsWithCustomContextMenu[15] is "---------" -PASS itemsWithCustomContextMenu[16] is "Item13" -PASS itemsWithCustomContextMenu[17] is "Item14" -PASS itemsWithCustomContextMenu[18] is "*Item15" -PASS itemsWithCustomContextMenu[19] is "Item16" -PASS itemsWithCustomContextMenu[20] is "Item17" -PASS itemsWithCustomContextMenu[21] is "*Item18" -PASS itemsWithCustomContextMenu[22] is "Item19" -PASS items1.length - items.length is 0 -PASS items2.length - items.length is 0 -PASS items3.length - items.length is 0 -PASS items4.length - items.length is 0 -PASS items5.length - items.length is 3 -PASS items5[0] is "Item1" -PASS items5[1] is "Item2" -PASS items5[2] is "Item3" -PASS successfullyParsed is true - -TEST COMPLETE - - -
diff --git a/third_party/WebKit/LayoutTests/html/menu_menuitem/custom-context-menu.html b/third_party/WebKit/LayoutTests/html/menu_menuitem/custom-context-menu.html deleted file mode 100644 index e9be85f..0000000 --- a/third_party/WebKit/LayoutTests/html/menu_menuitem/custom-context-menu.html +++ /dev/null
@@ -1,200 +0,0 @@ -<!DOCTYPE html> -<head> -<script src="../../resources/js-test.js"></script> -</head> -<button id="button" style="height: 100px; width: 100px;"> -</button> -<button id="button_with_contextmenu" contextmenu="menu_id" style="height: 100px; width: 100px;"> - <menu id="menu_id" type="ConText"> - <!-- Test removal of separator at the start. --> - <hr> - <menuitem label="Item1"></menuitem> - <!-- Test disabled menuitem. --> - <menuitem label="Item2" disabled></menuitem> - <!-- Test addition of separator for <hr>. --> - <hr> - <menuitem label="Item3"></menuitem> - <!-- Test child menu with label. --> - <menu label="Submenu"> - <menuitem label="Item4"></menuitem> - <menu label="Deeper submenu"> - <!-- Test removal of separator at the start inside submenu. --> - <hr> - <menuitem label="Item5"></menuitem> - <hr> - <menuitem label="Item6"></menuitem> - <!-- Test removal of separator at the end inside submenu. --> - <hr> - </menu> - </menu> - <menuitem label="Item7"></menuitem> - <!-- Test child menu without label. --> - <menu> - <menuitem label="Item8"></menuitem> - <!-- Test child menu with empty label. --> - <menu label=""> - <menuitem label="Item9"></menuitem> - <menuitem label="Item10"></menuitem> - </menu> - <menuitem label="Item11"></menuitem> - <menuitem label="Item12"></menuitem> - </menu> - <!-- Test collapsing two or more adjacent separators. --> - <hr> - <hr> - <hr> - <hr> - <!-- Test menuitem menu without label. --> - <menuitem></menuitem> - <!-- Test menuitem menu with empty label. --> - <menuitem label=""></menuitem> - <menuitem label="Item13"></menuitem> - <!-- Test menuitem of type "checkbox" without "checked" attribute. --> - <menuitem type="checkbox" label="Item14"></menuitem> - <!-- Test menuitem of type "checkbox" with "checked" attribute. --> - <menuitem type="checkbox" label="Item15" checked></menuitem> - <!-- Test default menuitem with "checked" attribute. --> - <menuitem label="Item16" checked></menuitem> - <!-- Test menuitem of type "radio" with "checked" attribute. --> - <menuitem type="radio" radiogroup="group" label="Item17"></menuitem> - <menuitem type="radio" radiogroup="group" label="Item18" checked></menuitem> - <menuitem type="radio" radiogroup="group" label="Item19"></menuitem> - <!-- Test removal of separator at the end. --> - <hr> - </menu> -</button> -<!-- Test with menu element without type attribute specified. --> -<button id="button_1" contextmenu="menu_without_type" style="height: 100px; width: 100px;"> - <menu id="menu_without_type"> - <menuitem label="Item1"></menuitem> - <menuitem label="Item2"></menuitem> - <menuitem label="Item3"></menuitem> - </menu> -</button> -<!-- Test cancelling show event. --> -<button id="button_2" contextmenu="menu_2" style="height: 100px; width: 100px;"> - <menu id="menu_2" type="context"> - <menuitem label="Item1"></menuitem> - <menuitem label="Item2"></menuitem> - <menuitem label="Item3"></menuitem> - </menu> -</button> -<!-- Test removing menu element inside show event handler. --> -<button id="button_3" contextmenu="menu_3" style="height: 100px; width: 100px;"> - <menu id="menu_3" type="context"> - <menuitem label="Item1"></menuitem> - <menuitem label="Item2"></menuitem> - <menuitem label="Item3"></menuitem> - </menu> -</button> -<!-- Test with menu element without any children. --> -<button id="button_4" contextmenu="menu_4" style="height: 100px; width: 100px;"> - <menu id="menu_4" type="context"> - </menu> -</button> -<!-- Test if an element A has a parent element, then A's assigned context menu is the assigned context menu of its parent element. --> -<div contextmenu="menu_5"> - <div> - <button id="button_5" style="height: 100px; width: 100px;"></button> - </div> - <menu id="menu_5" type="context"> - <menuitem label="Item1"> - <menuitem label="Item2"> - <menuitem label="Item3"> - </menu> -</div> -<script> -if (!window.eventSender) - debug("This test requires window.eventSender.") - -function contextClickAndGetMenuItems(element) { - var x = element.offsetParent.offsetLeft + element.offsetLeft + 4; - var y = element.offsetParent.offsetTop + element.offsetTop + element.offsetHeight / 2; - eventSender.mouseMoveTo(x, y); - return eventSender.contextClick(); -} - -function cancel(event) { - event.preventDefault(); -} - -function removeMenu(event) { - event.target.remove(); -} - -description("Tests the custom context menu items."); -var button = document.getElementById("button"); -var items = contextClickAndGetMenuItems(button); - -// Esc key to hide the context menu. -eventSender.keyDown("Escape"); - -var buttonWithContextMenu = document.getElementById("button_with_contextmenu"); -var itemsWithCustomContextMenu = contextClickAndGetMenuItems(buttonWithContextMenu); - -// Esc key to hide the context menu. -eventSender.keyDown("Escape"); - -var button1 = document.getElementById("button_1"); -var items1 = contextClickAndGetMenuItems(button1); - -// Esc key to hide the context menu. -eventSender.keyDown("Escape"); - -var button2 = document.getElementById("button_2"); -document.getElementById("menu_2").addEventListener("show", cancel, false); -var items2 = contextClickAndGetMenuItems(button2); - -// Esc key to hide the context menu. -eventSender.keyDown("Escape"); - -var button3 = document.getElementById("button_3"); -document.getElementById("menu_3").addEventListener("show", removeMenu, false); -var items3 = contextClickAndGetMenuItems(button3); - -// Esc key to hide the context menu. -eventSender.keyDown("Escape"); - -var button4 = document.getElementById("button_4"); -var items4 = contextClickAndGetMenuItems(button4); - -// Esc key to hide the context menu. -eventSender.keyDown("Escape"); - -var button5 = document.getElementById("button_5"); -var items5 = contextClickAndGetMenuItems(button5); - -shouldBeEqualToNumber("itemsWithCustomContextMenu.length - items.length", 23); -shouldBeEqualToString("itemsWithCustomContextMenu[0]", "Item1"); -shouldBeEqualToString("itemsWithCustomContextMenu[1]", "#Item2"); -shouldBeEqualToString("itemsWithCustomContextMenu[2]", "---------"); -shouldBeEqualToString("itemsWithCustomContextMenu[3]", "Item3"); -shouldBeEqualToString("itemsWithCustomContextMenu[4]", "Submenu >"); -shouldBeEqualToString("itemsWithCustomContextMenu[5]", "_Item4"); -shouldBeEqualToString("itemsWithCustomContextMenu[6]", "_Deeper submenu >"); -shouldBeEqualToString("itemsWithCustomContextMenu[7]", "__Item5"); -shouldBeEqualToString("itemsWithCustomContextMenu[8]", "__---------"); -shouldBeEqualToString("itemsWithCustomContextMenu[9]", "__Item6"); -shouldBeEqualToString("itemsWithCustomContextMenu[10]", "Item7"); -shouldBeEqualToString("itemsWithCustomContextMenu[11]", "---------"); -shouldBeEqualToString("itemsWithCustomContextMenu[12]", "Item8"); -shouldBeEqualToString("itemsWithCustomContextMenu[13]", "Item11"); -shouldBeEqualToString("itemsWithCustomContextMenu[14]", "Item12"); -shouldBeEqualToString("itemsWithCustomContextMenu[15]", "---------"); -shouldBeEqualToString("itemsWithCustomContextMenu[16]", "Item13"); -shouldBeEqualToString("itemsWithCustomContextMenu[17]", "Item14"); -shouldBeEqualToString("itemsWithCustomContextMenu[18]", "*Item15"); -shouldBeEqualToString("itemsWithCustomContextMenu[19]", "Item16"); -shouldBeEqualToString("itemsWithCustomContextMenu[20]", "Item17"); -shouldBeEqualToString("itemsWithCustomContextMenu[21]", "*Item18"); -shouldBeEqualToString("itemsWithCustomContextMenu[22]", "Item19"); -shouldBeEqualToNumber("items1.length - items.length", 0); -shouldBeEqualToNumber("items2.length - items.length", 0); -shouldBeEqualToNumber("items3.length - items.length", 0); -shouldBeEqualToNumber("items4.length - items.length", 0); -shouldBeEqualToNumber("items5.length - items.length", 3); -shouldBeEqualToString("items5[0]", "Item1"); -shouldBeEqualToString("items5[1]", "Item2"); -shouldBeEqualToString("items5[2]", "Item3"); - -</script>
diff --git a/third_party/WebKit/LayoutTests/html/menu_menuitem/menu-type-context-expected.html b/third_party/WebKit/LayoutTests/html/menu_menuitem/menu-type-context-expected.html deleted file mode 100644 index 05fe4c0..0000000 --- a/third_party/WebKit/LayoutTests/html/menu_menuitem/menu-type-context-expected.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<head> -<style> -p { - -webkit-margin-before: 1__qem; - -webkit-margin-after: 1em; - -webkit-padding-start: 40px -} -</style> -</head> -<p>This Text should render as it is inside menu which is not of type="context".</p>
diff --git a/third_party/WebKit/LayoutTests/html/menu_menuitem/menu-type-context.html b/third_party/WebKit/LayoutTests/html/menu_menuitem/menu-type-context.html deleted file mode 100644 index 01efd594..0000000 --- a/third_party/WebKit/LayoutTests/html/menu_menuitem/menu-type-context.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<menuitem label="Orphan item"> -<menu type="context"> -This Text should not render as it is inside menu of type="context". -<menuitem label="Item in a menu"> -</menu> -<menu> -This Text should render as it is inside menu which is not of type="context". -<menuitem label="Item in a menu"> -</menu>
diff --git a/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-click-expected.txt b/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-click-expected.txt deleted file mode 100644 index 23ef7d4..0000000 --- a/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-click-expected.txt +++ /dev/null
@@ -1,27 +0,0 @@ -Test that the "checked" attribute of menuitem is toggled with click. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS element.hasAttribute("checked") is true -PASS element.hasAttribute("checked") is false -PASS mi2.hasAttribute("checked") is true -PASS mi2.hasAttribute("checked") is false -PASS mi3.hasAttribute("checked") is true -PASS mi3.hasAttribute("checked") is false -PASS mi4.hasAttribute("checked") is true -PASS mi4.hasAttribute("checked") is true -PASS mi4.hasAttribute("checked") is true -PASS _mi1.hasAttribute("checked") is true -PASS mi5.hasAttribute("checked") is true -PASS mi6.hasAttribute("checked") is true -PASS mi7.hasAttribute("checked") is true -PASS mi8.hasAttribute("checked") is true -PASS mi9.hasAttribute("checked") is false -PASS mi10.hasAttribute("checked") is true -PASS mi11.hasAttribute("checked") is true -PASS mi12.hasAttribute("checked") is false -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-click.html b/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-click.html deleted file mode 100644 index 01b1ea3..0000000 --- a/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-click.html +++ /dev/null
@@ -1,72 +0,0 @@ -<script src="../../resources/js-test.js"></script> -<menu type=context> - <menuitem id=mi1 type=checkbox></menuitem> - <menuitem id=mi2 type=radio radiogroup="g1" checked></menuitem> - <menuitem id=mi3 type=radio radiogroup="g1"></menuitem> - <menuitem id=mi4 type=radio radiogroup="g1"></menuitem> - <menu label="Submenu"> - <menuitem id=_mi1 type=radio radiogroup="g1"></menuitem> - <menuitem id=_mi2 type=radio radiogroup="g1"></menuitem> - <menuitem id=_mi3 type=radio radiogroup="g1"></menuitem> - </menu> - <menuitem id=mi5 type=radio radiogroup="g2" checked></menuitem> - <menuitem id=mi6 type=radio radiogroup="G2"></menuitem> - <menuitem id=mi7 type=radio radiogroup=" g3 " checked></menuitem> - <menuitem id=mi8 type=radio radiogroup=" g3"></menuitem> - <menuitem id=mi9 type=radio radiogroup="" checked></menuitem> - <menuitem id=mi10 type=radio></menuitem> - <menuitem id=mi11 type=radio radiogroup="g4"></menuitem> - <menuitem id=mi12 type=checkbox radiogroup="g4" checked></menuitem> -</menu> -<script> - -description('Test that the "checked" attribute of menuitem is toggled with click.'); - -var element = document.getElementById('mi1'); -element.click(); -shouldBeTrue('element.hasAttribute("checked")'); -element.click(); -shouldBeFalse('element.hasAttribute("checked")'); -var mi2 = document.getElementById('mi2'); -var mi3 = document.getElementById('mi3'); -var mi4 = document.getElementById('mi4'); -shouldBeTrue('mi2.hasAttribute("checked")'); -mi3.click(); -shouldBeFalse('mi2.hasAttribute("checked")'); -shouldBeTrue('mi3.hasAttribute("checked")'); -mi4.click(); -shouldBeFalse('mi3.hasAttribute("checked")'); -shouldBeTrue('mi4.hasAttribute("checked")'); -// Test clicking menuitem of type=radio which is already checked. -mi4.click(); -shouldBeTrue('mi4.hasAttribute("checked")'); -// Test radiogroup in a submenu. -var _mi1 = document.getElementById('_mi1'); -_mi1.click(); -shouldBeTrue('mi4.hasAttribute("checked")'); -shouldBeTrue('_mi1.hasAttribute("checked")'); -// Test radiogroup case matching. -var mi5 = document.getElementById('mi5'); -var mi6 = document.getElementById('mi6'); -mi6.click(); -shouldBeTrue('mi5.hasAttribute("checked")'); -shouldBeTrue('mi6.hasAttribute("checked")'); -// Test radiogroup white space matching. -var mi7 = document.getElementById('mi7'); -var mi8 = document.getElementById('mi8'); -mi8.click(); -shouldBeTrue('mi7.hasAttribute("checked")'); -shouldBeTrue('mi8.hasAttribute("checked")'); -// Test empty radiogroup. -var mi9 = document.getElementById('mi9'); -var mi10 = document.getElementById('mi10'); -mi10.click(); -shouldBeFalse('mi9.hasAttribute("checked")'); -shouldBeTrue('mi10.hasAttribute("checked")'); -// Test that radiogroup attribute is ignored if type is not radio. -var mi11 = document.getElementById('mi11'); -var mi12 = document.getElementById('mi12'); -mi11.click(); -shouldBeTrue('mi11.hasAttribute("checked")'); -shouldBeFalse('mi12.hasAttribute("checked")'); -</script>
diff --git a/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-crash-asan-expected.txt b/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-crash-asan-expected.txt deleted file mode 100644 index 9d0acaf..0000000 --- a/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-crash-asan-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -Test passes if it does not crash on Linux ASan builds.
diff --git a/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-crash-asan.html b/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-crash-asan.html deleted file mode 100644 index a1f4c7b..0000000 --- a/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-crash-asan.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -Test passes if it does not crash on Linux ASan builds. -<menuitem id="domfuzz" checked type="radio"><menuitem checked> -<script> -function fuzz() { - document.getElementById("domfuzz").addEventListener( - "fullscreenerror", function() { - var elt = document.getElementById("domfuzz"); - elt.setAttribute("radiogroup", "G1"); - }); - e = document.createEvent("Event"); - var element = document.getElementById("domfuzz"); - e.initEvent("fullscreenerror"); - element.dispatchEvent(e); - e = new MouseEvent("click"); - element.dispatchEvent(e); -} -if (window.testRunner) { - testRunner.dumpAsText(); - fuzz(); -} -</script> -</body>
diff --git a/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-with-end-tag-expected.html b/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-with-end-tag-expected.html deleted file mode 100644 index 2f27b039..0000000 --- a/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-with-end-tag-expected.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<body> -Orphan item -<menu> -Item in a menu -</menu> -</body>
diff --git a/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-with-end-tag.html b/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-with-end-tag.html deleted file mode 100644 index 7728fe4..0000000 --- a/third_party/WebKit/LayoutTests/html/menu_menuitem/menuitem-with-end-tag.html +++ /dev/null
@@ -1,5 +0,0 @@ -<!DOCTYPE html> -<menuitem>Orphan item</menuitem> -<menu> -<menuitem>Item in a menu</menuitem> -</menu>
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/custom-context-menu-expected.txt b/third_party/WebKit/LayoutTests/http/tests/misc/custom-context-menu-expected.txt deleted file mode 100644 index b5141408..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/misc/custom-context-menu-expected.txt +++ /dev/null
@@ -1,45 +0,0 @@ -Tests the custom context menu items. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS itemsWithCustomContextMenu.length - items.length is 25 -PASS itemsWithCustomContextMenu[0] is "Item1" -PASS itemsWithCustomContextMenu[1] is "#Item2" -PASS itemsWithCustomContextMenu[2] is "---------" -PASS itemsWithCustomContextMenu[3] is "Item3" -PASS itemsWithCustomContextMenu[4] is "Submenu >" -PASS itemsWithCustomContextMenu[5] is "_Item4" -PASS itemsWithCustomContextMenu[6] is "_Deeper submenu >" -PASS itemsWithCustomContextMenu[7] is "__Item5" -PASS itemsWithCustomContextMenu[8] is "__---------" -PASS itemsWithCustomContextMenu[9] is "__Item6" -PASS itemsWithCustomContextMenu[10] is "Item7" -PASS itemsWithCustomContextMenu[11] is "---------" -PASS itemsWithCustomContextMenu[12] is "Item8" -PASS itemsWithCustomContextMenu[13] is "Item11" -PASS itemsWithCustomContextMenu[14] is "Item12" -PASS itemsWithCustomContextMenu[15] is "---------" -PASS itemsWithCustomContextMenu[16] is "Item13" -PASS itemsWithCustomContextMenu[17] is "Item14" -PASS itemsWithCustomContextMenu[18] is "*Item15" -PASS itemsWithCustomContextMenu[19] is "Item16" -PASS itemsWithCustomContextMenu[20] is "Item17" -PASS itemsWithCustomContextMenu[21] is "*Item18" -PASS itemsWithCustomContextMenu[22] is "Item19" -PASS itemsWithCustomContextMenu[23] is "Item20http://127.0.0.1:8000/misc/icon1.png" -PASS itemsWithCustomContextMenu[24] is "Item21http://127.0.0.1:8000/misc/icon2.png" -PASS items1.length - items.length is 0 -PASS items2.length - items.length is 0 -PASS items3.length - items.length is 0 -PASS items4.length - items.length is 0 -PASS items5.length - items.length is 3 -PASS items5[0] is "Item1" -PASS items5[1] is "Item2" -PASS items5[2] is "Item3" -PASS successfullyParsed is true - -TEST COMPLETE - - -
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/custom-context-menu.html b/third_party/WebKit/LayoutTests/http/tests/misc/custom-context-menu.html deleted file mode 100644 index bba3035..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/misc/custom-context-menu.html +++ /dev/null
@@ -1,206 +0,0 @@ -<!DOCTYPE html> -<head> -<script src="/js-test-resources/js-test.js"></script> -</head> -<button id="button" style="height: 100px; width: 100px;"> -</button> -<button id="button_with_contextmenu" contextmenu="menu_id" style="height: 100px; width: 100px;"> - <menu id="menu_id" type="ConText"> - <!-- Test removal of separator at the start. --> - <hr> - <menuitem label="Item1"></menuitem> - <!-- Test disabled menuitem. --> - <menuitem label="Item2" disabled></menuitem> - <!-- Test addition of separator for <hr>. --> - <hr> - <menuitem label="Item3"></menuitem> - <!-- Test child menu with label. --> - <menu label="Submenu"> - <menuitem label="Item4"></menuitem> - <menu label="Deeper submenu"> - <!-- Test removal of separator at the start inside submenu. --> - <hr> - <menuitem label="Item5"></menuitem> - <hr> - <menuitem label="Item6"></menuitem> - <!-- Test removal of separator at the end inside submenu. --> - <hr> - </menu> - </menu> - <menuitem label="Item7"></menuitem> - <!-- Test child menu without label. --> - <menu> - <menuitem label="Item8"></menuitem> - <!-- Test child menu with empty label. --> - <menu label=""> - <menuitem label="Item9"></menuitem> - <menuitem label="Item10"></menuitem> - </menu> - <menuitem label="Item11"></menuitem> - <menuitem label="Item12"></menuitem> - </menu> - <!-- Test collapsing two or more adjacent separators. --> - <hr> - <hr> - <hr> - <hr> - <!-- Test menuitem menu without label. --> - <menuitem></menuitem> - <!-- Test menuitem menu with empty label. --> - <menuitem label=""></menuitem> - <menuitem label="Item13"></menuitem> - <!-- Test menuitem of type "checkbox" without "checked" attribute. --> - <menuitem type="checkbox" label="Item14"></menuitem> - <!-- Test menuitem of type "checkbox" with "checked" attribute. --> - <menuitem type="checkbox" label="Item15" checked></menuitem> - <!-- Test default menuitem with "checked" attribute. --> - <menuitem label="Item16" checked></menuitem> - <!-- Test menuitem of type "radio" with "checked" attribute. --> - <menuitem type="radio" radiogroup="group" label="Item17"></menuitem> - <menuitem type="radio" radiogroup="group" label="Item18" checked></menuitem> - <menuitem type="radio" radiogroup="group" label="Item19"></menuitem> - <!-- Test menuitem with "icon" attribute. --> - <menuitem label="Item20" icon="icon1.png" checked></menuitem> - <!-- Test menuitem with "icon" attribute having leading and trailing white spaces. --> - <menuitem label="Item21" icon=" icon2.png " checked></menuitem> - <!-- Test removal of separator at the end. --> - <hr> - </menu> -</button> -<!-- Test with menu element without type attribute specified. --> -<button id="button_1" contextmenu="menu_without_type" style="height: 100px; width: 100px;"> - <menu id="menu_without_type"> - <menuitem label="Item1"></menuitem> - <menuitem label="Item2"></menuitem> - <menuitem label="Item3"></menuitem> - </menu> -</button> -<!-- Test cancelling show event. --> -<button id="button_2" contextmenu="menu_2" style="height: 100px; width: 100px;"> - <menu id="menu_2" type="context"> - <menuitem label="Item1"></menuitem> - <menuitem label="Item2"></menuitem> - <menuitem label="Item3"></menuitem> - </menu> -</button> -<!-- Test removing menu element inside show event handler. --> -<button id="button_3" contextmenu="menu_3" style="height: 100px; width: 100px;"> - <menu id="menu_3" type="context"> - <menuitem label="Item1"></menuitem> - <menuitem label="Item2"></menuitem> - <menuitem label="Item3"></menuitem> - </menu> -</button> -<!-- Test with menu element without any children. --> -<button id="button_4" contextmenu="menu_4" style="height: 100px; width: 100px;"> - <menu id="menu_4" type="context"> - </menu> -</button> -<!-- Test if an element A has a parent element, then A's assigned context menu is the assigned context menu of its parent element. --> -<div contextmenu="menu_5"> - <div> - <button id="button_5" style="height: 100px; width: 100px;"></button> - </div> - <menu id="menu_5" type="context"> - <menuitem label="Item1"> - <menuitem label="Item2"> - <menuitem label="Item3"> - </menu> -</div> -<script> -if (!window.eventSender) - debug("This test requires window.eventSender.") - -function contextClickAndGetMenuItems(element) { - var x = element.offsetParent.offsetLeft + element.offsetLeft + 4; - var y = element.offsetParent.offsetTop + element.offsetTop + element.offsetHeight / 2; - eventSender.mouseMoveTo(x, y); - return eventSender.contextClick(); -} - -function cancel(event) { - event.preventDefault(); -} - -function removeMenu(event) { - event.target.remove(); -} - -description("Tests the custom context menu items."); -var button = document.getElementById("button"); -var items = contextClickAndGetMenuItems(button); - -// Esc key to hide the context menu. -eventSender.keyDown("Escape"); - -var buttonWithContextMenu = document.getElementById("button_with_contextmenu"); -var itemsWithCustomContextMenu = contextClickAndGetMenuItems(buttonWithContextMenu); - -// Esc key to hide the context menu. -eventSender.keyDown("Escape"); - -var button1 = document.getElementById("button_1"); -var items1 = contextClickAndGetMenuItems(button1); - -// Esc key to hide the context menu. -eventSender.keyDown("Escape"); - -var button2 = document.getElementById("button_2"); -document.getElementById("menu_2").addEventListener("show", cancel, false); -var items2 = contextClickAndGetMenuItems(button2); - -// Esc key to hide the context menu. -eventSender.keyDown("Escape"); - -var button3 = document.getElementById("button_3"); -document.getElementById("menu_3").addEventListener("show", removeMenu, false); -var items3 = contextClickAndGetMenuItems(button3); - -// Esc key to hide the context menu. -eventSender.keyDown("Escape"); - -var button4 = document.getElementById("button_4"); -var items4 = contextClickAndGetMenuItems(button4); - -// Esc key to hide the context menu. -eventSender.keyDown("Escape"); - -var button5 = document.getElementById("button_5"); -var items5 = contextClickAndGetMenuItems(button5); - -shouldBeEqualToNumber("itemsWithCustomContextMenu.length - items.length", 25); -shouldBeEqualToString("itemsWithCustomContextMenu[0]", "Item1"); -shouldBeEqualToString("itemsWithCustomContextMenu[1]", "#Item2"); -shouldBeEqualToString("itemsWithCustomContextMenu[2]", "---------"); -shouldBeEqualToString("itemsWithCustomContextMenu[3]", "Item3"); -shouldBeEqualToString("itemsWithCustomContextMenu[4]", "Submenu >"); -shouldBeEqualToString("itemsWithCustomContextMenu[5]", "_Item4"); -shouldBeEqualToString("itemsWithCustomContextMenu[6]", "_Deeper submenu >"); -shouldBeEqualToString("itemsWithCustomContextMenu[7]", "__Item5"); -shouldBeEqualToString("itemsWithCustomContextMenu[8]", "__---------"); -shouldBeEqualToString("itemsWithCustomContextMenu[9]", "__Item6"); -shouldBeEqualToString("itemsWithCustomContextMenu[10]", "Item7"); -shouldBeEqualToString("itemsWithCustomContextMenu[11]", "---------"); -shouldBeEqualToString("itemsWithCustomContextMenu[12]", "Item8"); -shouldBeEqualToString("itemsWithCustomContextMenu[13]", "Item11"); -shouldBeEqualToString("itemsWithCustomContextMenu[14]", "Item12"); -shouldBeEqualToString("itemsWithCustomContextMenu[15]", "---------"); -shouldBeEqualToString("itemsWithCustomContextMenu[16]", "Item13"); -shouldBeEqualToString("itemsWithCustomContextMenu[17]", "Item14"); -shouldBeEqualToString("itemsWithCustomContextMenu[18]", "*Item15"); -shouldBeEqualToString("itemsWithCustomContextMenu[19]", "Item16"); -shouldBeEqualToString("itemsWithCustomContextMenu[20]", "Item17"); -shouldBeEqualToString("itemsWithCustomContextMenu[21]", "*Item18"); -shouldBeEqualToString("itemsWithCustomContextMenu[22]", "Item19"); -shouldBeEqualToString("itemsWithCustomContextMenu[23]", "Item20http://127.0.0.1:8000/misc/icon1.png"); -shouldBeEqualToString("itemsWithCustomContextMenu[24]", "Item21http://127.0.0.1:8000/misc/icon2.png"); -shouldBeEqualToNumber("items1.length - items.length", 0); -shouldBeEqualToNumber("items2.length - items.length", 0); -shouldBeEqualToNumber("items3.length - items.length", 0); -shouldBeEqualToNumber("items4.length - items.length", 0); -shouldBeEqualToNumber("items5.length - items.length", 3); -shouldBeEqualToString("items5[0]", "Item1"); -shouldBeEqualToString("items5[1]", "Item2"); -shouldBeEqualToString("items5[2]", "Item3"); - -</script>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/table/cached-change-colgroup-border-color-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/table/cached-change-colgroup-border-color-expected.txt index 71449ce..d599485 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/table/cached-change-colgroup-border-color-expected.txt +++ b/third_party/WebKit/LayoutTests/paint/invalidation/table/cached-change-colgroup-border-color-expected.txt
@@ -8,7 +8,7 @@ "paintInvalidations": [ { "object": "LayoutTableCol COLGROUP id='colgroup'", - "rect": [8, 8, 166, 102], + "rect": [8, 8, 167, 104], "reason": "style change" } ]
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/table/cached-change-colgroup-border-width-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/table/cached-change-colgroup-border-width-expected.txt index f129619..af9e7aef 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/table/cached-change-colgroup-border-width-expected.txt +++ b/third_party/WebKit/LayoutTests/paint/invalidation/table/cached-change-colgroup-border-width-expected.txt
@@ -7,43 +7,53 @@ "drawsContent": true, "paintInvalidations": [ { - "object": "LayoutTableSection TBODY", - "rect": [7, 7, 167, 104], - "reason": "geometry" - }, - { "object": "LayoutTableCol COLGROUP id='colgroup'", - "rect": [8, 8, 166, 102], + "rect": [8, 8, 167, 104], "reason": "style change" }, { + "object": "LayoutTableSection TBODY", + "rect": [8, 8, 167, 104], + "reason": "geometry" + }, + { + "object": "LayoutTable TABLE", + "rect": [8, 108, 167, 4], + "reason": "incremental" + }, + { "object": "LayoutTableCell TD", - "rect": [63, 7, 58, 53], + "rect": [64, 8, 58, 53], "reason": "geometry" }, { "object": "LayoutTableCell TD", - "rect": [7, 58, 58, 53], + "rect": [8, 59, 58, 53], "reason": "geometry" }, { "object": "LayoutTableCell TD", - "rect": [7, 7, 58, 53], + "rect": [8, 8, 58, 53], "reason": "geometry" }, { "object": "LayoutTableCell TD", - "rect": [117, 59, 57, 52], + "rect": [118, 60, 57, 52], "reason": "geometry" }, { "object": "LayoutTableCell TD", - "rect": [117, 7, 57, 52], + "rect": [118, 8, 57, 52], "reason": "geometry" }, { "object": "LayoutTableCell TD", - "rect": [64, 59, 57, 52], + "rect": [65, 60, 57, 52], + "reason": "geometry" + }, + { + "object": "LayoutTableCell TD", + "rect": [8, 58, 56, 52], "reason": "geometry" }, { @@ -68,7 +78,7 @@ }, { "object": "LayoutTable TABLE", - "rect": [169, 8, 5, 102], + "rect": [169, 8, 6, 104], "reason": "incremental" } ] @@ -112,7 +122,7 @@ "reason": "geometry" }, { - "object": "LayoutTableCell TD", + "object": "LayoutTableRow TR", "reason": "geometry" }, { @@ -128,6 +138,14 @@ "reason": "geometry" }, { + "object": "LayoutTableRow TR", + "reason": "geometry" + }, + { + "object": "LayoutTableCell TD", + "reason": "geometry" + }, + { "object": "LayoutTableCell TD", "reason": "geometry" },
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/table/backgr_border-table-column-group-collapsed-border-expected.png index fb2d843..1e36a67 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/table/backgr_border-table-column-group-collapsed-border-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/table/border-collapsing/002-vertical-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/table/border-collapsing/002-vertical-expected.png index df0b4c89..0a7707d05 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/table/border-collapsing/002-vertical-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/table/border-collapsing/002-vertical-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png index c083106..b90ce0e23d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png new file mode 100644 index 0000000..1e36a67 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/fast/table/border-collapsing/002-vertical-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/fast/table/border-collapsing/002-vertical-expected.png new file mode 100644 index 0000000..0a7707d05 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/fast/table/border-collapsing/002-vertical-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png new file mode 100644 index 0000000..b90ce0e23d --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/file/file-input-direction-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/file/file-input-direction-expected.txt index e981d59..f84ca5dc5 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/file/file-input-direction-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/file/file-input-direction-expected.txt
@@ -1,4 +1,4 @@ -layer at (0,0) size 800x600 scrollWidth 970 +layer at (0,0) size 800x600 scrollWidth 971 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/table/backgr_border-table-column-group-collapsed-border-expected.png index ef19b10..7d110470 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/table/backgr_border-table-column-group-collapsed-border-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png new file mode 100644 index 0000000..7d110470 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/table/backgr_border-table-column-group-collapsed-border-expected.png index 5a0868e..bfa25fc 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/table/backgr_border-table-column-group-collapsed-border-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png new file mode 100644 index 0000000..bfa25fc --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/file/file-input-direction-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/file/file-input-direction-expected.txt index a063ca1..e475f1d 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/file/file-input-direction-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/file/file-input-direction-expected.txt
@@ -1,4 +1,4 @@ -layer at (0,0) size 800x600 scrollWidth 1070 +layer at (0,0) size 800x600 scrollWidth 1071 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_border-table-column-group-collapsed-border-expected.png index 9e942a7..861375eb 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_border-table-column-group-collapsed-border-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png new file mode 100644 index 0000000..861375eb --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/table/backgr_border-table-column-group-collapsed-border-expected.png index 5a0868e..bfa25fc 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/table/backgr_border-table-column-group-collapsed-border-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png new file mode 100644 index 0000000..bfa25fc --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/file/file-input-direction-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/file/file-input-direction-expected.txt index f63284d..e4ebfeb 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/file/file-input-direction-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/file/file-input-direction-expected.txt
@@ -1,4 +1,4 @@ -layer at (0,0) size 800x600 scrollWidth 1066 +layer at (0,0) size 800x600 scrollWidth 1067 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_border-table-column-group-collapsed-border-expected.png index 660b92a..cf9f3f3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_border-table-column-group-collapsed-border-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/table/border-collapsing/002-vertical-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/table/border-collapsing/002-vertical-expected.png index 52141d74..21e67d5 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/table/border-collapsing/002-vertical-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/table/border-collapsing/002-vertical-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png index c0308bd..44f12dd3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png new file mode 100644 index 0000000..cf9f3f3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/fast/table/border-collapsing/002-vertical-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/fast/table/border-collapsing/002-vertical-expected.png new file mode 100644 index 0000000..21e67d5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/fast/table/border-collapsing/002-vertical-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png new file mode 100644 index 0000000..44f12dd3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/table/backgr_border-table-column-group-collapsed-border-expected.png index 31cb85c58..e8e662a 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/table/backgr_border-table-column-group-collapsed-border-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/table/border-collapsing/002-vertical-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/table/border-collapsing/002-vertical-expected.png index 115f1d5..a6f7c87f 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/table/border-collapsing/002-vertical-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/table/border-collapsing/002-vertical-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png index c2d8be78..22525ac 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png new file mode 100644 index 0000000..e8e662a --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/fast/table/border-collapsing/002-vertical-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/fast/table/border-collapsing/002-vertical-expected.png new file mode 100644 index 0000000..a6f7c87f --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/fast/table/border-collapsing/002-vertical-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png new file mode 100644 index 0000000..22525ac --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/mojo-loading/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/table/backgr_border-table-column-group-collapsed-border-expected.png index 6b9c920..1c193407 100644 --- a/third_party/WebKit/LayoutTests/platform/win7/fast/table/backgr_border-table-column-group-collapsed-border-expected.png +++ b/third_party/WebKit/LayoutTests/platform/win7/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png b/third_party/WebKit/LayoutTests/platform/win7/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png new file mode 100644 index 0000000..1c193407 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win7/virtual/mojo-loading/fast/table/backgr_border-table-column-group-collapsed-border-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt index c40dfa5..0591229 100644 --- a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
@@ -2318,7 +2318,6 @@ attribute @@toStringTag getter accessKey getter contentEditable - getter contextMenu getter dataset getter dir getter draggable @@ -2420,7 +2419,6 @@ method focus setter accessKey setter contentEditable - setter contextMenu setter dir setter draggable setter hidden @@ -3029,29 +3027,8 @@ interface HTMLMenuElement : HTMLElement attribute @@toStringTag getter compact - getter label - getter type method constructor setter compact - setter label - setter type -interface HTMLMenuItemElement : HTMLElement - attribute @@toStringTag - getter checked - getter default - getter disabled - getter icon - getter label - getter radiogroup - getter type - method constructor - setter checked - setter default - setter disabled - setter icon - setter label - setter radiogroup - setter type interface HTMLMetaElement : HTMLElement attribute @@toStringTag getter content @@ -5211,10 +5188,6 @@ method pipeThrough method pipeTo method tee -interface RelatedEvent : Event - attribute @@toStringTag - getter relatedTarget - method constructor interface RemotePlayback : EventTarget attribute @@toStringTag getter onconnect
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt index 147cba0..a2f906b7 100644 --- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt
@@ -702,7 +702,6 @@ property width html element menu property compact -html element menuitem html element meta property content property httpEquiv
diff --git a/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt index 43d3c90..cf2c5cf5 100644 --- a/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt
@@ -54,7 +54,6 @@ property computedRole property contains property contentEditable - property contextMenu property createShadowRoot property dataset property dir @@ -721,16 +720,6 @@ property width html element menu property compact - property label - property type -html element menuitem - property checked - property default - property disabled - property icon - property label - property radiogroup - property type html element meta property content property httpEquiv @@ -1160,7 +1149,6 @@ property computedRole property contains property contentEditable - property contextMenu property createShadowRoot property dataset property dir
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt index 5645069..844f5a8 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
@@ -2318,7 +2318,6 @@ attribute @@toStringTag getter accessKey getter contentEditable - getter contextMenu getter dataset getter dir getter draggable @@ -2420,7 +2419,6 @@ method focus setter accessKey setter contentEditable - setter contextMenu setter dir setter draggable setter hidden @@ -3029,29 +3027,8 @@ interface HTMLMenuElement : HTMLElement attribute @@toStringTag getter compact - getter label - getter type method constructor setter compact - setter label - setter type -interface HTMLMenuItemElement : HTMLElement - attribute @@toStringTag - getter checked - getter default - getter disabled - getter icon - getter label - getter radiogroup - getter type - method constructor - setter checked - setter default - setter disabled - setter icon - setter label - setter radiogroup - setter type interface HTMLMetaElement : HTMLElement attribute @@toStringTag getter content @@ -5218,10 +5195,6 @@ method pipeThrough method pipeTo method tee -interface RelatedEvent : Event - attribute @@toStringTag - getter relatedTarget - method constructor interface RemotePlayback : EventTarget attribute @@toStringTag getter onconnect
diff --git a/third_party/WebKit/Source/bindings/core/v8/BUILD.gn b/third_party/WebKit/Source/bindings/core/v8/BUILD.gn index b965807..6708cbef 100644 --- a/third_party/WebKit/Source/bindings/core/v8/BUILD.gn +++ b/third_party/WebKit/Source/bindings/core/v8/BUILD.gn
@@ -93,8 +93,6 @@ "$blink_core_output_dir/events/ProgressEventInit.h", "$blink_core_output_dir/events/PromiseRejectionEventInit.cpp", "$blink_core_output_dir/events/PromiseRejectionEventInit.h", - "$blink_core_output_dir/events/RelatedEventInit.cpp", - "$blink_core_output_dir/events/RelatedEventInit.h", "$blink_core_output_dir/events/SecurityPolicyViolationEventInit.cpp", "$blink_core_output_dir/events/SecurityPolicyViolationEventInit.h", "$blink_core_output_dir/events/TouchEventInit.cpp",
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp index 238e6af..864d96a3e 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp
@@ -84,23 +84,6 @@ return static_cast<ScriptCustomElementDefinition*>(definition); } -using SymbolGetter = V8PrivateProperty::Symbol (*)(v8::Isolate*); - -template <typename T> -static void KeepAlive(v8::Local<v8::Object>& object, - SymbolGetter symbol_getter, - const v8::Local<T>& value, - ScopedPersistent<T>& persistent, - ScriptState* script_state) { - if (value.IsEmpty()) - return; - - v8::Isolate* isolate = script_state->GetIsolate(); - symbol_getter(isolate).Set(object, value); - persistent.Set(isolate, value); - persistent.SetPhantom(); -} - ScriptCustomElementDefinition* ScriptCustomElementDefinition::Create( ScriptState* script_state, CustomElementRegistry* registry, @@ -123,22 +106,6 @@ EnsureCustomElementRegistryMap(script_state, registry); map->Set(script_state->GetContext(), constructor, name_value) .ToLocalChecked(); - definition->constructor_.SetPhantom(); - - // We add the callbacks here to keep them alive. We use the name as - // the key because it is unique per-registry. - v8::Local<v8::Object> object = v8::Object::New(script_state->GetIsolate()); - KeepAlive(object, V8PrivateProperty::GetCustomElementConnectedCallback, - connected_callback, definition->connected_callback_, script_state); - KeepAlive(object, V8PrivateProperty::GetCustomElementDisconnectedCallback, - disconnected_callback, definition->disconnected_callback_, - script_state); - KeepAlive(object, V8PrivateProperty::GetCustomElementAdoptedCallback, - adopted_callback, definition->adopted_callback_, script_state); - KeepAlive(object, V8PrivateProperty::GetCustomElementAttributeChangedCallback, - attribute_changed_callback, definition->attribute_changed_callback_, - script_state); - map->Set(script_state->GetContext(), name_value, object).ToLocalChecked(); return definition; } @@ -154,7 +121,29 @@ HashSet<AtomicString>&& observed_attributes) : CustomElementDefinition(descriptor, std::move(observed_attributes)), script_state_(script_state), - constructor_(script_state->GetIsolate(), constructor) {} + constructor_(script_state->GetIsolate(), this, constructor), + connected_callback_(this), + disconnected_callback_(this), + adopted_callback_(this), + attribute_changed_callback_(this) { + v8::Isolate* isolate = script_state->GetIsolate(); + if (!connected_callback.IsEmpty()) + connected_callback_.Set(isolate, connected_callback); + if (!disconnected_callback.IsEmpty()) + disconnected_callback_.Set(isolate, disconnected_callback); + if (!adopted_callback.IsEmpty()) + adopted_callback_.Set(isolate, adopted_callback); + if (!attribute_changed_callback.IsEmpty()) + attribute_changed_callback_.Set(isolate, attribute_changed_callback); +} + +DEFINE_TRACE_WRAPPERS(ScriptCustomElementDefinition) { + visitor->TraceWrappers(constructor_.Cast<v8::Value>()); + visitor->TraceWrappers(connected_callback_.Cast<v8::Value>()); + visitor->TraceWrappers(disconnected_callback_.Cast<v8::Value>()); + visitor->TraceWrappers(adopted_callback_.Cast<v8::Value>()); + visitor->TraceWrappers(attribute_changed_callback_.Cast<v8::Value>()); +} static void DispatchErrorEvent(v8::Isolate* isolate, v8::Local<v8::Value> exception,
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.h b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.h index 5d848d5f..439a73a0 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.h
@@ -7,8 +7,8 @@ #include "core/CoreExport.h" #include "core/dom/custom/CustomElementDefinition.h" -#include "platform/bindings/ScopedPersistent.h" #include "platform/bindings/ScriptState.h" +#include "platform/bindings/TraceWrapperV8Reference.h" #include "platform/wtf/Noncopyable.h" #include "platform/wtf/RefPtr.h" #include "v8.h" @@ -41,6 +41,8 @@ virtual ~ScriptCustomElementDefinition() = default; + DECLARE_VIRTUAL_TRACE_WRAPPERS(); + v8::Local<v8::Object> Constructor() const; HTMLElement* CreateElementSync(Document&, const QualifiedName&) override; @@ -88,11 +90,11 @@ ExceptionState&); RefPtr<ScriptState> script_state_; - ScopedPersistent<v8::Object> constructor_; - ScopedPersistent<v8::Function> connected_callback_; - ScopedPersistent<v8::Function> disconnected_callback_; - ScopedPersistent<v8::Function> adopted_callback_; - ScopedPersistent<v8::Function> attribute_changed_callback_; + TraceWrapperV8Reference<v8::Object> constructor_; + TraceWrapperV8Reference<v8::Function> connected_callback_; + TraceWrapperV8Reference<v8::Function> disconnected_callback_; + TraceWrapperV8Reference<v8::Function> adopted_callback_; + TraceWrapperV8Reference<v8::Function> attribute_changed_callback_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8DevToolsHostCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8DevToolsHostCustom.cpp index fbc6d6e..d97f7eac 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8DevToolsHostCustom.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8DevToolsHostCustom.cpp
@@ -82,9 +82,8 @@ continue; String type_string = ToCoreStringWithNullCheck(type.As<v8::String>()); if (type_string == "separator") { - ContextMenuItem item(ContextMenuItem(kSeparatorType, - kContextMenuItemCustomTagNoAction, - String(), String())); + ContextMenuItem item(ContextMenuItem( + kSeparatorType, kContextMenuItemCustomTagNoAction, String())); menu.AppendItem(item); } else if (type_string == "subMenu" && sub_items->IsArray()) { ContextMenu sub_menu; @@ -95,7 +94,7 @@ TOSTRING_DEFAULT(V8StringResource<kTreatNullAsNullString>, label_string, label, false); ContextMenuItem item(kSubmenuType, kContextMenuItemCustomTagNoAction, - label_string, String(), &sub_menu); + label_string, &sub_menu); menu.AppendItem(item); } else { int32_t int32_id; @@ -107,7 +106,7 @@ label, false); ContextMenuItem menu_item( (type_string == "checkbox" ? kCheckableActionType : kActionType), - typed_id, label_string, String()); + typed_id, label_string); if (checked->IsBoolean()) menu_item.SetChecked(checked.As<v8::Boolean>()->Value()); if (enabled->IsBoolean())
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py index c88be2b3..940e8f60 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
@@ -365,6 +365,8 @@ idl_type = attribute.idl_type base_idl_type = idl_type.base_type extended_attributes = attribute.extended_attributes + if attribute.is_static: + return False return ( # For readonly attributes, for performance reasons we keep the attribute # wrapper alive while the owner wrapper is alive, because the attribute
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp index 870eb79..017a708 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
@@ -36,7 +36,6 @@ #include "platform/RuntimeEnabledFeatures.h" #include "platform/bindings/ScriptState.h" #include "platform/bindings/V8ObjectConstructor.h" -#include "platform/bindings/V8PrivateProperty.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" #include "public/platform/WebFeature.h" @@ -375,18 +374,7 @@ } static void staticReadOnlyReturnDOMWrapperAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { - TestInterfaceImplementation* cppValue(WTF::GetPtr(TestInterfaceImplementation::staticReadOnlyReturnDOMWrapperAttribute())); - - // Keep the wrapper object for the return value alive as long as |this| - // object is alive in order to save creation time of the wrapper object. - if (cppValue && DOMDataStore::SetReturnValue(info.GetReturnValue(), cppValue)) - return; - v8::Local<v8::Value> v8Value(ToV8(cppValue, holder, info.GetIsolate())); - V8PrivateProperty::GetSymbol( - info.GetIsolate(), "KeepAlive#TestInterface#staticReadOnlyReturnDOMWrapperAttribute") - .Set(holder, v8Value); - - V8SetReturnValue(info, v8Value); + V8SetReturnValue(info, WTF::GetPtr(TestInterfaceImplementation::staticReadOnlyReturnDOMWrapperAttribute()), info.GetIsolate()->GetCurrentContext()->Global()); } static void staticConditionalReadOnlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp index 9c8583a..c04159e 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
@@ -4200,18 +4200,7 @@ } } - TestInterfaceImplementation* cppValue(WTF::GetPtr(TestObject::staticSaveSameObjectAttribute())); - - // Keep the wrapper object for the return value alive as long as |this| - // object is alive in order to save creation time of the wrapper object. - if (cppValue && DOMDataStore::SetReturnValue(info.GetReturnValue(), cppValue)) - return; - v8::Local<v8::Value> v8Value(ToV8(cppValue, holder, info.GetIsolate())); - V8PrivateProperty::GetSymbol( - info.GetIsolate(), "KeepAlive#TestObject#staticSaveSameObjectAttribute") - .Set(holder, v8Value); - - V8SetReturnValue(info, v8Value); + V8SetReturnValue(info, WTF::GetPtr(TestObject::staticSaveSameObjectAttribute()), info.GetIsolate()->GetCurrentContext()->Global()); // [SaveSameObject] privateSameObject.Set(holder, info.GetReturnValue().Get());
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn index e12dbf9..0d030dc 100644 --- a/third_party/WebKit/Source/core/BUILD.gn +++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -323,7 +323,6 @@ "events/PopStateEvent.idl", "events/ProgressEvent.idl", "events/PromiseRejectionEvent.idl", - "events/RelatedEvent.idl", "events/ResourceProgressEvent.idl", "events/SecurityPolicyViolationEvent.idl", "events/TextEvent.idl", @@ -1315,6 +1314,7 @@ "layout/LayoutTableCellTest.cpp", "layout/LayoutTableRowTest.cpp", "layout/LayoutTableSectionTest.cpp", + "layout/LayoutTableTest.cpp", "layout/LayoutTestHelper.cpp", "layout/LayoutTestHelper.h", "layout/LayoutTextTest.cpp", @@ -1377,7 +1377,6 @@ "loader/resource/MultipartImageResourceParserTest.cpp", "origin_trials/OriginTrialContextTest.cpp", "page/ChromeClientTest.cpp", - "page/ContextMenuControllerTest.cpp", "page/FocusControllerTest.cpp", "page/PagePopupClientTest.cpp", "page/PrintContextTest.cpp",
diff --git a/third_party/WebKit/Source/core/core_idl_files.gni b/third_party/WebKit/Source/core/core_idl_files.gni index 9dad1a5..728f46ec 100644 --- a/third_party/WebKit/Source/core/core_idl_files.gni +++ b/third_party/WebKit/Source/core/core_idl_files.gni
@@ -173,7 +173,6 @@ "events/PopStateEvent.idl", "events/ProgressEvent.idl", "events/PromiseRejectionEvent.idl", - "events/RelatedEvent.idl", "events/ResourceProgressEvent.idl", "events/SecurityPolicyViolationEvent.idl", "events/TextEvent.idl", @@ -231,7 +230,6 @@ "html/HTMLMapElement.idl", "html/HTMLMarqueeElement.idl", "html/HTMLMenuElement.idl", - "html/HTMLMenuItemElement.idl", "html/HTMLMetaElement.idl", "html/HTMLMeterElement.idl", "html/HTMLModElement.idl", @@ -551,7 +549,6 @@ "events/PopStateEventInit.idl", "events/ProgressEventInit.idl", "events/PromiseRejectionEventInit.idl", - "events/RelatedEventInit.idl", "events/SecurityPolicyViolationEventInit.idl", "events/TouchEventInit.idl", "events/TransitionEventInit.idl",
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h b/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h index 44d29c0..15b6061 100644 --- a/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h +++ b/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h
@@ -8,6 +8,7 @@ #include "bindings/core/v8/ScriptValue.h" #include "core/CoreExport.h" #include "core/dom/custom/CustomElementDescriptor.h" +#include "platform/bindings/ScriptWrappable.h" // For TraceWrapperBase #include "platform/heap/Handle.h" #include "platform/wtf/HashSet.h" #include "platform/wtf/Noncopyable.h" @@ -23,7 +24,8 @@ class QualifiedName; class CORE_EXPORT CustomElementDefinition - : public GarbageCollectedFinalized<CustomElementDefinition> { + : public GarbageCollectedFinalized<CustomElementDefinition>, + public TraceWrapperBase { WTF_MAKE_NONCOPYABLE(CustomElementDefinition); public: @@ -33,6 +35,7 @@ virtual ~CustomElementDefinition(); DECLARE_VIRTUAL_TRACE(); + DECLARE_VIRTUAL_TRACE_WRAPPERS() {} const CustomElementDescriptor& Descriptor() { return descriptor_; }
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.cpp index c0dfb779..18bf29f 100644 --- a/third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.cpp +++ b/third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.cpp
@@ -93,6 +93,8 @@ DEFINE_TRACE_WRAPPERS(CustomElementRegistry) { visitor->TraceWrappers(&CustomElementReactionStack::Current()); + for (auto definition : definitions_.Values()) + visitor->TraceWrappers(definition); } CustomElementDefinition* CustomElementRegistry::define( @@ -186,8 +188,9 @@ CustomElementDefinition* definition = builder.Build(descriptor); CHECK(!exception_state.HadException()); CHECK(definition->Descriptor() == descriptor); - DefinitionMap::AddResult result = - definitions_.insert(descriptor.GetName(), definition); + DefinitionMap::AddResult result = definitions_.insert( + descriptor.GetName(), + TraceWrapperMember<CustomElementDefinition>(this, definition)); CHECK(result.is_new_entry); HeapVector<Member<Element>> candidates;
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.h b/third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.h index 4abc535..fba6ad6 100644 --- a/third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.h +++ b/third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.h
@@ -8,7 +8,9 @@ #include "base/gtest_prod_util.h" #include "bindings/core/v8/ScriptPromise.h" #include "core/CoreExport.h" +#include "core/dom/custom/CustomElementDefinition.h" #include "platform/bindings/ScriptWrappable.h" +#include "platform/bindings/TraceWrapperMember.h" #include "platform/heap/Handle.h" #include "platform/wtf/Noncopyable.h" #include "platform/wtf/text/AtomicString.h" @@ -84,7 +86,7 @@ bool element_definition_is_running_; using DefinitionMap = - HeapHashMap<AtomicString, Member<CustomElementDefinition>>; + HeapHashMap<AtomicString, TraceWrapperMember<CustomElementDefinition>>; DefinitionMap definitions_; Member<const LocalDOMWindow> owner_;
diff --git a/third_party/WebKit/Source/core/editing/BUILD.gn b/third_party/WebKit/Source/core/editing/BUILD.gn index e96a0cc5..6dfdba75 100644 --- a/third_party/WebKit/Source/core/editing/BUILD.gn +++ b/third_party/WebKit/Source/core/editing/BUILD.gn
@@ -192,6 +192,8 @@ "iterators/TextIteratorTextState.h", "iterators/TextSearcherICU.cpp", "iterators/TextSearcherICU.h", + "markers/CompositionMarker.cpp", + "markers/CompositionMarker.h", "markers/CompositionMarkerListImpl.cpp", "markers/CompositionMarkerListImpl.h", "markers/DocumentMarker.cpp", @@ -312,6 +314,7 @@ "iterators/TextIteratorTest.cpp", "iterators/TextSearcherICUTest.cpp", "markers/CompositionMarkerListImplTest.cpp", + "markers/CompositionMarkerTest.cpp", "markers/DocumentMarkerControllerTest.cpp", "markers/DocumentMarkerListEditorTest.cpp", "markers/DocumentMarkerTest.cpp",
diff --git a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp index 2467fa8..82cebfdf 100644 --- a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp +++ b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
@@ -79,15 +79,16 @@ has_pending_selection_(false), paint_range_(SelectionPaintRange()) {} -SelectionInFlatTree LayoutSelection::CalcVisibleSelection( - const VisibleSelectionInFlatTree& original_selection) const { +static SelectionInFlatTree CalcSelection( + const VisibleSelectionInFlatTree& original_selection, + bool should_show_blok_cursor) { const PositionInFlatTree& start = original_selection.Start(); const PositionInFlatTree& end = original_selection.end(); SelectionType selection_type = original_selection.GetSelectionType(); const TextAffinity affinity = original_selection.Affinity(); bool paint_block_cursor = - frame_selection_->ShouldShowBlockCursor() && + should_show_blok_cursor && selection_type == SelectionType::kCaretSelection && !IsLogicalEndOfLine(CreateVisiblePosition(end, affinity)); if (EnclosingTextControl(start.ComputeContainerNode())) { @@ -315,25 +316,22 @@ paint_range_ = SelectionPaintRange(); } -void LayoutSelection::Commit() { - if (!HasPendingSelection()) - return; - has_pending_selection_ = false; - +static SelectionPaintRange CalcSelectionPaintRange( + const FrameSelection& frame_selection) { const VisibleSelectionInFlatTree& original_selection = - frame_selection_->ComputeVisibleSelectionInFlatTree(); - + frame_selection.ComputeVisibleSelectionInFlatTree(); // Construct a new VisibleSolution, since visibleSelection() is not // necessarily valid, and the following steps assume a valid selection. See // <https://bugs.webkit.org/show_bug.cgi?id=69563> and // <rdar://problem/10232866>. + const SelectionInFlatTree& new_selection = CalcSelection( + original_selection, frame_selection.ShouldShowBlockCursor()); const VisibleSelectionInFlatTree& selection = - CreateVisibleSelection(CalcVisibleSelection(original_selection)); + CreateVisibleSelection(new_selection); - if (!selection.IsRange() || frame_selection_->IsHidden()) { - ClearSelection(); - return; - } + if (!selection.IsRange() || frame_selection.IsHidden()) + return SelectionPaintRange(); + DCHECK(!selection.IsNone()); // Use the rightmost candidate for the start of the selection, and the // leftmost candidate for the end of the selection. Example: foo <a>bar</a>. @@ -360,9 +358,22 @@ DCHECK(end_layout_object); DCHECK(start_layout_object->View() == end_layout_object->View()); - const SelectionPaintRange new_range( - start_layout_object, start_pos.ComputeEditingOffset(), end_layout_object, - end_pos.ComputeEditingOffset()); + return SelectionPaintRange(start_layout_object, + start_pos.ComputeEditingOffset(), + end_layout_object, end_pos.ComputeEditingOffset()); +} + +void LayoutSelection::Commit() { + if (!HasPendingSelection()) + return; + has_pending_selection_ = false; + + const SelectionPaintRange& new_range = + CalcSelectionPaintRange(*frame_selection_); + if (new_range.IsNull()) { + ClearSelection(); + return; + } // Just return if the selection hasn't changed. if (paint_range_ == new_range) return;
diff --git a/third_party/WebKit/Source/core/editing/LayoutSelection.h b/third_party/WebKit/Source/core/editing/LayoutSelection.h index 2532756..272d016 100644 --- a/third_party/WebKit/Source/core/editing/LayoutSelection.h +++ b/third_party/WebKit/Source/core/editing/LayoutSelection.h
@@ -88,9 +88,6 @@ private: LayoutSelection(FrameSelection&); - SelectionInFlatTree CalcVisibleSelection( - const VisibleSelectionInFlatTree&) const; - Member<FrameSelection> frame_selection_; bool has_pending_selection_ : 1;
diff --git a/third_party/WebKit/Source/core/editing/markers/CompositionMarker.cpp b/third_party/WebKit/Source/core/editing/markers/CompositionMarker.cpp new file mode 100644 index 0000000..f445f50 --- /dev/null +++ b/third_party/WebKit/Source/core/editing/markers/CompositionMarker.cpp
@@ -0,0 +1,31 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/editing/markers/CompositionMarker.h" + +namespace blink { + +CompositionMarker::CompositionMarker(unsigned start_offset, + unsigned end_offset, + Color underline_color, + bool thick, + Color background_color) + : DocumentMarker(DocumentMarker::kComposition, start_offset, end_offset), + underline_color_(underline_color), + background_color_(background_color), + thick_(thick) {} + +Color CompositionMarker::UnderlineColor() const { + return underline_color_; +} + +bool CompositionMarker::Thick() const { + return thick_; +} + +Color CompositionMarker::BackgroundColor() const { + return background_color_; +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/markers/CompositionMarker.h b/third_party/WebKit/Source/core/editing/markers/CompositionMarker.h new file mode 100644 index 0000000..0b02e62 --- /dev/null +++ b/third_party/WebKit/Source/core/editing/markers/CompositionMarker.h
@@ -0,0 +1,45 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CompositionMarker_h +#define CompositionMarker_h + +#include "core/editing/markers/DocumentMarker.h" + +namespace blink { + +// A subclass of DocumentMarker used to store information specific to +// composition markers. We store what color to display the underline (possibly +// transparent), whether the underline should be thick or not, and what +// background color should be used under the marked text (also possibly +// transparent). +class CORE_EXPORT CompositionMarker final : public DocumentMarker { + public: + CompositionMarker(unsigned start_offset, + unsigned end_offset, + Color underline_color, + bool thick, + Color background_color); + + Color UnderlineColor() const; + bool Thick() const; + Color BackgroundColor() const; + + private: + const Color underline_color_; + const Color background_color_; + const bool thick_; + + DISALLOW_COPY_AND_ASSIGN(CompositionMarker); +}; + +DEFINE_TYPE_CASTS(CompositionMarker, + DocumentMarker, + marker, + marker->GetType() == DocumentMarker::kComposition, + marker.GetType() == DocumentMarker::kComposition); + +} // namespace blink + +#endif
diff --git a/third_party/WebKit/Source/core/editing/markers/CompositionMarkerListImplTest.cpp b/third_party/WebKit/Source/core/editing/markers/CompositionMarkerListImplTest.cpp index dcd94cd..5a6e3239 100644 --- a/third_party/WebKit/Source/core/editing/markers/CompositionMarkerListImplTest.cpp +++ b/third_party/WebKit/Source/core/editing/markers/CompositionMarkerListImplTest.cpp
@@ -5,6 +5,7 @@ #include "core/editing/markers/CompositionMarkerListImpl.h" #include "core/editing/EditingTestBase.h" +#include "core/editing/markers/CompositionMarker.h" namespace blink { @@ -14,8 +15,8 @@ : marker_list_(new CompositionMarkerListImpl()) {} DocumentMarker* CreateMarker(unsigned start_offset, unsigned end_offset) { - return new DocumentMarker(start_offset, end_offset, Color::kBlack, false, - Color::kBlack); + return new CompositionMarker(start_offset, end_offset, Color::kBlack, false, + Color::kBlack); } Persistent<CompositionMarkerListImpl> marker_list_;
diff --git a/third_party/WebKit/Source/core/editing/markers/CompositionMarkerTest.cpp b/third_party/WebKit/Source/core/editing/markers/CompositionMarkerTest.cpp new file mode 100644 index 0000000..f45f647 --- /dev/null +++ b/third_party/WebKit/Source/core/editing/markers/CompositionMarkerTest.cpp
@@ -0,0 +1,31 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/editing/markers/CompositionMarker.h" + +#include "testing/gtest/include/gtest/gtest.h" + +namespace blink { + +class CompositionMarkerTest : public ::testing::Test {}; + +TEST_F(CompositionMarkerTest, MarkerType) { + DocumentMarker* marker = new CompositionMarker(0, 1, Color::kTransparent, + false, Color::kTransparent); + EXPECT_EQ(DocumentMarker::kComposition, marker->GetType()); +} + +TEST_F(CompositionMarkerTest, ConstructorAndGetters) { + CompositionMarker* marker = + new CompositionMarker(0, 1, Color::kDarkGray, false, Color::kGray); + EXPECT_EQ(Color::kDarkGray, marker->UnderlineColor()); + EXPECT_FALSE(marker->Thick()); + EXPECT_EQ(Color::kGray, marker->BackgroundColor()); + + CompositionMarker* thick_marker = + new CompositionMarker(0, 1, Color::kDarkGray, true, Color::kGray); + EXPECT_EQ(true, thick_marker->Thick()); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp index 11c02f0..7e9f2b1 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
@@ -63,45 +63,6 @@ return 0; } -class TextCompositionMarkerDetails final : public DocumentMarkerDetails { - public: - static TextCompositionMarkerDetails* Create(Color underline_color, - bool thick, - Color background_color); - - bool IsComposition() const override { return true; } - Color UnderlineColor() const { return underline_color_; } - bool Thick() const { return thick_; } - Color BackgroundColor() const { return background_color_; } - - private: - TextCompositionMarkerDetails(Color underline_color, - bool thick, - Color background_color) - : underline_color_(underline_color), - background_color_(background_color), - thick_(thick) {} - - Color underline_color_; - Color background_color_; - bool thick_; -}; - -TextCompositionMarkerDetails* TextCompositionMarkerDetails::Create( - Color underline_color, - bool thick, - Color background_color) { - return new TextCompositionMarkerDetails(underline_color, thick, - background_color); -} - -inline TextCompositionMarkerDetails* ToTextCompositionMarkerDetails( - DocumentMarkerDetails* details) { - if (details && details->IsComposition()) - return static_cast<TextCompositionMarkerDetails*>(details); - return nullptr; -} - DocumentMarker::DocumentMarker(MarkerType type, unsigned start_offset, unsigned end_offset) @@ -120,18 +81,6 @@ ? nullptr : DocumentMarkerDescription::Create(description)) {} -DocumentMarker::DocumentMarker(unsigned start_offset, - unsigned end_offset, - Color underline_color, - bool thick, - Color background_color) - : type_(DocumentMarker::kComposition), - start_offset_(start_offset), - end_offset_(end_offset), - details_(TextCompositionMarkerDetails::Create(underline_color, - thick, - background_color)) {} - Optional<DocumentMarker::MarkerOffsets> DocumentMarker::ComputeOffsetsAfterShift(unsigned offset, unsigned old_length, @@ -190,27 +139,6 @@ return g_empty_string; } -Color DocumentMarker::UnderlineColor() const { - if (TextCompositionMarkerDetails* details = - ToTextCompositionMarkerDetails(details_.Get())) - return details->UnderlineColor(); - return Color::kTransparent; -} - -bool DocumentMarker::Thick() const { - if (TextCompositionMarkerDetails* details = - ToTextCompositionMarkerDetails(details_.Get())) - return details->Thick(); - return false; -} - -Color DocumentMarker::BackgroundColor() const { - if (TextCompositionMarkerDetails* details = - ToTextCompositionMarkerDetails(details_.Get())) - return details->BackgroundColor(); - return Color::kTransparent; -} - DEFINE_TRACE(DocumentMarker) { visitor->Trace(details_); }
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h index f0c8d38..2d7169c 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
@@ -132,20 +132,12 @@ unsigned start_offset, unsigned end_offset, const String& description); - DocumentMarker(unsigned start_offset, - unsigned end_offset, - Color underline_color, - bool thick, - Color background_color); MarkerType GetType() const { return type_; } unsigned StartOffset() const { return start_offset_; } unsigned EndOffset() const { return end_offset_; } const String& Description() const; - Color UnderlineColor() const; - bool Thick() const; - Color BackgroundColor() const; DocumentMarkerDetails* Details() const; void ClearDetails() { details_.Clear(); } @@ -191,7 +183,6 @@ DocumentMarkerDetails() {} virtual ~DocumentMarkerDetails(); virtual bool IsDescription() const { return false; } - virtual bool IsComposition() const { return false; } DEFINE_INLINE_VIRTUAL_TRACE() {} };
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp index 5456789..0064a7f 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
@@ -34,6 +34,7 @@ #include "core/dom/Text.h" #include "core/editing/VisibleUnits.h" #include "core/editing/iterators/TextIterator.h" +#include "core/editing/markers/CompositionMarker.h" #include "core/editing/markers/CompositionMarkerListImpl.h" #include "core/editing/markers/DocumentMarkerListEditor.h" #include "core/editing/markers/GrammarMarkerListImpl.h" @@ -162,8 +163,8 @@ DCHECK(!document_->NeedsLayoutTreeUpdate()); AddMarkerInternal(range, [underline_color, thick, background_color]( int start_offset, int end_offset) { - return new DocumentMarker(start_offset, end_offset, underline_color, thick, - background_color); + return new CompositionMarker(start_offset, end_offset, underline_color, + thick, background_color); }); }
diff --git a/third_party/WebKit/Source/core/editing/markers/TextMatchMarker.h b/third_party/WebKit/Source/core/editing/markers/TextMatchMarker.h index 4422679..0b712782 100644 --- a/third_party/WebKit/Source/core/editing/markers/TextMatchMarker.h +++ b/third_party/WebKit/Source/core/editing/markers/TextMatchMarker.h
@@ -86,6 +86,8 @@ MatchStatus match_status_; LayoutRect rendered_rect_; State layout_state_; + + DISALLOW_COPY_AND_ASSIGN(TextMatchMarker); }; DEFINE_TYPE_CASTS(TextMatchMarker,
diff --git a/third_party/WebKit/Source/core/events/BUILD.gn b/third_party/WebKit/Source/core/events/BUILD.gn index f8590dd..52bffd8 100644 --- a/third_party/WebKit/Source/core/events/BUILD.gn +++ b/third_party/WebKit/Source/core/events/BUILD.gn
@@ -83,8 +83,6 @@ "PromiseRejectionEvent.cpp", "PromiseRejectionEvent.h", "RegisteredEventListener.h", - "RelatedEvent.cpp", - "RelatedEvent.h", "ResourceProgressEvent.cpp", "ResourceProgressEvent.h", "ScopedEventQueue.cpp",
diff --git a/third_party/WebKit/Source/core/events/RelatedEvent.cpp b/third_party/WebKit/Source/core/events/RelatedEvent.cpp deleted file mode 100644 index 9a433d30..0000000 --- a/third_party/WebKit/Source/core/events/RelatedEvent.cpp +++ /dev/null
@@ -1,41 +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 "core/events/RelatedEvent.h" - -namespace blink { - -RelatedEvent::~RelatedEvent() {} - -RelatedEvent* RelatedEvent::Create(const AtomicString& type, - bool can_bubble, - bool cancelable, - EventTarget* related_target) { - return new RelatedEvent(type, can_bubble, cancelable, related_target); -} - -RelatedEvent* RelatedEvent::Create(const AtomicString& type, - const RelatedEventInit& initializer) { - return new RelatedEvent(type, initializer); -} - -RelatedEvent::RelatedEvent(const AtomicString& type, - bool can_bubble, - bool cancelable, - EventTarget* related_target) - : Event(type, can_bubble, cancelable), related_target_(related_target) {} - -RelatedEvent::RelatedEvent(const AtomicString& event_type, - const RelatedEventInit& initializer) - : Event(event_type, initializer) { - if (initializer.hasRelatedTarget()) - related_target_ = initializer.relatedTarget(); -} - -DEFINE_TRACE(RelatedEvent) { - visitor->Trace(related_target_); - Event::Trace(visitor); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/core/events/RelatedEvent.h b/third_party/WebKit/Source/core/events/RelatedEvent.h deleted file mode 100644 index 86420faa..0000000 --- a/third_party/WebKit/Source/core/events/RelatedEvent.h +++ /dev/null
@@ -1,49 +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 RelatedEvent_h -#define RelatedEvent_h - -#include "core/events/Event.h" -#include "core/events/RelatedEventInit.h" - -namespace blink { - -class RelatedEvent final : public Event { - DEFINE_WRAPPERTYPEINFO(); - - public: - static RelatedEvent* Create(const AtomicString& type, - bool can_bubble, - bool cancelable, - EventTarget* related_target); - static RelatedEvent* Create(const AtomicString& event_type, - const RelatedEventInit&); - - ~RelatedEvent() override; - - EventTarget* relatedTarget() const { return related_target_.Get(); } - - const AtomicString& InterfaceName() const override { - return EventNames::RelatedEvent; - } - bool IsRelatedEvent() const override { return true; } - - DECLARE_VIRTUAL_TRACE(); - - private: - RelatedEvent(const AtomicString& type, - bool can_bubble, - bool cancelable, - EventTarget*); - RelatedEvent(const AtomicString& type, const RelatedEventInit&); - - Member<EventTarget> related_target_; -}; - -DEFINE_EVENT_TYPE_CASTS(RelatedEvent); - -} // namespace blink - -#endif // RelatedEvent_h
diff --git a/third_party/WebKit/Source/core/events/RelatedEvent.idl b/third_party/WebKit/Source/core/events/RelatedEvent.idl deleted file mode 100644 index 142bf29..0000000 --- a/third_party/WebKit/Source/core/events/RelatedEvent.idl +++ /dev/null
@@ -1,12 +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. - -// https://html.spec.whatwg.org/#the-relatedevent-interfaces - -[ - Constructor(DOMString type, optional RelatedEventInit eventInitDict), - RuntimeEnabled=ContextMenu, -] interface RelatedEvent : Event { - readonly attribute EventTarget? relatedTarget; -};
diff --git a/third_party/WebKit/Source/core/events/RelatedEventInit.idl b/third_party/WebKit/Source/core/events/RelatedEventInit.idl deleted file mode 100644 index 3322b553..0000000 --- a/third_party/WebKit/Source/core/events/RelatedEventInit.idl +++ /dev/null
@@ -1,9 +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. - -// https://html.spec.whatwg.org/#the-relatedevent-interfaces - -dictionary RelatedEventInit : EventInit { - EventTarget? relatedTarget; -};
diff --git a/third_party/WebKit/Source/core/frame/FrameOrPlugin.h b/third_party/WebKit/Source/core/frame/FrameOrPlugin.h index a9aed1e..6801141 100644 --- a/third_party/WebKit/Source/core/frame/FrameOrPlugin.h +++ b/third_party/WebKit/Source/core/frame/FrameOrPlugin.h
@@ -20,7 +20,7 @@ public: virtual ~FrameOrPlugin() {} - virtual bool IsFrameView() const { return false; } + virtual bool IsLocalFrameView() const { return false; } virtual bool IsPluginView() const { return false; } virtual void Attach() = 0;
diff --git a/third_party/WebKit/Source/core/frame/LocalFrameView.h b/third_party/WebKit/Source/core/frame/LocalFrameView.h index 130277f..c42da6d 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrameView.h +++ b/third_party/WebKit/Source/core/frame/LocalFrameView.h
@@ -661,7 +661,7 @@ const Scrollbar&, const IntPoint&) const override; - bool IsFrameView() const override { return true; } + bool IsLocalFrameView() const override { return true; } DECLARE_VIRTUAL_TRACE(); void NotifyPageThatContentAreaWillPaint() const; @@ -1259,18 +1259,18 @@ DEFINE_TYPE_CASTS(LocalFrameView, PlatformFrameView, platform_frame_view, - platform_frame_view->IsFrameView(), - platform_frame_view.IsFrameView()); + platform_frame_view->IsLocalFrameView(), + platform_frame_view.IsLocalFrameView()); DEFINE_TYPE_CASTS(LocalFrameView, FrameOrPlugin, frame_or_plugin, - frame_or_plugin->IsFrameView(), - frame_or_plugin.IsFrameView()); + frame_or_plugin->IsLocalFrameView(), + frame_or_plugin.IsLocalFrameView()); DEFINE_TYPE_CASTS(LocalFrameView, ScrollableArea, scrollableArea, - scrollableArea->IsFrameView(), - scrollableArea.IsFrameView()); + scrollableArea->IsLocalFrameView(), + scrollableArea.IsLocalFrameView()); } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/BUILD.gn b/third_party/WebKit/Source/core/html/BUILD.gn index d5556ac..f46ed0d 100644 --- a/third_party/WebKit/Source/core/html/BUILD.gn +++ b/third_party/WebKit/Source/core/html/BUILD.gn
@@ -120,8 +120,6 @@ "HTMLMediaElement.h", "HTMLMenuElement.cpp", "HTMLMenuElement.h", - "HTMLMenuItemElement.cpp", - "HTMLMenuItemElement.h", "HTMLMetaElement.cpp", "HTMLMetaElement.h", "HTMLMeterElement.cpp",
diff --git a/third_party/WebKit/Source/core/html/HTMLAttributeNames.json5 b/third_party/WebKit/Source/core/html/HTMLAttributeNames.json5 index 4169fa1..270e811 100644 --- a/third_party/WebKit/Source/core/html/HTMLAttributeNames.json5 +++ b/third_party/WebKit/Source/core/html/HTMLAttributeNames.json5
@@ -104,7 +104,6 @@ "compact", "content", "contenteditable", - "contextmenu", "controls", "controlslist", "coords", @@ -143,7 +142,6 @@ "hreflang", "hspace", "http-equiv", - "icon", "id", "incremental", "inert", @@ -301,7 +299,6 @@ "poster", "preload", "pseudo", - "radiogroup", "readonly", "referrerpolicy", "rel",
diff --git a/third_party/WebKit/Source/core/html/HTMLElement.cpp b/third_party/WebKit/Source/core/html/HTMLElement.cpp index 1f083b6d..0add414 100644 --- a/third_party/WebKit/Source/core/html/HTMLElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp
@@ -57,7 +57,6 @@ #include "core/html/HTMLDimension.h" #include "core/html/HTMLFormElement.h" #include "core/html/HTMLInputElement.h" -#include "core/html/HTMLMenuElement.h" #include "core/html/HTMLTemplateElement.h" #include "core/html/parser/HTMLParserIdioms.h" #include "core/layout/LayoutBoxModelObject.h" @@ -1068,49 +1067,6 @@ return false; } -HTMLMenuElement* HTMLElement::AssignedContextMenu() const { - if (HTMLMenuElement* menu = contextMenu()) - return menu; - - return parentElement() && parentElement()->IsHTMLElement() - ? ToHTMLElement(parentElement())->AssignedContextMenu() - : nullptr; -} - -HTMLMenuElement* HTMLElement::contextMenu() const { - const AtomicString& context_menu_id(FastGetAttribute(contextmenuAttr)); - if (context_menu_id.IsNull()) - return nullptr; - - Element* element = GetTreeScope().getElementById(context_menu_id); - // Not checking if the menu element is of type "popup". - // Ignoring menu element type attribute is intentional according to the - // standard. - return isHTMLMenuElement(element) ? toHTMLMenuElement(element) : nullptr; -} - -void HTMLElement::setContextMenu(HTMLMenuElement* context_menu) { - if (!context_menu) { - setAttribute(contextmenuAttr, ""); - return; - } - - // http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#reflecting-content-attributes-in-idl-attributes - // On setting, if the given element has an id attribute, and has the same home - // subtree as the element of the attribute being set, and the given element is - // the first element in that home subtree whose ID is the value of that id - // attribute, then the content attribute must be set to the value of that id - // attribute. Otherwise, the content attribute must be set to the empty - // string. - const AtomicString& context_menu_id(context_menu->FastGetAttribute(idAttr)); - - if (!context_menu_id.IsNull() && - context_menu == GetTreeScope().getElementById(context_menu_id)) - setAttribute(contextmenuAttr, context_menu_id); - else - setAttribute(contextmenuAttr, ""); -} - void HTMLElement::DefaultEventHandler(Event* event) { if (event->type() == EventTypeNames::keypress && event->IsKeyboardEvent()) { HandleKeypressEvent(ToKeyboardEvent(event));
diff --git a/third_party/WebKit/Source/core/html/HTMLElement.h b/third_party/WebKit/Source/core/html/HTMLElement.h index b890e3b..df14759 100644 --- a/third_party/WebKit/Source/core/html/HTMLElement.h +++ b/third_party/WebKit/Source/core/html/HTMLElement.h
@@ -32,7 +32,6 @@ class ExceptionState; class FormAssociated; class HTMLFormElement; -class HTMLMenuElement; class KeyboardEvent; enum TranslateAttributeMode { @@ -107,10 +106,6 @@ static const AtomicString& EventParameterName(); - HTMLMenuElement* AssignedContextMenu() const; - HTMLMenuElement* contextMenu() const; - void setContextMenu(HTMLMenuElement*); - virtual String AltText() const { return String(); } int offsetLeftForBinding();
diff --git a/third_party/WebKit/Source/core/html/HTMLElement.idl b/third_party/WebKit/Source/core/html/HTMLElement.idl index 74763c0..ad8390f7 100644 --- a/third_party/WebKit/Source/core/html/HTMLElement.idl +++ b/third_party/WebKit/Source/core/html/HTMLElement.idl
@@ -37,7 +37,6 @@ void blur(); [CEReactions, Reflect] attribute DOMString accessKey; [CEReactions, CustomElementCallbacks] attribute boolean draggable; - [CEReactions, RuntimeEnabled=ContextMenu] attribute HTMLMenuElement? contextMenu; [CEReactions] attribute boolean spellcheck; // HTMLElement implements ElementContentEditable
diff --git a/third_party/WebKit/Source/core/html/HTMLMenuElement.cpp b/third_party/WebKit/Source/core/html/HTMLMenuElement.cpp index 59ffce3..d26d981a 100644 --- a/third_party/WebKit/Source/core/html/HTMLMenuElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMenuElement.cpp
@@ -31,25 +31,6 @@ inline HTMLMenuElement::HTMLMenuElement(Document& document) : HTMLElement(menuTag, document) {} -const String HTMLMenuElement::type() const { - const AtomicString menuType = FastGetAttribute(typeAttr); - if (EqualIgnoringASCIICase(menuType, "context")) { - return "context"; - } - if (EqualIgnoringASCIICase(menuType, "toolbar")) { - return "toolbar"; - } - if (parentNode() && isHTMLMenuElement(parentNode()) && - toHTMLMenuElement(parentNode())->type() == "context") { - return "context"; - } - return "toolbar"; -} - -void HTMLMenuElement::setType(const AtomicString& type) { - setAttribute(typeAttr, type); -} - DEFINE_NODE_FACTORY(HTMLMenuElement) } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/HTMLMenuElement.h b/third_party/WebKit/Source/core/html/HTMLMenuElement.h index 5779940..599ab98 100644 --- a/third_party/WebKit/Source/core/html/HTMLMenuElement.h +++ b/third_party/WebKit/Source/core/html/HTMLMenuElement.h
@@ -31,8 +31,6 @@ DEFINE_WRAPPERTYPEINFO(); public: - const String type() const; - void setType(const AtomicString&); DECLARE_NODE_FACTORY(HTMLMenuElement); private:
diff --git a/third_party/WebKit/Source/core/html/HTMLMenuElement.idl b/third_party/WebKit/Source/core/html/HTMLMenuElement.idl index 96b4618..e7913e27 100644 --- a/third_party/WebKit/Source/core/html/HTMLMenuElement.idl +++ b/third_party/WebKit/Source/core/html/HTMLMenuElement.idl
@@ -20,9 +20,6 @@ // https://html.spec.whatwg.org/#the-menu-element interface HTMLMenuElement : HTMLElement { - [CEReactions, RuntimeEnabled=ContextMenu] attribute DOMString type; - [CEReactions, RuntimeEnabled=ContextMenu, Reflect] attribute DOMString label; - // obsolete members // https://html.spec.whatwg.org/#HTMLMenuElement-partial [CEReactions, Reflect] attribute boolean compact;
diff --git a/third_party/WebKit/Source/core/html/HTMLMenuItemElement.cpp b/third_party/WebKit/Source/core/html/HTMLMenuItemElement.cpp deleted file mode 100644 index 5675f11..0000000 --- a/third_party/WebKit/Source/core/html/HTMLMenuItemElement.cpp +++ /dev/null
@@ -1,83 +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 "core/html/HTMLMenuItemElement.h" - -#include "core/HTMLNames.h" -#include "core/dom/ElementTraversal.h" -#include "core/events/Event.h" -#include "core/frame/UseCounter.h" -#include "core/html/parser/HTMLParserIdioms.h" - -namespace blink { - -using namespace HTMLNames; - -inline HTMLMenuItemElement::HTMLMenuItemElement(Document& document) - : HTMLElement(HTMLNames::menuitemTag, document) { - UseCounter::Count(document, UseCounter::kMenuItemElement); -} - -bool HTMLMenuItemElement::IsURLAttribute(const Attribute& attribute) const { - return attribute.GetName() == iconAttr || - HTMLElement::IsURLAttribute(attribute); -} - -void HTMLMenuItemElement::ParseAttribute( - const AttributeModificationParams& params) { - if (params.name == iconAttr) - UseCounter::Count(GetDocument(), UseCounter::kMenuItemElementIconAttribute); - HTMLElement::ParseAttribute(params); -} - -void HTMLMenuItemElement::DefaultEventHandler(Event* event) { - if (event->type() == EventTypeNames::click) { - if (DeprecatedEqualIgnoringCase(FastGetAttribute(typeAttr), "checkbox")) { - if (FastHasAttribute(checkedAttr)) - removeAttribute(checkedAttr); - else - setAttribute(checkedAttr, "checked"); - } else if (DeprecatedEqualIgnoringCase(FastGetAttribute(typeAttr), - "radio")) { - if (Element* parent = parentElement()) { - AtomicString group = FastGetAttribute(radiogroupAttr); - for (HTMLMenuItemElement& menu_item : - Traversal<HTMLMenuItemElement>::ChildrenOf(*parent)) { - if (!menu_item.FastHasAttribute(checkedAttr)) - continue; - const AtomicString& group_attr = - menu_item.FastGetAttribute(radiogroupAttr); - if (EqualIgnoringNullity(group_attr.Impl(), group.Impl())) - menu_item.removeAttribute(checkedAttr); - } - } - setAttribute(checkedAttr, "checked"); - } - event->SetDefaultHandled(); - } -} - -String HTMLMenuItemElement::label() const { - const AtomicString label = FastGetAttribute(labelAttr); - if (!label.IsNull()) - return label; - return conceptualLabel(); -} - -void HTMLMenuItemElement::setLabel(const AtomicString& label) { - setAttribute(labelAttr, label); -} - -String HTMLMenuItemElement::conceptualLabel() const { - const AtomicString label = FastGetAttribute(labelAttr); - if (!label.IsEmpty()) - return label; - return this->textContent(false) - .StripWhiteSpace(IsHTMLSpace<UChar>) - .SimplifyWhiteSpace(IsHTMLSpace<UChar>); -} - -DEFINE_NODE_FACTORY(HTMLMenuItemElement) - -} // namespace blink
diff --git a/third_party/WebKit/Source/core/html/HTMLMenuItemElement.h b/third_party/WebKit/Source/core/html/HTMLMenuItemElement.h deleted file mode 100644 index 9a8e598e..0000000 --- a/third_party/WebKit/Source/core/html/HTMLMenuItemElement.h +++ /dev/null
@@ -1,34 +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 HTMLMenuItemElement_h -#define HTMLMenuItemElement_h - -#include "core/html/HTMLElement.h" - -namespace blink { - -class HTMLMenuItemElement final : public HTMLElement { - DEFINE_WRAPPERTYPEINFO(); - - public: - DECLARE_NODE_FACTORY(HTMLMenuItemElement); - - // https://html.spec.whatwg.org/multipage/forms.html#dom-menuitem-label - String label() const; - void setLabel(const AtomicString&); - - // https://html.spec.whatwg.org/multipage/forms.html#concept-menuitem-label - String conceptualLabel() const; - - private: - explicit HTMLMenuItemElement(Document&); - bool IsURLAttribute(const Attribute&) const override; - void ParseAttribute(const AttributeModificationParams&) override; - void DefaultEventHandler(Event*) override; -}; - -} // namespace blink - -#endif // HTMLMenuItemElement_h
diff --git a/third_party/WebKit/Source/core/html/HTMLMenuItemElement.idl b/third_party/WebKit/Source/core/html/HTMLMenuItemElement.idl deleted file mode 100644 index c26a87e..0000000 --- a/third_party/WebKit/Source/core/html/HTMLMenuItemElement.idl +++ /dev/null
@@ -1,18 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// https://html.spec.whatwg.org/#the-menuitem-element - -[ - RuntimeEnabled=ContextMenu, -] interface HTMLMenuItemElement : HTMLElement { - [CEReactions, Reflect, ReflectOnly=("checkbox","radio"), ReflectInvalid="command", ReflectMissing="command"] attribute DOMString type; - [CEReactions] attribute DOMString label; - [CEReactions, Reflect, URL] attribute DOMString icon; - [CEReactions, Reflect] attribute boolean disabled; - [CEReactions, Reflect] attribute boolean checked; - [CEReactions, Reflect] attribute DOMString radiogroup; - [CEReactions, Reflect] attribute boolean default; - // FIXME: readonly attribute HTMLElement? command; -};
diff --git a/third_party/WebKit/Source/core/html/HTMLTagNames.json5 b/third_party/WebKit/Source/core/html/HTMLTagNames.json5 index 5d65b245..8ca99927 100644 --- a/third_party/WebKit/Source/core/html/HTMLTagNames.json5 +++ b/third_party/WebKit/Source/core/html/HTMLTagNames.json5
@@ -269,11 +269,6 @@ }, "marquee", "menu", - { - name: "menuitem", - interfaceName: "HTMLMenuItemElement", - runtimeEnabled: "contextMenu", - }, "meta", { name: "meter",
diff --git a/third_party/WebKit/Source/core/html/HTMLUnknownElement.cpp b/third_party/WebKit/Source/core/html/HTMLUnknownElement.cpp index d87b3e4..2af0d17c 100644 --- a/third_party/WebKit/Source/core/html/HTMLUnknownElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLUnknownElement.cpp
@@ -15,15 +15,6 @@ UseCounter::Count(document, UseCounter::kDataElement); else if (tag_name.LocalName() == "time") UseCounter::Count(document, UseCounter::kTimeElement); - else if (tag_name.LocalName() == "menuitem") - UseCounter::Count(document, UseCounter::kMenuItemElement); -} - -void HTMLUnknownElement::ParseAttribute( - const AttributeModificationParams& params) { - if (params.name == HTMLNames::iconAttr && HasTagName(HTMLNames::menuitemTag)) - UseCounter::Count(GetDocument(), UseCounter::kMenuItemElementIconAttribute); - HTMLElement::ParseAttribute(params); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/HTMLUnknownElement.h b/third_party/WebKit/Source/core/html/HTMLUnknownElement.h index fef667e9..0a36182 100644 --- a/third_party/WebKit/Source/core/html/HTMLUnknownElement.h +++ b/third_party/WebKit/Source/core/html/HTMLUnknownElement.h
@@ -46,7 +46,6 @@ private: HTMLUnknownElement(const QualifiedName&, Document&); - void ParseAttribute(const AttributeModificationParams&) override; bool IsHTMLUnknownElement() const override { return true; } };
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp index 3b3c58b..73eb573da 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp
@@ -1384,9 +1384,6 @@ void HTMLTreeBuilder::ProcessAnyOtherEndTagForInBody(AtomicHTMLToken* token) { DCHECK_EQ(token->GetType(), HTMLToken::kEndTag); - if (token->GetName() == menuitemTag) - UseCounter::Count(tree_.CurrentNode()->GetDocument(), - UseCounter::kMenuItemCloseTag); HTMLElementStack::ElementRecord* record = tree_.OpenElements()->TopRecord(); while (1) { HTMLStackItem* item = record->StackItem();
diff --git a/third_party/WebKit/Source/core/layout/LayoutPart.cpp b/third_party/WebKit/Source/core/layout/LayoutPart.cpp index 39c73cb..274531d3a 100644 --- a/third_party/WebKit/Source/core/layout/LayoutPart.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutPart.cpp
@@ -95,7 +95,7 @@ LocalFrameView* LayoutPart::ChildFrameView() const { FrameOrPlugin* frame_or_plugin = GetFrameOrPlugin(); - if (frame_or_plugin && frame_or_plugin->IsFrameView()) + if (frame_or_plugin && frame_or_plugin->IsLocalFrameView()) return ToLocalFrameView(frame_or_plugin); return nullptr; }
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp index 3b8bdc8..0c8b64c3 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -58,6 +58,7 @@ first_body_(nullptr), collapsed_borders_valid_(false), needs_invalidate_collapsed_borders_for_all_cells_(false), + collapsed_outer_borders_valid_(false), has_col_elements_(false), needs_section_recalc_(false), column_logical_width_changed_(false), @@ -65,8 +66,10 @@ no_cell_colspan_at_least_(0), h_spacing_(0), v_spacing_(0), - border_start_(0), - border_end_(0) { + collapsed_outer_border_start_(0), + collapsed_outer_border_end_(0), + collapsed_outer_border_before_(0), + collapsed_outer_border_after_(0) { DCHECK(!ChildrenInline()); effective_column_positions_.Fill(0, 1); } @@ -582,10 +585,6 @@ TextAutosizer::LayoutScope text_autosizer_layout_scope(this); RecalcSectionsIfNeeded(); - // FIXME: We should do this recalc lazily in borderStart/borderEnd so that we - // don't have to make sure to call this before we call borderStart/borderEnd - // to avoid getting a stale value. - RecalcBordersInRowDirection(); SubtreeLayoutScope layouter(*this); @@ -626,13 +625,6 @@ LayoutUnit table_box_logical_top = LogicalHeight(); bool collapsing = ShouldCollapseBorders(); - if (collapsing) { - // Need to set up the table borders before we can position the sections. - for (LayoutTableSection* section = top_section; section; - section = SectionBelow(section)) - section->RecalcOuterBorder(); - } - LayoutUnit border_and_padding_before = BorderBefore() + (collapsing ? LayoutUnit() : PaddingBefore()); LayoutUnit border_and_padding_after = @@ -782,6 +774,7 @@ collapsed_borders_.clear(); collapsed_borders_valid_ = false; needs_invalidate_collapsed_borders_for_all_cells_ = true; + collapsed_outer_borders_valid_ = false; SetMayNeedPaintInvalidation(); } @@ -833,29 +826,6 @@ } void LayoutTable::AddOverflowFromChildren() { - // Add overflow from borders. - // Technically it's odd that we are incorporating the borders into layout - // overflow, which is only supposed to be about overflow from our - // descendant objects, but since tables don't support overflow:auto, this - // works out fine. - if (ShouldCollapseBorders()) { - LayoutUnit right_border_overflow = - Size().Width() + OuterBorderRight() - BorderRight(); - LayoutUnit left_border_overflow = BorderLeft() - OuterBorderLeft(); - LayoutUnit bottom_border_overflow = - Size().Height() + OuterBorderBottom() - BorderBottom(); - LayoutUnit top_border_overflow = BorderTop() - OuterBorderTop(); - IntRect border_overflow_rect( - left_border_overflow.ToInt(), top_border_overflow.ToInt(), - (right_border_overflow - left_border_overflow).ToInt(), - (bottom_border_overflow - top_border_overflow).ToInt()); - if (border_overflow_rect != PixelSnappedBorderBoxRect()) { - LayoutRect border_layout_rect(border_overflow_rect); - AddLayoutOverflow(border_layout_rect); - AddContentsVisualOverflow(border_layout_rect); - } - } - // Add overflow from our caption. for (unsigned i = 0; i < captions_.size(); i++) AddOverflowFromChild(*captions_[i]); @@ -864,6 +834,12 @@ for (LayoutTableSection* section = TopSection(); section; section = SectionBelow(section)) AddOverflowFromChild(*section); + + // Technically it's odd that we are incorporating the borders into layout + // overflow, which is only supposed to be about overflow from our + // descendant objects, but since tables don't support overflow:auto, this + // works out fine. + AddLayoutOverflow(VisualOverflowRect()); } void LayoutTable::PaintObject(const PaintInfo& paint_info, @@ -916,11 +892,6 @@ void LayoutTable::ComputeIntrinsicLogicalWidths(LayoutUnit& min_width, LayoutUnit& max_width) const { RecalcSectionsIfNeeded(); - // FIXME: Do the recalc in borderStart/borderEnd and make those const_cast - // this call. - // Then m_borderStart/m_borderEnd will be transparent a cache and it removes - // the possibility of reading out stale values. - const_cast<LayoutTable*>(this)->RecalcBordersInRowDirection(); // FIXME: Restructure the table layout code so that we can make this method // const. const_cast<LayoutTable*>(this)->table_layout_->ComputeIntrinsicLogicalWidths( @@ -989,6 +960,13 @@ return section; } +LayoutTableSection* LayoutTable::BottomNonEmptySection() const { + LayoutTableSection* section = BottomSection(); + if (section && !section->NumRows()) + section = SectionAbove(section, kSkipEmptySections); + return section; +} + void LayoutTable::SplitEffectiveColumn(unsigned index, unsigned first_span) { // We split the column at |index|, taking |firstSpan| cells from the span. DCHECK_GT(effective_columns_[index].span, first_span); @@ -1180,270 +1158,40 @@ needs_section_recalc_ = false; } -int LayoutTable::CalcBorderStart() const { - if (!ShouldCollapseBorders()) - return LayoutBlock::BorderStart().ToInt(); - - // Determined by the first cell of the first row. See the CSS 2.1 spec, - // section 17.6.2. - if (!NumEffectiveColumns()) - return 0; - - int border_width = 0; - - EBorderStyle table_start_border_style = Style()->BorderStartStyle(); - if (table_start_border_style == EBorderStyle::kHidden) - return 0; - if (ComputedStyle::BorderStyleIsVisible(table_start_border_style)) - border_width = Style()->BorderStartWidth(); - - // TODO(dgrogan): This logic doesn't properly account for the first column in - // the first column-group case. - if (LayoutTableCol* column = - ColElementAtAbsoluteColumn(0).InnermostColOrColGroup()) { - // FIXME: We don't account for direction on columns and column groups. - EBorderStyle column_adjoining_border_style = - column->Style()->BorderStartStyle(); - if (column_adjoining_border_style == EBorderStyle::kHidden) - return 0; - if (ComputedStyle::BorderStyleIsVisible(column_adjoining_border_style)) { - border_width = - std::max<int>(border_width, column->Style()->BorderStartWidth()); - } - } - - if (const LayoutTableSection* top_non_empty_section = - this->TopNonEmptySection()) { - const BorderValue& section_adjoining_border = - top_non_empty_section->BorderAdjoiningTableStart(); - if (section_adjoining_border.Style() == EBorderStyle::kHidden) - return 0; - - if (ComputedStyle::BorderStyleIsVisible(section_adjoining_border.Style())) - border_width = - std::max<int>(border_width, section_adjoining_border.Width()); - - if (const LayoutTableCell* adjoining_start_cell = - top_non_empty_section->FirstRowCellAdjoiningTableStart()) { - // FIXME: Make this work with perpendicular and flipped cells. - const BorderValue& start_cell_adjoining_border = - adjoining_start_cell->BorderAdjoiningTableStart(); - if (start_cell_adjoining_border.Style() == EBorderStyle::kHidden) - return 0; - - const BorderValue& first_row_adjoining_border = - adjoining_start_cell->Row()->BorderAdjoiningTableStart(); - if (first_row_adjoining_border.Style() == EBorderStyle::kHidden) - return 0; - - if (ComputedStyle::BorderStyleIsVisible( - start_cell_adjoining_border.Style())) { - border_width = - std::max<int>(border_width, start_cell_adjoining_border.Width()); - } - if (ComputedStyle::BorderStyleIsVisible( - first_row_adjoining_border.Style())) { - border_width = - std::max<int>(border_width, first_row_adjoining_border.Width()); - } - } - } - return (border_width + (Style()->IsLeftToRightDirection() ? 0 : 1)) / 2; -} - -int LayoutTable::CalcBorderEnd() const { - if (!ShouldCollapseBorders()) - return LayoutBlock::BorderEnd().ToInt(); - - // Determined by the last cell of the first row. See the CSS 2.1 spec, section - // 17.6.2. - if (!NumEffectiveColumns()) - return 0; - - int border_width = 0; - - EBorderStyle table_end_border_style = Style()->BorderEndStyle(); - if (table_end_border_style == EBorderStyle::kHidden) - return 0; - if (ComputedStyle::BorderStyleIsVisible(table_end_border_style)) - border_width = Style()->BorderEndWidth(); - - unsigned end_column = NumEffectiveColumns() - 1; - - // TODO(dgrogan): This logic doesn't properly account for the last column in - // the last column-group case. - if (LayoutTableCol* column = - ColElementAtAbsoluteColumn(end_column).InnermostColOrColGroup()) { - // FIXME: We don't account for direction on columns and column groups. - EBorderStyle column_adjoining_border_style = - column->Style()->BorderEndStyle(); - if (column_adjoining_border_style == EBorderStyle::kHidden) - return 0; - if (ComputedStyle::BorderStyleIsVisible(column_adjoining_border_style)) { - border_width = - std::max<int>(border_width, column->Style()->BorderEndWidth()); - } - } - - if (const LayoutTableSection* top_non_empty_section = - this->TopNonEmptySection()) { - const BorderValue& section_adjoining_border = - top_non_empty_section->BorderAdjoiningTableEnd(); - if (section_adjoining_border.Style() == EBorderStyle::kHidden) - return 0; - - if (ComputedStyle::BorderStyleIsVisible(section_adjoining_border.Style())) - border_width = - std::max<int>(border_width, section_adjoining_border.Width()); - - if (const LayoutTableCell* adjoining_end_cell = - top_non_empty_section->FirstRowCellAdjoiningTableEnd()) { - // FIXME: Make this work with perpendicular and flipped cells. - const BorderValue& end_cell_adjoining_border = - adjoining_end_cell->BorderAdjoiningTableEnd(); - if (end_cell_adjoining_border.Style() == EBorderStyle::kHidden) - return 0; - - const BorderValue& first_row_adjoining_border = - adjoining_end_cell->Row()->BorderAdjoiningTableEnd(); - if (first_row_adjoining_border.Style() == EBorderStyle::kHidden) - return 0; - - if (ComputedStyle::BorderStyleIsVisible( - end_cell_adjoining_border.Style())) { - border_width = - std::max<int>(border_width, end_cell_adjoining_border.Width()); - } - if (ComputedStyle::BorderStyleIsVisible( - first_row_adjoining_border.Style())) { - border_width = - std::max<int>(border_width, first_row_adjoining_border.Width()); - } - } - } - return (border_width + (Style()->IsLeftToRightDirection() ? 1 : 0)) / 2; -} - -void LayoutTable::RecalcBordersInRowDirection() { - // FIXME: We need to compute the collapsed before / after borders in the same - // fashion. - border_start_ = CalcBorderStart(); - border_end_ = CalcBorderEnd(); -} - LayoutUnit LayoutTable::BorderBefore() const { if (ShouldCollapseBorders()) { - RecalcSectionsIfNeeded(); - return LayoutUnit(OuterBorderBefore()); + UpdateCollapsedOuterBorders(); + return LayoutUnit(collapsed_outer_border_before_); } + // TODO(karlo@opera.com): Should we round this in the same way as in + // BorderStart()? return LayoutBlock::BorderBefore(); } LayoutUnit LayoutTable::BorderAfter() const { if (ShouldCollapseBorders()) { - RecalcSectionsIfNeeded(); - return LayoutUnit(OuterBorderAfter()); + UpdateCollapsedOuterBorders(); + return LayoutUnit(collapsed_outer_border_after_); } + // TODO(karlo@opera.com): Should we round this in the same way as in + // BorderStart()? return LayoutBlock::BorderAfter(); } -int LayoutTable::OuterBorderBefore() const { - if (!ShouldCollapseBorders()) - return 0; - int border_width = 0; - if (LayoutTableSection* top_section = this->TopSection()) { - border_width = top_section->OuterBorderBefore(); - if (border_width < 0) - return 0; // Overridden by hidden +LayoutUnit LayoutTable::BorderStart() const { + if (ShouldCollapseBorders()) { + UpdateCollapsedOuterBorders(); + return LayoutUnit(collapsed_outer_border_start_); } - EBorderStyle tbs = Style()->BorderBeforeStyle(); - if (tbs == EBorderStyle::kHidden) - return 0; - if (ComputedStyle::BorderStyleIsVisible(tbs)) { - border_width = - std::max<int>(border_width, Style()->BorderBeforeWidth() / 2); - } - return border_width; + return LayoutUnit(LayoutBlock::BorderStart().ToInt()); } -int LayoutTable::OuterBorderAfter() const { - if (!ShouldCollapseBorders()) - return 0; - int border_width = 0; - - if (LayoutTableSection* section = BottomSection()) { - border_width = section->OuterBorderAfter(); - if (border_width < 0) - return 0; // Overridden by hidden +LayoutUnit LayoutTable::BorderEnd() const { + if (ShouldCollapseBorders()) { + UpdateCollapsedOuterBorders(); + return LayoutUnit(collapsed_outer_border_end_); } - EBorderStyle tbs = Style()->BorderAfterStyle(); - if (tbs == EBorderStyle::kHidden) - return 0; - if (ComputedStyle::BorderStyleIsVisible(tbs)) { - border_width = - std::max<int>(border_width, (Style()->BorderAfterWidth() + 1) / 2); - } - return border_width; -} - -int LayoutTable::OuterBorderStart() const { - if (!ShouldCollapseBorders()) - return 0; - - int border_width = 0; - - EBorderStyle tbs = Style()->BorderStartStyle(); - if (tbs == EBorderStyle::kHidden) - return 0; - if (ComputedStyle::BorderStyleIsVisible(tbs)) { - border_width = (Style()->BorderStartWidth() + - (Style()->IsLeftToRightDirection() ? 0 : 1)) / - 2; - } - - bool all_hidden = true; - for (LayoutTableSection* section = TopSection(); section; - section = SectionBelow(section)) { - int sw = section->OuterBorderStart(); - if (sw < 0) - continue; - all_hidden = false; - border_width = std::max(border_width, sw); - } - if (all_hidden) - return 0; - - return border_width; -} - -int LayoutTable::OuterBorderEnd() const { - if (!ShouldCollapseBorders()) - return 0; - - int border_width = 0; - - EBorderStyle tbs = Style()->BorderEndStyle(); - if (tbs == EBorderStyle::kHidden) - return 0; - if (ComputedStyle::BorderStyleIsVisible(tbs)) { - border_width = (Style()->BorderEndWidth() + - (Style()->IsLeftToRightDirection() ? 1 : 0)) / - 2; - } - - bool all_hidden = true; - for (LayoutTableSection* section = TopSection(); section; - section = SectionBelow(section)) { - int sw = section->OuterBorderEnd(); - if (sw < 0) - continue; - all_hidden = false; - border_width = std::max(border_width, sw); - } - if (all_hidden) - return 0; - - return border_width; + return LayoutUnit(LayoutBlock::BorderEnd().ToInt()); } LayoutTableSection* LayoutTable::SectionAbove( @@ -1784,4 +1532,90 @@ return LayoutBlock::PaddingRight(); } +unsigned LayoutTable::ComputeCollapsedOuterBorderBefore() const { + DCHECK(ShouldCollapseBorders()); + + // The table's before outer border width is the maximum before outer border + // widths of all cells in the first row. See the CSS 2.1 spec, section 17.6.2. + const auto* section = TopNonEmptySection(); + if (!section) + return 0; + + unsigned n_cols = section->NumCols(0); + unsigned result = 0; + for (unsigned col = 0; col < n_cols; ++col) { + if (const auto* cell = section->PrimaryCellAt(0, col)) + result = std::max(result, cell->CollapsedOuterBorderBefore()); + } + return result; +} + +unsigned LayoutTable::ComputeCollapsedOuterBorderAfter() const { + DCHECK(ShouldCollapseBorders()); + + const auto* section = BottomNonEmptySection(); + if (!section) + return 0; + + // The table's after outer border width is the maximum after outer border + // widths of all cells in the last row. See the CSS 2.1 spec, section 17.6.2. + unsigned row = section->NumRows() - 1; + unsigned n_cols = section->NumCols(row); + unsigned result = 0; + for (unsigned col = 0; col < n_cols; ++col) { + if (const auto* cell = section->PrimaryCellAt(row, col)) + result = std::max(result, cell->CollapsedOuterBorderAfter()); + } + return result; +} + +unsigned LayoutTable::ComputeCollapsedOuterBorderStart() const { + DCHECK(ShouldCollapseBorders()); + + // The table's start and end outer border widths are the border outer widths + // of the first and last cells in the first row. See the CSS 2.1 spec, + // section 17.6.2. + if (const auto* section = TopNonEmptySection()) { + if (const auto* row = section->FirstRow()) { + if (const auto* cell = HasSameDirectionAs(section) ? row->FirstCell() + : row->LastCell()) { + return HasSameDirectionAs(row) ? cell->CollapsedOuterBorderStart() + : cell->CollapsedOuterBorderEnd(); + } + } + } + return 0; +} + +unsigned LayoutTable::ComputeCollapsedOuterBorderEnd() const { + DCHECK(ShouldCollapseBorders()); + + // The table's start and end outer border widths are the border outer widths + // of the first and last cells in the first row. See the CSS 2.1 spec, + // section 17.6.2. + if (const auto* section = TopNonEmptySection()) { + if (const auto* row = section->FirstRow()) { + if (const auto* cell = HasSameDirectionAs(section) ? row->LastCell() + : row->FirstCell()) { + return HasSameDirectionAs(row) ? cell->CollapsedOuterBorderEnd() + : cell->CollapsedOuterBorderStart(); + } + } + } + return 0; +} + +void LayoutTable::UpdateCollapsedOuterBorders() const { + if (collapsed_outer_borders_valid_) + return; + + collapsed_outer_borders_valid_ = true; + if (ShouldCollapseBorders()) { + collapsed_outer_border_before_ = ComputeCollapsedOuterBorderBefore(); + collapsed_outer_border_after_ = ComputeCollapsedOuterBorderAfter(); + collapsed_outer_border_start_ = ComputeCollapsedOuterBorderStart(); + collapsed_outer_border_end_ = ComputeCollapsedOuterBorderEnd(); + } +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.h b/third_party/WebKit/Source/core/layout/LayoutTable.h index 335eea3..6e96324 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTable.h +++ b/third_party/WebKit/Source/core/layout/LayoutTable.h
@@ -149,8 +149,8 @@ return Style()->BorderCollapse() == EBorderCollapse::kCollapse; } - LayoutUnit BorderStart() const override { return LayoutUnit(border_start_); } - LayoutUnit BorderEnd() const override { return LayoutUnit(border_end_); } + LayoutUnit BorderStart() const override; + LayoutUnit BorderEnd() const override; LayoutUnit BorderBefore() const override; LayoutUnit BorderAfter() const override; @@ -182,47 +182,6 @@ return Style()->IsLeftToRightDirection() ? BorderEnd() : BorderStart(); } - int OuterBorderBefore() const; - int OuterBorderAfter() const; - int OuterBorderStart() const; - int OuterBorderEnd() const; - - int OuterBorderLeft() const { - if (Style()->IsHorizontalWritingMode()) - return Style()->IsLeftToRightDirection() ? OuterBorderStart() - : OuterBorderEnd(); - return Style()->IsFlippedBlocksWritingMode() ? OuterBorderAfter() - : OuterBorderBefore(); - } - - int OuterBorderRight() const { - if (Style()->IsHorizontalWritingMode()) - return Style()->IsLeftToRightDirection() ? OuterBorderEnd() - : OuterBorderStart(); - return Style()->IsFlippedBlocksWritingMode() ? OuterBorderBefore() - : OuterBorderAfter(); - } - - int OuterBorderTop() const { - if (Style()->IsHorizontalWritingMode()) - return Style()->IsFlippedBlocksWritingMode() ? OuterBorderAfter() - : OuterBorderBefore(); - return Style()->IsLeftToRightDirection() ? OuterBorderStart() - : OuterBorderEnd(); - } - - int OuterBorderBottom() const { - if (Style()->IsHorizontalWritingMode()) - return Style()->IsFlippedBlocksWritingMode() ? OuterBorderBefore() - : OuterBorderAfter(); - return Style()->IsLeftToRightDirection() ? OuterBorderEnd() - : OuterBorderStart(); - } - - int CalcBorderStart() const; - int CalcBorderEnd() const; - void RecalcBordersInRowDirection(); - void AddChild(LayoutObject* child, LayoutObject* before_child = nullptr) override; @@ -274,12 +233,13 @@ return row_offset_from_repeating_header_; } - // This function returns 0 if the table has no section. + // These functions return nullptr if the table has no sections. LayoutTableSection* TopSection() const; LayoutTableSection* BottomSection() const; - // This function returns 0 if the table has no non-empty sections. + // These functions return nullptr if the table has no non-empty sections. LayoutTableSection* TopNonEmptySection() const; + LayoutTableSection* BottomNonEmptySection() const; unsigned LastEffectiveColumnIndex() const { return NumEffectiveColumns() - 1; @@ -522,6 +482,13 @@ void AddOverflowFromChildren() override; void RecalcSections() const; + + void UpdateCollapsedOuterBorders() const; + unsigned ComputeCollapsedOuterBorderBefore() const; + unsigned ComputeCollapsedOuterBorderAfter() const; + unsigned ComputeCollapsedOuterBorderStart() const; + unsigned ComputeCollapsedOuterBorderEnd() const; + void LayoutCaption(LayoutTableCaption&, SubtreeLayoutScope&); void LayoutSection(LayoutTableSection&, SubtreeLayoutScope&, @@ -589,6 +556,7 @@ CollapsedBorderValues collapsed_borders_; bool collapsed_borders_valid_ : 1; bool needs_invalidate_collapsed_borders_for_all_cells_ : 1; + mutable bool collapsed_outer_borders_valid_ : 1; mutable bool has_col_elements_ : 1; mutable bool needs_section_recalc_ : 1; @@ -606,8 +574,11 @@ short h_spacing_; short v_spacing_; - int border_start_; - int border_end_; + + mutable unsigned collapsed_outer_border_start_; + mutable unsigned collapsed_outer_border_end_; + mutable unsigned collapsed_outer_border_before_; + mutable unsigned collapsed_outer_border_after_; LayoutUnit block_offset_to_first_repeatable_header_; LayoutUnit row_offset_from_repeating_header_;
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp b/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp index 700529f..f910084 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
@@ -433,10 +433,10 @@ // Our border rect already includes the inner halves of the collapsed borders, // so here we get the outer halves. bool rtl = !StyleForCellFlow().IsLeftToRightDirection(); - LayoutUnit left = CollapsedBorderHalfLeft(true); - LayoutUnit right = CollapsedBorderHalfRight(true); - LayoutUnit top = CollapsedBorderHalfTop(true); - LayoutUnit bottom = CollapsedBorderHalfBottom(true); + unsigned left = CollapsedBorderHalfLeft(true); + unsigned right = CollapsedBorderHalfRight(true); + unsigned top = CollapsedBorderHalfTop(true); + unsigned bottom = CollapsedBorderHalfBottom(true); // This cell's borders may be lengthened to match the widths of orthogonal // borders of adjacent cells. Expand visual overflow to cover the lengthened @@ -467,7 +467,8 @@ } LayoutRect rect = BorderBoxRect(); - rect.ExpandEdges(top, right, bottom, left); + rect.ExpandEdges(LayoutUnit(top), LayoutUnit(right), LayoutUnit(bottom), + LayoutUnit(left)); collapsed_border_values_->SetLocalVisualRect(rect); } @@ -1136,49 +1137,57 @@ } LayoutUnit LayoutTableCell::BorderLeft() const { - return Table()->ShouldCollapseBorders() ? CollapsedBorderHalfLeft(false) - : LayoutBlockFlow::BorderLeft(); + return Table()->ShouldCollapseBorders() + ? LayoutUnit(CollapsedBorderHalfLeft(false)) + : LayoutBlockFlow::BorderLeft(); } LayoutUnit LayoutTableCell::BorderRight() const { - return Table()->ShouldCollapseBorders() ? CollapsedBorderHalfRight(false) - : LayoutBlockFlow::BorderRight(); + return Table()->ShouldCollapseBorders() + ? LayoutUnit(CollapsedBorderHalfRight(false)) + : LayoutBlockFlow::BorderRight(); } LayoutUnit LayoutTableCell::BorderTop() const { - return Table()->ShouldCollapseBorders() ? CollapsedBorderHalfTop(false) - : LayoutBlockFlow::BorderTop(); + return Table()->ShouldCollapseBorders() + ? LayoutUnit(CollapsedBorderHalfTop(false)) + : LayoutBlockFlow::BorderTop(); } LayoutUnit LayoutTableCell::BorderBottom() const { - return Table()->ShouldCollapseBorders() ? CollapsedBorderHalfBottom(false) - : LayoutBlockFlow::BorderBottom(); + return Table()->ShouldCollapseBorders() + ? LayoutUnit(CollapsedBorderHalfBottom(false)) + : LayoutBlockFlow::BorderBottom(); } // FIXME: https://bugs.webkit.org/show_bug.cgi?id=46191, make the collapsed // border drawing work with different block flow values instead of being // hard-coded to top-to-bottom. LayoutUnit LayoutTableCell::BorderStart() const { - return Table()->ShouldCollapseBorders() ? CollapsedBorderHalfStart(false) - : LayoutBlockFlow::BorderStart(); + return Table()->ShouldCollapseBorders() + ? LayoutUnit(CollapsedBorderHalfStart(false)) + : LayoutBlockFlow::BorderStart(); } LayoutUnit LayoutTableCell::BorderEnd() const { - return Table()->ShouldCollapseBorders() ? CollapsedBorderHalfEnd(false) - : LayoutBlockFlow::BorderEnd(); + return Table()->ShouldCollapseBorders() + ? LayoutUnit(CollapsedBorderHalfEnd(false)) + : LayoutBlockFlow::BorderEnd(); } LayoutUnit LayoutTableCell::BorderBefore() const { - return Table()->ShouldCollapseBorders() ? CollapsedBorderHalfBefore(false) - : LayoutBlockFlow::BorderBefore(); + return Table()->ShouldCollapseBorders() + ? LayoutUnit(CollapsedBorderHalfBefore(false)) + : LayoutBlockFlow::BorderBefore(); } LayoutUnit LayoutTableCell::BorderAfter() const { - return Table()->ShouldCollapseBorders() ? CollapsedBorderHalfAfter(false) - : LayoutBlockFlow::BorderAfter(); + return Table()->ShouldCollapseBorders() + ? LayoutUnit(CollapsedBorderHalfAfter(false)) + : LayoutBlockFlow::BorderAfter(); } -LayoutUnit LayoutTableCell::CollapsedBorderHalfLeft(bool outer) const { +unsigned LayoutTableCell::CollapsedBorderHalfLeft(bool outer) const { const ComputedStyle& style_for_cell_flow = this->StyleForCellFlow(); if (style_for_cell_flow.IsHorizontalWritingMode()) { return style_for_cell_flow.IsLeftToRightDirection() @@ -1190,7 +1199,7 @@ : CollapsedBorderHalfBefore(outer); } -LayoutUnit LayoutTableCell::CollapsedBorderHalfRight(bool outer) const { +unsigned LayoutTableCell::CollapsedBorderHalfRight(bool outer) const { const ComputedStyle& style_for_cell_flow = this->StyleForCellFlow(); if (style_for_cell_flow.IsHorizontalWritingMode()) { return style_for_cell_flow.IsLeftToRightDirection() @@ -1202,7 +1211,7 @@ : CollapsedBorderHalfAfter(outer); } -LayoutUnit LayoutTableCell::CollapsedBorderHalfTop(bool outer) const { +unsigned LayoutTableCell::CollapsedBorderHalfTop(bool outer) const { const ComputedStyle& style_for_cell_flow = this->StyleForCellFlow(); if (style_for_cell_flow.IsHorizontalWritingMode()) { return style_for_cell_flow.IsFlippedBlocksWritingMode() @@ -1214,7 +1223,7 @@ : CollapsedBorderHalfEnd(outer); } -LayoutUnit LayoutTableCell::CollapsedBorderHalfBottom(bool outer) const { +unsigned LayoutTableCell::CollapsedBorderHalfBottom(bool outer) const { const ComputedStyle& style_for_cell_flow = this->StyleForCellFlow(); if (style_for_cell_flow.IsHorizontalWritingMode()) { return style_for_cell_flow.IsFlippedBlocksWritingMode() @@ -1226,68 +1235,66 @@ : CollapsedBorderHalfStart(outer); } -LayoutUnit LayoutTableCell::CollapsedBorderHalfStart(bool outer) const { +unsigned LayoutTableCell::CollapsedBorderHalfStart(bool outer) const { UpdateCollapsedBorderValues(); const auto* collapsed_border_values = this->GetCollapsedBorderValues(); if (!collapsed_border_values) - return LayoutUnit(); + return 0; const auto& border = collapsed_border_values->StartBorder(); if (border.Exists()) { - return LayoutUnit( - (border.Width() + - ((StyleForCellFlow().IsLeftToRightDirection() ^ outer) ? 1 : 0)) / - 2); // Give the extra pixel to top and left. + return (border.Width() + + ((StyleForCellFlow().IsLeftToRightDirection() ^ outer) ? 1 : 0)) / + 2; // Give the extra pixel to top and left. } - return LayoutUnit(); + return 0; } -LayoutUnit LayoutTableCell::CollapsedBorderHalfEnd(bool outer) const { +unsigned LayoutTableCell::CollapsedBorderHalfEnd(bool outer) const { UpdateCollapsedBorderValues(); const auto* collapsed_border_values = this->GetCollapsedBorderValues(); if (!collapsed_border_values) - return LayoutUnit(); + return 0; const auto& border = collapsed_border_values->EndBorder(); if (border.Exists()) { - return LayoutUnit( - (border.Width() + - ((StyleForCellFlow().IsLeftToRightDirection() ^ outer) ? 0 : 1)) / - 2); + return (border.Width() + + ((StyleForCellFlow().IsLeftToRightDirection() ^ outer) ? 0 : 1)) / + 2; } - return LayoutUnit(); + return 0; } -LayoutUnit LayoutTableCell::CollapsedBorderHalfBefore(bool outer) const { +unsigned LayoutTableCell::CollapsedBorderHalfBefore(bool outer) const { UpdateCollapsedBorderValues(); const auto* collapsed_border_values = this->GetCollapsedBorderValues(); if (!collapsed_border_values) - return LayoutUnit(); + return 0; const auto& border = collapsed_border_values->BeforeBorder(); if (border.Exists()) { - return LayoutUnit( - (border.Width() + - ((StyleForCellFlow().IsFlippedBlocksWritingMode() ^ outer) ? 0 : 1)) / - 2); // Give the extra pixel to top and left. + return (border.Width() + + ((StyleForCellFlow().IsFlippedBlocksWritingMode() ^ outer) ? 0 + : 1)) / + 2; // Give the extra pixel to top and left. } - return LayoutUnit(); + return 0; } -LayoutUnit LayoutTableCell::CollapsedBorderHalfAfter(bool outer) const { +unsigned LayoutTableCell::CollapsedBorderHalfAfter(bool outer) const { UpdateCollapsedBorderValues(); const auto* collapsed_border_values = this->GetCollapsedBorderValues(); if (!collapsed_border_values) - return LayoutUnit(); + return 0; const auto& border = collapsed_border_values->AfterBorder(); if (border.Exists()) { - return LayoutUnit( - (border.Width() + - ((StyleForCellFlow().IsFlippedBlocksWritingMode() ^ outer) ? 1 : 0)) / - 2); + return (border.Width() + + ((StyleForCellFlow().IsFlippedBlocksWritingMode() ^ outer) ? 1 + : 0)) / + 2; } - return LayoutUnit(); + return 0; } void LayoutTableCell::Paint(const PaintInfo& paint_info,
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableCell.h b/third_party/WebKit/Source/core/layout/LayoutTableCell.h index c513017..b9bc03b 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableCell.h +++ b/third_party/WebKit/Source/core/layout/LayoutTableCell.h
@@ -355,6 +355,20 @@ return cell1->RowIndex() < cell2->RowIndex(); } + // For LayoutTable to compute its collapsed outer borders. + unsigned CollapsedOuterBorderBefore() const { + return CollapsedBorderHalfBefore(true); + } + unsigned CollapsedOuterBorderAfter() const { + return CollapsedBorderHalfAfter(true); + } + unsigned CollapsedOuterBorderStart() const { + return CollapsedBorderHalfStart(true); + } + unsigned CollapsedOuterBorderEnd() const { + return CollapsedBorderHalfEnd(true); + } + protected: void StyleDidChange(StyleDifference, const ComputedStyle* old_style) override; void ComputePreferredLogicalWidths() override; @@ -388,15 +402,15 @@ bool recompute_floats = false) override; LayoutRect LocalVisualRect() const override; - LayoutUnit CollapsedBorderHalfLeft(bool outer) const; - LayoutUnit CollapsedBorderHalfRight(bool outer) const; - LayoutUnit CollapsedBorderHalfTop(bool outer) const; - LayoutUnit CollapsedBorderHalfBottom(bool outer) const; + unsigned CollapsedBorderHalfLeft(bool outer) const; + unsigned CollapsedBorderHalfRight(bool outer) const; + unsigned CollapsedBorderHalfTop(bool outer) const; + unsigned CollapsedBorderHalfBottom(bool outer) const; - LayoutUnit CollapsedBorderHalfStart(bool outer) const; - LayoutUnit CollapsedBorderHalfEnd(bool outer) const; - LayoutUnit CollapsedBorderHalfBefore(bool outer) const; - LayoutUnit CollapsedBorderHalfAfter(bool outer) const; + unsigned CollapsedBorderHalfStart(bool outer) const; + unsigned CollapsedBorderHalfEnd(bool outer) const; + unsigned CollapsedBorderHalfBefore(bool outer) const; + unsigned CollapsedBorderHalfAfter(bool outer) const; void SetIntrinsicPaddingBefore(int p) { intrinsic_padding_before_ = p; } void SetIntrinsicPaddingAfter(int p) { intrinsic_padding_after_ = p; }
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp index 5191677..92766866 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -90,10 +90,6 @@ : LayoutTableBoxComponent(element), c_col_(0), c_row_(0), - outer_border_start_(0), - outer_border_end_(0), - outer_border_before_(0), - outer_border_after_(0), needs_cell_recalc_(false), force_full_paint_(false), has_multiple_cell_levels_(false), @@ -1354,174 +1350,6 @@ } } -int LayoutTableSection::CalcBlockDirectionOuterBorder( - BlockBorderSide side) const { - if (!grid_.size() || !Table()->NumEffectiveColumns()) - return 0; - - int border_width = 0; - - EBorderStyle section_border_style = side == kBorderBefore - ? Style()->BorderBeforeStyle() - : Style()->BorderAfterStyle(); - if (section_border_style == EBorderStyle::kHidden) - return -1; - if (ComputedStyle::BorderStyleIsVisible(section_border_style)) { - border_width = side == kBorderBefore ? Style()->BorderBeforeWidth() - : Style()->BorderAfterWidth(); - } - - EBorderStyle row_border_style = side == kBorderBefore - ? FirstRow()->Style()->BorderBeforeStyle() - : LastRow()->Style()->BorderAfterStyle(); - float row_border_width = side == kBorderBefore - ? FirstRow()->Style()->BorderBeforeWidth() - : LastRow()->Style()->BorderAfterWidth(); - if (row_border_style == EBorderStyle::kHidden) - return -1; - if (ComputedStyle::BorderStyleIsVisible(row_border_style) && - row_border_width > border_width) - border_width = row_border_width; - bool all_hidden = true; - unsigned r = side == kBorderBefore ? 0 : grid_.size() - 1; - unsigned n_cols = NumCols(r); - for (unsigned c = 0; c < n_cols; c++) { - const auto& grid_cell = GridCellAt(r, c); - if (grid_cell.InColSpan() || !grid_cell.HasCells()) - continue; - const ComputedStyle& primary_cell_style = - grid_cell.PrimaryCell()->StyleRef(); - // FIXME: Make this work with perpendicular and flipped cells. - EBorderStyle cell_border_style = - side == kBorderBefore ? primary_cell_style.BorderBeforeStyle() - : primary_cell_style.BorderAfterStyle(); - float cell_border_width = side == kBorderBefore - ? primary_cell_style.BorderBeforeWidth() - : primary_cell_style.BorderAfterWidth(); - // FIXME: Don't repeat for the same col group - LayoutTableCol* col = - Table()->ColElementAtAbsoluteColumn(c).InnermostColOrColGroup(); - if (col) { - EBorderStyle col_border_style = side == kBorderBefore - ? col->Style()->BorderBeforeStyle() - : col->Style()->BorderAfterStyle(); - const float col_border_width = side == kBorderBefore - ? col->Style()->BorderBeforeWidth() - : col->Style()->BorderAfterWidth(); - if (col_border_style == EBorderStyle::kHidden || - cell_border_style == EBorderStyle::kHidden) - continue; - all_hidden = false; - if (ComputedStyle::BorderStyleIsVisible(col_border_style) && - col_border_width > border_width) - border_width = col_border_width; - if (ComputedStyle::BorderStyleIsVisible(cell_border_style) && - cell_border_width > border_width) - border_width = cell_border_width; - } else { - if (cell_border_style == EBorderStyle::kHidden) - continue; - all_hidden = false; - if (ComputedStyle::BorderStyleIsVisible(cell_border_style) && - cell_border_width > border_width) - border_width = cell_border_width; - } - } - if (all_hidden) - return -1; - - if (side == kBorderAfter) - border_width++; // Distribute rounding error - return border_width / 2; -} - -int LayoutTableSection::CalcInlineDirectionOuterBorder( - InlineBorderSide side) const { - unsigned total_cols = Table()->NumEffectiveColumns(); - if (!grid_.size() || !total_cols) - return 0; - unsigned col_index = side == kBorderStart ? 0 : total_cols - 1; - - int border_width = 0; - - EBorderStyle section_border_style = side == kBorderStart - ? Style()->BorderStartStyle() - : Style()->BorderEndStyle(); - const float section_border_width = side == kBorderStart - ? Style()->BorderStartWidth() - : Style()->BorderEndWidth(); - if (section_border_style == EBorderStyle::kHidden) - return -1; - if (ComputedStyle::BorderStyleIsVisible(section_border_style)) - border_width = section_border_width; - - if (LayoutTableCol* col = Table() - ->ColElementAtAbsoluteColumn(col_index) - .InnermostColOrColGroup()) { - EBorderStyle col_border_style = side == kBorderStart - ? col->Style()->BorderStartStyle() - : col->Style()->BorderEndStyle(); - const float col_border_width = side == kBorderStart - ? col->Style()->BorderStartWidth() - : col->Style()->BorderEndWidth(); - if (col_border_style == EBorderStyle::kHidden) - return -1; - if (ComputedStyle::BorderStyleIsVisible(col_border_style) && - col_border_width > border_width) - border_width = col_border_width; - } - - bool all_hidden = true; - for (unsigned r = 0; r < grid_.size(); r++) { - if (col_index >= NumCols(r)) - continue; - const auto& grid_cell = GridCellAt(r, col_index); - if (!grid_cell.HasCells()) - continue; - // FIXME: Don't repeat for the same cell - const ComputedStyle& primary_cell_style = - grid_cell.PrimaryCell()->StyleRef(); - const ComputedStyle& primary_cell_parent_style = - grid_cell.PrimaryCell()->Parent()->StyleRef(); - // FIXME: Make this work with perpendicular and flipped cells. - EBorderStyle cell_border_style = side == kBorderStart - ? primary_cell_style.BorderStartStyle() - : primary_cell_style.BorderEndStyle(); - EBorderStyle row_border_style = - side == kBorderStart ? primary_cell_parent_style.BorderStartStyle() - : primary_cell_parent_style.BorderEndStyle(); - const float cell_border_width = side == kBorderStart - ? primary_cell_style.BorderStartWidth() - : primary_cell_style.BorderEndWidth(); - const float row_border_width = - side == kBorderStart ? primary_cell_parent_style.BorderStartWidth() - : primary_cell_parent_style.BorderEndWidth(); - if (cell_border_style == EBorderStyle::kHidden || - row_border_style == EBorderStyle::kHidden) - continue; - all_hidden = false; - if (ComputedStyle::BorderStyleIsVisible(cell_border_style) && - cell_border_width > border_width) - border_width = cell_border_width; - if (ComputedStyle::BorderStyleIsVisible(row_border_style) && - row_border_width > border_width) - border_width = row_border_width; - } - if (all_hidden) - return -1; - - if ((side == kBorderStart) != Table()->Style()->IsLeftToRightDirection()) - border_width++; // Distribute rounding error - return border_width / 2; -} - -void LayoutTableSection::RecalcOuterBorder() { - outer_border_before_ = CalcBlockDirectionOuterBorder(kBorderBefore); - outer_border_after_ = CalcBlockDirectionOuterBorder(kBorderAfter); - outer_border_start_ = CalcInlineDirectionOuterBorder(kBorderStart); - outer_border_end_ = CalcInlineDirectionOuterBorder(kBorderEnd); -} - int LayoutTableSection::FirstLineBoxBaseline() const { if (!grid_.size()) return -1;
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.h b/third_party/WebKit/Source/core/layout/LayoutTableSection.h index 4ba5d923..c384e52 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableSection.h +++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.h
@@ -204,17 +204,6 @@ void AppendEffectiveColumn(unsigned pos); void SplitEffectiveColumn(unsigned pos, unsigned first); - enum BlockBorderSide { kBorderBefore, kBorderAfter }; - int CalcBlockDirectionOuterBorder(BlockBorderSide) const; - enum InlineBorderSide { kBorderStart, kBorderEnd }; - int CalcInlineDirectionOuterBorder(InlineBorderSide) const; - void RecalcOuterBorder(); - - int OuterBorderBefore() const { return outer_border_before_; } - int OuterBorderAfter() const { return outer_border_after_; } - int OuterBorderStart() const { return outer_border_start_; } - int OuterBorderEnd() const { return outer_border_end_; } - unsigned NumRows() const { DCHECK(!NeedsCellRecalc()); return grid_.size(); @@ -439,11 +428,6 @@ unsigned c_col_; unsigned c_row_; - int outer_border_start_; - int outer_border_end_; - int outer_border_before_; - int outer_border_after_; - bool needs_cell_recalc_; // This HashSet holds the overflowing cells for the partial paint path. If we
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp b/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp new file mode 100644 index 0000000..d14789e --- /dev/null +++ b/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp
@@ -0,0 +1,167 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/layout/LayoutTable.h" + +#include "core/layout/LayoutTestHelper.h" + +namespace blink { + +namespace { + +class LayoutTableTest : public RenderingTest { + protected: + LayoutTable* GetTableByElementId(const char* id) { + return ToLayoutTable(GetLayoutObjectByElementId(id)); + } +}; + +TEST_F(LayoutTableTest, OverflowWithCollapsedBorders) { + SetBodyInnerHTML( + "<style>" + " table { border-collapse: collapse }" + " td { border: 0px solid blue; padding: 0 }" + " div { width: 100px; height: 100px }" + "</style>" + "<table id='table'>" + " <tr>" + " <td style='border-bottom-width: 10px;" + " outline: 3px solid blue'><div></div></td>" + " <td style='border-width: 3px 15px'><div></div></td>" + " </tr>" + " <tr style='outline: 8px solid green'><td><div></div></td></tr>" + "</table>"); + + auto* table = GetTableByElementId("table"); + + // The table's self visual overflow covers the collapsed borders. + EXPECT_EQ(LayoutRect(0, 0, 230, 211), table->BorderBoxRect()); + EXPECT_EQ(LayoutRect(0, 0, 230, 211), table->SelfVisualOverflowRect()); + + // The table's visual overflow covers self visual overflow and content visual + // overflows. + LayoutRect expected_visual_overflow = table->ContentBoxRect(); + expected_visual_overflow.ExpandEdges(LayoutUnit(3), LayoutUnit(8), + LayoutUnit(8), LayoutUnit(8)); + EXPECT_EQ(expected_visual_overflow, table->VisualOverflowRect()); + + // Tables layout overflow equals visual overflow. + EXPECT_EQ(expected_visual_overflow, table->LayoutOverflowRect()); +} + +TEST_F(LayoutTableTest, CollapsedBorders) { + SetBodyInnerHTML( + "<style>table { border-collapse: collapse }</style>" + "<table id='table1'" + " style='border-top: hidden; border-bottom: 8px solid;" + " border-left: hidden; border-right: 10px solid'>" + " <tr><td>A</td><td>B</td></tr>" + "</table>" + "<table id='table2' style='border: 10px solid'>" + " <tr>" + " <td style='border: hidden'>C</td>" + " <td style='border: hidden'>D</td>" + " </tr>" + "</table>" + "<table id='table3' style='border: 10px solid'>" + " <tr>" + " <td style='border-top: 15px solid;" + " border-left: 21px solid'>E</td>" + " <td style='border-right: 25px solid'>F</td>" + " </tr>" + // The second row won't affect start and end borders of the table. + " <tr>" + " <td style='border: 30px solid'>G</td>" + " <td style='border: 40px solid'>H</td>" + " </tr>" + "</table>"); + + auto* table1 = GetTableByElementId("table1"); + EXPECT_EQ(0, table1->BorderBefore()); + EXPECT_EQ(4, table1->BorderAfter()); + EXPECT_EQ(0, table1->BorderStart()); + EXPECT_EQ(5, table1->BorderEnd()); + + // All cells have hidden border. + auto* table2 = GetTableByElementId("table2"); + EXPECT_EQ(0, table2->BorderBefore()); + EXPECT_EQ(0, table2->BorderAfter()); + EXPECT_EQ(0, table2->BorderStart()); + EXPECT_EQ(0, table2->BorderEnd()); + + // Cells have wider borders. + auto* table3 = GetTableByElementId("table3"); + // Cell E's border-top won. + EXPECT_EQ(7, table3->BorderBefore()); + // Cell H's border-bottom won. + EXPECT_EQ(20, table3->BorderAfter()); + // Cell E's border-left won. + EXPECT_EQ(10, table3->BorderStart()); + // Cell F's border-bottom won. + EXPECT_EQ(13, table3->BorderEnd()); +} + +TEST_F(LayoutTableTest, CollapsedBordersWithCol) { + SetBodyInnerHTML( + "<style>table { border-collapse: collapse }</style>" + "<table id='table1' style='border: hidden'>" + " <colgroup>" + " <col span='2000' style='border: 10px solid'>" + " <col span='2000' style='border: 20px solid'>" + " </colgroup>" + " <tr>" + " <td colspan='2000'>A</td>" + " <td colspan='2000'>B</td>" + " </tr>" + "</table>" + "<table id='table2' style='border: 10px solid'>" + " <colgroup>" + " <col span='2000' style='border: 10px solid'>" + " <col span='2000' style='border: 20px solid'>" + " </colgroup>" + " <tr>" + " <td colspan='2000' style='border: hidden'>C</td>" + " <td colspan='2000' style='border: hidden'>D</td>" + " </tr>" + "</table>" + "<table id='table3'>" + " <colgroup>" + " <col span='2000' style='border: 10px solid'>" + " <col span='2000' style='border: 20px solid'>" + " </colgroup>" + " <tr>" + " <td colspan='2000' style='border: 12px solid'>E</td>" + " <td colspan='2000' style='border: 16px solid'>F</td>" + " </tr>" + "</table>"); + + // Table has hidden border. + auto* table1 = GetTableByElementId("table1"); + EXPECT_EQ(0, table1->BorderBefore()); + EXPECT_EQ(0, table1->BorderAfter()); + EXPECT_EQ(0, table1->BorderStart()); + EXPECT_EQ(0, table1->BorderEnd()); + + // All cells have hidden border. + auto* table2 = GetTableByElementId("table2"); + EXPECT_EQ(0, table2->BorderBefore()); + EXPECT_EQ(0, table2->BorderAfter()); + EXPECT_EQ(0, table2->BorderStart()); + EXPECT_EQ(0, table2->BorderEnd()); + + // Combined cell and col borders. + auto* table3 = GetTableByElementId("table3"); + // The second col's border-top won. + EXPECT_EQ(10, table3->BorderBefore()); + // The second col's border-bottom won. + EXPECT_EQ(10, table3->BorderAfter()); + // Cell E's border-left won. + EXPECT_EQ(6, table3->BorderStart()); + // The second col's border-right won. + EXPECT_EQ(10, table3->BorderEnd()); +} + +} // anonymous namespace + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/LayoutTheme.cpp b/third_party/WebKit/Source/core/layout/LayoutTheme.cpp index 0279ba31..cfe7fc13 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTheme.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTheme.cpp
@@ -255,10 +255,7 @@ } String LayoutTheme::ExtraDefaultStyleSheet() { - StringBuilder runtime_css; - if (RuntimeEnabledFeatures::contextMenuEnabled()) - runtime_css.Append("menu[type=\"context\" i] { display: none; }"); - return runtime_css.ToString(); + return g_empty_string; } static String FormatChromiumMediaControlsTime(float time,
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp index a1ce777..343ffb4 100644 --- a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp +++ b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
@@ -32,7 +32,7 @@ void ScrollAnchor::SetScroller(ScrollableArea* scroller) { DCHECK_NE(scroller_, scroller); DCHECK(scroller); - DCHECK(scroller->IsRootFrameViewport() || scroller->IsFrameView() || + DCHECK(scroller->IsRootFrameViewport() || scroller->IsLocalFrameView() || scroller->IsPaintLayerScrollableArea()); scroller_ = scroller; ClearSelf();
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp index 3019f26..42864d8 100644 --- a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp +++ b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
@@ -50,7 +50,8 @@ } ScrollAnchor& GetScrollAnchor(ScrollableArea* scroller) { - DCHECK(scroller->IsFrameView() || scroller->IsPaintLayerScrollableArea()); + DCHECK(scroller->IsLocalFrameView() || + scroller->IsPaintLayerScrollableArea()); return *(scroller->GetScrollAnchor()); }
diff --git a/third_party/WebKit/Source/core/layout/api/SelectionState.cpp b/third_party/WebKit/Source/core/layout/api/SelectionState.cpp index c492d72..1413647 100644 --- a/third_party/WebKit/Source/core/layout/api/SelectionState.cpp +++ b/third_party/WebKit/Source/core/layout/api/SelectionState.cpp
@@ -19,7 +19,7 @@ case SelectionState::kEnd: return out << "End"; case SelectionState::kStartAndEnd: - return out << "Both"; + return out << "StartAndEnd"; } NOTREACHED(); return out;
diff --git a/third_party/WebKit/Source/core/layout/api/SelectionStateTest.cpp b/third_party/WebKit/Source/core/layout/api/SelectionStateTest.cpp index 5ba05fe4..8f0c465 100644 --- a/third_party/WebKit/Source/core/layout/api/SelectionStateTest.cpp +++ b/third_party/WebKit/Source/core/layout/api/SelectionStateTest.cpp
@@ -19,7 +19,7 @@ { std::stringstream string_stream; string_stream << SelectionState::kStartAndEnd; - EXPECT_EQ("Both", string_stream.str()); + EXPECT_EQ("StartAndEnd", string_stream.str()); } }
diff --git a/third_party/WebKit/Source/core/page/BUILD.gn b/third_party/WebKit/Source/core/page/BUILD.gn index 791b81393..7286a84 100644 --- a/third_party/WebKit/Source/core/page/BUILD.gn +++ b/third_party/WebKit/Source/core/page/BUILD.gn
@@ -16,8 +16,6 @@ "ContextMenuProvider.h", "CreateWindow.cpp", "CreateWindow.h", - "CustomContextMenuProvider.cpp", - "CustomContextMenuProvider.h", "DragActions.h", "DragController.cpp", "DragController.h",
diff --git a/third_party/WebKit/Source/core/page/ContextMenuController.cpp b/third_party/WebKit/Source/core/page/ContextMenuController.cpp index 4372fbb..a5f627ef 100644 --- a/third_party/WebKit/Source/core/page/ContextMenuController.cpp +++ b/third_party/WebKit/Source/core/page/ContextMenuController.cpp
@@ -31,21 +31,16 @@ #include "core/dom/Node.h" #include "core/events/Event.h" #include "core/events/MouseEvent.h" -#include "core/events/RelatedEvent.h" #include "core/frame/LocalFrame.h" -#include "core/html/HTMLMenuElement.h" #include "core/input/EventHandler.h" #include "core/page/ContextMenuClient.h" #include "core/page/ContextMenuProvider.h" -#include "core/page/CustomContextMenuProvider.h" #include "platform/ContextMenu.h" #include "platform/ContextMenuItem.h" #include "platform/wtf/PtrUtil.h" namespace blink { -using namespace HTMLNames; - ContextMenuController::ContextMenuController(Page*, ContextMenuClient* client) : client_(client) { DCHECK(client); @@ -81,35 +76,10 @@ } } -void ContextMenuController::PopulateCustomContextMenu(const Event& event) { - if (!RuntimeEnabledFeatures::contextMenuEnabled()) - return; - - Node* node = event.target()->ToNode(); - if (!node || !node->IsHTMLElement()) - return; - - HTMLElement& element = ToHTMLElement(*node); - HTMLMenuElement* menu_element = element.AssignedContextMenu(); - if (!menu_element || !DeprecatedEqualIgnoringCase( - menu_element->FastGetAttribute(typeAttr), "context")) - return; - RelatedEvent* related_event = - RelatedEvent::Create(EventTypeNames::show, true, true, node); - if (menu_element->DispatchEvent(related_event) != - DispatchEventResult::kNotCanceled) - return; - if (menu_element != element.AssignedContextMenu()) - return; - menu_provider_ = CustomContextMenuProvider::Create(*menu_element, element); - menu_provider_->PopulateContextMenu(context_menu_.get()); -} - void ContextMenuController::HandleContextMenuEvent(Event* event) { context_menu_ = CreateContextMenu(event); if (!context_menu_) return; - PopulateCustomContextMenu(*event); ShowContextMenu(event); }
diff --git a/third_party/WebKit/Source/core/page/ContextMenuController.h b/third_party/WebKit/Source/core/page/ContextMenuController.h index 3697627c..0a21d3ce 100644 --- a/third_party/WebKit/Source/core/page/ContextMenuController.h +++ b/third_party/WebKit/Source/core/page/ContextMenuController.h
@@ -75,7 +75,6 @@ std::unique_ptr<ContextMenu> CreateContextMenu(Event*); std::unique_ptr<ContextMenu> CreateContextMenu(LocalFrame*, const LayoutPoint&); - void PopulateCustomContextMenu(const Event&); void ShowContextMenu(Event*); ContextMenuClient* client_;
diff --git a/third_party/WebKit/Source/core/page/ContextMenuControllerTest.cpp b/third_party/WebKit/Source/core/page/ContextMenuControllerTest.cpp deleted file mode 100644 index 823f58fa..0000000 --- a/third_party/WebKit/Source/core/page/ContextMenuControllerTest.cpp +++ /dev/null
@@ -1,148 +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 "core/page/ContextMenuController.h" - -#include <memory> -#include "core/clipboard/DataTransfer.h" -#include "core/events/MouseEvent.h" -#include "core/frame/LocalFrameView.h" -#include "core/frame/Settings.h" -#include "core/html/HTMLElement.h" -#include "core/testing/DummyPageHolder.h" -#include "platform/ContextMenu.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace blink { - -class ContextMenuControllerTest : public testing::Test { - protected: - virtual void SetUp() { - page_holder_ = DummyPageHolder::Create(IntSize(800, 600)); - } - - Document& GetDocument() const { return page_holder_->GetDocument(); } - - void SetBodyInnerHTML(const String& html_content) { - GetDocument().body()->setInnerHTML(html_content); - GetDocument().View()->UpdateAllLifecyclePhases(); - } - - private: - std::unique_ptr<DummyPageHolder> page_holder_; -}; - -TEST_F(ContextMenuControllerTest, TestCustomMenu) { - GetDocument().GetSettings()->SetScriptEnabled(true); - // Load the the test page. - SetBodyInnerHTML( - "<button id=\"button_id\" contextmenu=\"menu_id\" style=\"height: 100px; " - "width: 100px;\">" - "<menu type=\"context\" id=\"menu_id\">" - "<menuitem label=\"Item1\" onclick='document.title = \"Title 1\";'>" - "</menuitem>" - "<menuitem label=\"Item2\" onclick='document.title = \"Title 2\";'>" - "</menuitem>" - "<menuitem label=\"Item3\" onclick='document.title = \"Title 3\";'>" - "</menuitem>" - "<menu label='Submenu'>" - "<menuitem label=\"Item4\" onclick='document.title = \"Title 4\";'>" - "</menuitem>" - "<menuitem label=\"Item5\" onclick='document.title = \"Title 5\";'>" - "</menuitem>" - "<menuitem label=\"Item6\" onclick='document.title = \"Title 6\";'>" - "</menuitem>" - "</menu>" - "<menuitem id=\"item7\" type=\"checkbox\" checked label=\"Item7\"" - "onclick='if " - "(document.getElementById(\"item7\").hasAttribute(\"checked\"))" - "document.title = \"Title 7 checked\"; else document.title = \"Title 7 " - "not checked\";'>" - "</menuitem>" - "<menuitem id=\"item8\" type=\"radio\" radiogroup=\"group\" " - "label=\"Item8\"" - "onclick='if " - "(document.getElementById(\"item8\").hasAttribute(\"checked\"))" - "document.title = \"Title 8 checked\"; else if " - "(document.getElementById(\"item9\").hasAttribute(\"checked\"))" - "document.title = \"Title 8 not checked and Title 9 checked\";'>" - "</menuitem>" - "<menuitem id=\"item9\" type=\"radio\" radiogroup=\"group\" checked " - "label=\"Item9\"" - "onclick='if " - "(document.getElementById(\"item9\").hasAttribute(\"checked\"))" - "document.title = \"Title 9 checked\"; else document.title = \"Title 9 " - "not checked\";'>" - "</menuitem>" - "<menuitem id=\"item10\" type=\"radio\" radiogroup=\"group\" " - "label=\"Item10\"" - "onclick='if " - "(document.getElementById(\"item10\").hasAttribute(\"checked\"))" - "document.title = \"Title 10 checked\"; else if " - "(document.getElementById(\"item8\").hasAttribute(\"checked\"))" - "document.title = \"Title 10 not checked and Title 8 checked\";'>" - "</menuitem>" - "</menu>" - "</button>"); - - MouseEventInit mouse_initializer; - mouse_initializer.setView(GetDocument().domWindow()); - mouse_initializer.setScreenX(50); - mouse_initializer.setScreenY(50); - mouse_initializer.setButton(1); - - // Create right button click event and pass it to context menu controller. - Event* event = - MouseEvent::Create(nullptr, EventTypeNames::click, mouse_initializer); - GetDocument().getElementById("button_id")->focus(); - event->SetTarget(GetDocument().getElementById("button_id")); - GetDocument().GetPage()->GetContextMenuController().HandleContextMenuEvent( - event); - - // Item 1 - // Item 2 - // Item 3 - // Submenu > Item 4 - // Item 5 - // Item 6 - // *Item 7 - // Item 8 - // *Item 9 - // Item 10 - const Vector<ContextMenuItem>& items = GetDocument() - .GetPage() - ->GetContextMenuController() - .GetContextMenu() - ->Items(); - EXPECT_EQ(8u, items.size()); - EXPECT_EQ(kActionType, items[0].GetType()); - EXPECT_STREQ("Item1", items[0].Title().Utf8().data()); - GetDocument().GetPage()->GetContextMenuController().ContextMenuItemSelected( - &items[0]); - EXPECT_STREQ("Title 1", GetDocument().title().Utf8().data()); - EXPECT_EQ(kSubmenuType, items[3].GetType()); - EXPECT_STREQ("Submenu", items[3].Title().Utf8().data()); - const Vector<ContextMenuItem>& sub_menu_items = items[3].SubMenuItems(); - EXPECT_EQ(3u, sub_menu_items.size()); - EXPECT_STREQ("Item6", sub_menu_items[2].Title().Utf8().data()); - GetDocument().GetPage()->GetContextMenuController().ContextMenuItemSelected( - &sub_menu_items[2]); - EXPECT_STREQ("Title 6", GetDocument().title().Utf8().data()); - GetDocument().GetPage()->GetContextMenuController().ContextMenuItemSelected( - &items[4]); - EXPECT_STREQ("Title 7 checked", GetDocument().title().Utf8().data()); - GetDocument().GetPage()->GetContextMenuController().ContextMenuItemSelected( - &items[4]); - EXPECT_STREQ("Title 7 not checked", GetDocument().title().Utf8().data()); - GetDocument().GetPage()->GetContextMenuController().ContextMenuItemSelected( - &items[5]); - EXPECT_STREQ("Title 8 not checked and Title 9 checked", - GetDocument().title().Utf8().data()); - GetDocument().GetPage()->GetContextMenuController().ContextMenuItemSelected( - &items[7]); - EXPECT_STREQ("Title 10 not checked and Title 8 checked", - GetDocument().title().Utf8().data()); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/core/page/CustomContextMenuProvider.cpp b/third_party/WebKit/Source/core/page/CustomContextMenuProvider.cpp deleted file mode 100644 index 561c647a..0000000 --- a/third_party/WebKit/Source/core/page/CustomContextMenuProvider.cpp +++ /dev/null
@@ -1,149 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "core/page/CustomContextMenuProvider.h" - -#include "core/dom/Document.h" -#include "core/dom/ElementTraversal.h" -#include "core/events/EventDispatcher.h" -#include "core/events/MouseEvent.h" -#include "core/html/HTMLMenuElement.h" -#include "core/html/HTMLMenuItemElement.h" -#include "core/page/ContextMenuController.h" -#include "core/page/Page.h" -#include "platform/ContextMenu.h" - -namespace blink { - -using namespace HTMLNames; - -CustomContextMenuProvider::CustomContextMenuProvider(HTMLMenuElement& menu, - HTMLElement& subject) - : menu_(menu), subject_element_(subject) {} - -CustomContextMenuProvider::~CustomContextMenuProvider() {} - -DEFINE_TRACE(CustomContextMenuProvider) { - visitor->Trace(menu_); - visitor->Trace(subject_element_); - visitor->Trace(menu_items_); - ContextMenuProvider::Trace(visitor); -} - -void CustomContextMenuProvider::PopulateContextMenu(ContextMenu* menu) { - PopulateContextMenuItems(*menu_, *menu); -} - -void CustomContextMenuProvider::ContextMenuItemSelected( - const ContextMenuItem* item) { - if (HTMLElement* element = MenuItemAt(item->Action())) { - MouseEvent* click = MouseEvent::Create( - EventTypeNames::click, menu_->GetDocument().domWindow(), - Event::Create(), SimulatedClickCreationScope::kFromUserAgent); - click->SetRelatedTarget(subject_element_.Get()); - element->DispatchEvent(click); - } -} - -void CustomContextMenuProvider::ContextMenuCleared() { - menu_items_.clear(); - subject_element_ = nullptr; -} - -void CustomContextMenuProvider::AppendSeparator(ContextMenu& context_menu) { - // Avoid separators at the start of any menu and submenu. - if (!context_menu.Items().size()) - return; - - // Collapse all sequences of two or more adjacent separators in the menu or - // any submenus to a single separator. - ContextMenuItem last_item = context_menu.Items().back(); - if (last_item.GetType() == kSeparatorType) - return; - - context_menu.AppendItem(ContextMenuItem( - kSeparatorType, kContextMenuItemCustomTagNoAction, String(), String())); -} - -void CustomContextMenuProvider::AppendMenuItem(HTMLMenuItemElement* menu_item, - ContextMenu& context_menu) { - // Avoid menuitems with no label. - String label_string = menu_item->label(); - if (label_string.IsEmpty()) - return; - - menu_items_.push_back(menu_item); - - bool enabled = !menu_item->FastHasAttribute(disabledAttr); - String icon = menu_item->FastGetAttribute(iconAttr); - if (!icon.IsEmpty()) { - // To obtain the absolute URL of the icon when the attribute's value is not - // the empty string, the attribute's value must be resolved relative to the - // element. - KURL icon_url = KURL(menu_item->baseURI(), icon); - icon = icon_url.GetString(); - } - ContextMenuAction action = static_cast<ContextMenuAction>( - kContextMenuItemBaseCustomTag + menu_items_.size() - 1); - if (DeprecatedEqualIgnoringCase(menu_item->FastGetAttribute(typeAttr), - "checkbox") || - DeprecatedEqualIgnoringCase(menu_item->FastGetAttribute(typeAttr), - "radio")) - context_menu.AppendItem( - ContextMenuItem(kCheckableActionType, action, label_string, icon, - enabled, menu_item->FastHasAttribute(checkedAttr))); - else - context_menu.AppendItem(ContextMenuItem(kActionType, action, label_string, - icon, enabled, false)); -} - -void CustomContextMenuProvider::PopulateContextMenuItems( - const HTMLMenuElement& menu, - ContextMenu& context_menu) { - HTMLElement* next_element = Traversal<HTMLElement>::FirstWithin(menu); - while (next_element) { - if (isHTMLHRElement(*next_element)) { - AppendSeparator(context_menu); - next_element = Traversal<HTMLElement>::Next(*next_element, &menu); - } else if (isHTMLMenuElement(*next_element)) { - ContextMenu sub_menu; - String label_string = next_element->FastGetAttribute(labelAttr); - if (label_string.IsNull()) { - AppendSeparator(context_menu); - PopulateContextMenuItems(*toHTMLMenuElement(next_element), - context_menu); - AppendSeparator(context_menu); - } else if (!label_string.IsEmpty()) { - PopulateContextMenuItems(*toHTMLMenuElement(next_element), sub_menu); - context_menu.AppendItem( - ContextMenuItem(kSubmenuType, kContextMenuItemCustomTagNoAction, - label_string, String(), &sub_menu)); - } - next_element = Traversal<HTMLElement>::NextSibling(*next_element); - } else if (isHTMLMenuItemElement(*next_element)) { - AppendMenuItem(toHTMLMenuItemElement(next_element), context_menu); - if (kContextMenuItemBaseCustomTag + menu_items_.size() >= - kContextMenuItemLastCustomTag) - break; - next_element = Traversal<HTMLElement>::Next(*next_element, &menu); - } else { - next_element = Traversal<HTMLElement>::Next(*next_element, &menu); - } - } - - // Remove separators at the end of the menu and any submenus. - while (context_menu.Items().size() && - context_menu.Items().back().GetType() == kSeparatorType) - context_menu.RemoveLastItem(); -} - -HTMLElement* CustomContextMenuProvider::MenuItemAt(unsigned menu_id) { - int item_index = menu_id - kContextMenuItemBaseCustomTag; - if (item_index < 0 || - static_cast<unsigned long>(item_index) >= menu_items_.size()) - return nullptr; - return menu_items_[item_index].Get(); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/core/page/CustomContextMenuProvider.h b/third_party/WebKit/Source/core/page/CustomContextMenuProvider.h deleted file mode 100644 index 793a3fc..0000000 --- a/third_party/WebKit/Source/core/page/CustomContextMenuProvider.h +++ /dev/null
@@ -1,48 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CustomContextMenuProvider_h -#define CustomContextMenuProvider_h - -#include "core/page/ContextMenuProvider.h" -#include "platform/ContextMenuItem.h" -#include "platform/heap/Handle.h" - -namespace blink { - -class ContextMenu; -class HTMLElement; -class HTMLMenuElement; -class HTMLMenuItemElement; - -class CustomContextMenuProvider final : public ContextMenuProvider { - public: - ~CustomContextMenuProvider() override; - - static CustomContextMenuProvider* Create(HTMLMenuElement& menu, - HTMLElement& subject) { - return new CustomContextMenuProvider(menu, subject); - } - - DECLARE_VIRTUAL_TRACE(); - - private: - CustomContextMenuProvider(HTMLMenuElement&, HTMLElement&); - - void PopulateContextMenu(ContextMenu*) override; - void ContextMenuItemSelected(const ContextMenuItem*) override; - void ContextMenuCleared() override; - void PopulateContextMenuItems(const HTMLMenuElement&, ContextMenu&); - void AppendSeparator(ContextMenu&); - void AppendMenuItem(HTMLMenuItemElement*, ContextMenu&); - HTMLElement* MenuItemAt(unsigned menu_id); - - Member<HTMLMenuElement> menu_; - Member<HTMLElement> subject_element_; - HeapVector<Member<HTMLElement>> menu_items_; -}; - -} // namespace blink - -#endif
diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp index 52251721..bdb4c9a 100644 --- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -547,7 +547,7 @@ // LocalFrameView::CompositorAnimationTimeline() can indirectly return // m_programmaticScrollAnimatorTimeline if it does not have its own // timeline. - if (scrollable_area->IsFrameView()) { + if (scrollable_area->IsLocalFrameView()) { timeline = ToLocalFrameView(scrollable_area)->GetCompositorAnimationTimeline(); } else if (scrollable_area->IsPaintLayerScrollableArea()) { @@ -988,7 +988,7 @@ if (const LocalFrameView::ScrollableAreaSet* scrollable_areas = frame_view->ScrollableAreas()) { for (const ScrollableArea* scrollable_area : *scrollable_areas) { - if (scrollable_area->IsFrameView() && + if (scrollable_area->IsLocalFrameView() && ToLocalFrameView(scrollable_area)->ShouldThrottleRendering()) continue; // Composited scrollable areas can be scrolled off the main thread.
diff --git a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp index 0e103ea3..17249ed 100644 --- a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp +++ b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
@@ -6,6 +6,7 @@ #include "core/editing/CompositionUnderline.h" #include "core/editing/Editor.h" +#include "core/editing/markers/CompositionMarker.h" #include "core/editing/markers/DocumentMarkerController.h" #include "core/editing/markers/TextMatchMarker.h" #include "core/frame/LocalFrame.h" @@ -676,9 +677,12 @@ } break; case DocumentMarker::kComposition: { - CompositionUnderline underline(marker.StartOffset(), marker.EndOffset(), - marker.UnderlineColor(), marker.Thick(), - marker.BackgroundColor()); + const CompositionMarker& composition_marker = + ToCompositionMarker(marker); + CompositionUnderline underline( + composition_marker.StartOffset(), composition_marker.EndOffset(), + composition_marker.UnderlineColor(), composition_marker.Thick(), + composition_marker.BackgroundColor()); if (marker_paint_phase == DocumentMarkerPaintPhase::kBackground) PaintSingleCompositionBackgroundRun( paint_info.context, box_origin, style, font,
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp index 1fe253cd..ddf32276 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp +++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -92,11 +92,11 @@ // ComputedStyle. ASSERT_SIZE(ComputedStyle, SameSizeAsComputedStyle); -PassRefPtr<ComputedStyle> ComputedStyle::Create() { +RefPtr<ComputedStyle> ComputedStyle::Create() { return AdoptRef(new ComputedStyle(InitialStyle())); } -PassRefPtr<ComputedStyle> ComputedStyle::CreateInitialStyle() { +RefPtr<ComputedStyle> ComputedStyle::CreateInitialStyle() { return AdoptRef(new ComputedStyle()); } @@ -111,7 +111,7 @@ MutableInitialStyle().SetTapHighlightColor(InitialTapHighlightColor()); } -PassRefPtr<ComputedStyle> ComputedStyle::CreateAnonymousStyleWithDisplay( +RefPtr<ComputedStyle> ComputedStyle::CreateAnonymousStyleWithDisplay( const ComputedStyle& parent_style, EDisplay display) { RefPtr<ComputedStyle> new_style = ComputedStyle::Create(); @@ -121,7 +121,7 @@ return new_style; } -PassRefPtr<ComputedStyle> ComputedStyle::Clone(const ComputedStyle& other) { +RefPtr<ComputedStyle> ComputedStyle::Clone(const ComputedStyle& other) { return AdoptRef(new ComputedStyle(other)); }
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h index 3c48cb7..5a9ad613 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyle.h +++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -86,7 +86,6 @@ #include "platform/transforms/TransformOperations.h" #include "platform/wtf/Forward.h" #include "platform/wtf/LeakAnnotations.h" -#include "platform/wtf/PassRefPtr.h" #include "platform/wtf/RefCounted.h" #include "platform/wtf/RefVector.h" #include "platform/wtf/Vector.h" @@ -254,16 +253,16 @@ ALWAYS_INLINE ComputedStyle(); ALWAYS_INLINE ComputedStyle(const ComputedStyle&); - static PassRefPtr<ComputedStyle> CreateInitialStyle(); + static RefPtr<ComputedStyle> CreateInitialStyle(); // TODO(shend): Remove this. Initial style should not be mutable. static ComputedStyle& MutableInitialStyle(); public: - static PassRefPtr<ComputedStyle> Create(); - static PassRefPtr<ComputedStyle> CreateAnonymousStyleWithDisplay( + static RefPtr<ComputedStyle> Create(); + static RefPtr<ComputedStyle> CreateAnonymousStyleWithDisplay( const ComputedStyle& parent_style, EDisplay); - static PassRefPtr<ComputedStyle> Clone(const ComputedStyle&); + static RefPtr<ComputedStyle> Clone(const ComputedStyle&); static const ComputedStyle& InitialStyle() { return MutableInitialStyle(); } static void InvalidateInitialStyle(); @@ -1298,7 +1297,7 @@ // Independent transform properties. // translate - static PassRefPtr<TranslateTransformOperation> InitialTranslate() { + static RefPtr<TranslateTransformOperation> InitialTranslate() { return nullptr; } TranslateTransformOperation* Translate() const { @@ -1310,9 +1309,7 @@ } // rotate - static PassRefPtr<RotateTransformOperation> InitialRotate() { - return nullptr; - } + static RefPtr<RotateTransformOperation> InitialRotate() { return nullptr; } RotateTransformOperation* Rotate() const { return rare_non_inherited_data_->transform_->rotate_.Get(); } @@ -1322,7 +1319,7 @@ } // scale - static PassRefPtr<ScaleTransformOperation> InitialScale() { return nullptr; } + static RefPtr<ScaleTransformOperation> InitialScale() { return nullptr; } ScaleTransformOperation* Scale() const { return rare_non_inherited_data_->transform_->scale_.Get(); }
diff --git a/third_party/WebKit/Source/platform/ContextMenuItem.cpp b/third_party/WebKit/Source/platform/ContextMenuItem.cpp index b04d1ad..8a806c81 100644 --- a/third_party/WebKit/Source/platform/ContextMenuItem.cpp +++ b/third_party/WebKit/Source/platform/ContextMenuItem.cpp
@@ -32,12 +32,10 @@ ContextMenuItem::ContextMenuItem(ContextMenuItemType type, ContextMenuAction action, const String& title, - const String& icon, ContextMenu* sub_menu) : type_(type), action_(action), title_(title), - icon_(icon), enabled_(true), checked_(false) { if (sub_menu) @@ -47,13 +45,11 @@ ContextMenuItem::ContextMenuItem(ContextMenuItemType type, ContextMenuAction action, const String& title, - const String& icon, bool enabled, bool checked) : type_(type), action_(action), title_(title), - icon_(icon), enabled_(enabled), checked_(checked) {}
diff --git a/third_party/WebKit/Source/platform/ContextMenuItem.h b/third_party/WebKit/Source/platform/ContextMenuItem.h index 481a7743..7e3cae8 100644 --- a/third_party/WebKit/Source/platform/ContextMenuItem.h +++ b/third_party/WebKit/Source/platform/ContextMenuItem.h
@@ -55,12 +55,10 @@ ContextMenuItem(ContextMenuItemType, ContextMenuAction, const String& title, - const String& icon, ContextMenu* sub_menu = 0); ContextMenuItem(ContextMenuItemType, ContextMenuAction, const String& title, - const String& icon, bool enabled, bool checked); @@ -89,9 +87,6 @@ void SetTitle(const String& title) { title_ = title; } const String& Title() const { return title_; } - void SetIcon(const String& icon) { icon_ = icon; } - const String& Icon() const { return icon_; } - const Vector<ContextMenuItem>& SubMenuItems() const { return sub_menu_items_; } @@ -100,7 +95,6 @@ ContextMenuItemType type_; ContextMenuAction action_; String title_; - String icon_; bool enabled_; bool checked_; Vector<ContextMenuItem> sub_menu_items_;
diff --git a/third_party/WebKit/Source/platform/PlatformFrameView.h b/third_party/WebKit/Source/platform/PlatformFrameView.h index ecc0ac27..6848a46 100644 --- a/third_party/WebKit/Source/platform/PlatformFrameView.h +++ b/third_party/WebKit/Source/platform/PlatformFrameView.h
@@ -17,7 +17,7 @@ PlatformFrameView() {} virtual ~PlatformFrameView() {} - virtual bool IsFrameView() const { return false; } + virtual bool IsLocalFrameView() const { return false; } }; } // namespace blink
diff --git a/third_party/WebKit/Source/platform/bindings/V8PrivateProperty.h b/third_party/WebKit/Source/platform/bindings/V8PrivateProperty.h index cc84662..2129c9c 100644 --- a/third_party/WebKit/Source/platform/bindings/V8PrivateProperty.h +++ b/third_party/WebKit/Source/platform/bindings/V8PrivateProperty.h
@@ -24,10 +24,6 @@ // FetchEvent.Request. // Apply |X| for each pair of (InterfaceName, PrivateKeyName). #define V8_PRIVATE_PROPERTY_FOR_EACH(X) \ - X(CustomElement, AdoptedCallback) \ - X(CustomElement, AttributeChangedCallback) \ - X(CustomElement, ConnectedCallback) \ - X(CustomElement, DisconnectedCallback) \ X(CustomElement, Document) \ X(CustomElement, IsInterfacePrototypeObject) \ X(CustomElement, NamespaceURI) \
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp index dd539b6..b95765c 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
@@ -37,6 +37,14 @@ } template <typename T> +static std::unique_ptr<JSONArray> PointAsJSONArray(const T& point) { + std::unique_ptr<JSONArray> array = JSONArray::Create(); + array->PushDouble(point.X()); + array->PushDouble(point.Y()); + return array; +} + +template <typename T> static std::unique_ptr<JSONArray> SizeAsJSONArray(const T& size) { std::unique_ptr<JSONArray> array = JSONArray::Create(); array->PushDouble(size.Width()); @@ -104,34 +112,28 @@ return false; } - void SetNeedsDisplayRect(const gfx::Rect& rect) { - cc_picture_layer_->SetNeedsDisplayRect(rect); + RasterInvalidationTracking& EnsureRasterInvalidationTracking() { + return CcLayersRasterInvalidationTrackingMap().Add(cc_picture_layer_.get()); } - void AddTrackedRasterInvalidations( - const RasterInvalidationTracking& tracking) { - auto& cc_tracking = - CcLayersRasterInvalidationTrackingMap().Add(cc_picture_layer_.get()); - cc_tracking.invalidations.AppendVector(tracking.invalidations); - - if (!RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) - return; - for (const auto& info : tracking.invalidations) { - // TODO(crbug.com/496260): Some antialiasing effects overflow the paint - // invalidation rect. - IntRect r = info.rect; - r.Inflate(1); - cc_tracking.invalidation_region_since_last_paint.Unite(r); - } + void SetNeedsDisplayRect(const gfx::Rect& rect) { + cc_picture_layer_->SetNeedsDisplayRect(rect); } std::unique_ptr<JSONObject> LayerAsJSON(LayerTreeFlags flags) { std::unique_ptr<JSONObject> json = JSONObject::Create(); json->SetString("name", debug_name_); + + FloatPoint position(cc_picture_layer_->offset_to_transform_parent().x(), + cc_picture_layer_->offset_to_transform_parent().y()); + if (position != FloatPoint()) + json->SetArray("position", PointAsJSONArray(position)); + IntSize bounds(cc_picture_layer_->bounds().width(), cc_picture_layer_->bounds().height()); if (!bounds.IsEmpty()) json->SetArray("bounds", SizeAsJSONArray(bounds)); + json->SetBoolean("contentsOpaque", cc_picture_layer_->contents_opaque()); json->SetBoolean("drawsContent", cc_picture_layer_->DrawsContent()); @@ -240,6 +242,24 @@ .GetId())); } +IntRect PaintArtifactCompositor::MapRasterInvalidationRectFromChunkToLayer( + const FloatRect& r, + const PaintChunk& paint_chunk, + const PendingLayer& pending_layer, + const gfx::Vector2dF& layer_offset) { + FloatClipRect rect( + r == FloatRect(LayoutRect::InfiniteIntRect()) ? paint_chunk.bounds : r); + GeometryMapper::LocalToAncestorVisualRect( + paint_chunk.properties.property_tree_state, + pending_layer.property_tree_state, rect); + if (rect.Rect().IsEmpty()) + return IntRect(); + // Now rect is in the space of the containing transform node of pending_layer, + // so need to subtract off the layer offset. + rect.Rect().Move(-layer_offset.x(), -layer_offset.y()); + return EnclosingIntRect(rect.Rect()); +} + scoped_refptr<cc::Layer> PaintArtifactCompositor::CompositedLayerForPendingLayer( const PaintArtifact& paint_artifact, @@ -290,22 +310,31 @@ DisplayItemList::kShownOnlyDisplayItemTypes)); } - for (const auto& r : paint_chunk->raster_invalidation_rects) { - IntRect rect(EnclosingIntRect(r)); - gfx::Rect cc_invalidation_rect(rect.X(), rect.Y(), - std::max(0, rect.Width()), - std::max(0, rect.Height())); - if (cc_invalidation_rect.IsEmpty()) - continue; - // Raster paintChunk.rasterInvalidationRects is in the space of the - // containing transform node, so need to subtract off the layer offset. - cc_invalidation_rect.Offset(-cc_combined_bounds.OffsetFromOrigin()); - content_layer_client->SetNeedsDisplayRect(cc_invalidation_rect); - } + auto* raster_tracking = + tracking_map ? tracking_map->Find(paint_chunk) : nullptr; + DCHECK(!raster_tracking || paint_chunk->raster_invalidation_rects.size() == + raster_tracking->invalidations.size()); - if (auto* raster_tracking = - tracking_map ? tracking_map->Find(paint_chunk) : nullptr) - content_layer_client->AddTrackedRasterInvalidations(*raster_tracking); + for (size_t i = 0; i < paint_chunk->raster_invalidation_rects.size(); ++i) { + auto rect = MapRasterInvalidationRectFromChunkToLayer( + paint_chunk->raster_invalidation_rects[i], *paint_chunk, + pending_layer, layer_offset); + if (rect.IsEmpty()) + continue; + content_layer_client->SetNeedsDisplayRect(rect); + + if (!raster_tracking) + continue; + auto& cc_tracking = + content_layer_client->EnsureRasterInvalidationTracking(); + auto info = raster_tracking->invalidations[i]; + info.rect = rect; + cc_tracking.invalidations.push_back(info); + // TODO(crbug.com/496260): Some antialiasing effects overflow the paint + // invalidation rect. + rect.Inflate(1); + cc_tracking.invalidation_region_since_last_paint.Unite(rect); + } } new_content_layer_clients.push_back(std::move(content_layer_client));
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h index ad3a660..bc271933 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h
@@ -148,6 +148,12 @@ static bool CanDecompositeEffect(const EffectPaintPropertyNode*, const PendingLayer&); + static IntRect MapRasterInvalidationRectFromChunkToLayer( + const FloatRect&, + const PaintChunk&, + const PendingLayer&, + const gfx::Vector2dF& layer_offset); + // Builds a leaf layer that represents a single paint chunk. // Note: cc::Layer API assumes the layer bounds start at (0, 0), but the // bounding box of a paint chunk does not necessarily start at (0, 0) (and
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp index 5bb67b2..00159eab 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
@@ -746,17 +746,15 @@ PaintInvalidationReason reason) { chunk.raster_invalidation_rects.push_back(rect); if (raster_invalidation_tracking_info_) - TrackRasterInvalidation(client, chunk, rect, reason); + TrackRasterInvalidation(client, chunk, reason); } void PaintController::TrackRasterInvalidation(const DisplayItemClient& client, PaintChunk& chunk, - const FloatRect& rect, PaintInvalidationReason reason) { DCHECK(raster_invalidation_tracking_info_); RasterInvalidationInfo info; - info.rect = EnclosingIntRect(rect); info.client = &client; if (reason == PaintInvalidationReason::kNone) { // The client was validated by another PaintController, but not valid in
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.h b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h index 285034b8..ce8e842 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.h +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h
@@ -318,7 +318,6 @@ PaintInvalidationReason); void TrackRasterInvalidation(const DisplayItemClient&, PaintChunk&, - const FloatRect&, PaintInvalidationReason); // The following two methods are for checking under-invalidations
diff --git a/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h b/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h index 445af4f..bbc0d74 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h +++ b/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h
@@ -25,6 +25,8 @@ // died. const DisplayItemClient* client = nullptr; String client_debug_name; + // For SPv2, this is set in PaintArtifactCompositor when converting chunk + // raster invalidations to cc raster invalidations. IntRect rect; PaintInvalidationReason reason = PaintInvalidationReason::kFull; };
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc index 2cc38716..1578d3e9 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
@@ -219,6 +219,7 @@ in_idle_period_for_testing(false), use_virtual_time(false), is_audio_playing(false), + virtual_time_paused(false), rail_mode_observer(nullptr), wake_up_budget_pool(nullptr), task_duration_reporter("RendererScheduler.TaskDurationPerQueueType2"), @@ -369,6 +370,8 @@ TimeDomainType::THROTTLED) { task_queue_throttler_->IncreaseThrottleRefCount(timer_task_queue.get()); } + if (GetMainThreadOnly().virtual_time_paused) + timer_task_queue->InsertFence(TaskQueue::InsertFencePosition::NOW); timer_task_queue->AddTaskObserver( &GetMainThreadOnly().timer_task_cost_estimator); AddQueueToWakeUpBudgetPool(timer_task_queue.get()); @@ -1404,6 +1407,25 @@ ForceUpdatePolicy(); } +void RendererSchedulerImpl::VirtualTimePaused() { + DCHECK(!GetMainThreadOnly().virtual_time_paused); + GetMainThreadOnly().virtual_time_paused = true; + for (const auto& pair : timer_task_runners_) { + DCHECK(!task_queue_throttler_->IsThrottled(pair.first.get())); + DCHECK(!pair.first->HasFence()); + pair.first->InsertFence(TaskQueue::InsertFencePosition::NOW); + } +} + +void RendererSchedulerImpl::VirtualTimeResumed() { + DCHECK(GetMainThreadOnly().virtual_time_paused); + GetMainThreadOnly().virtual_time_paused = false; + for (const auto& pair : timer_task_runners_) { + DCHECK(!task_queue_throttler_->IsThrottled(pair.first.get())); + pair.first->RemoveFence(); + } +} + void RendererSchedulerImpl::SetTimerQueueSuspensionWhenBackgroundedEnabled( bool enabled) { // Note that this will only take effect for the next backgrounded signal. @@ -1518,6 +1540,8 @@ .timer_task_cost_estimator.expected_task_duration() .InMillisecondsF()); state->SetBoolean("is_audio_playing", GetMainThreadOnly().is_audio_playing); + state->SetBoolean("virtual_time_paused", + GetMainThreadOnly().virtual_time_paused); state->BeginDictionary("web_view_schedulers"); for (WebViewSchedulerImpl* web_view_scheduler :
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h index 3da44a2..2ba9c645 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
@@ -117,6 +117,8 @@ void Shutdown() override; void SuspendTimerQueue() override; void ResumeTimerQueue() override; + void VirtualTimePaused() override; + void VirtualTimeResumed() override; void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled) override; void SetTopLevelBlameContext( base::trace_event::BlameContext* blame_context) override; @@ -492,6 +494,7 @@ bool in_idle_period_for_testing; bool use_virtual_time; bool is_audio_playing; + bool virtual_time_paused; std::set<WebViewSchedulerImpl*> web_view_schedulers; // Not owned. RAILModeObserver* rail_mode_observer; // Not owned. WakeUpBudgetPool* wake_up_budget_pool; // Not owned.
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.cc b/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.cc index f6b9706..d0537a2 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.cc
@@ -100,7 +100,7 @@ should_throttle_frames_(false), disable_background_timer_throttling_(disable_background_timer_throttling), allow_virtual_time_to_advance_(true), - timers_suspended_(false), + virtual_time_paused_(false), have_seen_loading_task_(false), virtual_time_(false), is_audio_playing_(false), @@ -189,15 +189,17 @@ } void WebViewSchedulerImpl::ApplyVirtualTimePolicyToTimers() { - if (!virtual_time_ || allow_virtual_time_to_advance_) { - if (timers_suspended_) { - renderer_scheduler_->ResumeTimerQueue(); - timers_suspended_ = false; - } - } else if (!timers_suspended_) { - renderer_scheduler_->SuspendTimerQueue(); - timers_suspended_ = true; + bool virtual_time_should_be_paused = + virtual_time_ && !allow_virtual_time_to_advance_; + if (virtual_time_should_be_paused == virtual_time_paused_) + return; + + if (virtual_time_should_be_paused) { + renderer_scheduler_->VirtualTimePaused(); + } else { + renderer_scheduler_->VirtualTimeResumed(); } + virtual_time_paused_ = virtual_time_should_be_paused; } void WebViewSchedulerImpl::SetAllowVirtualTimeToAdvance(
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.h b/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.h index 3994213d..2f0a7abc 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.h +++ b/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl.h
@@ -112,7 +112,7 @@ bool should_throttle_frames_; bool disable_background_timer_throttling_; bool allow_virtual_time_to_advance_; - bool timers_suspended_; + bool virtual_time_paused_; bool have_seen_loading_task_; bool virtual_time_; bool is_audio_playing_;
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc b/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc index 8bdac8155..507872fb 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc
@@ -614,13 +614,13 @@ std::unique_ptr<WebFrameSchedulerImpl> web_frame_scheduler = web_view_scheduler_->CreateWebFrameSchedulerImpl(nullptr); - web_frame_scheduler->TimerTaskRunner()->PostDelayedTask( - BLINK_FROM_HERE, WTF::Bind(&RunOrderTask, 1, WTF::Unretained(&run_order)), - TimeDelta()); - web_view_scheduler_->SetVirtualTimePolicy(VirtualTimePolicy::PAUSE); web_view_scheduler_->EnableVirtualTime(); + web_frame_scheduler->TimerTaskRunner()->PostTask( + BLINK_FROM_HERE, + WTF::Bind(&RunOrderTask, 1, WTF::Unretained(&run_order))); + mock_task_runner_->RunUntilIdle(); EXPECT_TRUE(run_order.empty()); @@ -681,9 +681,11 @@ // The timer that is scheduled for the exact point in time when virtual time // expires will not run. - EXPECT_THAT(real_times, ElementsAre(initial_real_time, initial_real_time)); + EXPECT_THAT(real_times, ElementsAre(initial_real_time, initial_real_time, + initial_real_time)); EXPECT_THAT(virtual_times_ms, ElementsAre(initial_virtual_time_ms + 1, - initial_virtual_time_ms + 2)); + initial_virtual_time_ms + 2, + initial_virtual_time_ms + 5)); } namespace {
diff --git a/third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc b/third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc index 3ce57df..f45154cc 100644 --- a/third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc +++ b/third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc
@@ -106,6 +106,10 @@ void FakeRendererScheduler::ResumeTimerQueue() {} +void FakeRendererScheduler::VirtualTimePaused() {} + +void FakeRendererScheduler::VirtualTimeResumed() {} + void FakeRendererScheduler::SetTimerQueueSuspensionWhenBackgroundedEnabled( bool enabled) {}
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.h b/third_party/WebKit/Source/platform/scroll/ScrollableArea.h index a84fe5c..e3cd362 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.h +++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.h
@@ -348,7 +348,7 @@ const LayoutObject*, unsigned = 0) const; - virtual bool IsFrameView() const { return false; } + virtual bool IsLocalFrameView() const { return false; } virtual bool IsPaintLayerScrollableArea() const { return false; } virtual bool IsRootFrameViewport() const { return false; }
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp index 6a01332..3c8a527 100644 --- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp +++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -557,7 +557,7 @@ void ChromeClientImpl::ScheduleAnimation( const PlatformFrameView* platform_frame_view) { - DCHECK(platform_frame_view->IsFrameView()); + DCHECK(platform_frame_view->IsLocalFrameView()); LocalFrame& frame = ToLocalFrameView(platform_frame_view)->GetFrame().LocalFrameRoot(); // If the frame is still being created, it might not yet have a WebWidget. @@ -574,7 +574,7 @@ const PlatformFrameView* platform_frame_view) const { WebRect screen_rect(rect_in_viewport); - DCHECK(platform_frame_view->IsFrameView()); + DCHECK(platform_frame_view->IsLocalFrameView()); const LocalFrameView* view = ToLocalFrameView(platform_frame_view); LocalFrame& frame = view->GetFrame().LocalFrameRoot();
diff --git a/third_party/WebKit/Source/web/ColorChooserPopupUIController.cpp b/third_party/WebKit/Source/web/ColorChooserPopupUIController.cpp index de40c74..1becf19 100644 --- a/third_party/WebKit/Source/web/ColorChooserPopupUIController.cpp +++ b/third_party/WebKit/Source/web/ColorChooserPopupUIController.cpp
@@ -28,11 +28,11 @@ #include "core/frame/LocalFrame.h" #include "core/frame/LocalFrameView.h" #include "core/html/forms/ColorChooserClient.h" +#include "core/page/ChromeClient.h" #include "core/page/PagePopup.h" #include "platform/geometry/IntRect.h" #include "public/platform/Platform.h" #include "public/web/WebColorChooser.h" -#include "web/ChromeClientImpl.h" namespace blink { @@ -45,7 +45,7 @@ ColorChooserPopupUIController::ColorChooserPopupUIController( LocalFrame* frame, - ChromeClientImpl* chrome_client, + ChromeClient* chrome_client, ColorChooserClient* client) : ColorChooserUIController(frame, client), chrome_client_(chrome_client),
diff --git a/third_party/WebKit/Source/web/ColorChooserPopupUIController.h b/third_party/WebKit/Source/web/ColorChooserPopupUIController.h index 54896f6..e7224a32 100644 --- a/third_party/WebKit/Source/web/ColorChooserPopupUIController.h +++ b/third_party/WebKit/Source/web/ColorChooserPopupUIController.h
@@ -31,7 +31,7 @@ namespace blink { -class ChromeClientImpl; +class ChromeClient; class ColorChooserClient; class PagePopup; @@ -41,7 +41,7 @@ public: static ColorChooserPopupUIController* Create(LocalFrame* frame, - ChromeClientImpl* chrome_client, + ChromeClient* chrome_client, ColorChooserClient* client) { return new ColorChooserPopupUIController(frame, chrome_client, client); } @@ -68,13 +68,13 @@ private: ColorChooserPopupUIController(LocalFrame*, - ChromeClientImpl*, + ChromeClient*, ColorChooserClient*); void OpenPopup(); void Dispose(); - Member<ChromeClientImpl> chrome_client_; + Member<ChromeClient> chrome_client_; PagePopup* popup_; Locale& locale_; };
diff --git a/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp b/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp index 854c49a..9328735 100644 --- a/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp +++ b/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp
@@ -529,7 +529,6 @@ WebMenuItemInfo output_item; output_item.label = input_item->Title(); - output_item.icon = input_item->Icon(); output_item.enabled = input_item->Enabled(); output_item.checked = input_item->Checked(); output_item.action = static_cast<unsigned>(input_item->Action() -
diff --git a/third_party/WebKit/Source/web/WebAXObject.cpp b/third_party/WebKit/Source/web/WebAXObject.cpp index 35c332a..7320af9a 100644 --- a/third_party/WebKit/Source/web/WebAXObject.cpp +++ b/third_party/WebKit/Source/web/WebAXObject.cpp
@@ -1560,4 +1560,13 @@ return private_.Get(); } +// static +WebAXObject WebAXObject::FromWebNode(WebNode& web_node) { + WebDocument web_document = web_node.GetDocument(); + const Document* doc = web_document.ConstUnwrap<Document>(); + AXObjectCacheBase* cache = ToAXObjectCacheBase(doc->ExistingAXObjectCache()); + Node* node = web_node.Unwrap<Node>(); + return cache ? WebAXObject(cache->Get(node)) : WebAXObject(); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/web/WebNode.cpp b/third_party/WebKit/Source/web/WebNode.cpp index ba78476..858940f0 100644 --- a/third_party/WebKit/Source/web/WebNode.cpp +++ b/third_party/WebKit/Source/web/WebNode.cpp
@@ -32,7 +32,6 @@ #include "bindings/core/v8/ExceptionState.h" #include "core/dom/AXObject.h" -#include "core/dom/AXObjectCacheBase.h" #include "core/dom/Document.h" #include "core/dom/Element.h" #include "core/dom/Node.h" @@ -50,7 +49,6 @@ #include "core/layout/LayoutPart.h" #include "platform/wtf/PtrUtil.h" #include "public/platform/WebString.h" -#include "public/web/WebAXObject.h" #include "public/web/WebDOMEvent.h" #include "public/web/WebDocument.h" #include "public/web/WebElement.h" @@ -177,14 +175,6 @@ return private_->GetWebPluginContainerBase(); } -WebAXObject WebNode::AccessibilityObject() { - WebDocument web_document = GetDocument(); - const Document* doc = GetDocument().ConstUnwrap<Document>(); - AXObjectCacheBase* cache = ToAXObjectCacheBase(doc->ExistingAXObjectCache()); - Node* node = Unwrap<Node>(); - return cache ? WebAXObject(cache->Get(node)) : WebAXObject(); -} - WebNode::WebNode(Node* node) : private_(node) {} WebNode& WebNode::operator=(Node* node) {
diff --git a/third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp b/third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp index 1176d909..2d68ce9 100644 --- a/third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp +++ b/third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp
@@ -208,10 +208,11 @@ TEST_F(VirtualTimeTest, MAYBE_DOMTimersSuspended) { WebView().Scheduler()->EnableVirtualTime(); - // Schedule a normal DOM timer to run at 1s in the future. + // Schedule normal DOM timers to run at 1s and 1.001s in the future. ExecuteJavaScript( "var run_order = [];" - "setTimeout(() => { run_order.push(1); }, 1000);"); + "setTimeout(() => { run_order.push(1); }, 1000);" + "setTimeout(() => { run_order.push(2); }, 1001);"); RefPtr<WebTaskRunner> runner = TaskRunnerHelper::Get(TaskType::kTimer, Window().GetExecutionContext()); @@ -226,13 +227,13 @@ WTF::Unretained(WebView().Scheduler())), TimeDelta::FromMilliseconds(1000)); - // ALso schedule a second timer for the same point in time. + // ALso schedule a third timer for the same point in time. ExecuteJavaScript("setTimeout(() => { run_order.push(2); }, 1000);"); - // The second DOM timer shouldn't have run because pausing virtual time also - // atomically pauses DOM timers. + // The second DOM timer shouldn't have run because the virtual time budget + // expired. testing::RunPendingTasks(); - EXPECT_EQ("1", ExecuteJavaScript("run_order.join(', ')")); + EXPECT_EQ("1, 2", ExecuteJavaScript("run_order.join(', ')")); } } // namespace blink
diff --git a/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h b/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h index 821f5b5..65b3f5ab 100644 --- a/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h +++ b/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h
@@ -159,14 +159,24 @@ // Must be called from the main thread. virtual bool IsHighPriorityWorkAnticipated() = 0; - // Suspends the timer queue and increments the timer queue suspension count. + // Suspends the timer queues and increments the timer queue suspension count. // May only be called from the main thread. virtual void SuspendTimerQueue() = 0; - // Decrements the timer queue suspension count and re-enables the timer queue + // Decrements the timer queue suspension count and re-enables the timer queues // if the suspension count is zero and the current schduler policy allows it. virtual void ResumeTimerQueue() = 0; + // Suspends the timer queues by inserting a fence that blocks any tasks posted + // after this point from running. Orthogonal to SuspendTimerQueue. Care must + // be taken when using this API to avoid fighting with the TaskQueueThrottler. + virtual void VirtualTimePaused() = 0; + + // Removes the fence added by VirtualTimePaused allowing timers to execute + // normally. Care must be taken when using this API to avoid fighting with the + // TaskQueueThrottler. + virtual void VirtualTimeResumed() = 0; + // Sets whether to allow suspension of timers after the backgrounded signal is // received via OnRendererBackgrounded. Defaults to disabled. virtual void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled) = 0;
diff --git a/third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h b/third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h index 94a84623..52d1fb4b 100644 --- a/third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h +++ b/third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h
@@ -53,6 +53,8 @@ void Shutdown() override; void SuspendTimerQueue() override; void ResumeTimerQueue() override; + void VirtualTimePaused() override; + void VirtualTimeResumed() override; void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled) override; void SetTopLevelBlameContext( base::trace_event::BlameContext* blame_context) override;
diff --git a/third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h b/third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h index b2c57e3..bd997bed 100644 --- a/third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h +++ b/third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h
@@ -57,6 +57,8 @@ MOCK_METHOD0(Shutdown, void()); MOCK_METHOD0(SuspendTimerQueue, void()); MOCK_METHOD0(ResumeTimerQueue, void()); + MOCK_METHOD0(VirtualTimePaused, void()); + MOCK_METHOD0(VirtualTimeResumed, void()); MOCK_METHOD1(SetTimerQueueSuspensionWhenBackgroundedEnabled, void(bool)); MOCK_METHOD1(SetTopLevelBlameContext, void(base::trace_event::BlameContext*)); MOCK_METHOD1(SetRAILModeObserver, void(RAILModeObserver*));
diff --git a/third_party/WebKit/public/web/WebAXObject.h b/third_party/WebKit/public/web/WebAXObject.h index d118585..37d0d43 100644 --- a/third_party/WebKit/public/web/WebAXObject.h +++ b/third_party/WebKit/public/web/WebAXObject.h
@@ -93,6 +93,8 @@ return *this; } + BLINK_EXPORT static WebAXObject FromWebNode(WebNode&); + BLINK_EXPORT void Reset(); BLINK_EXPORT void Assign(const WebAXObject&); BLINK_EXPORT bool Equals(const WebAXObject&) const;
diff --git a/third_party/WebKit/public/web/WebNode.h b/third_party/WebKit/public/web/WebNode.h index 466ede0..a1af179b 100644 --- a/third_party/WebKit/public/web/WebNode.h +++ b/third_party/WebKit/public/web/WebNode.h
@@ -39,7 +39,6 @@ namespace blink { class Node; -class WebAXObject; class WebDocument; class WebElement; class WebElementCollection; @@ -103,7 +102,6 @@ BLINK_EXPORT WebPluginContainer* PluginContainer() const; BLINK_EXPORT bool IsInsideFocusableElementOrARIAWidget() const; - BLINK_EXPORT WebAXObject AccessibilityObject(); template <typename T> T To();
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 16964cc..02af1d3 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -221,6 +221,7 @@ 'Chromium Linux Goma Staging': 'release_bot', 'Chromium Mac Goma Staging': 'release_bot', 'CrWinGomaStaging': 'release_bot_x86_minimal_symbols', + 'Chromium Linux Goma GCE Staging': 'release_bot', }, 'chromium.gpu': {
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index b9e363234..573f1a3 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -14155,8 +14155,8 @@ <int value="1101" label="SVG1DOMUriReference"/> <int value="1102" label="SVG1DOMZoomAndPan"/> <int value="1103" label="V8SVGGraphicsElement_Transform_AttributeGetter"/> - <int value="1104" label="MenuItemElement"/> - <int value="1105" label="MenuItemCloseTag"/> + <int value="1104" label="OBSOLETE_MenuItemElement"/> + <int value="1105" label="OBSOLETE_MenuItemCloseTag"/> <int value="1106" label="SVG1DOMMarkerElement"/> <int value="1107" label="SVG1DOMUseElement"/> <int value="1108" label="SVG1DOMMaskElement"/> @@ -14980,7 +14980,7 @@ <int value="1908" label="OrientationSensorPopulateMatrix"/> <int value="1909" label="WindowOpenWithInvalidURL"/> <int value="1910" label="CrossOriginMainFrameNulledNameAccessed"/> - <int value="1911" label="MenuItemElementIconAttribute"/> + <int value="1911" label="OBSOLETE_MenuItemElementIconAttribute"/> <int value="1912" label="WebkitCSSMatrixSetMatrixValue"/> <int value="1913" label="WebkitCSSMatrixConstructFromString"/> <int value="1914" label="CanRequestURLHTTPContainingNewline"/>
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 d17fadf..5be65cc 100644 --- a/ui/file_manager/file_manager/background/js/background_scripts.js +++ b/ui/file_manager/file_manager/background/js/background_scripts.js
@@ -7,6 +7,7 @@ // <include src="../../common/js/progress_center_common.js"> // <include src="../../common/js/importer_common.js"> // <include src="../../common/js/error_util.js"> +// <include src="metadata_proxy.js"> // <include src="device_handler.js"> // <include src="drive_sync_handler.js"> // <include src="duplicate_finder.js">
diff --git a/ui/file_manager/file_manager/background/js/compiled_resources2.gyp b/ui/file_manager/file_manager/background/js/compiled_resources2.gyp index 4b75042..6ac8743 100644 --- a/ui/file_manager/file_manager/background/js/compiled_resources2.gyp +++ b/ui/file_manager/file_manager/background/js/compiled_resources2.gyp
@@ -125,6 +125,14 @@ '../../../externs/compiled_resources2.gyp:file_operation_progress_event', '../../common/js/compiled_resources2.gyp:async_util', '../../common/js/compiled_resources2.gyp:util', + 'metadata_proxy', + ], + 'includes': ['../../../compile_js2.gypi'], + }, + { + 'target_name': 'metadata_proxy', + 'dependencies': [ + '../../common/js/compiled_resources2.gyp:lru_cache', ], 'includes': ['../../../compile_js2.gypi'], }, @@ -136,6 +144,7 @@ '../../common/js/compiled_resources2.gyp:metrics', '../../common/js/compiled_resources2.gyp:metrics_events', '../../common/js/compiled_resources2.gyp:util', + 'metadata_proxy', ], 'includes': ['../../../compile_js2.gypi'], },
diff --git a/ui/file_manager/file_manager/background/js/duplicate_finder_unittest.html b/ui/file_manager/file_manager/background/js/duplicate_finder_unittest.html index 19e7befb5..dce0ddb 100644 --- a/ui/file_manager/file_manager/background/js/duplicate_finder_unittest.html +++ b/ui/file_manager/file_manager/background/js/duplicate_finder_unittest.html
@@ -22,9 +22,11 @@ <script src="../../common/js/importer_common.js"></script> <script src="../../common/js/progress_center_common.js"></script> + <script src="metadata_proxy.js"></script> <script src="entry_location_impl.js"></script> <script src="test_import_history.js"></script> <script src="mock_volume_manager.js"></script> + <script src="import_history.js"></script> <script src="duplicate_finder.js"></script> <script src="volume_info_impl.js"></script> <script src="volume_info_list_impl.js"></script>
diff --git a/ui/file_manager/file_manager/background/js/file_operation_manager.js b/ui/file_manager/file_manager/background/js/file_operation_manager.js index 8400b96b..f73e384 100644 --- a/ui/file_manager/file_manager/background/js/file_operation_manager.js +++ b/ui/file_manager/file_manager/background/js/file_operation_manager.js
@@ -370,16 +370,18 @@ var group = new AsyncUtil.Group(); for (var i = 0; i < task.entries.length; i++) { group.add(function(entry, callback) { - entry.getMetadata(function(metadata) { - task.entrySize[entry.toURL()] = metadata.size; - task.totalBytes += metadata.size; - callback(); - }, function() { - // Fail to obtain the metadata. Use fake value 1. - task.entrySize[entry.toURL()] = 1; - task.totalBytes += 1; - callback(); - }); + metadataProxy.getEntryMetadata(entry).then( + function(metadata) { + task.entrySize[entry.toURL()] = metadata.size; + task.totalBytes += metadata.size; + callback(); + }, + function() { + // Fail to obtain the metadata. Use fake value 1. + task.entrySize[entry.toURL()] = 1; + task.totalBytes += 1; + callback(); + }); }.bind(this, task.entries[i])); }
diff --git a/ui/file_manager/file_manager/background/js/file_operation_manager_unittest.html b/ui/file_manager/file_manager/background/js/file_operation_manager_unittest.html index 716f9dd..3c04a2d 100644 --- a/ui/file_manager/file_manager/background/js/file_operation_manager_unittest.html +++ b/ui/file_manager/file_manager/background/js/file_operation_manager_unittest.html
@@ -13,7 +13,9 @@ <script src="../../common/js/async_util.js"></script> <script src="../../common/js/unittest_util.js"></script> <script src="../../common/js/util.js"></script> +<script src="../../common/js/lru_cache.js"></script> <script src="../../common/js/mock_entry.js"></script> +<script src="metadata_proxy.js"></script> <script src="file_operation_manager.js"></script> <script src="file_operation_util.js"></script>
diff --git a/ui/file_manager/file_manager/background/js/file_operation_util.js b/ui/file_manager/file_manager/background/js/file_operation_util.js index 4b1ae2a..19ba98c 100644 --- a/ui/file_manager/file_manager/background/js/file_operation_util.js +++ b/ui/file_manager/file_manager/background/js/file_operation_util.js
@@ -152,7 +152,7 @@ onError); } else { // For a file, annotate the file size. - entry.getMetadata(function(metadata) { + metadataProxy.getEntryMetadata(entry).then(function(metadata) { entry.size = metadata.size; --numRunningTasks; maybeInvokeCallback();
diff --git a/ui/file_manager/file_manager/background/js/import_history.js b/ui/file_manager/file_manager/background/js/import_history.js index aba2c16f4..4655877 100644 --- a/ui/file_manager/file_manager/background/js/import_history.js +++ b/ui/file_manager/file_manager/background/js/import_history.js
@@ -1011,3 +1011,37 @@ function(listener) { this.historyResolver_.promise.then(listener); }; + +/** + * @param {!FileEntry} fileEntry + * @return {!Promise<string>} Resolves with a "hashcode" consisting of + * just the last modified time and the file size. + */ +importer.createMetadataHashcode = function(fileEntry) { + return new Promise( + /** + * @param {function()} resolve + * @param {function()} reject + * @this {importer.PersistentImportHistory} + */ + function(resolve, reject) { + metadataProxy.getEntryMetadata(fileEntry).then( + /** + * @param {!Object} metadata + * @return {!Promise<string>} + * @this {importer.PersistentImportHistory} + */ + function(metadata) { + if (!('modificationTime' in metadata)) { + reject('File entry missing "modificationTime" field.'); + } else if (!('size' in metadata)) { + reject('File entry missing "size" field.'); + } else { + var secondsSinceEpoch = importer.toSecondsFromEpoch( + metadata.modificationTime); + resolve(secondsSinceEpoch + '_' + metadata.size); + } + }.bind(this)); + }.bind(this)) + .catch(importer.getLogger().catcher('importer-common-create-hashcode')); +};
diff --git a/ui/file_manager/file_manager/background/js/import_history_unittest.html b/ui/file_manager/file_manager/background/js/import_history_unittest.html index 4926ddf..2e7b6c0 100644 --- a/ui/file_manager/file_manager/background/js/import_history_unittest.html +++ b/ui/file_manager/file_manager/background/js/import_history_unittest.html
@@ -11,6 +11,7 @@ <script src="../../common/js/volume_manager_common.js"></script> <script src="../../common/js/importer_common.js"></script> +<script src="../../common/js/lru_cache.js"></script> <script src="../../common/js/test_importer_common.js"></script> <script src="../../common/js/test_tracker.js"></script> <script src="../../common/js/metrics_base.js"></script> @@ -19,6 +20,7 @@ <script src="../../common/js/unittest_util.js"></script> <script src="../../common/js/util.js"></script> +<script src="metadata_proxy.js"></script> <script src="import_history.js"></script> <script src="import_history_unittest.js"></script>
diff --git a/ui/file_manager/file_manager/background/js/import_history_unittest.js b/ui/file_manager/file_manager/background/js/import_history_unittest.js index 0cde2e4..8d6fdded8 100644 --- a/ui/file_manager/file_manager/background/js/import_history_unittest.js +++ b/ui/file_manager/file_manager/background/js/import_history_unittest.js
@@ -321,6 +321,21 @@ reportPromise(testPromise, callback); } +function testCreateMetadataHashcode(callback) { + var promise = + importer.createMetadataHashcode(testFileEntry).then(function(hashcode) { + // Note that the expression matches at least 4 numbers + // in the last segment, since we hard code the byte + // size in our test file to a four digit size. + // In reality it will vary. + assertEquals( + 0, hashcode.search(/[\-0-9]{9,}_[0-9]{4,}/), + 'Hashcode (' + hashcode + ') does not match next pattern.'); + }); + + reportPromise(promise, callback); +} + /** * Installs stub APIs. */
diff --git a/ui/file_manager/file_manager/background/js/media_scanner.js b/ui/file_manager/file_manager/background/js/media_scanner.js index 9d86300..bb5d1c6 100644 --- a/ui/file_manager/file_manager/background/js/media_scanner.js +++ b/ui/file_manager/file_manager/background/js/media_scanner.js
@@ -454,7 +454,7 @@ * rejected as a dupe. */ importer.DefaultScanResult.prototype.addFileEntry = function(entry) { - return new Promise(entry.getMetadata.bind(entry)).then( + return metadataProxy.getEntryMetadata(entry).then( /** * @param {!Metadata} metadata * @this {importer.DefaultScanResult} @@ -487,7 +487,7 @@ return true; }.bind(this)); - }.bind(this)); + }.bind(this)); }; /**
diff --git a/ui/file_manager/file_manager/background/js/media_scanner_unittest.html b/ui/file_manager/file_manager/background/js/media_scanner_unittest.html index 53b60e73..529c8bc 100644 --- a/ui/file_manager/file_manager/background/js/media_scanner_unittest.html +++ b/ui/file_manager/file_manager/background/js/media_scanner_unittest.html
@@ -14,10 +14,12 @@ <script src="../../common/js/volume_manager_common.js"></script> <script src="../../common/js/file_type.js"></script> <script src="../../common/js/importer_common.js"></script> +<script src="../../common/js/lru_cache.js"></script> <script src="../../common/js/mock_entry.js"></script> <script src="../../common/js/mock_file_system.js"></script> <script src="../../common/js/unittest_util.js"></script> <script src="../../common/js/util.js"></script> +<script src="metadata_proxy.js"></script> <script src="file_operation_util.js"></script> <script src="import_history.js"></script> <script src="media_scanner.js"></script>
diff --git a/ui/file_manager/file_manager/background/js/metadata_proxy.js b/ui/file_manager/file_manager/background/js/metadata_proxy.js new file mode 100644 index 0000000..b664fd2f --- /dev/null +++ b/ui/file_manager/file_manager/background/js/metadata_proxy.js
@@ -0,0 +1,38 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Namespace +var metadataProxy = {}; + +/** + * Maximum number of entries whose metadata can be cached. + * @const {number} + * @private + */ +metadataProxy.MAX_CACHED_METADATA_ = 10000; + +/** + * @private {!LRUCache<!Metadata>} + */ +metadataProxy.cache_ = new LRUCache(metadataProxy.MAX_CACHED_METADATA_); + +/** + * Returns metadata for the given FileEntry. Uses cached metadata if possible. + * + * @param {!FileEntry} entry + * @return {!Promise.<!Metadata>} + */ +metadataProxy.getEntryMetadata = function(entry) { + var entryURL = entry.toURL(); + if (metadataProxy.cache_.hasKey(entryURL)) { + return Promise.resolve(metadataProxy.cache_.get(entryURL)); + } else { + return new Promise(function(resolve, reject) { + entry.getMetadata(function(metadata) { + metadataProxy.cache_.put(entryURL, metadata); + resolve(metadata); + }, reject); + }); + } +};
diff --git a/ui/file_manager/file_manager/common/js/importer_common.js b/ui/file_manager/file_manager/common/js/importer_common.js index d4772e3..a609be1c 100644 --- a/ui/file_manager/file_manager/common/js/importer_common.js +++ b/ui/file_manager/file_manager/common/js/importer_common.js
@@ -643,42 +643,6 @@ }; /** - * @param {!FileEntry} fileEntry - * @return {!Promise<string>} Resolves with a "hashcode" consisting of - * just the last modified time and the file size. - */ -importer.createMetadataHashcode = function(fileEntry) { - var entry = new importer.PromisingFileEntry(fileEntry); - return new Promise( - /** - * @param {function()} resolve - * @param {function()} reject - * @this {importer.PersistentImportHistory} - */ - function(resolve, reject) { - entry.getMetadata() - .then( - /** - * @param {!Object} metadata - * @return {!Promise<string>} - * @this {importer.PersistentImportHistory} - */ - function(metadata) { - if (!('modificationTime' in metadata)) { - reject('File entry missing "modificationTime" field.'); - } else if (!('size' in metadata)) { - reject('File entry missing "size" field.'); - } else { - var secondsSinceEpoch = - importer.toSecondsFromEpoch(metadata.modificationTime); - resolve(secondsSinceEpoch + '_' + metadata.size); - } - }.bind(this)); - }.bind(this)) - .catch(importer.getLogger().catcher('importer-common-create-hashcode')); -}; - -/** * @param {string} date A date string in the form * expected by Date.parse. * @return {string} The number of seconds from epoch to the date...as a string.
diff --git a/ui/file_manager/file_manager/common/js/importer_common_unittest.html b/ui/file_manager/file_manager/common/js/importer_common_unittest.html index 57df3cf..0e83618 100644 --- a/ui/file_manager/file_manager/common/js/importer_common_unittest.html +++ b/ui/file_manager/file_manager/common/js/importer_common_unittest.html
@@ -11,7 +11,9 @@ <script src="../../../../../ui/webui/resources/js/cr/ui/array_data_model.js"></script> <script src="../../../../../ui/webui/resources/js/load_time_data.js"></script> <script src="volume_manager_common.js"></script> + <script src="../../common/js/lru_cache.js"></script> <script src="../../background/js/entry_location_impl.js"></script> + <script src="../../background/js/metadata_proxy.js"></script> <script src="../../background/js/mock_file_operation_manager.js"></script> <script src="../../background/js/mock_volume_manager.js"></script> <script src="../../background/js/mock_media_scanner.js"></script>
diff --git a/ui/file_manager/file_manager/common/js/importer_common_unittest.js b/ui/file_manager/file_manager/common/js/importer_common_unittest.js index d013f19..7d14b8f 100644 --- a/ui/file_manager/file_manager/common/js/importer_common_unittest.js +++ b/ui/file_manager/file_manager/common/js/importer_common_unittest.js
@@ -246,21 +246,6 @@ 'Deflated then inflated URLs must match original URL.'); }; -function testCreateMetadataHashcode(callback) { - var promise = importer.createMetadataHashcode(cameraFileEntry) - .then( - function(hashcode) { - // Note that the expression matches at least 4 numbers - // in the last segment, since we hard code the byte - // size in our test file to a four digit size. - // In reality it will vary. - assertEquals(0, hashcode.search(/[0-9]{9,}_[0-9]{4,}/), - 'Hashcode (' + hashcode + ') does not match next pattern.'); - }); - - reportPromise(promise, callback); -} - function testHasMediaDirectory(callback) { var dir = createDirectoryEntry(sdVolume, '/DCIM'); var promise = importer.hasMediaDirectory(sdVolume.fileSystem.root)
diff --git a/ui/message_center/views/message_list_view.cc b/ui/message_center/views/message_list_view.cc index 164dd00..127f3fd 100644 --- a/ui/message_center/views/message_list_view.cc +++ b/ui/message_center/views/message_list_view.cc
@@ -302,21 +302,36 @@ } void MessageListView::OnBoundsAnimatorDone(views::BoundsAnimator* animator) { + bool need_update = false; + + if (clear_all_started_) { + clear_all_started_ = false; + // TODO(yoshiki): we shouldn't touch views in OnAllNotificationsCleared(). + // Or rename it to like OnAllNotificationsClearing(). + for (auto& observer : observers_) + observer.OnAllNotificationsCleared(); + + // Need to update layout after deleting the views. + if (!deleted_when_done_.empty()) + need_update = true; + } + + // None of these views should be deleted. + DCHECK(std::all_of(deleted_when_done_.begin(), deleted_when_done_.end(), + [this](views::View* view) { return Contains(view); })); + for (auto* view : deleted_when_done_) delete view; deleted_when_done_.clear(); - if (clear_all_started_) { - clear_all_started_ = false; - for (auto& observer : observers_) - observer.OnAllNotificationsCleared(); - } - if (has_deferred_task_) { has_deferred_task_ = false; - DoUpdateIfPossible(); + need_update = true; } + if (need_update) + DoUpdateIfPossible(); + if (GetWidget()) GetWidget()->SynthesizeMouseMoveEvent();