Re: [webcomponents]: Allowing text children of ShadowRoot is a bad time

On Mon, Oct 28, 2013 at 10:44 PM, Elliott Sprehn <esprehn@gmail.com> wrote:
> On Thu, Oct 24, 2013 at 1:29 PM, Anne van Kesteren <annevk@annevk.nl> wrote:
>> innerHTML would end up re-throwing the same exception, unless you
>> special-cased parsing.  innerHTML throwing is somewhat unexpected though.
>
> We don't really need to special case parsing. innerHTML works by parsing
> into a DocumentFragment and then copying the nodes over from there, so we
> can just silently drop them in the copy step or throw an exception.

Right, that's what I said.


> Note that innerHTML can already throw an exception in XHTML/SVG documents if
> the content is not well formed. Admittedly leaving some of the content
> appended and throwing is somewhat confusing, but I think that's fine given
> that once you get the text in there the API is full of sadness.

We are considering not throwing in XML.


> As a counter point appendChild(documentType) would throw an exception and
> innerHTML silently drops if you do innerHTML = "<!DOCTYPE html>" (bogus
> comment IIRC).

That's because the context is not a full document. I think that case
worked when we still had document.innerHTML.


> So perhaps dropping the text to avoid having authors deal with the exception
> is best. I think we should do that.

That seems rather silly. I don't really have a better suggestion though.


-- 
http://annevankesteren.nl/

Received on Monday, 28 October 2013 23:54:33 UTC