From 549212cd3823087de5ac10b9ac95fd3b89dbdd17 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Fri, 30 Mar 2018 21:13:59 +0200 Subject: [PATCH] Bug 1364026 - (Part 1) Expose HTMLInputElement.getMinimum/getMaximum methods via webidl --- dom/html/HTMLInputElement.h | 7 +++++++ dom/webidl/HTMLInputElement.webidl | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/dom/html/HTMLInputElement.h b/dom/html/HTMLInputElement.h index fde12b817d..2321b7338e 100644 --- a/dom/html/HTMLInputElement.h +++ b/dom/html/HTMLInputElement.h @@ -796,6 +796,13 @@ public: void UpdateDateTimePicker(const DateTimeValue& aValue); void CloseDateTimePicker(); + /* + * The following are called from datetime input box binding to get the + * corresponding computed values. + */ + double GetMinimumAsDouble() { return GetMinimum().toDouble(); } + double GetMaximumAsDouble() { return GetMaximum().toDouble(); } + HTMLInputElement* GetOwnerNumberControl(); HTMLInputElement* GetOwnerDateTimeControl(); diff --git a/dom/webidl/HTMLInputElement.webidl b/dom/webidl/HTMLInputElement.webidl index b2546fccac..c551d96ab6 100644 --- a/dom/webidl/HTMLInputElement.webidl +++ b/dom/webidl/HTMLInputElement.webidl @@ -253,6 +253,14 @@ partial interface HTMLInputElement { [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);