Changeset 204929 in webkit
- Timestamp:
- Aug 24, 2016 1:53:22 PM (8 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r204918 r204929 1 2016-08-24 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS DRT] Make iOS DRT use the same window size as WebKitTestRunner for flexible viewport tests 4 https://bugs.webkit.org/show_bug.cgi?id=161124 5 6 Reviewed by Daniel Bates. 7 8 Use the main UIScreen's bounds for the size of the window in flexible viewport mode, 9 and remove the 'phoneBrowserAddressBarOffset' hack, so that it matches WTR. 10 11 Remove some unnecessary zero initializations of static variables. 12 13 Change _setVisibleSize to use the window size, which should not be a behavior change 14 because this it just used for text autosizing, which is disabled by default, 15 and only the width is consulted. 16 17 * DumpRenderTree/mac/DumpRenderTree.mm: 18 (adjustWebDocumentForFlexibleViewport): 19 (adjustWebDocumentForStandardViewport): 20 (createWebViewAndOffscreenWindow): 21 1 22 2016-08-24 Jonathan Bedard <jbedard@apple.com> 2 23 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r204912 r204929 178 178 volatile bool done; 179 179 180 NavigationController* gNavigationController = 0;180 NavigationController* gNavigationController = nullptr; 181 181 RefPtr<TestRunner> gTestRunner; 182 182 183 WebFrame *mainFrame = 0;183 WebFrame *mainFrame = nullptr; 184 184 // This is the topmost frame that is loading, during a given load, or nil when no load is 185 185 // in progress. Usually this is the same as the main frame, but not always. In the case 186 186 // where a frameset is loaded, and then new content is loaded into one of the child frames, 187 187 // that child frame is the "topmost frame that is loading". 188 WebFrame *topLoadingFrame = n il;// !nil iff a load is in progress189 190 191 CFMutableSetRef disallowedURLs = 0;192 static CFRunLoopTimerRef waitToDumpWatchdog = 0;188 WebFrame *topLoadingFrame = nullptr; // !nil iff a load is in progress 189 190 191 CFMutableSetRef disallowedURLs= nullptr; 192 static CFRunLoopTimerRef waitToDumpWatchdog; 193 193 194 194 // Delegates … … 198 198 static ResourceLoadDelegate *resourceLoadDelegate; 199 199 static HistoryDelegate *historyDelegate; 200 PolicyDelegate *policyDelegate ;201 DefaultPolicyDelegate *defaultPolicyDelegate ;200 PolicyDelegate *policyDelegate = nullptr; 201 DefaultPolicyDelegate *defaultPolicyDelegate = nullptr; 202 202 #if PLATFORM(IOS) 203 203 static ScrollViewResizerDelegate *scrollViewResizerDelegate; 204 204 #endif 205 205 206 static int dumpPixelsForAllTests = NO;207 static bool dumpPixelsForCurrentTest = false;206 static int dumpPixelsForAllTests; 207 static bool dumpPixelsForCurrentTest; 208 208 static int threaded; 209 209 static int dumpTree = YES; … … 212 212 static int useAcceleratedDrawing; 213 213 static int gcBetweenTests; 214 static int showWebView = NO;215 static int printTestCount = NO;214 static int showWebView; 215 static int printTestCount; 216 216 static BOOL printSeparators; 217 217 static RetainPtr<CFStringRef> persistentUserStyleSheetLocation; 218 218 static std::set<std::string> allowedHosts; 219 219 220 static WebHistoryItem *prevTestBFItem = nil;// current b/f item at the end of the previous test220 static WebHistoryItem *prevTestBFItem; // current b/f item at the end of the previous test 221 221 222 222 #if PLATFORM(IOS) 223 const unsigned phoneViewHeight = 480;224 const unsigned phoneViewWidth = 320;225 const unsigned phoneBrowserScrollViewHeight = 416;226 const unsigned phoneBrowserAddressBarOffset = 60;227 223 const CGRect layoutTestViewportRect = { {0, 0}, {static_cast<CGFloat>(TestRunner::viewWidth), static_cast<CGFloat>(TestRunner::viewHeight)} }; 228 224 UIWebBrowserView *gWebBrowserView = nil; … … 647 643 648 644 #if PLATFORM(IOS) 649 void adjustWebDocumentForFlexibleViewport(UIWebBrowserView *webBrowserView, UIWebScrollView *scrollView)645 static void adjustWebDocumentForFlexibleViewport(UIWebBrowserView *webBrowserView, UIWebScrollView *scrollView) 650 646 { 651 647 // These values match MobileSafari's, see -[TabDocument _createDocumentView]. … … 660 656 [webBrowserView setDelegate:scrollViewResizerDelegate]; 661 657 662 CGRect viewportRect = CGRectMake(0, 0, phoneViewWidth, phoneBrowserScrollViewHeight); 658 CGRect screenBounds = [UIScreen mainScreen].bounds; 659 CGRect viewportRect = CGRectMake(0, 0, screenBounds.size.width, screenBounds.size.height); 660 663 661 [scrollView setBounds:viewportRect]; 664 662 [scrollView setFrame:viewportRect]; … … 666 664 [webBrowserView setMinimumSize:viewportRect.size]; 667 665 [webBrowserView setAutoresizes:YES]; 668 CGRect browserViewFrame = [webBrowserView frame]; 669 browserViewFrame.origin = CGPointMake(0, phoneBrowserAddressBarOffset); 670 [webBrowserView setFrame:browserViewFrame]; 671 } 672 673 void adjustWebDocumentForStandardViewport(UIWebBrowserView *webBrowserView, UIWebScrollView *scrollView) 666 [webBrowserView setFrame:screenBounds]; 667 668 // This just affects text autosizing. 669 [mainFrame _setVisibleSize:CGSizeMake(screenBounds.size.width, screenBounds.size.height)]; 670 } 671 672 static void adjustWebDocumentForStandardViewport(UIWebBrowserView *webBrowserView, UIWebScrollView *scrollView) 674 673 { 675 674 [webBrowserView setMinimumScale:1.0f forDocumentTypes:UIEveryDocumentMask]; … … 685 684 [webBrowserView setMinimumSize:layoutTestViewportRect.size]; 686 685 [webBrowserView setAutoresizes:NO]; 687 CGRect browserViewFrame = [webBrowserView frame]; 688 browserViewFrame.origin = CGPointZero; 689 [webBrowserView setFrame:browserViewFrame]; 686 [webBrowserView setFrame:layoutTestViewportRect]; 687 688 // This just affects text autosizing. 689 [mainFrame _setVisibleSize:CGSizeMake(layoutTestViewportRect.size.width, layoutTestViewportRect.size.height)]; 690 690 691 } 691 692 #endif … … 844 845 [webView cacheDisplayInRect:[webView bounds] toBitmapImageRep:imageRep]; 845 846 #else 846 [[webView mainFrame] _setVisibleSize:CGSizeMake(phoneViewWidth, phoneViewHeight)];847 847 [[webView preferences] _setTelephoneNumberParsingEnabled:NO]; 848 848
Note: See TracChangeset
for help on using the changeset viewer.