Bug 112586 - Web Inspector: Switch Drawer animation from JavaScript to CSS transitions.
Summary: Web Inspector: Switch Drawer animation from JavaScript to CSS transitions.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-18 09:55 PDT by Dmitry Zvorygin
Modified: 2013-03-20 04:34 PDT (History)
9 users (show)

See Also:


Attachments
Patch (11.54 KB, patch)
2013-03-18 10:23 PDT, Dmitry Zvorygin
no flags Details | Formatted Diff | Diff
Patch (11.84 KB, patch)
2013-03-19 04:54 PDT, Dmitry Zvorygin
no flags Details | Formatted Diff | Diff
Patch (11.84 KB, patch)
2013-03-19 05:34 PDT, Dmitry Zvorygin
no flags Details | Formatted Diff | Diff
Patch (11.57 KB, patch)
2013-03-20 03:23 PDT, Dmitry Zvorygin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Zvorygin 2013-03-18 09:55:51 PDT
This simplifies code, and gives smoother animation for free.
Comment 1 Dmitry Zvorygin 2013-03-18 10:23:50 PDT
Created attachment 193598 [details]
Patch
Comment 2 Vsevolod Vlasov 2013-03-19 00:46:02 PDT
Comment on attachment 193598 [details]
Patch

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

> Source/WebCore/inspector/front-end/Drawer.js:-104
> -        function animationFinished()

Why was this function removed?

> Source/WebCore/inspector/front-end/Drawer.js:130
> +        this.animationFinished = function()

Please make it a named function
function animationFinshed()
{
 ...
}
this._animationFinished = animationFinished;

> Source/WebCore/inspector/front-end/Drawer.js:141
> +        if (this._viewStatusBar.style.opacity == 0 || animationType == WebInspector.Drawer.AnimationType.Immediately )

What does this condition check: this._viewStatusBar.style.opacity == 0 ?
Comment 3 Dmitry Zvorygin 2013-03-19 04:53:05 PDT
Comment on attachment 193598 [details]
Patch

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

>> Source/WebCore/inspector/front-end/Drawer.js:-104
>> -        function animationFinished()
> 
> Why was this function removed?

By mistake.
Restored, although everything seemed to work fine without this function.

>> Source/WebCore/inspector/front-end/Drawer.js:130
>> +        this.animationFinished = function()
> 
> Please make it a named function
> function animationFinshed()
> {
>  ...
> }
> this._animationFinished = animationFinished;

Done.

>> Source/WebCore/inspector/front-end/Drawer.js:141
>> +        if (this._viewStatusBar.style.opacity == 0 || animationType == WebInspector.Drawer.AnimationType.Immediately )
> 
> What does this condition check: this._viewStatusBar.style.opacity == 0 ?

Added comments.
Comment 4 Dmitry Zvorygin 2013-03-19 04:54:42 PDT
Created attachment 193794 [details]
Patch
Comment 5 Alexander Pavlov (apavlov) 2013-03-19 05:21:08 PDT
Comment on attachment 193794 [details]
Patch

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

> Source/WebCore/inspector/front-end/Drawer.js:114
> +        if (this._viewStatusBar.style.opacity == 1 || animationType == WebInspector.Drawer.AnimationType.Immediately )

We use === everywhere.

Also, an extraneous whitespace before ')'

> Source/WebCore/inspector/front-end/Drawer.js:156
> +        if (this._viewStatusBar.style.opacity == 0 || animationType == WebInspector.Drawer.AnimationType.Immediately )

I seem to have seen this somewhere? :) Is the diff/patch correct?
Comment 6 Dmitry Zvorygin 2013-03-19 05:34:44 PDT
Created attachment 193802 [details]
Patch
Comment 7 Vsevolod Vlasov 2013-03-19 08:11:19 PDT
Comment on attachment 193802 [details]
Patch

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

> Source/WebCore/inspector/front-end/Drawer.js:155
> +        // So we have to finish animation manually.

But when does this actually happen?
Comment 8 Dmitry Zvorygin 2013-03-19 09:33:34 PDT
Comment on attachment 193802 [details]
Patch

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

>> Source/WebCore/inspector/front-end/Drawer.js:155
>> +        // So we have to finish animation manually.
> 
> But when does this actually happen?

Honestly, I can't invent situation when opacity can unsynchronize with drawer state, but if it happens, we wouldn't receive webkitTransitionEnd, and thuis wouldn't perform important cleanup.

I can remove opacity check assuming that such situation will newer happen.
Comment 9 Vsevolod Vlasov 2013-03-19 09:46:36 PDT
(In reply to comment #8)
> (From update of attachment 193802 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=193802&action=review
> 
> >> Source/WebCore/inspector/front-end/Drawer.js:155
> >> +        // So we have to finish animation manually.
> > 
> > But when does this actually happen?
> 
> Honestly, I can't invent situation when opacity can unsynchronize with drawer state, but if it happens, we wouldn't receive webkitTransitionEnd, and thuis wouldn't perform important cleanup.
> 
> I can remove opacity check assuming that such situation will newer happen.

Sounds like a good time to use console.assert :)
Comment 10 Dmitry Zvorygin 2013-03-20 03:23:42 PDT
Created attachment 194012 [details]
Patch
Comment 11 WebKit Review Bot 2013-03-20 04:34:14 PDT
Comment on attachment 194012 [details]
Patch

Clearing flags on attachment: 194012

Committed r146326: <http://trac.webkit.org/changeset/146326>
Comment 12 WebKit Review Bot 2013-03-20 04:34:17 PDT
All reviewed patches have been landed.  Closing bug.