Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Side by Side Diff: Source/core/css/resolver/FontBuilder.h

Issue 308123010: Trigger computation of font size when crossing foreignObject boundary (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove use of useSVGZoomRules in FontBuilder and add a forced mode for when crossing the foreignObj… Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 24 matching lines...) Expand all
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 WTF_MAKE_NONCOPYABLE(FontBuilder); WTF_MAKE_FAST_ALLOCATED; 41 WTF_MAKE_NONCOPYABLE(FontBuilder); WTF_MAKE_FAST_ALLOCATED;
42 public: 42 public:
43 FontBuilder(); 43 FontBuilder();
44 44
45 enum FontBuilderOperation {
46 OnlyBuildFontOnChange,
47 AlwaysBuildFont,
48 };
49
45 // FIXME: The name is probably wrong, but matches StyleResolverState callsit e for consistency. 50 // FIXME: The name is probably wrong, but matches StyleResolverState callsit e for consistency.
46 void initForStyleResolve(const Document&, RenderStyle*, bool useSVGZoomRules ); 51 void initForStyleResolve(const Document&, RenderStyle*, FontBuilderOperation = OnlyBuildFontOnChange);
pdr. 2014/06/03 16:40:46 Could you add a comment here explaining why one wo
47 52
48 void setInitial(float effectiveZoom); 53 void setInitial(float effectiveZoom);
49 54
50 void didChangeFontParameters(bool); 55 void didChangeFontParameters(bool);
51 56
52 void inheritFrom(const FontDescription&); 57 void inheritFrom(const FontDescription&);
53 void fromSystemFont(CSSValueID, float effectiveZoom); 58 void fromSystemFont(CSSValueID, float effectiveZoom);
54 59
55 void setFontFamilyInitial(); 60 void setFontFamilyInitial();
56 void setFontFamilyInherit(const FontDescription&); 61 void setFontFamilyInherit(const FontDescription&);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // FIXME: "size" arg should be first for consistency with other similar func tions. 110 // FIXME: "size" arg should be first for consistency with other similar func tions.
106 void setSize(FontDescription&, float effectiveZoom, float size); 111 void setSize(FontDescription&, float effectiveZoom, float size);
107 void checkForOrientationChange(RenderStyle*); 112 void checkForOrientationChange(RenderStyle*);
108 // This function fixes up the default font size if it detects that the curre nt generic font family has changed. -dwh 113 // This function fixes up the default font size if it detects that the curre nt generic font family has changed. -dwh
109 void checkForGenericFamilyChange(RenderStyle*, const RenderStyle* parentStyl e); 114 void checkForGenericFamilyChange(RenderStyle*, const RenderStyle* parentStyl e);
110 void updateComputedSize(RenderStyle*, const RenderStyle* parentStyle); 115 void updateComputedSize(RenderStyle*, const RenderStyle* parentStyle);
111 116
112 float getComputedSizeFromSpecifiedSize(FontDescription&, float effectiveZoom , float specifiedSize); 117 float getComputedSizeFromSpecifiedSize(FontDescription&, float effectiveZoom , float specifiedSize);
113 118
114 const Document* m_document; 119 const Document* m_document;
115 bool m_useSVGZoomRules;
116 bool m_fontSizehasViewportUnits; 120 bool m_fontSizehasViewportUnits;
117 // FIXME: This member is here on a short-term lease. The plan is to remove 121 // FIXME: This member is here on a short-term lease. The plan is to remove
118 // any notion of RenderStyle from here, allowing FontBuilder to build Font o bjects 122 // any notion of RenderStyle from here, allowing FontBuilder to build Font o bjects
119 // directly, rather than as a byproduct of calling RenderStyle::setFontDescr iption. 123 // directly, rather than as a byproduct of calling RenderStyle::setFontDescr iption.
120 // FontDescriptionChangeScope should be the only consumer of this member. 124 // FontDescriptionChangeScope should be the only consumer of this member.
121 // If you're using it, U R DOIN IT WRONG. 125 // If you're using it, U R DOIN IT WRONG.
122 RenderStyle* m_style; 126 RenderStyle* m_style;
123 127
124 // Fontbuilder is responsbile for creating the Font() 128 // Fontbuilder is responsbile for creating the Font()
125 // object on RenderStyle from various other font-related 129 // object on RenderStyle from various other font-related
126 // properties on RenderStyle. Whenever one of those 130 // properties on RenderStyle. Whenever one of those
127 // is changed, FontBuilder tracks the need to update 131 // is changed, FontBuilder tracks the need to update
128 // style->font() with this bool. 132 // style->font() with this bool.
129 bool m_fontDirty; 133 bool m_fontDirty;
130 134
131 friend class FontBuilderTest; 135 friend class FontBuilderTest;
132 }; 136 };
133 137
134 } 138 }
135 139
136 #endif 140 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698