W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2011

Re: Global variables and id lookup for elements

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 19 Jul 2011 21:47:54 -0400
Message-ID: <4E2633CA.20302@mit.edu>
To: Ian Hickson <ian@hixie.ch>
CC: Magnus Kristiansen <magnusrk+w3c@pvv.org>, Cameron McCormack <cam@mcc.id.au>, public-webapps@w3.org, "public-script-coord@w3.org" <public-script-coord@w3.org>
On 7/19/11 7:43 PM, Ian Hickson wrote:
> On Thu, 28 Apr 2011, Magnus Kristiansen wrote:
>>
>> Context: http://krijnhoetmer.nl/irc-logs/whatwg/20110428#l-707
>>
>> Current browsers disagree about how to handle<div
>> id=x></div><script>var x;</script>. Webkit browsers leave x pointing to
>> the div, whereas IE, Firefox and Opera make x undefined [1]. (There is
>> content that depends on x being undefined, but I don't have any links
>> handy right now.)
>>
>> My reading of the relevant specs (es5 section 10, WebIDL 4.5.3, HTML
>> 6.2.4) supports the Webkit behavior

> Is this still something I should do, or did this get resolved using
> another solution?

Unclear.  For one thing, the ES5 spec on this has changed, and there is 
no public draft with the errata yet; they're only present in the form of 
e-mails.  That makes it hard for me to say at this point whether the 
above claim is even true.

That said, even if we ignore the behavior of var, that leaves open 
questions about what happens on assignment, etc.  I do think Cameron has 
done a bunch of testing of this stuff recently, and there was a data 
table that summarized the results somewhere.  You should probably just 
talk to him about it.

-Boris
Received on Wednesday, 20 July 2011 01:48:35 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:04 UTC