Source/WebCore: <rdar://problem/9842889> Add a generic pictograph font family Add...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jul 2011 20:23:50 +0000 (20:23 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jul 2011 20:23:50 +0000 (20:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=65197

Reviewed by Anders Carlsson.

Test: fast/css/font-family-pictograph.html

* WebCore.exp.in: Export Settings::setPictographFontFamily().
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::identifierForFamily): Added -webkit-pictograph.
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule): Ditto.
(WebCore::fontDataForGenericFamily): Ditto.
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty): Ditto.
* css/CSSValueKeywords.in:
* inspector/front-end/CSSKeywordCompletions.js: Ditto.
* inspector/front-end/SourceCSSTokenizer.js: Ditto.
(WebInspector.SourceCSSTokenizer):
* inspector/front-end/SourceCSSTokenizer.re2js: Ditto.
* page/Settings.cpp:
(WebCore::Settings::pictographFontFamily): Added this getter.
(WebCore::Settings::setPictographFontFamily): Added this setter.
* page/Settings.h:
* platform/graphics/FontDescription.h: Added PictographFamily to the GenericFamilyType enum.

Source/WebKit/mac: <rdar://problem/9842889> Add a generic pictograph font family
https://bugs.webkit.org/show_bug.cgi?id=65197

Reviewed by Anders Carlsson.

* WebView/WebPreferenceKeysPrivate.h: Added WebKitPictographFontPreferenceKey.
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]): Set the default pictograph font family to
"Apple Color Emoji".
(-[WebPreferences pictographFontFamily]): Added this getter.
(-[WebPreferences setPictographFontFamily:]): Added this setter.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]): Pass the preference through to WebCore.

Source/WebKit/win: <rdar://problem/9842889> Add a generic pictograph font family
https://bugs.webkit.org/show_bug.cgi?id=65197

Reviewed by Anders Carlsson.

* Interfaces/IWebPreferences.idl: Added pictographFontFamily() and
setPictographFontFamily().
* WebPreferenceKeysPrivate.h: Added WebKitPictographFontPreferenceKey.
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings): Initialize the pictograph font
preference to "Times New Roman".
(WebPreferences::pictographFontFamily): Added this getter.
(WebPreferences::setPictographFontFamily): Added this setter.
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged): Pass the preference value through to
WebCore.

Source/WebKit2: <rdar://problem/9842889> Add a generic pictograph font family
https://bugs.webkit.org/show_bug.cgi?id=65197

Reviewed by Anders Carlsson.

* Shared/WebPreferencesStore.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPictographFontFamily): Added.
(WKPreferencesCopyPictographFontFamily): Added.
* UIProcess/API/C/WKPreferences.h:

LayoutTests: <rdar://problem/9842889> Add a generic pictograph font family Add a generic pictograph font family
https://bugs.webkit.org/show_bug.cgi?id=65197

Reviewed by Anders Carlsson.

* fast/css/font-family-pictograph.html: Added.
* platform/mac/fast/css/font-family-pictograph-expected.png: Added.
* platform/mac/fast/css/font-family-pictograph-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@91777 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/font-family-pictograph.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/font-family-pictograph-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/font-family-pictograph-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/inspector/front-end/CSSKeywordCompletions.js
Source/WebCore/inspector/front-end/SourceCSSTokenizer.js
Source/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/platform/graphics/FontDescription.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/Interfaces/IWebPreferences.idl
Source/WebKit/win/WebPreferenceKeysPrivate.h
Source/WebKit/win/WebPreferences.cpp
Source/WebKit/win/WebPreferences.h
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesStore.h
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferences.h

index 5a0778b..62f89c3 100644 (file)
@@ -1,3 +1,14 @@
+2011-07-26  Dan Bernstein  <mitz@apple.com>
+
+        <rdar://problem/9842889> Add a generic pictograph font family Add a generic pictograph font family
+        https://bugs.webkit.org/show_bug.cgi?id=65197
+
+        Reviewed by Anders Carlsson.
+
+        * fast/css/font-family-pictograph.html: Added.
+        * platform/mac/fast/css/font-family-pictograph-expected.png: Added.
+        * platform/mac/fast/css/font-family-pictograph-expected.txt: Added.
+
 2011-07-26  Adrienne Walker  <enne@google.com>
 
         [chromium] getClientRects now fails similarly on Mac after r91763.
