2011-06-10 Kent Tamura <tkent@chromium.org>
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Jun 2011 03:46:30 +0000 (03:46 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Jun 2011 03:46:30 +0000 (03:46 +0000)
commitda2ba98889d932377092f60b3179d1359800ef26
tree0b3454135fc4e7f46505df8d84fd1aae55d8d074
parent6b993b1ed541fb9fc2453af6ffdcc670a481d2dc
2011-06-10  Kent Tamura  <tkent@chromium.org>

        Reviewed by Dimitri Glazkov.

        Use CSS machinery to position slider thumb.
        https://bugs.webkit.org/show_bug.cgi?id=52920

        Add two new tests, and update tests with sliders.

        * fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt:
        * fast/forms/input-appearance-range.html: Added.
        * fast/forms/slider-thumb-stylability.html: Remove text.
        * fast/forms/validation-message-on-range-expected.txt: Added.
        * fast/forms/validation-message-on-range.html: Added.
        * fast/multicol/client-rects-expected.txt:
        * fast/repaint/slider-thumb-float-expected.txt:
        * media/audio-repaint-expected.txt:
        * media/controls-without-preload-expected.txt:
        * media/media-document-audio-repaint-expected.txt:
        * platform/chromium/test_expectations.txt:
        * platform/gtk/Skipped: Skip validaiton-message-on-range.html because
          this platform doesn't support the interactive validation.
        * platform/mac-wk2/Skipped: Skip validaiton-message-on-range.html.
        * platform/mac/fast/dom/HTMLInputElement/input-slider-update-expected.png:
        * platform/mac/fast/dom/HTMLInputElement/input-slider-update-expected.txt:
        * platform/mac/fast/forms/box-shadow-override-expected.png:
        * platform/mac/fast/forms/box-shadow-override-expected.txt:
        * platform/mac/fast/forms/input-appearance-height-expected.png:
        * platform/mac/fast/forms/input-appearance-height-expected.txt:
        * platform/mac/fast/forms/input-appearance-range-expected.png: Added.
        * platform/mac/fast/forms/input-appearance-range-expected.txt: Added.
        * platform/mac/fast/forms/range-thumb-height-percentage-expected.txt:
        * platform/mac/fast/forms/slider-padding-expected.png:
        * platform/mac/fast/forms/slider-padding-expected.txt:
        * platform/mac/fast/forms/slider-thumb-shared-style-expected.png:
        * platform/mac/fast/forms/slider-thumb-shared-style-expected.txt:
        * platform/mac/fast/forms/slider-thumb-stylability-expected.png:
        * platform/mac/fast/forms/slider-thumb-stylability-expected.txt:
        * platform/mac/fast/forms/thumbslider-no-parent-slider-expected.png:
        * platform/mac/fast/forms/thumbslider-no-parent-slider-expected.txt:
        * platform/mac/fast/repaint/slider-thumb-drag-release-expected.png:
        * platform/mac/fast/repaint/slider-thumb-drag-release-expected.txt:
        * platform/mac/media/audio-controls-rendering-expected.png:
        * platform/mac/media/audio-controls-rendering-expected.txt:
        * platform/mac/media/controls-after-reload-expected.png:
        * platform/mac/media/controls-after-reload-expected.txt:
        * platform/mac/media/controls-styling-expected.png:
        * platform/mac/media/controls-styling-expected.txt:
        * platform/qt/Skipped: Skip validaiton-message-on-range.html.
        * platform/win/Skipped: Skip validaiton-message-on-range.html.
2011-06-10  Kent Tamura  <tkent@chromium.org>

        Reviewed by Dimitri Glazkov.

        Use CSS machinery to position slider thumb.
        https://bugs.webkit.org/show_bug.cgi?id=52920

        Remove RenderSlider::layout().
        In order to remove it, we introduce new three shadow nodes:
         - A flex box container occupying the whole box
         - A flex box item representing a movable area of the thumb
         - A flex box item limiting the movable area of the thumb
        The thumb position is specified by percentage position in the second element.

        This change also fixes Bug 60353.

        Tests: fast/forms/input-appearance-range.html
               fast/forms/validation-message-on-range.html

        * accessibility/AccessibilitySlider.cpp:
        (WebCore::AccessibilitySliderThumb::elementRect):
          Use Node::getRect() for the thumb element.
        * css/html.css: Add new style definitions for the new node layout.
        (input[type="range"]::-webkit-slider-container):
        (input[type="range"]::-webkit-slider-runnable-track):
        (input[type="range"]::-webkit-slider-thumb):
        * html/RangeInputType.cpp:
        (WebCore::RangeInputType::handleMouseDownEvent):
          Accepts events on shadow nodes, use sliderThumbElementOf().
        (WebCore::RangeInputType::createShadowSubtree):
          Creates new nodes layout.
        (WebCore::RangeInputType::valueChanged): Use sliderThumbElementOf().
        * html/RangeInputType.h: Remove shadowSliderThumb().
        * html/shadow/SliderThumbElement.cpp:
        (WebCore::sliderPosition): Moved from RenderSlider.cpp.
        (WebCore::hasVerticalAppearance): New utility function.
        (WebCore::sliderThumbElementOf): New utility function.
        (WebCore::RenderSliderThumb::layout):
          Sets CSS top/left values.
        (WebCore::RenderSliderContainer::RenderSliderContainer):
        (WebCore::RenderSliderContainer::layout):
          Add some adjustment code.
          - Setting box-orient
          - Adjust heights of some nodes. It is required to pass existing tests.
        (WebCore::SliderThumbElement::setPositionFromValue):
          Update comments.
        (WebCore::SliderThumbElement::setPositionFromPoint):
          Calculate the current position from absolute positions.
        (WebCore::SliderThumbElement::hostInput):
          Removed unnecessary variable.
        (WebCore::TrackLimiterElement::TrackLimiterElement):
        (WebCore::TrackLimiterElement::create): Adjust style.
        (WebCore::TrackLimiterElement::createRenderer):
          This node uses RenderSliderThumb.
        (WebCore::TrackLimiterElement::shadowPseudoId):
          This node also uses -webkit-slider-thumb.
        (WebCore::SliderContainerElement::SliderContainerElement):
        (WebCore::SliderContainerElement::create):
        (WebCore::SliderContainerElement::createRenderer):
          Uses RenderSliderContainer.
        (WebCore::SliderContainerElement::shadowPseudoId):
        * html/shadow/SliderThumbElement.h:
          Make hostInput() public, add declarations of TrackLimiterElement
          and SliderContainerElement.
        * rendering/RenderSlider.cpp:
        (WebCore::RenderSlider::RenderSlider): Added an assertion.
        (WebCore::RenderSlider::inDragMode): Uses sliderThumbElementOf().
        * rendering/RenderSlider.h: Remove declarations of removed functions.
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::adjustSliderThumbStyle):
          Calls adjustSliderThumbSize().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@88757 268f45cc-cd09-0410-ab3c-d52691b4dbfc
