Title: [143857] trunk/Source/WebCore
Revision
143857
Author
[email protected]
Date
2013-02-23 21:31:10 -0800 (Sat, 23 Feb 2013)

Log Message

[Mac] user preference caption style applied incorrectly
https://bugs.webkit.org/show_bug.cgi?id=110707
<rdar://problem/13281096>

Reviewed by Maciej Stachowiak.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::textTrackContainerElementShadowPseudoId): New
    static function so the pseudo ID is available.
(WebCore::MediaControlTextTrackContainerElement::shadowPseudoId): Call textTrackContainerElementShadowPseudoId.
* html/shadow/MediaControlElements.h:

* page/CaptionUserPreferencesMac.mm:
(WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride): Style the text track container
    element for cue color, edge style, and font name.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (143856 => 143857)


--- trunk/Source/WebCore/ChangeLog	2013-02-24 02:54:56 UTC (rev 143856)
+++ trunk/Source/WebCore/ChangeLog	2013-02-24 05:31:10 UTC (rev 143857)
@@ -1,3 +1,21 @@
+2013-02-23  Eric Carlson  <[email protected]>
+
+        [Mac] user preference caption style applied incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=110707
+        <rdar://problem/13281096>
+
+        Reviewed by Maciej Stachowiak.
+
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlTextTrackContainerElement::textTrackContainerElementShadowPseudoId): New
+            static function so the pseudo ID is available.
+        (WebCore::MediaControlTextTrackContainerElement::shadowPseudoId): Call textTrackContainerElementShadowPseudoId.
+        * html/shadow/MediaControlElements.h:
+
+        * page/CaptionUserPreferencesMac.mm:
+        (WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride): Style the text track container
+            element for cue color, edge style, and font name.
+
 2013-02-22  Kentaro Hara  <[email protected]>
 
         [V8] Generate xxxAttrGetterCallback()

Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.cpp (143856 => 143857)


--- trunk/Source/WebCore/html/shadow/MediaControlElements.cpp	2013-02-24 02:54:56 UTC (rev 143856)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.cpp	2013-02-24 05:31:10 UTC (rev 143857)
@@ -1200,11 +1200,16 @@
     return new (arena) RenderTextTrackContainerElement(this);
 }
 
-const AtomicString& MediaControlTextTrackContainerElement::shadowPseudoId() const
+const AtomicString& MediaControlTextTrackContainerElement::textTrackContainerElementShadowPseudoId()
 {
     DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-text-track-container", AtomicString::ConstructFromLiteral));
     return id;
 }
+    
+const AtomicString& MediaControlTextTrackContainerElement::shadowPseudoId() const
+{
+    return textTrackContainerElementShadowPseudoId();
+}
 
 void MediaControlTextTrackContainerElement::updateDisplay()
 {

Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.h (143856 => 143857)


--- trunk/Source/WebCore/html/shadow/MediaControlElements.h	2013-02-24 02:54:56 UTC (rev 143856)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.h	2013-02-24 05:31:10 UTC (rev 143857)
@@ -440,6 +440,7 @@
     void updateDisplay();
     void updateSizes(bool forceUpdate = false);
     void createSubtrees(Document*);
+    static const AtomicString& textTrackContainerElementShadowPseudoId();
 
 private:
     explicit MediaControlTextTrackContainerElement(Document*);

Modified: trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm (143856 => 143857)


--- trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm	2013-02-24 02:54:56 UTC (rev 143856)
+++ trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm	2013-02-24 05:31:10 UTC (rev 143857)
@@ -37,6 +37,7 @@
 #import "Language.h"
 #import "LocalizedStrings.h"
 #import "Logging.h"
+#import "MediaControlElements.h"
 #import "PageGroup.h"
 #import "SoftLinking.h"
 #import "TextTrackCue.h"
@@ -376,10 +377,7 @@
 
     String windowColor = captionsWindowCSS();
     String windowCornerRadius = windowRoundedCornerRadiusCSS();
-    String captionsColor = captionsTextColorCSS();
-    String edgeStyle = captionsTextEdgeCSS();
-    String fontName = captionsDefaultFontCSS();
-    if (!captionsColor.isEmpty() || !windowColor.isEmpty() || !windowCornerRadius.isEmpty() || !edgeStyle.isEmpty() || !fontName.isEmpty()) {
+    if (!windowColor.isEmpty() || !windowCornerRadius.isEmpty()) {
         captionsOverrideStyleSheet.append(" video::");
         captionsOverrideStyleSheet.append(TextTrackCueBox::textTrackCueBoxShadowPseudoId());
         captionsOverrideStyleSheet.append('{');
@@ -388,6 +386,18 @@
             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())
@@ -397,7 +407,7 @@
 
         captionsOverrideStyleSheet.append('}');
     }
-
+    
     LOG(Media, "CaptionUserPreferencesMac::captionsStyleSheetOverrideSetting sytle to:\n%s", captionsOverrideStyleSheet.toString().utf8().data());
 
     return captionsOverrideStyleSheet.toString();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to