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

Unified 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: Rebase and added a test to verify behavior of internal 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 033a99604efe96e7d7b243b9e90e29f501bb3993..3dcfc72e68fb7b88ec5ac24a811db43387aba280 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"
@@ -1246,8 +1247,9 @@ void StyleResolver::applyProperties(StyleResolverState& state, const StyleProper
continue;
}
- if (propertyWhitelistType == PropertyWhitelistCue && !isValidCueStyleProperty(property))
+ if (propertyWhitelistType == PropertyWhitelistCue && (!isValidCueStyleProperty(property) || shouldIgnoreTextTrackAuthorStyle()))
continue;
+
if (propertyWhitelistType == PropertyWhitelistFirstLetter && !isValidFirstLetterStyleProperty(property))
continue;
@@ -1487,6 +1489,23 @@ bool StyleResolver::mediaQueryAffectedByViewportChange() const
return false;
}
+bool StyleResolver::shouldIgnoreTextTrackAuthorStyle()
+{
+ Settings* settings = document().settings();
+ if (!settings)
+ return false;
+ // Ignore author specified settings for text tracks when any of the user settings are present.
+ if (!settings->textTrackBackgroundColor().isEmpty()
+ || !settings->textTrackFontFamily().isEmpty()
+ || !settings->textTrackFontStyle().isEmpty()
+ || !settings->textTrackFontVariant().isEmpty()
+ || !settings->textTrackTextColor().isEmpty()
+ || !settings->textTrackTextShadow().isEmpty()
+ || !settings->textTrackTextSize().isEmpty())
+ return true;
+ return false;
+}
+
DEFINE_TRACE(StyleResolver)
{
#if ENABLE(OILPAN)

Powered by Google App Engine
This is Rietveld 408576698