Remove hidden limiter div in the input slider shadow DOM
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Nov 2012 21:39:15 +0000 (21:39 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Nov 2012 21:39:15 +0000 (21:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=102993

Reviewed by Ojan Vafai.

Source/WebCore:

The shadow DOM for input sliders would have a hidden div (the TrackLimiterElement)
the size of the thumb which would limit the position of thumb since the width of
the thumb takes up space in the track. This patch simplifies the shadow DOM by
removing this hidden div and computing the position of the thumb taking the size of
the thumb into account.

No new tests, covered by existing tests in fast/forms.

* css/mediaControlsChromium.css:
(input[type="range"]::-webkit-media-slider-container > div): We were depending on the behavior of the limiter having negative margins, causing the slider div
to overflow. Moving the negative margin to the slider produces the same effect.
* css/mediaControlsChromiumAndroid.css:
(input[type="range"]::-webkit-media-slider-container > div): Ditto.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createShadowSubtree): Remove limiter div.
* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderContainer::layout): Adjust the available space for the thumb and correctly position in the vertical case.
(WebCore::SliderThumbElement::setPositionFromPoint): Adjust the usable track size and simplify RTL code (no need to account for the limiter).
(WebCore): Delete limiter code.
* html/shadow/SliderThumbElement.h:
(WebCore): Delete limiter code.
* rendering/RenderSlider.cpp:
(WebCore::RenderSlider::layout): Delete limiter code.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintSliderTicks): Simplify code for painting tick marks.

LayoutTests:

Pixel results should be the same, but the render tree for RenderSlider has one less div.

* platform/chromium-linux/fast/dom/HTMLInputElement/input-slider-update-expected.txt:
* platform/chromium-linux/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt:
* platform/chromium-linux/fast/forms/box-shadow-override-expected.txt:
* platform/chromium-linux/fast/forms/input-appearance-height-expected.txt:
* platform/chromium-linux/fast/forms/range/input-appearance-range-expected.txt:
* platform/chromium-linux/fast/forms/range/range-thumb-height-percentage-expected.txt:
* platform/chromium-linux/fast/forms/range/slider-padding-expected.txt:
* platform/chromium-linux/fast/forms/range/slider-thumb-shared-style-expected.txt:
* platform/chromium-linux/fast/forms/range/slider-thumb-stylability-expected.txt:
* platform/chromium-linux/fast/multicol/client-rects-expected.txt:
* platform/chromium-linux/fast/repaint/slider-thumb-drag-release-expected.txt:
* platform/chromium-linux/fast/repaint/slider-thumb-float-expected.txt:
* platform/chromium-win/fast/hidpi/video-controls-in-hidpi-expected.txt:
* platform/chromium-win/fast/layers/video-layer-expected.txt:
* platform/chromium-win/media/audio-controls-rendering-expected.txt:
* platform/chromium-win/media/audio-repaint-expected.txt:
* platform/chromium-win/media/controls-after-reload-expected.txt:
* platform/chromium-win/media/controls-strict-expected.txt:
* platform/chromium-win/media/controls-styling-expected.txt:
* platform/chromium-win/media/controls-styling-strict-expected.txt:
* platform/chromium-win/media/controls-without-preload-expected.txt:
* platform/chromium-win/media/media-controls-clone-expected.txt:
* platform/chromium-win/media/media-document-audio-repaint-expected.txt:
* platform/chromium-win/media/video-controls-rendering-expected.txt:
* platform/chromium-win/media/video-display-toggle-expected.txt:
* platform/chromium-win/media/video-no-audio-expected.txt:
* platform/chromium-win/media/video-playing-and-pause-expected.txt:
* platform/chromium-win/media/video-zoom-controls-expected.txt:
* platform/chromium-win/platform/chromium/virtual/gpu/fast/hidpi/video-controls-in-hidpi-expected.txt:

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


No differences found