Changeset 42260 in webkit


Ignore:
Timestamp:
Apr 6, 2009 4:11:59 PM (15 years ago)
Author:
Dimitri Glazkov
Message:

2009-04-06 Dimitri Glazkov <Dimitri Glazkov>

Reviewed by Darin Fisher.

https://bugs.webkit.org/show_bug.cgi?id=25059
Remove references to dominantScript, getGenericFontForScript.

  • platform/graphics/chromium/FontCacheChromiumWin.cpp: Removed references

to getGenericFontForScript.

(WebCore::FontCache::getLastResortFallbackFont): Removed calls to dominantScript.

  • platform/graphics/chromium/FontCacheLinux.cpp: Ditto.
  • rendering/RenderThemeChromiumLinux.cpp: (WebCore::defaultGUIFont): Removed Document* arg. (WebCore::RenderThemeChromiumLinux::systemFont): Ditto.
  • rendering/RenderThemeChromiumLinux.h: Ditto.
  • rendering/RenderThemeChromiumMac.h: Ditto.
  • rendering/RenderThemeChromiumMac.mm: Ditto. (WebCore::RenderThemeChromiumMac::systemFont): Ditto.
  • rendering/RenderThemeChromiumWin.cpp: (WebCore::defaultGUIFont): Ditto. (WebCore::RenderThemeChromiumWin::systemFont): Ditto.
  • rendering/RenderThemeChromiumWin.h: Ditto.
