Changeset 123424 in webkit


Ignore:
Timestamp:
Jul 23, 2012 10:05:25 PM (12 years ago)
Author:
pilgrim@chromium.org
Message:

[Chromium] Move layoutTestMode to WebCore
https://bugs.webkit.org/show_bug.cgi?id=92010

Reviewed by Adam Barth.

Part of a refactoring series. See tracking bug 82948.

Source/WebCore:

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/generic/RuntimeEnabledFeatures.h:

(RuntimeEnabledFeatures):

  • platform/LayoutTestSupport.cpp: Added.

(WebCore):
(WebCore::isRunningLayoutTest):
(WebCore::setIsRunningLayoutTest):

  • platform/LayoutTestSupport.h: Added.

(WebCore):

  • platform/chromium/PlatformSupport.h:

(PlatformSupport):

  • platform/chromium/ScrollbarThemeChromiumAndroid.cpp:

(WebCore::ScrollbarThemeChromiumAndroid::scrollbarThickness):
(WebCore::ScrollbarThemeChromiumAndroid::paintScrollbarBackground):

  • platform/chromium/ScrollbarThemeChromiumWin.cpp:

(WebCore::ScrollbarThemeChromiumWin::scrollbarThickness):
(WebCore::ScrollbarThemeChromiumWin::buttonSize):

  • platform/graphics/chromium/FontCacheChromiumWin.cpp:

(WebCore):
(WebCore::LookupAltName):
(WebCore::fontContainsCharacter):
(WebCore::FillLogFont):
(WebCore::FontCache::getFontDataForCharacters):
(WebCore::FontCache::createFontPlatformData):

  • platform/graphics/skia/FontCustomPlatformData.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/skia/FontSkia.cpp:

(WebCore::Font::drawGlyphs):

  • rendering/RenderThemeChromiumAndroid.cpp:

(WebCore::RenderThemeChromiumAndroid::systemColor):
(WebCore::RenderThemeChromiumAndroid::adjustInnerSpinButtonStyle):

  • rendering/RenderThemeChromiumMac.mm:

(WebCore::RenderThemeChromiumMac::usesTestModeFocusRingColor):

  • rendering/RenderThemeChromiumSkia.cpp:

(WebCore::RenderThemeChromiumSkia::caretBlinkInterval):

  • rendering/RenderThemeChromiumWin.cpp:

(WebCore):
(WebCore::RenderThemeChromiumWin::platformActiveSelectionBackgroundColor):
(WebCore::RenderThemeChromiumWin::platformInactiveSelectionBackgroundColor):
(WebCore::RenderThemeChromiumWin::platformActiveSelectionForegroundColor):
(WebCore::RenderThemeChromiumWin::systemColor):
(WebCore::menuListButtonWidth):
(WebCore::RenderThemeChromiumWin::determineClassicState):

Source/WebKit/chromium:

  • src/PlatformSupport.cpp:

(WebCore):

  • src/WebKit.cpp:

(WebKit::setLayoutTestMode):
(WebKit::layoutTestMode):

Location:
trunk/Source
Files:
2 added
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r123369 r123424  
    17011701    platform/KillRingNone.cpp
    17021702    platform/Language.cpp
     1703    platform/LayoutTestSupport.cpp
    17031704    platform/Length.cpp
    17041705    platform/LengthBox.cpp
  • trunk/Source/WebCore/ChangeLog

    r123421 r123424  
     12012-07-23  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        [Chromium] Move layoutTestMode to WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=92010
     5
     6        Reviewed by Adam Barth.
     7
     8        Part of a refactoring series. See tracking bug 82948.
     9
     10        * CMakeLists.txt:
     11        * GNUmakefile.list.am:
     12        * Target.pri:
     13        * WebCore.gypi:
     14        * WebCore.vcproj/WebCore.vcproj:
     15        * WebCore.xcodeproj/project.pbxproj:
     16        * bindings/generic/RuntimeEnabledFeatures.h:
     17        (RuntimeEnabledFeatures):
     18        * platform/LayoutTestSupport.cpp: Added.
     19        (WebCore):
     20        (WebCore::isRunningLayoutTest):
     21        (WebCore::setIsRunningLayoutTest):
     22        * platform/LayoutTestSupport.h: Added.
     23        (WebCore):
     24        * platform/chromium/PlatformSupport.h:
     25        (PlatformSupport):
     26        * platform/chromium/ScrollbarThemeChromiumAndroid.cpp:
     27        (WebCore::ScrollbarThemeChromiumAndroid::scrollbarThickness):
     28        (WebCore::ScrollbarThemeChromiumAndroid::paintScrollbarBackground):
     29        * platform/chromium/ScrollbarThemeChromiumWin.cpp:
     30        (WebCore::ScrollbarThemeChromiumWin::scrollbarThickness):
     31        (WebCore::ScrollbarThemeChromiumWin::buttonSize):
     32        * platform/graphics/chromium/FontCacheChromiumWin.cpp:
     33        (WebCore):
     34        (WebCore::LookupAltName):
     35        (WebCore::fontContainsCharacter):
     36        (WebCore::FillLogFont):
     37        (WebCore::FontCache::getFontDataForCharacters):
     38        (WebCore::FontCache::createFontPlatformData):
     39        * platform/graphics/skia/FontCustomPlatformData.cpp:
     40        (WebCore::FontCustomPlatformData::fontPlatformData):
     41        * platform/graphics/skia/FontSkia.cpp:
     42        (WebCore::Font::drawGlyphs):
     43        * rendering/RenderThemeChromiumAndroid.cpp:
     44        (WebCore::RenderThemeChromiumAndroid::systemColor):
     45        (WebCore::RenderThemeChromiumAndroid::adjustInnerSpinButtonStyle):
     46        * rendering/RenderThemeChromiumMac.mm:
     47        (WebCore::RenderThemeChromiumMac::usesTestModeFocusRingColor):
     48        * rendering/RenderThemeChromiumSkia.cpp:
     49        (WebCore::RenderThemeChromiumSkia::caretBlinkInterval):
     50        * rendering/RenderThemeChromiumWin.cpp:
     51        (WebCore):
     52        (WebCore::RenderThemeChromiumWin::platformActiveSelectionBackgroundColor):
     53        (WebCore::RenderThemeChromiumWin::platformInactiveSelectionBackgroundColor):
     54        (WebCore::RenderThemeChromiumWin::platformActiveSelectionForegroundColor):
     55        (WebCore::RenderThemeChromiumWin::systemColor):
     56        (WebCore::menuListButtonWidth):
     57        (WebCore::RenderThemeChromiumWin::determineClassicState):
     58
    1592012-07-23  Dave Tu  <dtu@chromium.org>
    260
  • trunk/Source/WebCore/GNUmakefile.list.am

    r123330 r123424  
    35093509        Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp \
    35103510        Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h \
     3511        Source/WebCore/platform/LayoutTestSupport.cpp \
     3512        Source/WebCore/platform/LayoutTestSupport.h \
    35113513        Source/WebCore/platform/linux/GamepadDeviceLinux.cpp \
    35123514        Source/WebCore/platform/linux/GamepadDeviceLinux.h \
     
    62696271
    62706272endif  # END ENABLE_QUOTA
    6271 
  • trunk/Source/WebCore/Target.pri

    r123219 r123424  
    998998    platform/KURL.cpp \
    999999    platform/Language.cpp \
     1000    platform/LayoutTestSupport.cpp \
    10001001    platform/Length.cpp \
    10011002    platform/LengthBox.cpp \
  • trunk/Source/WebCore/WebCore.gypi

    r123326 r123424  
    288288            'platform/KURLHash.h',
    289289            'platform/Language.h',
     290            'platform/LayoutTestSupport.cpp',
     291            'platform/LayoutTestSupport.h',
    290292            'platform/Length.h',
    291293            'platform/LengthBox.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r123223 r123424  
    2816428164                        </File>
    2816528165                        <File
     28166                                RelativePath="..\platform\LayoutTestSupport.cpp"
     28167                                >
     28168                        </File>
     28169                        <File
     28170                                RelativePath="..\platform\LayoutTestSupport.h"
     28171                                >
     28172                        </File>
     28173                        <File
    2816628174                                RelativePath="..\platform\Length.cpp"
    2816728175                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r123181 r123424  
    58965896                D630E2AC149BF344005B2F95 /* MemoryUsageSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = D630E2AB149BF344005B2F95 /* MemoryUsageSupport.h */; };
    58975897                D630E2AC149BF344005B2F96 /* EventTracer.h in Headers */ = {isa = PBXBuildFile; fileRef = D630E2AB149BF344005B2F96 /* EventTracer.h */; };
     5898                D630E2AC149BF344005B2F93 /* LayoutTestSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = D630E2AB149BF344005B2F97 /* LayoutTestSupport.h */; };
    58985899                D6E276AF14637455001D280A /* MutationObserverRegistration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6E276AD14637455001D280A /* MutationObserverRegistration.cpp */; };
    58995900                D6E276B014637455001D280A /* MutationObserverRegistration.h in Headers */ = {isa = PBXBuildFile; fileRef = D6E276AE14637455001D280A /* MutationObserverRegistration.h */; };
     
    59045905                D6FDAEF3149C06190037B1E3 /* MemoryUsageSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6FDAEF2149C06190037B1E3 /* MemoryUsageSupport.cpp */; };
    59055906                D6FDAEF3149C06190037B1E4 /* EventTracer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6FDAEF2149C06190037B1E4 /* EventTracer.cpp */; };
     5907                D6FDAEF3149C06190037B1E5 /* LayoutTestSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6FDAEF2149C06190037B1E5 /* LayoutTestSupport.cpp */; };
    59065908                D70AD65713E1342B005B50B4 /* RenderRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D70AD65513E1342B005B50B4 /* RenderRegion.cpp */; };
    59075909                D70AD65813E1342B005B50B4 /* RenderRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = D70AD65613E1342B005B50B4 /* RenderRegion.h */; };
     
    1314713149                D630E2AB149BF344005B2F95 /* MemoryUsageSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryUsageSupport.h; sourceTree = "<group>"; };
    1314813150                D630E2AB149BF344005B2F96 /* EventTracer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventTracer.h; sourceTree = "<group>"; };
     13151                D630E2AB149BF344005B2F97 /* HistogramSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutTestSupport.h; sourceTree = "<group>"; };
    1314913152                D6E276AD14637455001D280A /* MutationObserverRegistration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MutationObserverRegistration.cpp; sourceTree = "<group>"; };
    1315013153                D6E276AE14637455001D280A /* MutationObserverRegistration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MutationObserverRegistration.h; sourceTree = "<group>"; };
     
    1315513158                D6FDAEF2149C06190037B1E3 /* MemoryUsageSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryUsageSupport.cpp; sourceTree = "<group>"; };
    1315613159                D6FDAEF2149C06190037B1E4 /* EventTracer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventTracer.cpp; sourceTree = "<group>"; };
     13160                D6FDAEF2149C06190037B1E5 /* LayoutTestSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutTestSupport.cpp; sourceTree = "<group>"; };
    1315713161                D70AD65513E1342B005B50B4 /* RenderRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderRegion.cpp; sourceTree = "<group>"; };
    1315813162                D70AD65613E1342B005B50B4 /* RenderRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderRegion.h; sourceTree = "<group>"; };
     
    2057220576                                E18772F0126E2629003DD586 /* Language.cpp */,
    2057320577                                85EC9AF90A71A2C600EEEAED /* Language.h */,
     20578                                D6FDAEF2149C06190037B1E5 /* LayoutTestSupport.cpp */,
     20579                                D630E2AB149BF344005B2F97 /* LayoutTestSupport.h */,
    2057420580                                BCE65BE80EACDF16007E4533 /* Length.cpp */,
    2057520581                                BCE65BE90EACDF16007E4533 /* Length.h */,
     
    2407124077                                A12538D413F9B60A00024754 /* LayoutRepainter.h in Headers */,
    2407224078                                2D9066070BE141D400956998 /* LayoutState.h in Headers */,
     24079                                D630E2AC149BF344005B2F97 /* LayoutTestSupport.h in Headers */,
    2407324080                                BACF290113B2A0D500781F90 /* LayoutTypes.h in Headers */,
    2407424081                                512DD8F50D91E6AF000F89EE /* LegacyWebArchive.h in Headers */,
     
    2735327360                                A120ACA413F998CA00FE4AC7 /* LayoutRepainter.cpp in Sources */,
    2735427361                                2D9066060BE141D400956998 /* LayoutState.cpp in Sources */,
     27362                                D6FDAEF3149C06190037B1E5 /* LayoutTestSupport.cpp in Sources */,
    2735527363                                512DD8F40D91E6AF000F89EE /* LegacyWebArchive.cpp in Sources */,
    2735627364                                51B2417B0D931F3F00E83F5C /* LegacyWebArchiveMac.mm in Sources */,
  • trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h

    r122195 r123424  
    149149    static bool deviceMotionEventEnabled() { return isDeviceMotionEnabled; }
    150150    static bool ondevicemotionEnabled() { return isDeviceMotionEnabled; }
    151    
     151
    152152    static void setDeviceOrientationEnabled(bool isEnabled) { isDeviceOrientationEnabled = isEnabled; }
    153153    static bool deviceOrientationEnabled() { return isDeviceOrientationEnabled; }
  • trunk/Source/WebCore/platform/chromium/PlatformSupport.h

    r123014 r123424  
    129129    static bool allowScriptDespiteSettings(const KURL& documentURL);
    130130
    131     // LayoutTestMode -----------------------------------------------------
    132     static bool layoutTestMode();
    133 
    134131    // Plugin -------------------------------------------------------------
    135132    static bool plugins(bool refresh, Vector<PluginInfo>*);
  • trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumAndroid.cpp

    r123402 r123424  
    2727#include "ScrollbarThemeChromiumAndroid.h"
    2828
     29#include "LayoutTestSupport.h"
    2930#include "PlatformContextSkia.h"
    3031#include "PlatformMouseEvent.h"
    31 #include "PlatformSupport.h"
    3232#include "Scrollbar.h"
    3333#include "TransformationMatrix.h"
     
    5050int ScrollbarThemeChromiumAndroid::scrollbarThickness(ScrollbarControlSize controlSize)
    5151{
    52     if (PlatformSupport::layoutTestMode()) {
     52    if (isRunningLayoutTest()) {
    5353        // Match Chromium-Linux for DumpRenderTree, so the layout test results
    5454        // can be shared. The width of scrollbar down arrow should equal the
     
    149149    // Paint black background in DumpRenderTree, otherwise the pixels in the scrollbar area depend
    150150    // on their previous state, which makes the dumped result undetermined.
    151     if (PlatformSupport::layoutTestMode())
     151    if (isRunningLayoutTest())
    152152        context->fillRect(scrollbar->frameRect(), Color::black, ColorSpaceDeviceRGB);
    153153}
  • trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumWin.cpp

    r121212 r123424  
    3232
    3333#include "GraphicsContext.h"
     34#include "LayoutTestSupport.h"
    3435#include "PlatformContextSkia.h"
    3536#include "PlatformMouseEvent.h"
     
    6263    static int thickness;
    6364    if (!thickness) {
    64         if (PlatformSupport::layoutTestMode())
     65        if (isRunningLayoutTest())
    6566            return kMacScrollbarSize[controlSize];
    6667        thickness = GetSystemMetrics(SM_CXVSCROLL);
     
    257258    // preserving this hack avoids having to rebaseline pixel tests.
    258259    const int kLayoutTestModeGirth = 17;
    259     int girth = PlatformSupport::layoutTestMode() ? kLayoutTestModeGirth : thickness;
     260    int girth = isRunningLayoutTest() ? kLayoutTestModeGirth : thickness;
    260261
    261262    if (scrollbar->orientation() == HorizontalScrollbar) {
  • trunk/Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp

    r111344 r123424  
    22 * Copyright (C) 2006, 2007 Apple Computer, Inc.
    33 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved.
    4  * 
     4 *
    55 * Redistribution and use in source and binary forms, with or without
    66 * modification, are permitted provided that the following conditions are
    77 * met:
    8  * 
     8 *
    99 *     * Redistributions of source code must retain the above copyright
    1010 * notice, this list of conditions and the following disclaimer.
     
    1616 * contributors may be used to endorse or promote products derived from
    1717 * this software without specific prior written permission.
    18  * 
     18 *
    1919 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    2020 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     
    3636#include "FontUtilsChromiumWin.h"
    3737#include "HWndDC.h"
     38#include "LayoutTestSupport.h"
    3839#include "PlatformSupport.h"
    3940#include "SimpleFontData.h"
     
    5657// |GetTextFace| (after |CreateFont*|) returns a 'bogus' value (e.g. Arial).
    5758// This is not consistent with what MSDN says !!
    58 // Therefore, before we call |CreateFont*|, we have to map a Romanized name to 
    59 // the corresponding native name under a CJK locale and vice versa 
     59// Therefore, before we call |CreateFont*|, we have to map a Romanized name to
     60// the corresponding native name under a CJK locale and vice versa
    6061// under a non-CJK locale.
    61 // See the corresponding gecko bugs at 
     62// See the corresponding gecko bugs at
    6263// https://bugzilla.mozilla.org/show_bug.cgi?id=373952
    6364// https://bugzilla.mozilla.org/show_bug.cgi?id=231426
     
    207208    }
    208209
    209     bool isAscii = false; 
     210    bool isAscii = false;
    210211    String n;
    211     // use |lower| only for ASCII names 
    212     // For non-ASCII names, we don't want to invoke an expensive 
    213     // and unnecessary |lower|. 
     212    // use |lower| only for ASCII names
     213    // For non-ASCII names, we don't want to invoke an expensive
     214    // and unnecessary |lower|.
    214215    if (name.containsOnlyASCII()) {
    215216        isAscii = true;
     
    258259// characters. Because it's family names rather than font faces we use
    259260// as keys, there might be edge cases where one face of a font family
    260 // has a different repertoire from another face of the same family. 
     261// has a different repertoire from another face of the same family.
    261262typedef HashMap<const wchar_t*, icu::UnicodeSet*> FontCmapCache;
    262263
     
    276277
    277278    HashMap<const wchar_t*, icu::UnicodeSet*>::iterator it = fontCmapCache->find(family);
    278     if (it != fontCmapCache->end()) 
     279    if (it != fontCmapCache->end())
    279280        return it->second->contains(character);
    280    
    281     HFONT hfont = fontData->hfont(); 
     281
     282    HFONT hfont = fontData->hfont();
    282283    HWndDC hdc(0);
    283284    HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(hdc, hfont));
     
    295296    GLYPHSET* glyphset = reinterpret_cast<GLYPHSET*>(glyphsetBuffer.data());
    296297    // In addition, refering to the OS/2 table and converting the codepage list
    297     // to the coverage map might be faster. 
     298    // to the coverage map might be faster.
    298299    count = GetFontUnicodeRanges(hdc, glyphset);
    299300    ASSERT(count > 0);
     
    306307    icu::UnicodeSet* cmap = new icu::UnicodeSet;
    307308    while (i < glyphset->cRanges) {
    308         WCHAR start = glyphset->ranges[i].wcLow; 
     309        WCHAR start = glyphset->ranges[i].wcLow;
    309310        cmap->add(start, start + glyphset->ranges[i].cGlyphs - 1);
    310311        i++;
     
    312313    cmap->freeze();
    313314    // We don't lowercase |family| because all of them are under our control
    314     // and they're already lowercased. 
    315     fontCmapCache->set(family, cmap); 
     315    // and they're already lowercased.
     316    fontCmapCache->set(family, cmap);
    316317    return cmap->contains(character);
    317318}
     
    355356    winfont->lfCharSet = DEFAULT_CHARSET;
    356357    winfont->lfOutPrecision = OUT_TT_ONLY_PRECIS;
    357     winfont->lfQuality = PlatformSupport::layoutTestMode() ? NONANTIALIASED_QUALITY : DEFAULT_QUALITY; // Honor user's desktop settings.
     358    winfont->lfQuality = isRunningLayoutTest() ? NONANTIALIASED_QUALITY : DEFAULT_QUALITY; // Honor user's desktop settings.
    358359    winfont->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
    359360    winfont->lfItalic = fontDescription.italic();
     
    434435    FontPlatformData* data = 0;
    435436    if (family)
    436         data = getCachedFontPlatformData(font.fontDescription(),  AtomicString(family, wcslen(family)), false); 
     437        data = getCachedFontPlatformData(font.fontDescription(),  AtomicString(family, wcslen(family)), false);
    437438
    438439    // Last resort font list : PanUnicode. CJK fonts have a pretty
     
    493494    int i;
    494495    for (i = 0; (!data || !fontContainsCharacter(data, family, c)) && i < numFonts; ++i) {
    495         family = panUniFonts[i]; 
     496        family = panUniFonts[i];
    496497        data = getCachedFontPlatformData(font.fontDescription(), AtomicString(family, wcslen(family)));
    497498    }
     
    604605    FillLogFont(fontDescription, &winfont);
    605606
    606     // Windows will always give us a valid pointer here, even if the face name 
    607     // is non-existent.  We have to double-check and see if the family name was
     607    // Windows will always give us a valid pointer here, even if the face name
     608    // is non-existent. We have to double-check and see if the family name was
    608609    // really used.
    609610    String winName;
     
    615616    // when we're running in layout-test mode?
    616617    if (!equalIgnoringCase(family, winName)) {
    617         // For CJK fonts with both English and native names, 
     618        // For CJK fonts with both English and native names,
    618619        // GetTextFace returns a native name under the font's "locale"
    619         // and an English name under other locales regardless of 
     620        // and an English name under other locales regardless of
    620621        // lfFaceName field of LOGFONT. As a result, we need to check
    621622        // if a font has an alternate name. If there is, we need to
    622623        // compare it with what's requested in the first place.
    623624        String altName;
    624         if (!LookupAltName(family, altName) ||
    625             !equalIgnoringCase(altName, winName)) {
     625        if (!LookupAltName(family, altName) || !equalIgnoringCase(altName, winName)) {
    626626            DeleteObject(hfont);
    627627            return 0;
  • trunk/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp

    r122652 r123424  
    33 * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved.
    44 * Copyright (C) 2010 Company 100, Inc.
    5  * 
     5 *
    66 * Redistribution and use in source and binary forms, with or without
    77 * modification, are permitted provided that the following conditions are
    88 * met:
    9  * 
     9 *
    1010 *     * Redistributions of source code must retain the above copyright
    1111 * notice, this list of conditions and the following disclaimer.
     
    1717 * contributors may be used to endorse or promote products derived from
    1818 * this software without specific prior written permission.
    19  * 
     19 *
    2020 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    2121 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     
    3636#if OS(WINDOWS)
    3737#include "OpenTypeUtilities.h"
    38 #include "PlatformSupport.h"
    3938#elif OS(UNIX)
    4039#include "SkStream.h"
     
    4241
    4342#include "FontPlatformData.h"
     43#include "LayoutTestSupport.h"
    4444#include "NotImplemented.h"
    4545#include "OpenTypeSanitizer.h"
     
    8484
    8585    // FIXME: almost identical to FillLogFont in FontCacheWin.cpp.
    86     // Need to refactor. 
     86    // Need to refactor.
    8787    logFont.lfHeight = -size;
    8888    logFont.lfWidth = 0;
     
    9393    logFont.lfCharSet = DEFAULT_CHARSET;
    9494    logFont.lfOutPrecision = OUT_TT_ONLY_PRECIS;
    95     logFont.lfQuality = PlatformSupport::layoutTestMode() ?
     95    logFont.lfQuality = isRunningLayoutTest() ?
    9696                        NONANTIALIASED_QUALITY :
    9797                        DEFAULT_QUALITY; // Honor user's desktop settings.
  • trunk/Source/WebCore/platform/graphics/skia/FontSkia.cpp

    r114607 r123424  
    11/*
    22 * Copyright (c) 2011 Google Inc. All rights reserved.
    3  * 
     3 *
    44 * Redistribution and use in source and binary forms, with or without
    55 * modification, are permitted provided that the following conditions are
    66 * met:
    7  * 
     7 *
    88 *     * Redistributions of source code must retain the above copyright
    99 * notice, this list of conditions and the following disclaimer.
     
    1515 * contributors may be used to endorse or promote products derived from
    1616 * this software without specific prior written permission.
    17  * 
     17 *
    1818 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    1919 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     
    3434#include "GlyphBuffer.h"
    3535#include "GraphicsContext.h"
     36#include "LayoutTestSupport.h"
    3637#include "PlatformContextSkia.h"
    37 #include "PlatformSupport.h"
    3838#include "SimpleFontData.h"
    3939
     
    8484    bool shouldSmoothFonts = true;
    8585    bool shouldAntialias = true;
    86    
     86
    8787    switch (fontDescription().fontSmoothing()) {
    8888    case Antialiased:
     
    9797    case AutoSmoothing:
    9898        // For the AutoSmooth case, don't do anything! Keep the default settings.
    99         break; 
     99        break;
    100100    }
    101    
    102     if (!shouldUseSmoothing() || PlatformSupport::layoutTestMode())
     101
     102    if (!shouldUseSmoothing() || isRunningLayoutTest())
    103103        shouldSmoothFonts = false;
    104104
  • trunk/Source/WebCore/rendering/RenderThemeChromiumAndroid.cpp

    r122740 r123424  
    2929#include "CSSValueKeywords.h"
    3030#include "Color.h"
     31#include "LayoutTestSupport.h"
    3132#include "PaintInfo.h"
    3233#include "PlatformSupport.h"
     
    5758Color RenderThemeChromiumAndroid::systemColor(int cssValueId) const
    5859{
    59     if (PlatformSupport::layoutTestMode() && cssValueId == CSSValueButtonface) {
     60    if (isRunningLayoutTest() && cssValueId == CSSValueButtonface) {
    6061        // Match Chromium Linux' button color in layout tests.
    6162        static const Color linuxButtonGrayColor(0xffdddddd);
     
    7879void RenderThemeChromiumAndroid::adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle* style, Element*) const
    7980{
    80     if (PlatformSupport::layoutTestMode()) {
     81    if (isRunningLayoutTest()) {
    8182        // Match Chromium Linux spin button style in layout tests.
    8283        // FIXME: Consider removing the conditional if a future Android theme matches this.
  • trunk/Source/WebCore/rendering/RenderThemeChromiumMac.mm

    r120414 r123424  
    2222
    2323#import "CalendarPickerMac.h"
     24#import "LayoutTestSupport.h"
    2425#import "LocalCurrentGraphicsContext.h"
    2526#import "RenderThemeChromiumMac.h"
    2627#import "PaintInfo.h"
    27 #import "PlatformSupport.h"
    2828#import "RenderMediaControlsChromium.h"
    2929#import "WebCoreSystemInterface.h"
     
    8181bool RenderThemeChromiumMac::usesTestModeFocusRingColor() const
    8282{
    83     return PlatformSupport::layoutTestMode();
     83    return isRunningLayoutTest();
    8484}
    8585
  • trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp

    r123300 r123424  
    3030#include "HTMLNames.h"
    3131#include "Image.h"
     32#include "LayoutTestSupport.h"
    3233#include "MediaControlElements.h"
    3334#include "PaintInfo.h"
    34 #include "PlatformSupport.h"
    3535#include "PlatformContextSkia.h"
    3636#include "RenderBox.h"
     
    161161    // Disable the blinking caret in layout test mode, as it introduces
    162162    // a race condition for the pixel tests. http://b/1198440
    163     if (PlatformSupport::layoutTestMode())
     163    if (isRunningLayoutTest())
    164164        return 0;
    165165
  • trunk/Source/WebCore/rendering/RenderThemeChromiumWin.cpp

    r123300 r123424  
    3737#include "HTMLNames.h"
    3838#include "HWndDC.h"
     39#include "LayoutTestSupport.h"
    3940#include "MediaControlElements.h"
    4041#include "PaintInfo.h"
     
    248249Color RenderThemeChromiumWin::platformActiveSelectionBackgroundColor() const
    249250{
    250     if (PlatformSupport::layoutTestMode())
     251    if (isRunningLayoutTest())
    251252        return Color(0x00, 0x00, 0xff); // Royal blue.
    252253    COLORREF color = GetSysColor(COLOR_HIGHLIGHT);
     
    256257Color RenderThemeChromiumWin::platformInactiveSelectionBackgroundColor() const
    257258{
    258     if (PlatformSupport::layoutTestMode())
     259    if (isRunningLayoutTest())
    259260        return Color(0x99, 0x99, 0x99); // Medium gray.
    260261    COLORREF color = GetSysColor(COLOR_GRAYTEXT);
     
    264265Color RenderThemeChromiumWin::platformActiveSelectionForegroundColor() const
    265266{
    266     if (PlatformSupport::layoutTestMode())
     267    if (isRunningLayoutTest())
    267268        return Color(0xff, 0xff, 0xcc); // Pale yellow.
    268269    COLORREF color = GetSysColor(COLOR_HIGHLIGHTTEXT);
     
    385386{
    386387    int sysColorIndex = cssValueIdToSysColorIndex(cssValueId);
    387     if (PlatformSupport::layoutTestMode() || (sysColorIndex == -1))
     388    if (isRunningLayoutTest() || (sysColorIndex == -1))
    388389        return RenderTheme::systemColor(cssValueId);
    389390
     
    480481static int menuListButtonWidth()
    481482{
    482     static int width = PlatformSupport::layoutTestMode() ? kStandardMenuListButtonWidth : GetSystemMetrics(SM_CXVSCROLL);
     483    static int width = isRunningLayoutTest() ? kStandardMenuListButtonWidth : GetSystemMetrics(SM_CXVSCROLL);
    483484    return width;
    484485}
     
    604605    // So are readonly text fields.
    605606    if (isReadOnlyControl(o) && (part == TextFieldPart || part == TextAreaPart || part == SearchFieldPart))
    606         return result;   
     607        return result;
    607608
    608609    if (part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart) {
  • trunk/Source/WebKit/chromium/ChangeLog

    r123421 r123424  
     12012-07-23  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        [Chromium] Move layoutTestMode to WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=92010
     5
     6        Reviewed by Adam Barth.
     7
     8        Part of a refactoring series. See tracking bug 82948.
     9
     10        * src/PlatformSupport.cpp:
     11        (WebCore):
     12        * src/WebKit.cpp:
     13        (WebKit::setLayoutTestMode):
     14        (WebKit::layoutTestMode):
     15
    1162012-07-23  Dave Tu  <dtu@chromium.org>
    217
  • trunk/Source/WebKit/chromium/src/PlatformSupport.cpp

    r123014 r123424  
    303303}
    304304
    305 // LayoutTestMode -------------------------------------------------------------
    306 
    307 bool PlatformSupport::layoutTestMode()
    308 {
    309     return WebKit::layoutTestMode();
    310 }
    311 
    312305// Plugin ---------------------------------------------------------------------
    313306
  • trunk/Source/WebKit/chromium/src/WebKit.cpp

    r122159 r123424  
    3232#include "WebKit.h"
    3333
     34#include "LayoutTestSupport.h"
    3435#include "Logging.h"
    3536#include "MutationObserver.h"
     
    8283
    8384static WebKitPlatformSupport* s_webKitPlatformSupport = 0;
    84 static bool s_layoutTestMode = false;
    8585
    8686static bool generateEntropy(unsigned char* buffer, size_t length)
     
    177177void setLayoutTestMode(bool value)
    178178{
    179     s_layoutTestMode = value;
     179    WebCore::setIsRunningLayoutTest(value);
    180180}
    181181
    182182bool layoutTestMode()
    183183{
    184     return s_layoutTestMode;
     184    return WebCore::isRunningLayoutTest();
    185185}
    186186
Note: See TracChangeset for help on using the changeset viewer.