Changeset 254042 in webkit


Ignore:
Timestamp:
Jan 5, 2020 9:58:09 AM (4 years ago)
Author:
Simon Fraser
Message:

Source/WebCore/PAL:
DumpRenderTree doesn't always call updateRendering() when a test completes
https://bugs.webkit.org/show_bug.cgi?id=205761

Reviewed by Darin Adler.

Add -[CATransaction synchronize].

  • pal/spi/cocoa/QuartzCoreSPI.h:

Source/WebKit:
DumpRenderTree doesn't always call updateRendering() when a test completes
https://bugs.webkit.org/show_bug.cgi?id=205761

Reviewed by Darin Adler.

Use the QuartzCore SPI header.

  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

Source/WebKitLegacy/mac:
Fix a souce of WebKit1 test flakiness
https://bugs.webkit.org/show_bug.cgi?id=205761

Reviewed by Darin Adler.

Some animation tests (and possibly many others) are flakey or broken in WK1 because
there was no code to guarantee that Page::updateRendering() was called at notifyDone()
time.

WK2 calls DrawingArea::forceRepaint(), which does updateRendering(), flushes layers,
and flushes a CATransaction.

In WK1, we historically relied in AppKit to call -viewWillDraw on WebView and/or WebHTMLView,
and just called [webView display] to make this happen. However, with layer backing, AppKit behavior
changes, and WebCore changes that make more things happen with HTML event loop timing, this
approach no longer works. The fix is to add WebView SPI, _forceRepaintForTesting, which emulates what
WK2 is doing.

  • WebView/WebView.mm:

(-[WebView _forceRepaintForTesting]):

  • WebView/WebViewPrivate.h:

Tools:
DumpRenderTree doesn't always call updateRendering() when a test completes
https://bugs.webkit.org/show_bug.cgi?id=205761

Reviewed by Darin Adler.

Some animation tests (and possibly many others) are flakey or broken in WK1 because
there was no code to guarantee that Page::updateRendering() was called at notifyDone()
time.

WK2 calls DrawingArea::forceRepaint(), which does updateRendering(), flushes layers,
and flushes a CATransaction.

In WK1, we historically relied in AppKit to call -viewWillDraw on WebView and/or WebHTMLView,
and just called [webView display] to make this happen. However, with layer backing, AppKit behavior
changes, and WebCore changes that make more things happen with HTML event loop timing, this
approach no longer works. The fix is to add WebView SPI, _forceRepaintForTesting, which emulates what
WK2 is doing.

  • DumpRenderTree/mac/DumpRenderTree.mm:

