Index: Source/core/css/resolver/FontBuilder.h |
diff --git a/Source/core/css/resolver/FontBuilder.h b/Source/core/css/resolver/FontBuilder.h |
index 09efe4066af8dd8a1ddcf97f8397c8d20e5be44d..b343d31e1ef6d5c0a7471e81a3a6fb5783190b76 100644 |
--- a/Source/core/css/resolver/FontBuilder.h |
+++ b/Source/core/css/resolver/FontBuilder.h |
@@ -35,22 +35,17 @@ class CSSValue; |
class FontSelector; |
class RenderStyle; |
-class FontDescriptionChangeScope; |
- |
class FontBuilder { |
STACK_ALLOCATED(); |
WTF_MAKE_NONCOPYABLE(FontBuilder); |
public: |
FontBuilder(const Document&); |
- void setFontDescription(const FontDescription& fd) { m_fontDescription = fd; } |
- const FontDescription& fontDescription() const { return m_fontDescription; } |
- |
void setInitial(float effectiveZoom); |
- void didChangeFontParameters(bool); |
- |
- void inheritFrom(const FontDescription&); |
+ void didChangeEffectiveZoom(); |
+ void didChangeTextOrientation(); |
+ void didChangeWritingMode(); |
FontFamily standardFontFamily() const; |
AtomicString standardFontFamilyName() const; |
@@ -70,14 +65,11 @@ public: |
void setFontSmoothing(FontSmoothingMode); |
// FIXME: These need to just vend a Font object eventually. |
- void createFont(PassRefPtrWillBeRawPtr<FontSelector>, RenderStyle*, const RenderStyle* parentStyle); |
+ void createFont(PassRefPtrWillBeRawPtr<FontSelector>, RenderStyle*); |
void createFontForDocument(PassRefPtrWillBeRawPtr<FontSelector>, RenderStyle*); |
- // FIXME: These should not be necessary eventually. |
- void setFontDirty(bool fontDirty) { m_fontDirty = fontDirty; } |
- // FIXME: This is only used by an ASSERT in StyleResolver. Remove? |
- bool fontDirty() const { return m_fontDirty; } |
+ bool fontDirty() const { return m_flags; } |
static FontDescription::FamilyDescription initialFamilyDescription() { return FontDescription::FamilyDescription(initialGenericFamily()); } |
static FontFeatureSettings* initialFeatureSettings() { return nullptr; } |
@@ -92,16 +84,14 @@ public: |
static FontStretch initialStretch() { return FontStretchNormal; } |
static FontWeight initialWeight() { return FontWeightNormal; } |
- friend class FontDescriptionChangeScope; |
- |
private: |
void setFamilyDescription(FontDescription&, const FontDescription::FamilyDescription&); |
void setSize(FontDescription&, const FontDescription::Size&); |
- void checkForOrientationChange(RenderStyle*); |
+ void updateOrientation(FontDescription&, RenderStyle*); |
// This function fixes up the default font size if it detects that the current generic font family has changed. -dwh |
- void checkForGenericFamilyChange(RenderStyle*, const RenderStyle* parentStyle); |
- void updateComputedSize(RenderStyle*, const RenderStyle* parentStyle); |
+ void checkForGenericFamilyChange(const FontDescription&, FontDescription&); |
+ void updateSpecifiedSize(FontDescription&, RenderStyle*); |
void updateComputedSize(FontDescription&, RenderStyle*); |
float getComputedSizeFromSpecifiedSize(FontDescription&, float effectiveZoom, float specifiedSize); |
@@ -109,12 +99,29 @@ private: |
const Document& m_document; |
FontDescription m_fontDescription; |
- // Fontbuilder is responsbile for creating the Font() |
- // object on RenderStyle from various other font-related |
- // properties on RenderStyle. Whenever one of those |
- // is changed, FontBuilder tracks the need to update |
- // style->font() with this bool. |
- bool m_fontDirty; |
+ enum class PropertySetFlag { |
+ Weight, |
+ Size, |
+ Stretch, |
+ Family, |
+ FeatureSettings, |
+ Script, |
+ Style, |
+ Variant, |
+ VariantLigatures, |
+ TextRendering, |
+ Kerning, |
+ FontSmoothing, |
+ |
+ EffectiveZoom, |
+ TextOrientation, |
+ WritingMode |
+ }; |
+ |
+ void set(PropertySetFlag flag) { m_flags |= (1 << unsigned(flag)); } |
+ bool isSet(PropertySetFlag flag) const { return m_flags & (1 << unsigned(flag)); } |
+ |
+ unsigned m_flags; |
}; |
} |