| Differences between
and this patch
- a/Source/WebCore/ChangeLog +43 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-02-22  Matt Falkenhagen  <falken@chromium.org>
2
3
        Add per-script font settings to InternalSettings
4
        https://bugs.webkit.org/show_bug.cgi?id=78184
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        This adds per-script font settings to InternalSettings, so it can be used in layout tests instead of
9
        DumpRenderTree overridePreference, which has only been implemented for Chromium so far.
10
11
        Test: changed fast/text/international/locale-sensitive-fonts.html to use InternalSettings
12
        instead of overridePreference.
13
14
        * WebCore.exp.in: Export scriptNameToCode symbol.
15
        * platform/text/LocaleToScriptMapping.h: 
16
        (WebCore): Add scriptNameToCode
17
        * platform/text/LocaleToScriptMappingDefault.cpp:
18
        (WebCore::scriptNameToCode):
19
        (WebCore::localeToScriptCodeForFontSelection):
20
        * platform/text/LocaleToScriptMappingICU.cpp:
21
        (WebCore::scriptNameToCode):
22
        (WebCore):
23
        * testing/InternalSettings.cpp: Add per-script font settings.
24
        (WebCore::setStandardFontFamilyWrapper):
25
        (WebCore):
26
        (WebCore::setSerifFontFamilyWrapper):
27
        (WebCore::setSansSerifFontFamilyWrapper):
28
        (WebCore::setFixedFontFamilyWrapper):
29
        (WebCore::setCursiveFontFamilyWrapper):
30
        (WebCore::setFantasyFontFamilyWrapper):
31
        (WebCore::setPictographFontFamilyWrapper):
32
        (WebCore::InternalSettings::setFontFamily):
33
        (WebCore::InternalSettings::setStandardFontFamily):
34
        (WebCore::InternalSettings::setSerifFontFamily):
35
        (WebCore::InternalSettings::setSansSerifFontFamily):
36
        (WebCore::InternalSettings::setFixedFontFamily):
37
        (WebCore::InternalSettings::setCursiveFontFamily):
38
        (WebCore::InternalSettings::setFantasyFontFamily):
39
        (WebCore::InternalSettings::setPictographFontFamily):
40
        * testing/InternalSettings.h:
41
        (InternalSettings):
42
        * testing/InternalSettings.idl:
43
1
2012-02-22  Kentaro Hara  <haraken@chromium.org>
44
2012-02-22  Kentaro Hara  <haraken@chromium.org>
2
45
3
        Enable Geolocation bindings for GObject
46
        Enable Geolocation bindings for GObject
