Bug 1364026 - (Part 1) Expose HTMLInputElement.getMinimum/getMaximum methods via webidl. r=smaug draft
authorScott Wu <scottcwwu@gmail.com>
Fri, 14 Jul 2017 14:16:36 +0800
changeset 610274 82a2519f68364129c3a42a8b912452e513d07500
parent 610234 5e73b9798464c3f7106f0161dc9a49b234f42f9c
child 610275 dedd970ef233e056e2941b657cf1fb82942023fd
push id68825
push userbmo:scwwu@mozilla.com
push dateTue, 18 Jul 2017 02:33:07 +0000
reviewerssmaug
bugs1364026
milestone56.0a1
Bug 1364026 - (Part 1) Expose HTMLInputElement.getMinimum/getMaximum methods via webidl. r=smaug MozReview-Commit-ID: 2eU0MX7glng
dom/html/HTMLInputElement.h
dom/webidl/HTMLInputElement.webidl
--- a/dom/html/HTMLInputElement.h
+++ b/dom/html/HTMLInputElement.h
@@ -881,16 +881,18 @@ public:
   void UpdateValidityState();
 
   /*
    * The following are called from datetime input box binding to get the
    * corresponding computed values.
    */
   double GetStepAsDouble() { return GetStep().toDouble(); }
   double GetStepBaseAsDouble() { return GetStepBase().toDouble(); }
+  double GetMinimumAsDouble() { return GetMinimum().toDouble(); }
+  double GetMaximumAsDouble() { return GetMaximum().toDouble(); }
 
   HTMLInputElement* GetOwnerNumberControl();
 
   void StartNumberControlSpinnerSpin();
   enum SpinnerStopState {
     eAllowDispatchingEvents,
     eDisallowDispatchingEvents
   };
--- a/dom/webidl/HTMLInputElement.webidl
+++ b/dom/webidl/HTMLInputElement.webidl
@@ -242,16 +242,24 @@ partial interface HTMLInputElement {
   DateTimeValue getDateTimeInputBoxValue();
 
   [Pref="dom.forms.datetime", ChromeOnly]
   void updateDateTimeInputBox(optional DateTimeValue value);
 
   [Pref="dom.forms.datetime", ChromeOnly]
   void setDateTimePickerState(boolean open);
 
+  [Pref="dom.forms.datetime", ChromeOnly,
+   BinaryName="getMinimumAsDouble"]
+  double getMinimum();
+
+  [Pref="dom.forms.datetime", ChromeOnly,
+   BinaryName="getMaximumAsDouble"]
+  double getMaximum();
+
   [Pref="dom.forms.datetime", Func="IsChromeOrXBL"]
   void openDateTimePicker(optional DateTimeValue initialValue);
 
   [Pref="dom.forms.datetime", Func="IsChromeOrXBL"]
   void updateDateTimePicker(optional DateTimeValue value);
 
   [Pref="dom.forms.datetime", Func="IsChromeOrXBL"]
   void closeDateTimePicker();