Bug 17977 - REGRESSION(3.0-3.1): Safari/WebKit initializes variables to dom elements
Summary: REGRESSION(3.0-3.1): Safari/WebKit initializes variables to dom elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2008-03-20 19:22 PDT by David den Boer
Modified: 2022-07-21 17:14 PDT (History)
5 users (show)

See Also:


Attachments
Reduction for ticket (833 bytes, text/html)
2008-03-20 19:26 PDT, David den Boer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David den Boer 2008-03-20 19:22:37 PDT
I have in my html a variable named foo.
In my html, I have a div element named foo.
In javascript, I check to see if variable foo is undefined, and if so, I take action.
Expected result : action in javascript executes for foo.
Actual result : foo gets defined to the div element foo automatically.
Comment 1 David den Boer 2008-03-20 19:26:34 PDT
Created attachment 19918 [details]
Reduction for ticket

simple test case. If the bug is present, the alert displays the dom node, otherwise it displays a message.
Comment 2 Mark Rowe (bdash) 2008-03-20 20:00:50 PDT
You've marked this as a regression:  what is it a regression from?
Comment 3 David den Boer 2008-03-20 20:05:15 PDT
Behaves correctly in Safari 3.0.4
Comment 4 Mark Rowe (bdash) 2008-03-20 20:12:28 PDT
This may have been an intentional change in behaviour.
Comment 5 Mark Rowe (bdash) 2008-03-20 20:12:56 PDT
<rdar://problem/5811736>
Comment 6 Geoffrey Garen 2008-04-29 11:17:53 PDT
IE7, Firefox2, and Opera 9 all disagree with Safari's behavior.
Comment 7 Ahmad Saleem 2022-07-21 12:53:10 PDT
I am unable to reproduce this bug in Safari 15.6 on macOS 12.5 based on attached test case (assuming it is correct - it does not have any errors in Console) and the browser shows dialog box saying 'This is correct behaviour'.

It matches with all other browsers (Chrome Canary 105 and Firefox Nightly 104). I think it was fixed along the way and this can be marked as "RESOLVED CONFIGURATION CHANGED". If I am testing incorrectly, please test accordingly. Thanks!