Bug 28433 - Associated objects set via 10.6 obj-c API are lost
Summary: Associated objects set via 10.6 obj-c API are lost
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-18 11:13 PDT by Andy Matuschak
Modified: 2009-08-18 11:31 PDT (History)
2 users (show)

See Also:


Attachments
Reduced test case demonstrating the faulty behavior (2.33 MB, application/zip)
2009-08-18 11:13 PDT, Andy Matuschak
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Matuschak 2009-08-18 11:13:20 PDT
Created attachment 35053 [details]
Reduced test case demonstrating the faulty behavior

Snow Leopard introduces a new API called associated objects: objc_setAssociatedObject and objc_getAssociatedObject can be used to basically treat any objcet like a big dictionary. This is especially useful when writing categories on DOM objects if one wants to store any kind of instance data at all.

Unfortunately, DOM objects seem to "lose" the associated objects, even when keeping the same memory address and having otherwise all the same properties from request to request.

Please see the attached reduced test case: when clicking "Set Value", the app sets an associated object on the web view and on a DOM element inside. When the user clicks "Get Value", it fetches those values again and displays the results.

At time of writing, the WebView successfully stores the saved value ("Test value"), but the DOM element does not.
Comment 1 Mark Rowe (bdash) 2009-08-18 11:16:47 PDT
It is not appropriate to file bug reports about pre-release software that is only available under NDA in a public forum such as this.
Comment 2 Andy Matuschak 2009-08-18 11:17:32 PDT
Sorry about that; will move to Radar.
Comment 3 Andy Matuschak 2009-08-18 11:24:36 PDT
c.f. rdar://7150998