Changeset 37470 in webkit
- Timestamp:
- Oct 9, 2008 9:04:15 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r37466 r37470 1 2008-10-09 Eric Carlson <eric.carlson@apple.com> 2 3 Media controls should not show when element is not visible 4 5 https://bugs.webkit.org/show_bug.cgi?id=21155 6 7 Reviewed by Adele Peterson. 8 9 * html/HTMLMediaElement.cpp: 10 (WebCore::HTMLMediaElement::recalcStyle): New, call renderer()->updateFromElement to stay 11 in sync with visibility changes 12 * html/HTMLMediaElement.h: 13 * rendering/RenderMedia.cpp: 14 (WebCore::RenderMedia::RenderMedia): initialize m_previousVisible 15 (WebCore::RenderMedia::updateControlVisibility): consider style()->visibility() when determining 16 if element is visible or not. Don't animate controller visibility when change triggered by 17 showing or hiding media element. 18 * rendering/RenderMedia.h: declare m_previousVisible 19 1 20 2008-10-09 Timothy Hatcher <timothy@apple.com> 2 21 -
trunk/WebCore/html/HTMLMediaElement.cpp
r37136 r37470 153 153 } 154 154 155 void HTMLMediaElement::recalcStyle(StyleChange change) 156 { 157 HTMLElement::recalcStyle(change); 158 159 if (renderer()) 160 renderer()->updateFromElement(); 161 } 162 155 163 void HTMLMediaElement::scheduleLoad() 156 164 { -
trunk/WebCore/html/HTMLMediaElement.h
r36957 r37470 54 54 virtual void removedFromDocument(); 55 55 virtual void attach(); 56 virtual void recalcStyle(StyleChange); 56 57 57 58 MediaPlayer* player() const { return m_player.get(); } -
trunk/WebCore/rendering/RenderMedia.cpp
r36957 r37470 62 62 , m_opacityAnimationFrom(0) 63 63 , m_opacityAnimationTo(1.0f) 64 , m_previousVisible(VISIBLE) 64 65 { 65 66 } … … 313 314 return; 314 315 // do fading manually, css animations don't work well with shadow trees 315 bool visible = m_mouseOver || media->paused() || media->ended() || media->networkState() < HTMLMediaElement::LOADED_METADATA;316 bool visible = style()->visibility() == VISIBLE && (m_mouseOver || media->paused() || media->ended() || media->networkState() < HTMLMediaElement::LOADED_METADATA); 316 317 if (visible == (m_opacityAnimationTo > 0)) 317 318 return; 319 320 if (style()->visibility() != m_previousVisible) { 321 // don't fade gradually if it the element has just changed visibility 322 m_previousVisible = style()->visibility(); 323 m_opacityAnimationTo = m_previousVisible == VISIBLE ? 1.0f : 0; 324 changeOpacity(m_panel.get(), 0); 325 return; 326 } 327 318 328 if (visible) { 319 329 m_opacityAnimationFrom = m_panel->renderer()->style()->opacity(); -
trunk/WebCore/rendering/RenderMedia.h
r35438 r37470 110 110 float m_opacityAnimationFrom; 111 111 float m_opacityAnimationTo; 112 EVisibility m_previousVisible; 112 113 }; 113 114
Note: See TracChangeset
for help on using the changeset viewer.