[WK1] iframes in layer-backed NSViews are not cleared between successive draws
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 May 2017 00:42:58 +0000 (00:42 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 May 2017 00:42:58 +0000 (00:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=172554
<rdar://problem/31247133>

Reviewed by Simon Fraser.

Source/WebKit/mac:

Update an overridden internal AppKit function to the new signature.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:_recursive:displayRectIgnoringOpacity:inContext:topView:]):
(-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:shouldChangeFontReferenceColor:_recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:]):
(-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:topView:]): Deleted.
(-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:]): Deleted.

Tools:

Previously, there was no way to make DumpRenderTree's views layer-backed. Unfortunately,
simply setting [WebView setWantsLayer:] is insufficient; turning it on and then off again
leaves some state around inside the NSWindow which isn't easily cleaned up. Instead,
we should just tear down and rebuild the window whenever we need a layer-backed WebView.
We can also use the "webkit-test-runner" header comment to trigger this new layer-backed
codepath.

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
(TestOptions::webViewIsCompatibleWithOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(shouldIgnoreWebCoreNodeLeaks):
(allowedFontFamilySet):
(-[DRTMockScroller rectForPart:]):
(-[DRTMockScroller drawKnob]):
(-[DRTMockScroller drawRect:]):
(createWebViewAndOffscreenWindow):
(initializeGlobalsFromCommandLineOptions):
(prepareConsistentTestingEnvironment):
(dumpRenderTree):
(dumpAudio):
(dumpHistoryItem):
(dumpBackForwardListForWebView):
(resetWebViewToConsistentStateBeforeTesting):
(WebThreadLockAfterDelegateCallbacksHaveCompleted):
(runTest):

LayoutTests:

Cause two successive paints, and compare it against 0 paints.

* fast/frames/iframe-translucent-background-expected.html: Added.
* fast/frames/iframe-translucent-background.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/frames/iframe-translucent-background-expected.html [new file with mode: 0644]
LayoutTests/fast/frames/iframe-translucent-background.html [new file with mode: 0644]
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebHTMLView.mm
Tools/ChangeLog
Tools/DumpRenderTree/TestOptions.h
Tools/DumpRenderTree/TestOptions.mm
Tools/DumpRenderTree/mac/DumpRenderTree.mm

index 2e22882..e7f624e 100644 (file)
@@ -1,3 +1,16 @@
+2017-05-25  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [WK1] iframes in layer-backed NSViews are not cleared between successive draws
+        https://bugs.webkit.org/show_bug.cgi?id=172554
+        <rdar://problem/31247133>
+
+        Reviewed by Simon Fraser.
+
+        Cause two successive paints, and compare it against 0 paints.
+
+        * fast/frames/iframe-translucent-background-expected.html: Added.
+        * fast/frames/iframe-translucent-background.html: Added.
+
 2017-05-25  Keith Miller  <keith_miller@apple.com>
 
         Date should use historical data if it's available.
diff --git a/LayoutTests/fast/frames/iframe-translucent-background-expected.html b/LayoutTests/fast/frames/iframe-translucent-background-expected.html
new file mode 100644 (file)
index 0000000..ee4938d
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<p>This test makes sure that iframes with translucent backgrounds are drawn with those background (and not just as black). The test passes if you don't see any black boxes below and the text has correct antialiasing.</p>
+<div style="border: 0px; width: 200px; height: 200px; background-color: rgba(0, 0, 128, 0.25);">Hello World <a href='http://www.apple.com/'>link</a> here.</div>
+</body>
+</html>
+
diff --git a/LayoutTests/fast/frames/iframe-translucent-background.html b/LayoutTests/fast/frames/iframe-translucent-background.html
new file mode 100644 (file)
index 0000000..06b4f91
--- /dev/null
@@ -0,0 +1,41 @@
+<!-- webkit-test-runner [ layerBackedWebView=true ] -->
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<p>This test makes sure that iframes with translucent backgrounds are drawn with those background (and not just as black). The test passes if you don't see any black boxes below and the text has correct antialiasing.</p>
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+function b() {
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+</script>
+<div style="width: 200px; height: 200px; overflow: hidden;">
+<iframe style="border: 0px; width: 200px; height: 200px;" srcdoc="<!DOCTYPE html>
+    <html>
+        <head>
+        </head>
+        <body style='background-color: rgba(0, 0, 128, 0.25); margin: 0px;'>
+            <div id='target'>Hello World <a href='http://www.apple.com/'>link</a> here.</div>
+            <script>
+                window.setTimeout(function() {
+                    var target = document.getElementById('target');
+                    var range = document.createRange();
+                    range.selectNodeContents(target);
+                    window.getSelection().addRange(range);
+                    window.setTimeout(function() {
+                        window.getSelection().removeAllRanges();
+                        window.parent.b();
+                    }, 0);
+                }, 0);
+            </script>
+        </body>
+    </html>"></iframe>
+<div style="background: red; transform-origin: left top; transform: perspective(600px) rotateY(-50deg); width: 200px; height: 200px;">Hello, World</div>
+</div>
+</body>
+</html>
+
index d0937a6..7966901 100644 (file)
@@ -1,3 +1,19 @@
+2017-05-25  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [WK1] iframes in layer-backed NSViews are not cleared between successive draws
+        https://bugs.webkit.org/show_bug.cgi?id=172554
+        <rdar://problem/31247133>
+
+        Reviewed by Simon Fraser.
+
+        Update an overridden internal AppKit function to the new signature.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:_recursive:displayRectIgnoringOpacity:inContext:topView:]):
+        (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:shouldChangeFontReferenceColor:_recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:]):
+        (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:topView:]): Deleted.
+        (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:]): Deleted.
+
 2017-05-24  Jer Noble  <jer.noble@apple.com>
 
         Rename DisplaySleepDisabler -> SleepDisabler
