Changeset 20642 in webkit


Ignore:
Timestamp:
Mar 31, 2007 9:48:17 PM (17 years ago)
Author:
bdash
Message:

2007-03-31 Mark Rowe <mrowe@apple.com>

Reviewed by Darin.

A more correct fix for http://bugs.webkit.org/show_bug.cgi?id=13129
Bug 13129: Democracy Player dies in NSException from WebScriptObject on startup

The previous attempt at a fix in r20343 attempted to conditionally expose the 'count'
method. It did not work which resulted in 'count' always being hidden. This change
disables -[WebScriptObject count] completely until it can be determined whether it is
needed and how to support it without breaking third-party applications.

  • bindings/objc/WebScriptObject.mm: (-[WebScriptObject count]):
  • bindings/objc/WebScriptObjectPrivate.h:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r20639 r20642  
     12007-03-31  Mark Rowe  <mrowe@apple.com>
     2
     3        Reviewed by Darin.
     4
     5        A more correct fix for http://bugs.webkit.org/show_bug.cgi?id=13129
     6        Bug 13129: Democracy Player dies in NSException from WebScriptObject on startup
     7
     8        The previous attempt at a fix in r20343 attempted to conditionally expose the 'count'
     9        method.  It did not work which resulted in 'count' always being hidden.  This change
     10        disables -[WebScriptObject count] completely until it can be determined whether it is
     11        needed and how to support it without breaking third-party applications.
     12
     13        * bindings/objc/WebScriptObject.mm:
     14        (-[WebScriptObject count]):
     15        * bindings/objc/WebScriptObjectPrivate.h:
     16
    1172007-03-31  Nicholas Shanks  <webkit@nickshanks.com>
    218
  • trunk/WebCore/bindings/objc/WebScriptObject.mm

    r20495 r20642  
    498498@interface WebScriptObject (WebKitCocoaBindings)
    499499
    500 - (unsigned)_count;
    501500- (id)objectAtIndex:(unsigned)index;
    502501
     
    505504@implementation WebScriptObject (WebKitCocoaBindings)
    506505
    507 - (BOOL)_shouldRespondToCount
    508 {
    509     if (_private->shouldRespondToCountSet)
    510         return _private->shouldRespondToCount;
    511 
    512     BOOL shouldRespondToCount = YES;
    513  
    514     @try {
    515         [self valueForKey:@"length"];
    516     } @catch (id e) {
    517         shouldRespondToCount = NO;
    518     }
    519 
    520     _private->shouldRespondToCount = shouldRespondToCount;
    521     _private->shouldRespondToCountSet = YES;
    522 
    523     return shouldRespondToCount;
    524 }
    525 
    526 - (IMP)methodForSelector:(SEL)selector
    527 {
    528     if (selector == @selector(count:) && [self _shouldRespondToCount])
    529         selector = @selector(_count:);
    530 
    531     return [super methodForSelector:selector];
    532 }
    533 
    534 - (BOOL)respondsToSelector:(SEL)selector
    535 {
    536     if (selector == @selector(count:) && [self _shouldRespondToCount])
    537         selector = @selector(_count:);
    538 
    539     return [super respondsToSelector:selector];
    540 }
    541 
    542 
    543 - (unsigned)_count
     506#if 0
     507// FIXME: presence of 'count' method on WebScriptObject breaks Democracy player
     508//        http://bugs.webkit.org/show_bug.cgi?id=13129
     509
     510- (unsigned)count
    544511{
    545512    id length = [self valueForKey:@"length"];
     
    550517}
    551518
     519#endif
     520
    552521- (id)objectAtIndex:(unsigned)index
    553522{
  • trunk/WebCore/bindings/objc/WebScriptObjectPrivate.h

    r20343 r20642  
    2929    KJS::Bindings::RootObject* originRootObject;
    3030    BOOL isCreatedByDOMWrapper;
    31     BOOL shouldRespondToCount;
    32     BOOL shouldRespondToCountSet;
    3331}
    3432@end
Note: See TracChangeset for help on using the changeset viewer.