source: webkit/trunk/Source/WebCore/css/CSSFontValue.cpp

Last change on this file was 218890, checked in by Konstantin Tokarev, 8 years ago

Remove excessive includes from WebCore/css sources
https://bugs.webkit.org/show_bug.cgi?id=173919

Reviewed by Simon Fraser.

No new tests needed.

  • css/CSSCanvasValue.cpp:
  • css/CSSComputedStyleDeclaration.cpp:
  • css/CSSContentDistributionValue.cpp:
  • css/CSSCrossfadeValue.cpp:
  • css/CSSCursorImageValue.cpp:
  • css/CSSCustomPropertyValue.cpp:
  • css/CSSDefaultStyleSheets.cpp:
  • css/CSSFilterImageValue.cpp:
  • css/CSSFontFace.cpp:
  • css/CSSFontFaceSet.cpp:
  • css/CSSFontFaceSource.cpp:
  • css/CSSFontFaceSrcValue.cpp:
  • css/CSSFontFeatureValue.cpp:
  • css/CSSFontSelector.cpp:
  • css/CSSFontValue.cpp:
  • css/CSSImageGeneratorValue.cpp:
  • css/CSSImageSetValue.cpp:
  • css/CSSImageValue.cpp:
  • css/CSSImportRule.cpp:
  • css/CSSKeyframesRule.cpp:
  • css/CSSMediaRule.cpp:
  • css/CSSNamedImageValue.cpp:
  • css/CSSPrimitiveValue.cpp:
  • css/CSSProperty.cpp:
  • css/CSSPropertySourceData.cpp:
  • css/CSSReflectValue.cpp:
  • css/CSSRuleList.cpp:
  • css/CSSSegmentedFontFace.cpp:
  • css/CSSSelector.cpp:
  • css/CSSStyleRule.cpp:
  • css/CSSStyleSheet.cpp:
  • css/CSSSupportsRule.cpp:
  • css/CSSToStyleMap.cpp:
  • css/CSSValueList.cpp:
  • css/CSSValuePool.cpp:
  • css/CSSVariableData.cpp:
  • css/ElementRuleCollector.cpp:
  • css/InspectorCSSOMWrappers.cpp:
  • css/MediaList.cpp:
  • css/MediaQueryEvaluator.cpp:
  • css/MediaQueryExpression.cpp:
  • css/PropertySetCSSStyleDeclaration.cpp:
  • css/RGBColor.cpp:
  • css/SelectorChecker.cpp:
  • css/StyleProperties.cpp:
  • css/StyleResolver.cpp:
  • css/StyleRule.cpp:
  • css/StyleSheetContents.cpp:
  • css/TransformFunctions.cpp:
  • css/ViewportStyleResolver.cpp:
  • css/WebKitCSSRegionRule.cpp:
  • css/parser/CSSParser.cpp:
  • css/parser/CSSParserFastPaths.cpp:
  • css/parser/CSSParserIdioms.cpp:
  • css/parser/CSSParserSelector.cpp:
  • css/parser/CSSParserToken.cpp:
  • css/parser/CSSPropertyParser.cpp:
  • css/parser/CSSSelectorParser.cpp:
  • css/parser/MediaQueryParser.cpp:
  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1/**
2 * (C) 1999-2003 Lars Knoll ([email protected])
3 * Copyright (C) 2004, 2005, 2006 Apple Inc.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20#include "config.h"
21#include "CSSFontValue.h"
22
23#include "CSSValueList.h"
24#include <wtf/text/StringBuilder.h>
25
26namespace WebCore {
27
28String CSSFontValue::customCSSText() const
29{
30 // font variant weight size / line-height family
31
32 StringBuilder result;
33
34 if (style)
35 result.append(style->cssText());
36 if (variant) {
37 if (!result.isEmpty())
38 result.append(' ');
39 result.append(variant->cssText());
40 }
41 if (weight) {
42 if (!result.isEmpty())
43 result.append(' ');
44 result.append(weight->cssText());
45 }
46 if (stretch) {
47 if (!result.isEmpty())
48 result.append(' ');
49 result.append(stretch->cssText());
50 }
51 if (size) {
52 if (!result.isEmpty())
53 result.append(' ');
54 result.append(size->cssText());
55 }
56 if (lineHeight) {
57 if (!size)
58 result.append(' ');
59 result.append('/');
60 result.append(lineHeight->cssText());
61 }
62 if (family) {
63 if (!result.isEmpty())
64 result.append(' ');
65 result.append(family->cssText());
66 }
67
68 return result.toString();
69}
70
71bool CSSFontValue::equals(const CSSFontValue& other) const
72{
73 return compareCSSValuePtr(style, other.style)
74 && compareCSSValuePtr(variant, other.variant)
75 && compareCSSValuePtr(weight, other.weight)
76 && compareCSSValuePtr(stretch, other.stretch)
77 && compareCSSValuePtr(size, other.size)
78 && compareCSSValuePtr(lineHeight, other.lineHeight)
79 && compareCSSValuePtr(family, other.family);
80}
81
82}
Note: See TracBrowser for help on using the repository browser.