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

Cameron McCormack cam at mcc.id.au
Sun Feb 2 19:34:24 PST 2014


Cameron McCormack wrote:
>> Document.activeElement is currently defined to return the <body>
>> element if there is no element with focus, or null if there's no
>> <body> element.  I think it needs to return the root element when
>> the document isn't an HTML document (like an SVG document).

Anne van Kesteren wrote:
> You mean when there's no <body> element?

When the document isn't an HTML document and when there is no element 
with focus.  Browsers agree on returning null in an HTML document when 
there is no element with focus, no <body> element, but still a document 
element.



More information about the whatwg mailing list