Changeset 152433 in webkit
- Timestamp:
- Jul 5, 2013 7:19:41 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r152430 r152433 1 2013-07-05 Tim Horton <timothy_horton@apple.com> 2 3 Fix r152265: FrameView's pagination mode is only one of two, and the logic was totally wrong 4 https://bugs.webkit.org/show_bug.cgi?id=118439 5 <rdar://problem/14366120> 6 7 Reviewed by Anders Carlsson. 8 9 * page/FrameView.cpp: 10 (WebCore::FrameView::maximumScrollPosition): 11 - Test both Page and FrameView's pagination modes. 12 - *Don't* clamp negatives to zero if we are paginated with scroll offset set, 13 like the original changelog claimed, but the code did the opposite. 14 - Don't clamp in *all* pagination modes; with 'direction: RTL' it's still possible 15 to have a negative maximum position in LTR/TB pagination modes. 16 1 17 2013-07-05 Sam Weinig <sam@webkit.org> 2 18 -
trunk/Source/WebCore/page/FrameView.cpp
r152425 r152433 1654 1654 IntPoint maximumOffset(contentsWidth() - visibleWidth() - scrollOrigin().x(), totalContentsSize().height() - visibleHeight() - scrollOrigin().y()); 1655 1655 1656 // With reverse pagination modes, we can have a negative maximum scroll position. 1657 if (m_pagination.mode == Pagination::BottomToTopPaginated 1658 || m_pagination.mode == Pagination::RightToLeftPaginated 1656 // With pagination enabled, we can have a negative maximum scroll position. 1657 if ((m_frame->page()->pagination().mode == Pagination::Unpaginated && m_pagination.mode == Pagination::Unpaginated) 1659 1658 || scrollOrigin() == IntPoint::zero()) 1660 1659 maximumOffset.clampNegativeToZero(); -
trunk/Tools/ChangeLog
r152425 r152433 1 2013-07-05 Tim Horton <timothy_horton@apple.com> 2 3 Fix r152265: FrameView's pagination mode is only one of two, and the logic was totally wrong 4 https://bugs.webkit.org/show_bug.cgi?id=118439 5 <rdar://problem/14366120> 6 7 Reviewed by Anders Carlsson. 8 9 * TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp: 10 (TestWebKitAPI::didLayout): 11 (TestWebKitAPI::TEST): 12 - Make use of EXPECT_JS_EQ instead of manually doing JavaScript stuff. 13 - Assert that we got the right number of pages for sanity. 14 - Reduce the page gap size so that DrawingAreaImpl doesn't try to allocate 15 so much memory that SharedMemory asserts and makes the test time out. 16 - Use didFirstLayoutAfterSuppressedIncrementalRendering instead of Paint 17 because paint doesn't fire if the window is offscreen. 18 1 19 2013-07-05 Tim Horton <timothy_horton@apple.com> 2 20 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp
r152265 r152433 25 25 26 26 #include "config.h" 27 #include "JavaScriptTest.h" 27 28 #include "PlatformUtilities.h" 28 29 #include "PlatformWebView.h" … … 38 39 39 40 static const unsigned pageLength = 100; 40 static const unsigned pageGap = 1000; 41 42 static void didRunJavaScript(WKSerializedScriptValueRef resultSerializedScriptValue, WKErrorRef error, void* context) 43 { 44 JSGlobalContextRef scriptContext = JSGlobalContextCreate(0); 45 ASSERT_NOT_NULL(scriptContext); 46 47 ASSERT_NOT_NULL(resultSerializedScriptValue); 48 JSValueRef returnValue = WKSerializedScriptValueDeserialize(resultSerializedScriptValue, scriptContext, 0); 49 double scrollPosition = JSValueToNumber(scriptContext, returnValue, 0); 50 51 ASSERT_EQ(-20900.0, scrollPosition); 52 53 testDone = true; 54 } 41 static const unsigned pageGap = 100; 42 static const unsigned expectedPageCount = 20; 55 43 56 44 static void didLayout(WKPageRef page, WKLayoutMilestones milestones, WKTypeRef, const void* clientInfo) 57 45 { 58 if (milestones & kWKDidFirst PaintAfterSuppressedIncrementalRendering) {46 if (milestones & kWKDidFirstLayoutAfterSuppressedIncrementalRendering) { 59 47 PlatformWebView* webView = (PlatformWebView*)clientInfo; 48 60 49 unsigned pageCount = WKPageGetPageCount(page); 50 EXPECT_EQ(expectedPageCount, pageCount); 51 61 52 webView->resizeTo((pageLength * pageCount) + (pageGap * (pageCount - 1)), 500); 53 EXPECT_JS_EQ(page, "window.scrollX", "-3800"); 62 54 63 WKRetainPtr<WKStringRef> javaScriptString(AdoptWK, WKStringCreateWithUTF8CString("window.scrollX")); 64 WKPageRunJavaScriptInMainFrame(page, javaScriptString.get(), 0, didRunJavaScript); 55 testDone = true; 65 56 } 66 57 } … … 79 70 WKPageSetPageLoaderClient(webView.page(), &loaderClient); 80 71 81 WKPageListenForLayoutMilestones(webView.page(), kWKDidFirst PaintAfterSuppressedIncrementalRendering);72 WKPageListenForLayoutMilestones(webView.page(), kWKDidFirstLayoutAfterSuppressedIncrementalRendering); 82 73 83 74 WKPageGroupRef pageGroup = WKPageGetPageGroup(webView.page());
Note: See TracChangeset
for help on using the changeset viewer.