Bug 152357 - Simplify isOverlayScrollbar() logic
Summary: Simplify isOverlayScrollbar() logic
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-16 14:48 PST by Simon Fraser (smfr)
Modified: 2015-12-16 16:20 PST (History)
3 users (show)

See Also:


Attachments
Patch (17.30 KB, patch)
2015-12-16 14:49 PST, Simon Fraser (smfr)
bdakin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.