Changeset 128235 in webkit
- Timestamp:
- Sep 11, 2012 4:08:57 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r128233 r128235 1 2012-09-11 Adam Klein <adamk@chromium.org> 2 3 Unreviewed, rolling out r128075 4 https://bugs.webkit.org/show_bug.cgi?id=96435 5 6 * platform/chromium-mac/platform/chromium/media/controls-video-sizes-expected.png: Removed. 7 * platform/chromium/TestExpectations: 8 * platform/chromium/media/controls-audio-sizes-expected.txt: Removed. 9 * platform/chromium/media/controls-audio-sizes.html: Removed. 10 * platform/chromium/media/controls-video-sizes-expected.txt: Removed. 11 * platform/chromium/media/controls-video-sizes-padding-expected.txt: Removed. 12 * platform/chromium/media/controls-video-sizes-padding.html: Removed. 13 * platform/chromium/media/controls-video-sizes.html: Removed. 14 1 15 2012-09-11 Adam Klein <adamk@chromium.org> 2 16 -
trunk/LayoutTests/platform/chromium/TestExpectations
r128233 r128235 3339 3339 BUGWK94242 DEBUG : media/track/track-cues-sorted-before-dispatch.html = PASS TIMEOUT 3340 3340 3341 // Need rebaseline.3342 BUGWK89344 : media/audio-controls-rendering.html = IMAGE+TEXT3343 BUGCR145590 BUGWK89344 : media/audio-repaint.html = IMAGE+TEXT TIMEOUT3344 BUGWK89344 : media/controls-after-reload.html = IMAGE+TEXT3345 BUGWK89344 : media/controls-layout-direction.html = IMAGE3346 BUGWK89344 : media/controls-strict.html = IMAGE+TEXT3347 BUGWK89344 : media/controls-styling-strict.html = IMAGE+TEXT3348 BUGWK89344 : media/controls-styling.html = IMAGE+TEXT3349 BUGWK89344 : media/controls-without-preload.html = IMAGE+TEXT3350 BUGWK89344 : media/media-controls-clone.html = IMAGE+TEXT3351 BUGWK89344 : media/media-document-audio-repaint.html = IMAGE+TEXT3352 BUGWK89344 : media/track/track-cue-rendering-horizontal.html = IMAGE+TEXT3353 BUGWK89344 : media/track/track-cue-rendering-vertical.html = IMAGE+TEXT3354 BUGWK89344 : media/video-controls-rendering.html = IMAGE+TEXT3355 BUGWK89344 : media/video-display-toggle.html = IMAGE+TEXT3356 BUGWK89344 : media/video-empty-source.html = IMAGE+TEXT3357 BUGWK89344 : media/video-no-audio.html = IMAGE+TEXT3358 BUGWK89344 : media/video-playing-and-pause.html = IMAGE+TEXT3359 BUGWK89344 : media/video-zoom-controls.html = IMAGE+TEXT3360 BUGWK89344 : http/tests/media/video-buffered-range-contains-currentTime.html = IMAGE3361 BUGWK89344 : fast/hidpi/video-controls-in-hidpi.html = IMAGE+TEXT3362 BUGWK89344 : fast/layers/video-layer.html = IMAGE+TEXT3363 BUGWK89344 : compositing/video/video-controls-layer-creation.html = IMAGE3364 BUGWK89344 LINUX ANDROID WIN : platform/chromium/media/controls-video-sizes.html = IMAGE3365 3366 3341 // Supposedly started failing between CR r140760 and CR r141216. The failures 3367 3342 // look like they involve antialiasing; the fact that the test clearly expects … … 3575 3550 BUGCR145590 ANDROID : media/W3C/video/canPlayType/canPlayType_two_implies_one_6.html = TEXT 3576 3551 BUGCR145590 ANDROID : media/audio-data-url.html = TEXT 3552 BUGCR145590 ANDROID : media/audio-repaint.html = TEXT TIMEOUT 3577 3553 BUGCR145590 ANDROID : media/encrypted-media/encrypted-media-events.html = TIMEOUT 3578 3554 BUGCR145590 ANDROID : media/encrypted-media/encrypted-media-not-loaded.html = TEXT -
trunk/Source/WebCore/ChangeLog
r128234 r128235 1 2012-09-11 Adam Klein <adamk@chromium.org> 2 3 Unreviewed, rolling out r128075 4 https://bugs.webkit.org/show_bug.cgi?id=96435 5 6 Broke chromium content_browsertests and included flaky layout tests 7 8 * html/shadow/MediaControlRootElementChromium.cpp: 9 (WebCore::MediaControlRootElementChromium::MediaControlRootElementChromium): 10 (WebCore::MediaControlRootElementChromium::reset): 11 (WebCore::MediaControlRootElementChromium::playbackStarted): 12 (WebCore::MediaControlRootElementChromium::playbackProgressed): 13 (WebCore::MediaControlRootElementChromium::playbackStopped): 14 (WebCore::MediaControlRootElementChromium::updateTimeDisplay): 15 * html/shadow/MediaControlRootElementChromium.h: 16 (MediaControlPanelEnclosureElement): 17 (MediaControlRootElementChromium): 18 1 19 2012-09-11 Matt Lilek <mrl@apple.com> 2 20 -
trunk/Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp
r128075 r128235 30 30 #include "MediaControlRootElementChromium.h" 31 31 32 #include "CSSValueKeywords.h"33 32 #include "HTMLDivElement.h" 34 33 #include "HTMLMediaElement.h" … … 37 36 #include "MouseEvent.h" 38 37 #include "Page.h" 39 #include "RenderMedia.h"40 38 #include "RenderTheme.h" 41 #include "RenderView.h"42 #include "StyleResolver.h"43 39 #include "Text.h" 44 40 … … 64 60 } 65 61 66 67 class RenderMediaControlPanelEnclosureElement : public RenderBlock {68 public:69 RenderMediaControlPanelEnclosureElement(Node*);70 71 private:72 virtual void layout() OVERRIDE;73 };74 75 RenderMediaControlPanelEnclosureElement::RenderMediaControlPanelEnclosureElement(Node* node)76 : RenderBlock(node)77 {78 }79 80 static const int hideTimeDisplayWidth = 350;81 static const int hideVolumeDisplayWidth = 275;82 static const int hideMuteButtonWidth = 210;83 static const int hideFullscreenButtonWidth = 150;84 static const int hideTimelineWidth = 100;85 86 void RenderMediaControlPanelEnclosureElement::layout()87 {88 HTMLMediaElement* mediaElement = toParentMediaElement(this);89 if (!mediaElement || !mediaElement->renderer())90 return;91 92 float mediaWidthFloat = toRenderMedia(mediaElement->renderer())->contentBoxRect().width().toFloat();93 int mediaWidth = round(adjustFloatForAbsoluteZoom(mediaWidthFloat, style()));94 95 MediaControlRootElementChromium* elementShadow = (MediaControlRootElementChromium *) mediaElement->mediaControls();96 97 if (mediaWidth < hideTimeDisplayWidth)98 elementShadow->hideTimeDisplay();99 else100 elementShadow->showTimeDisplay();101 102 if (mediaWidth < hideVolumeDisplayWidth)103 elementShadow->hideVolumeSlider();104 else105 elementShadow->showVolumeSlider();106 107 if (mediaWidth < hideMuteButtonWidth)108 elementShadow->hideMuteButton();109 else110 elementShadow->showMuteButton();111 112 if (mediaWidth < hideFullscreenButtonWidth)113 elementShadow->hideFullscreenButton();114 else115 elementShadow->showFullscreenButton();116 117 if (mediaWidth < hideTimelineWidth)118 elementShadow->hideTimeline();119 else120 elementShadow->showTimeline();121 122 if (mediaElement->renderer()->isVideo())123 // Update padding according to video width.124 static_cast<MediaControlPanelEnclosureElement*>(node())->updatePadding(mediaWidth);125 126 RenderBlock::layout();127 }128 129 62 MediaControlPanelEnclosureElement::MediaControlPanelEnclosureElement(Document* document) 130 63 : MediaControlChromiumEnclosureElement(document) … … 137 70 } 138 71 139 RenderObject* MediaControlPanelEnclosureElement::createRenderer(RenderArena* arena, RenderStyle*)140 {141 return new (arena) RenderMediaControlPanelEnclosureElement(this);142 }143 144 72 const AtomicString& MediaControlPanelEnclosureElement::shadowPseudoId() const 145 73 { 146 74 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-enclosure")); 147 75 return id; 148 }149 150 // Make sure to keep these values in sync with the ones in mediaControlsChromium.css.151 static const int videoControlsHeight = 30;152 static const int maxPadding = 5;153 static const int minPadding = 0;154 static const int minPaddingAtWidth = 160;155 static const int decreaseStep = 60;156 157 void MediaControlPanelEnclosureElement::updatePadding(int mediaWidth)158 {159 // Scale padding linearly between minPadding and maxPadding depending on mediaWidth.160 float padding = round((mediaWidth - minPaddingAtWidth) / decreaseStep);161 if (padding < minPadding)162 padding = minPadding;163 else if (padding > maxPadding)164 padding = maxPadding;165 166 setInlineStyleProperty(CSSPropertyPaddingRight, padding, CSSPrimitiveValue::CSS_PX);167 setInlineStyleProperty(CSSPropertyPaddingBottom, padding, CSSPrimitiveValue::CSS_PX);168 setInlineStyleProperty(CSSPropertyPaddingLeft, padding, CSSPrimitiveValue::CSS_PX);169 setInlineStyleProperty(CSSPropertyHeight, padding + videoControlsHeight, CSSPrimitiveValue::CSS_PX);170 76 } 171 77 … … 189 95 , m_isMouseOverControls(false) 190 96 , m_isFullscreen(false) 191 , m_hiddenTimeDisplay(false)192 97 { 193 98 } … … 353 258 float duration = m_mediaController->duration(); 354 259 m_timeline->setDuration(duration); 260 m_timeline->show(); 355 261 356 262 m_durationDisplay->setInnerText(page->theme()->formatMediaControlsTime(duration), ASSERT_NO_EXCEPTION); 357 263 m_durationDisplay->setCurrentValue(duration); 358 264 265 m_timeline->setPosition(m_mediaController->currentTime()); 359 266 updateTimeDisplay(); 267 268 m_panelMuteButton->show(); 360 269 361 270 if (m_volumeSlider) { … … 375 284 } 376 285 377 showFullscreenButton(); 378 286 if (m_mediaController->supportsFullscreen() && m_mediaController->hasVideo()) 287 m_fullscreenButton->show(); 288 else 289 m_fullscreenButton->hide(); 379 290 makeOpaque(); 380 291 } … … 383 294 { 384 295 m_playButton->updateDisplayType(); 296 m_timeline->setPosition(m_mediaController->currentTime()); 297 m_currentTimeDisplay->show(); 298 m_durationDisplay->hide(); 385 299 updateTimeDisplay(); 386 300 … … 391 305 void MediaControlRootElementChromium::playbackProgressed() 392 306 { 307 m_timeline->setPosition(m_mediaController->currentTime()); 393 308 updateTimeDisplay(); 394 309 … … 400 315 { 401 316 m_playButton->updateDisplayType(); 317 m_timeline->setPosition(m_mediaController->currentTime()); 402 318 updateTimeDisplay(); 403 319 makeOpaque(); … … 415 331 return; 416 332 417 // After seek or playback start, hide duration display and show current time.418 if ( !m_hiddenTimeDisplay &&now > 0) {333 // After seek, hide duration display and show current time. 334 if (now > 0) { 419 335 m_currentTimeDisplay->show(); 420 336 m_durationDisplay->hide(); … … 425 341 m_currentTimeDisplay->setInnerText(page->theme()->formatMediaControlsCurrentTime(now, duration), ec); 426 342 m_currentTimeDisplay->setCurrentValue(now); 427 428 m_timeline->setPosition(m_mediaController->currentTime());429 343 } 430 344 … … 565 479 } 566 480 567 void MediaControlRootElementChromium::hideVolumeSlider()568 {569 m_volumeSlider->hide();570 }571 572 void MediaControlRootElementChromium::showTimeDisplay()573 {574 m_hiddenTimeDisplay = false;575 m_durationDisplay->show();576 updateTimeDisplay();577 }578 579 void MediaControlRootElementChromium::hideTimeDisplay()580 {581 m_hiddenTimeDisplay = true;582 m_durationDisplay->hide();583 m_currentTimeDisplay->hide();584 }585 586 void MediaControlRootElementChromium::showMuteButton()587 {588 if (!m_mediaController->hasAudio())589 return;590 591 m_panelMuteButton->show();592 }593 594 void MediaControlRootElementChromium::hideMuteButton()595 {596 m_panelMuteButton->hide();597 }598 599 void MediaControlRootElementChromium::showFullscreenButton()600 {601 if (!m_mediaController->supportsFullscreen() || !m_mediaController->hasVideo())602 return;603 604 m_fullscreenButton->show();605 }606 607 void MediaControlRootElementChromium::hideFullscreenButton()608 {609 m_fullscreenButton->hide();610 }611 612 void MediaControlRootElementChromium::showTimeline()613 {614 m_timeline->show();615 }616 617 void MediaControlRootElementChromium::hideTimeline()618 {619 m_timeline->hide();620 }621 622 481 #if ENABLE(VIDEO_TRACK) 623 482 void MediaControlRootElementChromium::createTextTrackDisplay() -
trunk/Source/WebCore/html/shadow/MediaControlRootElementChromium.h
r128075 r128235 75 75 public: 76 76 static PassRefPtr<MediaControlPanelEnclosureElement> create(Document*); 77 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;78 void updatePadding(int mediaWidth);79 77 80 78 private: … … 112 110 113 111 void showVolumeSlider(); 114 void hideVolumeSlider();115 void showTimeDisplay();116 void hideTimeDisplay();117 void showMuteButton();118 void hideMuteButton();119 void showFullscreenButton();120 void hideFullscreenButton();121 void showTimeline();122 void hideTimeline();123 124 112 void updateTimeDisplay(); 125 113 void updateStatusDisplay(); … … 172 160 bool m_isMouseOverControls; 173 161 bool m_isFullscreen; 174 bool m_hiddenTimeDisplay;175 162 }; 176 163
Note: See TracChangeset
for help on using the changeset viewer.