| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
| 4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 class CSSValue; | 34 class CSSValue; |
| 35 class FontSelector; | 35 class FontSelector; |
| 36 class RenderStyle; | 36 class RenderStyle; |
| 37 | 37 |
| 38 class FontDescriptionChangeScope; | 38 class FontDescriptionChangeScope; |
| 39 | 39 |
| 40 class FontBuilder { | 40 class FontBuilder { |
| 41 STACK_ALLOCATED(); | 41 STACK_ALLOCATED(); |
| 42 WTF_MAKE_NONCOPYABLE(FontBuilder); | 42 WTF_MAKE_NONCOPYABLE(FontBuilder); |
| 43 public: | 43 public: |
| 44 FontBuilder(); | 44 FontBuilder(const Document&); |
| 45 | 45 |
| 46 // FIXME: The name is probably wrong, but matches StyleResolverState callsit
e for consistency. | 46 void setStyle(RenderStyle* style) { m_style = style; } |
| 47 void initForStyleResolve(const Document&, RenderStyle*); | |
| 48 | |
| 49 void setInitial(float effectiveZoom); | 47 void setInitial(float effectiveZoom); |
| 50 | 48 |
| 51 void didChangeFontParameters(bool); | 49 void didChangeFontParameters(bool); |
| 52 | 50 |
| 53 void inheritFrom(const FontDescription&); | 51 void inheritFrom(const FontDescription&); |
| 54 void fromSystemFont(CSSValueID, float effectiveZoom); | 52 void fromSystemFont(CSSValueID, float effectiveZoom); |
| 55 | 53 |
| 56 FontFamily standardFontFamily() const; | 54 FontFamily standardFontFamily() const; |
| 57 AtomicString standardFontFamilyName() const; | 55 AtomicString standardFontFamilyName() const; |
| 58 AtomicString genericFontFamilyName(FontDescription::GenericFamilyType) const
; | 56 AtomicString genericFontFamilyName(FontDescription::GenericFamilyType) const
; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 void setFamilyDescription(FontDescription&, const FontDescription::FamilyDes
cription&); | 98 void setFamilyDescription(FontDescription&, const FontDescription::FamilyDes
cription&); |
| 101 void setSize(FontDescription&, const FontDescription::Size&); | 99 void setSize(FontDescription&, const FontDescription::Size&); |
| 102 void checkForOrientationChange(RenderStyle*); | 100 void checkForOrientationChange(RenderStyle*); |
| 103 // This function fixes up the default font size if it detects that the curre
nt generic font family has changed. -dwh | 101 // This function fixes up the default font size if it detects that the curre
nt generic font family has changed. -dwh |
| 104 void checkForGenericFamilyChange(RenderStyle*, const RenderStyle* parentStyl
e); | 102 void checkForGenericFamilyChange(RenderStyle*, const RenderStyle* parentStyl
e); |
| 105 void updateComputedSize(RenderStyle*, const RenderStyle* parentStyle); | 103 void updateComputedSize(RenderStyle*, const RenderStyle* parentStyle); |
| 106 void updateComputedSize(FontDescription&, RenderStyle*); | 104 void updateComputedSize(FontDescription&, RenderStyle*); |
| 107 | 105 |
| 108 float getComputedSizeFromSpecifiedSize(FontDescription&, float effectiveZoom
, float specifiedSize); | 106 float getComputedSizeFromSpecifiedSize(FontDescription&, float effectiveZoom
, float specifiedSize); |
| 109 | 107 |
| 110 RawPtrWillBeMember<const Document> m_document; | 108 const Document& m_document; |
| 111 // FIXME: This member is here on a short-term lease. The plan is to remove | 109 // FIXME: This member is here on a short-term lease. The plan is to remove |
| 112 // any notion of RenderStyle from here, allowing FontBuilder to build Font o
bjects | 110 // any notion of RenderStyle from here, allowing FontBuilder to build Font o
bjects |
| 113 // directly, rather than as a byproduct of calling RenderStyle::setFontDescr
iption. | 111 // directly, rather than as a byproduct of calling RenderStyle::setFontDescr
iption. |
| 114 // FontDescriptionChangeScope should be the only consumer of this member. | 112 // FontDescriptionChangeScope should be the only consumer of this member. |
| 115 // If you're using it, U R DOIN IT WRONG. | 113 // If you're using it, U R DOIN IT WRONG. |
| 116 RenderStyle* m_style; | 114 RenderStyle* m_style; |
| 117 | 115 |
| 118 // Fontbuilder is responsbile for creating the Font() | 116 // Fontbuilder is responsbile for creating the Font() |
| 119 // object on RenderStyle from various other font-related | 117 // object on RenderStyle from various other font-related |
| 120 // properties on RenderStyle. Whenever one of those | 118 // properties on RenderStyle. Whenever one of those |
| 121 // is changed, FontBuilder tracks the need to update | 119 // is changed, FontBuilder tracks the need to update |
| 122 // style->font() with this bool. | 120 // style->font() with this bool. |
| 123 bool m_fontDirty; | 121 bool m_fontDirty; |
| 124 | 122 |
| 125 friend class FontBuilderTest; | 123 friend class FontBuilderTest; |
| 126 }; | 124 }; |
| 127 | 125 |
| 128 } | 126 } |
| 129 | 127 |
| 130 #endif | 128 #endif |
| OLD | NEW |