diff --git a/LayoutTests/fast/css/font-family-pictograph.html b/LayoutTests/fast/css/font-family-pictograph.html
new file mode 100644 (file)
index 0000000..ea703fc
--- /dev/null
@@ -0,0 +1,3 @@
+<div style="font-size: 72px; font-family: -webkit-pictograph;">
+    &#x2665;
+</div>
diff --git a/LayoutTests/platform/mac/fast/css/font-family-pictograph-expected.png b/LayoutTests/platform/mac/fast/css/font-family-pictograph-expected.png
new file mode 100644 (file)
index 0000000..37129b0
Binary files /dev/null and b/LayoutTests/platform/mac/fast/css/font-family-pictograph-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/css/font-family-pictograph-expected.txt b/LayoutTests/platform/mac/fast/css/font-family-pictograph-expected.txt
new file mode 100644 (file)
index 0000000..d2b60b2
--- /dev/null
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 784x95
+        RenderText {#text} at (0,0) size 72x95
+          text run at (0,0) width 72: "\x{2665}"
index 7d5b78e..7edc3f0 100644 (file)
@@ -1,3 +1,31 @@
+2011-07-26  Dan Bernstein  <mitz@apple.com>
+
+        <rdar://problem/9842889> Add a generic pictograph font family Add a generic pictograph font family
+        https://bugs.webkit.org/show_bug.cgi?id=65197
+
+        Reviewed by Anders Carlsson.
+
+        Test: fast/css/font-family-pictograph.html
+
+        * WebCore.exp.in: Export Settings::setPictographFontFamily().
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::identifierForFamily): Added -webkit-pictograph.
+        * css/CSSFontSelector.cpp:
+        (WebCore::CSSFontSelector::addFontFaceRule): Ditto.
+        (WebCore::fontDataForGenericFamily): Ditto.
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applyProperty): Ditto.
+        * css/CSSValueKeywords.in:
+        * inspector/front-end/CSSKeywordCompletions.js: Ditto.
+        * inspector/front-end/SourceCSSTokenizer.js: Ditto.
+        (WebInspector.SourceCSSTokenizer):
+        * inspector/front-end/SourceCSSTokenizer.re2js: Ditto.
+        * page/Settings.cpp:
+        (WebCore::Settings::pictographFontFamily): Added this getter.
+        (WebCore::Settings::setPictographFontFamily): Added this setter.
+        * page/Settings.h:
+        * platform/graphics/FontDescription.h: Added PictographFamily to the GenericFamilyType enum.
+
 2011-07-26  Viet-Trung Luu  <viettrungluu@chromium.org>
 
         Improve (i.e., speed up) .gyp(i) files for Chromium
index a496881..d758c55 100644 (file)
@@ -884,6 +884,7 @@ __ZN7WebCore8Settings23setDefaultFixedFontSizeEi
 __ZN7WebCore8Settings23setEditableLinkBehaviorENS_20EditableLinkBehaviorE
 __ZN7WebCore8Settings23setLoadDeferringEnabledEb
 __ZN7WebCore8Settings23setNeedsTigerMailQuirksEb
+__ZN7WebCore8Settings23setPictographFontFamilyERKN3WTF12AtomicStringE11UScriptCode
 __ZN7WebCore8Settings23setPluginAllowedRunTimeEj
 __ZN7WebCore8Settings23setUsesEncodingDetectorEb
 __ZN7WebCore8Settings24setApplicationChromeModeEb
index 18c6300..5e710d7 100644 (file)
@@ -681,17 +681,20 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
 
 static int identifierForFamily(const AtomicString& family)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, cursiveFamily, ("-webkit-cursive")); 
-    DEFINE_STATIC_LOCAL(AtomicString, fantasyFamily, ("-webkit-fantasy")); 
-    DEFINE_STATIC_LOCAL(AtomicString, monospaceFamily, ("-webkit-monospace")); 
-    DEFINE_STATIC_LOCAL(AtomicString, sansSerifFamily, ("-webkit-sans-serif")); 
-    DEFINE_STATIC_LOCAL(AtomicString, serifFamily, ("-webkit-serif")); 
+    DEFINE_STATIC_LOCAL(AtomicString, cursiveFamily, ("-webkit-cursive"));
+    DEFINE_STATIC_LOCAL(AtomicString, fantasyFamily, ("-webkit-fantasy"));
+    DEFINE_STATIC_LOCAL(AtomicString, monospaceFamily, ("-webkit-monospace"));
+    DEFINE_STATIC_LOCAL(AtomicString, pictographFamily, ("-webkit-pictograph"));
+    DEFINE_STATIC_LOCAL(AtomicString, sansSerifFamily, ("-webkit-sans-serif"));
+    DEFINE_STATIC_LOCAL(AtomicString, serifFamily, ("-webkit-serif"));
     if (family == cursiveFamily)
         return CSSValueCursive;
     if (family == fantasyFamily)
         return CSSValueFantasy;
     if (family == monospaceFamily)
         return CSSValueMonospace;
