Closed
Bug 799077
Opened 13 years ago
Closed 11 years ago
Add transitions when sliding a breakpoint to another line
Categories
(DevTools :: Debugger, defect, P3)
DevTools
Debugger
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 32
People
(Reporter: past, Assigned: jlong)
References
Details
(Whiteboard: [mentor=msucan][lang=js,css])
Attachments
(1 file, 5 obsolete files)
6.00 KB,
patch
|
Details | Diff | Splinter Review |
In bug 737803 comment 8 Mihai suggested that we need changes in Orion to implement this. I'm filing this bug to make sure we do so, after bug 759351 or any other dependencies land. I'd prefer the icon sliding to the new line, but a fade out/in effect works for me, too.
Comment 1•11 years ago
|
||
Is this easier now that we use code mirror?
Flags: needinfo?(past)
Flags: needinfo?(mihai.sucan)
Comment 2•11 years ago
|
||
Also +1 for sliding.
Comment 3•11 years ago
|
||
Difficulty seems similar to the Orion days. Might actually be easy with CSS animations, it needs some time to play with CSS. This could be a mentored bug.
Flags: needinfo?(mihai.sucan)
Whiteboard: [mentor=msucan][lang=js,css]
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → jlong
Assignee | ||
Comment 5•11 years ago
|
||
This wasn't too hard. The only thing I don't like is that I had to embed the CSS style for transitions in JS. This is because CSS transitions suck. I change the "top" style of the element after adding a transition, which makes it slide, and in the "transitionend" event remove the old breakpoint and add the new one.
Because we keep the actual breakpoint element around (when removing, we just remove the "class" breakpoint), I need to reset the div element with a "top" of 0. However since it has a transition, it doesn't happen immediately and something in the removal is stopping it from happening. The result is that once a breakpoint shifts, it always stays shifted. I fixed it by only applying a transition property when I want it to happen.
Attachment #8404005 -
Flags: review?(past)
Assignee | ||
Updated•11 years ago
|
Attachment #8404005 -
Flags: review?(past) → review?(mihai.sucan)
Comment 6•11 years ago
|
||
Drive-by, hope you don't mind :)
(In reply to James Long (:jlongster) from comment #5)
> Created attachment 8404005 [details] [diff] [review]
> 799077-bp-transition.patch
> I fixed it by only applying a transition property when I want it to happen.
Wouldn't simply using an attribute work? Like
> .breakpoint[sliding] {
> transition: top .25s;
> }
..and add/remove the attribute when it makes sense.
Also, I cry a little whenever I see "top" used instead of "translate". If it "feels" smoother using a transformation here, I'd vote for using it and avoid needless reflows caused by "top".
Assignee | ||
Comment 7•11 years ago
|
||
(In reply to Victor Porof [:vporof][:vp] from comment #6)
> Drive-by, hope you don't mind :)
>
> (In reply to James Long (:jlongster) from comment #5)
> > Created attachment 8404005 [details] [diff] [review]
> > 799077-bp-transition.patch
>
> > I fixed it by only applying a transition property when I want it to happen.
>
> Wouldn't simply using an attribute work? Like
>
> > .breakpoint[sliding] {
> > transition: top .25s;
> > }
>
> ..and add/remove the attribute when it makes sense.
I tried that too, and it didn't work at a quick glance. I can try it again. There's something funky with the interactions of transitions. I always have these problems with CSS transitions...
>
> Also, I cry a little whenever I see "top" used instead of "translate". If it
> "feels" smoother using a transformation here, I'd vote for using it and
> avoid needless reflows caused by "top".
You're right, I can change it. It seems smooth enough, but we should use translate. When are we getting `will-change`?
Comment 8•11 years ago
|
||
(In reply to James Long (:jlongster) from comment #7)
> (In reply to Victor Porof [:vporof][:vp] from comment #6)
> > Drive-by, hope you don't mind :)
> >
> > (In reply to James Long (:jlongster) from comment #5)
> > > Created attachment 8404005 [details] [diff] [review]
> > > 799077-bp-transition.patch
> >
> > > I fixed it by only applying a transition property when I want it to happen.
> >
> > Wouldn't simply using an attribute work? Like
> >
> > > .breakpoint[sliding] {
> > > transition: top .25s;
> > > }
> >
> > ..and add/remove the attribute when it makes sense.
>
> I tried that too, and it didn't work at a quick glance. I can try it again.
> There's something funky with the interactions of transitions. I always have
> these problems with CSS transitions...
>
Yeah, they can be a PITA sometimes. You could quickly take a look at how the debugger does the "bounce" animation when clicking on a match, and see if it rings any bells [0] [1]
[0] http://dxr.mozilla.org/mozilla-central/source/browser/devtools/debugger/debugger-panes.js#2900
[1] http://dxr.mozilla.org/mozilla-central/source/browser/themes/shared/devtools/debugger.inc.css?from=debugger.inc.css#472
> >
> > Also, I cry a little whenever I see "top" used instead of "translate". If it
> > "feels" smoother using a transformation here, I'd vote for using it and
> > avoid needless reflows caused by "top".
>
> You're right, I can change it. It seems smooth enough, but we should use
> translate. When are we getting `will-change`?
FWIW, (sadly) even if we did get "will-change", I don't think that will actually make any difference with archaic properties like "top". Anyway, off-topic :P
Assignee | ||
Comment 9•11 years ago
|
||
This uses transforms instead. I have to leave now and will be on PTO for a week, I'll figure out how to get the transition into the CSS when I get back.
Assignee | ||
Updated•11 years ago
|
Attachment #8404005 -
Attachment is obsolete: true
Attachment #8404005 -
Flags: review?(mihai.sucan)
Comment 10•11 years ago
|
||
James, patch looks good to me. Feel free to ask again for review when it's ready. Thanks!
Assignee | ||
Comment 11•11 years ago
|
||
Final patch, I moved the transition into CSS. All tests pass.
Attachment #8415975 -
Flags: review?(mihai.sucan)
Assignee | ||
Updated•11 years ago
|
Attachment #8404040 -
Attachment is obsolete: true
Assignee | ||
Comment 12•11 years ago
|
||
Haven't seen msucan for a few days; panos mind reviewing this? it's a really small patch. Uploaded a new one to fix a minor coding style.
Attachment #8415975 -
Attachment is obsolete: true
Attachment #8415975 -
Flags: review?(mihai.sucan)
Attachment #8418851 -
Flags: review?(past)
Reporter | ||
Comment 13•11 years ago
|
||
Comment on attachment 8418851 [details] [diff] [review]
799077-bp-transition.patch
Review of attachment 8418851 [details] [diff] [review]:
-----------------------------------------------------------------
Love it!
::: browser/devtools/debugger/debugger-controller.js
@@ +1745,5 @@
>
> // Initialize the breakpoint, but don't update the editor, since this
> // callback is invoked because a breakpoint was added in the editor itself.
> this.addBreakpoint(location, { noEditorUpdate: true }).then(aBreakpointClient => {
> // If the breakpoint client has an "requestedLocation" attached, then
Can you also fix the "an" typo above, please?
::: browser/devtools/sourceeditor/debugger.js
@@ +167,5 @@
> + marker.addEventListener('transitionend', function(e) {
> + ed.removeBreakpoint(info.line);
> + ed.addBreakpoint(toLine);
> +
> + // For some reason, we have to do reset the styles after the
Typo: "do" is redundant here.
::: browser/devtools/sourceeditor/editor.js
@@ +508,5 @@
> /**
> * Returns whether a marker of a specified class exists in a line's gutter.
> */
> hasMarker: function (line, gutterName, markerClass) {
> + let marker = this.getMarker(line, gutterName, markerClass);
getMarker() only takes 2 parameters.
Attachment #8418851 -
Flags: review?(past) → review+
Reporter | ||
Updated•11 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 14•11 years ago
|
||
Thanks, fixed! Waiting on try now.
Attachment #8418851 -
Attachment is obsolete: true
Assignee | ||
Comment 15•11 years ago
|
||
Tests are passing on try: https://tbpl.mozilla.org/?tree=Try&rev=6f6d4a170d2b
Keywords: checkin-needed
Assignee | ||
Comment 16•11 years ago
|
||
Add bug/message to patch
Attachment #8419541 -
Attachment is obsolete: true
Comment 17•11 years ago
|
||
Keywords: checkin-needed
Whiteboard: [mentor=msucan][lang=js,css] → [mentor=msucan][lang=js,css][fixed-in-fx-team]
Comment 18•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [mentor=msucan][lang=js,css][fixed-in-fx-team] → [mentor=msucan][lang=js,css]
Target Milestone: --- → Firefox 32
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•