Diff
Modified: trunk/Source/WebCore/ChangeLog (153377 => 153378)
--- trunk/Source/WebCore/ChangeLog 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebCore/ChangeLog 2013-07-26 20:09:25 UTC (rev 153378)
@@ -1,3 +1,25 @@
+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 Brent Fulgham <[email protected]>
[Windows] Remove workarounds now that rdar://problem/14390466 is fixed.
Modified: trunk/Source/WebCore/WebCore.exp.in (153377 => 153378)
--- trunk/Source/WebCore/WebCore.exp.in 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebCore/WebCore.exp.in 2013-07-26 20:09:25 UTC (rev 153378)
@@ -1176,6 +1176,7 @@
__ZN7WebCore9FrameView26adjustPageHeightDeprecatedEPffff
__ZN7WebCore9FrameView26adjustTiledBackingCoverageEv
__ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb
+__ZN7WebCore9FrameView29setAutoSizeFixedMinimumHeightEi
__ZN7WebCore9FrameView31setVisualUpdatesAllowedByClientEb
__ZN7WebCore9FrameView37setScrollingPerformanceLoggingEnabledEb
__ZN7WebCore9FrameView37updateLayoutAndStyleIfNeededRecursiveEv
Modified: trunk/Source/WebCore/page/FrameView.cpp (153377 => 153378)
--- trunk/Source/WebCore/page/FrameView.cpp 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebCore/page/FrameView.cpp 2013-07-26 20:09:25 UTC (rev 153378)
@@ -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)
@@ -2967,9 +2968,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: trunk/Source/WebCore/page/FrameView.h (153377 => 153378)
--- trunk/Source/WebCore/page/FrameView.h 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebCore/page/FrameView.h 2013-07-26 20:09:25 UTC (rev 153378)
@@ -298,6 +298,8 @@
void updateIsVisuallyNonEmpty();
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: trunk/Source/WebKit2/ChangeLog (153377 => 153378)
--- trunk/Source/WebKit2/ChangeLog 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebKit2/ChangeLog 2013-07-26 20:09:25 UTC (rev 153378)
@@ -1,3 +1,60 @@
+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-25 Andreas Kling <[email protected]>
ChromeClient::focusedNodeChanged() should be focusedElementChanged().
Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp (153377 => 153378)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2013-07-26 20:09:25 UTC (rev 153378)
@@ -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: trunk/Source/WebKit2/Shared/WebPageCreationParameters.h (153377 => 153378)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2013-07-26 20:09:25 UTC (rev 153378)
@@ -90,6 +90,7 @@
bool mayStartMediaWhenInWindow;
WebCore::IntSize minimumLayoutSize;
+ bool autoSizingShouldExpandToViewHeight;
WebCore::ScrollPinningBehavior scrollPinningBehavior;
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (153377 => 153378)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2013-07-26 20:09:25 UTC (rev 153378)
@@ -3229,25 +3229,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);
}
@@ -3266,6 +3252,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: trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h (153377 => 153378)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h 2013-07-26 20:09:25 UTC (rev 153378)
@@ -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: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (153377 => 153378)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-07-26 20:09:25 UTC (rev 153378)
@@ -306,6 +306,7 @@
, m_renderTreeSize(0)
, m_shouldSendEventsSynchronously(false)
, m_suppressVisibilityUpdates(false)
+ , m_autoSizingShouldExpandToViewHeight(false)
, m_mediaVolume(1)
, m_mayStartMediaWhenInWindow(true)
, m_waitingForDidUpdateInWindowState(false)
@@ -3955,6 +3956,7 @@
parameters.mediaVolume = m_mediaVolume;
parameters.mayStartMediaWhenInWindow = m_mayStartMediaWhenInWindow;
parameters.minimumLayoutSize = m_minimumLayoutSize;
+ parameters.autoSizingShouldExpandToViewHeight = m_autoSizingShouldExpandToViewHeight;
parameters.scrollPinningBehavior = m_scrollPinningBehavior;
#if PLATFORM(MAC)
@@ -4349,6 +4351,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: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (153377 => 153378)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-07-26 20:09:25 UTC (rev 153378)
@@ -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);
@@ -1252,6 +1255,7 @@
bool m_shouldSendEventsSynchronously;
bool m_suppressVisibilityUpdates;
+ bool m_autoSizingShouldExpandToViewHeight;
WebCore::IntSize m_minimumLayoutSize;
float m_mediaVolume;
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (153377 => 153378)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2013-07-26 20:09:25 UTC (rev 153378)
@@ -1212,6 +1212,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: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (153377 => 153378)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-07-26 20:09:25 UTC (rev 153378)
@@ -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);
@@ -3900,6 +3902,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: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (153377 => 153378)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-07-26 20:09:25 UTC (rev 153378)
@@ -639,6 +639,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>);
@@ -1003,6 +1006,7 @@
unsigned m_cachedPageCount;
WebCore::IntSize m_minimumLayoutSize;
+ bool m_autoSizingShouldExpandToViewHeight;
#if ENABLE(CONTEXT_MENUS)
bool m_isShowingContextMenu;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (153377 => 153378)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2013-07-26 20:09:25 UTC (rev 153378)
@@ -289,6 +289,7 @@
#endif
SetMinimumLayoutSize(WebCore::IntSize minimumLayoutSize)
+ SetAutoSizingShouldExpandToViewHeight(bool shouldExpand)
#if PLATFORM(EFL)
ConfirmComposition(WTF::String compositionString)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (153377 => 153378)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2013-07-26 19:19:34 UTC (rev 153377)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2013-07-26 20:09:25 UTC (rev 153378)
@@ -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;
}