Bug 141842 - Rename ScrollElasticityController to ScrollController
Summary: Rename ScrollElasticityController to ScrollController
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords:
Depends on:
Blocks: 140633
  Show dependency treegraph
 
Reported: 2015-02-20 11:23 PST by Brent Fulgham
Modified: 2015-02-20 18:07 PST (History)
5 users (show)

See Also:


Attachments
Patch (64.05 KB, patch)
2015-02-20 11:30 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch v2 (clean up style warnings) (68.51 KB, patch)
2015-02-20 11:41 PST, Brent Fulgham
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2015-02-20 11:23:58 PST
As a first step in some scrolling refactoring, rename ScrollElasticityController to ScrollController.
Comment 1 Brent Fulgham 2015-02-20 11:30:45 PST
Created attachment 246979 [details]
Patch
Comment 2 WebKit Commit Bot 2015-02-20 11:33:33 PST
Attachment 246979 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/mac/ScrollController.mm:31:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/platform/mac/ScrollController.mm:107:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/WebCore/platform/mac/ScrollController.mm:107:  Multi line control clauses should use braces.  [whitespace/braces] [4]
ERROR: Source/WebCore/platform/mac/ScrollController.mm:193:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/WebCore/platform/mac/ScrollController.mm:204:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/WebCore/platform/mac/ScrollController.mm:227:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/WebCore/platform/mac/ScrollController.mm:229:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/WebCore/platform/mac/ScrollController.mm:233:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/WebCore/platform/mac/ScrollController.mm:241:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/WebCore/platform/mac/ScrollController.mm:251:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/WebCore/platform/mac/ScrollController.mm:335:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 11 in 10 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Brent Fulgham 2015-02-20 11:41:26 PST
Created attachment 246982 [details]
Patch v2 (clean up style warnings)
Comment 4 Simon Fraser (smfr) 2015-02-20 11:49:10 PST
Comment on attachment 246982 [details]
Patch v2 (clean up style warnings)

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

> Source/WebCore/platform/mac/ScrollController.mm:57
> +static NSTimeInterval systemUptime()
> +{
> +    if ([[NSProcessInfo processInfo] respondsToSelector:@selector(systemUptime)])
> +        return [[NSProcessInfo processInfo] systemUptime];
> +
> +    // Get how long system has been up. Found by looking getting "boottime" from the kernel.
> +    static struct timeval boottime = {0, 0};
> +    if (!boottime.tv_sec) {
> +        int mib[2] = {CTL_KERN, KERN_BOOTTIME};
> +        size_t size = sizeof(boottime);
> +        if (-1 == sysctl(mib, 2, &boottime, &size, 0, 0))
> +            boottime.tv_sec = 0;
> +    }
> +    struct timeval now;
> +    if (boottime.tv_sec && -1 != gettimeofday(&now, 0)) {
> +        struct timeval uptime;
> +        timersub(&now, &boottime, &uptime);
> +        NSTimeInterval result = uptime.tv_sec + (uptime.tv_usec / 1E+6);
> +        return result;
> +    }
> +    return 0;
> +}

Why the heck is this here? Can't we just use monotonicallyIncreasingTime or some std::chrono?
Comment 5 Brent Fulgham 2015-02-20 11:54:18 PST
(In reply to comment #4)
> Comment on attachment 246982 [details]
> Patch v2 (clean up style warnings)
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=246982&action=review
> 
> > Source/WebCore/platform/mac/ScrollController.mm:57
> > +static NSTimeInterval systemUptime()
> > +{
> > +    if ([[NSProcessInfo processInfo] respondsToSelector:@selector(systemUptime)])
> > +        return [[NSProcessInfo processInfo] systemUptime];
> > +
> > +    // Get how long system has been up. Found by looking getting "boottime" from the kernel.
> > +    static struct timeval boottime = {0, 0};
> > +    if (!boottime.tv_sec) {
> > +        int mib[2] = {CTL_KERN, KERN_BOOTTIME};
> > +        size_t size = sizeof(boottime);
> > +        if (-1 == sysctl(mib, 2, &boottime, &size, 0, 0))
> > +            boottime.tv_sec = 0;
> > +    }
> > +    struct timeval now;
> > +    if (boottime.tv_sec && -1 != gettimeofday(&now, 0)) {
> > +        struct timeval uptime;
> > +        timersub(&now, &boottime, &uptime);
> > +        NSTimeInterval result = uptime.tv_sec + (uptime.tv_usec / 1E+6);
> > +        return result;
> > +    }
> > +    return 0;
> > +}
> 
> Why the heck is this here? Can't we just use monotonicallyIncreasingTime or
> some std::chrono?

I'm not sure! Beth, do you remember why this is here?
Comment 6 Beth Dakin 2015-02-20 12:00:51 PST
(In reply to comment #5)
> (In reply to comment #4)
> > Comment on attachment 246982 [details]
> > Patch v2 (clean up style warnings)
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=246982&action=review
> > 
> > > Source/WebCore/platform/mac/ScrollController.mm:57
> > > +static NSTimeInterval systemUptime()
> > > +{
> > > +    if ([[NSProcessInfo processInfo] respondsToSelector:@selector(systemUptime)])
> > > +        return [[NSProcessInfo processInfo] systemUptime];
> > > +
> > > +    // Get how long system has been up. Found by looking getting "boottime" from the kernel.
> > > +    static struct timeval boottime = {0, 0};
> > > +    if (!boottime.tv_sec) {
> > > +        int mib[2] = {CTL_KERN, KERN_BOOTTIME};
> > > +        size_t size = sizeof(boottime);
> > > +        if (-1 == sysctl(mib, 2, &boottime, &size, 0, 0))
> > > +            boottime.tv_sec = 0;
> > > +    }
> > > +    struct timeval now;
> > > +    if (boottime.tv_sec && -1 != gettimeofday(&now, 0)) {
> > > +        struct timeval uptime;
> > > +        timersub(&now, &boottime, &uptime);
> > > +        NSTimeInterval result = uptime.tv_sec + (uptime.tv_usec / 1E+6);
> > > +        return result;
> > > +    }
> > > +    return 0;
> > > +}
> > 
> > Why the heck is this here? Can't we just use monotonicallyIncreasingTime or
> > some std::chrono?
> 
> I'm not sure! Beth, do you remember why this is here?

I don't know. Looks like Anders added that code. Any memory of what it's for, Anders?
Comment 7 Brent Fulgham 2015-02-20 12:50:59 PST
Committed r180447: <http://trac.webkit.org/changeset/180447>