diff --git a/devtools/shared/css/generated/properties-db.js b/devtools/shared/css/generated/properties-db.js index 5f0d0abd2a49..eb62edcd4d41 100644 --- a/devtools/shared/css/generated/properties-db.js +++ b/devtools/shared/css/generated/properties-db.js @@ -226,8 +226,6 @@ exports.CSS_PROPERTIES = { "button-arrow-previous", "button-arrow-up", "checkbox", - "checkbox-container", - "checkbox-label", "checkmenuitem", "dialog", "dualbutton", @@ -246,8 +244,6 @@ exports.CSS_PROPERTIES = { "progress-bar", "progresschunk", "radio", - "radio-container", - "radio-label", "range", "range-thumb", "revert", @@ -1481,8 +1477,6 @@ exports.CSS_PROPERTIES = { "button-arrow-previous", "button-arrow-up", "checkbox", - "checkbox-container", - "checkbox-label", "checkmenuitem", "dialog", "dualbutton", @@ -1501,8 +1495,6 @@ exports.CSS_PROPERTIES = { "progress-bar", "progresschunk", "radio", - "radio-container", - "radio-label", "range", "range-thumb", "revert", @@ -3519,8 +3511,6 @@ exports.CSS_PROPERTIES = { "button-arrow-previous", "button-arrow-up", "checkbox", - "checkbox-container", - "checkbox-label", "checkmenuitem", "dialog", "dualbutton", @@ -3539,8 +3529,6 @@ exports.CSS_PROPERTIES = { "progress-bar", "progresschunk", "radio", - "radio-container", - "radio-label", "range", "range-thumb", "revert", diff --git a/servo/components/style/values/specified/box.rs b/servo/components/style/values/specified/box.rs index 190468a1688c..c1dc017bd0c5 100644 --- a/servo/components/style/values/specified/box.rs +++ b/servo/components/style/values/specified/box.rs @@ -1508,18 +1508,6 @@ pub enum Appearance { /// The progress bar's progress indicator #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] Progresschunk, - /// A generic container that always repaints on state changes. This is a - /// hack to make XUL checkboxes and radio buttons work. - #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] - CheckboxContainer, - #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] - RadioContainer, - /// The label part of a checkbox or radio button, used for painting a focus - /// outline. - #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] - CheckboxLabel, - #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] - RadioLabel, /// nsRangeFrame and its subparts #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")] Range, diff --git a/toolkit/themes/shared/checkbox.css b/toolkit/themes/shared/checkbox.css index 7f39159cb7e8..35539546e516 100644 --- a/toolkit/themes/shared/checkbox.css +++ b/toolkit/themes/shared/checkbox.css @@ -126,8 +126,6 @@ checkbox[native][disabled="true"] { @media (-moz-platform: windows) or (-moz-platform: linux) { checkbox[native]:focus-visible > .checkbox-label-box { - /* On Linux, native theming should take care of this but it appears to be - * broken with some Gtk themes. Bug 1312169. */ outline: var(--focus-outline); } } @@ -152,14 +150,6 @@ checkbox[native][disabled="true"] { @media (-moz-platform: linux) { checkbox:where([native]) { - appearance: auto; - -moz-default-appearance: checkbox-container; margin: 2px 4px; } - - .checkbox-label-box[native] { - /* FIXME: Is this needed given the focus rules above? */ - appearance: auto; - -moz-default-appearance: checkbox-label; - } } diff --git a/toolkit/themes/shared/radio.css b/toolkit/themes/shared/radio.css index 181838861c6f..b1a393b480ad 100644 --- a/toolkit/themes/shared/radio.css +++ b/toolkit/themes/shared/radio.css @@ -53,8 +53,6 @@ radio { } @media (-moz-platform: windows) or (-moz-platform: linux) { - /* On Linux, native theming should take care of this but it appears to be - * broken with some Gtk themes. Bug 1312169. */ radiogroup:focus-visible > radio[focused="true"] > .radio-label-box { outline: var(--focus-outline); } @@ -72,14 +70,6 @@ radio { } } -@media (-moz-platform: linux) { - /* FIXME: Is this needed given the focused styles above? */ - .radio-label-box { - appearance: auto; - -moz-default-appearance: radio-label; - } -} - @media (-moz-platform: macos) { .radio-label, radiogroup { diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index 3085db0cf172..50be1f398f94 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -3207,7 +3207,6 @@ bool nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFra case StyleAppearance::Tooltip: case StyleAppearance::Checkbox: - case StyleAppearance::CheckboxContainer: case StyleAppearance::Radio: case StyleAppearance::RadioContainer: case StyleAppearance::MozMacHelpButton: diff --git a/widget/gtk/gtk3drawing.cpp b/widget/gtk/gtk3drawing.cpp index b9e927174ccf..142bfbc96d03 100644 --- a/widget/gtk/gtk3drawing.cpp +++ b/widget/gtk/gtk3drawing.cpp @@ -1211,35 +1211,6 @@ static gint moz_gtk_combo_box_entry_button_paint(cairo_t* cr, return MOZ_GTK_SUCCESS; } -static gint moz_gtk_container_paint(cairo_t* cr, GdkRectangle* rect, - GtkWidgetState* state, - WidgetNodeType widget_type, - GtkTextDirection direction) { - GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state); - GtkStyleContext* style = - GetStyleContext(widget_type, state->image_scale, direction, state_flags); - /* this is for drawing a prelight box */ - if (state_flags & GTK_STATE_FLAG_PRELIGHT) { - gtk_render_background(style, cr, rect->x, rect->y, rect->width, - rect->height); - } - - return MOZ_GTK_SUCCESS; -} - -static gint moz_gtk_toggle_label_paint(cairo_t* cr, GdkRectangle* rect, - GtkWidgetState* state, gboolean isradio, - GtkTextDirection direction) { - if (!state->focused) return MOZ_GTK_SUCCESS; - - GtkStyleContext* style = GetStyleContext( - isradio ? MOZ_GTK_RADIOBUTTON_CONTAINER : MOZ_GTK_CHECKBUTTON_CONTAINER, - state->image_scale, direction, GetStateFlagsFromGtkWidgetState(state)); - gtk_render_focus(style, cr, rect->x, rect->y, rect->width, rect->height); - - return MOZ_GTK_SUCCESS; -} - static gint moz_gtk_toolbar_paint(cairo_t* cr, GdkRectangle* rect, GtkWidgetState* state, GtkTextDirection direction) { @@ -1884,18 +1855,6 @@ gint moz_gtk_get_widget_border(WidgetNodeType widget, gint* left, gint* top, case MOZ_GTK_FRAME: w = GetWidget(MOZ_GTK_FRAME); break; - case MOZ_GTK_CHECKBUTTON_CONTAINER: - case MOZ_GTK_RADIOBUTTON_CONTAINER: { - w = GetWidget(widget); - if (w) { - style = gtk_widget_get_style_context(w); - - *left = *top = *right = *bottom = - gtk_container_get_border_width(GTK_CONTAINER(w)); - moz_gtk_add_border_padding(style, left, top, right, bottom); - } - return MOZ_GTK_SUCCESS; - } case MOZ_GTK_TOOLTIP: { // In GTK 3 there are 6 pixels of additional margin around the box. // See details there: @@ -1930,8 +1889,6 @@ gint moz_gtk_get_widget_border(WidgetNodeType widget, gint* left, gint* top, return MOZ_GTK_SUCCESS; } /* These widgets have no borders, since they are not containers. */ - case MOZ_GTK_CHECKBUTTON_LABEL: - case MOZ_GTK_RADIOBUTTON_LABEL: case MOZ_GTK_SPLITTER_HORIZONTAL: case MOZ_GTK_SPLITTER_VERTICAL: case MOZ_GTK_CHECKBUTTON: @@ -2391,13 +2348,6 @@ gint moz_gtk_widget_paint(WidgetNodeType widget, cairo_t* cr, case MOZ_GTK_DROPDOWN_ARROW: return moz_gtk_combo_box_entry_button_paint(cr, rect, state, flags, direction); - case MOZ_GTK_CHECKBUTTON_CONTAINER: - case MOZ_GTK_RADIOBUTTON_CONTAINER: - return moz_gtk_container_paint(cr, rect, state, widget, direction); - case MOZ_GTK_CHECKBUTTON_LABEL: - case MOZ_GTK_RADIOBUTTON_LABEL: - return moz_gtk_toggle_label_paint( - cr, rect, state, (widget == MOZ_GTK_RADIOBUTTON_LABEL), direction); case MOZ_GTK_TOOLBAR: return moz_gtk_toolbar_paint(cr, rect, state, direction); case MOZ_GTK_TOOLBAR_SEPARATOR: diff --git a/widget/gtk/gtkdrawing.h b/widget/gtk/gtkdrawing.h index 24c7ab81143b..3b342412c675 100644 --- a/widget/gtk/gtkdrawing.h +++ b/widget/gtk/gtkdrawing.h @@ -130,15 +130,11 @@ enum WidgetNodeType : int { MOZ_GTK_CHECKBUTTON_CONTAINER, /* Paints a GtkCheckButton. flags is a boolean, 1=checked, 0=not checked. */ MOZ_GTK_CHECKBUTTON, - /* Paints the label of a GtkCheckButton (focus outline) */ - MOZ_GTK_CHECKBUTTON_LABEL, /* Paints the container part of a GtkRadioButton. */ MOZ_GTK_RADIOBUTTON_CONTAINER, /* Paints a GtkRadioButton. flags is a boolean, 1=checked, 0=not checked. */ MOZ_GTK_RADIOBUTTON, - /* Paints the label of a GtkRadioButton (focus outline) */ - MOZ_GTK_RADIOBUTTON_LABEL, /* Vertical GtkScrollbar counterparts */ MOZ_GTK_SCROLLBAR_VERTICAL, MOZ_GTK_SCROLLBAR_CONTENTS_VERTICAL, diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp index 64f8136218a5..d8efdc3252e8 100644 --- a/widget/gtk/nsNativeThemeGTK.cpp +++ b/widget/gtk/nsNativeThemeGTK.cpp @@ -272,10 +272,10 @@ bool nsNativeThemeGTK::GetGtkWidgetAndState(StyleAppearance aAppearance, aGtkWidgetType = MOZ_GTK_TOOLBAR_BUTTON; break; case StyleAppearance::Checkbox: + aGtkWidgetType = MOZ_GTK_CHECKBUTTON; + break; case StyleAppearance::Radio: - aGtkWidgetType = (aAppearance == StyleAppearance::Radio) - ? MOZ_GTK_RADIOBUTTON - : MOZ_GTK_CHECKBUTTON; + aGtkWidgetType = MOZ_GTK_RADIOBUTTON; break; case StyleAppearance::Spinner: aGtkWidgetType = MOZ_GTK_SPINBUTTON; @@ -392,18 +392,6 @@ bool nsNativeThemeGTK::GetGtkWidgetAndState(StyleAppearance aAppearance, *aWidgetFlags = GTK_ARROW_LEFT; } break; - case StyleAppearance::CheckboxContainer: - aGtkWidgetType = MOZ_GTK_CHECKBUTTON_CONTAINER; - break; - case StyleAppearance::RadioContainer: - aGtkWidgetType = MOZ_GTK_RADIOBUTTON_CONTAINER; - break; - case StyleAppearance::CheckboxLabel: - aGtkWidgetType = MOZ_GTK_CHECKBUTTON_LABEL; - break; - case StyleAppearance::RadioLabel: - aGtkWidgetType = MOZ_GTK_RADIOBUTTON_LABEL; - break; case StyleAppearance::Toolbar: aGtkWidgetType = MOZ_GTK_TOOLBAR; break; @@ -1164,10 +1152,6 @@ LayoutDeviceIntSize nsNativeThemeGTK::GetMinimumWidgetSize( result.height = metrics->minSizeWithBorderMargin.height; break; } - case StyleAppearance::CheckboxContainer: - case StyleAppearance::RadioContainer: - case StyleAppearance::CheckboxLabel: - case StyleAppearance::RadioLabel: case StyleAppearance::Button: case StyleAppearance::Menulist: case StyleAppearance::MenulistButton: @@ -1375,10 +1359,6 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext, case StyleAppearance::Textarea: case StyleAppearance::Range: case StyleAppearance::RangeThumb: - case StyleAppearance::CheckboxContainer: - case StyleAppearance::RadioContainer: - case StyleAppearance::CheckboxLabel: - case StyleAppearance::RadioLabel: case StyleAppearance::Menuarrow: case StyleAppearance::Splitter: case StyleAppearance::MozWindowButtonBox: diff --git a/widget/nsNativeTheme.cpp b/widget/nsNativeTheme.cpp index 0b2bcbb7b05f..55393736ba31 100644 --- a/widget/nsNativeTheme.cpp +++ b/widget/nsNativeTheme.cpp @@ -51,18 +51,14 @@ NS_IMPL_ISUPPORTS(nsNativeTheme, nsITimerCallback, nsINamed) const bool isXULElement = frameContent->IsXULElement(); if (isXULElement) { - if (aAppearance == StyleAppearance::CheckboxLabel || - aAppearance == StyleAppearance::RadioLabel) { - aFrame = aFrame->GetParent()->GetParent(); - frameContent = aFrame->GetContent(); - } else if (aAppearance == StyleAppearance::Checkbox || - aAppearance == StyleAppearance::Radio || - aAppearance == StyleAppearance::ToolbarbuttonDropdown || - aAppearance == StyleAppearance::Treeheadersortarrow || - aAppearance == StyleAppearance::ButtonArrowPrevious || - aAppearance == StyleAppearance::ButtonArrowNext || - aAppearance == StyleAppearance::ButtonArrowUp || - aAppearance == StyleAppearance::ButtonArrowDown) { + if (aAppearance == StyleAppearance::Checkbox || + aAppearance == StyleAppearance::Radio || + aAppearance == StyleAppearance::ToolbarbuttonDropdown || + aAppearance == StyleAppearance::Treeheadersortarrow || + aAppearance == StyleAppearance::ButtonArrowPrevious || + aAppearance == StyleAppearance::ButtonArrowNext || + aAppearance == StyleAppearance::ButtonArrowUp || + aAppearance == StyleAppearance::ButtonArrowDown) { aFrame = aFrame->GetParent(); frameContent = aFrame->GetContent(); } @@ -87,7 +83,6 @@ NS_IMPL_ISUPPORTS(nsNativeTheme, nsITimerCallback, nsINamed) } switch (aAppearance) { - case StyleAppearance::RadioLabel: case StyleAppearance::Radio: { if (CheckBooleanAttr(aFrame, nsGkAtoms::focused)) { flags |= ElementState::FOCUS; @@ -103,7 +98,6 @@ NS_IMPL_ISUPPORTS(nsNativeTheme, nsITimerCallback, nsINamed) } break; } - case StyleAppearance::CheckboxLabel: case StyleAppearance::Checkbox: { if (CheckBooleanAttr(aFrame, nsGkAtoms::checked)) { flags |= ElementState::CHECKED;