Title: [244633] trunk
Revision
244633
Author
[email protected]
Date
2019-04-24 19:17:50 -0700 (Wed, 24 Apr 2019)

Log Message

Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
https://bugs.webkit.org/show_bug.cgi?id=196948
<rdar://problem/49927131>

Reviewed by Tim Horton.

Source/WebCore:

Covered by existing tests.

* loader/EmptyClients.h:
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::autoSizeIfEnabled):
(WebCore::FrameView::enableAutoSizeMode):
* page/FrameView.h:

Source/WebKit:

Move intrinsicContentSizeDidChange out of DrawingArea. Intrinsic content size is a layout concept and
after r244291 there's no reason to have it in DrawingArea.

* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::didUpdateGeometry):
(WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
* UIProcess/DrawingAreaProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChangeIntrinsicContentSize):
(WebKit::WebPageProxy::setViewLayoutSize):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::intrinsicContentSizeDidChange): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::intrinsicContentsSizeChanged const):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
(WebKit::WebPage::dispatchDidReachLayoutMilestone):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded): Deleted.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebChromeClient.h:

Source/WebKitLegacy/win:

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::intrinsicContentsSizeChanged const):
* WebCoreSupport/WebChromeClient.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm:
(TEST):
The expected order of incoming events is
1. didInvalidateIntrinsicContentSize
2. didFirstLayout
At setRenderingProgressDidChange, we already check if didInvalidateIntrinsicContentSize comes in first.
However it's not guaranteed that the milestone event is delayed until after TestWebKitAPI::Util::run() is finished
(and remember, all we care about is ordering).

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (244632 => 244633)


--- trunk/Source/WebCore/ChangeLog	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebCore/ChangeLog	2019-04-25 02:17:50 UTC (rev 244633)
@@ -1,3 +1,20 @@
+2019-04-24  Zalan Bujtas  <[email protected]>
+
+        Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
+        https://bugs.webkit.org/show_bug.cgi?id=196948
+        <rdar://problem/49927131>
+
+        Reviewed by Tim Horton.
+
+        Covered by existing tests.
+
+        * loader/EmptyClients.h:
+        * page/ChromeClient.h:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::autoSizeIfEnabled):
+        (WebCore::FrameView::enableAutoSizeMode):
+        * page/FrameView.h:
+
 2019-04-24  Youenn Fablet  <[email protected]>
 
         Do not restart WebRTC stats timer if backend is stopped

Modified: trunk/Source/WebCore/loader/EmptyClients.h (244632 => 244633)


--- trunk/Source/WebCore/loader/EmptyClients.h	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebCore/loader/EmptyClients.h	2019-04-25 02:17:50 UTC (rev 244633)
@@ -113,6 +113,7 @@
 
     PlatformPageClient platformPageClient() const final { return 0; }
     void contentsSizeChanged(Frame&, const IntSize&) const final { }
+    void intrinsicContentsSizeChanged(const IntSize&) const final { }
 
     void mouseDidMoveOverElement(const HitTestResult&, unsigned) final { }
 

Modified: trunk/Source/WebCore/page/ChromeClient.h (244632 => 244633)


--- trunk/Source/WebCore/page/ChromeClient.h	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebCore/page/ChromeClient.h	2019-04-25 02:17:50 UTC (rev 244633)
@@ -195,6 +195,7 @@
     virtual void dispatchViewportPropertiesDidChange(const ViewportArguments&) const { }
 
     virtual void contentsSizeChanged(Frame&, const IntSize&) const = 0;
+    virtual void intrinsicContentsSizeChanged(const IntSize&) const = 0;
     virtual void scrollRectIntoView(const IntRect&) const { }; // Currently only Mac has a non empty implementation.
 
     virtual bool shouldUnavailablePluginMessageBeButton(RenderEmbeddedObject::PluginUnavailabilityReason) const { return false; }

Modified: trunk/Source/WebCore/page/FrameView.cpp (244632 => 244633)


