[webkit-dev] Most methods in WebUIDelegate are not getting called

piet piet.webkit at yahoo.com
Fri Jul 27 12:37:06 PDT 2007


I need to know when the contentRect of a WebView changes so I added a  WebUIDelegate listening to setContentRect:. 

Problem: setContentRect: is never called.

I added more methods to the WebUIDelegate, listening to show/close, focus/unfocus, set status text, set frame/content and mouse-move, but none of them gets called except for mouse-move (mouseDidMoveOverElement:).

Is there anything wrong with my code? I tested with both Safari 2 and Safari 3. For a minimal testcase, you can add the following code to /Developer/Examples/WebKit/MiniBrowser/MyDocument.m, line 263. The only output to the console comes from the NSLog() in mouseDidMoveOverElement:

- (void)webViewClose:(WebView *)sender
{
    NSLog(@"WebView UI delegate:webViewClose");
}

- (void)webViewFocus:(WebView *)sender
{
    NSLog(@"WebView UI delegate:webViewFocus");
}

- (void)webViewUnfocus:(WebView *)sender
{
    NSLog(@"WebView UI delegate:webViewUnfocus");
}

- (void)webView:(WebView *)sender setStatusText:(NSString *)text
{
    NSLog(@"WebView UI delegate:setStatusText %@", text);
}

- (void)webView:(WebView *)sender setFrame:(NSRect)frame
{
    NSLog(@"WebView UI delegate:setFrame w=%f h=%f", frame.size.width, frame.size.height);
}

- (void)webView:(WebView *)sender setContentRect:(NSRect)contentRect
{
    NSLog(@"WebView UI delegate:setContentRect w=%f h=%f", contentRect.size.width, contentRect.size.height);
}

- (void)webView:(WebView *)sender mouseDidMoveOverElement:(NSDictionary *)elementInformation modifierFlags:(unsigned int)modifierFlags
{
    NSLog(@"WebView UI delegate:mouseDidMoveOverElement");
}


       
---------------------------------
Get the free Yahoo! toolbar and rest assured with the added security of spyware protection. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/webkit-dev/attachments/20070727/58749050/attachment.html


More information about the webkit-dev mailing list