index 9478959..5ea2314 100644 (file)
@@ -684,10 +684,15 @@ extern NSString *NSTextInputReplacementRangeAttributeName;
 @interface NSView (WebNSViewDetails)
 - (void)_recursiveDisplayRectIfNeededIgnoringOpacity:(NSRect)rect isVisibleRect:(BOOL)isVisibleRect rectIsVisibleRectForView:(NSView *)visibleView topView:(BOOL)topView;
 - (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)needsLockFocus visRect:(NSRect)visRect;
-#if !PLATFORM(IOS)
+#if PLATFORM(MAC)
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
+- (void)_recursive:(BOOL)recurse displayRectIgnoringOpacity:(NSRect)displayRect inContext:(NSGraphicsContext *)context shouldChangeFontReferenceColor:(BOOL)shouldChangeFontReferenceColor;
+- (void)_recursive:(BOOL)recurseX displayRectIgnoringOpacity:(NSRect)displayRect inGraphicsContext:(NSGraphicsContext *)graphicsContext CGContext:(CGContextRef)ctx shouldChangeFontReferenceColor:(BOOL)shouldChangeFontReferenceColor;
+#else
 - (void)_recursive:(BOOL)recurse displayRectIgnoringOpacity:(NSRect)displayRect inContext:(NSGraphicsContext *)context topView:(BOOL)topView;
 - (void)_recursive:(BOOL)recurseX displayRectIgnoringOpacity:(NSRect)displayRect inGraphicsContext:(NSGraphicsContext *)graphicsContext CGContext:(CGContextRef)ctx topView:(BOOL)isTopView shouldChangeFontReferenceColor:(BOOL)shouldChangeFontReferenceColor;
 #endif
+#endif
 - (NSRect)_dirtyRect;
 - (void)_setDrawsOwnDescendants:(BOOL)drawsOwnDescendants;
 - (BOOL)_drawnByAncestor;
@@ -1836,15 +1841,27 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
 }
 
 // Don't let AppKit even draw subviews. We take care of that.
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
+- (void)_recursive:(BOOL)recurse displayRectIgnoringOpacity:(NSRect)displayRect inContext:(NSGraphicsContext *)context shouldChangeFontReferenceColor:(BOOL)shouldChangeFontReferenceColor
+#else
 - (void)_recursive:(BOOL)recurse displayRectIgnoringOpacity:(NSRect)displayRect inContext:(NSGraphicsContext *)context topView:(BOOL)topView
+#endif
 {
     [self _setAsideSubviews];
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
+    [super _recursive:recurse displayRectIgnoringOpacity:displayRect inContext:context shouldChangeFontReferenceColor:shouldChangeFontReferenceColor];
+#else
     [super _recursive:recurse displayRectIgnoringOpacity:displayRect inContext:context topView:topView];
+#endif
     [self _restoreSubviews];
 }
 
 // Don't let AppKit even draw subviews. We take care of that.
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
+- (void)_recursive:(BOOL)recurseX displayRectIgnoringOpacity:(NSRect)displayRect inGraphicsContext:(NSGraphicsContext *)graphicsContext CGContext:(CGContextRef)ctx shouldChangeFontReferenceColor:(BOOL)shouldChangeFontReferenceColor
+#else
 - (void)_recursive:(BOOL)recurseX displayRectIgnoringOpacity:(NSRect)displayRect inGraphicsContext:(NSGraphicsContext *)graphicsContext CGContext:(CGContextRef)ctx topView:(BOOL)isTopView shouldChangeFontReferenceColor:(BOOL)shouldChangeFontReferenceColor
