Title: [190754] trunk/Source/WebCore
Revision
190754
Author
[email protected]
Date
2015-10-08 15:53:51 -0700 (Thu, 08 Oct 2015)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (190753 => 190754)


--- trunk/Source/WebCore/ChangeLog	2015-10-08 22:53:16 UTC (rev 190753)
+++ trunk/Source/WebCore/ChangeLog	2015-10-08 22:53:51 UTC (rev 190754)
@@ -1,3 +1,44 @@
+2015-10-08  Chris Dumez  <[email protected]>
+
+        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):
+
 2015-10-08  Andreas Kling  <[email protected]>
 
         Generated frame tree names should be kept reasonably long.

Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (190753 => 190754)


--- trunk/Source/WebCore/css/CSSPropertyNames.in	2015-10-08 22:53:16 UTC (rev 190753)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in	2015-10-08 22:53:51 UTC (rev 190754)
@@ -114,7 +114,7 @@
 font-variant-numeric [Inherited, FontProperty, NameForMethods=VariantNumeric, Custom=All]
 font-variant-alternates [Inherited, FontProperty, NameForMethods=VariantAlternates]
 font-variant-east-asian [Inherited, FontProperty, NameForMethods=VariantEastAsian, Custom=All]
--webkit-locale [Inherited, FontProperty, Custom=Value]
+-webkit-locale [Inherited, Custom=Value]
 -webkit-text-orientation [Inherited, Custom=Value]
 -epub-text-orientation = -webkit-text-orientation
 #if defined(ENABLE_IOS_TEXT_AUTOSIZING) && ENABLE_IOS_TEXT_AUTOSIZING

Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (190753 => 190754)


--- trunk/Source/WebCore/css/StyleBuilderCustom.h	2015-10-08 22:53:16 UTC (rev 190753)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h	2015-10-08 22:53:51 UTC (rev 190754)
@@ -40,6 +40,7 @@
 #include "ElementAncestorIterator.h"
 #include "Frame.h"
 #include "HTMLElement.h"
+#include "LocaleToScriptMapping.h"
 #include "Rect.h"
 #include "RenderTheme.h"
 #include "SVGElement.h"
@@ -694,12 +695,13 @@
 inline void StyleBuilderCustom::applyValueWebkitLocale(StyleResolver& styleResolver, CSSValue& value)
 {
     auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
-    
-    auto fontDescription = styleResolver.style()->fontDescription();
     if (primitiveValue.getValueID() == CSSValueAuto)
-        fontDescription.setLocale(nullAtom);
+        styleResolver.style()->setLocale(nullAtom);
     else
-        fontDescription.setLocale(primitiveValue.getStringValue());
+        styleResolver.style()->setLocale(primitiveValue.getStringValue());
+
+    FontCascadeDescription fontDescription = styleResolver.style()->fontDescription();
+    fontDescription.setScript(localeToScriptCodeForFontSelection(styleResolver.style()->locale()));
     styleResolver.setFontDescription(fontDescription);
 }
 

Modified: trunk/Source/WebCore/platform/graphics/Font.cpp (190753 => 190754)


--- trunk/Source/WebCore/platform/graphics/Font.cpp	2015-10-08 22:53:16 UTC (rev 190753)
+++ trunk/Source/WebCore/platform/graphics/Font.cpp	2015-10-08 22:53:51 UTC (rev 190754)
@@ -393,9 +393,8 @@
     {
     }
 
-    CharacterFallbackMapKey(const AtomicString& locale, UChar32 character, bool isForPlatformFont)
-        : locale(locale)
-        , character(character)
+    CharacterFallbackMapKey(UChar32 character, bool isForPlatformFont)
+        : character(character)
         , isForPlatformFont(isForPlatformFont)
     {
     }
@@ -409,7 +408,7 @@
 
     bool operator==(const CharacterFallbackMapKey& other) const
     {
-        return locale == other.locale && character == other.character && isForPlatformFont == other.isForPlatformFont;
+        return character == other.character && isForPlatformFont == other.isForPlatformFont;
     }
 
     static const bool emptyValueIsZero = true;
@@ -417,7 +416,6 @@
 private:
     friend struct CharacterFallbackMapKeyHash;
 
-    AtomicString locale;
     UChar32 character { 0 };
     bool isForPlatformFont { false };
 };