--- trunk/Source/WebCore/page/FrameView.cpp	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebCore/page/FrameView.cpp	2019-04-25 02:17:50 UTC (rev 244633)
@@ -3463,12 +3463,15 @@
     resize(m_autoSizeConstraint.width(), m_autoSizeConstraint.height());
     document->updateStyleIfNeeded();
     document->updateLayoutIgnorePendingStylesheets();
-    m_autoSizeContentSize = contentsSize();
 
-    auto finalWidth = std::max(m_autoSizeConstraint.width(), m_autoSizeContentSize.width());
-    auto finalHeight = m_autoSizeFixedMinimumHeight ? std::max(m_autoSizeFixedMinimumHeight, m_autoSizeContentSize.height()) : m_autoSizeContentSize.height();
+    auto currentContentsSize = this->contentsSize();
+    auto finalWidth = std::max(m_autoSizeConstraint.width(), currentContentsSize.width());
+    auto finalHeight = m_autoSizeFixedMinimumHeight ? std::max(m_autoSizeFixedMinimumHeight, currentContentsSize.height()) : currentContentsSize.height();
     resize(finalWidth, finalHeight);
     document->updateLayoutIgnorePendingStylesheets();
+    m_autoSizeContentSize = contentsSize(); 
+    if (auto* page = frame().page())
+        page->chrome().client().intrinsicContentsSizeChanged(m_autoSizeContentSize);
     m_didRunAutosize = true;
 }
 
@@ -4470,6 +4473,7 @@
 
     m_shouldAutoSize = enable;
     m_autoSizeConstraint = viewSize;
+    m_autoSizeContentSize = contentsSize();
     m_didRunAutosize = false;
 
     setNeedsLayoutAfterViewConfigurationChange();

Modified: trunk/Source/WebCore/page/FrameView.h (244632 => 244633)


--- trunk/Source/WebCore/page/FrameView.h	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebCore/page/FrameView.h	2019-04-25 02:17:50 UTC (rev 244633)
@@ -401,6 +401,7 @@
     bool isVisuallyNonEmpty() const { return m_isVisuallyNonEmpty; }
     WEBCORE_EXPORT void enableAutoSizeMode(bool enable, const IntSize& minSize);
     WEBCORE_EXPORT void setAutoSizeFixedMinimumHeight(int);
+    bool isAutoSizeEnabled() const { return m_shouldAutoSize; }
     IntSize autoSizingIntrinsicContentSize() const { return m_autoSizeContentSize; }
 
     WEBCORE_EXPORT void forceLayout(bool allowSubtreeLayout = false);

Modified: trunk/Source/WebKit/ChangeLog (244632 => 244633)


--- trunk/Source/WebKit/ChangeLog	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/ChangeLog	2019-04-25 02:17:50 UTC (rev 244633)
@@ -1,3 +1,40 @@
+2019-04-24  Zalan Bujtas  <[email protected]>
+
+        Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
+        https://bugs.webkit.org/show_bug.cgi?id=196948
+        <rdar://problem/49927131>
+
+        Reviewed by Tim Horton.
+
+        Move intrinsicContentSizeDidChange out of DrawingArea. Intrinsic content size is a layout concept and
+        after r244291 there's no reason to have it in DrawingArea.
+
+        * UIProcess/DrawingAreaProxy.h:
+        (WebKit::DrawingAreaProxy::didUpdateGeometry):
+        (WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
+        * UIProcess/DrawingAreaProxy.messages.in:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didChangeIntrinsicContentSize):
+        (WebKit::WebPageProxy::setViewLayoutSize):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
+        (WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
+        * UIProcess/mac/WebPageProxyMac.mm:
+        (WebKit::WebPageProxy::intrinsicContentSizeDidChange): Deleted.
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::intrinsicContentsSizeChanged const):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
+        (WebKit::WebPage::dispatchDidReachLayoutMilestone):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
+        (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded): Deleted.
+
 2019-04-24  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r244228.

Modified: trunk/Source/WebKit/UIProcess/DrawingAreaProxy.h (244632 => 244633)


