Created
April 18, 2012 05:49
-
-
Save alanjrogers/2411352 to your computer and use it in GitHub Desktop.
WebKit crash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When the dom node is [object HTMLObjectElement] | |
// element is not a valid object ==> crash | |
- (void)mouseMoved:(NSEvent *)theEvent { | |
NSPoint mouseLocation = [self.webView convertPoint:[theEvent locationInWindow] fromView:nil]; | |
mouseLocation.y = [self.webView frame].size.height - mouseLocation.y; | |
id element2 = [[self.webView windowScriptObject] evaluateWebScript:[NSString stringWithFormat:@"document.elementFromPoint(%f,%f);", mouseLocation.x, mouseLocation.y]]; | |
id element = [[self.webView windowScriptObject] evaluateWebScript:[NSString stringWithFormat:@"\"result: \" + document.elementFromPoint(%f,%f)", mouseLocation.x, mouseLocation.y]]; | |
NSLog(@"element %@, %@", element, element2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So my theory is that the bridge from JS object to ObjC object is failing for [object HTMLObjectElement]