Remove FormControlsRefresh and ColorSchemeUARendering flags and code
Both of these are now fully-launched (in M91) so the flags and associated code are no longer needed. This CL should cause no behavior changes, and the form controls appearance is widely covered by web_tests and a few browser_tests. Bug: 1099951, 1208983 Change-Id: I8d87355e0b86cde9969caee886bf9779c77ad61e Cq-Do-Not-Cancel-Tryjobs: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2895047 Reviewed-by: Joey Arhar <jarhar@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Philip Rogers <pdr@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Bo <boliu@chromium.org> Reviewed-by: Andrey Kosyakov <caseq@chromium.org> Commit-Queue: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/master@{#885605}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
01e5e64e47
commit
972aab37ea
android_webview/java/src/org/chromium/android_webview/common
chrome/browser
about_flags.ccflag-metadata.jsonflag_descriptions.ccflag_descriptions.hfocus_ring_browsertest.ccrenderer_preferences_util.cc
content
app_shim_remote_cocoa
popup_window_mac.hpopup_window_mac.mmrender_widget_host_ns_view_bridge.hrender_widget_host_ns_view_bridge.mm
browser
child
common
headless/lib/browser
testing/variations
third_party/blink
public
renderer
core
css
exported
frame
html
forms
chooser_resource_loader.ccchooser_resource_loader.hcolor_chooser_popup_ui_controller.cccolor_input_type.ccdate_time_chooser_impl.cchtml_input_element.cchtml_select_element.ccinternal_popup_menu.ccmultiple_fields_temporal_input_type_view.ccpicker_indicator_element.cc
resources
calendarPicker.csscalendarPicker.jscalendar_picker_refresh.csscolorSuggestionPicker.csscolorSuggestionPicker.jscolor_picker_common.jsdatetimelocal_picker.jslistPicker.csslistPicker.jsmonth_picker.jspickerButton.csspickerCommon.jssuggestionPicker.csssuggestionPicker.js
select_type.ccslider_thumb_element.cclayout
layout_text_control_single_line_test.cclayout_theme.cclayout_theme_android.cclayout_theme_android.hlayout_theme_default.cclayout_theme_mac.mmlayout_theme_test.ccscrollbars_test.cc
paint
scroll
style
testing
platform
web_tests
FlagExpectations
TestExpectationsVirtualTestSuitesfast
forms
calendar-picker
color-scheme
month-picker
http
tests
forms
virtual
system-color-compute
ui
base
native_theme
views
widget
@ -122,8 +122,6 @@ public final class ProductionSupportedFlagList {
|
|||||||
"Enables the new Java/JS Bridge code path with mojo implementation."),
|
"Enables the new Java/JS Bridge code path with mojo implementation."),
|
||||||
Flag.baseFeature(
|
Flag.baseFeature(
|
||||||
AwFeatures.WEBVIEW_ORIGIN_TRIALS, "Enables Origin Trials support on WebView."),
|
AwFeatures.WEBVIEW_ORIGIN_TRIALS, "Enables Origin Trials support on WebView."),
|
||||||
Flag.baseFeature(UiFeatures.FORM_CONTROLS_REFRESH,
|
|
||||||
"Enables the Form Controls visual improvements and dark mode."),
|
|
||||||
Flag.baseFeature(
|
Flag.baseFeature(
|
||||||
BlinkFeatures.LAYOUT_NG_TABLE, "Enables Blink's next generation table layout."),
|
BlinkFeatures.LAYOUT_NG_TABLE, "Enables Blink's next generation table layout."),
|
||||||
Flag.baseFeature(
|
Flag.baseFeature(
|
||||||
|
@ -5685,17 +5685,6 @@ const FeatureEntry kFeatureEntries[] = {
|
|||||||
FEATURE_VALUE_TYPE(
|
FEATURE_VALUE_TYPE(
|
||||||
policy::features::kPolicyBlocklistThrottleRequiresPoliciesLoaded)},
|
policy::features::kPolicyBlocklistThrottleRequiresPoliciesLoaded)},
|
||||||
|
|
||||||
#if !defined(OS_ANDROID)
|
|
||||||
{"form-controls-dark-mode", flag_descriptions::kFormControlsDarkModeName,
|
|
||||||
flag_descriptions::kFormControlsDarkModeDescription, kOsDesktop,
|
|
||||||
FEATURE_VALUE_TYPE(features::kCSSColorSchemeUARendering)},
|
|
||||||
#endif // !defined(OS_ANDROID)
|
|
||||||
|
|
||||||
{"form-controls-refresh", flag_descriptions::kFormControlsRefreshName,
|
|
||||||
flag_descriptions::kFormControlsRefreshDescription,
|
|
||||||
kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
|
|
||||||
FEATURE_VALUE_TYPE(features::kFormControlsRefresh)},
|
|
||||||
|
|
||||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
{"auto-screen-brightness", flag_descriptions::kAutoScreenBrightnessName,
|
{"auto-screen-brightness", flag_descriptions::kAutoScreenBrightnessName,
|
||||||
flag_descriptions::kAutoScreenBrightnessDescription, kOsCrOS,
|
flag_descriptions::kAutoScreenBrightnessDescription, kOsCrOS,
|
||||||
|
@ -3003,16 +3003,6 @@
|
|||||||
"owners": [ "almaher@microsoft.com" ],
|
"owners": [ "almaher@microsoft.com" ],
|
||||||
"expiry_milestone": 95
|
"expiry_milestone": 95
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "form-controls-dark-mode",
|
|
||||||
"owners": [ "sasebree@microsoft.com", "masonf", "yuzhehan", "//third_party/blink/renderer/core/OWNERS" ],
|
|
||||||
"expiry_milestone": 92
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "form-controls-refresh",
|
|
||||||
"owners": [ "iopopesc@microsoft.com", "masonf", "yuzhehan", "//third_party/blink/renderer/core/OWNERS" ],
|
|
||||||
"expiry_milestone": 92
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "fractional-scroll-offsets",
|
"name": "fractional-scroll-offsets",
|
||||||
"owners": [ "bokan" ],
|
"owners": [ "bokan" ],
|
||||||
|
@ -1280,16 +1280,6 @@ const char kForceUiDirectionDescription[] =
|
|||||||
"Explicitly force the UI to left-to-right (LTR) or right-to-left (RTL) "
|
"Explicitly force the UI to left-to-right (LTR) or right-to-left (RTL) "
|
||||||
"mode, overriding the default direction of the UI language.";
|
"mode, overriding the default direction of the UI language.";
|
||||||
|
|
||||||
const char kFormControlsDarkModeName[] = "Web Platform Controls Dark Mode";
|
|
||||||
const char kFormControlsDarkModeDescription[] =
|
|
||||||
"If enabled, forms controls and scrollbars will be rendered with a dark "
|
|
||||||
"theme, only on web pages that support dark color schemes, and when the "
|
|
||||||
"OS is switched to dark theme.";
|
|
||||||
|
|
||||||
const char kFormControlsRefreshName[] = "Web Platform Controls updated UI";
|
|
||||||
const char kFormControlsRefreshDescription[] =
|
|
||||||
"If enabled, HTML forms elements will be rendered using an updated style.";
|
|
||||||
|
|
||||||
const char kGlobalMediaControlsName[] = "Global Media Controls";
|
const char kGlobalMediaControlsName[] = "Global Media Controls";
|
||||||
const char kGlobalMediaControlsDescription[] =
|
const char kGlobalMediaControlsDescription[] =
|
||||||
"Enables the Global Media Controls UI in the toolbar.";
|
"Enables the Global Media Controls UI in the toolbar.";
|
||||||
|
@ -750,12 +750,6 @@ extern const char kForceDirectionRtl[];
|
|||||||
extern const char kForceUiDirectionName[];
|
extern const char kForceUiDirectionName[];
|
||||||
extern const char kForceUiDirectionDescription[];
|
extern const char kForceUiDirectionDescription[];
|
||||||
|
|
||||||
extern const char kFormControlsDarkModeName[];
|
|
||||||
extern const char kFormControlsDarkModeDescription[];
|
|
||||||
|
|
||||||
extern const char kFormControlsRefreshName[];
|
|
||||||
extern const char kFormControlsRefreshDescription[];
|
|
||||||
|
|
||||||
extern const char kGlobalMediaControlsName[];
|
extern const char kGlobalMediaControlsName[];
|
||||||
extern const char kGlobalMediaControlsDescription[];
|
extern const char kGlobalMediaControlsDescription[];
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include "base/files/file_util.h"
|
#include "base/files/file_util.h"
|
||||||
#include "base/path_service.h"
|
#include "base/path_service.h"
|
||||||
#include "base/test/scoped_feature_list.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
#include "build/chromeos_buildflags.h"
|
||||||
#include "cc/test/pixel_comparator.h"
|
#include "cc/test/pixel_comparator.h"
|
||||||
@ -55,12 +54,6 @@ const cc::FuzzyPixelComparator mac_loose_comparator(
|
|||||||
|
|
||||||
class FocusRingBrowserTest : public InProcessBrowserTest {
|
class FocusRingBrowserTest : public InProcessBrowserTest {
|
||||||
public:
|
public:
|
||||||
FocusRingBrowserTest() {
|
|
||||||
feature_list_.InitWithFeatures(
|
|
||||||
{features::kFormControlsRefresh, features::kCSSColorSchemeUARendering},
|
|
||||||
{});
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
EnablePixelOutput(/*force_device_scale_factor=*/1.f);
|
EnablePixelOutput(/*force_device_scale_factor=*/1.f);
|
||||||
InProcessBrowserTest::SetUp();
|
InProcessBrowserTest::SetUp();
|
||||||
@ -84,9 +77,6 @@ class FocusRingBrowserTest : public InProcessBrowserTest {
|
|||||||
const cc::PixelComparator& comparator) {
|
const cc::PixelComparator& comparator) {
|
||||||
base::ScopedAllowBlockingForTesting allow_blocking;
|
base::ScopedAllowBlockingForTesting allow_blocking;
|
||||||
|
|
||||||
ASSERT_TRUE(features::IsFormControlsRefreshEnabled());
|
|
||||||
ASSERT_TRUE(features::IsCSSColorSchemeUARenderingEnabled());
|
|
||||||
|
|
||||||
base::FilePath dir_test_data;
|
base::FilePath dir_test_data;
|
||||||
ASSERT_TRUE(base::PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data));
|
ASSERT_TRUE(base::PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data));
|
||||||
|
|
||||||
@ -119,9 +109,6 @@ class FocusRingBrowserTest : public InProcessBrowserTest {
|
|||||||
web_contents, golden_filepath,
|
web_contents, golden_filepath,
|
||||||
gfx::Size(screenshot_width, screenshot_height), comparator));
|
gfx::Size(screenshot_width, screenshot_height), comparator));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
base::test::ScopedFeatureList feature_list_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IN_PROC_BROWSER_TEST_F(FocusRingBrowserTest, Checkbox) {
|
IN_PROC_BROWSER_TEST_F(FocusRingBrowserTest, Checkbox) {
|
||||||
|
@ -208,13 +208,11 @@ void UpdateFromSystemSettings(blink::RendererPreferences* prefs,
|
|||||||
ConvertExplicitlyAllowedNetworkPortsPref(local_state);
|
ConvertExplicitlyAllowedNetworkPortsPref(local_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (::features::IsFormControlsRefreshEnabled()) {
|
|
||||||
#if defined(OS_MAC)
|
#if defined(OS_MAC)
|
||||||
prefs->focus_ring_color = SkColorSetRGB(0x00, 0x5F, 0xCC);
|
prefs->focus_ring_color = SkColorSetRGB(0x00, 0x5F, 0xCC);
|
||||||
#else
|
#else
|
||||||
prefs->focus_ring_color = SkColorSetRGB(0x10, 0x10, 0x10);
|
prefs->focus_ring_color = SkColorSetRGB(0x10, 0x10, 0x10);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace renderer_preferences_util
|
} // namespace renderer_preferences_util
|
||||||
|
@ -21,7 +21,6 @@ namespace remote_cocoa {
|
|||||||
class PopupWindowMac {
|
class PopupWindowMac {
|
||||||
public:
|
public:
|
||||||
PopupWindowMac(const gfx::Rect& content_rect,
|
PopupWindowMac(const gfx::Rect& content_rect,
|
||||||
bool has_shadow,
|
|
||||||
RenderWidgetHostViewCocoa* cocoa_view);
|
RenderWidgetHostViewCocoa* cocoa_view);
|
||||||
~PopupWindowMac();
|
~PopupWindowMac();
|
||||||
|
|
||||||
|
@ -88,7 +88,6 @@
|
|||||||
namespace remote_cocoa {
|
namespace remote_cocoa {
|
||||||
|
|
||||||
PopupWindowMac::PopupWindowMac(const gfx::Rect& content_rect,
|
PopupWindowMac::PopupWindowMac(const gfx::Rect& content_rect,
|
||||||
bool has_shadow,
|
|
||||||
RenderWidgetHostViewCocoa* cocoa_view)
|
RenderWidgetHostViewCocoa* cocoa_view)
|
||||||
: cocoa_view_(cocoa_view) {
|
: cocoa_view_(cocoa_view) {
|
||||||
[cocoa_view_ setCloseOnDeactivate:YES];
|
[cocoa_view_ setCloseOnDeactivate:YES];
|
||||||
@ -99,7 +98,7 @@ PopupWindowMac::PopupWindowMac(const gfx::Rect& content_rect,
|
|||||||
styleMask:NSBorderlessWindowMask
|
styleMask:NSBorderlessWindowMask
|
||||||
backing:NSBackingStoreBuffered
|
backing:NSBackingStoreBuffered
|
||||||
defer:NO]);
|
defer:NO]);
|
||||||
[popup_window_ setHasShadow:has_shadow];
|
[popup_window_ setHasShadow:YES];
|
||||||
[popup_window_ setLevel:NSPopUpMenuWindowLevel];
|
[popup_window_ setLevel:NSPopUpMenuWindowLevel];
|
||||||
[popup_window_ setReleasedWhenClosed:NO];
|
[popup_window_ setReleasedWhenClosed:NO];
|
||||||
[popup_window_ makeKeyAndOrderFront:nil];
|
[popup_window_ makeKeyAndOrderFront:nil];
|
||||||
|
@ -43,7 +43,7 @@ class RenderWidgetHostNSViewBridge : public mojom::RenderWidgetHostNSView,
|
|||||||
RenderWidgetHostViewCocoa* GetNSView();
|
RenderWidgetHostViewCocoa* GetNSView();
|
||||||
|
|
||||||
// mojom::RenderWidgetHostNSView implementation.
|
// mojom::RenderWidgetHostNSView implementation.
|
||||||
void InitAsPopup(const gfx::Rect& content_rect, bool has_shadow) override;
|
void InitAsPopup(const gfx::Rect& content_rect) override;
|
||||||
void SetParentWebContentsNSView(uint64_t parent_ns_view_id) override;
|
void SetParentWebContentsNSView(uint64_t parent_ns_view_id) override;
|
||||||
void DisableDisplay() override;
|
void DisableDisplay() override;
|
||||||
void MakeFirstResponder() override;
|
void MakeFirstResponder() override;
|
||||||
|
@ -61,10 +61,8 @@ RenderWidgetHostViewCocoa* RenderWidgetHostNSViewBridge::GetNSView() {
|
|||||||
return cocoa_view_;
|
return cocoa_view_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderWidgetHostNSViewBridge::InitAsPopup(const gfx::Rect& content_rect,
|
void RenderWidgetHostNSViewBridge::InitAsPopup(const gfx::Rect& content_rect) {
|
||||||
bool has_shadow) {
|
popup_window_ = std::make_unique<PopupWindowMac>(content_rect, cocoa_view_);
|
||||||
popup_window_ =
|
|
||||||
std::make_unique<PopupWindowMac>(content_rect, has_shadow, cocoa_view_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderWidgetHostNSViewBridge::SetParentWebContentsNSView(
|
void RenderWidgetHostNSViewBridge::SetParentWebContentsNSView(
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include "base/files/file_util.h"
|
#include "base/files/file_util.h"
|
||||||
#include "base/path_service.h"
|
#include "base/path_service.h"
|
||||||
#include "base/test/scoped_feature_list.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
#include "build/chromeos_buildflags.h"
|
||||||
#include "cc/test/pixel_comparator.h"
|
#include "cc/test/pixel_comparator.h"
|
||||||
@ -44,12 +43,6 @@ namespace content {
|
|||||||
|
|
||||||
class FormControlsBrowserTest : public ContentBrowserTest {
|
class FormControlsBrowserTest : public ContentBrowserTest {
|
||||||
public:
|
public:
|
||||||
FormControlsBrowserTest() {
|
|
||||||
feature_list_.InitWithFeatures(
|
|
||||||
{features::kFormControlsRefresh, features::kCSSColorSchemeUARendering},
|
|
||||||
{});
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
EnablePixelOutput(/*force_device_scale_factor=*/1.f);
|
EnablePixelOutput(/*force_device_scale_factor=*/1.f);
|
||||||
ContentBrowserTest::SetUp();
|
ContentBrowserTest::SetUp();
|
||||||
@ -72,9 +65,6 @@ class FormControlsBrowserTest : public ContentBrowserTest {
|
|||||||
int screenshot_height) {
|
int screenshot_height) {
|
||||||
base::ScopedAllowBlockingForTesting allow_blocking;
|
base::ScopedAllowBlockingForTesting allow_blocking;
|
||||||
|
|
||||||
ASSERT_TRUE(features::IsFormControlsRefreshEnabled());
|
|
||||||
ASSERT_TRUE(features::IsCSSColorSchemeUARenderingEnabled());
|
|
||||||
|
|
||||||
std::string platform_suffix;
|
std::string platform_suffix;
|
||||||
#if defined(OS_MAC)
|
#if defined(OS_MAC)
|
||||||
platform_suffix = "_mac";
|
platform_suffix = "_mac";
|
||||||
@ -163,9 +153,6 @@ class FormControlsBrowserTest : public ContentBrowserTest {
|
|||||||
#endif // defined(OS_WIN)
|
#endif // defined(OS_WIN)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
base::test::ScopedFeatureList feature_list_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Checkbox) {
|
IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Checkbox) {
|
||||||
|
@ -384,10 +384,7 @@ void RenderWidgetHostViewMac::InitAsPopup(
|
|||||||
SetContentBackgroundColor(SK_ColorTRANSPARENT);
|
SetContentBackgroundColor(SK_ColorTRANSPARENT);
|
||||||
|
|
||||||
// This path is used by the time/date picker.
|
// This path is used by the time/date picker.
|
||||||
// When FormControlsRefresh is enabled the popup window should use
|
ns_view_->InitAsPopup(pos);
|
||||||
// the native shadow.
|
|
||||||
bool has_shadow = features::IsFormControlsRefreshEnabled();
|
|
||||||
ns_view_->InitAsPopup(pos, has_shadow);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderWidgetHostViewBase*
|
RenderWidgetHostViewBase*
|
||||||
|
@ -130,14 +130,6 @@ void SetRuntimeFeatureDefaultsForPlatform(
|
|||||||
WebRuntimeFeatures::EnableMediaControlsExpandGesture(
|
WebRuntimeFeatures::EnableMediaControlsExpandGesture(
|
||||||
base::FeatureList::IsEnabled(media::kMediaControlsExpandGesture));
|
base::FeatureList::IsEnabled(media::kMediaControlsExpandGesture));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_ANDROID)
|
|
||||||
WebRuntimeFeatures::EnableCSSColorSchemeUARendering(
|
|
||||||
// Combining form-controls-refresh and form-controls-dark-mode
|
|
||||||
// to be launched together on Android. Only one about flags
|
|
||||||
// for both features.
|
|
||||||
base::FeatureList::IsEnabled(features::kFormControlsRefresh));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum RuntimeFeatureEnableOptions {
|
enum RuntimeFeatureEnableOptions {
|
||||||
@ -357,7 +349,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
|
|||||||
{"CompositeAfterPaint", blink::features::kCompositeAfterPaint},
|
{"CompositeAfterPaint", blink::features::kCompositeAfterPaint},
|
||||||
{"ComputePressure", blink::features::kComputePressure,
|
{"ComputePressure", blink::features::kComputePressure,
|
||||||
kSetOnlyIfOverridden},
|
kSetOnlyIfOverridden},
|
||||||
{"CSSColorSchemeUARendering", features::kCSSColorSchemeUARendering},
|
|
||||||
{"DeclarativeShadowDOM", blink::features::kDeclarativeShadowDOM},
|
{"DeclarativeShadowDOM", blink::features::kDeclarativeShadowDOM},
|
||||||
{"DocumentTransition", blink::features::kDocumentTransition},
|
{"DocumentTransition", blink::features::kDocumentTransition},
|
||||||
{"FeaturePolicyForClientHints",
|
{"FeaturePolicyForClientHints",
|
||||||
|
@ -23,7 +23,7 @@ import "ui/gfx/range/mojom/range.mojom";
|
|||||||
interface RenderWidgetHostNSView {
|
interface RenderWidgetHostNSView {
|
||||||
// Specify that the NSView will a popup (e.g, date/time picker) that will
|
// Specify that the NSView will a popup (e.g, date/time picker) that will
|
||||||
// create its own NSWindow.
|
// create its own NSWindow.
|
||||||
InitAsPopup(gfx.mojom.Rect content_rect, bool has_shadow);
|
InitAsPopup(gfx.mojom.Rect content_rect);
|
||||||
|
|
||||||
// Set this to be a child NSView of the NSView mapped to by
|
// Set this to be a child NSView of the NSView mapped to by
|
||||||
// |parent_ns_view_id|.
|
// |parent_ns_view_id|.
|
||||||
|
@ -65,16 +65,11 @@ void UpdatePrefsFromSystemSettings(blink::RendererPreferences* prefs) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The values were copied from chrome/browser/renderer_preferences_util.cc.
|
// The values were copied from chrome/browser/renderer_preferences_util.cc.
|
||||||
#if defined(USE_AURA)
|
|
||||||
prefs->focus_ring_color = SkColorSetRGB(0x4D, 0x90, 0xFE);
|
|
||||||
#endif
|
|
||||||
if (::features::IsFormControlsRefreshEnabled()) {
|
|
||||||
#if defined(OS_MAC)
|
#if defined(OS_MAC)
|
||||||
prefs->focus_ring_color = SkColorSetRGB(0x00, 0x5F, 0xCC);
|
prefs->focus_ring_color = SkColorSetRGB(0x00, 0x5F, 0xCC);
|
||||||
#else
|
#else
|
||||||
prefs->focus_ring_color = SkColorSetRGB(0x10, 0x10, 0x10);
|
prefs->focus_ring_color = SkColorSetRGB(0x10, 0x10, 0x10);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -3613,41 +3613,6 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"FormControlsDarkMode": [
|
|
||||||
{
|
|
||||||
"platforms": [
|
|
||||||
"chromeos",
|
|
||||||
"chromeos_lacros",
|
|
||||||
"linux",
|
|
||||||
"mac",
|
|
||||||
"windows"
|
|
||||||
],
|
|
||||||
"experiments": [
|
|
||||||
{
|
|
||||||
"name": "Enabled",
|
|
||||||
"enable_features": [
|
|
||||||
"CSSColorSchemeUARendering"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"FormControlsRefreshAndroid": [
|
|
||||||
{
|
|
||||||
"platforms": [
|
|
||||||
"android",
|
|
||||||
"android_webview"
|
|
||||||
],
|
|
||||||
"experiments": [
|
|
||||||
{
|
|
||||||
"name": "Enabled",
|
|
||||||
"enable_features": [
|
|
||||||
"FormControlsRefresh"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"FuzzyAppSearch": [
|
"FuzzyAppSearch": [
|
||||||
{
|
{
|
||||||
"platforms": [
|
"platforms": [
|
||||||
|
1
third_party/blink/public/blink_resources.grd
vendored
1
third_party/blink/public/blink_resources.grd
vendored
@ -47,7 +47,6 @@
|
|||||||
<include name="IDR_TIME_PICKER_CSS" file="../renderer/core/html/forms/resources/time_picker.css" type="BINDATA" compress="gzip"/>
|
<include name="IDR_TIME_PICKER_CSS" file="../renderer/core/html/forms/resources/time_picker.css" type="BINDATA" compress="gzip"/>
|
||||||
<include name="IDR_TIME_PICKER_JS" file="../renderer/core/html/forms/resources/time_picker.js" type="BINDATA" compress="gzip"/>
|
<include name="IDR_TIME_PICKER_JS" file="../renderer/core/html/forms/resources/time_picker.js" type="BINDATA" compress="gzip"/>
|
||||||
<include name="IDR_DATETIMELOCAL_PICKER_JS" file="../renderer/core/html/forms/resources/datetimelocal_picker.js" type="BINDATA" compress="gzip"/>
|
<include name="IDR_DATETIMELOCAL_PICKER_JS" file="../renderer/core/html/forms/resources/datetimelocal_picker.js" type="BINDATA" compress="gzip"/>
|
||||||
<include name="IDR_PICKER_BUTTON_CSS" file="../renderer/core/html/forms/resources/pickerButton.css" type="BINDATA" compress="gzip"/>
|
|
||||||
<include name="IDR_SUGGESTION_PICKER_CSS" file="../renderer/core/html/forms/resources/suggestionPicker.css" type="BINDATA" compress="gzip"/>
|
<include name="IDR_SUGGESTION_PICKER_CSS" file="../renderer/core/html/forms/resources/suggestionPicker.css" type="BINDATA" compress="gzip"/>
|
||||||
<include name="IDR_SUGGESTION_PICKER_JS" file="../renderer/core/html/forms/resources/suggestionPicker.js" type="BINDATA" compress="gzip"/>
|
<include name="IDR_SUGGESTION_PICKER_JS" file="../renderer/core/html/forms/resources/suggestionPicker.js" type="BINDATA" compress="gzip"/>
|
||||||
<include name="IDR_COLOR_PICKER_COMMON_JS" file="../renderer/core/html/forms/resources/color_picker_common.js" type="BINDATA" compress="gzip"/>
|
<include name="IDR_COLOR_PICKER_COMMON_JS" file="../renderer/core/html/forms/resources/color_picker_common.js" type="BINDATA" compress="gzip"/>
|
||||||
|
@ -243,7 +243,6 @@ class WebRuntimeFeatures {
|
|||||||
|
|
||||||
BLINK_PLATFORM_EXPORT static void EnableParseUrlProtocolHandler(bool);
|
BLINK_PLATFORM_EXPORT static void EnableParseUrlProtocolHandler(bool);
|
||||||
|
|
||||||
BLINK_PLATFORM_EXPORT static void EnableCSSColorSchemeUARendering(bool);
|
|
||||||
BLINK_PLATFORM_EXPORT static void EnableDocumentTransition(bool);
|
BLINK_PLATFORM_EXPORT static void EnableDocumentTransition(bool);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -2426,8 +2426,6 @@ TEST_F(StyleEngineTest, ColorSchemeBaseBackgroundChange) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(StyleEngineTest, ColorSchemeOverride) {
|
TEST_F(StyleEngineTest, ColorSchemeOverride) {
|
||||||
ScopedCSSColorSchemeUARenderingForTest enable_color_scheme_ua(true);
|
|
||||||
|
|
||||||
ColorSchemeHelper color_scheme_helper(GetDocument());
|
ColorSchemeHelper color_scheme_helper(GetDocument());
|
||||||
color_scheme_helper.SetPreferredColorScheme(
|
color_scheme_helper.SetPreferredColorScheme(
|
||||||
mojom::blink::PreferredColorScheme::kLight);
|
mojom::blink::PreferredColorScheme::kLight);
|
||||||
|
@ -3170,8 +3170,7 @@ void WebViewImpl::UpdateRendererPreferences(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (::features::IsFormControlsRefreshEnabled() &&
|
if (renderer_preferences_.use_custom_colors) {
|
||||||
renderer_preferences_.use_custom_colors) {
|
|
||||||
SetFocusRingColor(renderer_preferences_.focus_ring_color);
|
SetFocusRingColor(renderer_preferences_.focus_ring_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2799,8 +2799,6 @@ TEST_P(VisualViewportTest, InSubtreeOfPageScale) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(VisualViewportSimTest, UsedColorSchemeFromRootElement) {
|
TEST_F(VisualViewportSimTest, UsedColorSchemeFromRootElement) {
|
||||||
ScopedCSSColorSchemeUARenderingForTest color_scheme_ua_enabled(true);
|
|
||||||
|
|
||||||
ColorSchemeHelper color_scheme_helper(*(WebView().GetPage()));
|
ColorSchemeHelper color_scheme_helper(*(WebView().GetPage()));
|
||||||
color_scheme_helper.SetPreferredColorScheme(
|
color_scheme_helper.SetPreferredColorScheme(
|
||||||
mojom::blink::PreferredColorScheme::kDark);
|
mojom::blink::PreferredColorScheme::kDark);
|
||||||
|
@ -29,15 +29,6 @@ Vector<char> ChooserResourceLoader::GetSuggestionPickerJS() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<char> ChooserResourceLoader::GetPickerButtonStyleSheet() {
|
|
||||||
#if !defined(OS_ANDROID)
|
|
||||||
return UncompressResourceAsBinary(IDR_PICKER_BUTTON_CSS);
|
|
||||||
#else
|
|
||||||
NOTREACHED();
|
|
||||||
return Vector<char>();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector<char> ChooserResourceLoader::GetPickerCommonStyleSheet() {
|
Vector<char> ChooserResourceLoader::GetPickerCommonStyleSheet() {
|
||||||
#if !defined(OS_ANDROID)
|
#if !defined(OS_ANDROID)
|
||||||
return UncompressResourceAsBinary(IDR_PICKER_COMMON_CSS);
|
return UncompressResourceAsBinary(IDR_PICKER_COMMON_CSS);
|
||||||
|
@ -20,9 +20,6 @@ class ChooserResourceLoader {
|
|||||||
// Returns the picker common javascript as a string.
|
// Returns the picker common javascript as a string.
|
||||||
static Vector<char> GetPickerCommonJS();
|
static Vector<char> GetPickerCommonJS();
|
||||||
|
|
||||||
// Returns the picker button stylesheet as a string.
|
|
||||||
static Vector<char> GetPickerButtonStyleSheet();
|
|
||||||
|
|
||||||
// Returns the suggestion picker stylesheet as a string.
|
// Returns the suggestion picker stylesheet as a string.
|
||||||
static Vector<char> GetSuggestionPickerStyleSheet();
|
static Vector<char> GetSuggestionPickerStyleSheet();
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ namespace blink {
|
|||||||
|
|
||||||
// Keep in sync with Actions in colorSuggestionPicker.js.
|
// Keep in sync with Actions in colorSuggestionPicker.js.
|
||||||
enum ColorPickerPopupAction {
|
enum ColorPickerPopupAction {
|
||||||
kColorPickerPopupActionChooseOtherColor = -2,
|
|
||||||
kColorPickerPopupActionCancel = -1,
|
kColorPickerPopupActionCancel = -1,
|
||||||
kColorPickerPopupActionSetValue = 0
|
kColorPickerPopupActionSetValue = 0
|
||||||
};
|
};
|
||||||
@ -70,11 +69,7 @@ void ColorChooserPopupUIController::Trace(Visitor* visitor) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ColorChooserPopupUIController::OpenUI() {
|
void ColorChooserPopupUIController::OpenUI() {
|
||||||
if (client_->ShouldShowSuggestions() ||
|
OpenPopup();
|
||||||
features::IsFormControlsRefreshEnabled())
|
|
||||||
OpenPopup();
|
|
||||||
else
|
|
||||||
OpenColorChooser();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorChooserPopupUIController::EndChooser() {
|
void ColorChooserPopupUIController::EndChooser() {
|
||||||
@ -96,8 +91,6 @@ void ColorChooserPopupUIController::WriteDocument(SharedBuffer* data) {
|
|||||||
|
|
||||||
void ColorChooserPopupUIController::WriteColorPickerDocument(
|
void ColorChooserPopupUIController::WriteColorPickerDocument(
|
||||||
SharedBuffer* data) {
|
SharedBuffer* data) {
|
||||||
DCHECK(features::IsFormControlsRefreshEnabled());
|
|
||||||
|
|
||||||
IntRect anchor_rect_in_screen = chrome_client_->ViewportToScreen(
|
IntRect anchor_rect_in_screen = chrome_client_->ViewportToScreen(
|
||||||
client_->ElementRectRelativeToViewport(), frame_->View());
|
client_->ElementRectRelativeToViewport(), frame_->View());
|
||||||
|
|
||||||
@ -119,8 +112,7 @@ void ColorChooserPopupUIController::WriteColorPickerDocument(
|
|||||||
AddProperty("shouldShowColorSuggestionPicker", false, data);
|
AddProperty("shouldShowColorSuggestionPicker", false, data);
|
||||||
AddProperty("isEyeDropperEnabled", features::IsEyeDropperEnabled(), data);
|
AddProperty("isEyeDropperEnabled", features::IsEyeDropperEnabled(), data);
|
||||||
#if defined(OS_MAC)
|
#if defined(OS_MAC)
|
||||||
AddProperty("isBorderTransparent", features::IsFormControlsRefreshEnabled(),
|
AddProperty("isBorderTransparent", true, data);
|
||||||
data);
|
|
||||||
#endif
|
#endif
|
||||||
// We don't create PagePopups on Android, so these strings are excluded
|
// We don't create PagePopups on Android, so these strings are excluded
|
||||||
// from blink_strings.grd on Android to save binary size. We have to
|
// from blink_strings.grd on Android to save binary size. We have to
|
||||||
@ -169,8 +161,7 @@ void ColorChooserPopupUIController::WriteColorSuggestionPickerDocument(
|
|||||||
data);
|
data);
|
||||||
data->Append(ChooserResourceLoader::GetPickerCommonStyleSheet());
|
data->Append(ChooserResourceLoader::GetPickerCommonStyleSheet());
|
||||||
data->Append(ChooserResourceLoader::GetColorSuggestionPickerStyleSheet());
|
data->Append(ChooserResourceLoader::GetColorSuggestionPickerStyleSheet());
|
||||||
if (features::IsFormControlsRefreshEnabled())
|
data->Append(ChooserResourceLoader::GetColorPickerStyleSheet());
|
||||||
data->Append(ChooserResourceLoader::GetColorPickerStyleSheet());
|
|
||||||
PagePopupClient::AddString(
|
PagePopupClient::AddString(
|
||||||
"</style></head><body>\n"
|
"</style></head><body>\n"
|
||||||
"<div id='main'>Loading...</div><script>\n"
|
"<div id='main'>Loading...</div><script>\n"
|
||||||
@ -179,25 +170,19 @@ void ColorChooserPopupUIController::WriteColorSuggestionPickerDocument(
|
|||||||
PagePopupClient::AddProperty("values", suggestion_values, data);
|
PagePopupClient::AddProperty("values", suggestion_values, data);
|
||||||
PagePopupClient::AddLocalizedProperty("otherColorLabel",
|
PagePopupClient::AddLocalizedProperty("otherColorLabel",
|
||||||
IDS_FORM_OTHER_COLOR_LABEL, data);
|
IDS_FORM_OTHER_COLOR_LABEL, data);
|
||||||
if (features::IsFormControlsRefreshEnabled()) {
|
PagePopupClient::AddProperty("selectedColor",
|
||||||
PagePopupClient::AddProperty("selectedColor",
|
client_->CurrentColor().Serialized(), data);
|
||||||
client_->CurrentColor().Serialized(), data);
|
|
||||||
}
|
|
||||||
AddProperty("anchorRectInScreen", anchor_rect_in_screen, data);
|
AddProperty("anchorRectInScreen", anchor_rect_in_screen, data);
|
||||||
AddProperty("zoomFactor", ScaledZoomFactor(), data);
|
AddProperty("zoomFactor", ScaledZoomFactor(), data);
|
||||||
AddProperty("shouldShowColorSuggestionPicker", true, data);
|
AddProperty("shouldShowColorSuggestionPicker", true, data);
|
||||||
AddProperty("isFormControlsRefreshEnabled",
|
|
||||||
features::IsFormControlsRefreshEnabled(), data);
|
|
||||||
AddProperty("isEyeDropperEnabled", features::IsEyeDropperEnabled(), data);
|
AddProperty("isEyeDropperEnabled", features::IsEyeDropperEnabled(), data);
|
||||||
#if defined(OS_MAC)
|
#if defined(OS_MAC)
|
||||||
AddProperty("isBorderTransparent", features::IsFormControlsRefreshEnabled(),
|
AddProperty("isBorderTransparent", true, data);
|
||||||
data);
|
|
||||||
#endif
|
#endif
|
||||||
PagePopupClient::AddString("};\n", data);
|
PagePopupClient::AddString("};\n", data);
|
||||||
data->Append(ChooserResourceLoader::GetPickerCommonJS());
|
data->Append(ChooserResourceLoader::GetPickerCommonJS());
|
||||||
data->Append(ChooserResourceLoader::GetColorSuggestionPickerJS());
|
data->Append(ChooserResourceLoader::GetColorSuggestionPickerJS());
|
||||||
if (features::IsFormControlsRefreshEnabled())
|
data->Append(ChooserResourceLoader::GetColorPickerJS());
|
||||||
data->Append(ChooserResourceLoader::GetColorPickerJS());
|
|
||||||
data->Append(ChooserResourceLoader::GetColorPickerCommonJS());
|
data->Append(ChooserResourceLoader::GetColorPickerCommonJS());
|
||||||
PagePopupClient::AddString("</script></body>\n", data);
|
PagePopupClient::AddString("</script></body>\n", data);
|
||||||
}
|
}
|
||||||
@ -213,10 +198,6 @@ void ColorChooserPopupUIController::SetValueAndClosePopup(
|
|||||||
DCHECK(client_);
|
DCHECK(client_);
|
||||||
if (num_value == kColorPickerPopupActionSetValue)
|
if (num_value == kColorPickerPopupActionSetValue)
|
||||||
SetValue(string_value);
|
SetValue(string_value);
|
||||||
if (num_value == kColorPickerPopupActionChooseOtherColor) {
|
|
||||||
DCHECK(!features::IsFormControlsRefreshEnabled());
|
|
||||||
OpenColorChooser();
|
|
||||||
}
|
|
||||||
CancelPopup();
|
CancelPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,8 +160,7 @@ void ColorInputType::HandleDOMActivateEvent(Event& event) {
|
|||||||
: WebFeature::kColorInputTypeChooserByUntrustedClick);
|
: WebFeature::kColorInputTypeChooserByUntrustedClick);
|
||||||
chooser_ = chrome_client->OpenColorChooser(document.GetFrame(), this,
|
chooser_ = chrome_client->OpenColorChooser(document.GetFrame(), this,
|
||||||
ValueAsColor());
|
ValueAsColor());
|
||||||
if (::features::IsFormControlsRefreshEnabled() &&
|
if (GetElement().GetLayoutObject()) {
|
||||||
GetElement().GetLayoutObject()) {
|
|
||||||
// Invalidate paint to ensure that the focus ring is removed.
|
// Invalidate paint to ensure that the focus ring is removed.
|
||||||
GetElement().GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
GetElement().GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
||||||
}
|
}
|
||||||
@ -213,8 +212,7 @@ void ColorInputType::DidChooseColor(const Color& color) {
|
|||||||
void ColorInputType::DidEndChooser() {
|
void ColorInputType::DidEndChooser() {
|
||||||
GetElement().EnqueueChangeEvent();
|
GetElement().EnqueueChangeEvent();
|
||||||
chooser_.Clear();
|
chooser_.Clear();
|
||||||
if (::features::IsFormControlsRefreshEnabled() &&
|
if (GetElement().GetLayoutObject()) {
|
||||||
GetElement().GetLayoutObject()) {
|
|
||||||
// Invalidate paint to ensure that the focus ring is shown.
|
// Invalidate paint to ensure that the focus ring is shown.
|
||||||
GetElement().GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
GetElement().GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
||||||
}
|
}
|
||||||
|
@ -129,16 +129,12 @@ void DateTimeChooserImpl::WriteDocument(SharedBuffer* data) {
|
|||||||
data);
|
data);
|
||||||
|
|
||||||
data->Append(ChooserResourceLoader::GetPickerCommonStyleSheet());
|
data->Append(ChooserResourceLoader::GetPickerCommonStyleSheet());
|
||||||
if (!features::IsFormControlsRefreshEnabled())
|
|
||||||
data->Append(ChooserResourceLoader::GetPickerButtonStyleSheet());
|
|
||||||
data->Append(ChooserResourceLoader::GetSuggestionPickerStyleSheet());
|
data->Append(ChooserResourceLoader::GetSuggestionPickerStyleSheet());
|
||||||
data->Append(ChooserResourceLoader::GetCalendarPickerStyleSheet());
|
data->Append(ChooserResourceLoader::GetCalendarPickerStyleSheet());
|
||||||
if (features::IsFormControlsRefreshEnabled()) {
|
data->Append(ChooserResourceLoader::GetCalendarPickerRefreshStyleSheet());
|
||||||
data->Append(ChooserResourceLoader::GetCalendarPickerRefreshStyleSheet());
|
if (parameters_->type == input_type_names::kTime ||
|
||||||
if (parameters_->type == input_type_names::kTime ||
|
parameters_->type == input_type_names::kDatetimeLocal) {
|
||||||
parameters_->type == input_type_names::kDatetimeLocal) {
|
data->Append(ChooserResourceLoader::GetTimePickerStyleSheet());
|
||||||
data->Append(ChooserResourceLoader::GetTimePickerStyleSheet());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
AddString(
|
AddString(
|
||||||
"</style></head><body><div id=main>Loading...</div><script>\n"
|
"</style></head><body><div id=main>Loading...</div><script>\n"
|
||||||
@ -182,11 +178,8 @@ void DateTimeChooserImpl::WriteDocument(SharedBuffer* data) {
|
|||||||
AddProperty("ampmLabels", locale_->TimeAMPMLabels(), data);
|
AddProperty("ampmLabels", locale_->TimeAMPMLabels(), data);
|
||||||
AddProperty("isLocaleRTL", locale_->IsRTL(), data);
|
AddProperty("isLocaleRTL", locale_->IsRTL(), data);
|
||||||
AddProperty("isRTL", parameters_->is_anchor_element_rtl, data);
|
AddProperty("isRTL", parameters_->is_anchor_element_rtl, data);
|
||||||
AddProperty("isFormControlsRefreshEnabled",
|
|
||||||
features::IsFormControlsRefreshEnabled(), data);
|
|
||||||
#if defined(OS_MAC)
|
#if defined(OS_MAC)
|
||||||
AddProperty("isBorderTransparent", features::IsFormControlsRefreshEnabled(),
|
AddProperty("isBorderTransparent", true, data);
|
||||||
data);
|
|
||||||
#endif
|
#endif
|
||||||
AddProperty("mode", parameters_->type.GetString(), data);
|
AddProperty("mode", parameters_->type.GetString(), data);
|
||||||
AddProperty("isAMPMFirst", parameters_->is_ampm_first, data);
|
AddProperty("isAMPMFirst", parameters_->is_ampm_first, data);
|
||||||
@ -236,14 +229,12 @@ void DateTimeChooserImpl::WriteDocument(SharedBuffer* data) {
|
|||||||
|
|
||||||
data->Append(ChooserResourceLoader::GetPickerCommonJS());
|
data->Append(ChooserResourceLoader::GetPickerCommonJS());
|
||||||
data->Append(ChooserResourceLoader::GetSuggestionPickerJS());
|
data->Append(ChooserResourceLoader::GetSuggestionPickerJS());
|
||||||
if (features::IsFormControlsRefreshEnabled()) {
|
data->Append(ChooserResourceLoader::GetMonthPickerJS());
|
||||||
data->Append(ChooserResourceLoader::GetMonthPickerJS());
|
if (parameters_->type == input_type_names::kTime) {
|
||||||
if (parameters_->type == input_type_names::kTime) {
|
data->Append(ChooserResourceLoader::GetTimePickerJS());
|
||||||
data->Append(ChooserResourceLoader::GetTimePickerJS());
|
} else if (parameters_->type == input_type_names::kDatetimeLocal) {
|
||||||
} else if (parameters_->type == input_type_names::kDatetimeLocal) {
|
data->Append(ChooserResourceLoader::GetTimePickerJS());
|
||||||
data->Append(ChooserResourceLoader::GetTimePickerJS());
|
data->Append(ChooserResourceLoader::GetDateTimeLocalPickerJS());
|
||||||
data->Append(ChooserResourceLoader::GetDateTimeLocalPickerJS());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
data->Append(ChooserResourceLoader::GetCalendarPickerJS());
|
data->Append(ChooserResourceLoader::GetCalendarPickerJS());
|
||||||
AddString("</script></body>\n", data);
|
AddString("</script></body>\n", data);
|
||||||
|
@ -305,10 +305,8 @@ bool HTMLInputElement::MayTriggerVirtualKeyboard() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool HTMLInputElement::ShouldHaveFocusAppearance() const {
|
bool HTMLInputElement::ShouldHaveFocusAppearance() const {
|
||||||
// For FormControlsRefresh don't draw focus ring for an input that has its
|
// Don't draw focus ring for an input that has its popup open.
|
||||||
// popup open.
|
if (input_type_view_->HasOpenedPopup())
|
||||||
if (::features::IsFormControlsRefreshEnabled() &&
|
|
||||||
input_type_view_->HasOpenedPopup())
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return TextControlElement::ShouldHaveFocusAppearance();
|
return TextControlElement::ShouldHaveFocusAppearance();
|
||||||
|
@ -363,9 +363,8 @@ bool HTMLSelectElement::MayTriggerVirtualKeyboard() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool HTMLSelectElement::ShouldHaveFocusAppearance() const {
|
bool HTMLSelectElement::ShouldHaveFocusAppearance() const {
|
||||||
// For FormControlsRefresh don't draw focus ring for a select that has its
|
// Don't draw focus ring for a select that has its popup open.
|
||||||
// popup open.
|
if (PopupIsVisible())
|
||||||
if (::features::IsFormControlsRefreshEnabled() && PopupIsVisible())
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return HTMLFormControlElementWithState::ShouldHaveFocusAppearance();
|
return HTMLFormControlElementWithState::ShouldHaveFocusAppearance();
|
||||||
|
@ -357,8 +357,6 @@ void InternalPopupMenu::WriteDocument(SharedBuffer* data) {
|
|||||||
AddProperty("scaleFactor", scale_factor, data);
|
AddProperty("scaleFactor", scale_factor, data);
|
||||||
bool is_rtl = !owner_style->IsLeftToRightDirection();
|
bool is_rtl = !owner_style->IsLeftToRightDirection();
|
||||||
AddProperty("isRTL", is_rtl, data);
|
AddProperty("isRTL", is_rtl, data);
|
||||||
AddProperty("isFormControlsRefreshEnabled",
|
|
||||||
features::IsFormControlsRefreshEnabled(), data);
|
|
||||||
AddProperty("paddingStart",
|
AddProperty("paddingStart",
|
||||||
is_rtl ? owner_element.ClientPaddingRight().ToDouble()
|
is_rtl ? owner_element.ClientPaddingRight().ToDouble()
|
||||||
: owner_element.ClientPaddingLeft().ToDouble(),
|
: owner_element.ClientPaddingLeft().ToDouble(),
|
||||||
|
@ -296,9 +296,8 @@ void MultipleFieldsTemporalInputTypeView::PickerIndicatorChooseValue(
|
|||||||
if (input_type_->FormControlType() == input_type_names::kTime) {
|
if (input_type_->FormControlType() == input_type_names::kTime) {
|
||||||
if (date.ParseTime(value, 0, end) && end == value.length())
|
if (date.ParseTime(value, 0, end) && end == value.length())
|
||||||
edit->SetOnlyTime(date);
|
edit->SetOnlyTime(date);
|
||||||
} else if (features::IsFormControlsRefreshEnabled() &&
|
} else if (input_type_->FormControlType() ==
|
||||||
input_type_->FormControlType() ==
|
input_type_names::kDatetimeLocal) {
|
||||||
input_type_names::kDatetimeLocal) {
|
|
||||||
if (date.ParseDateTimeLocal(value, 0, end) && end == value.length())
|
if (date.ParseDateTimeLocal(value, 0, end) && end == value.length())
|
||||||
edit->SetDateTimeLocal(date);
|
edit->SetDateTimeLocal(date);
|
||||||
} else {
|
} else {
|
||||||
@ -397,18 +396,6 @@ void MultipleFieldsTemporalInputTypeView::CreateShadowSubtree() {
|
|||||||
MakeGarbageCollected<DateTimeEditElement, Document&,
|
MakeGarbageCollected<DateTimeEditElement, Document&,
|
||||||
DateTimeEditElement::EditControlOwner&>(document,
|
DateTimeEditElement::EditControlOwner&>(document,
|
||||||
*this));
|
*this));
|
||||||
if (!features::IsFormControlsRefreshEnabled()) {
|
|
||||||
GetElement().UpdateView();
|
|
||||||
container->AppendChild(
|
|
||||||
MakeGarbageCollected<ClearButtonElement, Document&,
|
|
||||||
ClearButtonElement::ClearButtonOwner&>(document,
|
|
||||||
*this));
|
|
||||||
container->AppendChild(
|
|
||||||
MakeGarbageCollected<SpinButtonElement, Document&,
|
|
||||||
SpinButtonElement::SpinButtonOwner&>(document,
|
|
||||||
*this));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LayoutTheme::GetTheme().SupportsCalendarPicker(
|
if (LayoutTheme::GetTheme().SupportsCalendarPicker(
|
||||||
input_type_->FormControlType()))
|
input_type_->FormControlType()))
|
||||||
picker_indicator_is_always_visible_ = true;
|
picker_indicator_is_always_visible_ = true;
|
||||||
@ -497,8 +484,7 @@ void MultipleFieldsTemporalInputTypeView::HandleKeydownEvent(
|
|||||||
return;
|
return;
|
||||||
if (picker_indicator_is_visible_ &&
|
if (picker_indicator_is_visible_ &&
|
||||||
((event.key() == "ArrowDown" && event.getModifierState("Alt")) ||
|
((event.key() == "ArrowDown" && event.getModifierState("Alt")) ||
|
||||||
(event.key() == "F4") ||
|
event.key() == "F4" || event.key() == " ")) {
|
||||||
(features::IsFormControlsRefreshEnabled() && event.key() == " "))) {
|
|
||||||
if (PickerIndicatorElement* element = GetPickerIndicatorElement())
|
if (PickerIndicatorElement* element = GetPickerIndicatorElement())
|
||||||
element->OpenPopup();
|
element->OpenPopup();
|
||||||
event.SetDefaultHandled();
|
event.SetDefaultHandled();
|
||||||
|
@ -51,13 +51,6 @@ PickerIndicatorElement::PickerIndicatorElement(
|
|||||||
picker_indicator_owner_(&picker_indicator_owner) {
|
picker_indicator_owner_(&picker_indicator_owner) {
|
||||||
SetShadowPseudoId(AtomicString("-webkit-calendar-picker-indicator"));
|
SetShadowPseudoId(AtomicString("-webkit-calendar-picker-indicator"));
|
||||||
setAttribute(html_names::kIdAttr, shadow_element_names::kIdPickerIndicator);
|
setAttribute(html_names::kIdAttr, shadow_element_names::kIdPickerIndicator);
|
||||||
if (!features::IsFormControlsRefreshEnabled()) {
|
|
||||||
setAttribute(html_names::kStyleAttr,
|
|
||||||
"display:list-item; list-style:disclosure-open inside; "
|
|
||||||
"block-size:1em;");
|
|
||||||
// Do not expose list-item role.
|
|
||||||
setAttribute(html_names::kAriaHiddenAttr, "true");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PickerIndicatorElement::~PickerIndicatorElement() {
|
PickerIndicatorElement::~PickerIndicatorElement() {
|
||||||
@ -109,8 +102,7 @@ void PickerIndicatorElement::DidChooseValue(double value) {
|
|||||||
void PickerIndicatorElement::DidEndChooser() {
|
void PickerIndicatorElement::DidEndChooser() {
|
||||||
chooser_.Clear();
|
chooser_.Clear();
|
||||||
picker_indicator_owner_->DidEndChooser();
|
picker_indicator_owner_->DidEndChooser();
|
||||||
if (::features::IsFormControlsRefreshEnabled() &&
|
if (OwnerElement().GetLayoutObject()) {
|
||||||
OwnerElement().GetLayoutObject()) {
|
|
||||||
// Invalidate paint to ensure that the focus ring is shown.
|
// Invalidate paint to ensure that the focus ring is shown.
|
||||||
OwnerElement().GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
OwnerElement().GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
||||||
}
|
}
|
||||||
@ -128,8 +120,7 @@ void PickerIndicatorElement::OpenPopup() {
|
|||||||
return;
|
return;
|
||||||
chooser_ = GetDocument().GetPage()->GetChromeClient().OpenDateTimeChooser(
|
chooser_ = GetDocument().GetPage()->GetChromeClient().OpenDateTimeChooser(
|
||||||
GetDocument().GetFrame(), this, parameters);
|
GetDocument().GetFrame(), this, parameters);
|
||||||
if (::features::IsFormControlsRefreshEnabled() &&
|
if (OwnerElement().GetLayoutObject()) {
|
||||||
OwnerElement().GetLayoutObject()) {
|
|
||||||
// Invalidate paint to ensure that the focus ring is removed.
|
// Invalidate paint to ensure that the focus ring is removed.
|
||||||
OwnerElement().GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
OwnerElement().GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
||||||
}
|
}
|
||||||
|
@ -193,16 +193,6 @@ body {
|
|||||||
padding-bottom: 2px;
|
padding-bottom: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.today-button::after {
|
|
||||||
content: "";
|
|
||||||
display: block;
|
|
||||||
border-radius: 3px;
|
|
||||||
width: 6px;
|
|
||||||
height: 6px;
|
|
||||||
background-color: #6e6e6e;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-navigation-button {
|
.calendar-navigation-button {
|
||||||
-webkit-align-self: center;
|
-webkit-align-self: center;
|
||||||
width: 24px;
|
width: 24px;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -165,7 +165,7 @@ body {
|
|||||||
color: rgba(16, 16, 16, 0.3);
|
color: rgba(16, 16, 16, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.today-button-refresh {
|
.today-button {
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
bottom: 12px;
|
bottom: 12px;
|
||||||
color: #0078D4;
|
color: #0078D4;
|
||||||
@ -177,11 +177,11 @@ body {
|
|||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.today-button-refresh:hover {
|
.today-button:hover {
|
||||||
background-color: rgba(0, 117, 255, 0.3);
|
background-color: rgba(0, 117, 255, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.today-button-refresh:disabled {
|
.today-button:disabled {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
color: rgba(16, 16, 16, 0.3);
|
color: rgba(16, 16, 16, 0.3);
|
||||||
}
|
}
|
||||||
@ -360,18 +360,18 @@ body {
|
|||||||
color: GrayText;
|
color: GrayText;
|
||||||
}
|
}
|
||||||
|
|
||||||
.today-button-refresh {
|
.today-button {
|
||||||
background-color: Window;
|
background-color: Window;
|
||||||
color: LinkText;
|
color: LinkText;
|
||||||
forced-color-adjust: none;
|
forced-color-adjust: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.today-button-refresh:hover {
|
.today-button:hover {
|
||||||
background-color: Window;
|
background-color: Window;
|
||||||
border-color: Highlight;
|
border-color: Highlight;
|
||||||
}
|
}
|
||||||
|
|
||||||
.today-button-refresh:disabled {
|
.today-button:disabled {
|
||||||
background-color: Window;
|
background-color: Window;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
color: GrayText;
|
color: GrayText;
|
||||||
@ -471,16 +471,16 @@ body {
|
|||||||
color: rgba(255, 255, 255, 0.3);
|
color: rgba(255, 255, 255, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.today-button-refresh {
|
.today-button {
|
||||||
color: #99C8FF;
|
color: #99C8FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.today-button-refresh:hover {
|
.today-button:hover {
|
||||||
color: #D1E6FF;
|
color: #D1E6FF;
|
||||||
background-color: #545454;
|
background-color: #545454;
|
||||||
}
|
}
|
||||||
|
|
||||||
.today-button-refresh:disabled {
|
.today-button:disabled {
|
||||||
color: rgba(255, 255, 255, 0.3);
|
color: rgba(255, 255, 255, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,10 +25,11 @@
|
|||||||
|
|
||||||
body {
|
body {
|
||||||
--color-swatch-border-width: 1px;
|
--color-swatch-border-width: 1px;
|
||||||
--color-swatch-margin: 1px;
|
|
||||||
--color-swatch-height: 20px;
|
|
||||||
--color-swatch-padding: 0;
|
--color-swatch-padding: 0;
|
||||||
--color-swatch-width: 20px;
|
--color-swatch-margin: 3px;
|
||||||
|
--color-swatch-height: 18px;
|
||||||
|
--color-swatch-width: 18px;
|
||||||
|
--scrollbar-width: 4px;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
font: -webkit-small-control;
|
font: -webkit-small-control;
|
||||||
@ -36,23 +37,9 @@ body {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.controls-refresh {
|
|
||||||
--color-swatch-margin: 3px;
|
|
||||||
--color-swatch-height: 18px;
|
|
||||||
--color-swatch-width: 18px;
|
|
||||||
--scrollbar-width: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.color-suggestion-picker-main {
|
.color-suggestion-picker-main {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
border: solid 1px #8899aa;
|
|
||||||
box-shadow: inset 2px 2px 2px white,
|
|
||||||
inset -2px -2px 1px rgba(0,0,0,0.1);
|
|
||||||
padding: 6px;
|
|
||||||
float: left;
|
float: left;
|
||||||
}
|
|
||||||
|
|
||||||
.controls-refresh .color-suggestion-picker-main {
|
|
||||||
border: 1px solid #bfbfbf;
|
border: 1px solid #bfbfbf;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
padding: 8px 8px 4px 8px;
|
padding: 8px 8px 4px 8px;
|
||||||
@ -64,19 +51,15 @@ body.controls-refresh {
|
|||||||
height: var(--color-swatch-height);
|
height: var(--color-swatch-height);
|
||||||
margin: var(--color-swatch-margin);
|
margin: var(--color-swatch-margin);
|
||||||
padding: var(--color-swatch-padding);
|
padding: var(--color-swatch-padding);
|
||||||
border: var(--color-swatch-border-width) solid #e0e0e0;
|
|
||||||
border-radius: 0;
|
|
||||||
box-sizing: content-box;
|
box-sizing: content-box;
|
||||||
}
|
|
||||||
|
|
||||||
.controls-refresh .color-swatch {
|
|
||||||
border: var(--color-swatch-border-width) solid rgba(0, 0, 0, 0.19);
|
border: var(--color-swatch-border-width) solid rgba(0, 0, 0, 0.19);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.color-swatch:focus {
|
.color-swatch:focus {
|
||||||
border: var(--color-swatch-border-width) solid #000000;
|
border: var(--color-swatch-border-width) solid #000000;
|
||||||
outline: none;
|
outline: solid 2px -webkit-focus-ring-color;
|
||||||
|
outline-offset: -2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.color-swatch-container {
|
.color-swatch-container {
|
||||||
@ -86,17 +69,14 @@ body.controls-refresh {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row wrap;
|
flex-flow: row wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
|
||||||
|
|
||||||
.controls-refresh .color-swatch-container {
|
|
||||||
margin: 4px;
|
margin: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .color-swatch-container::-webkit-scrollbar {
|
.color-swatch-container::-webkit-scrollbar {
|
||||||
width: var(--scrollbar-width);
|
width: var(--scrollbar-width);
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .color-swatch-container::-webkit-scrollbar-thumb {
|
.color-swatch-container::-webkit-scrollbar-thumb {
|
||||||
background-color: #cecece;
|
background-color: #cecece;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
height: 47px;
|
height: 47px;
|
||||||
@ -104,17 +84,8 @@ body.controls-refresh {
|
|||||||
width: 4px;
|
width: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .color-swatch:focus {
|
|
||||||
outline: solid 2px -webkit-focus-ring-color;
|
|
||||||
outline-offset: -2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.other-color {
|
.other-color {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 4px 0 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.controls-refresh .other-color {
|
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
@ -125,61 +96,61 @@ body.controls-refresh {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .other-color:hover {
|
.other-color:hover {
|
||||||
background-color: #f3f3f3;
|
background-color: #f3f3f3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (forced-colors: active) {
|
@media (forced-colors: active) {
|
||||||
.controls-refresh .color-suggestion-picker-main {
|
.color-suggestion-picker-main {
|
||||||
border: 1px solid WindowText;
|
border: 1px solid WindowText;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .color-swatch {
|
.color-swatch {
|
||||||
forced-color-adjust: none;
|
forced-color-adjust: none;
|
||||||
border-color: WindowText;
|
border-color: WindowText;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .color-swatch:focus {
|
.color-swatch:focus {
|
||||||
outline-color: Highlight;
|
outline-color: Highlight;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .color-swatch-container {
|
.color-swatch-container {
|
||||||
forced-color-adjust: none;
|
forced-color-adjust: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .color-swatch-container::-webkit-scrollbar-thumb {
|
.color-swatch-container::-webkit-scrollbar-thumb {
|
||||||
background-color: WindowText;
|
background-color: WindowText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
.controls-refresh .color-suggestion-picker-main {
|
.color-suggestion-picker-main {
|
||||||
background: #3B3B3B;
|
background: #3B3B3B;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
border: 1px solid #858585;
|
border: 1px solid #858585;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .color-swatch {
|
.color-swatch {
|
||||||
border-color: #858585;
|
border-color: #858585;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .color-swatch:focus {
|
.color-swatch:focus {
|
||||||
outline-color: Highlight;
|
outline-color: Highlight;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .other-color,
|
.other-color,
|
||||||
.controls-refresh .other-color:hover {
|
.other-color:hover {
|
||||||
background: #3B3B3B;
|
background: #3B3B3B;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
border: 1px solid #858585;
|
border: 1px solid #858585;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .other-color:hover{
|
.other-color:hover{
|
||||||
border: 1px solid #ACACAC;
|
border: 1px solid #ACACAC;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .color-swatch-container::-webkit-scrollbar-thumb {
|
.color-swatch-container::-webkit-scrollbar-thumb {
|
||||||
background-color: WindowText;
|
background-color: WindowText;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -129,17 +129,15 @@ Object.defineProperty(ColorSuggestionPicker, 'SwatchesPerRow', {
|
|||||||
|
|
||||||
Object.defineProperty(ColorSuggestionPicker, 'SwatchesMaxRow', {
|
Object.defineProperty(ColorSuggestionPicker, 'SwatchesMaxRow', {
|
||||||
get: function() {
|
get: function() {
|
||||||
return global.params.isFormControlsRefreshEnabled ? 3 : 4;
|
return 3;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.defineProperty(ColorSuggestionPicker, 'ScrollbarWidth', {
|
Object.defineProperty(ColorSuggestionPicker, 'ScrollbarWidth', {
|
||||||
get: function() {
|
get: function() {
|
||||||
return !global.params.isFormControlsRefreshEnabled ?
|
return Number(window.getComputedStyle(document.body)
|
||||||
getScrollbarWidth() :
|
.getPropertyValue('--scrollbar-width')
|
||||||
Number(window.getComputedStyle(document.body)
|
.replace('px', ''));
|
||||||
.getPropertyValue('--scrollbar-width')
|
|
||||||
.replace('px', ''));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -178,19 +176,15 @@ ColorSuggestionPicker.prototype._layout = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ColorSuggestionPicker.prototype._onOtherButtonClick = function() {
|
ColorSuggestionPicker.prototype._onOtherButtonClick = function() {
|
||||||
if (global.params.isFormControlsRefreshEnabled) {
|
var main = $('main');
|
||||||
var main = $('main');
|
main.innerHTML = '';
|
||||||
main.innerHTML = '';
|
main.classList.remove('color-suggestion-picker-main');
|
||||||
main.classList.remove('color-suggestion-picker-main');
|
main.classList.add('color-picker-main');
|
||||||
main.classList.add('color-picker-main');
|
// Replace document.body with a deep clone to drop all event listeners.
|
||||||
// Replace document.body with a deep clone to drop all event listeners.
|
var oldBody = document.body;
|
||||||
var oldBody = document.body;
|
var newBody = oldBody.cloneNode(true);
|
||||||
var newBody = oldBody.cloneNode(true);
|
oldBody.parentElement.replaceChild(newBody, oldBody);
|
||||||
oldBody.parentElement.replaceChild(newBody, oldBody);
|
initializeColorPicker();
|
||||||
initializeColorPicker();
|
|
||||||
} else {
|
|
||||||
this.chooseOtherColor();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ColorSuggestionPicker.prototype.selectColorAtIndex = function(index) {
|
ColorSuggestionPicker.prototype.selectColorAtIndex = function(index) {
|
||||||
|
@ -40,9 +40,6 @@ function initialize(args) {
|
|||||||
main.innerHTML = '';
|
main.innerHTML = '';
|
||||||
var errorString;
|
var errorString;
|
||||||
if (global.params.shouldShowColorSuggestionPicker) {
|
if (global.params.shouldShowColorSuggestionPicker) {
|
||||||
if (global.params.isFormControlsRefreshEnabled) {
|
|
||||||
document.body.classList.add('controls-refresh');
|
|
||||||
}
|
|
||||||
main.classList.add('color-suggestion-picker-main');
|
main.classList.add('color-suggestion-picker-main');
|
||||||
if (global.params.isBorderTransparent) {
|
if (global.params.isBorderTransparent) {
|
||||||
main.style.borderColor = 'transparent';
|
main.style.borderColor = 'transparent';
|
||||||
|
@ -99,7 +99,7 @@ class DateTimeLocalPicker extends HTMLElement {
|
|||||||
|
|
||||||
onClick_ = (event) => {
|
onClick_ = (event) => {
|
||||||
if (event.target.matches(
|
if (event.target.matches(
|
||||||
'.day-cell, .time-cell, .today-button-refresh, .calendar-navigation-button, .year-list-view, .calendar-navigation-button, .navigation-button-icon-refresh, .month-button') &&
|
'.day-cell, .time-cell, .today-button, .calendar-navigation-button, .year-list-view, .calendar-navigation-button, .navigation-button-icon, .month-button') &&
|
||||||
this.hasSelectedDate) {
|
this.hasSelectedDate) {
|
||||||
window.pagePopupController.setValue(this.selectedValue);
|
window.pagePopupController.setValue(this.selectedValue);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
select {
|
select {
|
||||||
display: block;
|
display: block;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
border-radius: 0px;
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
select hr {
|
select hr {
|
||||||
@ -16,8 +18,3 @@ option, optgroup {
|
|||||||
.wrap option {
|
.wrap option {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh select {
|
|
||||||
border-radius: 0px;
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
@ -21,9 +21,6 @@ function initialize(args) {
|
|||||||
global.params = args;
|
global.params = args;
|
||||||
var main = $('main');
|
var main = $('main');
|
||||||
main.innerHTML = '';
|
main.innerHTML = '';
|
||||||
if (global.params.isFormControlsRefreshEnabled) {
|
|
||||||
document.body.classList.add('controls-refresh');
|
|
||||||
}
|
|
||||||
global.picker = new ListPicker(main, args);
|
global.picker = new ListPicker(main, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,5 +170,5 @@ MonthPicker.YearWidth = 194;
|
|||||||
MonthPicker.YearHeight = 128;
|
MonthPicker.YearHeight = 128;
|
||||||
MonthPicker.YearPadding = 12;
|
MonthPicker.YearPadding = 12;
|
||||||
MonthPicker.Height = 182;
|
MonthPicker.Height = 182;
|
||||||
MonthPicker.ClassNameTodayButton = 'today-button-refresh';
|
MonthPicker.ClassNameTodayButton = 'today-button';
|
||||||
window.customElements.define('month-picker', MonthPicker);
|
window.customElements.define('month-picker', MonthPicker);
|
||||||
|
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2013 Google Inc. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
|
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
|
||||||
* DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
input[type='button'],
|
|
||||||
button {
|
|
||||||
-webkit-appearance: none;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
background-image: linear-gradient(#ededed, #ededed 38%, #dedede);
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.25);
|
|
||||||
border-radius: 2px;
|
|
||||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08),
|
|
||||||
inset 0 1px 2px rgba(255, 255, 255, 0.75);
|
|
||||||
color: #444;
|
|
||||||
font: inherit;
|
|
||||||
text-shadow: 0 1px 0 rgb(240, 240, 240);
|
|
||||||
min-height: 2em;
|
|
||||||
min-width: 4em;
|
|
||||||
padding-inline-end: 10px;
|
|
||||||
padding-inline-start: 10px;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
:enabled:hover:-webkit-any(button, input[type='button']) {
|
|
||||||
background-image: linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
|
|
||||||
border-color: rgba(0, 0, 0, 0.3);
|
|
||||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.95);
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
:enabled:active:-webkit-any(button, input[type='button']) {
|
|
||||||
background-image: linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
|
|
||||||
box-shadow: none;
|
|
||||||
text-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
:disabled:-webkit-any(button, input[type='button']) {
|
|
||||||
background-image: linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);
|
|
||||||
border-color: rgba(80, 80, 80, 0.2);
|
|
||||||
box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.75);
|
|
||||||
color: #aaa;
|
|
||||||
}
|
|
||||||
|
|
||||||
:enabled:focus:-webkit-any(button, input[type='button']) {
|
|
||||||
transition: border-color 200ms;
|
|
||||||
/* We use border color because it follows the border radius (unlike outline).
|
|
||||||
* This is particularly noticeable on mac. */
|
|
||||||
border-color: rgb(77, 144, 254);
|
|
||||||
outline: none;
|
|
||||||
}
|
|
@ -331,7 +331,6 @@ Picker.prototype = Object.create(EventEmitter.prototype);
|
|||||||
Picker.Actions = {
|
Picker.Actions = {
|
||||||
SetValue: 0,
|
SetValue: 0,
|
||||||
Cancel: -1,
|
Cancel: -1,
|
||||||
ChooseOtherColor: -2
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -346,11 +345,6 @@ Picker.prototype.handleCancel = function() {
|
|||||||
window.pagePopupController.closePopup();
|
window.pagePopupController.closePopup();
|
||||||
};
|
};
|
||||||
|
|
||||||
Picker.prototype.chooseOtherColor = function() {
|
|
||||||
window.pagePopupController.setValueAndClosePopup(
|
|
||||||
Picker.Actions.ChooseOtherColor, '');
|
|
||||||
};
|
|
||||||
|
|
||||||
Picker.prototype.cleanup = function() {};
|
Picker.prototype.cleanup = function() {};
|
||||||
|
|
||||||
window.addEventListener('keyup', function(event) {
|
window.addEventListener('keyup', function(event) {
|
||||||
|
@ -1,23 +1,28 @@
|
|||||||
.suggestion-list {
|
.suggestion-list {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font: -webkit-small-control;
|
font: -webkit-small-control;
|
||||||
border: 1px solid #7f9db9;
|
border: 1px solid #bfbfbf;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
padding: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.suggestion-list-entry {
|
.suggestion-list-entry {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
height: 1.73em;
|
|
||||||
line-height: 1.73em;
|
|
||||||
-webkit-select: none;
|
-webkit-select: none;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
border-radius: 2px;
|
||||||
|
font-size: 14px;
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestion-list-entry:focus {
|
.suggestion-list-entry:focus {
|
||||||
outline: none;
|
background-color: #E5E5E5 !important;
|
||||||
|
outline: solid 2px -webkit-focus-ring-color;
|
||||||
|
outline-offset: -2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestion-list-entry .content {
|
.suggestion-list-entry .content {
|
||||||
@ -26,9 +31,9 @@
|
|||||||
|
|
||||||
.suggestion-list-entry .label {
|
.suggestion-list-entry .label {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
color: #737373;
|
|
||||||
float: right;
|
float: right;
|
||||||
padding: 0 4px 0 20px;
|
padding: 0 4px 0 20px;
|
||||||
|
color: rgba(16, 16, 16, 0.6) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rtl .suggestion-list-entry .label {
|
.rtl .suggestion-list-entry .label {
|
||||||
@ -39,6 +44,7 @@
|
|||||||
.suggestion-list-entry .title {
|
.suggestion-list-entry .title {
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
color: #101010;
|
||||||
}
|
}
|
||||||
|
|
||||||
.locale-rtl .suggestion-list-entry .title {
|
.locale-rtl .suggestion-list-entry .title {
|
||||||
@ -55,45 +61,19 @@
|
|||||||
height: 0;
|
height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .suggestion-list {
|
|
||||||
border-color: #bfbfbf;
|
|
||||||
padding: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.controls-refresh .suggestion-list-entry {
|
|
||||||
border-radius: 2px;
|
|
||||||
font-size: 14px;
|
|
||||||
height: 32px;
|
|
||||||
line-height: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.controls-refresh .suggestion-list-entry:focus {
|
|
||||||
background-color: #E5E5E5;
|
|
||||||
outline: solid 2px -webkit-focus-ring-color;
|
|
||||||
outline-offset: -2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.controls-refresh .suggestion-list-entry .title {
|
|
||||||
color: #101010;
|
|
||||||
}
|
|
||||||
|
|
||||||
.controls-refresh .suggestion-list-entry .label {
|
|
||||||
color: rgba(16, 16, 16, 0.6) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (forced-colors: active) {
|
@media (forced-colors: active) {
|
||||||
.controls-refresh .suggestion-list-entry:focus {
|
.suggestion-list-entry:focus {
|
||||||
background-color: Highlight !important;
|
background-color: Highlight !important;
|
||||||
forced-color-adjust: none;
|
forced-color-adjust: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .suggestion-list-entry:focus .label,
|
.suggestion-list-entry:focus .label,
|
||||||
.controls-refresh .suggestion-list-entry:focus .title {
|
.suggestion-list-entry:focus .title {
|
||||||
color: HighlightText !important;
|
color: HighlightText !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls-refresh .suggestion-list-entry .label,
|
.suggestion-list-entry .label,
|
||||||
.controls-refresh .suggestion-list-entry .title {
|
.suggestion-list-entry .title {
|
||||||
color: WindowText !important;
|
color: WindowText !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,12 +211,6 @@ SuggestionPicker.prototype._layout = function() {
|
|||||||
this._config.suggestionLabels[i], this._config.suggestionValues[i]));
|
this._config.suggestionLabels[i], this._config.suggestionValues[i]));
|
||||||
}
|
}
|
||||||
if (this._config.showOtherDateEntry) {
|
if (this._config.showOtherDateEntry) {
|
||||||
// Add separator
|
|
||||||
if (!global.params.isFormControlsRefreshEnabled) {
|
|
||||||
var separator = createElement('div', 'separator');
|
|
||||||
this._containerElement.appendChild(separator);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add "Other..." entry
|
// Add "Other..." entry
|
||||||
var otherEntry = this._createActionEntryElement(
|
var otherEntry = this._createActionEntryElement(
|
||||||
this._config.otherDateLabel,
|
this._config.otherDateLabel,
|
||||||
|
@ -357,8 +357,6 @@ bool MenuListSelectType::PopupIsVisible() const {
|
|||||||
|
|
||||||
void MenuListSelectType::SetPopupIsVisible(bool popup_is_visible) {
|
void MenuListSelectType::SetPopupIsVisible(bool popup_is_visible) {
|
||||||
popup_is_visible_ = popup_is_visible;
|
popup_is_visible_ = popup_is_visible;
|
||||||
if (!::features::IsFormControlsRefreshEnabled())
|
|
||||||
return;
|
|
||||||
if (auto* layout_object = select_->GetLayoutObject()) {
|
if (auto* layout_object = select_->GetLayoutObject()) {
|
||||||
// Invalidate paint to ensure that the focus ring is updated.
|
// Invalidate paint to ensure that the focus ring is updated.
|
||||||
layout_object->SetShouldDoFullPaintInvalidation();
|
layout_object->SetShouldDoFullPaintInvalidation();
|
||||||
|
@ -63,12 +63,10 @@ void SliderThumbElement::SetPositionFromValue() {
|
|||||||
if (GetLayoutObject()) {
|
if (GetLayoutObject()) {
|
||||||
GetLayoutObject()->SetNeedsLayoutAndFullPaintInvalidation(
|
GetLayoutObject()->SetNeedsLayoutAndFullPaintInvalidation(
|
||||||
layout_invalidation_reason::kSliderValueChanged);
|
layout_invalidation_reason::kSliderValueChanged);
|
||||||
if (features::IsFormControlsRefreshEnabled()) {
|
HTMLInputElement* input(HostInput());
|
||||||
HTMLInputElement* input(HostInput());
|
if (input && input->GetLayoutObject()) {
|
||||||
if (input && input->GetLayoutObject()) {
|
// the slider track selected value needs to be updated.
|
||||||
// the slider track selected value needs to be updated.
|
input->GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
||||||
input->GetLayoutObject()->SetShouldDoFullPaintInvalidation();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,27 +24,11 @@ TEST_F(LayoutTextControlSingleLineTest, VisualOverflowCleared) {
|
|||||||
<input id=input type="text"></input.
|
<input id=input type="text"></input.
|
||||||
)HTML");
|
)HTML");
|
||||||
auto* input = To<LayoutBox>(GetLayoutObjectByElementId("input"));
|
auto* input = To<LayoutBox>(GetLayoutObjectByElementId("input"));
|
||||||
if (::features::IsFormControlsRefreshEnabled()) {
|
EXPECT_EQ(LayoutRect(-3, -3, 74, 72), input->SelfVisualOverflowRect());
|
||||||
EXPECT_EQ(LayoutRect(-3, -3, 74, 72), input->SelfVisualOverflowRect());
|
|
||||||
} else {
|
|
||||||
#if defined(OS_MAC)
|
|
||||||
EXPECT_EQ(LayoutRect(-3, -3, 72, 72), input->SelfVisualOverflowRect());
|
|
||||||
#else
|
|
||||||
EXPECT_EQ(LayoutRect(-3, -3, 70, 72), input->SelfVisualOverflowRect());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
To<Element>(input->GetNode())
|
To<Element>(input->GetNode())
|
||||||
->setAttribute(html_names::kStyleAttr, "box-shadow: initial");
|
->setAttribute(html_names::kStyleAttr, "box-shadow: initial");
|
||||||
UpdateAllLifecyclePhasesForTest();
|
UpdateAllLifecyclePhasesForTest();
|
||||||
if (::features::IsFormControlsRefreshEnabled()) {
|
EXPECT_EQ(LayoutRect(0, 0, 58, 56), input->SelfVisualOverflowRect());
|
||||||
EXPECT_EQ(LayoutRect(0, 0, 58, 56), input->SelfVisualOverflowRect());
|
|
||||||
} else {
|
|
||||||
#if defined(OS_MAC)
|
|
||||||
EXPECT_EQ(LayoutRect(0, 0, 56, 56), input->SelfVisualOverflowRect());
|
|
||||||
#else
|
|
||||||
EXPECT_EQ(LayoutRect(0, 0, 54, 56), input->SelfVisualOverflowRect());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
@ -743,8 +743,7 @@ String LayoutTheme::DisplayNameForFile(const File& file) const {
|
|||||||
|
|
||||||
bool LayoutTheme::SupportsCalendarPicker(const AtomicString& type) const {
|
bool LayoutTheme::SupportsCalendarPicker(const AtomicString& type) const {
|
||||||
DCHECK(RuntimeEnabledFeatures::InputMultipleFieldsUIEnabled());
|
DCHECK(RuntimeEnabledFeatures::InputMultipleFieldsUIEnabled());
|
||||||
if (features::IsFormControlsRefreshEnabled() &&
|
if (type == input_type_names::kTime)
|
||||||
type == input_type_names::kTime)
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return type == input_type_names::kDate ||
|
return type == input_type_names::kDate ||
|
||||||
|
@ -19,19 +19,6 @@ LayoutTheme& LayoutTheme::NativeTheme() {
|
|||||||
|
|
||||||
LayoutThemeAndroid::~LayoutThemeAndroid() {}
|
LayoutThemeAndroid::~LayoutThemeAndroid() {}
|
||||||
|
|
||||||
String LayoutThemeAndroid::ExtraDefaultStyleSheet() {
|
|
||||||
String extra_sheet = LayoutThemeMobile::ExtraDefaultStyleSheet();
|
|
||||||
if (features::IsFormControlsRefreshEnabled())
|
|
||||||
return extra_sheet;
|
|
||||||
|
|
||||||
// "32px" comes from
|
|
||||||
// 2 * -LayoutThemeDefault::SliderTickOffsetFromTrackCenter().
|
|
||||||
return extra_sheet + R"CSS(
|
|
||||||
input[type="range" i]:-internal-has-datalist::-webkit-slider-container {
|
|
||||||
min-block-size: 32px;
|
|
||||||
})CSS";
|
|
||||||
}
|
|
||||||
|
|
||||||
Color LayoutThemeAndroid::PlatformActiveSelectionBackgroundColor(
|
Color LayoutThemeAndroid::PlatformActiveSelectionBackgroundColor(
|
||||||
mojom::blink::ColorScheme color_scheme) const {
|
mojom::blink::ColorScheme color_scheme) const {
|
||||||
return color_scheme == mojom::blink::ColorScheme::kDark
|
return color_scheme == mojom::blink::ColorScheme::kDark
|
||||||
|
@ -13,7 +13,6 @@ class LayoutThemeAndroid final : public LayoutThemeMobile {
|
|||||||
public:
|
public:
|
||||||
static scoped_refptr<LayoutTheme> Create();
|
static scoped_refptr<LayoutTheme> Create();
|
||||||
bool DelegatesMenuListRendering() const override { return true; }
|
bool DelegatesMenuListRendering() const override { return true; }
|
||||||
String ExtraDefaultStyleSheet() override;
|
|
||||||
Color PlatformActiveSelectionBackgroundColor(
|
Color PlatformActiveSelectionBackgroundColor(
|
||||||
mojom::blink::ColorScheme color_scheme) const override;
|
mojom::blink::ColorScheme color_scheme) const override;
|
||||||
Color PlatformActiveSelectionForegroundColor(
|
Color PlatformActiveSelectionForegroundColor(
|
||||||
|
@ -66,10 +66,7 @@ String LayoutThemeDefault::ExtraDefaultStyleSheet() {
|
|||||||
String windows_style_sheet =
|
String windows_style_sheet =
|
||||||
UncompressResourceAsASCIIString(IDR_UASTYLE_THEME_WIN_CSS);
|
UncompressResourceAsASCIIString(IDR_UASTYLE_THEME_WIN_CSS);
|
||||||
String controls_refresh_style_sheet =
|
String controls_refresh_style_sheet =
|
||||||
features::IsFormControlsRefreshEnabled()
|
UncompressResourceAsASCIIString(IDR_UASTYLE_THEME_CONTROLS_REFRESH_CSS);
|
||||||
? UncompressResourceAsASCIIString(
|
|
||||||
IDR_UASTYLE_THEME_CONTROLS_REFRESH_CSS)
|
|
||||||
: String();
|
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
builder.ReserveCapacity(
|
builder.ReserveCapacity(
|
||||||
extra_style_sheet.length() + multiple_fields_style_sheet.length() +
|
extra_style_sheet.length() + multiple_fields_style_sheet.length() +
|
||||||
@ -108,19 +105,13 @@ Color LayoutThemeDefault::PlatformInactiveSelectionForegroundColor(
|
|||||||
IntSize LayoutThemeDefault::SliderTickSize() const {
|
IntSize LayoutThemeDefault::SliderTickSize() const {
|
||||||
// The value should be synchronized with a -webkit-slider-container rule in
|
// The value should be synchronized with a -webkit-slider-container rule in
|
||||||
// html.css.
|
// html.css.
|
||||||
if (features::IsFormControlsRefreshEnabled())
|
return IntSize(1, 4);
|
||||||
return IntSize(1, 4);
|
|
||||||
else
|
|
||||||
return IntSize(1, 6);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int LayoutThemeDefault::SliderTickOffsetFromTrackCenter() const {
|
int LayoutThemeDefault::SliderTickOffsetFromTrackCenter() const {
|
||||||
// The value should be synchronized with a -webkit-slider-container rule in
|
// The value should be synchronized with a -webkit-slider-container rule in
|
||||||
// html.css and LayoutThemeAndroid::ExtraDefaultStyleSheet().
|
// html.css and LayoutThemeAndroid::ExtraDefaultStyleSheet().
|
||||||
if (features::IsFormControlsRefreshEnabled())
|
return 7;
|
||||||
return 7;
|
|
||||||
else
|
|
||||||
return -16;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayoutThemeDefault::AdjustSliderThumbSize(ComputedStyle& style) const {
|
void LayoutThemeDefault::AdjustSliderThumbSize(ComputedStyle& style) const {
|
||||||
|
@ -150,7 +150,6 @@ bool LayoutThemeMac::UsesTestModeFocusRingColor() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LayoutTheme& LayoutTheme::NativeTheme() {
|
LayoutTheme& LayoutTheme::NativeTheme() {
|
||||||
DCHECK(features::IsFormControlsRefreshEnabled());
|
|
||||||
DEFINE_STATIC_REF(LayoutTheme, layout_theme, (LayoutThemeMac::Create()));
|
DEFINE_STATIC_REF(LayoutTheme, layout_theme, (LayoutThemeMac::Create()));
|
||||||
return *layout_theme;
|
return *layout_theme;
|
||||||
}
|
}
|
||||||
|
@ -19,14 +19,11 @@
|
|||||||
#include "third_party/blink/renderer/core/testing/color_scheme_helper.h"
|
#include "third_party/blink/renderer/core/testing/color_scheme_helper.h"
|
||||||
#include "third_party/blink/renderer/core/testing/page_test_base.h"
|
#include "third_party/blink/renderer/core/testing/page_test_base.h"
|
||||||
#include "third_party/blink/renderer/platform/graphics/color.h"
|
#include "third_party/blink/renderer/platform/graphics/color.h"
|
||||||
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
|
|
||||||
|
|
||||||
namespace blink {
|
namespace blink {
|
||||||
|
|
||||||
class LayoutThemeTest : public PageTestBase,
|
class LayoutThemeTest : public PageTestBase {
|
||||||
private ScopedCSSColorSchemeUARenderingForTest {
|
|
||||||
protected:
|
protected:
|
||||||
LayoutThemeTest() : ScopedCSSColorSchemeUARenderingForTest(true) {}
|
|
||||||
void SetHtmlInnerHTML(const char* html_content);
|
void SetHtmlInnerHTML(const char* html_content);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2950,7 +2950,6 @@ INSTANTIATE_TEST_SUITE_P(NonOverlay,
|
|||||||
|
|
||||||
TEST_P(ScrollbarColorSchemeTest, MAYBE_ThemeEnginePaint) {
|
TEST_P(ScrollbarColorSchemeTest, MAYBE_ThemeEnginePaint) {
|
||||||
ScopedTestingPlatformSupport<ScrollbarTestingPlatformSupport> platform;
|
ScopedTestingPlatformSupport<ScrollbarTestingPlatformSupport> platform;
|
||||||
ScopedCSSColorSchemeUARenderingForTest color_scheme_ua_scope(true);
|
|
||||||
|
|
||||||
WebView().MainFrameViewWidget()->Resize(gfx::Size(800, 600));
|
WebView().MainFrameViewWidget()->Resize(gfx::Size(800, 600));
|
||||||
SimRequest request("https://example.com/test.html", "text/html");
|
SimRequest request("https://example.com/test.html", "text/html");
|
||||||
|
@ -516,9 +516,7 @@ void DrawSolidBoxSide(GraphicsContext& graphics_context,
|
|||||||
float GetFocusRingBorderRadius(const ComputedStyle& style) {
|
float GetFocusRingBorderRadius(const ComputedStyle& style) {
|
||||||
// Default style is border-radius equal to outline width.
|
// Default style is border-radius equal to outline width.
|
||||||
float border_radius = style.GetOutlineStrokeWidthForFocusRing();
|
float border_radius = style.GetOutlineStrokeWidthForFocusRing();
|
||||||
|
if (!style.HasAuthorBorder() && style.HasEffectiveAppearance()) {
|
||||||
if (::features::IsFormControlsRefreshEnabled() && !style.HasAuthorBorder() &&
|
|
||||||
style.HasEffectiveAppearance()) {
|
|
||||||
// For the elements that have not been styled and that have an appearance,
|
// For the elements that have not been styled and that have an appearance,
|
||||||
// the focus ring should use the same border radius as the one used for
|
// the focus ring should use the same border radius as the one used for
|
||||||
// drawing the element.
|
// drawing the element.
|
||||||
|
@ -2799,9 +2799,7 @@ Scrollbar* PaintLayerScrollableArea::ScrollbarManager::CreateScrollbar(
|
|||||||
ScrollableArea(), orientation, To<Element>(style_source.GetNode()));
|
ScrollableArea(), orientation, To<Element>(style_source.GetNode()));
|
||||||
} else {
|
} else {
|
||||||
Element* style_source_element = nullptr;
|
Element* style_source_element = nullptr;
|
||||||
if (::features::IsFormControlsRefreshEnabled()) {
|
style_source_element = DynamicTo<Element>(style_source.GetNode());
|
||||||
style_source_element = DynamicTo<Element>(style_source.GetNode());
|
|
||||||
}
|
|
||||||
scrollbar = MakeGarbageCollected<Scrollbar>(ScrollableArea(), orientation,
|
scrollbar = MakeGarbageCollected<Scrollbar>(ScrollableArea(), orientation,
|
||||||
style_source_element);
|
style_source_element);
|
||||||
}
|
}
|
||||||
|
@ -171,15 +171,9 @@ bool ThemePainter::Paint(const LayoutObject& o,
|
|||||||
case kMenulistButtonPart:
|
case kMenulistButtonPart:
|
||||||
return true;
|
return true;
|
||||||
case kTextFieldPart:
|
case kTextFieldPart:
|
||||||
if (!features::IsFormControlsRefreshEnabled()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
CountAppearanceTextFieldPart(element);
|
CountAppearanceTextFieldPart(element);
|
||||||
return PaintTextField(element, style, paint_info, r);
|
return PaintTextField(element, style, paint_info, r);
|
||||||
case kTextAreaPart:
|
case kTextAreaPart:
|
||||||
if (!features::IsFormControlsRefreshEnabled()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
COUNT_APPEARANCE(doc, TextArea);
|
COUNT_APPEARANCE(doc, TextArea);
|
||||||
return PaintTextArea(element, style, paint_info, r);
|
return PaintTextArea(element, style, paint_info, r);
|
||||||
case kSearchFieldPart: {
|
case kSearchFieldPart: {
|
||||||
@ -211,17 +205,8 @@ bool ThemePainter::PaintBorderOnly(const Node* node,
|
|||||||
// Call the appropriate paint method based off the appearance value.
|
// Call the appropriate paint method based off the appearance value.
|
||||||
switch (style.EffectiveAppearance()) {
|
switch (style.EffectiveAppearance()) {
|
||||||
case kTextFieldPart:
|
case kTextFieldPart:
|
||||||
if (features::IsFormControlsRefreshEnabled()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
CountAppearanceTextFieldPart(element);
|
|
||||||
return PaintTextField(element, style, paint_info, r);
|
|
||||||
case kTextAreaPart:
|
case kTextAreaPart:
|
||||||
if (features::IsFormControlsRefreshEnabled()) {
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
COUNT_APPEARANCE(element.GetDocument(), TextArea);
|
|
||||||
return PaintTextArea(element, style, paint_info, r);
|
|
||||||
case kMenulistButtonPart:
|
case kMenulistButtonPart:
|
||||||
case kSearchFieldPart:
|
case kSearchFieldPart:
|
||||||
case kListboxPart:
|
case kListboxPart:
|
||||||
|
@ -209,9 +209,7 @@ bool ThemePainterDefault::PaintRadio(const Element& element,
|
|||||||
extra_params.button.zoom = zoom_level;
|
extra_params.button.zoom = zoom_level;
|
||||||
GraphicsContextStateSaver state_saver(paint_info.context, false);
|
GraphicsContextStateSaver state_saver(paint_info.context, false);
|
||||||
IntRect unzoomed_rect =
|
IntRect unzoomed_rect =
|
||||||
features::IsFormControlsRefreshEnabled()
|
ApplyZoomToRect(rect, paint_info, state_saver, zoom_level);
|
||||||
? ApplyZoomToRect(rect, paint_info, state_saver, zoom_level)
|
|
||||||
: rect;
|
|
||||||
|
|
||||||
Platform::Current()->ThemeEngine()->Paint(
|
Platform::Current()->ThemeEngine()->Paint(
|
||||||
canvas, WebThemeEngine::kPartRadio, GetWebThemeState(element),
|
canvas, WebThemeEngine::kPartRadio, GetWebThemeState(element),
|
||||||
@ -353,8 +351,7 @@ void ThemePainterDefault::SetupMenuListArrow(
|
|||||||
theme_.ClampedMenuListArrowPaddingSize(document.GetFrame(), style);
|
theme_.ClampedMenuListArrowPaddingSize(document.GetFrame(), style);
|
||||||
float arrow_scale_factor = arrow_box_width / theme_.MenuListArrowWidthInDIP();
|
float arrow_scale_factor = arrow_box_width / theme_.MenuListArrowWidthInDIP();
|
||||||
// TODO(tkent): This should be 7.0 to match scroll bar buttons.
|
// TODO(tkent): This should be 7.0 to match scroll bar buttons.
|
||||||
float arrow_size = (features::IsFormControlsRefreshEnabled() ? 8.0 : 6.0) *
|
float arrow_size = 8.0 * arrow_scale_factor;
|
||||||
arrow_scale_factor;
|
|
||||||
// Put the arrow at the center of paddingForArrow area.
|
// Put the arrow at the center of paddingForArrow area.
|
||||||
// |arrowX| is the left position for Aura theme engine.
|
// |arrowX| is the left position for Aura theme engine.
|
||||||
extra_params.menu_list.arrow_x =
|
extra_params.menu_list.arrow_x =
|
||||||
@ -383,14 +380,6 @@ bool ThemePainterDefault::PaintSliderTrack(const Element& element,
|
|||||||
extra_params.slider.zoom = zoom_level;
|
extra_params.slider.zoom = zoom_level;
|
||||||
GraphicsContextStateSaver state_saver(i.context, false);
|
GraphicsContextStateSaver state_saver(i.context, false);
|
||||||
IntRect unzoomed_rect = rect;
|
IntRect unzoomed_rect = rect;
|
||||||
if (zoom_level != 1 && !features::IsFormControlsRefreshEnabled()) {
|
|
||||||
state_saver.Save();
|
|
||||||
unzoomed_rect.SetWidth(unzoomed_rect.Width() / zoom_level);
|
|
||||||
unzoomed_rect.SetHeight(unzoomed_rect.Height() / zoom_level);
|
|
||||||
i.context.Translate(unzoomed_rect.X(), unzoomed_rect.Y());
|
|
||||||
i.context.Scale(zoom_level, zoom_level);
|
|
||||||
i.context.Translate(-unzoomed_rect.X(), -unzoomed_rect.Y());
|
|
||||||
}
|
|
||||||
|
|
||||||
auto* input = DynamicTo<HTMLInputElement>(element);
|
auto* input = DynamicTo<HTMLInputElement>(element);
|
||||||
extra_params.slider.thumb_x = 0;
|
extra_params.slider.thumb_x = 0;
|
||||||
@ -405,23 +394,12 @@ bool ThemePainterDefault::PaintSliderTrack(const Element& element,
|
|||||||
LayoutBox* input_box = input->GetLayoutBox();
|
LayoutBox* input_box = input->GetLayoutBox();
|
||||||
if (thumb) {
|
if (thumb) {
|
||||||
IntRect thumb_rect = PixelSnappedIntRect(thumb->FrameRect());
|
IntRect thumb_rect = PixelSnappedIntRect(thumb->FrameRect());
|
||||||
if (features::IsFormControlsRefreshEnabled()) {
|
extra_params.slider.thumb_x = thumb_rect.X() +
|
||||||
extra_params.slider.thumb_x = thumb_rect.X() +
|
input_box->PaddingLeft().ToInt() +
|
||||||
input_box->PaddingLeft().ToInt() +
|
input_box->BorderLeft().ToInt();
|
||||||
input_box->BorderLeft().ToInt();
|
extra_params.slider.thumb_y = thumb_rect.Y() +
|
||||||
extra_params.slider.thumb_y = thumb_rect.Y() +
|
input_box->PaddingTop().ToInt() +
|
||||||
input_box->PaddingTop().ToInt() +
|
input_box->BorderTop().ToInt();
|
||||||
input_box->BorderTop().ToInt();
|
|
||||||
} else {
|
|
||||||
extra_params.slider.thumb_x =
|
|
||||||
(thumb_rect.X() + input_box->PaddingLeft().ToInt() +
|
|
||||||
input_box->BorderLeft().ToInt()) /
|
|
||||||
zoom_level;
|
|
||||||
extra_params.slider.thumb_y =
|
|
||||||
(thumb_rect.Y() + input_box->PaddingTop().ToInt() +
|
|
||||||
input_box->BorderTop().ToInt()) /
|
|
||||||
zoom_level;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,14 +424,6 @@ bool ThemePainterDefault::PaintSliderThumb(const Element& element,
|
|||||||
extra_params.slider.zoom = zoom_level;
|
extra_params.slider.zoom = zoom_level;
|
||||||
GraphicsContextStateSaver state_saver(paint_info.context, false);
|
GraphicsContextStateSaver state_saver(paint_info.context, false);
|
||||||
IntRect unzoomed_rect = rect;
|
IntRect unzoomed_rect = rect;
|
||||||
if (zoom_level != 1 && !features::IsFormControlsRefreshEnabled()) {
|
|
||||||
state_saver.Save();
|
|
||||||
unzoomed_rect.SetWidth(unzoomed_rect.Width() / zoom_level);
|
|
||||||
unzoomed_rect.SetHeight(unzoomed_rect.Height() / zoom_level);
|
|
||||||
paint_info.context.Translate(unzoomed_rect.X(), unzoomed_rect.Y());
|
|
||||||
paint_info.context.Scale(zoom_level, zoom_level);
|
|
||||||
paint_info.context.Translate(-unzoomed_rect.X(), -unzoomed_rect.Y());
|
|
||||||
}
|
|
||||||
|
|
||||||
// The element passed in is inside the user agent shadowdom of the input
|
// The element passed in is inside the user agent shadowdom of the input
|
||||||
// element, so we have to access the parent input element in order to get the
|
// element, so we have to access the parent input element in order to get the
|
||||||
|
@ -815,16 +815,14 @@ float Scrollbar::ScaleFromDIP() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float Scrollbar::EffectiveZoom() const {
|
float Scrollbar::EffectiveZoom() const {
|
||||||
if (::features::IsFormControlsRefreshEnabled() && style_source_ &&
|
if (style_source_ && style_source_->GetLayoutObject()) {
|
||||||
style_source_->GetLayoutObject()) {
|
|
||||||
return style_source_->GetLayoutObject()->Style()->EffectiveZoom();
|
return style_source_->GetLayoutObject()->Style()->EffectiveZoom();
|
||||||
}
|
}
|
||||||
return 1.0;
|
return 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scrollbar::ContainerIsRightToLeft() const {
|
bool Scrollbar::ContainerIsRightToLeft() const {
|
||||||
if (::features::IsFormControlsRefreshEnabled() && style_source_ &&
|
if (style_source_ && style_source_->GetLayoutObject()) {
|
||||||
style_source_->GetLayoutObject()) {
|
|
||||||
TextDirection dir = style_source_->GetLayoutObject()->Style()->Direction();
|
TextDirection dir = style_source_->GetLayoutObject()->Style()->Direction();
|
||||||
return IsRtl(dir);
|
return IsRtl(dir);
|
||||||
}
|
}
|
||||||
|
@ -2224,7 +2224,7 @@ int ComputedStyle::OutlineOutsetExtent() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float ComputedStyle::GetOutlineStrokeWidthForFocusRing() const {
|
float ComputedStyle::GetOutlineStrokeWidthForFocusRing() const {
|
||||||
if (::features::IsFormControlsRefreshEnabled() && OutlineStyleIsAuto()) {
|
if (OutlineStyleIsAuto()) {
|
||||||
return std::max(EffectiveZoom(), 3.f);
|
return std::max(EffectiveZoom(), 3.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2602,9 +2602,7 @@ class ComputedStyle : public ComputedStyleBase,
|
|||||||
}
|
}
|
||||||
|
|
||||||
mojom::blink::ColorScheme UsedColorScheme() const {
|
mojom::blink::ColorScheme UsedColorScheme() const {
|
||||||
return RuntimeEnabledFeatures::CSSColorSchemeUARenderingEnabled()
|
return ComputedColorScheme();
|
||||||
? ComputedColorScheme()
|
|
||||||
: mojom::blink::ColorScheme::kLight;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mojom::blink::ColorScheme UsedColorSchemeForInitialColors() const {
|
mojom::blink::ColorScheme UsedColorSchemeForInitialColors() const {
|
||||||
|
@ -91,30 +91,11 @@ TEST_F(ComputedStyleTest, ClipPathEqual) {
|
|||||||
|
|
||||||
TEST_F(ComputedStyleTest, FocusRingWidth) {
|
TEST_F(ComputedStyleTest, FocusRingWidth) {
|
||||||
scoped_refptr<ComputedStyle> style = CreateComputedStyle();
|
scoped_refptr<ComputedStyle> style = CreateComputedStyle();
|
||||||
if (::features::IsFormControlsRefreshEnabled()) {
|
style->SetOutlineStyleIsAuto(static_cast<bool>(OutlineIsAuto::kOn));
|
||||||
style->SetOutlineStyleIsAuto(static_cast<bool>(OutlineIsAuto::kOn));
|
EXPECT_EQ(3, style->GetOutlineStrokeWidthForFocusRing());
|
||||||
EXPECT_EQ(3, style->GetOutlineStrokeWidthForFocusRing());
|
style->SetEffectiveZoom(3.5);
|
||||||
style->SetEffectiveZoom(3.5);
|
style->SetOutlineWidth(4);
|
||||||
style->SetOutlineWidth(4);
|
EXPECT_EQ(3.5, style->GetOutlineStrokeWidthForFocusRing());
|
||||||
EXPECT_EQ(3.5, style->GetOutlineStrokeWidthForFocusRing());
|
|
||||||
} else {
|
|
||||||
style->SetEffectiveZoom(3.5);
|
|
||||||
style->SetOutlineStyle(EBorderStyle::kSolid);
|
|
||||||
#if defined(OS_MAC)
|
|
||||||
EXPECT_EQ(3, style->GetOutlineStrokeWidthForFocusRing());
|
|
||||||
#else
|
|
||||||
style->SetOutlineStyleIsAuto(static_cast<bool>(OutlineIsAuto::kOn));
|
|
||||||
static uint16_t outline_width = 4;
|
|
||||||
style->SetOutlineWidth(outline_width);
|
|
||||||
|
|
||||||
double expected_width = 3.5;
|
|
||||||
EXPECT_EQ(expected_width, style->GetOutlineStrokeWidthForFocusRing());
|
|
||||||
|
|
||||||
expected_width = 1.0;
|
|
||||||
style->SetEffectiveZoom(0.5);
|
|
||||||
EXPECT_EQ(expected_width, style->GetOutlineStrokeWidthForFocusRing());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ComputedStyleTest, FocusRingOutset) {
|
TEST_F(ComputedStyleTest, FocusRingOutset) {
|
||||||
@ -122,15 +103,7 @@ TEST_F(ComputedStyleTest, FocusRingOutset) {
|
|||||||
style->SetOutlineStyle(EBorderStyle::kSolid);
|
style->SetOutlineStyle(EBorderStyle::kSolid);
|
||||||
style->SetOutlineStyleIsAuto(static_cast<bool>(OutlineIsAuto::kOn));
|
style->SetOutlineStyleIsAuto(static_cast<bool>(OutlineIsAuto::kOn));
|
||||||
style->SetEffectiveZoom(4.75);
|
style->SetEffectiveZoom(4.75);
|
||||||
if (::features::IsFormControlsRefreshEnabled()) {
|
EXPECT_EQ(4, style->OutlineOutsetExtent());
|
||||||
EXPECT_EQ(4, style->OutlineOutsetExtent());
|
|
||||||
} else {
|
|
||||||
#if defined(OS_MAC)
|
|
||||||
EXPECT_EQ(4, style->OutlineOutsetExtent());
|
|
||||||
#else
|
|
||||||
EXPECT_EQ(3, style->OutlineOutsetExtent());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ComputedStyleTest, SVGStackingContext) {
|
TEST_F(ComputedStyleTest, SVGStackingContext) {
|
||||||
@ -679,8 +652,6 @@ TEST_F(ComputedStyleTest, CustomPropertiesInheritance_StyleRecalc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ComputedStyleTest, ApplyColorSchemeLightOnDark) {
|
TEST_F(ComputedStyleTest, ApplyColorSchemeLightOnDark) {
|
||||||
ScopedCSSColorSchemeUARenderingForTest scoped_ua_enabled(true);
|
|
||||||
|
|
||||||
std::unique_ptr<DummyPageHolder> dummy_page_holder =
|
std::unique_ptr<DummyPageHolder> dummy_page_holder =
|
||||||
std::make_unique<DummyPageHolder>(IntSize(0, 0), nullptr);
|
std::make_unique<DummyPageHolder>(IntSize(0, 0), nullptr);
|
||||||
Document& document = dummy_page_holder->GetDocument();
|
Document& document = dummy_page_holder->GetDocument();
|
||||||
@ -714,8 +685,6 @@ TEST_F(ComputedStyleTest, ApplyColorSchemeLightOnDark) {
|
|||||||
TEST_F(ComputedStyleTest, ApplyInternalLightDarkColor) {
|
TEST_F(ComputedStyleTest, ApplyInternalLightDarkColor) {
|
||||||
using css_test_helpers::ParseDeclarationBlock;
|
using css_test_helpers::ParseDeclarationBlock;
|
||||||
|
|
||||||
ScopedCSSColorSchemeUARenderingForTest scoped_ua_enabled(true);
|
|
||||||
|
|
||||||
std::unique_ptr<DummyPageHolder> dummy_page_holder =
|
std::unique_ptr<DummyPageHolder> dummy_page_holder =
|
||||||
std::make_unique<DummyPageHolder>(IntSize(0, 0), nullptr);
|
std::make_unique<DummyPageHolder>(IntSize(0, 0), nullptr);
|
||||||
Document& document = dummy_page_holder->GetDocument();
|
Document& document = dummy_page_holder->GetDocument();
|
||||||
@ -758,8 +727,6 @@ TEST_F(ComputedStyleTest, ApplyInternalLightDarkColor) {
|
|||||||
TEST_F(ComputedStyleTest, ApplyInternalLightDarkBackgroundImage) {
|
TEST_F(ComputedStyleTest, ApplyInternalLightDarkBackgroundImage) {
|
||||||
using css_test_helpers::ParseDeclarationBlock;
|
using css_test_helpers::ParseDeclarationBlock;
|
||||||
|
|
||||||
ScopedCSSColorSchemeUARenderingForTest scoped_ua_enabled(true);
|
|
||||||
|
|
||||||
std::unique_ptr<DummyPageHolder> dummy_page_holder =
|
std::unique_ptr<DummyPageHolder> dummy_page_holder =
|
||||||
std::make_unique<DummyPageHolder>(IntSize(0, 0), nullptr);
|
std::make_unique<DummyPageHolder>(IntSize(0, 0), nullptr);
|
||||||
Document& document = dummy_page_holder->GetDocument();
|
Document& document = dummy_page_holder->GetDocument();
|
||||||
|
@ -711,10 +711,6 @@ unsigned Internals::workerThreadCount() const {
|
|||||||
return WorkerThread::WorkerThreadCount();
|
return WorkerThread::WorkerThreadCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Internals::isFormControlsRefreshEnabled() const {
|
|
||||||
return ::features::IsFormControlsRefreshEnabled();
|
|
||||||
}
|
|
||||||
|
|
||||||
GCObservation* Internals::observeGC(ScriptValue script_value) {
|
GCObservation* Internals::observeGC(ScriptValue script_value) {
|
||||||
v8::Local<v8::Value> observed_value = script_value.V8Value();
|
v8::Local<v8::Value> observed_value = script_value.V8Value();
|
||||||
DCHECK(!observed_value.IsEmpty());
|
DCHECK(!observed_value.IsEmpty());
|
||||||
|
@ -333,8 +333,6 @@ class Internals final : public ScriptWrappable {
|
|||||||
InternalRuntimeFlags* runtimeFlags() const;
|
InternalRuntimeFlags* runtimeFlags() const;
|
||||||
unsigned workerThreadCount() const;
|
unsigned workerThreadCount() const;
|
||||||
|
|
||||||
bool isFormControlsRefreshEnabled() const;
|
|
||||||
|
|
||||||
String resolveModuleSpecifier(const String& specifier,
|
String resolveModuleSpecifier(const String& specifier,
|
||||||
const String& base_url_string,
|
const String& base_url_string,
|
||||||
Document*,
|
Document*,
|
||||||
|
@ -185,7 +185,6 @@
|
|||||||
readonly attribute InternalSettings settings;
|
readonly attribute InternalSettings settings;
|
||||||
readonly attribute InternalRuntimeFlags runtimeFlags;
|
readonly attribute InternalRuntimeFlags runtimeFlags;
|
||||||
readonly attribute unsigned long workerThreadCount;
|
readonly attribute unsigned long workerThreadCount;
|
||||||
readonly attribute boolean isFormControlsRefreshEnabled;
|
|
||||||
|
|
||||||
// Flag for layerTreeAsText. The value must be kept in sync with the value
|
// Flag for layerTreeAsText. The value must be kept in sync with the value
|
||||||
// of LayerTreeFlags in layers_as_json.h.
|
// of LayerTreeFlags in layers_as_json.h.
|
||||||
|
@ -678,10 +678,6 @@ void WebRuntimeFeatures::EnableTargetBlankImpliesNoOpener(bool enable) {
|
|||||||
RuntimeEnabledFeatures::SetTargetBlankImpliesNoOpenerEnabled(enable);
|
RuntimeEnabledFeatures::SetTargetBlankImpliesNoOpenerEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebRuntimeFeatures::EnableCSSColorSchemeUARendering(bool enable) {
|
|
||||||
RuntimeEnabledFeatures::SetCSSColorSchemeUARenderingEnabled(enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
void WebRuntimeFeatures::EnableDocumentTransition(bool enable) {
|
void WebRuntimeFeatures::EnableDocumentTransition(bool enable) {
|
||||||
RuntimeEnabledFeatures::SetDocumentTransitionEnabled(enable);
|
RuntimeEnabledFeatures::SetDocumentTransitionEnabled(enable);
|
||||||
}
|
}
|
||||||
|
@ -329,32 +329,11 @@ void GraphicsContext::CompositeRecord(sk_sp<PaintRecord> record,
|
|||||||
canvas_->restore();
|
canvas_->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
int AdjustedFocusRingOffset(int offset) {
|
|
||||||
// For FormControlsRefresh we just use the value of outline-offset so we don't
|
|
||||||
// need to call this method.
|
|
||||||
DCHECK(!::features::IsFormControlsRefreshEnabled());
|
|
||||||
|
|
||||||
#if defined(OS_MAC)
|
|
||||||
return offset + 2;
|
|
||||||
#else
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
int GraphicsContext::FocusRingOutsetExtent(int offset, int width) {
|
int GraphicsContext::FocusRingOutsetExtent(int offset, int width) {
|
||||||
// Unlike normal outlines (whole width is outside of the offset), focus
|
// Unlike normal outlines (whole width is outside of the offset), focus
|
||||||
// rings can be drawn with the center of the path aligned with the offset, so
|
// rings can be drawn with the center of the path aligned with the offset, so
|
||||||
// only half of the width is outside of the offset.
|
// only 2/3 of the width is outside of the offset.
|
||||||
if (::features::IsFormControlsRefreshEnabled()) {
|
return offset + std::ceil(width / 3.f) * 2;
|
||||||
// For FormControlsRefresh 2/3 of the width is outside of the offset.
|
|
||||||
return offset + std::ceil(width / 3.f) * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return AdjustedFocusRingOffset(offset) + (width + 1) / 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsContext::DrawFocusRingPath(const SkPath& path,
|
void GraphicsContext::DrawFocusRingPath(const SkPath& path,
|
||||||
@ -398,10 +377,6 @@ void GraphicsContext::DrawFocusRingInternal(const Vector<IntRect>& rects,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
SkRegion focus_ring_region;
|
SkRegion focus_ring_region;
|
||||||
if (!::features::IsFormControlsRefreshEnabled()) {
|
|
||||||
// For FormControlsRefresh we don't need to adjust the offset.
|
|
||||||
offset = AdjustedFocusRingOffset(offset);
|
|
||||||
}
|
|
||||||
for (unsigned i = 0; i < rect_count; i++) {
|
for (unsigned i = 0; i < rect_count; i++) {
|
||||||
SkIRect r = rects[i];
|
SkIRect r = rects[i];
|
||||||
if (r.isEmpty())
|
if (r.isEmpty())
|
||||||
@ -436,29 +411,25 @@ void GraphicsContext::DrawFocusRing(const Vector<IntRect>& rects,
|
|||||||
const Color& inner_color =
|
const Color& inner_color =
|
||||||
color_scheme == mojom::blink::ColorScheme::kDark ? SK_ColorWHITE : color;
|
color_scheme == mojom::blink::ColorScheme::kDark ? SK_ColorWHITE : color;
|
||||||
#endif
|
#endif
|
||||||
if (::features::IsFormControlsRefreshEnabled()) {
|
// The focus ring is made of two borders which have a 2:1 ratio.
|
||||||
// The focus ring is made of two borders which have a 2:1 ratio.
|
const float first_border_width = (width / 3) * 2;
|
||||||
const float first_border_width = (width / 3) * 2;
|
const float second_border_width = width - first_border_width;
|
||||||
const float second_border_width = width - first_border_width;
|
|
||||||
|
|
||||||
// How much space the focus ring would like to take from the actual border.
|
// How much space the focus ring would like to take from the actual border.
|
||||||
const float inside_border_width = 1;
|
const float inside_border_width = 1;
|
||||||
if (min_border_width >= inside_border_width) {
|
if (min_border_width >= inside_border_width) {
|
||||||
offset -= inside_border_width;
|
offset -= inside_border_width;
|
||||||
}
|
|
||||||
const Color& outer_color = color_scheme == mojom::blink::ColorScheme::kDark
|
|
||||||
? SkColorSetRGB(0x10, 0x10, 0x10)
|
|
||||||
: SK_ColorWHITE;
|
|
||||||
// The outer ring is drawn first, and we overdraw to ensure no gaps or AA
|
|
||||||
// artifacts.
|
|
||||||
DrawFocusRingInternal(rects, first_border_width,
|
|
||||||
offset + std::ceil(second_border_width),
|
|
||||||
border_radius, outer_color);
|
|
||||||
DrawFocusRingInternal(rects, first_border_width, offset, border_radius,
|
|
||||||
inner_color);
|
|
||||||
} else {
|
|
||||||
DrawFocusRingInternal(rects, width, offset, border_radius, inner_color);
|
|
||||||
}
|
}
|
||||||
|
const Color& outer_color = color_scheme == mojom::blink::ColorScheme::kDark
|
||||||
|
? SkColorSetRGB(0x10, 0x10, 0x10)
|
||||||
|
: SK_ColorWHITE;
|
||||||
|
// The outer ring is drawn first, and we overdraw to ensure no gaps or AA
|
||||||
|
// artifacts.
|
||||||
|
DrawFocusRingInternal(rects, first_border_width,
|
||||||
|
offset + std::ceil(second_border_width), border_radius,
|
||||||
|
outer_color);
|
||||||
|
DrawFocusRingInternal(rects, first_border_width, offset, border_radius,
|
||||||
|
inner_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void EnforceDotsAtEndpoints(GraphicsContext& context,
|
static void EnforceDotsAtEndpoints(GraphicsContext& context,
|
||||||
|
@ -420,26 +420,7 @@ void DrawPlatformFocusRing(const PrimitiveType& primitive,
|
|||||||
flags.setColor(color);
|
flags.setColor(color);
|
||||||
flags.setStrokeWidth(width);
|
flags.setStrokeWidth(width);
|
||||||
|
|
||||||
if (::features::IsFormControlsRefreshEnabled()) {
|
DrawFocusRingPrimitive(primitive, canvas, flags, border_radius);
|
||||||
DrawFocusRingPrimitive(primitive, canvas, flags, border_radius);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(OS_MAC)
|
|
||||||
flags.setAlpha(64);
|
|
||||||
const float corner_radius = (width - 1) * 0.5f;
|
|
||||||
#else
|
|
||||||
const float corner_radius = width;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DrawFocusRingPrimitive(primitive, canvas, flags, corner_radius);
|
|
||||||
|
|
||||||
#if defined(OS_MAC)
|
|
||||||
// Inner part
|
|
||||||
flags.setAlpha(128);
|
|
||||||
flags.setStrokeWidth(flags.getStrokeWidth() * 0.5f);
|
|
||||||
DrawFocusRingPrimitive(primitive, canvas, flags, corner_radius);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template void PLATFORM_EXPORT
|
template void PLATFORM_EXPORT
|
||||||
|
@ -502,15 +502,6 @@
|
|||||||
name: "CSSCaseSensitiveSelector",
|
name: "CSSCaseSensitiveSelector",
|
||||||
status: "test",
|
status: "test",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
// When the color-scheme is supported via the CSS color-scheme property
|
|
||||||
// (CSSColorScheme) or the meta tag (MetaColorScheme), the only UA
|
|
||||||
// rendering change is for the canvas background and the :root element
|
|
||||||
// color property. Enabling this runtime flag will enable dark UA
|
|
||||||
// rendering for form controls, scrollbars, etc.
|
|
||||||
name: "CSSColorSchemeUARendering",
|
|
||||||
status: "stable",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "CSSColorTypedOM",
|
name: "CSSColorTypedOM",
|
||||||
status: "experimental",
|
status: "experimental",
|
||||||
|
@ -249,13 +249,8 @@ void LocaleICU::InitializeCalendar() {
|
|||||||
UCAL_FIRST_DAY_OF_WEEK) -
|
UCAL_FIRST_DAY_OF_WEEK) -
|
||||||
UCAL_SUNDAY;
|
UCAL_SUNDAY;
|
||||||
|
|
||||||
if (features::IsFormControlsRefreshEnabled()) {
|
week_day_short_labels_ = CreateLabelVector(
|
||||||
week_day_short_labels_ = CreateLabelVector(
|
short_date_format_, UDAT_NARROW_WEEKDAYS, UCAL_SUNDAY, 7);
|
||||||
short_date_format_, UDAT_NARROW_WEEKDAYS, UCAL_SUNDAY, 7);
|
|
||||||
} else {
|
|
||||||
week_day_short_labels_ = CreateLabelVector(
|
|
||||||
short_date_format_, UDAT_SHORT_WEEKDAYS, UCAL_SUNDAY, 7);
|
|
||||||
}
|
|
||||||
if (!week_day_short_labels_)
|
if (!week_day_short_labels_)
|
||||||
week_day_short_labels_ = CreateFallbackWeekDayShortLabels();
|
week_day_short_labels_ = CreateFallbackWeekDayShortLabels();
|
||||||
}
|
}
|
||||||
|
@ -137,9 +137,7 @@ const Vector<String>& LocaleMac::WeekDayShortLabels() {
|
|||||||
if (!week_day_short_labels_.IsEmpty())
|
if (!week_day_short_labels_.IsEmpty())
|
||||||
return week_day_short_labels_;
|
return week_day_short_labels_;
|
||||||
week_day_short_labels_.ReserveCapacity(7);
|
week_day_short_labels_.ReserveCapacity(7);
|
||||||
NSArray* array = features::IsFormControlsRefreshEnabled()
|
NSArray* array = [ShortDateFormatter() veryShortWeekdaySymbols];
|
||||||
? [ShortDateFormatter() veryShortWeekdaySymbols]
|
|
||||||
: [ShortDateFormatter() shortWeekdaySymbols];
|
|
||||||
if ([array count] == 7) {
|
if ([array count] == 7) {
|
||||||
for (unsigned i = 0; i < 7; ++i)
|
for (unsigned i = 0; i < 7; ++i)
|
||||||
week_day_short_labels_.push_back(String(array[i]));
|
week_day_short_labels_.push_back(String(array[i]));
|
||||||
|
@ -293,24 +293,14 @@ void LocaleWin::EnsureMonthLabels() {
|
|||||||
void LocaleWin::EnsureWeekDayShortLabels() {
|
void LocaleWin::EnsureWeekDayShortLabels() {
|
||||||
if (!week_day_short_labels_.IsEmpty())
|
if (!week_day_short_labels_.IsEmpty())
|
||||||
return;
|
return;
|
||||||
const LCTYPE kTypes[7] = {LOCALE_SABBREVDAYNAME7, // Sunday
|
const LCTYPE kTypes[7] = {LOCALE_SSHORTESTDAYNAME7, // Sunday
|
||||||
LOCALE_SABBREVDAYNAME1, // Monday
|
LOCALE_SSHORTESTDAYNAME1, // Monday
|
||||||
LOCALE_SABBREVDAYNAME2, LOCALE_SABBREVDAYNAME3,
|
LOCALE_SSHORTESTDAYNAME2, LOCALE_SSHORTESTDAYNAME3,
|
||||||
LOCALE_SABBREVDAYNAME4, LOCALE_SABBREVDAYNAME5,
|
LOCALE_SSHORTESTDAYNAME4, LOCALE_SSHORTESTDAYNAME5,
|
||||||
LOCALE_SABBREVDAYNAME6};
|
LOCALE_SSHORTESTDAYNAME6};
|
||||||
const LCTYPE kTypesRefresh[7] = {
|
|
||||||
LOCALE_SSHORTESTDAYNAME7, // Sunday
|
|
||||||
LOCALE_SSHORTESTDAYNAME1, // Monday
|
|
||||||
LOCALE_SSHORTESTDAYNAME2, LOCALE_SSHORTESTDAYNAME3,
|
|
||||||
LOCALE_SSHORTESTDAYNAME4, LOCALE_SSHORTESTDAYNAME5,
|
|
||||||
LOCALE_SSHORTESTDAYNAME6};
|
|
||||||
week_day_short_labels_.ReserveCapacity(base::size(kTypes));
|
week_day_short_labels_.ReserveCapacity(base::size(kTypes));
|
||||||
for (unsigned i = 0; i < base::size(kTypes); ++i) {
|
for (unsigned i = 0; i < base::size(kTypes); ++i) {
|
||||||
if (features::IsFormControlsRefreshEnabled()) {
|
week_day_short_labels_.push_back(GetLocaleInfoString(kTypes[i]));
|
||||||
week_day_short_labels_.push_back(GetLocaleInfoString(kTypesRefresh[i]));
|
|
||||||
} else {
|
|
||||||
week_day_short_labels_.push_back(GetLocaleInfoString(kTypes[i]));
|
|
||||||
}
|
|
||||||
if (week_day_short_labels_.back().IsEmpty()) {
|
if (week_day_short_labels_.back().IsEmpty()) {
|
||||||
week_day_short_labels_.Shrink(0);
|
week_day_short_labels_.Shrink(0);
|
||||||
week_day_short_labels_.ReserveCapacity(base::size(WTF::kWeekdayName));
|
week_day_short_labels_.ReserveCapacity(base::size(WTF::kWeekdayName));
|
||||||
|
@ -189,23 +189,13 @@ TEST_F(LocaleWinTest, monthLabels) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(LocaleWinTest, weekDayShortLabels) {
|
TEST_F(LocaleWinTest, weekDayShortLabels) {
|
||||||
if (features::IsFormControlsRefreshEnabled()) {
|
EXPECT_EQ("Su", WeekDayShortLabel(kEnglishUS, kSunday));
|
||||||
EXPECT_EQ("Su", WeekDayShortLabel(kEnglishUS, kSunday));
|
EXPECT_EQ("We", WeekDayShortLabel(kEnglishUS, kWednesday));
|
||||||
EXPECT_EQ("We", WeekDayShortLabel(kEnglishUS, kWednesday));
|
EXPECT_EQ("Sa", WeekDayShortLabel(kEnglishUS, kSaturday));
|
||||||
EXPECT_EQ("Sa", WeekDayShortLabel(kEnglishUS, kSaturday));
|
|
||||||
|
|
||||||
EXPECT_EQ("di", WeekDayShortLabel(kFrenchFR, kSunday));
|
EXPECT_EQ("di", WeekDayShortLabel(kFrenchFR, kSunday));
|
||||||
EXPECT_EQ("me", WeekDayShortLabel(kFrenchFR, kWednesday));
|
EXPECT_EQ("me", WeekDayShortLabel(kFrenchFR, kWednesday));
|
||||||
EXPECT_EQ("sa", WeekDayShortLabel(kFrenchFR, kSaturday));
|
EXPECT_EQ("sa", WeekDayShortLabel(kFrenchFR, kSaturday));
|
||||||
} else {
|
|
||||||
EXPECT_EQ("Sun", WeekDayShortLabel(kEnglishUS, kSunday));
|
|
||||||
EXPECT_EQ("Wed", WeekDayShortLabel(kEnglishUS, kWednesday));
|
|
||||||
EXPECT_EQ("Sat", WeekDayShortLabel(kEnglishUS, kSaturday));
|
|
||||||
|
|
||||||
EXPECT_EQ("dim.", WeekDayShortLabel(kFrenchFR, kSunday));
|
|
||||||
EXPECT_EQ("mer.", WeekDayShortLabel(kFrenchFR, kWednesday));
|
|
||||||
EXPECT_EQ("sam.", WeekDayShortLabel(kFrenchFR, kSaturday));
|
|
||||||
}
|
|
||||||
EXPECT_EQ("\xE6\x97\xA5", WeekDayShortLabel(kJapaneseJP, kSunday).Utf8());
|
EXPECT_EQ("\xE6\x97\xA5", WeekDayShortLabel(kJapaneseJP, kSunday).Utf8());
|
||||||
EXPECT_EQ("\xE6\xB0\xB4", WeekDayShortLabel(kJapaneseJP, kWednesday).Utf8());
|
EXPECT_EQ("\xE6\xB0\xB4", WeekDayShortLabel(kJapaneseJP, kWednesday).Utf8());
|
||||||
EXPECT_EQ("\xE5\x9C\x9F", WeekDayShortLabel(kJapaneseJP, kSaturday).Utf8());
|
EXPECT_EQ("\xE5\x9C\x9F", WeekDayShortLabel(kJapaneseJP, kSaturday).Utf8());
|
||||||
|
@ -724,7 +724,7 @@ crbug.com/6606 external/wpt/mathml/* [ Skip ]
|
|||||||
|
|
||||||
crbug.com/1034944 webexposed/global-interface-listing.html [ Skip ]
|
crbug.com/1034944 webexposed/global-interface-listing.html [ Skip ]
|
||||||
|
|
||||||
# TODO(iopopesc) these need to be rebaselined for FormControlsRefresh focus ring.
|
# TODO(iopopesc) these need to be rebaselined for focus ring changes.
|
||||||
crbug.com/1035582 fast/css/focus-ring-detached.html [ Failure ]
|
crbug.com/1035582 fast/css/focus-ring-detached.html [ Failure ]
|
||||||
crbug.com/1035582 fast/events/sequential-focus-navigation-starting-point.html [ Skip ]
|
crbug.com/1035582 fast/events/sequential-focus-navigation-starting-point.html [ Skip ]
|
||||||
crbug.com/1035582 fast/inline/continuation-outlines-with-layers.html [ Failure ]
|
crbug.com/1035582 fast/inline/continuation-outlines-with-layers.html [ Failure ]
|
||||||
|
4
third_party/blink/web_tests/TestExpectations
vendored
4
third_party/blink/web_tests/TestExpectations
vendored
@ -1361,7 +1361,7 @@ crbug.com/1133390 virtual/css-calc-infinity-and-nan/external/wpt/css/css-values/
|
|||||||
# ====== Style team owned tests to here ======
|
# ====== Style team owned tests to here ======
|
||||||
|
|
||||||
|
|
||||||
# Bug in FormControlsRefresh <select multiple> tap behavior:
|
# Bug in <select multiple> tap behavior:
|
||||||
crbug.com/1045672 fast/forms/select/listbox-tap.html [ Failure ]
|
crbug.com/1045672 fast/forms/select/listbox-tap.html [ Failure ]
|
||||||
|
|
||||||
### sheriff 2019-07-16
|
### sheriff 2019-07-16
|
||||||
@ -1418,8 +1418,6 @@ crbug.com/520194 http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-worker
|
|||||||
|
|
||||||
crbug.com/892032 fast/events/wheel/wheel-latched-scroll-node-removed.html [ Pass Failure ]
|
crbug.com/892032 fast/events/wheel/wheel-latched-scroll-node-removed.html [ Pass Failure ]
|
||||||
|
|
||||||
|
|
||||||
# Tests that fail when FormControlsRefresh is enabled:
|
|
||||||
crbug.com/1051136 fast/forms/select/listbox-overlay-scrollbar.html [ Failure ]
|
crbug.com/1051136 fast/forms/select/listbox-overlay-scrollbar.html [ Failure ]
|
||||||
|
|
||||||
# These performance-sensitive user-timing tests are flaky in debug on all platforms, and flaky on all configurations of windows.
|
# These performance-sensitive user-timing tests are flaky in debug on all platforms, and flaky on all configurations of windows.
|
||||||
|
@ -655,7 +655,7 @@
|
|||||||
{
|
{
|
||||||
"prefix": "system-color-compute",
|
"prefix": "system-color-compute",
|
||||||
"bases": ["external/wpt/css/css-color"],
|
"bases": ["external/wpt/css/css-color"],
|
||||||
"args": ["--enable-blink-features=CSSColorScheme,CSSColorSchemeUARendering,CSSSystemColorComputeToSelf"]
|
"args": ["--enable-blink-features=CSSColorScheme,CSSSystemColorComputeToSelf"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"prefix": "dark-color-scheme",
|
"prefix": "dark-color-scheme",
|
||||||
@ -663,7 +663,7 @@
|
|||||||
"fast/forms/color-scheme",
|
"fast/forms/color-scheme",
|
||||||
"http/tests/eye-dropper"],
|
"http/tests/eye-dropper"],
|
||||||
"args": ["--force-dark-mode",
|
"args": ["--force-dark-mode",
|
||||||
"--enable-blink-features=CSSColorScheme,CSSColorSchemeUARendering",
|
"--enable-blink-features=CSSColorScheme",
|
||||||
"--enable-features=EyeDropper"]
|
"--enable-features=EyeDropper"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -17,11 +17,7 @@ let t = async_test('Test year list view size');
|
|||||||
function test1() {
|
function test1() {
|
||||||
var dateViewHeight = popupWindow.global.picker.height();
|
var dateViewHeight = popupWindow.global.picker.height();
|
||||||
clickMonthPopupButton();
|
clickMonthPopupButton();
|
||||||
if (popupWindow.global.params.isFormControlsRefreshEnabled) {
|
assert_equals(dateViewHeight, popupWindow.global.picker.height());
|
||||||
assert_equals(dateViewHeight, popupWindow.global.picker.height());
|
|
||||||
} else {
|
|
||||||
assert_not_equals(dateViewHeight, popupWindow.global.picker.height());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
t.step(() => {
|
t.step(() => {
|
||||||
|
4
third_party/blink/web_tests/fast/forms/calendar-picker/resources/calendar-picker-common.js
vendored
4
third_party/blink/web_tests/fast/forms/calendar-picker/resources/calendar-picker-common.js
vendored
@ -173,7 +173,7 @@ function skipAnimationAndGetPositionOfTodayButton() {
|
|||||||
popupWindow.global.picker.datePicker.calendarTableView :
|
popupWindow.global.picker.datePicker.calendarTableView :
|
||||||
popupWindow.global.picker.calendarTableView;
|
popupWindow.global.picker.calendarTableView;
|
||||||
var buttonElement =
|
var buttonElement =
|
||||||
calendarTableView.element.querySelector('.today-button-refresh');
|
calendarTableView.element.querySelector('.today-button');
|
||||||
var offset = cumulativeOffset(buttonElement);
|
var offset = cumulativeOffset(buttonElement);
|
||||||
return {
|
return {
|
||||||
x: offset[0] + buttonElement.offsetWidth / 2,
|
x: offset[0] + buttonElement.offsetWidth / 2,
|
||||||
@ -195,7 +195,7 @@ function clickTodayButton() {
|
|||||||
function skipAnimationAndGetPositionOfThisMonthButton() {
|
function skipAnimationAndGetPositionOfThisMonthButton() {
|
||||||
skipAnimation();
|
skipAnimation();
|
||||||
const button =
|
const button =
|
||||||
popupWindow.global.picker.querySelector('.today-button-refresh');
|
popupWindow.global.picker.querySelector('.today-button');
|
||||||
var offset = cumulativeOffset(button);
|
var offset = cumulativeOffset(button);
|
||||||
return {
|
return {
|
||||||
x: offset[0] + button.offsetWidth / 2,
|
x: offset[0] + button.offsetWidth / 2,
|
||||||
|
@ -9,9 +9,7 @@ testRunner.waitUntilDone();
|
|||||||
<input type=month id=month value="2018-08">
|
<input type=month id=month value="2018-08">
|
||||||
<script>
|
<script>
|
||||||
openPickerAppearanceOnly(document.getElementById('month'), function() {
|
openPickerAppearanceOnly(document.getElementById('month'), function() {
|
||||||
if (popupWindow.global.params.isFormControlsRefreshEnabled) {
|
hoverOverMonthButtonForMonthPicker(2018, 5);
|
||||||
hoverOverMonthButtonForMonthPicker(2018, 5);
|
|
||||||
}
|
|
||||||
testRunner.notifyDone()
|
testRunner.notifyDone()
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
7
third_party/blink/web_tests/http/tests/forms/resources/date-picker-keyboard-cross-domain-iframe.html
vendored
7
third_party/blink/web_tests/http/tests/forms/resources/date-picker-keyboard-cross-domain-iframe.html
vendored
@ -6,12 +6,7 @@
|
|||||||
|
|
||||||
input_date.focus();
|
input_date.focus();
|
||||||
|
|
||||||
if (internals.isFormControlsRefreshEnabled) {
|
eventSender.keyDown(" ");
|
||||||
eventSender.keyDown(" ");
|
|
||||||
} else {
|
|
||||||
// Old picker needs Alt+ArrowDown
|
|
||||||
eventSender.keyDown("ArrowDown", ["altKey"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Advance date to the next day
|
// Advance date to the next day
|
||||||
eventSender.keyDown("ArrowRight");
|
eventSender.keyDown("ArrowRight");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
This suite runs the tests with
|
This suite runs the tests with
|
||||||
|
|
||||||
--enable-blink-features=CSSColorScheme,CSSColorSchemeUARendering,CSSSystemColorComputeToSelf
|
--enable-blink-features=CSSColorScheme,CSSSystemColorComputeToSelf
|
||||||
|
|
||||||
in order to enable the color-scheme property and make system color keywords compute to themselves.
|
in order to enable the color-scheme property and make system color keywords compute to themselves.
|
||||||
|
@ -219,26 +219,7 @@ const base::Feature kEyeDropper {
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool IsEyeDropperEnabled() {
|
bool IsEyeDropperEnabled() {
|
||||||
return IsFormControlsRefreshEnabled() &&
|
return base::FeatureList::IsEnabled(features::kEyeDropper);
|
||||||
base::FeatureList::IsEnabled(features::kEyeDropper);
|
|
||||||
}
|
|
||||||
|
|
||||||
const base::Feature kCSSColorSchemeUARendering = {
|
|
||||||
"CSSColorSchemeUARendering", base::FEATURE_ENABLED_BY_DEFAULT};
|
|
||||||
|
|
||||||
bool IsCSSColorSchemeUARenderingEnabled() {
|
|
||||||
static const bool css_color_scheme_ua_rendering_enabled =
|
|
||||||
base::FeatureList::IsEnabled(features::kCSSColorSchemeUARendering);
|
|
||||||
return css_color_scheme_ua_rendering_enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
const base::Feature kFormControlsRefresh = {"FormControlsRefresh",
|
|
||||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
|
||||||
|
|
||||||
bool IsFormControlsRefreshEnabled() {
|
|
||||||
static const bool form_controls_refresh_enabled =
|
|
||||||
base::FeatureList::IsEnabled(features::kFormControlsRefresh);
|
|
||||||
return form_controls_refresh_enabled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable the common select popup.
|
// Enable the common select popup.
|
||||||
|
@ -88,16 +88,6 @@ COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsForcedColorsEnabled();
|
|||||||
COMPONENT_EXPORT(UI_BASE_FEATURES) extern const base::Feature kEyeDropper;
|
COMPONENT_EXPORT(UI_BASE_FEATURES) extern const base::Feature kEyeDropper;
|
||||||
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsEyeDropperEnabled();
|
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsEyeDropperEnabled();
|
||||||
|
|
||||||
// Used to enable form controls and scrollbar dark mode rendering.
|
|
||||||
COMPONENT_EXPORT(UI_BASE_FEATURES)
|
|
||||||
extern const base::Feature kCSSColorSchemeUARendering;
|
|
||||||
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsCSSColorSchemeUARenderingEnabled();
|
|
||||||
|
|
||||||
// Used to enable the new controls UI.
|
|
||||||
COMPONENT_EXPORT(UI_BASE_FEATURES)
|
|
||||||
extern const base::Feature kFormControlsRefresh;
|
|
||||||
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsFormControlsRefreshEnabled();
|
|
||||||
|
|
||||||
// Used to enable the common select popup.
|
// Used to enable the common select popup.
|
||||||
COMPONENT_EXPORT(UI_BASE_FEATURES)
|
COMPONENT_EXPORT(UI_BASE_FEATURES)
|
||||||
extern const base::Feature kUseCommonSelectPopup;
|
extern const base::Feature kUseCommonSelectPopup;
|
||||||
|
@ -103,7 +103,6 @@ NativeThemeAura* NativeThemeAura::web_instance() {
|
|||||||
|
|
||||||
SkColor NativeThemeAura::FocusRingColorForBaseColor(SkColor base_color) const {
|
SkColor NativeThemeAura::FocusRingColorForBaseColor(SkColor base_color) const {
|
||||||
#if defined(OS_APPLE)
|
#if defined(OS_APPLE)
|
||||||
DCHECK(features::IsFormControlsRefreshEnabled());
|
|
||||||
// On Mac OSX, the system Accent Color setting is darkened a bit
|
// On Mac OSX, the system Accent Color setting is darkened a bit
|
||||||
// for better contrast.
|
// for better contrast.
|
||||||
return SkColorSetA(base_color, 166);
|
return SkColorSetA(base_color, 166);
|
||||||
@ -184,12 +183,6 @@ void NativeThemeAura::PaintArrowButton(
|
|||||||
cc::PaintFlags flags;
|
cc::PaintFlags flags;
|
||||||
flags.setColor(bg_color);
|
flags.setColor(bg_color);
|
||||||
|
|
||||||
if (!features::IsFormControlsRefreshEnabled()) {
|
|
||||||
canvas->drawIRect(gfx::RectToSkIRect(rect), flags);
|
|
||||||
|
|
||||||
return PaintArrow(canvas, rect, direction, arrow_color);
|
|
||||||
}
|
|
||||||
|
|
||||||
SkScalar upper_left_radius = 0;
|
SkScalar upper_left_radius = 0;
|
||||||
SkScalar lower_left_radius = 0;
|
SkScalar lower_left_radius = 0;
|
||||||
SkScalar upper_right_radius = 0;
|
SkScalar upper_right_radius = 0;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -109,9 +109,7 @@ namespace ui {
|
|||||||
|
|
||||||
// static
|
// static
|
||||||
NativeTheme* NativeTheme::GetInstanceForWeb() {
|
NativeTheme* NativeTheme::GetInstanceForWeb() {
|
||||||
if (features::IsFormControlsRefreshEnabled())
|
return NativeThemeAura::web_instance();
|
||||||
return NativeThemeAura::web_instance();
|
|
||||||
return NativeThemeMac::instance();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
@ -625,11 +623,7 @@ void NativeThemeMac::InitializeDarkModeStateAndObserver() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void NativeThemeMac::ConfigureWebInstance() {
|
void NativeThemeMac::ConfigureWebInstance() {
|
||||||
if (!features::IsFormControlsRefreshEnabled())
|
// NativeThemeAura is used as web instance so we need to initialize its state.
|
||||||
return;
|
|
||||||
|
|
||||||
// For FormControlsRefresh, NativeThemeAura is used as web instance so we need
|
|
||||||
// to initialize its state.
|
|
||||||
NativeTheme* web_instance = NativeTheme::GetInstanceForWeb();
|
NativeTheme* web_instance = NativeTheme::GetInstanceForWeb();
|
||||||
web_instance->set_use_dark_colors(IsDarkMode());
|
web_instance->set_use_dark_colors(IsDarkMode());
|
||||||
web_instance->set_preferred_color_scheme(CalculatePreferredColorScheme());
|
web_instance->set_preferred_color_scheme(CalculatePreferredColorScheme());
|
||||||
|
@ -110,8 +110,7 @@ class DesktopNativeWidgetTopLevelHandler : public aura::WindowObserver {
|
|||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
// For menus, on Windows versions that support drop shadow remove
|
// For menus, on Windows versions that support drop shadow remove
|
||||||
// the standard frame in order to keep just the shadow.
|
// the standard frame in order to keep just the shadow.
|
||||||
if (::features::IsFormControlsRefreshEnabled() &&
|
if (init_params.type == Widget::InitParams::TYPE_MENU)
|
||||||
init_params.type == Widget::InitParams::TYPE_MENU)
|
|
||||||
init_params.remove_standard_frame = true;
|
init_params.remove_standard_frame = true;
|
||||||
#endif
|
#endif
|
||||||
init_params.bounds = bounds;
|
init_params.bounds = bounds;
|
||||||
|
@ -109,8 +109,7 @@ void CalculateWindowStylesFromInitParams(
|
|||||||
break;
|
break;
|
||||||
case Widget::InitParams::TYPE_MENU:
|
case Widget::InitParams::TYPE_MENU:
|
||||||
*style |= WS_POPUP;
|
*style |= WS_POPUP;
|
||||||
if (::features::IsFormControlsRefreshEnabled() &&
|
if (params.remove_standard_frame) {
|
||||||
params.remove_standard_frame) {
|
|
||||||
// If the platform doesn't support drop shadow, decorate the Window
|
// If the platform doesn't support drop shadow, decorate the Window
|
||||||
// with just a border.
|
// with just a border.
|
||||||
if (ui::win::IsAeroGlassEnabled())
|
if (ui::win::IsAeroGlassEnabled())
|
||||||
|
Reference in New Issue
Block a user