Bug 122152

Summary: [mac] 1x emulation on Retina hardware shouldn't use SPI
Product: WebKit Reporter: Tim Horton <thorton>
Component: Tools / TestsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, ap, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 122006    
Attachments:
Description Flags
patch andersca: review+

Tim Horton
Reported 2013-10-01 03:37:38 PDT
There's a NSHighResolutionCapable Info.plist key that is much more official than the SPI we're using. This will un-break some things re: snapshotting down the road.
Attachments
patch (4.96 KB, patch)
2013-10-01 11:39 PDT, Tim Horton
andersca: review+
Radar WebKit Bug Importer
Comment 1 2013-10-01 03:37:48 PDT
Alexey Proskuryakov
Comment 2 2013-10-01 08:57:29 PDT
Will using it break the few HiDPI tests we have?
Tim Horton
Comment 3 2013-10-01 09:02:39 PDT
(In reply to comment #2) > Will using it break the few HiDPI tests we have? It shouldn't; they change the deviceScaleFactor at a purely WebKit level.
Tim Horton
Comment 4 2013-10-01 11:39:56 PDT
Tim Horton
Comment 5 2013-10-01 11:45:43 PDT
Alexey Proskuryakov
Comment 6 2013-10-01 12:51:26 PDT
Comment on attachment 213102 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=213102&action=review > Tools/DumpRenderTree/mac/DumpRenderTree.mm:954 > + NSDictionary *defaults = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"AppleMagnifiedMode", nil]; @{@"AppleMagnifiedMode": @YES} > Tools/DumpRenderTree/mac/DumpRenderTree.mm:955 > + [[NSUserDefaults standardUserDefaults] registerDefaults:defaults]; Registering defaults is not what we need here. A persistent preference stuck somewhere would override a registered default, and it's inconsistent with what we do in resetDefaultsToConsistentValues(). We just use regular setBool:forKey:. Is it important to set this default before entering NSApplication? Otherwise, you could just add this to resetDefaultsToConsistentValues(). > Tools/WebKitTestRunner/mac/main.mm:38 > + NSDictionary *defaults = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"AppleMagnifiedMode", nil]; > + [[NSUserDefaults standardUserDefaults] registerDefaults:defaults]; > + [defaults release]; Same comment about registerDefaults:. We already had two styles of setting defaults in this function, which was one more than we should have. Do we only want AppleMagnifiedMode set in UI process?
Tim Horton
Comment 7 2013-10-01 12:59:24 PDT
(In reply to comment #6) > (From update of attachment 213102 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=213102&action=review > > > Tools/DumpRenderTree/mac/DumpRenderTree.mm:954 > > + NSDictionary *defaults = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"AppleMagnifiedMode", nil]; > > @{@"AppleMagnifiedMode": @YES} I wasn't sure if I could use this here, but Anders said yes, so I will switch it up. > > Tools/DumpRenderTree/mac/DumpRenderTree.mm:955 > > + [[NSUserDefaults standardUserDefaults] registerDefaults:defaults]; > > Registering defaults is not what we need here. A persistent preference stuck somewhere would override a registered default, and it's inconsistent with what we do in resetDefaultsToConsistentValues(). We just use regular setBool:forKey:. > > Is it important to set this default before entering NSApplication? Otherwise, you could just add this to resetDefaultsToConsistentValues(). > > > Tools/WebKitTestRunner/mac/main.mm:38 > > + NSDictionary *defaults = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"AppleMagnifiedMode", nil]; > > + [[NSUserDefaults standardUserDefaults] registerDefaults:defaults]; > > + [defaults release]; > > Same comment about registerDefaults:. We already had two styles of setting defaults in this function, which was one more than we should have. Yeah, Dan pointed this out. Apparently setVolatileDomain is the way to go for temporary defaults that override ones up the chain, though I didn't know this at the time. Is there any reason to actually use setBool:forKey: instead of that? > Do we only want AppleMagnifiedMode set in UI process? We only need it set in the UI process.
Alexey Proskuryakov
Comment 8 2013-10-01 13:10:50 PDT
> Is there any reason to actually use setBool:forKey: instead of that? You can only set any volatile domain once, I think (I assume that repeated calls will replace its content). In fact, I'm not sure if what we are doing between tests in WebKitTestRunner is right.
Note You need to log in before you can comment on or make changes to this bug.