Bug 1341775 - Part 1: stylo: Calculate font-size keywords based on base size; r?heycam draft
authorManish Goregaokar <manishearth@gmail.com>
Fri, 17 Mar 2017 19:48:20 -0700
changeset 513623 848767ca1ab86187d0fc5721edbfeead3438fbb8
parent 504632 4c987b7ed54a630a7de76adcc2eb00dab49d5dfd
child 513624 be21e87867680f5b048f2bc3e15872632009141a
push id50890
push userbmo:manishearth@gmail.com
push dateFri, 24 Mar 2017 18:00:44 +0000
reviewersheycam
bugs1341775
milestone55.0a1
Bug 1341775 - Part 1: stylo: Calculate font-size keywords based on base size; r?heycam MozReview-Commit-ID: Ff6kt8RLChI
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
--- 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);