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

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

Issue 205743004: Expand system font values during font property parsing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and fix up unittest use of systemFont() Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/resolver/FontBuilder.h ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 FontDescriptionChangeScope scope(this); 115 FontDescriptionChangeScope scope(this);
116 116
117 scope.set(fontDescription); 117 scope.set(fontDescription);
118 } 118 }
119 119
120 void FontBuilder::didChangeFontParameters(bool changed) 120 void FontBuilder::didChangeFontParameters(bool changed)
121 { 121 {
122 m_fontDirty |= changed; 122 m_fontDirty |= changed;
123 } 123 }
124 124
125 void FontBuilder::fromSystemFont(CSSValueID valueId, float effectiveZoom)
126 {
127 FontDescriptionChangeScope scope(this);
128
129 FontDescription fontDescription;
130 RenderTheme::theme().systemFont(valueId, fontDescription);
131
132 // Double-check and see if the theme did anything. If not, don't bother upda ting the font.
133 if (!fontDescription.isAbsoluteSize())
134 return;
135
136 // Make sure the rendering mode and printer font settings are updated.
137 const Settings* settings = m_document->settings();
138 ASSERT(settings); // If we're doing style resolution, this document should a lways be in a frame and thus have settings
139 if (!settings)
140 return;
141 fontDescription.setUsePrinterFont(m_document->printing());
142
143 // Handle the zoom factor.
144 fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(fontDescrip tion, effectiveZoom, fontDescription.specifiedSize()));
145 scope.set(fontDescription);
146 }
147
148 void FontBuilder::setFontFamilyInitial() 125 void FontBuilder::setFontFamilyInitial()
149 { 126 {
150 FontDescriptionChangeScope scope(this); 127 FontDescriptionChangeScope scope(this);
151 128
152 setFontFamilyToStandard(scope.fontDescription(), m_document); 129 setFontFamilyToStandard(scope.fontDescription(), m_document);
153 } 130 }
154 131
155 void FontBuilder::setFontFamilyInherit(const FontDescription& parentFontDescript ion) 132 void FontBuilder::setFontFamilyInherit(const FontDescription& parentFontDescript ion)
156 { 133 {
157 FontDescriptionChangeScope scope(this); 134 FontDescriptionChangeScope scope(this);
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 FontOrientation fontOrientation; 646 FontOrientation fontOrientation;
670 NonCJKGlyphOrientation glyphOrientation; 647 NonCJKGlyphOrientation glyphOrientation;
671 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation) ; 648 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation) ;
672 fontDescription.setOrientation(fontOrientation); 649 fontDescription.setOrientation(fontOrientation);
673 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); 650 fontDescription.setNonCJKGlyphOrientation(glyphOrientation);
674 documentStyle->setFontDescription(fontDescription); 651 documentStyle->setFontDescription(fontDescription);
675 documentStyle->font().update(fontSelector); 652 documentStyle->font().update(fontSelector);
676 } 653 }
677 654
678 } 655 }
OLDNEW
« no previous file with comments | « Source/core/css/resolver/FontBuilder.h ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698