Backed out changeset f3c5f5a1b35d (bug 1624696) for wpt failures on baseline-alignment-and-overflow.tentative.html . CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Wed, 25 Mar 2020 00:24:22 +0200
changeset 520294 0460bc1ab4f09146747792fdb41c0031f60fc006
parent 520293 2fa61ecc475692527b77b7cbfc49a7ce15fe5fba
child 520295 178ba8ef059cb90937f458692617a660bc961562
push id37246
push useropoprus@mozilla.com
push dateWed, 25 Mar 2020 03:40:33 +0000
treeherdermozilla-central@14b59d4adc95 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1624696
milestone76.0a1
backs outf3c5f5a1b35dccaf7d301e1a19653e738f327964
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset f3c5f5a1b35d (bug 1624696) for wpt failures on baseline-alignment-and-overflow.tentative.html . CLOSED TREE
layout/reftests/forms/button/author-padding-notref.html
layout/reftests/forms/button/author-padding.html
layout/reftests/forms/button/reftest.list
widget/nsNativeBasicTheme.cpp
deleted file mode 100644
--- a/layout/reftests/forms/button/author-padding-notref.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<!doctype html>
-<button>Foo</button>
deleted file mode 100644
--- a/layout/reftests/forms/button/author-padding.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<!doctype html>
-<!-- This technically assumes that no theme would have 300px of padding by default, looks like a safe enough assumption -->
-<button style="padding: 300px">Foo</button>
--- a/layout/reftests/forms/button/reftest.list
+++ b/layout/reftests/forms/button/reftest.list
@@ -30,18 +30,16 @@ fuzzy-if(Android,0-125,0-20) == percent-
 fails-if(Android&&nativeThemePref) == disabled-1.html disabled-1-ref.html
 == disabled-2.html disabled-2-ref.html
 
 != disabled-3.html disabled-3-notref.html
 != disabled-4.html disabled-4-notref.html
 != disabled-5.html disabled-5-notref.html
 != disabled-6.html disabled-6-notref.html
 
-!= author-padding.html author-padding-notref.html
-
 == width-auto-size-em-ltr.html width-auto-size-em-ltr-ref.html
 == width-auto-size-ltr.html width-auto-size-ltr-ref.html
 == width-exact-fit-ltr.html width-auto-size-ltr-ref.html
 == width-auto-size-em-rtl.html width-auto-size-em-rtl-ref.html
 == width-auto-size-rtl.html width-auto-size-rtl-ref.html
 == width-exact-fit-rtl.html width-auto-size-rtl-ref.html
 == display-grid-flex-columnset.html display-grid-flex-columnset-ref.html
 == button-empty-columns.html button-empty-columns-ref.html
--- a/widget/nsNativeBasicTheme.cpp
+++ b/widget/nsNativeBasicTheme.cpp
@@ -720,40 +720,39 @@ LayoutDeviceIntMargin nsNativeBasicTheme
       return LayoutDeviceIntMargin();
   }
 }
 
 bool nsNativeBasicTheme::GetWidgetPadding(nsDeviceContext* aContext,
                                           nsIFrame* aFrame,
                                           StyleAppearance aAppearance,
                                           LayoutDeviceIntMargin* aResult) {
+  if (aAppearance == StyleAppearance::Menulist ||
+      aAppearance == StyleAppearance::MenulistTextfield ||
+      aAppearance == StyleAppearance::NumberInput ||
+      aAppearance == StyleAppearance::Textarea ||
+      aAppearance == StyleAppearance::Textfield) {
+    // If we have author-specified padding for these elements, don't do the
+    // fixups below.
+    if (aFrame->PresContext()->HasAuthorSpecifiedRules(
+            aFrame, NS_AUTHOR_SPECIFIED_PADDING)) {
+      return false;
+    }
+  }
+
+  uint32_t dpi = GetDPIRatio(aFrame);
   switch (aAppearance) {
     // Radios and checkboxes return a fixed size in GetMinimumWidgetSize
     // and have a meaningful baseline, so they can't have
     // author-specified padding.
     case StyleAppearance::Radio:
     case StyleAppearance::Checkbox:
     case StyleAppearance::MozMenulistArrowButton:
       aResult->SizeTo(0, 0, 0, 0);
       return true;
-    default:
-      break;
-  }
-
-  // Respect author padding.
-  //
-  // TODO(emilio): Consider just unconditionally returning false, so that the
-  // default size of all elements matches other platforms and the UA stylesheet.
-  if (aFrame->PresContext()->HasAuthorSpecifiedRules(
-          aFrame, NS_AUTHOR_SPECIFIED_PADDING)) {
-    return false;
-  }
-
-  uint32_t dpi = GetDPIRatio(aFrame);
-  switch (aAppearance) {
     case StyleAppearance::Textarea:
     case StyleAppearance::Listbox:
     case StyleAppearance::Menulist:
     case StyleAppearance::MenulistButton:
     case StyleAppearance::MenulistTextfield:
     case StyleAppearance::NumberInput:
       aResult->SizeTo(6 * dpi, 7 * dpi, 6 * dpi, 7 * dpi);
       return true;
@@ -763,18 +762,20 @@ bool nsNativeBasicTheme::GetWidgetPaddin
     case StyleAppearance::Textfield:
       if (IsDateTimeTextField(aFrame)) {
         aResult->SizeTo(7 * dpi, 7 * dpi, 5 * dpi, 7 * dpi);
         return true;
       }
       aResult->SizeTo(6 * dpi, 7 * dpi, 6 * dpi, 7 * dpi);
       return true;
     default:
-      return false;
+      break;
   }
+
+  return false;
 }
 
 bool nsNativeBasicTheme::GetWidgetOverflow(nsDeviceContext* aContext,
                                            nsIFrame* aFrame,
                                            StyleAppearance aAppearance,
                                            nsRect* aOverflowRect) {
   // TODO(bug 1620360): This should return non-zero for
   // StyleAppearance::FocusOutline, if we implement outline-style: auto.