--- trunk/Source/WebKit/UIProcess/DrawingAreaProxy.h	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/UIProcess/DrawingAreaProxy.h	2019-04-25 02:17:50 UTC (rev 244633)
@@ -143,7 +143,6 @@
     virtual void updateAcceleratedCompositingMode(uint64_t /* backingStoreStateID */, const LayerTreeContext&) { }
 #if PLATFORM(COCOA)
     virtual void didUpdateGeometry() { }
-    virtual void intrinsicContentSizeDidChange(const WebCore::IntSize&) { }
 
 #if PLATFORM(MAC)
     RunLoop::Timer<DrawingAreaProxy> m_viewExposedRectChangedTimer;

Modified: trunk/Source/WebKit/UIProcess/DrawingAreaProxy.messages.in (244632 => 244633)


--- trunk/Source/WebKit/UIProcess/DrawingAreaProxy.messages.in	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/UIProcess/DrawingAreaProxy.messages.in	2019-04-25 02:17:50 UTC (rev 244633)
@@ -31,6 +31,5 @@
 #if PLATFORM(COCOA)
     // Used by TiledCoreAnimationDrawingAreaProxy.
     DidUpdateGeometry()
-    IntrinsicContentSizeDidChange(WebCore::IntSize newIntrinsicContentSize)
 #endif
 }

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (244632 => 244633)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2019-04-25 02:17:50 UTC (rev 244633)
@@ -5472,6 +5472,13 @@
     pageClient().didChangeContentSize(size);
 }
 
+void WebPageProxy::didChangeIntrinsicContentSize(const IntSize& intrinsicContentSize)
+{
+#if USE(APPKIT)
+    pageClient().intrinsicContentSizeDidChange(intrinsicContentSize);
+#endif
+}
+
 #if ENABLE(INPUT_TYPE_COLOR)
 void WebPageProxy::showColorPicker(const WebCore::Color& initialColor, const IntRect& elementRect, Vector<WebCore::Color>&& suggestions)
 {
@@ -7604,7 +7611,7 @@
 
 #if USE(APPKIT)
     if (m_viewLayoutSize.width() <= 0)
-        intrinsicContentSizeDidChange(IntSize(-1, -1));
+        didChangeIntrinsicContentSize(IntSize(-1, -1));
 #endif
 }
 

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (244632 => 244633)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2019-04-25 02:17:50 UTC (rev 244633)
@@ -790,7 +790,6 @@
     NSView *inspectorAttachmentView();
     _WKRemoteObjectRegistry *remoteObjectRegistry();
 
-    void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize);
     CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const;
 #endif // PLATFORM(MAC)
 
@@ -1714,6 +1713,7 @@
     void didDestroyNotification(uint64_t notificationID);
 
     void didChangeContentSize(const WebCore::IntSize&);
+    void didChangeIntrinsicContentSize(const WebCore::IntSize&);
 
 #if ENABLE(INPUT_TYPE_COLOR)
     void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&, Vector<WebCore::Color>&&);

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (244632 => 244633)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2019-04-25 02:17:50 UTC (rev 244633)
@@ -88,6 +88,7 @@
     SetCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents)
 
     DidChangeContentSize(WebCore::IntSize newSize)
+    DidChangeIntrinsicContentSize(WebCore::IntSize newIntrinsicContentSize)
 
 #if ENABLE(INPUT_TYPE_COLOR)
     ShowColorPicker(WebCore::Color initialColor, WebCore::IntRect elementRect, Vector<WebCore::Color> suggestions);

Modified: trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h (244632 => 244633)


--- trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h	2019-04-25 02:17:50 UTC (rev 244633)
@@ -60,7 +60,6 @@
 
     // Message handlers.
     void didUpdateGeometry() override;
-    void intrinsicContentSizeDidChange(const WebCore::IntSize&) override;
 
     void sendUpdateGeometry();
 

Modified: trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm (244632 => 244633)


--- trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm	2019-04-25 02:17:50 UTC (rev 244633)
@@ -125,12 +125,6 @@
     process().connection()->waitForAndDispatchImmediately<Messages::WebPageProxy::DidUpdateActivityState>(m_webPageProxy.pageID(), activityStateUpdateTimeout, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives);
 }
 
-void TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange(const IntSize& newIntrinsicContentSize)
-{
-    if (m_webPageProxy.viewLayoutSize().width() > 0)
-        m_webPageProxy.intrinsicContentSizeDidChange(newIntrinsicContentSize);
-}
-
 void TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry()
 {
     m_lastSentViewLayoutSize = m_webPageProxy.viewLayoutSize();

Modified: trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm (244632 => 244633)


--- trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm	2019-04-25 02:17:50 UTC (rev 244633)
@@ -433,11 +433,6 @@
     return result;
 }
 
-void WebPageProxy::intrinsicContentSizeDidChange(const IntSize& intrinsicContentSize)
-{
-    pageClient().intrinsicContentSizeDidChange(intrinsicContentSize);
-}
-
 void WebPageProxy::setRemoteLayerTreeRootNode(RemoteLayerTreeNode* rootNode)
 {
     pageClient().setRemoteLayerTreeRootNode(rootNode);

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (244632 => 244633)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp	2019-04-25 02:17:50 UTC (rev 244633)
@@ -589,6 +589,11 @@
     return 0;
 }
 
+void WebChromeClient::intrinsicContentsSizeChanged(const IntSize& size) const
+{
+    m_page.updateIntrinsicContentSizeIfNeeded(size);
+}
+
 void WebChromeClient::contentsSizeChanged(Frame& frame, const IntSize& size) const
 {
     FrameView* frameView = frame.view();

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (244632 => 244633)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h	2019-04-25 02:17:50 UTC (rev 244633)
@@ -117,6 +117,7 @@
 
     PlatformPageClient platformPageClient() const final;
     void contentsSizeChanged(WebCore::Frame&, const WebCore::IntSize&) const final;
+    void intrinsicContentsSizeChanged(const WebCore::IntSize&) const final;
     void scrollRectIntoView(const WebCore::IntRect&) const final; // Currently only Mac has a non empty implementation.
 
     bool shouldUnavailablePluginMessageBeButton(WebCore::RenderEmbeddedObject::PluginUnavailabilityReason) const final;

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (244632 => 244633)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-04-25 02:17:50 UTC (rev 244633)
@@ -6230,6 +6230,19 @@
     m_userContentController->removeAllUserContent();
 }
 
+void WebPage::updateIntrinsicContentSizeIfNeeded(const WebCore::IntSize& size)
+{
+    if (!viewLayoutSize().width())
+        return;
+    ASSERT(mainFrameView());
+    ASSERT(mainFrameView()->isAutoSizeEnabled());
+    ASSERT(!mainFrameView()->needsLayout());
+    if (m_lastSentIntrinsicContentSize == size)
+        return;
+    m_lastSentIntrinsicContentSize = size;
+    send(Messages::WebPageProxy::DidChangeIntrinsicContentSize(size));
+}
+
 void WebPage::dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone> milestones)
 {
     RefPtr<API::Object> userData;
@@ -6245,6 +6258,10 @@
         if (drawingAreaRelatedMilestones && m_drawingArea->addMilestonesToDispatch(drawingAreaRelatedMilestones))
             milestones.remove(drawingAreaRelatedMilestones);
     }
+    if (milestones.contains(DidFirstLayout) && mainFrameView()) {
+        // Ensure we never send DidFirstLayout milestone without updating the intrinsic size.
+        updateIntrinsicContentSizeIfNeeded(mainFrameView()->autoSizingIntrinsicContentSize());
+    }
 
     send(Messages::WebPageProxy::DidReachLayoutMilestone(milestones));
 }

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (244632 => 244633)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-04-25 02:17:50 UTC (rev 244633)
@@ -1178,6 +1178,8 @@
 
     void setRemoteObjectRegistry(RemoteObjectRegistry&);
 
