Title: [176790] trunk/Source/WebCore
Revision
176790
Author
[email protected]
Date
2014-12-04 06:09:57 -0800 (Thu, 04 Dec 2014)

Log Message

Unreviewed, rolling out r176789.
https://bugs.webkit.org/show_bug.cgi?id=139255

Broke the non Mac-WK2 builds (Requested by stavila on
#webkit).

Reverted changeset:

"Remove isSpecifiedFont boolean from FontDescription"
https://bugs.webkit.org/show_bug.cgi?id=139233
http://trac.webkit.org/changeset/176789

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (176789 => 176790)


--- trunk/Source/WebCore/ChangeLog	2014-12-04 11:50:26 UTC (rev 176789)
+++ trunk/Source/WebCore/ChangeLog	2014-12-04 14:09:57 UTC (rev 176790)
@@ -1,3 +1,17 @@
+2014-12-04  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r176789.
+        https://bugs.webkit.org/show_bug.cgi?id=139255
+
+        Broke the non Mac-WK2 builds (Requested by stavila on
+        #webkit).
+
+        Reverted changeset:
+
+        "Remove isSpecifiedFont boolean from FontDescription"
+        https://bugs.webkit.org/show_bug.cgi?id=139233
+        http://trac.webkit.org/changeset/176789
+
 2014-12-03  Antti Koivisto  <[email protected]>
 
         Remove isSpecifiedFont boolean from FontDescription

Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (176789 => 176790)


--- trunk/Source/WebCore/css/StyleBuilderCustom.h	2014-12-04 11:50:26 UTC (rev 176789)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h	2014-12-04 14:09:57 UTC (rev 176790)
@@ -911,6 +911,7 @@
     FontDescription parentFontDescription = styleResolver.parentStyle()->fontDescription();
 
     fontDescription.setFamilies(parentFontDescription.families());
+    fontDescription.setIsSpecifiedFont(parentFontDescription.isSpecifiedFont());
     styleResolver.setFontDescription(fontDescription);
 }
 
@@ -928,6 +929,7 @@
     for (auto& item : valueList) {
         auto& contentValue = downcast<CSSPrimitiveValue>(item.get());
         AtomicString family;
+        bool isGenericFamily = false;
         if (contentValue.isString())
             family = contentValue.getStringValue();
         else {
@@ -938,28 +940,37 @@
                 break;
             case CSSValueSerif:
                 family = serifFamily;
+                isGenericFamily = true;
                 break;
             case CSSValueSansSerif:
                 family = sansSerifFamily;
+                isGenericFamily = true;
                 break;
             case CSSValueCursive:
                 family = cursiveFamily;
+                isGenericFamily = true;
                 break;
             case CSSValueFantasy:
                 family = fantasyFamily;
+                isGenericFamily = true;
                 break;
             case CSSValueMonospace:
                 family = monospaceFamily;
+                isGenericFamily = true;
                 break;
             case CSSValueWebkitPictograph:
                 family = pictographFamily;
+                isGenericFamily = true;
                 break;
             default:
                 break;
             }
         }
+
         if (family.isEmpty())
             continue;
+        if (families.isEmpty())
+            fontDescription.setIsSpecifiedFont(!isGenericFamily);
         families.uncheckedAppend(family);
     }
 

Modified: trunk/Source/WebCore/platform/graphics/FontDescription.cpp (176789 => 176790)


--- trunk/Source/WebCore/platform/graphics/FontDescription.cpp	2014-12-04 11:50:26 UTC (rev 176789)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.cpp	2014-12-04 14:09:57 UTC (rev 176790)
@@ -30,10 +30,6 @@
 #include "config.h"
 #include "FontDescription.h"
 
