Title: [164860] trunk
Revision
164860
Author
[email protected]
Date
2014-02-28 07:52:17 -0800 (Fri, 28 Feb 2014)

Log Message

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).

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.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (164859 => 164860)


--- trunk/LayoutTests/ChangeLog	2014-02-28 15:24:18 UTC (rev 164859)
+++ trunk/LayoutTests/ChangeLog	2014-02-28 15:52:17 UTC (rev 164860)
@@ -1,3 +1,15 @@
+2014-02-28  Commit Queue  <[email protected]>
+
+        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  <[email protected]>
 
         Add hiDPI support to DumpRenderTree/WebKitTestRunner without the need of reloading the test case.

Deleted: trunk/LayoutTests/fast/borders/hidpi-simple-hairline-border-painting-expected.html (164859 => 164860)


--- trunk/LayoutTests/fast/borders/hidpi-simple-hairline-border-painting-expected.html	2014-02-28 15:24:18 UTC (rev 164859)
+++ trunk/LayoutTests/fast/borders/hidpi-simple-hairline-border-painting-expected.html	2014-02-28 15:52:17 UTC (rev 164860)
@@ -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>

Deleted: trunk/LayoutTests/fast/borders/hidpi-simple-hairline-border-painting.html (164859 => 164860)


--- trunk/LayoutTests/fast/borders/hidpi-simple-hairline-border-painting.html	2014-02-28 15:24:18 UTC (rev 164859)
+++ trunk/LayoutTests/fast/borders/hidpi-simple-hairline-border-painting.html	2014-02-28 15:52:17 UTC (rev 164860)
@@ -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>

Modified: trunk/Tools/ChangeLog (164859 => 164860)


--- trunk/Tools/ChangeLog	2014-02-28 15:24:18 UTC (rev 164859)
+++ trunk/Tools/ChangeLog	2014-02-28 15:52:17 UTC (rev 164860)
@@ -1,3 +1,28 @@
+2014-02-28  Commit Queue  <[email protected]>
+
+        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  <[email protected]>
 
         Add hiDPI support to DumpRenderTree/WebKitTestRunner without the need of reloading the test case.

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (164859 => 164860)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2014-02-28 15:24:18 UTC (rev 164859)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2014-02-28 15:52:17 UTC (rev 164860)
@@ -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 @@
         [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 @@
     [NSSound _setAlertType:0];
 #endif
 
-    createWebViewAndOffscreenWindow();
+    WebView *webView = createWebViewAndOffscreenWindow();
+    mainFrame = [webView mainFrame];
 
     [[NSURLCache sharedURLCache] removeAllCachedResponses];
     [WebCache empty];
@@ -1174,8 +1148,28 @@
     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();
     
 #if !PLATFORM(IOS)
@@ -1443,20 +1437,6 @@
     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 @@
         return;
     }
 
-    const char* testURL([[url absoluteString] UTF8String]);
+    const string testURL([[url absoluteString] UTF8String]);
     
-    changeWindowScaleIfNeeded(testURL);
-
     resetWebViewToConsistentStateBeforeTesting();
 
     gTestRunner = TestRunner::create(testURL, command.expectedPixelHash);

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.h (164859 => 164860)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.h	2014-02-28 15:24:18 UTC (rev 164859)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.h	2014-02-28 15:52:17 UTC (rev 164860)
@@ -38,12 +38,6 @@
 
 @class WebView;
 
-@interface NSWindow (Details)
-
-- (void)_setWindowResolution:(CGFloat)resolution displayIfChanged:(BOOL)displayIfChanged;
-
-@end
-
 @interface DumpRenderTreeWindow : NSWindow
 {
 }

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm (164859 => 164860)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm	2014-02-28 15:24:18 UTC (rev 164859)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm	2014-02-28 15:52:17 UTC (rev 164860)
@@ -74,9 +74,8 @@
 #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

Modified: trunk/Tools/WebKitTestRunner/PlatformWebView.h (164859 => 164860)


--- trunk/Tools/WebKitTestRunner/PlatformWebView.h	2014-02-28 15:24:18 UTC (rev 164859)
+++ trunk/Tools/WebKitTestRunner/PlatformWebView.h	2014-02-28 15:52:17 UTC (rev 164860)
@@ -89,8 +89,6 @@
     WKRetainPtr<WKImageRef> windowSnapshotImage();
     WKDictionaryRef options() const { return m_options.get(); }
 
-    void changeWindowScaleIfNeeded(float newScale);
-
 private:
     PlatformWKView m_view;
     PlatformWindow m_window;

Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (164859 => 164860)


--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2014-02-28 15:24:18 UTC (rev 164859)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp	2014-02-28 15:52:17 UTC (rev 164860)
@@ -127,13 +127,6 @@
         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 @@
 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());

Modified: trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp (164859 => 164860)


--- trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp	2014-02-28 15:24:18 UTC (rev 164859)
+++ trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp	2014-02-28 15:52:17 UTC (rev 164860)
@@ -127,10 +127,6 @@
 {
 }
 
-void PlatformWebView::changeWindowScaleIfNeeded(float)
-{
-}
-
 WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
 {
     int width;

Modified: trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp (164859 => 164860)


--- trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp	2014-02-28 15:24:18 UTC (rev 164859)
+++ trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp	2014-02-28 15:52:17 UTC (rev 164860)
@@ -114,10 +114,6 @@
 {
 }
 
-void PlatformWebView::changeWindowScaleIfNeeded(float)
-{
-}
-
 WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
 {
     // FIXME: implement to capture pixels in the UI process,

Modified: trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm (164859 => 164860)


--- trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm	2014-02-28 15:24:18 UTC (rev 164859)
+++ trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm	2014-02-28 15:52:17 UTC (rev 164860)
@@ -207,11 +207,6 @@
 //    [m_window makeFirstResponder:m_view];
 }
 
-void PlatformWebView::changeWindowScaleIfNeeded(float)
-{
-    // Retina only surface.
-}
-
 WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
 {
     return 0; // FIXME for iOS?

Modified: trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm (164859 => 164860)


--- trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm	2014-02-28 15:24:18 UTC (rev 164859)
+++ trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm	2014-02-28 15:52:17 UTC (rev 164860)
@@ -109,12 +109,7 @@
     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
 
 namespace WTR {
@@ -247,16 +242,4 @@
     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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to