W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2007

[whatwg] activeElement

From: Hallvord R M Steen <hallvors@gmail.com>
Date: Thu, 17 May 2007 23:54:26 +0200
Message-ID: <dd4c8a40705171454s71716895v133245bc2a84f0ce@mail.gmail.com>
if WHATWG is defining document.activeElement, perhaps the WHAT spec
should match IE's behaviour more closely on some points. I refer to:

Following up some Opera bug report I had a 10 minute go at working out
what IE is doing, and I came up with this:


Quoting the four main observations, with comments:
* when the document is loaded, before any interaction activeElement is
the body element (!) (probably not important, I doubt any site would
rely on this)

* activeElement is set after mousedown. (important, maybe implied by
other stuff about focus handling? I didn't test keydown for e.g.
tabbing but pretty sure the same applies.)

* it is set to the event's target if it is "focusable" (A, INPUT,
BUTTON etc.), otherwise it is set to the event's target's
.offsetParent (important, and the offsetParent stuff isn't covered in
the current spec )

* it keeps pointing to the same element until another interaction with
the document sets it again (important)

Hallvord R. M. Steen
Received on Thursday, 17 May 2007 14:54:26 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:55 UTC