Bug 1521212 - Unset visibility of the reset button instead of setting it to visible. r=Gijs
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 21 Jan 2019 12:58:41 +0000
changeset 454668 dc8020199c4bb3be745ba753f017c213a1fc90b5
parent 454667 2dd26100e3117b221eff2a19c83e50db3bd11bc3
child 454669 053747e3a369cc4ec41ec4e6b2620489e655ca61
push id35409
push userrmaries@mozilla.com
push dateMon, 21 Jan 2019 17:48:45 +0000
treeherdermozilla-central@4977d02e1191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1521212
milestone66.0a1
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
Bug 1521212 - Unset visibility of the reset button instead of setting it to visible. r=Gijs CSS visibility doesn't work like `display`. `visibility: visible` elements in a `visibility: hidden` subtree still get shown. Differential Revision: https://phabricator.services.mozilla.com/D17068
layout/reftests/forms/input/datetime/reftest.list
layout/reftests/forms/input/datetime/reset-button-visibility-hidden-ref.html
layout/reftests/forms/input/datetime/reset-button-visibility-hidden.html
toolkit/content/widgets/datetimebox.js
--- a/layout/reftests/forms/input/datetime/reftest.list
+++ b/layout/reftests/forms/input/datetime/reftest.list
@@ -14,8 +14,9 @@ default-preferences pref(dom.forms.datet
 == time-small-height.html time-small-height-ref.html
 == time-small-width-height.html time-small-width-height-ref.html
 
 # content (text) should be left aligned
 fuzzy-if(Android,0-4,0-8) == time-content-left-aligned.html time-content-left-aligned-ref.html
 
 # reset button should be right aligned
 skip-if(Android) == time-reset-button-right-aligned.html time-reset-button-right-aligned-ref.html # bug 1372062
+== reset-button-visibility-hidden.html reset-button-visibility-hidden-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/forms/input/datetime/reset-button-visibility-hidden-ref.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<!-- intentionally blank -->
new file mode 100644
--- /dev/null
+++ b/layout/reftests/forms/input/datetime/reset-button-visibility-hidden.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<input type="date" value="2019-01-18" style="visibility: hidden">
+<input type="time" value="16:30" style="visibility: hidden">
--- a/toolkit/content/widgets/datetimebox.js
+++ b/toolkit/content/widgets/datetimebox.js
@@ -303,17 +303,17 @@ this.DateTimeInputBaseImplWidget = class
       field.setAttribute("role", "textbox");
     }
 
     return field;
   }
 
   updateResetButtonVisibility() {
     if (this.isAnyFieldAvailable(false)) {
-      this.mResetButton.style.visibility = "visible";
+      this.mResetButton.style.visibility = "";
     } else {
       this.mResetButton.style.visibility = "hidden";
     }
   }
 
   focusInnerTextBox() {
     this.log("Focus inner editable field.");