-#include <wtf/HashSet.h>
-#include <wtf/NeverDestroyed.h>
-#include <wtf/text/AtomicStringHash.h>
-
 namespace WebCore {
 
 struct SameSizeAsFontDescription {
@@ -105,29 +101,6 @@
     return normalDescription;
 }
 
-static const HashSet<AtomicString>& genericFamiliesSet()
-{
-    static NeverDestroyed<HashSet<AtomicString>> set;
-    if (set.get().isEmpty()) {
-        set.get().add(cursiveFamily);
-        set.get().add(fantasyFamily);
-        set.get().add(monospaceFamily);
-        set.get().add(pictographFamily);
-        set.get().add(sansSerifFamily);
-        set.get().add(serifFamily);
-        set.get().add(standardFamily);
-    }
-    return set.get();
-}
-
-bool FontDescription::hasGenericFirstFamily() const
-{
-    auto& family = firstFamily();
-    if (family.isNull())
-        return false;
-    return genericFamiliesSet().contains(family);
-}
-
 #if ENABLE(IOS_TEXT_AUTOSIZING)
 bool FontDescription::familiesEqualForTextAutoSizing(const FontDescription& other) const
 {

Modified: trunk/Source/WebCore/platform/graphics/FontDescription.h (176789 => 176790)


--- trunk/Source/WebCore/platform/graphics/FontDescription.h	2014-12-04 11:50:26 UTC (rev 176789)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.h	2014-12-04 14:09:57 UTC (rev 176790)
@@ -93,6 +93,7 @@
         , m_keywordSize(0)
         , m_fontSmoothing(AutoSmoothing)
         , m_textRendering(AutoTextRendering)
+        , m_isSpecifiedFont(false)
         , m_script(USCRIPT_COMMON)
     {
     }
@@ -126,9 +127,9 @@
     FontSmoothingMode fontSmoothing() const { return static_cast<FontSmoothingMode>(m_fontSmoothing); }
     TextRenderingMode textRenderingMode() const { return static_cast<TextRenderingMode>(m_textRendering); }
     UScriptCode script() const { return static_cast<UScriptCode>(m_script); }
-    bool hasGenericFirstFamily() const;
 
     FontTraitsMask traitsMask() const;
+    bool isSpecifiedFont() const { return m_isSpecifiedFont; }
     FontOrientation orientation() const { return static_cast<FontOrientation>(m_orientation); }
     NonCJKGlyphOrientation nonCJKGlyphOrientation() const { return static_cast<NonCJKGlyphOrientation>(m_nonCJKGlyphOrientation); }
     FontWidthVariant widthVariant() const { return static_cast<FontWidthVariant>(m_widthVariant); }
@@ -155,6 +156,7 @@
     void setKeywordSize(unsigned s) { m_keywordSize = s; }
     void setFontSmoothing(FontSmoothingMode smoothing) { m_fontSmoothing = smoothing; }
     void setTextRenderingMode(TextRenderingMode rendering) { m_textRendering = rendering; }
+    void setIsSpecifiedFont(bool isSpecifiedFont) { m_isSpecifiedFont = isSpecifiedFont; }
     void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
     void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { m_nonCJKGlyphOrientation = orientation; }
     void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; }
@@ -207,6 +209,7 @@
 
     unsigned m_fontSmoothing : 2; // FontSmoothingMode
     unsigned m_textRendering : 2; // TextRenderingMode
+    unsigned m_isSpecifiedFont : 1; // True if a web page specifies a non-generic font family as the first font family.
     unsigned m_script : 7; // Used to help choose an appropriate font for generic font families.
 };
 
@@ -228,6 +231,7 @@
         && m_keywordSize == other.m_keywordSize
         && m_fontSmoothing == other.m_fontSmoothing
         && m_textRendering == other.m_textRendering
+        && m_isSpecifiedFont == other.m_isSpecifiedFont
         && m_orientation == other.m_orientation
         && m_nonCJKGlyphOrientation == other.m_nonCJKGlyphOrientation
         && m_widthVariant == other.m_widthVariant

Modified: trunk/Source/WebCore/rendering/RenderText.cpp (176789 => 176790)


--- trunk/Source/WebCore/rendering/RenderText.cpp	2014-12-04 11:50:26 UTC (rev 176789)
+++ trunk/Source/WebCore/rendering/RenderText.cpp	2014-12-04 14:09:57 UTC (rev 176790)
@@ -213,11 +213,15 @@
 bool RenderText::computeUseBackslashAsYenSymbol() const
 {
     const RenderStyle& style = this->style();
+    const FontDescription& fontDescription = style.font().fontDescription();
     if (style.font().useBackslashAsYenSymbol())
         return true;
-    if (!document().decoder() || document().decoder()->encoding().backslashAsCurrencySymbol() == '\\')
+    if (fontDescription.isSpecifiedFont())
         return false;
-    return style.font().fontDescription().hasGenericFirstFamily() || style.font().primaryFontDataIsSystemFont();
+    const TextEncoding* encoding = document().decoder() ? &document().decoder()->encoding() : 0;
+    if (encoding && encoding->backslashAsCurrencySymbol() != '\\')
+        return true;
+    return false;
 }
 
 void RenderText::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to