[whatwg] "Any content inside wbr elements must not be considered part of the surrounding text"

Ian Hickson ian at hixie.ch
Mon Feb 14 01:54:42 PST 2011


On Sun, 13 Feb 2011, Alex Bishop wrote:
>
> The definition of the wbr element says:
> 
> > Any content inside wbr elements must not be considered part of the 
> > surrounding text.
> 
> How's that work? The wbr element is a void element; it can't have any 
> content.

Such content is non-conforming (because the content model of <wbr> is 
"empty"), but it can still happen, e.g.:

   <script>
    var w = document.createElement('wbr');
    w.textContent = 'invalid and ignored'; 
    document.body.appendChild(w);
   </script>

...or, in an XML file:

   ...<wbr>invalid and ignored</wbr>...

HTH,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list