Closed Bug 1311799 Opened 8 years ago Closed 8 years ago

Fade the tab audio icon when the audio has stopped but before it has been removed

Categories

(Firefox :: Tabbed Browser, defect, P3)

defect

Tracking

()

RESOLVED FIXED
Firefox 52
Tracking Status
firefox52 --- fixed

People

(Reporter: jaws, Assigned: jaws)

References

Details

Attachments

(1 file)

From https://bugzilla.mozilla.org/show_bug.cgi?id=1232357#c39,
> Do we have any plan to add extra effects (eg. fade out) for sound indicator? 
> (Chrome uses fading out) Since it looks little strange because disappearing very 
> suddenly.
Assignee: nobody → jaws
Status: NEW → ASSIGNED
Comment on attachment 8803105 [details]
Bug 1311799 - Fade the tab audio icon when the audio has stopped but before it has been removed.

https://reviewboard.mozilla.org/r/87316/#review86762

I don't think this is what the comment in bug 1232357 asked about. I think it was effectively suggesting we transition the opacity from .8 to 0 when we remove it, rather than just setting it to 0 directly. Setting it to .4 in the meantime would mean we would go back to flickering in cases where the audio volume occasionally disappears.
Attachment #8803105 - Flags: review?(gijskruitbosch+bugs) → review-
(note that I'm out until Wed, so if you have an update before then you may want to find another reviewer - sorry!)
Priority: -- → P3
Comment on attachment 8803105 [details]
Bug 1311799 - Fade the tab audio icon when the audio has stopped but before it has been removed.

https://reviewboard.mozilla.org/r/87316/#review89066

::: browser/base/content/tabbrowser.xml:5082
(Diff revision 2)
>  
>            if (tab.hasAttribute("soundplaying")) {
> +            tab.setAttribute("soundplaying-scheduledremoval", "true");
> +            this._tabAttrModified(tab, ["soundplaying-scheduledremoval"]);
> +
>              let removalDelay = Services.prefs.getIntPref("browser.tabs.delayHidingAudioPlayingIconMS");

Shouldn't the delay in the transition be based on this pref? Right now the pref can change and the transition delay and length doesn't.
Attachment #8803105 - Flags: review?(gijskruitbosch+bugs)
(In reply to :Gijs Kruitbosch from comment #5)
> Comment on attachment 8803105 [details]
> Bug 1311799 - Fade the tab audio icon when the audio has stopped but before
> it has been removed.
> 
> https://reviewboard.mozilla.org/r/87316/#review89066
> 
> ::: browser/base/content/tabbrowser.xml:5082
> (Diff revision 2)
> >  
> >            if (tab.hasAttribute("soundplaying")) {
> > +            tab.setAttribute("soundplaying-scheduledremoval", "true");
> > +            this._tabAttrModified(tab, ["soundplaying-scheduledremoval"]);
> > +
> >              let removalDelay = Services.prefs.getIntPref("browser.tabs.delayHidingAudioPlayingIconMS");
> 
> Shouldn't the delay in the transition be based on this pref? Right now the
> pref can change and the transition delay and length doesn't.

Yes, I looked at that and I'm not sure what we want to do here. I'd rather not do `tab.style.transitionDelay = (removalDelay - 300) + "ms";` as that style would get applied to other transitions and wouldn't get removed without adding even more code.

Ideally we could use `attr()` for non-generated content properties and then set this via an attribute and use `calc()` in the transition property.
(In reply to Jared Wein [:jaws] (please needinfo? me) from comment #6)
> (In reply to :Gijs Kruitbosch from comment #5)
> > Comment on attachment 8803105 [details]
> > Bug 1311799 - Fade the tab audio icon when the audio has stopped but before
> > it has been removed.
> > 
> > https://reviewboard.mozilla.org/r/87316/#review89066
> > 
> > ::: browser/base/content/tabbrowser.xml:5082
> > (Diff revision 2)
> > >  
> > >            if (tab.hasAttribute("soundplaying")) {
> > > +            tab.setAttribute("soundplaying-scheduledremoval", "true");
> > > +            this._tabAttrModified(tab, ["soundplaying-scheduledremoval"]);
> > > +
> > >              let removalDelay = Services.prefs.getIntPref("browser.tabs.delayHidingAudioPlayingIconMS");
> > 
> > Shouldn't the delay in the transition be based on this pref? Right now the
> > pref can change and the transition delay and length doesn't.
> 
> Yes, I looked at that and I'm not sure what we want to do here. I'd rather
> not do `tab.style.transitionDelay = (removalDelay - 300) + "ms";` as that
> style would get applied to other transitions and wouldn't get removed
> without adding even more code.
> 
> Ideally we could use `attr()` for non-generated content properties and then
> set this via an attribute and use `calc()` in the transition property.

You could set a custom CSS property in the JS and use the value from the CSS (both with and without calc, haven't really thought about what would make more sense).
This still duplicates the transition duration between the CSS and the binding. I couldn't get calc() to work with the custom property and getting the computed style to do the math within the binding got pretty messy quickly since we might be showing the .tab-icon-overlay or .tab-icon-sound.
Comment on attachment 8803105 [details]
Bug 1311799 - Fade the tab audio icon when the audio has stopped but before it has been removed.

https://reviewboard.mozilla.org/r/87316/#review89204
Attachment #8803105 - Flags: review?(gijskruitbosch+bugs) → review+
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/36105103e869
Fade the tab audio icon when the audio has stopped but before it has been removed. r=Gijs
https://hg.mozilla.org/mozilla-central/rev/36105103e869
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Depends on: 1326593
Depends on: 1352694
Depends on: 1345440
Depends on: 1345479
No longer depends on: 1345479
Regressions: 1345479
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: