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

Unified Diff: third_party/WebKit/Source/core/css/FontFace.cpp

Issue 2640753002: CSS font-display: expose display property on FontFace (Closed)
Patch Set: Fix webexposed Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFace.h ('k') | third_party/WebKit/Source/core/css/FontFace.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/FontFace.cpp
diff --git a/third_party/WebKit/Source/core/css/FontFace.cpp b/third_party/WebKit/Source/core/css/FontFace.cpp
index 1f64d68d760aefaeb992bd847f4f18df2a8f2214..87adc2963c3d745d6107a673b012b85f7c93e170 100644
--- a/third_party/WebKit/Source/core/css/FontFace.cpp
+++ b/third_party/WebKit/Source/core/css/FontFace.cpp
@@ -60,6 +60,7 @@
#include "core/frame/UseCounter.h"
#include "platform/FontFamilyNames.h"
#include "platform/Histogram.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/SharedBuffer.h"
#include "platform/WebTaskRunner.h"
@@ -174,6 +175,10 @@ FontFace::FontFace(ExecutionContext* context,
CSSPropertyFontVariant);
setPropertyFromString(document, descriptors.featureSettings(),
CSSPropertyFontFeatureSettings);
+ if (RuntimeEnabledFeatures::cssFontDisplayEnabled()) {
+ setPropertyFromString(document, descriptors.display(),
+ CSSPropertyFontDisplay);
+ }
}
FontFace::~FontFace() {}
@@ -202,6 +207,10 @@ String FontFace::featureSettings() const {
return m_featureSettings ? m_featureSettings->cssText() : "normal";
}
+String FontFace::display() const {
+ return m_display ? m_display->cssText() : "auto";
+}
+
void FontFace::setStyle(ExecutionContext* context,
const String& s,
ExceptionState& exceptionState) {
@@ -244,6 +253,13 @@ void FontFace::setFeatureSettings(ExecutionContext* context,
&exceptionState);
}
+void FontFace::setDisplay(ExecutionContext* context,
+ const String& s,
+ ExceptionState& exceptionState) {
+ setPropertyFromString(toDocument(context), s, CSSPropertyFontDisplay,
+ &exceptionState);
+}
+
void FontFace::setPropertyFromString(const Document* document,
const String& s,
CSSPropertyID propertyID,
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFace.h ('k') | third_party/WebKit/Source/core/css/FontFace.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698