Changeset 183494 in webkit


Ignore:
Timestamp:
Apr 28, 2015 11:36:59 AM (9 years ago)
Author:
mmaxfield@apple.com
Message:

Source/WebCore:
[Mac] [iOS] Implement font-synthesis CSS property
https://bugs.webkit.org/show_bug.cgi?id=144305

Reviewed by Andreas Kling.

This patch is fairly straightforward, though there are some particular pieces to the patch listed below.

The implementation of this font-synthesis CSS property lives inside FontCacheIOS and FontCacheMac. We already
determine if we should synthesize bold and italics, this CSS property simply guards that decision.

Because FontCache interacts with FontDescriptions and not RenderStyles, this patch moves the source of truth
regarding font-synthesis into FontDescription (from RenderStyle).

Test: fast/css3-text/font-synthesis.html

  • css/CSSPropertyNames.in: Mark font-synthesis as a FontProperty, which means that the relevant state is kept

inside FontDescription. This also means that the property must be marked as a "high priority" property, which
is enforced by it existing at the top of CSSPropertyNames.in. The move to FontDescription must be done so that
FontCacheIOS and FontCacheMac have access to the saved state.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::fontSynthesisFromStyle): Update to look for state in FontDescription instead of RenderStyle.

  • css/CSSSegmentedFontFace.cpp:

(WebCore::CSSSegmentedFontFace::fontRanges): Guard the synthetic bold and synthic italic decision on the new
FontSynthesis state inside FontDescription.

  • css/StyleBuilderConverter.h:

(WebCore::StyleBuilderConverter::convertFontSynthesis): Moved from
StyleBuilderCustom::applyValueFontSynthesis(). This is because of the updated options inside of
CSSPropertyNames.in

  • css/StyleBuilderCustom.h:

(WebCore::StyleBuilderCustom::applyValueFontSynthesis): Deleted.

  • platform/graphics/FontDescription.h:

(WebCore::FontDescription::FontDescription): Moved from RenderStyle.
(WebCore::FontDescription::fontSynthesis): Ditto.
(WebCore::FontDescription::setFontSynthesis): Ditto.
(WebCore::FontDescription::initialFontSynthesis): Ditto.
(WebCore::FontDescription::operator==): Update to include new state.

  • platform/graphics/FontCache.h:

(WebCore::FontDescriptionFontDataCacheKey::makeFlagKey): Make FontDescription hashes sensitive to the new
state inside FontDescription.

  • platform/graphics/ios/FontCacheIOS.mm:

(WebCore::FontCache::createFontPlatformData): Guard the synthetic bold and synthetic italic decision on the
new FontSynthesis state inside FontDescription.

  • platform/graphics/mac/FontCacheMac.mm:

(WebCore::FontCache::createFontPlatformData): Ditto.

  • platform/text/TextFlags.h: Move FontSynthesis type from RenderStyleConstants.
  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::fontSynthesis): Moved to FontDescription.
(WebCore::RenderStyle::setFontSynthesis): Ditto.
(WebCore::RenderStyle::initialFontSynthesis): Ditto.

  • rendering/style/RenderStyleConstants.h: Moved FontSynthesis type to TextFlags.
  • rendering/style/StyleRareInheritedData.h: Remove state regarding font synthesis (moved to FontDescription)

LayoutTests:
Implement font-synthesis CSS property
https://bugs.webkit.org/show_bug.cgi?id=144305

Reviewed by Andreas Kling.

Test all combinations of font-weight, font-style, and font-synthesis.

  • fast/css3-text/font-synthesis-expected.html: Added.
  • fast/css3-text/font-synthesis.html: Added.
