Title: [153394] branches/safari-537-branch/Source

Diff

Modified: branches/safari-537-branch/Source/WebCore/ChangeLog (153393 => 153394)


--- branches/safari-537-branch/Source/WebCore/ChangeLog	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebCore/ChangeLog	2013-07-27 00:22:23 UTC (rev 153394)
@@ -1,5 +1,31 @@
 2013-07-26  Lucas Forschler  <[email protected]>
 
+        Merge r153378
+
+    2013-07-26  Tim Horton  <[email protected]>
+
+            Add a mode where autosizing fixes the FrameView height to at least the WKView height
+            https://bugs.webkit.org/show_bug.cgi?id=119104
+            <rdar://problem/14549021>
+
+            Reviewed by Anders Carlsson.
+
+            * WebCore.exp.in: Export FrameView::setAutoSizeFixedMinimumHeight.
+            * page/FrameView.cpp:
+            (WebCore::FrameView::FrameView):
+            Initialize m_autoSizeFixedMinimumHeight to 0.
+
+            (WebCore::FrameView::autoSizeIfEnabled):
+            Increase the FrameView height to m_autoSizeFixedMinimumHeight if necessary,
+            and do another layout. Store the computed intrinsic content size.
+
+            (WebCore::FrameView::setAutoSizeFixedMinimumHeight): Added.
+
+            * page/FrameView.h:
+            (WebCore::FrameView::autoSizingIntrinsicContentSize): Added.
+
+2013-07-26  Lucas Forschler  <[email protected]>
+
         Merge r153349
 
     2013-07-25  Tim Horton  <[email protected]>

Modified: branches/safari-537-branch/Source/WebCore/WebCore.exp.in (153393 => 153394)


--- branches/safari-537-branch/Source/WebCore/WebCore.exp.in	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebCore/WebCore.exp.in	2013-07-27 00:22:23 UTC (rev 153394)
@@ -1173,6 +1173,7 @@
 __ZN7WebCore9FrameView26adjustPageHeightDeprecatedEPffff
 __ZN7WebCore9FrameView26adjustTiledBackingCoverageEv
 __ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb
+__ZN7WebCore9FrameView29setAutoSizeFixedMinimumHeightEi
 __ZN7WebCore9FrameView31setVisualUpdatesAllowedByClientEb
 __ZN7WebCore9FrameView37setScrollingPerformanceLoggingEnabledEb
 __ZN7WebCore9FrameView37updateLayoutAndStyleIfNeededRecursiveEv

Modified: branches/safari-537-branch/Source/WebCore/page/FrameView.cpp (153393 => 153394)


--- branches/safari-537-branch/Source/WebCore/page/FrameView.cpp	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebCore/page/FrameView.cpp	2013-07-27 00:22:23 UTC (rev 153394)
@@ -195,6 +195,7 @@
     , m_shouldAutoSize(false)
     , m_inAutoSize(false)
     , m_didRunAutosize(false)
+    , m_autoSizeFixedMinimumHeight(0)
     , m_headerHeight(0)
     , m_footerHeight(0)
     , m_milestonesPendingPaint(0)
@@ -2970,9 +2971,27 @@
         setHorizontalScrollbarLock(false);
         setScrollbarModes(horizonalScrollbarMode, verticalScrollbarMode, true, true);
     }
+
+    m_autoSizeContentSize = contentsSize();
+
+    if (m_autoSizeFixedMinimumHeight) {
+        resize(m_autoSizeContentSize.width(), max(m_autoSizeFixedMinimumHeight, m_autoSizeContentSize.height()));
+        document->updateLayoutIgnorePendingStylesheets();
+    }
+
     m_didRunAutosize = true;
 }
 
