Title: [87168] trunk
- Revision
- 87168
- Author
- [email protected]
- Date
- 2011-05-24 10:43:55 -0700 (Tue, 24 May 2011)
Log Message
2011-05-24 Tony Chang <[email protected]>
Reviewed by James Robinson.
fix render overflow computation for input type=range
https://bugs.webkit.org/show_bug.cgi?id=61132
* fast/forms/slider-hit-testing-expected.txt: Added.
* fast/forms/slider-hit-testing.html: Added.
2011-05-24 Tony Chang <[email protected]>
Reviewed by James Robinson.
fix render overflow computation for input type=range
https://bugs.webkit.org/show_bug.cgi?id=61132
Test: fast/forms/slider-hit-testing.html
We need to clear m_overflow otherwise we use the first
size of the slider for hit testing (i.e., changes to the size
cause problems). This only shows up if the thumb isn't contained
in the bounds of the slider. Making the range have a smaller height
than the thumb shows the bug.
* rendering/RenderSlider.cpp:
(WebCore::RenderSlider::layout): Clear the overflow during layout
so we re-compute the overflow based on the current size of the
slider.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (87167 => 87168)
--- trunk/LayoutTests/ChangeLog 2011-05-24 17:41:33 UTC (rev 87167)
+++ trunk/LayoutTests/ChangeLog 2011-05-24 17:43:55 UTC (rev 87168)
@@ -1,3 +1,13 @@
+2011-05-24 Tony Chang <[email protected]>
+
+ Reviewed by James Robinson.
+
+ fix render overflow computation for input type=range
+ https://bugs.webkit.org/show_bug.cgi?id=61132
+
+ * fast/forms/slider-hit-testing-expected.txt: Added.
+ * fast/forms/slider-hit-testing.html: Added.
+
2011-05-24 Kenneth Russell <[email protected]>
Unreviewed. Fixed incorrect test expectations I previously checked in.
Added: trunk/LayoutTests/fast/forms/slider-hit-testing-expected.txt (0 => 87168)
--- trunk/LayoutTests/fast/forms/slider-hit-testing-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/slider-hit-testing-expected.txt 2011-05-24 17:43:55 UTC (rev 87168)
@@ -0,0 +1,4 @@
+Clicking on the right side of slider should cause the thumb to move.
+
+
+PASSED
Property changes on: trunk/LayoutTests/fast/forms/slider-hit-testing-expected.txt
___________________________________________________________________
Added: svn:eol-style
Added: trunk/LayoutTests/fast/forms/slider-hit-testing.html (0 => 87168)
--- trunk/LayoutTests/fast/forms/slider-hit-testing.html (rev 0)
+++ trunk/LayoutTests/fast/forms/slider-hit-testing.html 2011-05-24 17:43:55 UTC (rev 87168)
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>Clicking on the right side of slider should cause the thumb to move.</p>
+<input id="slider" type="range" style="height: 10px; margin: 0" min="1" max="3">
+<div id="results"></div>
+<script>
+// Force a layout so the slider starts with the default width.
+document.body.offsetLeft;
+
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+}
+
+window._onload_ = function() {
+ document.getElementById("slider").style.width = "100%";
+ changeAndCheckRangeValue();
+};
+
+function changeAndCheckRangeValue()
+{
+ if (!window.layoutTestController)
+ return;
+
+ // Click on the right side of the slider. This should cause the thumb
+ // to move to the right side.
+ var slider = document.getElementById("slider");
+ var x = slider.offsetLeft + (slider.clientWidth * .75);
+ var y = slider.offsetTop + (slider.clientHeight / 2);
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+
+ document.getElementById("results").innerText = (slider.value == 3) ? "PASSED" : "FAILED";
+}
+
+</script>
+</body>
+</html>
Property changes on: trunk/LayoutTests/fast/forms/slider-hit-testing.html
___________________________________________________________________
Added: svn:eol-style
Modified: trunk/Source/WebCore/ChangeLog (87167 => 87168)
--- trunk/Source/WebCore/ChangeLog 2011-05-24 17:41:33 UTC (rev 87167)
+++ trunk/Source/WebCore/ChangeLog 2011-05-24 17:43:55 UTC (rev 87168)
@@ -1,3 +1,23 @@
+2011-05-24 Tony Chang <[email protected]>
+
+ Reviewed by James Robinson.
+
+ fix render overflow computation for input type=range
+ https://bugs.webkit.org/show_bug.cgi?id=61132
+
+ Test: fast/forms/slider-hit-testing.html
+
+ We need to clear m_overflow otherwise we use the first
+ size of the slider for hit testing (i.e., changes to the size
+ cause problems). This only shows up if the thumb isn't contained
+ in the bounds of the slider. Making the range have a smaller height
+ than the thumb shows the bug.
+
+ * rendering/RenderSlider.cpp:
+ (WebCore::RenderSlider::layout): Clear the overflow during layout
+ so we re-compute the overflow based on the current size of the
+ slider.
+
2011-05-24 Alok Priyadarshi <[email protected]>
Reviewed by James Robinson.
Modified: trunk/Source/WebCore/rendering/RenderSlider.cpp (87167 => 87168)
--- trunk/Source/WebCore/rendering/RenderSlider.cpp 2011-05-24 17:41:33 UTC (rev 87167)
+++ trunk/Source/WebCore/rendering/RenderSlider.cpp 2011-05-24 17:43:55 UTC (rev 87168)
@@ -153,6 +153,8 @@
computeLogicalHeight();
updateLayerTransform();
+ m_overflow.clear();
+
if (thumb) {
if (oldSize != size())
thumb->setChildNeedsLayout(true, false);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes