Title: [176751] trunk/Source/WebCore
Revision
176751
Author
[email protected]
Date
2014-12-03 13:01:36 -0800 (Wed, 03 Dec 2014)

Log Message

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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (176750 => 176751)


--- 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)
@@ -1,3 +1,56 @@
+2014-12-03  Antti Koivisto  <[email protected]>
+
+        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.
+
 2014-12-03  Zalan Bujtas  <[email protected]>
 
         ASSERTION: RenderMultiColumnFlowThread::processPossibleSpannerDescendant() when column spanner's parent is not a RenderBlockFlow.

Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (176750 => 176751)


--- 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)
@@ -360,35 +360,30 @@
     dispatchInvalidationCallbacks();
 }
 
-static PassRefPtr<SimpleFontData> fontDataForGenericFamily(Document* document, const FontDescription& fontDescription, const AtomicString& familyName)
+static const AtomicString& resolveGenericFamily(Document* document, const FontDescription& fontDescription, const AtomicString& familyName)
 {
     if (!document || !document->frame())
-        return 0;
+        return familyName;
 
     const Settings& settings = document->frame()->settings();
 
-    AtomicString genericFamily;
     UScriptCode script = fontDescription.script();
-
     if (familyName == serifFamily)
-        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);
+        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);
 
-    if (!genericFamily.isEmpty())
-        return fontCache().getCachedFontData(fontDescription, genericFamily);
-
-    return nullptr;
+    return familyName;
 }
 
 static FontTraitsMask desiredTraitsMaskForComparison;
@@ -475,25 +470,17 @@
 
 PassRefPtr<FontData> CSSFontSelector::getFontData(const FontDescription& fontDescription, const AtomicString& familyName)
 {
-    if (m_fontFaces.isEmpty()) {
-        if (familyName.startsWith("-webkit-"))
-            return fontDataForGenericFamily(m_document, fontDescription, familyName);
-        if (fontDescription.genericFamily() == FontDescription::StandardFamily && !fontDescription.isSpecifiedFont())
-            return fontDataForGenericFamily(m_document, fontDescription, standardFamily);
-        return 0;
-    }
+    // 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;
 
-    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.
+    AtomicString familyForLookup = resolveGenericFamilyFirst ? resolveGenericFamily(m_document, fontDescription, familyName) : familyName;
+    CSSSegmentedFontFace* face = getFontFace(fontDescription, familyForLookup);
     if (!face) {
-        // 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 && !fontDescription.isSpecifiedFont())
-            return fontDataForGenericFamily(m_document, fontDescription, standardFamily);
-        return fontDataForGenericFamily(m_document, fontDescription, familyName);
+        if (!resolveGenericFamilyFirst)
+            familyForLookup = resolveGenericFamily(m_document, fontDescription, familyName);
+        return fontCache().getCachedFontData(fontDescription, familyForLookup);
     }
 
-    // We have a face. Ask it for a font data. If it cannot produce one, it will fail, and the OS will take over.
     return face->getFontData(fontDescription);
 }
 
@@ -613,8 +600,6 @@
 {
     for (unsigned i = 0; i < description.familyCount(); ++i) {
         const AtomicString& familyName = description.familyAt(i);
-        if (description.genericFamily() == FontDescription::StandardFamily && !description.isSpecifiedFont())
-            return true;
         if (familyName.isEmpty())
             continue;
         if (m_fontFaces.contains(familyName))

Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (176750 => 176751)


--- 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)
@@ -899,7 +899,6 @@
     // We need to adjust the size to account for the generic family change from monospace to non-monospace.
     if (fontDescription.keywordSize() && fontDescription.useFixedDefaultSize())
         styleResolver.setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueXxSmall + fontDescription.keywordSize() - 1, false, styleResolver.document()));
-    fontDescription.setGenericFamily(initialDesc.genericFamily());
     if (!initialDesc.firstFamily().isEmpty())
         fontDescription.setFamilies(initialDesc.families());
 
