Unreviewed, rolling out r130556 and r130564.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2012 23:28:42 +0000 (23:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2012 23:28:42 +0000 (23:28 +0000)
http://trac.webkit.org/changeset/130556
http://trac.webkit.org/changeset/130564
https://bugs.webkit.org/show_bug.cgi?id=98572

The patch wasn't reviewed by a reviewer and it is breaking
Chromium Windows (Requested by jchaffraix on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-10-05

Source/WebCore:

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* css/mediaControls.css:
(video::-webkit-media-text-track-container):
(video::-webkit-media-text-track-past-nodes):
(video::-webkit-media-text-track-future-nodes):
(video::-webkit-media-text-track-display):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::attach):
(WebCore::HTMLMediaElement::userIsInterestedInThisLanguage):
(WebCore::HTMLMediaElement::userIsInterestedInThisTrackKind):
(WebCore::HTMLMediaElement::setClosedCaptionsVisible):
(WebCore::HTMLMediaElement::updateClosedCaptionsControls):
* html/HTMLMediaElement.h:
(HTMLMediaElement):
* html/shadow/MediaControlElements.cpp:
(WebCore):
(WebCore::MediaControlTextTrackContainerElement::updateSizes):
* html/shadow/MediaControlElements.h:
(MediaControlTextTrackContainerElement):
* html/shadow/MediaControlRootElement.cpp:
(WebCore::MediaControlRootElement::updateTextTrackDisplay):
* html/shadow/MediaControlRootElement.h:
(MediaControlRootElement):
* html/shadow/MediaControls.h:
(MediaControls):
* html/track/TextTrack.cpp:
(WebCore::TextTrack::TextTrack):
(WebCore::TextTrack::isValidKindKeyword):
(WebCore::TextTrack::setKind):
(WebCore::TextTrack::setMode):
(WebCore::TextTrack::mode):
* html/track/TextTrack.h:
(WebCore::TextTrack::create):
(WebCore::TextTrack::kind):
(TextTrack):
(WebCore::TextTrack::label):
(WebCore::TextTrack::setLabel):
(WebCore::TextTrack::language):
(WebCore::TextTrack::setLanguage):
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCueBox::TextTrackCueBox):
(WebCore::TextTrackCueBox::shadowPseudoId):
(WebCore):
(WebCore::TextTrackCue::updateDisplayTree):
* html/track/TextTrackCue.h:
(TextTrackCueBox):
(TextTrackCue):
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:
* rendering/CaptionPreferencesChangedListener.h: Removed.
* rendering/RenderTheme.h:
(WebCore):
(RenderTheme):
* rendering/RenderThemeMac.h:
(RenderThemeMac):
* rendering/RenderThemeMac.mm:
(WebCore):
(WebCore::RenderThemeMac::RenderThemeMac):
(WebCore::RenderThemeMac::~RenderThemeMac):

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

WebKitLibraries:

* WebKitSystemInterface.h:

LayoutTests:

* media/track/track-cue-rendering-expected.txt:
* media/track/track-cue-rendering.html:
* platform/chromium/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130567 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 files changed:
LayoutTests/ChangeLog
LayoutTests/media/track/track-cue-rendering-expected.txt
LayoutTests/media/track/track-cue-rendering.html
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/mediaControls.css
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/MediaControlElements.h
Source/WebCore/html/shadow/MediaControlRootElement.cpp
Source/WebCore/html/shadow/MediaControlRootElement.h
Source/WebCore/html/shadow/MediaControls.h
Source/WebCore/html/track/TextTrack.cpp
Source/WebCore/html/track/TextTrack.h
Source/WebCore/html/track/TextTrackCue.cpp
Source/WebCore/html/track/TextTrackCue.h
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebCore/rendering/CaptionPreferencesChangedListener.h [deleted file]
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeMac.h
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h

