Diff
Modified: trunk/Source/WebCore/ChangeLog (129454 => 129455)
--- trunk/Source/WebCore/ChangeLog 2012-09-25 04:33:25 UTC (rev 129454)
+++ trunk/Source/WebCore/ChangeLog 2012-09-25 04:40:48 UTC (rev 129455)
@@ -1,3 +1,32 @@
+2012-09-24 Yoshifumi Inoue <[email protected]>
+
+ [Forms] We should remove DateTimeEditElement::valueAsDouble()
+ https://bugs.webkit.org/show_bug.cgi?id=97327
+
+ Reviewed by Kent Tamura.
+
+ This patch removes unused function DateTimeEditElement::valueAsDouble()
+ and related functions in DateTimeFieldElement.
+
+ This patch affects ports which enable both ENABLE_INPUT_TYPE_TIME and
+ ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS.
+
+ No new tests. This patch doesn't change behavior.
+
+ * html/shadow/DateTimeEditElement.cpp: Removed valueAsDouble() implementation.
+ * html/shadow/DateTimeEditElement.h: Removed valueAsDouble() declaration.
+ (DateTimeEditElement):
+ * html/shadow/DateTimeFieldElement.cpp: Removed valueAsDouble() implementation.
+ * html/shadow/DateTimeFieldElement.h: Removed unitInMillisecond() and valueAsDouble() declarations.
+ (DateTimeFieldElement):
+ * html/shadow/DateTimeFieldElements.cpp: Removed unitInMillisecond() implementations.
+ * html/shadow/DateTimeFieldElements.h:
+ (DateTimeAMPMFieldElement): Removed unitInMillisecond() declaration.
+ (DateTimeHourFieldElement): ditto.
+ (DateTimeMillisecondFieldElement): ditto.
+ (DateTimeMinuteFieldElement): ditto.
+ (DateTimeSecondFieldElement): ditto.
+
2012-09-24 Antti Koivisto <[email protected]>
Don't use StyleSheetList internally.
Modified: trunk/Source/WebCore/html/shadow/DateTimeEditElement.cpp (129454 => 129455)
--- trunk/Source/WebCore/html/shadow/DateTimeEditElement.cpp 2012-09-25 04:33:25 UTC (rev 129454)
+++ trunk/Source/WebCore/html/shadow/DateTimeEditElement.cpp 2012-09-25 04:40:48 UTC (rev 129455)
@@ -465,20 +465,6 @@
return dateTimeFieldsState;
}
-double DateTimeEditElement::valueAsDouble() const
-{
- double value = 0;
-
- for (size_t fieldIndex = 0; fieldIndex < m_fields.size(); ++fieldIndex) {
- const DateTimeFieldElement* const field = m_fields[fieldIndex];
- if (!field->hasValue())
- return std::numeric_limits<double>::quiet_NaN();
- value += field->valueAsDouble();
- }
-
- return value;
-}
-
} // namespace WebCore
#endif
Modified: trunk/Source/WebCore/html/shadow/DateTimeEditElement.h (129454 => 129455)
--- trunk/Source/WebCore/html/shadow/DateTimeEditElement.h 2012-09-25 04:33:25 UTC (rev 129454)
+++ trunk/Source/WebCore/html/shadow/DateTimeEditElement.h 2012-09-25 04:40:48 UTC (rev 129455)
@@ -91,7 +91,6 @@
void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField);
String value() const;
DateTimeFieldsState valueAsDateTimeFieldsState() const;
- double valueAsDouble() const;
private:
static const size_t invalidFieldIndex = static_cast<size_t>(-1);
Modified: trunk/Source/WebCore/html/shadow/DateTimeFieldElement.cpp (129454 => 129455)
--- trunk/Source/WebCore/html/shadow/DateTimeFieldElement.cpp 2012-09-25 04:33:25 UTC (rev 129454)
+++ trunk/Source/WebCore/html/shadow/DateTimeFieldElement.cpp 2012-09-25 04:40:48 UTC (rev 129455)
@@ -186,11 +186,6 @@
m_fieldOwner->fieldValueChanged();
}
-double DateTimeFieldElement::valueAsDouble() const
-{
- return hasValue() ? valueAsInteger() * unitInMillisecond() : std::numeric_limits<double>::quiet_NaN();
-}
-
} // namespace WebCore
#endif
Modified: trunk/Source/WebCore/html/shadow/DateTimeFieldElement.h (129454 => 129455)
--- trunk/Source/WebCore/html/shadow/DateTimeFieldElement.h 2012-09-25 04:33:25 UTC (rev 129454)
+++ trunk/Source/WebCore/html/shadow/DateTimeFieldElement.h 2012-09-25 04:40:48 UTC (rev 129455)
@@ -70,7 +70,6 @@
virtual void stepDown() = 0;
virtual void stepUp() = 0;
virtual String value() const = 0;
- double valueAsDouble() const;
virtual int valueAsInteger() const = 0;
virtual String visibleValue() const = 0;
@@ -83,7 +82,6 @@
void initialize(const AtomicString& shadowPseudoId, const String& axHelpText);
virtual int maximum() const = 0;
virtual int minimum() const = 0;
- virtual double unitInMillisecond() const = 0;
void updateVisibleValue(EventBehavior);
private:
Modified: trunk/Source/WebCore/html/shadow/DateTimeFieldElements.cpp (129454 => 129455)
--- trunk/Source/WebCore/html/shadow/DateTimeFieldElements.cpp 2012-09-25 04:33:25 UTC (rev 129454)
+++ trunk/Source/WebCore/html/shadow/DateTimeFieldElements.cpp 2012-09-25 04:40:48 UTC (rev 129455)
@@ -30,7 +30,6 @@
#include "DateComponents.h"
#include "DateTimeFieldsState.h"
#include "LocalizedStrings.h"
-#include <wtf/DateMath.h>
namespace WebCore {
@@ -68,11 +67,6 @@
setEmptyValue(dateForReadOnlyField);
}
-double DateTimeAMPMFieldElement::unitInMillisecond() const
-{
- return msPerHour * 12;
-}
-
// ----------------------------
DateTimeHourFieldElement::DateTimeHourFieldElement(Document* document, FieldOwner& fieldOwner, int minimum, int maximum)
@@ -173,11 +167,6 @@
DateTimeNumericFieldElement::setValueAsInteger(range().minimum && !value ? m_alignment : value, eventBehavior);
}
-double DateTimeHourFieldElement::unitInMillisecond() const
-{
- return msPerHour;
-}
-
int DateTimeHourFieldElement::valueAsInteger() const
{
return hasValue() ? DateTimeNumericFieldElement::valueAsInteger() % m_alignment : -1;
@@ -224,11 +213,6 @@
setValueAsInteger(value);
}
-double DateTimeMillisecondFieldElement::unitInMillisecond() const
-{
- return 1;
-}
-
// ----------------------------
DateTimeMinuteFieldElement::DateTimeMinuteFieldElement(Document* document, FieldOwner& fieldOwner)
@@ -270,11 +254,6 @@
setValueAsInteger(value);
}
-double DateTimeMinuteFieldElement::unitInMillisecond() const
-{
- return msPerMinute;
-}
-
// ----------------------------
DateTimeSecondFieldElement::DateTimeSecondFieldElement(Document* document, FieldOwner& fieldOwner)
@@ -316,11 +295,6 @@
setValueAsInteger(value);
}
-double DateTimeSecondFieldElement::unitInMillisecond() const
-{
- return msPerSecond;
-}
-
} // namespace WebCore
#endif
Modified: trunk/Source/WebCore/html/shadow/DateTimeFieldElements.h (129454 => 129455)
--- trunk/Source/WebCore/html/shadow/DateTimeFieldElements.h 2012-09-25 04:33:25 UTC (rev 129454)
+++ trunk/Source/WebCore/html/shadow/DateTimeFieldElements.h 2012-09-25 04:40:48 UTC (rev 129455)
@@ -45,7 +45,6 @@
virtual void populateDateTimeFieldsState(DateTimeFieldsState&) OVERRIDE FINAL;
virtual void setValueAsDate(const DateComponents&) OVERRIDE FINAL;
virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
- virtual double unitInMillisecond() const OVERRIDE FINAL;
};
@@ -69,7 +68,6 @@
virtual void setValueAsDate(const DateComponents&) OVERRIDE FINAL;
virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
virtual void setValueAsInteger(int, EventBehavior = DispatchNoEvent) OVERRIDE FINAL;
- virtual double unitInMillisecond() const OVERRIDE FINAL;
virtual int valueAsInteger() const OVERRIDE FINAL;
const int m_alignment;
@@ -88,7 +86,6 @@
virtual void populateDateTimeFieldsState(DateTimeFieldsState&) OVERRIDE FINAL;
virtual void setValueAsDate(const DateComponents&) OVERRIDE FINAL;
virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
- virtual double unitInMillisecond() const OVERRIDE FINAL;
};
class DateTimeMinuteFieldElement : public DateTimeNumericFieldElement {
@@ -104,7 +101,6 @@
virtual void populateDateTimeFieldsState(DateTimeFieldsState&) OVERRIDE FINAL;
virtual void setValueAsDate(const DateComponents&) OVERRIDE FINAL;
virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
- virtual double unitInMillisecond() const OVERRIDE FINAL;
};
class DateTimeSecondFieldElement : public DateTimeNumericFieldElement {
@@ -120,7 +116,6 @@
virtual void populateDateTimeFieldsState(DateTimeFieldsState&) OVERRIDE FINAL;
virtual void setValueAsDate(const DateComponents&) OVERRIDE FINAL;
virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL;
- virtual double unitInMillisecond() const OVERRIDE FINAL;
};
} // namespace WebCore