[webkit-dev] Hi All (Windows WebKit through COM, focus issue)

Adam Roben aroben at apple.com
Wed Aug 12 09:14:40 PDT 2009


On Jan 4, 2009, at 2:16 AM, Mike wrote:

> But, if I create a tab control and add multiple tab pages, and use
> panels on those tabs to host the control, when the form is active, the
> WebView does not act as if it is active (it doesn't display the cursor
> for text boxes and other fields, and the safari theme for the scroll
> bar does not light up).
>
> The first tab page works properly, but the other tab pages display
> this behavior.

I don't know anything about how the Windows Forms tab control works,  
but I can point you at the code in WebKit that decides whether a  
blinking caret should appear in text fields.

A blinking caret will only appear if the WebView thinks that is is  
"active". A WebView is considered to be "active" if its top-level  
parent window and the top-level parent window of the window returned  
from GetActiveWindow are the same. This code is in WebView::active in  
WebKit/win/WebView.cpp. The active state of the WebView has to be  
passed down to the WebCore level when the state changes. This happens  
in WebView::updateActiveState.

It seems like there are two possibilities:

1) WebView::active is returning the wrong answer (i.e., it's returning  
false but should be returning true)
2) WebView::updateActiveState isn't getting called at the right times

If the problem is (2), you should be able to work around it by calling  
IWebViewPrivate::updateFocusedAndActiveState. I can't think of a good  
workaround for (1). In either case we'll want to investigate further  
to find out what's causing the bug!

-Adam



More information about the webkit-dev mailing list