W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2014

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 03 Feb 2014 07:36:37 -0500
Message-ID: <52EF8D55.3060705@mit.edu>
To: whatwg@lists.whatwg.org
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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:15 UTC