mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1615056 - Remove layout.css.webkit-appearance.enabled. r=jwatt
I don't think we want to keep the ugly widget hacks forever. Let me know if you'd rather keep the property behind a pref but I don't think there's a point in doing that. Differential Revision: https://phabricator.services.mozilla.com/D62649 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
fc1c08fe45
commit
f63532cf6d
@ -10907,10 +10907,6 @@ exports.PREFERENCES = [
|
||||
"-moz-transform-origin",
|
||||
"layout.css.prefixes.transforms"
|
||||
],
|
||||
[
|
||||
"-webkit-appearance",
|
||||
"layout.css.webkit-appearance.enabled"
|
||||
],
|
||||
[
|
||||
"-moz-column-width",
|
||||
"layout.css.prefixes.columns"
|
||||
|
@ -384,7 +384,6 @@ skip-if = toolkit == 'android' # TIMED_OUT for android
|
||||
skip-if = toolkit == 'android' # TIMED_OUT for android
|
||||
[test_visited_reftests.html]
|
||||
skip-if = toolkit == 'android' # TIMED_OUT for android
|
||||
[test_webkit_appearance_basic.html]
|
||||
[test_webkit_device_pixel_ratio.html]
|
||||
[test_webkit_flex_display.html]
|
||||
[test_first_letter_restrictions.html]
|
||||
|
@ -1478,6 +1478,13 @@ var gCSSProperties = {
|
||||
other_values: ["radio", "menulist"],
|
||||
invalid_values: [],
|
||||
},
|
||||
"-webkit-appearance": {
|
||||
domProp: "webkitAppearance",
|
||||
inherited: false,
|
||||
type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
|
||||
alias_for: "-moz-appearance",
|
||||
subproperties: ["-moz-appearance"],
|
||||
},
|
||||
"border-inline": {
|
||||
domProp: "borderInline",
|
||||
inherited: false,
|
||||
@ -12429,15 +12436,6 @@ if (IsCSSPropertyPrefEnabled("layout.css.overscroll-behavior.enabled")) {
|
||||
invalid_values: ["left", "1px", "contain auto none", "contain nonsense"],
|
||||
};
|
||||
}
|
||||
if (IsCSSPropertyPrefEnabled("layout.css.webkit-appearance.enabled")) {
|
||||
gCSSProperties["-webkit-appearance"] = {
|
||||
domProp: "webkitAppearance",
|
||||
inherited: false,
|
||||
type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
|
||||
alias_for: "-moz-appearance",
|
||||
subproperties: ["-moz-appearance"],
|
||||
};
|
||||
}
|
||||
|
||||
if (IsCSSPropertyPrefEnabled("layout.css.offset-logical-properties.enabled")) {
|
||||
gCSSProperties["offset-block-start"] = {
|
||||
|
@ -1,66 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1429713
|
||||
-->
|
||||
<head>
|
||||
<title>Test pref layout.css.webkit-appearance.enabled</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1429713">Mozilla Bug 1429713</a>
|
||||
<div id="content" style="display: none">
|
||||
<iframe id="iframe"></iframe>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="application/javascript">
|
||||
|
||||
function iframe_reload() {
|
||||
return new Promise(resolve => {
|
||||
iframe.addEventListener("load", _ => resolve());
|
||||
iframe.contentWindow.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
add_task(async function runTests() {
|
||||
// Pref changes only take affect after a page is reloaded, which is why we
|
||||
// use an iframe here and reload it after the pref changes.
|
||||
|
||||
const iframe = document.getElementById("iframe");
|
||||
|
||||
// Test pref enabled:
|
||||
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
"set": [["layout.css.webkit-appearance.enabled", true]],
|
||||
});
|
||||
|
||||
await iframe_reload();
|
||||
|
||||
let win = iframe.contentWindow;
|
||||
let testElem = win.document.body;
|
||||
testElem.style["-webkit-appearance"] = "none";
|
||||
is(window.getComputedStyle(testElem)["-webkit-appearance"], "none",
|
||||
"Pref should enable -webkit-appearance support");
|
||||
|
||||
// Test pref disabled:
|
||||
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
"set": [["layout.css.webkit-appearance.enabled", false]],
|
||||
});
|
||||
|
||||
await iframe_reload();
|
||||
|
||||
win = iframe.contentWindow;
|
||||
testElem = win.document.body;
|
||||
testElem.style["-webkit-appearance"] = "none";
|
||||
is(window.getComputedStyle(testElem)["-webkit-appearance"], undefined,
|
||||
"Pref should disable -webkit-appearance support");
|
||||
});
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -5523,12 +5523,6 @@
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
# Is the '-webkit-appearance' alias for '-moz-appearance' enabled?
|
||||
- name: layout.css.webkit-appearance.enabled
|
||||
type: bool
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
- name: layout.css.xul-display-values.content.enabled
|
||||
type: RelaxedAtomicBool
|
||||
value: false
|
||||
|
@ -635,7 +635,7 @@ ${helpers.predefined_type(
|
||||
"Appearance",
|
||||
"computed::Appearance::None",
|
||||
engines="gecko",
|
||||
alias="-webkit-appearance:layout.css.webkit-appearance.enabled",
|
||||
alias="-webkit-appearance",
|
||||
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-appearance)",
|
||||
animation_value_type="discrete",
|
||||
gecko_ffi_name="mAppearance",
|
||||
|
@ -2666,11 +2666,6 @@ Maybe<nsNativeThemeCocoa::WidgetInfo> nsNativeThemeCocoa::ComputeWidgetInfo(
|
||||
nsIFrame* aFrame, StyleAppearance aAppearance, const nsRect& aRect) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
// setup to draw into the correct port
|
||||
int32_t p2a = aFrame->PresContext()->AppUnitsPerDevPixel();
|
||||
|
||||
@ -2901,6 +2896,7 @@ Maybe<nsNativeThemeCocoa::WidgetInfo> nsNativeThemeCocoa::ComputeWidgetInfo(
|
||||
case StyleAppearance::Statusbar:
|
||||
return Some(WidgetInfo::StatusBar(IsActive(aFrame, YES)));
|
||||
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::Menulist: {
|
||||
ControlParams controlParams = ComputeControlParams(aFrame, eventState);
|
||||
controlParams.focused = controlParams.focused || IsFocused(aFrame);
|
||||
@ -2912,7 +2908,6 @@ Maybe<nsNativeThemeCocoa::WidgetInfo> nsNativeThemeCocoa::ComputeWidgetInfo(
|
||||
return Some(WidgetInfo::Dropdown(params));
|
||||
}
|
||||
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
return Some(WidgetInfo::Button(
|
||||
ButtonParams{ComputeControlParams(aFrame, eventState), ButtonType::eArrowButton}));
|
||||
@ -3417,8 +3412,6 @@ bool nsNativeThemeCocoa::CreateWebRenderCommandsForWidget(
|
||||
case StyleAppearance::Toolbar:
|
||||
case StyleAppearance::MozWindowTitlebar:
|
||||
case StyleAppearance::Statusbar:
|
||||
// NOTE: if you change Menulist and MenulistButton to behave differently,
|
||||
// be sure to handle StaticPrefs::layout_css_webkit_appearance_enabled.
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistTextfield:
|
||||
case StyleAppearance::MenulistButton:
|
||||
@ -3564,8 +3557,6 @@ LayoutDeviceIntMargin nsNativeThemeCocoa::GetWidgetBorder(nsDeviceContext* aCont
|
||||
break;
|
||||
}
|
||||
|
||||
// NOTE: if you change Menulist and MenulistButton to behave differently,
|
||||
// be sure to handle StaticPrefs::layout_css_webkit_appearance_enabled.
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
@ -3683,8 +3674,6 @@ bool nsNativeThemeCocoa::GetWidgetOverflow(nsDeviceContext* aContext, nsIFrame*
|
||||
case StyleAppearance::Textarea:
|
||||
case StyleAppearance::Searchfield:
|
||||
case StyleAppearance::Listbox:
|
||||
// NOTE: if you change Menulist and MenulistButton to behave differently,
|
||||
// be sure to handle StaticPrefs::layout_css_webkit_appearance_enabled.
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
@ -3799,8 +3788,6 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame*
|
||||
break;
|
||||
}
|
||||
|
||||
// NOTE: if you change Menulist and MenulistButton to behave differently,
|
||||
// be sure to handle StaticPrefs::layout_css_webkit_appearance_enabled.
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton: {
|
||||
@ -4066,14 +4053,8 @@ nsNativeThemeCocoa::ThemeChanged() {
|
||||
|
||||
bool nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* aFrame,
|
||||
StyleAppearance aAppearance) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
// if this is a dropdown button in a combobox the answer is always no
|
||||
if (aAppearance == StyleAppearance::MenulistButton ||
|
||||
aAppearance == StyleAppearance::MozMenulistButton) {
|
||||
if (aAppearance == StyleAppearance::MozMenulistButton) {
|
||||
nsIFrame* parentFrame = aFrame->GetParent();
|
||||
if (parentFrame && parentFrame->IsComboboxControlFrame()) return false;
|
||||
}
|
||||
@ -4090,7 +4071,6 @@ bool nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFra
|
||||
[[fallthrough]];
|
||||
|
||||
case StyleAppearance::Listbox:
|
||||
|
||||
case StyleAppearance::Dialog:
|
||||
case StyleAppearance::Window:
|
||||
case StyleAppearance::MozWindowButtonBox:
|
||||
@ -4204,14 +4184,8 @@ bool nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFra
|
||||
}
|
||||
|
||||
bool nsNativeThemeCocoa::WidgetIsContainer(StyleAppearance aAppearance) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
// flesh this out at some point
|
||||
switch (aAppearance) {
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
case StyleAppearance::Radio:
|
||||
case StyleAppearance::Checkbox:
|
||||
@ -4229,12 +4203,9 @@ bool nsNativeThemeCocoa::WidgetIsContainer(StyleAppearance aAppearance) {
|
||||
}
|
||||
|
||||
bool nsNativeThemeCocoa::ThemeDrawsFocusForWidget(StyleAppearance aAppearance) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
if (aAppearance == StyleAppearance::Menulist || aAppearance == StyleAppearance::Button ||
|
||||
if (aAppearance == StyleAppearance::MenulistButton ||
|
||||
aAppearance == StyleAppearance::Button ||
|
||||
aAppearance == StyleAppearance::MozMacHelpButton ||
|
||||
aAppearance == StyleAppearance::MozMacDisclosureButtonOpen ||
|
||||
aAppearance == StyleAppearance::MozMacDisclosureButtonClosed ||
|
||||
|
@ -219,11 +219,6 @@ bool nsNativeThemeGTK::GetGtkWidgetAndState(StyleAppearance aAppearance,
|
||||
WidgetNodeType& aGtkWidgetType,
|
||||
GtkWidgetState* aState,
|
||||
gint* aWidgetFlags) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
if (aState) {
|
||||
memset(aState, 0, sizeof(GtkWidgetState));
|
||||
|
||||
@ -626,6 +621,7 @@ bool nsNativeThemeGTK::GetGtkWidgetAndState(StyleAppearance aAppearance,
|
||||
aGtkWidgetType = MOZ_GTK_TREEVIEW_EXPANDER;
|
||||
if (aWidgetFlags) *aWidgetFlags = GTK_EXPANDER_EXPANDED;
|
||||
break;
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::Menulist:
|
||||
aGtkWidgetType = MOZ_GTK_DROPDOWN;
|
||||
if (aWidgetFlags)
|
||||
@ -637,7 +633,6 @@ bool nsNativeThemeGTK::GetGtkWidgetAndState(StyleAppearance aAppearance,
|
||||
case StyleAppearance::MenulistTextfield:
|
||||
aGtkWidgetType = MOZ_GTK_DROPDOWN_ENTRY;
|
||||
break;
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
aGtkWidgetType = MOZ_GTK_DROPDOWN_ARROW;
|
||||
break;
|
||||
@ -1384,11 +1379,6 @@ bool nsNativeThemeGTK::GetWidgetPadding(nsDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
StyleAppearance aAppearance,
|
||||
LayoutDeviceIntMargin* aResult) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
switch (aAppearance) {
|
||||
case StyleAppearance::ButtonFocus:
|
||||
case StyleAppearance::Toolbarbutton:
|
||||
@ -1400,7 +1390,6 @@ bool nsNativeThemeGTK::GetWidgetPadding(nsDeviceContext* aContext,
|
||||
case StyleAppearance::Dualbutton:
|
||||
case StyleAppearance::TabScrollArrowBack:
|
||||
case StyleAppearance::TabScrollArrowForward:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
case StyleAppearance::ToolbarbuttonDropdown:
|
||||
case StyleAppearance::ButtonArrowUp:
|
||||
@ -1474,11 +1463,6 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
|
||||
aResult->width = aResult->height = 0;
|
||||
*aIsOverridable = true;
|
||||
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
switch (aAppearance) {
|
||||
case StyleAppearance::ScrollbarbuttonUp:
|
||||
case StyleAppearance::ScrollbarbuttonDown: {
|
||||
@ -1579,7 +1563,6 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
|
||||
moz_gtk_get_tab_scroll_arrow_size(&aResult->width, &aResult->height);
|
||||
*aIsOverridable = false;
|
||||
} break;
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton: {
|
||||
moz_gtk_get_combo_box_entry_button_size(&aResult->width,
|
||||
&aResult->height);
|
||||
@ -1638,9 +1621,11 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
|
||||
case StyleAppearance::RadioLabel:
|
||||
case StyleAppearance::Button:
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::Toolbarbutton:
|
||||
case StyleAppearance::Treeheadercell: {
|
||||
if (aAppearance == StyleAppearance::Menulist) {
|
||||
if (aAppearance == StyleAppearance::Menulist ||
|
||||
aAppearance == StyleAppearance::MenulistButton) {
|
||||
// Include the arrow size.
|
||||
moz_gtk_get_arrow_size(MOZ_GTK_DROPDOWN, &aResult->width,
|
||||
&aResult->height);
|
||||
@ -1820,14 +1805,10 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
switch (aAppearance) {
|
||||
// Combobox dropdowns don't support native theming in vertical mode.
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MenulistText:
|
||||
if (aFrame && aFrame->GetWritingMode().IsVertical()) {
|
||||
return false;
|
||||
@ -1933,7 +1914,6 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
|
||||
return gtk_check_version(3, 10, 0) == nullptr &&
|
||||
!IsWidgetStyled(aPresContext, aFrame, aAppearance);
|
||||
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
if (aFrame && aFrame->GetWritingMode().IsVertical()) {
|
||||
return false;
|
||||
@ -1955,14 +1935,8 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
|
||||
|
||||
NS_IMETHODIMP_(bool)
|
||||
nsNativeThemeGTK::WidgetIsContainer(StyleAppearance aAppearance) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
// XXXdwh At some point flesh all of this out.
|
||||
if (aAppearance == StyleAppearance::MenulistButton ||
|
||||
aAppearance == StyleAppearance::MozMenulistButton ||
|
||||
if (aAppearance == StyleAppearance::MozMenulistButton ||
|
||||
aAppearance == StyleAppearance::Radio ||
|
||||
aAppearance == StyleAppearance::RangeThumb ||
|
||||
aAppearance == StyleAppearance::Checkbox ||
|
||||
@ -1977,12 +1951,8 @@ nsNativeThemeGTK::WidgetIsContainer(StyleAppearance aAppearance) {
|
||||
}
|
||||
|
||||
bool nsNativeThemeGTK::ThemeDrawsFocusForWidget(StyleAppearance aAppearance) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
if (aAppearance == StyleAppearance::Menulist ||
|
||||
aAppearance == StyleAppearance::MenulistButton ||
|
||||
aAppearance == StyleAppearance::Button ||
|
||||
aAppearance == StyleAppearance::Treeheadercell)
|
||||
return true;
|
||||
|
@ -24,11 +24,6 @@ HeadlessThemeGTK::DrawWidgetBackground(gfxContext* aContext, nsIFrame* aFrame,
|
||||
|
||||
LayoutDeviceIntMargin HeadlessThemeGTK::GetWidgetBorder(
|
||||
nsDeviceContext* aContext, nsIFrame* aFrame, StyleAppearance aAppearance) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
LayoutDeviceIntMargin result;
|
||||
// The following values are generated from the Ubuntu GTK theme.
|
||||
switch (aAppearance) {
|
||||
@ -84,13 +79,13 @@ LayoutDeviceIntMargin HeadlessThemeGTK::GetWidgetBorder(
|
||||
result.bottom = 6;
|
||||
result.left = 6;
|
||||
break;
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::Menulist:
|
||||
result.top = 6;
|
||||
result.right = 22;
|
||||
result.bottom = 6;
|
||||
result.left = 7;
|
||||
break;
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
result.top = 1;
|
||||
result.right = 1;
|
||||
@ -118,11 +113,6 @@ bool HeadlessThemeGTK::GetWidgetPadding(nsDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
StyleAppearance aAppearance,
|
||||
LayoutDeviceIntMargin* aResult) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
// The following values are generated from the Ubuntu GTK theme.
|
||||
switch (aAppearance) {
|
||||
case StyleAppearance::Radio:
|
||||
@ -136,7 +126,6 @@ bool HeadlessThemeGTK::GetWidgetPadding(nsDeviceContext* aContext,
|
||||
case StyleAppearance::ButtonArrowPrevious:
|
||||
case StyleAppearance::TabScrollArrowBack:
|
||||
case StyleAppearance::TabScrollArrowForward:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
case StyleAppearance::RangeThumb:
|
||||
case StyleAppearance::ButtonFocus:
|
||||
@ -171,11 +160,6 @@ HeadlessThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
|
||||
aResult->width = aResult->height = 0;
|
||||
*aIsOverridable = true;
|
||||
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
// The following values are generated from the Ubuntu GTK theme.
|
||||
switch (aAppearance) {
|
||||
case StyleAppearance::Splitter:
|
||||
@ -275,11 +259,11 @@ HeadlessThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
|
||||
aResult->height = 31;
|
||||
*aIsOverridable = false;
|
||||
break;
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::Menulist:
|
||||
aResult->width = 44;
|
||||
aResult->height = 27;
|
||||
break;
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
aResult->width = 29;
|
||||
aResult->height = 28;
|
||||
@ -329,11 +313,6 @@ NS_IMETHODIMP_(bool)
|
||||
HeadlessThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
StyleAppearance aAppearance) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
switch (aAppearance) {
|
||||
case StyleAppearance::Button:
|
||||
case StyleAppearance::Radio:
|
||||
@ -388,6 +367,7 @@ HeadlessThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
|
||||
case StyleAppearance::Textfield:
|
||||
case StyleAppearance::Textarea:
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MenulistText:
|
||||
case StyleAppearance::MenulistTextfield:
|
||||
case StyleAppearance::ScaleHorizontal:
|
||||
@ -412,7 +392,6 @@ HeadlessThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
|
||||
case StyleAppearance::Menuarrow:
|
||||
case StyleAppearance::MozGtkInfoBar:
|
||||
return !IsWidgetStyled(aPresContext, aFrame, aAppearance);
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
return (!aFrame ||
|
||||
IsFrameContentNodeInNamespace(aFrame, kNameSpaceID_XUL)) &&
|
||||
@ -425,13 +404,7 @@ HeadlessThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
|
||||
|
||||
NS_IMETHODIMP_(bool)
|
||||
HeadlessThemeGTK::WidgetIsContainer(StyleAppearance aAppearance) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
if (aAppearance == StyleAppearance::MenulistButton ||
|
||||
aAppearance == StyleAppearance::MozMenulistButton ||
|
||||
if (aAppearance == StyleAppearance::MozMenulistButton ||
|
||||
aAppearance == StyleAppearance::Radio ||
|
||||
aAppearance == StyleAppearance::RangeThumb ||
|
||||
aAppearance == StyleAppearance::Checkbox ||
|
||||
|
@ -699,8 +699,6 @@ bool nsNativeBasicTheme::GetWidgetOverflow(nsDeviceContext* aContext,
|
||||
case StyleAppearance::Textarea:
|
||||
case StyleAppearance::Searchfield:
|
||||
case StyleAppearance::Listbox:
|
||||
// NOTE: if you change Menulist and MenulistButton to behave differently,
|
||||
// be sure to handle StaticPrefs::layout_css_webkit_appearance_enabled.
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
@ -841,11 +839,6 @@ nsITheme::ThemeGeometryType nsNativeBasicTheme::ThemeGeometryTypeForWidget(
|
||||
bool nsNativeBasicTheme::ThemeSupportsWidget(nsPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
StyleAppearance aAppearance) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
if (IsWidgetScrollbarPart(aAppearance)) {
|
||||
const auto* style = nsLayoutUtils::StyleForScrollbar(aFrame);
|
||||
// We don't currently handle custom scrollbars on nsNativeBasicTheme. We
|
||||
@ -875,9 +868,9 @@ bool nsNativeBasicTheme::ThemeSupportsWidget(nsPresContext* aPresContext,
|
||||
case StyleAppearance::Button:
|
||||
case StyleAppearance::Listbox:
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MenulistTextfield:
|
||||
case StyleAppearance::NumberInput:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
case StyleAppearance::SpinnerUpbutton:
|
||||
case StyleAppearance::SpinnerDownbutton:
|
||||
@ -888,13 +881,7 @@ bool nsNativeBasicTheme::ThemeSupportsWidget(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
bool nsNativeBasicTheme::WidgetIsContainer(StyleAppearance aAppearance) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
switch (aAppearance) {
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
case StyleAppearance::Radio:
|
||||
case StyleAppearance::Checkbox:
|
||||
|
@ -289,8 +289,7 @@ bool nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext,
|
||||
aAppearance == StyleAppearance::Textarea ||
|
||||
aAppearance == StyleAppearance::Listbox ||
|
||||
aAppearance == StyleAppearance::Menulist ||
|
||||
(aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled())) &&
|
||||
aAppearance == StyleAppearance::MenulistButton) &&
|
||||
aFrame->GetContent()->IsHTMLElement() &&
|
||||
aPresContext->HasAuthorSpecifiedRules(
|
||||
aFrame,
|
||||
|
@ -746,8 +746,6 @@ mozilla::Maybe<nsUXThemeClass> nsNativeThemeWin::GetThemeClass(
|
||||
case StyleAppearance::Resizerpanel:
|
||||
case StyleAppearance::Resizer:
|
||||
return Some(eUXStatus);
|
||||
// NOTE: if you change Menulist and MenulistButton to behave differently,
|
||||
// be sure to handle StaticPrefs::layout_css_webkit_appearance_enabled.
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
@ -835,11 +833,6 @@ nsresult nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame,
|
||||
StyleAppearance aAppearance,
|
||||
int32_t& aPart,
|
||||
int32_t& aState) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
switch (aAppearance) {
|
||||
case StyleAppearance::Button: {
|
||||
aPart = BP_BUTTON;
|
||||
@ -1238,6 +1231,7 @@ nsresult nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame,
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::Menulist: {
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
bool useDropBorder = content && content->IsHTMLElement();
|
||||
@ -1272,7 +1266,6 @@ nsresult nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame,
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton: {
|
||||
bool isHTML = IsHTMLContent(aFrame);
|
||||
nsIFrame* parentFrame = aFrame->GetParent();
|
||||
@ -1540,11 +1533,6 @@ nsNativeThemeWin::DrawWidgetBackground(gfxContext* aContext, nsIFrame* aFrame,
|
||||
StyleAppearance aAppearance,
|
||||
const nsRect& aRect,
|
||||
const nsRect& aDirtyRect) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
if (IsWidgetScrollbarPart(aAppearance)) {
|
||||
if (MayDrawCustomScrollbarPart(aContext, aFrame, aAppearance, aRect,
|
||||
aDirtyRect)) {
|
||||
@ -1829,7 +1817,6 @@ RENDER_AGAIN:
|
||||
}
|
||||
// The following widgets need to be RTL-aware
|
||||
else if (aAppearance == StyleAppearance::Resizer ||
|
||||
aAppearance == StyleAppearance::MenulistButton ||
|
||||
aAppearance == StyleAppearance::MozMenulistButton) {
|
||||
DrawThemeBGRTLAware(theme, hdc, part, state, &widgetRect, &clipRect,
|
||||
IsFrameRTL(aFrame));
|
||||
@ -2055,11 +2042,6 @@ bool nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
StyleAppearance aAppearance,
|
||||
LayoutDeviceIntMargin* aResult) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
switch (aAppearance) {
|
||||
// Radios and checkboxes return a fixed size in GetMinimumWidgetSize
|
||||
// and have a meaningful baseline, so they can't have
|
||||
@ -2134,6 +2116,7 @@ bool nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext,
|
||||
aAppearance == StyleAppearance::NumberInput ||
|
||||
aAppearance == StyleAppearance::Textfield ||
|
||||
aAppearance == StyleAppearance::Textarea ||
|
||||
aAppearance == StyleAppearance::MenulistButton ||
|
||||
aAppearance == StyleAppearance::Menulist) {
|
||||
// If we have author-specified padding for these elements, don't do the
|
||||
// fixups below.
|
||||
@ -2157,7 +2140,8 @@ bool nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext,
|
||||
ScaleForFrameDPI(aResult, aFrame);
|
||||
return ok;
|
||||
} else if (IsHTMLContent(aFrame) &&
|
||||
aAppearance == StyleAppearance::Menulist) {
|
||||
(aAppearance == StyleAppearance::Menulist ||
|
||||
aAppearance == StyleAppearance::MenulistButton)) {
|
||||
/* For content menulist controls, we need an extra pixel so that we have
|
||||
* room to draw our focus rectangle stuff. Otherwise, the focus rect might
|
||||
* overlap the control's border.
|
||||
@ -2264,11 +2248,6 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsPresContext* aPresContext,
|
||||
StyleAppearance aAppearance,
|
||||
LayoutDeviceIntSize* aResult,
|
||||
bool* aIsOverridable) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
aResult->width = aResult->height = 0;
|
||||
*aIsOverridable = true;
|
||||
nsresult rv = NS_OK;
|
||||
@ -2326,7 +2305,6 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsPresContext* aPresContext,
|
||||
case StyleAppearance::ScrollbarbuttonRight:
|
||||
case StyleAppearance::ScrollbarHorizontal:
|
||||
case StyleAppearance::ScrollbarVertical:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton: {
|
||||
rv = ClassicGetMinimumWidgetSize(aFrame, aAppearance, aResult,
|
||||
aIsOverridable);
|
||||
@ -2511,11 +2489,6 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame,
|
||||
StyleAppearance aAppearance,
|
||||
nsAtom* aAttribute, bool* aShouldRepaint,
|
||||
const nsAttrValue* aOldValue) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
// Some widget types just never change state.
|
||||
if (aAppearance == StyleAppearance::Toolbox ||
|
||||
aAppearance == StyleAppearance::MozWinMediaToolbox ||
|
||||
@ -2553,9 +2526,6 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame,
|
||||
|
||||
// We need to repaint the dropdown arrow in vista HTML combobox controls when
|
||||
// the control is closed to get rid of the hover effect.
|
||||
//
|
||||
// NOTE: if you change Menulist and MenulistButton to behave differently,
|
||||
// be sure to handle StaticPrefs::layout_css_webkit_appearance_enabled.
|
||||
if ((aAppearance == StyleAppearance::Menulist ||
|
||||
aAppearance == StyleAppearance::MenulistButton ||
|
||||
aAppearance == StyleAppearance::MozMenulistButton) &&
|
||||
@ -2622,14 +2592,8 @@ bool nsNativeThemeWin::ThemeSupportsWidget(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
bool nsNativeThemeWin::WidgetIsContainer(StyleAppearance aAppearance) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
// XXXdwh At some point flesh all of this out.
|
||||
if (aAppearance == StyleAppearance::MenulistButton ||
|
||||
aAppearance == StyleAppearance::MozMenulistButton ||
|
||||
if (aAppearance == StyleAppearance::MozMenulistButton ||
|
||||
aAppearance == StyleAppearance::Radio ||
|
||||
aAppearance == StyleAppearance::Checkbox)
|
||||
return false;
|
||||
@ -2786,11 +2750,9 @@ bool nsNativeThemeWin::ClassicThemeSupportsWidget(nsIFrame* aFrame,
|
||||
case StyleAppearance::ScaleVertical:
|
||||
case StyleAppearance::ScalethumbHorizontal:
|
||||
case StyleAppearance::ScalethumbVertical:
|
||||
// NOTE: if you change Menulist and MenulistButton to behave differently,
|
||||
// be sure to handle StaticPrefs::layout_css_webkit_appearance_enabled.
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistTextfield:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MenulistTextfield:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
case StyleAppearance::InnerSpinButton:
|
||||
case StyleAppearance::SpinnerUpbutton:
|
||||
@ -2834,11 +2796,6 @@ bool nsNativeThemeWin::ClassicThemeSupportsWidget(nsIFrame* aFrame,
|
||||
|
||||
LayoutDeviceIntMargin nsNativeThemeWin::ClassicGetWidgetBorder(
|
||||
nsDeviceContext* aContext, nsIFrame* aFrame, StyleAppearance aAppearance) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
LayoutDeviceIntMargin result;
|
||||
switch (aAppearance) {
|
||||
case StyleAppearance::Groupbox:
|
||||
@ -2852,6 +2809,7 @@ LayoutDeviceIntMargin nsNativeThemeWin::ClassicGetWidgetBorder(
|
||||
case StyleAppearance::Listbox:
|
||||
case StyleAppearance::Treeview:
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MenulistTextfield:
|
||||
case StyleAppearance::Tab:
|
||||
case StyleAppearance::NumberInput:
|
||||
@ -2931,11 +2889,6 @@ bool nsNativeThemeWin::ClassicGetWidgetPadding(nsDeviceContext* aContext,
|
||||
nsresult nsNativeThemeWin::ClassicGetMinimumWidgetSize(
|
||||
nsIFrame* aFrame, StyleAppearance aAppearance, LayoutDeviceIntSize* aResult,
|
||||
bool* aIsOverridable) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
(*aResult).width = (*aResult).height = 0;
|
||||
*aIsOverridable = true;
|
||||
switch (aAppearance) {
|
||||
@ -3007,11 +2960,11 @@ nsresult nsNativeThemeWin::ClassicGetMinimumWidgetSize(
|
||||
(*aResult).height = 12;
|
||||
*aIsOverridable = false;
|
||||
break;
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
(*aResult).width = ::GetSystemMetrics(SM_CXVSCROLL);
|
||||
break;
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::Button:
|
||||
case StyleAppearance::Groupbox:
|
||||
case StyleAppearance::Listbox:
|
||||
@ -3128,11 +3081,6 @@ nsresult nsNativeThemeWin::ClassicGetMinimumWidgetSize(
|
||||
nsresult nsNativeThemeWin::ClassicGetThemePartAndState(
|
||||
nsIFrame* aFrame, StyleAppearance aAppearance, int32_t& aPart,
|
||||
int32_t& aState, bool& aFocused) {
|
||||
if (aAppearance == StyleAppearance::MenulistButton &&
|
||||
StaticPrefs::layout_css_webkit_appearance_enabled()) {
|
||||
aAppearance = StyleAppearance::Menulist;
|
||||
}
|
||||
|
||||
aFocused = false;
|
||||
switch (aAppearance) {
|
||||
case StyleAppearance::Button: {
|
||||
@ -3267,6 +3215,7 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(
|
||||
case StyleAppearance::Textfield:
|
||||
case StyleAppearance::Textarea:
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MenulistTextfield:
|
||||
case StyleAppearance::Range:
|
||||
case StyleAppearance::RangeThumb:
|
||||
@ -3294,7 +3243,6 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(
|
||||
case StyleAppearance::Groupbox:
|
||||
// these don't use DrawFrameControl
|
||||
return NS_OK;
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton: {
|
||||
aPart = DFC_SCROLL;
|
||||
aState = DFCS_SCROLLCOMBOBOX;
|
||||
@ -3671,7 +3619,6 @@ RENDER_AGAIN:
|
||||
case StyleAppearance::InnerSpinButton:
|
||||
case StyleAppearance::SpinnerUpbutton:
|
||||
case StyleAppearance::SpinnerDownbutton:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
case StyleAppearance::Resizer: {
|
||||
int32_t oldTA;
|
||||
@ -3687,6 +3634,7 @@ RENDER_AGAIN:
|
||||
case StyleAppearance::Textarea:
|
||||
case StyleAppearance::Listbox:
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MenulistTextfield: {
|
||||
// Paint the border, except for 'menulist-textfield' that isn't focused:
|
||||
if (aAppearance != StyleAppearance::MenulistTextfield || focused) {
|
||||
@ -4043,8 +3991,8 @@ uint32_t nsNativeThemeWin::GetWidgetNativeDrawingFlags(
|
||||
case StyleAppearance::FocusOutline:
|
||||
case StyleAppearance::Textfield:
|
||||
case StyleAppearance::Textarea:
|
||||
|
||||
case StyleAppearance::Menulist:
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MenulistTextfield:
|
||||
return gfxWindowsNativeDrawing::CANNOT_DRAW_TO_COLOR_ALPHA |
|
||||
gfxWindowsNativeDrawing::CAN_AXIS_ALIGNED_SCALE |
|
||||
@ -4053,7 +4001,6 @@ uint32_t nsNativeThemeWin::GetWidgetNativeDrawingFlags(
|
||||
// the dropdown button /almost/ renders correctly with scaling,
|
||||
// except that the graphic in the dropdown button (the downward arrow)
|
||||
// doesn't get scaled up.
|
||||
case StyleAppearance::MenulistButton:
|
||||
case StyleAppearance::MozMenulistButton:
|
||||
// these are definitely no; they're all graphics that don't get scaled up
|
||||
case StyleAppearance::Checkbox:
|
||||
|
Loading…
Reference in New Issue
Block a user