- WebCore/css/CSSStyleSelector.cpp -15 / +95 lines
Lines 48-53 WebCore/css/CSSStyleSelector.cpp_sec1
48
#include "CSSVariablesRule.h"
48
#include "CSSVariablesRule.h"
49
#include "CachedImage.h"
49
#include "CachedImage.h"
50
#include "Counter.h"
50
#include "Counter.h"
51
#include "FontCache.h"
51
#include "FontFamilyValue.h"
52
#include "FontFamilyValue.h"
52
#include "FontValue.h"
53
#include "FontValue.h"
53
#include "Frame.h"
54
#include "Frame.h"
Lines 2538-2543 void CSSStyleSelector::applyPropertyToSt WebCore/css/CSSStyleSelector.cpp_sec2
2538
    applyProperty(id, value);
2539
    applyProperty(id, value);
2539
}
2540
}
2540
2541
2542
struct ScriptFamilyState {
2543
  bool isGenericAdded;
2544
  bool isPerScriptGenericChecked;
2545
  ScriptFamilyState() : isGenericAdded(false), isPerScriptGenericChecked(false)
2546
  {}
2547
};
2548
2549
inline static void handleScriptFamily(const char* webkitFamily, UScriptCode script,
2550
                                      FontDescription::GenericFamilyType generic,
2551
                                      AtomicString& face, ScriptFamilyState& state,
2552
                                      FontDescription& fontDescription,
2553
                                      int& familyIndex)
