Changeset 206247 in webkit
- Timestamp:
- Sep 21, 2016, 10:03:01 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r206238 r206247 1 2016-09-21 Dan Bernstein <mitz@apple.com> 2 3 [macOS] Upon layout, _webView:renderingProgressDidChange: fires before the intrinsic content size is updated 4 https://bugs.webkit.org/show_bug.cgi?id=162359 5 <rdar://problem/27776454> 6 7 Reviewed by Tim Horton. 8 9 Test: added to TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm 10 11 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: Fixed a bug where 12 m_pendingNewlyReachedLayoutMilestones was never initialized. 13 14 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Added 15 m_pendingNewlyReachedLayoutMilestones member variable to this derived class as well. 16 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 17 (WebKit::TiledCoreAnimationDrawingArea::flushLayers): If we have pending milestones, notify 18 the WebPageProxy now, after any content size changes have been sent. 19 (WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone): New override that 20 accumulates the milestones into m_pendingNewlyReachedLayoutMilestones and returns true, 21 so that the caller won’t notify the WebPageProxy immediately. 22 1 23 2016-09-21 Anders Carlsson <andersca@apple.com> 2 24 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
r204665 r206247 164 164 Vector<RemoteLayerTreeTransaction::TransactionCallbackID> m_pendingCallbackIDs; 165 165 166 WebCore::LayoutMilestones m_pendingNewlyReachedLayoutMilestones ;166 WebCore::LayoutMilestones m_pendingNewlyReachedLayoutMilestones { 0 }; 167 167 168 168 WebCore::GraphicsLayer* m_contentLayer; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
r202611 r206247 87 87 void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override; 88 88 89 bool dispatchDidReachLayoutMilestone(WebCore::LayoutMilestones) override; 90 89 91 // WebCore::LayerFlushSchedulerClient 90 92 bool flushLayers() override; … … 155 157 WebCore::IntSize m_lastViewSizeForScaleToFit; 156 158 WebCore::IntSize m_lastDocumentSizeForScaleToFit; 159 160 WebCore::LayoutMilestones m_pendingNewlyReachedLayoutMilestones { 0 }; 157 161 }; 158 162 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r202611 r206247 440 440 applyTransientZoomToLayers(m_transientZoomScale, m_transientZoomOrigin); 441 441 442 if (m_pendingNewlyReachedLayoutMilestones) 443 m_webPage.send(Messages::WebPageProxy::DidReachLayoutMilestone(m_pendingNewlyReachedLayoutMilestones)); 444 m_pendingNewlyReachedLayoutMilestones = 0; 445 442 446 return returnValue; 443 447 } … … 865 869 } 866 870 871 bool TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone(WebCore::LayoutMilestones layoutMilestones) 872 { 873 m_pendingNewlyReachedLayoutMilestones |= layoutMilestones; 874 return true; 875 } 876 867 877 } // namespace WebKit 868 878 -
trunk/Tools/ChangeLog
r206245 r206247 1 2016-09-21 Dan Bernstein <mitz@apple.com> 2 3 [macOS] Upon layout, _webView:renderingProgressDidChange: fires before the intrinsic content size is updated 4 https://bugs.webkit.org/show_bug.cgi?id=162359 5 <rdar://problem/27776454> 6 7 Reviewed by Tim Horton. 8 9 * TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm: 10 (TEST): 11 1 12 2016-09-21 Keith Miller <keith_miller@apple.com> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm
r205329 r206247 37 37 38 38 @interface AutoLayoutWKWebView : WKWebView 39 @property (nonatomic) BOOL expectingIntrinsicContentSizeChange; 40 @property (nonatomic) NSSize expectedIntrinsicContentSize; 39 41 @end 40 42 41 @implementation AutoLayoutWKWebView { 42 BOOL _expectingIntrinsicContentSizeChange; 43 NSSize _expectedIntrinsicContentSize; 44 } 43 @implementation AutoLayoutWKWebView 45 44 46 45 - (instancetype)initWithFrame:(NSRect)frame configuration:(WKWebViewConfiguration *)configuration … … 157 156 TestWebKitAPI::Util::run(&didEvaluateJavaScript); 158 157 didEvaluateJavaScript = false; 158 [webView _setShouldExpandContentToViewHeightForAutoLayout:NO]; 159 160 auto navigationDelegate = adoptNS([[TestNavigationDelegate alloc] init]); 161 162 __block bool didFinishNavigation = false; 163 [navigationDelegate setDidFinishNavigation:^(WKWebView *, WKNavigation *) { 164 didFinishNavigation = true; 165 }]; 166 __block bool didFirstLayout = false; 167 [navigationDelegate setRenderingProgressDidChange:^(WKWebView *, _WKRenderingProgressEvents progressEvents) { 168 if (progressEvents & _WKRenderingProgressEventFirstLayout) { 169 didFirstLayout = true; 170 EXPECT_TRUE(didInvalidateIntrinsicContentSize); 171 } 172 }]; 173 [webView setNavigationDelegate:navigationDelegate.get()]; 174 175 [webView _setMinimumLayoutWidth:100]; 176 didInvalidateIntrinsicContentSize = false; 177 [webView setExpectingIntrinsicContentSizeChange:YES]; 178 [webView setExpectedIntrinsicContentSize:NSMakeSize(100, 400)]; 179 [webView loadHTMLString:@"<body style='margin: 0; height: 400px;'></body>" baseURL:nil]; 180 TestWebKitAPI::Util::run(&didInvalidateIntrinsicContentSize); 181 EXPECT_FALSE(didFirstLayout); 182 TestWebKitAPI::Util::run(&didFirstLayout); 183 TestWebKitAPI::Util::run(&didFinishNavigation); 184 [webView setNavigationDelegate:nil]; 159 185 } 160 186
Note:
See TracChangeset
for help on using the changeset viewer.