Changeset 204931 in webkit


Ignore:
Timestamp:
Aug 24, 2016, 1:53:30 PM (9 years ago)
Author:
Simon Fraser
Message:

[iOS DRT] Get basic viewport tests working in DRT
https://bugs.webkit.org/show_bug.cgi?id=161160

Reviewed by Tim Horton.

Tools:

Hook up enough of UIScriptController in iOS DRT to be able to read viewport
scale, and get the contentVisibleRect.

Requires exposing a bit of UIWebBrowserView SPI from UIKit, which in turn
requires typing the gWebBrowserView as a DumpRenderTreeBrowserView * everywhere.

One test has different results between DRT and WTR, but DRT behavior seems to differ
from UIWebView here, so just give it a WK1-specific result.

  • DumpRenderTree/ios/DumpRenderTreeBrowserView.h:
  • DumpRenderTree/ios/DumpRenderTreeBrowserView.mm:

(-[DumpRenderTreeBrowserView documentVisibleRect]):

  • DumpRenderTree/ios/PixelDumpSupportIOS.mm:
  • DumpRenderTree/ios/UIScriptControllerIOS.mm:

(WTR::UIScriptController::zoomScale):
(WTR::UIScriptController::minimumZoomScale):
(WTR::UIScriptController::maximumZoomScale):
(WTR::UIScriptController::contentVisibleRect):

  • DumpRenderTree/mac/DumpRenderTree.mm:

(createWebViewAndOffscreenWindow):

  • DumpRenderTree/mac/DumpRenderTreeMac.h:

LayoutTests:

Enable some fast/viewport/ios/ tests for ios-simulator-wk1 that work now.

"body-overflow-hidden" tests should pass everywhere now since the behavior of overflow:hidden
on the body was reverted.

  • fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-expected.txt:
  • fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall-expected.txt:
  • fast/viewport/ios/width-is-device-width-overflowing-expected.txt:
  • platform/ios-simulator-wk1/TestExpectations:
  • platform/ios-simulator-wk1/fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall-expected.txt: Renamed from LayoutTests/platform/ios-simulator/fast/viewport/ios/width-is-device-width-overflowing-expected.txt.
  • platform/ios-simulator-wk2/TestExpectations:
  • platform/ios-simulator/fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-expected.txt: Removed.
  • platform/ios-simulator/fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall-expected.txt: Removed.
