views:

63

answers:

1

I've implemented an SWT Browser on my Windows 7 machine as follows:

Browser browser;
try {
    browser = new Browser(parent, SWT.NONE);
    browser.setUrl(url);
} catch (final SWTError e) {
    System.out.println(e);
}

I navigate to a page that contains the following source code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<body>
    <div style="overflow:scroll;position:fixed;width:300px;height:300px;">
        <div style="height:1000px;">SWT won't scroll in this div</div>
    </div>
</body>
</html>

It shows up beautifully using an Internet Explorer 8 frame to render the content. Now here's where things get strange: using my scrollwheel, scrolling occurs intermittently. After one or two turns (sometimes more; it seems random), the page stops scrolling for a bit.

If I output the scroll event in SWT, all scroll events are outputted, even when the browser doesn't respond to them:

browser.addMouseWheelListener(new MouseWheelListener() {
    public void mouseScrolled(final MouseEvent e) {
        System.out.println(e);
    }
});

The scrolling issue also occurs on a different Windows Vista machine, and only happens in divs with style="position:fixed;overflow;scroll;height:300px;width:300px;". On Mac, however, it doesn't.

It seems the culprit is Internet Explorer 8, or something between SWT and the browser. Has anybody else run into this? Any ideas?

A: 

It seems to me that this is a bug in SWT. I opened bug #321167.

Paul Lammertsma