Changeset 88294 in webkit


Ignore:
Timestamp:
Jun 7, 2011 5:26:11 PM (13 years ago)
Author:
tkent@chromium.org
Message:

2011-06-07 Kent Tamura <tkent@chromium.org>

Reviewed by Andreas Kling.

[Qt] RenderThemeQt::adjustSliderThumbSize() should not refer to the parent style.
https://bugs.webkit.org/show_bug.cgi?id=62207

  • css/mediaControlsQt.css: Add comments. (audio::-webkit-media-controls-timeline): (video::-webkit-media-controls-timeline): (audio::-webkit-media-controls-volume-slider): (video::-webkit-media-controls-volume-slider):
  • platform/qt/RenderThemeQt.cpp: Use fixed values to avoid referring to o->parent(). (WebCore::RenderThemeQt::adjustSliderThumbSize):
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r88286 r88294  
     12011-06-07  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] RenderThemeQt::adjustSliderThumbSize() should not refer to the parent style.
     6        https://bugs.webkit.org/show_bug.cgi?id=62207
     7
     8        * css/mediaControlsQt.css: Add comments.
     9        (audio::-webkit-media-controls-timeline):
     10        (video::-webkit-media-controls-timeline):
     11        (audio::-webkit-media-controls-volume-slider):
     12        (video::-webkit-media-controls-volume-slider):
     13        * platform/qt/RenderThemeQt.cpp: Use fixed values to avoid referring to o->parent().
     14        (WebCore::RenderThemeQt::adjustSliderThumbSize):
     15
    1162011-06-07  Sailesh Agrawal  <sail@chromium.org>
    217
  • trunk/Source/WebCore/css/mediaControlsQt.css

    r83973 r88294  
    150150
    151151audio::-webkit-media-controls-timeline {
    152     height: 12px;
     152    height: 12px; /* See RenderThemeQt::adjustSliderThumbSize(). */
    153153    padding: 6px 8px;
    154154    margin: 5px 3px;
     
    156156
    157157video::-webkit-media-controls-timeline {
    158     height: 12px;
     158    height: 12px; /* See RenderThemeQt::adjustSliderThumbSize(). */
    159159    padding: 6px 8px;
    160160    margin: 5px 3px;
     
    180180    position: absolute;
    181181
    182     width: 12px;
     182    width: 12px; /* See RenderThemeQt::adjustSliderThumbSize(). */
    183183    padding: 6px;
    184184    height: 88px;
     
    191191    position: absolute;
    192192
    193     width: 12px;
     193    width: 12px; /* See RenderThemeQt::adjustSliderThumbSize(). */
    194194    padding: 6px;
    195195    height: 88px;
  • trunk/Source/WebCore/platform/qt/RenderThemeQt.cpp

    r88029 r88294  
    14661466void RenderThemeQt::adjustSliderThumbSize(RenderObject* o) const
    14671467{
     1468    // timelineThumbHeight should match the height property of -webkit-media-controls-timeline in mediaControlsQt.css.
     1469    const int timelineThumbHeight = 12;
     1470    const int timelineThumbWidth = timelineThumbHeight / 3;
     1471    // volumeThumbWidth should match the width property of -webkit-media-controls-volume-slider in mediaControlsQt.css.
     1472    const int volumeThumbWidth = 12;
     1473    const int volumeThumbHeight = volumeThumbWidth / 3;
    14681474    ControlPart part = o->style()->appearance();
    14691475
    14701476    if (part == MediaSliderThumbPart) {
    1471         RenderStyle* parentStyle = o->parent()->style();
    1472         Q_ASSERT(parentStyle);
    1473 
    1474         int parentHeight = parentStyle->height().value();
    1475         o->style()->setWidth(Length(parentHeight / 3, Fixed));
    1476         o->style()->setHeight(Length(parentHeight, Fixed));
     1477        o->style()->setWidth(Length(timelineThumbWidth, Fixed));
     1478        o->style()->setHeight(Length(timelineThumbHeight, Fixed));
    14771479    } else if (part == MediaVolumeSliderThumbPart) {
    1478         RenderStyle* parentStyle = o->parent()->style();
    1479         Q_ASSERT(parentStyle);
    1480 
    1481         int parentWidth = parentStyle->width().value();
    1482         o->style()->setHeight(Length(parentWidth / 3, Fixed));
    1483         o->style()->setWidth(Length(parentWidth, Fixed));
     1480        o->style()->setHeight(Length(volumeThumbHeight, Fixed));
     1481        o->style()->setWidth(Length(volumeThumbWidth, Fixed));
    14841482    } else if (part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart) {
    14851483        QStyleOptionSlider option;
Note: See TracChangeset for help on using the changeset viewer.