Implement painting slider tick marks
authorkeishi@webkit.org <keishi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jul 2012 05:30:14 +0000 (05:30 +0000)
committerkeishi@webkit.org <keishi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jul 2012 05:30:14 +0000 (05:30 +0000)
commit3dda93decb504877085e5f1d7880e53f4ed4c53e
tree6b14ddd5b78b78b5e8141476a6d5b3fff4b22d3b
parent242d54417e27d5c8a7900761956fcb8a5a1958e9
Implement painting slider tick marks
https://bugs.webkit.org/show_bug.cgi?id=87844

Reviewed by Kent Tamura.

Source/WebCore:

This implements painting slider tick marks for <datalist> support for input type=range.
This does not support automatic update when list target changes, and it will be fixed
in a follow up patch (Bug 89544).

Tests: fast/forms/datalist/input-appearance-range-with-datalist-rtl.html
       fast/forms/datalist/input-appearance-range-with-datalist-zoomed.html
       fast/forms/datalist/input-appearance-range-with-datalist.html

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::sliderThumbElement):
(WebCore):
* html/HTMLInputElement.h:
(HTMLInputElement):
* html/InputType.h:
(WebCore::InputType::sliderThumbElement):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::typeMismatchFor): We need HTMLInputElement::isValidValue("foo") to return false.
(WebCore):
(WebCore::RangeInputType::sliderThumbElement):
* html/RangeInputType.h:
(RangeInputType):
* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderContainer::layout): Slider height needs to be increased for the tick marks.
* platform/efl/RenderThemeEfl.cpp:
(WebCore):
(WebCore::RenderThemeEfl::sliderTickSize):
(WebCore::RenderThemeEfl::sliderTickOffsetFromTrackCenter):
* platform/efl/RenderThemeEfl.h:
(RenderThemeEfl):
* platform/qt/RenderThemeQt.cpp:
(WebCore::RenderThemeQt::sliderTickSize):
(WebCore):
(WebCore::RenderThemeQt::sliderTickOffsetFromTrackCenter):
* platform/qt/RenderThemeQt.h:
(RenderThemeQt):
* rendering/RenderTheme.cpp:
(WebCore):
(WebCore::RenderTheme::paintSliderTicks):
* rendering/RenderTheme.h:
(RenderTheme):
* rendering/RenderThemeChromiumCommon.cpp:
(WebCore::RenderThemeChromiumCommon::supportsDataListUI):
* rendering/RenderThemeChromiumLinux.cpp:
(WebCore):
(WebCore::RenderThemeChromiumLinux::sliderTickSize): Tick size for horizontal slider. i.e. Width is length along the track.
(WebCore::RenderThemeChromiumLinux::sliderTickOffsetFromTrackCenter): Offset from
middle of draw rect to draw the ticks. Minus value means above the track.
(WebCore::RenderThemeChromiumLinux::paintSliderTrack):
* rendering/RenderThemeChromiumLinux.h:
(RenderThemeChromiumLinux):
* rendering/RenderThemeChromiumWin.cpp:
(WebCore):
(WebCore::RenderThemeChromiumWin::sliderTickSize):
(WebCore::RenderThemeChromiumWin::sliderTickOffsetFromTrackCenter):
(WebCore::RenderThemeChromiumWin::paintSliderTrack):
(WebCore::RenderThemeChromiumWin::paintSliderThumb):
* rendering/RenderThemeChromiumWin.h:
(RenderThemeChromiumWin):
* rendering/RenderThemeMac.h:
(RenderThemeMac):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSliderTrack):
(WebCore):
(WebCore::RenderThemeMac::sliderTickSize):
(WebCore::RenderThemeMac::sliderTickOffsetFromTrackCenter):

LayoutTests:

* fast/forms/datalist/input-appearance-range-with-datalist-expected.txt: Added.
* fast/forms/datalist/input-appearance-range-with-datalist-rtl-expected.html: Added.
* fast/forms/datalist/input-appearance-range-with-datalist-rtl.html: Added. The ticks should go from right to left.
* fast/forms/datalist/input-appearance-range-with-datalist-zoomed-expected.txt: Added.
* fast/forms/datalist/input-appearance-range-with-datalist-zoomed.html: Added. The ticks should zoom properly.
* fast/forms/datalist/input-appearance-range-with-datalist.html: Added.
* platform/chromium-linux/fast/forms/datalist/input-appearance-range-with-datalist-expected.png: Added.
* platform/chromium-linux/fast/forms/datalist/input-appearance-range-with-datalist-zoomed-expected.png: Added.
* platform/chromium-mac/fast/forms/datalist/input-appearance-range-with-datalist-expected.png: Added.
* platform/chromium-mac/fast/forms/datalist/input-appearance-range-with-datalist-zoomed-expected.png: Added.
* platform/chromium-win/fast/forms/datalist/input-appearance-range-with-datalist-expected.png: Added.
* platform/chromium-win/fast/forms/datalist/input-appearance-range-with-datalist-zoomed-expected.png: Added.
* platform/chromium/TestExpectations:
* platform/chromium/fast/forms/datalist/input-list-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
35 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/datalist/input-appearance-range-with-datalist-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/datalist/input-appearance-range-with-datalist-rtl-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/datalist/input-appearance-range-with-datalist-rtl.html [new file with mode: 0644]
LayoutTests/fast/forms/datalist/input-appearance-range-with-datalist-zoomed-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/datalist/input-appearance-range-with-datalist-zoomed.html [new file with mode: 0644]
LayoutTests/fast/forms/datalist/input-appearance-range-with-datalist.html [new file with mode: 0644]
LayoutTests/platform/chromium-linux/fast/forms/datalist/input-appearance-range-with-datalist-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-linux/fast/forms/datalist/input-appearance-range-with-datalist-zoomed-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-mac/fast/forms/datalist/input-appearance-range-with-datalist-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-mac/fast/forms/datalist/input-appearance-range-with-datalist-zoomed-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-win/fast/forms/datalist/input-appearance-range-with-datalist-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-win/fast/forms/datalist/input-appearance-range-with-datalist-zoomed-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/chromium/fast/forms/datalist/input-list-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/InputType.h
Source/WebCore/html/RangeInputType.cpp
Source/WebCore/html/RangeInputType.h
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/platform/efl/RenderThemeEfl.cpp
Source/WebCore/platform/efl/RenderThemeEfl.h
Source/WebCore/platform/qt/RenderThemeQt.cpp
Source/WebCore/platform/qt/RenderThemeQt.h
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeChromiumCommon.cpp
Source/WebCore/rendering/RenderThemeChromiumLinux.cpp
Source/WebCore/rendering/RenderThemeChromiumLinux.h
Source/WebCore/rendering/RenderThemeChromiumWin.cpp
Source/WebCore/rendering/RenderThemeChromiumWin.h
Source/WebCore/rendering/RenderThemeMac.h
Source/WebCore/rendering/RenderThemeMac.mm