2554
{
2555
    if (!state.isGenericAdded) {
2556
        face = webkitFamily;
2557
        state.isGenericAdded = true;
2558
        fontDescription.setGenericFamily(generic);
2559
        // go through this once more to add per-script generic family.
2560
        --familyIndex;
2561
    } else if (!state.isPerScriptGenericChecked) {
2562
        face = FontCache::getGenericFontForScript(script, fontDescription);
2563
        state.isPerScriptGenericChecked = true;
2564
    }
2565
}
2566
2541
void CSSStyleSelector::applyProperty(int id, CSSValue *value)
2567
void CSSStyleSelector::applyProperty(int id, CSSValue *value)
2542
{
2568
{
2543
    CSSPrimitiveValue* primitiveValue = 0;
2569
    CSSPrimitiveValue* primitiveValue = 0;
Lines 3788-3793 void CSSStyleSelector::applyProperty(int WebCore/css/CSSStyleSelector.cpp_sec3
3788
            fontDescription.setGenericFamily(initialDesc.genericFamily());
3814
            fontDescription.setGenericFamily(initialDesc.genericFamily());
3789
            if (!initialDesc.firstFamily().familyIsEmpty())
3815
            if (!initialDesc.firstFamily().familyIsEmpty())
3790
                fontDescription.setFamily(initialDesc.firstFamily());
3816
                fontDescription.setFamily(initialDesc.firstFamily());
3817
            UScriptCode script = m_element->document()->dominantScript();
3818
            if (script != USCRIPT_INVALID_CODE) 
3819
                fontDescription.setDominantScript(script);
3791
            if (m_style->setFontDescription(fontDescription))
3820
            if (m_style->setFontDescription(fontDescription))
3792
                m_fontDirty = true;
3821
                m_fontDirty = true;
3793
            return;
3822
            return;
Lines 3804-3815 void CSSStyleSelector::applyProperty(int WebCore/css/CSSStyleSelector.cpp_sec4
3804
        bool oldFamilyIsMonospace = fontDescription.genericFamily() == FontDescription::MonospaceFamily;
3833
        bool oldFamilyIsMonospace = fontDescription.genericFamily() == FontDescription::MonospaceFamily;
3805
        fontDescription.setGenericFamily(FontDescription::NoFamily);
3834
        fontDescription.setGenericFamily(FontDescription::NoFamily);
3806
3835
3836
        // |script| is used to add a font per script and per CSS generic family. 
3837
        // Adding it here is not very efficient because we may never use it 
3838
        // if all the characters are covered by fonts specified for this element.
3839
        // TODO(jungshik): Currently, it's document-wide constant inferred from
3840
        // the document charset, but we should infer it from the value of 
3841
        // xml:lang or lang for |m_element|. 
3842
        UScriptCode script = m_element->document()->dominantScript();
3843
        // serif, sans-serif, cursive, fantasy, monospace
3844
        ScriptFamilyState scriptFamilyStates[5]; 
3845
        Settings* settings = m_checker.m_document->settings();
3807
        for (int i = 0; i < len; i++) {
3846
        for (int i = 0; i < len; i++) {
3808
            CSSValue *item = list->itemWithoutBoundsCheck(i);
3847
            CSSValue *item = list->itemWithoutBoundsCheck(i);
3809
            if (!item->isPrimitiveValue()) continue;
3848
            if (!item->isPrimitiveValue()) continue;
3810
            CSSPrimitiveValue *val = static_cast<CSSPrimitiveValue*>(item);
3849
            CSSPrimitiveValue *val = static_cast<CSSPrimitiveValue*>(item);
3811
            AtomicString face;
3850
            AtomicString face;
3812
            Settings* settings = m_checker.m_document->settings();
3813
            if (val->primitiveType() == CSSPrimitiveValue::CSS_STRING)
3851
            if (val->primitiveType() == CSSPrimitiveValue::CSS_STRING)
3814
                face = static_cast<FontFamilyValue*>(val)->familyName();
3852
                face = static_cast<FontFamilyValue*>(val)->familyName();
3815
            else if (val->primitiveType() == CSSPrimitiveValue::CSS_IDENT && settings) {
3853
            else if (val->primitiveType() == CSSPrimitiveValue::CSS_IDENT && settings) {
Lines 3817-3841 void CSSStyleSelector::applyProperty(int WebCore/css/CSSStyleSelector.cpp_sec5
3817
                    case CSSValueWebkitBody:
3855
                    case CSSValueWebkitBody:
3818
                        face = settings->standardFontFamily();
3856
                        face = settings->standardFontFamily();
3819
                        break;
3857
                        break;
3858
                    // For each of 5 CSS generic families,
3859
                    // we add '-webkit-FOO' and a per-script generic family.
3860
                    // When |Settings| becomes expressive enough to support
3861
                    // per-script&per-generic family and we have a UI for
3862
                    // that, we'd just add the latter. Even without that,
3863
                    // I'm tempted to add per-script generic first, but I can't.
3864
                    // If I did, our font-selection UI would be all but
3865
                    // non-functional. Another issue is that we're adding 
3866
                    // these fonts without regard for actual need in page
3867
                    // rendering. That is, it's not done in a lazy manner.
3868
                    // Somewhere in getGlyphDataForCharacter() could be
3869
                    // a better place in terms of performance.
3870
                    // See https://bugs.webkit.org/show_bug.cgi?id=18085
3871
                    // and http://bugs.webkit.org/show_bug.cgi?id=10874
3820
                    case CSSValueSerif:
3872
                    case CSSValueSerif:
3821
                        face = "-webkit-serif";
3873
                        handleScriptFamily("-webkit-serif", script,
3822
                        fontDescription.setGenericFamily(FontDescription::SerifFamily);
3874
                             FontDescription::SerifFamily, face,
3875
                             scriptFamilyStates[0], fontDescription, i);
3823
                        break;
3876
                        break;
3824
                    case CSSValueSansSerif:
3877
		    case CSSValueSansSerif:
3825
                        face = "-webkit-sans-serif";
3878
                        handleScriptFamily("-webkit-sans-serif", script,
3826
                        fontDescription.setGenericFamily(FontDescription::SansSerifFamily);
3879
                             FontDescription::SansSerifFamily, face,
3880
                             scriptFamilyStates[1], fontDescription, i);
3827
                        break;
3881
                        break;
3828
                    case CSSValueCursive:
3882
		    case CSSValueCursive:
3829
                        face = "-webkit-cursive";
3883
                        handleScriptFamily("-webkit-cursive", script,
3830
                        fontDescription.setGenericFamily(FontDescription::CursiveFamily);
3884
                             FontDescription::CursiveFamily, face,
3885
                             scriptFamilyStates[2], fontDescription, i);
3831
                        break;
3886
                        break;
3832
                    case CSSValueFantasy:
3887
		    case CSSValueFantasy:
3833
                        face = "-webkit-fantasy";
3888
                        handleScriptFamily("-webkit-fantasy", script,
3834
                        fontDescription.setGenericFamily(FontDescription::FantasyFamily);
3889
                             FontDescription::FantasyFamily, face,
3890
                             scriptFamilyStates[3], fontDescription, i);
3835
                        break;
3891
                        break;
3836
                    case CSSValueMonospace:
3892
		    case CSSValueMonospace:
3837
                        face = "-webkit-monospace";
3893
                        handleScriptFamily("-webkit-monospace", script,
3838
                        fontDescription.setGenericFamily(FontDescription::MonospaceFamily);
3894
                             FontDescription::MonospaceFamily, face,
3895
                             scriptFamilyStates[4], fontDescription, i);
3839
                        break;
3896
                        break;
3840
                }
3897
                }
3841
            }
3898
            }
Lines 3860-3865 void CSSStyleSelector::applyProperty(int WebCore/css/CSSStyleSelector.cpp_sec6
3860
                    m_fontDirty = true;
3917
                    m_fontDirty = true;
3861
            }
3918
            }
3862
        }
3919
        }
3920
3921
        if (fontDescription.genericFamily() == FontDescription::NoFamily && currFamily) {
3922
            FontDescription::GenericFamilyType generic;
3923
            // TODO(jungshik) : Perhaps, we'd better add isStandardSerif()
3924
            // method to |Settings| which will be set via WebPreference.
3925
            if (settings) {
3926
                if (settings->serifFontFamily() == settings->standardFontFamily())
3927
                    generic = FontDescription::SerifFamily ;
3928
                else 
3929
                    generic = FontDescription::SansSerifFamily;
3930
            } else
3931
              generic = FontDescription::StandardFamily; 
3932
            fontDescription.setGenericFamily(generic);
3933
            AtomicString face = FontCache::getGenericFontForScript(script, fontDescription);
3934
            if (!face.isEmpty()) {
3935
                RefPtr<SharedFontFamily> newFamily = SharedFontFamily::create();
3936
                newFamily->setFamily(face);
3937
                currFamily->appendFamily(newFamily);
3938
                currFamily = newFamily.get();
3939
                if (m_style->setFontDescription(fontDescription))
3940
                    m_fontDirty = true;
3941
            }
3942
        }
3863
      return;
3943
      return;
3864
    }
3944
    }