+void FrameView::setAutoSizeFixedMinimumHeight(int fixedMinimumHeight)
+{
+    if (m_autoSizeFixedMinimumHeight == fixedMinimumHeight)
+        return;
+
+    m_autoSizeFixedMinimumHeight = fixedMinimumHeight;
+
+    setNeedsLayout();
+}
+
 void FrameView::updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow)
 {
     if (!m_viewportRenderer)

Modified: branches/safari-537-branch/Source/WebCore/page/FrameView.h (153393 => 153394)


--- branches/safari-537-branch/Source/WebCore/page/FrameView.h	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebCore/page/FrameView.h	2013-07-27 00:22:23 UTC (rev 153394)
@@ -298,6 +298,8 @@
     void setIsVisuallyNonEmpty();
     bool isVisuallyNonEmpty() const { return m_isVisuallyNonEmpty; }
     void enableAutoSizeMode(bool enable, const IntSize& minSize, const IntSize& maxSize);
+    void setAutoSizeFixedMinimumHeight(int fixedMinimumHeight);
+    IntSize autoSizingIntrinsicContentSize() const { return m_autoSizeContentSize; }
 
     void forceLayout(bool allowSubtree = false);
     void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkFactor, AdjustViewSizeOrNot);
@@ -636,6 +638,10 @@
     IntSize m_minAutoSize;
     // The upper bound on the size when autosizing.
     IntSize m_maxAutoSize;
+    // The fixed height to resize the view to after autosizing is complete.
+    int m_autoSizeFixedMinimumHeight;
+    // The intrinsic content size decided by autosizing.
+    IntSize m_autoSizeContentSize;
 
     OwnPtr<ScrollableAreaSet> m_scrollableAreas;
     OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects;

Modified: branches/safari-537-branch/Source/WebKit2/ChangeLog (153393 => 153394)


--- branches/safari-537-branch/Source/WebKit2/ChangeLog	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebKit2/ChangeLog	2013-07-27 00:22:23 UTC (rev 153394)
@@ -1,5 +1,66 @@
 2013-07-26  Lucas Forschler  <[email protected]>
 
