Summary: | LayoutTests/fast/events/objc-event-api.html failing due to screenY output | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> | ||||||
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | jonas.witt | ||||||
Priority: | P2 | ||||||||
Version: | 420+ | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.4 | ||||||||
Attachments: |
|
Description
David Kilzer (:ddkilzer)
2006-06-25 13:01:03 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?
(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. :) 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)?
(In reply to comment #4) > Is the > WebView that's used for testing just shifted way off-screen (so nobody sees > it)? Yes. 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.
(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); Committed revision 15046. |