WebCore:
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Aug 2007 14:32:21 +0000 (14:32 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Aug 2007 14:32:21 +0000 (14:32 +0000)
        Reviewed by Adam Roben

        WebCore part of fix for:
        <rdar://problem/5417777> WebKit focus ring color no longer matches system focus rings

        Adele wrote the first version of this patch. No test cases added because I made sure the
        layout tests are unaffected. Two additional bug fixes were made in passing, but neither
        of them had any effect on any known real-world case, and both were too difficult to write
        test cases for to be worthwhile.

        * WebCore.exp:
        added symbols for these new functions so WebKit can call them

        * WebCore.xcodeproj/project.pbxproj:
        updated for new file

        * platform/graphics/mac/ColorMac.h: Added.
        New file to hold the increasing amount of Mac-specific color stuff.

        * platform/graphics/Color.h:
        removed #if PLATFORM(MAC) code, which is now in ColorMac.h

        * platform/graphics/mac/ColorMac.mm:
        (WebCore::makeRGBAFromNSColor):
        new static function to convert an NSColor object to an RGBA32 struct
        (WebCore::colorFromNSColor):
        new public function to convert an NSColor object to a WebCore-style Color object
        (WebCore::focusRingColor):
        Uses (cached) systemFocusRingColor instead of hardwired values, unless usesTestModeFocusRingColor is true,
        in which case it uses the old hardwired color
        (WebCore::usesTestModeFocusRingColor):
        returns value of global var
        (WebCore::setUsesTestModeFocusRingColor):
        sets value of global var
        (+[WebCoreControlTintObserver controlTintDidChange]):
        Uses [NSColor keyboardFocusIndicatorColor] to set systemFocusRingColor; don't compile if COLORMATCH_EVERYTHING
        is set since we don't know what it would take to satisfy this state.

        * bindings/objc/DOMRGBColor.mm:
        now includes ColorMac.h to account for moved declarations
        * bridge/mac/WebCoreAXObject.mm:
        ditto

        * page/mac/FrameMac.mm:
        (WebCore::convertAttributesToUnderlines):
        now uses new colorFromNSColor. The old code was swapping G & B, but it didn't matter in practice because
        this function is only used to convert the color of an input manager's marked text underline, which is always black

        * page/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge setBaseBackgroundColor:]):
        now uses new colorFromNSColor. The old code was swapping G & B, but it didn't matter in practice because
        this function is only called with a grayscale color perhaps containing an alpha value

        * rendering/RenderView.cpp:
        (WebCore::RenderView::paintBoxDecorations):
        just updated a comment

WebKit:

        Reviewed by Adam Roben

        WebKit part of fix for:
        <rdar://problem/5417777> WebKit focus ring color no longer matches system focus rings

        * Misc/WebNSAttributedStringExtras.mm:
        now includes <WebCore/ColorMac.h> to account for moved declaration
        * WebView/WebFrame.mm:
        ditto

        * WebView/WebViewPrivate.h:
        * WebView/WebView.mm:
        (+[WebView _setUsesTestModeFocusRingColor:]):
        new SPI, calls through to new WebCore function. This is used by DumpRenderTree to make sure the
        focus ring color is always the same when performing layout tests, regardless of OS X version.
        (+[WebView _usesTestModeFocusRingColor]):
        new SPI, calls through to new WebCore function

WebKitTools:

        Reviewed by Adam Roben

        * DumpRenderTree/DumpRenderTree.m:
        (runTest):
        call new +[WebView _setUsesTestModeFocusRingColor:YES] so we get the same focus ring colors
        in layout tests on Tiger and Leopard

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25169 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/objc/DOMRGBColor.mm
WebCore/bridge/mac/WebCoreAXObject.mm
WebCore/page/mac/FrameMac.mm
WebCore/page/mac/WebCoreFrameBridge.mm
WebCore/platform/graphics/Color.h
WebCore/platform/graphics/mac/ColorMac.h [new file with mode: 0644]
WebCore/platform/graphics/mac/ColorMac.mm
WebCore/rendering/RenderView.cpp
WebKit/ChangeLog
WebKit/Misc/WebNSAttributedStringExtras.mm
WebKit/WebView/WebFrame.mm
WebKit/WebView/WebView.mm
WebKit/WebView/WebViewPrivate.h
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.m

