Closed
Bug 713612
Opened 14 years ago
Closed 14 years ago
add closing curly bracket to avoid disrupting the rest of the CSS
Categories
(DevTools :: Style Editor, defect, P2)
DevTools
Style Editor
Tracking
(firefox12 verified)
VERIFIED
FIXED
Firefox 12
Tracking | Status | |
---|---|---|
firefox12 | --- | verified |
People
(Reporter: mattw, Assigned: cedricv)
References
()
Details
(Whiteboard: [styleeditor][qa!])
Attachments
(1 file, 1 obsolete file)
4.79 KB,
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20111226 Firefox/12.0a1
Build ID: 20111226031002
Steps to reproduce:
Opening up a curly bracket when creating a new CSS rule.
Actual results:
the entire page crashes due to the lack of a closing curly bracket
Expected results:
either the Style Editor should add a closing curly bracket, or wait a second or two for me to finishing adding my rules to avoid having the rest of the page crash
Reporter | ||
Updated•14 years ago
|
Summary: add closing curly bracket to avoid screwing up the rest of the page → add closing curly bracket to avoid crashing the rest of the CSS
Reporter | ||
Updated•14 years ago
|
Summary: add closing curly bracket to avoid crashing the rest of the CSS → add closing curly bracket to avoid disrupting the rest of the CSS
Comment 1•14 years ago
|
||
(In reply to Matthew Wein from comment #0)
> the entire page crashes due to the lack of a closing curly bracket
>
> Expected results:
>
> either the Style Editor should add a closing curly bracket, or wait a second
> or two for me to finishing adding my rules to avoid having the rest of the
> page crash
What is meant here is not that the page crashes, but that the styling of the page is sometimes altered to the point of it being unrecognizable until the closing curly bracket is added.
OS: Windows 7 → All
Hardware: x86_64 → All
Version: 12 Branch → Trunk
Comment 2•14 years ago
|
||
Updated STR:
1. Visit http://www.mozilla.org/projects/firefox/prerelease.html
2. Open the Style Editor
3. In the screen-2010.css file, above the /* {{{ Reset */ comment, add a selector and opening bracket.
4. Wait a second or two for the style to be applied.
Expected results:
Opening the curly bracket should add a matching closing bracket.
Actual results:
Lack of closing bracket causes the rest of the CSS rules to have invalid syntax and as such the styles fail to apply.
Comment 3•14 years ago
|
||
Cedric, didn't the style editor used to automatically close new opening braces?
Assignee | ||
Comment 4•14 years ago
|
||
(In reply to Dave Camp (:dcamp) from comment #3)
> Cedric, didn't the style editor used to automatically close new opening
> braces?
The add-on does. This was especially necessary for automatic transitions.
There is another bug to add this feature in a more generic way in SourceEditor (bug 678980)
Depends on: 678980
Comment 5•14 years ago
|
||
How hard would it be to put in the addon's workaround for now? I don't think this should depend on a decision about whether closing brackets by default is the right behavior for SourceEditor.
Priority: -- → P2
Assignee | ||
Comment 6•14 years ago
|
||
Assignee | ||
Updated•14 years ago
|
Attachment #588047 -
Flags: review? → review?(rcampbell)
Comment 7•14 years ago
|
||
Comment on attachment 588047 [details] [diff] [review]
StyleEditor-specific bracket completion
+ let pairs = {
+ 123/*{*/: {
+ closeString: "}",
+ closeKeyCode: Ci.nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET
+ },
+ 40/*(*/: {
+ closeString: ")",
+ closeKeyCode: Ci.nsIDOMKeyEvent.DOM_VK_0
+ },
+ 91/*[*/: {
+ closeString: "]",
+ closeKeyCode: Ci.nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET
+ },
+ };
Those comments threw me off for a second. The lack of spacing make them difficult to parse at a glance.
Could you move those comments after the { ?
e.g., 123: { // '{'
or similar.
+ //we got a pair to complete, simulate the closing key
^ space
I might reword that to:
// We detected an open bracket sending closing character.
actual code looks decent. Does the SourceEditor not provide a convenient mechanism to insert a key or string like this? Might make sense to add this there for reuse.
Could be done in a followup bug.
Attachment #588047 -
Flags: review?(rcampbell) → review+
Updated•14 years ago
|
Whiteboard: [needs-update]
Assignee | ||
Comment 8•14 years ago
|
||
Attachment #588047 -
Attachment is obsolete: true
Assignee | ||
Comment 9•14 years ago
|
||
(In reply to Rob Campbell [:rc] (robcee) from comment #7)
> Does the SourceEditor not provide a convenient
> mechanism to insert a key or string like this? Might make sense to add this
> there for reuse.
Bracket completion is a bit more specific than a plain text insert, needs to be added to the current undo stack as if the user pressed the key himself, and the caret offset needs to be adjusted so that the insertion is not intrusive.
We have bug 678980 open for a more generic implementation of this feature in SourceEditor.
No longer depends on: 678980
Whiteboard: [needs-update] → [styleeditor][land-in-fx-team]
Comment 10•14 years ago
|
||
status-firefox12:
--- → fixed
Whiteboard: [styleeditor][land-in-fx-team] → [styleeditor][fixed-in-fx-team]
Comment 11•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [styleeditor][fixed-in-fx-team] → [styleeditor]
Target Milestone: --- → Firefox 12
Comment 12•13 years ago
|
||
Verified as fixed on:
Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:12.0) Gecko/20100101 Firefox/12.0
20120328051619
Status: RESOLVED → VERIFIED
Whiteboard: [styleeditor][qa+] → [styleeditor][qa!]
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•