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 514686 dc8020199c4b
parent 514685 2dd26100e311
child 514687 053747e3a369
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [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.");