+        Merge r153378
+
+    2013-07-26  Tim Horton  <[email protected]>
+
+            Add a mode where autosizing fixes the FrameView height to at least the WKView height
+            https://bugs.webkit.org/show_bug.cgi?id=119104
+            <rdar://problem/14549021>
+
+            Reviewed by Anders Carlsson.
+
+            * Shared/WebPageCreationParameters.cpp:
+            (WebKit::WebPageCreationParameters::encode):
+            (WebKit::WebPageCreationParameters::decode):
+            * Shared/WebPageCreationParameters.h:
+            Add autoSizingShouldExpandToViewHeight parameter.
+
+            * UIProcess/API/mac/WKView.mm:
+            (-[WKView minimumWidthForAutoLayout]):
+            (-[WKView setMinimumWidthForAutoLayout:]):
+            Un-deprecate these as they're still useful if not sending a height.
+
+            (-[WKView shouldExpandToViewHeightForAutoLayout]):
+            (-[WKView setShouldExpandToViewHeightForAutoLayout:]):
+            * UIProcess/API/mac/WKViewPrivate.h:
+            New property, forward to WebPageProxy.
+
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::WebPageProxy):
+            (WebKit::WebPageProxy::creationParameters):
+            (WebKit::WebPageProxy::setAutoSizingShouldExpandToViewHeight):
+            * UIProcess/WebPageProxy.h:
+            (WebKit::WebPageProxy::autoSizingShouldExpandToViewHeight):
+            New property, forward to WebPage.
+
+            * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+            (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
+            If enabled, update the FrameView's autoSizeFixedMinimumHeight.
+
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::WebPage):
+            (WebKit::WebPage::setAutoSizingShouldExpandToViewHeight):
+            * WebProcess/WebPage/WebPage.h:
+            (WebKit::WebPage::autoSizingShouldExpandToViewHeight):
+            New property; if enabled, set FrameView's autoSizeFixedMinimumHeight,
+            otherwise reset it to 0.
+
+            * WebProcess/WebPage/WebPage.messages.in:
+            * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+            (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeTimerFired):
+            (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
+            Retrieve intrinsic content size explicitly from the FrameView, as
+            it may not have used it as its final contentsSize if
+            autoSizeFixedMinimumHeight is set.
+
+            Set the WebPage's size in case the load is committed so that the
+            WebFrameLoaderClient doesn't reset us to the wrong size.
+
+            Update autoSizeFixedMinimumHeight if enabled when the view size changes.
+
+2013-07-26  Lucas Forschler  <[email protected]>
+
         Merge r153107
 
     2013-07-24  Anders Carlsson  <[email protected]>

Modified: branches/safari-537-branch/Source/WebKit2/Shared/WebPageCreationParameters.cpp (153393 => 153394)


--- branches/safari-537-branch/Source/WebKit2/Shared/WebPageCreationParameters.cpp	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebKit2/Shared/WebPageCreationParameters.cpp	2013-07-27 00:22:23 UTC (rev 153394)
@@ -60,6 +60,7 @@
     encoder << mediaVolume;
     encoder << mayStartMediaWhenInWindow;
     encoder << minimumLayoutSize;
+    encoder << autoSizingShouldExpandToViewHeight;
     encoder.encodeEnum(scrollPinningBehavior);
 
 #if PLATFORM(MAC)
@@ -124,6 +125,8 @@
         return false;
     if (!decoder.decode(parameters.minimumLayoutSize))
         return false;
+    if (!decoder.decode(parameters.autoSizingShouldExpandToViewHeight))
+        return false;
     if (!decoder.decodeEnum(parameters.scrollPinningBehavior))
         return false;
     

Modified: branches/safari-537-branch/Source/WebKit2/Shared/WebPageCreationParameters.h (153393 => 153394)


--- branches/safari-537-branch/Source/WebKit2/Shared/WebPageCreationParameters.h	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebKit2/Shared/WebPageCreationParameters.h	2013-07-27 00:22:23 UTC (rev 153394)
@@ -90,6 +90,7 @@
     bool mayStartMediaWhenInWindow;
 
     WebCore::IntSize minimumLayoutSize;
+    bool autoSizingShouldExpandToViewHeight;
     
     WebCore::ScrollPinningBehavior scrollPinningBehavior;
 

Modified: branches/safari-537-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (153393 => 153394)


--- branches/safari-537-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2013-07-27 00:22:23 UTC (rev 153394)
@@ -3300,25 +3300,11 @@
 
 - (CGFloat)minimumWidthForAutoLayout
 {
-    static BOOL loggedDeprecationWarning = NO;
-
-    if (!loggedDeprecationWarning) {
-        NSLog(@"Please use minimumSizeForAutoLayout instead of minimumWidthForAutoLayout.");
-        loggedDeprecationWarning = YES;
-    }
-
     return self.minimumSizeForAutoLayout.width;
 }
 
 - (void)setMinimumWidthForAutoLayout:(CGFloat)minimumLayoutWidth
 {
-    static BOOL loggedDeprecationWarning = NO;
-
-    if (!loggedDeprecationWarning) {
-        NSLog(@"Please use setMinimumSizeForAutoLayout: instead of setMinimumWidthForAutoLayout:");
-        loggedDeprecationWarning = YES;
-    }
-
     self.minimumSizeForAutoLayout = NSMakeSize(minimumLayoutWidth, self.minimumSizeForAutoLayout.height);
 }
 
@@ -3337,6 +3323,16 @@
     [self setShouldClipToVisibleRect:expandsToFit];
 }
 