+    if (family == pictographFamily)
+        return CSSValueWebkitPictograph;
     if (family == sansSerifFamily)
         return CSSValueSansSerif;
     if (family == serifFamily)
index 1bf4fca..f2a4125 100644 (file)
@@ -310,6 +310,9 @@ void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
                 case CSSValueMonospace:
                     familyName = "-webkit-monospace";
                     break;
+                case CSSValueWebkitPictograph:
+                    familyName = "-webkit-pictograph";
+                    break;
                 default:
                     break;
             }
@@ -399,6 +402,8 @@ static FontData* fontDataForGenericFamily(Document* document, const FontDescript
         genericFamily = settings->fantasyFontFamily();
     else if (familyName == "-webkit-monospace")
         genericFamily = settings->fixedFontFamily();
+    else if (familyName == "-webkit-pictograph")
+        genericFamily = settings->pictographFontFamily();
     else if (familyName == "-webkit-standard")
         genericFamily = settings->standardFontFamily();
 
index 6f08c0b..b75ecf5 100644 (file)
@@ -4213,6 +4213,10 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
                         face = "-webkit-monospace";
                         fontDescription.setGenericFamily(FontDescription::MonospaceFamily);
                         break;
+                    case CSSValueWebkitPictograph:
+                        face = "-webkit-pictograph";
+                        fontDescription.setGenericFamily(FontDescription::PictographFamily);
+                        break;
                 }
             }
 
index cd9b328..0535b5b 100644 (file)
@@ -104,6 +104,7 @@ cursive
 fantasy
 monospace
 -webkit-body
+-webkit-pictograph
 //
 //
 // CSS_PROP_*_COLOR
index 55a2ecf..bc5895e 100644 (file)
@@ -289,7 +289,7 @@ WebInspector.CSSKeywordCompletions._propertyKeywordMap = {
         "-webkit-control", "status-bar", "italic", "oblique", "small-caps", "normal", "bold", "bolder", "lighter",
         "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium",
         "large", "x-large", "xx-large", "-webkit-xxx-large", "smaller", "larger", "serif", "sans-serif", "cursive",
-        "fantasy", "monospace", "-webkit-body"
+        "fantasy", "monospace", "-webkit-body", "-webkit-pictograph"
     ],
     "dominant-baseline": [
         "middle", "auto", "central", "text-before-edge", "text-after-edge", "ideographic", "alphabetic", "hanging",
@@ -353,7 +353,7 @@ WebInspector.CSSKeywordCompletions._propertyKeywordMap = {
         "absolute", "fixed", "relative", "static"
     ],
     "font-family": [
-        "serif", "sans-serif", "cursive", "fantasy", "monospace", "-webkit-body"
+        "serif", "sans-serif", "cursive", "fantasy", "monospace", "-webkit-body", "-webkit-pictograph"
     ],
     "text-overflow-mode": [
         "clip", "ellipsis"
index 8d3c5af..b93a877 100644 (file)
@@ -93,8 +93,8 @@ WebInspector.SourceCSSTokenizer = function()
         "visibleFill", "visiblePainted", "visibleStroke", "visual", "w-resize", "wait", "wave", "white", "wider", "window", "windowframe", "windowtext",
         "x-large", "x-small", "xor", "xx-large", "xx-small", "yellow", "-wap-marquee", "-webkit-activelink", "-webkit-auto", "-webkit-baseline-middle",
         "-webkit-body", "-webkit-box", "-webkit-center", "-webkit-control", "-webkit-focus-ring-color", "-webkit-grab", "-webkit-grabbing",
-        "-webkit-gradient", "-webkit-inline-box", "-webkit-left", "-webkit-link", "-webkit-marquee", "-webkit-mini-control", "-webkit-nowrap", "-webkit-right",
-        "-webkit-small-control", "-webkit-text", "-webkit-xxx-large", "-webkit-zoom-in", "-webkit-zoom-out",
+        "-webkit-gradient", "-webkit-inline-box", "-webkit-left", "-webkit-link", "-webkit-marquee", "-webkit-mini-control", "-webkit-nowrap", "-webkit-pictograph",
+        "-webkit-right", "-webkit-small-control", "-webkit-text", "-webkit-xxx-large", "-webkit-zoom-in", "-webkit-zoom-out",
     ].keySet();
 
     this._mediaTypes = ["all", "aural", "braille", "embossed", "handheld", "import", "print", "projection", "screen", "tty", "tv"].keySet();
index eefbb47..414f70e 100644 (file)
@@ -92,8 +92,8 @@ WebInspector.SourceCSSTokenizer = function()
         "visibleFill", "visiblePainted", "visibleStroke", "visual", "w-resize", "wait", "wave", "white", "wider", "window", "windowframe", "windowtext",
         "x-large", "x-small", "xor", "xx-large", "xx-small", "yellow", "-wap-marquee", "-webkit-activelink", "-webkit-auto", "-webkit-baseline-middle",
         "-webkit-body", "-webkit-box", "-webkit-center", "-webkit-control", "-webkit-focus-ring-color", "-webkit-grab", "-webkit-grabbing",
-        "-webkit-gradient", "-webkit-inline-box", "-webkit-left", "-webkit-link", "-webkit-marquee", "-webkit-mini-control", "-webkit-nowrap", "-webkit-right",
-        "-webkit-small-control", "-webkit-text", "-webkit-xxx-large", "-webkit-zoom-in", "-webkit-zoom-out",
+        "-webkit-gradient", "-webkit-inline-box", "-webkit-left", "-webkit-link", "-webkit-marquee", "-webkit-mini-control", "-webkit-nowrap", "-webkit-pictograph",
+        "-webkit-right", "-webkit-small-control", "-webkit-text", "-webkit-xxx-large", "-webkit-zoom-in", "-webkit-zoom-out",
     ].keySet();
 
     this._mediaTypes = ["all", "aural", "braille", "embossed", "handheld", "import", "print", "projection", "screen", "tty", "tv"].keySet();
