Bug 10273
Summary: | Copy and Paste of Javascript from the Inspector doesn't work properly | ||
---|---|---|---|
Product: | WebKit | Reporter: | Gavin Sherlock <gsherloc> |
Component: | Web Inspector (Deprecated) | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | apavlov, ap, bburg, joepeck |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://www.google-analytics.com/urchin.js |
Gavin Sherlock
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Gavin Sherlock
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
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
Is this an issue with the Web Inspector's code views?
Gavin Sherlock
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
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
We have bugs about those two issues.
Timothy Hatcher
Now that we have syntax highlighting again, does it reproduce in the Inspector?
Gavin Sherlock
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
Updated title to reflect Inspector, rather than Drosera.
Joseph Pecoraro
(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
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)
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
The inspector now uses CodeMirror as its text editor widget. Please re-open if this is still relevant on recent nightlies.