0

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:
Mason Freed
2021-05-21 19:11:46 +00:00
committed by Chromium LUCI CQ
parent 01e5e64e47
commit 972aab37ea
90 changed files with 558 additions and 2057 deletions
android_webview/java/src/org/chromium/android_webview/common
chrome/browser
content
headless/lib/browser
testing/variations
third_party/blink
public
renderer
web_tests
ui

@ -122,8 +122,6 @@ public final class ProductionSupportedFlagList {
"Enables the new Java/JS Bridge code path with mojo implementation."),
Flag.baseFeature(
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(
BlinkFeatures.LAYOUT_NG_TABLE, "Enables Blink's next generation table layout."),
Flag.baseFeature(

@ -5685,17 +5685,6 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(
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)
{"auto-screen-brightness", flag_descriptions::kAutoScreenBrightnessName,
flag_descriptions::kAutoScreenBrightnessDescription, kOsCrOS,

@ -3003,16 +3003,6 @@
"owners": [ "almaher@microsoft.com" ],
"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",
"owners": [ "bokan" ],

@ -1280,16 +1280,6 @@ const char kForceUiDirectionDescription[] =
"Explicitly force the UI to left-to-right (LTR) or right-to-left (RTL) "
"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 kGlobalMediaControlsDescription[] =
"Enables the Global Media Controls UI in the toolbar.";

@ -750,12 +750,6 @@ extern const char kForceDirectionRtl[];
extern const char kForceUiDirectionName[];
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 kGlobalMediaControlsDescription[];

@ -4,7 +4,6 @@
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "cc/test/pixel_comparator.h"
@ -55,12 +54,6 @@ const cc::FuzzyPixelComparator mac_loose_comparator(
class FocusRingBrowserTest : public InProcessBrowserTest {
public:
FocusRingBrowserTest() {
feature_list_.InitWithFeatures(
{features::kFormControlsRefresh, features::kCSSColorSchemeUARendering},
{});
}
void SetUp() override {
EnablePixelOutput(/*force_device_scale_factor=*/1.f);
InProcessBrowserTest::SetUp();
@ -84,9 +77,6 @@ class FocusRingBrowserTest : public InProcessBrowserTest {
const cc::PixelComparator& comparator) {
base::ScopedAllowBlockingForTesting allow_blocking;
ASSERT_TRUE(features::IsFormControlsRefreshEnabled());
ASSERT_TRUE(features::IsCSSColorSchemeUARenderingEnabled());
base::FilePath 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,
gfx::Size(screenshot_width, screenshot_height), comparator));
}
private:
base::test::ScopedFeatureList feature_list_;
};
IN_PROC_BROWSER_TEST_F(FocusRingBrowserTest, Checkbox) {

@ -208,13 +208,11 @@ void UpdateFromSystemSettings(blink::RendererPreferences* prefs,
ConvertExplicitlyAllowedNetworkPortsPref(local_state);
}
if (::features::IsFormControlsRefreshEnabled()) {
#if defined(OS_MAC)
prefs->focus_ring_color = SkColorSetRGB(0x00, 0x5F, 0xCC);
prefs->focus_ring_color = SkColorSetRGB(0x00, 0x5F, 0xCC);
#else
prefs->focus_ring_color = SkColorSetRGB(0x10, 0x10, 0x10);
prefs->focus_ring_color = SkColorSetRGB(0x10, 0x10, 0x10);
#endif
}
}
} // namespace renderer_preferences_util

@ -21,7 +21,6 @@ namespace remote_cocoa {
class PopupWindowMac {
public:
PopupWindowMac(const gfx::Rect& content_rect,
bool has_shadow,
RenderWidgetHostViewCocoa* cocoa_view);
~PopupWindowMac();

@ -88,7 +88,6 @@
namespace remote_cocoa {
PopupWindowMac::PopupWindowMac(const gfx::Rect& content_rect,
bool has_shadow,
RenderWidgetHostViewCocoa* cocoa_view)
: cocoa_view_(cocoa_view) {
[cocoa_view_ setCloseOnDeactivate:YES];
@ -99,7 +98,7 @@ PopupWindowMac::PopupWindowMac(const gfx::Rect& content_rect,
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO]);
[popup_window_ setHasShadow:has_shadow];
[popup_window_ setHasShadow:YES];
[popup_window_ setLevel:NSPopUpMenuWindowLevel];
[popup_window_ setReleasedWhenClosed:NO];
[popup_window_ makeKeyAndOrderFront:nil];

@ -43,7 +43,7 @@ class RenderWidgetHostNSViewBridge : public mojom::RenderWidgetHostNSView,
RenderWidgetHostViewCocoa* GetNSView();
// 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 DisableDisplay() override;
void MakeFirstResponder() override;

@ -61,10 +61,8 @@ RenderWidgetHostViewCocoa* RenderWidgetHostNSViewBridge::GetNSView() {
return cocoa_view_;
}
void RenderWidgetHostNSViewBridge::InitAsPopup(const gfx::Rect& content_rect,
bool has_shadow) {
popup_window_ =
std::make_unique<PopupWindowMac>(content_rect, has_shadow, cocoa_view_);
void RenderWidgetHostNSViewBridge::InitAsPopup(const gfx::Rect& content_rect) {
popup_window_ = std::make_unique<PopupWindowMac>(content_rect, cocoa_view_);
}
void RenderWidgetHostNSViewBridge::SetParentWebContentsNSView(

@ -4,7 +4,6 @@
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "cc/test/pixel_comparator.h"
@ -44,12 +43,6 @@ namespace content {
class FormControlsBrowserTest : public ContentBrowserTest {
public:
FormControlsBrowserTest() {
feature_list_.InitWithFeatures(
{features::kFormControlsRefresh, features::kCSSColorSchemeUARendering},
{});
}
void SetUp() override {
EnablePixelOutput(/*force_device_scale_factor=*/1.f);
ContentBrowserTest::SetUp();
@ -72,9 +65,6 @@ class FormControlsBrowserTest : public ContentBrowserTest {
int screenshot_height) {
base::ScopedAllowBlockingForTesting allow_blocking;
ASSERT_TRUE(features::IsFormControlsRefreshEnabled());
ASSERT_TRUE(features::IsCSSColorSchemeUARenderingEnabled());
std::string platform_suffix;
#if defined(OS_MAC)
platform_suffix = "_mac";
@ -163,9 +153,6 @@ class FormControlsBrowserTest : public ContentBrowserTest {
#endif // defined(OS_WIN)
return false;
}
private:
base::test::ScopedFeatureList feature_list_;
};
IN_PROC_BROWSER_TEST_F(FormControlsBrowserTest, Checkbox) {

@ -384,10 +384,7 @@ void RenderWidgetHostViewMac::InitAsPopup(
SetContentBackgroundColor(SK_ColorTRANSPARENT);
// This path is used by the time/date picker.
// When FormControlsRefresh is enabled the popup window should use
// the native shadow.
bool has_shadow = features::IsFormControlsRefreshEnabled();
ns_view_->InitAsPopup(pos, has_shadow);
ns_view_->InitAsPopup(pos);
}
RenderWidgetHostViewBase*

@ -130,14 +130,6 @@ void SetRuntimeFeatureDefaultsForPlatform(
WebRuntimeFeatures::EnableMediaControlsExpandGesture(
base::FeatureList::IsEnabled(media::kMediaControlsExpandGesture));
#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 {
@ -357,7 +349,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
{"CompositeAfterPaint", blink::features::kCompositeAfterPaint},
{"ComputePressure", blink::features::kComputePressure,
kSetOnlyIfOverridden},
{"CSSColorSchemeUARendering", features::kCSSColorSchemeUARendering},
{"DeclarativeShadowDOM", blink::features::kDeclarativeShadowDOM},
{"DocumentTransition", blink::features::kDocumentTransition},
{"FeaturePolicyForClientHints",

@ -23,7 +23,7 @@ import "ui/gfx/range/mojom/range.mojom";
interface RenderWidgetHostNSView {
// Specify that the NSView will a popup (e.g, date/time picker) that will
// 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
// |parent_ns_view_id|.

@ -65,16 +65,11 @@ void UpdatePrefsFromSystemSettings(blink::RendererPreferences* prefs) {
#endif
// 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)
prefs->focus_ring_color = SkColorSetRGB(0x00, 0x5F, 0xCC);
prefs->focus_ring_color = SkColorSetRGB(0x00, 0x5F, 0xCC);
#else
prefs->focus_ring_color = SkColorSetRGB(0x10, 0x10, 0x10);
prefs->focus_ring_color = SkColorSetRGB(0x10, 0x10, 0x10);
#endif
}
}
} // 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": [
{
"platforms": [

@ -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_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_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_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"/>

@ -243,7 +243,6 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableParseUrlProtocolHandler(bool);
BLINK_PLATFORM_EXPORT static void EnableCSSColorSchemeUARendering(bool);
BLINK_PLATFORM_EXPORT static void EnableDocumentTransition(bool);
private:

@ -2426,8 +2426,6 @@ TEST_F(StyleEngineTest, ColorSchemeBaseBackgroundChange) {
}
TEST_F(StyleEngineTest, ColorSchemeOverride) {
ScopedCSSColorSchemeUARenderingForTest enable_color_scheme_ua(true);
ColorSchemeHelper color_scheme_helper(GetDocument());
color_scheme_helper.SetPreferredColorScheme(
mojom::blink::PreferredColorScheme::kLight);

@ -3170,8 +3170,7 @@ void WebViewImpl::UpdateRendererPreferences(
}
#endif
if (::features::IsFormControlsRefreshEnabled() &&
renderer_preferences_.use_custom_colors) {
if (renderer_preferences_.use_custom_colors) {
SetFocusRingColor(renderer_preferences_.focus_ring_color);
}

@ -2799,8 +2799,6 @@ TEST_P(VisualViewportTest, InSubtreeOfPageScale) {
}
TEST_F(VisualViewportSimTest, UsedColorSchemeFromRootElement) {
ScopedCSSColorSchemeUARenderingForTest color_scheme_ua_enabled(true);
ColorSchemeHelper color_scheme_helper(*(WebView().GetPage()));
color_scheme_helper.SetPreferredColorScheme(
mojom::blink::PreferredColorScheme::kDark);

@ -29,15 +29,6 @@ Vector<char> ChooserResourceLoader::GetSuggestionPickerJS() {
#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() {
#if !defined(OS_ANDROID)
return UncompressResourceAsBinary(IDR_PICKER_COMMON_CSS);

@ -20,9 +20,6 @@ class ChooserResourceLoader {
// Returns the picker common javascript as a string.
static Vector<char> GetPickerCommonJS();
// Returns the picker button stylesheet as a string.
static Vector<char> GetPickerButtonStyleSheet();
// Returns the suggestion picker stylesheet as a string.
static Vector<char> GetSuggestionPickerStyleSheet();

@ -44,7 +44,6 @@ namespace blink {
// Keep in sync with Actions in colorSuggestionPicker.js.
enum ColorPickerPopupAction {
kColorPickerPopupActionChooseOtherColor = -2,
kColorPickerPopupActionCancel = -1,
kColorPickerPopupActionSetValue = 0
};
@ -70,11 +69,7 @@ void ColorChooserPopupUIController::Trace(Visitor* visitor) const {
}
void ColorChooserPopupUIController::OpenUI() {
if (client_->ShouldShowSuggestions() ||
features::IsFormControlsRefreshEnabled())
OpenPopup();
else
OpenColorChooser();
OpenPopup();
}
void ColorChooserPopupUIController::EndChooser() {
@ -96,8 +91,6 @@ void ColorChooserPopupUIController::WriteDocument(SharedBuffer* data) {
void ColorChooserPopupUIController::WriteColorPickerDocument(
SharedBuffer* data) {
DCHECK(features::IsFormControlsRefreshEnabled());
IntRect anchor_rect_in_screen = chrome_client_->ViewportToScreen(
client_->ElementRectRelativeToViewport(), frame_->View());
@ -119,8 +112,7 @@ void ColorChooserPopupUIController::WriteColorPickerDocument(
AddProperty("shouldShowColorSuggestionPicker", false, data);
AddProperty("isEyeDropperEnabled", features::IsEyeDropperEnabled(), data);
#if defined(OS_MAC)
AddProperty("isBorderTransparent", features::IsFormControlsRefreshEnabled(),
data);
AddProperty("isBorderTransparent", true, data);
#endif
// 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
@ -169,8 +161,7 @@ void ColorChooserPopupUIController::WriteColorSuggestionPickerDocument(
data);
data->Append(ChooserResourceLoader::GetPickerCommonStyleSheet());
data->Append(ChooserResourceLoader::GetColorSuggestionPickerStyleSheet());
if (features::IsFormControlsRefreshEnabled())
data->Append(ChooserResourceLoader::GetColorPickerStyleSheet());
data->Append(ChooserResourceLoader::GetColorPickerStyleSheet());
PagePopupClient::AddString(
"</style></head><body>\n"
"<div id='main'>Loading...</div><script>\n"
@ -179,25 +170,19 @@ void ColorChooserPopupUIController::WriteColorSuggestionPickerDocument(
PagePopupClient::AddProperty("values", suggestion_values, data);
PagePopupClient::AddLocalizedProperty("otherColorLabel",
IDS_FORM_OTHER_COLOR_LABEL, data);
if (features::IsFormControlsRefreshEnabled()) {
PagePopupClient::AddProperty("selectedColor",
client_->CurrentColor().Serialized(), data);
}
PagePopupClient::AddProperty("selectedColor",
client_->CurrentColor().Serialized(), data);
AddProperty("anchorRectInScreen", anchor_rect_in_screen, data);
AddProperty("zoomFactor", ScaledZoomFactor(), data);
AddProperty("shouldShowColorSuggestionPicker", true, data);
AddProperty("isFormControlsRefreshEnabled",
features::IsFormControlsRefreshEnabled(), data);
AddProperty("isEyeDropperEnabled", features::IsEyeDropperEnabled(), data);
#if defined(OS_MAC)
AddProperty("isBorderTransparent", features::IsFormControlsRefreshEnabled(),
data);
AddProperty("isBorderTransparent", true, data);
#endif
PagePopupClient::AddString("};\n", data);
data->Append(ChooserResourceLoader::GetPickerCommonJS());
data->Append(ChooserResourceLoader::GetColorSuggestionPickerJS());
if (features::IsFormControlsRefreshEnabled())
data->Append(ChooserResourceLoader::GetColorPickerJS());
data->Append(ChooserResourceLoader::GetColorPickerJS());
data->Append(ChooserResourceLoader::GetColorPickerCommonJS());
PagePopupClient::AddString("</script></body>\n", data);
}
@ -213,10 +198,6 @@ void ColorChooserPopupUIController::SetValueAndClosePopup(
DCHECK(client_);
if (num_value == kColorPickerPopupActionSetValue)
SetValue(string_value);
if (num_value == kColorPickerPopupActionChooseOtherColor) {
DCHECK(!features::IsFormControlsRefreshEnabled());
OpenColorChooser();
}
CancelPopup();
}

@ -160,8 +160,7 @@ void ColorInputType::HandleDOMActivateEvent(Event& event) {
: WebFeature::kColorInputTypeChooserByUntrustedClick);
chooser_ = chrome_client->OpenColorChooser(document.GetFrame(), this,
ValueAsColor());
if (::features::IsFormControlsRefreshEnabled() &&
GetElement().GetLayoutObject()) {
if (GetElement().GetLayoutObject()) {
// Invalidate paint to ensure that the focus ring is removed.
GetElement().GetLayoutObject()->SetShouldDoFullPaintInvalidation();
}
@ -213,8 +212,7 @@ void ColorInputType::DidChooseColor(const Color& color) {
void ColorInputType::DidEndChooser() {
GetElement().EnqueueChangeEvent();
chooser_.Clear();
if (::features::IsFormControlsRefreshEnabled() &&
GetElement().GetLayoutObject()) {
if (GetElement().GetLayoutObject()) {
// Invalidate paint to ensure that the focus ring is shown.
GetElement().GetLayoutObject()->SetShouldDoFullPaintInvalidation();
}

@ -129,16 +129,12 @@ void DateTimeChooserImpl::WriteDocument(SharedBuffer* data) {
data);
data->Append(ChooserResourceLoader::GetPickerCommonStyleSheet());
if (!features::IsFormControlsRefreshEnabled())
data->Append(ChooserResourceLoader::GetPickerButtonStyleSheet());
data->Append(ChooserResourceLoader::GetSuggestionPickerStyleSheet());
data->Append(ChooserResourceLoader::GetCalendarPickerStyleSheet());
if (features::IsFormControlsRefreshEnabled()) {
data->Append(ChooserResourceLoader::GetCalendarPickerRefreshStyleSheet());
if (parameters_->type == input_type_names::kTime ||
parameters_->type == input_type_names::kDatetimeLocal) {
data->Append(ChooserResourceLoader::GetTimePickerStyleSheet());
}
data->Append(ChooserResourceLoader::GetCalendarPickerRefreshStyleSheet());
if (parameters_->type == input_type_names::kTime ||
parameters_->type == input_type_names::kDatetimeLocal) {
data->Append(ChooserResourceLoader::GetTimePickerStyleSheet());
}
AddString(
"</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("isLocaleRTL", locale_->IsRTL(), data);
AddProperty("isRTL", parameters_->is_anchor_element_rtl, data);
AddProperty("isFormControlsRefreshEnabled",
features::IsFormControlsRefreshEnabled(), data);
#if defined(OS_MAC)
AddProperty("isBorderTransparent", features::IsFormControlsRefreshEnabled(),
data);
AddProperty("isBorderTransparent", true, data);
#endif
AddProperty("mode", parameters_->type.GetString(), data);
AddProperty("isAMPMFirst", parameters_->is_ampm_first, data);
@ -236,14 +229,12 @@ void DateTimeChooserImpl::WriteDocument(SharedBuffer* data) {
data->Append(ChooserResourceLoader::GetPickerCommonJS());
data->Append(ChooserResourceLoader::GetSuggestionPickerJS());
if (features::IsFormControlsRefreshEnabled()) {
data->Append(ChooserResourceLoader::GetMonthPickerJS());
if (parameters_->type == input_type_names::kTime) {
data->Append(ChooserResourceLoader::GetTimePickerJS());
} else if (parameters_->type == input_type_names::kDatetimeLocal) {
data->Append(ChooserResourceLoader::GetTimePickerJS());
data->Append(ChooserResourceLoader::GetDateTimeLocalPickerJS());
}
data->Append(ChooserResourceLoader::GetMonthPickerJS());
if (parameters_->type == input_type_names::kTime) {
data->Append(ChooserResourceLoader::GetTimePickerJS());
} else if (parameters_->type == input_type_names::kDatetimeLocal) {
data->Append(ChooserResourceLoader::GetTimePickerJS());
data->Append(ChooserResourceLoader::GetDateTimeLocalPickerJS());
}
data->Append(ChooserResourceLoader::GetCalendarPickerJS());
AddString("</script></body>\n", data);

@ -305,10 +305,8 @@ bool HTMLInputElement::MayTriggerVirtualKeyboard() const {
}
bool HTMLInputElement::ShouldHaveFocusAppearance() const {
// For FormControlsRefresh don't draw focus ring for an input that has its
// popup open.
if (::features::IsFormControlsRefreshEnabled() &&
input_type_view_->HasOpenedPopup())
// Don't draw focus ring for an input that has its popup open.
if (input_type_view_->HasOpenedPopup())
return false;
return TextControlElement::ShouldHaveFocusAppearance();

@ -363,9 +363,8 @@ bool HTMLSelectElement::MayTriggerVirtualKeyboard() const {
}
bool HTMLSelectElement::ShouldHaveFocusAppearance() const {
// For FormControlsRefresh don't draw focus ring for a select that has its
// popup open.
if (::features::IsFormControlsRefreshEnabled() && PopupIsVisible())
// Don't draw focus ring for a select that has its popup open.
if (PopupIsVisible())
return false;
return HTMLFormControlElementWithState::ShouldHaveFocusAppearance();

@ -357,8 +357,6 @@ void InternalPopupMenu::WriteDocument(SharedBuffer* data) {
AddProperty("scaleFactor", scale_factor, data);
bool is_rtl = !owner_style->IsLeftToRightDirection();
AddProperty("isRTL", is_rtl, data);
AddProperty("isFormControlsRefreshEnabled",
features::IsFormControlsRefreshEnabled(), data);
AddProperty("paddingStart",
is_rtl ? owner_element.ClientPaddingRight().ToDouble()
: owner_element.ClientPaddingLeft().ToDouble(),

@ -296,9 +296,8 @@ void MultipleFieldsTemporalInputTypeView::PickerIndicatorChooseValue(
if (input_type_->FormControlType() == input_type_names::kTime) {
if (date.ParseTime(value, 0, end) && end == value.length())
edit->SetOnlyTime(date);
} else if (features::IsFormControlsRefreshEnabled() &&
input_type_->FormControlType() ==
input_type_names::kDatetimeLocal) {
} else if (input_type_->FormControlType() ==
input_type_names::kDatetimeLocal) {
if (date.ParseDateTimeLocal(value, 0, end) && end == value.length())
edit->SetDateTimeLocal(date);
} else {
@ -397,18 +396,6 @@ void MultipleFieldsTemporalInputTypeView::CreateShadowSubtree() {
MakeGarbageCollected<DateTimeEditElement, Document&,
DateTimeEditElement::EditControlOwner&>(document,
*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(
input_type_->FormControlType()))
picker_indicator_is_always_visible_ = true;
@ -497,8 +484,7 @@ void MultipleFieldsTemporalInputTypeView::HandleKeydownEvent(
return;
if (picker_indicator_is_visible_ &&
((event.key() == "ArrowDown" && event.getModifierState("Alt")) ||
(event.key() == "F4") ||
(features::IsFormControlsRefreshEnabled() && event.key() == " "))) {
event.key() == "F4" || event.key() == " ")) {
if (PickerIndicatorElement* element = GetPickerIndicatorElement())
element->OpenPopup();
event.SetDefaultHandled();

@ -51,13 +51,6 @@ PickerIndicatorElement::PickerIndicatorElement(
picker_indicator_owner_(&picker_indicator_owner) {
SetShadowPseudoId(AtomicString("-webkit-calendar-picker-indicator"));
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() {
@ -109,8 +102,7 @@ void PickerIndicatorElement::DidChooseValue(double value) {
void PickerIndicatorElement::DidEndChooser() {
chooser_.Clear();
picker_indicator_owner_->DidEndChooser();
if (::features::IsFormControlsRefreshEnabled() &&
OwnerElement().GetLayoutObject()) {
if (OwnerElement().GetLayoutObject()) {
// Invalidate paint to ensure that the focus ring is shown.
OwnerElement().GetLayoutObject()->SetShouldDoFullPaintInvalidation();
}
@ -128,8 +120,7 @@ void PickerIndicatorElement::OpenPopup() {
return;
chooser_ = GetDocument().GetPage()->GetChromeClient().OpenDateTimeChooser(
GetDocument().GetFrame(), this, parameters);
if (::features::IsFormControlsRefreshEnabled() &&
OwnerElement().GetLayoutObject()) {
if (OwnerElement().GetLayoutObject()) {
// Invalidate paint to ensure that the focus ring is removed.
OwnerElement().GetLayoutObject()->SetShouldDoFullPaintInvalidation();
}

@ -193,16 +193,6 @@ body {
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 {
-webkit-align-self: center;
width: 24px;

File diff suppressed because it is too large Load Diff

@ -165,7 +165,7 @@ body {
color: rgba(16, 16, 16, 0.3);
}
.today-button-refresh {
.today-button {
border: 1px solid transparent;
bottom: 12px;
color: #0078D4;
@ -177,11 +177,11 @@ body {
width: auto;
}
.today-button-refresh:hover {
.today-button:hover {
background-color: rgba(0, 117, 255, 0.3);
}
.today-button-refresh:disabled {
.today-button:disabled {
background-color: #FFFFFF;
color: rgba(16, 16, 16, 0.3);
}
@ -360,18 +360,18 @@ body {
color: GrayText;
}
.today-button-refresh {
.today-button {
background-color: Window;
color: LinkText;
forced-color-adjust: none;
}
.today-button-refresh:hover {
.today-button:hover {
background-color: Window;
border-color: Highlight;
}
.today-button-refresh:disabled {
.today-button:disabled {
background-color: Window;
border-color: transparent;
color: GrayText;
@ -471,16 +471,16 @@ body {
color: rgba(255, 255, 255, 0.3);
}
.today-button-refresh {
.today-button {
color: #99C8FF;
}
.today-button-refresh:hover {
.today-button:hover {
color: #D1E6FF;
background-color: #545454;
}
.today-button-refresh:disabled {
.today-button:disabled {
color: rgba(255, 255, 255, 0.3);
}

@ -25,10 +25,11 @@
body {
--color-swatch-border-width: 1px;
--color-swatch-margin: 1px;
--color-swatch-height: 20px;
--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;
background-color: white;
font: -webkit-small-control;
@ -36,23 +37,9 @@ body {
overflow: hidden;
}
body.controls-refresh {
--color-swatch-margin: 3px;
--color-swatch-height: 18px;
--color-swatch-width: 18px;
--scrollbar-width: 4px;
}
.color-suggestion-picker-main {
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;
}
.controls-refresh .color-suggestion-picker-main {
border: 1px solid #bfbfbf;
box-shadow: none;
padding: 8px 8px 4px 8px;
@ -64,19 +51,15 @@ body.controls-refresh {
height: var(--color-swatch-height);
margin: var(--color-swatch-margin);
padding: var(--color-swatch-padding);
border: var(--color-swatch-border-width) solid #e0e0e0;
border-radius: 0;
box-sizing: content-box;
}
.controls-refresh .color-swatch {
border: var(--color-swatch-border-width) solid rgba(0, 0, 0, 0.19);
border-radius: 2px;
}
.color-swatch:focus {
border: var(--color-swatch-border-width) solid #000000;
outline: none;
outline: solid 2px -webkit-focus-ring-color;
outline-offset: -2px;
}
.color-swatch-container {
@ -86,17 +69,14 @@ body.controls-refresh {
display: flex;
flex-flow: row wrap;
align-items: center;
}
.controls-refresh .color-swatch-container {
margin: 4px;
}
.controls-refresh .color-swatch-container::-webkit-scrollbar {
.color-swatch-container::-webkit-scrollbar {
width: var(--scrollbar-width);
}
.controls-refresh .color-swatch-container::-webkit-scrollbar-thumb {
.color-swatch-container::-webkit-scrollbar-thumb {
background-color: #cecece;
border-radius: 2px;
height: 47px;
@ -104,17 +84,8 @@ body.controls-refresh {
width: 4px;
}
.controls-refresh .color-swatch:focus {
outline: solid 2px -webkit-focus-ring-color;
outline-offset: -2px;
}
.other-color {
width: 100%;
margin: 4px 0 0 0;
}
.controls-refresh .other-color {
background-color: #ffffff;
border-color: transparent;
border-radius: 2px;
@ -125,61 +96,61 @@ body.controls-refresh {
text-align: left;
}
.controls-refresh .other-color:hover {
.other-color:hover {
background-color: #f3f3f3;
}
@media (forced-colors: active) {
.controls-refresh .color-suggestion-picker-main {
.color-suggestion-picker-main {
border: 1px solid WindowText;
}
.controls-refresh .color-swatch {
.color-swatch {
forced-color-adjust: none;
border-color: WindowText;
}
.controls-refresh .color-swatch:focus {
.color-swatch:focus {
outline-color: Highlight;
}
.controls-refresh .color-swatch-container {
.color-swatch-container {
forced-color-adjust: none;
}
.controls-refresh .color-swatch-container::-webkit-scrollbar-thumb {
.color-swatch-container::-webkit-scrollbar-thumb {
background-color: WindowText;
}
}
@media (prefers-color-scheme: dark) {
.controls-refresh .color-suggestion-picker-main {
.color-suggestion-picker-main {
background: #3B3B3B;
color: #FFFFFF;
border: 1px solid #858585;
box-shadow: none;
}
.controls-refresh .color-swatch {
.color-swatch {
border-color: #858585;
}
.controls-refresh .color-swatch:focus {
.color-swatch:focus {
outline-color: Highlight;
}
.controls-refresh .other-color,
.controls-refresh .other-color:hover {
.other-color,
.other-color:hover {
background: #3B3B3B;
color: #FFFFFF;
border: 1px solid #858585;
}
.controls-refresh .other-color:hover{
.other-color:hover{
border: 1px solid #ACACAC;
}
.controls-refresh .color-swatch-container::-webkit-scrollbar-thumb {
.color-swatch-container::-webkit-scrollbar-thumb {
background-color: WindowText;
}
}

@ -129,17 +129,15 @@ Object.defineProperty(ColorSuggestionPicker, 'SwatchesPerRow', {
Object.defineProperty(ColorSuggestionPicker, 'SwatchesMaxRow', {
get: function() {
return global.params.isFormControlsRefreshEnabled ? 3 : 4;
return 3;
}
});
Object.defineProperty(ColorSuggestionPicker, 'ScrollbarWidth', {
get: function() {
return !global.params.isFormControlsRefreshEnabled ?
getScrollbarWidth() :
Number(window.getComputedStyle(document.body)
.getPropertyValue('--scrollbar-width')
.replace('px', ''));
return Number(window.getComputedStyle(document.body)
.getPropertyValue('--scrollbar-width')
.replace('px', ''));
}
});
@ -178,19 +176,15 @@ ColorSuggestionPicker.prototype._layout = function() {
};
ColorSuggestionPicker.prototype._onOtherButtonClick = function() {
if (global.params.isFormControlsRefreshEnabled) {
var main = $('main');
main.innerHTML = '';
main.classList.remove('color-suggestion-picker-main');
main.classList.add('color-picker-main');
// Replace document.body with a deep clone to drop all event listeners.
var oldBody = document.body;
var newBody = oldBody.cloneNode(true);
oldBody.parentElement.replaceChild(newBody, oldBody);
initializeColorPicker();
} else {
this.chooseOtherColor();
}
var main = $('main');
main.innerHTML = '';
main.classList.remove('color-suggestion-picker-main');
main.classList.add('color-picker-main');
// Replace document.body with a deep clone to drop all event listeners.
var oldBody = document.body;
var newBody = oldBody.cloneNode(true);
oldBody.parentElement.replaceChild(newBody, oldBody);
initializeColorPicker();
};
ColorSuggestionPicker.prototype.selectColorAtIndex = function(index) {

@ -40,9 +40,6 @@ function initialize(args) {
main.innerHTML = '';
var errorString;
if (global.params.shouldShowColorSuggestionPicker) {
if (global.params.isFormControlsRefreshEnabled) {
document.body.classList.add('controls-refresh');
}
main.classList.add('color-suggestion-picker-main');
if (global.params.isBorderTransparent) {
main.style.borderColor = 'transparent';

@ -99,7 +99,7 @@ class DateTimeLocalPicker extends HTMLElement {
onClick_ = (event) => {
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) {
window.pagePopupController.setValue(this.selectedValue);
}

@ -1,6 +1,8 @@
select {
display: block;
overflow-y: auto;
border-radius: 0px;
outline: none;
}
select hr {
@ -16,8 +18,3 @@ option, optgroup {
.wrap option {
white-space: pre-wrap;
}
.controls-refresh select {
border-radius: 0px;
outline: none;
}

@ -21,9 +21,6 @@ function initialize(args) {
global.params = args;
var main = $('main');
main.innerHTML = '';
if (global.params.isFormControlsRefreshEnabled) {
document.body.classList.add('controls-refresh');
}
global.picker = new ListPicker(main, args);
}

@ -170,5 +170,5 @@ MonthPicker.YearWidth = 194;
MonthPicker.YearHeight = 128;
MonthPicker.YearPadding = 12;
MonthPicker.Height = 182;
MonthPicker.ClassNameTodayButton = 'today-button-refresh';
MonthPicker.ClassNameTodayButton = 'today-button';
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 = {
SetValue: 0,
Cancel: -1,
ChooseOtherColor: -2
};
/**
@ -346,11 +345,6 @@ Picker.prototype.handleCancel = function() {
window.pagePopupController.closePopup();
};
Picker.prototype.chooseOtherColor = function() {
window.pagePopupController.setValueAndClosePopup(
Picker.Actions.ChooseOtherColor, '');
};
Picker.prototype.cleanup = function() {};
window.addEventListener('keyup', function(event) {

@ -1,23 +1,28 @@
.suggestion-list {
list-style: none;
padding: 0;
margin: 0;
font: -webkit-small-control;
border: 1px solid #7f9db9;
border: 1px solid #bfbfbf;
background-color: white;
overflow: hidden;
padding: 4px;
}
.suggestion-list-entry {
white-space: nowrap;
height: 1.73em;
line-height: 1.73em;
-webkit-select: none;
cursor: default;
border-radius: 2px;
font-size: 14px;
height: 32px;
line-height: 32px;
}
.suggestion-list-entry:focus {
outline: none;
background-color: #E5E5E5 !important;
outline: solid 2px -webkit-focus-ring-color;
outline-offset: -2px;
}
.suggestion-list-entry .content {
@ -26,9 +31,9 @@
.suggestion-list-entry .label {
text-align: right;
color: #737373;
float: right;
padding: 0 4px 0 20px;
color: rgba(16, 16, 16, 0.6) !important;
}
.rtl .suggestion-list-entry .label {
@ -39,6 +44,7 @@
.suggestion-list-entry .title {
direction: ltr;
display: inline-block;
color: #101010;
}
.locale-rtl .suggestion-list-entry .title {
@ -55,45 +61,19 @@
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) {
.controls-refresh .suggestion-list-entry:focus {
.suggestion-list-entry:focus {
background-color: Highlight !important;
forced-color-adjust: none;
}
.controls-refresh .suggestion-list-entry:focus .label,
.controls-refresh .suggestion-list-entry:focus .title {
.suggestion-list-entry:focus .label,
.suggestion-list-entry:focus .title {
color: HighlightText !important;
}
.controls-refresh .suggestion-list-entry .label,
.controls-refresh .suggestion-list-entry .title {
.suggestion-list-entry .label,
.suggestion-list-entry .title {
color: WindowText !important;
}
}

@ -211,12 +211,6 @@ SuggestionPicker.prototype._layout = function() {
this._config.suggestionLabels[i], this._config.suggestionValues[i]));
}
if (this._config.showOtherDateEntry) {
// Add separator
if (!global.params.isFormControlsRefreshEnabled) {
var separator = createElement('div', 'separator');
this._containerElement.appendChild(separator);
}
// Add "Other..." entry
var otherEntry = this._createActionEntryElement(
this._config.otherDateLabel,

@ -357,8 +357,6 @@ bool MenuListSelectType::PopupIsVisible() const {
void MenuListSelectType::SetPopupIsVisible(bool popup_is_visible) {
popup_is_visible_ = popup_is_visible;
if (!::features::IsFormControlsRefreshEnabled())
return;
if (auto* layout_object = select_->GetLayoutObject()) {
// Invalidate paint to ensure that the focus ring is updated.
layout_object->SetShouldDoFullPaintInvalidation();

@ -63,12 +63,10 @@ void SliderThumbElement::SetPositionFromValue() {
if (GetLayoutObject()) {
GetLayoutObject()->SetNeedsLayoutAndFullPaintInvalidation(
layout_invalidation_reason::kSliderValueChanged);
if (features::IsFormControlsRefreshEnabled()) {
HTMLInputElement* input(HostInput());
if (input && input->GetLayoutObject()) {
// the slider track selected value needs to be updated.
input->GetLayoutObject()->SetShouldDoFullPaintInvalidation();
}
HTMLInputElement* input(HostInput());
if (input && input->GetLayoutObject()) {
// the slider track selected value needs to be updated.
input->GetLayoutObject()->SetShouldDoFullPaintInvalidation();
}
}
}

@ -24,27 +24,11 @@ TEST_F(LayoutTextControlSingleLineTest, VisualOverflowCleared) {
<input id=input type="text"></input.
)HTML");
auto* input = To<LayoutBox>(GetLayoutObjectByElementId("input"));
if (::features::IsFormControlsRefreshEnabled()) {
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
}
EXPECT_EQ(LayoutRect(-3, -3, 74, 72), input->SelfVisualOverflowRect());
To<Element>(input->GetNode())
->setAttribute(html_names::kStyleAttr, "box-shadow: initial");
UpdateAllLifecyclePhasesForTest();
if (::features::IsFormControlsRefreshEnabled()) {
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
}
EXPECT_EQ(LayoutRect(0, 0, 58, 56), input->SelfVisualOverflowRect());
}
} // anonymous namespace

@ -743,8 +743,7 @@ String LayoutTheme::DisplayNameForFile(const File& file) const {
bool LayoutTheme::SupportsCalendarPicker(const AtomicString& type) const {
DCHECK(RuntimeEnabledFeatures::InputMultipleFieldsUIEnabled());
if (features::IsFormControlsRefreshEnabled() &&
type == input_type_names::kTime)
if (type == input_type_names::kTime)
return true;
return type == input_type_names::kDate ||

@ -19,19 +19,6 @@ LayoutTheme& LayoutTheme::NativeTheme() {
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(
mojom::blink::ColorScheme color_scheme) const {
return color_scheme == mojom::blink::ColorScheme::kDark

@ -13,7 +13,6 @@ class LayoutThemeAndroid final : public LayoutThemeMobile {
public:
static scoped_refptr<LayoutTheme> Create();
bool DelegatesMenuListRendering() const override { return true; }
String ExtraDefaultStyleSheet() override;
Color PlatformActiveSelectionBackgroundColor(
mojom::blink::ColorScheme color_scheme) const override;
Color PlatformActiveSelectionForegroundColor(

@ -66,10 +66,7 @@ String LayoutThemeDefault::ExtraDefaultStyleSheet() {
String windows_style_sheet =
UncompressResourceAsASCIIString(IDR_UASTYLE_THEME_WIN_CSS);
String controls_refresh_style_sheet =
features::IsFormControlsRefreshEnabled()
? UncompressResourceAsASCIIString(
IDR_UASTYLE_THEME_CONTROLS_REFRESH_CSS)
: String();
UncompressResourceAsASCIIString(IDR_UASTYLE_THEME_CONTROLS_REFRESH_CSS);
StringBuilder builder;
builder.ReserveCapacity(
extra_style_sheet.length() + multiple_fields_style_sheet.length() +
@ -108,19 +105,13 @@ Color LayoutThemeDefault::PlatformInactiveSelectionForegroundColor(
IntSize LayoutThemeDefault::SliderTickSize() const {
// The value should be synchronized with a -webkit-slider-container rule in
// html.css.
if (features::IsFormControlsRefreshEnabled())
return IntSize(1, 4);
else
return IntSize(1, 6);
return IntSize(1, 4);
}
int LayoutThemeDefault::SliderTickOffsetFromTrackCenter() const {
// The value should be synchronized with a -webkit-slider-container rule in
// html.css and LayoutThemeAndroid::ExtraDefaultStyleSheet().
if (features::IsFormControlsRefreshEnabled())
return 7;
else
return -16;
return 7;
}
void LayoutThemeDefault::AdjustSliderThumbSize(ComputedStyle& style) const {

@ -150,7 +150,6 @@ bool LayoutThemeMac::UsesTestModeFocusRingColor() const {
}
LayoutTheme& LayoutTheme::NativeTheme() {
DCHECK(features::IsFormControlsRefreshEnabled());
DEFINE_STATIC_REF(LayoutTheme, layout_theme, (LayoutThemeMac::Create()));
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/page_test_base.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 {
class LayoutThemeTest : public PageTestBase,
private ScopedCSSColorSchemeUARenderingForTest {
class LayoutThemeTest : public PageTestBase {
protected:
LayoutThemeTest() : ScopedCSSColorSchemeUARenderingForTest(true) {}
void SetHtmlInnerHTML(const char* html_content);
};

@ -2950,7 +2950,6 @@ INSTANTIATE_TEST_SUITE_P(NonOverlay,
TEST_P(ScrollbarColorSchemeTest, MAYBE_ThemeEnginePaint) {
ScopedTestingPlatformSupport<ScrollbarTestingPlatformSupport> platform;
ScopedCSSColorSchemeUARenderingForTest color_scheme_ua_scope(true);
WebView().MainFrameViewWidget()->Resize(gfx::Size(800, 600));
SimRequest request("https://example.com/test.html", "text/html");

@ -516,9 +516,7 @@ void DrawSolidBoxSide(GraphicsContext& graphics_context,
float GetFocusRingBorderRadius(const ComputedStyle& style) {
// Default style is border-radius equal to outline width.
float border_radius = style.GetOutlineStrokeWidthForFocusRing();
if (::features::IsFormControlsRefreshEnabled() && !style.HasAuthorBorder() &&
style.HasEffectiveAppearance()) {
if (!style.HasAuthorBorder() && style.HasEffectiveAppearance()) {
// 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
// drawing the element.

@ -2799,9 +2799,7 @@ Scrollbar* PaintLayerScrollableArea::ScrollbarManager::CreateScrollbar(
ScrollableArea(), orientation, To<Element>(style_source.GetNode()));
} else {
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,
style_source_element);
}

@ -171,15 +171,9 @@ bool ThemePainter::Paint(const LayoutObject& o,
case kMenulistButtonPart:
return true;
case kTextFieldPart:
if (!features::IsFormControlsRefreshEnabled()) {
return true;
}
CountAppearanceTextFieldPart(element);
return PaintTextField(element, style, paint_info, r);
case kTextAreaPart:
if (!features::IsFormControlsRefreshEnabled()) {
return true;
}
COUNT_APPEARANCE(doc, TextArea);
return PaintTextArea(element, style, paint_info, r);
case kSearchFieldPart: {
@ -211,17 +205,8 @@ bool ThemePainter::PaintBorderOnly(const Node* node,
// Call the appropriate paint method based off the appearance value.
switch (style.EffectiveAppearance()) {
case kTextFieldPart:
if (features::IsFormControlsRefreshEnabled()) {
return false;
}
CountAppearanceTextFieldPart(element);
return PaintTextField(element, style, paint_info, r);
case kTextAreaPart:
if (features::IsFormControlsRefreshEnabled()) {
return false;
}
COUNT_APPEARANCE(element.GetDocument(), TextArea);
return PaintTextArea(element, style, paint_info, r);
return false;
case kMenulistButtonPart:
case kSearchFieldPart:
case kListboxPart:

@ -209,9 +209,7 @@ bool ThemePainterDefault::PaintRadio(const Element& element,
extra_params.button.zoom = zoom_level;
GraphicsContextStateSaver state_saver(paint_info.context, false);
IntRect unzoomed_rect =
features::IsFormControlsRefreshEnabled()
? ApplyZoomToRect(rect, paint_info, state_saver, zoom_level)
: rect;
ApplyZoomToRect(rect, paint_info, state_saver, zoom_level);
Platform::Current()->ThemeEngine()->Paint(
canvas, WebThemeEngine::kPartRadio, GetWebThemeState(element),
@ -353,8 +351,7 @@ void ThemePainterDefault::SetupMenuListArrow(
theme_.ClampedMenuListArrowPaddingSize(document.GetFrame(), style);
float arrow_scale_factor = arrow_box_width / theme_.MenuListArrowWidthInDIP();
// TODO(tkent): This should be 7.0 to match scroll bar buttons.
float arrow_size = (features::IsFormControlsRefreshEnabled() ? 8.0 : 6.0) *
arrow_scale_factor;
float arrow_size = 8.0 * arrow_scale_factor;
// Put the arrow at the center of paddingForArrow area.
// |arrowX| is the left position for Aura theme engine.
extra_params.menu_list.arrow_x =
@ -383,14 +380,6 @@ bool ThemePainterDefault::PaintSliderTrack(const Element& element,
extra_params.slider.zoom = zoom_level;
GraphicsContextStateSaver state_saver(i.context, false);
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);
extra_params.slider.thumb_x = 0;
@ -405,23 +394,12 @@ bool ThemePainterDefault::PaintSliderTrack(const Element& element,
LayoutBox* input_box = input->GetLayoutBox();
if (thumb) {
IntRect thumb_rect = PixelSnappedIntRect(thumb->FrameRect());
if (features::IsFormControlsRefreshEnabled()) {
extra_params.slider.thumb_x = thumb_rect.X() +
input_box->PaddingLeft().ToInt() +
input_box->BorderLeft().ToInt();
extra_params.slider.thumb_y = thumb_rect.Y() +
input_box->PaddingTop().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;
}
extra_params.slider.thumb_x = thumb_rect.X() +
input_box->PaddingLeft().ToInt() +
input_box->BorderLeft().ToInt();
extra_params.slider.thumb_y = thumb_rect.Y() +
input_box->PaddingTop().ToInt() +
input_box->BorderTop().ToInt();
}
}
@ -446,14 +424,6 @@ bool ThemePainterDefault::PaintSliderThumb(const Element& element,
extra_params.slider.zoom = zoom_level;
GraphicsContextStateSaver state_saver(paint_info.context, false);
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
// 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 {
if (::features::IsFormControlsRefreshEnabled() && style_source_ &&
style_source_->GetLayoutObject()) {
if (style_source_ && style_source_->GetLayoutObject()) {
return style_source_->GetLayoutObject()->Style()->EffectiveZoom();
}
return 1.0;
}
bool Scrollbar::ContainerIsRightToLeft() const {
if (::features::IsFormControlsRefreshEnabled() && style_source_ &&
style_source_->GetLayoutObject()) {
if (style_source_ && style_source_->GetLayoutObject()) {
TextDirection dir = style_source_->GetLayoutObject()->Style()->Direction();
return IsRtl(dir);
}

@ -2224,7 +2224,7 @@ int ComputedStyle::OutlineOutsetExtent() const {
}
float ComputedStyle::GetOutlineStrokeWidthForFocusRing() const {
if (::features::IsFormControlsRefreshEnabled() && OutlineStyleIsAuto()) {
if (OutlineStyleIsAuto()) {
return std::max(EffectiveZoom(), 3.f);
}

@ -2602,9 +2602,7 @@ class ComputedStyle : public ComputedStyleBase,
}
mojom::blink::ColorScheme UsedColorScheme() const {
return RuntimeEnabledFeatures::CSSColorSchemeUARenderingEnabled()
? ComputedColorScheme()
: mojom::blink::ColorScheme::kLight;
return ComputedColorScheme();
}
mojom::blink::ColorScheme UsedColorSchemeForInitialColors() const {

@ -91,30 +91,11 @@ TEST_F(ComputedStyleTest, ClipPathEqual) {
TEST_F(ComputedStyleTest, FocusRingWidth) {
scoped_refptr<ComputedStyle> style = CreateComputedStyle();
if (::features::IsFormControlsRefreshEnabled()) {
style->SetOutlineStyleIsAuto(static_cast<bool>(OutlineIsAuto::kOn));
EXPECT_EQ(3, style->GetOutlineStrokeWidthForFocusRing());
style->SetEffectiveZoom(3.5);
style->SetOutlineWidth(4);
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
}
style->SetOutlineStyleIsAuto(static_cast<bool>(OutlineIsAuto::kOn));
EXPECT_EQ(3, style->GetOutlineStrokeWidthForFocusRing());
style->SetEffectiveZoom(3.5);
style->SetOutlineWidth(4);
EXPECT_EQ(3.5, style->GetOutlineStrokeWidthForFocusRing());
}
TEST_F(ComputedStyleTest, FocusRingOutset) {
@ -122,15 +103,7 @@ TEST_F(ComputedStyleTest, FocusRingOutset) {
style->SetOutlineStyle(EBorderStyle::kSolid);
style->SetOutlineStyleIsAuto(static_cast<bool>(OutlineIsAuto::kOn));
style->SetEffectiveZoom(4.75);
if (::features::IsFormControlsRefreshEnabled()) {
EXPECT_EQ(4, style->OutlineOutsetExtent());
} else {
#if defined(OS_MAC)
EXPECT_EQ(4, style->OutlineOutsetExtent());
#else
EXPECT_EQ(3, style->OutlineOutsetExtent());
#endif
}
EXPECT_EQ(4, style->OutlineOutsetExtent());
}
TEST_F(ComputedStyleTest, SVGStackingContext) {
@ -679,8 +652,6 @@ TEST_F(ComputedStyleTest, CustomPropertiesInheritance_StyleRecalc) {
}
TEST_F(ComputedStyleTest, ApplyColorSchemeLightOnDark) {
ScopedCSSColorSchemeUARenderingForTest scoped_ua_enabled(true);
std::unique_ptr<DummyPageHolder> dummy_page_holder =
std::make_unique<DummyPageHolder>(IntSize(0, 0), nullptr);
Document& document = dummy_page_holder->GetDocument();
@ -714,8 +685,6 @@ TEST_F(ComputedStyleTest, ApplyColorSchemeLightOnDark) {
TEST_F(ComputedStyleTest, ApplyInternalLightDarkColor) {
using css_test_helpers::ParseDeclarationBlock;
ScopedCSSColorSchemeUARenderingForTest scoped_ua_enabled(true);
std::unique_ptr<DummyPageHolder> dummy_page_holder =
std::make_unique<DummyPageHolder>(IntSize(0, 0), nullptr);
Document& document = dummy_page_holder->GetDocument();
@ -758,8 +727,6 @@ TEST_F(ComputedStyleTest, ApplyInternalLightDarkColor) {
TEST_F(ComputedStyleTest, ApplyInternalLightDarkBackgroundImage) {
using css_test_helpers::ParseDeclarationBlock;
ScopedCSSColorSchemeUARenderingForTest scoped_ua_enabled(true);
std::unique_ptr<DummyPageHolder> dummy_page_holder =
std::make_unique<DummyPageHolder>(IntSize(0, 0), nullptr);
Document& document = dummy_page_holder->GetDocument();

@ -711,10 +711,6 @@ unsigned Internals::workerThreadCount() const {
return WorkerThread::WorkerThreadCount();
}
bool Internals::isFormControlsRefreshEnabled() const {
return ::features::IsFormControlsRefreshEnabled();
}
GCObservation* Internals::observeGC(ScriptValue script_value) {
v8::Local<v8::Value> observed_value = script_value.V8Value();
DCHECK(!observed_value.IsEmpty());

@ -333,8 +333,6 @@ class Internals final : public ScriptWrappable {
InternalRuntimeFlags* runtimeFlags() const;
unsigned workerThreadCount() const;
bool isFormControlsRefreshEnabled() const;
String resolveModuleSpecifier(const String& specifier,
const String& base_url_string,
Document*,

@ -185,7 +185,6 @@
readonly attribute InternalSettings settings;
readonly attribute InternalRuntimeFlags runtimeFlags;
readonly attribute unsigned long workerThreadCount;
readonly attribute boolean isFormControlsRefreshEnabled;
// Flag for layerTreeAsText. The value must be kept in sync with the value
// of LayerTreeFlags in layers_as_json.h.

@ -678,10 +678,6 @@ void WebRuntimeFeatures::EnableTargetBlankImpliesNoOpener(bool enable) {
RuntimeEnabledFeatures::SetTargetBlankImpliesNoOpenerEnabled(enable);
}
void WebRuntimeFeatures::EnableCSSColorSchemeUARendering(bool enable) {
RuntimeEnabledFeatures::SetCSSColorSchemeUARenderingEnabled(enable);
}
void WebRuntimeFeatures::EnableDocumentTransition(bool enable) {
RuntimeEnabledFeatures::SetDocumentTransitionEnabled(enable);
}

@ -329,32 +329,11 @@ void GraphicsContext::CompositeRecord(sk_sp<PaintRecord> record,
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) {
// 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
// only half of the width is outside of the offset.
if (::features::IsFormControlsRefreshEnabled()) {
// 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;
// only 2/3 of the width is outside of the offset.
return offset + std::ceil(width / 3.f) * 2;
}
void GraphicsContext::DrawFocusRingPath(const SkPath& path,
@ -398,10 +377,6 @@ void GraphicsContext::DrawFocusRingInternal(const Vector<IntRect>& rects,
return;
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++) {
SkIRect r = rects[i];
if (r.isEmpty())
@ -436,29 +411,25 @@ void GraphicsContext::DrawFocusRing(const Vector<IntRect>& rects,
const Color& inner_color =
color_scheme == mojom::blink::ColorScheme::kDark ? SK_ColorWHITE : color;
#endif
if (::features::IsFormControlsRefreshEnabled()) {
// The focus ring is made of two borders which have a 2:1 ratio.
const float first_border_width = (width / 3) * 2;
const float second_border_width = width - first_border_width;
// The focus ring is made of two borders which have a 2:1 ratio.
const float first_border_width = (width / 3) * 2;
const float second_border_width = width - first_border_width;
// How much space the focus ring would like to take from the actual border.
const float inside_border_width = 1;
if (min_border_width >= 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);
// How much space the focus ring would like to take from the actual border.
const float inside_border_width = 1;
if (min_border_width >= 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);
}
static void EnforceDotsAtEndpoints(GraphicsContext& context,

@ -420,26 +420,7 @@ void DrawPlatformFocusRing(const PrimitiveType& primitive,
flags.setColor(color);
flags.setStrokeWidth(width);
if (::features::IsFormControlsRefreshEnabled()) {
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
DrawFocusRingPrimitive(primitive, canvas, flags, border_radius);
}
template void PLATFORM_EXPORT

@ -502,15 +502,6 @@
name: "CSSCaseSensitiveSelector",
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",
status: "experimental",

@ -249,13 +249,8 @@ void LocaleICU::InitializeCalendar() {
UCAL_FIRST_DAY_OF_WEEK) -
UCAL_SUNDAY;
if (features::IsFormControlsRefreshEnabled()) {
week_day_short_labels_ = CreateLabelVector(
short_date_format_, UDAT_NARROW_WEEKDAYS, UCAL_SUNDAY, 7);
} else {
week_day_short_labels_ = CreateLabelVector(
short_date_format_, UDAT_SHORT_WEEKDAYS, UCAL_SUNDAY, 7);
}
week_day_short_labels_ = CreateLabelVector(
short_date_format_, UDAT_NARROW_WEEKDAYS, UCAL_SUNDAY, 7);
if (!week_day_short_labels_)
week_day_short_labels_ = CreateFallbackWeekDayShortLabels();
}

@ -137,9 +137,7 @@ const Vector<String>& LocaleMac::WeekDayShortLabels() {
if (!week_day_short_labels_.IsEmpty())
return week_day_short_labels_;
week_day_short_labels_.ReserveCapacity(7);
NSArray* array = features::IsFormControlsRefreshEnabled()
? [ShortDateFormatter() veryShortWeekdaySymbols]
: [ShortDateFormatter() shortWeekdaySymbols];
NSArray* array = [ShortDateFormatter() veryShortWeekdaySymbols];
if ([array count] == 7) {
for (unsigned i = 0; i < 7; ++i)
week_day_short_labels_.push_back(String(array[i]));

@ -293,24 +293,14 @@ void LocaleWin::EnsureMonthLabels() {
void LocaleWin::EnsureWeekDayShortLabels() {
if (!week_day_short_labels_.IsEmpty())
return;
const LCTYPE kTypes[7] = {LOCALE_SABBREVDAYNAME7, // Sunday
LOCALE_SABBREVDAYNAME1, // Monday
LOCALE_SABBREVDAYNAME2, LOCALE_SABBREVDAYNAME3,
LOCALE_SABBREVDAYNAME4, LOCALE_SABBREVDAYNAME5,
LOCALE_SABBREVDAYNAME6};
const LCTYPE kTypesRefresh[7] = {
LOCALE_SSHORTESTDAYNAME7, // Sunday
LOCALE_SSHORTESTDAYNAME1, // Monday
LOCALE_SSHORTESTDAYNAME2, LOCALE_SSHORTESTDAYNAME3,
LOCALE_SSHORTESTDAYNAME4, LOCALE_SSHORTESTDAYNAME5,
LOCALE_SSHORTESTDAYNAME6};
const LCTYPE kTypes[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));
for (unsigned i = 0; i < base::size(kTypes); ++i) {
if (features::IsFormControlsRefreshEnabled()) {
week_day_short_labels_.push_back(GetLocaleInfoString(kTypesRefresh[i]));
} else {
week_day_short_labels_.push_back(GetLocaleInfoString(kTypes[i]));
}
week_day_short_labels_.push_back(GetLocaleInfoString(kTypes[i]));
if (week_day_short_labels_.back().IsEmpty()) {
week_day_short_labels_.Shrink(0);
week_day_short_labels_.ReserveCapacity(base::size(WTF::kWeekdayName));

@ -189,23 +189,13 @@ TEST_F(LocaleWinTest, monthLabels) {
}
TEST_F(LocaleWinTest, weekDayShortLabels) {
if (features::IsFormControlsRefreshEnabled()) {
EXPECT_EQ("Su", WeekDayShortLabel(kEnglishUS, kSunday));
EXPECT_EQ("We", WeekDayShortLabel(kEnglishUS, kWednesday));
EXPECT_EQ("Sa", WeekDayShortLabel(kEnglishUS, kSaturday));
EXPECT_EQ("Su", WeekDayShortLabel(kEnglishUS, kSunday));
EXPECT_EQ("We", WeekDayShortLabel(kEnglishUS, kWednesday));
EXPECT_EQ("Sa", WeekDayShortLabel(kEnglishUS, kSaturday));
EXPECT_EQ("di", WeekDayShortLabel(kFrenchFR, kSunday));
EXPECT_EQ("me", WeekDayShortLabel(kFrenchFR, kWednesday));
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("di", WeekDayShortLabel(kFrenchFR, kSunday));
EXPECT_EQ("me", WeekDayShortLabel(kFrenchFR, kWednesday));
EXPECT_EQ("sa", WeekDayShortLabel(kFrenchFR, kSaturday));
EXPECT_EQ("\xE6\x97\xA5", WeekDayShortLabel(kJapaneseJP, kSunday).Utf8());
EXPECT_EQ("\xE6\xB0\xB4", WeekDayShortLabel(kJapaneseJP, kWednesday).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 ]
# 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/events/sequential-focus-navigation-starting-point.html [ Skip ]
crbug.com/1035582 fast/inline/continuation-outlines-with-layers.html [ Failure ]

@ -1361,7 +1361,7 @@ crbug.com/1133390 virtual/css-calc-infinity-and-nan/external/wpt/css/css-values/
# ====== 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 ]
### 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 ]
# Tests that fail when FormControlsRefresh is enabled:
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.

@ -655,7 +655,7 @@
{
"prefix": "system-color-compute",
"bases": ["external/wpt/css/css-color"],
"args": ["--enable-blink-features=CSSColorScheme,CSSColorSchemeUARendering,CSSSystemColorComputeToSelf"]
"args": ["--enable-blink-features=CSSColorScheme,CSSSystemColorComputeToSelf"]
},
{
"prefix": "dark-color-scheme",
@ -663,7 +663,7 @@
"fast/forms/color-scheme",
"http/tests/eye-dropper"],
"args": ["--force-dark-mode",
"--enable-blink-features=CSSColorScheme,CSSColorSchemeUARendering",
"--enable-blink-features=CSSColorScheme",
"--enable-features=EyeDropper"]
},
{

@ -17,11 +17,7 @@ let t = async_test('Test year list view size');
function test1() {
var dateViewHeight = popupWindow.global.picker.height();
clickMonthPopupButton();
if (popupWindow.global.params.isFormControlsRefreshEnabled) {
assert_equals(dateViewHeight, popupWindow.global.picker.height());
} else {
assert_not_equals(dateViewHeight, popupWindow.global.picker.height());
}
assert_equals(dateViewHeight, popupWindow.global.picker.height());
}
t.step(() => {

@ -173,7 +173,7 @@ function skipAnimationAndGetPositionOfTodayButton() {
popupWindow.global.picker.datePicker.calendarTableView :
popupWindow.global.picker.calendarTableView;
var buttonElement =
calendarTableView.element.querySelector('.today-button-refresh');
calendarTableView.element.querySelector('.today-button');
var offset = cumulativeOffset(buttonElement);
return {
x: offset[0] + buttonElement.offsetWidth / 2,
@ -195,7 +195,7 @@ function clickTodayButton() {
function skipAnimationAndGetPositionOfThisMonthButton() {
skipAnimation();
const button =
popupWindow.global.picker.querySelector('.today-button-refresh');
popupWindow.global.picker.querySelector('.today-button');
var offset = cumulativeOffset(button);
return {
x: offset[0] + button.offsetWidth / 2,

@ -9,9 +9,7 @@ testRunner.waitUntilDone();
<input type=month id=month value="2018-08">
<script>
openPickerAppearanceOnly(document.getElementById('month'), function() {
if (popupWindow.global.params.isFormControlsRefreshEnabled) {
hoverOverMonthButtonForMonthPicker(2018, 5);
}
hoverOverMonthButtonForMonthPicker(2018, 5);
testRunner.notifyDone()
});
</script>

@ -6,12 +6,7 @@
input_date.focus();
if (internals.isFormControlsRefreshEnabled) {
eventSender.keyDown(" ");
} else {
// Old picker needs Alt+ArrowDown
eventSender.keyDown("ArrowDown", ["altKey"]);
}
eventSender.keyDown(" ");
// Advance date to the next day
eventSender.keyDown("ArrowRight");

@ -1,5 +1,5 @@
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.

@ -219,26 +219,7 @@ const base::Feature kEyeDropper {
};
bool IsEyeDropperEnabled() {
return IsFormControlsRefreshEnabled() &&
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;
return base::FeatureList::IsEnabled(features::kEyeDropper);
}
// 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) 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.
COMPONENT_EXPORT(UI_BASE_FEATURES)
extern const base::Feature kUseCommonSelectPopup;

@ -103,7 +103,6 @@ NativeThemeAura* NativeThemeAura::web_instance() {
SkColor NativeThemeAura::FocusRingColorForBaseColor(SkColor base_color) const {
#if defined(OS_APPLE)
DCHECK(features::IsFormControlsRefreshEnabled());
// On Mac OSX, the system Accent Color setting is darkened a bit
// for better contrast.
return SkColorSetA(base_color, 166);
@ -184,12 +183,6 @@ void NativeThemeAura::PaintArrowButton(
cc::PaintFlags flags;
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 lower_left_radius = 0;
SkScalar upper_right_radius = 0;

File diff suppressed because it is too large Load Diff

@ -109,9 +109,7 @@ namespace ui {
// static
NativeTheme* NativeTheme::GetInstanceForWeb() {
if (features::IsFormControlsRefreshEnabled())
return NativeThemeAura::web_instance();
return NativeThemeMac::instance();
return NativeThemeAura::web_instance();
}
// static
@ -625,11 +623,7 @@ void NativeThemeMac::InitializeDarkModeStateAndObserver() {
}
void NativeThemeMac::ConfigureWebInstance() {
if (!features::IsFormControlsRefreshEnabled())
return;
// For FormControlsRefresh, NativeThemeAura is used as web instance so we need
// to initialize its state.
// NativeThemeAura is used as web instance so we need to initialize its state.
NativeTheme* web_instance = NativeTheme::GetInstanceForWeb();
web_instance->set_use_dark_colors(IsDarkMode());
web_instance->set_preferred_color_scheme(CalculatePreferredColorScheme());

@ -110,8 +110,7 @@ class DesktopNativeWidgetTopLevelHandler : public aura::WindowObserver {
#if defined(OS_WIN)
// For menus, on Windows versions that support drop shadow remove
// the standard frame in order to keep just the shadow.
if (::features::IsFormControlsRefreshEnabled() &&
init_params.type == Widget::InitParams::TYPE_MENU)
if (init_params.type == Widget::InitParams::TYPE_MENU)
init_params.remove_standard_frame = true;
#endif
init_params.bounds = bounds;

@ -109,8 +109,7 @@ void CalculateWindowStylesFromInitParams(
break;
case Widget::InitParams::TYPE_MENU:
*style |= WS_POPUP;
if (::features::IsFormControlsRefreshEnabled() &&
params.remove_standard_frame) {
if (params.remove_standard_frame) {
// If the platform doesn't support drop shadow, decorate the Window
// with just a border.
if (ui::win::IsAeroGlassEnabled())