@@ -425,7 +423,7 @@
 struct CharacterFallbackMapKeyHash {
     static unsigned hash(const CharacterFallbackMapKey& key)
     {
-        return WTF::pairIntHash(key.locale.isNull() ? 0 : WTF::AtomicStringHash::hash(key.locale), WTF::pairIntHash(key.character, key.isForPlatformFont));
+        return WTF::pairIntHash(key.character, key.isForPlatformFont);
     }
 
     static bool equal(const CharacterFallbackMapKey& a, const CharacterFallbackMapKey& b)
@@ -456,7 +454,7 @@
         return FontCache::singleton().systemFallbackForCharacters(description, this, isForPlatformFont, &codeUnit, 1);
     }
 
-    auto key = CharacterFallbackMapKey(description.locale(), character, isForPlatformFont);
+    auto key = CharacterFallbackMapKey(character, isForPlatformFont);
     auto characterAddResult = fontAddResult.iterator->value.add(WTF::move(key), nullptr);
 
     Font*& fallbackFont = characterAddResult.iterator->value;

Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (190753 => 190754)


--- trunk/Source/WebCore/platform/graphics/FontCache.h	2015-10-08 22:53:16 UTC (rev 190753)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h	2015-10-08 22:53:51 UTC (rev 190754)
@@ -75,7 +75,6 @@
         : m_size(description.computedPixelSize())
         , m_weight(description.weight())
         , m_flags(makeFlagsKey(description))
-        , m_locale(description.locale())
         , m_featureSettings(description.featureSettings())
     { }
 
@@ -85,7 +84,7 @@
 
     bool operator==(const FontDescriptionKey& other) const
     {
-        return m_size == other.m_size && m_weight == other.m_weight && m_flags == other.m_flags && m_locale == other.m_locale
+        return m_size == other.m_size && m_weight == other.m_weight && m_flags == other.m_flags
             && m_featureSettings == other.m_featureSettings;
     }
 
@@ -103,7 +102,6 @@
         hasher.add(m_weight);
         for (unsigned flagItem : m_flags)
             hasher.add(flagItem);
-        hasher.add(m_locale.isNull() ? 0 : m_locale.impl()->existingHash());
         hasher.add(m_featureSettings.hash());
         return hasher.hash();
     }
@@ -144,7 +142,6 @@
     unsigned m_size { 0 };
     unsigned m_weight { 0 };
     std::array<unsigned, 2> m_flags {{ 0, 0 }};
-    AtomicString m_locale;
     FontFeatureSettings m_featureSettings;
 };
 

Modified: trunk/Source/WebCore/platform/graphics/FontDescription.cpp (190753 => 190754)


--- trunk/Source/WebCore/platform/graphics/FontDescription.cpp	2015-10-08 22:53:16 UTC (rev 190753)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.cpp	2015-10-08 22:53:51 UTC (rev 190754)
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (C) 2007 Nicholas Shanks <[email protected]>
  * Copyright (C) 2008, 2013 Apple Inc. All rights reserved.
@@ -30,13 +29,11 @@
 
 #include "config.h"
 #include "FontDescription.h"
