Changeset 127553 in webkit


Ignore:
Timestamp:
Sep 4, 2012 9:53:35 PM (12 years ago)
Author:
keishi@webkit.org
Message:

REGRESSION(r126132): MediaSlider and MediaVolumeSlider thumbs don't match mouse when dragged
https://bugs.webkit.org/show_bug.cgi?id=95701

Reviewed by Kent Tamura.

Source/WebCore:

MediaSlider and MediaVolumeSlider thumbs didn't match mouse when dragged because of the negative margin applied to the thumb.

Test: platform/chromium/media/media-volume-slider-hit-test.html

  • html/shadow/SliderThumbElement.cpp:

(WebCore::SliderThumbElement::setPositionFromPoint): Account for margins when calculating the position.

LayoutTests:

  • platform/chromium/media/media-volume-slider-hit-test-expected.txt: Added.
  • platform/chromium/media/media-volume-slider-hit-test.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r127551 r127553  
     12012-09-04  Keishi Hattori  <keishi@webkit.org>
     2
     3        REGRESSION(r126132): MediaSlider and MediaVolumeSlider thumbs don't match mouse when dragged
     4        https://bugs.webkit.org/show_bug.cgi?id=95701
     5
     6        Reviewed by Kent Tamura.
     7
     8        * platform/chromium/media/media-volume-slider-hit-test-expected.txt: Added.
     9        * platform/chromium/media/media-volume-slider-hit-test.html: Added.
     10
    1112012-09-04  Kent Tamura  <tkent@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r127549 r127553  
     12012-09-04  Keishi Hattori  <keishi@webkit.org>
     2
     3        REGRESSION(r126132): MediaSlider and MediaVolumeSlider thumbs don't match mouse when dragged
     4        https://bugs.webkit.org/show_bug.cgi?id=95701
     5
     6        Reviewed by Kent Tamura.
     7
     8        MediaSlider and MediaVolumeSlider thumbs didn't match mouse when dragged because of the negative margin applied to the thumb.
     9
     10        Test: platform/chromium/media/media-volume-slider-hit-test.html
     11
     12        * html/shadow/SliderThumbElement.cpp:
     13        (WebCore::SliderThumbElement::setPositionFromPoint): Account for margins when calculating the position.
     14
    1152012-09-04  Tony Chang  <tony@chromium.org>
    216
  • trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp

    r126539 r127553  
    273273    if (isVertical) {
    274274        trackSize = trackElement->renderBox()->contentHeight();
    275         position = offset.y() - renderBox()->height() / 2 - trackBoundingBox.y() + inputBoundingBox.y();
     275        position = offset.y() - renderBox()->height() / 2 - trackBoundingBox.y() + inputBoundingBox.y() - renderBox()->marginBottom();
    276276        currentPosition = absoluteThumbOrigin.y() - absoluteSliderContentOrigin.y();
    277277    } else {
    278278        trackSize = trackElement->renderBox()->contentWidth();
    279279        position = offset.x() - renderBox()->width() / 2 - trackBoundingBox.x() + inputBoundingBox.x();
    280         if (!isLeftToRightDirection)
    281             position += renderBox()->width();
     280        if (isLeftToRightDirection)
     281            position -= renderBox()->marginLeft();
     282        else
     283            position += renderBox()->width() - renderBox()->marginRight();
    282284        currentPosition = absoluteThumbOrigin.x() - absoluteSliderContentOrigin.x();
    283285    }
Note: See TracChangeset for help on using the changeset viewer.