Summary: | [GTK] can't middle-button paste within a single window | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Dan Winship <danw> | ||||||||||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | alex, christian, commit-queue, darin, eric, evan, pachoramos1, reinouts, tony, xan.lopez | ||||||||||||
Priority: | P2 | ||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||
Hardware: | PC | ||||||||||||||
OS: | Linux | ||||||||||||||
Bug Depends on: | 31711 | ||||||||||||||
Bug Blocks: | |||||||||||||||
Attachments: |
|
Description
Dan Winship
2009-08-10 10:35:04 PDT
*** Bug 27838 has been marked as a duplicate of this bug. *** Created attachment 41645 [details] Proposed patch This is a first proposal to fix this issue. Now we store a reference to the range instead of requesting it every time, and we do not release it until the clipboard is requested. Consider applying this other simple patch for the .h file also: https://bugs.webkit.org/show_bug.cgi?id=30664 Is it not possible to write a test for this? It would seem you could add some sort of middle-click event to layoutTestController. eventSender.mouseDown takes a button argument if that's helpful. I think mouseDown(1) is the middle button. Comment on attachment 41645 [details]
Proposed patch
Patch looks fine but can we please add a test?
r- for the lack of test.
(In reply to comment #4) > eventSender.mouseDown takes a button argument if that's helpful. I think > mouseDown(1) is the middle button. Actually we added support for that parameter some weeks ago: 2009-10-08 Alejandro G. Castro <alex@igalia.com> Reviewed by Xan Lopez. [GTK] Added support for a parameter setting the button that was pressed in the mouseDown function. https://bugs.webkit.org/show_bug.cgi?id=30220 * WebKitTools/DumpRenderTree/gtk/EventSender.cpp: I'll add that test to the patch. Checking the test I found another issue that we could consider before adding this patch, it is reported in bug 31711. Created attachment 43582 [details] Patch proposed with test This patch includes the test for the solution proposed, but it will not work until we solve the bug 31711. Until that moment the test requires this patch to work properly, check the other bug for more information about the issue: index 8783973..2ff65cb 100644 --- a/LayoutTests/platform/gtk/editing/pasteboard/middle-button-paste.html +++ b/LayoutTests/platform/gtk/editing/pasteboard/middle-button-paste.html @@ -20,8 +20,8 @@ function runTest() var y = target.offsetParent.offsetTop + target.offsetTop + target.offsetHeight / 2; - eventSender.mouseMoveTo(x, y); eventSender.mouseDown(); + eventSender.mouseMoveTo(x, y); eventSender.mouseMoveTo(x + 50, y); eventSender.mouseUp(); eventSender.mouseMoveTo(x + 100, y); Comment on attachment 43582 [details] Patch proposed with test The test should be dumpAsText(). http://trac.webkit.org/wiki/Writing%20Layout%20Tests%20for%20DumpRenderTree Created attachment 44143 [details] New patch proposal I've used dumpAsText for the test and I've added a new condition to control situations where range could be 0 in the get_contents callback because toNormalizedRange can return 0. I'm not adding the review request until the drag bug 31711 is fixed because the test will fail if we upload it. Created attachment 45233 [details]
Proposed patch
I've added the workaround to the test, I do not think makes sense to wait for that fix and the test is not incorrect.
Comment on attachment 45233 [details] Proposed patch >+ EditorClient* client = reinterpret_cast<EditorClient*>(data); Isn't static_cast enough to go from void* to EditorClient? (In reply to comment #12) > (From update of attachment 45233 [details]) > >+ EditorClient* client = reinterpret_cast<EditorClient*>(data); > > Isn't static_cast enough to go from void* to EditorClient? Yep, I've checked it, reviewing the patch. Created attachment 45234 [details]
Proposed patch
Comment on attachment 45234 [details]
Proposed patch
r=me
Comment on attachment 45234 [details] Proposed patch Clearing flags on attachment: 45234 Committed r52389: <http://trac.webkit.org/changeset/52389> All reviewed patches have been landed. Closing bug. |