<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>26045</bug_id>
          
          <creation_ts>2009-05-27 13:44:31 -0700</creation_ts>
          <short_desc>The Qt Style Sheets are not applied on webkit scrollbars</short_desc>
          <delta_ts>2014-02-03 03:50:33 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt, QtTriaged</keywords>
          <priority>P3</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Vincent Ordy">vincent.ordy</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>kent.hansen</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>123318</commentid>
    <comment_count>0</comment_count>
    <who name="Vincent Ordy">vincent.ordy</who>
    <bug_when>2009-05-27 13:44:31 -0700</bug_when>
    <thetext>The Qt Style Sheets set with setStyleSheet() on the QWebView are not applied on webkit scroll bars.

It seems to happen because of the QStyleSheetStyleSelector::attribute() and QStyleSheetStyleSelector::nodeNames() functions used by StyleSelector::styleRulesForNode(). They both use the widget metadata to get the widget type name and properties in order to find out which rules to apply.

A quick fix is to have ScrollbarThemeQt inherit from QScrollbar and use &quot;this&quot; as widget for drawComplexControl().
-    p.drawComplexControl(QStyle::CC_ScrollBar, *opt);
+    p.style-&gt;drawComplexControl(QStyle::CC_ScrollBar, opt, p.painter, this);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198133</commentid>
    <comment_count>1</comment_count>
    <who name="Kent Hansen">kent.hansen</who>
    <bug_when>2010-03-10 07:40:06 -0800</bug_when>
    <thetext>Please provide a testcase (in the form of a compileable Qt app, for example).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198383</commentid>
    <comment_count>2</comment_count>
      <attachid>50446</attachid>
    <who name="Vincent Ordy">vincent.ordy</who>
    <bug_when>2010-03-10 15:25:58 -0800</bug_when>
    <thetext>Created attachment 50446
Testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198393</commentid>
    <comment_count>3</comment_count>
    <who name="Vincent Ordy">vincent.ordy</who>
    <bug_when>2010-03-10 15:40:11 -0800</bug_when>
    <thetext>This testcase creates 2 windows.  Both have a QScrollArea which contains a QWebView. I do setStyleSheet(&quot;QScrollBar { background: blue; }&quot;) on both windows.

The style of the first is QWindowsStyle, and the second&apos;s is QMotifStyle. The QWebView scrollbar does use the style set by setStyle.

However, it does not use the one set by setStyleSheet(&quot;QScrollBar {...}&quot;). Like I said before, it happens because the Qt Style Sheets system uses metadata to find out the type of an object. Since a ScrollbarThemeQt is not a QScrollbar, the style sheet for QScrollbar is not used.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198975</commentid>
    <comment_count>4</comment_count>
    <who name="Kent Hansen">kent.hansen</who>
    <bug_when>2010-03-12 03:23:47 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; This testcase creates 2 windows.  Both have a QScrollArea which contains a
&gt; QWebView. I do setStyleSheet(&quot;QScrollBar { background: blue; }&quot;) on both
&gt; windows.
&gt; 
&gt; The style of the first is QWindowsStyle, and the second&apos;s is QMotifStyle. The
&gt; QWebView scrollbar does use the style set by setStyle.
&gt; 
&gt; However, it does not use the one set by setStyleSheet(&quot;QScrollBar {...}&quot;). Like
&gt; I said before, it happens because the Qt Style Sheets system uses metadata to
&gt; find out the type of an object. Since a ScrollbarThemeQt is not a QScrollbar,
&gt; the style sheet for QScrollbar is not used.

Thanks for the testcase.
Hmm, with r33755 and Qt 4.6 trunk the QWebView scrollbars don&apos;t even respect setStyle()! It did in an older version, like you said, so this is a regression.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198976</commentid>
    <comment_count>5</comment_count>
    <who name="Kent Hansen">kent.hansen</who>
    <bug_when>2010-03-12 03:24:37 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; Hmm, with r33755 and Qt 4.6 trunk

Sorry, that should be r55658.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>975799</commentid>
    <comment_count>6</comment_count>
    <who name="Jocelyn Turcotte">jturcotte</who>
    <bug_when>2014-02-03 03:50:33 -0800</bug_when>
    <thetext>=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>50446</attachid>
            <date>2010-03-10 15:25:58 -0800</date>
            <delta_ts>2010-03-10 15:25:58 -0800</delta_ts>
            <desc>Testcase</desc>
            <filename>test-qt-webkit-scrollbar.tar.bz2</filename>
            <type>application/x-bzip2</type>
            <size>1044</size>
            <attacher name="Vincent Ordy">vincent.ordy</attacher>
            
              <data encoding="base64">QlpoOTFBWSZTWfDkh1oABAp/lMyQAIB6//+/f/f/gP/v//oBAQABAAhQA96pASAAA0RGkYTJpqae
oaHqejU0eoDR6h6gGQ9RtGk0BoDhoZNNDTI0NMjIMjI0MgMTRk0AZMjEMcNDJpoaZGhpkZBkZGhk
BiaMmgDJkYhjhoZNNDTI0NMjIMjI0MgMTRk0AZMjEMJFCARlPQ1DRgJomiZPJPSaZNoQGjQyNN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