+    void updateIntrinsicContentSizeIfNeeded(const WebCore::IntSize&);
+
 private:
     WebPage(uint64_t pageID, WebPageCreationParameters&&);
 
@@ -1890,6 +1892,7 @@
 #if PLATFORM(COCOA)
     WeakPtr<RemoteObjectRegistry> m_remoteObjectRegistry;
 #endif
+    WebCore::IntSize m_lastSentIntrinsicContentSize;
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (244632 => 244633)


--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h	2019-04-25 02:17:50 UTC (rev 244633)
@@ -121,7 +121,6 @@
     WebCore::TiledBacking* mainFrameTiledBacking() const;
     void updateDebugInfoLayer(bool showLayer);
 
-    void updateIntrinsicContentSizeIfNeeded();
     void updateScrolledExposedRect();
     void scaleViewToFitDocumentIfNeeded();
 
@@ -150,8 +149,6 @@
     WebCore::IntSize m_lastViewSizeForScaleToFit;
     WebCore::IntSize m_lastDocumentSizeForScaleToFit;
 
-    WebCore::IntSize m_lastSentIntrinsicContentSize;
-
     double m_transientZoomScale { 1 };
     WebCore::FloatPoint m_transientZoomOrigin;
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (244632 => 244633)


--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2019-04-25 02:17:50 UTC (rev 244633)
@@ -278,26 +278,6 @@
 {
 }
 
-void TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded()
-{
-    if (!m_webPage.viewLayoutSize().width())
-        return;
-
-    FrameView* frameView = m_webPage.mainFrameView();
-    if (!frameView)
-        return;
-
-    if (frameView->needsLayout())
-        return;
-
-    IntSize contentSize = frameView->autoSizingIntrinsicContentSize();
-    if (m_lastSentIntrinsicContentSize == contentSize)
-        return;
-
-    m_lastSentIntrinsicContentSize = contentSize;
-    send(Messages::DrawingAreaProxy::IntrinsicContentSizeDidChange(contentSize));
-}
-
 void TiledCoreAnimationDrawingArea::setShouldScaleViewToFitDocument(bool shouldScaleView)
 {
     if (m_shouldScaleViewToFitDocument == shouldScaleView)
@@ -462,8 +442,6 @@
         m_webPage.updateRendering();
         m_webPage.flushPendingEditorStateUpdate();
 
-        updateIntrinsicContentSizeIfNeeded();
-
         if (m_pendingRootLayer) {
             setRootCompositingLayer(m_pendingRootLayer.get());
             m_pendingRootLayer = nullptr;

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (244632 => 244633)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2019-04-25 02:17:50 UTC (rev 244633)
@@ -1,3 +1,13 @@
+2019-04-24  Zalan Bujtas  <[email protected]>
+
+        Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
+        https://bugs.webkit.org/show_bug.cgi?id=196948
+        <rdar://problem/49927131>
+
+        Reviewed by Tim Horton.
+
+        * WebCoreSupport/WebChromeClient.h:
+
 2019-04-24  Eric Carlson  <[email protected]>
 
         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h (244632 => 244633)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h	2019-04-25 02:17:50 UTC (rev 244633)
@@ -104,6 +104,7 @@
 
     PlatformPageClient platformPageClient() const final;
     void contentsSizeChanged(WebCore::Frame&, const WebCore::IntSize&) const final;
+    void intrinsicContentsSizeChanged(const WebCore::IntSize&) const final { }
     void scrollRectIntoView(const WebCore::IntRect&) const final;
 
     void setStatusbarText(const String&) override;

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (244632 => 244633)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2019-04-25 02:17:50 UTC (rev 244633)
@@ -1,3 +1,15 @@
+2019-04-24  Zalan Bujtas  <[email protected]>
+
+        Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
+        https://bugs.webkit.org/show_bug.cgi?id=196948
+        <rdar://problem/49927131>
+
+        Reviewed by Tim Horton.
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::intrinsicContentsSizeChanged const):
+        * WebCoreSupport/WebChromeClient.h:
+
 2019-04-24  Simon Fraser  <[email protected]>
 
         Make it possible to control the renderTreeAsText output by setting options on testRunner

Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.cpp (244632 => 244633)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.cpp	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.cpp	2019-04-25 02:17:50 UTC (rev 244633)
@@ -524,6 +524,11 @@
     notImplemented();
 }
 