index eda7802..0c08ae6 100644 (file)
@@ -1,3 +1,17 @@
+2012-10-05  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r130556 and r130564.
+        http://trac.webkit.org/changeset/130556
+        http://trac.webkit.org/changeset/130564
+        https://bugs.webkit.org/show_bug.cgi?id=98572
+
+        The patch wasn't reviewed by a reviewer and it is breaking
+        Chromium Windows (Requested by jchaffraix on #webkit).
+
+        * media/track/track-cue-rendering-expected.txt:
+        * media/track/track-cue-rendering.html:
+        * platform/chromium/TestExpectations:
+
 2012-10-05  Julien Chaffraix  <jchaffraix@webkit.org>
 
         Unreviewed Chromium gardening.
index 36c7f47..c06fbd0 100644 (file)
@@ -49,7 +49,7 @@ RUN(video.height = 1440)
 EXPECTED (getComputedStyle(textTrackDisplayElement(video)).fontSize == '72px') OK
 
 EXPECTED (getComputedStyle(textTrackDisplayElement(video)).fontFamily == 'sans-serif') OK
-EXPECTED (getComputedStyle(textTrackDisplayElement(video)).color == 'rgb(255, 255, 255)') OK
+EXPECTED (getComputedStyle(textTrackDisplayElement(video)).color == 'rgba(255, 255, 255, 0)') 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
 
index cdf1b08..5a7e8e6 100644 (file)
@@ -32,7 +32,7 @@
             testFontSize(2560, 1440);
 
             testExpected("getComputedStyle(textTrackDisplayElement(video)).fontFamily", "sans-serif");
-            testExpected("getComputedStyle(textTrackDisplayElement(video)).color", "rgb(255, 255, 255)");
+            testExpected("getComputedStyle(textTrackDisplayElement(video)).color", "rgba(255, 255, 255, 0)");
             testExpected("getComputedStyle(textTrackDisplayElement(video, 'display').firstChild).backgroundColor", "rgba(0, 0, 0, 0.796875)");
 
             endTest();
index a99d8a6..98ef15d 100644 (file)
@@ -3786,9 +3786,3 @@ webkit.org/b/95121 fast/borders/border-image-side-reduction.html [ ImageOnlyFail
 # failing after r130443 but we're not sure if this is a real bug or just needs rebaselining
 webkit.org/b/98545 [ Mac ] fast/text/international/text-spliced-font.html [ Failure ]
 webkit.org/b/98545 [ Mac ] fast/writing-mode/Kusa-Makura-background-canvas.html [ Failure ]
-
-# Need to be updated after webkit.org/b/97800
-webkit.org/b/89167 media/track/track-cue-rendering-horizontal.html [ Failure ]
-webkit.org/b/89167 media/track/track-cue-rendering-vertical.html [ Failure ]
-webkit.org/b/89167 media/track/track-cue-rendering.html [ Failure ]
-
index 21d1b08..25c2163 100644 (file)
@@ -1,3 +1,75 @@
+2012-10-05  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r130556 and r130564.
+        http://trac.webkit.org/changeset/130556
+        http://trac.webkit.org/changeset/130564
+        https://bugs.webkit.org/show_bug.cgi?id=98572
+
+        The patch wasn't reviewed by a reviewer and it is breaking
+        Chromium Windows (Requested by jchaffraix on #webkit).
+
+        * WebCore.exp.in:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/mediaControls.css:
+        (video::-webkit-media-text-track-container):
+        (video::-webkit-media-text-track-past-nodes):
+        (video::-webkit-media-text-track-future-nodes):
+        (video::-webkit-media-text-track-display):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement):
+        (WebCore::HTMLMediaElement::attach):
+        (WebCore::HTMLMediaElement::userIsInterestedInThisLanguage):
+        (WebCore::HTMLMediaElement::userIsInterestedInThisTrackKind):
+        (WebCore::HTMLMediaElement::setClosedCaptionsVisible):
+        (WebCore::HTMLMediaElement::updateClosedCaptionsControls):
+        * html/HTMLMediaElement.h:
+        (HTMLMediaElement):
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore):
+        (WebCore::MediaControlTextTrackContainerElement::updateSizes):
+        * html/shadow/MediaControlElements.h:
+        (MediaControlTextTrackContainerElement):
+        * html/shadow/MediaControlRootElement.cpp:
+        (WebCore::MediaControlRootElement::updateTextTrackDisplay):
+        * html/shadow/MediaControlRootElement.h:
+        (MediaControlRootElement):
+        * html/shadow/MediaControls.h:
+        (MediaControls):
+        * html/track/TextTrack.cpp:
+        (WebCore::TextTrack::TextTrack):
+        (WebCore::TextTrack::isValidKindKeyword):
+        (WebCore::TextTrack::setKind):
+        (WebCore::TextTrack::setMode):
+        (WebCore::TextTrack::mode):
+        * html/track/TextTrack.h:
+        (WebCore::TextTrack::create):
+        (WebCore::TextTrack::kind):
+        (TextTrack):
+        (WebCore::TextTrack::label):
+        (WebCore::TextTrack::setLabel):
+        (WebCore::TextTrack::language):
+        (WebCore::TextTrack::setLanguage):
+        * html/track/TextTrackCue.cpp:
+        (WebCore::TextTrackCueBox::TextTrackCueBox):
+        (WebCore::TextTrackCueBox::shadowPseudoId):
+        (WebCore):
+        (WebCore::TextTrackCue::updateDisplayTree):
+        * html/track/TextTrackCue.h:
+        (TextTrackCueBox):
+        (TextTrackCue):
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+        * rendering/CaptionPreferencesChangedListener.h: Removed.
+        * rendering/RenderTheme.h:
+        (WebCore):
+        (RenderTheme):
+        * rendering/RenderThemeMac.h:
+        (RenderThemeMac):
+        * rendering/RenderThemeMac.mm:
+        (WebCore):
+        (WebCore::RenderThemeMac::RenderThemeMac):
+        (WebCore::RenderThemeMac::~RenderThemeMac):
+
 2012-10-05  Tim Horton  <timothy_horton@apple.com>
 
         [cg] GraphicsContextCG should ask CG whether the shadow offset workaround is required
index 8c51261..5f87aab 100644 (file)
@@ -2585,18 +2585,3 @@ __ZN7WebCore27AlternativeTextUIController16showAlternativesEP6NSViewRKNS_9FloatR
 __ZN7WebCore24TextAlternativeWithRangeC1EP18NSTextAlternatives8_NSRange
 __ZN7WebCore32collectDictationTextAlternativesEP18NSAttributedStringRN3WTF6VectorINS_24TextAlternativeWithRangeELm0EEE
 #endif
-
-#if ENABLE(VIDEO_TRACK)
-_wkCaptionAppearanceHasUserPreferences
-_wkCaptionAppearanceShowCaptionsWhenAvailable
-_wkCaptionAppearanceCopyForegroundColor
-_wkCaptionAppearanceCopyBackgroundColor
-_wkCaptionAppearanceCopyWindowColor
-_wkCaptionAppearanceGetForegroundOpacity
-_wkCaptionAppearanceGetBackgroundOpacity
-_wkCaptionAppearanceGetWindowOpacity
-_wkCaptionAppearanceCopyFontForStyle
-_wkCaptionAppearanceGetRelativeCharacterSize
-_wkCaptionAppearanceGetTextEdgeStyle
-_wkCaptionAppearanceGetSettingsChangedNotification
-#endif
index e0411d4..cb7bd65 100644 (file)
                CAE9F910146441F000C245B1 /* CSSVariableValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B1 /* CSSVariableValue.h */; };
                CD127DED14F3097D00E84779 /* WebCoreFullScreenWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD127DEB14F3097900E84779 /* WebCoreFullScreenWindow.mm */; };
                CD127DEE14F3098400E84779 /* WebCoreFullScreenWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = CD127DEA14F3097900E84779 /* WebCoreFullScreenWindow.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               CD2565BA161E46A90055634D /* CaptionPreferencesChangedListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EC38B816154C1A00E8146D /* CaptionPreferencesChangedListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CD27F6E51457685A0078207D /* JSMediaController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD27F6E2145767580078207D /* JSMediaController.cpp */; };
                CD27F6E7145770D30078207D /* MediaController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD27F6E6145770D30078207D /* MediaController.cpp */; };
                CD37B39815C1B971006DC898 /* DiagnosticLoggingKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD37B37415C1A7E1006DC898 /* DiagnosticLoggingKeys.cpp */; };
                07E116B01489C9A100EC5ACE /* JSTextTrackCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextTrackCustom.cpp; sourceTree = "<group>"; };
                07E117061489EBEB00EC5ACE /* JSTextTrackCueCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextTrackCueCustom.cpp; sourceTree = "<group>"; };
                07E38A0B148FCF0C006E1ECC /* JSTextTrackCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTextTrackCustom.h; sourceTree = "<group>"; };
-               07EC38B816154C1A00E8146D /* CaptionPreferencesChangedListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CaptionPreferencesChangedListener.h; sourceTree = "<group>"; };
                0806E57912893045007CED32 /* SVGMatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMatrix.h; sourceTree = "<group>"; };
                080E49211255F3BD00EFCA27 /* SVGTextLayoutEngineBaseline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextLayoutEngineBaseline.cpp; sourceTree = "<group>"; };
                080E49221255F3BD00EFCA27 /* SVGTextLayoutEngineBaseline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutEngineBaseline.h; sourceTree = "<group>"; };
                                BCE789851120E7A60060ECE5 /* BidiRun.h */,
                                BCEA4815097D93020094C9E4 /* break_lines.cpp */,
                                BCEA4816097D93020094C9E4 /* break_lines.h */,
-                               07EC38B816154C1A00E8146D /* CaptionPreferencesChangedListener.h */,
                                BCDD454D1236C95C009A7985 /* ColumnInfo.h */,
                                9392F14F0AD1862300691BD4 /* CounterNode.cpp */,
                                9392F14B0AD1861B00691BD4 /* CounterNode.h */,
                                931CBD0D161A44E900E4C874 /* ScrollingStateNode.h in Headers */,
                                931CBD0F161A44E900E4C874 /* ScrollingStateScrollingNode.h in Headers */,
                                931CBD11161A44E900E4C874 /* ScrollingStateTree.h in Headers */,
