<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[187626] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/187626">187626</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2015-07-30 17:12:38 -0700 (Thu, 30 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move locale information into FontDescription
https://bugs.webkit.org/show_bug.cgi?id=147457

Reviewed by Andreas Kling.

Currently, the &quot;lang&quot; attribute on a node sets locale information in RenderStyle.
Font selection is sensitive to this locale information, and occurs deep within
platform/ code, far away from RenderStyle. Because every RenderStyle owns a
FontDescription, and font selection can consult with FontDescriptions, it makes
sense to move the variable from RenderStyle to FontDescription, and provide
convenience methods on RenderStyle which inspect its FontDescription for locale
information.

This patch is in preparation for correctly obeying locale information when
performing font fallback.

No new tests because there is no behavior change.

* css/CSSPropertyNames.in:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueWebkitLocale):
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::FontDescriptionKey):
(WebCore::FontDescriptionKey::operator==):
* platform/graphics/FontCascade.cpp:
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::FontDescription):
(WebCore::FontDescription::setLocale):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::locale):
(WebCore::FontDescription::initialLocale):
(WebCore::FontDescription::operator==):
(WebCore::FontDescription::FontDescription): Deleted.
(WebCore::FontDescription::setScript): Deleted.
* platform/text/LocaleToScriptMappingDefault.cpp:
(WebCore::localeToScriptCodeForFontSelection):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout): Deleted.
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData): Deleted.
(WebCore::StyleRareInheritedData::operator==): Deleted.
* rendering/style/StyleRareInheritedData.h:
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertyNamesin">trunk/Source/WebCore/css/CSSPropertyNames.in</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderCustomh">trunk/Source/WebCore/css/StyleBuilderCustom.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCacheh">trunk/Source/WebCore/platform/graphics/FontCache.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCascadecpp">trunk/Source/WebCore/platform/graphics/FontCascade.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontDescriptioncpp">trunk/Source/WebCore/platform/graphics/FontDescription.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontDescriptionh">trunk/Source/WebCore/platform/graphics/FontDescription.h</a></li>
<li><a href="#trunkSourceWebCoreplatformtextLocaleToScriptMappingDefaultcpp">trunk/Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStylecpp">trunk/Source/WebCore/rendering/style/RenderStyle.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleRareInheritedDatacpp">trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleRareInheritedDatah">trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h</a></li>
<li><a href="#trunkSourceWebCorestyleStyleResolveForDocumentcpp">trunk/Source/WebCore/style/StyleResolveForDocument.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (187625 => 187626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-07-30 23:56:51 UTC (rev 187625)
+++ trunk/Source/WebCore/ChangeLog        2015-07-31 00:12:38 UTC (rev 187626)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2015-07-30  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        Move locale information into FontDescription
+        https://bugs.webkit.org/show_bug.cgi?id=147457
+
+        Reviewed by Andreas Kling.
+
+        Currently, the &quot;lang&quot; attribute on a node sets locale information in RenderStyle.
+        Font selection is sensitive to this locale information, and occurs deep within
+        platform/ code, far away from RenderStyle. Because every RenderStyle owns a
+        FontDescription, and font selection can consult with FontDescriptions, it makes
+        sense to move the variable from RenderStyle to FontDescription, and provide
+        convenience methods on RenderStyle which inspect its FontDescription for locale
+        information.
+
+        This patch is in preparation for correctly obeying locale information when
+        performing font fallback.
+
+        No new tests because there is no behavior change.
+
+        * css/CSSPropertyNames.in:
+        * css/StyleBuilderCustom.h:
+        (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
+        * platform/graphics/FontCache.h:
+        (WebCore::FontDescriptionKey::FontDescriptionKey):
+        (WebCore::FontDescriptionKey::operator==):
+        * platform/graphics/FontCascade.cpp:
+        * platform/graphics/FontDescription.cpp:
+        (WebCore::FontDescription::FontDescription):
+        (WebCore::FontDescription::setLocale):
+        * platform/graphics/FontDescription.h:
+        (WebCore::FontDescription::locale):
+        (WebCore::FontDescription::initialLocale):
+        (WebCore::FontDescription::operator==):
+        (WebCore::FontDescription::FontDescription): Deleted.
+        (WebCore::FontDescription::setScript): Deleted.
+        * platform/text/LocaleToScriptMappingDefault.cpp:
+        (WebCore::localeToScriptCodeForFontSelection):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::changeRequiresLayout): Deleted.
+        * rendering/style/RenderStyle.h:
+        * rendering/style/StyleRareInheritedData.cpp:
+        (WebCore::StyleRareInheritedData::StyleRareInheritedData): Deleted.
+        (WebCore::StyleRareInheritedData::operator==): Deleted.
+        * rendering/style/StyleRareInheritedData.h:
+        * style/StyleResolveForDocument.cpp:
+        (WebCore::Style::resolveForDocument):
+
</ins><span class="cx"> 2015-07-30  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove stray printf.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (187625 => 187626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2015-07-30 23:56:51 UTC (rev 187625)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2015-07-31 00:12:38 UTC (rev 187626)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx"> -webkit-font-kerning [Inherited, FontProperty, NameForMethods=Kerning]
</span><span class="cx"> -webkit-font-smoothing [Inherited, FontProperty]
</span><span class="cx"> -webkit-font-variant-ligatures [Inherited, Custom=All]
</span><del>--webkit-locale [Inherited, Custom=Value]
</del><ins>+-webkit-locale [Inherited, FontProperty, Custom=Value]
</ins><span class="cx"> -webkit-text-orientation [Inherited, Custom=Value]
</span><span class="cx"> -epub-text-orientation = -webkit-text-orientation
</span><span class="cx"> #if defined(ENABLE_IOS_TEXT_AUTOSIZING) &amp;&amp; ENABLE_IOS_TEXT_AUTOSIZING
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (187625 => 187626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderCustom.h        2015-07-30 23:56:51 UTC (rev 187625)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h        2015-07-31 00:12:38 UTC (rev 187626)
</span><span class="lines">@@ -40,7 +40,6 @@
</span><span class="cx"> #include &quot;ElementAncestorIterator.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;HTMLElement.h&quot;
</span><del>-#include &quot;LocaleToScriptMapping.h&quot;
</del><span class="cx"> #include &quot;Rect.h&quot;
</span><span class="cx"> #include &quot;RenderTheme.h&quot;
</span><span class="cx"> #include &quot;SVGElement.h&quot;
</span><span class="lines">@@ -691,14 +690,12 @@
</span><span class="cx"> inline void StyleBuilderCustom::applyValueWebkitLocale(StyleResolver&amp; styleResolver, CSSValue&amp; value)
</span><span class="cx"> {
</span><span class="cx">     auto&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(value);
</span><del>-
-    if (primitiveValue.getValueID() == CSSValueAuto)
-        styleResolver.style()-&gt;setLocale(nullAtom);
-    else
-        styleResolver.style()-&gt;setLocale(primitiveValue.getStringValue());
</del><span class="cx">     
</span><span class="cx">     FontDescription fontDescription = styleResolver.style()-&gt;fontDescription();
</span><del>-    fontDescription.setScript(localeToScriptCodeForFontSelection(styleResolver.style()-&gt;locale()));
</del><ins>+    if (primitiveValue.getValueID() == CSSValueAuto)
+        fontDescription.setLocale(nullAtom);
+    else
+        fontDescription.setLocale(primitiveValue.getStringValue());
</ins><span class="cx">     styleResolver.setFontDescription(fontDescription);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (187625 => 187626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.h        2015-07-30 23:56:51 UTC (rev 187625)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h        2015-07-31 00:12:38 UTC (rev 187626)
</span><span class="lines">@@ -71,11 +71,13 @@
</span><span class="cx">         : size(size)
</span><span class="cx">         , weight(0)
</span><span class="cx">         , flags(0)
</span><ins>+        , localeHash(0)
</ins><span class="cx">     { }
</span><span class="cx">     FontDescriptionKey(const FontDescription&amp; description)
</span><span class="cx">         : size(description.computedPixelSize())
</span><span class="cx">         , weight(description.weight())
</span><span class="cx">         , flags(makeFlagKey(description))
</span><ins>+        , localeHash(description.locale().isNull() ? 0 : description.locale().impl()-&gt;existingHash())
</ins><span class="cx">     { }
</span><span class="cx">     static unsigned makeFlagKey(const FontDescription&amp; description)
</span><span class="cx">     {
</span><span class="lines">@@ -91,7 +93,7 @@
</span><span class="cx">     }
</span><span class="cx">     bool operator==(const FontDescriptionKey&amp; other) const
</span><span class="cx">     {
</span><del>-        return size == other.size &amp;&amp; weight == other.weight &amp;&amp; flags == other.flags;
</del><ins>+        return size == other.size &amp;&amp; weight == other.weight &amp;&amp; flags == other.flags &amp;&amp; localeHash == other.localeHash;
</ins><span class="cx">     }
</span><span class="cx">     bool operator!=(const FontDescriptionKey&amp; other) const
</span><span class="cx">     {
</span><span class="lines">@@ -104,6 +106,7 @@
</span><span class="cx">     unsigned size;
</span><span class="cx">     unsigned weight;
</span><span class="cx">     unsigned flags;
</span><ins>+    unsigned localeHash; // FIXME: Here, and every client of us, makes hashes of hashes.
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class FontCache {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCascadecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (187625 => 187626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp        2015-07-30 23:56:51 UTC (rev 187625)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp        2015-07-31 00:12:38 UTC (rev 187626)
</span><span class="lines">@@ -178,8 +178,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> struct FontCascadeCacheKey {
</span><del>-    // This part of the key is shared with the lower level FontCache (caching FontData objects).
-    FontDescriptionKey fontDescriptionKey;
</del><ins>+    FontDescriptionKey fontDescriptionKey; // Shared with the lower level FontCache (caching Font objects)
</ins><span class="cx">     Vector&lt;AtomicString, 3&gt; families;
</span><span class="cx">     unsigned fontSelectorId;
</span><span class="cx">     unsigned fontSelectorVersion;
</span><span class="lines">@@ -241,6 +240,7 @@
</span><span class="cx">     return key;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// FIXME: Why can't we just teach HashMap about FontCascadeCacheKey instead of hashing a hash?
</ins><span class="cx"> static unsigned computeFontCascadeCacheHash(const FontCascadeCacheKey&amp; key)
</span><span class="cx"> {
</span><span class="cx">     Vector&lt;unsigned, 7&gt; hashCodes;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontDescriptioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontDescription.cpp (187625 => 187626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontDescription.cpp        2015-07-30 23:56:51 UTC (rev 187625)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.cpp        2015-07-31 00:12:38 UTC (rev 187626)
</span><span class="lines">@@ -1,3 +1,4 @@
</span><ins>+
</ins><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2007 Nicholas Shanks &lt;contact@nickshanks.com&gt;
</span><span class="cx">  * Copyright (C) 2008, 2013 Apple Inc. All rights reserved.
</span><span class="lines">@@ -29,19 +30,42 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;FontDescription.h&quot;
</span><ins>+#include &quot;LocaleToScriptMapping.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> struct SameSizeAsFontDescription {
</span><del>-    void* pointers[2];
</del><ins>+    void* pointers[3];
</ins><span class="cx">     float sizes[2];
</span><del>-    // FXIME: Make them fit into one word.
</del><ins>+    // FIXME: Make them fit into one word.
</ins><span class="cx">     uint32_t bitfields;
</span><span class="cx">     uint32_t bitfields2 : 8;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> COMPILE_ASSERT(sizeof(FontDescription) == sizeof(SameSizeAsFontDescription), FontDescription_should_stay_small);
</span><span class="cx"> 
</span><ins>+FontDescription::FontDescription()
+    : m_orientation(Horizontal)
+    , m_nonCJKGlyphOrientation(NonCJKGlyphOrientationVerticalRight)
+    , m_widthVariant(RegularWidth)
+    , m_italic(FontItalicOff)
+    , m_smallCaps(FontSmallCapsOff)
+    , m_isAbsoluteSize(false)
+    , m_weight(FontWeightNormal)
+    , m_renderingMode(NormalRenderingMode)
+    , m_kerning(AutoKerning)
+    , m_commonLigaturesState(NormalLigaturesState)
+    , m_discretionaryLigaturesState(NormalLigaturesState)
+    , m_historicalLigaturesState(NormalLigaturesState)
+    , m_keywordSize(0)
+    , m_fontSmoothing(AutoSmoothing)
+    , m_textRendering(AutoTextRendering)
+    , m_isSpecifiedFont(false)
+    , m_script(localeToScriptCodeForFontSelection(m_locale))
+    , m_fontSynthesis(initialFontSynthesis())
+{
+}
+
</ins><span class="cx"> FontWeight FontDescription::lighterWeight(void) const
</span><span class="cx"> {
</span><span class="cx">     switch (m_weight) {
</span><span class="lines">@@ -94,6 +118,12 @@
</span><span class="cx">     
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void FontDescription::setLocale(const AtomicString&amp; locale)
+{
+    m_locale = locale;
+    m_script = localeToScriptCodeForFontSelection(m_locale);
+}
+
</ins><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx"> bool FontDescription::familiesEqualForTextAutoSizing(const FontDescription&amp; other) const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontDescriptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontDescription.h (187625 => 187626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontDescription.h        2015-07-30 23:56:51 UTC (rev 187625)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.h        2015-07-31 00:12:38 UTC (rev 187626)
</span><span class="lines">@@ -44,30 +44,7 @@
</span><span class="cx"> 
</span><span class="cx">     enum LigaturesState { NormalLigaturesState, DisabledLigaturesState, EnabledLigaturesState };
</span><span class="cx"> 
</span><del>-    FontDescription()
-        : m_families(1)
-        , m_specifiedSize(0)
-        , m_computedSize(0)
-        , m_orientation(Horizontal)
-        , m_nonCJKGlyphOrientation(NonCJKGlyphOrientationVerticalRight)
-        , m_widthVariant(RegularWidth)
-        , m_italic(FontItalicOff)
-        , m_smallCaps(FontSmallCapsOff)
-        , m_isAbsoluteSize(false)
-        , m_weight(FontWeightNormal)
-        , m_renderingMode(NormalRenderingMode)
-        , m_kerning(AutoKerning)
-        , m_commonLigaturesState(NormalLigaturesState)
-        , m_discretionaryLigaturesState(NormalLigaturesState)
-        , m_historicalLigaturesState(NormalLigaturesState)
-        , m_keywordSize(0)
-        , m_fontSmoothing(AutoSmoothing)
-        , m_textRendering(AutoTextRendering)
-        , m_isSpecifiedFont(false)
-        , m_script(USCRIPT_COMMON)
-        , m_fontSynthesis(initialFontSynthesis())
-    {
-    }
</del><ins>+    WEBCORE_EXPORT FontDescription();
</ins><span class="cx"> 
</span><span class="cx">     bool operator==(const FontDescription&amp;) const;
</span><span class="cx">     bool operator!=(const FontDescription&amp; other) const { return !(*this == other); }
</span><span class="lines">@@ -103,6 +80,7 @@
</span><span class="cx">     FontSmoothingMode fontSmoothing() const { return static_cast&lt;FontSmoothingMode&gt;(m_fontSmoothing); }
</span><span class="cx">     TextRenderingMode textRenderingMode() const { return static_cast&lt;TextRenderingMode&gt;(m_textRendering); }
</span><span class="cx">     UScriptCode script() const { return static_cast&lt;UScriptCode&gt;(m_script); }
</span><ins>+    const AtomicString&amp; locale() const { return m_locale; }
</ins><span class="cx"> 
</span><span class="cx">     FontTraitsMask traitsMask() const;
</span><span class="cx">     bool isSpecifiedFont() const { return m_isSpecifiedFont; }
</span><span class="lines">@@ -147,7 +125,7 @@
</span><span class="cx">     void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
</span><span class="cx">     void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { m_nonCJKGlyphOrientation = orientation; }
</span><span class="cx">     void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; }
</span><del>-    void setScript(UScriptCode s) { m_script = s; }
</del><ins>+    void setLocale(const AtomicString&amp;);
</ins><span class="cx">     void setFeatureSettings(PassRefPtr&lt;FontFeatureSettings&gt; settings) { m_featureSettings = settings; }
</span><span class="cx">     void setFontSynthesis(FontSynthesis fontSynthesis) { m_fontSynthesis = fontSynthesis; }
</span><span class="cx"> 
</span><span class="lines">@@ -170,14 +148,16 @@
</span><span class="cx">     static FontSmoothingMode initialFontSmoothing() { return AutoSmoothing; }
</span><span class="cx">     static TextRenderingMode initialTextRenderingMode() { return AutoTextRendering; }
</span><span class="cx">     static FontSynthesis initialFontSynthesis() { return FontSynthesisWeight | FontSynthesisStyle; }
</span><ins>+    static const AtomicString&amp; initialLocale() { return nullAtom; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    RefCountedArray&lt;AtomicString&gt; m_families;
</del><ins>+    RefCountedArray&lt;AtomicString&gt; m_families { 1 };
</ins><span class="cx">     RefPtr&lt;FontFeatureSettings&gt; m_featureSettings;
</span><ins>+    AtomicString m_locale { initialLocale() };
</ins><span class="cx"> 
</span><del>-    float m_specifiedSize;   // Specified CSS value. Independent of rendering issues such as integer
</del><ins>+    float m_specifiedSize { 0 };   // Specified CSS value. Independent of rendering issues such as integer
</ins><span class="cx">                              // rounding, minimum font sizes, and zooming.
</span><del>-    float m_computedSize;    // Computed size adjusted for the minimum font size and the zoom factor.  
</del><ins>+    float m_computedSize { 0 };    // Computed size adjusted for the minimum font size and the zoom factor.
</ins><span class="cx"> 
</span><span class="cx">     unsigned m_orientation : 1; // FontOrientation - Whether the font is rendering on a horizontal line or a vertical line.
</span><span class="cx">     unsigned m_nonCJKGlyphOrientation : 1; // NonCJKGlyphOrientation - Only used by vertical text. Determines the default orientation for non-ideograph glyphs.
</span><span class="lines">@@ -229,7 +209,7 @@
</span><span class="cx">         &amp;&amp; m_orientation == other.m_orientation
</span><span class="cx">         &amp;&amp; m_nonCJKGlyphOrientation == other.m_nonCJKGlyphOrientation
</span><span class="cx">         &amp;&amp; m_widthVariant == other.m_widthVariant
</span><del>-        &amp;&amp; m_script == other.m_script
</del><ins>+        &amp;&amp; m_locale == other.m_locale
</ins><span class="cx">         &amp;&amp; m_featureSettings == other.m_featureSettings
</span><span class="cx">         &amp;&amp; m_fontSynthesis == other.m_fontSynthesis;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextLocaleToScriptMappingDefaultcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp (187625 => 187626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp        2015-07-30 23:56:51 UTC (rev 187625)
+++ trunk/Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp        2015-07-31 00:12:38 UTC (rev 187626)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><ins>+#include &lt;wtf/NeverDestroyed.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/StringHash.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -389,16 +390,16 @@
</span><span class="cx"> 
</span><span class="cx"> UScriptCode localeToScriptCodeForFontSelection(const String&amp; locale)
</span><span class="cx"> {
</span><del>-    DEPRECATED_DEFINE_STATIC_LOCAL(LocaleScriptMap, localeScriptMap, ());
-    if (localeScriptMap.isEmpty()) {
</del><ins>+    static NeverDestroyed&lt;LocaleScriptMap&gt; localeScriptMap;
+    if (localeScriptMap.get().isEmpty()) {
</ins><span class="cx">         for (size_t i = 0; i &lt; sizeof(localeScriptList) / sizeof(LocaleScript); ++i)
</span><del>-            localeScriptMap.set(ASCIILiteral(localeScriptList[i].locale), localeScriptList[i].script);
</del><ins>+            localeScriptMap.get().set(ASCIILiteral(localeScriptList[i].locale), localeScriptList[i].script);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String canonicalLocale = locale.lower().replace('-', '_');
</span><span class="cx">     while (!canonicalLocale.isEmpty()) {
</span><del>-        LocaleScriptMap::iterator it = localeScriptMap.find(canonicalLocale);
-        if (it != localeScriptMap.end())
</del><ins>+        LocaleScriptMap::iterator it = localeScriptMap.get().find(canonicalLocale);
+        if (it != localeScriptMap.get().end())
</ins><span class="cx">             return it-&gt;value;
</span><span class="cx">         size_t pos = canonicalLocale.reverseFind('_');
</span><span class="cx">         if (pos == notFound)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (187625 => 187626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2015-07-30 23:56:51 UTC (rev 187625)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2015-07-31 00:12:38 UTC (rev 187626)
</span><span class="lines">@@ -576,7 +576,6 @@
</span><span class="cx">             || rareInheritedData-&gt;hyphenationLimitBefore != other.rareInheritedData-&gt;hyphenationLimitBefore
</span><span class="cx">             || rareInheritedData-&gt;hyphenationLimitAfter != other.rareInheritedData-&gt;hyphenationLimitAfter
</span><span class="cx">             || rareInheritedData-&gt;hyphenationString != other.rareInheritedData-&gt;hyphenationString
</span><del>-            || rareInheritedData-&gt;locale != other.rareInheritedData-&gt;locale
</del><span class="cx">             || rareInheritedData-&gt;m_rubyPosition != other.rareInheritedData-&gt;m_rubyPosition
</span><span class="cx">             || rareInheritedData-&gt;textEmphasisMark != other.rareInheritedData-&gt;textEmphasisMark
</span><span class="cx">             || rareInheritedData-&gt;textEmphasisPosition != other.rareInheritedData-&gt;textEmphasisPosition
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (187625 => 187626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2015-07-30 23:56:51 UTC (rev 187625)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2015-07-31 00:12:38 UTC (rev 187626)
</span><span class="lines">@@ -998,7 +998,7 @@
</span><span class="cx">     short hyphenationLimitAfter() const { return rareInheritedData-&gt;hyphenationLimitAfter; }
</span><span class="cx">     short hyphenationLimitLines() const { return rareInheritedData-&gt;hyphenationLimitLines; }
</span><span class="cx">     const AtomicString&amp; hyphenationString() const { return rareInheritedData-&gt;hyphenationString; }
</span><del>-    const AtomicString&amp; locale() const { return rareInheritedData-&gt;locale; }
</del><ins>+    const AtomicString&amp; locale() const { return fontDescription().locale(); }
</ins><span class="cx">     EBorderFit borderFit() const { return static_cast&lt;EBorderFit&gt;(rareNonInheritedData-&gt;m_borderFit); }
</span><span class="cx">     EResize resize() const { return static_cast&lt;EResize&gt;(rareInheritedData-&gt;resize); }
</span><span class="cx">     ColumnAxis columnAxis() const { return static_cast&lt;ColumnAxis&gt;(rareNonInheritedData-&gt;m_multiCol-&gt;m_axis); }
</span><span class="lines">@@ -1572,7 +1572,6 @@
</span><span class="cx">     void setHyphenationLimitAfter(short limit) { SET_VAR(rareInheritedData, hyphenationLimitAfter, limit); }
</span><span class="cx">     void setHyphenationLimitLines(short limit) { SET_VAR(rareInheritedData, hyphenationLimitLines, limit); }
</span><span class="cx">     void setHyphenationString(const AtomicString&amp; h) { SET_VAR(rareInheritedData, hyphenationString, h); }
</span><del>-    void setLocale(const AtomicString&amp; locale) { SET_VAR(rareInheritedData, locale, locale); }
</del><span class="cx">     void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); }
</span><span class="cx">     void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); }
</span><span class="cx">     void setColumnAxis(ColumnAxis axis) { SET_VAR(rareNonInheritedData.access()-&gt;m_multiCol, m_axis, axis); }
</span><span class="lines">@@ -1966,7 +1965,6 @@
</span><span class="cx">     static short initialHyphenationLimitAfter() { return -1; }
</span><span class="cx">     static short initialHyphenationLimitLines() { return -1; }
</span><span class="cx">     static const AtomicString&amp; initialHyphenationString() { return nullAtom; }
</span><del>-    static const AtomicString&amp; initialLocale() { return nullAtom; }
</del><span class="cx">     static EBorderFit initialBorderFit() { return BorderFitBorder; }
</span><span class="cx">     static EResize initialResize() { return RESIZE_NONE; }
</span><span class="cx">     static ControlPart initialAppearance() { return NoControlPart; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleRareInheritedDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp (187625 => 187626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp        2015-07-30 23:56:51 UTC (rev 187625)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp        2015-07-31 00:12:38 UTC (rev 187626)
</span><span class="lines">@@ -206,7 +206,6 @@
</span><span class="cx">     , hyphenationLimitBefore(o.hyphenationLimitBefore)
</span><span class="cx">     , hyphenationLimitAfter(o.hyphenationLimitAfter)
</span><span class="cx">     , hyphenationLimitLines(o.hyphenationLimitLines)
</span><del>-    , locale(o.locale)
</del><span class="cx">     , textEmphasisCustomMark(o.textEmphasisCustomMark)
</span><span class="cx">     , m_lineGrid(o.m_lineGrid)
</span><span class="cx">     , m_tabSize(o.m_tabSize)
</span><span class="lines">@@ -302,7 +301,6 @@
</span><span class="cx">         &amp;&amp; touchCalloutEnabled == o.touchCalloutEnabled
</span><span class="cx"> #endif
</span><span class="cx">         &amp;&amp; hyphenationString == o.hyphenationString
</span><del>-        &amp;&amp; locale == o.locale
</del><span class="cx">         &amp;&amp; textEmphasisCustomMark == o.textEmphasisCustomMark
</span><span class="cx">         &amp;&amp; quotesDataEquivalent(quotes.get(), o.quotes.get())
</span><span class="cx">         &amp;&amp; m_tabSize == o.m_tabSize
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleRareInheritedDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h (187625 => 187626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h        2015-07-30 23:56:51 UTC (rev 187625)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h        2015-07-31 00:12:38 UTC (rev 187626)
</span><span class="lines">@@ -139,8 +139,6 @@
</span><span class="cx">     short hyphenationLimitAfter;
</span><span class="cx">     short hyphenationLimitLines;
</span><span class="cx"> 
</span><del>-    AtomicString locale;
-
</del><span class="cx">     AtomicString textEmphasisCustomMark;
</span><span class="cx">     RefPtr&lt;QuotesData&gt; quotes;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleResolveForDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleResolveForDocument.cpp (187625 => 187626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleResolveForDocument.cpp        2015-07-30 23:56:51 UTC (rev 187625)
+++ trunk/Source/WebCore/style/StyleResolveForDocument.cpp        2015-07-31 00:12:38 UTC (rev 187626)
</span><span class="lines">@@ -59,7 +59,9 @@
</span><span class="cx">     documentStyle.get().setRTLOrdering(document.visuallyOrdered() ? VisualOrder : LogicalOrder);
</span><span class="cx">     documentStyle.get().setZoom(!document.printing() ? renderView.frame().pageZoomFactor() : 1);
</span><span class="cx">     documentStyle.get().setPageScaleTransform(renderView.frame().frameScaleFactor());
</span><del>-    documentStyle.get().setLocale(document.contentLanguage());
</del><ins>+    FontDescription documentFontDescription = documentStyle.get().fontDescription();
+    documentFontDescription.setLocale(document.contentLanguage());
+    documentStyle.get().setFontDescription(WTF::move(documentFontDescription));
</ins><span class="cx"> 
</span><span class="cx">     // This overrides any -webkit-user-modify inherited from the parent iframe.
</span><span class="cx">     documentStyle.get().setUserModify(document.inDesignMode() ? READ_WRITE : READ_ONLY);
</span><span class="lines">@@ -97,7 +99,7 @@
</span><span class="cx">     const Settings&amp; settings = renderView.frame().settings();
</span><span class="cx"> 
</span><span class="cx">     FontDescription fontDescription;
</span><del>-    fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle.get().locale()));
</del><ins>+    fontDescription.setLocale(document.contentLanguage());
</ins><span class="cx">     fontDescription.setRenderingMode(settings.fontRenderingMode());
</span><span class="cx">     fontDescription.setOneFamily(standardFamily);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>