Changeset 190754 in webkit


Ignore:
Timestamp:
Oct 8, 2015 3:53:51 PM (9 years ago)
Author:
Chris Dumez
Message:

Revert r187626 (and r188025) as it caused a PLT regression
https://bugs.webkit.org/show_bug.cgi?id=149898
<rdar://problem/22657123>

Reviewed by Myles Maxfield.

  • css/CSSPropertyNames.in:
  • css/StyleBuilderCustom.h:

(WebCore::StyleBuilderCustom::applyValueWebkitLocale):

  • platform/graphics/Font.cpp:

(WebCore::CharacterFallbackMapKey::CharacterFallbackMapKey):
(WebCore::CharacterFallbackMapKey::operator==):
(WebCore::CharacterFallbackMapKeyHash::hash):
(WebCore::Font::systemFallbackFontForCharacter):

  • platform/graphics/FontCache.h:

(WebCore::FontDescriptionKey::operator==):
(WebCore::FontDescriptionKey::FontDescriptionKey): Deleted.
(WebCore::FontDescriptionKey::computeHash): Deleted.

  • platform/graphics/FontDescription.cpp:

(WebCore::FontDescription::FontDescription):
(WebCore::FontDescription::traitsMask): Deleted.
(WebCore::FontCascadeDescription::FontCascadeDescription): Deleted.

  • platform/graphics/FontDescription.h:

(WebCore::FontDescription::setScript):
(WebCore::FontDescription::operator==):
(WebCore::FontDescription::setFeatureSettings): Deleted.
(WebCore::FontCascadeDescription::initialVariantAlternates): Deleted.

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::FontCache::systemFallbackForCharacters):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::changeRequiresLayout):

  • rendering/style/RenderStyle.h:
  • rendering/style/StyleRareInheritedData.cpp:

(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):

  • rendering/style/StyleRareInheritedData.h:
  • style/StyleResolveForDocument.cpp:

(WebCore::Style::resolveForDocument):

