Bug 22054 - DRT does not properly reset scrollbar arrows to default
Summary: DRT does not properly reset scrollbar arrows to default
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-03 14:00 PST by Pierre-Olivier Latour
Modified: 2008-11-03 18:33 PST (History)
2 users (show)

See Also:


Attachments
Tentative patch (2.20 KB, patch)
2008-11-03 18:01 PST, Pierre-Olivier Latour
mitz: review+
Details | Formatted Diff | Diff
Second revision (3.00 KB, patch)
2008-11-03 18:30 PST, Pierre-Olivier Latour
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Olivier Latour 2008-11-03 14:00:54 PST
This code in DRT has actually no effect for the scrollbars drawn by WebKit as it uses HI toolbox which reads the default _only_ from kCFPreferencesAnyApplication / kCFPreferencesCurrentUser / kCFPreferencesAnyHost.

[defaults setObject:@"DoubleMax" forKey:@"AppleScrollBarVariant"];

This makes pixel tests fail for test cases that display scrollbars if the user has chosen to place scroll arrows at top and bottom in system preferences.
Comment 1 Pierre-Olivier Latour 2008-11-03 17:33:17 PST
Here's a test case that fails for instance:
LayoutTests/svg/custom/invisible-text-after-scrolling.xhtml

But actually, for this one, the scrollbars do not appear to be drawn by HIToolbox.
Comment 2 Pierre-Olivier Latour 2008-11-03 17:49:33 PST
> But actually, for this one, the scrollbars do not appear to be drawn by
> HIToolbox.

Ignore this comment as it is incorrect: HIToolbox is indeed drawing these scrollbars!
Comment 3 Pierre-Olivier Latour 2008-11-03 18:01:44 PST
Created attachment 24874 [details]
Tentative patch
Comment 4 mitz 2008-11-03 18:08:40 PST
Comment on attachment 24874 [details]
Tentative patch

> +    CFTypeRef oldValue = CFPreferencesCopyValue(CFSTR("AppleScrollBarVariant"), kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);

You can use a RetainPtr for that and create create a local variable to hold CFSTR("AppleScrollBarVariant"). It would also be nice to move this closer to where you set the default in NSUserDefaults.

r=me
Comment 5 Pierre-Olivier Latour 2008-11-03 18:30:01 PST
Created attachment 24877 [details]
Second revision
Comment 6 mitz 2008-11-03 18:32:05 PST
Comment on attachment 24877 [details]
Second revision

r=me
Comment 7 mitz 2008-11-03 18:33:07 PST
Fixed in <http://trac.webkit.org/changeset/38082>.