Changeset 29728 in webkit
- Timestamp:
- Jan 22, 2008 8:01:09 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r29727 r29728 1 2008-01-22 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Adele Peterson. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=16905 6 <rdar://problem/5692407> REGRESSION (3.0.4-TOT): "menu" pseudocolor is badly chosen 7 8 The regression test for this is fast/css/css2-system-color.html which 9 is currently disabled. 10 11 * rendering/RenderThemeMac.mm: 12 (WebCore::menuBackgroundColor): Added. Uses HIThemeDrawMenuBackground 13 to draw the menu item background into a bitmap graphics context and 14 returns the color of the pixel at (0, 0). 15 (WebCore::RenderThemeMac::systemColor): Changed to call 16 menuBackgroundColor for the CSS2 menu color. 17 1 18 2008-01-22 Darin Adler <darin@apple.com> 2 19 -
trunk/WebCore/rendering/RenderThemeMac.mm
r29510 r29728 38 38 #import "SharedBuffer.h" 39 39 #import "WebCoreSystemInterface.h" 40 #import <Carbon/Carbon.h> 40 41 #import <Cocoa/Cocoa.h> 41 42 #import <wtf/RetainPtr.h> … … 241 242 } 242 243 244 static RGBA32 menuBackgroundColor() 245 { 246 NSBitmapImageRep *offscreenRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil 247 pixelsWide:1 248 pixelsHigh:1 249 bitsPerSample:8 250 samplesPerPixel:4 251 hasAlpha:YES 252 isPlanar:NO 253 colorSpaceName:NSCalibratedRGBColorSpace 254 bytesPerRow:4 255 bitsPerPixel:32]; 256 257 CGContextRef context = static_cast<CGContextRef>([[NSGraphicsContext graphicsContextWithBitmapImageRep:offscreenRep] graphicsPort]); 258 CGRect rect = CGRectMake(0, 0, 1, 1); 259 HIThemeMenuDrawInfo drawInfo; 260 drawInfo.version = 0; 261 drawInfo.menuType = kThemeMenuTypePopUp; 262 HIThemeDrawMenuBackground(&rect, &drawInfo, context, kHIThemeOrientationInverted); 263 264 NSUInteger pixel[4]; 265 [offscreenRep getPixel:pixel atX:0 y:0]; 266 267 [offscreenRep release]; 268 269 return makeRGB(pixel[0], pixel[1], pixel[2]); 270 } 271 243 272 void RenderThemeMac::platformColorsDidChange() 244 273 { … … 309 338 break; 310 339 case CSS_VAL_MENU: 311 color = convertNSColorToColor([NSColor selectedMenuItemColor]);340 color = menuBackgroundColor(); 312 341 break; 313 342 case CSS_VAL_MENUTEXT:
Note: See TracChangeset
for help on using the changeset viewer.