Bug 67217

Summary: Mitigate scrollbar differences when running pixel tests
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Tools / TestsAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, aroben, eae, hyatt, leandro, leviw, mitz, rakuco, sam, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 68134, 76247, 98011    
Bug Blocks:    
Attachments:
Description Flags
Patch none

Description Simon Fraser (smfr) 2011-08-30 12:04:01 PDT
We need to find a way to avoid having scrollbar differences between OSes from prevent us from sharing pixel results between Mac OS versions. Possible solutions (not mutually exclusive):

1. Exclude the scrollbar area from the the part of the pixel result that gets checksummed
2. Make a scrollbar theme used by DRT that draws dummy scrollbars which look the same across OSes
3. Dump scrollbar thumb position and size in render tree output so that scrollbar bugs can be tested without having to look at pixels.
Comment 1 Simon Fraser (smfr) 2012-01-06 12:32:03 PST
Created attachment 121471 [details]
Patch
Comment 2 mitz 2012-01-06 12:42:22 PST
Comment on attachment 121471 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=121471&action=review

> Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm:46
> +@interface NSScrollView(AppKitSecretsIKnowAbout)

The modern convention for such category names is “WebNSScrollViewDetails”.

> Tools/DumpRenderTree/mac/DumpRenderTree.mm:458
> +        CGFloat knobPosition = round([self doubleValue] * (trackLength - knobLength));

Will round() here work in 32-bit?

> Tools/DumpRenderTree/mac/DumpRenderTree.mm:463
> +        return NSMakeRect(bounds.origin.x, bounds.origin.y +  + knobPosition, bounds.size.width, knobLength);

+ +

> Tools/DumpRenderTree/mac/DumpRenderTree.mm:474
> +    NSColor *knobColor = [NSColor colorWithDeviceRed:0x80 / 255.0 green:0x80 / 255.0 blue:0x80 / 255.0 alpha:1];

Could make this a function static (and retain the color).

> Tools/DumpRenderTree/mac/DumpRenderTree.mm:482
> +    NSColor *trackColor = [NSColor colorWithDeviceRed:0xC0 / 255.0 green:0xC0 / 255.0 blue:0xC0 / 255.0 alpha:1];

Ditto.
Comment 3 Simon Fraser (smfr) 2012-01-06 13:45:22 PST
Comment on attachment 121471 [details]
Patch

Landed in http://trac.webkit.org/changeset/104331

Keeping bug open to enable mock scrollbars by default.
Comment 4 Levi Weintraub 2012-01-20 14:56:02 PST
(In reply to comment #3)
> (From update of attachment 121471 [details])
> Landed in http://trac.webkit.org/changeset/104331
> 
> Keeping bug open to enable mock scrollbars by default.

Is there a plan to update mac-snowleopard results to go along with this? On ToT right now, it's impossible to make it through the snowleopard pixel tests without bailing due to too many errors. I'd love for the intent of this patch to come through, but right now I can't even run the tests. This is very disruptive.
Comment 5 Levi Weintraub 2012-01-23 15:22:05 PST
(In reply to comment #4)
> Is there a plan to update mac-snowleopard results to go along with this? On ToT right now, it's impossible to make it through the snowleopard pixel tests without bailing due to too many errors. I'd love for the intent of this patch to come through, but right now I can't even run the tests. This is very disruptive.

I'm just going to go ahead and add snowleopard expectations for the failing tests myself.
Comment 6 Simon Fraser (smfr) 2012-01-23 15:52:04 PST
Please do, sorry I didn't respond sooner.
Comment 7 Eric Seidel (no email) 2012-02-10 10:18:55 PST
Comment on attachment 121471 [details]
Patch

Cleared Dan Bernstein's review+ from obsolete attachment 121471 [details] so that this bug does not appear in http://webkit.org/pending-commit.
Comment 8 Radar WebKit Bug Importer 2020-05-11 17:31:14 PDT
<rdar://problem/63113462>