Bug 9579 - LayoutTests/fast/events/objc-event-api.html failing due to screenY output
Summary: LayoutTests/fast/events/objc-event-api.html failing due to screenY output
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-25 13:01 PDT by David Kilzer (:ddkilzer)
Modified: 2006-06-26 08:21 PDT (History)
1 user (show)

See Also:


Attachments
Report screenY values as (height of main screen - screenY) (4.79 KB, patch)
2006-06-26 02:31 PDT, Jonas Witt
no flags Details | Formatted Diff | Diff
Report screenY values as (height of main screen - screenY) (4.91 KB, patch)
2006-06-26 04:17 PDT, Jonas Witt
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2006-06-25 13:01:03 PDT
The LayoutTests/fast/events/objc-event-api.html test fails on some systems due to the screenY output varying.

Darin suggested via IRC to "flip" the screenY values by taking "height of main screen - screenY" and reporting that value, or to comment out the values for now.

The code that does this is in WebKitTools/DumpRenderTree/EventSendingController.m.  It was originally landed for Bug 9181 in r15008.
Comment 1 David Kilzer (:ddkilzer) 2006-06-25 13:01:53 PDT
I said, Bug 9181.

Comment 2 Jonas Witt 2006-06-26 02:31:24 PDT
Created attachment 9043 [details]
Report screenY values as (height of main screen - screenY)

screenY values are reported as (height of main screen - screenY). However, I'm unsure about the values being between -9,000 and -10,000 - where does it get 10,000 pixels from?
Comment 3 David Kilzer (:ddkilzer) 2006-06-26 03:45:18 PDT
(In reply to comment #2)
> Created an attachment (id=9043) [edit]
> Report screenY values as (height of main screen - screenY)

You should denote that the "screenY" value is computed ("flipped") rather than the actual value on the output.

> screenY values are reported as (height of main screen - screenY). However, I'm
> unsure about the values being between -9,000 and -10,000 - where does it get
> 10,000 pixels from?

Per Darin via IRC, if you think of the screen as a set of X and Y coordinates, the origin point for Mac OS X is in the lower left-hand corner, and all X and Y values are positive values.  OS X inherited this behavior from PostScript.  Other operating systems (Windows?) put the origin point in the upper left-hand corner, thus making X values positive and Y values negative.  By subtracting the screenY value from the window height, this "flips" the origin point and (apparently) removes the height of the browser window from the value (which can vary from computer to computer).

I'm sure someone will correct me if I'm wrong.  :)

Comment 4 Jonas Witt 2006-06-26 04:17:21 PDT
Created attachment 9045 [details]
Report screenY values as (height of main screen - screenY)

OK, I added "(flipped)" to the test output.

Can anyone explain why screenY reports such large values (10,000)? Is the WebView that's used for testing just shifted way off-screen (so nobody sees it)?
Comment 5 mitz 2006-06-26 04:19:57 PDT
(In reply to comment #4)
> Is the
> WebView that's used for testing just shifted way off-screen (so nobody sees
> it)?

Yes.
Comment 6 Darin Adler 2006-06-26 08:11:43 PDT
Comment on attachment 9045 [details]
Report screenY values as (height of main screen - screenY)

Nice, but not quite right for multi-screen systems. Flipping is based on the zero screen. So it's

(int) [[[NSScreen screens] objectAtIndex:0] frame].size.height

But I'll fix it and land it.
Comment 7 Darin Adler 2006-06-26 08:19:13 PDT
(In reply to comment #4)
> Can anyone explain why screenY reports such large values (10,000)? Is the
> WebView that's used for testing just shifted way off-screen (so nobody sees
> it)?

    // To make things like certain NSViews, dragging, and plug-ins work, put the WebView a window, but put it off-screen so you don't see it.
    NSRect windowRect = NSOffsetRect(rect, -10000, -10000);
Comment 8 Darin Adler 2006-06-26 08:21:24 PDT
Committed revision 15046.