Title: [262856] trunk
Revision
262856
Author
grao...@webkit.org
Date
2020-06-10 13:37:03 -0700 (Wed, 10 Jun 2020)

Log Message

Subframes should not autosize independently
https://bugs.webkit.org/show_bug.cgi?id=212984
<rdar://problem/64175493>

Reviewed by Simon Fraser.

Source/WebCore:

* page/FrameView.cpp:
(WebCore::FrameView::enableAutoSizeMode):

Source/WebKit:

Ensure we only call FrameView::enableSizeToContentAutoSizeMode() for the main frame.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm:
(TEST): Added test for <object>.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (262855 => 262856)


--- trunk/Source/WebCore/ChangeLog	2020-06-10 20:36:34 UTC (rev 262855)
+++ trunk/Source/WebCore/ChangeLog	2020-06-10 20:37:03 UTC (rev 262856)
@@ -1,3 +1,14 @@
+2020-06-10  Antoine Quint  <grao...@webkit.org>
+
+        Subframes should not autosize independently
+        https://bugs.webkit.org/show_bug.cgi?id=212984
+        <rdar://problem/64175493>
+
+        Reviewed by Simon Fraser.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::enableAutoSizeMode):
+
 2020-06-10  Philippe Normand  <pnorm...@igalia.com>
 
         Unreviewed, WPE Debug build fix attempt after r262838.

Modified: trunk/Source/WebCore/page/FrameView.cpp (262855 => 262856)


--- trunk/Source/WebCore/page/FrameView.cpp	2020-06-10 20:36:34 UTC (rev 262855)
+++ trunk/Source/WebCore/page/FrameView.cpp	2020-06-10 20:37:03 UTC (rev 262856)
@@ -4593,6 +4593,7 @@
 
 void FrameView::enableAutoSizeMode(bool enable, const IntSize& viewSize, AutoSizeMode mode)
 {
+    ASSERT(frame().isMainFrame());
     ASSERT(!enable || !viewSize.isEmpty());
     if (m_shouldAutoSize == enable && m_autoSizeConstraint == viewSize)
         return;

Modified: trunk/Source/WebKit/ChangeLog (262855 => 262856)


--- trunk/Source/WebKit/ChangeLog	2020-06-10 20:36:34 UTC (rev 262855)
+++ trunk/Source/WebKit/ChangeLog	2020-06-10 20:37:03 UTC (rev 262856)
@@ -1,3 +1,16 @@
+2020-06-10  Antoine Quint  <grao...@webkit.org>
+
+        Subframes should not autosize independently
+        https://bugs.webkit.org/show_bug.cgi?id=212984
+        <rdar://problem/64175493>
+
+        Reviewed by Simon Fraser.
+
+        Ensure we only call FrameView::enableSizeToContentAutoSizeMode() for the main frame.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
+
 2020-06-10  Jonathan Bedard  <jbed...@apple.com>
 
         WebKit:Add PepperUICoreSPI.h

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (262855 => 262856)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2020-06-10 20:36:34 UTC (rev 262855)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2020-06-10 20:37:03 UTC (rev 262856)
@@ -1515,7 +1515,8 @@
 
     IntSize sizeToContentAutoSizeMaximumSize = webPage->sizeToContentAutoSizeMaximumSize();
     if (sizeToContentAutoSizeMaximumSize.width() && sizeToContentAutoSizeMaximumSize.height()) {
-        view->enableSizeToContentAutoSizeMode(true, sizeToContentAutoSizeMaximumSize);
+        if (isMainFrame)
+            view->enableSizeToContentAutoSizeMode(true, sizeToContentAutoSizeMaximumSize);
 
         if (webPage->autoSizingShouldExpandToViewHeight())
             view->setAutoSizeFixedMinimumHeight(webPage->size().height());

Modified: trunk/Tools/ChangeLog (262855 => 262856)


--- trunk/Tools/ChangeLog	2020-06-10 20:36:34 UTC (rev 262855)
+++ trunk/Tools/ChangeLog	2020-06-10 20:37:03 UTC (rev 262856)
@@ -1,3 +1,14 @@
+2020-06-10  Antoine Quint  <grao...@webkit.org>
+
+        Subframes should not autosize independently
+        https://bugs.webkit.org/show_bug.cgi?id=212984
+        <rdar://problem/64175493>
+
+        Reviewed by Simon Fraser.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm:
+        (TEST): Added test for <object>.
+
 2020-06-09  Ryan Haddad  <ryanhad...@apple.com>
 
         [Mojave] Flaky API Test: TestWebKitAPI.WebKitLegacy.CrossPartitionFileSchemeAccess

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm (262855 => 262856)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm	2020-06-10 20:36:34 UTC (rev 262855)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm	2020-06-10 20:37:03 UTC (rev 262856)
@@ -148,6 +148,9 @@
     // One 100x100 rect and ten 10x10 rects, inline; with the constraint (width >= 20) -> 100x150
     [webView load:@"<div class='large'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div>" withWidth:20 expectingContentSize:NSMakeSize(100, 150)];
 
+    // Test content with a subframe
+    [webView load:@"<object type=\"text/html\" data="" withWidth:300 expectingContentSize:NSMakeSize(300, 150)];
+
     // With _shouldExpandContentToViewHeightForAutoLayout off (the default), the page should lay out to the intrinsic height
     // of the content.
     [webView load:@"<div class='small'></div>" withWidth:50 expectingContentSize:NSMakeSize(50, 10) resettingWidth:NO];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to