Bug 41476 - Dragging URL with linebreak truncates URL
: Dragging URL with linebreak truncates URL
Status: RESOLVED WONTFIX
Product: WebKit
Classification: Unclassified
Component: HTML Editing
: 528+ (Nightly build)
: PC Mac OS X 10.5
: P2 Normal
Assigned To: Nobody
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-01 11:55 PDT by Daniel Cheng
Modified: 2012-05-01 10:06 PDT (History)
6 users (show)

See Also:


Attachments
Patch (7.78 KB, patch)
2010-07-01 15:01 PDT, Daniel Cheng
dcheng: review-
dcheng: commit‑queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Cheng 2010-07-01 11:55:48 PDT
Some web sites attempt to automatically wrap long lines, which can occasionally cause an embedded URL to be wrapped incorrectly. If you select the URL (including the part that got wrapped around and is unlinked), and drag it, you can have two different behaviors depending on where you started your drag:
1. If you start the drag from the text, there will be no URL in the drag data. Safari and Chromium will still navigate to the proper URL (they strip out all whitespace from a URL-like string prior to navigating).
2. If you start the drag from the hyperlinked portion, then Safari and Chromium will only use the URL data in the drag. Since the hyperlinked URL was mistakenly truncated, Safari and Chromium will fail this navigation.

As far as I can tell, Firefox is able to handle this case correctly, so we should try too.
Comment 1 Daniel Cheng 2010-07-01 15:01:42 PDT
Created attachment 60292 [details]
Patch
Comment 2 Dave Hyatt 2010-07-01 15:11:47 PDT
Comment on attachment 60292 [details]
Patch

This patch makes zero sense to me.  The source is clearly broken.
Comment 3 Daniel Cheng 2010-07-01 15:37:48 PDT
Comment on attachment 60292 [details]
Patch

(In reply to comment #2)
> (From update of attachment 60292 [details])
> This patch makes zero sense to me.  The source is clearly broken.

See comment #4 on http://code.google.com/p/support/issues/detail?id=2363. If you select the entire URL, including the section that was badly wrapped, then you get two different behaviors depending on how you start the drag:
1) If you start the drag by clicking on the link and drop it in a WebKit view to navigate, you will navigate to a broken URL.
2) If you start the drag by clicking on the non-linked portion of the URL, you will navigate to the complete URL.
Obviously the link itself is broken, but it seems strange to have two different behaviors for dragging around the same bit of data.

I'll be moving the ClipboardChromium change into a separate patch.
Comment 4 Stuart Morgan 2010-07-01 15:45:30 PDT
(In reply to comment #2)
> The source is clearly broken.

Nobody is arguing that it's not; the point is that it's a case that does happen in the wild (I'm sure I've seen this on sites other than code.google.com), and the behavior is strange and hard to understand--I was being bitten by this and it took me a while to figure out that the place I clicked in the selection to start the drag mattered; before that I thought it was random.

If we can do what users expect in the face of mildly broken sites, that seems like a win; c.f. quirks mode.
Comment 5 Ryosuke Niwa 2012-04-30 22:24:40 PDT
I'd say we won't fix this bug. I don't think we want to be too clever about these things given how many editing and drag&drop bugs we already have. If websites have a bug to auto-truncate URLs, then it's their authors' responsibility to fix that.