index 4cebc36..c40b7ad 100644 (file)
@@ -275,6 +275,16 @@ void Settings::setFantasyFontFamily(const AtomicString& family, UScriptCode scri
     setGenericFontFamilyMap(m_fantasyFontFamilyMap, family, script, m_page);
 }
 
+const AtomicString& Settings::pictographFontFamily(UScriptCode script) const
+{
+    return getGenericFontFamilyForScript(m_pictographFontFamilyMap, script);
+}
+
+void Settings::setPictographFontFamily(const AtomicString& family, UScriptCode script)
+{
+    setGenericFontFamilyMap(m_pictographFontFamilyMap, family, script, m_page);
+}
+
 void Settings::setMinimumFontSize(int minimumFontSize)
 {
     if (m_minimumFontSize == minimumFontSize)
index 1348977..b5a06c5 100644 (file)
@@ -88,6 +88,9 @@ namespace WebCore {
         void setFantasyFontFamily(const AtomicString&, UScriptCode = USCRIPT_COMMON);
         const AtomicString& fantasyFontFamily(UScriptCode = USCRIPT_COMMON) const;
 
+        void setPictographFontFamily(const AtomicString&, UScriptCode = USCRIPT_COMMON);
+        const AtomicString& pictographFontFamily(UScriptCode = USCRIPT_COMMON) const;
+
         void setMinimumFontSize(int);
         int minimumFontSize() const { return m_minimumFontSize; }
 
@@ -462,6 +465,7 @@ namespace WebCore {
         ScriptFontFamilyMap m_sansSerifFontFamilyMap;
         ScriptFontFamilyMap m_cursiveFontFamilyMap;
         ScriptFontFamilyMap m_fantasyFontFamilyMap;
+        ScriptFontFamilyMap m_pictographFontFamilyMap;
         EditableLinkBehavior m_editableLinkBehavior;
         TextDirectionSubmenuInclusionBehavior m_textDirectionSubmenuInclusionBehavior;
         int m_minimumFontSize;
index 908eba2..5d53388 100644 (file)
@@ -64,7 +64,7 @@ enum FontSmallCaps {
 class FontDescription {
 public:
     enum GenericFamilyType { NoFamily, StandardFamily, SerifFamily, SansSerifFamily, 
-                             MonospaceFamily, CursiveFamily, FantasyFamily };
+                             MonospaceFamily, CursiveFamily, FantasyFamily, PictographFamily };
 
     FontDescription()
         : m_specifiedSize(0)
index f7dc548..c0e4054 100644 (file)
@@ -1,3 +1,20 @@
+2011-07-26  Dan Bernstein  <mitz@apple.com>
+
+        <rdar://problem/9842889> Add a generic pictograph font family
+        https://bugs.webkit.org/show_bug.cgi?id=65197
+
+        Reviewed by Anders Carlsson.
+
+        * WebView/WebPreferenceKeysPrivate.h: Added WebKitPictographFontPreferenceKey.
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]): Set the default pictograph font family to
+        "Apple Color Emoji".
+        (-[WebPreferences pictographFontFamily]): Added this getter.
+        (-[WebPreferences setPictographFontFamily:]): Added this setter.
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]): Pass the preference through to WebCore.
+
 2011-07-25  Ian Henderson  <ianh@apple.com>
 
         WebFrame should have a method to determine its visual emptiness
index f8a426c..bd58039 100644 (file)
@@ -36,6 +36,7 @@
 #define WebKitSansSerifFontPreferenceKey @"WebKitSansSerifFont"
 #define WebKitCursiveFontPreferenceKey @"WebKitCursiveFont"
 #define WebKitFantasyFontPreferenceKey @"WebKitFantasyFont"
+#define WebKitPictographFontPreferenceKey @"WebKitPictographFont"
 #define WebKitMinimumFontSizePreferenceKey @"WebKitMinimumFontSize"
 #define WebKitMinimumLogicalFontSizePreferenceKey @"WebKitMinimumLogicalFontSize"
 #define WebKitDefaultFontSizePreferenceKey @"WebKitDefaultFontSize"
index b5e517a..9d3aa4c 100644 (file)
@@ -306,6 +306,7 @@ static WebCacheModel cacheModelForMainBundle(void)
         @"Helvetica",                   WebKitSansSerifFontPreferenceKey,
         @"Apple Chancery",              WebKitCursiveFontPreferenceKey,
         @"Papyrus",                     WebKitFantasyFontPreferenceKey,
+        @"Apple Color Emoji",           WebKitPictographFontPreferenceKey,
         @"0",                           WebKitMinimumFontSizePreferenceKey,
         @"9",                           WebKitMinimumLogicalFontSizePreferenceKey, 
         @"16",                          WebKitDefaultFontSizePreferenceKey,
@@ -1506,6 +1507,17 @@ static NSString *classIBCreatorID = nil;
 {
     [self _setBoolValue:flag forKey:WebKitMediaPlaybackAllowsInlinePreferenceKey];
 }
+
+- (NSString *)pictographFontFamily
+{
+    return [self _stringValueForKey: WebKitPictographFontPreferenceKey];
+}
+
+- (void)setPictographFontFamily:(NSString *)family
+{
+    [self _setStringValue: family forKey: WebKitPictographFontPreferenceKey];
+}
+
 @end
 
 @implementation WebPreferences (WebInternal)
index 9f0dee6..9d67a85 100644 (file)
@@ -216,6 +216,9 @@ extern NSString *WebPreferencesChangedInternalNotification;
 - (void)setMediaPlaybackAllowsInline:(BOOL)flag;
 - (BOOL)mediaPlaybackAllowsInline;
 
+- (NSString *)pictographFontFamily;
+- (void)setPictographFontFamily:(NSString *)family;
+
 // Other private methods
 - (void)_postPreferencesChangedNotification;
 - (void)_postPreferencesChangedAPINotification;
index a58fd7a..a70dc6b 100644 (file)
@@ -1509,6 +1509,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
     settings->setJavaScriptCanOpenWindowsAutomatically([preferences javaScriptCanOpenWindowsAutomatically]);
     settings->setMinimumFontSize([preferences minimumFontSize]);
     settings->setMinimumLogicalFontSize([preferences minimumLogicalFontSize]);
+    settings->setPictographFontFamily([preferences pictographFontFamily]);
     settings->setPluginsEnabled([preferences arePlugInsEnabled]);
 #if ENABLE(DATABASE)
     AbstractDatabase::setIsAvailable([preferences databasesEnabled]);
