https://bugs.webkit.org/show_bug.cgi?id=97976
Reviewed by Kent Tamura.
.:
* ManualTests/forms/calendar-picker.html: Added stepBase parameters.
Source/WebCore:
Calendar picker should be using zero as default step base for input type=date.
The spec says to use zero unless specified otherwise.
Since input type=week has another default step base, I am adding step base
to DateTimeChooserParameters.
Test: fast/forms/date/calendar-picker-with-step.html
* Resources/pagepopups/calendarPicker.js:
(handleArgumentsTimeout):
(CalendarPicker):
(CalendarPicker.prototype.stepMismatch): Use the new this.stepBase.
* html/shadow/PickerIndicatorElement.cpp:
(WebCore::PickerIndicatorElement::openPopup): Gets step base from step range.
* platform/DateTimeChooser.h:
(DateTimeChooserParameters): Added stepBase.
Source/WebKit/chromium:
* src/DateTimeChooserImpl.cpp:
(WebKit::DateTimeChooserImpl::writeDocument): stepBase needs 11 digits of precision when setting maximum possible date.
LayoutTests:
* fast/forms/date/calendar-picker-with-step-expected.txt: Renamed from LayoutTests/fast/forms/date/calendar-picker-appearance-with-step-expected.txt.
* fast/forms/date/calendar-picker-with-step.html: Renamed from LayoutTests/fast/forms/date/calendar-picker-appearance-with-step.html. Renamed because this does not test apeparance.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130113
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-10-01 Keishi Hattori <keishi@webkit.org>
+
+ Calendar picker should use zero as default step base
+ https://bugs.webkit.org/show_bug.cgi?id=97976
+
+ Reviewed by Kent Tamura.
+
+ * ManualTests/forms/calendar-picker.html: Added stepBase parameters.
+
2012-09-28 Mariusz Grzegorczyk <mariusz.g@samsung.com>
[WK2][GTK][EFL] Share WebKit2-GTK plugin process implementation with EFL port
+2012-10-01 Keishi Hattori <keishi@webkit.org>
+
+ Calendar picker should use zero as default step base
+ https://bugs.webkit.org/show_bug.cgi?id=97976
+
+ Reviewed by Kent Tamura.
+
+ * fast/forms/date/calendar-picker-with-step-expected.txt: Renamed from LayoutTests/fast/forms/date/calendar-picker-appearance-with-step-expected.txt.
+ * fast/forms/date/calendar-picker-with-step.html: Renamed from LayoutTests/fast/forms/date/calendar-picker-appearance-with-step.html. Renamed because this does not test apeparance.
+
2012-10-01 Roger Fong <roger_fong@apple.com>
Unreviewed. Fix expected result name.
Step without min.
-PASS availableDatesInCurrentMonth().join(",") is ["2011-05-09", "2011-05-18", "2011-05-27"].join(",")
+PASS availableDatesInCurrentMonth().join(",") is ["2011-05-08", "2011-05-17", "2011-05-26"].join(",")
Step when min is set.
PASS availableDatesInCurrentMonth().join(",") is ["2011-05-01", "2011-05-10", "2011-05-19", "2011-05-28"].join(",")
function test1() {
debug("Step without min.");
- shouldBe('availableDatesInCurrentMonth().join(",")', '["2011-05-09", "2011-05-18", "2011-05-27"].join(",")');
+ shouldBe('availableDatesInCurrentMonth().join(",")', '["2011-05-08", "2011-05-17", "2011-05-26"].join(",")');
pickerWindow.removeEventListener('resize', test1);
// Close popup
clearLabel : 'Clear',
cancelLabel : 'Cancel',
weekStartDay : 0,
- step : 1,
+ step : "86400000",
+ stepBase: "0",
max : '2099-12-31',
};
var japaneseArguments = {
clearLabel : 'クリア',
cancelLabel : '取り消し',
weekStartDay : 0,
- step : 1,
+ step : "86400000",
+ stepBase: "0",
max : '2099-03-15',
};
var arabicArguments = {
todayLabel : 'اليوم',
clearLabel : 'مسح',
weekStartDay : 5,
- step : 1,
+ step : "86400000",
+ stepBase: "0",
max : '2020-05-15',
};
var datalistArguments = {
clearLabel : 'Clear',
cancelLabel : 'Cancel',
weekStartDay : 0,
- step : 1,
+ step : "86400000",
+ stepBase: "0",
max : '2099-12-31',
suggestionValues : ['2012-01-01', '2012-06-03', '2012-09-06', '2012-12-24'],
localizedSuggestionValues : ['1/1/12', '6/3/12', '9/6/12', '12/24/12'],
clearLabel : 'Clear',
cancelLabel : 'Cancel',
weekStartDay : 0,
- step : 1,
+ step : "86400000",
+ stepBase: "0",
max : '2099-12-31',
suggestionValues: ["2012-01-01", "2012-01-02", "2012-01-03", "2012-01-04",
"2012-01-05", "2012-01-06", "2012-01-07", "2012-01-08", "2012-01-09",
todayLabel : 'اليوم',
clearLabel : 'مسح',
weekStartDay : 5,
- step : 1,
+ step : "86400000",
+ stepBase: "0",
max : '2020-05-15',
suggestionValues : ['2012-01-01', '2012-06-03', '2012-09-06', '2012-12-24'],
localizedSuggestionValues : ['1/1/12', '6/3/12', '9/6/12', '12/24/12'],
todayLabel : 'اليوم',
clearLabel : 'مسح',
weekStartDay : 5,
- step : 1,
+ step : "86400000",
+ stepBase: "0",
max : '2020-05-15',
suggestionValues: ["2012-01-01", "2012-01-02", "2012-01-03", "2012-01-04",
"2012-01-05", "2012-01-06", "2012-01-07", "2012-01-08", "2012-01-09",
+2012-10-01 Keishi Hattori <keishi@webkit.org>
+
+ Calendar picker should use zero as default step base
+ https://bugs.webkit.org/show_bug.cgi?id=97976
+
+ Reviewed by Kent Tamura.
+
+ Calendar picker should be using zero as default step base for input type=date.
+ The spec says to use zero unless specified otherwise.
+ Since input type=week has another default step base, I am adding step base
+ to DateTimeChooserParameters.
+
+ Test: fast/forms/date/calendar-picker-with-step.html
+
+ * Resources/pagepopups/calendarPicker.js:
+ (handleArgumentsTimeout):
+ (CalendarPicker):
+ (CalendarPicker.prototype.stepMismatch): Use the new this.stepBase.
+ * html/shadow/PickerIndicatorElement.cpp:
+ (WebCore::PickerIndicatorElement::openPopup): Gets step base from step range.
+ * platform/DateTimeChooser.h:
+ (DateTimeChooserParameters): Added stepBase.
+
2012-10-01 Tony Chang <tony@chromium.org>
flexbox does wrong baseline item alignment in columns
cancelLabel : "Cancel",
currentValue : "",
weekStartDay : 0,
- step : 1
+ step : CalendarPicker.DefaultStepScaleFactor,
+ stepBase: CalendarPicker.DefaultStepBase
};
initialize(args);
}
this.minimumDate = (typeof this._config.min !== "undefined") ? parseDateString(this._config.min) : CalendarPicker.MinimumPossibleDate;
// We assume this._config.max is a valid date.
this.maximumDate = (typeof this._config.max !== "undefined") ? parseDateString(this._config.max) : CalendarPicker.MaximumPossibleDate;
- this.step = (typeof this._config.step !== undefined) ? this._config.step : CalendarPicker.BaseStep;
+ this.step = (typeof this._config.step !== undefined) ? Number(this._config.step) : CalendarPicker.DefaultStepScaleFactor;
+ this.stepBase = (typeof this._config.stepBase !== "undefined") ? Number(this._config.stepBase) : CalendarPicker.DefaultStepBase;
this.yearMonthController = new YearMonthController(this);
this.daysTable = new DaysTable(this);
this._hadKeyEvent = false;
CalendarPicker.MinimumPossibleDate = new Date(-62135596800000.0);
CalendarPicker.MaximumPossibleDate = new Date(8640000000000000.0);
// See WebCore/html/DateInputType.cpp.
-CalendarPicker.BaseStep = 86400000;
+CalendarPicker.DefaultStepScaleFactor = 86400000;
+CalendarPicker.DefaultStepBase = 0.0;
CalendarPicker.prototype.cleanup = function() {
document.body.removeEventListener("keydown", this._handleBodyKeyDownBound, false);
* @return {!boolean}
*/
CalendarPicker.prototype.stepMismatch = function(time) {
- return (time - this.minimumDate.getTime()) % this.step != 0;
+ return (time - this.stepBase) % this.step != 0;
}
/**
parameters.minimum = input->minimum();
parameters.maximum = input->maximum();
parameters.required = input->required();
- Decimal step;
- if (hostInput()->getAllowedValueStep(&step))
- parameters.step = step.toDouble();
- else
+
+ StepRange stepRange = input->createStepRange(RejectAny);
+ if (stepRange.hasStep()) {
+ parameters.step = stepRange.step().toDouble();
+ parameters.stepBase = stepRange.stepBase().toDouble();
+ } else {
parameters.step = 1.0;
+ parameters.stepBase = 0;
+ }
+
parameters.anchorRectInRootView = document()->view()->contentsToRootView(hostInput()->pixelSnappedBoundingBox());
parameters.currentValue = input->value();
parameters.isAnchorElementRTL = input->computedStyle()->direction() == RTL;
double minimum;
double maximum;
double step;
+ double stepBase;
bool required;
bool isAnchorElementRTL;
};
+2012-10-01 Keishi Hattori <keishi@webkit.org>
+
+ Calendar picker should use zero as default step base
+ https://bugs.webkit.org/show_bug.cgi?id=97976
+
+ Reviewed by Kent Tamura.
+
+ * src/DateTimeChooserImpl.cpp:
+ (WebKit::DateTimeChooserImpl::writeDocument): stepBase needs 11 digits of precision when setting maximum possible date.
+
2012-10-01 Joshua Bell <jsbell@chromium.org>
IndexedDB: Move onSuccess(IDBDatabaseBackendInterface) to IDBOpenDBRequest
date.setMillisecondsSinceEpochForDate(m_parameters.maximum);
String maxString = date.toString();
String stepString = String::number(m_parameters.step);
+ String stepBaseString = String::number(m_parameters.stepBase, 11, WTF::TruncateTrailingZeros);
OwnPtr<Localizer> localizer = Localizer::create(nullAtom);
addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer);
addProperty("min", minString, writer);
addProperty("max", maxString, writer);
addProperty("step", stepString, writer);
+ addProperty("stepBase", stepBaseString, writer);
addProperty("required", m_parameters.required, writer);
addProperty("currentValue", m_parameters.currentValue, writer);
addProperty("locale", WebCore::defaultLanguage(), writer);