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

Side by Side Diff: Source/core/html/canvas/CanvasFontCache.cpp

Issue 1312843008: Remove CSSParserMode argument on CSSParser::parseValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « Source/core/css/parser/CSSParser.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "core/html/canvas/CanvasFontCache.h" 7 #include "core/html/canvas/CanvasFontCache.h"
8 8
9 #include "core/css/parser/CSSParser.h" 9 #include "core/css/parser/CSSParser.h"
10 #include "core/css/resolver/StyleResolver.h" 10 #include "core/css/resolver/StyleResolver.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 MutableStylePropertySet* CanvasFontCache::parseFont(const String& fontString) 84 MutableStylePropertySet* CanvasFontCache::parseFont(const String& fontString)
85 { 85 {
86 RefPtrWillBeRawPtr<MutableStylePropertySet> parsedStyle; 86 RefPtrWillBeRawPtr<MutableStylePropertySet> parsedStyle;
87 MutableStylePropertyMap::iterator i = m_fetchedFonts.find(fontString); 87 MutableStylePropertyMap::iterator i = m_fetchedFonts.find(fontString);
88 if (i != m_fetchedFonts.end()) { 88 if (i != m_fetchedFonts.end()) {
89 ASSERT(m_fontLRUList.contains(fontString)); 89 ASSERT(m_fontLRUList.contains(fontString));
90 parsedStyle = i->value; 90 parsedStyle = i->value;
91 m_fontLRUList.remove(fontString); 91 m_fontLRUList.remove(fontString);
92 m_fontLRUList.add(fontString); 92 m_fontLRUList.add(fontString);
93 } else { 93 } else {
94 parsedStyle = MutableStylePropertySet::create(HTMLQuirksMode); 94 parsedStyle = MutableStylePropertySet::create(HTMLStandardMode);
95 CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, tr ue, HTMLStandardMode, 0); 95 CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, tr ue, 0);
96 if (parsedStyle->isEmpty()) 96 if (parsedStyle->isEmpty())
97 return nullptr; 97 return nullptr;
98 // According to http://lists.w3.org/Archives/Public/public-html/2009Jul/ 0947.html, 98 // According to http://lists.w3.org/Archives/Public/public-html/2009Jul/ 0947.html,
99 // the "inherit" and "initial" values must be ignored. 99 // the "inherit" and "initial" values must be ignored.
100 RefPtrWillBeRawPtr<CSSValue> fontValue = parsedStyle->getPropertyCSSValu e(CSSPropertyFontSize); 100 RefPtrWillBeRawPtr<CSSValue> fontValue = parsedStyle->getPropertyCSSValu e(CSSPropertyFontSize);
101 if (fontValue && (fontValue->isInitialValue() || fontValue->isInheritedV alue())) 101 if (fontValue && (fontValue->isInitialValue() || fontValue->isInheritedV alue()))
102 return nullptr; 102 return nullptr;
103 m_fetchedFonts.add(fontString, parsedStyle); 103 m_fetchedFonts.add(fontString, parsedStyle);
104 m_fontLRUList.add(fontString); 104 m_fontLRUList.add(fontString);
105 // Hard limit is applied here, on the fly, while the soft limit is 105 // Hard limit is applied here, on the fly, while the soft limit is
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 DEFINE_TRACE(CanvasFontCache) 156 DEFINE_TRACE(CanvasFontCache)
157 { 157 {
158 #if ENABLE(OILPAN) 158 #if ENABLE(OILPAN)
159 visitor->trace(m_fetchedFonts); 159 visitor->trace(m_fetchedFonts);
160 visitor->trace(m_document); 160 visitor->trace(m_document);
161 #endif 161 #endif
162 } 162 }
163 163
164 } // blink 164 } // blink
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698