- a/Source/WebCore/WebCore.exp.in +1 lines
Lines 534-539 __ZN7WebCore16deleteAllCookiesEv a/Source/WebCore/WebCore.exp.in_sec1
534
__ZN7WebCore16enclosingIntRectERK7_NSRect
534
__ZN7WebCore16enclosingIntRectERK7_NSRect
535
__ZN7WebCore16enclosingIntRectERKNS_9FloatRectE
535
__ZN7WebCore16enclosingIntRectERKNS_9FloatRectE
536
__ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE
536
__ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE
537
__ZN7WebCore16scriptNameToCodeERKN3WTF6StringE
537
__ZN7WebCore16startOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE
538
__ZN7WebCore16startOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE
538
__ZN7WebCore17CredentialStorage24getFromPersistentStorageERKNS_15ProtectionSpaceE
539
__ZN7WebCore17CredentialStorage24getFromPersistentStorageERKNS_15ProtectionSpaceE
539
__ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE
540
__ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE
- a/Source/WebCore/platform/text/LocaleToScriptMapping.h -1 / +2 lines
Lines 36-42 a/Source/WebCore/platform/text/LocaleToScriptMapping.h_sec1
36
36
37
namespace WebCore {
37
namespace WebCore {
38
38
39
UScriptCode localeToScriptCodeForFontSelection(const String& locale);
39
UScriptCode localeToScriptCodeForFontSelection(const String&);
40
UScriptCode scriptNameToCode(const String&);
40
41
41
}
42
}
42
43
- a/Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp -3 / +3 lines
Lines 37-43 a/Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp_sec1
37
37
38
namespace WebCore {
38
namespace WebCore {
39
39
40
static UScriptCode getScriptCode(const String& scriptName)
40
UScriptCode scriptNameToCode(const String& scriptName)
41
{
41
{
42
    struct ScriptNameCode {
42
    struct ScriptNameCode {
43
        const char* name;
43
        const char* name;
Lines 158-164 static UScriptCode getScriptCode(const String& scriptName) a/Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp_sec2
158
            scriptNameCodeMap.set(scriptNameCodeList[i].name, scriptNameCodeList[i].code);
158
            scriptNameCodeMap.set(scriptNameCodeList[i].name, scriptNameCodeList[i].code);
159
    }
159
    }
160
160
161
    HashMap<String, UScriptCode>::iterator it = scriptNameCodeMap.find(scriptName);
161
    HashMap<String, UScriptCode>::iterator it = scriptNameCodeMap.find(scriptName.lower());
162
    if (it != scriptNameCodeMap.end())
162
    if (it != scriptNameCodeMap.end())
163
        return it->second;
163
        return it->second;
164
    return USCRIPT_INVALID_CODE;
164
    return USCRIPT_INVALID_CODE;
Lines 387-393 UScriptCode localeToScriptCodeForFontSelection(const String& locale) a/Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp_sec3
387
        size_t pos = canonicalLocale.reverseFind('_');
387
        size_t pos = canonicalLocale.reverseFind('_');
388
        if (pos == notFound)
388
        if (pos == notFound)
389
            break;
389
            break;
390
        UScriptCode code = getScriptCode(canonicalLocale.substring(pos + 1));
390
        UScriptCode code = scriptNameToCode(canonicalLocale.substring(pos + 1));
391
        if (code != USCRIPT_INVALID_CODE && code != USCRIPT_UNKNOWN)
391
        if (code != USCRIPT_INVALID_CODE && code != USCRIPT_UNKNOWN)
392
            return code;
392
            return code;
393
        canonicalLocale = canonicalLocale.substring(0, pos);
393
        canonicalLocale = canonicalLocale.substring(0, pos);
- a/Source/WebCore/platform/text/LocaleToScriptMappingICU.cpp +8 lines
Lines 77-80 UScriptCode localeToScriptCodeForFontSelection(const String& locale) a/Source/WebCore/platform/text/LocaleToScriptMappingICU.cpp_sec1
77
    return scriptCodeForFontSelection(scriptCode);
77
    return scriptCodeForFontSelection(scriptCode);
78
}
78
}
79
79
80
UScriptCode scriptNameToCode(const String& name)
81
{
82
    int32_t code = u_getPropertyValueEnum(UCHAR_SCRIPT, name.utf8().data());
83
    if (code >= 0 && code < USCRIPT_CODE_LIMIT)
84
        return static_cast<UScriptCode>(code);
85
    return USCRIPT_INVALID_CODE;
86
}
87
80
} // namespace WebCore
88
} // namespace WebCore
- a/Source/WebCore/testing/InternalSettings.cpp +85 lines
Lines 33-38 a/Source/WebCore/testing/InternalSettings.cpp_sec1
33
#include "FrameView.h"
33
#include "FrameView.h"
34
#include "InspectorController.h"
34
#include "InspectorController.h"
35
#include "Language.h"
35
#include "Language.h"
36
#include "LocaleToScriptMapping.h"
36
#include "Page.h"
37
#include "Page.h"
37
#include "Settings.h"
38
#include "Settings.h"
38
39
Lines 231-234 void InternalSettings::setTouchEventEmulationEnabled(bool enabled, ExceptionCode a/Source/WebCore/testing/InternalSettings.cpp_sec2
231
#endif
232
#endif
232
}
233
}
233
234
235
static void setStandardFontFamilyWrapper(Settings* settings, const String& family, UScriptCode code)
236
{
237
    settings->setStandardFontFamily(family, code);
238
}
239
240
static void setSerifFontFamilyWrapper(Settings* settings, const String& family, UScriptCode code)
241
{
242
    settings->setSerifFontFamily(family, code);
243
}
244
245
static void setSansSerifFontFamilyWrapper(Settings* settings, const String& family, UScriptCode code)
246
{
247
    settings->setSansSerifFontFamily(family, code);
248
}
249
250
static void setFixedFontFamilyWrapper(Settings* settings, const String& family, UScriptCode code)
251
{
252
    settings->setFixedFontFamily(family, code);
253
}
254
255
static void setCursiveFontFamilyWrapper(Settings* settings, const String& family, UScriptCode code)
256
{
257
    settings->setCursiveFontFamily(family, code);
258
}
259
260
static void setFantasyFontFamilyWrapper(Settings* settings, const String& family, UScriptCode code)
261
{
262
    settings->setFantasyFontFamily(family, code);
263
}
264
265
static void setPictographFontFamilyWrapper(Settings* settings, const String& family, UScriptCode code)
266
{
267
    settings->setPictographFontFamily(family, code);
268
}
269
270
void InternalSettings::setFontFamily(const String& family, const String& script, SetFontFamilyWrapper setter)
271
{
272
    UScriptCode code = scriptNameToCode(script);
273
    if (code != USCRIPT_INVALID_CODE)
274
        (*setter)(settings(), family, code);
275
}
276
277
void InternalSettings::setStandardFontFamily(const String& family, const String& script, ExceptionCode& ec)
278
{
279
    InternalSettingsGuardForSettings();
280
    setFontFamily(family, script, setStandardFontFamilyWrapper);
281
}
282
283
void InternalSettings::setSerifFontFamily(const String& family, const String& script, ExceptionCode& ec)
284
{
285
    InternalSettingsGuardForSettings();
286
    setFontFamily(family, script, setSerifFontFamilyWrapper);
287
}
288
289
void InternalSettings::setSansSerifFontFamily(const String& family, const String& script, ExceptionCode& ec)
290
{
291
    InternalSettingsGuardForSettings();
292
    setFontFamily(family, script, setSansSerifFontFamilyWrapper);
293
}
294
295
void InternalSettings::setFixedFontFamily(const String& family, const String& script, ExceptionCode& ec)
296
{
297
    InternalSettingsGuardForSettings();
298
    setFontFamily(family, script, setFixedFontFamilyWrapper);
299
}
300
301
void InternalSettings::setCursiveFontFamily(const String& family, const String& script, ExceptionCode& ec)
302
{
303
    InternalSettingsGuardForSettings();
304
    setFontFamily(family, script, setCursiveFontFamilyWrapper);
305
}
306
307
void InternalSettings::setFantasyFontFamily(const String& family, const String& script, ExceptionCode& ec)
308
{
309
    InternalSettingsGuardForSettings();
310
    setFontFamily(family, script, setFantasyFontFamilyWrapper);
311
}
312
313
void InternalSettings::setPictographFontFamily(const String& family, const String& script, ExceptionCode& ec)
314
{
315
    InternalSettingsGuardForSettings();
316
    setFontFamily(family, script, setPictographFontFamilyWrapper);
317
}
318
234
}
319
}
- a/Source/WebCore/testing/InternalSettings.h +11 lines
Lines 30-35 a/Source/WebCore/testing/InternalSettings.h_sec1
30
#include <wtf/PassRefPtr.h>
30
#include <wtf/PassRefPtr.h>
31
#include <wtf/RefCounted.h>
31
#include <wtf/RefCounted.h>
32
#include <wtf/text/WTFString.h>
32
#include <wtf/text/WTFString.h>
33
#include <wtf/unicode/Unicode.h>
33
34
34
namespace WebCore {
35
namespace WebCore {
35
36
Lines 61-66 public: a/Source/WebCore/testing/InternalSettings.h_sec2
61
    void setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCode&);
62
    void setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCode&);
62
    void setPerTileDrawingEnabled(bool enabled, ExceptionCode&);
63
    void setPerTileDrawingEnabled(bool enabled, ExceptionCode&);
63
    void setTouchEventEmulationEnabled(bool enabled, ExceptionCode&);
64
    void setTouchEventEmulationEnabled(bool enabled, ExceptionCode&);
65
    void setStandardFontFamily(const String& family, const String& script, ExceptionCode&);
66
    void setSerifFontFamily(const String& family, const String& script, ExceptionCode&);
67
    void setSansSerifFontFamily(const String& family, const String& script, ExceptionCode&);
68
    void setFixedFontFamily(const String& family, const String& script, ExceptionCode&);
69
    void setCursiveFontFamily(const String& family, const String& script, ExceptionCode&);
70
    void setFantasyFontFamily(const String& family, const String& script, ExceptionCode&);
71
    void setPictographFontFamily(const String& family, const String& script, ExceptionCode&);
64
72
65
private:
73
private:
66
    InternalSettings(Frame*, InternalSettings* old);
74
    InternalSettings(Frame*, InternalSettings* old);
Lines 69-74 private: a/Source/WebCore/testing/InternalSettings.h_sec3
69
    Document* document() const;
77
    Document* document() const;
70
    Page* page() const;
