Re: [whatwg] Document.activeElement should return the root element in non-HTML documents when no element has focus

On 2/3/14 5:29 AM, Anne van Kesteren wrote:
> So how does that work for text/xml? Do you dispatch on namespace of
> the root element?

What Gecko does is that if the document is an HTMLDocument (so is 
text/html or application/xhtml+xml) and hence has a .body property we 
use that.  Otherwise we use .documentElement.

Of course the spec has no concept of HTMLDocument and has a .body on all 
documents...

-Boris

Received on Monday, 3 February 2014 12:37:04 UTC