index 8d0bf40bc6e917fabf2b2753272b5a35c4446696..64f1ea3767927086054eeec8244cb6019effc2d9 100644 (file)
@@ -1,3 +1,62 @@
+2007-08-20  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Adam Roben
+
+        WebCore part of fix for: 
+        <rdar://problem/5417777> WebKit focus ring color no longer matches system focus rings
+        
+        Adele wrote the first version of this patch. No test cases added because I made sure the 
+        layout tests are unaffected. Two additional bug fixes were made in passing, but neither 
+        of them had any effect on any known real-world case, and both were too difficult to write 
+        test cases for to be worthwhile.
+
+        * WebCore.exp:
+        added symbols for these new functions so WebKit can call them
+        
+        * WebCore.xcodeproj/project.pbxproj:
+        updated for new file
+        
+        * platform/graphics/mac/ColorMac.h: Added.
+        New file to hold the increasing amount of Mac-specific color stuff.
+        
+        * platform/graphics/Color.h:
+        removed #if PLATFORM(MAC) code, which is now in ColorMac.h
+        
+        * platform/graphics/mac/ColorMac.mm:
+        (WebCore::makeRGBAFromNSColor):
+        new static function to convert an NSColor object to an RGBA32 struct
+        (WebCore::colorFromNSColor):
+        new public function to convert an NSColor object to a WebCore-style Color object
+        (WebCore::focusRingColor):
+        Uses (cached) systemFocusRingColor instead of hardwired values, unless usesTestModeFocusRingColor is true,
+        in which case it uses the old hardwired color
+        (WebCore::usesTestModeFocusRingColor):
+        returns value of global var
+        (WebCore::setUsesTestModeFocusRingColor):
+        sets value of global var
+        (+[WebCoreControlTintObserver controlTintDidChange]):
+        Uses [NSColor keyboardFocusIndicatorColor] to set systemFocusRingColor; don't compile if COLORMATCH_EVERYTHING
+        is set since we don't know what it would take to satisfy this state.
+
+        * bindings/objc/DOMRGBColor.mm:
+        now includes ColorMac.h to account for moved declarations
+        * bridge/mac/WebCoreAXObject.mm:
+        ditto
+        
+        * page/mac/FrameMac.mm:
+        (WebCore::convertAttributesToUnderlines):
+        now uses new colorFromNSColor. The old code was swapping G & B, but it didn't matter in practice because
+        this function is only used to convert the color of an input manager's marked text underline, which is always black
+        
+        * page/mac/WebCoreFrameBridge.mm:
+        (-[WebCoreFrameBridge setBaseBackgroundColor:]):
+        now uses new colorFromNSColor. The old code was swapping G & B, but it didn't matter in practice because
+        this function is only called with a grayscale color perhaps containing an alpha value
+                
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::paintBoxDecorations):
+        just updated a comment
+
 2007-08-20  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Dave Hyatt.
         (WebCore::RenderPartObject::layout):
         Call updateWidget here if m_widget is 0, causing the plug-in to be instantiated.
         
+>>>>>>> .r25158
 2007-08-17  Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Maciej.
index a37356d93b099e91df8f96f9e55edd7fc1aba134..7f654c6b605a267a26422172c2f2ff01d3940a0e 100644 (file)
@@ -604,6 +604,8 @@ __ZNK7WebCore19ResourceRequestBase3urlEv
 __ZNK7WebCore19ResourceRequestBase7isEmptyEv
 __ZNK7WebCore19SelectionController17isInPasswordFieldEv
 __ZNK7WebCore26NetscapePlugInStreamLoader6isDoneEv
+__ZN7WebCore26usesTestModeFocusRingColorEv
+__ZN7WebCore29setUsesTestModeFocusRingColorEb
 __ZNK7WebCore4Font11primaryFontEv
 __ZNK7WebCore4KURL17lastPathComponentEv
 __ZNK7WebCore4KURL4hostEv