Location:
trunk
Files:
2 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r183493 r183494  
     12015-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Implement font-synthesis CSS property
     4        https://bugs.webkit.org/show_bug.cgi?id=144305
     5
     6        Reviewed by Andreas Kling.
     7
     8        Test all combinations of font-weight, font-style, and font-synthesis.
     9
     10        * fast/css3-text/font-synthesis-expected.html: Added.
     11        * fast/css3-text/font-synthesis.html: Added.
     12
    1132015-04-28  Brent Fulgham  <bfulgham@apple.com>
    214
  • trunk/LayoutTests/fast/css3-text/font-synthesis-parse-expected.txt

    r183348 r183494  
    22PASS declaration.length is 0
    33PASS declaration.getPropertyValue('font-synthesis') is null
    4 PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "none"
     4PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "style weight"
    55PASS cssRule.type is cssRule.STYLE_RULE
    66PASS declaration.length is 1
     
    3434PASS declaration.length is 0
    3535PASS declaration.getPropertyValue('font-synthesis') is null
    36 PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "none"
     36PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "style weight"
    3737PASS cssRule.type is cssRule.STYLE_RULE
    3838PASS declaration.length is 0
    3939PASS declaration.getPropertyValue('font-synthesis') is null
    40 PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "none"
     40PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "style weight"
    4141PASS cssRule.type is cssRule.STYLE_RULE
    4242PASS declaration.length is 0
    4343PASS declaration.getPropertyValue('font-synthesis') is null
    44 PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "none"
     44PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "style weight"
    4545PASS cssRule.type is cssRule.STYLE_RULE
    4646PASS declaration.length is 0
    4747PASS declaration.getPropertyValue('font-synthesis') is null
    48 PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "none"
     48PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "style weight"
    4949PASS cssRule.type is cssRule.STYLE_RULE
    5050PASS declaration.length is 0
    5151PASS declaration.getPropertyValue('font-synthesis') is null
    52 PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "none"
     52PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "style weight"
    5353PASS successfullyParsed is true
    5454
  • trunk/LayoutTests/fast/css3-text/font-synthesis-parse.html

    r183348 r183494  
    88  <div id="q"><div id="r"></div></div>
    99  <script type="text/javascript">
    10     function testEmptyIsNone(stylesheet, target) {
     10    function testEmptyIsBoth(stylesheet, target) {
    1111      cssRule = stylesheet.cssRules.item(0);
    1212      shouldBe("cssRule.type", "cssRule.STYLE_RULE");
     
    1515      shouldBe("declaration.getPropertyValue('font-synthesis')", "null");
    1616      computedStyle = window.getComputedStyle(target, null);
    17       shouldBeEqualToString("computedStyle.getPropertyCSSValue('font-synthesis').cssText", "none");
     17      shouldBeEqualToString("computedStyle.getPropertyCSSValue('font-synthesis').cssText", "style weight");
    1818      stylesheet.deleteRule(0);
    1919    }
     
    8080
    8181    stylesheet.insertRule("#p { }", 0);
    82     testEmptyIsNone(stylesheet, target);
     82    testEmptyIsBoth(stylesheet, target);
    8383
    8484    stylesheet.insertRule("#p { font-synthesis: initial; }", 0);
     
    104104
    105105    stylesheet.insertRule("#p { font-synthesis: garbage style }", 0);
    106     testEmptyIsNone(stylesheet, target);
     106    testEmptyIsBoth(stylesheet, target);
    107107
    108108    stylesheet.insertRule("#p { font-synthesis: style garbage }", 0);
    109     testEmptyIsNone(stylesheet, target);
     109    testEmptyIsBoth(stylesheet, target);
    110110
    111111    stylesheet.insertRule("#p { font-synthesis: garbage style garbage }", 0);
    112     testEmptyIsNone(stylesheet, target);
     112    testEmptyIsBoth(stylesheet, target);
    113113
    114114    stylesheet.insertRule("#p { font-synthesis: style garbage style }", 0);
    115     testEmptyIsNone(stylesheet, target);
     115    testEmptyIsBoth(stylesheet, target);
    116116
    117117    stylesheet.insertRule("#p { font-synthesis: weight garbage }", 0);
    118     testEmptyIsNone(stylesheet, target);
     118    testEmptyIsBoth(stylesheet, target);
    119119
    120120  </script>
  • trunk/Source/WebCore/ChangeLog

    r183489 r183494  
     12015-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [Mac] [iOS] Implement font-synthesis CSS property
     4        https://bugs.webkit.org/show_bug.cgi?id=144305
     5
     6        Reviewed by Andreas Kling.
     7
     8        This patch is fairly straightforward, though there are some particular pieces to the patch listed below.
     9
     10        The implementation of this font-synthesis CSS property lives inside FontCacheIOS and FontCacheMac. We already
     11        determine if we should synthesize bold and italics, this CSS property simply guards that decision.
     12
     13        Because FontCache interacts with FontDescriptions and not RenderStyles, this patch moves the source of truth
     14        regarding font-synthesis into FontDescription (from RenderStyle).
     15
     16        Test: fast/css3-text/font-synthesis.html
     17
     18        * css/CSSPropertyNames.in: Mark font-synthesis as a FontProperty, which means that the relevant state is kept
     19        inside FontDescription. This also means that the property must be marked as a "high priority" property, which
     20        is enforced by it existing at the top of CSSPropertyNames.in. The move to FontDescription must be done so that
     21        FontCacheIOS and FontCacheMac have access to the saved state.
     22        * css/CSSComputedStyleDeclaration.cpp:
     23        (WebCore::fontSynthesisFromStyle): Update to look for state in FontDescription instead of RenderStyle.
     24        * css/CSSSegmentedFontFace.cpp:
     25        (WebCore::CSSSegmentedFontFace::fontRanges): Guard the synthetic bold and synthic italic decision on the new
     26        FontSynthesis state inside FontDescription.
     27        * css/StyleBuilderConverter.h:
     28        (WebCore::StyleBuilderConverter::convertFontSynthesis): Moved from
     29        StyleBuilderCustom::applyValueFontSynthesis(). This is because of the updated options inside of
     30        CSSPropertyNames.in
     31        * css/StyleBuilderCustom.h:
     32        (WebCore::StyleBuilderCustom::applyValueFontSynthesis): Deleted.
     33        * platform/graphics/FontDescription.h:
     34        (WebCore::FontDescription::FontDescription): Moved from RenderStyle.
     35        (WebCore::FontDescription::fontSynthesis): Ditto.
     36        (WebCore::FontDescription::setFontSynthesis): Ditto.
     37        (WebCore::FontDescription::initialFontSynthesis): Ditto.
     38        (WebCore::FontDescription::operator==): Update to include new state.
     39        * platform/graphics/FontCache.h:
     40        (WebCore::FontDescriptionFontDataCacheKey::makeFlagKey): Make FontDescription hashes sensitive to the new
     41        state inside FontDescription.
     42        * platform/graphics/ios/FontCacheIOS.mm:
     43        (WebCore::FontCache::createFontPlatformData): Guard the synthetic bold and synthetic italic decision on the
     44        new FontSynthesis state inside FontDescription.
     45        * platform/graphics/mac/FontCacheMac.mm:
     46        (WebCore::FontCache::createFontPlatformData): Ditto.
     47        * platform/text/TextFlags.h: Move FontSynthesis type from RenderStyleConstants.
     48        * rendering/style/RenderStyle.h:
     49        (WebCore::RenderStyle::fontSynthesis): Moved to FontDescription.
     50        (WebCore::RenderStyle::setFontSynthesis): Ditto.
     51        (WebCore::RenderStyle::initialFontSynthesis): Ditto.
     52        * rendering/style/RenderStyleConstants.h: Moved FontSynthesis type to TextFlags.
     53        * rendering/style/StyleRareInheritedData.h: Remove state regarding font synthesis (moved to FontDescription)
     54
    1552015-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
    256
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r183314 r183494  
    16141614static Ref<CSSValue> fontSynthesisFromStyle(RenderStyle& style)
    16151615{
    1616     if (style.fontSynthesis() == FontSynthesisNone)
     1616    if (style.fontDescription().fontSynthesis() == FontSynthesisNone)
    16171617        return cssValuePool().createIdentifierValue(CSSValueNone);
    16181618
    16191619    auto list = CSSValueList::createSpaceSeparated();
    1620     if (style.fontSynthesis() & FontSynthesisStyle)
     1620    if (style.fontDescription().fontSynthesis() & FontSynthesisStyle)
    16211621        list.get().append(cssValuePool().createIdentifierValue(CSSValueStyle));
    1622     if (style.fontSynthesis() & FontSynthesisWeight)
     1622    if (style.fontDescription().fontSynthesis() & FontSynthesisWeight)
    16231623        list.get().append(cssValuePool().createIdentifierValue(CSSValueWeight));
    16241624    return Ref<CSSValue>(list.get());
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r183304 r183494  
    119119-epub-writing-mode = -webkit-writing-mode
    120120zoom [Custom=All]
     121font-synthesis [Inherited, FontProperty, Converter=FontSynthesis]
    121122
    122123// Keep this in between the highest priority props and the lower ones.
     
    224225font [Inherited, Longhands=font-family|font-size|font-style|font-variant|font-weight|line-height]
    225226font-stretch [SkipBuilder]
    226 font-synthesis [Inherited, Custom=Value]
    227227glyph-orientation-horizontal [Inherited, SVG, Converter=GlyphOrientation]
    228228glyph-orientation-vertical [Inherited, SVG, Converter=GlyphOrientationOrAuto]
  • trunk/Source/WebCore/css/CSSSegmentedFontFace.cpp

    r178940 r183494  
    114114
    115115    FontTraitsMask desiredTraitsMask = fontDescription.traitsMask();
    116     unsigned hashKey = ((fontDescription.computedPixelSize() + 1) << (FontTraitsMaskWidth + FontWidthVariantWidth + 1))
     116    // FIXME: Unify this function with FontDescriptionFontDataCacheKey in FontCache.h (Or just use the regular FontCache instead of this)
     117    unsigned hashKey = ((fontDescription.computedPixelSize() + 1) << (FontTraitsMaskWidth + FontWidthVariantWidth + FontSynthesisWidth + 1))
     118        | (fontDescription.fontSynthesis() << (FontTraitsMaskWidth + FontWidthVariantWidth + 1))
    117119        | ((fontDescription.orientation() == Vertical ? 1 : 0) << (FontTraitsMaskWidth + FontWidthVariantWidth))
    118120        | fontDescription.widthVariant() << FontTraitsMaskWidth
     
    126128            if (!face->isValid())
    127129                continue;
     130
    128131            FontTraitsMask traitsMask = face->traitsMask();
    129             bool syntheticBold = !(traitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask)) && (desiredTraitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask));
    130             bool syntheticItalic = !(traitsMask & FontStyleItalicMask) && (desiredTraitsMask & FontStyleItalicMask);
     132            bool syntheticBold = (fontDescription.fontSynthesis() & FontSynthesisWeight) && !(traitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask)) && (desiredTraitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask));
     133            bool syntheticItalic = (fontDescription.fontSynthesis() & FontSynthesisStyle) && !(traitsMask & FontStyleItalicMask) && (desiredTraitsMask & FontStyleItalicMask);
     134
    131135            if (RefPtr<Font> faceFont = face->font(fontDescription, syntheticBold, syntheticItalic))
    132136                appendFontWithInvalidUnicodeRangeIfLoading(fontRanges, faceFont.releaseNonNull(), face->ranges());
  • trunk/Source/WebCore/css/StyleBuilderConverter.h

    r181352 r183494  
    125125    static EGlyphOrientation convertGlyphOrientationOrAuto(StyleResolver&, CSSValue&);
    126126    static Optional<Length> convertLineHeight(StyleResolver&, CSSValue&, float multiplier = 1.f);
     127    static FontSynthesis convertFontSynthesis(StyleResolver&, CSSValue&);
    127128
    128129private:
     
    12121213}
    12131214
     1215FontSynthesis StyleBuilderConverter::convertFontSynthesis(StyleResolver&, CSSValue& value)
     1216{
     1217    if (is<CSSPrimitiveValue>(value)) {
     1218        ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNone);
     1219        return FontSynthesisNone;
     1220    }
     1221
     1222    FontSynthesis result = FontSynthesisNone;
     1223    ASSERT(is<CSSValueList>(value));
     1224    for (CSSValue& v : downcast<CSSValueList>(value)) {
     1225        switch (downcast<CSSPrimitiveValue>(v).getValueID()) {
     1226        case CSSValueWeight:
     1227            result |= FontSynthesisWeight;
     1228            break;
     1229        case CSSValueStyle:
     1230            result |= FontSynthesisStyle;
     1231            break;
     1232        default:
     1233            ASSERT_NOT_REACHED();
     1234            break;
     1235        }
     1236    }
     1237
     1238    return result;
     1239}
     1240
    12141241} // namespace WebCore
    12151242
  • trunk/Source/WebCore/css/StyleBuilderCustom.h

    r183304 r183494  
    7777    DECLARE_PROPERTY_CUSTOM_HANDLERS(FontSize);
    7878    DECLARE_PROPERTY_CUSTOM_HANDLERS(FontWeight);
    79     DECLARE_PROPERTY_CUSTOM_HANDLERS(FontSynthesis);
    8079#if ENABLE(CSS_IMAGE_RESOLUTION)
    8180    DECLARE_PROPERTY_CUSTOM_HANDLERS(ImageResolution);
     
    13771376}
    13781377
    1379 inline void StyleBuilderCustom::applyValueFontSynthesis(StyleResolver& styleResolver, CSSValue& value)
    1380 {
    1381     if (is<CSSPrimitiveValue>(value)) {
    1382         ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNone);
    1383         styleResolver.style()->setFontSynthesis(FontSynthesisNone);
    1384     }
    1385 
    1386     FontSynthesis result = FontSynthesisNone;
    1387     ASSERT(is<CSSValueList>(value));
    1388     for (CSSValue& i : downcast<CSSValueList>(value)) {
    1389         switch (downcast<CSSPrimitiveValue>(i).getValueID()) {
    1390         case CSSValueWeight:
    1391             result |= FontSynthesisWeight;
    1392             break;
    1393         case CSSValueStyle:
    1394             result |= FontSynthesisStyle;
    1395             break;
    1396         default:
    1397             ASSERT_NOT_REACHED();
    1398             break;
    1399         }
    1400     }
    1401 
    1402     styleResolver.style()->setFontSynthesis(result);
    1403 }
    1404 
    14051378inline void StyleBuilderCustom::applyInitialColumnGap(StyleResolver& styleResolver)
    14061379{
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r182613 r183494  
    169169using namespace HTMLNames;
    170170
    171 static const CSSPropertyID lastHighPriorityProperty = CSSPropertyZoom;
     171static const CSSPropertyID lastHighPriorityProperty = CSSPropertyFontSynthesis;
    172172static const CSSPropertyID firstLowPriorityProperty = static_cast<CSSPropertyID>(lastHighPriorityProperty + 1);
    173173
  • trunk/Source/WebCore/platform/graphics/FontCache.h

    r181348 r183494  
    8080    static unsigned makeFlagKey(const FontDescription& description)
    8181    {
    82         return static_cast<unsigned>(description.widthVariant()) << 4
     82        return static_cast<unsigned>(description.fontSynthesis()) << 6
     83            | static_cast<unsigned>(description.widthVariant()) << 4
    8384            | static_cast<unsigned>(description.nonCJKGlyphOrientation()) << 3
    8485            | static_cast<unsigned>(description.orientation()) << 2
  • trunk/Source/WebCore/platform/graphics/FontDescription.h

    r183442 r183494  
    6666        , m_isSpecifiedFont(false)
    6767        , m_script(USCRIPT_COMMON)
     68        , m_fontSynthesis(initialFontSynthesis())
    6869    {
    6970    }
     
    110111    FontWidthVariant widthVariant() const { return static_cast<FontWidthVariant>(m_widthVariant); }
    111112    FontFeatureSettings* featureSettings() const { return m_featureSettings.get(); }
     113    FontSynthesis fontSynthesis() const { return static_cast<FontSynthesis>(m_fontSynthesis); }
    112114
    113115    void setOneFamily(const AtomicString& family) { ASSERT(m_families.size() == 1); m_families[0] = family; }
     
    148150    void setScript(UScriptCode s) { m_script = s; }
    149151    void setFeatureSettings(PassRefPtr<FontFeatureSettings> settings) { m_featureSettings = settings; }
     152    void setFontSynthesis(FontSynthesis fontSynthesis) { m_fontSynthesis = fontSynthesis; }
    150153
    151154#if ENABLE(IOS_TEXT_AUTOSIZING)
     
    167170    static FontSmoothingMode initialFontSmoothing() { return AutoSmoothing; }
    168171    static TextRenderingMode initialTextRenderingMode() { return AutoTextRendering; }
     172    static FontSynthesis initialFontSynthesis() { return FontSynthesisWeight | FontSynthesisStyle; }
    169173
    170174private:
     
    202206    unsigned m_isSpecifiedFont : 1; // True if a web page specifies a non-generic font family as the first font family.
    203207    unsigned m_script : 7; // Used to help choose an appropriate font for generic font families.
     208    unsigned m_fontSynthesis : 2; // FontSynthesis type
    204209};
    205210
     
    226231        && m_widthVariant == other.m_widthVariant
    227232        && m_script == other.m_script
    228         && m_featureSettings == other.m_featureSettings;
     233        && m_featureSettings == other.m_featureSettings
     234        && m_fontSynthesis == other.m_fontSynthesis;
    229235}
    230236
  • trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm

    r182894 r183494  
    695695    bool isAppleColorEmoji = CTFontIsAppleColorEmoji(ctFont.get());
    696696
    697     bool syntheticBold = (traits & kCTFontTraitBold) && !(actualTraits & kCTFontTraitBold) && !isAppleColorEmoji;
    698     bool syntheticOblique = (traits & kCTFontTraitItalic) && !(actualTraits & kCTFontTraitItalic) && !isAppleColorEmoji;
     697    bool syntheticBold = (fontDescription.fontSynthesis() & FontSynthesisWeight) && (traits & kCTFontTraitBold) && !(actualTraits & kCTFontTraitBold) && !isAppleColorEmoji;
     698    bool syntheticOblique = (fontDescription.fontSynthesis() & FontSynthesisStyle) && (traits & kCTFontTraitItalic) && !(actualTraits & kCTFontTraitItalic) && !isAppleColorEmoji;
    699699
    700700    auto result = std::make_unique<FontPlatformData>(ctFont.get(), size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant());
  • trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm

    r183269 r183494  
    510510
    511511    NSFont *platformFont = [nsFont printerFont];
    512     bool syntheticBold = isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(actualWeight);
    513     bool syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait);
     512    bool syntheticBold = (fontDescription.fontSynthesis() & FontSynthesisWeight) && isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(actualWeight);
     513    bool syntheticOblique = (fontDescription.fontSynthesis() & FontSynthesisStyle) && (traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait);
    514514
    515515    return std::make_unique<FontPlatformData>(reinterpret_cast<CTFontRef>(platformFont), size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant());
  • trunk/Source/WebCore/platform/text/TextFlags.h

    r183442 r183494  
    5959};
    6060typedef unsigned ExpansionBehavior;
     61
     62enum FontSynthesisValues {
     63    FontSynthesisNone = 0x0,
     64    FontSynthesisWeight = 0x1,
     65    FontSynthesisStyle = 0x2
     66};
     67typedef unsigned FontSynthesis;
     68const unsigned FontSynthesisWidth = 2;
    6169
    6270enum FontWidthVariant {
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r183454 r183494  
    10251025
    10261026    TextOrientation textOrientation() const { return static_cast<TextOrientation>(rareInheritedData->m_textOrientation); }
    1027 
    1028     FontSynthesis fontSynthesis() const { return static_cast<FontSynthesis>(rareInheritedData->fontSynthesis); }
    10291027
    10301028    ObjectFit objectFit() const { return static_cast<ObjectFit>(rareNonInheritedData->m_objectFit); }
     
    15421540    void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b); }
    15431541    void setOverflowWrap(EOverflowWrap b) { SET_VAR(rareInheritedData, overflowWrap, b); }
    1544     void setFontSynthesis(FontSynthesis synthesis) { SET_VAR(rareInheritedData, fontSynthesis, synthesis); }
    15451542    void setNBSPMode(ENBSPMode b) { SET_VAR(rareInheritedData, nbspMode, b); }
    15461543    void setLineBreak(LineBreak b) { SET_VAR(rareInheritedData, lineBreak, b); }
     
    20712068    static Isolation initialIsolation() { return IsolationAuto; }
    20722069#endif
    2073     static FontSynthesis initialFontSynthesis() { return FontSynthesisStyle | FontSynthesisWeight; }
    20742070
    20752071    static ptrdiff_t noninheritedFlagsMemoryOffset() { return OBJECT_OFFSETOF(RenderStyle, noninherited_flags); }
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r183454 r183494  
    418418};
    419419
    420 enum FontSynthesisValues {
    421     FontSynthesisNone = 0x0,
    422     FontSynthesisWeight = 0x1,
    423     FontSynthesisStyle = 0x2
    424 };
    425 typedef unsigned FontSynthesis;
    426 
    427420#if ENABLE(LETTERPRESS)
    428421static const size_t TextDecorationBits = 5;
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h

    r183304 r183494  
    134134#endif
    135135
    136     unsigned fontSynthesis : 2;
    137 
    138136    AtomicString hyphenationString;
    139137    short hyphenationLimitBefore;
Note: See TracChangeset for help on using the changeset viewer.