+- (BOOL)shouldExpandToViewHeightForAutoLayout
+{
+    return _data->_page->autoSizingShouldExpandToViewHeight();
+}
+
+- (void)setShouldExpandToViewHeightForAutoLayout:(BOOL)shouldExpand
+{
+    return _data->_page->setAutoSizingShouldExpandToViewHeight(shouldExpand);
+}
+
 - (BOOL)shouldClipToVisibleRect
 {
     return _data->_clipsToVisibleRect;

Modified: branches/safari-537-branch/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h (153393 => 153394)


--- branches/safari-537-branch/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h	2013-07-27 00:22:23 UTC (rev 153394)
@@ -62,6 +62,7 @@
 @property (readwrite) CGFloat minimumWidthForAutoLayout;
 @property (readwrite) NSSize minimumSizeForAutoLayout;
 @property (readwrite) BOOL shouldClipToVisibleRect;
+@property (readwrite) BOOL shouldExpandToViewHeightForAutoLayout;
 
 @property(copy, nonatomic) NSColor *underlayColor;
 

Modified: branches/safari-537-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (153393 => 153394)


--- branches/safari-537-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-07-27 00:22:23 UTC (rev 153394)
@@ -307,6 +307,7 @@
     , m_renderTreeSize(0)
     , m_shouldSendEventsSynchronously(false)
     , m_suppressVisibilityUpdates(false)
+    , m_autoSizingShouldExpandToViewHeight(false)
     , m_mediaVolume(1)
     , m_mayStartMediaWhenInWindow(true)
     , m_waitingForDidUpdateInWindowState(false)
@@ -3992,6 +3993,7 @@
     parameters.mediaVolume = m_mediaVolume;
     parameters.mayStartMediaWhenInWindow = m_mayStartMediaWhenInWindow;
     parameters.minimumLayoutSize = m_minimumLayoutSize;
+    parameters.autoSizingShouldExpandToViewHeight = m_autoSizingShouldExpandToViewHeight;
     parameters.scrollPinningBehavior = m_scrollPinningBehavior;
 
 #if PLATFORM(MAC)
@@ -4391,6 +4393,19 @@
 #endif
 }
 
+void WebPageProxy::setAutoSizingShouldExpandToViewHeight(bool shouldExpand)
+{
+    if (m_autoSizingShouldExpandToViewHeight == shouldExpand)
+        return;
+
+    m_autoSizingShouldExpandToViewHeight = shouldExpand;
+
+    if (!isValid())
+        return;
+
+    m_process->send(Messages::WebPage::SetAutoSizingShouldExpandToViewHeight(shouldExpand), m_pageID, 0);
+}
+
 #if PLATFORM(MAC)
 
 void WebPageProxy::substitutionsPanelIsShowing(bool& isShowing)

Modified: branches/safari-537-branch/Source/WebKit2/UIProcess/WebPageProxy.h (153393 => 153394)


--- branches/safari-537-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2013-07-27 00:22:23 UTC (rev 153394)
@@ -756,6 +756,9 @@
     WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
     void setMinimumLayoutSize(const WebCore::IntSize&);
 
+    bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
+    void setAutoSizingShouldExpandToViewHeight(bool);
+
     bool mainFrameInViewSourceMode() const { return m_mainFrameInViewSourceMode; }
     void setMainFrameInViewSourceMode(bool);
 
@@ -1257,6 +1260,7 @@
     bool m_shouldSendEventsSynchronously;
 
     bool m_suppressVisibilityUpdates;
+    bool m_autoSizingShouldExpandToViewHeight;
     WebCore::IntSize m_minimumLayoutSize;
 
     float m_mediaVolume;

Modified: branches/safari-537-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (153393 => 153394)


--- branches/safari-537-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2013-07-27 00:22:23 UTC (rev 153394)
@@ -1241,6 +1241,7 @@
         int minimumLayoutHeight = std::max(webPage->minimumLayoutSize().height(), 1);
         int maximumSize = std::numeric_limits<int>::max();
         m_frame->coreFrame()->view()->enableAutoSizeMode(true, IntSize(minimumLayoutWidth, minimumLayoutHeight), IntSize(maximumSize, maximumSize));
+        m_frame->coreFrame()->view()->setAutoSizeFixedMinimumHeight(webPage->size().height());
     }
 
     m_frame->coreFrame()->view()->setProhibitsScrolling(shouldDisableScrolling);

Modified: branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (153393 => 153394)


--- branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-07-27 00:22:23 UTC (rev 153394)
@@ -278,6 +278,7 @@
     , m_canShortCircuitHorizontalWheelEvents(false)
     , m_numWheelEventHandlers(0)
     , m_cachedPageCount(0)
