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

Unified Diff: Source/core/html/track/vtt/VTTCue.cpp

Issue 921833003: Expose APIs for text track settings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed comments from fs Created 5 years, 10 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/html/track/vtt/VTTCue.cpp
diff --git a/Source/core/html/track/vtt/VTTCue.cpp b/Source/core/html/track/vtt/VTTCue.cpp
index 03339999edfbd5bf8c3e29076b99454fef831d41..d5ec6015035f0aac1641369f3c3e1267c7bdeb88 100644
--- a/Source/core/html/track/vtt/VTTCue.cpp
+++ b/Source/core/html/track/vtt/VTTCue.cpp
@@ -38,6 +38,7 @@
#include "core/dom/DocumentFragment.h"
#include "core/dom/NodeTraversal.h"
#include "core/events/Event.h"
+#include "core/frame/Settings.h"
#include "core/frame/UseCounter.h"
#include "core/html/HTMLDivElement.h"
#include "core/html/track/TextTrack.h"
@@ -204,6 +205,19 @@ void VTTCueBox::applyCSSProperties(const VTTDisplayParameters& displayParameters
setInlineStyleProperty(CSSPropertyWhiteSpace, CSSValuePre);
}
+
+ Settings* settings = m_cue->element()->document().settings();
+ if (settings) {
+ m_cue->element()->setInlineStyleProperty(CSSPropertyBackgroundColor, settings->textTrackBackgroundColor(), true);
+ m_cue->element()->setInlineStyleProperty(CSSPropertyFontFamily, settings->textTrackFontFamily(), true);
+ m_cue->element()->setInlineStyleProperty(CSSPropertyFontStyle, settings->textTrackFontStyle(), true);
+ m_cue->element()->setInlineStyleProperty(CSSPropertyFontVariant, settings->textTrackFontVariant(), true);
+ m_cue->element()->setInlineStyleProperty(CSSPropertyColor, settings->textTrackTextColor(), true);
+ m_cue->element()->setInlineStyleProperty(CSSPropertyTextShadow, settings->textTrackTextShadow(), true);
+ m_cue->element()->setInlineStyleProperty(CSSPropertyFontSize, settings->textTrackTextSize(), true);
+ // Override background color for the cue box
+ setInlineStyleProperty(CSSPropertyBackgroundColor, settings->textTrackWindowColor(), true);
+ }
}
LayoutObject* VTTCueBox::createRenderer(const LayoutStyle&)

Powered by Google App Engine
This is Rietveld 408576698