Changeset 190754 in webkit
- Timestamp:
- Oct 8, 2015 3:53:51 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r190752 r190754 1 2015-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 1 42 2015-10-08 Andreas Kling <akling@apple.com> 2 43 -
trunk/Source/WebCore/css/CSSPropertyNames.in
r190663 r190754 115 115 font-variant-alternates [Inherited, FontProperty, NameForMethods=VariantAlternates] 116 116 font-variant-east-asian [Inherited, FontProperty, NameForMethods=VariantEastAsian, Custom=All] 117 -webkit-locale [Inherited, FontProperty,Custom=Value]117 -webkit-locale [Inherited, Custom=Value] 118 118 -webkit-text-orientation [Inherited, Custom=Value] 119 119 -epub-text-orientation = -webkit-text-orientation -
trunk/Source/WebCore/css/StyleBuilderCustom.h
r190564 r190754 41 41 #include "Frame.h" 42 42 #include "HTMLElement.h" 43 #include "LocaleToScriptMapping.h" 43 44 #include "Rect.h" 44 45 #include "RenderTheme.h" … … 695 696 { 696 697 auto& primitiveValue = downcast<CSSPrimitiveValue>(value); 697 698 auto fontDescription = styleResolver.style()->fontDescription();699 698 if (primitiveValue.getValueID() == CSSValueAuto) 700 fontDescription.setLocale(nullAtom);699 styleResolver.style()->setLocale(nullAtom); 701 700 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())); 703 705 styleResolver.setFontDescription(fontDescription); 704 706 } -
trunk/Source/WebCore/platform/graphics/Font.cpp
r189539 r190754 394 394 } 395 395 396 CharacterFallbackMapKey(const AtomicString& locale, UChar32 character, bool isForPlatformFont) 397 : locale(locale) 398 , character(character) 396 CharacterFallbackMapKey(UChar32 character, bool isForPlatformFont) 397 : character(character) 399 398 , isForPlatformFont(isForPlatformFont) 400 399 { … … 410 409 bool operator==(const CharacterFallbackMapKey& other) const 411 410 { 412 return locale == other.locale &&character == other.character && isForPlatformFont == other.isForPlatformFont;411 return character == other.character && isForPlatformFont == other.isForPlatformFont; 413 412 } 414 413 … … 418 417 friend struct CharacterFallbackMapKeyHash; 419 418 420 AtomicString locale;421 419 UChar32 character { 0 }; 422 420 bool isForPlatformFont { false }; … … 426 424 static unsigned hash(const CharacterFallbackMapKey& key) 427 425 { 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); 429 427 } 430 428 … … 457 455 } 458 456 459 auto key = CharacterFallbackMapKey( description.locale(),character, isForPlatformFont);457 auto key = CharacterFallbackMapKey(character, isForPlatformFont); 460 458 auto characterAddResult = fontAddResult.iterator->value.add(WTF::move(key), nullptr); 461 459 -
trunk/Source/WebCore/platform/graphics/FontCache.h
r190746 r190754 76 76 , m_weight(description.weight()) 77 77 , m_flags(makeFlagsKey(description)) 78 , m_locale(description.locale())79 78 , m_featureSettings(description.featureSettings()) 80 79 { } … … 86 85 bool operator==(const FontDescriptionKey& other) const 87 86 { 88 return m_size == other.m_size && m_weight == other.m_weight && m_flags == other.m_flags && m_locale == other.m_locale87 return m_size == other.m_size && m_weight == other.m_weight && m_flags == other.m_flags 89 88 && m_featureSettings == other.m_featureSettings; 90 89 } … … 104 103 for (unsigned flagItem : m_flags) 105 104 hasher.add(flagItem); 106 hasher.add(m_locale.isNull() ? 0 : m_locale.impl()->existingHash());107 105 hasher.add(m_featureSettings.hash()); 108 106 return hasher.hash(); … … 145 143 unsigned m_weight { 0 }; 146 144 std::array<unsigned, 2> m_flags {{ 0, 0 }}; 147 AtomicString m_locale;148 145 FontFeatureSettings m_featureSettings; 149 146 }; -
trunk/Source/WebCore/platform/graphics/FontDescription.cpp
r190192 r190754 1 2 1 /* 3 2 * Copyright (C) 2007 Nicholas Shanks <contact@nickshanks.com> … … 31 30 #include "config.h" 32 31 #include "FontDescription.h" 33 #include "LocaleToScriptMapping.h"34 32 35 33 namespace WebCore { … … 37 35 struct SameSizeAsFontCascadeDescription { 38 36 Vector<void*> vector; 39 void* string;40 37 float size; 41 38 unsigned bitfields1; … … 57 54 , m_renderingMode(NormalRenderingMode) 58 55 , m_textRendering(AutoTextRendering) 59 , m_script( localeToScriptCodeForFontSelection(m_locale))56 , m_script(USCRIPT_COMMON) 60 57 , m_fontSynthesis(FontSynthesisWeight | FontSynthesisStyle) 61 58 , m_variantCommonLigatures(static_cast<unsigned>(FontVariantLigatures::Normal)) … … 75 72 , m_variantEastAsianRuby(static_cast<unsigned>(FontVariantEastAsianRuby::Normal)) 76 73 { 77 }78 79 void FontDescription::setLocale(const AtomicString& locale)80 {81 m_locale = locale;82 m_script = localeToScriptCodeForFontSelection(m_locale);83 74 } 84 75 -
trunk/Source/WebCore/platform/graphics/FontDescription.h
r190192 r190754 56 56 TextRenderingMode textRenderingMode() const { return static_cast<TextRenderingMode>(m_textRendering); } 57 57 UScriptCode script() const { return static_cast<UScriptCode>(m_script); } 58 const AtomicString& locale() const { return m_locale; }59 58 60 59 FontOrientation orientation() const { return static_cast<FontOrientation>(m_orientation); } … … 108 107 void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { m_nonCJKGlyphOrientation = orientation; } 109 108 void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; } // Make sure new callers of this sync with FontPlatformData::isForTextCombine()! 110 void set Locale(const AtomicString&);109 void setScript(UScriptCode s) { m_script = s; } 111 110 void setFeatureSettings(FontFeatureSettings&& settings) { m_featureSettings = WTF::move(settings); } 112 111 void setFontSynthesis(FontSynthesis fontSynthesis) { m_fontSynthesis = fontSynthesis; } … … 131 130 private: 132 131 FontFeatureSettings m_featureSettings; 133 AtomicString m_locale;134 132 135 133 float m_computedSize { 0 }; // Computed size adjusted for the minimum font size and the zoom factor. … … 172 170 && m_nonCJKGlyphOrientation == other.m_nonCJKGlyphOrientation 173 171 && m_widthVariant == other.m_widthVariant 174 && m_ locale == other.m_locale172 && m_script == other.m_script 175 173 && m_featureSettings == other.m_featureSettings 176 174 && m_fontSynthesis == other.m_fontSynthesis … … 266 264 static TextRenderingMode initialTextRenderingMode() { return AutoTextRendering; } 267 265 static FontSynthesis initialFontSynthesis() { return FontSynthesisWeight | FontSynthesisStyle; } 268 static const AtomicString& initialLocale() { return nullAtom; }269 266 static FontVariantPosition initialVariantPosition() { return FontVariantPosition::Normal; } 270 267 static FontVariantCaps initialVariantCaps() { return FontVariantCaps::Normal; } -
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
r190192 r190754 713 713 714 714 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); 716 717 result = preparePlatformFont(result.get(), description.textRenderingMode(), description.featureSettings(), description.variantSettings()); 717 718 if (!result) -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r190484 r190754 595 595 || rareInheritedData->hyphenationLimitAfter != other.rareInheritedData->hyphenationLimitAfter 596 596 || rareInheritedData->hyphenationString != other.rareInheritedData->hyphenationString 597 || rareInheritedData->locale != other.rareInheritedData->locale 597 598 || rareInheritedData->m_rubyPosition != other.rareInheritedData->m_rubyPosition 598 599 || rareInheritedData->textEmphasisMark != other.rareInheritedData->textEmphasisMark -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r190663 r190754 1009 1009 short hyphenationLimitLines() const { return rareInheritedData->hyphenationLimitLines; } 1010 1010 const AtomicString& hyphenationString() const { return rareInheritedData->hyphenationString; } 1011 const AtomicString& locale() const { return fontDescription().locale(); }1011 const AtomicString& locale() const { return rareInheritedData->locale; } 1012 1012 EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); } 1013 1013 EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); } … … 1584 1584 void setHyphenationLimitLines(short limit) { SET_VAR(rareInheritedData, hyphenationLimitLines, limit); } 1585 1585 void setHyphenationString(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenationString, h); } 1586 void setLocale(const AtomicString& locale) { SET_VAR(rareInheritedData, locale, locale); } 1586 1587 void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); } 1587 1588 void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); } … … 1987 1988 static short initialHyphenationLimitLines() { return -1; } 1988 1989 static const AtomicString& initialHyphenationString() { return nullAtom; } 1990 static const AtomicString& initialLocale() { return nullAtom; } 1989 1991 static EBorderFit initialBorderFit() { return BorderFitBorder; } 1990 1992 static EResize initialResize() { return RESIZE_NONE; } -
trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
r190209 r190754 211 211 , hyphenationLimitAfter(o.hyphenationLimitAfter) 212 212 , hyphenationLimitLines(o.hyphenationLimitLines) 213 , locale(o.locale) 213 214 , textEmphasisCustomMark(o.textEmphasisCustomMark) 214 215 , m_lineGrid(o.m_lineGrid) … … 305 306 #endif 306 307 && hyphenationString == o.hyphenationString 308 && locale == o.locale 307 309 && textEmphasisCustomMark == o.textEmphasisCustomMark 308 310 && quotesDataEquivalent(quotes.get(), o.quotes.get()) -
trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h
r190209 r190754 144 144 short hyphenationLimitLines; 145 145 146 AtomicString locale; 147 146 148 AtomicString textEmphasisCustomMark; 147 149 RefPtr<QuotesData> quotes; -
trunk/Source/WebCore/style/StyleResolveForDocument.cpp
r189830 r190754 60 60 documentStyle.get().setZoom(!document.printing() ? renderView.frame().pageZoomFactor() : 1); 61 61 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()); 65 63 66 64 // This overrides any -webkit-user-modify inherited from the parent iframe. … … 100 98 101 99 FontCascadeDescription fontDescription; 102 fontDescription.set Locale(document.contentLanguage());100 fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle.get().locale())); 103 101 fontDescription.setRenderingMode(settings.fontRenderingMode()); 104 102 fontDescription.setOneFamily(standardFamily);
Note: See TracChangeset
for help on using the changeset viewer.