diff options
author | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-16 18:17:37 +0000 |
---|---|---|
committer | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-16 18:17:37 +0000 |
commit | 9cdaf0f648394c1affc52b7f92cc1d99f235e1b6 (patch) | |
tree | cf970aad945ffe52697d0c45b14fa27f948fb882 | |
parent | 769b7beeaea8b5538a425eefc6fa7aca17d374ed (diff) | |
download | chromium_src-9cdaf0f648394c1affc52b7f92cc1d99f235e1b6.zip chromium_src-9cdaf0f648394c1affc52b7f92cc1d99f235e1b6.tar.gz chromium_src-9cdaf0f648394c1affc52b7f92cc1d99f235e1b6.tar.bz2 |
Address missing methods in forked FontCache.h header without forking entire implementation for mac. Turn off buliding resource loader we're not using.
Review URL: http://codereview.chromium.org/2897
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2268 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/port/platform/graphics/mac/FontCacheMacPending.cpp | 84 | ||||
-rw-r--r-- | webkit/webkit.xcodeproj/project.pbxproj | 6 |
2 files changed, 88 insertions, 2 deletions
diff --git a/webkit/port/platform/graphics/mac/FontCacheMacPending.cpp b/webkit/port/platform/graphics/mac/FontCacheMacPending.cpp new file mode 100644 index 0000000..cdfe861 --- /dev/null +++ b/webkit/port/platform/graphics/mac/FontCacheMacPending.cpp @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "AtomicString.h" +#include "FontCache.h" +#include "FontDescription.h" +#include "webkit_glue.h" + +// +// This file contains implementations of methods in the "pending" version +// of FontCache. These implementations are derrived from Apple code to avoid +// having to fork the entire FontCacheMac.mm file just to add these additional +// methods, hence its copyright at the top of the file. +// + +namespace WebCore { + +// TODO(jungshik): This may not be the best place to put this function. See +// TODO in pending/FontCache.h. +AtomicString FontCache::getGenericFontForScript(UScriptCode script, const FontDescription& description) +{ + if (webkit_glue::IsLayoutTestMode()) + return emptyAtom; + // TODO(pinkerton) -- flesh this out with some script handling code + return emptyAtom; +} + +// default implementation taken from +// WebCore/port/platform/graphics/FontCache.cpp. Windows makes lots of changes +// due to their font representations, we can probably stick with the original +// fallbacks for Mac. +const AtomicString& FontCache::alternateFamilyName(const AtomicString& familyName) +{ + // Alias Courier <-> Courier New + static AtomicString courier("Courier"), courierNew("Courier New"); + if (equalIgnoringCase(familyName, courier)) + return courierNew; + if (equalIgnoringCase(familyName, courierNew)) + return courier; + + // Alias Times and Times New Roman. + static AtomicString times("Times"), timesNewRoman("Times New Roman"); + if (equalIgnoringCase(familyName, times)) + return timesNewRoman; + if (equalIgnoringCase(familyName, timesNewRoman)) + return times; + + // Alias Arial and Helvetica + static AtomicString arial("Arial"), helvetica("Helvetica"); + if (equalIgnoringCase(familyName, arial)) + return helvetica; + if (equalIgnoringCase(familyName, helvetica)) + return arial; + + return emptyAtom; +} + +} // namespace WebCore diff --git a/webkit/webkit.xcodeproj/project.pbxproj b/webkit/webkit.xcodeproj/project.pbxproj index b932e17..d7e1f1b 100644 --- a/webkit/webkit.xcodeproj/project.pbxproj +++ b/webkit/webkit.xcodeproj/project.pbxproj @@ -602,7 +602,6 @@ E456248B0E268E87005E4685 /* loader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B5E8DC30D7F3C01001ECF42 /* loader.cpp */; }; E456248C0E268E87005E4685 /* ImageDocumentMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7B12FBDC0D8F54D900CB6E8F /* ImageDocumentMac.mm */; }; E456248D0E268E87005E4685 /* LoaderNSURLExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B5E8DC70D7F3C01001ECF42 /* LoaderNSURLExtras.m */; }; - E456248E0E268E87005E4685 /* ResourceLoaderMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7B5E8DC80D7F3C01001ECF42 /* ResourceLoaderMac.mm */; }; E456248F0E268E87005E4685 /* UserStyleSheetLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B5E8DC90D7F3C01001ECF42 /* UserStyleSheetLoader.cpp */; }; E45624900E268E87005E4685 /* MainResourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B5E8DCB0D7F3C01001ECF42 /* MainResourceLoader.cpp */; }; E45624910E268E87005E4685 /* NavigationAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B5E8DCD0D7F3C01001ECF42 /* NavigationAction.cpp */; }; @@ -1152,6 +1151,7 @@ E4E4C8560E7832E2009A687C /* PlatformContextSkia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4E4C8530E7832DC009A687C /* PlatformContextSkia.cpp */; }; E4E4C88F0E783E49009A687C /* SkGraphicsContextMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4E4C88E0E783E49009A687C /* SkGraphicsContextMac.cpp */; }; E4E4C94A0E797648009A687C /* ImageSourceCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B5E8FBD0D7F3CC1001ECF42 /* ImageSourceCG.cpp */; }; + E4E4CA470E8027ED009A687C /* FontCacheMacPending.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4E4CA190E80208A009A687C /* FontCacheMacPending.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -3702,6 +3702,7 @@ E4E4C7F80E781B5B009A687C /* webplugin_impl_mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = webplugin_impl_mac.mm; sourceTree = "<group>"; }; E4E4C8530E7832DC009A687C /* PlatformContextSkia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformContextSkia.cpp; sourceTree = "<group>"; }; E4E4C88E0E783E49009A687C /* SkGraphicsContextMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SkGraphicsContextMac.cpp; sourceTree = "<group>"; }; + E4E4CA190E80208A009A687C /* FontCacheMacPending.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FontCacheMacPending.cpp; path = mac/FontCacheMacPending.cpp; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -6521,6 +6522,7 @@ 822B1BE70DC77910005C9A96 /* graphics */ = { isa = PBXGroup; children = ( + E4E4CA190E80208A009A687C /* FontCacheMacPending.cpp */, 82C2604A0DCB9AC1005CFE91 /* ImageSourceSkia.cpp */, 82C2604B0DCB9AC1005CFE91 /* ImageSourceSkia.h */, E48A07220E3F95A000172919 /* NativeImageSkia.cpp */, @@ -7464,6 +7466,7 @@ E45624C70E268E87005E4685 /* Font.cpp in Sources */, E45624C80E268E87005E4685 /* FontCache.cpp in Sources */, E45624D60E268E87005E4685 /* FontCacheMac.mm in Sources */, + E4E4CA470E8027ED009A687C /* FontCacheMacPending.cpp in Sources */, E45624D70E268E87005E4685 /* FontCustomPlatformData.cpp in Sources */, E45624C90E268E87005E4685 /* FontData.cpp in Sources */, E45624CA0E268E87005E4685 /* FontFallbackList.cpp in Sources */, @@ -7752,7 +7755,6 @@ E456251F0E268E87005E4685 /* ResourceErrorMac.mm in Sources */, E45625250E268E87005E4685 /* ResourceHandle.cpp in Sources */, E45624960E268E87005E4685 /* ResourceLoader.cpp in Sources */, - E456248E0E268E87005E4685 /* ResourceLoaderMac.mm in Sources */, E45625260E268E87005E4685 /* ResourceRequestBase.cpp in Sources */, E45625270E268E87005E4685 /* ResourceResponseBase.cpp in Sources */, E45625930E268E87005E4685 /* RootInlineBox.cpp in Sources */, |