Changeset 244633 in webkit
- Timestamp:
- Apr 24, 2019 7:17:50 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r244632 r244633 1 2019-04-24 Zalan Bujtas <zalan@apple.com> 2 3 Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering 4 https://bugs.webkit.org/show_bug.cgi?id=196948 5 <rdar://problem/49927131> 6 7 Reviewed by Tim Horton. 8 9 Covered by existing tests. 10 11 * loader/EmptyClients.h: 12 * page/ChromeClient.h: 13 * page/FrameView.cpp: 14 (WebCore::FrameView::autoSizeIfEnabled): 15 (WebCore::FrameView::enableAutoSizeMode): 16 * page/FrameView.h: 17 1 18 2019-04-24 Youenn Fablet <youenn@apple.com> 2 19 -
trunk/Source/WebCore/loader/EmptyClients.h
r242108 r244633 114 114 PlatformPageClient platformPageClient() const final { return 0; } 115 115 void contentsSizeChanged(Frame&, const IntSize&) const final { } 116 void intrinsicContentsSizeChanged(const IntSize&) const final { } 116 117 117 118 void mouseDidMoveOverElement(const HitTestResult&, unsigned) final { } -
trunk/Source/WebCore/page/ChromeClient.h
r244382 r244633 196 196 197 197 virtual void contentsSizeChanged(Frame&, const IntSize&) const = 0; 198 virtual void intrinsicContentsSizeChanged(const IntSize&) const = 0; 198 199 virtual void scrollRectIntoView(const IntRect&) const { }; // Currently only Mac has a non empty implementation. 199 200 -
trunk/Source/WebCore/page/FrameView.cpp
r244446 r244633 3464 3464 document->updateStyleIfNeeded(); 3465 3465 document->updateLayoutIgnorePendingStylesheets(); 3466 m_autoSizeContentSize = contentsSize(); 3467 3468 auto finalWidth = std::max(m_autoSizeConstraint.width(), m_autoSizeContentSize.width());3469 auto finalHeight = m_autoSizeFixedMinimumHeight ? std::max(m_autoSizeFixedMinimumHeight, m_autoSizeContentSize.height()) : m_autoSizeContentSize.height();3466 3467 auto currentContentsSize = this->contentsSize(); 3468 auto finalWidth = std::max(m_autoSizeConstraint.width(), currentContentsSize.width()); 3469 auto finalHeight = m_autoSizeFixedMinimumHeight ? std::max(m_autoSizeFixedMinimumHeight, currentContentsSize.height()) : currentContentsSize.height(); 3470 3470 resize(finalWidth, finalHeight); 3471 3471 document->updateLayoutIgnorePendingStylesheets(); 3472 m_autoSizeContentSize = contentsSize(); 3473 if (auto* page = frame().page()) 3474 page->chrome().client().intrinsicContentsSizeChanged(m_autoSizeContentSize); 3472 3475 m_didRunAutosize = true; 3473 3476 } … … 4471 4474 m_shouldAutoSize = enable; 4472 4475 m_autoSizeConstraint = viewSize; 4476 m_autoSizeContentSize = contentsSize(); 4473 4477 m_didRunAutosize = false; 4474 4478 -
trunk/Source/WebCore/page/FrameView.h
r244446 r244633 402 402 WEBCORE_EXPORT void enableAutoSizeMode(bool enable, const IntSize& minSize); 403 403 WEBCORE_EXPORT void setAutoSizeFixedMinimumHeight(int); 404 bool isAutoSizeEnabled() const { return m_shouldAutoSize; } 404 405 IntSize autoSizingIntrinsicContentSize() const { return m_autoSizeContentSize; } 405 406 -
trunk/Source/WebKit/ChangeLog
r244628 r244633 1 2019-04-24 Zalan Bujtas <zalan@apple.com> 2 3 Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering 4 https://bugs.webkit.org/show_bug.cgi?id=196948 5 <rdar://problem/49927131> 6 7 Reviewed by Tim Horton. 8 9 Move intrinsicContentSizeDidChange out of DrawingArea. Intrinsic content size is a layout concept and 10 after r244291 there's no reason to have it in DrawingArea. 11 12 * UIProcess/DrawingAreaProxy.h: 13 (WebKit::DrawingAreaProxy::didUpdateGeometry): 14 (WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange): Deleted. 15 * UIProcess/DrawingAreaProxy.messages.in: 16 * UIProcess/WebPageProxy.cpp: 17 (WebKit::WebPageProxy::didChangeIntrinsicContentSize): 18 (WebKit::WebPageProxy::setViewLayoutSize): 19 * UIProcess/WebPageProxy.h: 20 * UIProcess/WebPageProxy.messages.in: 21 * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: 22 * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: 23 (WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange): Deleted. 24 * UIProcess/mac/WebPageProxyMac.mm: 25 (WebKit::WebPageProxy::intrinsicContentSizeDidChange): Deleted. 26 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 27 (WebKit::WebChromeClient::intrinsicContentsSizeChanged const): 28 * WebProcess/WebCoreSupport/WebChromeClient.h: 29 * WebProcess/WebPage/WebPage.cpp: 30 (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded): 31 (WebKit::WebPage::dispatchDidReachLayoutMilestone): 32 * WebProcess/WebPage/WebPage.h: 33 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: 34 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 35 (WebKit::TiledCoreAnimationDrawingArea::flushLayers): 36 (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded): Deleted. 37 1 38 2019-04-24 Commit Queue <commit-queue@webkit.org> 2 39 -
trunk/Source/WebKit/UIProcess/DrawingAreaProxy.h
r244446 r244633 144 144 #if PLATFORM(COCOA) 145 145 virtual void didUpdateGeometry() { } 146 virtual void intrinsicContentSizeDidChange(const WebCore::IntSize&) { }147 146 148 147 #if PLATFORM(MAC) -
trunk/Source/WebKit/UIProcess/DrawingAreaProxy.messages.in
r244446 r244633 32 32 // Used by TiledCoreAnimationDrawingAreaProxy. 33 33 DidUpdateGeometry() 34 IntrinsicContentSizeDidChange(WebCore::IntSize newIntrinsicContentSize)35 34 #endif 36 35 } -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r244614 r244633 5473 5473 } 5474 5474 5475 void WebPageProxy::didChangeIntrinsicContentSize(const IntSize& intrinsicContentSize) 5476 { 5477 #if USE(APPKIT) 5478 pageClient().intrinsicContentSizeDidChange(intrinsicContentSize); 5479 #endif 5480 } 5481 5475 5482 #if ENABLE(INPUT_TYPE_COLOR) 5476 5483 void WebPageProxy::showColorPicker(const WebCore::Color& initialColor, const IntRect& elementRect, Vector<WebCore::Color>&& suggestions) … … 7605 7612 #if USE(APPKIT) 7606 7613 if (m_viewLayoutSize.width() <= 0) 7607 intrinsicContentSizeDidChange(IntSize(-1, -1));7614 didChangeIntrinsicContentSize(IntSize(-1, -1)); 7608 7615 #endif 7609 7616 } -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r244614 r244633 791 791 _WKRemoteObjectRegistry *remoteObjectRegistry(); 792 792 793 void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize);794 793 CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const; 795 794 #endif // PLATFORM(MAC) … … 1715 1714 1716 1715 void didChangeContentSize(const WebCore::IntSize&); 1716 void didChangeIntrinsicContentSize(const WebCore::IntSize&); 1717 1717 1718 1718 #if ENABLE(INPUT_TYPE_COLOR) -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r244559 r244633 89 89 90 90 DidChangeContentSize(WebCore::IntSize newSize) 91 DidChangeIntrinsicContentSize(WebCore::IntSize newIntrinsicContentSize) 91 92 92 93 #if ENABLE(INPUT_TYPE_COLOR) -
trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h
r244446 r244633 61 61 // Message handlers. 62 62 void didUpdateGeometry() override; 63 void intrinsicContentSizeDidChange(const WebCore::IntSize&) override;64 63 65 64 void sendUpdateGeometry(); -
trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm
r244446 r244633 126 126 } 127 127 128 void TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange(const IntSize& newIntrinsicContentSize)129 {130 if (m_webPageProxy.viewLayoutSize().width() > 0)131 m_webPageProxy.intrinsicContentSizeDidChange(newIntrinsicContentSize);132 }133 134 128 void TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry() 135 129 { -
trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
r244446 r244633 434 434 } 435 435 436 void WebPageProxy::intrinsicContentSizeDidChange(const IntSize& intrinsicContentSize)437 {438 pageClient().intrinsicContentSizeDidChange(intrinsicContentSize);439 }440 441 436 void WebPageProxy::setRemoteLayerTreeRootNode(RemoteLayerTreeNode* rootNode) 442 437 { -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
r244440 r244633 590 590 } 591 591 592 void WebChromeClient::intrinsicContentsSizeChanged(const IntSize& size) const 593 { 594 m_page.updateIntrinsicContentSizeIfNeeded(size); 595 } 596 592 597 void WebChromeClient::contentsSizeChanged(Frame& frame, const IntSize& size) const 593 598 { -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
r244382 r244633 118 118 PlatformPageClient platformPageClient() const final; 119 119 void contentsSizeChanged(WebCore::Frame&, const WebCore::IntSize&) const final; 120 void intrinsicContentsSizeChanged(const WebCore::IntSize&) const final; 120 121 void scrollRectIntoView(const WebCore::IntRect&) const final; // Currently only Mac has a non empty implementation. 121 122 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r244599 r244633 6231 6231 } 6232 6232 6233 void WebPage::updateIntrinsicContentSizeIfNeeded(const WebCore::IntSize& size) 6234 { 6235 if (!viewLayoutSize().width()) 6236 return; 6237 ASSERT(mainFrameView()); 6238 ASSERT(mainFrameView()->isAutoSizeEnabled()); 6239 ASSERT(!mainFrameView()->needsLayout()); 6240 if (m_lastSentIntrinsicContentSize == size) 6241 return; 6242 m_lastSentIntrinsicContentSize = size; 6243 send(Messages::WebPageProxy::DidChangeIntrinsicContentSize(size)); 6244 } 6245 6233 6246 void WebPage::dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone> milestones) 6234 6247 { … … 6245 6258 if (drawingAreaRelatedMilestones && m_drawingArea->addMilestonesToDispatch(drawingAreaRelatedMilestones)) 6246 6259 milestones.remove(drawingAreaRelatedMilestones); 6260 } 6261 if (milestones.contains(DidFirstLayout) && mainFrameView()) { 6262 // Ensure we never send DidFirstLayout milestone without updating the intrinsic size. 6263 updateIntrinsicContentSizeIfNeeded(mainFrameView()->autoSizingIntrinsicContentSize()); 6247 6264 } 6248 6265 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r244599 r244633 1179 1179 void setRemoteObjectRegistry(RemoteObjectRegistry&); 1180 1180 1181 void updateIntrinsicContentSizeIfNeeded(const WebCore::IntSize&); 1182 1181 1183 private: 1182 1184 WebPage(uint64_t pageID, WebPageCreationParameters&&); … … 1891 1893 WeakPtr<RemoteObjectRegistry> m_remoteObjectRegistry; 1892 1894 #endif 1895 WebCore::IntSize m_lastSentIntrinsicContentSize; 1893 1896 }; 1894 1897 -
trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
r244446 r244633 122 122 void updateDebugInfoLayer(bool showLayer); 123 123 124 void updateIntrinsicContentSizeIfNeeded();125 124 void updateScrolledExposedRect(); 126 125 void scaleViewToFitDocumentIfNeeded(); … … 150 149 WebCore::IntSize m_lastViewSizeForScaleToFit; 151 150 WebCore::IntSize m_lastDocumentSizeForScaleToFit; 152 153 WebCore::IntSize m_lastSentIntrinsicContentSize;154 151 155 152 double m_transientZoomScale { 1 }; -
trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r244446 r244633 279 279 } 280 280 281 void TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded()282 {283 if (!m_webPage.viewLayoutSize().width())284 return;285 286 FrameView* frameView = m_webPage.mainFrameView();287 if (!frameView)288 return;289 290 if (frameView->needsLayout())291 return;292 293 IntSize contentSize = frameView->autoSizingIntrinsicContentSize();294 if (m_lastSentIntrinsicContentSize == contentSize)295 return;296 297 m_lastSentIntrinsicContentSize = contentSize;298 send(Messages::DrawingAreaProxy::IntrinsicContentSizeDidChange(contentSize));299 }300 301 281 void TiledCoreAnimationDrawingArea::setShouldScaleViewToFitDocument(bool shouldScaleView) 302 282 { … … 463 443 m_webPage.flushPendingEditorStateUpdate(); 464 444 465 updateIntrinsicContentSizeIfNeeded();466 467 445 if (m_pendingRootLayer) { 468 446 setRootCompositingLayer(m_pendingRootLayer.get()); -
trunk/Source/WebKitLegacy/mac/ChangeLog
r244627 r244633 1 2019-04-24 Zalan Bujtas <zalan@apple.com> 2 3 Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering 4 https://bugs.webkit.org/show_bug.cgi?id=196948 5 <rdar://problem/49927131> 6 7 Reviewed by Tim Horton. 8 9 * WebCoreSupport/WebChromeClient.h: 10 1 11 2019-04-24 Eric Carlson <eric.carlson@apple.com> 2 12 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h
r241321 r244633 105 105 PlatformPageClient platformPageClient() const final; 106 106 void contentsSizeChanged(WebCore::Frame&, const WebCore::IntSize&) const final; 107 void intrinsicContentsSizeChanged(const WebCore::IntSize&) const final { } 107 108 void scrollRectIntoView(const WebCore::IntRect&) const final; 108 109 -
trunk/Source/WebKitLegacy/win/ChangeLog
r244599 r244633 1 2019-04-24 Zalan Bujtas <zalan@apple.com> 2 3 Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering 4 https://bugs.webkit.org/show_bug.cgi?id=196948 5 <rdar://problem/49927131> 6 7 Reviewed by Tim Horton. 8 9 * WebCoreSupport/WebChromeClient.cpp: 10 (WebChromeClient::intrinsicContentsSizeChanged const): 11 * WebCoreSupport/WebChromeClient.h: 12 1 13 2019-04-24 Simon Fraser <simon.fraser@apple.com> 2 14 -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.cpp
r244440 r244633 525 525 } 526 526 527 void WebChromeClient::intrinsicContentsSizeChanged(const IntSize&) const 528 { 529 notImplemented(); 530 } 531 527 532 void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags) 528 533 { -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.h
r241321 r244633 103 103 PlatformPageClient platformPageClient() const final; 104 104 void contentsSizeChanged(WebCore::Frame&, const WebCore::IntSize&) const final; 105 void intrinsicContentsSizeChanged(const WebCore::IntSize&) const final; 105 106 106 107 void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags) final; -
trunk/Tools/ChangeLog
r244627 r244633 1 2019-04-24 Zalan Bujtas <zalan@apple.com> 2 3 Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering 4 https://bugs.webkit.org/show_bug.cgi?id=196948 5 <rdar://problem/49927131> 6 7 Reviewed by Tim Horton. 8 9 * TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm: 10 (TEST): 11 The expected order of incoming events is 12 1. didInvalidateIntrinsicContentSize 13 2. didFirstLayout 14 At setRenderingProgressDidChange, we already check if didInvalidateIntrinsicContentSize comes in first. 15 However it's not guaranteed that the milestone event is delayed until after TestWebKitAPI::Util::run() is finished 16 (and remember, all we care about is ordering). 17 1 18 2019-04-24 Eric Carlson <eric.carlson@apple.com> 2 19 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm
r244446 r244633 164 164 // the intrinsic size change callback. 165 165 [webView _setShouldExpandContentToViewHeightForAutoLayout:YES]; 166 [webView load:@"<div class='large'></div>" withWidth:50 expectingContentSize:NSMakeSize(100, 100 ) resettingWidth:NO];166 [webView load:@"<div class='large'></div>" withWidth:50 expectingContentSize:NSMakeSize(100, 1000) resettingWidth:NO]; 167 167 [webView evaluateJavaScript:@"window.innerHeight" completionHandler:^(id value, NSError *error) { 168 168 EXPECT_TRUE([value isKindOfClass:[NSNumber class]]); … … 175 175 } 176 176 177 TEST(WebKit, DISABLED_AutoLayoutRenderingProgressRelativeOrdering)177 TEST(WebKit, AutoLayoutRenderingProgressRelativeOrdering) 178 178 { 179 179 RetainPtr<AutoLayoutWKWebView> webView = adoptNS([[AutoLayoutWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 1000, 1000)]); … … 200 200 [webView loadHTMLString:@"<body style='margin: 0; height: 400px;'></body>" baseURL:nil]; 201 201 TestWebKitAPI::Util::run(&didInvalidateIntrinsicContentSize); 202 EXPECT_FALSE(didFirstLayout);203 202 TestWebKitAPI::Util::run(&didFirstLayout); 204 203 TestWebKitAPI::Util::run(&didFinishNavigation);
Note: See TracChangeset
for help on using the changeset viewer.