source: webkit/trunk/Source/WebCore/css/CSSFontVariationValue.h

Last change on this file was 266686, checked in by [email protected], 5 years ago

Remove all non-web-exposed uses of ENABLE(VARIATION_FONTS)
https://bugs.webkit.org/show_bug.cgi?id=216211

Reviewed by Darin Adler.

This is the first step toward enabling variation fonts on all ports.
This patch compiles internal data structures on all ports, keeping care to not make
any web-exposed changes. It also stops consulting with ENABLE(VARIATION_FONTS) on
Cocoa platforms, since the flag is enabled on all Cocoa platforms and we've been
shipping it for years.

No new tests because there is no behavior change.

  • css/CSSFontVariationValue.cpp:
  • css/CSSFontVariationValue.h:
  • css/CSSValue.cpp:

(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):

  • css/CSSValue.h:

(WebCore::CSSValue::isFontFeatureValue const):
(WebCore::CSSValue::isFontVariationValue const):

  • platform/graphics/FontCache.h:

(WebCore::FontDescriptionKey::FontDescriptionKey):
(WebCore::FontDescriptionKey::operator== const):
(WebCore::FontDescriptionKey::computeHash const):

  • platform/graphics/FontCascadeDescription.cpp:
  • platform/graphics/FontDescription.h:

(WebCore::FontDescription::setFeatureSettings):
(WebCore::FontDescription::setVariationSettings):
(WebCore::FontDescription::operator== const):
(WebCore::FontDescription::encode const):
(WebCore::FontDescription::decode):

  • platform/graphics/FontTaggedSettings.cpp:

(WebCore::operator<<):

  • platform/graphics/FontTaggedSettings.h:

(WebCore::FontVariationSettings::isEmpty const): Deleted.

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::denormalizeVariationWidth):
(WebCore::normalizeVariationWidth):
(WebCore::preparePlatformFont):
(WebCore::extractVariationBounds):
(WebCore::variationCapabilitiesForFontDescriptor):

  • platform/graphics/mac/FontCustomPlatformData.cpp:

(WebCore::FontCustomPlatformData::supportsFormat):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::setFontVariationSettings):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::fontVariationSettings const):

  • style/StyleBuilderConverter.h:

(WebCore::Style::BuilderConverter::convertFontVariationSettings):

  • style/StyleBuilderCustom.h:

(WebCore::Style::BuilderCustom::applyInheritFontFeatureSettings):
(WebCore::Style::BuilderCustom::applyInheritFontVariationSettings):

  • Property svn:eol-style set to native
File size: 2.0 KB
Line 
1/*
2 * Copyright (C) 2016 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#pragma once
27
28#include "CSSValue.h"
29#include "FontTaggedSettings.h"
30
31namespace WebCore {
32
33class CSSFontVariationValue final : public CSSValue {
34public:
35 static Ref<CSSFontVariationValue> create(FontTag tag, float value)
36 {
37 return adoptRef(*new CSSFontVariationValue(tag, value));
38 }
39
40 const FontTag& tag() const { return m_tag; }
41 float value() const { return m_value; }
42 String customCSSText() const;
43
44 bool equals(const CSSFontVariationValue&) const;
45
46private:
47 CSSFontVariationValue(FontTag, float);
48
49 FontTag m_tag;
50 const float m_value;
51};
52
53} // namespace WebCore
54
55SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSFontVariationValue, isFontVariationValue())
Note: See TracBrowser for help on using the repository browser.