groups

name language licence
Force Application Crash Objective-C Other
FourCharCode to NSString Objective-C Other
ROT13 Objective-C Other
NSIndexSet to String Objective-C Other
getBoundingClientRect from WebKit using JavaScriptCore Objective-C Other
NSImage Create QuickLook icon for URL Objective-C Other
Method Replacement (swizzle) Objective-C Other
Safe respondsToSelector: override Objective-C Other

< 1 2 3 >



language: Objective-C
licence: Other

getBoundingClientRect from WebKit using JavaScriptCore

options: view full snippetsend to code collector
// WebKit build 40837 included support for getBoundingClientRect and getClientRects, which
// gives you the (hopefully) exact position and size of an element relative to the viewport.
// Which is cool, but unfortunately didn't come with Obj-C bindings to it.
// So this extension to DOMNode will retrieve a dictionary of the bounds inforation
// for the node given a JavaScript Context.
//
// http://trac.webkit.org/changeset/40837

#import <WebKit/WebKit.h>
#import <JavaScriptCore/JavaScriptCore.h>

@interface DOMNode (ClientRectsAdditions)
-(NSDictionary *)getBoundingClientRectForContext:(JSContextRef)jsCtx;
@end

	
(Continues...)