Copying CSS Rules from the Devtools Inspector inserts empty lines between rules
Categories
(DevTools :: Inspector: Rules, defect, P2)
Tracking
(firefox76 fixed)
Tracking | Status | |
---|---|---|
firefox76 | --- | fixed |
People
(Reporter: lachlan, Assigned: sankalp.sans, Mentored)
References
Details
Attachments
(1 file)
Comment 1•7 years ago
|
||
Reporter | ||
Comment 2•7 years ago
|
||
Updated•7 years ago
|
Comment 4•6 years ago
|
||
Hey, I can give this issue a try. Can you please assign it to me?
Updated•6 years ago
|
Comment 5•6 years ago
|
||
I can't reproduce this in Firefox 68.0a1 (2019-03-18).
Is there a reduced test case where this still occurs?
Reporter | ||
Comment 6•6 years ago
|
||
I can't reproduce this either. It seems to have been fixed between v57 and v58.
Reporter | ||
Updated•6 years ago
|
I'm sorry, I just reproduced it today with 66.0.1 (64-bit)
This only happens when I ctrl + C - if I right click and copy, it does not happen.
Reporter | ||
Comment 8•6 years ago
|
||
(In reply to yoni from comment #7)
I'm sorry, I just reproduced it today with 66.0.1 (64-bit)
This only happens when I ctrl + C - if I right click and copy, it does not happen.
It doesn't happen for me with macOS Mojave on v66.0.1 when using keyboard shortcut, edit menu or right click option.
@yoni, Are you able to provide more details about how you reproduce the issue?
@Lachlan, would be happy to provide details but unsure what you'd need & what I could provide without exposing private site info.
I'm on Windows 10, latest updated FF.
Reporter | ||
Comment 10•6 years ago
|
||
What are the steps to reproduce the issue? Is it a local development environment? Does it happen on any other sites?
Without more information, there's no way to reproduce the issue which means it cannot be debugged and resolved.
Comment 11•6 years ago
|
||
The site is not a local environment - it is a server. It happens very randomly but as fortune would have it today when you closed the issue I was suffering the same issue.
I copy and paste from a site using Ctrl C after selecting the CSS rules, pasting into Sublime Text 3 (also on Windows) and it inserts spaces. For example:
Use mouse to select these rules and press Ctrl C: https://s.put.re/37De7gQb.png
Pasted into ST3 using Ctrl V: https://s.put.re/kuyNp655.png
If I have selected those and right clicked Copy, pasting it into ST3 looks like this: https://s.put.re/XRW577NL.png
Reporter | ||
Comment 12•6 years ago
|
||
I think I can replicate this issue though need someone to confirm.
When I highlight only a few rules and copy/paste them, the extra newlines appear.
If the selection includes any part of the opening or closing line of the rule, the newlines do get pasted.
Here's a video to demonstrate.
Comment 13•6 years ago
|
||
Nice video Lachlan, thanks for doing that.
You've identified there another related bug - the fact that on some selects, you have a tab indentation on all lines after the first. Another annoying mini bug.
Updated•6 years ago
|
Comment 14•6 years ago
|
||
Hey Gabriel,
Can you please assign this task for other contributors as I have a lot more issues to work on and will look on this one if nobody else takes it.
Thanks in advance.
Updated•6 years ago
|
Assignee | ||
Comment 15•5 years ago
|
||
Hi folks, I'd be happy to take up this issue. I actively want this fixed (recently switched all my dev from Chrome to Firefox, and realized this to be a pain point)
@Gabriel could you assign this to me?
Comment 16•5 years ago
•
|
||
(In reply to sankalp.sans from comment #15)
Hi folks, I'd be happy to take up this issue. I actively want this fixed (recently switched all my dev from Chrome to Firefox, and realized this to be a pain point)
@Gabriel could you assign this to me?
Hi!
You're welcome to fix this. I've assigned it to you.
There's a duplicate bug 1619894 which mentions the unwanted line breaks occur only after the Computed panel is visible at least once. That unexpected interaction is a good place to start looking for the root cause.
Copied over the steps to reproduce:
- Open the inspector.
- Make sure to set the 3rd pane to "computed"
- Highlight text in the rules view and copy it to clipboard
- Paste the copied text into an editor.
The StyleInspectorMenu
is where the copying action is done: https://searchfox.org/mozilla-central/source/devtools/client/inspector/shared/style-inspector-menu.js
If you haven't done so already, check out this resource on getting the code and getting started: https://docs.firefox-dev.tools/
Assignee | ||
Comment 18•5 years ago
|
||
Assignee | ||
Comment 19•5 years ago
|
||
Thanks, Razvan.
That information was incredibly helpful. The docs are also beautifully navigable.
This is my first contribution to the project, and I was able to get up and running in no time!
In fact I was able to prepare the patch over this weekend too.
https://phabricator.services.mozilla.com/D66899
Please do let me know if this is okay.
I've tested it with a couple of scenarios, and the behavior is nominal in each one of those.
Comment 20•5 years ago
|
||
Comment 21•5 years ago
|
||
bugherder |
Comment 22•5 years ago
|
||
How do I get this fix?
Comment 23•5 years ago
|
||
(In reply to legoduke from comment #22)
How do I get this fix?
If you really need it immediately, you can download Firefox Nightly and use it right away.
Otherwise, this fix will carry over to Firefox Beta and Firefox Developer Edition in about 2 weeks and then to Firefox Release in about 6 weeks.
Updated•5 years ago
|
Comment 24•5 years ago
|
||
Hi
In Firefox Nightly ( version 77 ) copy in inspector not working. And in version 75 not working too.
OS Windows 10.
Comment 25•5 years ago
|
||
Hi
In Firefox 78 copy not working :( OS Windows 10
Comment 26•4 years ago
|
||
Using Ctrl+C when copying part of the CSS is not working for me on Windows 10 - FF 83.0 (64-bit). This works fine on my MAC computer.
Copying including the selector works fine.
I need to do right click then Copy to make it work.
Description
•