78
    Page* page() const;
71
79
80
    typedef void (*SetFontFamilyWrapper)(Settings*, const String&, UScriptCode);
81
    void setFontFamily(const String& family, const String& script, SetFontFamilyWrapper setter);
82
72
    double m_passwordEchoDurationInSecondsBackup;
83
    double m_passwordEchoDurationInSecondsBackup;
73
    bool m_passwordEchoEnabledBackup : 1;
84
    bool m_passwordEchoEnabledBackup : 1;
74
    bool m_passwordEchoDurationInSecondsBackedUp : 1;
85
    bool m_passwordEchoDurationInSecondsBackedUp : 1;
- a/Source/WebCore/testing/InternalSettings.idl +7 lines
Lines 41-46 module window { a/Source/WebCore/testing/InternalSettings.idl_sec1
41
        boolean unifiedTextCheckingEnabled() raises (DOMException);
41
        boolean unifiedTextCheckingEnabled() raises (DOMException);
42
        void setPageScaleFactor(in float scaleFactor, in long x, in long y) raises(DOMException);
42
        void setPageScaleFactor(in float scaleFactor, in long x, in long y) raises(DOMException);
43
        void setTouchEventEmulationEnabled(in boolean enabled) raises(DOMException);
43
        void setTouchEventEmulationEnabled(in boolean enabled) raises(DOMException);
44
        void setStandardFontFamily(in DOMString family, in DOMString script) raises(DOMException);
45
        void setSerifFontFamily(in DOMString family, in DOMString script) raises(DOMException);
46
        void setSansSerifFontFamily(in DOMString family, in DOMString script) raises(DOMException);
47
        void setFixedFontFamily(in DOMString family, in DOMString script) raises(DOMException);
48
        void setCursiveFontFamily(in DOMString family, in DOMString script) raises(DOMException);
49
        void setFantasyFontFamily(in DOMString family, in DOMString script) raises(DOMException);
50
        void setPictographFontFamily(in DOMString family, in DOMString script) raises(DOMException);
44
    };
51
    };