index eeaf101352327f9b6497a10279a63639c81a4416..52dbca99c54d61da45e406115ae592d97c3ad13a 100644 (file)
                ED048ABC0833F132006E1E67 /* textAreaResizeCorner.tiff in Resources */ = {isa = PBXBuildFile; fileRef = ED048ABB0833F132006E1E67 /* textAreaResizeCorner.tiff */; };
                ED2BA83C09A24B91006C0AC4 /* DocumentMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */; settings = {ATTRIBUTES = (Private, ); }; };
                ED501DC60B249F2900AE18D9 /* EditorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED501DC50B249F2900AE18D9 /* EditorMac.mm */; };
+               EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE3A4FF0C7A430600956A37 /* ColorMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                EDEC98030AED7E170059137F /* WebCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EDEC98020AED7E170059137F /* WebCorePrefix.h */; };
                F971E27FD70F4382BC66D792 /* BidiContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A579C284B928484FB9A446BC /* BidiContext.cpp */; };
                FAE0418F097596C9000540BE /* SVGImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAE0418D097596C9000540BE /* SVGImageLoader.cpp */; };
                ED048ABB0833F132006E1E67 /* textAreaResizeCorner.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = textAreaResizeCorner.tiff; sourceTree = "<group>"; };
                ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentMarker.h; sourceTree = "<group>"; };
                ED501DC50B249F2900AE18D9 /* EditorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = EditorMac.mm; path = mac/EditorMac.mm; sourceTree = "<group>"; };
+               EDE3A4FF0C7A430600956A37 /* ColorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorMac.h; sourceTree = "<group>"; };
                EDEC98020AED7E170059137F /* WebCorePrefix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCorePrefix.h; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; };
                F523D23B02DE4396018635CA /* HTMLDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLDocument.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D23C02DE4396018635CA /* HTMLDocument.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLDocument.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                B275354F0B053814002CE64F /* IntPointMac.mm */,
                                B27535500B053814002CE64F /* IntRectMac.mm */,
                                B27535510B053814002CE64F /* IntSizeMac.mm */,
+                               EDE3A4FF0C7A430600956A37 /* ColorMac.h */,
                        );
                        path = mac;
                        sourceTree = "<group>";
                                0F31CBF92B654730BA0535E8 /* BidiContext.h in Headers */,
                                1432E8470C51493800B1500F /* GCController.h in Headers */,
                                514B3F730C722047000530DF /* FileSystem.h in Headers */,
