Index: Source/core/css/resolver/StyleResolver.cpp |
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp |
index 81a1ea16741c9d82071413453291172395cc77cc..4a942136b5e659e168b03d0c549cbffdc7d6d801 100644 |
--- a/Source/core/css/resolver/StyleResolver.cpp |
+++ b/Source/core/css/resolver/StyleResolver.cpp |
@@ -77,6 +77,7 @@ |
#include "core/dom/shadow/ShadowRoot.h" |
#include "core/frame/FrameView.h" |
#include "core/frame/LocalFrame.h" |
+#include "core/frame/Settings.h" |
#include "core/html/HTMLIFrameElement.h" |
#include "core/inspector/InspectorInstrumentation.h" |
#include "core/layout/LayoutView.h" |
@@ -1015,7 +1016,7 @@ void StyleResolver::applyAnimatedProperties(StyleResolverState& state, const Wil |
} |
} |
-static inline bool isValidCueStyleProperty(CSSPropertyID id) |
+static inline bool isValidCueStyleProperty(CSSPropertyID id, bool platformClosedCaptionsEnabled) |
{ |
switch (id) { |
case CSSPropertyBackground: |
@@ -1040,19 +1041,20 @@ static inline bool isValidCueStyleProperty(CSSPropertyID id) |
case CSSPropertyFontVariant: |
case CSSPropertyFontWeight: |
case CSSPropertyLineHeight: |
- case CSSPropertyOpacity: |
case CSSPropertyOutline: |
case CSSPropertyOutlineColor: |
case CSSPropertyOutlineOffset: |
case CSSPropertyOutlineStyle: |
case CSSPropertyOutlineWidth: |
- case CSSPropertyVisibility: |
- case CSSPropertyWhiteSpace: |
// FIXME: 'text-decoration' shorthand to be handled when available. |
// See https://chromiumcodereview.appspot.com/19516002 for details. |
case CSSPropertyTextDecoration: |
case CSSPropertyTextShadow: |
case CSSPropertyBorderStyle: |
+ return (!platformClosedCaptionsEnabled); |
+ case CSSPropertyOpacity: |
philipj_slow
2015/03/24 07:11:58
On second thought it's odd to allow opacity and vi
srivats
2015/03/25 15:03:28
Done.
|
+ case CSSPropertyVisibility: |
+ case CSSPropertyWhiteSpace: |
return true; |
case CSSPropertyTextDecorationLine: |
case CSSPropertyTextDecorationStyle: |
@@ -1246,8 +1248,10 @@ void StyleResolver::applyProperties(StyleResolverState& state, const StyleProper |
continue; |
} |
- if (propertyWhitelistType == PropertyWhitelistCue && !isValidCueStyleProperty(property)) |
+ bool platformClosedCaptionsEnabled = document().settings()->platformClosedCaptionsEnabled(); |
+ if (propertyWhitelistType == PropertyWhitelistCue && !isValidCueStyleProperty(property, platformClosedCaptionsEnabled)) |
continue; |
+ |
if (propertyWhitelistType == PropertyWhitelistFirstLetter && !isValidFirstLetterStyleProperty(property)) |
continue; |