Bug 40492

Summary: onpaste
Product: WebKit Reporter: jay <jay>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: ap
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
URL: http://www.honte.eu/register.svg
Attachments:
Description Flags
html testcase
none
html testcase, paste clipboard text into textbox
none
SVG pseudo-code?
none
clip grab using: Version 5.0.5 (5533.21.1, r88541)
none
without script version... none

Description jay 2010-06-11 13:04:22 PDT
is there any inherent reason why the safari javascript "support to let you handle cut, copy, and paste operations of your HTML content" 
should not be available within SVG?

---

http://developer.apple.com/mac/library/documentation/AppleApplications/Conceptual/SafariJSProgTopics/Tasks/CopyAndPaste.html

support for text editing in SVG, together with xForms is currently limited, or non-existent.

implementing SVG1.2 editable text fields might help somewhat, but this bug may still remain

http://www.honte.eu/register.svg currently runs from my laptop, has no fixed ipaddress and may well move to http://www.honte.eu once stable.
the text fields are edited using script and the DOM, to partially emulate an html form


a related issue is raising a virtual keypad, ie for Android, iPad etc within SVG
Comment 1 jay 2010-06-11 13:09:07 PDT
Created attachment 58499 [details]
html testcase
Comment 2 Alexey Proskuryakov 2010-06-13 00:21:55 PDT
I don't understand this bug report. What is expected behavior on this test case? And why is it HTML if you are talking about SVG?
Comment 3 jay 2010-06-13 02:26:42 PDT
#2 Alexey, the expected behaviour is that plain text content of clipboard is pasted into textbox, onpaste  event.
 paste any text into textbox, note predicate "clipboard: " is added
Comment 4 jay 2010-06-13 02:27:59 PDT
Created attachment 58584 [details]
html testcase, paste clipboard text into textbox
Comment 5 jay 2010-06-13 03:17:49 PDT
Created attachment 58586 [details]
SVG pseudo-code?
Comment 6 jay 2010-06-13 03:20:17 PDT
apologies, this example is my 'best effort' at how I imagine this might work in SVG. the updated HTML example should now demonstrate clearly the intention, ie to provide a means to paste the plain/text clipboard contents into  an SVG document.
Comment 7 Ryosuke Niwa 2011-05-24 22:52:26 PDT
I don't understand the bug either.  Is this bug about firing copy/paste events in SVG documents?
Comment 8 jay 2011-05-25 02:35:00 PDT
#7

whilst not advocating Amaya, it does provide some possibilities to copy and paste between SVG documents.

basic text copying is part of the SVG1.1 spec iirc, else 1.2
in either case, the user expectation is that they can copy/paste text at a minimum,
SVG isn't bitmaps...
Comment 9 Ryosuke Niwa 2011-05-25 08:45:18 PDT
(In reply to comment #8)
> whilst not advocating Amaya, it does provide some possibilities to copy and paste between SVG documents.
> 
> basic text copying is part of the SVG1.1 spec iirc, else 1.2
> in either case, the user expectation is that they can copy/paste text at a minimum,
> SVG isn't bitmaps...

Are you saying that you can't copy text in SVG?
Comment 10 Ryosuke Niwa 2011-06-27 10:52:53 PDT
Nobody but the bug reporter understands what this bug report is about.
Comment 11 jay 2011-06-27 11:13:12 PDT
#10 Niwa did you copy and paste as per comment #3?

please read this is simple and easy to understand for anyone.

please dont just add bug spam
Comment 12 jay 2011-06-27 11:14:43 PDT
SVG text is in SVG attachment, copy it and paste into html textbox, in other attachment
Comment 13 Ryosuke Niwa 2011-06-27 11:15:03 PDT
(In reply to comment #11)
> #10 Niwa did you copy and paste as per comment #3?

The expected behavior in comment #3 is exactly what happens when I try.
Comment 14 jay 2011-06-27 11:18:42 PDT
Created attachment 98752 [details]
clip grab using: Version 5.0.5 (5533.21.1, r88541)
Comment 15 jay 2011-06-27 11:19:58 PDT
as you can see in the clip image the word clipboard is duplicated...
Comment 16 Ryosuke Niwa 2011-06-27 11:21:20 PDT
(In reply to comment #15)
> as you can see in the clip image the word clipboard is duplicated...

That's because you're appending "clipboard: " in attachment 58584 [details].
Comment 17 Ryosuke Niwa 2011-06-27 11:22:01 PDT
It works as expected.
Comment 18 jay 2011-06-27 11:26:10 PDT
it is not!

please do not make such assertions without checking first!
Comment 19 Ryosuke Niwa 2011-06-27 11:26:47 PDT
(In reply to comment #18)
> it is not!
> 
> please do not make such assertions without checking first!

    function myPaste(event) {
     event.preventDefault();
event.currentTarget.value = "clipboard: " + event.clipboardData.getData("text/plain");
}
Comment 20 jay 2011-06-27 11:27:49 PDT
Created attachment 98756 [details]
without script version...
Comment 21 jay 2011-06-27 11:29:29 PDT
that is why it is marked pseudo, because the effect is as if the script was there, but it isnt needed...

my apologies if this is not as clear as it could be,

but there are some stubborn people in this world
Comment 22 Alexey Proskuryakov 2011-06-27 11:57:18 PDT
Please provide an actual test case and clear steps to reproduce. A "pseudo" test that behaves correctly is not a starting point for investigation. There is no reason to keep a bug open if no one can understand it.
Comment 23 jay 2011-06-27 22:32:34 PDT
moved to #63510