From 4a374e5b99c793b953505af632eb8232b82adee4 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Tue, 7 Jan 2020 13:15:03 -0800 Subject: [PATCH] Clean up _defaultStepBase in Restore to the original HTML definition of nonexistent for anything other than type=week. --- lib/jsdom/living/nodes/HTMLInputElement-impl.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/jsdom/living/nodes/HTMLInputElement-impl.js b/lib/jsdom/living/nodes/HTMLInputElement-impl.js index 53de55e4d5..8c7335be48 100644 --- a/lib/jsdom/living/nodes/HTMLInputElement-impl.js +++ b/lib/jsdom/living/nodes/HTMLInputElement-impl.js @@ -848,7 +848,10 @@ class HTMLInputElementImpl extends HTMLElementImpl { return value; } } - return this._defaultStepBase; + if (this._defaultStepBase !== null) { + return this._defaultStepBase; + } + return 0; } // https://html.spec.whatwg.org/multipage/input.html#concept-input-step-default-base @@ -857,7 +860,7 @@ class HTMLInputElementImpl extends HTMLElementImpl { // The start of week 1970-W01 return -259200000; } - return 0; + return null; } // https://html.spec.whatwg.org/multipage/input.html#common-input-element-attributes