@@ -911,7 +910,6 @@
     FontDescription fontDescription = styleResolver.style()->fontDescription();
     FontDescription parentFontDescription = styleResolver.parentStyle()->fontDescription();
 
-    fontDescription.setGenericFamily(parentFontDescription.genericFamily());
     fontDescription.setFamilies(parentFontDescription.families());
     fontDescription.setIsSpecifiedFont(parentFontDescription.isSpecifiedFont());
     styleResolver.setFontDescription(fontDescription);
@@ -924,55 +922,56 @@
     FontDescription fontDescription = styleResolver.style()->fontDescription();
     // Before mapping in a new font-family property, we should reset the generic family.
     bool oldFamilyUsedFixedDefaultSize = fontDescription.useFixedDefaultSize();
-    fontDescription.setGenericFamily(FontDescription::NoFamily);
 
     Vector<AtomicString> families;
     families.reserveInitialCapacity(valueList.length());
 
     for (auto& item : valueList) {
         auto& contentValue = downcast<CSSPrimitiveValue>(item.get());
-        AtomicString face;
+        AtomicString family;
+        bool isGenericFamily = false;
         if (contentValue.isString())
-            face = contentValue.getStringValue();
-        else if (Settings* settings = styleResolver.document().settings()) {
+            family = contentValue.getStringValue();
+        else {
             switch (contentValue.getValueID()) {
             case CSSValueWebkitBody:
-                face = settings->standardFontFamily();
+                if (Settings* settings = styleResolver.document().settings())
+                    family = settings->standardFontFamily();
                 break;
             case CSSValueSerif:
-                face = serifFamily;
-                fontDescription.setGenericFamily(FontDescription::SerifFamily);
+                family = serifFamily;
+                isGenericFamily = true;
                 break;
             case CSSValueSansSerif:
-                face = sansSerifFamily;
-                fontDescription.setGenericFamily(FontDescription::SansSerifFamily);
+                family = sansSerifFamily;
+                isGenericFamily = true;
                 break;
             case CSSValueCursive:
-                face = cursiveFamily;
-                fontDescription.setGenericFamily(FontDescription::CursiveFamily);
+                family = cursiveFamily;
+                isGenericFamily = true;
                 break;
             case CSSValueFantasy:
-                face = fantasyFamily;
-                fontDescription.setGenericFamily(FontDescription::FantasyFamily);
+                family = fantasyFamily;
+                isGenericFamily = true;
                 break;
             case CSSValueMonospace:
-                face = monospaceFamily;
-                fontDescription.setGenericFamily(FontDescription::MonospaceFamily);
+                family = monospaceFamily;
+                isGenericFamily = true;
                 break;
             case CSSValueWebkitPictograph:
-                face = pictographFamily;
-                fontDescription.setGenericFamily(FontDescription::PictographFamily);
+                family = pictographFamily;
+                isGenericFamily = true;
                 break;
             default:
                 break;
             }
         }
 
-        if (face.isEmpty())
+        if (family.isEmpty())
             continue;
         if (families.isEmpty())
-            fontDescription.setIsSpecifiedFont(fontDescription.genericFamily() == FontDescription::NoFamily);
-        families.uncheckedAppend(face);
+            fontDescription.setIsSpecifiedFont(!isGenericFamily);
+        families.uncheckedAppend(family);
     }
 
     if (families.isEmpty())

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (176750 => 176751)


--- 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)
@@ -3139,12 +3139,6 @@
     const FontDescription& parentFont = parentStyle->fontDescription();
     if (childFont.useFixedDefaultSize() == parentFont.useFixedDefaultSize())
         return;
