W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2010

TextEvent.data on pasting HTML.

From: Hajime Morita <morrita@google.com>
Date: Mon, 26 Jul 2010 19:11:41 +0900
Message-ID: <AANLkTikJHVbNZmgo7DAtM1WkG2GaBRcjewhtj2JByQ_P@mail.gmail.com>
To: www-dom@w3.org
Hi,

I'm extending TextInput implementation of WebKit.
And I'm wondering how should we do when HTML is pasted (or dropped)
into the contentEditable area.
Specifically, What value should be given for TextEvent.data attribute?

Then, to handle the HTML correctly, TextEvent.data is not enough anyway
because its type is DOMString, not DocumentFragment.
We need a pasted HTML itself. It's vital part of customizing editing
behavior in JS world.

Here is an idea:
- for data attribute, give a DocumenetFragment.textContent equivalent.
- to accessing the pasted DocumentFragment, add an "newValue"
attribute, whose type is Node.
-- It's no longer a "Text" event. So subclassing might be sufficient.

How do you think?
Any suggestions are appreciated.

Regards.
-- 
morita
Received on Thursday, 29 July 2010 06:36:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:05 GMT