Changeset 49995 in webkit


Ignore:
Timestamp:
Oct 23, 2009 1:35:15 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-10-23 Alpha Lam <hclam@chromium.org>

Reviewed by Eric Carlson.

Volume slider always starts at half volume
https://bugs.webkit.org/show_bug.cgi?id=28322

  • media/video-volume-slider.html: Added. Pixel test for the volume slider of the media control. This test assumes volume slider is implemented and usable. It moves the mouse over the right bottom corner of a video element to trigger the volume slider. If volume slider is not implemented at all, you'll only see a video element with the first frame.
  • platform/gtk/Skipped: The above test requires a volume slider so it's skipped.
  • platform/mac/Skipped: ditto.
  • platform/win/Skipped: ditto.

2009-10-23 Alpha Lam <hclam@chromium.org>

Reviewed by Eric Carlson.

Volume slider always starts at half volume
https://bugs.webkit.org/show_bug.cgi?id=28322

Sets the value attribute of volume slider to the volume attribute
of the media element. Also update the value attribute of the
input element for the volume slider when the volume attribute
of the media element is updated.

Test: media/video-volume-slider.html

  • rendering/MediaControlElements.cpp: (WebCore::MediaControlVolumeSliderElement::update): Set the value attribute of the input element for the volume slider using the current volume of the media element.
  • rendering/MediaControlElements.h: Add method definition of update().
  • rendering/RenderMedia.cpp: (WebCore::RenderMedia::createVolumeSlider): Creates a volume slider with value attribute equals to the current volume attribute of the media element.
Location:
trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r49993 r49995  
     12009-10-23  Alpha Lam  <hclam@chromium.org>
     2
     3        Reviewed by Eric Carlson.
     4
     5        Volume slider always starts at half volume
     6        https://bugs.webkit.org/show_bug.cgi?id=28322
     7
     8        * media/video-volume-slider.html: Added.
     9        Pixel test for the volume slider of the media control. This test
     10        assumes volume slider is implemented and usable. It moves the mouse
     11        over the right bottom corner of a video element to trigger the
     12        volume slider. If volume slider is not implemented at all, you'll
     13        only see a video element with the first frame.
     14        * platform/gtk/Skipped: The above test requires a volume slider so it's skipped.
     15        * platform/mac/Skipped: ditto.
     16        * platform/win/Skipped: ditto.
     17
    1182009-10-23  Andrew Scherkus  <scherkus@chromium.org>
    219
  • trunk/LayoutTests/platform/gtk/Skipped

    r49972 r49995  
    36123612media/video-zoom-controls.html
    36133613media/video-zoom.html
     3614# This test requires media controls has a volume slider.
     3615media/video-volume-slider.html
    36143616
    36153617# Tests in plugins/ directory
  • trunk/LayoutTests/platform/mac/Skipped

    r49972 r49995  
    8585media/video-controls-zoomed.html
    8686
     87# This test requires media controls has a volume slider.
     88media/video-volume-slider.html
     89
    8790# As long as pages with unload handlers are put in the Page Cache, this test doesn't make any sense for Mac.
    8891# <rdar://problem/7196485> and https://bugs.webkit.org/show_bug.cgi?id=29021
  • trunk/LayoutTests/platform/win/Skipped

    r49983 r49995  
    4848# <rdar://problem/6710625> Test media/video-error-abort.html doesn't work
    4949media/video-error-abort.html
     50
     51# This test requires media controls has a volume slider.
     52media/video-volume-slider.html
    5053
    5154# <rdar://problem/5075790> Layout tests that depend on certain fonts don't match Mac results:
  • trunk/WebCore/ChangeLog

    r49994 r49995  
     12009-10-23  Alpha Lam  <hclam@chromium.org>
     2
     3        Reviewed by Eric Carlson.
     4
     5        Volume slider always starts at half volume
     6        https://bugs.webkit.org/show_bug.cgi?id=28322
     7
     8        Sets the value attribute of volume slider to the volume attribute
     9        of the media element. Also update the value attribute of the
     10        input element for the volume slider when the volume attribute
     11        of the media element is updated.
     12
     13        Test: media/video-volume-slider.html
     14
     15        * rendering/MediaControlElements.cpp:
     16        (WebCore::MediaControlVolumeSliderElement::update):
     17        Set the value attribute of the input element for the volume slider
     18        using the current volume of the media element.
     19        * rendering/MediaControlElements.h:
     20        Add method definition of update().
     21        * rendering/RenderMedia.cpp:
     22        (WebCore::RenderMedia::createVolumeSlider):
     23        Creates a volume slider with value attribute equals to the current
     24        volume attribute of the media element.
     25
    1262009-10-23  Evan Martin  <evan@chromium.org>
    227
  • trunk/WebCore/rendering/MediaControlElements.cpp

    r49259 r49995  
    647647}
    648648
     649void MediaControlVolumeSliderElement::update()
     650{
     651    float volume = m_mediaElement->volume();
     652    if (value().toFloat() != volume) {
     653        setValue(String::number(volume));
     654        MediaControlInputElement::update();
     655    }
     656}
     657
    649658// ----------------------------
    650659
  • trunk/WebCore/rendering/MediaControlElements.h

    r49259 r49995  
    235235    MediaControlVolumeSliderElement(Document*, HTMLMediaElement*);
    236236    virtual void defaultEventHandler(Event*);
     237    virtual void update();
    237238};
    238239
  • trunk/WebCore/rendering/RenderMedia.cpp

    r47774 r49995  
    259259    m_volumeSlider->setAttribute(precisionAttr, "float");
    260260    m_volumeSlider->setAttribute(maxAttr, "1");
     261    m_volumeSlider->setAttribute(valueAttr, String::number(mediaElement()->volume()));
    261262    m_volumeSlider->attachToParent(m_volumeSliderContainer.get());
    262263}
Note: See TracChangeset for help on using the changeset viewer.