[Webkit-unassigned] [Bug 39421] New: [Qt] Vertical slider rendered upside down

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 20 04:59:51 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=39421

           Summary: [Qt] Vertical slider rendered upside down
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P3
         Component: Layout and Rendering
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: apwebster at gmail.com


The bar for vertical sliders using the <input type="range"> tag seem to be rendered with the minimum value at the top of the slider rather than the bottom (the handle however appears in the correct location).  This is only obvious when using a style that renders the bar differently above and below the handle, such as QCleanlooksStyle.

I am using the HEAD from the qtwebkit-2.0 branch and Qt 4.6.2 on Embedded Linux (qws).  I have confirmed the same behavior under Windows.

To reproduce, load the following in a QWebView using the QCleanlooksStyle:

<html>
<head>
<style>      
      input[type="range"].v {
         width: 100px;
         height: 200px;
        -webkit-appearance: slider-vertical;
      }      
      input[type="range"].h {
         width: 200px;
         height: 100px;
        -webkit-appearance: slider-horizontal;
      }
</style>
</head>
<body>
    <input id="slide1" class="h" type="range" min="0" max="100" />
    <input id="slide2" class="v" type="range" min="0" max="100" />
</body>
</html>

The horizontal slider will have the blue section of the slider between the left side and the handle, however the vertical slider will have the blue section between the top and the handle.  The blue section should be between the bottom and the handle.

The following patch makes the vertical slider render properly with QCleanlooksStyle and makes the rendering more consistent with QSlider:

diff --git a/WebCore/platform/qt/RenderThemeQt.cpp b/WebCore/platform/qt/RenderThemeQt.cpp
index 577903b..6be018b 100644
--- a/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/WebCore/platform/qt/RenderThemeQt.cpp
@@ -746,6 +746,10 @@ bool RenderThemeQt::paintSliderTrack(RenderObject* o, const RenderObject::PaintI
     IntRect thumbRect = renderSlider->thumbRect();

     option.rect = r;
+    
+    option.upsideDown = (appearance == SliderHorizontalPart) ?
+                     (option.direction == Qt::RightToLeft)
+                     : true;

     int value;
     if (appearance == SliderVerticalPart) {
@@ -756,7 +760,7 @@ bool RenderThemeQt::paintSliderTrack(RenderObject* o, const RenderObject::PaintI
         value = thumbRect.x();
     }

-    value = QStyle::sliderValueFromPosition(0, option.maximum, value, option.maximum);
+    value = QStyle::sliderValueFromPosition(0, option.maximum, value, option.maximum, option.upsideDown);

     option.sliderValue = value;
     option.sliderPosition = value;

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list