Bug 1341775 - Part 1: stylo: Calculate font-size keywords based on base size; r?heycam
MozReview-Commit-ID: Ff6kt8RLChI
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -1500,16 +1500,22 @@ Gecko_nsStyleFont_SetLang(nsStyleFont* a
}
void
Gecko_nsStyleFont_CopyLangFrom(nsStyleFont* aFont, const nsStyleFont* aSource)
{
aFont->mLanguage = aSource->mLanguage;
}
+nscoord
+Gecko_nsStyleFont_GetBaseSize(const nsStyleFont* aFont, RawGeckoPresContextBorrowed aPresContext)
+{
+ return aPresContext->GetDefaultFont(aFont->mGenericID, aFont->mLanguage)->size;
+}
+
void
Gecko_LoadStyleSheet(css::Loader* aLoader,
ServoStyleSheet* aParent,
RawServoImportRuleBorrowed aImportRule,
nsIURI* aBaseURI,
const uint8_t* aURLString,
uint32_t aURLStringLength,
const uint8_t* aMediaString,
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -372,16 +372,17 @@ void Gecko_CSSValue_SetURL(nsCSSValueBor
void Gecko_CSSValue_SetLocal(nsCSSValueBorrowedMut css_value, const nsString family);
void Gecko_CSSValue_SetInteger(nsCSSValueBorrowedMut css_value, int32_t integer);
void Gecko_CSSValue_Drop(nsCSSValueBorrowedMut css_value);
NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsCSSValueSharedList, CSSValueSharedList);
bool Gecko_PropertyId_IsPrefEnabled(nsCSSPropertyID id);
void Gecko_nsStyleFont_SetLang(nsStyleFont* font, nsIAtom* atom);
void Gecko_nsStyleFont_CopyLangFrom(nsStyleFont* aFont, const nsStyleFont* aSource);
+nscoord Gecko_nsStyleFont_GetBaseSize(const nsStyleFont* font, RawGeckoPresContextBorrowed pres_context);
const nsMediaFeature* Gecko_GetMediaFeatures();
// We use an int32_t here instead of a LookAndFeel::ColorID
// because forward-declaring a nested enum/struct is impossible
nscolor Gecko_GetLookAndFeelSystemColor(int32_t color_id,
RawGeckoPresContextBorrowed pres_context);