Changeset 76951 in webkit
- Timestamp:
- Jan 28, 2011 9:52:58 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r76950 r76951 1 2011-01-27 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-27 Dimitri Glazkov <dglazkov@chromium.org> 2 70 -
trunk/Source/WebCore/css/CSSSelector.cpp
r76724 r76951 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
r76724 r76951 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
r76724 r76951 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/css/mediaControlsChromium.css
r74535 r76951 158 158 padding: 0px; 159 159 margin: 0px 6px; 160 height: 1 6px;160 height: 18px; 161 161 162 162 border-color: rgba(255, 255, 255, 0.2); -
trunk/Source/WebCore/html/shadow/MediaControls.cpp
r76950 r76951 247 247 { 248 248 ASSERT(!m_muteButton); 249 m_muteButton = MediaControlMuteButtonElement::create(m_mediaElement , MediaControlMuteButtonElement::Controller);249 m_muteButton = MediaControlMuteButtonElement::create(m_mediaElement); 250 250 m_muteButton->attachToParent(m_panel.get()); 251 251 } … … 261 261 { 262 262 ASSERT(!m_seekBackButton); 263 m_seekBackButton = MediaControlSeekB uttonElement::create(m_mediaElement, MEDIA_CONTROLS_SEEK_BACK_BUTTON);263 m_seekBackButton = MediaControlSeekBackButtonElement::create(m_mediaElement); 264 264 m_seekBackButton->attachToParent(m_panel.get()); 265 265 } … … 268 268 { 269 269 ASSERT(!m_seekForwardButton); 270 m_seekForwardButton = MediaControlSeek ButtonElement::create(m_mediaElement, MEDIA_CONTROLS_SEEK_FORWARD_BUTTON);270 m_seekForwardButton = MediaControlSeekForwardButtonElement::create(m_mediaElement); 271 271 m_seekForwardButton->attachToParent(m_panel.get()); 272 272 } … … 335 335 { 336 336 ASSERT(!m_volumeSliderMuteButton); 337 m_volumeSliderMuteButton = MediaControl MuteButtonElement::create(m_mediaElement, MediaControlMuteButtonElement::VolumeSlider);337 m_volumeSliderMuteButton = MediaControlVolumeSliderMuteButtonElement::create(m_mediaElement); 338 338 m_volumeSliderMuteButton->attachToParent(m_volumeSliderContainer.get()); 339 339 } -
trunk/Source/WebCore/rendering/MediaControlElements.cpp
r76950 r76951 33 33 #include "MediaControlElements.h" 34 34 35 #include "CSSStyleSelector.h" 35 36 #include "EventNames.h" 36 37 #include "FloatConversion.h" … … 354 355 // ---------------------------- 355 356 356 MediaControlInputElement::MediaControlInputElement(HTMLMediaElement* mediaElement, PseudoId pseudo)357 MediaControlInputElement::MediaControlInputElement(HTMLMediaElement* mediaElement, MediaControlElementType displayType) 357 358 : HTMLInputElement(inputTag, mediaElement->document(), 0, false) 358 359 , m_mediaElement(mediaElement) 359 , m_pseudoStyleId(pseudo) 360 { 361 setInDocument(); 362 363 switch (pseudo) { 364 case MEDIA_CONTROLS_MUTE_BUTTON: 365 m_displayType = MediaMuteButton; 366 break; 367 case MEDIA_CONTROLS_PLAY_BUTTON: 368 m_displayType = MediaPlayButton; 369 break; 370 case MEDIA_CONTROLS_SEEK_FORWARD_BUTTON: 371 m_displayType = MediaSeekForwardButton; 372 break; 373 case MEDIA_CONTROLS_SEEK_BACK_BUTTON: 374 m_displayType = MediaSeekBackButton; 375 break; 376 case MEDIA_CONTROLS_FULLSCREEN_BUTTON: 377 m_displayType = MediaFullscreenButton; 378 break; 379 case MEDIA_CONTROLS_TIMELINE: 380 m_displayType = MediaSlider; 381 break; 382 case MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON: 383 m_displayType = MediaReturnToRealtimeButton; 384 break; 385 case MEDIA_CONTROLS_REWIND_BUTTON: 386 m_displayType = MediaRewindButton; 387 break; 388 case MEDIA_CONTROLS_VOLUME_SLIDER: 389 m_displayType = MediaVolumeSlider; 390 break; 391 case MEDIA_CONTROLS_VOLUME_SLIDER_MUTE_BUTTON: 392 m_displayType = MediaVolumeSliderMuteButton; 393 break; 394 case MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON: 395 m_displayType = MediaShowClosedCaptionsButton; 396 break; 397 default: 398 ASSERT_NOT_REACHED(); 399 break; 400 } 360 , m_displayType(displayType) 361 { 401 362 } 402 363 … … 418 379 PassRefPtr<RenderStyle> MediaControlInputElement::styleForElement() 419 380 { 420 return mediaElement()->renderer()->getCachedPseudoStyle(m_pseudoStyleId);381 return document()->styleSelector()->styleForElement(this, 0, true); 421 382 } 422 383 … … 483 444 shadowNode->recalcStyle(Node::Force); 484 445 } 485 446 486 447 bool MediaControlInputElement::hitTest(const IntPoint& absPoint) 487 448 { … … 504 465 // ---------------------------- 505 466 506 inline MediaControlMuteButtonElement::MediaControlMuteButtonElement(HTMLMediaElement* mediaElement, ButtonLocation location)507 : MediaControlInputElement(mediaElement, location == Controller ? MEDIA_CONTROLS_MUTE_BUTTON : MEDIA_CONTROLS_VOLUME_SLIDER_MUTE_BUTTON)508 { 509 } 510 511 PassRefPtr<MediaControlMuteButtonElement> MediaControlMuteButtonElement::create(HTMLMediaElement* mediaElement , ButtonLocation location)512 { 513 RefPtr<MediaControlMuteButtonElement> button = adoptRef(new MediaControlMuteButtonElement(mediaElement, location));467 inline MediaControlMuteButtonElement::MediaControlMuteButtonElement(HTMLMediaElement* mediaElement, MediaControlElementType displayType) 468 : MediaControlInputElement(mediaElement, displayType) 469 { 470 } 471 472 PassRefPtr<MediaControlMuteButtonElement> MediaControlMuteButtonElement::create(HTMLMediaElement* mediaElement) 473 { 474 RefPtr<MediaControlMuteButtonElement> button = adoptRef(new MediaControlMuteButtonElement(mediaElement, MediaMuteButton)); 514 475 button->setType("button"); 515 476 return button.release(); … … 525 486 } 526 487 488 const AtomicString& MediaControlMuteButtonElement::shadowPseudoId() const 489 { 490 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-mute-button")); 491 return id; 492 } 493 527 494 void MediaControlMuteButtonElement::updateDisplayType() 528 495 { … … 530 497 } 531 498 499 inline MediaControlVolumeSliderMuteButtonElement::MediaControlVolumeSliderMuteButtonElement(HTMLMediaElement* mediaElement) 500 : MediaControlMuteButtonElement(mediaElement, MediaVolumeSliderMuteButton) 501 { 502 } 503 504 PassRefPtr<MediaControlVolumeSliderMuteButtonElement> MediaControlVolumeSliderMuteButtonElement::create(HTMLMediaElement* mediaElement) 505 { 506 RefPtr<MediaControlVolumeSliderMuteButtonElement> button = adoptRef(new MediaControlVolumeSliderMuteButtonElement(mediaElement)); 507 button->setType("button"); 508 return button.release(); 509 } 510 511 const AtomicString& MediaControlVolumeSliderMuteButtonElement::shadowPseudoId() const 512 { 513 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-volume-slider-mute-button")); 514 return id; 515 } 516 532 517 // ---------------------------- 533 518 534 519 inline MediaControlPlayButtonElement::MediaControlPlayButtonElement(HTMLMediaElement* mediaElement) 535 : MediaControlInputElement(mediaElement, M EDIA_CONTROLS_PLAY_BUTTON)520 : MediaControlInputElement(mediaElement, MediaPlayButton) 536 521 { 537 522 } … … 558 543 } 559 544 560 // ---------------------------- 561 562 inline MediaControlSeekButtonElement::MediaControlSeekButtonElement(HTMLMediaElement* mediaElement, PseudoId pseudoId) 563 : MediaControlInputElement(mediaElement, pseudoId) 545 const AtomicString& MediaControlPlayButtonElement::shadowPseudoId() const 546 { 547 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-play-button")); 548 return id; 549 } 550 551 // ---------------------------- 552 553 inline MediaControlSeekButtonElement::MediaControlSeekButtonElement(HTMLMediaElement* mediaElement, MediaControlElementType displayType) 554 : MediaControlInputElement(mediaElement, displayType) 564 555 , m_seeking(false) 565 556 , m_capturing(false) 566 557 , m_seekTimer(this, &MediaControlSeekButtonElement::seekTimerFired) 567 558 { 568 }569 570 PassRefPtr<MediaControlSeekButtonElement> MediaControlSeekButtonElement::create(HTMLMediaElement* mediaElement, PseudoId pseudoStyleId)571 {572 RefPtr<MediaControlSeekButtonElement> button = adoptRef(new MediaControlSeekButtonElement(mediaElement, pseudoStyleId));573 button->setType("button");574 return button.release();575 }576 577 inline bool MediaControlSeekButtonElement::isForwardButton() const578 {579 return pseudoStyleId() == MEDIA_CONTROLS_SEEK_FORWARD_BUTTON;580 559 } 581 560 … … 629 608 // ---------------------------- 630 609 610 inline MediaControlSeekForwardButtonElement::MediaControlSeekForwardButtonElement(HTMLMediaElement* mediaElement) 611 : MediaControlSeekButtonElement(mediaElement, MediaSeekForwardButton) 612 { 613 } 614 615 PassRefPtr<MediaControlSeekForwardButtonElement> MediaControlSeekForwardButtonElement::create(HTMLMediaElement* mediaElement) 616 { 617 RefPtr<MediaControlSeekForwardButtonElement> button = adoptRef(new MediaControlSeekForwardButtonElement(mediaElement)); 618 button->setType("button"); 619 return button.release(); 620 } 621 622 const AtomicString& MediaControlSeekForwardButtonElement::shadowPseudoId() const 623 { 624 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-seek-forward-button")); 625 return id; 626 } 627 628 // ---------------------------- 629 630 inline MediaControlSeekBackButtonElement::MediaControlSeekBackButtonElement(HTMLMediaElement* mediaElement) 631 : MediaControlSeekButtonElement(mediaElement, MediaSeekBackButton) 632 { 633 } 634 635 PassRefPtr<MediaControlSeekBackButtonElement> MediaControlSeekBackButtonElement::create(HTMLMediaElement* mediaElement) 636 { 637 RefPtr<MediaControlSeekBackButtonElement> button = adoptRef(new MediaControlSeekBackButtonElement(mediaElement)); 638 button->setType("button"); 639 return button.release(); 640 } 641 642 const AtomicString& MediaControlSeekBackButtonElement::shadowPseudoId() const 643 { 644 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-seek-back-button")); 645 return id; 646 } 647 648 // ---------------------------- 649 631 650 inline MediaControlRewindButtonElement::MediaControlRewindButtonElement(HTMLMediaElement* element) 632 : MediaControlInputElement(element, M EDIA_CONTROLS_REWIND_BUTTON)651 : MediaControlInputElement(element, MediaRewindButton) 633 652 { 634 653 } … … 650 669 } 651 670 671 const AtomicString& MediaControlRewindButtonElement::shadowPseudoId() const 672 { 673 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-rewind-button")); 674 return id; 675 } 676 652 677 // ---------------------------- 653 678 654 679 inline MediaControlReturnToRealtimeButtonElement::MediaControlReturnToRealtimeButtonElement(HTMLMediaElement* mediaElement) 655 : MediaControlInputElement(mediaElement, M EDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON)680 : MediaControlInputElement(mediaElement, MediaReturnToRealtimeButton) 656 681 { 657 682 } … … 673 698 } 674 699 700 const AtomicString& MediaControlReturnToRealtimeButtonElement::shadowPseudoId() const 701 { 702 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-return-to-realtime-button")); 703 return id; 704 } 675 705 676 706 // ---------------------------- 677 707 678 708 inline MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement(HTMLMediaElement* mediaElement) 679 : MediaControlInputElement(mediaElement, M EDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON)709 : MediaControlInputElement(mediaElement, MediaShowClosedCaptionsButton) 680 710 { 681 711 } … … 703 733 } 704 734 735 const AtomicString& MediaControlToggleClosedCaptionsButtonElement::shadowPseudoId() const 736 { 737 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-toggle-closed-captions-button")); 738 return id; 739 } 740 705 741 // ---------------------------- 706 742 707 743 MediaControlTimelineElement::MediaControlTimelineElement(HTMLMediaElement* mediaElement) 708 : MediaControlInputElement(mediaElement, M EDIA_CONTROLS_TIMELINE)744 : MediaControlInputElement(mediaElement, MediaSlider) 709 745 { 710 746 } … … 758 794 } 759 795 796 const AtomicString& MediaControlTimelineElement::shadowPseudoId() const 797 { 798 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-timeline")); 799 return id; 800 } 801 760 802 // ---------------------------- 761 803 762 804 inline MediaControlVolumeSliderElement::MediaControlVolumeSliderElement(HTMLMediaElement* mediaElement) 763 : MediaControlInputElement(mediaElement, M EDIA_CONTROLS_VOLUME_SLIDER)805 : MediaControlInputElement(mediaElement, MediaVolumeSlider) 764 806 { 765 807 } … … 802 844 } 803 845 846 const AtomicString& MediaControlVolumeSliderElement::shadowPseudoId() const 847 { 848 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-volume-slider")); 849 return id; 850 } 851 804 852 // ---------------------------- 805 853 806 854 inline MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(HTMLMediaElement* mediaElement) 807 : MediaControlInputElement(mediaElement, M EDIA_CONTROLS_FULLSCREEN_BUTTON)855 : MediaControlInputElement(mediaElement, MediaFullscreenButton) 808 856 { 809 857 } … … 838 886 } 839 887 888 const AtomicString& MediaControlFullscreenButtonElement::shadowPseudoId() const 889 { 890 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-fullscreen-button")); 891 return id; 892 } 893 840 894 // ---------------------------- 841 895 -
trunk/Source/WebCore/rendering/MediaControlElements.h
r76724 r76951 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 const 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 const AtomicString& shadowPseudoId() const; 221 }; 222 212 223 213 224 // ---------------------------- … … 223 234 224 235 virtual void updateDisplayType(); 236 virtual const 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 const 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 const AtomicString& shadowPseudoId() const; 283 }; 284 248 285 // ---------------------------- 249 286 … … 256 293 private: 257 294 MediaControlRewindButtonElement(HTMLMediaElement*); 295 296 virtual const AtomicString& shadowPseudoId() const; 258 297 }; 259 298 … … 268 307 private: 269 308 MediaControlReturnToRealtimeButtonElement(HTMLMediaElement*); 309 310 virtual const AtomicString& shadowPseudoId() const; 270 311 }; 271 312 … … 282 323 283 324 virtual void updateDisplayType(); 325 virtual const AtomicString& shadowPseudoId() const; 284 326 }; 285 327 … … 295 337 private: 296 338 MediaControlTimelineElement(HTMLMediaElement*); 339 340 virtual const AtomicString& shadowPseudoId() const; 297 341 }; 298 342 … … 308 352 private: 309 353 MediaControlVolumeSliderElement(HTMLMediaElement*); 354 355 virtual const AtomicString& shadowPseudoId() const; 310 356 }; 311 357 … … 320 366 private: 321 367 MediaControlFullscreenButtonElement(HTMLMediaElement*); 368 369 virtual const AtomicString& shadowPseudoId() const; 322 370 }; 323 371 -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r76724 r76951 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.