2011-06-14 Kent Tamura <tkent@chromium.org>
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jun 2011 03:41:24 +0000 (03:41 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jun 2011 03:41:24 +0000 (03:41 +0000)
        Reviewed by Hajime Morita.

        REGRESSION(r88757): [Chromium] Vertical position of media slider thumb is wrong.
        https://bugs.webkit.org/show_bug.cgi?id=62685

        No new tests. Covered by existing tests.

        * rendering/RenderSlider.cpp:
        (WebCore::RenderSlider::layout): Center the thumb position.
        * rendering/RenderSlider.h:

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderSlider.cpp
Source/WebCore/rendering/RenderSlider.h

index f1147d1..f099429 100644 (file)
@@ -1,3 +1,16 @@
+2011-06-14  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Hajime Morita.
+
+        REGRESSION(r88757): [Chromium] Vertical position of media slider thumb is wrong.
+        https://bugs.webkit.org/show_bug.cgi?id=62685
+
+        No new tests. Covered by existing tests.
+
+        * rendering/RenderSlider.cpp:
+        (WebCore::RenderSlider::layout): Center the thumb position.
+        * rendering/RenderSlider.h:
+
 2011-06-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         Reviewed by Kent Tamura.
index b355abc..049d5ad 100644 (file)
@@ -95,6 +95,17 @@ void RenderSlider::computePreferredLogicalWidths()
     setPreferredLogicalWidthsDirty(false); 
 }
 
+void RenderSlider::layout()
+{
+    RenderBlock::layout();
+    RenderBox* thumbBox = sliderThumbElementOf(node())->renderBox();
+    if (!thumbBox)
+        return;
+    int heightDiff = thumbBox->height() - contentHeight();
+    if (heightDiff > 0)
+        thumbBox->setY(thumbBox->y() - (heightDiff / 2));
+}
+
 bool RenderSlider::inDragMode() const
 {
     return sliderThumbElementOf(node())->active();
index 8b7d552..c1261bb 100644 (file)
@@ -43,6 +43,7 @@ namespace WebCore {
         virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
         virtual void computePreferredLogicalWidths();
         virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
+        virtual void layout();
     };
 
     inline RenderSlider* toRenderSlider(RenderObject* object)