Commit 11d85ccf authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Enable visually-refreshed form controls on Mac

*** SHERIFFS: if this CL triggers a flaky layout test, PLEASE do not
*** revert this CL. Instead, please disable the offending test(s) and
*** add them to the crbug.com/1053725 section of TestExpectations. I
*** will then take care of them as I fix up the remainder of these
*** tests. Feel free to cc me if you create a bug. Thanks.

This CL enables the FormControlsRefresh flag by default on all Desktop
platforms. The launch bug is crbug.com/1051552.

Because many layout tests use form controls, including tests that are
not directly testing form controls, this CL requires many tests
to be rebaselined. The bug at [1] tracks the effort to re-baseline all
of these tests and remove these new lines from TestExpectations. This
will be done in pieces, to reduce the code review burden. The bug at
[2] tracks cleaning up some of these tests eventually, as there are
new tests (see [3]) that directly test the appearance of the new form
controls, and those likely supersede many rebaselines in this CL.
However, I would like to get this landed first, as it might require
several Revert/Reland cycles to get landed for good, and then I can
come back and do the cleanup.

[1] https://crbug.com/1053725
[2] https://crbug.com/1034611
[3] https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/web_tests/virtual/controls-refresh/

Bug: 1012108, 1053725, 1034611, 1051552
Change-Id: I2d6da06c21567506cf1fc601b90c686c74310376
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2063530
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743185}
parent 98f2a89e
......@@ -392,12 +392,7 @@ TEST_P(LayoutBoxTest, ControlClip) {
EXPECT_TRUE(target->HasControlClip());
EXPECT_TRUE(target->HasClipRelatedProperty());
EXPECT_TRUE(target->ShouldClipOverflow());
#if defined(OS_MACOSX)
EXPECT_EQ(PhysicalRect(0, 0, 100, 18),
target->ClippingRect(PhysicalOffset()));
#else
EXPECT_EQ(PhysicalRect(2, 2, 96, 46), target->ClippingRect(PhysicalOffset()));
#endif
}
TEST_P(LayoutBoxTest, LocalVisualRectWithMask) {
......
......@@ -319,8 +319,10 @@ Color LayoutThemeMacRefresh::PlatformGrammarMarkerUnderlineColor() const {
Color LayoutThemeMacRefresh::FocusRingColor() const {
static const RGBA32 kDefaultFocusRingColor = 0xFF101010;
if (UsesTestModeFocusRingColor())
return kDefaultFocusRingColor;
if (UsesTestModeFocusRingColor()) {
return HasCustomFocusRingColor() ? GetCustomFocusRingColor()
: kDefaultFocusRingColor;
}
Color keyboard_focus_indicator =
GetSystemColor(MacSystemColorID::kKeyboardFocusIndicator);
......
......@@ -183,21 +183,12 @@ TEST_F(PaintLayerClipperTest, ControlClip) {
.CalculateRects(context,
&target_paint_layer->GetLayoutObject().FirstFragment(),
nullptr, layer_bounds, background_rect, foreground_rect);
#if defined(OS_MACOSX)
// If the PaintLayer clips overflow, the background rect is intersected with
// the PaintLayer bounds...
EXPECT_EQ(PhysicalRect(3, 4, 210, 28), background_rect.Rect());
// and the foreground rect is intersected with the control clip in this case.
EXPECT_EQ(PhysicalRect(8, 8, 200, 18), foreground_rect.Rect());
EXPECT_EQ(PhysicalRect(8, 8, 200, 18), layer_bounds);
#else
// If the PaintLayer clips overflow, the background rect is intersected with
// the PaintLayer bounds...
EXPECT_EQ(PhysicalRect(8, 8, 200, 300), background_rect.Rect());
// and the foreground rect is intersected with the control clip in this case.
EXPECT_EQ(PhysicalRect(10, 10, 196, 296), foreground_rect.Rect());
EXPECT_EQ(PhysicalRect(8, 8, 200, 300), layer_bounds);
#endif
}
TEST_F(PaintLayerClipperTest, RoundedClip) {
......
......@@ -291,13 +291,13 @@ TEST_F(LocaleMacTest, monthLabels) {
}
TEST_F(LocaleMacTest, weekDayShortLabels) {
EXPECT_EQ("Sun", WeekDayShortLabel("en_US", kSunday));
EXPECT_EQ("Wed", WeekDayShortLabel("en_US", kWednesday));
EXPECT_EQ("Sat", WeekDayShortLabel("en_US", kSaturday));
EXPECT_EQ("S", WeekDayShortLabel("en_US", kSunday));
EXPECT_EQ("W", WeekDayShortLabel("en_US", kWednesday));
EXPECT_EQ("S", WeekDayShortLabel("en_US", kSaturday));
EXPECT_EQ("dim.", WeekDayShortLabel("fr_FR", kSunday));
EXPECT_EQ("mer.", WeekDayShortLabel("fr_FR", kWednesday));
EXPECT_EQ("sam.", WeekDayShortLabel("fr_FR", kSaturday));
EXPECT_EQ("D", WeekDayShortLabel("fr_FR", kSunday));
EXPECT_EQ("M", WeekDayShortLabel("fr_FR", kWednesday));
EXPECT_EQ("S", WeekDayShortLabel("fr_FR", kSaturday));
EXPECT_EQ("\xE6\x97\xA5", WeekDayShortLabel("ja_JP", kSunday).Utf8());
EXPECT_EQ("\xE6\xB0\xB4", WeekDayShortLabel("ja_JP", kWednesday).Utf8());
......
......@@ -125,12 +125,13 @@ const base::Feature kDirectManipulationStylus = {
};
#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
// Enable the FormControlsRefresh feature for Windows, ChromeOS, and Linux.
// This feature will be released for Mac and Android in later milestones.
// See crbug.com/1012106 for the Windows launch bug, and crbug.com/1012108 for
// the Mac launch bug.
// Enable the FormControlsRefresh feature for Windows, ChromeOS, Linux, and Mac.
// This feature will be released for Android in later milestones. See
// crbug.com/1012106 for the Windows launch bug, and crbug.com/1012108 for the
// Mac launch bug.
const base::Feature kFormControlsRefresh = {"FormControlsRefresh",
#if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_LINUX)
#if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_LINUX) || \
defined(OS_MACOSX)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment