Unreviewed, rolling out r164859.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Feb 2014 15:52:17 +0000 (15:52 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Feb 2014 15:52:17 +0000 (15:52 +0000)
http://trac.webkit.org/changeset/164859
https://bugs.webkit.org/show_bug.cgi?id=129483

caused WK1 crashes (DumpRenderTree) (Requested by zalan on
#webkit).

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow):
(dumpRenderTree):
(runTest):
* DumpRenderTree/mac/DumpRenderTreeWindow.h:
* DumpRenderTree/mac/DumpRenderTreeWindow.mm:
(-[DumpRenderTreeWindow initWithContentRect:styleMask:backing:defer:]):
* WebKitTestRunner/PlatformWebView.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(-[WebKitTestRunnerWindow frameRespectingFakeOrigin]):

LayoutTests:

* fast/borders/hidpi-simple-hairline-border-painting-expected.html: Removed.
* fast/borders/hidpi-simple-hairline-border-painting.html: Removed.

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

13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/borders/hidpi-simple-hairline-border-painting-expected.html [deleted file]
LayoutTests/fast/borders/hidpi-simple-hairline-border-painting.html [deleted file]
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/mac/DumpRenderTreeWindow.h
Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm
Tools/WebKitTestRunner/PlatformWebView.h
Tools/WebKitTestRunner/TestInvocation.cpp
Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp
Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm
Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm

index 493ebb2..e78b5ea 100644 (file)
@@ -1,3 +1,15 @@
+2014-02-28  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r164859.
+        http://trac.webkit.org/changeset/164859
+        https://bugs.webkit.org/show_bug.cgi?id=129483
+
+        caused WK1 crashes (DumpRenderTree) (Requested by zalan on
+        #webkit).
+
+        * fast/borders/hidpi-simple-hairline-border-painting-expected.html: Removed.
+        * fast/borders/hidpi-simple-hairline-border-painting.html: Removed.
+
 2014-02-28  Zalan Bujtas  <zalan@apple.com>
 
         Add hiDPI support to DumpRenderTree/WebKitTestRunner without the need of reloading the test case.
diff --git a/LayoutTests/fast/borders/hidpi-simple-hairline-border-painting-expected.html b/LayoutTests/fast/borders/hidpi-simple-hairline-border-painting-expected.html
deleted file mode 100644 (file)
index 51f8cd4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<html>
-<title>It tests if 0.5px borders get painted.</title>
-<style>
-  div {
-       width: 49px;
-       height: 49px;
-       border: 1px solid green;
-  }
-</style>
-<body>
-       <div></div>
-</body>
diff --git a/LayoutTests/fast/borders/hidpi-simple-hairline-border-painting.html b/LayoutTests/fast/borders/hidpi-simple-hairline-border-painting.html
deleted file mode 100644 (file)
index 0e33d51..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<html>
-<title>It tests if 0.5px borders get painted.</title>
-<style>
-.outer {
-       width: 50px;
-       height: 50px;
-       border: 0.5px solid green;
-}
-.inner {
-       width: 49px;
-       height: 49px;
-       border: 0.5px solid green;
-}
-</style>
-<body>
-       <div class="outer"><div class="inner"></div></div>
-</body>
index cbc93e5..2a5e1f3 100644 (file)
@@ -1,3 +1,28 @@
+2014-02-28  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r164859.
+        http://trac.webkit.org/changeset/164859
+        https://bugs.webkit.org/show_bug.cgi?id=129483
+
+        caused WK1 crashes (DumpRenderTree) (Requested by zalan on
+        #webkit).
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (createWebViewAndOffscreenWindow):
+        (dumpRenderTree):
+        (runTest):
+        * DumpRenderTree/mac/DumpRenderTreeWindow.h:
+        * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
+        (-[DumpRenderTreeWindow initWithContentRect:styleMask:backing:defer:]):
+        * WebKitTestRunner/PlatformWebView.h:
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::invoke):
+        * WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
+        * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
+        * WebKitTestRunner/ios/PlatformWebViewIOS.mm:
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        (-[WebKitTestRunnerWindow frameRespectingFakeOrigin]):
+
 2014-02-28  Zalan Bujtas  <zalan@apple.com>
 
         Add hiDPI support to DumpRenderTree/WebKitTestRunner without the need of reloading the test case.
index 55e76c0..a462d65 100644 (file)
@@ -90,7 +90,6 @@
 #import <wtf/Threading.h>
 #import <wtf/ObjcRuntimeExtras.h>
 #import <wtf/OwnPtr.h>
-#import <wtf/text/WTFString.h>
 
 #if !PLATFORM(IOS)
 #import <Carbon/Carbon.h>
@@ -772,36 +771,10 @@ WebView *createWebViewAndOffscreenWindow()
         [uiWindow retain];
     }
 #endif
-    mainFrame = [webView mainFrame];
 
     return webView;
 }
 
