[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-08-02 Thread Adam Barth

On Sun, Aug 2, 2009 at 8:35 PM, Peter Kasting wrote:
> I commented on the duplicate this bug was merged into.
> I think there's been a lack of clarity in the request here.  The problem is
> not that the text is a link; the problem is that the text is keeping its
> font, color, etc.  There may be a way to eliminate one and preserve the
> other.

Yeah, the font color issue is a long-standing bug.  I looked into it
for a few hours a while ago.  I think we're not intercepting the copy
event properly in the omnibox.

Adam

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-08-02 Thread Peter Kasting
On Sat, Aug 1, 2009 at 9:53 AM, ptr727  wrote:

> I looked at the defect filing, and the immediate reply that it was as
> designed.
> Maybe pointing to this thread would provide more details around the
> expected behavior, and why, i.e. why copying URL should only place
> text in the clipboard.


I commented on the duplicate this bug was merged into.

I think there's been a lack of clarity in the request here.  The problem is
not that the text is a link; the problem is that the text is keeping its
font, color, etc.  There may be a way to eliminate one and preserve the
other.

PK

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-08-01 Thread ptr727

On Jul 31, 7:15 pm, Tony Chang  wrote:
> I already filed a bug for 
> this:http://code.google.com/p/chromium/issues/detail?id=18194

Thank you.

I looked at the defect filing, and the immediate reply that it was as
designed.
Maybe pointing to this thread would provide more details around the
expected behavior, and why, i.e. why copying URL should only place
text in the clipboard.

P.

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-07-31 Thread Tony Chang

I already filed a bug for this:
http://code.google.com/p/chromium/issues/detail?id=18194

On Fri, Jul 31, 2009 at 7:06 PM, Evan Stade wrote:
>
> Ah, I am eating my words. So you don't like the
> targets/flavors/formats we write to when copying from the omnibox,
> correct? If you plan to create a patch to change this, here would be
> the place to discuss the technical details. If you are simply
> requesting a change, you might be better served filing a bug at
> crbug.com.
>
> Personally I agree that it seems wrong to write the data as html when
> copying out of the omnibox, but I don't know the various formats that
> Windows programs expect well enough to say for sure. On Linux I think
> the right targets would be plain text and maybe uri list.
>
> >
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-07-31 Thread Evan Stade

Ah, I am eating my words. So you don't like the
targets/flavors/formats we write to when copying from the omnibox,
correct? If you plan to create a patch to change this, here would be
the place to discuss the technical details. If you are simply
requesting a change, you might be better served filing a bug at
crbug.com.

Personally I agree that it seems wrong to write the data as html when
copying out of the omnibox, but I don't know the various formats that
Windows programs expect well enough to say for sure. On Linux I think
the right targets would be plain text and maybe uri list.

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-07-31 Thread ptr727

> By "copying the URL from the UI" do you mean copying the URL from the
> Omnibox?  Or copying from the webpage contents, using ctrl-c?

The edit box where you type the URL.
Click in it with the mouse (give it focus), press Ctrl-A (select all),
press Ctrl-C (copy).
This results in the clipboard having HTML content instead of just
text.

P.
--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-07-31 Thread Ojan Vafai
This is kind of off topic, but should we consider adding a
copy/cut-as-plain-text keyboard shortcut (ctrl+shift+c/x). That would be
nicely symmetrical with ctrl+shift+v for paste-as-plain-text.
Ojan

On Fri, Jul 31, 2009 at 4:57 PM, Scott Violet  wrote:

>
> I just happen to be looking at clipboard code for page contents.
> Here's the code for writing a URL:
>
> void WebClipboardImpl::writeURL(const WebURL& url, const WebString& title)
> {
>  ScopedClipboardWriterGlue scw(ClipboardGetClipboard());
>
>  scw.WriteBookmark(title, url.spec());
>  scw.WriteHTML(UTF8ToUTF16(URLToMarkup(url, title)), "");
>  scw.WriteText(UTF8ToUTF16(url.spec()));
> }
>
> Notice how we write it as HTML here.
>
> I'm not sure under what conditions we end up in that method though.
> Selecting a link on a page and pressing control-c ends up here:
>
> void WebClipboardImpl::writeHTML(
>const WebString& html_text, const WebURL& source_url,
>const WebString& plain_text, bool write_smart_paste) {
>  ScopedClipboardWriterGlue scw(ClipboardGetClipboard());
>  scw.WriteHTML(html_text, source_url.spec());
>  scw.WriteText(plain_text);
>
>  if (write_smart_paste)
>scw.WriteWebSmartPaste();
> }
>
>  -Scott
>
> On Fri, Jul 31, 2009 at 1:36 PM, Evan Stade wrote:
> >
> > I have a feeling you are talking about the render view, and you should
> > be asking these questions 'round webkit way
> >
> > -- Evan Stade
> >
> >
> >
> > On Fri, Jul 31, 2009 at 12:34 PM, Peter Kasting
> wrote:
> >> On Fri, Jul 31, 2009 at 12:00 PM, ptr727 
> wrote:
> >>>
> >>> To summarize, in Chrome copying the URL from the UI is not the same as
> >>> right click copy link.
> >>
> >> By "copying the URL from the UI" do you mean copying the URL from the
> >> Omnibox?  Or copying from the webpage contents, using ctrl-c?
> >>>
> >>> Right click copy link works fine because it does not contain HTML
> >>> formatted text.
> >>
> >> Does highlighting the link and copying do the same thing?
> >> PK
> >> >
> >>
> >
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-07-31 Thread Scott Violet

I just happen to be looking at clipboard code for page contents.
Here's the code for writing a URL:

void WebClipboardImpl::writeURL(const WebURL& url, const WebString& title) {
  ScopedClipboardWriterGlue scw(ClipboardGetClipboard());

  scw.WriteBookmark(title, url.spec());
  scw.WriteHTML(UTF8ToUTF16(URLToMarkup(url, title)), "");
  scw.WriteText(UTF8ToUTF16(url.spec()));
}

Notice how we write it as HTML here.

I'm not sure under what conditions we end up in that method though.
Selecting a link on a page and pressing control-c ends up here:

void WebClipboardImpl::writeHTML(
const WebString& html_text, const WebURL& source_url,
const WebString& plain_text, bool write_smart_paste) {
  ScopedClipboardWriterGlue scw(ClipboardGetClipboard());
  scw.WriteHTML(html_text, source_url.spec());
  scw.WriteText(plain_text);

  if (write_smart_paste)
scw.WriteWebSmartPaste();
}

  -Scott

On Fri, Jul 31, 2009 at 1:36 PM, Evan Stade wrote:
>
> I have a feeling you are talking about the render view, and you should
> be asking these questions 'round webkit way
>
> -- Evan Stade
>
>
>
> On Fri, Jul 31, 2009 at 12:34 PM, Peter Kasting wrote:
>> On Fri, Jul 31, 2009 at 12:00 PM, ptr727  wrote:
>>>
>>> To summarize, in Chrome copying the URL from the UI is not the same as
>>> right click copy link.
>>
>> By "copying the URL from the UI" do you mean copying the URL from the
>> Omnibox?  Or copying from the webpage contents, using ctrl-c?
>>>
>>> Right click copy link works fine because it does not contain HTML
>>> formatted text.
>>
>> Does highlighting the link and copying do the same thing?
>> PK
>> >
>>
>
> >
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-07-31 Thread Evan Stade

I have a feeling you are talking about the render view, and you should
be asking these questions 'round webkit way

-- Evan Stade



On Fri, Jul 31, 2009 at 12:34 PM, Peter Kasting wrote:
> On Fri, Jul 31, 2009 at 12:00 PM, ptr727  wrote:
>>
>> To summarize, in Chrome copying the URL from the UI is not the same as
>> right click copy link.
>
> By "copying the URL from the UI" do you mean copying the URL from the
> Omnibox?  Or copying from the webpage contents, using ctrl-c?
>>
>> Right click copy link works fine because it does not contain HTML
>> formatted text.
>
> Does highlighting the link and copying do the same thing?
> PK
> >
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-07-31 Thread Peter Kasting
On Fri, Jul 31, 2009 at 12:00 PM, ptr727  wrote:

> To summarize, in Chrome copying the URL from the UI is not the same as
> right click copy link.


By "copying the URL from the UI" do you mean copying the URL from the
Omnibox?  Or copying from the webpage contents, using ctrl-c?

Right click copy link works fine because it does not contain HTML
> formatted text.


Does highlighting the link and copying do the same thing?

PK

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-07-31 Thread ptr727

As I was writing this and testing steps to replicate, I found that the
HTML formatting did not always happen.

I found the answer using the Windows ClipBook Viewer (it is only
available on XP as clipbrd.exe, but works on Vista).
When placing contents in the clipbook, the application that saves the
information makes various versions of that information available.
Copy something, then click the view menu to see all the available
formats.

E.g. when copying from text from a Word doc you will see Text, Unicode
Text, Enhanced Metafile, Picture, Locale, OEM Text, DataObject, etc.
E.g. when you copy the URL in IE, you will see Unicode Text, Locale,
Text, and OEM Text.
E.g. when you right click copy shortcut in IE, you will see Unicode
Text, Locale, Text, and OEM Text, DataObject, FileContents,
FileGropupDescriptorW, etc.
E.g. when you copy the URL in FireFox, you will see Unicode Text,
Text, Locale, OEM Text, DataObject, Ole Private Data.
E.g. when you right click copy link location in FireFox, you will see
Unicode Text, Text, Locale, OEM Text, DataObject, Ole Private Data.
E.g. when you copy the URL in Chrome, you will see Unicode Text,
Locale, Text, Locale, OEM Text, UniformResourceLocatorW, HTML Format.
E.g. when you right click copy link address in Chrome, you will see
Unicode Text, Locale, Text, OEM Text.

When you paste in Outlook or Word, it defaults to HTML when available.
If I create a new Outlook email or a new Word doc, and I paste the
Chrome URL, it pastes fine because, I assume, there are no other HTML
tags.
If I am writing an email with formatting, or replying to an email, and
I then paste the contents, the URL has a Times New Roman font instead
of the font in the doc.

To summarize, in Chrome copying the URL from the UI is not the same as
right click copy link.
Right click copy link works fine because it does not contain HTML
formatted text.
Copy from URL does contain HTML formatted text, and results in
documents with weird formatting.

If the UI URL copy can work the same as the right click copy link
address, the problem can be solved.

P.





On Jul 31, 10:56 am, Tony Chang  wrote:
> Can you elaborate on how you're copying a URL from Chrome?  Are you
> using Ctrl+C, the page menu item, or the context menu?

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-07-31 Thread Tony Chang

Can you elaborate on how you're copying a URL from Chrome?  Are you
using Ctrl+C, the page menu item, or the context menu?

When I use the context menu, I only get the plain text of the URL.  In
the other two cases, doesn't every browser paste as HTML?

On Fri, Jul 31, 2009 at 10:28 AM, ptr727 wrote:
>
> Hi
>
> This is my first post in this group, so if there is more appropriate
> place to post a requests like this, please let me know.
>
> I often copy and past the browser URL or link URL's in documents or
> emails.
> IE copies the URL as plain text, and when pasting the URL in a
> document, the pasted text has not formatting, and correctly inherits
> the formatting of the document.
>
> When doing the same with Chrome, it pastes the the URL as formatted
> HTML, messing up the font and formatting of the document.
> To work around this, every time I paste in Outlook or Word, I have to
> select the paste special menu, and select paste as text.
>
> I can think of no particular reason why the URL or a link needs to be
> formatted in anything other than plain text.
>
> Can the URL and link copy code please be changed to not format the
> text?
>
>
> Thank you
> P.
> >
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-07-31 Thread Jeremy Orlow
On Fri, Jul 31, 2009 at 10:41 AM, PhistucK  wrote:

> Though, at least on Windows, that is what they (and the external
> application) are expecting, I mean, they expect the formatting not to
> change.
> Word, Outlook and rest are automatically turning the URL into a link if it
> is not already a link, anyway.
> GMail does not, true.
>

Gmail does when you send the mail, though.


> But any other browser (I think) is not formatting it with HTML.
>
> ☆PhistucK
>
>
>
> On Fri, Jul 31, 2009 at 20:30, Peter Kasting  wrote:
>
>> On Fri, Jul 31, 2009 at 10:28 AM, ptr727 wrote:
>>
>>> I can think of no particular reason why the URL or a link needs to be
>>> formatted in anything other than plain text.
>>
>>
>> Most people tend to prefer links to be formatted as links, so they can
>> click them.
>>
>> Can the URL and link copy code please be changed to not format the
>>> text?
>>
>>
>> I don't think that would serve our userbase well.
>>
>> PK
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-07-31 Thread PhistucK
Though, at least on Windows, that is what they (and the external
application) are expecting, I mean, they expect the formatting not to
change.
Word, Outlook and rest are automatically turning the URL into a link if it
is not already a link, anyway.
GMail does not, true.
But any other browser (I think) is not formatting it with HTML.

☆PhistucK


On Fri, Jul 31, 2009 at 20:30, Peter Kasting  wrote:

> On Fri, Jul 31, 2009 at 10:28 AM, ptr727  wrote:
>
>> I can think of no particular reason why the URL or a link needs to be
>> formatted in anything other than plain text.
>
>
> Most people tend to prefer links to be formatted as links, so they can
> click them.
>
> Can the URL and link copy code please be changed to not format the
>> text?
>
>
> I don't think that would serve our userbase well.
>
> PK
>
> >
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Copy URL as plain text instead of HTML

2009-07-31 Thread Peter Kasting
On Fri, Jul 31, 2009 at 10:28 AM, ptr727  wrote:

> I can think of no particular reason why the URL or a link needs to be
> formatted in anything other than plain text.


Most people tend to prefer links to be formatted as links, so they can click
them.

Can the URL and link copy code please be changed to not format the
> text?


I don't think that would serve our userbase well.

PK

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---