Location:
trunk
Files:
2 added
2 deleted
13 edited
1 moved

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/LayoutTests/ChangeLog

    r204927 r204931  
     12016-08-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS DRT] Get basic viewport tests working in DRT
     4        https://bugs.webkit.org/show_bug.cgi?id=161160
     5
     6        Reviewed by Tim Horton.
     7       
     8        Enable some fast/viewport/ios/ tests for ios-simulator-wk1 that work now.
     9       
     10        "body-overflow-hidden" tests should pass everywhere now since the behavior of overflow:hidden
     11        on the body was reverted.
     12
     13        * fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-expected.txt:
     14        * fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall-expected.txt:
     15        * fast/viewport/ios/width-is-device-width-overflowing-expected.txt:
     16        * platform/ios-simulator-wk1/TestExpectations:
     17        * platform/ios-simulator-wk1/fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall-expected.txt: Renamed from LayoutTests/platform/ios-simulator/fast/viewport/ios/width-is-device-width-overflowing-expected.txt.
     18        * platform/ios-simulator-wk2/TestExpectations:
     19        * platform/ios-simulator/fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-expected.txt: Removed.
     20        * platform/ios-simulator/fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall-expected.txt: Removed.
     21
    1222016-08-24  Ryan Haddad  <ryanhaddad@apple.com>
    223
  • TabularUnified trunk/LayoutTests/fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-expected.txt

    r190808 r204931  
    11Viewport: width=device-width
    22
    3 scale   5.00000
     3scale   1.00000
    44maxScale        5.00000
    5 minScale        5.00000
    6 visibleRect     {"left":"0.00000","top":"0.00000","width":"64.00000","height":"96.00000"}
     5minScale        1.00000
     6visibleRect     {"left":"0.00000","top":"0.00000","width":"320.00000","height":"568.00000"}
    77
  • TabularUnified trunk/LayoutTests/fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall-expected.txt

    r190260 r204931  
    11Viewport: width=device-width
    22
    3 scale   1.05263
     3scale   0.55469
    44maxScale        5.00000
    5 minScale        1.05263
    6 visibleRect     {"left":"0.00000","top":"0.00000","width":"303.99999","height":"455.99998"}
     5minScale        0.55469
     6visibleRect     {"left":"0.00000","top":"0.00000","width":"576.90143","height":"1024.00000"}
    77
  • TabularUnified trunk/LayoutTests/fast/viewport/ios/width-is-device-width-overflowing-expected.txt

    r194246 r204931  
    44maxScale        5.00000
    55minScale        1.00000
    6 visibleRect     {"left":"0.00000","top":"0.00000","width":"320.00000","height":"480.00000"}
     6visibleRect     {"left":"0.00000","top":"0.00000","width":"320.00000","height":"568.00000"}
    77
  • TabularUnified trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations

    r204926 r204931  
    22#
    33# See http://trac.webkit.org/wiki/TestExpectations for more information on this file.
     4
     5# Selectively re-enable viewport tests that work
     6fast/viewport/ios/width-is-device-width.html [ Pass ]
     7fast/viewport/ios/width-is-device-width-overflowing.html [ Pass ]
     8fast/viewport/ios/width-is-device-width-overflowing-no-shrink-to-fit.html [ Pass ]
     9fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden.html [ Pass ]
     10fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall.html [ Pass ]
     11fast/viewport/ios/ipad/width-is-device-width.html [ Pass ]
    412
    513# <rdar://problem/6501130> LayoutTests: Enable editing tests after we support editing
  • TabularUnified trunk/LayoutTests/platform/ios-simulator-wk1/fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall-expected.txt

    r204930 r204931  
    44maxScale        5.00000
    55minScale        1.00000
    6 visibleRect     {"left":"0.00000","top":"0.00000","width":"320.00000","height":"480.00000"}
     6visibleRect     {"left":"0.00000","top":"0.00000","width":"320.00000","height":"568.00000"}
    77
  • TabularUnified trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations

    r204926 r204931  
    17701770# Forcing always allow user scalable is not supported on certain OS version.
    17711771webkit.org/b/155056 fast/viewport/ios/force-always-user-scalable.html [ Skip ]
    1772 webkit.org/b/153110 fast/viewport/ios/width-is-device-width-overflowing.html [ Pass Failure ]
    1773 webkit.org/b/153110 fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden.html [ Pass Failure ]
    1774 webkit.org/b/153110 fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall.html [ Pass Failure ]
    1775 fast/viewport/ios/width-is-device-width.html [ Pass ]
    1776 fast/viewport/ios/width-is-device-width-overflowing-no-shrink-to-fit.html [ Pass ]
    17771772
    17781773webkit.org/b/155501 animations/3d/transform-origin-vs-functions.html [ Pass Failure ]
  • TabularUnified trunk/Tools/ChangeLog

    r204930 r204931  
     12016-08-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS DRT] Get basic viewport tests working in DRT
     4        https://bugs.webkit.org/show_bug.cgi?id=161160
     5
     6        Reviewed by Tim Horton.
     7       
     8        Hook up enough of UIScriptController in iOS DRT to be able to read viewport
     9        scale, and get the contentVisibleRect.
     10       
     11        Requires exposing a bit of UIWebBrowserView SPI from UIKit, which in turn
     12        requires typing the gWebBrowserView as a DumpRenderTreeBrowserView * everywhere.
     13       
     14        One test has different results between DRT and WTR, but DRT behavior seems to differ
     15        from UIWebView here, so just give it a WK1-specific result.
     16
     17        * DumpRenderTree/ios/DumpRenderTreeBrowserView.h:
     18        * DumpRenderTree/ios/DumpRenderTreeBrowserView.mm:
     19        (-[DumpRenderTreeBrowserView documentVisibleRect]):
     20        * DumpRenderTree/ios/PixelDumpSupportIOS.mm:
     21        * DumpRenderTree/ios/UIScriptControllerIOS.mm:
     22        (WTR::UIScriptController::zoomScale):
     23        (WTR::UIScriptController::minimumZoomScale):
     24        (WTR::UIScriptController::maximumZoomScale):
     25        (WTR::UIScriptController::contentVisibleRect):
     26        * DumpRenderTree/mac/DumpRenderTree.mm:
     27        (createWebViewAndOffscreenWindow):
     28        * DumpRenderTree/mac/DumpRenderTreeMac.h:
     29
    1302016-08-24  Simon Fraser  <simon.fraser@apple.com>
    231
  • TabularUnified trunk/Tools/DumpRenderTree/ios/DumpRenderTreeBrowserView.h

    r178080 r204931  
    3434
    3535@end
     36
     37@interface DumpRenderTreeBrowserView (DRTTesting)
     38
     39- (CGRect)documentVisibleRect;
     40
     41@end
  • TabularUnified trunk/Tools/DumpRenderTree/ios/DumpRenderTreeBrowserView.mm

    r162817 r204931  
    2424 */
    2525
     26#import "config.h"
    2627#import "DumpRenderTreeBrowserView.h"
    2728
     
    3233@interface UIWebBrowserView (WebUIKitDelegate)
    3334- (BOOL)webView:(WebView *)webView shouldScrollToPoint:(CGPoint)point forFrame:(WebFrame *)frame;
     35@end
     36
     37@interface UIWebBrowserView (UIKitInternals)
     38- (CGRect)_documentViewVisibleRect;
    3439@end
    3540
     
    7479@end
    7580
     81@implementation DumpRenderTreeBrowserView (DRTTesting)
     82
     83- (CGRect)documentVisibleRect
     84{
     85    return [self _documentViewVisibleRect];
     86}
     87
     88@end
     89
    7690#endif // PLATFORM(IOS)
  • TabularUnified trunk/Tools/DumpRenderTree/ios/PixelDumpSupportIOS.mm

    r202411 r204931  
    4747
    4848extern DumpRenderTreeWindow *gDrtWindow;
    49 extern UIWebBrowserView *gWebBrowserView;
     49extern DumpRenderTreeBrowserView *gWebBrowserView;
    5050
    5151PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool incrementalRepaint, bool sweepHorizontally, bool drawSelectionRect)
  • TabularUnified trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm

    r204877 r204931  
    2929#if PLATFORM(IOS)
    3030
     31#import "DumpRenderTreeBrowserView.h"
    3132#import "UIScriptContext.h"
     33#import <WebCore/FloatRect.h>
     34
     35extern DumpRenderTreeBrowserView *gWebBrowserView;
     36extern UIWebScrollView *gWebScrollView;
    3237
    3338namespace WTR {
     
    5055double UIScriptController::zoomScale() const
    5156{
    52     return 1;
     57    return gWebScrollView.zoomScale;
    5358}
    5459
     
    107112double UIScriptController::minimumZoomScale() const
    108113{
    109     return 1;
     114    return gWebScrollView.minimumZoomScale;
    110115}
    111116
    112117double UIScriptController::maximumZoomScale() const
    113118{
    114     return 1;
     119    return gWebScrollView.maximumZoomScale;
    115120}
    116121
    117122JSObjectRef UIScriptController::contentVisibleRect() const
    118123{
    119     return nullptr;
     124    CGRect contentVisibleRect = [gWebBrowserView documentVisibleRect];
     125    WebCore::FloatRect rect(contentVisibleRect.origin.x, contentVisibleRect.origin.y, contentVisibleRect.size.width, contentVisibleRect.size.height);
     126    return m_context->objectFromRect(rect);
    120127}
    121128
  • TabularUnified trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r204929 r204931  
    222222#if PLATFORM(IOS)
    223223const CGRect layoutTestViewportRect = { {0, 0}, {static_cast<CGFloat>(TestRunner::viewWidth), static_cast<CGFloat>(TestRunner::viewHeight)} };
    224 UIWebBrowserView *gWebBrowserView = nil;
     224DumpRenderTreeBrowserView *gWebBrowserView = nil;
    225225UIWebScrollView *gWebScrollView = nil;
    226226DumpRenderTreeWindow *gDrtWindow = nil;
     
    759759    WebView *webView = [[WebView alloc] initWithFrame:rect frameName:nil groupName:@"org.webkit.DumpRenderTree"];
    760760#else
    761     UIWebBrowserView *webBrowserView = [[[DumpRenderTreeBrowserView alloc] initWithFrame:layoutTestViewportRect] autorelease];
     761    DumpRenderTreeBrowserView *webBrowserView = [[[DumpRenderTreeBrowserView alloc] initWithFrame:layoutTestViewportRect] autorelease];
    762762    [webBrowserView setInputViewObeysDOMFocus:YES];
    763763    WebView *webView = [[webBrowserView webView] retain];
  • TabularUnified trunk/Tools/DumpRenderTree/mac/DumpRenderTreeMac.h

    r202034 r204931  
    7070@end
    7171
    72 @class UIWebBrowserView;
    73 extern UIWebBrowserView *gWebBrowserView;
     72@class DumpRenderTreeBrowserView;
     73extern DumpRenderTreeBrowserView *gWebBrowserView;
    7474#endif
    7575
Note: See TracChangeset for help on using the changeset viewer.