⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 97517 in webkit


Ignore:
Timestamp:
Oct 14, 2011, 3:13:39 PM (15 years ago)
Author:
Beth Dakin
Message:

https://bugs.webkit.org/show_bug.cgi?id=70148
Should switch to CoreUI version of CorrectionDot, GrammarDot, and SpellingDot
-and corresponding-
<rdar://problem/10208281>

Reviewed by Anders Carlsson.

Use NS*Dot whenever it's available, and fallback to *Dot only when it is not.

  • platform/graphics/mac/GraphicsContextMac.mm:

(WebCore::createPatternColor):
(WebCore::GraphicsContext::drawLineForTextChecking):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r97516 r97517  
     12011-10-14  Beth Dakin  <bdakin@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=70148
     4        Should switch to CoreUI version of CorrectionDot, GrammarDot, and SpellingDot
     5        -and corresponding-
     6        <rdar://problem/10208281>
     7
     8        Reviewed by Anders Carlsson.
     9
     10        Use NS*Dot whenever it's available, and fallback to *Dot only when it is not.
     11        * platform/graphics/mac/GraphicsContextMac.mm:
     12        (WebCore::createPatternColor):
     13        (WebCore::GraphicsContext::drawLineForTextChecking):
     14
    1152011-10-14  Dmitry Lomov  <dslomov@google.com>
    216
  • trunk/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm

    r85036 r97517  
    8383
    8484
    85 static NSColor* createPatternColor(NSString* name, NSColor* defaultColor, bool& usingDot)
     85static NSColor* createPatternColor(NSString* firstChoiceName, NSString* secondChoiceName, NSColor* defaultColor, bool& usingDot)
    8686{
    87     NSImage *image = [NSImage imageNamed:name];
     87    // Eventually we should be able to get rid of the secondChoiceName. For the time being we need both to keep
     88    // this working on all platforms.
     89    NSImage *image = [NSImage imageNamed:firstChoiceName];
     90    if (!image)
     91        image = [NSImage imageNamed:secondChoiceName];
    8892    ASSERT(image); // if image is not available, we want to know
    8993    NSColor *color = (image ? [NSColor colorWithPatternImage:image] : nil);
     
    112116            // Constants for spelling pattern color.
    113117            static bool usingDotForSpelling = false;
    114             DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, spellingPatternColor, (createPatternColor(@"SpellingDot", [NSColor redColor], usingDotForSpelling)));
     118            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, spellingPatternColor, (createPatternColor(@"NSSpellingDot", @"SpellingDot", [NSColor redColor], usingDotForSpelling)));
    115119            usingDot = usingDotForSpelling;
    116120            patternColor = spellingPatternColor.get();
     
    121125            // Constants for grammar pattern color.
    122126            static bool usingDotForGrammar = false;
    123             DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, grammarPatternColor, (createPatternColor(@"GrammarDot", [NSColor greenColor], usingDotForGrammar)));
     127            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, grammarPatternColor, (createPatternColor(@"NSGrammarDot", @"GrammarDot", [NSColor greenColor], usingDotForGrammar)));
    124128            usingDot = usingDotForGrammar;
    125129            patternColor = grammarPatternColor.get();
     
    132136            // Constants for spelling pattern color.
    133137            static bool usingDotForSpelling = false;
    134             DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, spellingPatternColor, (createPatternColor(@"CorrectionDot", [NSColor blueColor], usingDotForSpelling)));
     138            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, spellingPatternColor, (createPatternColor(@"NSCorrectionDot", @"CorrectionDot", [NSColor blueColor], usingDotForSpelling)));
    135139            usingDot = usingDotForSpelling;
    136140            patternColor = spellingPatternColor.get();
Note: See TracChangeset for help on using the changeset viewer.