2011-02-03 Dimitri Glazkov <dglazkov@chromium.org>
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 18:42:30 +0000 (18:42 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 18:42:30 +0000 (18:42 +0000)
        Reviewed by Kent Tamura.

        REGRESSION(r76147): Slider thumb is not repainted when let go outside of the slider track.
        https://bugs.webkit.org/show_bug.cgi?id=53691

        * fast/repaint/slider-thumb-drag-release.html: Added.
        * platform/mac/fast/repaint/slider-thumb-drag-release-expected.checksum: Added.
        * platform/mac/fast/repaint/slider-thumb-drag-release-expected.png: Added.
        * platform/mac/fast/repaint/slider-thumb-drag-release-expected.txt: Added.
2011-02-03  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Kent Tamura.

        REGRESSION(r76147): Slider thumb is not repainted when let go outside of the slider track.
        https://bugs.webkit.org/show_bug.cgi?id=53691

        Test: fast/repaint/slider-thumb-drag-release.html

        * html/shadow/SliderThumbElement.cpp:
        (WebCore::SliderThumbElement::stopDragging): Added dirtying the layout bit to ensure
            that the thumb is repainted.

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

LayoutTests/ChangeLog
LayoutTests/fast/repaint/slider-thumb-drag-release.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/slider-thumb-drag-release-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/slider-thumb-drag-release-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/slider-thumb-drag-release-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/shadow/SliderThumbElement.cpp

index 84f1741c986f283e91431ffb09d035cfe75461b7..fb9e0d520b9b6bae4dc2d442245606c25805fbd5 100644 (file)
@@ -1,3 +1,15 @@
+2011-02-03  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Kent Tamura.
+
+        REGRESSION(r76147): Slider thumb is not repainted when let go outside of the slider track.
+        https://bugs.webkit.org/show_bug.cgi?id=53691
+
+        * fast/repaint/slider-thumb-drag-release.html: Added.
+        * platform/mac/fast/repaint/slider-thumb-drag-release-expected.checksum: Added.
+        * platform/mac/fast/repaint/slider-thumb-drag-release-expected.png: Added.
+        * platform/mac/fast/repaint/slider-thumb-drag-release-expected.txt: Added.
+
 2011-02-04  Dimitri Glazkov  <dglazkov@chromium.org>
 
         Update mac baselines. They pixel-rotted.
diff --git a/LayoutTests/fast/repaint/slider-thumb-drag-release.html b/LayoutTests/fast/repaint/slider-thumb-drag-release.html
new file mode 100644 (file)
index 0000000..4fc1190
--- /dev/null
@@ -0,0 +1,35 @@
+<html>
+<head>
+<script>
+
+// Tests that the slider thumb is repainted correctly when the mouse that's
+// dragging it releases outside of the track. The result should be a thumb
+// painted in the released state.
+
+var ARBITRARY_DELTA = 50;
+
+function clickAndDragDiagonally(element)
+{
+    if (!window.eventSender)
+        return;
+
+    var maxX = element.offsetLeft + element.offsetWidth;
+    var x = maxX / 2;
+    var y = element.offsetTop + element.offsetHeight / 2;
+    eventSender.mouseMoveTo(x, y);
+    eventSender.mouseDown();
+    eventSender.mouseMoveTo(maxX, y + ARBITRARY_DELTA);
+    eventSender.mouseUp();
+}
+
+function runTest()
+{
+    clickAndDragDiagonally(document.getElementById('slider'));
+}
+
+</script>
+</head>
+<body onload="runTest()">
+<input id="slider" type="range" value="0">
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/fast/repaint/slider-thumb-drag-release-expected.checksum b/LayoutTests/platform/mac/fast/repaint/slider-thumb-drag-release-expected.checksum
new file mode 100644 (file)
index 0000000..478a2b3
--- /dev/null
@@ -0,0 +1 @@
+144924c0a226d7d46fd200572c130ea4
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/repaint/slider-thumb-drag-release-expected.png b/LayoutTests/platform/mac/fast/repaint/slider-thumb-drag-release-expected.png
new file mode 100644 (file)
index 0000000..9c6b95d
Binary files /dev/null and b/LayoutTests/platform/mac/fast/repaint/slider-thumb-drag-release-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/repaint/slider-thumb-drag-release-expected.txt b/LayoutTests/platform/mac/fast/repaint/slider-thumb-drag-release-expected.txt
new file mode 100644 (file)
index 0000000..9853bd0
--- /dev/null
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderSlider {INPUT} at (2,2) size 129x15 [bgcolor=#FFFFFF]
+        RenderBlock {DIV} at (114,0) size 15x15
+      RenderText {#text} at (0,0) size 0x0
index 27cabcc27f871d2bedb7ea2830c04ffaa95dbe66..04870a5d0f8cac68712d5385e8bf37a68fe5d8da 100644 (file)
@@ -1,3 +1,16 @@
+2011-02-03  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Kent Tamura.
+
+        REGRESSION(r76147): Slider thumb is not repainted when let go outside of the slider track.
+        https://bugs.webkit.org/show_bug.cgi?id=53691
+
+        Test: fast/repaint/slider-thumb-drag-release.html
+
+        * html/shadow/SliderThumbElement.cpp:
+        (WebCore::SliderThumbElement::stopDragging): Added dirtying the layout bit to ensure
+            that the thumb is repainted.
+
 2011-02-04  Mikhail Naganov  <mnaganov@chromium.org>
 
         Reviewed by Pavel Feldman.
index 83148d0c5e960ae166de8a2510bb776cd7828f4c..6efd19186271e19e0beb3277b7832e93ded880d1 100644 (file)
@@ -147,6 +147,8 @@ void SliderThumbElement::stopDragging()
     if (Frame* frame = document()->frame())
         frame->eventHandler()->setCapturingMouseEventsNode(0);
     m_inDragMode = false;
+    if (renderer())
+        renderer()->setNeedsLayout(true);
 }
 
 void SliderThumbElement::defaultEventHandler(Event* event)