(updateDisplay):

  • DumpRenderTree/mac/PixelDumpSupportMac.mm:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r254014 r254042  
    810810# No support for reftest-wait in DRT.
    811811imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/range-setattribute-value.html [ ImageOnlyFailure ]
     812imported/w3c/web-platform-tests/css/css-display/display-none-inline-img.html [ ImageOnlyFailure ]
    812813
    813814# <rdar://problem/42625657> REGRESSION (Mojave): 12 fast/images tests timing out on WK1
  • trunk/Source/WebCore/PAL/ChangeLog

    r253834 r254042  
     12020-01-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        DumpRenderTree doesn't always call updateRendering() when a test completes
     4        https://bugs.webkit.org/show_bug.cgi?id=205761
     5
     6        Reviewed by Darin Adler.
     7       
     8        Add -[CATransaction synchronize].
     9
     10        * pal/spi/cocoa/QuartzCoreSPI.h:
     11
    1122019-12-20  Alex Christensen  <achristensen@webkit.org>
    213
  • trunk/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h

    r250310 r254042  
    142142+ (void)addCommitHandler:(void(^)(void))block forPhase:(CATransactionPhase)phase;
    143143+ (CATransactionPhase)currentPhase;
     144+ (void)synchronize;
    144145@end
    145146
  • trunk/Source/WebKit/ChangeLog

    r254033 r254042  
     12020-01-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        DumpRenderTree doesn't always call updateRendering() when a test completes
     4        https://bugs.webkit.org/show_bug.cgi?id=205761
     5
     6        Reviewed by Darin Adler.
     7
     8        Use the QuartzCore SPI header.
     9
     10        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     11
    1122020-01-04  Keith Rollin  <krollin@apple.com>
    213
  • trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r253689 r254042  
    6767#endif
    6868
    69 @interface CATransaction (Details)
    70 + (void)synchronize;
    71 @end
    72 
    7369namespace WebKit {
    7470using namespace WebCore;
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r254029 r254042  
     12020-01-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix a souce of WebKit1 test flakiness
     4        https://bugs.webkit.org/show_bug.cgi?id=205761
     5
     6        Reviewed by Darin Adler.
     7
     8        Some animation tests (and possibly many others) are flakey or broken in WK1 because
     9        there was no code to guarantee that Page::updateRendering() was called at notifyDone()
     10        time.
     11       
     12        WK2 calls DrawingArea::forceRepaint(), which does updateRendering(), flushes layers,
     13        and flushes a CATransaction.
     14
     15        In WK1, we historically relied in AppKit to call -viewWillDraw on WebView and/or WebHTMLView,
     16        and just called [webView display] to make this happen. However, with layer backing, AppKit behavior
     17        changes, and WebCore changes that make more things happen with HTML event loop timing, this
     18        approach no longer works. The fix is to add WebView SPI, _forceRepaintForTesting, which emulates what
     19        WK2 is doing.
     20
     21        * WebView/WebView.mm:
     22        (-[WebView _forceRepaintForTesting]):
     23        * WebView/WebViewPrivate.h:
     24
    1252020-01-03  Chris Dumez  <cdumez@apple.com>
    226
  • trunk/Source/WebKitLegacy/mac/WebView/WebView.mm

    r253834 r254042  
    233233#import <pal/spi/cocoa/NSURLDownloadSPI.h>
    234234#import <pal/spi/cocoa/NSURLFileTypeMappingsSPI.h>
     235#import <pal/spi/cocoa/QuartzCoreSPI.h>
    235236#import <pal/spi/mac/NSResponderSPI.h>
    236237#import <pal/spi/mac/NSSpellCheckerSPI.h>
     
    47694770}
    47704771
     4772- (void)_forceRepaintForTesting
     4773{
     4774#if PLATFORM(IOS_FAMILY)
     4775    // Ensure fixed positions layers are where they should be.
     4776    [self _synchronizeCustomFixedPositionLayoutRect];
     4777#endif
     4778
     4779    [self _viewWillDrawInternal];
     4780    [self _flushCompositingChanges];
     4781    [CATransaction flush];
     4782    [CATransaction synchronize];
     4783}
     4784
    47714785- (BOOL)allowsNewCSSAnimationsWhileSuspended
    47724786{
  • trunk/Source/WebKitLegacy/mac/WebView/WebViewPrivate.h

    r252254 r254042  
    818818// SPI for DumpRenderTree
    819819+ (void)_setLoadResourcesSerially:(BOOL)serialize;
     820- (void)_forceRepaintForTesting;
    820821
    821822/*!
  • trunk/Tools/ChangeLog

    r254024 r254042  
     12020-01-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        DumpRenderTree doesn't always call updateRendering() when a test completes
     4        https://bugs.webkit.org/show_bug.cgi?id=205761
     5
     6        Reviewed by Darin Adler.
     7       
     8        Some animation tests (and possibly many others) are flakey or broken in WK1 because
     9        there was no code to guarantee that Page::updateRendering() was called at notifyDone()
     10        time.
     11
     12        WK2 calls DrawingArea::forceRepaint(), which does updateRendering(), flushes layers,
     13        and flushes a CATransaction.
     14
     15        In WK1, we historically relied in AppKit to call -viewWillDraw on WebView and/or WebHTMLView,
     16        and just called [webView display] to make this happen. However, with layer backing, AppKit behavior
     17        changes, and WebCore changes that make more things happen with HTML event loop timing, this
     18        approach no longer works. The fix is to add WebView SPI, _forceRepaintForTesting, which emulates what
     19        WK2 is doing.
     20
     21        * DumpRenderTree/mac/DumpRenderTree.mm:
     22        (updateDisplay):
     23        * DumpRenderTree/mac/PixelDumpSupportMac.mm:
     24
    1252020-01-03  Tim Horton  <timothy_horton@apple.com>
    226
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r253093 r254042  
    9090#import <WebKit/WebResourceLoadDelegate.h>
    9191#import <WebKit/WebStorageManagerPrivate.h>
     92#import <WebKit/WebView.h>
    9293#import <WebKit/WebViewPrivate.h>
    9394#import <getopt.h>
     
    17221723    [webView _flushCompositingChanges];
    17231724#else
     1725    [webView _forceRepaintForTesting];
    17241726    if ([webView _isUsingAcceleratedCompositing])
    17251727        [webView display];
  • trunk/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm

    r249901 r254042  
    3838#import <QuartzCore/QuartzCore.h>
    3939#import <pal/spi/cg/CoreGraphicsSPI.h>
     40#import <pal/spi/cocoa/QuartzCoreSPI.h>
    4041#import <wtf/Assertions.h>
    4142#import <wtf/RefPtr.h>
     
    4647#import <WebKit/WebKit.h>
    4748#import <WebKit/WebViewPrivate.h>
    48 
    49 @interface CATransaction ()
    50 + (void)synchronize;
    51 @end
    5249
    5350@interface WebView ()
Note: See TracChangeset for help on using the changeset viewer.