Open
Bug 723890
Opened 13 years ago
Updated 3 years ago
Improve "<inline style sheet #n>" label
Categories
(DevTools :: Style Editor, enhancement, P3)
DevTools
Style Editor
Tracking
(Not tracked)
NEW
People
(Reporter: cedricv, Unassigned)
Details
(Whiteboard: [styleeditor])
Attachments
(1 file, 4 obsolete files)
|
4.40 KB,
patch
|
Details | Diff | Splinter Review |
The sequential order (ie. #n) is not very useful, the order in the list already gives that information.
It would be more useful to show the line number of the owner style element in the document (when possible).
Possible representations (that I think of) :
A) <inline style sheet:42>
B) <inline style sheet at line 42>
C) <style:42>
D) <style> at line 42
Any preference?
Comment 1•13 years ago
|
||
(In reply to Cedric Vivier [:cedricv] from comment #0)
> Possible representations (that I think of) :
>
> A) <inline style sheet:42>
> B) <inline style sheet at line 42>
> C) <style:42>
> D) <style> at line 42
>
> Any preference?
I like D because it seems easiest to interpret.
Any thoughts on style sheets that are created via the New button?
<style> created by Style Editor
?
| Reporter | ||
Comment 2•13 years ago
|
||
(In reply to Kevin Dangoor from comment #1)
> (In reply to Cedric Vivier [:cedricv] from comment #0)
> > D) <style> at line 42
> >
> > Any preference?
>
> I like D because it seems easiest to interpret.
D it is then.
> Any thoughts on style sheets that are created via the New button?
> <style> created by Style Editor
> ?
Isn't "New style sheet" as it is currently straightforward enough?
Comment 3•13 years ago
|
||
(In reply to Cedric Vivier [:cedricv] from comment #2)
> Isn't "New style sheet" as it is currently straightforward enough?
Err, yeah. I was thinking that New created more "inline style sheet"s, but that's not how it's presented... what we've got looks good there
Comment 5•13 years ago
|
||
It's not uncommon for things to dynamically add <style> elements, but they become hard to distinguish (and by 'hard' I mean 'practically impossible') because all you get is a #number.
Could we do "<style> at line 42" when the style does not have an id, and "<style id=foo>" when it does? That way people can add style elements with an id and have them distinguishable?
Updated•13 years ago
|
Whiteboard: [styleeditor][good-first-bugs][mentor=cedricv] → [styleeditor][good first bug][mentor=cedricv]
Comment 6•13 years ago
|
||
> Could we do "<style> at line 42" when the style does not have an id, and
> "<style id=foo>" when it does? That way people can add style elements with
> an id and have them distinguishable?
Is there any way to detect if style element has id or not? here http://mxr.mozilla.org/mozilla-central/source/browser/devtools/styleeditor/StyleEditor.jsm#353.
Comment 7•13 years ago
|
||
I would think that you should be able to use 'this.styleSheet.ownerNode.id'.
Comment 8•13 years ago
|
||
Attachment #600662 -
Attachment is obsolete: true
Attachment #630937 -
Flags: review?(jwalker)
Comment 9•13 years ago
|
||
(In reply to Jignesh Kakadiya [:jhk] from comment #8)
> Created attachment 630937 [details] [diff] [review]
> Patch(v1)
That looks great.
One thing: we can't change the value of a property. We have to change its name (it's much easier for the l10n process). So rename "inlineStyleSheet" to "inlineStyleSheet2" or, even better, to "inlineStyleSheetWithIndex".
Comment 10•13 years ago
|
||
Thanks Paul.
Fixed it.
Attachment #630937 -
Attachment is obsolete: true
Attachment #630937 -
Flags: review?(jwalker)
Attachment #631016 -
Flags: review?(jwalker)
Comment 11•13 years ago
|
||
Comment on attachment 631016 [details] [diff] [review]
Patch(v2)
r+! Thank you :)
Can you please change these 2 things? Then I'll land you code.
> + return id ? _("inlineStyleSheetWithId", id) : _("inlineStyleSheetWithIndex", index);
Can you break that into a simple if () {} block (because the line is getting rather long).
--
> +#LOCALIZATION NOTE (inlineStyleSheetWithId)
> +# This is name used for style sheet that is declared inline in the <style> element
> +# and that style element have id.
Can you update your comment to:
> +# This is the name used for a style sheet that is declared inline in the <style> element
> +# and that has an ID.
Attachment #631016 -
Flags: review?(jwalker) → review+
Comment 12•13 years ago
|
||
Fixed above comments. Patch to Land.
Attachment #631016 -
Attachment is obsolete: true
Comment 13•13 years ago
|
||
Comment on attachment 631036 [details] [diff] [review]
Patch(v3)
My bad, I've been to fast.
You use the position of the <style> element as its line number. And you should not.
"index" is the position (as in "<style> number 3").
You need to get the actual line number.
Sorry for the precipitated review :/
Attachment #631036 -
Flags: review-
Comment 14•13 years ago
|
||
Would anyone know an easy way to get the line number of the <style> element?
Comment 15•13 years ago
|
||
(In reply to Paul Rouget [:paul] from comment #14)
> Would anyone know an easy way to get the line number of the <style> element?
CssLogic:1424 does this I think.
Comment 16•13 years ago
|
||
(In reply to Joe Walker from comment #15)
> (In reply to Paul Rouget [:paul] from comment #14)
> > Would anyone know an easy way to get the line number of the <style> element?
>
> CssLogic:1424 does this I think.
I looked at that and it seems it returns line of the parent CSSStyleRule in the parent CSSStyleSheet and what we want is line of CSSStyleSheet inside Document.I guess it should be property of (CssSheet)CssLogic.jsm#913. As it handles all the stuff related to stylesheet. Right now all we get is the position/index of the stylesheet. May be we can get it from API which does initial parsing of documents style elements. But I don't know where it does that. Any one knows it?
Comment 17•13 years ago
|
||
I updated the previous patch and tried to do an approach to get the line number. However, it's still not good enough and doesn't show the exact line, because I wasn't able to get the whole doc text to count all the lines breaks.
Maybe someone else has an idea on how to improve it?
Attachment #631036 -
Attachment is obsolete: true
Attachment #668240 -
Flags: feedback?(paul)
Comment 18•13 years ago
|
||
Comment on attachment 668240 [details] [diff] [review]
Patch v4
That seems fragile. But I can't think of any better way to do it :( This might require some platform work.
Attachment #668240 -
Flags: feedback?(paul)
Comment 19•12 years ago
|
||
I'm going through older "good first bugs" that have been inactive for a while.
Paul, this one seems to be blocked. Do you think it is changed something in the meanwhile?
Flags: needinfo?(paul)
Comment 20•12 years ago
|
||
Not really good-first-bug anymore.
Flags: needinfo?(paul)
Whiteboard: [styleeditor][good first bug][mentor=cedricv] → [styleeditor]
Updated•7 years ago
|
Product: Firefox → DevTools
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•