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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 2388623002: Replace internal uses of BlinkMacSystemFont on Mac with system-ui (Closed)
Patch Set: Rebase Created 4 years, 1 month 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * * Redistributions of source code must retain the above copyright 4 * * Redistributions of source code must retain the above copyright
5 * notice, this list of conditions and the following disclaimer. 5 * notice, this list of conditions and the following disclaimer.
6 * * Redistributions in binary form must reproduce the above 6 * * Redistributions in binary form must reproduce the above
7 * copyright notice, this list of conditions and the following disclaimer 7 * copyright notice, this list of conditions and the following disclaimer
8 * in the documentation and/or other materials provided with the 8 * in the documentation and/or other materials provided with the
9 * distribution. 9 * distribution.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 28 matching lines...) Expand all
39 #include "core/css/CSSPathValue.h" 39 #include "core/css/CSSPathValue.h"
40 #include "core/css/CSSPrimitiveValueMappings.h" 40 #include "core/css/CSSPrimitiveValueMappings.h"
41 #include "core/css/CSSQuadValue.h" 41 #include "core/css/CSSQuadValue.h"
42 #include "core/css/CSSReflectValue.h" 42 #include "core/css/CSSReflectValue.h"
43 #include "core/css/CSSShadowValue.h" 43 #include "core/css/CSSShadowValue.h"
44 #include "core/css/CSSStringValue.h" 44 #include "core/css/CSSStringValue.h"
45 #include "core/css/CSSURIValue.h" 45 #include "core/css/CSSURIValue.h"
46 #include "core/css/CSSValuePair.h" 46 #include "core/css/CSSValuePair.h"
47 #include "core/css/resolver/FilterOperationResolver.h" 47 #include "core/css/resolver/FilterOperationResolver.h"
48 #include "core/frame/LocalFrame.h" 48 #include "core/frame/LocalFrame.h"
49 #include "core/frame/UseCounter.h"
49 #include "core/style/ClipPathOperation.h" 50 #include "core/style/ClipPathOperation.h"
50 #include "core/style/TextSizeAdjust.h" 51 #include "core/style/TextSizeAdjust.h"
51 #include "core/svg/SVGURIReference.h" 52 #include "core/svg/SVGURIReference.h"
53 #include "platform/fonts/FontCache.h"
52 #include "platform/transforms/RotateTransformOperation.h" 54 #include "platform/transforms/RotateTransformOperation.h"
53 #include "platform/transforms/ScaleTransformOperation.h" 55 #include "platform/transforms/ScaleTransformOperation.h"
54 #include "platform/transforms/TranslateTransformOperation.h" 56 #include "platform/transforms/TranslateTransformOperation.h"
55 #include <algorithm> 57 #include <algorithm>
56 58
57 namespace blink { 59 namespace blink {
58 60
59 namespace { 61 namespace {
60 62
61 static GridLength convertGridTrackBreadth(const StyleResolverState& state, 63 static GridLength convertGridTrackBreadth(const StyleResolverState& state,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 } 183 }
182 184
183 static bool convertFontFamilyName( 185 static bool convertFontFamilyName(
184 StyleResolverState& state, 186 StyleResolverState& state,
185 const CSSValue& value, 187 const CSSValue& value,
186 FontDescription::GenericFamilyType& genericFamily, 188 FontDescription::GenericFamilyType& genericFamily,
187 AtomicString& familyName) { 189 AtomicString& familyName) {
188 if (value.isFontFamilyValue()) { 190 if (value.isFontFamilyValue()) {
189 genericFamily = FontDescription::NoFamily; 191 genericFamily = FontDescription::NoFamily;
190 familyName = AtomicString(toCSSFontFamilyValue(value).value()); 192 familyName = AtomicString(toCSSFontFamilyValue(value).value());
193 #if OS(MACOSX)
194 if (familyName == FontCache::legacySystemFontFamily()) {
195 UseCounter::count(state.document(), UseCounter::BlinkMacSystemFont);
196 familyName = FontFamilyNames::system_ui;
197 }
198 #endif
191 } else if (state.document().settings()) { 199 } else if (state.document().settings()) {
192 genericFamily = 200 genericFamily =
193 convertGenericFamily(toCSSIdentifierValue(value).getValueID()); 201 convertGenericFamily(toCSSIdentifierValue(value).getValueID());
194 familyName = state.fontBuilder().genericFontFamilyName(genericFamily); 202 familyName = state.fontBuilder().genericFontFamilyName(genericFamily);
195 } 203 }
196 204
197 return !familyName.isEmpty(); 205 return !familyName.isEmpty();
198 } 206 }
199 207
200 FontDescription::FamilyDescription StyleBuilderConverter::convertFontFamily( 208 FontDescription::FamilyDescription StyleBuilderConverter::convertFontFamily(
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 // Instead of the actual zoom, use 1 to avoid potential rounding errors 1288 // Instead of the actual zoom, use 1 to avoid potential rounding errors
1281 Length length = primitiveValue.convertToLength( 1289 Length length = primitiveValue.convertToLength(
1282 state.cssToLengthConversionData().copyWithAdjustedZoom(1)); 1290 state.cssToLengthConversionData().copyWithAdjustedZoom(1));
1283 return *CSSPrimitiveValue::create(length, 1); 1291 return *CSSPrimitiveValue::create(length, 1);
1284 } 1292 }
1285 } 1293 }
1286 return value; 1294 return value;
1287 } 1295 }
1288 1296
1289 } // namespace blink 1297 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698