Last Comment Bug 719916 - style inspector loses focus after entering attribute name
: style inspector loses focus after entering attribute name
Status: RESOLVED FIXED
[ruleview]
:
Product: Firefox
Classification: Client Software
Component: Developer Tools: Inspector (show other bugs)
: Trunk
: Other Other
: -- normal (vote)
: Firefox 13
Assigned To: Dave Camp (:dcamp)
:
: Patrick Brosset <:pbro>
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-20 11:21 PST by Stefan
Modified: 2012-03-08 23:26 PST (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix (6.98 KB, patch)
2012-03-05 09:42 PST, Dave Camp (:dcamp)
jwalker: review+
Details | Diff | Splinter Review
updated per review comment (7.49 KB, patch)
2012-03-07 17:09 PST, Dave Camp (:dcamp)
no flags Details | Diff | Splinter Review
removed broken test changes (5.71 KB, patch)
2012-03-08 12:51 PST, Dave Camp (:dcamp)
no flags Details | Diff | Splinter Review

Description Stefan 2012-01-20 11:21:00 PST
User Agent:  

Steps to reproduce:

1. Open a new tab (blank page).
2. Inspect (ctrl-shift-i).
3. Press "Style" Button.
4. Click at closing brace ('}').
5. Enter 'foo'.
6. Press ':'-Key or RETURN-Key.


Actual results:

6. No focus in value field.


Expected results:

6. Focus in the value field.
Comment 1 Tim (fmdeveloper) 2012-01-20 14:58:35 PST
Confirmed on Mozilla/5.0 (Windows NT 5.1; rv:12.0a1) Gecko/20120120 Firefox/12.0a1 ID:20120120031125
Comment 2 Paul Rouget [:paul] 2012-01-20 16:38:41 PST
I think this happens with about:* pages (same behavior with about:home).
Comment 3 Dave Camp (:dcamp) 2012-03-05 09:42:35 PST
Created attachment 602945 [details] [diff] [review]
fix
Comment 4 Joe Walker [:jwalker] (needinfo me or ping on irc) 2012-03-05 10:41:56 PST
Comment on attachment 602945 [details] [diff] [review]
fix

Review of attachment 602945 [details] [diff] [review]:
-----------------------------------------------------------------

This may be hacky but it has 2 great features for hacky:
- It's short
- There are more lines of comment than hack

::: browser/devtools/styleinspector/CssRuleView.jsm
@@ +724,4 @@
>      }
>      this._viewedElement = null;
>      this._elementStyle = null;
> +    this._focusBackstop = null;

Way back when I was a C programmer doing manual memory management, I had a rule for getting it right - symmetry - there must be symmetry between allocation and deallocation, so I might remove the event listener before I delete the element.

(That's a 'yes I read this' comment. You probably want to ignore me :)
Comment 5 Dave Camp (:dcamp) 2012-03-07 17:09:55 PST
Created attachment 603921 [details] [diff] [review]
updated per review comment

https://tbpl.mozilla.org/?tree=Try&rev=267a47771847
Comment 6 Dave Camp (:dcamp) 2012-03-08 12:51:28 PST
Created attachment 604162 [details] [diff] [review]
removed broken test changes

That patch included some half-baked broken test changes in addition to the working new test.  Pulled that out, ran through try:

https://tbpl.mozilla.org/?tree=Try&rev=af755dafec46
Comment 7 Tim Taubert [:ttaubert] 2012-03-08 23:26:05 PST
https://hg.mozilla.org/mozilla-central/rev/cef966930777

Note You need to log in before you can comment on or make changes to this bug.