[Webkit-unassigned] [Bug 13129] New: Democracy Player dies in NSException from WebScriptObject on startup

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 20 06:31:19 PDT 2007


http://bugs.webkit.org/show_bug.cgi?id=13129

           Summary: Democracy Player dies in NSException from
                    WebScriptObject on startup
           Product: WebKit
           Version: 522+ (nightly)
          Platform: Macintosh
               URL: http://www.getdemocracy.com/
        OS/Version: Mac OS X 10.5
            Status: NEW
          Keywords: Regression
          Severity: Major
          Priority: P2
         Component: WebKit Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: bdash at webkit.org
                CC: timothy at hatcher.name


Democracy Player is a media player written in Python using PyObjC.  It's
interface makes heavy use of WebKit.  With a ToT build of WebKit Democracy
player throws an NSException on launch and fails to function.  This also means
that Democracy Player does not work at all in Leopard.  The exception is as
follows:

KeyError: 'NSUnknownKeyException - [<DOMHTMLElement 0x1622ef90>
valueForUndefinedKey:]: this class is not key value coding-compliant for the
key length.'

The cause for this is Python code such as:

        someElement = document.getElementsByID_('someElement')
        if not someElement:
            # do stuff here

The "not someElement" attempts to coerce Python's view on the DOMHTMLElement
object into a boolean.  I'm not completely sure what logic it uses to do this,
but one step seems to be checking whether the object is sequence-like.  From an
Objective-C point of view this means implementing -(int)count.  *All*
WebScriptObjects implement this method as of r13877, with the big downside that
it throws an exception if the WebScriptObject is not KVC-compliant for
"length".  One solution would be to only expose the "count" method if this
object is KVC-compliant for "length".


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list