Bug 9579

Summary: LayoutTests/fast/events/objc-event-api.html failing due to screenY output
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: jonas.witt
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Report screenY values as (height of main screen - screenY)
none
Report screenY values as (height of main screen - screenY) darin: review+

David Kilzer (:ddkilzer)
Reported 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.
Attachments
Report screenY values as (height of main screen - screenY) (4.79 KB, patch)
2006-06-26 02:31 PDT, Jonas Witt
no flags
Report screenY values as (height of main screen - screenY) (4.91 KB, patch)
2006-06-26 04:17 PDT, Jonas Witt
darin: review+
David Kilzer (:ddkilzer)
Comment 1 2006-06-25 13:01:53 PDT
I said, Bug 9181.
Jonas Witt
Comment 2 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?
David Kilzer (:ddkilzer)
Comment 3 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.  :)
Jonas Witt
Comment 4 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)?
mitz
Comment 5 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.
Darin Adler
Comment 6 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.
Darin Adler
Comment 7 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);
Darin Adler
Comment 8 2006-06-26 08:21:24 PDT
Committed revision 15046.
Note You need to log in before you can comment on or make changes to this bug.