Allow drawing a slider thumb for any nodes.
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Jun 2011 02:06:38 +0000 (02:06 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Jun 2011 02:06:38 +0000 (02:06 +0000)
commit6608431f614baf7b3355c9621d7d51d6774c50b7
tree66843e24b63512d2598dc1320962bc9436726339
parentcafb5a023683b894159a641a331f7e38a059236e
Allow drawing a slider thumb for any nodes.
https://bugs.webkit.org/show_bug.cgi?id=62196

Reviewed by Dimitri Glazkov.

Source/WebCore:

RenderObject::node() should provide various information which is
necessary for rendering. We don't need to refer the parent renderer.

* dom/Node.cpp:
(WebCore::Node::focusDe1egate): Added.
* dom/Node.h: Added a declaration.
* html/shadow/MediaControlElements.cpp:
(WebCore::toParentMediaElement):
  Added an overload of toParentMediaElement() with Node* parameter.
* html/shadow/MediaControlElements.h:
(WebCore::toParentMediaElement): ditto.
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::isEnabledFormControl):
  Returns the status of the host node.
(WebCore::SliderThumbElement::isReadOnlyFormControl): ditto.
(WebCore::SliderThumbElement::focusDe1egate):
  Returns the host node so that RenderTheme::isFocused() returns true.
(WebCore::SliderThumbElement::detach): Style nit.
(WebCore::SliderThumbElement::hostInput):
  Make it const because it is called by const functions.
* html/shadow/SliderThumbElement.h:
  - Remove inDragMode()
  - Update declarations
* platform/qt/RenderThemeQt.cpp:
(WebCore::RenderThemeQt::paintMediaSliderThumb):
  Use Node::shadowAncestorNode() instead of RenderObject::parent() to
  support deeper thumb nodes.
* rendering/RenderMediaControlsChromium.cpp:
(WebCore::paintMediaSliderThumb): ditto.
(WebCore::paintMediaVolumeSliderThumb): Remove isSlider() check.
* rendering/RenderSlider.cpp:
(WebCore::RenderSlider::inDragMode):
  SliderThumbElement::inDragMode() was removed, and Node::active() has
  the same information.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint): Remove isSlider() checks.
(WebCore::RenderTheme::isFocused): Apply Node::focusDelegate().
* rendering/RenderThemeChromiumLinux.cpp:
(WebCore::RenderThemeChromiumLinux::paintSliderThumb):
  isPressed() is enough.
* rendering/RenderThemeChromiumWin.cpp:
  isEnabled(), isFocused(), and isPressed() are enough.
(WebCore::RenderThemeChromiumWin::determineSliderThumbState):
(WebCore::RenderThemeChromiumWin::determineClassicState):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSliderThumb):
  - Remove isSlider() check.
  - Passing 'o' to udpateFooState functions is enough.
  - isPressed() is enough.
* rendering/RenderThemeSafari.cpp:
(WebCore::RenderThemeSafari::paintSliderThumb):
  We don't need special handling anymore.
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::determineSliderThumbState):
  isEnabled(), isFocused(), and isPressed() are enough.

LayoutTests:

The behavior was changed. We should show slider thumbs for any nodes with
-webkit-appearance:slidertumb-horizontal/vertical.

* fast/forms/thumbslider-no-parent-slider.html:
* platform/chromium/test_expections.txt: Expect to fail with thumbslider-no-parent-slider.html.
* platform/mac/fast/forms/thumbslider-no-parent-slider-expected.png:
* platform/mac/fast/forms/thumbslider-no-parent-slider-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@88415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/thumbslider-no-parent-slider.html
LayoutTests/platform/chromium/test_expectations.txt
LayoutTests/platform/mac/fast/forms/thumbslider-no-parent-slider-expected.png
LayoutTests/platform/mac/fast/forms/thumbslider-no-parent-slider-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/MediaControlElements.h
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/html/shadow/SliderThumbElement.h
Source/WebCore/platform/qt/RenderThemeQt.cpp
Source/WebCore/rendering/RenderMediaControlsChromium.cpp
Source/WebCore/rendering/RenderSlider.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderThemeChromiumLinux.cpp
Source/WebCore/rendering/RenderThemeChromiumWin.cpp
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderThemeSafari.cpp
Source/WebCore/rendering/RenderThemeWin.cpp