+#endif
 {
     BOOL didSetAsideSubviews = NO;
 
@@ -1853,7 +1870,11 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
         didSetAsideSubviews = YES;
     }
     
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
+    [super _recursive:recurseX displayRectIgnoringOpacity:displayRect inGraphicsContext:graphicsContext CGContext:ctx shouldChangeFontReferenceColor:shouldChangeFontReferenceColor];
+#else
     [super _recursive:recurseX displayRectIgnoringOpacity:displayRect inGraphicsContext:graphicsContext CGContext:ctx topView:isTopView shouldChangeFontReferenceColor:shouldChangeFontReferenceColor];
+#endif
 
     if (didSetAsideSubviews)
         [self _restoreSubviews];
index 8c68b18..009021c 100644 (file)
@@ -1,3 +1,39 @@
+2017-05-25  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [WK1] iframes in layer-backed NSViews are not cleared between successive draws
+        https://bugs.webkit.org/show_bug.cgi?id=172554
+        <rdar://problem/31247133>
+
+        Reviewed by Simon Fraser.
+
+        Previously, there was no way to make DumpRenderTree's views layer-backed. Unfortunately,
+        simply setting [WebView setWantsLayer:] is insufficient; turning it on and then off again
+        leaves some state around inside the NSWindow which isn't easily cleaned up. Instead,
+        we should just tear down and rebuild the window whenever we need a layer-backed WebView.
+        We can also use the "webkit-test-runner" header comment to trigger this new layer-backed
+        codepath.
+
+        * DumpRenderTree/TestOptions.h:
+        * DumpRenderTree/TestOptions.mm:
+        (TestOptions::TestOptions):
+        (TestOptions::webViewIsCompatibleWithOptions):
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (shouldIgnoreWebCoreNodeLeaks):
+        (allowedFontFamilySet):
+        (-[DRTMockScroller rectForPart:]):
+        (-[DRTMockScroller drawKnob]):
+        (-[DRTMockScroller drawRect:]):
+        (createWebViewAndOffscreenWindow):
+        (initializeGlobalsFromCommandLineOptions):
+        (prepareConsistentTestingEnvironment):
+        (dumpRenderTree):
+        (dumpAudio):
+        (dumpHistoryItem):
+        (dumpBackForwardListForWebView):
+        (resetWebViewToConsistentStateBeforeTesting):
+        (WebThreadLockAfterDelegateCallbacksHaveCompleted):
+        (runTest):
+
 2017-05-25  Sam Weinig  <sam@webkit.org>
 
         [WebIDL] Use the term 'operation' more consistently
index 6c9a56c..2f0fc64 100644 (file)
@@ -34,6 +34,8 @@ struct TestOptions {
     bool enablePointerLock { false };
     bool enableCredentialManagement { false };
     bool enableDragDestinationActionLoad { false };
+    bool layerBackedWebView { false };
 
     TestOptions(NSURL*, const TestCommand&);
+    bool webViewIsCompatibleWithOptions(const TestOptions&) const;
 };
index b5bf130..42d98f4 100644 (file)
@@ -90,6 +90,13 @@ TestOptions::TestOptions(NSURL *testURL, const TestCommand& command)
             this->enableCredentialManagement = parseBooleanTestHeaderValue(value);
         else if (key == "enableDragDestinationActionLoad")
             this->enableDragDestinationActionLoad = parseBooleanTestHeaderValue(value);
+        else if (key == "layerBackedWebView")
+            this->layerBackedWebView = parseBooleanTestHeaderValue(value);
         pairStart = pairEnd + 1;
     }
 }
+
+bool TestOptions::webViewIsCompatibleWithOptions(const TestOptions& other) const
+{
+    return other.layerBackedWebView == layerBackedWebView;
+}
index f8bd95c..5f84133 100644 (file)
@@ -180,6 +180,7 @@ volatile bool done;
 NavigationController* gNavigationController = nullptr;
 RefPtr<TestRunner> gTestRunner;
 
