2011.1.502 FF4 ContentWindows is detected incorrectly

8 posts, 0 answers
  1. Alexey Ivanov
    Alexey Ivanov avatar
    45 posts
    Member since:
    Sep 2009

    Posted 12 May 2011 Link to this post

    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.

  2. Alexey Ivanov
    Alexey Ivanov avatar
    45 posts
    Member since:
    Sep 2009

    Posted 18 May 2011 Link to this post

    Hey, were you able to reproduce this?
  3. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 19 May 2011 Link to this post

    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
  4. Alexey Ivanov
    Alexey Ivanov avatar
    45 posts
    Member since:
    Sep 2009

    Posted 19 May 2011 Link to this post

    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???

  5. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 25 May 2011 Link to this post

    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
  6. Alexey Ivanov
    Alexey Ivanov avatar
    45 posts
    Member since:
    Sep 2009

    Posted 27 May 2011 Link to this post

    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?
  7. Alexey Ivanov
    Alexey Ivanov avatar
    45 posts
    Member since:
    Sep 2009

    Posted 31 May 2011 Link to this post

    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?
  8. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 31 May 2011 Link to this post

    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
Back to Top