Location:
trunk/WebCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r42256 r42260  
     12009-04-06  Dimitri Glazkov  <dglazkov@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=25059
     6        Remove references to dominantScript, getGenericFontForScript.
     7
     8        * platform/graphics/chromium/FontCacheChromiumWin.cpp: Removed references
     9            to getGenericFontForScript.
     10        (WebCore::FontCache::getLastResortFallbackFont): Removed calls to dominantScript.
     11        * platform/graphics/chromium/FontCacheLinux.cpp: Ditto.
     12        * rendering/RenderThemeChromiumLinux.cpp:
     13        (WebCore::defaultGUIFont): Removed Document* arg.
     14        (WebCore::RenderThemeChromiumLinux::systemFont): Ditto.
     15        * rendering/RenderThemeChromiumLinux.h: Ditto.
     16        * rendering/RenderThemeChromiumMac.h: Ditto.
     17        * rendering/RenderThemeChromiumMac.mm: Ditto.
     18        (WebCore::RenderThemeChromiumMac::systemFont): Ditto.
     19        * rendering/RenderThemeChromiumWin.cpp:
     20        (WebCore::defaultGUIFont): Ditto.
     21        (WebCore::RenderThemeChromiumWin::systemFont): Ditto.
     22        * rendering/RenderThemeChromiumWin.h: Ditto.
     23
    1242009-04-06  Geoffrey Garen  <ggaren@apple.com>
    225
  • trunk/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp

    r41392 r42260  
    415415{
    416416    FontDescription::GenericFamilyType generic = description.genericFamily();
    417     // FIXME: Mapping webkit generic to GenericFamilyType needs to
    418     // be more intelligent.
    419     // This spot rarely gets reached. GetFontDataForCharacters() gets hit a lot
    420     // more often (see FIXME comment there).
    421     const wchar_t* family = getFontFamilyForScript(description.dominantScript(), generic);
    422 
    423     if (family)
    424         return getCachedFontPlatformData(description, AtomicString(family, wcslen(family)));
    425417
    426418    // FIXME: Would be even better to somehow get the user's default font here.
     
    454446    };
    455447    return gdiFontWeights[fontWeight];
    456 }
    457 
    458 // FIXME: This may not be the best place to put this function
    459 AtomicString FontCache::getGenericFontForScript(UScriptCode script, const FontDescription& description)
    460 {
    461     const wchar_t* scriptFont = getFontFamilyForScript( script, description.genericFamily());
    462     return scriptFont ? AtomicString(scriptFont, wcslen(scriptFont)) : emptyAtom;
    463448}
    464449
  • trunk/WebCore/platform/graphics/chromium/FontCacheLinux.cpp

    r41082 r42260  
    160160}
    161161
    162 AtomicString FontCache::getGenericFontForScript(UScriptCode script,
    163                                                 const FontDescription& descript)
    164 {
    165     notImplemented();
    166     return AtomicString();
    167 }
    168 
    169162}  // namespace WebCore
  • trunk/WebCore/rendering/RenderThemeChromiumLinux.cpp

    r42044 r42260  
    8989// IE uses MS Shell Dlg there, which we render incorrectly at certain pixel
    9090// sizes (e.g. 15px). So, for now we just use Arial.
    91 static const char* defaultGUIFont(Document* document)
     91static const char* defaultGUIFont()
    9292{
    9393    return "Arial";
     
    156156}
    157157
    158 void RenderThemeChromiumLinux::systemFont(int propId, Document* document, FontDescription& fontDescription) const
     158void RenderThemeChromiumLinux::systemFont(int propId, FontDescription& fontDescription) const
    159159{
    160160    float fontSize = DefaultFontSize;
     
    173173    }
    174174
    175     fontDescription.firstFamily().setFamily(defaultGUIFont(NULL));
     175    fontDescription.firstFamily().setFamily(defaultGUIFont());
    176176    fontDescription.setSpecifiedSize(fontSize);
    177177    fontDescription.setIsAbsoluteSize(true);
  • trunk/WebCore/rendering/RenderThemeChromiumLinux.h

    r42044 r42260  
    5757
    5858        // System fonts.
    59         virtual void systemFont(int propId, Document*, FontDescription&) const;
     59        virtual void systemFont(int propId, FontDescription&) const;
    6060
    6161        virtual int minimumMenuListSize(RenderStyle*) const;
  • trunk/WebCore/rendering/RenderThemeChromiumMac.h

    r41939 r42260  
    6868
    6969        // System fonts.
    70         virtual void systemFont(int cssValueId, Document*, FontDescription&) const;
     70        virtual void systemFont(int cssValueId, FontDescription&) const;
    7171
    7272        virtual int minimumMenuListSize(RenderStyle*) const;
  • trunk/WebCore/rendering/RenderThemeChromiumMac.mm

    r41040 r42260  
    3434#import "CSSStyleSelector.h"
    3535#import "CSSValueKeywords.h"
    36 #import "Document.h"
    3736#import "Element.h"
    3837#import "FoundationExtras.h"
     
    193192}
    194193
    195 void RenderThemeChromiumMac::systemFont(int cssValueId, Document* document, FontDescription& fontDescription) const
     194void RenderThemeChromiumMac::systemFont(int cssValueId, FontDescription& fontDescription) const
    196195{
    197196    static FontDescription systemFont;
  • trunk/WebCore/rendering/RenderThemeChromiumWin.cpp

    r42044 r42260  
    3232#include "CSSStyleSheet.h"
    3333#include "CSSValueKeywords.h"
    34 #include "Document.h"
    3534#include "FontSelector.h"
    3635#include "FontUtilsChromiumWin.h"
     
    207206// IE uses MS Shell Dlg there, which we render incorrectly at certain pixel
    208207// sizes (e.g. 15px). So, for now we just use Arial.
    209 static wchar_t* defaultGUIFont(Document* document)
    210 {
    211     UScriptCode dominantScript = document->dominantScript();
    212     const wchar_t* family = NULL;
    213 
    214     // FIXME: Special-casing of Latin/Greeek/Cyrillic should go away once
    215     // GetFontFamilyForScript is enhanced to support GenericFamilyType for
    216     // real. For now, we make sure that we use Arial to match IE for those
    217     // scripts.
    218     if (dominantScript != USCRIPT_LATIN &&
    219         dominantScript != USCRIPT_CYRILLIC &&
    220         dominantScript != USCRIPT_GREEK &&
    221         dominantScript != USCRIPT_INVALID_CODE) {
    222         family = getFontFamilyForScript(dominantScript, FontDescription::NoFamily);
    223         if (family)
    224             return const_cast<wchar_t*>(family);
    225     }
     208static wchar_t* defaultGUIFont()
     209{
    226210    return L"Arial";
    227211}
     
    339323}
    340324
    341 void RenderThemeChromiumWin::systemFont(int propId, Document* document, FontDescription& fontDescription) const
     325void RenderThemeChromiumWin::systemFont(int propId, FontDescription& fontDescription) const
    342326{
    343327    // This logic owes much to RenderThemeSafari.cpp.
     
    376360    case CSSValueWebkitSmallControl:
    377361    case CSSValueWebkitControl:
    378         faceName = defaultGUIFont(document);
     362        faceName = defaultGUIFont();
    379363        // Why 2 points smaller?  Because that's what Gecko does.
    380364        fontSize = defaultFontSize - pointsToPixels(2);
    381365        break;
    382366    default:
    383         faceName = defaultGUIFont(document);
     367        faceName = defaultGUIFont();
    384368        fontSize = defaultFontSize;
    385369        break;
  • trunk/WebCore/rendering/RenderThemeChromiumWin.h

    r42044 r42260  
    6767
    6868        // System fonts.
    69         virtual void systemFont(int propId, Document*, FontDescription&) const;
     69        virtual void systemFont(int propId, FontDescription&) const;
    7070
    7171        virtual int minimumMenuListSize(RenderStyle*) const;
Note: See TracChangeset for help on using the changeset viewer.