Changeset 115125 in webkit


Ignore:
Timestamp:
Apr 24, 2012 3:50:05 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Extra display logic for the media control panel element
https://bugs.webkit.org/show_bug.cgi?id=82476

Patch by Victor Carbune <vcarbune@adobe.com> on 2012-04-24
Reviewed by Eric Carlson.

Source/WebCore:

This patch fixes a bug which caused the controls to be displayed
when they should remain hidden. Added an extra variable to the
panel elements which properly keeps the state of the panel (visible or not).

Test: media/video-controls-toggling.html

  • html/shadow/MediaControlElements.cpp:

(WebCore::MediaControlPanelElement::MediaControlPanelElement): Added the
variable m_isDisplayed to hold the state whether the panel is visible or not.
(WebCore::MediaControlPanelElement::makeOpaque): Showing the panel only if it
is visible.
(WebCore::MediaControlPanelElement::makeTransparent): Enabled the transition
timer which sets the display:none property on the controls.
(WebCore::MediaControlPanelElement::setIsDisplayed): Setter for the state variable.
(WebCore):

  • html/shadow/MediaControlElements.h:

(MediaControlPanelElement):

  • html/shadow/MediaControlRootElement.cpp:

(WebCore::MediaControlRootElement::show): Updated the panel visibility state.
(WebCore::MediaControlRootElement::hide): Updated the panel visibility state.

  • html/shadow/MediaControlRootElementChromium.cpp:

(WebCore::MediaControlRootElementChromium::show): Updated the panel visibility state.
(WebCore::MediaControlRootElementChromium::hide): Updated the panel visibility state.

LayoutTests:

Added test to ensure that controls are not displayed when
the controls attribute is not set.

  • media/video-controls-toggling-expected.txt: Added.
  • media/video-controls-toggling.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r115123 r115125  
     12012-04-24  Victor Carbune  <vcarbune@adobe.com>
     2
     3        Extra display logic for the media control panel element
     4        https://bugs.webkit.org/show_bug.cgi?id=82476
     5
     6        Reviewed by Eric Carlson.
     7
     8        Added test to ensure that controls are not displayed when
     9        the controls attribute is not set.
     10
     11        * media/video-controls-toggling-expected.txt: Added.
     12        * media/video-controls-toggling.html: Added.
     13
    1142012-04-24  Alexandru Chiculita  <achicu@adobe.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r115123 r115125  
     12012-04-24  Victor Carbune  <vcarbune@adobe.com>
     2
     3        Extra display logic for the media control panel element
     4        https://bugs.webkit.org/show_bug.cgi?id=82476
     5
     6        Reviewed by Eric Carlson.
     7
     8        This patch fixes a bug which caused the controls to be displayed
     9        when they should remain hidden. Added an extra variable to the
     10        panel elements which properly keeps the state of the panel (visible or not).
     11
     12        Test: media/video-controls-toggling.html
     13
     14        * html/shadow/MediaControlElements.cpp:
     15        (WebCore::MediaControlPanelElement::MediaControlPanelElement): Added the
     16        variable m_isDisplayed to hold the state whether the panel is visible or not.
     17        (WebCore::MediaControlPanelElement::makeOpaque): Showing the panel only if it
     18        is visible.
     19        (WebCore::MediaControlPanelElement::makeTransparent): Enabled the transition
     20        timer which sets the display:none property on the controls.
     21        (WebCore::MediaControlPanelElement::setIsDisplayed): Setter for the state variable.
     22        (WebCore):
     23        * html/shadow/MediaControlElements.h:
     24        (MediaControlPanelElement):
     25        * html/shadow/MediaControlRootElement.cpp:
     26        (WebCore::MediaControlRootElement::show): Updated the panel visibility state.
     27        (WebCore::MediaControlRootElement::hide): Updated the panel visibility state.
     28        * html/shadow/MediaControlRootElementChromium.cpp:
     29        (WebCore::MediaControlRootElementChromium::show): Updated the panel visibility state.
     30        (WebCore::MediaControlRootElementChromium::hide): Updated the panel visibility state.
     31
    1322012-04-24  Alexandru Chiculita  <achicu@adobe.com>
    233
  • trunk/Source/WebCore/html/shadow/MediaControlElements.cpp

    r114957 r115125  
    109109    , m_canBeDragged(false)
    110110    , m_isBeingDragged(false)
     111    , m_isDisplayed(false)
    111112    , m_opaque(true)
    112113    , m_transitionTimer(this, &MediaControlPanelElement::transitionTimerFired)
     
    242243    m_opaque = true;
    243244
    244     // FIXME(BUG 79347): The display:none property should be toggled below only
    245     // when display logic is introduced.
    246     // show();
     245    if (m_isDisplayed)
     246        show();
    247247}
    248248
     
    258258    m_opaque = false;
    259259
    260     // FIXME(BUG 79347): The display:none property should be toggled below
    261     // (through the timer start) when display logic is introduced.
    262     // startTimer();
     260    startTimer();
    263261}
    264262
     
    291289    if (!canBeDragged)
    292290        endDrag();
     291}
     292
     293void MediaControlPanelElement::setIsDisplayed(bool isDisplayed)
     294{
     295    m_isDisplayed = isDisplayed;
    293296}
    294297
  • trunk/Source/WebCore/html/shadow/MediaControlElements.h

    r114957 r115125  
    110110
    111111    void setCanBeDragged(bool);
     112    void setIsDisplayed(bool);
     113
    112114    void resetPosition();
    113115    void makeOpaque();
     
    132134    bool m_canBeDragged;
    133135    bool m_isBeingDragged;
     136    bool m_isDisplayed;
    134137    bool m_opaque;
    135138    LayoutPoint m_dragStartEventLocation;
  • trunk/Source/WebCore/html/shadow/MediaControlRootElement.cpp

    r114957 r115125  
    285285void MediaControlRootElement::show()
    286286{
     287    m_panel->setIsDisplayed(true);
    287288    m_panel->show();
    288289}
     
    290291void MediaControlRootElement::hide()
    291292{
     293    m_panel->setIsDisplayed(false);
    292294    m_panel->hide();
    293295}
  • trunk/Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp

    r114957 r115125  
    171171void MediaControlRootElementChromium::show()
    172172{
     173    m_panel->setIsDisplayed(true);
    173174    m_panel->show();
    174175}
     
    176177void MediaControlRootElementChromium::hide()
    177178{
     179    m_panel->setIsDisplayed(false);
    178180    m_panel->hide();
    179181}
Note: See TracChangeset for help on using the changeset viewer.