-static void destroyWebViewAndOffscreenWindow()
-{
-    WebView *webView = [mainFrame webView];
-
-    [webView close];
-    mainFrame = nil;
-
-#if !PLATFORM(IOS)
-    NSWindow* window = [webView window];
-    // Work around problem where registering drag types leaves an outstanding
-    // "perform selector" on the window, which retains the window. It's a bit
-    // inelegant and perhaps dangerous to just blow them all away, but in practice
-    // it probably won't cause any trouble (and this is just a test tool, after all).
-    [NSObject cancelPreviousPerformRequestsWithTarget:window];
-
-    [window close]; // releases when closed
-#else
-    UIWindow *uiWindow = [gWebBrowserView window];
-    [uiWindow removeFromSuperview];
-    [uiWindow release];
-#endif
-
-    [webView release];
-}
-
 static NSString *libraryPathForDumpRenderTree()
 {
     //FIXME: This may not be sufficient to prevent interactions/crashes
@@ -1148,7 +1121,8 @@ void dumpRenderTree(int argc, const char *argv[])
     [NSSound _setAlertType:0];
 #endif
 
-    createWebViewAndOffscreenWindow();
+    WebView *webView = createWebViewAndOffscreenWindow();
+    mainFrame = [webView mainFrame];
 
     [[NSURLCache sharedURLCache] removeAllCachedResponses];
     [WebCache empty];
@@ -1174,7 +1148,27 @@ void dumpRenderTree(int argc, const char *argv[])
     if (threaded)
         stopJavaScriptThreads();
 
-    destroyWebViewAndOffscreenWindow();
+#if !PLATFORM(IOS)
+    NSWindow *window = [webView window];
+#endif
+    [webView close];
+    mainFrame = nil;
+
+#if !PLATFORM(IOS)
+    // Work around problem where registering drag types leaves an outstanding
+    // "perform selector" on the window, which retains the window. It's a bit
+    // inelegant and perhaps dangerous to just blow them all away, but in practice
+    // it probably won't cause any trouble (and this is just a test tool, after all).
+    [NSObject cancelPreviousPerformRequestsWithTarget:window];
+    
+    [window close]; // releases when closed
+#else
+    UIWindow *uiWindow = [gWebBrowserView window];
+    [uiWindow removeFromSuperview];
+    [uiWindow release];
+#endif
+
+    [webView release];
     
     releaseGlobalControllers();
     
@@ -1443,20 +1437,6 @@ static void dumpBackForwardListForWebView(WebView *view)
     printf("===============================================\n");
 }
 
-static void changeWindowScaleIfNeeded(const char* testPathOrUR)
-{
-    bool hasHighDPIWindow = [[[mainFrame webView] window] backingScaleFactor] != 1;
-    WTF::String localPathOrUrl = String(testPathOrUR);
-    bool needsHighDPIWindow = localPathOrUrl.findIgnoringCase("hidpi-") != notFound;
-    if (hasHighDPIWindow == needsHighDPIWindow)
-        return;
-
-    CGFloat newScaleFactor = needsHighDPIWindow ? 2 : 1;
-    // When the new scale factor is set on the window first, WebView doesn't see it as a new scale and stops propagating the behavior change to WebCore::Page.
-    gTestRunner->setBackingScaleFactor(newScaleFactor);
-    [[[mainFrame webView] window] _setWindowResolution:newScaleFactor displayIfChanged:YES];
-}
-
 static void sizeWebViewForCurrentTest()
 {
     // W3C SVG tests expect to be 480x360
@@ -1753,10 +1733,8 @@ static void runTest(const string& inputLine)
         return;
     }
 
-    const char* testURL([[url absoluteString] UTF8String]);
+    const string testURL([[url absoluteString] UTF8String]);
     
-    changeWindowScaleIfNeeded(testURL);
-
     resetWebViewToConsistentStateBeforeTesting();
 
     gTestRunner = TestRunner::create(testURL, command.expectedPixelHash);
index a91b039..89c979c 100644 (file)
 
 @class WebView;
 
-@interface NSWindow (Details)
-
-- (void)_setWindowResolution:(CGFloat)resolution displayIfChanged:(BOOL)displayIfChanged;
-
-@end
-
 @interface DumpRenderTreeWindow : NSWindow
 {
 }
