Closed
Bug 789094
Opened 12 years ago
Closed 12 years ago
Style editor: scripts with unicode in the name are URL-escaped
Categories
(DevTools :: Style Editor, defect)
DevTools
Style Editor
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 19
People
(Reporter: espadrine, Assigned: marioalv)
Details
(Whiteboard: [good first bug][lang=js][mentor=dao])
Attachments
(3 files, 2 obsolete files)
Take a file named <☙.css>. In the Style Editor, it is displayed as <%E2%98%99.js>. It would be nicer to display it as the corresponding unicode character, as the awesome bar itself does.
Comment 1•12 years ago
|
||
can we get a mentor for this?
Whiteboard: [good-first-bugs][lang=js][mentor=?]
Updated•12 years ago
|
Whiteboard: [good-first-bugs][lang=js][mentor=?] → [good first bug][lang=js][mentor=?]
Updated•12 years ago
|
Assignee: nobody → marioalv.mozilla
Assignee | ||
Comment 2•12 years ago
|
||
Hi. I would like to help solving this bug. Could someone please give me a hint about where in the code is located the style editor files and what files would need to be changed? Thanks.
Comment 3•12 years ago
|
||
Style editor code is in browser/devtools/styleeditor
Assignee | ||
Comment 4•12 years ago
|
||
This is my first patch for this bug. I copied the function losslessDecodeURI(aURI) from browser.js to emulate the behavior of the awesome bar. I tested a HTML file with this stylesheet includes: <link rel="stylesheet" type="text/css" href="☙.css"> <link rel="stylesheet" type="text/css" href="styles.css?стиль&somethingElse_☙_hello"> <link rel="stylesheet" type="text/css" href="стиль.css"> All the file names were properly displayed in the style editor. The only strange behavior (which also happens in the awesome bar) is when you include the "%" character in an URL, along with non english characters, like this: http://localhost/test/test.html?стиль_abc%def.css In that case, the awesome bar will display the URL as: http://localhost/test/test.html?%D1%81%D1%82%D0%B8%D0%BB%D1%8C_abc%def.css and the style editor will display the stylesheet include <link rel="stylesheet" type="text/css" href="стиль_abc%def.css"> as %D1%81%D1%82%D0%B8%D0%BB%D1%8C_abc%def.css . Please let me know if something needs to be changed or done differently. Thanks.
Attachment #666681 -
Flags: review?(dao)
Assignee | ||
Comment 5•12 years ago
|
||
Assignee | ||
Comment 6•12 years ago
|
||
Comment 7•12 years ago
|
||
Comment on attachment 666681 [details] [diff] [review] First patch to show the corresponding characters in the style editor Thanks for this patch. It seems to me that the displayed name can just be decoded lossy here, as it's only purpose is being displayed -- as opposed to the location bar, it can't be copied or edited here and won't be used to make further HTTP requests. So I think all you want here is call decodeURI and be done with it.
Attachment #666681 -
Flags: review?(dao)
Updated•12 years ago
|
Whiteboard: [good first bug][lang=js][mentor=?] → [good first bug][lang=js][mentor=dao]
Assignee | ||
Comment 8•12 years ago
|
||
This patch uses the function decodeURI() to decode the characters from the stylesheet filename displayed in the Style Editor of the Web Developer tool.
Attachment #666681 -
Attachment is obsolete: true
Attachment #667124 -
Flags: review?(dao)
Comment 9•12 years ago
|
||
Comment on attachment 667124 [details] [diff] [review] Second version of the patch to show the corresponding characters in the style editor decodeURI can throw, so you'll need to wrap this in try/catch.
Attachment #667124 -
Flags: review?(dao) → feedback+
Assignee | ||
Comment 10•12 years ago
|
||
Added a try/catch for the decodeURI function call.
Attachment #667124 -
Attachment is obsolete: true
Attachment #667600 -
Flags: review?(dao)
Comment 11•12 years ago
|
||
Comment on attachment 667600 [details] [diff] [review] Third version of the patch to show the corresponding characters in the style editor Thanks! I suppose we have no tests for this that need to be updated.
Attachment #667600 -
Flags: review?(dao) → review+
Assignee | ||
Comment 12•12 years ago
|
||
Hi. Thanks for the review. Does this patch need to be executed in the try server?
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 13•12 years ago
|
||
Pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=9895d8cf22b2 I'll push to inbound later if it's green and a devtools reviewer gives r+.
Status: NEW → ASSIGNED
Updated•12 years ago
|
Attachment #667600 -
Flags: review+
Comment 14•12 years ago
|
||
Pushed to inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/efbc7c741357
Flags: in-testsuite-
Keywords: checkin-needed
Comment 15•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/efbc7c741357
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 19
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•