Bug 152357

Summary: Simplify isOverlayScrollbar() logic
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: New BugsAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, simon.fraser, thorton
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch bdakin: review+

Description Simon Fraser (smfr) 2015-12-16 14:48:05 PST
Simplify isOverlayScrollbar() logic
Comment 1 Simon Fraser (smfr) 2015-12-16 14:49:52 PST
Created attachment 267493 [details]
Patch
Comment 2 Simon Fraser (smfr) 2015-12-16 15:42:06 PST
https://trac.webkit.org/r194184
Comment 3 Darin Adler 2015-12-16 16:20:09 PST
Comment on attachment 267493 [details]
Patch

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

> Source/WebCore/platform/ScrollableArea.cpp:523
> +    return IntSize(
> +        verticalScrollbar() ? verticalScrollbar()->occupiedWidth() : 0,
> +        horizontalScrollbar() ? horizontalScrollbar()->occupiedHeight() : 0);

Here’s how I would write this:

    return {
        verticalScrollbar() ? verticalScrollbar()->occupiedWidth() : 0,
        horizontalScrollbar() ? horizontalScrollbar()->occupiedHeight() : 0
    };

I like reducing the number of times we have to utter the type name IntSize, and I also like the formatting better with the braces.