-#include "LocaleToScriptMapping.h"
 
 namespace WebCore {
 
 struct SameSizeAsFontCascadeDescription {
     Vector<void*> vector;
-    void* string;
     float size;
     unsigned bitfields1;
     unsigned bitfields2 : 22;
@@ -56,7 +53,7 @@
     , m_weight(FontWeightNormal)
     , m_renderingMode(NormalRenderingMode)
     , m_textRendering(AutoTextRendering)
-    , m_script(localeToScriptCodeForFontSelection(m_locale))
+    , m_script(USCRIPT_COMMON)
     , m_fontSynthesis(FontSynthesisWeight | FontSynthesisStyle)
     , m_variantCommonLigatures(static_cast<unsigned>(FontVariantLigatures::Normal))
     , m_variantDiscretionaryLigatures(static_cast<unsigned>(FontVariantLigatures::Normal))
@@ -76,12 +73,6 @@
 {
 }
 
-void FontDescription::setLocale(const AtomicString& locale)
-{
-    m_locale = locale;
-    m_script = localeToScriptCodeForFontSelection(m_locale);
-}
-
 FontTraitsMask FontDescription::traitsMask() const
 {
     return static_cast<FontTraitsMask>((m_italic ? FontStyleItalicMask : FontStyleNormalMask)

Modified: trunk/Source/WebCore/platform/graphics/FontDescription.h (190753 => 190754)


--- trunk/Source/WebCore/platform/graphics/FontDescription.h	2015-10-08 22:53:16 UTC (rev 190753)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.h	2015-10-08 22:53:51 UTC (rev 190754)
@@ -55,7 +55,6 @@
     FontRenderingMode renderingMode() const { return static_cast<FontRenderingMode>(m_renderingMode); }
     TextRenderingMode textRenderingMode() const { return static_cast<TextRenderingMode>(m_textRendering); }
     UScriptCode script() const { return static_cast<UScriptCode>(m_script); }
-    const AtomicString& locale() const { return m_locale; }
 
     FontOrientation orientation() const { return static_cast<FontOrientation>(m_orientation); }
     NonCJKGlyphOrientation nonCJKGlyphOrientation() const { return static_cast<NonCJKGlyphOrientation>(m_nonCJKGlyphOrientation); }
@@ -107,7 +106,7 @@
     void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
     void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { m_nonCJKGlyphOrientation = orientation; }
     void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; } // Make sure new callers of this sync with FontPlatformData::isForTextCombine()!
-    void setLocale(const AtomicString&);
+    void setScript(UScriptCode s) { m_script = s; }
     void setFeatureSettings(FontFeatureSettings&& settings) { m_featureSettings = WTF::move(settings); }
     void setFontSynthesis(FontSynthesis fontSynthesis) { m_fontSynthesis = fontSynthesis; }
     void setVariantCommonLigatures(FontVariantLigatures variant) { m_variantCommonLigatures = static_cast<unsigned>(variant); }
@@ -130,7 +129,6 @@
 
 private:
     FontFeatureSettings m_featureSettings;
-    AtomicString m_locale;
 
     float m_computedSize { 0 }; // Computed size adjusted for the minimum font size and the zoom factor.
     unsigned m_orientation : 1; // FontOrientation - Whether the font is rendering on a horizontal line or a vertical line.
@@ -171,7 +169,7 @@
         && m_orientation == other.m_orientation
         && m_nonCJKGlyphOrientation == other.m_nonCJKGlyphOrientation
         && m_widthVariant == other.m_widthVariant
-        && m_locale == other.m_locale
+        && m_script == other.m_script
         && m_featureSettings == other.m_featureSettings
         && m_fontSynthesis == other.m_fontSynthesis
         && m_variantCommonLigatures == other.m_variantCommonLigatures
@@ -265,7 +263,6 @@
     static FontSmoothingMode initialFontSmoothing() { return AutoSmoothing; }
     static TextRenderingMode initialTextRenderingMode() { return AutoTextRendering; }
     static FontSynthesis initialFontSynthesis() { return FontSynthesisWeight | FontSynthesisStyle; }
-    static const AtomicString& initialLocale() { return nullAtom; }
     static FontVariantPosition initialVariantPosition() { return FontVariantPosition::Normal; }
     static FontVariantCaps initialVariantCaps() { return FontVariantCaps::Normal; }
     static FontVariantAlternates initialVariantAlternates() { return FontVariantAlternates::Normal; }

Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (190753 => 190754)


--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2015-10-08 22:53:16 UTC (rev 190753)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2015-10-08 22:53:51 UTC (rev 190754)
@@ -712,7 +712,8 @@
 #endif
 
     const FontPlatformData& platformData = originalFontData->platformData();
-    RetainPtr<CTFontRef> result = platformLookupFallbackFont(platformData.font(), description.weight(), description.locale(), characters, length);
+    // FIXME: Should pass in the locale instead of nullAtom.
+    RetainPtr<CTFontRef> result = platformLookupFallbackFont(platformData.font(), description.weight(), nullAtom, characters, length);
     result = preparePlatformFont(result.get(), description.textRenderingMode(), description.featureSettings(), description.variantSettings());
     if (!result)
         return lastResortFallbackFont(description);

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (190753 => 190754)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2015-10-08 22:53:16 UTC (rev 190753)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2015-10-08 22:53:51 UTC (rev 190754)
@@ -594,6 +594,7 @@
             || rareInheritedData->hyphenationLimitBefore != other.rareInheritedData->hyphenationLimitBefore
             || rareInheritedData->hyphenationLimitAfter != other.rareInheritedData->hyphenationLimitAfter
             || rareInheritedData->hyphenationString != other.rareInheritedData->hyphenationString
+            || rareInheritedData->locale != other.rareInheritedData->locale
             || rareInheritedData->m_rubyPosition != other.rareInheritedData->m_rubyPosition
             || rareInheritedData->textEmphasisMark != other.rareInheritedData->textEmphasisMark
             || rareInheritedData->textEmphasisPosition != other.rareInheritedData->textEmphasisPosition

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (190753 => 190754)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2015-10-08 22:53:16 UTC (rev 190753)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2015-10-08 22:53:51 UTC (rev 190754)
@@ -1008,7 +1008,7 @@
     short hyphenationLimitAfter() const { return rareInheritedData->hyphenationLimitAfter; }
     short hyphenationLimitLines() const { return rareInheritedData->hyphenationLimitLines; }
     const AtomicString& hyphenationString() const { return rareInheritedData->hyphenationString; }
-    const AtomicString& locale() const { return fontDescription().locale(); }
+    const AtomicString& locale() const { return rareInheritedData->locale; }
     EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); }
     EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); }
     ColumnAxis columnAxis() const { return static_cast<ColumnAxis>(rareNonInheritedData->m_multiCol->m_axis); }
