[whatwg] Fixing activeElement spec to match IE
ian at hixie.ch
Fri Dec 16 12:55:51 PST 2011
On Mon, 16 May 2011, Erik Arvidsson wrote:
> Currently, the spec says:
> "The activeElement attribute on HTMLDocument objects must return the
> element in the document that is focused. If no element in the Document
> is focused, this must return the body element."
> This does not fully match IE, or is underspecified. If the document has
> frames in it and a frame contains the focused element, the activeElement
> of the HTMLDocument should return the frame element which contains the
> I have a patch for WebKit  to match IE's behavior as described above.
>  http://dev.w3.org/html5/spec/Overview.html#document-level-focus-apis
>  https://bugs.webkit.org/show_bug.cgi?id=49509
On Mon, 16 May 2011, Ojan Vafai wrote:
> IE's behavior is better than the current spec because it allows a page
> to find the focused element even if the focused element is in a frame by
> walking down the frame tree if the activeElement is a frame.
> There is existing code that depends on this:
I've clarified the spec to say that when the browsing context in an iframe
has focus, the iframe itself by definition is the element with focus in
the parent browsing context.
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg