[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e
yael.aharon at nokia.com
yael.aharon at nokia.com
Fri Jan 21 14:45:43 UTC 2011
The following commit has been merged in the debian/experimental branch:
commit f55645df30dfadef723a4c727f8b6ad5ba05caa3
Author: yael.aharon at nokia.com <yael.aharon at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Dec 29 16:00:48 2010 +0000
[HTML5][Forms] Support for :in-range and :out-of-range CSS selectors
https://bugs.webkit.org/show_bug.cgi?id=29071
Reviewed by Kent Tamura.
WebCore:
Use InputType::rangeUnderflow() and InputType::rangeOverflow()
to determine if a control is in-range or out-of-range.
Tests: fast/css/pseudo-in-range-invalid-value.html
fast/css/pseudo-in-range.html
fast/css/pseudo-out-of-range.html
* css/CSSSelector.cpp:
(WebCore::CSSSelector::pseudoId):
(WebCore::nameToPseudoTypeMap):
(WebCore::CSSSelector::extractPseudoType):
* css/CSSSelector.h:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::canShareStyleWithElement):
(WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
* dom/Element.h:
(WebCore::Element::isInRange):
(WebCore::Element::isOutOfRange):
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::supportsRangeLimitation):
* html/BaseDateAndTimeInputType.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isInRange):
(WebCore::HTMLInputElement::isOutOfRange):
* html/HTMLInputElement.h:
* html/InputType.cpp:
(WebCore::InputType::supportsRangeLimitation):
* html/InputType.h:
* html/NumberInputType.cpp:
(WebCore::NumberInputType::supportsRangeLimitation):
* html/NumberInputType.h:
* html/RangeInputType.cpp:
(WebCore::RangeInputType::supportsRangeLimitation):
* html/RangeInputType.h:
LayoutTests:
* fast/css/pseudo-in-range-expected.txt: Added.
* fast/css/pseudo-in-range-invalid-value-expected.txt: Added.
* fast/css/pseudo-in-range-invalid-value.html: Added.
* fast/css/pseudo-in-range.html: Added.
* fast/css/pseudo-out-of-range-expected.txt: Added.
* fast/css/pseudo-out-of-range.html: Added.
* fast/css/script-tests/pseudo-in-range-invalid-value.js: Added.
* fast/css/script-tests/pseudo-in-range.js: Added.
* fast/css/script-tests/pseudo-out-of-range.js: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 47a1671..568d973 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2010-12-29 Yael Aharon <yael.aharon at nokia.com>
+
+ Reviewed by Kent Tamura.
+
+ [HTML5][Forms] Support for :in-range and :out-of-range CSS selectors
+ https://bugs.webkit.org/show_bug.cgi?id=29071
+
+ * fast/css/pseudo-in-range-expected.txt: Added.
+ * fast/css/pseudo-in-range-invalid-value-expected.txt: Added.
+ * fast/css/pseudo-in-range-invalid-value.html: Added.
+ * fast/css/pseudo-in-range.html: Added.
+ * fast/css/pseudo-out-of-range-expected.txt: Added.
+ * fast/css/pseudo-out-of-range.html: Added.
+ * fast/css/script-tests/pseudo-in-range-invalid-value.js: Added.
+ * fast/css/script-tests/pseudo-in-range.js: Added.
+ * fast/css/script-tests/pseudo-out-of-range.js: Added.
+
2010-12-29 Abhishek Arya <inferno at chromium.org>
Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/css/pseudo-in-range-expected.txt b/LayoutTests/fast/css/pseudo-in-range-expected.txt
new file mode 100644
index 0000000..a13ddf7
--- /dev/null
+++ b/LayoutTests/fast/css/pseudo-in-range-expected.txt
@@ -0,0 +1,13 @@
+Tests that we find controls if they have a range limitation and are in-range.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.querySelector("input[type=number]:in-range").id is "number1"
+PASS document.querySelector("input[type=range]:in-range").id is "range1"
+PASS document.querySelector("input[type=date]:in-range").id is "date1"
+PASS document.querySelectorAll(":in-range").length is 3
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/pseudo-in-range-invalid-value-expected.txt b/LayoutTests/fast/css/pseudo-in-range-invalid-value-expected.txt
new file mode 100644
index 0000000..1425d02
--- /dev/null
+++ b/LayoutTests/fast/css/pseudo-in-range-invalid-value-expected.txt
@@ -0,0 +1,13 @@
+Tests that invalid values are considered in-range.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.querySelector("input[type=number]:in-range").id is "number1"
+PASS document.querySelector("input[type=range]:in-range").id is "range1"
+PASS document.querySelector("input[type=date]:in-range").id is "date1"
+PASS document.querySelectorAll(":in-range").length is 3
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/pseudo-in-range-invalid-value.html b/LayoutTests/fast/css/pseudo-in-range-invalid-value.html
new file mode 100644
index 0000000..d306bcd
--- /dev/null
+++ b/LayoutTests/fast/css/pseudo-in-range-invalid-value.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/pseudo-in-range-invalid-value.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/css/pseudo-in-range.html b/LayoutTests/fast/css/pseudo-in-range.html
new file mode 100644
index 0000000..b93d4f2
--- /dev/null
+++ b/LayoutTests/fast/css/pseudo-in-range.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/pseudo-in-range.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/css/pseudo-out-of-range-expected.txt b/LayoutTests/fast/css/pseudo-out-of-range-expected.txt
new file mode 100644
index 0000000..e204fce
--- /dev/null
+++ b/LayoutTests/fast/css/pseudo-out-of-range-expected.txt
@@ -0,0 +1,17 @@
+Tests that we find controls if they have a range limitation and are out-of-range.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.querySelector("input[type=number]:out-of-range").id is "number1"
+PASS document.querySelector("input[type=date]:out-of-range").id is "date1"
+PASS document.querySelectorAll(":out-of-range").length is 2
+
+When the value becomes in-range dynamically, we do not find the control anymore
+PASS document.querySelector("input[type=number]:out-of-range") is null
+PASS document.querySelector("input[type=date]:out-of-range") is null
+PASS document.querySelectorAll(":out-of-range").length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/pseudo-out-of-range.html b/LayoutTests/fast/css/pseudo-out-of-range.html
new file mode 100644
index 0000000..eaa7458
--- /dev/null
+++ b/LayoutTests/fast/css/pseudo-out-of-range.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/pseudo-out-of-range.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/css/script-tests/pseudo-in-range-invalid-value.js b/LayoutTests/fast/css/script-tests/pseudo-in-range-invalid-value.js
new file mode 100644
index 0000000..1f9784a
--- /dev/null
+++ b/LayoutTests/fast/css/script-tests/pseudo-in-range-invalid-value.js
@@ -0,0 +1,12 @@
+description('Tests that invalid values are considered in-range.');
+
+var parentDiv = document.createElement('div');
+document.body.appendChild(parentDiv);
+parentDiv.innerHTML = '<input id="number1" type="number" min=0 max=10 value="ABC"><input id="range1" type="range" min=0 max=10 value="ABC"><input id="date1" type="date" min="2010-12-28" max="2010-12-28" value="ABC"><input id="text1" type="text" min=0 max=10 value="ABC"><input id="checkbox1" type="checkbox"> <input id="radio1" type="radio">';
+
+shouldBe('document.querySelector("input[type=number]:in-range").id', '"number1"');
+shouldBe('document.querySelector("input[type=range]:in-range").id', '"range1"');
+shouldBe('document.querySelector("input[type=date]:in-range").id', '"date1"');
+shouldBe('document.querySelectorAll(":in-range").length', '3');
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/css/script-tests/pseudo-in-range.js b/LayoutTests/fast/css/script-tests/pseudo-in-range.js
new file mode 100644
index 0000000..9a56e80
--- /dev/null
+++ b/LayoutTests/fast/css/script-tests/pseudo-in-range.js
@@ -0,0 +1,12 @@
+description('Tests that we find controls if they have a range limitation and are in-range.');
+
+var parentDiv = document.createElement('div');
+document.body.appendChild(parentDiv);
+parentDiv.innerHTML = '<input id="number1" type="number" min=0 max=10 value=5><input id="range1" type="range" min=0 max=10 value=5><input id="date1" type="date" min="2010-12-28" max="2010-12-30" value="2010-12-29"><input id="text1" type="text" min=0 max=10 value=5><input id="checkbox1" type="checkbox"> <input id="radio1" type="radio">';
+
+shouldBe('document.querySelector("input[type=number]:in-range").id', '"number1"');
+shouldBe('document.querySelector("input[type=range]:in-range").id', '"range1"');
+shouldBe('document.querySelector("input[type=date]:in-range").id', '"date1"');
+shouldBe('document.querySelectorAll(":in-range").length', '3');
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/css/script-tests/pseudo-out-of-range.js b/LayoutTests/fast/css/script-tests/pseudo-out-of-range.js
new file mode 100644
index 0000000..3b3fc81
--- /dev/null
+++ b/LayoutTests/fast/css/script-tests/pseudo-out-of-range.js
@@ -0,0 +1,20 @@
+description('Tests that we find controls if they have a range limitation and are out-of-range.');
+
+var parentDiv = document.createElement('div');
+document.body.appendChild(parentDiv);
+parentDiv.innerHTML = '<input id="number1" type="number" min=0 max=10 value=50><input id="date1" type="date" min="2010-12-28" max="2010-12-30" value="2011-01-01"><input id="text1" type="text" min=0 max=10 value=50><input id="checkbox1" type="checkbox"><input id="radio1" type="radio">';
+
+shouldBe('document.querySelector("input[type=number]:out-of-range").id', '"number1"');
+shouldBe('document.querySelector("input[type=date]:out-of-range").id', '"date1"');
+shouldBe('document.querySelectorAll(":out-of-range").length', '2');
+
+debug("");
+debug("When the value becomes in-range dynamically, we do not find the control anymore");
+document.getElementById("number1").value = 5;
+document.getElementById("date1").value = "2010-12-28";
+
+shouldBe('document.querySelector("input[type=number]:out-of-range")', 'null');
+shouldBe('document.querySelector("input[type=date]:out-of-range")', 'null');
+shouldBe('document.querySelectorAll(":out-of-range").length', '0');
+
+var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 511e440..90317e2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,45 @@
+2010-12-29 Yael Aharon <yael.aharon at nokia.com>
+
+ Reviewed by Kent Tamura.
+
+ [HTML5][Forms] Support for :in-range and :out-of-range CSS selectors
+ https://bugs.webkit.org/show_bug.cgi?id=29071
+
+ Use InputType::rangeUnderflow() and InputType::rangeOverflow()
+ to determine if a control is in-range or out-of-range.
+
+ Tests: fast/css/pseudo-in-range-invalid-value.html
+ fast/css/pseudo-in-range.html
+ fast/css/pseudo-out-of-range.html
+
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::pseudoId):
+ (WebCore::nameToPseudoTypeMap):
+ (WebCore::CSSSelector::extractPseudoType):
+ * css/CSSSelector.h:
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::canShareStyleWithElement):
+ (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
+ * dom/Element.h:
+ (WebCore::Element::isInRange):
+ (WebCore::Element::isOutOfRange):
+ * html/BaseDateAndTimeInputType.cpp:
+ (WebCore::BaseDateAndTimeInputType::supportsRangeLimitation):
+ * html/BaseDateAndTimeInputType.h:
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::isInRange):
+ (WebCore::HTMLInputElement::isOutOfRange):
+ * html/HTMLInputElement.h:
+ * html/InputType.cpp:
+ (WebCore::InputType::supportsRangeLimitation):
+ * html/InputType.h:
+ * html/NumberInputType.cpp:
+ (WebCore::NumberInputType::supportsRangeLimitation):
+ * html/NumberInputType.h:
+ * html/RangeInputType.cpp:
+ (WebCore::RangeInputType::supportsRangeLimitation):
+ * html/RangeInputType.h:
+
2010-12-29 Abhishek Arya <inferno at chromium.org>
Reviewed by Eric Seidel.
diff --git a/WebCore/css/CSSSelector.cpp b/WebCore/css/CSSSelector.cpp
index fb8f695..c139dbf 100644
--- a/WebCore/css/CSSSelector.cpp
+++ b/WebCore/css/CSSSelector.cpp
@@ -311,6 +311,8 @@ PseudoId CSSSelector::pseudoId(PseudoType type)
case PseudoFirstPage:
case PseudoLeftPage:
case PseudoRightPage:
+ case PseudoInRange:
+ case PseudoOutOfRange:
return NOPSEUDO;
case PseudoNotParsed:
ASSERT_NOT_REACHED();
@@ -437,6 +439,8 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap(
DEFINE_STATIC_LOCAL(AtomicString, fullScreen, ("-webkit-full-screen"));
DEFINE_STATIC_LOCAL(AtomicString, fullScreenDocument, ("-webkit-full-screen-document"));
#endif
+ DEFINE_STATIC_LOCAL(AtomicString, inRange, ("in-range"));
+ DEFINE_STATIC_LOCAL(AtomicString, outOfRange, ("out-of-range"));
static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoType = 0;
if (!nameToPseudoType) {
@@ -552,6 +556,8 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap(
nameToPseudoType->set(fullScreen.impl(), CSSSelector::PseudoFullScreen);
nameToPseudoType->set(fullScreenDocument.impl(), CSSSelector::PseudoFullScreenDocument);
#endif
+ nameToPseudoType->set(inRange.impl(), CSSSelector::PseudoInRange);
+ nameToPseudoType->set(outOfRange.impl(), CSSSelector::PseudoOutOfRange);
}
return nameToPseudoType;
}
@@ -685,6 +691,8 @@ void CSSSelector::extractPseudoType() const
case PseudoFullScreen:
case PseudoFullScreenDocument:
#endif
+ case PseudoInRange:
+ case PseudoOutOfRange:
break;
case PseudoFirstPage:
case PseudoLeftPage:
diff --git a/WebCore/css/CSSSelector.h b/WebCore/css/CSSSelector.h
index 00e23b9..353fb5e 100644
--- a/WebCore/css/CSSSelector.h
+++ b/WebCore/css/CSSSelector.h
@@ -221,6 +221,8 @@ namespace WebCore {
PseudoFullScreen,
PseudoFullScreenDocument,
#endif
+ PseudoInRange,
+ PseudoOutOfRange,
};
enum MarginBoxType {
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index d59f231..d2645d9 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -1015,6 +1015,12 @@ bool CSSStyleSelector::canShareStyleWithElement(Node* n) const
if (willValidate && (s->isValidFormControlElement() != m_element->isValidFormControlElement()))
return false;
+
+ if (s->isInRange() != m_element->isInRange())
+ return false;
+
+ if (s->isOutOfRange() != m_element->isOutOfRange())
+ return false;
}
if (style->transitions() || style->animations())
@@ -2672,6 +2678,16 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme
return false;
return true;
#endif
+ case CSSSelector::PseudoInRange:
+ if (!e)
+ return false;
+ e->document()->setContainsValidityStyleRules();
+ return e->isInRange();
+ case CSSSelector::PseudoOutOfRange:
+ if (!e)
+ return false;
+ e->document()->setContainsValidityStyleRules();
+ return e->isOutOfRange();
case CSSSelector::PseudoUnknown:
case CSSSelector::PseudoNotParsed:
default:
diff --git a/WebCore/dom/Element.h b/WebCore/dom/Element.h
index 4af99e2..9bad66f 100644
--- a/WebCore/dom/Element.h
+++ b/WebCore/dom/Element.h
@@ -304,6 +304,8 @@ public:
virtual bool willValidate() const { return false; }
virtual bool isValidFormControlElement() { return false; }
virtual bool hasUnacceptableValue() const { return false; }
+ virtual bool isInRange() const { return false; }
+ virtual bool isOutOfRange() const { return false; }
virtual bool formControlValueMatchesRenderer() const { return false; }
virtual void setFormControlValueMatchesRenderer(bool) { }
diff --git a/WebCore/html/BaseDateAndTimeInputType.cpp b/WebCore/html/BaseDateAndTimeInputType.cpp
index 6ae1afa..1974830 100644
--- a/WebCore/html/BaseDateAndTimeInputType.cpp
+++ b/WebCore/html/BaseDateAndTimeInputType.cpp
@@ -94,6 +94,11 @@ bool BaseDateAndTimeInputType::rangeOverflow(const String& value) const
return isfinite(doubleValue) && doubleValue > maximum();
}
+bool BaseDateAndTimeInputType::supportsRangeLimitation() const
+{
+ return true;
+}
+
double BaseDateAndTimeInputType::defaultValueForStepUp() const
{
double ms = currentTimeMS();
diff --git a/WebCore/html/BaseDateAndTimeInputType.h b/WebCore/html/BaseDateAndTimeInputType.h
index 2daa77c..c4b3046 100644
--- a/WebCore/html/BaseDateAndTimeInputType.h
+++ b/WebCore/html/BaseDateAndTimeInputType.h
@@ -55,6 +55,7 @@ private:
virtual bool typeMismatch() const;
virtual bool rangeUnderflow(const String&) const;
virtual bool rangeOverflow(const String&) const;
+ virtual bool supportsRangeLimitation() const;
virtual double defaultValueForStepUp() const;
virtual bool stepMismatch(const String&, double) const;
virtual double stepBase() const;
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 58c06a9..d1e1eeb 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -1487,6 +1487,16 @@ bool HTMLInputElement::hasUnacceptableValue() const
return deprecatedInputType() == NUMBER && renderer() && !isAcceptableValue(toRenderTextControl(renderer())->text());
}
+bool HTMLInputElement::isInRange() const
+{
+ return m_inputType->supportsRangeLimitation() && !rangeUnderflow(value()) && !rangeOverflow(value());
+}
+
+bool HTMLInputElement::isOutOfRange() const
+{
+ return m_inputType->supportsRangeLimitation() && (rangeUnderflow(value()) || rangeOverflow(value()));
+}
+
bool HTMLInputElement::needsActivationCallback()
{
return deprecatedInputType() == PASSWORD || m_autocomplete == Off;
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index b901edf..92f16db 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -312,6 +312,9 @@ private:
virtual String sanitizeValue(const String&) const;
virtual bool hasUnacceptableValue() const;
+ virtual bool isInRange() const;
+ virtual bool isOutOfRange() const;
+
virtual void documentDidBecomeActive();
virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
diff --git a/WebCore/html/InputType.cpp b/WebCore/html/InputType.cpp
index 8bbc9b1..b724407 100644
--- a/WebCore/html/InputType.cpp
+++ b/WebCore/html/InputType.cpp
@@ -220,6 +220,11 @@ bool InputType::rangeOverflow(const String&) const
return false;
}
+bool InputType::supportsRangeLimitation() const
+{
+ return false;
+}
+
double InputType::defaultValueForStepUp() const
{
return 0;
diff --git a/WebCore/html/InputType.h b/WebCore/html/InputType.h
index 767c675..994851a 100644
--- a/WebCore/html/InputType.h
+++ b/WebCore/html/InputType.h
@@ -93,6 +93,7 @@ public:
virtual bool patternMismatch(const String&) const;
virtual bool rangeUnderflow(const String&) const;
virtual bool rangeOverflow(const String&) const;
+ virtual bool supportsRangeLimitation() const;
virtual double defaultValueForStepUp() const;
virtual double minimum() const;
virtual double maximum() const;
diff --git a/WebCore/html/NumberInputType.cpp b/WebCore/html/NumberInputType.cpp
index 5e908ff..0a5c609 100644
--- a/WebCore/html/NumberInputType.cpp
+++ b/WebCore/html/NumberInputType.cpp
@@ -110,6 +110,11 @@ bool NumberInputType::rangeOverflow(const String& value) const
return isfinite(doubleValue) && doubleValue > maximum();
}
+bool NumberInputType::supportsRangeLimitation() const
+{
+ return true;
+}
+
double NumberInputType::minimum() const
{
return parseToDouble(element()->fastGetAttribute(minAttr), numberDefaultMinimum);
@@ -229,5 +234,4 @@ double NumberInputType::acceptableError(double step) const
return step / pow(2.0, FLT_MANT_DIG);
}
-
} // namespace WebCore
diff --git a/WebCore/html/NumberInputType.h b/WebCore/html/NumberInputType.h
index ee1a0e5..f048b54 100644
--- a/WebCore/html/NumberInputType.h
+++ b/WebCore/html/NumberInputType.h
@@ -48,6 +48,7 @@ private:
virtual bool typeMismatch() const;
virtual bool rangeUnderflow(const String&) const;
virtual bool rangeOverflow(const String&) const;
+ virtual bool supportsRangeLimitation() const;
virtual double minimum() const;
virtual double maximum() const;
virtual bool stepMismatch(const String&, double) const;
diff --git a/WebCore/html/RangeInputType.cpp b/WebCore/html/RangeInputType.cpp
index 6ded508..89b248e 100644
--- a/WebCore/html/RangeInputType.cpp
+++ b/WebCore/html/RangeInputType.cpp
@@ -94,6 +94,11 @@ bool RangeInputType::rangeOverflow(const String& value) const
return false;
}
+bool RangeInputType::supportsRangeLimitation() const
+{
+ return true;
+}
+
double RangeInputType::minimum() const
{
return parseToDouble(element()->fastGetAttribute(minAttr), rangeDefaultMinimum);
diff --git a/WebCore/html/RangeInputType.h b/WebCore/html/RangeInputType.h
index 440abb6..c802602 100644
--- a/WebCore/html/RangeInputType.h
+++ b/WebCore/html/RangeInputType.h
@@ -48,6 +48,7 @@ private:
virtual bool supportsRequired() const;
virtual bool rangeUnderflow(const String&) const;
virtual bool rangeOverflow(const String&) const;
+ virtual bool supportsRangeLimitation() const;
virtual double minimum() const;
virtual double maximum() const;
virtual bool stepMismatch(const String&, double) const;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list