RESOLVED INVALID 10273
Copy and Paste of Javascript from the Inspector doesn't work properly
https://bugs.webkit.org/show_bug.cgi?id=10273
Summary Copy and Paste of Javascript from the Inspector doesn't work properly
Gavin Sherlock
Reported 2006-08-05 14:35:16 PDT
Open Webkit nightly. Attach Drosera. Go to : http://webkit.opendarwin.org/ In Drosera, look at source for http://www.google-analytics.com/urchin.js Copy multiple lines, and Paste to Microsoft Word. Expected Results: Code, with syntax coloring will be pasted Actual Results: A blank table is pasted, with as many rows as there were line of code. Workaround : Paste one line at a time.
Attachments
Gavin Sherlock
Comment 1 2006-08-05 14:44:32 PDT
Additional workaround: Use Paste Special, and select Styled Text. However, the syntax coloring is then incorrect, with the colors being shifted forward with respect to the text that they are coloring.
Alexey Proskuryakov
Comment 2 2006-08-14 10:43:37 PDT
I can confirm the behavior, but it's not clear whether the issue is within WebKit. The problem with styled text might well be an entirely separate one (at a first glance, looks like 'ustl' clipboard flavor is generated incorrectly).
Timothy Hatcher
Comment 3 2008-05-17 09:06:24 PDT
Is this an issue with the Web Inspector's code views?
Gavin Sherlock
Comment 4 2008-05-17 11:51:33 PDT
Alas, there is no syntax coloring in the Web Inspector's view of the code, so the bug is now irrelevant. However, loss of syntax coloring is a step backwards. Should I file a bug on that? It would also be nice if the javascript code were pretty printed in the Web Inspector - should I file a bug for that too?
Gavin Sherlock
Comment 5 2008-05-17 11:55:05 PDT
I should note that I was testing with r33475 in case this behavior has changed since then (though this was the latest downloadable revision).
Timothy Hatcher
Comment 6 2008-05-25 14:07:20 PDT
We have bugs about those two issues.
Timothy Hatcher
Comment 7 2008-08-19 11:42:47 PDT
Now that we have syntax highlighting again, does it reproduce in the Inspector?
Gavin Sherlock
Comment 8 2008-08-19 11:55:30 PDT
Testing with r35814, I still see this bug. For this case, I went to: http://smd.stanford.edu/js/ontology/v1/ExampleProduction.html Selected: http://smd.stanford.edu/js/ontology/v1/OntologyTreeBrowser.js in the Resources list, then copied and pasted, using Paste Special->Styled Text, to Word, the following code snippet: function OntologyTreeBrowser(uid) { this.tree = new YAHOO.widget.TreeView ('treediv'+uid); this.uid = uid; /** now there is a div to store the highlighted id as in div id='highlight'+uid, value= **/ } From this.tree, the syntax highlighting starts to veer off.
Gavin Sherlock
Comment 9 2008-08-19 16:06:44 PDT
Updated title to reflect Inspector, rather than Drosera.
Joseph Pecoraro
Comment 10 2009-10-02 22:38:35 PDT
(In reply to comment #8) > Testing with r35814, I still see this bug. > > For this case, I went to: > http://smd.stanford.edu/js/ontology/v1/ExampleProduction.html > > Selected: > http://smd.stanford.edu/js/ontology/v1/OntologyTreeBrowser.js > > in the Resources list, then copied and pasted, using Paste Special->Styled > Text, to Word, the following code snippet: > > function OntologyTreeBrowser(uid) { > this.tree = new YAHOO.widget.TreeView ('treediv'+uid); > this.uid = uid; > /** now there is a div to store the highlighted id as in div > id='highlight'+uid, value= **/ > > } > > From this.tree, the syntax highlighting starts to veer off. I just played with this in Pages with r49008. It pasted with and without style perfectly in Pages. Is this an issue specific to Microsoft Word? Does anyone have Word and can verify if this is still an issue?
Gavin Sherlock
Comment 11 2009-10-03 00:11:14 PDT
It still has the buggy behavior exactly as described in comment #8 with Word 2008 with r49032. I tried with Pages 09, and it kind of works, in that the syntax highlighting is correct, but the text is still pasted as a table, rather than just as lines of styled text. Oddly, copying and pasting the table from Pages then into Word works correctly....
Alexander Pavlov (apavlov)
Comment 12 2011-09-06 09:01:22 PDT
As of r94572, the text is pasted as a single flow, but all leading spaces are not preserved (presumably, due to the fact that all whitespace is collapsed in HTML, unlike  )
Blaze Burg
Comment 13 2014-01-12 10:37:23 PST
The inspector now uses CodeMirror as its text editor widget. Please re-open if this is still relevant on recent nightlies.
Note You need to log in before you can comment on or make changes to this bug.