+    , m_autoSizingShouldExpandToViewHeight(false)
 #if ENABLE(CONTEXT_MENUS)
     , m_isShowingContextMenu(false)
 #endif
@@ -380,6 +381,7 @@
     setIsInWindow(parameters.isInWindow);
 
     setMinimumLayoutSize(parameters.minimumLayoutSize);
+    setAutoSizingShouldExpandToViewHeight(parameters.autoSizingShouldExpandToViewHeight);
     
     setScrollPinningBehavior(parameters.scrollPinningBehavior);
 
@@ -3980,6 +3982,16 @@
     corePage()->mainFrame()->view()->enableAutoSizeMode(true, IntSize(minimumLayoutWidth, minimumLayoutHeight), IntSize(maximumSize, maximumSize));
 }
 
+void WebPage::setAutoSizingShouldExpandToViewHeight(bool shouldExpand)
+{
+    if (m_autoSizingShouldExpandToViewHeight == shouldExpand)
+        return;
+
+    m_autoSizingShouldExpandToViewHeight = shouldExpand;
+
+    corePage()->mainFrame()->view()->setAutoSizeFixedMinimumHeight(shouldExpand ? m_viewSize.height() : 0);
+}
+
 bool WebPage::isSmartInsertDeleteEnabled()
 {
     return m_page->settings()->smartInsertDeleteEnabled();

Modified: branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h (153393 => 153394)


--- branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-07-27 00:22:23 UTC (rev 153394)
@@ -642,6 +642,9 @@
     void setMinimumLayoutSize(const WebCore::IntSize&);
     WebCore::IntSize minimumLayoutSize() const { return m_minimumLayoutSize; }
 
+    void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
+    bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
+
     bool canShowMIMEType(const String& MIMEType) const;
 
     void addTextCheckingRequest(uint64_t requestID, PassRefPtr<WebCore::TextCheckingRequest>);
@@ -1006,6 +1009,7 @@
     unsigned m_cachedPageCount;
 
     WebCore::IntSize m_minimumLayoutSize;
+    bool m_autoSizingShouldExpandToViewHeight;
 
 #if ENABLE(CONTEXT_MENUS)
     bool m_isShowingContextMenu;

Modified: branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (153393 => 153394)


--- branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2013-07-27 00:22:23 UTC (rev 153394)
@@ -289,6 +289,7 @@
 #endif
 
     SetMinimumLayoutSize(WebCore::IntSize minimumLayoutSize)
+    SetAutoSizingShouldExpandToViewHeight(bool shouldExpand)
 
 #if PLATFORM(EFL)
     ConfirmComposition(WTF::String compositionString)

Modified: branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (153393 => 153394)


--- branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2013-07-26 23:54:54 UTC (rev 153393)
+++ branches/safari-537-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2013-07-27 00:22:23 UTC (rev 153394)
@@ -275,7 +275,7 @@
     if (!frameView)
         return;
 
-    IntSize contentSize = frameView->contentsSize();
+    IntSize contentSize = frameView->autoSizingIntrinsicContentSize();
 
     if (m_lastSentIntrinsicContentSize == contentSize)
         return;
@@ -449,13 +449,18 @@
     IntSize size = viewSize;
     IntSize contentSize = IntSize(-1, -1);
 
-    if (!m_webPage->minimumLayoutSize().width())
+    if (!m_webPage->minimumLayoutSize().width() || m_webPage->autoSizingShouldExpandToViewHeight())
         m_webPage->setSize(size);
 
+    FrameView* frameView = m_webPage->mainFrameView();
+
+    if (m_webPage->autoSizingShouldExpandToViewHeight() && frameView)
+        frameView->setAutoSizeFixedMinimumHeight(viewSize.height());
+
     m_webPage->layoutIfNeeded();
 
-    if (m_webPage->minimumLayoutSize().width()) {
-        contentSize = m_webPage->mainWebFrame()->contentBounds().size();
+    if (m_webPage->minimumLayoutSize().width() && frameView) {
+        contentSize = frameView->autoSizingIntrinsicContentSize();
         size = contentSize;
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to