[iOS] Fix the view being half offscreen in WebKitTestRunner on iOS
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jun 2014 00:55:54 +0000 (00:55 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Jun 2014 00:55:54 +0000 (00:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133835

Reviewed by Tim Horton.

Don't do the _fakeOrigin stuff when -initWithFrame: is calling -setFrame:

* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(-[WebKitTestRunnerWindow initWithFrame:]):
(-[WebKitTestRunnerWindow setFrame:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169925 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm

index 3793bb8..9781b3d 100644 (file)
@@ -1,3 +1,16 @@
+2014-06-12  Simon Fraser  <simon.fraser@apple.com>
+
+        [iOS] Fix the view being half offscreen in WebKitTestRunner on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=133835
+
+        Reviewed by Tim Horton.
+        
+        Don't do the _fakeOrigin stuff when -initWithFrame: is calling -setFrame:
+
+        * WebKitTestRunner/ios/PlatformWebViewIOS.mm:
+        (-[WebKitTestRunnerWindow initWithFrame:]):
+        (-[WebKitTestRunnerWindow setFrame:]):
+
 2014-06-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
 
         [GTK] Performance tests should be always ran with WKTR.
 2014-06-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
 
         [GTK] Performance tests should be always ran with WKTR.
index e19979f..92715e1 100644 (file)
@@ -35,6 +35,7 @@
 @interface WebKitTestRunnerWindow : UIWindow {
     WTR::PlatformWebView* _platformWebView;
     CGPoint _fakeOrigin;
 @interface WebKitTestRunnerWindow : UIWindow {
     WTR::PlatformWebView* _platformWebView;
     CGPoint _fakeOrigin;
+    BOOL _initialized;
 }
 @property (nonatomic, assign) WTR::PlatformWebView* platformWebView;
 @end
 }
 @property (nonatomic, assign) WTR::PlatformWebView* platformWebView;
 @end
 @implementation WebKitTestRunnerWindow
 @synthesize platformWebView = _platformWebView;
 
 @implementation WebKitTestRunnerWindow
 @synthesize platformWebView = _platformWebView;
 
+- (id)initWithFrame:(CGRect)frame
+{
+    if ((self = [super initWithFrame:frame]))
+        _initialized = YES;
+
+    return self;
+}
 - (BOOL)isKeyWindow
 {
     return _platformWebView ? _platformWebView->windowIsKey() : YES;
 - (BOOL)isKeyWindow
 {
     return _platformWebView ? _platformWebView->windowIsKey() : YES;
     _fakeOrigin = point;
 }
 
     _fakeOrigin = point;
 }
 
-// FIXME: these frame gyrations cause the window to go half offscreen.
 - (void)setFrame:(CGRect)windowFrame
 {
 - (void)setFrame:(CGRect)windowFrame
 {
+    if (!_initialized) {
+        [super setFrame:windowFrame];
+        return;
+    }
+
     CGRect currentFrame = [super frame];
 
     _fakeOrigin = windowFrame.origin;
     CGRect currentFrame = [super frame];
 
     _fakeOrigin = windowFrame.origin;