-
-    // For now, lump all families but monospace together.
-    if (childFont.genericFamily() != FontDescription::MonospaceFamily
-        && parentFont.genericFamily() != FontDescription::MonospaceFamily)
-        return;
-
     // We know the parent is monospace or the child is monospace, and that font
     // size was unspecified. We want to scale our font size as appropriate.
     // If the font uses a keyword size, then we refetch from the table rather than
@@ -3170,12 +3164,9 @@
 void StyleResolver::initializeFontStyle(Settings* settings)
 {
     FontDescription fontDescription;
-    fontDescription.setGenericFamily(FontDescription::StandardFamily);
     fontDescription.setRenderingMode(settings->fontRenderingMode());
     fontDescription.setUsePrinterFont(document().printing() || !settings->screenFontSubstitutionEnabled());
-    const AtomicString& standardFontFamily = documentSettings()->standardFontFamily();
-    if (!standardFontFamily.isEmpty())
-        fontDescription.setOneFamily(standardFontFamily);
+    fontDescription.setOneFamily(standardFamily);
     fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
     setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueMedium, false, document()));
     m_state.style()->setLineHeight(RenderStyle::initialLineHeight());

Modified: trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp (176750 => 176751)


--- 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)
@@ -991,7 +991,6 @@
     fontDescription.setOneFamily("Sans");
     fontDescription.setSpecifiedSize(defaultFontSize);
     fontDescription.setIsAbsoluteSize(true);
-    fontDescription.setGenericFamily(FontDescription::NoFamily);
     fontDescription.setWeight(FontWeightNormal);
     fontDescription.setItalic(false);
 }

Modified: trunk/Source/WebCore/platform/graphics/FontDescription.h (176750 => 176751)


--- 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)
@@ -69,9 +69,6 @@
 
 class FontDescription {
 public:
-    enum GenericFamilyType { NoFamily, StandardFamily, SerifFamily, SansSerifFamily, 
-                             MonospaceFamily, CursiveFamily, FantasyFamily, PictographFamily };
-
     enum Kerning { AutoKerning, NormalKerning, NoneKerning };
 
     enum LigaturesState { NormalLigaturesState, DisabledLigaturesState, EnabledLigaturesState };
@@ -87,7 +84,6 @@
         , m_smallCaps(FontSmallCapsOff)
         , m_isAbsoluteSize(false)
         , m_weight(FontWeightNormal)
-        , m_genericFamily(NoFamily)
         , m_usePrinterFont(false)
         , m_renderingMode(NormalRenderingMode)
         , m_kerning(AutoKerning)
@@ -119,10 +115,9 @@
     FontWeight weight() const { return static_cast<FontWeight>(m_weight); }
     FontWeight lighterWeight() const;
     FontWeight bolderWeight() const;
-    GenericFamilyType genericFamily() const { return static_cast<GenericFamilyType>(m_genericFamily); }
     bool usePrinterFont() const { return m_usePrinterFont; }
     // only use fixed default size when there is only one font family, and that family is "monospace"
-    bool useFixedDefaultSize() const { return genericFamily() == MonospaceFamily && familyCount() == 1 && firstFamily() == monospaceFamily; }
+    bool useFixedDefaultSize() const { return familyCount() == 1 && firstFamily() == monospaceFamily; }
     FontRenderingMode renderingMode() const { return static_cast<FontRenderingMode>(m_renderingMode); }
     Kerning kerning() const { return static_cast<Kerning>(m_kerning); }
     LigaturesState commonLigaturesState() const { return static_cast<LigaturesState>(m_commonLigaturesState); }
@@ -152,7 +147,6 @@
     void setSmallCaps(bool c) { setSmallCaps(c ? FontSmallCapsOn : FontSmallCapsOff); }
     void setIsAbsoluteSize(bool s) { m_isAbsoluteSize = s; }
     void setWeight(FontWeight w) { m_weight = w; }
-    void setGenericFamily(GenericFamilyType genericFamily) { m_genericFamily = genericFamily; }
     void setUsePrinterFont(bool p) { m_usePrinterFont = p; }
     void setRenderingMode(FontRenderingMode mode) { m_renderingMode = mode; }
     void setKerning(Kerning kerning) { m_kerning = kerning; }
@@ -178,7 +172,6 @@
             && m_specifiedSize == other.m_specifiedSize
             && m_smallCaps == other.m_smallCaps
             && m_isAbsoluteSize == other.m_isAbsoluteSize
-            && m_genericFamily == other.m_genericFamily
             && m_usePrinterFont == other.m_usePrinterFont;
     }
 #endif
