Bug 1617472 - Remove kFontSmoothingKTable. r=heycam

Use the more general mechanism to get a property value. We can't just remove
the getter because of the resist-fingerprinting check, but...

Depends on D63791

Differential Revision: https://phabricator.services.mozilla.com/D63792
This commit is contained in:
Emilio Cobos Álvarez
2020-02-24 13:29:45 +00:00
parent a380a27b2f
commit 5f19da8f36
3 changed files with 6 additions and 10 deletions

View File

@@ -166,12 +166,6 @@ const nsCString& nsCSSProps::GetStringValue(nsCSSCounterDesc aCounterDesc) {
/***************************************************************************/
const KTableEntry nsCSSProps::kFontSmoothingKTable[] = {
{eCSSKeyword_auto, NS_FONT_SMOOTHING_AUTO},
{eCSSKeyword_grayscale, NS_FONT_SMOOTHING_GRAYSCALE},
{eCSSKeyword_UNKNOWN, nsCSSKTableEntry::SENTINEL_VALUE},
};
const KTableEntry nsCSSProps::kTextAlignKTable[] = {
{eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT},
{eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT},

View File

@@ -278,7 +278,6 @@ class nsCSSProps {
if (nsCSSProps::IsEnabled(*it_, (mozilla::CSSEnabledState)es_))
// Keyword/Enum value tables
static const KTableEntry kFontSmoothingKTable[];
static const KTableEntry kTextAlignKTable[];
static const KTableEntry kTextDecorationStyleKTable[];
};

View File

@@ -1339,12 +1339,15 @@ already_AddRefed<nsROCSSPrimitiveValue> nsComputedDOMStyle::MatrixToCSSValue(
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetOsxFontSmoothing() {
if (nsContentUtils::ShouldResistFingerprinting(
mPresShell->GetPresContext()->GetDocShell()))
mPresShell->GetPresContext()->GetDocShell())) {
return nullptr;
}
nsAutoString result;
Servo_GetPropertyValue(mComputedStyle, eCSSProperty__moz_osx_font_smoothing,
&result);
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
val->SetIdent(nsCSSProps::ValueToKeywordEnum(
StyleFont()->mFont.smoothing, nsCSSProps::kFontSmoothingKTable));
val->SetString(result);
return val.forget();
}