Title: [102199] branches/safari-534.53-branch/Source/WebCore

Diff

Modified: branches/safari-534.53-branch/Source/WebCore/ChangeLog (102198 => 102199)


--- branches/safari-534.53-branch/Source/WebCore/ChangeLog	2011-12-07 01:23:39 UTC (rev 102198)
+++ branches/safari-534.53-branch/Source/WebCore/ChangeLog	2011-12-07 01:29:05 UTC (rev 102199)
@@ -1,5 +1,23 @@
 2011-12-06  Lucas Forschler  <[email protected]>
 
+    Merge 97517
+
+    2011-10-14  Beth Dakin  <[email protected]>
+
+            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):
+
+2011-12-06  Lucas Forschler  <[email protected]>
+
     Merge 95697
 
     2011-09-21  Beth Dakin  <[email protected]>

Modified: branches/safari-534.53-branch/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm (102198 => 102199)


--- branches/safari-534.53-branch/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm	2011-12-07 01:23:39 UTC (rev 102198)
+++ branches/safari-534.53-branch/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm	2011-12-07 01:29:05 UTC (rev 102199)
@@ -82,9 +82,13 @@
 }
 
 
-static NSColor* createPatternColor(NSString* name, NSColor* defaultColor, bool& usingDot)
+static NSColor* createPatternColor(NSString* firstChoiceName, NSString* secondChoiceName, NSColor* defaultColor, bool& usingDot)
 {
-    NSImage *image = [NSImage imageNamed:name];
+    // Eventually we should be able to get rid of the secondChoiceName. For the time being we need both to keep
+    // this working on all platforms.
+    NSImage *image = [NSImage imageNamed:firstChoiceName];
+    if (!image)
+        image = [NSImage imageNamed:secondChoiceName];
     ASSERT(image); // if image is not available, we want to know
     NSColor *color = (image ? [NSColor colorWithPatternImage:image] : nil);
     if (color)
@@ -111,7 +115,7 @@
         {
             // Constants for spelling pattern color.
             static bool usingDotForSpelling = false;
-            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, spellingPatternColor, (createPatternColor(@"SpellingDot", [NSColor redColor], usingDotForSpelling)));
+            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, spellingPatternColor, (createPatternColor(@"NSSpellingDot", @"SpellingDot", [NSColor redColor], usingDotForSpelling)));
             usingDot = usingDotForSpelling;
             patternColor = spellingPatternColor.get();
             break;
@@ -120,7 +124,7 @@
         {
             // Constants for grammar pattern color.
             static bool usingDotForGrammar = false;
-            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, grammarPatternColor, (createPatternColor(@"GrammarDot", [NSColor greenColor], usingDotForGrammar)));
+            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, grammarPatternColor, (createPatternColor(@"NSGrammarDot", @"GrammarDot", [NSColor greenColor], usingDotForGrammar)));
             usingDot = usingDotForGrammar;
             patternColor = grammarPatternColor.get();
             break;
@@ -131,7 +135,7 @@
         {
             // Constants for spelling pattern color.
             static bool usingDotForSpelling = false;
-            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, spellingPatternColor, (createPatternColor(@"CorrectionDot", [NSColor blueColor], usingDotForSpelling)));
+            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, spellingPatternColor, (createPatternColor(@"NSCorrectionDot", @"CorrectionDot", [NSColor blueColor], usingDotForSpelling)));
             usingDot = usingDotForSpelling;
             patternColor = spellingPatternColor.get();
             break;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to