-                               CD2565BA161E46A90055634D /* CaptionPreferencesChangedListener.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 6df0340..81b0e16 100644 (file)
@@ -216,7 +216,7 @@ video::-webkit-media-text-track-container {
     font-size: 22px;
     font-family: sans-serif;
     text-align: center;
-    color: rgba(255, 255, 255, 1);
+    color: rgba(255, 255, 255, 0);
 
     letter-spacing: normal;
     word-spacing: normal;
@@ -234,6 +234,8 @@ video::-webkit-media-text-track-past-nodes {
 
     background-color: rgba(0, 0, 0, 0.8);
     padding: 2px 2px;
+
+    white-space: pre-wrap;
 }
 
 video::-webkit-media-text-track-future-nodes {
@@ -244,10 +246,11 @@ video::-webkit-media-text-track-future-nodes {
 
     margin-left: -2px;
     padding: 2px 2px 2px 0px;
+
+    white-space: pre-wrap;
 }
 
 video::-webkit-media-text-track-display {
     position: absolute;
-    overflow: hidden;
-    white-space: pre-wrap;
+    color: rgba(255, 255, 255, 1);
 }
index bc8c509..471616a 100644 (file)
@@ -69,7 +69,6 @@
 #include "MIMETypeRegistry.h"
 #include "NodeRenderingContext.h"
 #include "Page.h"
-#include "RenderTheme.h"
 #include "RenderVideo.h"
 #include "RenderView.h"
 #include "ScriptController.h"
@@ -282,14 +281,6 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* docum
 
     setHasCustomCallbacks();
     addElementToDocumentMap(this, document);
-
-#if ENABLE(VIDEO_TRACK)
-    if (document->page()) {
-        RenderTheme* theme = document->page()->theme();
-        if (theme->userHasCaptionPreferences())
-            m_disableCaptions = !theme->userPrefersCaptions();
-    }
-#endif
 }
 
 HTMLMediaElement::~HTMLMediaElement()
@@ -550,20 +541,6 @@ void HTMLMediaElement::attach()
             frame->loader()->client()->hideMediaPlayerProxyPlugin(m_proxyWidget.get());
     }
 #endif
-
-#if ENABLE(VIDEO_TRACK)
-    if (document()->page())
-        document()->page()->theme()->registerForCaptionPreferencesChangedCallbacks(this);
-#endif
-}
-
-void HTMLMediaElement::detach()
-{
-#if ENABLE(VIDEO_TRACK)
-    if (document()->page())
-        document()->page()->theme()->unregisterForCaptionPreferencesChangedCallbacks(this);
-#endif
-    HTMLElement::detach();
 }
 
 void HTMLMediaElement::didRecalcStyle(StyleChange)
@@ -2806,30 +2783,28 @@ void HTMLMediaElement::willRemoveTrack(HTMLTrackElement* trackElement)
         m_textTracksWhenResourceSelectionBegan.remove(index);
 }
 
-bool HTMLMediaElement::userPrefersCaptions() const
+bool HTMLMediaElement::userIsInterestedInThisLanguage(const String&) const
 {
-    Page* page = document()->page();
-    if (!page)
-        return false;
-
-    RenderTheme* theme = page->theme();
-    return theme->userHasCaptionPreferences() && theme->userPrefersCaptions();
+    // FIXME: check the user's language preference - bugs.webkit.org/show_bug.cgi?id=74121
+    return true;
 }
 
 bool HTMLMediaElement::userIsInterestedInThisTrackKind(String kind) const
 {
+    // If ... the user has indicated an interest in having a track with this text track kind, text track language, ... 
     if (m_disableCaptions)
         return false;
 
     Settings* settings = document()->settings();
-    bool userPrefersCaptionsOrSubtitles = m_closedCaptionsVisible || userPrefersCaptions();
+    if (!settings)
+        return false;
 
     if (kind == TextTrack::subtitlesKeyword())
-        return (settings && settings->shouldDisplaySubtitles()) || userPrefersCaptionsOrSubtitles;
+        return settings->shouldDisplaySubtitles() || m_closedCaptionsVisible;
     if (kind == TextTrack::captionsKeyword())
-        return (settings && settings->shouldDisplayCaptions()) || userPrefersCaptionsOrSubtitles;
+        return settings->shouldDisplayCaptions() || m_closedCaptionsVisible;
     if (kind == TextTrack::descriptionsKeyword())
-        return settings && settings->shouldDisplayTextDescriptions();
+        return settings->shouldDisplayTextDescriptions() || m_closedCaptionsVisible;
 
     return false;
 }
@@ -3994,12 +3969,22 @@ void HTMLMediaElement::setClosedCaptionsVisible(bool closedCaptionVisible)
 #if ENABLE(VIDEO_TRACK)
     if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) {
         m_disableCaptions = !m_closedCaptionsVisible;
+        
+        // Mark all track elements as not "configured" so that configureTextTracks()
+        // will reconsider which tracks to display in light of new user preferences
+        // (e.g. default tracks should not be displayed if the user has turned off
+        // captions and non-default tracks should be displayed based on language
+        // preferences if the user has turned captions on).
+        for (Node* node = firstChild(); node; node = node->nextSibling()) {
+            if (!node->hasTagName(trackTag))
+                continue;
+            HTMLTrackElement* trackElement = static_cast<HTMLTrackElement*>(node);
+            if (trackElement->kind() == TextTrack::captionsKeyword()
+                || trackElement->kind() == TextTrack::subtitlesKeyword())
+                trackElement->setHasBeenConfigured(false);
+        }
 
-        markCaptionAndSubtitleTracksAsUnconfigured();
         configureTextTracks();
-
-        if (!m_disableCaptions && (hasMediaControls() || createMediaControls()))
-            mediaControls()->userCaptionPreferencesChanged();
     }
 #else
     if (hasMediaControls())
@@ -4187,43 +4172,6 @@ void HTMLMediaElement::updateClosedCaptionsControls()
             mediaControls()->updateTextTrackDisplay();
     }
 }
-
-void HTMLMediaElement::captionPreferencesChanged()
-{
-    if (!isVideo())
-        return;
-
-    markCaptionAndSubtitleTracksAsUnconfigured();
-    configureTextTracks();
-
-    if (!hasMediaControls() && !createMediaControls())
-        return;
-    mediaControls()->userCaptionPreferencesChanged();
-}
-
-void HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured()
-{
-    // Mark all track elements as not "configured" so that configureTextTracks()
-    // will reconsider which tracks to display in light of new user preferences
-    // (e.g. default tracks should not be displayed if the user has turned off
-    // captions and non-default tracks should be displayed based on language
-    // preferences if the user has turned captions on).
-    for (RefPtr<Node> node = firstChild(); node; node = node->nextSibling()) {
-        if (!node->hasTagName(trackTag))
-            continue;
-        
-        HTMLTrackElement* trackElement = static_cast<HTMLTrackElement*>(node.get());
-        RefPtr<TextTrack> textTrack = trackElement->track();
-        if (!textTrack)
-            continue;
-        
-        String kind = textTrack->kind();
-
-        if (kind == TextTrack::subtitlesKeyword() || kind == TextTrack::captionsKeyword())
-            trackElement->setHasBeenConfigured(false);
-    }
-}
-
 #endif
 
 void* HTMLMediaElement::preDispatchEventHandler(Event* event)
index 7e84b75..821e228 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "HTMLElement.h"
 #include "ActiveDOMObject.h"
-#include "CaptionPreferencesChangedListener.h"
 #include "GenericEventQueue.h"
 #include "MediaCanStartListener.h"
 #include "MediaControllerInterface.h"
@@ -79,7 +78,7 @@ typedef Vector<CueIntervalTree::IntervalType> CueList;
 
 class HTMLMediaElement : public HTMLElement, public MediaPlayerClient, public MediaPlayerSupportsTypeClient, private MediaCanStartListener, public ActiveDOMObject, public MediaControllerInterface
 #if ENABLE(VIDEO_TRACK)
-    , private TextTrackClient, private CaptionPreferencesChangedListener
+    , private TextTrackClient
 #endif
 {
 public:
@@ -241,7 +240,6 @@ public:
     void configureTextTracks();
     void configureTextTrackGroup(const TrackGroup&) const;
 
-    bool userPrefersCaptions() const;
     bool userIsInterestedInThisTrackKind(String) const;
     bool textTracksAreReady() const;
     void configureTextTrackDisplay();
@@ -327,8 +325,7 @@ protected:
     virtual void parseAttribute(const Attribute&) OVERRIDE;
     virtual void finishParsingChildren();
     virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
-    virtual void attach() OVERRIDE;
-    virtual void detach() OVERRIDE;
+    virtual void attach();
 
     virtual void didMoveToNewDocument(Document* oldDocument) OVERRIDE;
 
@@ -477,14 +474,12 @@ private:
 
 #if ENABLE(VIDEO_TRACK)
     void updateActiveTextTrackCues(float);
+    bool userIsInterestedInThisLanguage(const String&) const;
     HTMLTrackElement* showingTrackWithSameKind(HTMLTrackElement*) const;
 
     bool ignoreTrackDisplayUpdateRequests() const { return m_ignoreTrackDisplayUpdate > 0; }
     void beginIgnoringTrackDisplayUpdateRequests() { ++m_ignoreTrackDisplayUpdate; }
     void endIgnoringTrackDisplayUpdateRequests() { ASSERT(m_ignoreTrackDisplayUpdate); --m_ignoreTrackDisplayUpdate; }
-
-    void markCaptionAndSubtitleTracksAsUnconfigured();
-    virtual void captionPreferencesChanged() OVERRIDE;
 #endif
 
     // These "internal" functions do not check user gesture restrictions.
index c51931b..881c2de 100644 (file)
 #include "HTMLVideoElement.h"
 #include "LayoutRepainter.h"
 #include "LocalizedStrings.h"
-#include "MediaControlRootElement.h"
 #include "MediaControls.h"
 #include "MouseEvent.h"
 #include "Page.h"
-#include "PageGroup.h"
 #include "RenderDeprecatedFlexibleBox.h"
 #include "RenderInline.h"
 #include "RenderMedia.h"
@@ -1312,32 +1310,6 @@ const AtomicString& MediaControlTextTrackContainerElement::shadowPseudoId() cons
     return id;
 }
 
-void MediaControlTextTrackContainerElement::userCaptionPreferencesChanged()
-{
-    DEFINE_STATIC_LOCAL(KURL, captionsStyleSheetURL, (ParsedURLString, "user-captions-override:01F6AF12-C3B0-4F70-AF5E-A3E00234DC23"));
-
-    Page* page = document()->page();
-    if (!page)
-        return;
-
-    RenderTheme* theme = page->theme();
-    HTMLMediaElement* mediaElement = toParentMediaElement(this);
-
-    mediaElement->setNeedsStyleRecalc();
-
-    page->group().removeUserStyleSheetFromWorld(mainThreadNormalWorld(), captionsStyleSheetURL);
-
-    if (!mediaElement->closedCaptionsVisible() && !theme->userHasCaptionPreferences())
-        return;
-
-    String captionsOverrideStyleSheet = theme->captionsStyleSheetOverride();
-    if (captionsOverrideStyleSheet.isEmpty())
-        return;
-
-    page->group().addUserStyleSheetToWorld(mainThreadNormalWorld(), captionsOverrideStyleSheet, captionsStyleSheetURL, adoptPtr(new Vector<String>), adoptPtr(new Vector<String>), 
-        InjectInAllFrames, UserStyleAuthorLevel, InjectInExistingDocuments);
-}
-
 void MediaControlTextTrackContainerElement::updateDisplay()
 {
     HTMLMediaElement* mediaElement = toParentMediaElement(this);
@@ -1404,18 +1376,22 @@ void MediaControlTextTrackContainerElement::updateDisplay()
     hasChildNodes() ? show() : hide();
 }
 
+static const float mimimumFontSize = 16;
+static const float videoHeightFontSizePercentage = .05;
+static const float trackBottomMultiplier = .9;
+
 void MediaControlTextTrackContainerElement::updateSizes()
 {
     HTMLMediaElement* mediaElement = toParentMediaElement(this);
     if (!mediaElement || !mediaElement->renderer() || !mediaElement->renderer()->isVideo())
         return;
 
-    if (!document()->page())
-        return;
-
     IntRect videoBox = toRenderVideo(mediaElement->renderer())->videoBox();
+    if (m_videoDisplaySize == videoBox)
+        return;
+    m_videoDisplaySize = videoBox;
 
-    float fontSize = videoBox.size().height() * (document()->page()->theme()->captionFontSizeScale());
+    float fontSize = m_videoDisplaySize.size().height() * videoHeightFontSizePercentage;
     if (fontSize != m_fontSize) {
         m_fontSize = fontSize;
         setInlineStyleProperty(CSSPropertyFontSize, String::number(fontSize) + "px");
index 7c7c5dd..effdcee 100644 (file)
@@ -537,7 +537,6 @@ class MediaControlTextTrackContainerElement : public MediaControlElement {
 public:
     static PassRefPtr<MediaControlTextTrackContainerElement> create(Document*);
 
-    void userCaptionPreferencesChanged();
     void updateDisplay();
     void updateSizes();
 
@@ -548,8 +547,7 @@ private:
     virtual MediaControlElementType displayType() const { return MediaTextTrackDisplayContainer; }
     virtual const AtomicString& shadowPseudoId() const;
 
-    void updateCaptionAppearance();
-
+    IntRect m_videoDisplaySize;
     float m_fontSize;
 };
 
index 0368e87..ef541ba 100644 (file)
@@ -630,12 +630,6 @@ void MediaControlRootElement::createTextTrackDisplay()
     insertBefore(textDisplayContainer.release(), m_panel, ec, true);
 }
 
-void MediaControlRootElement::userCaptionPreferencesChanged()
-{
-    if (m_textDisplayContainer)
-        m_textDisplayContainer->userCaptionPreferencesChanged();
-}
-
 void MediaControlRootElement::showTextTrackDisplay()
 {
     if (!m_textDisplayContainer)
@@ -656,6 +650,7 @@ void MediaControlRootElement::updateTextTrackDisplay()
         createTextTrackDisplay();
 
     m_textDisplayContainer->updateDisplay();
+
 }
 #endif
 
index 9010e10..a0b09d8 100644 (file)
@@ -105,10 +105,9 @@ public:
 
 #if ENABLE(VIDEO_TRACK)
     void createTextTrackDisplay();
-    virtual void userCaptionPreferencesChanged() OVERRIDE;
-    virtual void showTextTrackDisplay() OVERRIDE;
-    virtual void hideTextTrackDisplay() OVERRIDE;
-    virtual void updateTextTrackDisplay() OVERRIDE;
+    void showTextTrackDisplay();
+    void hideTextTrackDisplay();
+    void updateTextTrackDisplay();
 #endif
 
     virtual bool shouldHideControls();
index 8a99bc1..28908a9 100644 (file)
@@ -73,7 +73,6 @@ class MediaControls : public HTMLDivElement {
     virtual bool shouldHideControls() = 0;
 
 #if ENABLE(VIDEO_TRACK)
-    virtual void userCaptionPreferencesChanged() { };
     virtual void showTextTrackDisplay() = 0;
     virtual void hideTextTrackDisplay() = 0;
     virtual void updateTextTrackDisplay() = 0;
index 1b35efc..6abcacc 100644 (file)
@@ -94,7 +94,7 @@ const AtomicString& TextTrack::showingKeyword()
     return ended;
 }
 
-TextTrack::TextTrack(ScriptExecutionContext* context, TextTrackClient* client, const AtomicString& kind, const AtomicString& label, const AtomicString& language, TextTrackType type)
+TextTrack::TextTrack(ScriptExecutionContext* context, TextTrackClient* client, const String& kind, const String& label, const String& language, TextTrackType type)
     : TrackBase(context, TrackBase::TextTrack)
     , m_cues(0)
     , m_mediaElement(0)
@@ -117,7 +117,7 @@ TextTrack::~TextTrack()
     clearClient();
 }
 
-bool TextTrack::isValidKindKeyword(const AtomicString& value)
+bool TextTrack::isValidKindKeyword(const String& value)
 {
     if (equalIgnoringCase(value, subtitlesKeyword()))
         return true;
@@ -133,7 +133,7 @@ bool TextTrack::isValidKindKeyword(const AtomicString& value)
     return false;
 }
 
-void TextTrack::setKind(const AtomicString& kind)
+void TextTrack::setKind(const String& kind)
 {
     String oldKind = m_kind;
 
@@ -146,7 +146,7 @@ void TextTrack::setKind(const AtomicString& kind)
         m_client->textTrackKindChanged(this);
 }
 
-void TextTrack::setMode(const AtomicString& mode)
+void TextTrack::setMode(const String& mode)
 {
     // On setting, if the new value isn't equal to what the attribute would currently
     // return, the new value must be processed as follows ...
@@ -174,7 +174,7 @@ void TextTrack::setMode(const AtomicString& mode)
         m_client->textTrackModeChanged(this);
 }
 
-AtomicString TextTrack::mode() const
+String TextTrack::mode() const
 {
     // The text track "showing" and "showing by default" modes return the string "showing".
     if (m_showingByDefault)
index 3ba4d37..2c799ed 100644 (file)
@@ -54,7 +54,7 @@ public:
 
 class TextTrack : public TrackBase {
 public:
-    static PassRefPtr<TextTrack> create(ScriptExecutionContext* context, TextTrackClient* client, const AtomicString& kind, const AtomicString& label, const AtomicString& language)
+    static PassRefPtr<TextTrack> create(ScriptExecutionContext* context, TextTrackClient* client, const String& kind, const String& label, const String& language)
     {
         return adoptRef(new TextTrack(context, client, kind, label, language, AddTrack));
     }
@@ -63,28 +63,28 @@ public:
     void setMediaElement(HTMLMediaElement* element) { m_mediaElement = element; }
     HTMLMediaElement* mediaElement() { return m_mediaElement; }
 
-    AtomicString kind() const { return m_kind; }
-    void setKind(const AtomicString&);
+    String kind() const { return m_kind; }
+    void setKind(const String&);
 
     static const AtomicString& subtitlesKeyword();
     static const AtomicString& captionsKeyword();
     static const AtomicString& descriptionsKeyword();
     static const AtomicString& chaptersKeyword();
     static const AtomicString& metadataKeyword();
-    static bool isValidKindKeyword(const AtomicString&);
+    static bool isValidKindKeyword(const String&);
 
-    AtomicString label() const { return m_label; }
-    void setLabel(const AtomicString& label) { m_label = label; }
+    String label() const { return m_label; }
+    void setLabel(const String& label) { m_label = label; }
 
-    AtomicString language() const { return m_language; }
-    void setLanguage(const AtomicString& language) { m_language = language; }
+    String language() const { return m_language; }
+    void setLanguage(const String& language) { m_language = language; }
 
     static const AtomicString& disabledKeyword();
     static const AtomicString& hiddenKeyword();
     static const AtomicString& showingKeyword();
 
-    AtomicString mode() const;
-    void setMode(const AtomicString&);
+    String mode() const;
+    void setMode(const String&);
 
     bool showingByDefault() const { return m_showingByDefault; }
     void setShowingByDefault(bool showing) { m_showingByDefault = showing; }
@@ -116,17 +116,17 @@ public:
     bool isRendered();
 
 protected:
-    TextTrack(ScriptExecutionContext*, TextTrackClient*, const AtomicString& kind, const AtomicString& label, const AtomicString& language, TextTrackType);
+    TextTrack(ScriptExecutionContext*, TextTrackClient*, const String& kind, const String& label, const String& language, TextTrackType);
 
     RefPtr<TextTrackCueList> m_cues;
 
 private:
     TextTrackCueList* ensureTextTrackCueList();
     HTMLMediaElement* m_mediaElement;
-    AtomicString m_kind;
-    AtomicString m_label;
-    AtomicString m_language;
-    AtomicString m_mode;
+    String m_kind;
+    String m_label;
+    String m_language;
+    String m_mode;
     TextTrackClient* m_client;
     TextTrackType m_trackType;
     ReadinessState m_readinessState;
index bb73445..2fd4f1d 100644 (file)
@@ -95,7 +95,6 @@ TextTrackCueBox::TextTrackCueBox(Document* document, TextTrackCue* cue)
     : HTMLElement(divTag, document)
     , m_cue(cue)
 {
-    setShadowPseudoId(shadowPseudoId());
 }
 
 TextTrackCue* TextTrackCueBox::getCue() const
@@ -168,17 +167,12 @@ void TextTrackCueBox::applyCSSProperties()
     }
 }
 
-const AtomicString& TextTrackCueBox::textTrackCueBoxShadowPseudoId()
+const AtomicString& TextTrackCueBox::shadowPseudoId() const
 {
     DEFINE_STATIC_LOCAL(const AtomicString, trackDisplayBoxShadowPseudoId, ("-webkit-media-text-track-display"));
     return trackDisplayBoxShadowPseudoId;
 }
 
-const AtomicString& TextTrackCueBox::shadowPseudoId() const
-{
-    return textTrackCueBoxShadowPseudoId();
-}
-
 RenderObject* TextTrackCueBox::createRenderer(RenderArena* arena, RenderStyle*)
 {
     return new (arena) RenderTextTrackCue(this);
@@ -186,18 +180,6 @@ RenderObject* TextTrackCueBox::createRenderer(RenderArena* arena, RenderStyle*)
 
 // ----------------------------
 
-const AtomicString& TextTrackCue::pastNodesShadowPseudoId()
-{
-    DEFINE_STATIC_LOCAL(const AtomicString, subtitles, ("-webkit-media-text-track-past-nodes", AtomicString::ConstructFromLiteral));
-    return subtitles;
-}
-
-const AtomicString& TextTrackCue::futureNodesShadowPseudoId()
-{
-    DEFINE_STATIC_LOCAL(const AtomicString, subtitles, ("-webkit-media-text-track-future-nodes", AtomicString::ConstructFromLiteral));
-    return subtitles;
-}
-
 TextTrackCue::TextTrackCue(ScriptExecutionContext* context, double start, double end, const String& content)
     : m_startTime(start)
     , m_endTime(end)
@@ -670,6 +652,9 @@ void TextTrackCue::updateDisplayTree(float movieTime)
     // timestamps (processing instructions), along with displayable nodes.
     DEFINE_STATIC_LOCAL(const String, timestampTag, (ASCIILiteral("timestamp")));
 
+    DEFINE_STATIC_LOCAL(const AtomicString, trackPastNodesShadowPseudoId, ("-webkit-media-text-track-past-nodes"));
+    DEFINE_STATIC_LOCAL(const AtomicString, trackFutureNodesShadowPseudoId, ("-webkit-media-text-track-future-nodes"));
+
     if (!track()->isRendered())
       return;
 
@@ -677,10 +662,10 @@ void TextTrackCue::updateDisplayTree(float movieTime)
 
     // Clear the contents of the two sets.
     m_futureDocumentNodes->removeChildren();
-    m_futureDocumentNodes->setShadowPseudoId(futureNodesShadowPseudoId());
+    m_futureDocumentNodes->setShadowPseudoId(trackFutureNodesShadowPseudoId);
 
     m_pastDocumentNodes->removeChildren();
-    m_pastDocumentNodes->setShadowPseudoId(pastNodesShadowPseudoId());
+    m_pastDocumentNodes->setShadowPseudoId(trackPastNodesShadowPseudoId);
 
     // Update the two sets containing past and future WebVTT objects.
     RefPtr<DocumentFragment> referenceTree = getCueAsHTML();
index 3e29d1e..115a868 100644 (file)
@@ -60,7 +60,6 @@ public:
     void applyCSSProperties();
 
     virtual const AtomicString& shadowPseudoId() const OVERRIDE;
-    static const AtomicString& textTrackCueBoxShadowPseudoId();
 
 private:
     TextTrackCueBox(Document*, TextTrackCue*);
@@ -81,9 +80,6 @@ public:
 
     virtual ~TextTrackCue();
 
-    static const AtomicString& pastNodesShadowPseudoId();
-    static const AtomicString& futureNodesShadowPseudoId();
-
     TextTrack* track() const;
     void setTrack(PassRefPtr<TextTrack>);
 
index d8f6156..e9ca37a 100644 (file)
@@ -333,40 +333,6 @@ extern CGFloat (*wkNSElasticDeltaForReboundDelta)(CGFloat delta);
 extern CGFloat (*wkNSReboundDeltaForElasticDelta)(CGFloat delta);
 #endif
 
-typedef enum {
-    wkCaptionFontStyleDefault = 0,
-    wkCaptionFontStyleMonospacedWithSerif,
-    wkCaptionFontStyleProportionalWithSerif,
-    wkCaptionFontStyleMonospacedWithoutSerif,
-    wkCaptionFontStyleProportionalWithoutSerif,
-    wkCaptionFontStyleCasual,
-    wkCaptionFontStyleCursive,
-    wkCaptionFontStyleSmallCapital,
-    wkCaptionFontStyleMax
-} wkCaptionFontStyle;
-
-typedef enum {
-    wkCaptionTextEdgeStyleUndefined = 0,
-    wkCaptionTextEdgeStyleNone,
-    wkCaptionTextEdgeStyleRaised,
-    wkCaptionTextEdgeStyleDepressed,
-    wkCaptionTextEdgeStyleUniform,
-    wkCaptionTextEdgeStyleDropShadow,
-    wkCaptionTextEdgeStyleMax
-} wkCaptionTextEdgeStyle;
-
-extern bool (*wkCaptionAppearanceHasUserPreferences)(void);
-extern bool (*wkCaptionAppearanceShowCaptionsWhenAvailable)(void);
-extern CGColorRef(*wkCaptionAppearanceCopyForegroundColor)(void);
-extern CGColorRef(*wkCaptionAppearanceCopyBackgroundColor)(void);
-extern CGColorRef(*wkCaptionAppearanceCopyWindowColor)(void);
-extern bool(*wkCaptionAppearanceGetForegroundOpacity)(CGFloat*);
-extern bool(*wkCaptionAppearanceGetBackgroundOpacity)(CGFloat*);
-extern bool(*wkCaptionAppearanceGetWindowOpacity)(CGFloat*);
-extern CGFontRef(*wkCaptionAppearanceCopyFontForStyle)(int);
-extern bool(*wkCaptionAppearanceGetRelativeCharacterSize)(CGFloat*);
-extern int(*wkCaptionAppearanceGetTextEdgeStyle)(void);
-extern CFStringRef(*wkCaptionAppearanceGetSettingsChangedNotification)(void);
 }
 
 #endif
index 522f5ec..f1aef27 100644 (file)
@@ -212,15 +212,3 @@ CGFloat (*wkNSElasticDeltaForReboundDelta)(CGFloat delta);
 CGFloat (*wkNSReboundDeltaForElasticDelta)(CGFloat delta);
 #endif
 
-bool (*wkCaptionAppearanceHasUserPreferences)(void);
-bool (*wkCaptionAppearanceShowCaptionsWhenAvailable)(void);
-CGColorRef(*wkCaptionAppearanceCopyForegroundColor)(void);
-CGColorRef(*wkCaptionAppearanceCopyBackgroundColor)(void);
-CGColorRef(*wkCaptionAppearanceCopyWindowColor)(void);
-bool(*wkCaptionAppearanceGetForegroundOpacity)(CGFloat*);
-bool(*wkCaptionAppearanceGetBackgroundOpacity)(CGFloat*);
-bool(*wkCaptionAppearanceGetWindowOpacity)(CGFloat*);
-CGFontRef(*wkCaptionAppearanceCopyFontForStyle)(int);
-bool(*wkCaptionAppearanceGetRelativeCharacterSize)(CGFloat*);
-int(*wkCaptionAppearanceGetTextEdgeStyle)(void);
-CFStringRef(*wkCaptionAppearanceGetSettingsChangedNotification)(void);
diff --git a/Source/WebCore/rendering/CaptionPreferencesChangedListener.h b/Source/WebCore/rendering/CaptionPreferencesChangedListener.h
deleted file mode 100644 (file)
index 468f219..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef CaptionPreferencesChangedListener_h
-#define CaptionPreferencesChangedListener_h
-
-namespace WebCore {
-
-class CaptionPreferencesChangedListener {
-public:
-    virtual void captionPreferencesChanged() = 0;
-protected:
-    virtual ~CaptionPreferencesChangedListener() { }
-};
-
-}
-
-#endif
index 3217044..36e49f2 100644 (file)
@@ -46,9 +46,6 @@ class RenderMeter;
 #if ENABLE(PROGRESS_ELEMENT)
 class RenderProgress;
 #endif
-#if ENABLE(VIDEO_TRACK)
-class CaptionPreferencesChangedListener;
-#endif
 class CSSStyleSheet;
 
 class RenderTheme : public RefCounted<RenderTheme> {
@@ -233,15 +230,6 @@ public:
     void paintSliderTicks(RenderObject*, const PaintInfo&, const IntRect&);
 #endif
 
-#if ENABLE(VIDEO_TRACK)
-    virtual bool userPrefersCaptions() const { return false; }
-    virtual bool userHasCaptionPreferences() const { return false; }
-    virtual float captionFontSizeScale() const { return 0.05; }
-    virtual String captionsStyleSheetOverride() const { return emptyString(); }
-    virtual void registerForCaptionPreferencesChangedCallbacks(CaptionPreferencesChangedListener*) { }
-    virtual void unregisterForCaptionPreferencesChangedCallbacks(CaptionPreferencesChangedListener*) { }
-#endif
-
     virtual bool shouldShowPlaceholderWhenFocused() const { return false; }
     virtual bool shouldHaveSpinButton(HTMLInputElement*) const;
 
index 44f1d62..7ad49bd 100644 (file)
@@ -101,11 +101,6 @@ public:
     virtual bool usesTestModeFocusRingColor() const;
     // A view associated to the contained document. Subclasses may not have such a view and return a fake.
     virtual NSView* documentViewFor(RenderObject*) const;
-
-#if ENABLE(VIDEO_TRACK)
-    void captionPreferencesChanged();
-#endif
-
 protected:
     RenderThemeMac();
     virtual ~RenderThemeMac();
@@ -183,15 +178,6 @@ protected:
     virtual void adjustMediaSliderThumbSize(RenderStyle*) const;
     virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const OVERRIDE;
 #endif
-
-#if ENABLE(VIDEO_TRACK)
-    virtual bool userPrefersCaptions() const OVERRIDE;
-    virtual bool userHasCaptionPreferences() const OVERRIDE;
-    virtual float captionFontSizeScale() const OVERRIDE;
-    virtual String captionsStyleSheetOverride() const OVERRIDE;
-    virtual void registerForCaptionPreferencesChangedCallbacks(CaptionPreferencesChangedListener*) OVERRIDE;
-    virtual void unregisterForCaptionPreferencesChangedCallbacks(CaptionPreferencesChangedListener*) OVERRIDE;
-#endif
     
     virtual bool shouldShowPlaceholderWhenFocused() const;
 
@@ -251,17 +237,6 @@ private:
     const int* progressBarMargins(NSControlSize) const;
 #endif
 
-#if ENABLE(VIDEO_TRACK)
-    Color captionsWindowColor() const;
-    Color captionsBackgroundColor() const;
-    Color captionsTextColor() const;
-    String captionsDefaultFont() const;
-    Color captionsEdgeColorForTextColor(const Color&) const;
-    String captionsTextEdgeStyle() const;
-    String cssPropertyWithTextEdgeColor(CSSPropertyID, const String&, const Color&) const;
-    String cssColorProperty(CSSPropertyID, const Color&) const;
-#endif
-
 private:
     mutable RetainPtr<NSPopUpButtonCell> m_popupButton;
     mutable RetainPtr<NSSearchFieldCell> m_search;
@@ -277,11 +252,6 @@ private:
     mutable HashMap<int, RGBA32> m_systemColorCache;
 
     RetainPtr<WebCoreRenderThemeNotificationObserver> m_notificationObserver;
-
-#if ENABLE(VIDEO_TRACK)
-    HashSet<CaptionPreferencesChangedListener*> m_captionPreferenceChangeListeners;
-    bool m_listeningForCaptionPreferenceNotifications;
-#endif
 };
 
 } // namespace WebCore
index 49c4920..0bc9804 100644 (file)
@@ -27,7 +27,6 @@
 #import "Document.h"
 #import "Element.h"
 #import "FileList.h"
-#import "FloatConversion.h"
 #import "FrameView.h"
 #import "GraphicsContextCG.h"
 #import "HTMLInputElement.h"
@@ -152,11 +151,6 @@ PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page*)
 }
 #endif
 
-static void userCaptionPreferencesChangedNotificationCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void *, CFDictionaryRef)
-{
-    static_cast<RenderThemeMac*>(observer)->captionPreferencesChanged();
-}
-
 PassRefPtr<RenderTheme> RenderThemeMac::create()
 {
     return adoptRef(new RenderThemeMac);
@@ -166,9 +160,6 @@ RenderThemeMac::RenderThemeMac()
     : m_isSliderThumbHorizontalPressed(false)
     , m_isSliderThumbVerticalPressed(false)
     , m_notificationObserver(AdoptNS, [[WebCoreRenderThemeNotificationObserver alloc] initWithTheme:this])
-#if ENABLE(VIDEO_TRACK)
-    , m_listeningForCaptionPreferenceNotifications(false)
-#endif
 {
     [[NSNotificationCenter defaultCenter] addObserver:m_notificationObserver.get()
                                                         selector:@selector(systemColorsDidChange:)
@@ -179,11 +170,6 @@ RenderThemeMac::RenderThemeMac()
 RenderThemeMac::~RenderThemeMac()
 {
     [[NSNotificationCenter defaultCenter] removeObserver:m_notificationObserver.get()];
-
-#if ENABLE(VIDEO_TRACK)
-    if (m_listeningForCaptionPreferenceNotifications)
-        CFNotificationCenterRemoveObserver(CFNotificationCenterGetLocalCenter(), this, wkCaptionAppearanceGetSettingsChangedNotification(), NULL);
-#endif
 }
 
 Color RenderThemeMac::platformActiveSelectionBackgroundColor() const
@@ -2142,255 +2128,6 @@ IntPoint RenderThemeMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonB
     return RenderMediaControls::volumeSliderOffsetFromMuteButton(muteButtonBox, size);
 }
 
-#if ENABLE(VIDEO_TRACK)
-bool RenderThemeMac::userHasCaptionPreferences() const
-{
-    return wkCaptionAppearanceHasUserPreferences();
-}
-
-bool RenderThemeMac::userPrefersCaptions() const
-{
-    return wkCaptionAppearanceShowCaptionsWhenAvailable();
-}
-
-Color RenderThemeMac::captionsWindowColor() const
-{
-    RetainPtr<CGColorRef> color(AdoptCF, wkCaptionAppearanceCopyWindowColor());
-    Color windowColor(color.get());
-    if (!windowColor.isValid())
-        windowColor = Color::transparent;
-    
-    CGFloat opacity;
-    if (wkCaptionAppearanceGetWindowOpacity(&opacity))
-        return Color(windowColor.red(), windowColor.green(), windowColor.blue(), static_cast<int>(opacity * 255));
-    
-    if (!color)
-        return Color();
-
-    return windowColor;
-}
-
-Color RenderThemeMac::captionsBackgroundColor() const
-{
-    // This default value must be the same as the one specified in mediaControls.css for -webkit-media-text-track-past-nodes
-    // and webkit-media-text-track-future-nodes.
-    DEFINE_STATIC_LOCAL(Color, defaultBackgroundColor, (Color(0, 0, 0, 0.8 * 255)));
-
-    RetainPtr<CGColorRef> color(AdoptCF, wkCaptionAppearanceCopyBackgroundColor());
-    Color backgroundColor(color.get());
-    if (!backgroundColor.isValid()) {
-        backgroundColor = defaultBackgroundColor;
-    }
-
-    CGFloat opacity;
-    if (wkCaptionAppearanceGetBackgroundOpacity(&opacity))
-        return Color(backgroundColor.red(), backgroundColor.green(), backgroundColor.blue(), opacity * 255);
-
-    if (!color)
-        return Color();
-    
-    return backgroundColor;
-}
-
-Color RenderThemeMac::captionsTextColor() const
-{
-    RetainPtr<CGColorRef> color(AdoptCF, wkCaptionAppearanceCopyForegroundColor());
-    Color textColor(color.get());
-    if (!textColor.isValid()) {
-        // This default value must be the same as the one specified in mediaControls.css for -webkit-media-text-track-container.
-        textColor = Color::white;
-    }
-    
-    CGFloat opacity;
-    if (wkCaptionAppearanceGetForegroundOpacity(&opacity))
-        return Color(textColor.red(), textColor.green(), textColor.blue(), opacity * 255);
-    
-    if (!color)
-        return Color();
-    
-    return textColor;
-}
-
-Color RenderThemeMac::captionsEdgeColorForTextColor(const Color& textColor) const
-{
-    int distanceFromWhite = differenceSquared(textColor, Color::white);
-    int distanceFromBlack = differenceSquared(textColor, Color::black);
-    
-    if (distanceFromWhite < distanceFromBlack)
-        return textColor.dark();
-    
-    return textColor.light();
-}
-
-String RenderThemeMac::cssPropertyWithTextEdgeColor(CSSPropertyID id, const String& value, const Color& textColor) const
-{
-    StringBuilder builder;
-    
-    builder.append(getPropertyNameString(id));
-    builder.append(':');
-    builder.append(value);
-    builder.append(' ');
-    builder.append(captionsEdgeColorForTextColor(textColor).serialized());
-    builder.append(';');
-
-    return builder.toString();
-}
-    
-String RenderThemeMac::cssColorProperty(CSSPropertyID id, const Color& color) const
-{
-    StringBuilder builder;
-    
-    builder.append(getPropertyNameString(id));
-    builder.append(':');
-    builder.append(color.serialized());
-    builder.append(';');
-    
-    return builder.toString();
-}
-
-String RenderThemeMac::captionsTextEdgeStyle() const
-{
-    DEFINE_STATIC_LOCAL(const String, edgeStyleRaised, (" -.05em -.05em 0 ", String::ConstructFromLiteral));
-    DEFINE_STATIC_LOCAL(const String, edgeStyleDepressed, (" .05em .05em 0 ", String::ConstructFromLiteral));
-    DEFINE_STATIC_LOCAL(const String, edgeStyleDropShadow, (" .075em .075em 0 ", String::ConstructFromLiteral));
-    DEFINE_STATIC_LOCAL(const String, edgeStyleUniform, (" .03em ", String::ConstructFromLiteral));
-
-    Color color = captionsTextColor();
-    if (!color.isValid())
-        color.setNamedColor("black");
-    color = captionsEdgeColorForTextColor(color);
-
-    wkCaptionTextEdgeStyle textEdgeStyle = static_cast<wkCaptionTextEdgeStyle>(wkCaptionAppearanceGetTextEdgeStyle());
-    switch (textEdgeStyle) {
-    case wkCaptionTextEdgeStyleUndefined:
-    case wkCaptionTextEdgeStyleNone:
-        return emptyString();
-
-    case wkCaptionTextEdgeStyleRaised:
-        return cssPropertyWithTextEdgeColor(CSSPropertyTextShadow, edgeStyleRaised, color);
-    case wkCaptionTextEdgeStyleDepressed:
-        return cssPropertyWithTextEdgeColor(CSSPropertyTextShadow, edgeStyleDepressed, color);
-    case wkCaptionTextEdgeStyleDropShadow:
-        return cssPropertyWithTextEdgeColor(CSSPropertyTextShadow, edgeStyleDropShadow, color);
-    case wkCaptionTextEdgeStyleUniform:
-        return cssPropertyWithTextEdgeColor(CSSPropertyWebkitTextStroke, edgeStyleUniform, color);
-
-    case wkCaptionTextEdgeStyleMax:
-        ASSERT_NOT_REACHED();
-    default:
-        ASSERT_NOT_REACHED();
-        break;
-    }
-
-    return emptyString();
-}
-
-String RenderThemeMac::captionsDefaultFont() const
-{
-    RetainPtr<CGFontRef> font(AdoptCF, wkCaptionAppearanceCopyFontForStyle(wkCaptionFontStyleDefault));
-    if (!font)
-        return emptyString();
-
-    RetainPtr<CFStringRef> name(AdoptCF, CGFontCopyPostScriptName(font.get()));
-    if (!name)
-        return emptyString();
-
-    StringBuilder builder;
-    
-    builder.append(getPropertyNameString(CSSPropertyFontFamily));
-    builder.append(": \"");
-    builder.append(name.get());
-    builder.append("\";");
-    
-    return builder.toString();
-}
-
-String RenderThemeMac::captionsStyleSheetOverride() const
-{
-    StringBuilder captionsOverrideStyleSheet;
-
-    Color color = captionsBackgroundColor();
-    if (color.isValid()) {
-        captionsOverrideStyleSheet.append(" video::");
-        captionsOverrideStyleSheet.append(TextTrackCue::pastNodesShadowPseudoId());
-        captionsOverrideStyleSheet.append('{');
-        captionsOverrideStyleSheet.append(cssColorProperty(CSSPropertyBackgroundColor, color));
-        captionsOverrideStyleSheet.append('}');
-
-        captionsOverrideStyleSheet.append(" video::");
-        captionsOverrideStyleSheet.append(TextTrackCue::futureNodesShadowPseudoId());
-        captionsOverrideStyleSheet.append('{');
-        captionsOverrideStyleSheet.append(cssColorProperty(CSSPropertyBackgroundColor, color));
-        captionsOverrideStyleSheet.append('}');
-    }
-
-    color = captionsWindowColor();
-    if (color.isValid()) {
-        captionsOverrideStyleSheet.append(" video::");
-        captionsOverrideStyleSheet.append(TextTrackCueBox::textTrackCueBoxShadowPseudoId());
-        captionsOverrideStyleSheet.append('{');
-        captionsOverrideStyleSheet.append(cssColorProperty(CSSPropertyBackgroundColor, color));
-        captionsOverrideStyleSheet.append('}');
-    }
-
-    color = captionsTextColor();
-    String edgeStyle = captionsTextEdgeStyle();
-    String fontName = captionsDefaultFont();
-    if (color.isValid() || !edgeStyle.isEmpty() || !fontName.isEmpty()) {
-        captionsOverrideStyleSheet.append(" video::");
-        captionsOverrideStyleSheet.append(TextTrackCueBox::textTrackCueBoxShadowPseudoId());
-        captionsOverrideStyleSheet.append('{');
-
-        if (color.isValid())
-            captionsOverrideStyleSheet.append(cssColorProperty(CSSPropertyColor, color));
-        if (!edgeStyle.isEmpty())
-            captionsOverrideStyleSheet.append(edgeStyle);
-        if (!fontName.isEmpty())
-            captionsOverrideStyleSheet.append(fontName);
-
-        captionsOverrideStyleSheet.append('}');
-    }
-
-    return captionsOverrideStyleSheet.toString();
-}
-
-float RenderThemeMac::captionFontSizeScale() const
-{
-    CGFloat characterScale = RenderTheme::captionFontSizeScale();
-    CGFloat scaleAdjustment;
-    
-    if (!wkCaptionAppearanceGetRelativeCharacterSize(&scaleAdjustment))
-        return characterScale;
-    
-    return narrowPrecisionToFloat(scaleAdjustment * characterScale);
-}
-
-void RenderThemeMac::captionPreferencesChanged()
-{
-    for (HashSet<CaptionPreferencesChangedListener*>::iterator i = m_captionPreferenceChangeListeners.begin(); i != m_captionPreferenceChangeListeners.end(); ++i)
-        (*i)->captionPreferencesChanged();
-}
-
-void RenderThemeMac::registerForCaptionPreferencesChangedCallbacks(CaptionPreferencesChangedListener* listener)
-{
-    if (!wkCaptionAppearanceGetSettingsChangedNotification())
-        return;
-    
-    if (!m_listeningForCaptionPreferenceNotifications) {
-        m_listeningForCaptionPreferenceNotifications = true;
-        CFNotificationCenterAddObserver (CFNotificationCenterGetLocalCenter(), this, userCaptionPreferencesChangedNotificationCallback, wkCaptionAppearanceGetSettingsChangedNotification(), NULL, CFNotificationSuspensionBehaviorCoalesce);
-    }
-    
-    m_captionPreferenceChangeListeners.add(listener);
-}
-    
-void RenderThemeMac::unregisterForCaptionPreferencesChangedCallbacks(CaptionPreferencesChangedListener* listener)
-{
-     if (wkCaptionAppearanceGetSettingsChangedNotification())
-        m_captionPreferenceChangeListeners.remove(listener);
-}
-#endif // ENABLE(VIDEO_TRACK)
-
 #endif // ENABLE(VIDEO)
 
 bool RenderThemeMac::shouldShowPlaceholderWhenFocused() const
index 8110191..b491cc0 100644 (file)
@@ -1,3 +1,16 @@
+2012-10-05  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r130556 and r130564.
+        http://trac.webkit.org/changeset/130556
+        http://trac.webkit.org/changeset/130564
+        https://bugs.webkit.org/show_bug.cgi?id=98572
+
+        The patch wasn't reviewed by a reviewer and it is breaking
+        Chromium Windows (Requested by jchaffraix on #webkit).
+
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2012-10-05  Tim Horton  <timothy_horton@apple.com>
 
         [cg] GraphicsContextCG should ask CG whether the shadow offset workaround is required
index 3b6e1d9..8c35e8f 100644 (file)
@@ -208,19 +208,6 @@ void InitWebCoreSystemInterface(void)
     INIT(NSReboundDeltaForElasticDelta);
 #endif
 
-    INIT(CaptionAppearanceHasUserPreferences);
-    INIT(CaptionAppearanceShowCaptionsWhenAvailable);
-    INIT(CaptionAppearanceCopyForegroundColor);
-    INIT(CaptionAppearanceCopyBackgroundColor);
-    INIT(CaptionAppearanceCopyWindowColor);
-    INIT(CaptionAppearanceGetForegroundOpacity);
-    INIT(CaptionAppearanceGetBackgroundOpacity);
-    INIT(CaptionAppearanceGetWindowOpacity);
-    INIT(CaptionAppearanceCopyFontForStyle);
-    INIT(CaptionAppearanceGetRelativeCharacterSize);
-    INIT(CaptionAppearanceGetTextEdgeStyle);
-    INIT(CaptionAppearanceGetSettingsChangedNotification);
-
 #endif
     didInit = true;
 }
index 00b2b11..a243b38 100644 (file)
@@ -1,3 +1,16 @@
+2012-10-05  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r130556 and r130564.
+        http://trac.webkit.org/changeset/130556
+        http://trac.webkit.org/changeset/130564
+        https://bugs.webkit.org/show_bug.cgi?id=98572
+
+        The patch wasn't reviewed by a reviewer and it is breaking
+        Chromium Windows (Requested by jchaffraix on #webkit).
+
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2012-10-05  Sam Weinig  <sam@webkit.org>
 
         Set the current working directory to TMPDIR when entering the sandbox in the plug-in process.
index 795a13e..a004a8c 100644 (file)
@@ -189,17 +189,5 @@ void InitWebCoreSystemInterface(void)
         INIT(NSReboundDeltaForElasticDelta);
 #endif
 
-        INIT(CaptionAppearanceHasUserPreferences);
-        INIT(CaptionAppearanceShowCaptionsWhenAvailable);
-        INIT(CaptionAppearanceCopyForegroundColor);
-        INIT(CaptionAppearanceCopyBackgroundColor);
-        INIT(CaptionAppearanceCopyWindowColor);
-        INIT(CaptionAppearanceGetForegroundOpacity);
-        INIT(CaptionAppearanceGetBackgroundOpacity);
-        INIT(CaptionAppearanceGetWindowOpacity);
-        INIT(CaptionAppearanceCopyFontForStyle);
-        INIT(CaptionAppearanceGetRelativeCharacterSize);
-        INIT(CaptionAppearanceGetTextEdgeStyle);
-        INIT(CaptionAppearanceGetSettingsChangedNotification);
     });
 }
index 264ab2c..cd364d0 100644 (file)
@@ -1,3 +1,15 @@
+2012-10-05  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r130556 and r130564.
+        http://trac.webkit.org/changeset/130556
+        http://trac.webkit.org/changeset/130564
+        https://bugs.webkit.org/show_bug.cgi?id=98572
+
+        The patch wasn't reviewed by a reviewer and it is breaking
+        Chromium Windows (Requested by jchaffraix on #webkit).
+
+        * WebKitSystemInterface.h:
+
 2012-10-05  Tim Horton  <timothy_horton@apple.com>
 
         Update WebKitSystemInterface libraries and header.
index 47279f3..acf4061 100644 (file)
@@ -1,6 +1,6 @@
 /*      
     WebKitSystemInterface.h
-    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
+    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
 
     Public header file.
 */
