[whatwg] createContextualFragment in detached contexts
ryosuke.niwa at gmail.com
Thu Sep 29 16:10:29 PDT 2011
Can't authors use createElement? Or are you specifically concerne the case
where authors want to use createContextualFragment?
On Sep 29, 2011 3:37 PM, "Erik Arvidsson" <arv at chromium.org> wrote:
> Currently there is no easy way to create a tbody (and others from
> markup). To do this correctly people have to go through ugly hacks
> like what jQuery does  where they wrap the HTML string with the
> right context elements and then grab the nodes inside that.
> I would like to propose a change to createContextualFragment .
> If the context object is in a detached state, then relax the parsing
> rules so that all elements are allowed at that level. The hand wavy
> explanation is that for every tag at the top level create a new
> element in the same way that ownerDocument.createElement would do it.
> This would allow the following to work.
> var df =
> text <option></option>');
> assertEquals(3, df.childNodes.length);
> assertEquals('TBODY', df.childNodes.tagName);
> assertEquals(' text ', df.childNodes.textContent);
> assertEquals('OPTION', df.childNodes.tagName);
>  https://github.com/jquery/jquery/blob/master/src/manipulation.js#L643
More information about the whatwg