+void WebChromeClient::intrinsicContentsSizeChanged(const IntSize&) const
+{
+    notImplemented();
+}
+
 void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags)
 {
     COMPtr<IWebUIDelegate> uiDelegate;

Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.h (244632 => 244633)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.h	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.h	2019-04-25 02:17:50 UTC (rev 244633)
@@ -102,6 +102,7 @@
     WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&) const final;
     PlatformPageClient platformPageClient() const final;
     void contentsSizeChanged(WebCore::Frame&, const WebCore::IntSize&) const final;
+    void intrinsicContentsSizeChanged(const WebCore::IntSize&) const final;
 
     void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags) final;
     bool shouldUnavailablePluginMessageBeButton(WebCore::RenderEmbeddedObject::PluginUnavailabilityReason) const final;

Modified: trunk/Tools/ChangeLog (244632 => 244633)


--- trunk/Tools/ChangeLog	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Tools/ChangeLog	2019-04-25 02:17:50 UTC (rev 244633)
@@ -1,3 +1,20 @@
+2019-04-24  Zalan Bujtas  <[email protected]>
+
+        Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
+        https://bugs.webkit.org/show_bug.cgi?id=196948
+        <rdar://problem/49927131>
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm:
+        (TEST):
+        The expected order of incoming events is
+        1. didInvalidateIntrinsicContentSize
+        2. didFirstLayout
+        At setRenderingProgressDidChange, we already check if didInvalidateIntrinsicContentSize comes in first.
+        However it's not guaranteed that the milestone event is delayed until after TestWebKitAPI::Util::run() is finished
+        (and remember, all we care about is ordering).
+
 2019-04-24  Eric Carlson  <[email protected]>
 
         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm (244632 => 244633)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm	2019-04-25 01:11:00 UTC (rev 244632)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm	2019-04-25 02:17:50 UTC (rev 244633)
@@ -163,7 +163,7 @@
     // of the intrinsic height of the content. We have to load differently-sized content so that we can wait for
     // the intrinsic size change callback.
     [webView _setShouldExpandContentToViewHeightForAutoLayout:YES];
-    [webView load:@"<div class='large'></div>" withWidth:50 expectingContentSize:NSMakeSize(100, 100) resettingWidth:NO];
+    [webView load:@"<div class='large'></div>" withWidth:50 expectingContentSize:NSMakeSize(100, 1000) resettingWidth:NO];
     [webView evaluateJavaScript:@"window.innerHeight" completionHandler:^(id value, NSError *error) {
         EXPECT_TRUE([value isKindOfClass:[NSNumber class]]);
         EXPECT_EQ(1000, [value integerValue]);
@@ -174,7 +174,7 @@
     [webView _setShouldExpandContentToViewHeightForAutoLayout:NO];
 }
 
-TEST(WebKit, DISABLED_AutoLayoutRenderingProgressRelativeOrdering)
+TEST(WebKit, AutoLayoutRenderingProgressRelativeOrdering)
 {
     RetainPtr<AutoLayoutWKWebView> webView = adoptNS([[AutoLayoutWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 1000, 1000)]);
 
@@ -199,7 +199,6 @@
     [webView setExpectedIntrinsicContentSize:NSMakeSize(100, 400)];
     [webView loadHTMLString:@"<body style='margin: 0; height: 400px;'></body>" baseURL:nil];
     TestWebKitAPI::Util::run(&didInvalidateIntrinsicContentSize);
-    EXPECT_FALSE(didFirstLayout);
     TestWebKitAPI::Util::run(&didFirstLayout);
     TestWebKitAPI::Util::run(&didFinishNavigation);
     [webView setNavigationDelegate:nil];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to