W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2011

Re: paste events and HTML support - interest in exposing a DOM tree?

From: Ojan Vafai <ojan@chromium.org>
Date: Fri, 6 May 2011 13:39:02 -0700
Message-ID: <BANLkTinAB3D5RF_TNNXUFiuxbdeC8tXRSQ@mail.gmail.com>
To: "Hallvord R. M. Steen" <hallvord@opera.com>, Ryosuke Niwa <rniwa@webkit.org>
Cc: WebApps WG <public-webapps@w3.org>, Joćo Eiras <joao.eiras@gmail.com>
On Tue, May 3, 2011 at 3:20 AM, Hallvord R. M. Steen <hallvord@opera.com>wrote:

> On Tue, 03 May 2011 07:10:10 +0900, Joćo Eiras <joao.eiras@gmail.com>
> wrote:
>  event.clipboardData.getDocumentFragment()
>>> which would return a parsed and when applicable sanitized view of any
>>> markup the implementation supports from the clipboard.
>  This is already covered by doing x=createElement;x.innerHTML=foo;traverse
>> x
> Of course it is. The point was simply to see if there was interest in
> possibly optimising away an extra serialize->parse roundtrip, if developers
> feel it would be more convenient to get the DOM right away rather than the
> markup.

This sounds good to me. There are good use-cases and it I believe it would
be fairly straightforward to implement. What would getDocumentFragment do if
there is no text/html content on the clipboard? I'm OK with saying it just
returns null or undefined.

Received on Friday, 6 May 2011 20:39:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:19 UTC