45
}
52
}
46
53
- a/Source/autotools/symbols.filter +1 lines
Lines 51-56 _ZN7WebCore13createWrapperEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_4NodeE; a/Source/autotools/symbols.filter_sec1
51
_ZN7WebCore15setDOMExceptionEPN3JSC9ExecStateEi;
51
_ZN7WebCore15setDOMExceptionEPN3JSC9ExecStateEi;
52
_ZN7WebCore16HTMLInputElement17setSuggestedValueERKN3WTF6StringE;
52
_ZN7WebCore16HTMLInputElement17setSuggestedValueERKN3WTF6StringE;
53
_ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_10StringHashENS3_10HashTraitsIS6_EENSB_IS9_EEEES6_;
53
_ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_10StringHashENS3_10HashTraitsIS6_EENSB_IS9_EEEES6_;
54
_ZN7WebCore16scriptNameToCodeERKN3WTF6StringE;
54
_ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9ClassInfoE;
55
_ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9ClassInfoE;
55
_ZN7WebCore18HTMLContentElement6createEPNS_8DocumentE;
56
_ZN7WebCore18HTMLContentElement6createEPNS_8DocumentE;
56
_ZN7WebCore19InspectorController39setResourcesDataSizeLimitsFromInternalsEii;
57
_ZN7WebCore19InspectorController39setResourcesDataSizeLimitsFromInternalsEii;
- a/LayoutTests/ChangeLog +13 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2012-02-22  Matt Falkenhagen  <falken@chromium.org>
2
3
        Add per-script font settings to InternalSettings
4
        https://bugs.webkit.org/show_bug.cgi?id=78184
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        This adds per-script font settings to InternalSettings, so it can be used in layout tests instead of
9
        DumpRenderTree overridePreference, which has only been implemented for Chromium so far.
10
11
        * fast/text/international/locale-sensitive-fonts.html: Use InternalSettings instead of overridePreference
12
        * platform/mac/Skipped: Removed Skipped since I verified the test now works on Mac.
13
1
2012-02-22  Dan Bernstein  <mitz@apple.com>
14
2012-02-22  Dan Bernstein  <mitz@apple.com>
2
15
3
        Updated expected test results for the addition of -webkit-line-align (r108133) and the
16
        Updated expected test results for the addition of -webkit-line-align (r108133) and the
- a/LayoutTests/fast/text/international/locale-sensitive-fonts.html -3 / +3 lines
Lines 2-10 a/LayoutTests/fast/text/international/locale-sensitive-fonts.html_sec1
2
<html>
2
<html>
3
<head>
3
<head>
4
<script>
4
<script>
5
if (window.layoutTestController) {
5
if (window.internals) {
6
    layoutTestController.overridePreference("WebKitStandardFontMap", [ "Hans", "Ahem" ]);
6
    window.internals.settings.setStandardFontFamily("Ahem", "Hans");
7
    layoutTestController.overridePreference("WebKitFantasyFontMap", [ "Hans", "Ahem" ]);
7
    window.internals.settings.setFantasyFontFamily("Ahem", "Hans");
8
}
8
}
9
</script>
9
</script>
10
</head>
10
</head>
- a/LayoutTests/platform/mac/Skipped -1 lines
Lines 502-508 fast/repaint/table-extra-bottom-grow.html a/LayoutTests/platform/mac/Skipped_sec1
502
# DRT doesn't support overridePreference("WebKit*FontMap"...)
502
# DRT doesn't support overridePreference("WebKit*FontMap"...)
503
fast/text/international/content-language-font-selection.html
503
fast/text/international/content-language-font-selection.html
504
fast/text/international/content-language-with-subtags.html
504
fast/text/international/content-language-with-subtags.html
505
fast/text/international/locale-sensitive-fonts.html
506
505
507
# Web Intents is not yet enabled.
506
# Web Intents is not yet enabled.
508
webintents/
507
webintents/
- a/ChangeLog +9 lines
Lines 1-3 a/ChangeLog_sec1
1
2012-02-22  Matt Falkenhagen  <falken@chromium.org>
2
3
        Add per-script font settings to InternalSettings
4
        https://bugs.webkit.org/show_bug.cgi?id=78184
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * Source/autotools/symbols.filter: Export symbol
9
1
2012-02-22  Raphael Kubo da Costa  <kubo@profusion.mobi>
10
2012-02-22  Raphael Kubo da Costa  <kubo@profusion.mobi>
2
11
3
        [CMake] Remove FindGDK.cmake and FindGDK-PixBuf.cmake
12
        [CMake] Remove FindGDK.cmake and FindGDK-PixBuf.cmake

Return to Bug 78184