Changeset 217461 in webkit
- Timestamp:
- May 25, 2017 5:42:58 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r217458 r217461 1 2017-05-25 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [WK1] iframes in layer-backed NSViews are not cleared between successive draws 4 https://bugs.webkit.org/show_bug.cgi?id=172554 5 <rdar://problem/31247133> 6 7 Reviewed by Simon Fraser. 8 9 Cause two successive paints, and compare it against 0 paints. 10 11 * fast/frames/iframe-translucent-background-expected.html: Added. 12 * fast/frames/iframe-translucent-background.html: Added. 13 1 14 2017-05-25 Keith Miller <keith_miller@apple.com> 2 15 -
trunk/Source/WebKit/mac/ChangeLog
r217371 r217461 1 2017-05-25 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [WK1] iframes in layer-backed NSViews are not cleared between successive draws 4 https://bugs.webkit.org/show_bug.cgi?id=172554 5 <rdar://problem/31247133> 6 7 Reviewed by Simon Fraser. 8 9 Update an overridden internal AppKit function to the new signature. 10 11 * WebView/WebHTMLView.mm: 12 (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:_recursive:displayRectIgnoringOpacity:inContext:topView:]): 13 (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:shouldChangeFontReferenceColor:_recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:]): 14 (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:topView:]): Deleted. 15 (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:]): Deleted. 16 1 17 2017-05-24 Jer Noble <jer.noble@apple.com> 2 18 -
trunk/Source/WebKit/mac/WebView/WebHTMLView.mm
r217296 r217461 685 685 - (void)_recursiveDisplayRectIfNeededIgnoringOpacity:(NSRect)rect isVisibleRect:(BOOL)isVisibleRect rectIsVisibleRectForView:(NSView *)visibleView topView:(BOOL)topView; 686 686 - (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)needsLockFocus visRect:(NSRect)visRect; 687 #if !PLATFORM(IOS) 687 #if PLATFORM(MAC) 688 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 689 - (void)_recursive:(BOOL)recurse displayRectIgnoringOpacity:(NSRect)displayRect inContext:(NSGraphicsContext *)context shouldChangeFontReferenceColor:(BOOL)shouldChangeFontReferenceColor; 690 - (void)_recursive:(BOOL)recurseX displayRectIgnoringOpacity:(NSRect)displayRect inGraphicsContext:(NSGraphicsContext *)graphicsContext CGContext:(CGContextRef)ctx shouldChangeFontReferenceColor:(BOOL)shouldChangeFontReferenceColor; 691 #else 688 692 - (void)_recursive:(BOOL)recurse displayRectIgnoringOpacity:(NSRect)displayRect inContext:(NSGraphicsContext *)context topView:(BOOL)topView; 689 693 - (void)_recursive:(BOOL)recurseX displayRectIgnoringOpacity:(NSRect)displayRect inGraphicsContext:(NSGraphicsContext *)graphicsContext CGContext:(CGContextRef)ctx topView:(BOOL)isTopView shouldChangeFontReferenceColor:(BOOL)shouldChangeFontReferenceColor; 694 #endif 690 695 #endif 691 696 - (NSRect)_dirtyRect; … … 1837 1842 1838 1843 // Don't let AppKit even draw subviews. We take care of that. 1844 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 1845 - (void)_recursive:(BOOL)recurse displayRectIgnoringOpacity:(NSRect)displayRect inContext:(NSGraphicsContext *)context shouldChangeFontReferenceColor:(BOOL)shouldChangeFontReferenceColor 1846 #else 1839 1847 - (void)_recursive:(BOOL)recurse displayRectIgnoringOpacity:(NSRect)displayRect inContext:(NSGraphicsContext *)context topView:(BOOL)topView 1848 #endif 1840 1849 { 1841 1850 [self _setAsideSubviews]; 1851 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 1852 [super _recursive:recurse displayRectIgnoringOpacity:displayRect inContext:context shouldChangeFontReferenceColor:shouldChangeFontReferenceColor]; 1853 #else 1842 1854 [super _recursive:recurse displayRectIgnoringOpacity:displayRect inContext:context topView:topView]; 1855 #endif 1843 1856 [self _restoreSubviews]; 1844 1857 } 1845 1858 1846 1859 // Don't let AppKit even draw subviews. We take care of that. 1860 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 1861 - (void)_recursive:(BOOL)recurseX displayRectIgnoringOpacity:(NSRect)displayRect inGraphicsContext:(NSGraphicsContext *)graphicsContext CGContext:(CGContextRef)ctx shouldChangeFontReferenceColor:(BOOL)shouldChangeFontReferenceColor 1862 #else 1847 1863 - (void)_recursive:(BOOL)recurseX displayRectIgnoringOpacity:(NSRect)displayRect inGraphicsContext:(NSGraphicsContext *)graphicsContext CGContext:(CGContextRef)ctx topView:(BOOL)isTopView shouldChangeFontReferenceColor:(BOOL)shouldChangeFontReferenceColor 1864 #endif 1848 1865 { 1849 1866 BOOL didSetAsideSubviews = NO; … … 1854 1871 } 1855 1872 1873 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 1874 [super _recursive:recurseX displayRectIgnoringOpacity:displayRect inGraphicsContext:graphicsContext CGContext:ctx shouldChangeFontReferenceColor:shouldChangeFontReferenceColor]; 1875 #else 1856 1876 [super _recursive:recurseX displayRectIgnoringOpacity:displayRect inGraphicsContext:graphicsContext CGContext:ctx topView:isTopView shouldChangeFontReferenceColor:shouldChangeFontReferenceColor]; 1877 #endif 1857 1878 1858 1879 if (didSetAsideSubviews) -
trunk/Tools/ChangeLog
r217451 r217461 1 2017-05-25 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [WK1] iframes in layer-backed NSViews are not cleared between successive draws 4 https://bugs.webkit.org/show_bug.cgi?id=172554 5 <rdar://problem/31247133> 6 7 Reviewed by Simon Fraser. 8 9 Previously, there was no way to make DumpRenderTree's views layer-backed. Unfortunately, 10 simply setting [WebView setWantsLayer:] is insufficient; turning it on and then off again 11 leaves some state around inside the NSWindow which isn't easily cleaned up. Instead, 12 we should just tear down and rebuild the window whenever we need a layer-backed WebView. 13 We can also use the "webkit-test-runner" header comment to trigger this new layer-backed 14 codepath. 15 16 * DumpRenderTree/TestOptions.h: 17 * DumpRenderTree/TestOptions.mm: 18 (TestOptions::TestOptions): 19 (TestOptions::webViewIsCompatibleWithOptions): 20 * DumpRenderTree/mac/DumpRenderTree.mm: 21 (shouldIgnoreWebCoreNodeLeaks): 22 (allowedFontFamilySet): 23 (-[DRTMockScroller rectForPart:]): 24 (-[DRTMockScroller drawKnob]): 25 (-[DRTMockScroller drawRect:]): 26 (createWebViewAndOffscreenWindow): 27 (initializeGlobalsFromCommandLineOptions): 28 (prepareConsistentTestingEnvironment): 29 (dumpRenderTree): 30 (dumpAudio): 31 (dumpHistoryItem): 32 (dumpBackForwardListForWebView): 33 (resetWebViewToConsistentStateBeforeTesting): 34 (WebThreadLockAfterDelegateCallbacksHaveCompleted): 35 (runTest): 36 1 37 2017-05-25 Sam Weinig <sam@webkit.org> 2 38 -
trunk/Tools/DumpRenderTree/TestOptions.h
r215189 r217461 35 35 bool enableCredentialManagement { false }; 36 36 bool enableDragDestinationActionLoad { false }; 37 bool layerBackedWebView { false }; 37 38 38 39 TestOptions(NSURL*, const TestCommand&); 40 bool webViewIsCompatibleWithOptions(const TestOptions&) const; 39 41 }; -
trunk/Tools/DumpRenderTree/TestOptions.mm
r215189 r217461 91 91 else if (key == "enableDragDestinationActionLoad") 92 92 this->enableDragDestinationActionLoad = parseBooleanTestHeaderValue(value); 93 else if (key == "layerBackedWebView") 94 this->layerBackedWebView = parseBooleanTestHeaderValue(value); 93 95 pairStart = pairEnd + 1; 94 96 } 95 97 } 98 99 bool TestOptions::webViewIsCompatibleWithOptions(const TestOptions& other) const 100 { 101 return other.layerBackedWebView == layerBackedWebView; 102 } -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r217273 r217461 181 181 RefPtr<TestRunner> gTestRunner; 182 182 183 std::optional<TestOptions> mainFrameTestOptions; 183 184 WebFrame *mainFrame = nil; 184 185 // This is the topmost frame that is loading, during a given load, or nil when no load is … … 291 292 }; 292 293 static const int ignoreSetCount = sizeof(ignoreSet) / sizeof(char*); 293 294 294 295 for (int i = 0; i < ignoreSetCount; i++) { 295 296 // FIXME: ignore case … … 426 427 @"Zapfino", 427 428 nil] retain]; 428 429 429 430 return fontFamilySet; 430 431 } … … 648 649 CGFloat knobLength = max(minKnobSize, static_cast<CGFloat>(round(trackLength * [self knobProportion]))); 649 650 CGFloat knobPosition = static_cast<CGFloat>((round([self doubleValue] * (trackLength - knobLength)))); 650 651 651 652 if (isHorizontal) 652 653 return NSMakeRect(bounds.origin.x + knobPosition, bounds.origin.y, knobLength, bounds.size.height); … … 661 662 662 663 NSRect knobRect = [self rectForPart:NSScrollerKnob]; 663 664 664 665 static NSColor *knobColor = [[NSColor colorWithDeviceRed:0x80 / 255.0 green:0x80 / 255.0 blue:0x80 / 255.0 alpha:1] retain]; 665 666 [knobColor set]; … … 679 680 680 681 NSRectFill(dirtyRect); 681 682 682 683 [self drawKnob]; 683 684 } … … 715 716 [WebView registerURLSchemeAsLocal:@"feeds"]; 716 717 [WebView registerURLSchemeAsLocal:@"feedsearch"]; 717 718 718 719 #if PLATFORM(MAC) 719 720 [WebView _setFontWhitelist:fontWhitelist()]; … … 732 733 [webView setInteractiveFormValidationEnabled:YES]; 733 734 [webView setValidationMessageTimerMagnification:-1]; 734 735 735 736 // 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. 736 737 // Put it at -10000, -10000 in "flipped coordinates", since WebCore and the DOM use flipped coordinates. … … 777 778 adjustWebDocumentForStandardViewport(webBrowserView, scrollView); 778 779 #endif 779 780 780 781 #if !PLATFORM(IOS) 781 782 // For reasons that are not entirely clear, the following pair of calls makes WebView handle its … … 1129 1130 {nullptr, 0, nullptr, 0} 1130 1131 }; 1131 1132 1132 1133 int option; 1133 1134 while ((option = getopt_long(argc, (char * const *)argv, "", options, nullptr)) != -1) { … … 1212 1213 activateFontsIOS(); 1213 1214 #endif 1214 1215 1215 1216 allocateGlobalControllers(); 1216 1217 1217 1218 #if PLATFORM(MAC) 1218 1219 NSActivityOptions options = (NSActivityUserInitiatedAllowingIdleSystemSleep | NSActivityLatencyCritical) & ~(NSActivitySuddenTerminationDisabled | NSActivityAutomaticTerminationDisabled); … … 1257 1258 [NSSound _setAlertType:0]; 1258 1259 #endif 1259 1260 WebView *webView = createWebViewAndOffscreenWindow();1261 mainFrame = [webView mainFrame];1262 1260 1263 1261 [[NSURLCache sharedURLCache] removeAllCachedResponses]; … … 1285 1283 stopJavaScriptThreads(); 1286 1284 1287 destroyWebViewAndOffscreenWindow( webView);1288 1285 destroyWebViewAndOffscreenWindow([mainFrame webView]); 1286 1289 1287 releaseGlobalControllers(); 1290 1288 1291 1289 #if !PLATFORM(IOS) 1292 1290 [DumpRenderTreePasteboard releaseLocalPasteboards]; … … 1407 1405 { 1408 1406 const vector<char>& dataVector = gTestRunner->audioResult(); 1409 1407 1410 1408 NSData *data = [NSData dataWithBytes:dataVector.data() length:dataVector.size()]; 1411 1409 return data; … … 1421 1419 for (int i = start; i < indent; i++) 1422 1420 putchar(' '); 1423 1421 1424 1422 NSString *urlString = [item URLString]; 1425 1423 if ([[NSURL URLWithString:urlString] isFileURL]) { … … 1427 1425 urlString = [@"(file test):" stringByAppendingString:[urlString substringFromIndex:(range.length + range.location)]]; 1428 1426 } 1429 1427 1430 1428 printf("%s", [urlString UTF8String]); 1431 1429 NSString *target = [item target]; … … 1552 1550 [itemsToPrint addObject:item]; 1553 1551 } 1554 1552 1555 1553 assert([bfList currentItem] != prevTestBFItem); 1556 1554 [itemsToPrint addObject:[bfList currentItem]]; … … 1811 1809 1812 1810 [WebCache clearCachedCredentials]; 1813 1811 1814 1812 resetWebPreferencesToConsistentValues(); 1815 1813 setWebPreferencesForTestOptions(options); 1814 #if PLATFORM(MAC) 1815 [webView setWantsLayer:options.layerBackedWebView]; 1816 #endif 1816 1817 1817 1818 TestRunner::setSerializeHTTPLoads(false); … … 1846 1847 [[MockGeolocationProvider shared] stopTimer]; 1847 1848 [[MockWebNotificationProvider shared] reset]; 1848 1849 1849 1850 #if !PLATFORM(IOS) 1850 1851 // Clear the contents of the general pasteboard … … 1880 1881 1881 1882 WebThreadLock(); 1882 1883 1883 1884 dispatch_release(delegateSemaphore); 1884 1885 } … … 1950 1951 1951 1952 TestOptions options(url, command); 1953 if (!mainFrameTestOptions || !options.webViewIsCompatibleWithOptions(mainFrameTestOptions.value())) { 1954 if (mainFrame) 1955 destroyWebViewAndOffscreenWindow([mainFrame webView]); 1956 WebView *pristineWebView = createWebViewAndOffscreenWindow(); 1957 mainFrame = [pristineWebView mainFrame]; 1958 } 1959 mainFrameTestOptions = options; 1960 1952 1961 resetWebViewToConsistentStateBeforeTesting(options); 1953 1962 … … 2057 2066 if (window == [[mainFrame webView] window]) 2058 2067 continue; 2059 2068 2060 2069 #if !PLATFORM(IOS) 2061 2070 WebView *webView = [[[window contentView] subviews] objectAtIndex:0];
Note: See TracChangeset
for help on using the changeset viewer.