Location:
trunk/Source/WebCore
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r190752 r190754  
     12015-10-08  Chris Dumez  <cdumez@apple.com>
     2
     3        Revert r187626 (and r188025) as it caused a PLT regression
     4        https://bugs.webkit.org/show_bug.cgi?id=149898
     5        <rdar://problem/22657123>
     6
     7        Reviewed by Myles Maxfield.
     8
     9        * css/CSSPropertyNames.in:
     10        * css/StyleBuilderCustom.h:
     11        (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
     12        * platform/graphics/Font.cpp:
     13        (WebCore::CharacterFallbackMapKey::CharacterFallbackMapKey):
     14        (WebCore::CharacterFallbackMapKey::operator==):
     15        (WebCore::CharacterFallbackMapKeyHash::hash):
     16        (WebCore::Font::systemFallbackFontForCharacter):
     17        * platform/graphics/FontCache.h:
     18        (WebCore::FontDescriptionKey::operator==):
     19        (WebCore::FontDescriptionKey::FontDescriptionKey): Deleted.
     20        (WebCore::FontDescriptionKey::computeHash): Deleted.
     21        * platform/graphics/FontDescription.cpp:
     22        (WebCore::FontDescription::FontDescription):
     23        (WebCore::FontDescription::traitsMask): Deleted.
     24        (WebCore::FontCascadeDescription::FontCascadeDescription): Deleted.
     25        * platform/graphics/FontDescription.h:
     26        (WebCore::FontDescription::setScript):
     27        (WebCore::FontDescription::operator==):
     28        (WebCore::FontDescription::setFeatureSettings): Deleted.
     29        (WebCore::FontCascadeDescription::initialVariantAlternates): Deleted.
     30        * platform/graphics/cocoa/FontCacheCoreText.cpp:
     31        (WebCore::FontCache::systemFallbackForCharacters):
     32        * rendering/style/RenderStyle.cpp:
     33        (WebCore::RenderStyle::changeRequiresLayout):
     34        * rendering/style/RenderStyle.h:
     35        * rendering/style/StyleRareInheritedData.cpp:
     36        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
     37        (WebCore::StyleRareInheritedData::operator==):
     38        * rendering/style/StyleRareInheritedData.h:
     39        * style/StyleResolveForDocument.cpp:
     40        (WebCore::Style::resolveForDocument):
     41
    1422015-10-08  Andreas Kling  <akling@apple.com>
    243
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r190663 r190754  
    115115font-variant-alternates [Inherited, FontProperty, NameForMethods=VariantAlternates]
    116116font-variant-east-asian [Inherited, FontProperty, NameForMethods=VariantEastAsian, Custom=All]
    117 -webkit-locale [Inherited, FontProperty, Custom=Value]
     117-webkit-locale [Inherited, Custom=Value]
    118118-webkit-text-orientation [Inherited, Custom=Value]
    119119-epub-text-orientation = -webkit-text-orientation
  • trunk/Source/WebCore/css/StyleBuilderCustom.h

    r190564 r190754  
    4141#include "Frame.h"
    4242#include "HTMLElement.h"
     43#include "LocaleToScriptMapping.h"
    4344#include "Rect.h"
    4445#include "RenderTheme.h"
     
    695696{
    696697    auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
    697    
    698     auto fontDescription = styleResolver.style()->fontDescription();
    699698    if (primitiveValue.getValueID() == CSSValueAuto)
    700         fontDescription.setLocale(nullAtom);
     699        styleResolver.style()->setLocale(nullAtom);
    701700    else
    702         fontDescription.setLocale(primitiveValue.getStringValue());
     701        styleResolver.style()->setLocale(primitiveValue.getStringValue());
     702
     703    FontCascadeDescription fontDescription = styleResolver.style()->fontDescription();
     704    fontDescription.setScript(localeToScriptCodeForFontSelection(styleResolver.style()->locale()));
    703705    styleResolver.setFontDescription(fontDescription);
    704706}
  • trunk/Source/WebCore/platform/graphics/Font.cpp

    r189539 r190754  
    394394    }
    395395
    396     CharacterFallbackMapKey(const AtomicString& locale, UChar32 character, bool isForPlatformFont)
    397         : locale(locale)
    398         , character(character)
     396    CharacterFallbackMapKey(UChar32 character, bool isForPlatformFont)
     397        : character(character)
    399398        , isForPlatformFont(isForPlatformFont)
    400399    {
     
    410409    bool operator==(const CharacterFallbackMapKey& other) const
    411410    {
    412         return locale == other.locale && character == other.character && isForPlatformFont == other.isForPlatformFont;
     411        return character == other.character && isForPlatformFont == other.isForPlatformFont;
    413412    }
    414413
     
    418417    friend struct CharacterFallbackMapKeyHash;
    419418
    420     AtomicString locale;
    421419    UChar32 character { 0 };
    422420    bool isForPlatformFont { false };
     
    426424    static unsigned hash(const CharacterFallbackMapKey& key)
    427425    {
    428         return WTF::pairIntHash(key.locale.isNull() ? 0 : WTF::AtomicStringHash::hash(key.locale), WTF::pairIntHash(key.character, key.isForPlatformFont));
     426        return WTF::pairIntHash(key.character, key.isForPlatformFont);
    429427    }
    430428
     
    457455    }
    458456
    459     auto key = CharacterFallbackMapKey(description.locale(), character, isForPlatformFont);
     457    auto key = CharacterFallbackMapKey(character, isForPlatformFont);
    460458    auto characterAddResult = fontAddResult.iterator->value.add(WTF::move(key), nullptr);
    461459
  • trunk/Source/WebCore/platform/graphics/FontCache.h

    r190746 r190754  
    7676        , m_weight(description.weight())
    7777        , m_flags(makeFlagsKey(description))
    78         , m_locale(description.locale())
    7978        , m_featureSettings(description.featureSettings())
    8079    { }
     
    8685    bool operator==(const FontDescriptionKey& other) const
    8786    {
    88         return m_size == other.m_size && m_weight == other.m_weight && m_flags == other.m_flags && m_locale == other.m_locale
     87        return m_size == other.m_size && m_weight == other.m_weight && m_flags == other.m_flags
    8988            && m_featureSettings == other.m_featureSettings;
    9089    }
     
    104103        for (unsigned flagItem : m_flags)
    105104            hasher.add(flagItem);
    106         hasher.add(m_locale.isNull() ? 0 : m_locale.impl()->existingHash());
    107105        hasher.add(m_featureSettings.hash());
    108106        return hasher.hash();
     
    145143    unsigned m_weight { 0 };
    146144    std::array<unsigned, 2> m_flags {{ 0, 0 }};
    147     AtomicString m_locale;
    148145    FontFeatureSettings m_featureSettings;
    149146};
  • trunk/Source/WebCore/platform/graphics/FontDescription.cpp

    r190192 r190754  
    1 
    21/*
    32 * Copyright (C) 2007 Nicholas Shanks <contact@nickshanks.com>
     
    3130#include "config.h"
    3231#include "FontDescription.h"
    33 #include "LocaleToScriptMapping.h"
    3432
    3533namespace WebCore {
     
    3735struct SameSizeAsFontCascadeDescription {
    3836    Vector<void*> vector;
    39     void* string;
    4037    float size;
    4138    unsigned bitfields1;
     
    5754    , m_renderingMode(NormalRenderingMode)
    5855    , m_textRendering(AutoTextRendering)
    59     , m_script(localeToScriptCodeForFontSelection(m_locale))
     56    , m_script(USCRIPT_COMMON)
    6057    , m_fontSynthesis(FontSynthesisWeight | FontSynthesisStyle)
    6158    , m_variantCommonLigatures(static_cast<unsigned>(FontVariantLigatures::Normal))
     
    7572    , m_variantEastAsianRuby(static_cast<unsigned>(FontVariantEastAsianRuby::Normal))
    7673{
    77 }
    78 
    79 void FontDescription::setLocale(const AtomicString& locale)
    80 {
    81     m_locale = locale;
    82     m_script = localeToScriptCodeForFontSelection(m_locale);
    8374}
    8475
  • trunk/Source/WebCore/platform/graphics/FontDescription.h

    r190192 r190754  
    5656    TextRenderingMode textRenderingMode() const { return static_cast<TextRenderingMode>(m_textRendering); }
    5757    UScriptCode script() const { return static_cast<UScriptCode>(m_script); }
    58     const AtomicString& locale() const { return m_locale; }
    5958
    6059    FontOrientation orientation() const { return static_cast<FontOrientation>(m_orientation); }
     
    108107    void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { m_nonCJKGlyphOrientation = orientation; }
    109108    void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; } // Make sure new callers of this sync with FontPlatformData::isForTextCombine()!
    110     void setLocale(const AtomicString&);
     109    void setScript(UScriptCode s) { m_script = s; }
    111110    void setFeatureSettings(FontFeatureSettings&& settings) { m_featureSettings = WTF::move(settings); }
    112111    void setFontSynthesis(FontSynthesis fontSynthesis) { m_fontSynthesis = fontSynthesis; }
     
    131130private:
    132131    FontFeatureSettings m_featureSettings;
    133     AtomicString m_locale;
    134132
    135133    float m_computedSize { 0 }; // Computed size adjusted for the minimum font size and the zoom factor.
     
    172170        && m_nonCJKGlyphOrientation == other.m_nonCJKGlyphOrientation
    173171        && m_widthVariant == other.m_widthVariant
    174         && m_locale == other.m_locale
     172        && m_script == other.m_script
    175173        && m_featureSettings == other.m_featureSettings
    176174        && m_fontSynthesis == other.m_fontSynthesis
     
    266264    static TextRenderingMode initialTextRenderingMode() { return AutoTextRendering; }
    267265    static FontSynthesis initialFontSynthesis() { return FontSynthesisWeight | FontSynthesisStyle; }
    268     static const AtomicString& initialLocale() { return nullAtom; }
    269266    static FontVariantPosition initialVariantPosition() { return FontVariantPosition::Normal; }
    270267    static FontVariantCaps initialVariantCaps() { return FontVariantCaps::Normal; }
  • trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp

    r190192 r190754  
    713713
    714714    const FontPlatformData& platformData = originalFontData->platformData();
    715     RetainPtr<CTFontRef> result = platformLookupFallbackFont(platformData.font(), description.weight(), description.locale(), characters, length);
     715    // FIXME: Should pass in the locale instead of nullAtom.
     716    RetainPtr<CTFontRef> result = platformLookupFallbackFont(platformData.font(), description.weight(), nullAtom, characters, length);
    716717    result = preparePlatformFont(result.get(), description.textRenderingMode(), description.featureSettings(), description.variantSettings());
    717718    if (!result)
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r190484 r190754  
    595595            || rareInheritedData->hyphenationLimitAfter != other.rareInheritedData->hyphenationLimitAfter
    596596            || rareInheritedData->hyphenationString != other.rareInheritedData->hyphenationString
     597            || rareInheritedData->locale != other.rareInheritedData->locale
    597598            || rareInheritedData->m_rubyPosition != other.rareInheritedData->m_rubyPosition
    598599            || rareInheritedData->textEmphasisMark != other.rareInheritedData->textEmphasisMark
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r190663 r190754  
    10091009    short hyphenationLimitLines() const { return rareInheritedData->hyphenationLimitLines; }
    10101010    const AtomicString& hyphenationString() const { return rareInheritedData->hyphenationString; }
    1011     const AtomicString& locale() const { return fontDescription().locale(); }
     1011    const AtomicString& locale() const { return rareInheritedData->locale; }
    10121012    EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); }
    10131013    EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); }
     
    15841584    void setHyphenationLimitLines(short limit) { SET_VAR(rareInheritedData, hyphenationLimitLines, limit); }
    15851585    void setHyphenationString(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenationString, h); }
     1586    void setLocale(const AtomicString& locale) { SET_VAR(rareInheritedData, locale, locale); }
    15861587    void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); }
    15871588    void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); }
     
    19871988    static short initialHyphenationLimitLines() { return -1; }
    19881989    static const AtomicString& initialHyphenationString() { return nullAtom; }
     1990    static const AtomicString& initialLocale() { return nullAtom; }
    19891991    static EBorderFit initialBorderFit() { return BorderFitBorder; }
    19901992    static EResize initialResize() { return RESIZE_NONE; }
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp

    r190209 r190754  
    211211    , hyphenationLimitAfter(o.hyphenationLimitAfter)
    212212    , hyphenationLimitLines(o.hyphenationLimitLines)
     213    , locale(o.locale)
    213214    , textEmphasisCustomMark(o.textEmphasisCustomMark)
    214215    , m_lineGrid(o.m_lineGrid)
     
    305306#endif
    306307        && hyphenationString == o.hyphenationString
     308        && locale == o.locale
    307309        && textEmphasisCustomMark == o.textEmphasisCustomMark
    308310        && quotesDataEquivalent(quotes.get(), o.quotes.get())
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h

    r190209 r190754  
    144144    short hyphenationLimitLines;
    145145
     146    AtomicString locale;
     147
    146148    AtomicString textEmphasisCustomMark;
    147149    RefPtr<QuotesData> quotes;
  • trunk/Source/WebCore/style/StyleResolveForDocument.cpp

    r189830 r190754  
    6060    documentStyle.get().setZoom(!document.printing() ? renderView.frame().pageZoomFactor() : 1);
    6161    documentStyle.get().setPageScaleTransform(renderView.frame().frameScaleFactor());
    62     auto documentFontDescription = documentStyle.get().fontDescription();
    63     documentFontDescription.setLocale(document.contentLanguage());
    64     documentStyle.get().setFontDescription(WTF::move(documentFontDescription));
     62    documentStyle.get().setLocale(document.contentLanguage());
    6563
    6664    // This overrides any -webkit-user-modify inherited from the parent iframe.
     
    10098
    10199    FontCascadeDescription fontDescription;
    102     fontDescription.setLocale(document.contentLanguage());
     100    fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle.get().locale()));
    103101    fontDescription.setRenderingMode(settings.fontRenderingMode());
    104102    fontDescription.setOneFamily(standardFamily);
Note: See TracChangeset for help on using the changeset viewer.