RESOLVED FIXED 147249
REGRESSION (r184026): Safari AutoFill with Contact info for phone number is broken
https://bugs.webkit.org/show_bug.cgi?id=147249
Summary REGRESSION (r184026): Safari AutoFill with Contact info for phone number is b...
mitz
Reported 2015-07-23 19:24:21 PDT
rdar://problem/21929532 Safari AutoFill is failing to fill some contact information. The reason appears to be that an object graph being sent via WKRemoteObjectRegistry includes NSMutableString instances, and after <http://trac.webkit.org/changeset/184026> those aren’t being decoded correctly: that change applies custom encoding for NSString and its subclasses, but only the corresponding custom decoding for NSString itself. Patch forthcoming.
Attachments
Use custom string coding for NSString and NSMutableString only (1.90 KB, patch)
2015-07-23 21:45 PDT, mitz
sam: review+
mitz
Comment 1 2015-07-23 21:45:05 PDT
Created attachment 257435 [details] Use custom string coding for NSString and NSMutableString only
mitz
Comment 2 2015-07-23 21:55:10 PDT
Darin Adler
Comment 3 2015-07-26 20:16:36 PDT
Given that NSString is a class cluster, allocating a string with methods of NSString can create an object of a class derived from NSString, not NSString itself. Given that, I’m surprised this code works, and I think we may need a different approach to remain robust in the future.
mitz
Comment 4 2015-07-26 20:27:45 PDT
(In reply to comment #3) > Given that NSString is a class cluster, allocating a string with methods of > NSString can create an object of a class derived from NSString, not NSString > itself. Given that, I’m surprised this code works, and I think we may need a > different approach to remain robust in the future. Note that the objectClass variable in encodeObject() is initialized with [object classForCoder], not [object class]. The NSString implementation of -classForCoder returns NSString, and the concrete subclasses (in Foundation) don’t override it, so they all encode as NSString. Similarly, all (Foundation) concrete subclasses of NSMutableString encode as NSMutableString. The assumption here is that anything that encodes as an NSString or NSMutableString uses the Foundation encoder that has the bug that r184026 was meant to work around, and that any subclass that has a different classForCoder probably uses a different encoder that doesn’t have the bug.
Darin Adler
Comment 5 2015-07-26 20:31:00 PDT
OK, great!
Note You need to log in before you can comment on or make changes to this bug.