In Firefox 4 with the latest release Browser.ContentWindow coordinates are incorrect.
Run this code:
var point = Manager.Current.ActiveBrowser.ContentWindow.Location;
Manager.Current.Desktop.Mouse.HoverOver(point);
The mouse cursor will point at the left top corner of the main browser window.
Several of my tests are dependant on the location of the document window and they fail in FF4.
7 Answers, 1 is accepted
yes, I've reproduce this but this doesn't seem to be a bug. If you look at the definition for System.Drawing.Point.Window.Location (which you use here:Manager.Current.ActiveBrowser.ContentWindow.Location) you will see that it states:
"Gets the top left corner" (see screenshot 1). So this is expected behavior and I don't see the problem. Did the same code lead to different behavior in older versions of the Testing Framework?
Greetings,
Stoich
the Telerik team
Stoich, of course I wrote becuase the behavior changed from FF3.6.
The Browser object has 2 properties: Window (which is the main window) and ContentWindow (which used to be a window where the HTML document is displayed).
In Firefox 3.6 and all IEs the ContentWindow behaves as I expect: it is located at the document left top corner.
If FF4 the window location changed and some my tests begain to fail.
> but this doesn't seem to be a bug
The problem: you do not fully support FF4. How can it be not a bug???
Technically it's not a bug because Firefox 4 does not follow the standards for how a Windows application should construct it's windows. In Firefox 4 they radically changed how the window is structured. I've attached screenshots showing the window structure difference between Firefox 3 and Firefox 4. You can see that Firefox 4 eliminated most of the outer wrapping windows. Firefox 4 is the only browser that uses a single window for painting everything (navigation, menu, search box, DOM content, etc.).
When you ask for the "ContentWindow" we simply pass back the screen coordinates of the "MosillaWindowClass" window. In Firefox 3 this represented the actual content window. In Firefox 4 it is the chrome of the browser.
I have filed a feture request to make ContentWindow return the actual DOM contents in Firefox 4. You can track our progress on this here.
Cody
the Telerik team
I found a workaround for myself. I use this code in FF:
window.mozInnerScreenX, window.mozInnerScreenY
Maybe it is better to throw NotSupportedException for the ContentWindow property in FF4?
The docs say "Resize the browser window content to the specified window rectangle. This function will handle the padding between the outer browser window and the content window."
Probably this can be treated as a bug?
Yep this one I have to agree with you, I think it really is a bug. I have filed this bug report to track this issue. Thank you for bringing this to our attention!
Greetings,Cody
the Telerik team