index 13782a9..2ece9c9 100644 (file)
@@ -74,9 +74,8 @@ static CFArrayCallBacks NonRetainingArrayCallbacks = {
 #if !PLATFORM(IOS)
 - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation
 {
-    if ((self = [super initWithContentRect:contentRect styleMask:styleMask backing:bufferingType defer:deferCreation]))
-        [self _addToOpenWindows];
-    return self;
+    [self _addToOpenWindows];
+    return [super initWithContentRect:contentRect styleMask:styleMask backing:bufferingType defer:deferCreation];
 }
 #else
 - (id)initWithLayer:(CALayer *)layer
index 83d9521..db97b64 100644 (file)
@@ -89,8 +89,6 @@ public:
     WKRetainPtr<WKImageRef> windowSnapshotImage();
     WKDictionaryRef options() const { return m_options.get(); }
 
-    void changeWindowScaleIfNeeded(float newScale);
-
 private:
     PlatformWKView m_view;
     PlatformWindow m_window;
index f76bc85..f1ddc0e 100644 (file)
@@ -127,13 +127,6 @@ static void sizeWebViewForCurrentTest(const char* pathOrURL)
         TestController::shared().mainWebView()->resizeTo(TestController::viewWidth, TestController::viewHeight);
 }
 
-static void changeWindowScaleIfNeeded(const char* pathOrURL)
-{
-    WTF::String localPathOrUrl = String(pathOrURL);
-    bool needsHighDPIWindow = localPathOrUrl.findIgnoringCase("hidpi-") != notFound;
-    TestController::shared().mainWebView()->changeWindowScaleIfNeeded(needsHighDPIWindow ? 2 : 1);
-}
-
 static bool shouldLogFrameLoadDelegates(const char* pathOrURL)
 {
     return strstr(pathOrURL, "loading/");
@@ -200,7 +193,6 @@ static void updateLayoutType(const char* pathOrURL)
 void TestInvocation::invoke()
 {
     TestController::TimeoutDuration timeoutToUse = TestController::LongTimeout;
-    changeWindowScaleIfNeeded(m_pathOrURL.c_str());
     sizeWebViewForCurrentTest(m_pathOrURL.c_str());
     updateLayoutType(m_pathOrURL.c_str());
     updateThreadedScrollingForCurrentTest(m_pathOrURL.c_str());
index 846e4b7..60f5382 100644 (file)
@@ -127,10 +127,6 @@ void PlatformWebView::makeWebViewFirstResponder()
 {
 }
 
-void PlatformWebView::changeWindowScaleIfNeeded(float)
-{
-}
-
 WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
 {
     int width;
index 9e7c876..fd6f846 100644 (file)
@@ -114,10 +114,6 @@ void PlatformWebView::makeWebViewFirstResponder()
 {
 }
 
-void PlatformWebView::changeWindowScaleIfNeeded(float)
-{
-}
-
 WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
 {
     // FIXME: implement to capture pixels in the UI process,
index 029f7a4..5a67527 100644 (file)
@@ -207,11 +207,6 @@ void PlatformWebView::makeWebViewFirstResponder()
 //    [m_window makeFirstResponder:m_view];
 }
 
-void PlatformWebView::changeWindowScaleIfNeeded(float)
-{
-    // Retina only surface.
-}
-
 WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
 {
     return 0; // FIXME for iOS?
index 6b7731d..b6c53a2 100644 (file)
@@ -109,11 +109,6 @@ enum {
     NSRect currentFrame = [self frame];
     return NSMakeRect(_fakeOrigin.x, _fakeOrigin.y, currentFrame.size.width, currentFrame.size.height);
 }
-@end
-
-@interface NSWindow (Details)
-
-- (void)_setWindowResolution:(CGFloat)resolution displayIfChanged:(BOOL)displayIfChanged;
 
 @end
 
@@ -247,16 +242,4 @@ bool PlatformWebView::viewSupportsOptions(WKDictionaryRef options) const
     return useThreadedScrolling == [(TestRunnerWKView *)m_view useThreadedScrolling];
 }
 
-void PlatformWebView::changeWindowScaleIfNeeded(float newScale)
-{
-    CGFloat currentScale = [m_window backingScaleFactor];
-    if (currentScale == newScale)
-        return;
-    [m_window _setWindowResolution:newScale displayIfChanged:YES];
-    // Changing the scaling factor on the window does not trigger NSWindowDidChangeBackingPropertiesNotification. We need to send the notification manually.
-    RetainPtr<NSMutableDictionary> notificationUserInfo = [[NSMutableDictionary alloc] initWithCapacity:1];
-    [notificationUserInfo setObject:[NSNumber numberWithDouble:currentScale] forKey:NSBackingPropertyOldScaleFactorKey];
-    [[NSNotificationCenter defaultCenter] postNotificationName:NSWindowDidChangeBackingPropertiesNotification object:m_window userInfo:notificationUserInfo.get()];
-}
-
 } // namespace WTR