<!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>[176751] 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/176751">176751</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2014-12-03 13:01:36 -0800 (Wed, 03 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove genericFamily enum from FontDescription
https://bugs.webkit.org/show_bug.cgi?id=139207

Reviewed by Andreas Kling.

We use predefined AtomicStrings for generic families. The side enum adds no information.

* css/CSSFontSelector.cpp:
(WebCore::resolveGenericFamily):
(WebCore::CSSFontSelector::getFontData):

    Match the existing quirk where the default font can be replaced by @font-face rule but user generic families can't.

(WebCore::CSSFontSelector::resolvesFamilyFor):
(WebCore::fontDataForGenericFamily): Deleted.
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyFontFamily::applyInheritValue):
(WebCore::ApplyPropertyFontFamily::applyInitialValue):
(WebCore::ApplyPropertyFontFamily::applyValue):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::checkForGenericFamilyChange):

    Remove the explicit monospace check, earlier useFixedDefaultSize check is equivalent.

(WebCore::StyleResolver::initializeFontStyle):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::FontDescription):
(WebCore::FontDescription::useFixedDefaultSize):
(WebCore::FontDescription::setWeight):
(WebCore::FontDescription::equalForTextAutoSizing):
(WebCore::FontDescription::operator==):
(WebCore::FontDescription::genericFamily): Deleted.
(WebCore::FontDescription::setGenericFamily): Deleted.
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::controlFont):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):

    Reset the lineheight unconditionally for buttons.
    This always happened before because the explicitly set generic family made the font compare false.

* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::systemFont):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemFont):
(WebCore::RenderThemeMac::setFontFromControlSize):
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):

    Resolve document style for final value immediately as it can't be affected by @font-face rules.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontSelectorcpp">trunk/Source/WebCore/css/CSSFontSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderCustomh">trunk/Source/WebCore/css/StyleBuilderCustom.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformeflRenderThemeEflcpp">trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontDescriptionh">trunk/Source/WebCore/platform/graphics/FontDescription.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfreetypeFontCacheFreeTypecpp">trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacThemeMacmm">trunk/Source/WebCore/platform/mac/ThemeMac.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemecpp">trunk/Source/WebCore/rendering/RenderTheme.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeGtkcpp">trunk/Source/WebCore/rendering/RenderThemeGtk.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeIOSmm">trunk/Source/WebCore/rendering/RenderThemeIOS.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeMacmm">trunk/Source/WebCore/rendering/RenderThemeMac.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeSafaricpp">trunk/Source/WebCore/rendering/RenderThemeSafari.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeWincpp">trunk/Source/WebCore/rendering/RenderThemeWin.cpp</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 (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/ChangeLog        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -1,3 +1,56 @@
</span><ins>+2014-12-03  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Remove genericFamily enum from FontDescription
+        https://bugs.webkit.org/show_bug.cgi?id=139207
+
+        Reviewed by Andreas Kling.
+
+        We use predefined AtomicStrings for generic families. The side enum adds no information.
+
+        * css/CSSFontSelector.cpp:
+        (WebCore::resolveGenericFamily):
+        (WebCore::CSSFontSelector::getFontData):
+
+            Match the existing quirk where the default font can be replaced by @font-face rule but user generic families can't.
+
+        (WebCore::CSSFontSelector::resolvesFamilyFor):
+        (WebCore::fontDataForGenericFamily): Deleted.
+        * css/DeprecatedStyleBuilder.cpp:
+        (WebCore::ApplyPropertyFontFamily::applyInheritValue):
+        (WebCore::ApplyPropertyFontFamily::applyInitialValue):
+        (WebCore::ApplyPropertyFontFamily::applyValue):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::checkForGenericFamilyChange):
+
+            Remove the explicit monospace check, earlier useFixedDefaultSize check is equivalent.
+
+        (WebCore::StyleResolver::initializeFontStyle):
+        * platform/graphics/FontDescription.h:
+        (WebCore::FontDescription::FontDescription):
+        (WebCore::FontDescription::useFixedDefaultSize):
+        (WebCore::FontDescription::setWeight):
+        (WebCore::FontDescription::equalForTextAutoSizing):
+        (WebCore::FontDescription::operator==):
+        (WebCore::FontDescription::genericFamily): Deleted.
+        (WebCore::FontDescription::setGenericFamily): Deleted.
+        * platform/mac/ThemeMac.mm:
+        (WebCore::ThemeMac::controlFont):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::adjustStyle):
+
+            Reset the lineheight unconditionally for buttons.
+            This always happened before because the explicitly set generic family made the font compare false.
+
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::RenderThemeIOS::systemFont):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::systemFont):
+        (WebCore::RenderThemeMac::setFontFromControlSize):
+        * style/StyleResolveForDocument.cpp:
+        (WebCore::Style::resolveForDocument):
+
+            Resolve document style for final value immediately as it can't be affected by @font-face rules.
+
</ins><span class="cx"> 2014-12-03  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         ASSERTION: RenderMultiColumnFlowThread::processPossibleSpannerDescendant() when column spanner's parent is not a RenderBlockFlow.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontSelector.cpp        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/css/CSSFontSelector.cpp        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -360,35 +360,30 @@
</span><span class="cx">     dispatchInvalidationCallbacks();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static PassRefPtr&lt;SimpleFontData&gt; fontDataForGenericFamily(Document* document, const FontDescription&amp; fontDescription, const AtomicString&amp; familyName)
</del><ins>+static const AtomicString&amp; resolveGenericFamily(Document* document, const FontDescription&amp; fontDescription, const AtomicString&amp; familyName)
</ins><span class="cx"> {
</span><span class="cx">     if (!document || !document-&gt;frame())
</span><del>-        return 0;
</del><ins>+        return familyName;
</ins><span class="cx"> 
</span><span class="cx">     const Settings&amp; settings = document-&gt;frame()-&gt;settings();
</span><span class="cx"> 
</span><del>-    AtomicString genericFamily;
</del><span class="cx">     UScriptCode script = fontDescription.script();
</span><del>-
</del><span class="cx">     if (familyName == serifFamily)
</span><del>-        genericFamily = settings.serifFontFamily(script);
-    else if (familyName == sansSerifFamily)
-        genericFamily = settings.sansSerifFontFamily(script);
-    else if (familyName == cursiveFamily)
-        genericFamily = settings.cursiveFontFamily(script);
-    else if (familyName == fantasyFamily)
-        genericFamily = settings.fantasyFontFamily(script);
-    else if (familyName == monospaceFamily)
-        genericFamily = settings.fixedFontFamily(script);
-    else if (familyName == pictographFamily)
-        genericFamily = settings.pictographFontFamily(script);
-    else if (familyName == standardFamily)
-        genericFamily = settings.standardFontFamily(script);
</del><ins>+        return settings.serifFontFamily(script);
+    if (familyName == sansSerifFamily)
+        return settings.sansSerifFontFamily(script);
+    if (familyName == cursiveFamily)
+        return settings.cursiveFontFamily(script);
+    if (familyName == fantasyFamily)
+        return settings.fantasyFontFamily(script);
+    if (familyName == monospaceFamily)
+        return settings.fixedFontFamily(script);
+    if (familyName == pictographFamily)
+        return settings.pictographFontFamily(script);
+    if (familyName == standardFamily)
+        return settings.standardFontFamily(script);
</ins><span class="cx"> 
</span><del>-    if (!genericFamily.isEmpty())
-        return fontCache().getCachedFontData(fontDescription, genericFamily);
-
-    return nullptr;
</del><ins>+    return familyName;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static FontTraitsMask desiredTraitsMaskForComparison;
</span><span class="lines">@@ -475,25 +470,17 @@
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;FontData&gt; CSSFontSelector::getFontData(const FontDescription&amp; fontDescription, const AtomicString&amp; familyName)
</span><span class="cx"> {
</span><del>-    if (m_fontFaces.isEmpty()) {
-        if (familyName.startsWith(&quot;-webkit-&quot;))
-            return fontDataForGenericFamily(m_document, fontDescription, familyName);
-        if (fontDescription.genericFamily() == FontDescription::StandardFamily &amp;&amp; !fontDescription.isSpecifiedFont())
-            return fontDataForGenericFamily(m_document, fontDescription, standardFamily);
-        return 0;
-    }
</del><ins>+    // FIXME: The spec (and Firefox) says user specified generic families (sans-serif etc.) should be resolved before the @font-face lookup too.
+    bool resolveGenericFamilyFirst = familyName == standardFamily;
</ins><span class="cx"> 
</span><del>-    CSSSegmentedFontFace* face = getFontFace(fontDescription, familyName);
-    // If no face was found, then return 0 and let the OS come up with its best match for the name.
</del><ins>+    AtomicString familyForLookup = resolveGenericFamilyFirst ? resolveGenericFamily(m_document, fontDescription, familyName) : familyName;
+    CSSSegmentedFontFace* face = getFontFace(fontDescription, familyForLookup);
</ins><span class="cx">     if (!face) {
</span><del>-        // If we were handed a generic family, but there was no match, go ahead and return the correct font based off our
-        // settings.
-        if (fontDescription.genericFamily() == FontDescription::StandardFamily &amp;&amp; !fontDescription.isSpecifiedFont())
-            return fontDataForGenericFamily(m_document, fontDescription, standardFamily);
-        return fontDataForGenericFamily(m_document, fontDescription, familyName);
</del><ins>+        if (!resolveGenericFamilyFirst)
+            familyForLookup = resolveGenericFamily(m_document, fontDescription, familyName);
+        return fontCache().getCachedFontData(fontDescription, familyForLookup);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // We have a face. Ask it for a font data. If it cannot produce one, it will fail, and the OS will take over.
</del><span class="cx">     return face-&gt;getFontData(fontDescription);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -613,8 +600,6 @@
</span><span class="cx"> {
</span><span class="cx">     for (unsigned i = 0; i &lt; description.familyCount(); ++i) {
</span><span class="cx">         const AtomicString&amp; familyName = description.familyAt(i);
</span><del>-        if (description.genericFamily() == FontDescription::StandardFamily &amp;&amp; !description.isSpecifiedFont())
-            return true;
</del><span class="cx">         if (familyName.isEmpty())
</span><span class="cx">             continue;
</span><span class="cx">         if (m_fontFaces.contains(familyName))
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderCustom.h        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -899,7 +899,6 @@
</span><span class="cx">     // We need to adjust the size to account for the generic family change from monospace to non-monospace.
</span><span class="cx">     if (fontDescription.keywordSize() &amp;&amp; fontDescription.useFixedDefaultSize())
</span><span class="cx">         styleResolver.setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueXxSmall + fontDescription.keywordSize() - 1, false, styleResolver.document()));
</span><del>-    fontDescription.setGenericFamily(initialDesc.genericFamily());
</del><span class="cx">     if (!initialDesc.firstFamily().isEmpty())
</span><span class="cx">         fontDescription.setFamilies(initialDesc.families());
</span><span class="cx"> 
</span><span class="lines">@@ -911,7 +910,6 @@
</span><span class="cx">     FontDescription fontDescription = styleResolver.style()-&gt;fontDescription();
</span><span class="cx">     FontDescription parentFontDescription = styleResolver.parentStyle()-&gt;fontDescription();
</span><span class="cx"> 
</span><del>-    fontDescription.setGenericFamily(parentFontDescription.genericFamily());
</del><span class="cx">     fontDescription.setFamilies(parentFontDescription.families());
</span><span class="cx">     fontDescription.setIsSpecifiedFont(parentFontDescription.isSpecifiedFont());
</span><span class="cx">     styleResolver.setFontDescription(fontDescription);
</span><span class="lines">@@ -924,55 +922,56 @@
</span><span class="cx">     FontDescription fontDescription = styleResolver.style()-&gt;fontDescription();
</span><span class="cx">     // Before mapping in a new font-family property, we should reset the generic family.
</span><span class="cx">     bool oldFamilyUsedFixedDefaultSize = fontDescription.useFixedDefaultSize();
</span><del>-    fontDescription.setGenericFamily(FontDescription::NoFamily);
</del><span class="cx"> 
</span><span class="cx">     Vector&lt;AtomicString&gt; families;
</span><span class="cx">     families.reserveInitialCapacity(valueList.length());
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; item : valueList) {
</span><span class="cx">         auto&amp; contentValue = downcast&lt;CSSPrimitiveValue&gt;(item.get());
</span><del>-        AtomicString face;
</del><ins>+        AtomicString family;
+        bool isGenericFamily = false;
</ins><span class="cx">         if (contentValue.isString())
</span><del>-            face = contentValue.getStringValue();
-        else if (Settings* settings = styleResolver.document().settings()) {
</del><ins>+            family = contentValue.getStringValue();
+        else {
</ins><span class="cx">             switch (contentValue.getValueID()) {
</span><span class="cx">             case CSSValueWebkitBody:
</span><del>-                face = settings-&gt;standardFontFamily();
</del><ins>+                if (Settings* settings = styleResolver.document().settings())
+                    family = settings-&gt;standardFontFamily();
</ins><span class="cx">                 break;
</span><span class="cx">             case CSSValueSerif:
</span><del>-                face = serifFamily;
-                fontDescription.setGenericFamily(FontDescription::SerifFamily);
</del><ins>+                family = serifFamily;
+                isGenericFamily = true;
</ins><span class="cx">                 break;
</span><span class="cx">             case CSSValueSansSerif:
</span><del>-                face = sansSerifFamily;
-                fontDescription.setGenericFamily(FontDescription::SansSerifFamily);
</del><ins>+                family = sansSerifFamily;
+                isGenericFamily = true;
</ins><span class="cx">                 break;
</span><span class="cx">             case CSSValueCursive:
</span><del>-                face = cursiveFamily;
-                fontDescription.setGenericFamily(FontDescription::CursiveFamily);
</del><ins>+                family = cursiveFamily;
+                isGenericFamily = true;
</ins><span class="cx">                 break;
</span><span class="cx">             case CSSValueFantasy:
</span><del>-                face = fantasyFamily;
-                fontDescription.setGenericFamily(FontDescription::FantasyFamily);
</del><ins>+                family = fantasyFamily;
+                isGenericFamily = true;
</ins><span class="cx">                 break;
</span><span class="cx">             case CSSValueMonospace:
</span><del>-                face = monospaceFamily;
-                fontDescription.setGenericFamily(FontDescription::MonospaceFamily);
</del><ins>+                family = monospaceFamily;
+                isGenericFamily = true;
</ins><span class="cx">                 break;
</span><span class="cx">             case CSSValueWebkitPictograph:
</span><del>-                face = pictographFamily;
-                fontDescription.setGenericFamily(FontDescription::PictographFamily);
</del><ins>+                family = pictographFamily;
+                isGenericFamily = true;
</ins><span class="cx">                 break;
</span><span class="cx">             default:
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (face.isEmpty())
</del><ins>+        if (family.isEmpty())
</ins><span class="cx">             continue;
</span><span class="cx">         if (families.isEmpty())
</span><del>-            fontDescription.setIsSpecifiedFont(fontDescription.genericFamily() == FontDescription::NoFamily);
-        families.uncheckedAppend(face);
</del><ins>+            fontDescription.setIsSpecifiedFont(!isGenericFamily);
+        families.uncheckedAppend(family);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (families.isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -3139,12 +3139,6 @@
</span><span class="cx">     const FontDescription&amp; parentFont = parentStyle-&gt;fontDescription();
</span><span class="cx">     if (childFont.useFixedDefaultSize() == parentFont.useFixedDefaultSize())
</span><span class="cx">         return;
</span><del>-
-    // For now, lump all families but monospace together.
-    if (childFont.genericFamily() != FontDescription::MonospaceFamily
-        &amp;&amp; parentFont.genericFamily() != FontDescription::MonospaceFamily)
-        return;
-
</del><span class="cx">     // We know the parent is monospace or the child is monospace, and that font
</span><span class="cx">     // size was unspecified. We want to scale our font size as appropriate.
</span><span class="cx">     // If the font uses a keyword size, then we refetch from the table rather than
</span><span class="lines">@@ -3170,12 +3164,9 @@
</span><span class="cx"> void StyleResolver::initializeFontStyle(Settings* settings)
</span><span class="cx"> {
</span><span class="cx">     FontDescription fontDescription;
</span><del>-    fontDescription.setGenericFamily(FontDescription::StandardFamily);
</del><span class="cx">     fontDescription.setRenderingMode(settings-&gt;fontRenderingMode());
</span><span class="cx">     fontDescription.setUsePrinterFont(document().printing() || !settings-&gt;screenFontSubstitutionEnabled());
</span><del>-    const AtomicString&amp; standardFontFamily = documentSettings()-&gt;standardFontFamily();
-    if (!standardFontFamily.isEmpty())
-        fontDescription.setOneFamily(standardFontFamily);
</del><ins>+    fontDescription.setOneFamily(standardFamily);
</ins><span class="cx">     fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
</span><span class="cx">     setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueMedium, false, document()));
</span><span class="cx">     m_state.style()-&gt;setLineHeight(RenderStyle::initialLineHeight());
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformeflRenderThemeEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -991,7 +991,6 @@
</span><span class="cx">     fontDescription.setOneFamily(&quot;Sans&quot;);
</span><span class="cx">     fontDescription.setSpecifiedSize(defaultFontSize);
</span><span class="cx">     fontDescription.setIsAbsoluteSize(true);
</span><del>-    fontDescription.setGenericFamily(FontDescription::NoFamily);
</del><span class="cx">     fontDescription.setWeight(FontWeightNormal);
</span><span class="cx">     fontDescription.setItalic(false);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontDescriptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontDescription.h (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontDescription.h        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.h        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -69,9 +69,6 @@
</span><span class="cx"> 
</span><span class="cx"> class FontDescription {
</span><span class="cx"> public:
</span><del>-    enum GenericFamilyType { NoFamily, StandardFamily, SerifFamily, SansSerifFamily, 
-                             MonospaceFamily, CursiveFamily, FantasyFamily, PictographFamily };
-
</del><span class="cx">     enum Kerning { AutoKerning, NormalKerning, NoneKerning };
</span><span class="cx"> 
</span><span class="cx">     enum LigaturesState { NormalLigaturesState, DisabledLigaturesState, EnabledLigaturesState };
</span><span class="lines">@@ -87,7 +84,6 @@
</span><span class="cx">         , m_smallCaps(FontSmallCapsOff)
</span><span class="cx">         , m_isAbsoluteSize(false)
</span><span class="cx">         , m_weight(FontWeightNormal)
</span><del>-        , m_genericFamily(NoFamily)
</del><span class="cx">         , m_usePrinterFont(false)
</span><span class="cx">         , m_renderingMode(NormalRenderingMode)
</span><span class="cx">         , m_kerning(AutoKerning)
</span><span class="lines">@@ -119,10 +115,9 @@
</span><span class="cx">     FontWeight weight() const { return static_cast&lt;FontWeight&gt;(m_weight); }
</span><span class="cx">     FontWeight lighterWeight() const;
</span><span class="cx">     FontWeight bolderWeight() const;
</span><del>-    GenericFamilyType genericFamily() const { return static_cast&lt;GenericFamilyType&gt;(m_genericFamily); }
</del><span class="cx">     bool usePrinterFont() const { return m_usePrinterFont; }
</span><span class="cx">     // only use fixed default size when there is only one font family, and that family is &quot;monospace&quot;
</span><del>-    bool useFixedDefaultSize() const { return genericFamily() == MonospaceFamily &amp;&amp; familyCount() == 1 &amp;&amp; firstFamily() == monospaceFamily; }
</del><ins>+    bool useFixedDefaultSize() const { return familyCount() == 1 &amp;&amp; firstFamily() == monospaceFamily; }
</ins><span class="cx">     FontRenderingMode renderingMode() const { return static_cast&lt;FontRenderingMode&gt;(m_renderingMode); }
</span><span class="cx">     Kerning kerning() const { return static_cast&lt;Kerning&gt;(m_kerning); }
</span><span class="cx">     LigaturesState commonLigaturesState() const { return static_cast&lt;LigaturesState&gt;(m_commonLigaturesState); }
</span><span class="lines">@@ -152,7 +147,6 @@
</span><span class="cx">     void setSmallCaps(bool c) { setSmallCaps(c ? FontSmallCapsOn : FontSmallCapsOff); }
</span><span class="cx">     void setIsAbsoluteSize(bool s) { m_isAbsoluteSize = s; }
</span><span class="cx">     void setWeight(FontWeight w) { m_weight = w; }
</span><del>-    void setGenericFamily(GenericFamilyType genericFamily) { m_genericFamily = genericFamily; }
</del><span class="cx">     void setUsePrinterFont(bool p) { m_usePrinterFont = p; }
</span><span class="cx">     void setRenderingMode(FontRenderingMode mode) { m_renderingMode = mode; }
</span><span class="cx">     void setKerning(Kerning kerning) { m_kerning = kerning; }
</span><span class="lines">@@ -178,7 +172,6 @@
</span><span class="cx">             &amp;&amp; m_specifiedSize == other.m_specifiedSize
</span><span class="cx">             &amp;&amp; m_smallCaps == other.m_smallCaps
</span><span class="cx">             &amp;&amp; m_isAbsoluteSize == other.m_isAbsoluteSize
</span><del>-            &amp;&amp; m_genericFamily == other.m_genericFamily
</del><span class="cx">             &amp;&amp; m_usePrinterFont == other.m_usePrinterFont;
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="lines">@@ -201,7 +194,6 @@
</span><span class="cx">     unsigned m_isAbsoluteSize : 1; // Whether or not CSS specified an explicit size
</span><span class="cx">                                   // (logical sizes like &quot;medium&quot; don't count).
</span><span class="cx">     unsigned m_weight : 8; // FontWeight
</span><del>-    unsigned m_genericFamily : 3; // GenericFamilyType
</del><span class="cx">     unsigned m_usePrinterFont : 1;
</span><span class="cx"> 
</span><span class="cx">     unsigned m_renderingMode : 1;  // Used to switch between CG and GDI text on Windows.
</span><span class="lines">@@ -230,7 +222,6 @@
</span><span class="cx">         &amp;&amp; m_smallCaps == other.m_smallCaps
</span><span class="cx">         &amp;&amp; m_isAbsoluteSize == other.m_isAbsoluteSize
</span><span class="cx">         &amp;&amp; m_weight == other.m_weight
</span><del>-        &amp;&amp; m_genericFamily == other.m_genericFamily
</del><span class="cx">         &amp;&amp; m_usePrinterFont == other.m_usePrinterFont
</span><span class="cx">         &amp;&amp; m_renderingMode == other.m_renderingMode
</span><span class="cx">         &amp;&amp; m_kerning == other.m_kerning
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfreetypeFontCacheFreeTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -119,22 +119,17 @@
</span><span class="cx">     if (family.length() &amp;&amp; !family.startsWith(&quot;-webkit-&quot;))
</span><span class="cx">         return family.string();
</span><span class="cx"> 
</span><del>-    switch (fontDescription.genericFamily()) {
-    case FontDescription::StandardFamily:
-    case FontDescription::SerifFamily:
</del><ins>+    if (family == standardFamily || family == serifFamily)
</ins><span class="cx">         return &quot;serif&quot;;
</span><del>-    case FontDescription::SansSerifFamily:
</del><ins>+    if (family == sansSerifFamily)
</ins><span class="cx">         return &quot;sans-serif&quot;;
</span><del>-    case FontDescription::MonospaceFamily:
</del><ins>+    if (family == monospaceFamily)
</ins><span class="cx">         return &quot;monospace&quot;;
</span><del>-    case FontDescription::CursiveFamily:
</del><ins>+    if (family == cursiveFamily)
</ins><span class="cx">         return &quot;cursive&quot;;
</span><del>-    case FontDescription::FantasyFamily:
</del><ins>+    if (family == fantasyFamily)
</ins><span class="cx">         return &quot;fantasy&quot;;
</span><del>-    case FontDescription::NoFamily:
-    default:
-        return &quot;&quot;;
-    }
</del><ins>+    return &quot;&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int fontWeightToFontconfigWeight(FontWeight weight)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/ThemeMac.mm (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ThemeMac.mm        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/platform/mac/ThemeMac.mm        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -683,7 +683,6 @@
</span><span class="cx">         case PushButtonPart: {
</span><span class="cx">             FontDescription fontDescription;
</span><span class="cx">             fontDescription.setIsAbsoluteSize(true);
</span><del>-            fontDescription.setGenericFamily(FontDescription::SerifFamily);
</del><span class="cx"> 
</span><span class="cx">             NSFont* nsFont = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:controlSizeForFont(font)]];
</span><span class="cx">             fontDescription.setOneFamily([nsFont webCoreFamilyName]);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTheme.cpp        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -170,14 +170,12 @@
</span><span class="cx">         // Font
</span><span class="cx">         FontDescription controlFont = m_theme-&gt;controlFont(part, style.font(), style.effectiveZoom());
</span><span class="cx">         if (controlFont != style.font().fontDescription()) {
</span><del>-            // Reset our line-height
-            style.setLineHeight(RenderStyle::initialLineHeight());
-
</del><span class="cx">             // Now update our font.
</span><span class="cx">             if (style.setFontDescription(controlFont))
</span><span class="cx">                 style.font().update(0);
</span><span class="cx">         }
</span><del>-
</del><ins>+        // Reset our line-height
+        style.setLineHeight(RenderStyle::initialLineHeight());
</ins><span class="cx">         style.setInsideDefaultButton(part == DefaultButtonPart);
</span><span class="cx">     }
</span><span class="cx">     break;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeGtk.cpp (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeGtk.cpp        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/rendering/RenderThemeGtk.cpp        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -107,7 +107,6 @@
</span><span class="cx"> 
</span><span class="cx">     fontDescription.setSpecifiedSize(size);
</span><span class="cx">     fontDescription.setIsAbsoluteSize(true);
</span><del>-    fontDescription.setGenericFamily(FontDescription::NoFamily);
</del><span class="cx">     fontDescription.setWeight(FontWeightNormal);
</span><span class="cx">     fontDescription.setItalic(false);
</span><span class="cx">     pango_font_description_free(pangoDescription);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -1230,7 +1230,6 @@
</span><span class="cx">     if (fontDescriptor) {
</span><span class="cx">         RetainPtr&lt;CTFontRef&gt; font = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), 0, nullptr));
</span><span class="cx">         cachedDesc-&gt;setIsAbsoluteSize(true);
</span><del>-        cachedDesc-&gt;setGenericFamily(FontDescription::NoFamily);
</del><span class="cx">         cachedDesc-&gt;setOneFamily(textStyle);
</span><span class="cx">         cachedDesc-&gt;setSpecifiedSize(CTFontGetSize(font.get()));
</span><span class="cx">         cachedDesc-&gt;setWeight(fromCTFontWeight(FontCache::weightOfCTFont(font.get())));
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeMac.mm        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -390,7 +390,6 @@
</span><span class="cx">     if (font) {
</span><span class="cx">         NSFontManager *fontManager = [NSFontManager sharedFontManager];
</span><span class="cx">         cachedDesc-&gt;setIsAbsoluteSize(true);
</span><del>-        cachedDesc-&gt;setGenericFamily(FontDescription::NoFamily);
</del><span class="cx">         cachedDesc-&gt;setOneFamily([font webCoreFamilyName]);
</span><span class="cx">         cachedDesc-&gt;setSpecifiedSize([font pointSize]);
</span><span class="cx">         cachedDesc-&gt;setWeight(toFontWeight([fontManager weightOfFont:font]));
</span><span class="lines">@@ -808,7 +807,6 @@
</span><span class="cx"> {
</span><span class="cx">     FontDescription fontDescription;
</span><span class="cx">     fontDescription.setIsAbsoluteSize(true);
</span><del>-    fontDescription.setGenericFamily(FontDescription::SerifFamily);
</del><span class="cx"> 
</span><span class="cx">     NSFont* font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:controlSize]];
</span><span class="cx">     fontDescription.setOneFamily([font webCoreFamilyName]);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeSafaricpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeSafari.cpp (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeSafari.cpp        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/rendering/RenderThemeSafari.cpp        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -243,7 +243,6 @@
</span><span class="cx"> 
</span><span class="cx">     if (fontSize) {
</span><span class="cx">         cachedDesc-&gt;setIsAbsoluteSize(true);
</span><del>-        cachedDesc-&gt;setGenericFamily(FontDescription::NoFamily);
</del><span class="cx">         cachedDesc-&gt;setOneFamily(&quot;Lucida Grande&quot;);
</span><span class="cx">         cachedDesc-&gt;setSpecifiedSize(fontSize);
</span><span class="cx">         cachedDesc-&gt;setWeight(FontWeightNormal);
</span><span class="lines">@@ -392,7 +391,6 @@
</span><span class="cx"> {
</span><span class="cx">     FontDescription fontDescription;
</span><span class="cx">     fontDescription.setIsAbsoluteSize(true);
</span><del>-    fontDescription.setGenericFamily(FontDescription::SerifFamily);
</del><span class="cx"> 
</span><span class="cx">     float fontSize = systemFontSizeForControlSize(controlSize);
</span><span class="cx">     fontDescription.setOneFamily(&quot;Lucida Grande&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeWin.cpp (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeWin.cpp        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/rendering/RenderThemeWin.cpp        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -323,7 +323,6 @@
</span><span class="cx"> static void fillFontDescription(FontDescription&amp; fontDescription, LOGFONT&amp; logFont, float fontSize)
</span><span class="cx"> {    
</span><span class="cx">     fontDescription.setIsAbsoluteSize(true);
</span><del>-    fontDescription.setGenericFamily(FontDescription::NoFamily);
</del><span class="cx">     fontDescription.setOneFamily(String(logFont.lfFaceName));
</span><span class="cx">     fontDescription.setSpecifiedSize(fontSize);
</span><span class="cx">     fontDescription.setWeight(logFont.lfWeight &gt;= 700 ? FontWeightBold : FontWeightNormal); // FIXME: Use real weight.
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleResolveForDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleResolveForDocument.cpp (176750 => 176751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleResolveForDocument.cpp        2014-12-03 20:53:49 UTC (rev 176750)
+++ trunk/Source/WebCore/style/StyleResolveForDocument.cpp        2014-12-03 21:01:36 UTC (rev 176751)
</span><span class="lines">@@ -99,11 +99,8 @@
</span><span class="cx">     fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle.get().locale()));
</span><span class="cx">     fontDescription.setUsePrinterFont(document.printing() || !settings.screenFontSubstitutionEnabled());
</span><span class="cx">     fontDescription.setRenderingMode(settings.fontRenderingMode());
</span><del>-    const AtomicString&amp; standardFont = settings.standardFontFamily(fontDescription.script());
-    if (!standardFont.isEmpty()) {
-        fontDescription.setGenericFamily(FontDescription::StandardFamily);
-        fontDescription.setOneFamily(standardFont);
-    }
</del><ins>+    fontDescription.setOneFamily(standardFamily);
+
</ins><span class="cx">     fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
</span><span class="cx">     int size = fontSizeForKeyword(CSSValueMedium, false, document);
</span><span class="cx">     fontDescription.setSpecifiedSize(size);
</span></span></pre>
</div>
</div>

</body>
</html>