Skip to content

Commit

Permalink
Revert "Make macOS respect FormControlsRefresh feature"
Browse files Browse the repository at this point in the history
This reverts commit 6cbf3f7.

Reason for revert: looks like this broke a couple of layout tests on Mac crbug.com/963280

Original change's description:
> Make macOS respect FormControlsRefresh feature
> 
> The FormControlsRefresh feature will make macOS use the Aura theme (and
> the refresh theme, where it is implemented).
> 
> Add a runtime feature, FormControlsRefresh, to control this in blink.
> 
> Bug: 846357, 956778
> Change-Id: I4eefee7ef06748b95d4f2df361a38001a4989b0e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611108
> Reviewed-by: Philip Rogers <pdr@chromium.org>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Commit-Queue: ccameron <ccameron@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#659730}

TBR=avi@chromium.org,ccameron@chromium.org,pdr@chromium.org

Change-Id: Ib34449715a2536c2fdab2933822d38356df8ec6f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 846357, 956778
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1609748
Reviewed-by: Fergal Daly <fergal@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659802}
  • Loading branch information
fergald authored and Commit Bot committed May 15, 2019
1 parent b8852cb commit 12e9c5c
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 36 deletions.
3 changes: 0 additions & 3 deletions content/child/blink_platform_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#include "third_party/blink/public/resources/grit/blink_resources.h"
#include "third_party/zlib/google/compression_utils.h"
#include "ui/base/layout.h"
#include "ui/base/ui_base_features.h"
#include "ui/events/gestures/blink/web_gesture_curve_impl.h"

#if defined(OS_ANDROID)
Expand Down Expand Up @@ -78,8 +77,6 @@ std::unique_ptr<blink::WebThemeEngine> GetWebThemeEngine() {
#if defined(OS_ANDROID)
return std::make_unique<WebThemeEngineAndroid>();
#elif defined(OS_MACOSX)
if (features::IsFormControlsRefreshEnabled())
return std::make_unique<WebThemeEngineDefault>();
return std::make_unique<WebThemeEngineMac>();
#else
return std::make_unique<WebThemeEngineDefault>();
Expand Down
4 changes: 0 additions & 4 deletions content/child/runtime_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/platform/web_runtime_features.h"
#include "ui/base/ui_base_features.h"
#include "ui/events/blink/blink_features.h"
#include "ui/gfx/switches.h"
#include "ui/gl/gl_switches.h"
Expand Down Expand Up @@ -502,9 +501,6 @@ void SetIndividualRuntimeFeatures(

WebRuntimeFeatures::EnableDisplayLocking(
base::FeatureList::IsEnabled(blink::features::kDisplayLocking));

WebRuntimeFeatures::EnableFormControlsRefresh(
features::IsFormControlsRefreshEnabled());
}

} // namespace
Expand Down
1 change: 0 additions & 1 deletion third_party/blink/public/platform/web_runtime_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableFirstContentfulPaintPlusPlus(bool);
BLINK_PLATFORM_EXPORT static void EnableForceSynchronousHTMLParsing(bool);
BLINK_PLATFORM_EXPORT static void EnableForceTallerSelectPopup(bool);
BLINK_PLATFORM_EXPORT static void EnableFormControlsRefresh(bool);
BLINK_PLATFORM_EXPORT static void EnableGenericSensor(bool);
BLINK_PLATFORM_EXPORT static void EnableGenericSensorExtraClasses(bool);
BLINK_PLATFORM_EXPORT static void EnableHeapCompaction(bool);
Expand Down
18 changes: 2 additions & 16 deletions third_party/blink/renderer/core/layout/layout_theme_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#import "third_party/blink/renderer/core/fileapi/file_list.h"
#import "third_party/blink/renderer/core/html_names.h"
#import "third_party/blink/renderer/core/layout/layout_progress.h"
#import "third_party/blink/renderer/core/layout/layout_theme_default.h"
#import "third_party/blink/renderer/core/layout/layout_view.h"
#import "third_party/blink/renderer/core/style/shadow_list.h"
#import "third_party/blink/renderer/platform/data_resource_helper.h"
Expand Down Expand Up @@ -139,13 +138,6 @@ - (NSText*)currentEditor {

namespace {

class LayoutThemeMacRefresh final : public LayoutThemeDefault {
public:
static scoped_refptr<LayoutTheme> Create() {
return base::AdoptRef(new LayoutThemeMacRefresh());
}
};

// Inflate an IntRect to account for specific padding around margins.
enum { kTopMargin = 0, kRightMargin = 1, kBottomMargin = 2, kLeftMargin = 3 };

Expand Down Expand Up @@ -1019,14 +1011,8 @@ static FontSelectionValue ToFontWeight(NSInteger app_kit_font_weight) {
}

LayoutTheme& LayoutTheme::NativeTheme() {
if (RuntimeEnabledFeatures::FormControlsRefreshEnabled()) {
DEFINE_STATIC_REF(LayoutTheme, layout_theme,
(LayoutThemeMacRefresh::Create()));
return *layout_theme;
} else {
DEFINE_STATIC_REF(LayoutTheme, layout_theme, (LayoutThemeMac::Create()));
return *layout_theme;
}
DEFINE_STATIC_REF(LayoutTheme, layout_theme, (LayoutThemeMac::Create()));
return *layout_theme;
}

scoped_refptr<LayoutTheme> LayoutThemeMac::Create() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,6 @@ void WebRuntimeFeatures::EnableForceTallerSelectPopup(bool enable) {
RuntimeEnabledFeatures::SetForceTallerSelectPopupEnabled(enable);
}

void WebRuntimeFeatures::EnableFormControlsRefresh(bool enable) {
RuntimeEnabledFeatures::SetFormControlsRefreshEnabled(enable);
}

void WebRuntimeFeatures::EnableGenericSensor(bool enable) {
RuntimeEnabledFeatures::SetSensorEnabled(enable);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,6 @@
name: "FormAssociatedCustomElements",
status: "experimental",
},
// This is to communicate features::FormControlsRefresh from ui (and can be
// removed when the feature launches).
{
name: "FormControlsRefresh",
},
{
name: "FormDataEvent",
status: "experimental",
Expand Down
3 changes: 0 additions & 3 deletions ui/native_theme/native_theme_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/skia_util.h"
#include "ui/native_theme/common_theme.h"
#include "ui/native_theme/native_theme_aura.h"

namespace {

Expand Down Expand Up @@ -153,8 +152,6 @@ SkColor ColorToGrayscale(SkColor color) {

// static
NativeTheme* NativeTheme::GetInstanceForWeb() {
if (features::IsFormControlsRefreshEnabled())
return NativeThemeAura::web_instance();
return NativeThemeMac::instance();
}

Expand Down

0 comments on commit 12e9c5c

Please sign in to comment.