This is a migrated thread and some comments may be shown as answers.

2011.1.502 FF4 ContentWindows is detected incorrectly

7 Answers 127 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alexey Ivanov
Top achievements
Rank 1
Alexey Ivanov asked on 12 May 2011, 03:13 PM
Hello

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

Sort by
0
Alexey Ivanov
Top achievements
Rank 1
answered on 18 May 2011, 01:10 PM
Hey, were you able to reproduce this?
0
Stoich
Telerik team
answered on 19 May 2011, 09:58 AM
Hello Alexey,
   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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alexey Ivanov
Top achievements
Rank 1
answered on 19 May 2011, 11:12 AM
Did the same code lead to different behavior
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???

0
Cody
Telerik team
answered on 26 May 2011, 12:29 AM
Hi Alexey Ivanov,

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.

Regards,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alexey Ivanov
Top achievements
Rank 1
answered on 27 May 2011, 01:48 PM
Thanks for the explanation.

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?
0
Alexey Ivanov
Top achievements
Rank 1
answered on 31 May 2011, 03:30 PM
By the way, due to this Firefox peculiarity, the Browser.ResizeContent method now works wrong.


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?
0
Cody
Telerik team
answered on 31 May 2011, 03:54 PM
Hello Alexey Ivanov,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Alexey Ivanov
Top achievements
Rank 1
Answers by
Alexey Ivanov
Top achievements
Rank 1
Stoich
Telerik team
Cody
Telerik team
Share this question
or