@@ -513,41 +513,6 @@ CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
 Boolean WKJLIsRuntimeAndWebComponentsInstalled(void);
 #endif
 
-typedef enum {
-    WKCaptionFontStyleDefault = 0,
-    WKCaptionFontStyleMonospacedWithSerif,
-    WKCaptionFontStyleProportionalWithSerif,
-    WKCaptionFontStyleMonospacedWithoutSerif,
-    WKCaptionFontStyleProportionalWithoutSerif,
-    WKCaptionFontStyleCasual,
-    WKCaptionFontStyleCursive,
-    WKCaptionFontStyleSmallCapital,
-    WKCaptionFontStyleMax
-} WKCaptionFontStyle;
-
-typedef enum {
-    WKCaptionTextEdgeStyleUndefined = 0,
-    WKCaptionTextEdgeStyleNone,
-    WKCaptionTextEdgeStyleRaised,
-    WKCaptionTextEdgeStyleDepressed,
-    WKCaptionTextEdgeStyleUniform,
-    WKCaptionTextEdgeStyleDropShadow,
-    WKCaptionTextEdgeStyleMax
-} WKCaptionTextEdgeStyle;
-
-bool WKCaptionAppearanceHasUserPreferences(void);
-bool WKCaptionAppearanceShowCaptionsWhenAvailable(void);
-CGColorRef WKCaptionAppearanceCopyForegroundColor(void);
-CGColorRef WKCaptionAppearanceCopyBackgroundColor(void);
-CGColorRef WKCaptionAppearanceCopyWindowColor(void);
-bool WKCaptionAppearanceGetForegroundOpacity(CGFloat*);
-bool WKCaptionAppearanceGetBackgroundOpacity(CGFloat*);
-bool WKCaptionAppearanceGetWindowOpacity(CGFloat*);
-CGFontRef WKCaptionAppearanceCopyFontForStyle(int fontStyle);
-bool WKCaptionAppearanceGetRelativeCharacterSize(CGFloat*);
-int WKCaptionAppearanceGetTextEdgeStyle(void);
-CFStringRef WKCaptionAppearanceGetSettingsChangedNotification(void);
-
 #ifdef __cplusplus
 }
 #endif