51 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt
LayoutTests/fast/forms/input-appearance-range.html [new file with mode: 0644]
LayoutTests/fast/forms/slider-thumb-stylability.html
LayoutTests/fast/forms/validation-message-on-range-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/validation-message-on-range.html [new file with mode: 0644]
LayoutTests/fast/multicol/client-rects-expected.txt
LayoutTests/fast/repaint/slider-thumb-float-expected.txt
LayoutTests/media/audio-repaint-expected.txt
LayoutTests/media/controls-without-preload-expected.txt
LayoutTests/media/media-document-audio-repaint-expected.txt
LayoutTests/platform/chromium/test_expectations.txt
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/mac-wk2/Skipped
LayoutTests/platform/mac/fast/dom/HTMLInputElement/input-slider-update-expected.png
LayoutTests/platform/mac/fast/dom/HTMLInputElement/input-slider-update-expected.txt
LayoutTests/platform/mac/fast/forms/box-shadow-override-expected.png
LayoutTests/platform/mac/fast/forms/box-shadow-override-expected.txt
LayoutTests/platform/mac/fast/forms/input-appearance-height-expected.png
LayoutTests/platform/mac/fast/forms/input-appearance-height-expected.txt
LayoutTests/platform/mac/fast/forms/input-appearance-range-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/input-appearance-range-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/range-thumb-height-percentage-expected.txt
LayoutTests/platform/mac/fast/forms/slider-padding-expected.png
LayoutTests/platform/mac/fast/forms/slider-padding-expected.txt
LayoutTests/platform/mac/fast/forms/slider-thumb-shared-style-expected.png
LayoutTests/platform/mac/fast/forms/slider-thumb-shared-style-expected.txt
LayoutTests/platform/mac/fast/forms/slider-thumb-stylability-expected.png
LayoutTests/platform/mac/fast/forms/slider-thumb-stylability-expected.txt
LayoutTests/platform/mac/fast/forms/thumbslider-no-parent-slider-expected.png
LayoutTests/platform/mac/fast/forms/thumbslider-no-parent-slider-expected.txt
LayoutTests/platform/mac/fast/repaint/slider-thumb-drag-release-expected.png
LayoutTests/platform/mac/fast/repaint/slider-thumb-drag-release-expected.txt
LayoutTests/platform/mac/media/audio-controls-rendering-expected.png
LayoutTests/platform/mac/media/audio-controls-rendering-expected.txt
LayoutTests/platform/mac/media/controls-after-reload-expected.png
LayoutTests/platform/mac/media/controls-after-reload-expected.txt
LayoutTests/platform/mac/media/controls-styling-expected.png
LayoutTests/platform/mac/media/controls-styling-expected.txt
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilitySlider.cpp
Source/WebCore/css/html.css
Source/WebCore/html/RangeInputType.cpp
Source/WebCore/html/RangeInputType.h
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/html/shadow/SliderThumbElement.h
Source/WebCore/rendering/RenderSlider.cpp
Source/WebCore/rendering/RenderSlider.h
Source/WebCore/rendering/RenderTheme.cpp