Input type range slider is not updated when min or max are changed
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jun 2013 04:11:32 +0000 (04:11 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jun 2013 04:11:32 +0000 (04:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=117778

Reviewed by Kent Tamura.

Source/WebCore:

Merge https://chromium.googlesource.com/chromium/blink/+/089c7a0ba2d85b9b59632c2603fbc6472b310be1.

Test: fast/forms/range/range-change-min-max.html

* html/RangeInputType.cpp:
(WebCore::RangeInputType::minOrMaxAttributeChanged):

LayoutTests:

* fast/forms/range/range-change-min-max-expected.html: Added.
* fast/forms/range/range-change-min-max.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@151719 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/forms/range/range-change-min-max-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/range/range-change-min-max.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/RangeInputType.cpp

index df4bd26199b1e8b8eec0e70a92a1948b652ef27f..67df28db38b3f6e983a13546c70bdc24fa616f8d 100644 (file)
@@ -1,3 +1,13 @@
+2013-06-18  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Input type range slider is not updated when min or max are changed
+        https://bugs.webkit.org/show_bug.cgi?id=117778
+
+        Reviewed by Kent Tamura.
+
+        * fast/forms/range/range-change-min-max-expected.html: Added.
+        * fast/forms/range/range-change-min-max.html: Added.
+
 2013-06-18  Benjamin Poulain  <bpoulain@apple.com>
 
         [WK2] Media elements never fail to load
diff --git a/LayoutTests/fast/forms/range/range-change-min-max-expected.html b/LayoutTests/fast/forms/range/range-change-min-max-expected.html
new file mode 100644 (file)
index 0000000..375c2e2
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+<input type="range" id="test" value="100" min="80" max="140">
+</body>
+</html>
diff --git a/LayoutTests/fast/forms/range/range-change-min-max.html b/LayoutTests/fast/forms/range/range-change-min-max.html
new file mode 100644 (file)
index 0000000..00ae7c0
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<body>
+<input type="range" id="test" value="100" min="0" max="200">
+<script>
+var test = document.getElementById("test");
+test.offsetWidth; // Force layout.
+test.min = 80;
+test.max = 140;
+</script>
+</body>
+</html>
index 88d8fe088ede334b3fb1f4025a8f5a438d3f45f2..a5f8143d7d8fafa4a803e460438e54b61986ab77 100644 (file)
@@ -1,3 +1,17 @@
+2013-06-18  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Input type range slider is not updated when min or max are changed
+        https://bugs.webkit.org/show_bug.cgi?id=117778
+
+        Reviewed by Kent Tamura.
+
+        Merge https://chromium.googlesource.com/chromium/blink/+/089c7a0ba2d85b9b59632c2603fbc6472b310be1.
+
+        Test: fast/forms/range/range-change-min-max.html
+
+        * html/RangeInputType.cpp:
+        (WebCore::RangeInputType::minOrMaxAttributeChanged):
+
 2013-06-18  Ryosuke Niwa  <rniwa@webkit.org>
 
         Remove two superfluous overrides of supportsFocus
index 1abedb85a5994c452fa38aa394c86d5987796cf8..83337cc7b6569feee240880c39f363c0df2de4e8 100644 (file)
@@ -299,7 +299,8 @@ void RangeInputType::minOrMaxAttributeChanged()
     // Sanitize the value.
     if (element()->hasDirtyValue())
         element()->setValue(element()->value());
-    element()->setNeedsStyleRecalc();
+
+    sliderThumbElementOf(element())->setPositionFromValue();
 }
 
 void RangeInputType::setValue(const String& value, bool valueChanged, TextFieldEventBehavior eventBehavior)