Bug 159242 - Update focus test
Summary: Update focus test
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jon Lee
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-06-28 17:54 PDT by Jon Lee
Modified: 2016-06-28 18:52 PDT (History)
7 users (show)

See Also:


Attachments
Patch (17.70 KB, patch)
2016-06-28 18:01 PDT, Jon Lee
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Lee 2016-06-28 17:54:51 PDT
Update focus test
Comment 1 Radar WebKit Bug Importer 2016-06-28 17:56:52 PDT
<rdar://problem/27070007>
Comment 2 Jon Lee 2016-06-28 18:01:12 PDT
Created attachment 282309 [details]
Patch
Comment 3 Said Abou-Hallawa 2016-06-28 18:38:46 PDT
Comment on attachment 282309 [details]
Patch

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

Looks good to me. Unofficial r=me.

> PerformanceTests/Animometer/tests/master/resources/focus.js:12
> +var movementDuration = 2500;

Should not these be const?

> PerformanceTests/Animometer/tests/master/resources/focus.js:27
> +        this.particle = document.createElement('div');

Don't we need to append this.particle the childList of some parent? stage.element.appendChild(obj.particle);

> PerformanceTests/Animometer/tests/master/resources/focus.js:38
> +        this.animate(stage, 0, 0);

Why do we need this call here? The FocusElement.animate() function will be called anyway from FocusStage.animate(). It is strange also we call this function before appending this.particle to any parent.

> PerformanceTests/Animometer/tests/master/resources/focus.js:-97
> -        Utilities.setElementPrefixedProperty(this._centerElement, "filter", "blur(" + blur + "px)");

Why did we remove the center element? Is this because we want more accurate results?
Comment 4 Jon Lee 2016-06-28 18:42:47 PDT
Comment on attachment 282309 [details]
Patch

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

>> PerformanceTests/Animometer/tests/master/resources/focus.js:12
>> +var movementDuration = 2500;
> 
> Should not these be const?

I avoided it to keep things simple.

>> PerformanceTests/Animometer/tests/master/resources/focus.js:27
>> +        this.particle = document.createElement('div');
> 
> Don't we need to append this.particle the childList of some parent? stage.element.appendChild(obj.particle);

That's done in tune().

>> PerformanceTests/Animometer/tests/master/resources/focus.js:38
>> +        this.animate(stage, 0, 0);
> 
> Why do we need this call here? The FocusElement.animate() function will be called anyway from FocusStage.animate(). It is strange also we call this function before appending this.particle to any parent.

The order is that we create the particle, add it, and then style it. It is possible that before we style it in animate() we paint after adding, in which case you get a flash of opaque circles.

>> PerformanceTests/Animometer/tests/master/resources/focus.js:-97
>> -        Utilities.setElementPrefixedProperty(this._centerElement, "filter", "blur(" + blur + "px)");
> 
> Why did we remove the center element? Is this because we want more accurate results?

Remove some variability.
Comment 5 Dean Jackson 2016-06-28 18:47:52 PDT
Comment on attachment 282309 [details]
Patch

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

> PerformanceTests/Animometer/tests/dom/resources/focus.js:16
> +        // size and blurring are a function of depth

Nit: We do comments with sentence case and periods.

> PerformanceTests/Animometer/tests/dom/resources/focus.js:137
> +        // update center element before loop

Here too.

>>> PerformanceTests/Animometer/tests/master/resources/focus.js:12
>>> +var movementDuration = 2500;
>> 
>> Should not these be const?
> 
> I avoided it to keep things simple.

I'm not sure if all other browsers support const.

>>> PerformanceTests/Animometer/tests/master/resources/focus.js:27
>>> +        this.particle = document.createElement('div');
>> 
>> Don't we need to append this.particle the childList of some parent? stage.element.appendChild(obj.particle);
> 
> That's done in tune().

Nit: Use " not '
Comment 6 Jon Lee 2016-06-28 18:50:20 PDT
Comment on attachment 282309 [details]
Patch

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

>> PerformanceTests/Animometer/tests/dom/resources/focus.js:16
>> +        // size and blurring are a function of depth
> 
> Nit: We do comments with sentence case and periods.

Done.

>> PerformanceTests/Animometer/tests/dom/resources/focus.js:137
>> +        // update center element before loop
> 
> Here too.

Removed this instead.

>>>> PerformanceTests/Animometer/tests/master/resources/focus.js:27
>>>> +        this.particle = document.createElement('div');
>>> 
>>> Don't we need to append this.particle the childList of some parent? stage.element.appendChild(obj.particle);
>> 
>> That's done in tune().
> 
> Nit: Use " not '

Done.
Comment 7 Jon Lee 2016-06-28 18:52:40 PDT
Committed r202601: <http://trac.webkit.org/changeset/202601>