Bug 24170 - Add test to verify window property lookup precedence
Summary: Add test to verify window property lookup precedence
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pam Greene (IRC:pamg)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-25 13:36 PST by Pam Greene (IRC:pamg)
Modified: 2009-04-02 11:19 PDT (History)
1 user (show)

See Also:


Attachments
New test, resource file, helper function, and result (42.63 KB, patch)
2009-02-25 13:51 PST, Pam Greene (IRC:pamg)
no flags Details | Formatted Diff | Diff
Same patch; added missing newline to end of window-properties.js. (42.61 KB, patch)
2009-02-25 13:54 PST, Pam Greene (IRC:pamg)
fishd: review+
Details | Formatted Diff | Diff
Remove dependency on numerical values (4.82 KB, patch)
2009-03-16 12:37 PDT, Pam Greene (IRC:pamg)
no flags Details | Formatted Diff | Diff
remove unnecessary toLower (1.22 KB, patch)
2009-04-02 10:49 PDT, Pam Greene (IRC:pamg)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pam Greene (IRC:pamg) 2009-02-25 13:36:29 PST
Add a test to verify that properties on DOMWindow objects are found before properties of the child frame, and that  IDL properties defined in the prototype are found before named document elements.

This tests an error that Chromium had at one point, which led to a site compatibility issue on www.multimap.com.
Comment 1 Pam Greene (IRC:pamg) 2009-02-25 13:51:01 PST
Created attachment 27980 [details]
New test, resource  file, helper function, and result

Either there's something I don't understand about eval, or a trunk build currently fails some of these checks. window.defaultStatus, window.status, and window.name are modified when the subframe or input element changes: they go from undefined to '' (empty strings).

It's still worth adding this test to detect other regressions.
Comment 2 Pam Greene (IRC:pamg) 2009-02-25 13:54:45 PST
Created attachment 27981 [details]
Same patch; added missing newline to end of window-properties.js.
Comment 3 Darin Fisher (:fishd, Google) 2009-03-12 15:12:33 PDT
Comment on attachment 27981 [details]
Same patch; added missing newline to end of window-properties.js.

LGTM
Comment 4 Pam Greene (IRC:pamg) 2009-03-13 10:46:03 PDT
I made a small change to remove the dependency on the test file location for win['Location'], then landed as r41672.
Comment 5 Pam Greene (IRC:pamg) 2009-03-16 11:35:37 PDT
Test is failing because of differences in window size and location (outerHeight, outerWidth, screenTop, and screenX).
Comment 6 Pam Greene (IRC:pamg) 2009-03-16 12:37:37 PDT
Created attachment 28655 [details]
Remove dependency on numerical values

The exact values of these numbers are not pertinent to this test, only that they are unchanged.
Comment 7 Pam Greene (IRC:pamg) 2009-03-16 12:55:53 PDT
Fix reviewed by dglazkov on IRC, landed as r41736.
Comment 8 Darin Adler 2009-03-16 12:57:20 PDT
I'm surprised by the use of toLowerCase on the result of typeof. That string should reliably be the same constant across multiple JavaScript engines and there's no reason to call toLowerCase.
Comment 9 Alexey Proskuryakov 2009-03-19 01:40:46 PDT
Comment on attachment 28655 [details]
Remove dependency on numerical values

Clearing review flag, as this was landed already.
Comment 10 Pam Greene (IRC:pamg) 2009-04-02 10:49:00 PDT
Created attachment 29199 [details]
remove unnecessary toLower
Comment 11 Darin Adler 2009-04-02 10:54:20 PDT
Comment on attachment 29199 [details]
remove unnecessary toLower

r=me
Comment 12 Pam Greene (IRC:pamg) 2009-04-02 11:19:09 PDT
Cleanup landed in r42176.