@@ -201,7 +194,6 @@
     unsigned m_isAbsoluteSize : 1; // Whether or not CSS specified an explicit size
                                   // (logical sizes like "medium" don't count).
     unsigned m_weight : 8; // FontWeight
-    unsigned m_genericFamily : 3; // GenericFamilyType
     unsigned m_usePrinterFont : 1;
 
     unsigned m_renderingMode : 1;  // Used to switch between CG and GDI text on Windows.
@@ -230,7 +222,6 @@
         && m_smallCaps == other.m_smallCaps
         && m_isAbsoluteSize == other.m_isAbsoluteSize
         && m_weight == other.m_weight
-        && m_genericFamily == other.m_genericFamily
         && m_usePrinterFont == other.m_usePrinterFont
         && m_renderingMode == other.m_renderingMode
         && m_kerning == other.m_kerning

Modified: trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp (176750 => 176751)


--- 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)
@@ -119,22 +119,17 @@
     if (family.length() && !family.startsWith("-webkit-"))
         return family.string();
 
-    switch (fontDescription.genericFamily()) {
-    case FontDescription::StandardFamily:
-    case FontDescription::SerifFamily:
+    if (family == standardFamily || family == serifFamily)
         return "serif";
-    case FontDescription::SansSerifFamily:
+    if (family == sansSerifFamily)
         return "sans-serif";
-    case FontDescription::MonospaceFamily:
+    if (family == monospaceFamily)
         return "monospace";
-    case FontDescription::CursiveFamily:
+    if (family == cursiveFamily)
         return "cursive";
-    case FontDescription::FantasyFamily:
+    if (family == fantasyFamily)
         return "fantasy";
-    case FontDescription::NoFamily:
-    default:
-        return "";
-    }
+    return "";
 }
 
 int fontWeightToFontconfigWeight(FontWeight weight)

Modified: trunk/Source/WebCore/platform/mac/ThemeMac.mm (176750 => 176751)


--- 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)
@@ -683,7 +683,6 @@
         case PushButtonPart: {
             FontDescription fontDescription;
             fontDescription.setIsAbsoluteSize(true);
-            fontDescription.setGenericFamily(FontDescription::SerifFamily);
 
             NSFont* nsFont = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:controlSizeForFont(font)]];
             fontDescription.setOneFamily([nsFont webCoreFamilyName]);

Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (176750 => 176751)


--- 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)
@@ -170,14 +170,12 @@
         // Font
         FontDescription controlFont = m_theme->controlFont(part, style.font(), style.effectiveZoom());
         if (controlFont != style.font().fontDescription()) {
-            // Reset our line-height
-            style.setLineHeight(RenderStyle::initialLineHeight());
-
             // Now update our font.
             if (style.setFontDescription(controlFont))
                 style.font().update(0);
         }
-
+        // Reset our line-height
+        style.setLineHeight(RenderStyle::initialLineHeight());
         style.setInsideDefaultButton(part == DefaultButtonPart);
     }
     break;

Modified: trunk/Source/WebCore/rendering/RenderThemeGtk.cpp (176750 => 176751)


--- 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)
@@ -107,7 +107,6 @@
 
     fontDescription.setSpecifiedSize(size);
     fontDescription.setIsAbsoluteSize(true);