+                               EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
-                       projectRoot = "";
                        targets = (
                                93F198A508245E59001E9ABC /* WebCore */,
                                DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
index a163c3f0baa200ecc7d369e8020f78e608ddf5a9..41e872af93299fe93e1af033bae7b19fda76db4c 100644 (file)
@@ -29,6 +29,7 @@
 
 #import "CSSPrimitiveValue.h"
 #import "Color.h"
+#import "ColorMac.h"
 #import "DOMCSSPrimitiveValue.h"
 #import "DOMInternal.h"
 #import "WebCoreObjCExtras.h"
index 897d2d8ed6a47a3954740e1ef9b4c941785e9405..f00d911b1fce5e7b964c1a30eb5dbd2ee263d536 100644 (file)
@@ -27,6 +27,7 @@
 #import "WebCoreAXObject.h"
 
 #import "DOMInternal.h"
+#import "ColorMac.h"
 #import "Document.h"
 #import "EventNames.h"
 #import "FocusController.h"
index 3364f9a2cd477686919b3b5a44ad2215f94d487f..8f79298447ba3fbf3d9b436872b78a4e7d668c57 100644 (file)
@@ -36,6 +36,7 @@
 #import "Chrome.h"
 #import "ClipboardEvent.h"
 #import "ClipboardMac.h"
+#import "ColorMac.h"
 #import "Cursor.h"
 #import "DOMInternal.h"
 #import "DocumentLoader.h"
@@ -540,13 +541,8 @@ static void convertAttributesToUnderlines(Vector<MarkedTextUnderline>& result, c
         NSRange range = [[ranges objectAtIndex:i] rangeValue];
         NSColor* color = [[attributes objectAtIndex:i] objectForKey:NSUnderlineColorAttributeName];
         Color qColor = Color::black;
-        if (color) {
-            NSColor* deviceColor = [color colorUsingColorSpaceName:NSDeviceRGBColorSpace];
-            qColor = Color(makeRGBA((int)(255 * [deviceColor redComponent]),
-                                    (int)(255 * [deviceColor blueComponent]),
-                                    (int)(255 * [deviceColor greenComponent]),
-                                    (int)(255 * [deviceColor alphaComponent])));
-        }
+        if (color)
+            qColor = colorFromNSColor([color colorUsingColorSpaceName:NSDeviceRGBColorSpace]);
 
         result.append(MarkedTextUnderline(range.location + baseOffset, 
                                           range.location + baseOffset + range.length, 
index 375b246add4cc0e025bfe18821a10b17a09e0a28..82bdd77b2476c82cd69995aea690228843a0b296 100644 (file)
@@ -32,6 +32,7 @@
 #import "CSSHelper.h"
 #import "Cache.h"
 #import "ClipboardMac.h"
+#import "ColorMac.h"
 #import "DOMImplementation.h"
 #import "DOMInternal.h"
 #import "DOMWindow.h"
@@ -817,11 +818,7 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
 - (void)setBaseBackgroundColor:(NSColor *)backgroundColor
 {
     if (m_frame && m_frame->view()) {
-        NSColor *deviceColor = [backgroundColor colorUsingColorSpaceName:NSDeviceRGBColorSpace];
-        Color color = Color(makeRGBA((int)(255 * [deviceColor redComponent]),
-                                     (int)(255 * [deviceColor blueComponent]),
-                                     (int)(255 * [deviceColor greenComponent]),
-                                     (int)(255 * [deviceColor alphaComponent])));
+        Color color = colorFromNSColor([backgroundColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]);
         m_frame->view()->setBaseBackgroundColor(color);
     }
 }
index cdd03ed9c0ad8decc97934e5dda4e51987d665f6..676c5e6f6254d667ba2aabf1257bd2873c684660 100644 (file)
 
 #include <wtf/Platform.h>
 
-#if PLATFORM(MAC)
-#ifdef __OBJC__
-@class NSColor;
-#else
-class NSColor;
-#endif
-#endif
-
 #if PLATFORM(CG)
 typedef struct CGColor* CGColorRef;
 #endif
@@ -122,10 +114,6 @@ inline bool operator!=(const Color& a, const Color& b)
 Color focusRingColor();
 void setFocusRingColorChangeFunction(void (*)());
 
-#if PLATFORM(MAC)
-NSColor* nsColor(const Color&);
-#endif
-
 #if PLATFORM(CG)
 CGColorRef cgColor(const Color&);
 #endif
diff --git a/WebCore/platform/graphics/mac/ColorMac.h b/WebCore/platform/graphics/mac/ColorMac.h
new file mode 100644 (file)
index 0000000..3be9094
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 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 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 COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * 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. 
+ */
+
+#ifndef ColorMac_h
+#define ColorMac_h
+
+#include "Color.h"
+
+#ifdef __OBJC__
+@class NSColor;
+#else
+class NSColor;
+#endif
+
+namespace WebCore {
+    
+    Color colorFromNSColor(NSColor *);
+    NSColor* nsColor(const Color&);
+
+    bool usesTestModeFocusRingColor();
+    void setUsesTestModeFocusRingColor(bool);
+    
+}
+
+#endif
index 571b91342396cc8a0f5922be1255d10f5328358f..5c89715e6c41884cb4e612f3ffe6bb975434814d 100644 (file)
@@ -25,6 +25,7 @@
 
 #import "config.h"
 #import "Color.h"
+#import "ColorMac.h"
 
 #import <wtf/Assertions.h>
 #import <wtf/RetainPtr.h>
@@ -37,9 +38,22 @@ namespace WebCore {
 
 // NSColor calls don't throw, so no need to block Cocoa exceptions in this file
 
+static RGBA32 oldAquaFocusRingColor = 0xFF7DADD9;
 static bool tintIsKnown;
-static bool tintIsKnownToBeGraphite;
 static void (*tintChangeFunction)();
+static RGBA32 systemFocusRingColor;
+static bool useOldAquaFocusRingColor;
+
+
+static RGBA32 makeRGBAFromNSColor(NSColor *c)
+{
+    return makeRGBA((int)(255 * [c redComponent]), (int)(255 * [c greenComponent]), (int)(255 * [c blueComponent]), (int)(255 * [c alphaComponent]));
+}
+
+Color colorFromNSColor(NSColor *c)
+{
+    return Color(makeRGBAFromNSColor(c));
+}
 
 NSColor* nsColor(const Color& color)
 {
@@ -135,7 +149,21 @@ Color focusRingColor()
 {
     if (!tintIsKnown)
         observeTint();
-    return tintIsKnownToBeGraphite ? 0xFF9CABBD : 0xFF7DADD9;
+    
+    if (usesTestModeFocusRingColor())
+        return oldAquaFocusRingColor;
+    
+    return systemFocusRingColor;
+}
+
+bool usesTestModeFocusRingColor()
+{
+    return useOldAquaFocusRingColor;
+}
+
+void setUsesTestModeFocusRingColor(bool newValue)
+{
+    useOldAquaFocusRingColor = newValue;
 }
 
 }
@@ -144,7 +172,12 @@ Color focusRingColor()
 
 + (void)controlTintDidChange
 {
-    WebCore::tintIsKnownToBeGraphite = [NSColor currentControlTint] == NSGraphiteControlTint;
+#ifdef COLORMATCH_EVERYTHING
+#error Not yet implemented.
+#else
+    NSColor* color = [[NSColor keyboardFocusIndicatorColor] colorUsingColorSpaceName:NSDeviceRGBColorSpace];
+    WebCore::systemFocusRingColor = WebCore::makeRGBAFromNSColor(color);
+#endif
 }
 
 @end
index f3c55539ee2d17d16486c64b0b54d92382a54061..1dc9a6ba772365292db3939dc835a6153a65bc79 100644 (file)
@@ -161,8 +161,8 @@ void RenderView::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
         return;
 
     // This code typically only executes if the root element's visibility has been set to hidden.
-    // Only fill with white if we're the root document, since iframes/frames with
-    // no background in the child document should show the parent's background.
+    // Only fill with the base background color (typically white) if we're the root document, 
+    // since iframes/frames with no background in the child document should show the parent's background.
     if (view()->isTransparent())
         frameView()->setUseSlowRepaints(); // The parent must show behind the child.
     else {
index dc3d4e2996c0658e994820e46a1b64a7dbd4dc2a..616f167c499fa0c7952ac49a8ba1a8943dbb59f6 100644 (file)
@@ -1,3 +1,23 @@
+2007-08-20  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Adam Roben
+        
+        WebKit part of fix for: 
+        <rdar://problem/5417777> WebKit focus ring color no longer matches system focus rings
+
+        * Misc/WebNSAttributedStringExtras.mm:
+        now includes <WebCore/ColorMac.h> to account for moved declaration
+        * WebView/WebFrame.mm:
+        ditto
+        
+        * WebView/WebViewPrivate.h:
+        * WebView/WebView.mm:
+        (+[WebView _setUsesTestModeFocusRingColor:]):
+        new SPI, calls through to new WebCore function. This is used by DumpRenderTree to make sure the
+        focus ring color is always the same when performing layout tests, regardless of OS X version.
+        (+[WebView _usesTestModeFocusRingColor]):
+        new SPI, calls through to new WebCore function
+
 2007-08-20  Antti Koivisto  <antti@apple.com>
 
         Reviewed by John.
index 64ac73b5ba369fda839102d7cfd6081846ecf4c1..f6661b3a67240b930113ce05fdda0068ec612241 100644 (file)
@@ -34,6 +34,7 @@
 #import "WebFrameBridge.h"
 #import "WebFrameInternal.h"
 #import <WebCore/BlockExceptions.h>
+#import <WebCore/ColorMac.h>
 #import <WebCore/CSSHelper.h>
 #import <WebCore/Document.h>
 #import <WebCore/Element.h>
index 304094d2a310250e3abfd1a5f239f9f6a8bd2ea2..432b1a3c64648d10984a5a2f743a5609fe8bec9c 100644 (file)
@@ -59,6 +59,7 @@
 #import "WebScriptDebugDelegatePrivate.h"
 #import "WebViewInternal.h"
 #import <WebCore/Chrome.h>
+#import <WebCore/ColorMac.h>
 #import <WebCore/Document.h>
 #import <WebCore/Event.h>
 #import <WebCore/FrameLoader.h>
index 68b8d5d7ab399d5fc40dfe9455b6ec93289fb3d8..2d35f6091a7088e6ced3579a4b82562fa8516ef9 100644 (file)
@@ -91,6 +91,7 @@
 #import <Foundation/NSURLConnection.h>
 #import <JavaScriptCore/Assertions.h>
 #import <WebCore/Cache.h>
+#import <WebCore/ColorMac.h>
 #import <WebCore/Document.h>
 #import <WebCore/DocumentLoader.h>
 #import <WebCore/DragController.h>
@@ -1445,6 +1446,17 @@ WebFrameLoadDelegateImplementationCache WebViewGetFrameLoadDelegateImplementatio
     return WebCoreShouldUseFontSmoothing();
 }
 
++ (void)_setUsesTestModeFocusRingColor:(BOOL)f
+{
+    setUsesTestModeFocusRingColor(f);
+}
+
++ (BOOL)_usesTestModeFocusRingColor
+{
+    return usesTestModeFocusRingColor();
+}
+
+
 + (NSString *)_minimumRequiredSafariBuildNumber
 {
     return @"420+";
index 9eded6d3cdaeb07e606a99b251d4d4af39c8fbbd..902d2db22a53eeecece486a35273603422cc74bf 100644 (file)
@@ -334,6 +334,11 @@ Could be worth adding to the API.
 + (void)_setShouldUseFontSmoothing:(BOOL)f;
 + (BOOL)_shouldUseFontSmoothing;
 
+// These two methods are useful for a test harness that needs a consistent appearance for the focus rings
+// regardless of OS X version.
++ (void)_setUsesTestModeFocusRingColor:(BOOL)f;
++ (BOOL)_usesTestModeFocusRingColor;
+
 + (NSString *)_minimumRequiredSafariBuildNumber;
 
 /*!
index 773196c425bcb99391149c1e307036c52dc79e3c..05988fdf3c0869e6cbca687bad39636b04a65202 100644 (file)
@@ -1,3 +1,12 @@
+2007-08-20  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Adam Roben
+
+        * DumpRenderTree/DumpRenderTree.m:
+        (runTest):
+        call new +[WebView _setUsesTestModeFocusRingColor:YES] so we get the same focus ring colors
+        in layout tests on Tiger and Leopard
+
 2007-08-20  Adam Roben  <aroben@apple.com>
 
         Put LayoutTests after all other ChangeLogs in commit logs
@@ -38,6 +47,7 @@
         (sub isAddedStatus): Ditto.
         (sub testListForChangeLog): Added.
 
+>>>>>>> .r25168
 2007-08-19  Oleg Sukhodolsky  <son.two@gmail.com>
 
         Reviewed by Mark.
index 3dfad7d72756ad49933f3c1574088966481e1c45..2ec217613942ef91cd23413493ea11b503f7e2f3 100644 (file)
@@ -1547,6 +1547,7 @@ static void runTest(const char *pathOrURL)
     [[mainFrame webView] makeTextStandardSize:nil];
     [[mainFrame webView] setTabKeyCyclesThroughElements: YES];
     [[mainFrame webView] setPolicyDelegate:nil];
+    [WebView _setUsesTestModeFocusRingColor:YES];
     done = NO;
     topLoadingFrame = nil;
     waitToDump = NO;