+std::optional<TestOptions> mainFrameTestOptions;
 WebFrame *mainFrame = nil;
 // This is the topmost frame that is loading, during a given load, or nil when no load is 
 // in progress.  Usually this is the same as the main frame, but not always.  In the case
@@ -290,7 +291,7 @@ static bool shouldIgnoreWebCoreNodeLeaks(const string& URLString)
         // Keeping this infrastructure around in case we ever need it again.
     };
     static const int ignoreSetCount = sizeof(ignoreSet) / sizeof(char*);
-    
+
     for (int i = 0; i < ignoreSetCount; i++) {
         // FIXME: ignore case
         string curIgnore(ignoreSet[i]);
@@ -425,7 +426,7 @@ static NSSet *allowedFontFamilySet()
         @"Zapf Dingbats",
         @"Zapfino",
         nil] retain];
-    
+
     return fontFamilySet;
 }
 
@@ -647,7 +648,7 @@ static void adjustWebDocumentForStandardViewport(UIWebBrowserView *webBrowserVie
     CGFloat minKnobSize = isHorizontal ? bounds.size.height : bounds.size.width;
     CGFloat knobLength = max(minKnobSize, static_cast<CGFloat>(round(trackLength * [self knobProportion])));
     CGFloat knobPosition = static_cast<CGFloat>((round([self doubleValue] * (trackLength - knobLength))));
-    
+
     if (isHorizontal)
         return NSMakeRect(bounds.origin.x + knobPosition, bounds.origin.y, knobLength, bounds.size.height);
 
@@ -660,7 +661,7 @@ static void adjustWebDocumentForStandardViewport(UIWebBrowserView *webBrowserVie
         return;
 
     NSRect knobRect = [self rectForPart:NSScrollerKnob];
-    
+
     static NSColor *knobColor = [[NSColor colorWithDeviceRed:0x80 / 255.0 green:0x80 / 255.0 blue:0x80 / 255.0 alpha:1] retain];
     [knobColor set];
 
@@ -678,7 +679,7 @@ static void adjustWebDocumentForStandardViewport(UIWebBrowserView *webBrowserVie
         [disabledTrackColor set];
 
     NSRectFill(dirtyRect);
-    
+
     [self drawKnob];
 }
 
@@ -714,7 +715,7 @@ WebView *createWebViewAndOffscreenWindow()
     [WebView registerURLSchemeAsLocal:@"feed"];
     [WebView registerURLSchemeAsLocal:@"feeds"];
     [WebView registerURLSchemeAsLocal:@"feedsearch"];
-    
+
 #if PLATFORM(MAC)
     [WebView _setFontWhitelist:fontWhitelist()];
 #endif
@@ -731,7 +732,7 @@ WebView *createWebViewAndOffscreenWindow()
     [webView setDefersCallbacks:NO];
     [webView setInteractiveFormValidationEnabled:YES];
     [webView setValidationMessageTimerMagnification:-1];
-    
+
     // 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.
     // Put it at -10000, -10000 in "flipped coordinates", since WebCore and the DOM use flipped coordinates.
     NSScreen *firstScreen = [[NSScreen screens] firstObject];
@@ -776,7 +777,7 @@ WebView *createWebViewAndOffscreenWindow()
 
     adjustWebDocumentForStandardViewport(webBrowserView, scrollView);
 #endif
-    
+
 #if !PLATFORM(IOS)
     // For reasons that are not entirely clear, the following pair of calls makes WebView handle its
     // dynamic scrollbars properly. Without it, every frame will always have scrollbars.
@@ -1128,7 +1129,7 @@ static void initializeGlobalsFromCommandLineOptions(int argc, const char *argv[]
         {"print-test-count", no_argument, &printTestCount, YES},
         {nullptr, 0, nullptr, 0}
     };
-    
+
     int option;
     while ((option = getopt_long(argc, (char * const *)argv, "", options, nullptr)) != -1) {
         switch (option) {
@@ -1211,9 +1212,9 @@ static void prepareConsistentTestingEnvironment()
 #else
     activateFontsIOS();
 #endif
-    
+
     allocateGlobalControllers();
-    
+
 #if PLATFORM(MAC)
     NSActivityOptions options = (NSActivityUserInitiatedAllowingIdleSystemSleep | NSActivityLatencyCritical) & ~(NSActivitySuddenTerminationDisabled | NSActivityAutomaticTerminationDisabled);
     static id assertion = [[[NSProcessInfo processInfo] beginActivityWithOptions:options reason:@"DumpRenderTree should not be subject to process suppression"] retain];
@@ -1257,9 +1258,6 @@ void dumpRenderTree(int argc, const char *argv[])
     [NSSound _setAlertType:0];
 #endif
 
-    WebView *webView = createWebViewAndOffscreenWindow();
-    mainFrame = [webView mainFrame];
-
     [[NSURLCache sharedURLCache] removeAllCachedResponses];
     [WebCache empty];
 
@@ -1284,10 +1282,10 @@ void dumpRenderTree(int argc, const char *argv[])
     if (threaded)
         stopJavaScriptThreads();
 
-    destroyWebViewAndOffscreenWindow(webView);
-    
+    destroyWebViewAndOffscreenWindow([mainFrame webView]);
+
     releaseGlobalControllers();
-    
+
 #if !PLATFORM(IOS)
     [DumpRenderTreePasteboard releaseLocalPasteboards];
 #endif
@@ -1406,7 +1404,7 @@ static NSInteger compareHistoryItems(id item1, id item2, void *context)
 static NSData *dumpAudio()
 {
     const vector<char>& dataVector = gTestRunner->audioResult();
-    
+
     NSData *data = [NSData dataWithBytes:dataVector.data() length:dataVector.size()];
     return data;
 }
@@ -1420,13 +1418,13 @@ static void dumpHistoryItem(WebHistoryItem *item, int indent, BOOL current)
     }
     for (int i = start; i < indent; i++)
         putchar(' ');
-    
+
     NSString *urlString = [item URLString];
     if ([[NSURL URLWithString:urlString] isFileURL]) {
         NSRange range = [urlString rangeOfString:@"/LayoutTests/"];
         urlString = [@"(file test):" stringByAppendingString:[urlString substringFromIndex:(range.length + range.location)]];
     }
-    
+
     printf("%s", [urlString UTF8String]);
     NSString *target = [item target];
     if (target && [target length] > 0)
@@ -1551,7 +1549,7 @@ static void dumpBackForwardListForWebView(WebView *view)
         assert(item != prevTestBFItem);
         [itemsToPrint addObject:item];
     }
-            
+
     assert([bfList currentItem] != prevTestBFItem);
     [itemsToPrint addObject:[bfList currentItem]];
     int currentItemIndex = [itemsToPrint count] - 1;
@@ -1810,9 +1808,12 @@ static void resetWebViewToConsistentStateBeforeTesting(const TestOptions& option
     [webView setTracksRepaints:NO];
 
     [WebCache clearCachedCredentials];
-    
+
     resetWebPreferencesToConsistentValues();
     setWebPreferencesForTestOptions(options);
+#if PLATFORM(MAC)
+    [webView setWantsLayer:options.layerBackedWebView];
+#endif
 
     TestRunner::setSerializeHTTPLoads(false);
     TestRunner::setAllowsAnySSLCertificate(false);
@@ -1845,7 +1846,7 @@ static void resetWebViewToConsistentStateBeforeTesting(const TestOptions& option
 
     [[MockGeolocationProvider shared] stopTimer];
     [[MockWebNotificationProvider shared] reset];
-    
+
 #if !PLATFORM(IOS)
     // Clear the contents of the general pasteboard
     [[NSPasteboard generalPasteboard] declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
@@ -1879,7 +1880,7 @@ static void WebThreadLockAfterDelegateCallbacksHaveCompleted()
     }
 
     WebThreadLock();
-    
+
     dispatch_release(delegateSemaphore);
 }
 #endif
@@ -1949,6 +1950,14 @@ static void runTest(const string& inputLine)
     WKSetCrashReportApplicationSpecificInformation((CFStringRef)informationString);
 
     TestOptions options(url, command);
+    if (!mainFrameTestOptions || !options.webViewIsCompatibleWithOptions(mainFrameTestOptions.value())) {
+        if (mainFrame)
+            destroyWebViewAndOffscreenWindow([mainFrame webView]);
+        WebView *pristineWebView = createWebViewAndOffscreenWindow();
+        mainFrame = [pristineWebView mainFrame];
+    }
+    mainFrameTestOptions = options;
+
     resetWebViewToConsistentStateBeforeTesting(options);
 
     const char* testURL([[url absoluteString] UTF8String]);
@@ -2056,7 +2065,7 @@ static void runTest(const string& inputLine)
             // Don't try to close the main window
             if (window == [[mainFrame webView] window])
                 continue;
-            
+
 #if !PLATFORM(IOS)
             WebView *webView = [[[window contentView] subviews] objectAtIndex:0];
 #else