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: http://svn.webkit.org/repository/webkit/trunk@88757 268f45cc-cd09-0410-ab3c-d52691b4dbfc
51 files changed