3865
    case CSSPropertyTextDecoration: {
3945
    case CSSPropertyTextDecoration: {
- WebCore/dom/Document.cpp -1 / +104 lines
Lines 50-55 WebCore/dom/Document.cpp_sec1
50
#include "EventNames.h"
50
#include "EventNames.h"
51
#include "ExceptionCode.h"
51
#include "ExceptionCode.h"
52
#include "FocusController.h"
52
#include "FocusController.h"
53
#include "FontCache.h"
53
#include "Frame.h"
54
#include "Frame.h"
54
#include "FrameLoader.h"
55
#include "FrameLoader.h"
55
#include "FrameTree.h"
56
#include "FrameTree.h"
Lines 275-280 Document::Document(Frame* frame, bool is WebCore/dom/Document.cpp_sec2
275
#if ENABLE(XBL)
276
#if ENABLE(XBL)
276
    , m_bindingManager(new XBLBindingManager(this))
277
    , m_bindingManager(new XBLBindingManager(this))
277
#endif
278
#endif
279
    , m_dominantScript(USCRIPT_INVALID_CODE)
278
    , m_savedRenderer(0)
280
    , m_savedRenderer(0)
279
    , m_secureForms(0)
281
    , m_secureForms(0)
280
    , m_designMode(inherit)
282
    , m_designMode(inherit)
Lines 843-848 void Document::setCharset(const String& WebCore/dom/Document.cpp_sec3
843
    decoder()->setEncoding(charset, TextResourceDecoder::UserChosenEncoding);
845
    decoder()->setEncoding(charset, TextResourceDecoder::UserChosenEncoding);
844
}
846
}
845
847
848
UScriptCode Document::dominantScript() const
849
{
850
    struct EncodingScript {
851
        const char* encoding;
852
        UScriptCode script;
853
    };
854
 
855
    // inputEncoding() always returns a canonical name. We use
856
    // MIME names and IANA names (if the former is not available).
857
    static const EncodingScript encodingScriptList[] = {
858
        { "GB2312", USCRIPT_SIMPLIFIED_HAN },
859
        { "GBK", USCRIPT_SIMPLIFIED_HAN },
860
        { "GB18030", USCRIPT_SIMPLIFIED_HAN },
861
        { "Big5", USCRIPT_TRADITIONAL_HAN },
862
        { "Big5-HKSCS", USCRIPT_TRADITIONAL_HAN },
863
        { "Shift_JIS", USCRIPT_HIRAGANA},
864
        { "EUC-JP", USCRIPT_HIRAGANA },  // Japanese (USCRIPT_JAPANESE)
865
        { "ISO-2022-KR", USCRIPT_HIRAGANA },
866
        { "EUC-KR", USCRIPT_HANGUL },  // Korean (USCRIPT_KOREAN)
867
        { "TIS-620", USCRIPT_THAI },
868
        { "ISO-8859-1", USCRIPT_LATIN },
869
        { "ISO-8859-15", USCRIPT_LATIN },
870
        { "windows-1252", USCRIPT_LATIN },
871
        { "ISO-8859-2", USCRIPT_LATIN },
872
        { "windows-1250", USCRIPT_LATIN },
873
        { "ISO-8859-3", USCRIPT_LATIN },
874
        { "ISO-8859-4", USCRIPT_LATIN },
875
        { "ISO-8859-13", USCRIPT_LATIN },
876
        { "windows-1257", USCRIPT_LATIN },
877
        { "ISO-8859-5", USCRIPT_CYRILLIC },
878
        { "windows-1251", USCRIPT_CYRILLIC },
879
        { "KOI8-R", USCRIPT_CYRILLIC },
880
        { "KOI8-U", USCRIPT_CYRILLIC },
881
        { "ISO-8859-6", USCRIPT_ARABIC },
882
        { "windows-1256", USCRIPT_ARABIC },
883
        { "ISO-8859-7", USCRIPT_GREEK },
884
        { "windows-1253", USCRIPT_GREEK },
885
        { "ISO-8859-8", USCRIPT_HEBREW },
886
        { "windows-1255", USCRIPT_HEBREW },
887
        { "ISO-8859-9", USCRIPT_LATIN },  // Turkish
888
        { "windows-1254", USCRIPT_LATIN },
889
        { "ISO-8859-10", USCRIPT_LATIN }, // Nordic
890
        { "ISO-8859-14", USCRIPT_LATIN }, // Celtic
891
        { "ISO-8859-16", USCRIPT_LATIN }, // Romanian
892
        { "windows-1258", USCRIPT_LATIN }, // Vietnamese
893
    };
894
 
895
    static HashMap<String, UScriptCode> encodingScriptMap;
896
 
897
    if (encodingScriptMap.isEmpty()) {
898
        for (unsigned i = 0; i < sizeof(encodingScriptList) / sizeof(encodingScriptList[0]); ++i) 
899
            encodingScriptMap.set(encodingScriptList[i].encoding,
900
                                  encodingScriptList[i].script);
901
    }
902
 
903
    if (m_dominantScript != USCRIPT_INVALID_CODE) 
904
        return m_dominantScript;
905
    String encoding = inputEncoding();
906
    if (encoding.isEmpty())
907
        return m_dominantScript;
908
 
909
    HashMap<String, UScriptCode>::iterator it = encodingScriptMap.find(encoding);
910
    if (it != encodingScriptMap.end())
911
        m_dominantScript = it->second;
912
    else 
913
        // TODO(jungshik) : should return a script corresponding to the locale.
914
        m_dominantScript = USCRIPT_COMMON;
915
    return m_dominantScript;
916
}
917
846
void Document::setXMLVersion(const String& version, ExceptionCode& ec)
918
void Document::setXMLVersion(const String& version, ExceptionCode& ec)
847
{
919
{
848
    if (!implementation()->hasFeature("XML", String())) {
920
    if (!implementation()->hasFeature("XML", String())) {
Lines 1112-1117 void Document::recalcStyle(StyleChange c WebCore/dom/Document.cpp_sec4
1112
    
1184
    
1113
        FontDescription fontDescription;
1185
        FontDescription fontDescription;
1114
        fontDescription.setUsePrinterFont(printing());
1186
        fontDescription.setUsePrinterFont(printing());
1187
        // TODO(jungshik): Eventually, we need to derive the dominant script
1188
        // for the current node based on 'xml:lang' and 'lang' specified for
1189
        // it or inherited from its parent rather than using the document-wide
1190
        // value (inferred from charset). Note also that it does not work 
1191
        // for 'script-agnostic' charsets like UTF-8. In that case, Firefox
1192
        // uses the script corresponding to the application locale.
1193
        // While a document is loaded, this function is called multiple
1194
        // times. At the beginning, the document charset is not known and
1195
        // dominantScript remains invalid. Only when it's determined, we
1196
        // change the font accordingly.
1197
        // See http://bugs.webkit.org/show_bug.cgi?id=10874 and 
1198
        // https://bugs.webkit.org/show_bug.cgi?id=18085
1199
        UScriptCode script = dominantScript();
1200
        if (script != USCRIPT_INVALID_CODE)
1201
            fontDescription.setDominantScript(script);
1115
        if (Settings* settings = this->settings()) {
1202
        if (Settings* settings = this->settings()) {
1116
            fontDescription.setRenderingMode(settings->fontRenderingMode());
1203
            fontDescription.setRenderingMode(settings->fontRenderingMode());
1117
            if (printing() && !settings->shouldPrintBackgrounds())
1204
            if (printing() && !settings->shouldPrintBackgrounds())
Lines 1119-1125 void Document::recalcStyle(StyleChange c WebCore/dom/Document.cpp_sec5
1119
            const AtomicString& stdfont = settings->standardFontFamily();
1206
            const AtomicString& stdfont = settings->standardFontFamily();
1120
            if (!stdfont.isEmpty()) {
1207
            if (!stdfont.isEmpty()) {
1121
                fontDescription.firstFamily().setFamily(stdfont);
1208
                fontDescription.firstFamily().setFamily(stdfont);
1122
                fontDescription.firstFamily().appendFamily(0);
1209
                FontFamily& currFamily = fontDescription.firstFamily();
1210
                if (script != USCRIPT_INVALID_CODE) {
1211
                  // TODO(jungshik) : I might as well modify |genericFamily| of
1212
                  // |fontDescription| here, but I'm wary of a potential breakage.
1213
                  // For now, just use a temporary variable.
1214
                  FontDescription tmpDescription;
1215
                  tmpDescription.setGenericFamily(FontDescription::StandardFamily);
1216
                  AtomicString docFont = FontCache::getGenericFontForScript(
1217
                      script, tmpDescription);
1218
                  if (!docFont.isEmpty()) {
1219
                      RefPtr<SharedFontFamily> newFamily = SharedFontFamily::create();
1220
                      newFamily->setFamily(docFont);
1221
                      currFamily.appendFamily(newFamily);
1222
                      currFamily = *newFamily;
1223
                  }
1224
                }
1225
                currFamily.appendFamily(0);
1123
            }
1226
            }
1124
            fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
1227
            fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
1125
            m_styleSelector->setFontSize(fontDescription, m_styleSelector->fontSizeForKeyword(CSSValueMedium, inCompatMode(), false));
1228
            m_styleSelector->setFontSize(fontDescription, m_styleSelector->fontSizeForKeyword(CSSValueMedium, inCompatMode(), false));
- WebCore/dom/Document.h +17 lines
Lines 34-39 WebCore/dom/Document.h_sec1
34
#include "KURL.h"
34
#include "KURL.h"
35
#include "StringHash.h"
35
#include "StringHash.h"
36
#include "Timer.h"
36
#include "Timer.h"
37
#include <unicode/uscript.h>
37
#include <wtf/HashCountedSet.h>
38
#include <wtf/HashCountedSet.h>
38
#include <wtf/ListHashSet.h>
39
#include <wtf/ListHashSet.h>
39
40
Lines 238-243 public: WebCore/dom/Document.h_sec2
238
    String contentLanguage() const { return m_contentLanguage; }
239
    String contentLanguage() const { return m_contentLanguage; }
239
    void setContentLanguage(const String& lang) { m_contentLanguage = lang; }
240
    void setContentLanguage(const String& lang) { m_contentLanguage = lang; }
240
241
242
    UScriptCode dominantScript() const;
243
241
    String xmlEncoding() const { return m_xmlEncoding; }
244
    String xmlEncoding() const { return m_xmlEncoding; }
242
    String xmlVersion() const { return m_xmlVersion; }
245
    String xmlVersion() const { return m_xmlVersion; }
243
    bool xmlStandalone() const { return m_xmlStandalone; }
246
    bool xmlStandalone() const { return m_xmlStandalone; }
Lines 912-917 private: WebCore/dom/Document.h_sec3
912
915
913
    String m_contentLanguage;
916
    String m_contentLanguage;
914
917
918
    // UScriptCode can be derived from non-Unicode charsets and help us select a fallback
919
    // font. Because it's derived from charset, it's a document-wide constant.
920
    // For instance, it'll be Latin, SimplifiedHan, TraditionalHan, Hiragana,
921
    // Hangul, Arabic and Hebrew for documents in ISO-8859-1, GBK, Big5, Shift_JIS,
922
    // EUC-KR, Windows-1256 and Windows-1255, respectively. In case of Japanese encodings,
923
    // either Hiragana or Katakana should work but Han does not because it does not
924
    // uniquely identify Japanese and as a result does not help the font selection. 
925
    // Obviously, this does not work well for Unicode-encoded documents. In the meantime,
926
    // we can resort to the 'dominant' script of the current UI language. 
927
    // In the future, we should refer to the value of xml:lang and lang to infer 
928
    // this value for invididual text nodes. CSSStyleSelector might be a good place for that.
929
    // Moreover, the value of m_contentLanguage should be utilized as well. 
930
    mutable UScriptCode m_dominantScript; 
931
915
public:
932
public:
916
    bool inPageCache();
933
    bool inPageCache();
917
    void setInPageCache(bool flag);
934
    void setInPageCache(bool flag);
- WebCore/platform/graphics/FontCache.h +9 lines
Lines 30-35 WebCore/platform/graphics/FontCache.h_sec1
30
#define FontCache_h
30
#define FontCache_h
31
31
32
#include <limits.h>
32
#include <limits.h>
33
#include <unicode/uscript.h>
33
#include <wtf/Vector.h>
34
#include <wtf/Vector.h>
34
#include <wtf/unicode/Unicode.h>
35
#include <wtf/unicode/Unicode.h>
35
36
Lines 81-86 public: WebCore/platform/graphics/FontCache.h_sec2
81
    static size_t inactiveFontDataCount();
82
    static size_t inactiveFontDataCount();
82
    static void purgeInactiveFontData(int count = INT_MAX);
83
    static void purgeInactiveFontData(int count = INT_MAX);
83
84
85
    // TODO(jungshik): Is this the best place to put this function? It may
86
    // or may not be. Font.h is another place we can cosider.
87
    // Return a font family for |script| and |FontDescription.genericFamily()|.
88
    // It will return an empty atom if we can't find a font matching 
89
    // script and genericFamily in FontDescription. A caller should check
90
    // the emptyness before using it.
91
    static AtomicString getGenericFontForScript(UScriptCode script, const FontDescription&);
92
84
private:
93
private:
85
    // These methods are implemented by each platform.
94
    // These methods are implemented by each platform.
86
    static FontPlatformData* getSimilarFontPlatformData(const Font&);
95
    static FontPlatformData* getSimilarFontPlatformData(const Font&);
- WebCore/platform/graphics/FontDescription.h +6 lines
Lines 28-33 WebCore/platform/graphics/FontDescription.h_sec1
28
#include "FontFamily.h"
28
#include "FontFamily.h"
29
#include "FontRenderingMode.h"
29
#include "FontRenderingMode.h"
30
#include "FontTraitsMask.h"
30
#include "FontTraitsMask.h"
31
#include <unicode/uscript.h>
31
32
32
namespace WebCore {
33
namespace WebCore {
33
34
Lines 61-66 public: WebCore/platform/graphics/FontDescription.h_sec2
61
        , m_usePrinterFont(false)
62
        , m_usePrinterFont(false)
62
        , m_renderingMode(NormalRenderingMode)
63
        , m_renderingMode(NormalRenderingMode)
63
        , m_keywordSize(0)
64
        , m_keywordSize(0)
65
        , m_dominantScript(USCRIPT_INVALID_CODE)
64
    {
66
    {
65
    }
67
    }
66
68
Lines 82-87 public: WebCore/platform/graphics/FontDescription.h_sec3
82
    bool usePrinterFont() const { return m_usePrinterFont; }
84
    bool usePrinterFont() const { return m_usePrinterFont; }
83
    FontRenderingMode renderingMode() const { return static_cast<FontRenderingMode>(m_renderingMode); }
85
    FontRenderingMode renderingMode() const { return static_cast<FontRenderingMode>(m_renderingMode); }
84
    int keywordSize() const { return m_keywordSize; }
86
    int keywordSize() const { return m_keywordSize; }
87
    UScriptCode dominantScript() const { return m_dominantScript; }
85
88
86
    FontTraitsMask traitsMask() const;
89
    FontTraitsMask traitsMask() const;
87
90
Lines 96-101 public: WebCore/platform/graphics/FontDescription.h_sec4
96
    void setUsePrinterFont(bool p) { m_usePrinterFont = p; }
99
    void setUsePrinterFont(bool p) { m_usePrinterFont = p; }
97
    void setRenderingMode(FontRenderingMode mode) { m_renderingMode = mode; }
100
    void setRenderingMode(FontRenderingMode mode) { m_renderingMode = mode; }
98
    void setKeywordSize(int s) { m_keywordSize = s; }
101
    void setKeywordSize(int s) { m_keywordSize = s; }
102
    void setDominantScript(UScriptCode s) { m_dominantScript = s; }
99
103
100
private:
104
private:
101
    FontFamily m_familyList; // The list of font families to be used.
105
    FontFamily m_familyList; // The list of font families to be used.
Lines 117-122 private: WebCore/platform/graphics/FontDescription.h_sec5
117
    int m_keywordSize : 4; // We cache whether or not a font is currently represented by a CSS keyword (e.g., medium).  If so,
121
    int m_keywordSize : 4; // We cache whether or not a font is currently represented by a CSS keyword (e.g., medium).  If so,
118
                           // then we can accurately translate across different generic families to adjust for different preference settings
122
                           // then we can accurately translate across different generic families to adjust for different preference settings
119
                           // (e.g., 13px monospace vs. 16px everything else).  Sizes are 1-8 (like the HTML size values for <font>).
123
                           // (e.g., 13px monospace vs. 16px everything else).  Sizes are 1-8 (like the HTML size values for <font>).
124
    UScriptCode m_dominantScript; // See the comment in Document.h
125
                         
120
};
126
};
121
127
122
inline bool FontDescription::operator==(const FontDescription& other) const
128
inline bool FontDescription::operator==(const FontDescription& other) const
- WebCore/platform/graphics/gtk/FontCacheGtk.cpp +5 lines
Lines 70-73 FontPlatformData* FontCache::createFontP WebCore/platform/graphics/gtk/FontCacheGtk.cpp_sec1
70
    return new FontPlatformData(fontDescription, family);
70
    return new FontPlatformData(fontDescription, family);
71
}
71
}
72
72
73
AtomicString FontCache::getGenericFontForScript(UScriptCode script, const FontDescription&)
74
{
75
    return emptyAtom;
76
}
77
73
}
78
}
- WebCore/platform/graphics/mac/FontCacheMac.mm +5 lines
Lines 197-202 FontPlatformData* FontCache::createFontP WebCore/platform/graphics/mac/FontCacheMac.mm_sec1
197
    result->m_syntheticBold = isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(actualWeight);
197
    result->m_syntheticBold = isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(actualWeight);
198
    result->m_syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait);
198
    result->m_syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait);
199
    return result;
199
    return result;
200
} 
201
202
AtomicString FontCache::getGenericFontForScript(UScriptCode script, const FontDescription&)
203
{
204
    return emptyAtom;
200
}
205
}
201
206
202
} // namespace WebCore
207
} // namespace WebCore
- WebCore/platform/graphics/qt/FontCacheQt.cpp +5 lines
Lines 53-56 void FontCache::removeClient(FontSelecto WebCore/platform/graphics/qt/FontCacheQt.cpp_sec1
53
{
53
{
54
}
54
}
55
55
56
AtomicString FontCache::getGenericFontForScript(UScriptCode script, const FontDescription&)
57
{
58
    return emptyAtom;
59
}
60
56
} // namespace WebCore
61
} // namespace WebCore
- WebCore/platform/graphics/win/FontCacheWin.cpp +5 lines
Lines 521-525 FontPlatformData* FontCache::createFontP WebCore/platform/graphics/win/FontCacheWin.cpp_sec1
521
    return result;
521
    return result;
522
}
522
}
523
523
524
AtomicString FontCache::getGenericFontForScript(UScriptCode script, const FontDescription&)
525
{
526
    return emptyAtom;
527
}
528
524
}
529
}
525
530
- WebCore/platform/graphics/wx/FontCacheWx.cpp +5 lines
Lines 69-72 void FontCache::getTraitsInFamily(const WebCore/platform/graphics/wx/FontCacheWx.cpp_sec1
69
    notImplemented();
69
    notImplemented();
70
}
70
}
71
71
72
AtomicString FontCache::getGenericFontForScript(UScriptCode script, const FontDescription&)
73
{
74
    return emptyAtom;
75
}
76
72
}
77
}

Return to Bug 18085