Changeset 199200 in webkit
- Timestamp:
- Apr 7, 2016 4:14:25 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r199199 r199200 1 2016-04-07 Simon Fraser <simon.fraser@apple.com> 2 3 Make it possible to test effect of view exposed rect on tiled backing 4 https://bugs.webkit.org/show_bug.cgi?id=156365 5 6 Reviewed by Tim Horton. 7 8 Tests for tile size and tile coverage when we have an exposed view rect. 9 10 * tiled-drawing/tile-coverage-view-exposed-rect-expected.txt: Added. 11 * tiled-drawing/tile-coverage-view-exposed-rect.html: Added. 12 * tiled-drawing/tile-size-view-exposed-rect-expected.txt: Added. 13 * tiled-drawing/tile-size-view-exposed-rect.html: Added. 14 1 15 2016-04-07 Jiewen Tan <jiewen_tan@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r199199 r199200 1 2016-04-07 Simon Fraser <simon.fraser@apple.com> 2 3 Make it possible to test effect of view exposed rect on tiled backing 4 https://bugs.webkit.org/show_bug.cgi?id=156365 5 6 Reviewed by Tim Horton. 7 8 Implement Internals::setViewExposedRect(). 9 10 When the viewExposedRect is non-null, assume that we're scrollable on both axes 11 to avoid creation of huge tiles in this scenario. 12 13 We also need to call adjustTiledBackingScrollability() when setViewExposedRect() 14 has been called. 15 16 Tests: tiled-drawing/tile-coverage-view-exposed-rect.html 17 tiled-drawing/tile-size-view-exposed-rect.html 18 19 * page/FrameView.cpp: 20 (WebCore::FrameView::adjustTiledBackingScrollability): 21 (WebCore::FrameView::setViewExposedRect): 22 * testing/Internals.cpp: 23 (WebCore::Internals::setViewExposedRect): 24 * testing/Internals.h: 25 * testing/Internals.idl: 26 1 27 2016-04-07 Jiewen Tan <jiewen_tan@apple.com> 2 28 -
trunk/Source/WebCore/page/FrameView.cpp
r199155 r199200 2484 2484 bool horizontallyScrollable; 2485 2485 bool verticallyScrollable; 2486 bool clippedByAncestorView = static_cast<bool>(m_viewExposedRect); 2486 2487 2487 2488 if (delegatesScrolling()) { … … 2489 2490 IntSize visibleSize = this->visibleSize(); 2490 2491 2491 horizontallyScrollable = documentSize.width() > visibleSize.width();2492 verticallyScrollable = documentSize.height() > visibleSize.height();2492 horizontallyScrollable = clippedByAncestorView || documentSize.width() > visibleSize.width(); 2493 verticallyScrollable = clippedByAncestorView || documentSize.height() > visibleSize.height(); 2493 2494 } else { 2494 horizontallyScrollable = horizontalScrollbar();2495 verticallyScrollable = verticalScrollbar();2495 horizontallyScrollable = clippedByAncestorView || horizontalScrollbar(); 2496 verticallyScrollable = clippedByAncestorView || verticalScrollbar(); 2496 2497 } 2497 2498 … … 4914 4915 return; 4915 4916 4917 LOG_WITH_STREAM(Scrolling, stream << "FrameView " << this << " setViewExposedRect " << (viewExposedRect ? viewExposedRect.value() : FloatRect())); 4918 4919 bool hasRectChanged = !m_viewExposedRect == !viewExposedRect; 4916 4920 m_viewExposedRect = viewExposedRect; 4917 4921 … … 4921 4925 4922 4926 if (TiledBacking* tiledBacking = this->tiledBacking()) { 4927 if (hasRectChanged) 4928 adjustTiledBackingScrollability(); 4923 4929 adjustTiledBackingCoverage(); 4924 4930 tiledBacking->setTiledScrollingIndicatorPosition(m_viewExposedRect ? m_viewExposedRect.value().location() : FloatPoint()); -
trunk/Source/WebCore/testing/Internals.cpp
r199076 r199200 2390 2390 } 2391 2391 2392 void Internals::setViewExposedRect(float x, float y, float width, float height, ExceptionCode& ec) 2393 { 2394 Document* document = contextDocument(); 2395 if (!document || !document->view()) { 2396 ec = INVALID_ACCESS_ERR; 2397 return; 2398 } 2399 2400 FrameView* frameView = document->view(); 2401 frameView->setViewExposedRect(FloatRect(x, y, width, height)); 2402 } 2403 2392 2404 void Internals::setHeaderHeight(float height) 2393 2405 { -
trunk/Source/WebCore/testing/Internals.h
r198859 r199200 304 304 void setUseFixedLayout(bool useFixedLayout, ExceptionCode&); 305 305 void setFixedLayoutSize(int width, int height, ExceptionCode&); 306 void setViewExposedRect(float left, float top, float width, float height, ExceptionCode&); 306 307 307 308 void setHeaderHeight(float); -
trunk/Source/WebCore/testing/Internals.idl
r198859 r199200 288 288 [RaisesException] void setFixedLayoutSize(long width, long height); 289 289 290 [RaisesException] void setViewExposedRect(unrestricted float x, unrestricted float y, unrestricted float width, unrestricted float height); 291 290 292 void setHeaderHeight(unrestricted float height); 291 293 void setFooterHeight(unrestricted float height); -
trunk/Tools/ChangeLog
r199180 r199200 1 2016-04-07 Simon Fraser <simon.fraser@apple.com> 2 3 Make it possible to test effect of view exposed rect on tiled backing 4 https://bugs.webkit.org/show_bug.cgi?id=156365 5 6 Reviewed by Tim Horton. 7 8 Expose testRunner.setViewSize() and internals.setViewExposedRect() to enable 9 testing of tile coverage when setViewExposedRect() is passed a non-null rectangle. 10 11 testRunner.setViewSize() is used instead of using window.resizeTo(), since we 12 can't easily resize a window to larger than the screen being tested on. 13 14 * DumpRenderTree/TestRunner.cpp: 15 (setViewSizeCallback): 16 (TestRunner::staticFunctions): 17 * DumpRenderTree/TestRunner.h: 18 * DumpRenderTree/mac/TestRunnerMac.mm: 19 (TestRunner::setViewSize): 20 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 21 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 22 (WTR::InjectedBundle::postSetViewSize): 23 * WebKitTestRunner/InjectedBundle/InjectedBundle.h: 24 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 25 (WTR::TestRunner::setViewSize): 26 * WebKitTestRunner/InjectedBundle/TestRunner.h: 27 * WebKitTestRunner/TestInvocation.cpp: 28 (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): 29 1 30 2016-04-07 Jason Marcell <jmarcell@apple.com> 2 31 -
trunk/Tools/DumpRenderTree/TestRunner.cpp
r191530 r199200 1382 1382 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 1383 1383 controller->setWindowIsKey(JSValueToBoolean(context, arguments[0])); 1384 1385 return JSValueMakeUndefined(context); 1386 } 1387 1388 static JSValueRef setViewSizeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 1389 { 1390 if (argumentCount < 2) 1391 return JSValueMakeUndefined(context); 1392 1393 double width = JSValueToNumber(context, arguments[0], exception); 1394 ASSERT(!*exception); 1395 double height = JSValueToNumber(context, arguments[1], exception); 1396 ASSERT(!*exception); 1397 1398 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 1399 controller->setViewSize(width, height); 1384 1400 1385 1401 return JSValueMakeUndefined(context); … … 2128 2144 { "setWillSendRequestReturnsNullOnRedirect", setWillSendRequestReturnsNullOnRedirectCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2129 2145 { "setWindowIsKey", setWindowIsKeyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2146 { "setViewSize", setViewSizeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2130 2147 { "setJavaScriptCanAccessClipboard", setJavaScriptCanAccessClipboardCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2131 2148 { "setXSSAuditorEnabled", setXSSAuditorEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/Tools/DumpRenderTree/TestRunner.h
r199081 r199200 260 260 void setWindowIsKey(bool); 261 261 262 void setViewSize(double width, double height); 263 262 264 bool alwaysAcceptCookies() const { return m_alwaysAcceptCookies; } 263 265 void setAlwaysAcceptCookies(bool); -
trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm
r197942 r199200 617 617 } 618 618 619 void TestRunner::setViewSize(double width, double height) 620 { 621 [[mainFrame webView] setFrameSize:NSMakeSize(width, height)]; 622 } 623 619 624 static void waitUntilDoneWatchdogFired(CFRunLoopTimerRef timer, void* info) 620 625 { -
trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp
r198501 r199200 895 895 } 896 896 897 void TestRunner::setViewSize(double width, double height) 898 { 899 COMPtr<IWebView> webView; 900 if (FAILED(frame->webView(&webView))) 901 return; 902 903 COMPtr<IWebViewPrivate2> viewPrivate; 904 if (FAILED(webView->QueryInterface(&viewPrivate))) 905 return; 906 907 HWND webViewWindow; 908 if (FAILED(viewPrivate->viewWindow(&webViewWindow))) 909 return; 910 911 ::SetWindowPos(webViewWindow, 0, 0, 0, width, height, SWP_NOMOVE); 912 } 913 897 914 static const CFTimeInterval waitToDumpWatchdogInterval = 30.0; 898 915 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r198955 r199200 149 149 void focusWebView(object callback); 150 150 151 void clearTestRunnerCallbacks(); 152 151 // Window/view state 153 152 void setBackingScaleFactor(double backingScaleFactor, object callback); 154 153 155 154 void setWindowIsKey(boolean isKey); 155 void setViewSize(double width, double height); 156 156 157 157 // Cookies testing … … 221 221 // UI Process Testing 222 222 void runUIScript(DOMString script, object callback); 223 224 void clearTestRunnerCallbacks(); 223 225 }; 224 226 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r199081 r199200 443 443 } 444 444 445 void InjectedBundle::postSetViewSize(double width, double height) 446 { 447 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetViewSize")); 448 449 WKRetainPtr<WKStringRef> widthKey(AdoptWK, WKStringCreateWithUTF8CString("width")); 450 WKRetainPtr<WKStringRef> heightKey(AdoptWK, WKStringCreateWithUTF8CString("height")); 451 452 WKRetainPtr<WKMutableDictionaryRef> messageBody(AdoptWK, WKMutableDictionaryCreate()); 453 454 WKRetainPtr<WKDoubleRef> widthWK(AdoptWK, WKDoubleCreate(width)); 455 WKDictionarySetItem(messageBody.get(), widthKey.get(), widthWK.get()); 456 457 WKRetainPtr<WKDoubleRef> heightWK(AdoptWK, WKDoubleCreate(height)); 458 WKDictionarySetItem(messageBody.get(), heightKey.get(), heightWK.get()); 459 460 WKBundlePagePostSynchronousMessageForTesting(page()->page(), messageName.get(), messageBody.get(), 0); 461 } 462 445 463 void InjectedBundle::postSimulateWebNotificationClick(uint64_t notificationID) 446 464 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
r197114 r199200 86 86 void postSetBackingScaleFactor(double); 87 87 void postSetWindowIsKey(bool); 88 void postSetViewSize(double width, double height); 88 89 void postSimulateWebNotificationClick(uint64_t notificationID); 89 90 void postSetAddsVisitedLinks(bool); -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r199081 r199200 624 624 } 625 625 626 void TestRunner::setViewSize(double width, double height) 627 { 628 InjectedBundle::singleton().postSetViewSize(width, height); 629 } 630 626 631 void TestRunner::callAddChromeInputFieldCallback() 627 632 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r199081 r199200 247 247 void setWindowIsKey(bool); 248 248 249 void setViewSize(double width, double height); 250 249 251 void callAddChromeInputFieldCallback(); 250 252 void callRemoveChromeInputFieldCallback(); -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r198955 r199200 666 666 } 667 667 668 if (WKStringIsEqualToUTF8CString(messageName, "SetViewSize")) { 669 ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID()); 670 671 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 672 WKRetainPtr<WKStringRef> widthKey(AdoptWK, WKStringCreateWithUTF8CString("width")); 673 WKRetainPtr<WKStringRef> heightKey(AdoptWK, WKStringCreateWithUTF8CString("height")); 674 675 WKDoubleRef widthWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, widthKey.get())); 676 WKDoubleRef heightWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, heightKey.get())); 677 678 TestController::singleton().mainWebView()->resizeTo(WKDoubleGetValue(widthWK), WKDoubleGetValue(heightWK)); 679 return nullptr; 680 } 681 668 682 if (WKStringIsEqualToUTF8CString(messageName, "IsGeolocationClientActive")) { 669 683 bool isActive = TestController::singleton().isGeolocationProviderActive();
Note: See TracChangeset
for help on using the changeset viewer.