IE9 says document.hasFocus even when the focus is stealed by a dialog.

In this test page if document.hasFocus() is true, the background color is white but when it is false, it turns out to be fuchsia.
1. Open Internet Options in IE9.

2. document.hasFocus() should be false but IE9 says it still has a focus.

As far as "window.onblur" is concerned, it occurs as expected.

And when you move your cursor onto the address bar above, the background color turns out to be fuchsia, so document.hasFocus can be said to be working partially as expected.