@@ -1583,6 +1583,7 @@
     void setHyphenationLimitAfter(short limit) { SET_VAR(rareInheritedData, hyphenationLimitAfter, limit); }
     void setHyphenationLimitLines(short limit) { SET_VAR(rareInheritedData, hyphenationLimitLines, limit); }
     void setHyphenationString(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenationString, h); }
+    void setLocale(const AtomicString& locale) { SET_VAR(rareInheritedData, locale, locale); }
     void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); }
     void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); }
     void setColumnAxis(ColumnAxis axis) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_axis, axis); }
@@ -1986,6 +1987,7 @@
     static short initialHyphenationLimitAfter() { return -1; }
     static short initialHyphenationLimitLines() { return -1; }
     static const AtomicString& initialHyphenationString() { return nullAtom; }
+    static const AtomicString& initialLocale() { return nullAtom; }
     static EBorderFit initialBorderFit() { return BorderFitBorder; }
     static EResize initialResize() { return RESIZE_NONE; }
     static ControlPart initialAppearance() { return NoControlPart; }

Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp (190753 => 190754)


--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp	2015-10-08 22:53:16 UTC (rev 190753)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp	2015-10-08 22:53:51 UTC (rev 190754)
@@ -210,6 +210,7 @@
     , hyphenationLimitBefore(o.hyphenationLimitBefore)
     , hyphenationLimitAfter(o.hyphenationLimitAfter)
     , hyphenationLimitLines(o.hyphenationLimitLines)
+    , locale(o.locale)
     , textEmphasisCustomMark(o.textEmphasisCustomMark)
     , m_lineGrid(o.m_lineGrid)
     , m_tabSize(o.m_tabSize)
@@ -304,6 +305,7 @@
         && touchCalloutEnabled == o.touchCalloutEnabled
 #endif
         && hyphenationString == o.hyphenationString
+        && locale == o.locale
         && textEmphasisCustomMark == o.textEmphasisCustomMark
         && quotesDataEquivalent(quotes.get(), o.quotes.get())
         && m_tabSize == o.m_tabSize

Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h (190753 => 190754)


--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h	2015-10-08 22:53:16 UTC (rev 190753)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h	2015-10-08 22:53:51 UTC (rev 190754)
@@ -143,6 +143,8 @@
     short hyphenationLimitAfter;
     short hyphenationLimitLines;
 
+    AtomicString locale;
+
     AtomicString textEmphasisCustomMark;
     RefPtr<QuotesData> quotes;
 

Modified: trunk/Source/WebCore/style/StyleResolveForDocument.cpp (190753 => 190754)


--- trunk/Source/WebCore/style/StyleResolveForDocument.cpp	2015-10-08 22:53:16 UTC (rev 190753)
+++ trunk/Source/WebCore/style/StyleResolveForDocument.cpp	2015-10-08 22:53:51 UTC (rev 190754)
@@ -59,9 +59,7 @@
     documentStyle.get().setRTLOrdering(document.visuallyOrdered() ? VisualOrder : LogicalOrder);
     documentStyle.get().setZoom(!document.printing() ? renderView.frame().pageZoomFactor() : 1);
     documentStyle.get().setPageScaleTransform(renderView.frame().frameScaleFactor());
-    auto documentFontDescription = documentStyle.get().fontDescription();
-    documentFontDescription.setLocale(document.contentLanguage());
-    documentStyle.get().setFontDescription(WTF::move(documentFontDescription));
+    documentStyle.get().setLocale(document.contentLanguage());
 
     // This overrides any -webkit-user-modify inherited from the parent iframe.
     documentStyle.get().setUserModify(document.inDesignMode() ? READ_WRITE : READ_ONLY);
@@ -99,7 +97,7 @@
     const Settings& settings = renderView.frame().settings();
 
     FontCascadeDescription fontDescription;
-    fontDescription.setLocale(document.contentLanguage());
+    fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle.get().locale()));
     fontDescription.setRenderingMode(settings.fontRenderingMode());
     fontDescription.setOneFamily(standardFamily);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to