Re: Web Components: two questions

>     1) Are form elements (input, select, textarea) inside a shadow dom
>     considered when submitting a form?
>
>
> The Shadow DOM spec doesn't say anything about this. Therefore,
> form elements should be in the same node tree.
>
> For example, suppose a <form> element is in the node tree A. In this
> case, form elements in node tree B,  where A != B,  are not considered
> at all when submitting the form.

I am not sure I am able to fully interpret your response: do you imply 
that an <input> field inside a shadow dom inside a <form>

(diagram:

<form>
    |
   [shadow root]
        |
      <input>

)

shall get submitted?

This might pose some backwards incompatibility for tools that 
automatically aggregate input values (for e.g. xhr-based submit) by 
executing form.querySelectorAll("input, select, textarea"). An input 
inside a shadow root (not visible to a querySelectorAll from the outside 
world) will get ommited.


Sincerely,
O. Zara


>
> A composed tree shouldn't have any effect on submitting a from.
>
>     2) I am having troubles with lifecycle callback of custom elements that
>     are cloned from within a <template> element. More specifically, nor
>     createdCallback nor attachedCallback are fired when an element in
>     question is cloned from template.content or appended to an active
>     document. Is this a specified behavior? How do I properly initialize
>     custom elements that "live" inside a <template> ?
>
>
>     Thanks a lot,
>     sincerely,
>     Ondrej Zara
>
>
>
>
>     --
>     *RNDr. Ondřej Žára*
>     Programátor UI senior
>
>     https://twitter.com/0ndras
>     ondrej.zara@firma.seznam.cz <mailto:ondrej.zara@firma.seznam.cz>
>     <mailto:ondrej.zara@firma.__seznam.cz
>     <mailto:ondrej.zara@firma.seznam.cz>>
>     http://www.seznam.cz/
>
>     Seznam.cz, a.s., Radlická 3294/10, 150 00 Praha 5
>     <http://mapy.cz/s/6rw4>
>
>

-- 
*RNDr. Ondřej Žára*
Programátor UI senior

https://twitter.com/0ndras
ondrej.zara@firma.seznam.cz <mailto:ondrej.zara@firma.seznam.cz>
http://www.seznam.cz/

Seznam.cz, a.s., Radlická 3294/10, 150 00 Praha 5 <http://mapy.cz/s/6rw4>

Received on Thursday, 11 September 2014 06:26:16 UTC