index 4f26aff..4e629bb 100644 (file)
@@ -1,3 +1,23 @@
+2011-07-26  Dan Bernstein  <mitz@apple.com>
+
+        <rdar://problem/9842889> Add a generic pictograph font family
+        https://bugs.webkit.org/show_bug.cgi?id=65197
+
+        Reviewed by Anders Carlsson.
+
+        * Interfaces/IWebPreferences.idl: Added pictographFontFamily() and
+        setPictographFontFamily().
+        * WebPreferenceKeysPrivate.h: Added WebKitPictographFontPreferenceKey.
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings): Initialize the pictograph font
+        preference to "Times New Roman".
+        (WebPreferences::pictographFontFamily): Added this getter.
+        (WebPreferences::setPictographFontFamily): Added this setter.
+        * WebPreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged): Pass the preference value through to
+        WebCore.
+
 2011-07-18  Dean Jackson  <dino@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=64742
index dd7f282..782fc17 100644 (file)
@@ -98,6 +98,9 @@ interface IWebPreferences : IUnknown
     HRESULT fantasyFontFamily([out, retval] BSTR* family);
     HRESULT setFantasyFontFamily([in] BSTR family);
 
+    HRESULT pictographFontFamily([out, retval] BSTR* family);
+    HRESULT setPictographFontFamily([in] BSTR family);
+
     HRESULT defaultFontSize([out, retval] int* fontSize);
     HRESULT setDefaultFontSize([in] int fontSize);
 
index 639c18f..4e315b5 100644 (file)
@@ -36,6 +36,7 @@
 #define WebKitSansSerifFontPreferenceKey "WebKitSansSerifFont"
 #define WebKitCursiveFontPreferenceKey "WebKitCursiveFont"
 #define WebKitFantasyFontPreferenceKey "WebKitFantasyFont"
+#define WebKitPictographFontPreferenceKey "WebKitPictographFont"
 #define WebKitMinimumFontSizePreferenceKey "WebKitMinimumFontSize"
 #define WebKitMinimumLogicalFontSizePreferenceKey "WebKitMinimumLogicalFontSize"
 #define WebKitDefaultFontSizePreferenceKey "WebKitDefaultFontSize"
index 4fa5f2d..a556d11 100644 (file)
@@ -189,6 +189,7 @@ void WebPreferences::initializeDefaultSettings()
     CFDictionaryAddValue(defaults, CFSTR(WebKitSansSerifFontPreferenceKey), CFSTR("Arial"));
     CFDictionaryAddValue(defaults, CFSTR(WebKitCursiveFontPreferenceKey), CFSTR("Comic Sans MS"));
     CFDictionaryAddValue(defaults, CFSTR(WebKitFantasyFontPreferenceKey), CFSTR("Comic Sans MS"));
+    CFDictionaryAddValue(defaults, CFSTR(WebKitPictographFontPreferenceKey), CFSTR("Times New Roman"));
     CFDictionaryAddValue(defaults, CFSTR(WebKitMinimumFontSizePreferenceKey), CFSTR("0"));
     CFDictionaryAddValue(defaults, CFSTR(WebKitMinimumLogicalFontSizePreferenceKey), CFSTR("9"));
     CFDictionaryAddValue(defaults, CFSTR(WebKitDefaultFontSizePreferenceKey), CFSTR("16"));
@@ -652,6 +653,20 @@ HRESULT STDMETHODCALLTYPE WebPreferences::setFantasyFontFamily(
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE WebPreferences::pictographFontFamily( 
+    /* [retval][out] */ BSTR* family)
+{
+    *family = stringValueForKey(CFSTR(WebKitPictographFontPreferenceKey));
+    return (*family) ? S_OK : E_FAIL;
+}
+
+HRESULT STDMETHODCALLTYPE WebPreferences::setPictographFontFamily( 
+    /* [in] */ BSTR family)
+{
+    setStringValue(CFSTR(WebKitPictographFontPreferenceKey), family);
+    return S_OK;
+}
+
 HRESULT STDMETHODCALLTYPE WebPreferences::defaultFontSize( 
     /* [retval][out] */ int* fontSize)
 {
index 9cbc230..d925f81 100644 (file)
@@ -91,6 +91,12 @@ public:
     virtual HRESULT STDMETHODCALLTYPE setFantasyFontFamily( 
         /* [in] */ BSTR family);
     
+    virtual HRESULT STDMETHODCALLTYPE pictographFontFamily( 
+        /* [retval][out] */ BSTR* family);
+    
+    virtual HRESULT STDMETHODCALLTYPE setPictographFontFamily( 
+        /* [in] */ BSTR family);
+    
     virtual HRESULT STDMETHODCALLTYPE defaultFontSize( 
         /* [retval][out] */ int* fontSize);
     
index fa75874..4e78dda 100644 (file)
@@ -4577,6 +4577,12 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
     settings->setFixedFontFamily(AtomicString(str, SysStringLen(str)));
     SysFreeString(str);
 
+    hr = preferences->pictographFontFamily(&str);
+    if (FAILED(hr))
+        return hr;
+    settings->setPictographFontFamily(AtomicString(str, SysStringLen(str)));
+    SysFreeString(str);
+
     hr = preferences->isJavaEnabled(&enabled);
     if (FAILED(hr))
         return hr;
index d347d95..aa516b4 100644 (file)
@@ -1,3 +1,16 @@
+2011-07-26  Dan Bernstein  <mitz@apple.com>
+
+        <rdar://problem/9842889> Add a generic pictograph font family
+        https://bugs.webkit.org/show_bug.cgi?id=65197
+
+        Reviewed by Anders Carlsson.
+
+        * Shared/WebPreferencesStore.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetPictographFontFamily): Added.
+        (WKPreferencesCopyPictographFontFamily): Added.
+        * UIProcess/API/C/WKPreferences.h:
+
 2011-07-26  Andras Becsi  <abecsi@webkit.org>
 
         [Qt] [WK2] Disable the build with Qt versions older than 5.0 
index f96dbc9..3373b3f 100644 (file)
@@ -109,6 +109,7 @@ namespace WebKit {
     macro(FixedFontFamily, fixedFontFamily, String, String, "Courier New") \
     macro(SansSerifFontFamily, sansSerifFontFamily, String, String, "Arial") \
     macro(SerifFontFamily, serifFontFamily, String, String, "Times New Roman") \
+    macro(PictographFontFamily, pictographFontFamily, String, String, "Times New Roman") \
     \
 
 #elif PLATFORM(MAC)
@@ -120,6 +121,7 @@ namespace WebKit {
     macro(FixedFontFamily, fixedFontFamily, String, String, "Courier") \
     macro(SansSerifFontFamily, sansSerifFontFamily, String, String, "Helvetica") \
     macro(SerifFontFamily, serifFontFamily, String, String, "Times") \
+    macro(PictographFontFamily, pictographFontFamily, String, String, "Apple Color Emoji") \
     \
 
 #elif PLATFORM(QT) || PLATFORM(GTK)
index 4810404..55a2e02 100644 (file)
@@ -232,6 +232,16 @@ WKStringRef WKPreferencesCopyFantasyFontFamily(WKPreferencesRef preferencesRef)
     return toCopiedAPI(toImpl(preferencesRef)->fantasyFontFamily());
 }
 
+void WKPreferencesSetPictographFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
+{
+    toImpl(preferencesRef)->setPictographFontFamily(toWTFString(family));
+}
+
+WKStringRef WKPreferencesCopyPictographFontFamily(WKPreferencesRef preferencesRef)
+{
+    return toCopiedAPI(toImpl(preferencesRef)->pictographFontFamily());
+}
+
 void WKPreferencesSetDefaultFontSize(WKPreferencesRef preferencesRef, uint32_t size)
 {
     toImpl(preferencesRef)->setDefaultFontSize(size);
index 4e8e6ba..a336109 100644 (file)
@@ -107,6 +107,9 @@ WK_EXPORT WKStringRef WKPreferencesCopyCursiveFontFamily(WKPreferencesRef prefer
 WK_EXPORT void WKPreferencesSetFantasyFontFamily(WKPreferencesRef preferencesRef, WKStringRef family);
 WK_EXPORT WKStringRef WKPreferencesCopyFantasyFontFamily(WKPreferencesRef preferencesRef);
 
+WK_EXPORT void WKPreferencesSetPictographFontFamily(WKPreferencesRef preferencesRef, WKStringRef family);
+WK_EXPORT WKStringRef WKPreferencesCopyPictographFontFamily(WKPreferencesRef preferencesRef);
+
 // Defaults to 16.
 WK_EXPORT void WKPreferencesSetDefaultFontSize(WKPreferencesRef preferencesRef, uint32_t);
 WK_EXPORT uint32_t WKPreferencesGetDefaultFontSize(WKPreferencesRef preferencesRef);