Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Side by Side Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 921833003: Expose APIs for text track settings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Override author-specified caption settings with user-specified caption settings Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #include "core/css/resolver/ViewportStyleResolver.h" 70 #include "core/css/resolver/ViewportStyleResolver.h"
71 #include "core/dom/CSSSelectorWatch.h" 71 #include "core/dom/CSSSelectorWatch.h"
72 #include "core/dom/FirstLetterPseudoElement.h" 72 #include "core/dom/FirstLetterPseudoElement.h"
73 #include "core/dom/NodeLayoutStyle.h" 73 #include "core/dom/NodeLayoutStyle.h"
74 #include "core/dom/StyleEngine.h" 74 #include "core/dom/StyleEngine.h"
75 #include "core/dom/Text.h" 75 #include "core/dom/Text.h"
76 #include "core/dom/shadow/ElementShadow.h" 76 #include "core/dom/shadow/ElementShadow.h"
77 #include "core/dom/shadow/ShadowRoot.h" 77 #include "core/dom/shadow/ShadowRoot.h"
78 #include "core/frame/FrameView.h" 78 #include "core/frame/FrameView.h"
79 #include "core/frame/LocalFrame.h" 79 #include "core/frame/LocalFrame.h"
80 #include "core/frame/Settings.h"
80 #include "core/html/HTMLIFrameElement.h" 81 #include "core/html/HTMLIFrameElement.h"
81 #include "core/inspector/InspectorInstrumentation.h" 82 #include "core/inspector/InspectorInstrumentation.h"
82 #include "core/layout/LayoutView.h" 83 #include "core/layout/LayoutView.h"
83 #include "core/layout/style/KeyframeList.h" 84 #include "core/layout/style/KeyframeList.h"
84 #include "core/svg/SVGDocumentExtensions.h" 85 #include "core/svg/SVGDocumentExtensions.h"
85 #include "core/svg/SVGElement.h" 86 #include "core/svg/SVGElement.h"
86 #include "platform/RuntimeEnabledFeatures.h" 87 #include "platform/RuntimeEnabledFeatures.h"
87 #include "wtf/StdLibExtras.h" 88 #include "wtf/StdLibExtras.h"
88 89
89 namespace { 90 namespace {
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 { 1009 {
1009 for (const auto& interpolationEntry : activeInterpolations) { 1010 for (const auto& interpolationEntry : activeInterpolations) {
1010 CSSPropertyID property = interpolationEntry.key; 1011 CSSPropertyID property = interpolationEntry.key;
1011 if (!CSSPropertyPriorityData<priority>::propertyHasPriority(property)) 1012 if (!CSSPropertyPriorityData<priority>::propertyHasPriority(property))
1012 continue; 1013 continue;
1013 const StyleInterpolation* interpolation = toStyleInterpolation(interpola tionEntry.value.get()); 1014 const StyleInterpolation* interpolation = toStyleInterpolation(interpola tionEntry.value.get());
1014 interpolation->apply(state); 1015 interpolation->apply(state);
1015 } 1016 }
1016 } 1017 }
1017 1018
1018 static inline bool isValidCueStyleProperty(CSSPropertyID id) 1019 static inline bool isValidCueStyleProperty(CSSPropertyID id, bool platformClosed CaptionsEnabled)
1019 { 1020 {
1020 switch (id) { 1021 switch (id) {
1021 case CSSPropertyBackground: 1022 case CSSPropertyBackground:
1022 case CSSPropertyBackgroundAttachment: 1023 case CSSPropertyBackgroundAttachment:
1023 case CSSPropertyBackgroundClip: 1024 case CSSPropertyBackgroundClip:
1024 case CSSPropertyBackgroundColor: 1025 case CSSPropertyBackgroundColor:
1025 case CSSPropertyBackgroundImage: 1026 case CSSPropertyBackgroundImage:
1026 case CSSPropertyBackgroundOrigin: 1027 case CSSPropertyBackgroundOrigin:
1027 case CSSPropertyBackgroundPosition: 1028 case CSSPropertyBackgroundPosition:
1028 case CSSPropertyBackgroundPositionX: 1029 case CSSPropertyBackgroundPositionX:
1029 case CSSPropertyBackgroundPositionY: 1030 case CSSPropertyBackgroundPositionY:
1030 case CSSPropertyBackgroundRepeat: 1031 case CSSPropertyBackgroundRepeat:
1031 case CSSPropertyBackgroundRepeatX: 1032 case CSSPropertyBackgroundRepeatX:
1032 case CSSPropertyBackgroundRepeatY: 1033 case CSSPropertyBackgroundRepeatY:
1033 case CSSPropertyBackgroundSize: 1034 case CSSPropertyBackgroundSize:
1034 case CSSPropertyColor: 1035 case CSSPropertyColor:
1035 case CSSPropertyFont: 1036 case CSSPropertyFont:
1036 case CSSPropertyFontFamily: 1037 case CSSPropertyFontFamily:
1037 case CSSPropertyFontSize: 1038 case CSSPropertyFontSize:
1038 case CSSPropertyFontStretch: 1039 case CSSPropertyFontStretch:
1039 case CSSPropertyFontStyle: 1040 case CSSPropertyFontStyle:
1040 case CSSPropertyFontVariant: 1041 case CSSPropertyFontVariant:
1041 case CSSPropertyFontWeight: 1042 case CSSPropertyFontWeight:
1042 case CSSPropertyLineHeight: 1043 case CSSPropertyLineHeight:
1043 case CSSPropertyOpacity:
1044 case CSSPropertyOutline: 1044 case CSSPropertyOutline:
1045 case CSSPropertyOutlineColor: 1045 case CSSPropertyOutlineColor:
1046 case CSSPropertyOutlineOffset: 1046 case CSSPropertyOutlineOffset:
1047 case CSSPropertyOutlineStyle: 1047 case CSSPropertyOutlineStyle:
1048 case CSSPropertyOutlineWidth: 1048 case CSSPropertyOutlineWidth:
1049 case CSSPropertyVisibility:
1050 case CSSPropertyWhiteSpace:
1051 // FIXME: 'text-decoration' shorthand to be handled when available. 1049 // FIXME: 'text-decoration' shorthand to be handled when available.
1052 // See https://chromiumcodereview.appspot.com/19516002 for details. 1050 // See https://chromiumcodereview.appspot.com/19516002 for details.
1053 case CSSPropertyTextDecoration: 1051 case CSSPropertyTextDecoration:
1054 case CSSPropertyTextShadow: 1052 case CSSPropertyTextShadow:
1055 case CSSPropertyBorderStyle: 1053 case CSSPropertyBorderStyle:
1054 return (!platformClosedCaptionsEnabled);
1055 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.
1056 case CSSPropertyVisibility:
1057 case CSSPropertyWhiteSpace:
1056 return true; 1058 return true;
1057 case CSSPropertyTextDecorationLine: 1059 case CSSPropertyTextDecorationLine:
1058 case CSSPropertyTextDecorationStyle: 1060 case CSSPropertyTextDecorationStyle:
1059 case CSSPropertyTextDecorationColor: 1061 case CSSPropertyTextDecorationColor:
1060 return RuntimeEnabledFeatures::css3TextDecorationsEnabled(); 1062 return RuntimeEnabledFeatures::css3TextDecorationsEnabled();
1061 default: 1063 default:
1062 break; 1064 break;
1063 } 1065 }
1064 return false; 1066 return false;
1065 } 1067 }
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 StylePropertySet::PropertyReference current = properties->propertyAt(i); 1241 StylePropertySet::PropertyReference current = properties->propertyAt(i);
1240 if (isImportant != current.isImportant()) 1242 if (isImportant != current.isImportant())
1241 continue; 1243 continue;
1242 1244
1243 CSSPropertyID property = current.id(); 1245 CSSPropertyID property = current.id();
1244 if (property == CSSPropertyAll) { 1246 if (property == CSSPropertyAll) {
1245 applyAllProperty<priority>(state, current.value(), inheritedOnly); 1247 applyAllProperty<priority>(state, current.value(), inheritedOnly);
1246 continue; 1248 continue;
1247 } 1249 }
1248 1250
1249 if (propertyWhitelistType == PropertyWhitelistCue && !isValidCueStylePro perty(property)) 1251 bool platformClosedCaptionsEnabled = document().settings()->platformClos edCaptionsEnabled();
1252 if (propertyWhitelistType == PropertyWhitelistCue && !isValidCueStylePro perty(property, platformClosedCaptionsEnabled))
1250 continue; 1253 continue;
1254
1251 if (propertyWhitelistType == PropertyWhitelistFirstLetter && !isValidFir stLetterStyleProperty(property)) 1255 if (propertyWhitelistType == PropertyWhitelistFirstLetter && !isValidFir stLetterStyleProperty(property))
1252 continue; 1256 continue;
1253 1257
1254 if (inheritedOnly && !current.isInherited()) { 1258 if (inheritedOnly && !current.isInherited()) {
1255 // If the property value is explicitly inherited, we need to apply f urther non-inherited properties 1259 // If the property value is explicitly inherited, we need to apply f urther non-inherited properties
1256 // as they might override the value inherited here. For this reason we don't allow declarations with 1260 // as they might override the value inherited here. For this reason we don't allow declarations with
1257 // explicitly inherited properties to be cached. 1261 // explicitly inherited properties to be cached.
1258 ASSERT(!current.value()->isInheritedValue()); 1262 ASSERT(!current.value()->isInheritedValue());
1259 continue; 1263 continue;
1260 } 1264 }
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 visitor->trace(m_watchedSelectorsRules); 1504 visitor->trace(m_watchedSelectorsRules);
1501 visitor->trace(m_treeBoundaryCrossingRules); 1505 visitor->trace(m_treeBoundaryCrossingRules);
1502 visitor->trace(m_styleResourceLoader); 1506 visitor->trace(m_styleResourceLoader);
1503 visitor->trace(m_styleSharingLists); 1507 visitor->trace(m_styleSharingLists);
1504 visitor->trace(m_pendingStyleSheets); 1508 visitor->trace(m_pendingStyleSheets);
1505 visitor->trace(m_document); 1509 visitor->trace(m_document);
1506 #endif 1510 #endif
1507 } 1511 }
1508 1512
1509 } // namespace blink 1513 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698