Changeset 76719 in webkit
- Timestamp:
- Jan 26, 2011 2:19:57 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r76717 r76719 1 2011-01-25 Dimitri Glazkov <dglazkov@chromium.org> 2 3 Reviewed by Kent Tamura. 4 5 Change HTMLInputElement-derived parts of media element shadow DOM to use shadowPseudoId. 6 https://bugs.webkit.org/show_bug.cgi?id=53122 7 8 This is the first step in converting HTMLMediaElement to the new shadow DOM. 9 10 Should not regress any existing tests. No observable change in behavior. 11 12 * css/CSSSelector.cpp: 13 (WebCore::CSSSelector::pseudoId): Removed now-unnecessary hard-coded pseudo-element selectors. 14 (WebCore::nameToPseudoTypeMap): Ditto. 15 (WebCore::CSSSelector::extractPseudoType): Ditto. 16 * css/CSSSelector.h: Ditto. 17 * css/mediaControls.css: Added proper initial values, now that elements use the proper selector pipeline. 18 * rendering/MediaControlElements.cpp: 19 (WebCore::MediaControlInputElement::MediaControlInputElement): Removed the switch statement, 20 which is now replaced with virtual shadowPseudoId on each corresponding class. 21 (WebCore::MediaControlInputElement::styleForElement): Changed to use element pipeline. 22 (WebCore::MediaControlMuteButtonElement::MediaControlMuteButtonElement): Changed to set 23 display type in constructor. 24 (WebCore::MediaControlMuteButtonElement::create): Changed to not take PseudoId as 25 constructor argument. 26 (WebCore::MediaControlMuteButtonElement::shadowPseudoId): Added. 27 (WebCore::MediaControlVolumeSliderMuteButtonElement::MediaControlVolumeSliderMuteButtonElement): Added 28 to disambiguate from the MediaControlMuteButtonElement. 29 (WebCore::MediaControlVolumeSliderMuteButtonElement::create): Added. 30 (WebCore::MediaControlVolumeSliderMuteButtonElement::shadowPseudoId): Added. 31 (WebCore::MediaControlPlayButtonElement::MediaControlPlayButtonElement): Changed to not take PseudoId as 32 constructor argument. 33 (WebCore::MediaControlPlayButtonElement::shadowPseudoId): Added. 34 (WebCore::MediaControlSeekButtonElement::MediaControlSeekButtonElement): Changed to not take PseudoId as 35 constructor argument. 36 (WebCore::MediaControlSeekForwardButtonElement::MediaControlSeekForwardButtonElement): Added. 37 (WebCore::MediaControlSeekForwardButtonElement::create): Added. 38 (WebCore::MediaControlSeekForwardButtonElement::shadowPseudoId): Added. 39 (WebCore::MediaControlSeekBackButtonElement::MediaControlSeekBackButtonElement): Added. 40 (WebCore::MediaControlSeekBackButtonElement::create): Added. 41 (WebCore::MediaControlSeekBackButtonElement::shadowPseudoId): Added. 42 (WebCore::MediaControlRewindButtonElement::MediaControlRewindButtonElement): Added. 43 (WebCore::MediaControlRewindButtonElement::shadowPseudoId): Added. 44 (WebCore::MediaControlReturnToRealtimeButtonElement::MediaControlReturnToRealtimeButtonElement): Changed to not take PseudoId as 45 constructor argument. 46 (WebCore::MediaControlReturnToRealtimeButtonElement::shadowPseudoId): Added. 47 (WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement): Changed to not take PseudoId as 48 constructor argument. 49 (WebCore::MediaControlToggleClosedCaptionsButtonElement::shadowPseudoId): Added. 50 (WebCore::MediaControlTimelineElement::MediaControlTimelineElement): Changed to not take PseudoId as 51 constructor argument. 52 (WebCore::MediaControlTimelineElement::shadowPseudoId): Added. 53 (WebCore::MediaControlVolumeSliderElement::MediaControlVolumeSliderElement): Changed to not take PseudoId as 54 constructor argument. 55 (WebCore::MediaControlVolumeSliderElement::shadowPseudoId): Added. 56 (WebCore::MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement): Changed to not take PseudoId as 57 constructor argument. 58 (WebCore::MediaControlFullscreenButtonElement::shadowPseudoId): Added. 59 * rendering/MediaControlElements.h: 60 (WebCore::MediaControlSeekForwardButtonElement::isForwardButton): Added. 61 (WebCore::MediaControlSeekBackButtonElement::isForwardButton): Added. 62 * rendering/RenderMedia.cpp: 63 (WebCore::RenderMedia::createMuteButton): Changed to use new constructor. 64 (WebCore::RenderMedia::createSeekBackButton): Ditto. 65 (WebCore::RenderMedia::createSeekForwardButton): Ditto. 66 (WebCore::RenderMedia::createVolumeSliderMuteButton): Ditto. 67 * rendering/style/RenderStyleConstants.h: Removed constants that are no longer used. 68 1 69 2011-01-26 Kenneth Russell <kbr@google.com> 2 70 -
trunk/Source/WebCore/css/CSSSelector.cpp
r76648 r76719 141 141 case PseudoMediaControlsPanel: 142 142 return MEDIA_CONTROLS_PANEL; 143 case PseudoMediaControlsMuteButton:144 return MEDIA_CONTROLS_MUTE_BUTTON;145 case PseudoMediaControlsPlayButton:146 return MEDIA_CONTROLS_PLAY_BUTTON;147 143 case PseudoMediaControlsTimelineContainer: 148 144 return MEDIA_CONTROLS_TIMELINE_CONTAINER; … … 153 149 case PseudoMediaControlsTimeRemainingDisplay: 154 150 return MEDIA_CONTROLS_TIME_REMAINING_DISPLAY; 155 case PseudoMediaControlsTimeline:156 return MEDIA_CONTROLS_TIMELINE;157 case PseudoMediaControlsVolumeSlider:158 return MEDIA_CONTROLS_VOLUME_SLIDER;159 case PseudoMediaControlsVolumeSliderMuteButton:160 return MEDIA_CONTROLS_VOLUME_SLIDER_MUTE_BUTTON;161 case PseudoMediaControlsSeekBackButton:162 return MEDIA_CONTROLS_SEEK_BACK_BUTTON;163 case PseudoMediaControlsSeekForwardButton:164 return MEDIA_CONTROLS_SEEK_FORWARD_BUTTON;165 case PseudoMediaControlsRewindButton:166 return MEDIA_CONTROLS_REWIND_BUTTON;167 case PseudoMediaControlsReturnToRealtimeButton:168 return MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON;169 case PseudoMediaControlsToggleClosedCaptions:170 return MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON;171 151 case PseudoMediaControlsStatusDisplay: 172 152 return MEDIA_CONTROLS_STATUS_DISPLAY; 173 case PseudoMediaControlsFullscreenButton:174 return MEDIA_CONTROLS_FULLSCREEN_BUTTON;175 153 case PseudoScrollbar: 176 154 return SCROLLBAR; … … 348 326 DEFINE_STATIC_LOCAL(AtomicString, lang, ("lang(")); 349 327 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsPanel, ("-webkit-media-controls-panel")); 350 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsMuteButton, ("-webkit-media-controls-mute-button"));351 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsPlayButton, ("-webkit-media-controls-play-button"));352 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsTimeline, ("-webkit-media-controls-timeline"));353 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsVolumeSlider, ("-webkit-media-controls-volume-slider"));354 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsVolumeSliderMuteButton, ("-webkit-media-controls-volume-slider-mute-button"));355 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsSeekBackButton, ("-webkit-media-controls-seek-back-button"));356 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsSeekForwardButton, ("-webkit-media-controls-seek-forward-button"));357 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsRewindButton, ("-webkit-media-controls-rewind-button"));358 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsReturnToRealtimeButton, ("-webkit-media-controls-return-to-realtime-button"));359 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsToggleClosedCaptionsButton, ("-webkit-media-controls-toggle-closed-captions-button"));360 328 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsStatusDisplay, ("-webkit-media-controls-status-display")); 361 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsFullscreenButton, ("-webkit-media-controls-fullscreen-button"));362 329 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsTimelineContainer, ("-webkit-media-controls-timeline-container")); 363 330 DEFINE_STATIC_LOCAL(AtomicString, mediaControlsVolumeSliderContainer, ("-webkit-media-controls-volume-slider-container")); … … 465 432 nameToPseudoType->set(lang.impl(), CSSSelector::PseudoLang); 466 433 nameToPseudoType->set(mediaControlsPanel.impl(), CSSSelector::PseudoMediaControlsPanel); 467 nameToPseudoType->set(mediaControlsMuteButton.impl(), CSSSelector::PseudoMediaControlsMuteButton);468 nameToPseudoType->set(mediaControlsPlayButton.impl(), CSSSelector::PseudoMediaControlsPlayButton);469 434 nameToPseudoType->set(mediaControlsCurrentTimeDisplay.impl(), CSSSelector::PseudoMediaControlsCurrentTimeDisplay); 470 435 nameToPseudoType->set(mediaControlsTimeRemainingDisplay.impl(), CSSSelector::PseudoMediaControlsTimeRemainingDisplay); 471 nameToPseudoType->set(mediaControlsTimeline.impl(), CSSSelector::PseudoMediaControlsTimeline);472 nameToPseudoType->set(mediaControlsVolumeSlider.impl(), CSSSelector::PseudoMediaControlsVolumeSlider);473 nameToPseudoType->set(mediaControlsVolumeSliderMuteButton.impl(), CSSSelector::PseudoMediaControlsVolumeSliderMuteButton);474 nameToPseudoType->set(mediaControlsSeekBackButton.impl(), CSSSelector::PseudoMediaControlsSeekBackButton);475 nameToPseudoType->set(mediaControlsSeekForwardButton.impl(), CSSSelector::PseudoMediaControlsSeekForwardButton);476 nameToPseudoType->set(mediaControlsRewindButton.impl(), CSSSelector::PseudoMediaControlsRewindButton);477 nameToPseudoType->set(mediaControlsReturnToRealtimeButton.impl(), CSSSelector::PseudoMediaControlsReturnToRealtimeButton);478 nameToPseudoType->set(mediaControlsToggleClosedCaptionsButton.impl(), CSSSelector::PseudoMediaControlsToggleClosedCaptions);479 436 nameToPseudoType->set(mediaControlsStatusDisplay.impl(), CSSSelector::PseudoMediaControlsStatusDisplay); 480 nameToPseudoType->set(mediaControlsFullscreenButton.impl(), CSSSelector::PseudoMediaControlsFullscreenButton);481 437 nameToPseudoType->set(mediaControlsTimelineContainer.impl(), CSSSelector::PseudoMediaControlsTimelineContainer); 482 438 nameToPseudoType->set(mediaControlsVolumeSliderContainer.impl(), CSSSelector::PseudoMediaControlsVolumeSliderContainer); … … 575 531 case PseudoInnerSpinButton: 576 532 case PseudoMediaControlsPanel: 577 case PseudoMediaControlsMuteButton:578 case PseudoMediaControlsPlayButton:579 533 case PseudoMediaControlsCurrentTimeDisplay: 580 534 case PseudoMediaControlsTimeRemainingDisplay: 581 case PseudoMediaControlsTimeline:582 case PseudoMediaControlsVolumeSlider:583 case PseudoMediaControlsVolumeSliderMuteButton:584 case PseudoMediaControlsSeekBackButton:585 case PseudoMediaControlsSeekForwardButton:586 case PseudoMediaControlsRewindButton:587 case PseudoMediaControlsReturnToRealtimeButton:588 case PseudoMediaControlsToggleClosedCaptions:589 535 case PseudoMediaControlsStatusDisplay: 590 case PseudoMediaControlsFullscreenButton:591 536 case PseudoMediaControlsTimelineContainer: 592 537 case PseudoMediaControlsVolumeSliderContainer: -
trunk/Source/WebCore/css/CSSSelector.h
r76648 r76719 177 177 PseudoSearchResultsButton, 178 178 PseudoMediaControlsPanel, 179 PseudoMediaControlsMuteButton,180 PseudoMediaControlsPlayButton,181 179 PseudoMediaControlsTimelineContainer, 182 180 PseudoMediaControlsVolumeSliderContainer, 183 PseudoMediaControlsVolumeSliderMuteButton,184 181 PseudoMediaControlsCurrentTimeDisplay, 185 182 PseudoMediaControlsTimeRemainingDisplay, 186 PseudoMediaControlsToggleClosedCaptions,187 PseudoMediaControlsTimeline,188 PseudoMediaControlsVolumeSlider,189 PseudoMediaControlsSeekBackButton,190 PseudoMediaControlsSeekForwardButton,191 PseudoMediaControlsRewindButton,192 PseudoMediaControlsReturnToRealtimeButton,193 183 PseudoMediaControlsStatusDisplay, 194 PseudoMediaControlsFullscreenButton,195 184 PseudoMeterHorizontalBar, 196 185 PseudoMeterVerticalBar, -
trunk/Source/WebCore/css/mediaControls.css
r62821 r76719 53 53 width: 16px; 54 54 height: 16px; 55 background-color: initial; 56 border: initial; 57 color: inherit; 55 58 } 56 59 … … 60 63 width: 16px; 61 64 height: 16px; 65 background-color: initial; 66 border: initial; 67 color: inherit; 62 68 } 63 69 … … 87 93 height: 16px; 88 94 padding: 0px 2px; 95 background-color: initial; 96 border: initial; 97 color: inherit; 98 margin: initial; 89 99 } 90 100 … … 95 105 audio::-webkit-media-controls-volume-slider, video::-webkit-media-controls-volume-slider { 96 106 display: none; 107 background-color: initial; 108 border: initial; 109 color: inherit; 110 margin: initial; 97 111 } 98 112 … … 102 116 width: 16px; 103 117 height: 16px; 118 background-color: initial; 119 border: initial; 120 color: inherit; 104 121 } 105 122 … … 109 126 width: 16px; 110 127 height: 16px; 128 background-color: initial; 129 border: initial; 130 color: inherit; 111 131 } 112 132 … … 116 136 width: 16px; 117 137 height: 16px; 138 background-color: initial; 139 border: initial; 140 color: inherit; 118 141 } 119 142 120 143 audio::-webkit-media-controls-rewind-button, video::-webkit-media-controls-rewind-button { 121 144 display: none; 145 background-color: initial; 146 border: initial; 147 color: inherit; 122 148 } 123 149 124 150 audio::-webkit-media-controls-return-to-realtime-button, video::-webkit-media-controls-return-to-realtime-button { 125 151 display: none; 152 background-color: initial; 153 border: initial; 154 color: inherit; 126 155 } 127 156 … … 131 160 width: 16px; 132 161 height: 16px; 162 background-color: initial; 163 border: initial; 164 color: inherit; 133 165 } 134 166 … … 136 168 -webkit-appearance: media-volume-slider-mute-button; 137 169 display: none; 170 background-color: initial; 171 border: initial; 172 color: inherit; 138 173 } -
trunk/Source/WebCore/rendering/MediaControlElements.cpp
r76664 r76719 33 33 #include "MediaControlElements.h" 34 34 35 #include "CSSStyleSelector.h" 35 36 #include "EventNames.h" 36 37 #include "FloatConversion.h" … … 353 354 // ---------------------------- 354 355 355 MediaControlInputElement::MediaControlInputElement(HTMLMediaElement* mediaElement, PseudoId pseudo)356 MediaControlInputElement::MediaControlInputElement(HTMLMediaElement* mediaElement, MediaControlElementType displayType) 356 357 : HTMLInputElement(inputTag, mediaElement->document(), 0, false) 357 358 , m_mediaElement(mediaElement) 358 , m_pseudoStyleId(pseudo) 359 { 360 setInDocument(); 361 362 switch (pseudo) { 363 case MEDIA_CONTROLS_MUTE_BUTTON: 364 m_displayType = MediaMuteButton; 365 break; 366 case MEDIA_CONTROLS_PLAY_BUTTON: 367 m_displayType = MediaPlayButton; 368 break; 369 case MEDIA_CONTROLS_SEEK_FORWARD_BUTTON: 370 m_displayType = MediaSeekForwardButton; 371 break; 372 case MEDIA_CONTROLS_SEEK_BACK_BUTTON: 373 m_displayType = MediaSeekBackButton; 374 break; 375 case MEDIA_CONTROLS_FULLSCREEN_BUTTON: 376 m_displayType = MediaFullscreenButton; 377 break; 378 case MEDIA_CONTROLS_TIMELINE: 379 m_displayType = MediaSlider; 380 break; 381 case MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON: 382 m_displayType = MediaReturnToRealtimeButton; 383 break; 384 case MEDIA_CONTROLS_REWIND_BUTTON: 385 m_displayType = MediaRewindButton; 386 break; 387 case MEDIA_CONTROLS_VOLUME_SLIDER: 388 m_displayType = MediaVolumeSlider; 389 break; 390 case MEDIA_CONTROLS_VOLUME_SLIDER_MUTE_BUTTON: 391 m_displayType = MediaVolumeSliderMuteButton; 392 break; 393 case MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON: 394 m_displayType = MediaShowClosedCaptionsButton; 395 break; 396 default: 397 ASSERT_NOT_REACHED(); 398 break; 399 } 359 , m_displayType(displayType) 360 { 400 361 } 401 362 … … 417 378 PassRefPtr<RenderStyle> MediaControlInputElement::styleForElement() 418 379 { 419 return mediaElement()->renderer()->getCachedPseudoStyle(m_pseudoStyleId);380 return document()->styleSelector()->styleForElement(this, 0, true); 420 381 } 421 382 … … 482 443 shadowNode->recalcStyle(Node::Force); 483 444 } 484 445 485 446 bool MediaControlInputElement::hitTest(const IntPoint& absPoint) 486 447 { … … 503 464 // ---------------------------- 504 465 505 inline MediaControlMuteButtonElement::MediaControlMuteButtonElement(HTMLMediaElement* mediaElement, ButtonLocation location)506 : MediaControlInputElement(mediaElement, location == Controller ? MEDIA_CONTROLS_MUTE_BUTTON : MEDIA_CONTROLS_VOLUME_SLIDER_MUTE_BUTTON)507 { 508 } 509 510 PassRefPtr<MediaControlMuteButtonElement> MediaControlMuteButtonElement::create(HTMLMediaElement* mediaElement , ButtonLocation location)511 { 512 RefPtr<MediaControlMuteButtonElement> button = adoptRef(new MediaControlMuteButtonElement(mediaElement, location));466 inline MediaControlMuteButtonElement::MediaControlMuteButtonElement(HTMLMediaElement* mediaElement, MediaControlElementType displayType) 467 : MediaControlInputElement(mediaElement, displayType) 468 { 469 } 470 471 PassRefPtr<MediaControlMuteButtonElement> MediaControlMuteButtonElement::create(HTMLMediaElement* mediaElement) 472 { 473 RefPtr<MediaControlMuteButtonElement> button = adoptRef(new MediaControlMuteButtonElement(mediaElement, MediaMuteButton)); 513 474 button->setType("button"); 514 475 return button.release(); … … 524 485 } 525 486 487 AtomicString MediaControlMuteButtonElement::shadowPseudoId() const 488 { 489 DEFINE_STATIC_LOCAL(AtomicString, muteButton, ("-webkit-media-controls-mute-button")); 490 return muteButton; 491 } 492 526 493 void MediaControlMuteButtonElement::updateDisplayType() 527 494 { … … 529 496 } 530 497 498 inline MediaControlVolumeSliderMuteButtonElement::MediaControlVolumeSliderMuteButtonElement(HTMLMediaElement* mediaElement) 499 : MediaControlMuteButtonElement(mediaElement, MediaVolumeSliderMuteButton) 500 { 501 } 502 503 PassRefPtr<MediaControlVolumeSliderMuteButtonElement> MediaControlVolumeSliderMuteButtonElement::create(HTMLMediaElement* mediaElement) 504 { 505 RefPtr<MediaControlVolumeSliderMuteButtonElement> button = adoptRef(new MediaControlVolumeSliderMuteButtonElement(mediaElement)); 506 button->setType("button"); 507 return button.release(); 508 } 509 510 AtomicString MediaControlVolumeSliderMuteButtonElement::shadowPseudoId() const 511 { 512 DEFINE_STATIC_LOCAL(AtomicString, muteButton, ("-webkit-media-controls-volume-slider-mute-button")); 513 return muteButton; 514 } 515 531 516 // ---------------------------- 532 517 533 518 inline MediaControlPlayButtonElement::MediaControlPlayButtonElement(HTMLMediaElement* mediaElement) 534 : MediaControlInputElement(mediaElement, M EDIA_CONTROLS_PLAY_BUTTON)519 : MediaControlInputElement(mediaElement, MediaPlayButton) 535 520 { 536 521 } … … 557 542 } 558 543 559 // ---------------------------- 560 561 inline MediaControlSeekButtonElement::MediaControlSeekButtonElement(HTMLMediaElement* mediaElement, PseudoId pseudoId) 562 : MediaControlInputElement(mediaElement, pseudoId) 544 AtomicString MediaControlPlayButtonElement::shadowPseudoId() const 545 { 546 DEFINE_STATIC_LOCAL(AtomicString, playButton, ("-webkit-media-controls-play-button")); 547 return playButton; 548 } 549 550 // ---------------------------- 551 552 inline MediaControlSeekButtonElement::MediaControlSeekButtonElement(HTMLMediaElement* mediaElement, MediaControlElementType displayType) 553 : MediaControlInputElement(mediaElement, displayType) 563 554 , m_seeking(false) 564 555 , m_capturing(false) 565 556 , m_seekTimer(this, &MediaControlSeekButtonElement::seekTimerFired) 566 557 { 567 }568 569 PassRefPtr<MediaControlSeekButtonElement> MediaControlSeekButtonElement::create(HTMLMediaElement* mediaElement, PseudoId pseudoStyleId)570 {571 RefPtr<MediaControlSeekButtonElement> button = adoptRef(new MediaControlSeekButtonElement(mediaElement, pseudoStyleId));572 button->setType("button");573 return button.release();574 }575 576 inline bool MediaControlSeekButtonElement::isForwardButton() const577 {578 return pseudoStyleId() == MEDIA_CONTROLS_SEEK_FORWARD_BUTTON;579 558 } 580 559 … … 628 607 // ---------------------------- 629 608 609 inline MediaControlSeekForwardButtonElement::MediaControlSeekForwardButtonElement(HTMLMediaElement* mediaElement) 610 : MediaControlSeekButtonElement(mediaElement, MediaSeekForwardButton) 611 { 612 } 613 614 PassRefPtr<MediaControlSeekForwardButtonElement> MediaControlSeekForwardButtonElement::create(HTMLMediaElement* mediaElement) 615 { 616 RefPtr<MediaControlSeekForwardButtonElement> button = adoptRef(new MediaControlSeekForwardButtonElement(mediaElement)); 617 button->setType("button"); 618 return button.release(); 619 } 620 621 AtomicString MediaControlSeekForwardButtonElement::shadowPseudoId() const 622 { 623 DEFINE_STATIC_LOCAL(AtomicString, seekForwardButton, ("-webkit-media-controls-seek-forward-button")); 624 return seekForwardButton; 625 } 626 627 // ---------------------------- 628 629 inline MediaControlSeekBackButtonElement::MediaControlSeekBackButtonElement(HTMLMediaElement* mediaElement) 630 : MediaControlSeekButtonElement(mediaElement, MediaSeekBackButton) 631 { 632 } 633 634 PassRefPtr<MediaControlSeekBackButtonElement> MediaControlSeekBackButtonElement::create(HTMLMediaElement* mediaElement) 635 { 636 RefPtr<MediaControlSeekBackButtonElement> button = adoptRef(new MediaControlSeekBackButtonElement(mediaElement)); 637 button->setType("button"); 638 return button.release(); 639 } 640 641 AtomicString MediaControlSeekBackButtonElement::shadowPseudoId() const 642 { 643 DEFINE_STATIC_LOCAL(AtomicString, seekBackButton, ("-webkit-media-controls-seek-back-button")); 644 return seekBackButton; 645 } 646 647 // ---------------------------- 648 630 649 inline MediaControlRewindButtonElement::MediaControlRewindButtonElement(HTMLMediaElement* element) 631 : MediaControlInputElement(element, M EDIA_CONTROLS_REWIND_BUTTON)650 : MediaControlInputElement(element, MediaRewindButton) 632 651 { 633 652 } … … 649 668 } 650 669 670 AtomicString MediaControlRewindButtonElement::shadowPseudoId() const 671 { 672 DEFINE_STATIC_LOCAL(AtomicString, rewindButton, ("-webkit-media-controls-rewind-button")); 673 return rewindButton; 674 } 675 651 676 // ---------------------------- 652 677 653 678 inline MediaControlReturnToRealtimeButtonElement::MediaControlReturnToRealtimeButtonElement(HTMLMediaElement* mediaElement) 654 : MediaControlInputElement(mediaElement, M EDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON)679 : MediaControlInputElement(mediaElement, MediaReturnToRealtimeButton) 655 680 { 656 681 } … … 672 697 } 673 698 699 AtomicString MediaControlReturnToRealtimeButtonElement::shadowPseudoId() const 700 { 701 DEFINE_STATIC_LOCAL(AtomicString, returnToRealtimeButton, ("-webkit-media-controls-return-to-realtime-button")); 702 return returnToRealtimeButton; 703 } 674 704 675 705 // ---------------------------- 676 706 677 707 inline MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement(HTMLMediaElement* mediaElement) 678 : MediaControlInputElement(mediaElement, M EDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON)708 : MediaControlInputElement(mediaElement, MediaShowClosedCaptionsButton) 679 709 { 680 710 } … … 702 732 } 703 733 734 AtomicString MediaControlToggleClosedCaptionsButtonElement::shadowPseudoId() const 735 { 736 DEFINE_STATIC_LOCAL(AtomicString, closedCaptionsButton, ("-webkit-media-controls-toggle-closed-captions-button")); 737 return closedCaptionsButton; 738 } 739 704 740 // ---------------------------- 705 741 706 742 MediaControlTimelineElement::MediaControlTimelineElement(HTMLMediaElement* mediaElement) 707 : MediaControlInputElement(mediaElement, M EDIA_CONTROLS_TIMELINE)743 : MediaControlInputElement(mediaElement, MediaSlider) 708 744 { 709 745 } … … 757 793 } 758 794 795 AtomicString MediaControlTimelineElement::shadowPseudoId() const 796 { 797 DEFINE_STATIC_LOCAL(AtomicString, timelineSlider, ("-webkit-media-controls-timeline")); 798 return timelineSlider; 799 } 800 759 801 // ---------------------------- 760 802 761 803 inline MediaControlVolumeSliderElement::MediaControlVolumeSliderElement(HTMLMediaElement* mediaElement) 762 : MediaControlInputElement(mediaElement, M EDIA_CONTROLS_VOLUME_SLIDER)804 : MediaControlInputElement(mediaElement, MediaVolumeSlider) 763 805 { 764 806 } … … 801 843 } 802 844 845 AtomicString MediaControlVolumeSliderElement::shadowPseudoId() const 846 { 847 DEFINE_STATIC_LOCAL(AtomicString, volumeSlider, ("-webkit-media-controls-volume-slider")); 848 return volumeSlider; 849 } 850 803 851 // ---------------------------- 804 852 805 853 inline MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(HTMLMediaElement* mediaElement) 806 : MediaControlInputElement(mediaElement, M EDIA_CONTROLS_FULLSCREEN_BUTTON)854 : MediaControlInputElement(mediaElement, MediaFullscreenButton) 807 855 { 808 856 } … … 837 885 } 838 886 887 AtomicString MediaControlFullscreenButtonElement::shadowPseudoId() const 888 { 889 DEFINE_STATIC_LOCAL(AtomicString, fullscreenButton, ("-webkit-media-controls-fullscreen-button")); 890 return fullscreenButton; 891 } 892 839 893 // ---------------------------- 840 894 -
trunk/Source/WebCore/rendering/MediaControlElements.h
r73618 r76719 175 175 176 176 protected: 177 MediaControlInputElement(HTMLMediaElement*, PseudoId);177 MediaControlInputElement(HTMLMediaElement*, MediaControlElementType); 178 178 179 179 void setDisplayType(MediaControlElementType); 180 181 PseudoId pseudoStyleId() const { return m_pseudoStyleId; }182 180 183 181 private: … … 191 189 virtual void updateDisplayType() { } 192 190 193 HTMLMediaElement* m_mediaElement; 194 PseudoId m_pseudoStyleId; 191 HTMLMediaElement* m_mediaElement; 195 192 MediaControlElementType m_displayType; 196 193 }; … … 200 197 class MediaControlMuteButtonElement : public MediaControlInputElement { 201 198 public: 202 enum ButtonLocation { Controller, VolumeSlider };203 static PassRefPtr<MediaControlMuteButtonElement> create(HTMLMediaElement*, ButtonLocation); 204 205 virtual void defaultEventHandler(Event*); 206 207 private: 208 MediaControlMuteButtonElement(HTMLMediaElement*, ButtonLocation); 209 199 static PassRefPtr<MediaControlMuteButtonElement> create(HTMLMediaElement*); 200 201 virtual void defaultEventHandler(Event*); 202 203 protected: 204 MediaControlMuteButtonElement(HTMLMediaElement*, MediaControlElementType); 205 206 private: 210 207 virtual void updateDisplayType(); 211 }; 208 virtual AtomicString shadowPseudoId() const; 209 }; 210 211 // ---------------------------- 212 213 class MediaControlVolumeSliderMuteButtonElement : public MediaControlMuteButtonElement { 214 public: 215 static PassRefPtr<MediaControlVolumeSliderMuteButtonElement> create(HTMLMediaElement*); 216 217 private: 218 MediaControlVolumeSliderMuteButtonElement(HTMLMediaElement*); 219 220 virtual AtomicString shadowPseudoId() const; 221 }; 222 212 223 213 224 // ---------------------------- … … 223 234 224 235 virtual void updateDisplayType(); 236 virtual AtomicString shadowPseudoId() const; 225 237 }; 226 238 … … 229 241 class MediaControlSeekButtonElement : public MediaControlInputElement { 230 242 public: 231 static PassRefPtr<MediaControlSeekButtonElement> create(HTMLMediaElement*, PseudoId); 232 233 virtual void defaultEventHandler(Event*); 234 235 private: 236 MediaControlSeekButtonElement(HTMLMediaElement*, PseudoId); 237 238 bool isForwardButton() const; 243 virtual void defaultEventHandler(Event*); 244 245 protected: 246 MediaControlSeekButtonElement(HTMLMediaElement*, MediaControlElementType); 247 248 private: 249 virtual bool isForwardButton() const = 0; 239 250 240 251 virtual void detach(); … … 245 256 Timer<MediaControlSeekButtonElement> m_seekTimer; 246 257 }; 247 258 259 // ---------------------------- 260 261 class MediaControlSeekForwardButtonElement : public MediaControlSeekButtonElement { 262 public: 263 static PassRefPtr<MediaControlSeekForwardButtonElement> create(HTMLMediaElement*); 264 265 private: 266 MediaControlSeekForwardButtonElement(HTMLMediaElement*); 267 268 virtual bool isForwardButton() const { return true; } 269 virtual AtomicString shadowPseudoId() const; 270 }; 271 272 // ---------------------------- 273 274 class MediaControlSeekBackButtonElement : public MediaControlSeekButtonElement { 275 public: 276 static PassRefPtr<MediaControlSeekBackButtonElement> create(HTMLMediaElement*); 277 278 private: 279 MediaControlSeekBackButtonElement(HTMLMediaElement*); 280 281 virtual bool isForwardButton() const { return false; } 282 virtual AtomicString shadowPseudoId() const; 283 }; 284 248 285 // ---------------------------- 249 286 … … 256 293 private: 257 294 MediaControlRewindButtonElement(HTMLMediaElement*); 295 296 virtual AtomicString shadowPseudoId() const; 258 297 }; 259 298 … … 268 307 private: 269 308 MediaControlReturnToRealtimeButtonElement(HTMLMediaElement*); 309 310 virtual AtomicString shadowPseudoId() const; 270 311 }; 271 312 … … 282 323 283 324 virtual void updateDisplayType(); 325 virtual AtomicString shadowPseudoId() const; 284 326 }; 285 327 … … 295 337 private: 296 338 MediaControlTimelineElement(HTMLMediaElement*); 339 340 virtual AtomicString shadowPseudoId() const; 297 341 }; 298 342 … … 308 352 private: 309 353 MediaControlVolumeSliderElement(HTMLMediaElement*); 354 355 virtual AtomicString shadowPseudoId() const; 310 356 }; 311 357 … … 320 366 private: 321 367 MediaControlFullscreenButtonElement(HTMLMediaElement*); 368 369 virtual AtomicString shadowPseudoId() const; 322 370 }; 323 371 -
trunk/Source/WebCore/rendering/RenderMedia.cpp
r73385 r76719 191 191 { 192 192 ASSERT(!m_muteButton); 193 m_muteButton = MediaControlMuteButtonElement::create(mediaElement() , MediaControlMuteButtonElement::Controller);193 m_muteButton = MediaControlMuteButtonElement::create(mediaElement()); 194 194 m_muteButton->attachToParent(m_panel.get()); 195 195 } … … 205 205 { 206 206 ASSERT(!m_seekBackButton); 207 m_seekBackButton = MediaControlSeekB uttonElement::create(mediaElement(), MEDIA_CONTROLS_SEEK_BACK_BUTTON);207 m_seekBackButton = MediaControlSeekBackButtonElement::create(mediaElement()); 208 208 m_seekBackButton->attachToParent(m_panel.get()); 209 209 } … … 212 212 { 213 213 ASSERT(!m_seekForwardButton); 214 m_seekForwardButton = MediaControlSeek ButtonElement::create(mediaElement(), MEDIA_CONTROLS_SEEK_FORWARD_BUTTON);214 m_seekForwardButton = MediaControlSeekForwardButtonElement::create(mediaElement()); 215 215 m_seekForwardButton->attachToParent(m_panel.get()); 216 216 } … … 279 279 { 280 280 ASSERT(!m_volumeSliderMuteButton); 281 m_volumeSliderMuteButton = MediaControl MuteButtonElement::create(mediaElement(), MediaControlMuteButtonElement::VolumeSlider);281 m_volumeSliderMuteButton = MediaControlVolumeSliderMuteButtonElement::create(mediaElement()); 282 282 m_volumeSliderMuteButton->attachToParent(m_volumeSliderContainer.get()); 283 283 -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r75543 r76719 70 70 NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR, FILE_UPLOAD_BUTTON, INPUT_PLACEHOLDER, 71 71 SEARCH_CANCEL_BUTTON, SEARCH_DECORATION, SEARCH_RESULTS_DECORATION, SEARCH_RESULTS_BUTTON, MEDIA_CONTROLS_PANEL, 72 MEDIA_CONTROLS_PLAY_BUTTON, MEDIA_CONTROLS_MUTE_BUTTON, MEDIA_CONTROLS_TIMELINE, MEDIA_CONTROLS_TIMELINE_CONTAINER, 73 MEDIA_CONTROLS_VOLUME_SLIDER, MEDIA_CONTROLS_VOLUME_SLIDER_CONTAINER, MEDIA_CONTROLS_VOLUME_SLIDER_MUTE_BUTTON, 74 MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, MEDIA_CONTROLS_TIME_REMAINING_DISPLAY, 75 MEDIA_CONTROLS_SEEK_BACK_BUTTON, MEDIA_CONTROLS_SEEK_FORWARD_BUTTON, MEDIA_CONTROLS_FULLSCREEN_BUTTON, MEDIA_CONTROLS_REWIND_BUTTON, 76 MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON, MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON, 72 MEDIA_CONTROLS_TIMELINE_CONTAINER, MEDIA_CONTROLS_VOLUME_SLIDER_CONTAINER, MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, MEDIA_CONTROLS_TIME_REMAINING_DISPLAY, 77 73 MEDIA_CONTROLS_STATUS_DISPLAY, SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER, 78 74 INPUT_LIST_BUTTON, INPUT_SPEECH_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON, VISITED_LINK, PROGRESS_BAR_VALUE,
Note: See TracChangeset
for help on using the changeset viewer.