diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 394ad201edaeb70dd4289ef45b886c44b219d2ab..883ab603fd2bf3867518df3367e084711a19f7e6 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,18 @@ +2013-04-09 Eric Carlson + + [Mac] user caption styles not applied to correct element + https://bugs.webkit.org/show_bug.cgi?id=114230 + + Reviewed by Jer Noble. + + * media/track/track-css-user-override-expected.txt: Added. + * media/track/track-css-user-override.html: Added. + * media/track/track-cue-container-rendering-position-expected.txt: + * media/track/track-cue-container-rendering-position.html: + * media/track/track-cue-rendering-expected.txt: + * media/track/track-cue-rendering.html: Font size is not applied instantly when a video element is + resized, so check after a very short delay. + 2013-04-09 Simon Fraser Repaint rect too small on elements with shadows diff --git a/LayoutTests/media/track/track-css-user-override-expected.txt b/LayoutTests/media/track/track-css-user-override-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..2a782ccfe9f8c1c03a0bedf9ef2577ce0053f311 --- /dev/null +++ b/LayoutTests/media/track/track-css-user-override-expected.txt @@ -0,0 +1,33 @@ + +internals.captionsStyleSheetOverride = function captionsStyleSheetOverride() { [native code] } +Test that style to all cues is applied correctly. +EVENT(canplaythrough) +EVENT(seeked) + +** Check style in .vtt file ** +EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).color == 'rgb(255, 255, 255)') OK +EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor == 'rgba(0, 0, 0, 0.8)') OK + +** Add style to the document ** +RUN(stylesheet.insertRule('video::cue { color: purple; background-color: lime; }', 0)) +EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).color == 'rgb(128, 0, 128)') OK +EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor == 'rgb(0, 255, 0)') OK + +** Add an override, without '!important' ** +RUN(internals.setCaptionsStyleSheetOverride('video::cue { color: blue; background-color: yellow; }')) +internals.captionsStyleSheetOverride = function captionsStyleSheetOverride() { [native code] } +EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).color == 'rgb(128, 0, 128)') OK +EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor == 'rgb(0, 255, 0)') OK + +** Mark background-color '!important' ** +RUN(internals.setCaptionsStyleSheetOverride('video::cue { color: blue ; background-color: yellow !important; }')) +EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).color == 'rgb(128, 0, 128)') OK +EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor == 'rgb(255, 255, 0)') OK + +** Mark color '!important' ** +RUN(stylesheet.insertRule('video::cue { color: blue !important; background-color: yellow !important; }', 0)) +EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).color == 'rgb(0, 0, 255)') OK +EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'cue')).backgroundColor == 'rgb(255, 255, 0)') OK + +END OF TEST + diff --git a/LayoutTests/media/track/track-css-user-override.html b/LayoutTests/media/track/track-css-user-override.html new file mode 100644 index 0000000000000000000000000000000000000000..adc82fd7e3aaa23bce7cb44d1d098275dc904391 --- /dev/null +++ b/LayoutTests/media/track/track-css-user-override.html @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + diff --git a/LayoutTests/media/track/track-cue-container-rendering-position-expected.txt b/LayoutTests/media/track/track-cue-container-rendering-position-expected.txt index 380e0beaa1923e7ad7a1774ad2d652b7662b0342..fba1788bd5437f6c7481f70bcd31d5365bf06436 100644 --- a/LayoutTests/media/track/track-cue-container-rendering-position-expected.txt +++ b/LayoutTests/media/track/track-cue-container-rendering-position-expected.txt @@ -1,6 +1,6 @@ -The top of the text track container should be in the bottom 25% of the video element. +The top of the text track container should be in the bottom 30% of the video element. EVENT(canplaythrough) -EXPECTED (cueDisplayElement.offsetTop > (video.videoHeight * .75) == 'true') OK +EXPECTED (cueDisplayElement.offsetTop > (video.videoHeight * .70) == 'true') OK END OF TEST diff --git a/LayoutTests/media/track/track-cue-container-rendering-position.html b/LayoutTests/media/track/track-cue-container-rendering-position.html index df0b7a316d5698fd5d5f62b3e5a2f333f0e29ec5..7224ceda1aeb3181b42a568509fa317eab087ec1 100644 --- a/LayoutTests/media/track/track-cue-container-rendering-position.html +++ b/LayoutTests/media/track/track-cue-container-rendering-position.html @@ -20,13 +20,14 @@ consoleWrite(""); cueDisplayElement = textTrackDisplayElement(video, 'display', 0); - testExpected("cueDisplayElement.offsetTop > (video.videoHeight * .75)", true); + document.body.offsetTop; + testExpected("cueDisplayElement.offsetTop > (video.videoHeight * .70)", true); endTest(); } function loaded() { - consoleWrite("The top of the text track container should be in the bottom 25% of the video element."); + consoleWrite("The top of the text track container should be in the bottom 30% of the video element."); findMediaElement(); video.src = findMediaFile('video', '../content/test'); diff --git a/LayoutTests/media/track/track-cue-rendering-expected.txt b/LayoutTests/media/track/track-cue-rendering-expected.txt index 36c7f47a258814d740c7b41495bfa1e01b82f6f8..b1679eb2d7e2ac73fe7c55d8c08f73092a5303f5 100644 --- a/LayoutTests/media/track/track-cue-rendering-expected.txt +++ b/LayoutTests/media/track/track-cue-rendering-expected.txt @@ -34,22 +34,23 @@ EXPECTED (2 * testCueDisplayBox.offsetLeft == video.videoWidth - testCueDisplayB Test the cue display colors and font. RUN(video.width = 320) RUN(video.height = 240) -EXPECTED (getComputedStyle(textTrackDisplayElement(video)).fontSize == '12px') OK +EXPECTED (getComputedStyle(currentCue).fontSize == '12px') OK RUN(video.width = 640) RUN(video.height = 480) -EXPECTED (getComputedStyle(textTrackDisplayElement(video)).fontSize == '24px') OK +EXPECTED (getComputedStyle(currentCue).fontSize == '24px') OK + +RUN(video.width = 960) +RUN(video.height = 720) +EXPECTED (getComputedStyle(currentCue).fontSize == '36px') OK RUN(video.width = 1280) RUN(video.height = 960) -EXPECTED (getComputedStyle(textTrackDisplayElement(video)).fontSize == '48px') OK +EXPECTED (getComputedStyle(currentCue).fontSize == '48px') OK -RUN(video.width = 2560) -RUN(video.height = 1440) -EXPECTED (getComputedStyle(textTrackDisplayElement(video)).fontSize == '72px') OK +EXPECTED (getComputedStyle(currentCue).fontFamily == 'sans-serif') OK +EXPECTED (getComputedStyle(currentCue).color == 'rgb(255, 255, 255)') OK +EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'display').firstChild).backgroundColor == 'rgba(0, 0, 0, 0.8)') OK -EXPECTED (getComputedStyle(textTrackDisplayElement(video)).fontFamily == 'sans-serif') OK -EXPECTED (getComputedStyle(textTrackDisplayElement(video)).color == 'rgb(255, 255, 255)') OK -EXPECTED (getComputedStyle(textTrackDisplayElement(video, 'display').firstChild).backgroundColor == 'rgba(0, 0, 0, 0.796875)'), OBSERVED 'rgba(0, 0, 0, 0.8)' FAIL END OF TEST diff --git a/LayoutTests/media/track/track-cue-rendering.html b/LayoutTests/media/track/track-cue-rendering.html index cdf1b083a3e97d913c5dc5022b0989635f22a555..3681a915ae7754488758cfbdef7c8a74ab4b38d1 100644 --- a/LayoutTests/media/track/track-cue-rendering.html +++ b/LayoutTests/media/track/track-cue-rendering.html @@ -12,29 +12,33 @@ var testTrack; var testCueDisplayBox; var seekedCount = 0; + var resizeCount = 1; var info = [ "Lorem", "ipsum", "dolor", "sit" ]; - function testFontSize(width, height) + function setVideoSize(width, height) { run("video.width = " + width); run("video.height = " + height); - document.body.offsetTop; - testExpected("getComputedStyle(textTrackDisplayElement(video)).fontSize", parseInt(height * 0.05) + "px"); - consoleWrite(""); } - function testCueStyle() + function resizeTest() { - consoleWrite("
Test the cue display colors and font."); - testFontSize(320, 240); - testFontSize(640, 480); - testFontSize(1280, 960); - testFontSize(2560, 1440); + document.body.offsetTop; + currentCue = textTrackDisplayElement(video, 'cue'); + testExpected("getComputedStyle(currentCue).fontSize", parseInt(240 * resizeCount * 0.05) + "px"); + consoleWrite(""); + + if (++resizeCount < 5) { + setVideoSize(320 * resizeCount, 240 * resizeCount); + setTimeout(resizeTest, 10); + return + } - testExpected("getComputedStyle(textTrackDisplayElement(video)).fontFamily", "sans-serif"); - testExpected("getComputedStyle(textTrackDisplayElement(video)).color", "rgb(255, 255, 255)"); - testExpected("getComputedStyle(textTrackDisplayElement(video, 'display').firstChild).backgroundColor", "rgba(0, 0, 0, 0.796875)"); + testExpected("getComputedStyle(currentCue).fontFamily", "sans-serif"); + testExpected("getComputedStyle(currentCue).color", "rgb(255, 255, 255)"); + testExpected("getComputedStyle(textTrackDisplayElement(video, 'display').firstChild).backgroundColor", "rgba(0, 0, 0, 0.8)"); + consoleWrite(""); endTest(); // Resize the video so it is easier to interact with it manually, if necessary. @@ -42,6 +46,13 @@ video.height = 240; } + function testCueStyle() + { + consoleWrite("
Test the cue display colors and font."); + setVideoSize(320, 240); + setTimeout(resizeTest, 10); + } + function seeked() { if (testEnded) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index ac40cb473b92d8284f0acde24d7c40b094c03276..335736a141353fdf63676e52878cedb6ec8f2538 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,74 @@ +2013-04-09 Eric Carlson + + [Mac] user caption styles not applied to correct element + https://bugs.webkit.org/show_bug.cgi?id=114230 + + Reviewed by Jer Noble. + + Test: media/track/track-css-user-override.html + + * html/HTMLMediaElement.cpp: + (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Drive by clean-up so we don't log excessively. + + * html/shadow/MediaControlElements.cpp: + (WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement): Initialize + new member variables. + (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Set cue font size when it is + inserted into the tree. + (WebCore::MediaControlTextTrackContainerElement::updateTimerFired): Update the font size of + all active cues. + (WebCore::MediaControlTextTrackContainerElement::updateSizes): Set size-relative CSS properties + after a time because this can be called during layout. + * html/shadow/MediaControlElements.h: + + * html/shadow/MediaControls.cpp: + (WebCore::MediaControls::textTrackPreferencesChanged): Call closedCaptionTracksChanged before updateSizes. + + * html/track/TextTrackCue.cpp: + (WebCore::TextTrackCue::setFontSize): New, set the cue's font size. + * html/track/TextTrackCue.h: + + * html/track/TextTrackCueGeneric.cpp: + (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): Set cue properties on the cue element + instead of on the cue box to match what we do for the "cue" pseudo element. + (WebCore::TextTrackCueGeneric::setFontSize): New, set the cue's font size. + * html/track/TextTrackCueGeneric.h: + + * html/track/TextTrackList.cpp: + (TextTrackList::remove): Drive-by cleanup, don't ASSERT when the media element is NULL. + + * page/CaptionUserPreferences.cpp: + (WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride): New, allow user CSS overrides + to be tested in DRT. + (WebCore::CaptionUserPreferences::updateCaptionStyleSheetOveride): New, generate a user style + sheet override. Moved here from CaptionUserPreferencesMac. + * page/CaptionUserPreferences.h: + + * page/CaptionUserPreferencesMac.h: + * page/CaptionUserPreferencesMac.mm: + (WebCore::CaptionUserPreferencesMac::captionsBackgroundCSS): Don't ignore background color importance. + (WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride): Implement even when we don't + have the media accessibility framework so this can be tested in DRT. Apply all cue properties + to the element used for the "cue" pseudo element. + + * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: + (WebCore::MediaPlayerPrivateAVFoundation::didLoadingProgress): Drive-by cleanup, remove logging + because this method is called so frequently and the logging is not especially useful. + (WebCore::MediaPlayerPrivateAVFoundation::updateStates): Only log when the ready/network + state changes because this method is called so frequently. + + * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: + (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer): Drive-by cleanup, remove logging + because this method is called so frequently and the logging is not especially useful. + (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTrack): Make the logging more useful. + + * testing/Internals.cpp: + (WebCore::Internals::resetToConsistentState): Reset captions style sheet override. + (WebCore::Internals::captionsStyleSheetOverride): New, return the captions style sheet override. + (WebCore::Internals::setCaptionsStyleSheetOverride): New, override the captions style sheet override. + * testing/Internals.h: + * testing/Internals.idl: + 2013-04-08 Simon Fraser Repaint rect too small on elements with shadows diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp index 260d0a6759f52a6536d060340722ef5a9a4d93ac..da1ab5a5c2e7817432bfaa3011c0e98c3d2bc793 100644 --- a/Source/WebCore/html/HTMLMediaElement.cpp +++ b/Source/WebCore/html/HTMLMediaElement.cpp @@ -1081,8 +1081,6 @@ static bool eventTimeCueCompare(const std::pair& a, void HTMLMediaElement::updateActiveTextTrackCues(float movieTime) { - LOG(Media, "HTMLMediaElement::updateActiveTextTracks"); - // 4.8.10.8 Playing the media resource // If the current playback position changes while the steps are running, @@ -1091,6 +1089,8 @@ void HTMLMediaElement::updateActiveTextTrackCues(float movieTime) if (ignoreTrackDisplayUpdateRequests()) return; + LOG(Media, "HTMLMediaElement::updateActiveTextTracks"); + // 1 - Let current cues be a list of cues, initialized to contain all the // cues of all the hidden, showing, or showing by default text tracks of the // media element (not the disabled ones) whose start times are less than or diff --git a/Source/WebCore/html/shadow/MediaControlElements.cpp b/Source/WebCore/html/shadow/MediaControlElements.cpp index b2883647893d0717e3aaf7381a316e2912eccf94..0659097b7b4b4167f0b3b2959a64158b0feb673c 100644 --- a/Source/WebCore/html/shadow/MediaControlElements.cpp +++ b/Source/WebCore/html/shadow/MediaControlElements.cpp @@ -1188,7 +1188,9 @@ const AtomicString& MediaControlCurrentTimeDisplayElement::shadowPseudoId() cons MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement(Document* document) : MediaControlDivElement(document, MediaTextTrackDisplayContainer) + , m_updateTimer(this, &MediaControlTextTrackContainerElement::updateTimerFired) , m_fontSize(0) + , m_fontSizeIsImportant(false) { } @@ -1275,9 +1277,11 @@ void MediaControlTextTrackContainerElement::updateDisplay() continue; RefPtr displayBox = cue->getDisplayTree(m_videoDisplaySize.size()); - if (displayBox->hasChildNodes() && !contains(static_cast(displayBox.get()))) + if (displayBox->hasChildNodes() && !contains(static_cast(displayBox.get()))) { // Note: the display tree of a cue is removed when the active flag of the cue is unset. appendChild(displayBox, ASSERT_NO_EXCEPTION, AttachNow); + cue->setFontSize(m_fontSize, m_videoDisplaySize.size(), m_fontSizeIsImportant); + } } // 11. Return output. @@ -1304,6 +1308,32 @@ void MediaControlTextTrackContainerElement::updateDisplay() } } +void MediaControlTextTrackContainerElement::updateTimerFired(Timer*) +{ + if (!document()->page()) + return; + + if (m_textTrackRepresentation) { + setInlineStyleProperty(CSSPropertyWidth, String::number(m_videoDisplaySize.size().width()) + "px"); + setInlineStyleProperty(CSSPropertyHeight, String::number(m_videoDisplaySize.size().height()) + "px"); + } + + HTMLMediaElement* mediaElement = toParentMediaElement(this); + if (!mediaElement) + return; + + float smallestDimension = std::min(m_videoDisplaySize.size().height(), m_videoDisplaySize.size().width()); + float fontScale = document()->page()->group().captionPreferences()->captionFontSizeScaleAndImportance(m_fontSizeIsImportant); + m_fontSize = lrintf(smallestDimension * fontScale); + + CueList activeCues = mediaElement->currentlyActiveCues(); + for (size_t i = 0; i < activeCues.size(); ++i) { + TextTrackCue* cue = activeCues[i].data(); + cue->setFontSize(m_fontSize, m_videoDisplaySize.size(), m_fontSizeIsImportant); + + } +} + void MediaControlTextTrackContainerElement::updateSizes(bool forceUpdate) { HTMLMediaElement* mediaElement = toParentMediaElement(this); @@ -1333,25 +1363,7 @@ void MediaControlTextTrackContainerElement::updateSizes(bool forceUpdate) return; m_videoDisplaySize = videoBox; - if (m_textTrackRepresentation) { - setInlineStyleProperty(CSSPropertyWidth, String::number(m_videoDisplaySize.size().width()) + "px"); - setInlineStyleProperty(CSSPropertyHeight, String::number(m_videoDisplaySize.size().height()) + "px"); - } - - float smallestDimension = std::min(m_videoDisplaySize.size().height(), m_videoDisplaySize.size().width()); - - bool important; - float fontSize = smallestDimension * (document()->page()->group().captionPreferences()->captionFontSizeScale(important)); - if (fontSize != m_fontSize) { - m_fontSize = fontSize; - setInlineStyleProperty(CSSPropertyFontSize, String::number(fontSize) + "px", important); - } - - CueList activeCues = mediaElement->currentlyActiveCues(); - for (size_t i = 0; i < activeCues.size(); ++i) { - TextTrackCue* cue = activeCues[i].data(); - cue->videoSizeDidChange(m_videoDisplaySize.size()); - } + m_updateTimer.startOneShot(0); } void MediaControlTextTrackContainerElement::paintTextTrackRepresentation(GraphicsContext* context, const IntRect& contextRect) diff --git a/Source/WebCore/html/shadow/MediaControlElements.h b/Source/WebCore/html/shadow/MediaControlElements.h index 6197896240887b71bff9fdc031acc9139941ce46..1199158cec86b6c20d028eecf402e1a098ce72d4 100644 --- a/Source/WebCore/html/shadow/MediaControlElements.h +++ b/Source/WebCore/html/shadow/MediaControlElements.h @@ -448,6 +448,8 @@ public: static const AtomicString& textTrackContainerElementShadowPseudoId(); private: + void updateTimerFired(Timer*); + explicit MediaControlTextTrackContainerElement(Document*); virtual const AtomicString& shadowPseudoId() const OVERRIDE; @@ -457,8 +459,10 @@ private: virtual void textTrackRepresentationBoundsChanged(const IntRect&) OVERRIDE; OwnPtr m_textTrackRepresentation; + Timer m_updateTimer; IntRect m_videoDisplaySize; - float m_fontSize; + int m_fontSize; + bool m_fontSizeIsImportant; }; #endif diff --git a/Source/WebCore/html/shadow/MediaControls.cpp b/Source/WebCore/html/shadow/MediaControls.cpp index 36e1780b327e9e53af120b9fc7a1e935e717a178..b1639b70cbc01ca18ff50d0c7b777db7a7462d82 100644 --- a/Source/WebCore/html/shadow/MediaControls.cpp +++ b/Source/WebCore/html/shadow/MediaControls.cpp @@ -409,9 +409,9 @@ void MediaControls::updateTextTrackDisplay() void MediaControls::textTrackPreferencesChanged() { + closedCaptionTracksChanged(); if (m_textDisplayContainer) m_textDisplayContainer->updateSizes(true); - closedCaptionTracksChanged(); } #endif diff --git a/Source/WebCore/html/track/TextTrackCue.cpp b/Source/WebCore/html/track/TextTrackCue.cpp index d74b590ef5860ce604b750bc4572616bfe78761a..9d5886adc43005e84e26d8ed9812a3338b3cfe1a 100644 --- a/Source/WebCore/html/track/TextTrackCue.cpp +++ b/Source/WebCore/html/track/TextTrackCue.cpp @@ -42,6 +42,7 @@ #include "HTMLDivElement.h" #include "HTMLMediaElement.h" #include "HTMLSpanElement.h" +#include "Logging.h" #include "NodeTraversal.h" #include "RenderTextTrackCue.h" #include "Text.h" @@ -1179,6 +1180,16 @@ bool TextTrackCue::operator==(const TextTrackCue& cue) const return true; } +void TextTrackCue::setFontSize(int fontSize, const IntSize&, bool important) +{ + if (!hasDisplayTree() || !fontSize) + return; + + LOG(Media, "TextTrackCue::setFontSize - setting cue font size to %i", fontSize); + + element()->setInlineStyleProperty(CSSPropertyFontSize, String::number(fontSize) + "px", important); +} + } // namespace WebCore #endif diff --git a/Source/WebCore/html/track/TextTrackCue.h b/Source/WebCore/html/track/TextTrackCue.h index 5ebc1abcd2a142af6abde2d5ac9f2bf6f70e1f14..28a7116716c52559e642f5c03b723742e0b753bc 100644 --- a/Source/WebCore/html/track/TextTrackCue.h +++ b/Source/WebCore/html/track/TextTrackCue.h @@ -177,7 +177,7 @@ public: }; CueAlignment getAlignment() const { return m_cueAlignment; } - virtual void videoSizeDidChange(const IntSize&) { } + virtual void setFontSize(int, const IntSize&, bool important); virtual bool operator==(const TextTrackCue&) const; virtual bool operator!=(const TextTrackCue& cue) const diff --git a/Source/WebCore/html/track/TextTrackCueGeneric.cpp b/Source/WebCore/html/track/TextTrackCueGeneric.cpp index c1987fed03abaeea7a3e75e55395039605f4b57a..b7756d6b8a6a5235a2fb2a92c69f0d1ef35e4c2b 100644 --- a/Source/WebCore/html/track/TextTrackCueGeneric.cpp +++ b/Source/WebCore/html/track/TextTrackCueGeneric.cpp @@ -34,6 +34,7 @@ #include "HTMLDivElement.h" #include "HTMLNames.h" #include "InbandTextTrackPrivateClient.h" +#include "Logging.h" #include "RenderObject.h" #include "RenderTextTrackCue.h" #include "ScriptExecutionContext.h" @@ -65,6 +66,7 @@ void TextTrackCueGenericBoxElement::applyCSSProperties(const IntSize& videoSize) setInlineStyleProperty(CSSPropertyUnicodeBidi, CSSValueWebkitPlaintext); TextTrackCueGeneric* cue = static_cast(getCue()); + RefPtr cueElement = cue->element(); float size = static_cast(cue->getCSSSize()); if (cue->useDefaultPosition()) { @@ -81,22 +83,18 @@ void TextTrackCueGenericBoxElement::applyCSSProperties(const IntSize& videoSize) } if (cue->foregroundColor().isValid()) - setInlineStyleProperty(CSSPropertyColor, cue->foregroundColor().serialized()); + cueElement->setInlineStyleProperty(CSSPropertyColor, cue->foregroundColor().serialized()); if (cue->backgroundColor().isValid()) - cue->element()->setInlineStyleProperty(CSSPropertyBackgroundColor, cue->backgroundColor().serialized()); + cueElement->setInlineStyleProperty(CSSPropertyBackgroundColor, cue->backgroundColor().serialized()); if (cue->getWritingDirection() == TextTrackCue::Horizontal) setInlineStyleProperty(CSSPropertyHeight, CSSValueAuto); else setInlineStyleProperty(CSSPropertyWidth, CSSValueAuto); - if (cue->baseFontSizeRelativeToVideoHeight()) { - double fontSize = videoSize.height() * cue->baseFontSizeRelativeToVideoHeight() / 100; - if (cue->fontSizeMultiplier()) - fontSize *= cue->fontSizeMultiplier() / 100; - setInlineStyleProperty(CSSPropertyFontSize, String::number(fontSize) + "px"); - } + if (cue->baseFontSizeRelativeToVideoHeight()) + cue->setFontSize(cue->baseFontSizeRelativeToVideoHeight(), videoSize, false); if (cue->getAlignment() == TextTrackCue::Middle) setInlineStyleProperty(CSSPropertyTextAlign, CSSValueCenter); @@ -135,20 +133,24 @@ void TextTrackCueGeneric::setPosition(int position, ExceptionCode& ec) TextTrackCue::setPosition(position, ec); } -void TextTrackCueGeneric::videoSizeDidChange(const IntSize& videoSize) +void TextTrackCueGeneric::setFontSize(int fontSize, const IntSize& videoSize, bool important) { - if (!hasDisplayTree()) + if (!hasDisplayTree() || !fontSize) + return; + + if (important || !baseFontSizeRelativeToVideoHeight()) { + TextTrackCue::setFontSize(fontSize, videoSize, important); return; - - if (baseFontSizeRelativeToVideoHeight()) { - double fontSize = videoSize.height() * baseFontSizeRelativeToVideoHeight() / 100; - if (fontSizeMultiplier()) - fontSize *= fontSizeMultiplier() / 100; - displayTreeInternal()->setInlineStyleProperty(CSSPropertyFontSize, String::number(fontSize) + "px"); } -} + double size = videoSize.height() * baseFontSizeRelativeToVideoHeight() / 100; + if (fontSizeMultiplier()) + size *= fontSizeMultiplier() / 100; + element()->setInlineStyleProperty(CSSPropertyFontSize, String::number(lrintf(size)) + "px"); + LOG(Media, "TextTrackCueGeneric::setFontSize - setting cue font size to %li", lrintf(size)); +} + bool TextTrackCueGeneric::operator==(const TextTrackCue& cue) const { if (cue.cueType() != TextTrackCue::Generic) diff --git a/Source/WebCore/html/track/TextTrackCueGeneric.h b/Source/WebCore/html/track/TextTrackCueGeneric.h index 00a7298473bc4209ddd7ae49030e83b6f95266bc..23afcac200d969ea21534c780c440ff44270f2f5 100644 --- a/Source/WebCore/html/track/TextTrackCueGeneric.h +++ b/Source/WebCore/html/track/TextTrackCueGeneric.h @@ -68,7 +68,7 @@ public: Color backgroundColor() const { return m_backgroundColor; } void setBackgroundColor(RGBA32 color) { m_backgroundColor.setRGB(color); } - virtual void videoSizeDidChange(const IntSize&); + virtual void setFontSize(int, const IntSize&, bool important) OVERRIDE; virtual bool operator==(const TextTrackCue&) const OVERRIDE; virtual bool operator!=(const TextTrackCue& cue) const OVERRIDE diff --git a/Source/WebCore/html/track/TextTrackList.cpp b/Source/WebCore/html/track/TextTrackList.cpp index 293b3d02701b0955d2fa8b769480dacb01d7d0ec..8ae56c2b05e74d6029fb34d3a1dac6d000164720 100644 --- a/Source/WebCore/html/track/TextTrackList.cpp +++ b/Source/WebCore/html/track/TextTrackList.cpp @@ -205,7 +205,7 @@ void TextTrackList::remove(TextTrack* track) invalidateTrackIndexesAfterTrack(track); - ASSERT(track->mediaElement() == m_owner); + ASSERT(!track->mediaElement() || track->mediaElement() == m_owner); track->setMediaElement(0); tracks->remove(index); diff --git a/Source/WebCore/page/CaptionUserPreferences.cpp b/Source/WebCore/page/CaptionUserPreferences.cpp index a9ec3078abc760443bfb72072317a001f6d58749..383d996c0bd1dff06074f837418b3bc473fc27b0 100644 --- a/Source/WebCore/page/CaptionUserPreferences.cpp +++ b/Source/WebCore/page/CaptionUserPreferences.cpp @@ -28,10 +28,12 @@ #if ENABLE(VIDEO_TRACK) #include "CaptionUserPreferences.h" +#include "DOMWrapperWorld.h" #include "Page.h" #include "PageGroup.h" #include "Settings.h" #include "TextTrackList.h" +#include "UserStyleSheetTypes.h" #include namespace WebCore { @@ -221,6 +223,28 @@ int CaptionUserPreferences::textTrackLanguageSelectionScore(TextTrack* track, co return (preferredLanguages.size() - languageMatchIndex) * 10; } +void CaptionUserPreferences::setCaptionsStyleSheetOverride(const String& override) +{ + m_captionsStyleSheetOverride = override; + updateCaptionStyleSheetOveride(); +} + +void CaptionUserPreferences::updateCaptionStyleSheetOveride() +{ + // Identify our override style sheet with a unique URL - a new scheme and a UUID. + DEFINE_STATIC_LOCAL(KURL, captionsStyleSheetURL, (ParsedURLString, "user-captions-override:01F6AF12-C3B0-4F70-AF5E-A3E00234DC23")); + + pageGroup()->removeUserStyleSheetFromWorld(mainThreadNormalWorld(), captionsStyleSheetURL); + + String captionsOverrideStyleSheet = captionsStyleSheetOverride(); + if (captionsOverrideStyleSheet.isEmpty()) + return; + + pageGroup()->addUserStyleSheetToWorld(mainThreadNormalWorld(), captionsOverrideStyleSheet, captionsStyleSheetURL, Vector(), + Vector(), InjectInAllFrames, UserStyleAuthorLevel, InjectInExistingDocuments); +} + + } #endif // ENABLE(VIDEO_TRACK) diff --git a/Source/WebCore/page/CaptionUserPreferences.h b/Source/WebCore/page/CaptionUserPreferences.h index 6ca36dac5d144018ab55b78e27ac9794b9b233af..f367a49ecd7b388fdc9f2011d503d77003002460 100644 --- a/Source/WebCore/page/CaptionUserPreferences.h +++ b/Source/WebCore/page/CaptionUserPreferences.h @@ -66,8 +66,10 @@ public: virtual bool userPrefersTextDescriptions() const; virtual void setUserPrefersTextDescriptions(bool preference); - virtual float captionFontSizeScale(bool& important) const { important = false; return 0.05f; } - virtual String captionsStyleSheetOverride() const { return emptyString(); } + virtual float captionFontSizeScaleAndImportance(bool& important) const { important = false; return 0.05f; } + + virtual String captionsStyleSheetOverride() const { return m_captionsStyleSheetOverride; } + virtual void setCaptionsStyleSheetOverride(const String&); virtual void setInterestedInCaptionPreferenceChanges() { } @@ -86,6 +88,7 @@ public: protected: CaptionUserPreferences(PageGroup*); + void updateCaptionStyleSheetOveride(); private: void timerFired(Timer*); @@ -95,6 +98,7 @@ private: CaptionDisplayMode m_displayMode; Timer m_timer; String m_userPreferredLanguage; + String m_captionsStyleSheetOverride; bool m_testingMode; bool m_havePreferences; }; diff --git a/Source/WebCore/page/CaptionUserPreferencesMac.h b/Source/WebCore/page/CaptionUserPreferencesMac.h index bca57c691dfbf909643af03951450d2e267adb55..ca97d3ea2dcc1c7aadd2a717a31788c4e9d9f02a 100644 --- a/Source/WebCore/page/CaptionUserPreferencesMac.h +++ b/Source/WebCore/page/CaptionUserPreferencesMac.h @@ -47,8 +47,7 @@ public: virtual bool userPrefersCaptions() const OVERRIDE; virtual bool userPrefersSubtitles() const OVERRIDE; - virtual float captionFontSizeScale(bool&) const OVERRIDE; - virtual String captionsStyleSheetOverride() const OVERRIDE; + virtual float captionFontSizeScaleAndImportance(bool&) const OVERRIDE; virtual void setInterestedInCaptionPreferenceChanges() OVERRIDE; @@ -56,9 +55,9 @@ public: virtual Vector preferredLanguages() const OVERRIDE; virtual void captionPreferencesChanged() OVERRIDE; - #endif + virtual String captionsStyleSheetOverride() const OVERRIDE; virtual int textTrackSelectionScore(TextTrack*, HTMLMediaElement*) const OVERRIDE; virtual Vector > sortedTrackListForMenu(TextTrackList*) OVERRIDE; virtual String displayNameForTrack(TextTrack*) const OVERRIDE; @@ -78,8 +77,6 @@ private: String cssPropertyWithTextEdgeColor(CSSPropertyID, const String&, const Color&, bool) const; String colorPropertyCSS(CSSPropertyID, const Color&, bool) const; - void updateCaptionStyleSheetOveride(); - bool m_listeningForPreferenceChanges; #endif }; diff --git a/Source/WebCore/page/CaptionUserPreferencesMac.mm b/Source/WebCore/page/CaptionUserPreferencesMac.mm index fd82a817d5442eaa6c1f312e0a4208ed84d22749..c326f2e92525a624bdf1fc76bcbfb0b6ee570ec3 100644 --- a/Source/WebCore/page/CaptionUserPreferencesMac.mm +++ b/Source/WebCore/page/CaptionUserPreferencesMac.mm @@ -250,7 +250,7 @@ String CaptionUserPreferencesMac::captionsBackgroundCSS() const backgroundColor = defaultBackgroundColor; bool important = behavior == kMACaptionAppearanceBehaviorUseValue; - CGFloat opacity = MACaptionAppearanceGetBackgroundOpacity(kMACaptionAppearanceDomainUser, 0); + CGFloat opacity = MACaptionAppearanceGetBackgroundOpacity(kMACaptionAppearanceDomainUser, &behavior); if (!important) important = behavior == kMACaptionAppearanceBehaviorUseValue; String backgroundStyle = colorPropertyCSS(CSSPropertyBackgroundColor, Color(backgroundColor.red(), backgroundColor.green(), backgroundColor.blue(), static_cast(opacity * 255)), important); @@ -416,67 +416,13 @@ String CaptionUserPreferencesMac::captionsDefaultFontCSS() const return builder.toString(); } -String CaptionUserPreferencesMac::captionsStyleSheetOverride() const +float CaptionUserPreferencesMac::captionFontSizeScaleAndImportance(bool& important) const { if (testingMode() || !MediaAccessibilityLibrary()) - return CaptionUserPreferences::captionsStyleSheetOverride(); - - StringBuilder captionsOverrideStyleSheet; - - String background = captionsBackgroundCSS(); - if (!background.isEmpty()) { - captionsOverrideStyleSheet.append(" video::"); - captionsOverrideStyleSheet.append(TextTrackCue::cueShadowPseudoId()); - captionsOverrideStyleSheet.append('{'); - captionsOverrideStyleSheet.append(background); - captionsOverrideStyleSheet.append('}'); - } - - String windowColor = captionsWindowCSS(); - String windowCornerRadius = windowRoundedCornerRadiusCSS(); - if (!windowColor.isEmpty() || !windowCornerRadius.isEmpty()) { - captionsOverrideStyleSheet.append(" video::"); - captionsOverrideStyleSheet.append(TextTrackCueBox::textTrackCueBoxShadowPseudoId()); - captionsOverrideStyleSheet.append('{'); - - if (!windowColor.isEmpty()) - captionsOverrideStyleSheet.append(windowColor); - if (!windowCornerRadius.isEmpty()) - captionsOverrideStyleSheet.append(windowCornerRadius); - - captionsOverrideStyleSheet.append('}'); - } - - String captionsColor = captionsTextColorCSS(); - String edgeStyle = captionsTextEdgeCSS(); - String fontName = captionsDefaultFontCSS(); - if (!captionsColor.isEmpty() || !edgeStyle.isEmpty() || !fontName.isEmpty()) { - captionsOverrideStyleSheet.append(" video::"); - captionsOverrideStyleSheet.append(MediaControlTextTrackContainerElement::textTrackContainerElementShadowPseudoId()); - captionsOverrideStyleSheet.append('{'); - - if (!captionsColor.isEmpty()) - captionsOverrideStyleSheet.append(captionsColor); - if (!edgeStyle.isEmpty()) - captionsOverrideStyleSheet.append(edgeStyle); - if (!fontName.isEmpty()) - captionsOverrideStyleSheet.append(fontName); - - captionsOverrideStyleSheet.append('}'); - } - - LOG(Media, "CaptionUserPreferencesMac::captionsStyleSheetOverrideSetting sytle to:\n%s", captionsOverrideStyleSheet.toString().utf8().data()); - - return captionsOverrideStyleSheet.toString(); -} - -float CaptionUserPreferencesMac::captionFontSizeScale(bool& important) const -{ - if (testingMode() || !MediaAccessibilityLibrary()) - return CaptionUserPreferences::captionFontSizeScale(important); + return CaptionUserPreferences::captionFontSizeScaleAndImportance(important); MACaptionAppearanceBehavior behavior; - CGFloat characterScale = CaptionUserPreferences::captionFontSizeScale(important); + CGFloat characterScale = CaptionUserPreferences::captionFontSizeScaleAndImportance(important); CGFloat scaleAdjustment = MACaptionAppearanceGetRelativeCharacterSize(kMACaptionAppearanceDomainUser, &behavior); if (!scaleAdjustment) @@ -490,21 +436,6 @@ float CaptionUserPreferencesMac::captionFontSizeScale(bool& important) const #endif } -void CaptionUserPreferencesMac::updateCaptionStyleSheetOveride() -{ - // Identify our override style sheet with a unique URL - a new scheme and a UUID. - DEFINE_STATIC_LOCAL(KURL, captionsStyleSheetURL, (ParsedURLString, "user-captions-override:01F6AF12-C3B0-4F70-AF5E-A3E00234DC23")); - - pageGroup()->removeUserStyleSheetFromWorld(mainThreadNormalWorld(), captionsStyleSheetURL); - - String captionsOverrideStyleSheet = captionsStyleSheetOverride(); - if (captionsOverrideStyleSheet.isEmpty()) - return; - - pageGroup()->addUserStyleSheetToWorld(mainThreadNormalWorld(), captionsOverrideStyleSheet, captionsStyleSheetURL, Vector(), - Vector(), InjectInAllFrames, UserStyleAuthorLevel, InjectInExistingDocuments); -} - void CaptionUserPreferencesMac::setPreferredLanguage(const String& language) { if (testingMode() || !MediaAccessibilityLibrary()) { @@ -550,6 +481,59 @@ Vector CaptionUserPreferencesMac::preferredLanguages() const } #endif // HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK) +String CaptionUserPreferencesMac::captionsStyleSheetOverride() const +{ + if (testingMode()) + return CaptionUserPreferences::captionsStyleSheetOverride(); + + StringBuilder captionsOverrideStyleSheet; + +#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK) + if (!MediaAccessibilityLibrary()) + return CaptionUserPreferences::captionsStyleSheetOverride(); + + String captionsColor = captionsTextColorCSS(); + String edgeStyle = captionsTextEdgeCSS(); + String fontName = captionsDefaultFontCSS(); + String background = captionsBackgroundCSS(); + if (!background.isEmpty() || !captionsColor.isEmpty() || !edgeStyle.isEmpty() || !fontName.isEmpty()) { + captionsOverrideStyleSheet.append(" video::"); + captionsOverrideStyleSheet.append(TextTrackCue::cueShadowPseudoId()); + captionsOverrideStyleSheet.append('{'); + + if (!background.isEmpty()) + captionsOverrideStyleSheet.append(background); + if (!captionsColor.isEmpty()) + captionsOverrideStyleSheet.append(captionsColor); + if (!edgeStyle.isEmpty()) + captionsOverrideStyleSheet.append(edgeStyle); + if (!fontName.isEmpty()) + captionsOverrideStyleSheet.append(fontName); + + captionsOverrideStyleSheet.append('}'); + } + + String windowColor = captionsWindowCSS(); + String windowCornerRadius = windowRoundedCornerRadiusCSS(); + if (!windowColor.isEmpty() || !windowCornerRadius.isEmpty()) { + captionsOverrideStyleSheet.append(" video::"); + captionsOverrideStyleSheet.append(TextTrackCueBox::textTrackCueBoxShadowPseudoId()); + captionsOverrideStyleSheet.append('{'); + + if (!windowColor.isEmpty()) + captionsOverrideStyleSheet.append(windowColor); + if (!windowCornerRadius.isEmpty()) + captionsOverrideStyleSheet.append(windowCornerRadius); + + captionsOverrideStyleSheet.append('}'); + } +#endif // HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK) + + LOG(Media, "CaptionUserPreferencesMac::captionsStyleSheetOverrideSetting sytle to:\n%s", captionsOverrideStyleSheet.toString().utf8().data()); + + return captionsOverrideStyleSheet.toString(); +} + static String languageIdentifier(const String& languageCode) { if (languageCode.isEmpty()) diff --git a/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp b/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp index c8b64167ea66fe602e7783a7d0d7fc083a5532b5..bdd021a0b1512c2229a2be59ee4c70bfb97f36e2 100644 --- a/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp +++ b/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp @@ -391,7 +391,7 @@ bool MediaPlayerPrivateAVFoundation::didLoadingProgress() const float currentMaxTimeLoaded = maxTimeLoaded(); bool didLoadingProgress = currentMaxTimeLoaded != m_maxTimeLoadedAtLastDidLoadingProgress; m_maxTimeLoadedAtLastDidLoadingProgress = currentMaxTimeLoaded; - LOG(Media, "MediaPlayerPrivateAVFoundation::didLoadingProgress(%p) - returning %d", this, didLoadingProgress); + return didLoadingProgress; } @@ -433,9 +433,6 @@ void MediaPlayerPrivateAVFoundation::updateStates() MediaPlayer::NetworkState oldNetworkState = m_networkState; MediaPlayer::ReadyState oldReadyState = m_readyState; - LOG(Media, "MediaPlayerPrivateAVFoundation::updateStates(%p) - entering with networkState = %i, readyState = %i", - this, static_cast(m_networkState), static_cast(m_readyState)); - if (m_loadingMetadata) m_networkState = MediaPlayer::Loading; else { @@ -522,8 +519,12 @@ void MediaPlayerPrivateAVFoundation::updateStates() platformPlay(); } - LOG(Media, "MediaPlayerPrivateAVFoundation::updateStates(%p) - exiting with networkState = %i, readyState = %i", - this, static_cast(m_networkState), static_cast(m_readyState)); +#if !LOG_DISABLED + if (m_networkState != oldNetworkState || oldReadyState != m_readyState) { + LOG(Media, "MediaPlayerPrivateAVFoundation::updateStates(%p) - entered with networkState = %i, readyState = %i, exiting with networkState = %i, readyState = %i", + this, static_cast(oldNetworkState), static_cast(oldReadyState), static_cast(m_networkState), static_cast(m_readyState)); + } +#endif } void MediaPlayerPrivateAVFoundation::setSize(const IntSize&) diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm index b2eb8554d24965b513803556ab9a34476101c9ce..b722b817e88aa0921889db7988d8d2c508b94313 100644 --- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm +++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm @@ -529,7 +529,6 @@ PlatformMedia MediaPlayerPrivateAVFoundationObjC::platformMedia() const PlatformLayer* MediaPlayerPrivateAVFoundationObjC::platformLayer() const { - LOG(Media, "MediaPlayerPrivateAVFoundationObjC::platformLayer(%p)", this); return m_videoLayer.get(); } @@ -1367,7 +1366,7 @@ void MediaPlayerPrivateAVFoundationObjC::setCurrentTrack(InbandTextTrackPrivateA AVMediaSelectionOptionType *mediaSelectionOption = trackPrivate ? trackPrivate->mediaSelectionOption() : 0; - LOG(Media, "MediaPlayerPrivateAVFoundationObjC::setCurrentTrack(%p) - selecting media option %p", this, mediaSelectionOption); + LOG(Media, "MediaPlayerPrivateAVFoundationObjC::setCurrentTrack(%p) - selecting media option %p, language = %s", this, mediaSelectionOption, [[[mediaSelectionOption locale] localeIdentifier] UTF8String]); [m_avPlayerItem.get() selectMediaOption:mediaSelectionOption inMediaSelectionGroup:[m_avAsset.get() mediaSelectionGroupForMediaCharacteristic:AVMediaCharacteristicLegible]]; m_currentTrack = trackPrivate; diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp index 2254a98814d82a9a40f5866b29c024f217985e63..9c8abdbd55202c90880769102517d29846255a84 100644 --- a/Source/WebCore/testing/Internals.cpp +++ b/Source/WebCore/testing/Internals.cpp @@ -273,6 +273,7 @@ void Internals::resetToConsistentState(Page* page) page->inspectorController()->setProfilerEnabled(false); #endif #if ENABLE(VIDEO_TRACK) && !PLATFORM(WIN) + page->group().captionPreferences()->setCaptionsStyleSheetOverride(emptyString()); page->group().captionPreferences()->setTestingMode(false); #endif if (!page->mainFrame()->editor()->isContinuousSpellCheckingEnabled()) @@ -2107,4 +2108,32 @@ bool Internals::isSelectPopupVisible(Node* node) return menuList->popupIsVisible(); } +String Internals::captionsStyleSheetOverride(ExceptionCode& ec) +{ + Document* document = contextDocument(); + if (!document || !document->page()) { + ec = INVALID_ACCESS_ERR; + return emptyString(); + } + +#if ENABLE(VIDEO_TRACK) && !PLATFORM(WIN) + return document->page()->group().captionPreferences()->captionsStyleSheetOverride(); +#else + return emptyString(); +#endif +} + +void Internals::setCaptionsStyleSheetOverride(const String& override, ExceptionCode& ec) +{ + Document* document = contextDocument(); + if (!document || !document->page()) { + ec = INVALID_ACCESS_ERR; + return; + } + +#if ENABLE(VIDEO_TRACK) && !PLATFORM(WIN) + document->page()->group().captionPreferences()->setCaptionsStyleSheetOverride(override); +#endif +} + } diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h index 2dd924c29c206869e6f184bea9dc3d4c77b1a1b1..945cc9ee2d3927156f648477592a85a2693496af 100644 --- a/Source/WebCore/testing/Internals.h +++ b/Source/WebCore/testing/Internals.h @@ -311,6 +311,9 @@ public: bool isSelectPopupVisible(Node*); + String captionsStyleSheetOverride(ExceptionCode&); + void setCaptionsStyleSheetOverride(const String&, ExceptionCode&); + private: explicit Internals(Document*); Document* contextDocument() const; diff --git a/Source/WebCore/testing/Internals.idl b/Source/WebCore/testing/Internals.idl index a565e982c97c92f7d91709a2bd338c1e51e0584b..91cf354f124e706bfe7d899589309cf6a08e1cb2 100644 --- a/Source/WebCore/testing/Internals.idl +++ b/Source/WebCore/testing/Internals.idl @@ -272,5 +272,8 @@ DOMString getImageSourceURL(in Element element) raises(DOMException); + [Conditional=VIDEO_TRACK] DOMString captionsStyleSheetOverride() raises (DOMException); + [Conditional=VIDEO_TRACK] void setCaptionsStyleSheetOverride(in DOMString override) raises (DOMException); + boolean isSelectPopupVisible(in Node node); };