W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2004

[whatwg] Autofocus attribute

From: Brian Wilson <brian@opera.com>
Date: Tue, 03 Aug 2004 23:04:24 +0200
Message-ID: <opsb6ctm1e87i379@toshistation2.no-domain-set.bellcanada>

I was trying to create a few test cases for the autofocus attribute and I  
thought of an interesting scenario:

Two form fields walk in to a bar...


I mean... Two form fields are in a document, one has the  
autofocus="autofocus" attribute set, the other is given focus by the  
focus() javascript method at body onLoad time. Which should have focus  
when the document finishes loading? In other words, how does/should the  
autofocus attribute figure in to the document loading event chain  

The only prose to deal with this issue (sect. 2.14) says:
    "This implies that during document load, the last form control
     with this attribute set is the one that should have focus once
     the document is loaded."
but it doesn't seem to address this specific chronology issue.


Brian Wilson
Opera Core QA
Received on Tuesday, 3 August 2004 14:04:24 UTC

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