-    fontDescription.setGenericFamily(FontDescription::NoFamily);
     fontDescription.setWeight(FontWeightNormal);
     fontDescription.setItalic(false);
     pango_font_description_free(pangoDescription);

Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (176750 => 176751)


--- 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)
@@ -1230,7 +1230,6 @@
     if (fontDescriptor) {
         RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), 0, nullptr));
         cachedDesc->setIsAbsoluteSize(true);
-        cachedDesc->setGenericFamily(FontDescription::NoFamily);
         cachedDesc->setOneFamily(textStyle);
         cachedDesc->setSpecifiedSize(CTFontGetSize(font.get()));
         cachedDesc->setWeight(fromCTFontWeight(FontCache::weightOfCTFont(font.get())));

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (176750 => 176751)


--- 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)
@@ -390,7 +390,6 @@
     if (font) {
         NSFontManager *fontManager = [NSFontManager sharedFontManager];
         cachedDesc->setIsAbsoluteSize(true);
-        cachedDesc->setGenericFamily(FontDescription::NoFamily);
         cachedDesc->setOneFamily([font webCoreFamilyName]);
         cachedDesc->setSpecifiedSize([font pointSize]);
         cachedDesc->setWeight(toFontWeight([fontManager weightOfFont:font]));
@@ -808,7 +807,6 @@
 {
     FontDescription fontDescription;
     fontDescription.setIsAbsoluteSize(true);
-    fontDescription.setGenericFamily(FontDescription::SerifFamily);
 
     NSFont* font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:controlSize]];
     fontDescription.setOneFamily([font webCoreFamilyName]);

Modified: trunk/Source/WebCore/rendering/RenderThemeSafari.cpp (176750 => 176751)


--- 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)
@@ -243,7 +243,6 @@
 
     if (fontSize) {
         cachedDesc->setIsAbsoluteSize(true);
-        cachedDesc->setGenericFamily(FontDescription::NoFamily);
         cachedDesc->setOneFamily("Lucida Grande");
         cachedDesc->setSpecifiedSize(fontSize);
         cachedDesc->setWeight(FontWeightNormal);
@@ -392,7 +391,6 @@
 {
     FontDescription fontDescription;
     fontDescription.setIsAbsoluteSize(true);
-    fontDescription.setGenericFamily(FontDescription::SerifFamily);
 
     float fontSize = systemFontSizeForControlSize(controlSize);
     fontDescription.setOneFamily("Lucida Grande");

Modified: trunk/Source/WebCore/rendering/RenderThemeWin.cpp (176750 => 176751)


--- 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)
@@ -323,7 +323,6 @@
 static void fillFontDescription(FontDescription& fontDescription, LOGFONT& logFont, float fontSize)
 {    
     fontDescription.setIsAbsoluteSize(true);
-    fontDescription.setGenericFamily(FontDescription::NoFamily);
     fontDescription.setOneFamily(String(logFont.lfFaceName));
     fontDescription.setSpecifiedSize(fontSize);
     fontDescription.setWeight(logFont.lfWeight >= 700 ? FontWeightBold : FontWeightNormal); // FIXME: Use real weight.

Modified: trunk/Source/WebCore/style/StyleResolveForDocument.cpp (176750 => 176751)


--- 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)
@@ -99,11 +99,8 @@
     fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle.get().locale()));
     fontDescription.setUsePrinterFont(document.printing() || !settings.screenFontSubstitutionEnabled());
     fontDescription.setRenderingMode(settings.fontRenderingMode());
-    const AtomicString& standardFont = settings.standardFontFamily(fontDescription.script());
-    if (!standardFont.isEmpty()) {
-        fontDescription.setGenericFamily(FontDescription::StandardFamily);
-        fontDescription.setOneFamily(standardFont);
-    }
+    fontDescription.setOneFamily(standardFamily);
+
     fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
     int size = fontSizeForKeyword(CSSValueMedium, false, document);
     fontDescription.setSpecifiedSize(size);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to