Title: [113288] trunk/Tools
- Revision
- 113288
- Author
- [email protected]
- Date
- 2012-04-04 21:28:38 -0700 (Wed, 04 Apr 2012)
Log Message
[mac] WKTR should always keep its windows offscreen
https://bugs.webkit.org/show_bug.cgi?id=83244
<rdar://problem/11188764>
Reviewed by Simon Fraser.
We don't want to allow windows onto the main display; intercept attempts to
change WebKitTestRunnerWindow's frame origin and prevent it from happening.
Also keep around and respond with a new "fake" origin, in case someone is
expecting it to change (I couldn't find any tests that expected this, however).
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(-[WebKitTestRunnerWindow setFrameOrigin:]):
(-[WebKitTestRunnerWindow setFrame:display:animate:]):
(-[WebKitTestRunnerWindow setFrame:display:]):
(-[WebKitTestRunnerWindow frame]):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (113287 => 113288)
--- trunk/Tools/ChangeLog 2012-04-05 04:22:50 UTC (rev 113287)
+++ trunk/Tools/ChangeLog 2012-04-05 04:28:38 UTC (rev 113288)
@@ -1,3 +1,23 @@
+2012-04-04 Tim Horton <[email protected]>
+
+ [mac] WKTR should always keep its windows offscreen
+ https://bugs.webkit.org/show_bug.cgi?id=83244
+ <rdar://problem/11188764>
+
+ Reviewed by Simon Fraser.
+
+ We don't want to allow windows onto the main display; intercept attempts to
+ change WebKitTestRunnerWindow's frame origin and prevent it from happening.
+
+ Also keep around and respond with a new "fake" origin, in case someone is
+ expecting it to change (I couldn't find any tests that expected this, however).
+
+ * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+ (-[WebKitTestRunnerWindow setFrameOrigin:]):
+ (-[WebKitTestRunnerWindow setFrame:display:animate:]):
+ (-[WebKitTestRunnerWindow setFrame:display:]):
+ (-[WebKitTestRunnerWindow frame]):
+
2012-04-04 Dirk Pranke <[email protected]>
Fix typo introduced in r113271.
Modified: trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm (113287 => 113288)
--- trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm 2012-04-05 04:22:50 UTC (rev 113287)
+++ trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm 2012-04-05 04:28:38 UTC (rev 113288)
@@ -32,6 +32,8 @@
@interface WebKitTestRunnerWindow : NSWindow {
WTR::PlatformWebView* _platformWebView;
+ NSPoint _fakeOrigin;
+ bool _shouldUseFakeOrigin;
}
@property (nonatomic, assign) WTR::PlatformWebView* platformWebView;
@end
@@ -43,6 +45,42 @@
{
return _platformWebView ? _platformWebView->windowIsKey() : YES;
}
+
+- (void)setFrameOrigin:(NSPoint)point
+{
+ _fakeOrigin = point;
+ _shouldUseFakeOrigin = YES;
+}
+
+- (void)setFrame:(NSRect)windowFrame display:(BOOL)displayViews animate:(BOOL)performAnimation
+{
+ NSRect currentFrame = [super frame];
+
+ _fakeOrigin = windowFrame.origin;
+ _shouldUseFakeOrigin = YES;
+
+ [super setFrame:NSMakeRect(currentFrame.origin.x, currentFrame.origin.y, windowFrame.size.width, windowFrame.size.height) display:displayViews animate:performAnimation];
+}
+
+- (void)setFrame:(NSRect)windowFrame display:(BOOL)displayViews
+{
+ NSRect currentFrame = [super frame];
+
+ _fakeOrigin = windowFrame.origin;
+ _shouldUseFakeOrigin = YES;
+
+ [super setFrame:NSMakeRect(currentFrame.origin.x, currentFrame.origin.y, windowFrame.size.width, windowFrame.size.height) display:displayViews];
+}
+
+- (NSRect)frame
+{
+ NSRect currentFrame = [super frame];
+
+ if (_shouldUseFakeOrigin)
+ return NSMakeRect(_fakeOrigin.x, _fakeOrigin.y, currentFrame.size.width, currentFrame.size.height);
+
+ return currentFrame;
+}
@end
namespace WTR {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes