Changeset 136991 in webkit
- Timestamp:
- Dec 7, 2012 3:11:02 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r136990 r136991 1 2012-12-07 Dima Gorbik <dgorbik@apple.com> 2 3 Implement general ::cue pseudo element for the <video> 4 https://bugs.webkit.org/show_bug.cgi?id=104043 5 6 Reviewed by Eric Carlson. 7 8 * media/track/captions-webvtt/styling.vtt: Added. 9 * media/track/track-css-all-cues-expected.txt: Added. 10 * media/track/track-css-all-cues.html: Added. 11 1 12 2012-12-07 Kondapally Kalyan <kalyan.kondapally@intel.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r136986 r136991 1 2012-12-07 Dima Gorbik <dgorbik@apple.com> 2 3 Implement general ::cue pseudo element for the <video> 4 https://bugs.webkit.org/show_bug.cgi?id=104043 5 6 Reviewed by Eric Carlson. 7 8 Implemented the ::cue pseudo element to be able to style all WebVTT cues. 9 Added the subcontainer with a '::cue' pseudoId in between the TextTrackContainerElement and WebVTT nodes to separate 10 user agent default styles from user defined styles for the cue elements. 11 12 Test: media/track/track-css-all-cues.html 13 14 * css/CSSSelector.cpp: ::cue pseudo selector doesn't have a valid prefix but should be allowed in the user-agent stylesheet. 15 (WebCore::CSSSelector::parsePseudoType): 16 * html/shadow/MediaControlElements.cpp: 17 (WebCore): 18 (WebCore::MediaControlTextTrackContainerElement::createSubtrees): create a subcontainer and set its pseudoId to '::cue'. 19 (WebCore::MediaControlTextTrackContainerElement::updateDisplay): append WebVTT nodes to the newly created subcontainer. 20 * html/shadow/MediaControlElements.h: 21 (MediaControlTextTrackContainerElement): 22 * html/shadow/MediaControls.cpp: 23 (WebCore::MediaControls::createTextTrackDisplay): initiate creating subtrees for the MediaControlTextTrackContainerElement. 24 * html/shadow/MediaControlsChromium.cpp: 25 (WebCore::MediaControlsChromium::createTextTrackDisplay): 26 1 27 2012-12-06 Geoffrey Garen <ggaren@apple.com> 2 28 -
trunk/Source/WebCore/css/CSSSelector.cpp
r133577 r136991 396 396 if (name.startsWith("-webkit-")) 397 397 return PseudoWebKitCustomElement; 398 if (name.startsWith("x-") )398 if (name.startsWith("x-") || name.startsWith("cue")) 399 399 return PseudoUserAgentCustomElement; 400 400 -
trunk/Source/WebCore/html/shadow/MediaControlElements.cpp
r136978 r136991 1193 1193 { 1194 1194 } 1195 1196 void MediaControlTextTrackContainerElement::createSubtrees(Document* document) 1197 { 1198 DEFINE_STATIC_LOCAL(const AtomicString, cue, ("cue", AtomicString::ConstructFromLiteral)); 1199 m_cueContainer = HTMLElement::create(spanTag, document); 1200 m_cueContainer->setPseudo(cue); 1201 appendChild(m_cueContainer, ASSERT_NO_EXCEPTION, false); 1202 } 1195 1203 1196 1204 PassRefPtr<MediaControlTextTrackContainerElement> MediaControlTextTrackContainerElement::create(Document* document) … … 1271 1279 if (displayBox->hasChildNodes() && !contains(static_cast<Node*>(displayBox.get()))) 1272 1280 // Note: the display tree of a cue is removed when the active flag of the cue is unset. 1273 appendChild(displayBox, ASSERT_NO_EXCEPTION, false);1281 m_cueContainer->appendChild(displayBox, ASSERT_NO_EXCEPTION, false); 1274 1282 } 1275 1283 -
trunk/Source/WebCore/html/shadow/MediaControlElements.h
r136978 r136991 439 439 void updateDisplay(); 440 440 void updateSizes(); 441 void createSubtrees(Document*); 441 442 442 443 private: … … 448 449 IntRect m_videoDisplaySize; 449 450 float m_fontSize; 451 RefPtr<HTMLElement> m_cueContainer; 450 452 }; 451 453 -
trunk/Source/WebCore/html/shadow/MediaControls.cpp
r136613 r136991 370 370 // Insert it before the first controller element so it always displays behind the controls. 371 371 ExceptionCode ec; 372 insertBefore(textDisplayContainer.release(), m_panel, ec, true); 372 insertBefore(textDisplayContainer, m_panel, ec, true); 373 textDisplayContainer->createSubtrees(document()); 374 textDisplayContainer.release(); 373 375 } 374 376 -
trunk/Source/WebCore/html/shadow/MediaControlsChromium.cpp
r136613 r136991 215 215 // Insert it before the first controller element so it always displays behind the controls. 216 216 // In the Chromium case, that's the enclosure element. 217 insertBefore(textDisplayContainer.release(), m_enclosure, ASSERT_NO_EXCEPTION, true); 217 insertBefore(textDisplayContainer, m_enclosure, ASSERT_NO_EXCEPTION, true); 218 textDisplayContainer->createSubtrees(document()); 219 textDisplayContainer.release(); 218 220 } 219 221 #endif
Note: See TracChangeset
for help on using the changeset viewer.