Diff
Modified: trunk/LayoutTests/ChangeLog (259186 => 259187)
--- trunk/LayoutTests/ChangeLog 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/LayoutTests/ChangeLog 2020-03-30 07:33:06 UTC (rev 259187)
@@ -1,3 +1,18 @@
+2020-03-29 Antoine Quint <[email protected]>
+
+ [AutoSizing] Bring back the old auto-sizing code as a deprecated codepath for compatibility reasons
+ https://bugs.webkit.org/show_bug.cgi?id=209669
+ <rdar://problem/60111081>
+
+ Reviewed by Alan Bujtas and Darin Adler.
+
+ The methods internals.enableAutoSizeMode() has changed to internals.enableFixedWidthAutoSizeMode().
+
+ * css3/viewport-percentage-lengths/vh-auto-size-expected.html:
+ * css3/viewport-percentage-lengths/vh-auto-size.html:
+ * fast/dynamic/crash-subtree-layout-when-auto-size-enabled.html:
+ * fast/dynamic/mail-autosize-viewport-unit.html:
+
2020-03-29 Lauro Moura <[email protected]>
[GTK][WPE] Gardening some tests related to vertical text baselines
Modified: trunk/LayoutTests/css3/viewport-percentage-lengths/vh-auto-size-expected.html (259186 => 259187)
--- trunk/LayoutTests/css3/viewport-percentage-lengths/vh-auto-size-expected.html 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/LayoutTests/css3/viewport-percentage-lengths/vh-auto-size-expected.html 2020-03-30 07:33:06 UTC (rev 259187)
@@ -1,6 +1,6 @@
<script>
if (window.internals)
- internals.enableAutoSizeMode(true, 1000, 1);
+ internals.enableFixedWidthAutoSizeMode(true, 1000, 1);
</script>
text text text text text text text
<div style="height:1000px; border:2px solid green">
Modified: trunk/LayoutTests/css3/viewport-percentage-lengths/vh-auto-size.html (259186 => 259187)
--- trunk/LayoutTests/css3/viewport-percentage-lengths/vh-auto-size.html 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/LayoutTests/css3/viewport-percentage-lengths/vh-auto-size.html 2020-03-30 07:33:06 UTC (rev 259187)
@@ -2,7 +2,7 @@
<head>
<script>
if (window.internals)
- internals.enableAutoSizeMode(true, 1000, 1);
+ internals.enableFixedWidthAutoSizeMode(true, 1000, 1);
</script>
</head>
<body>
Modified: trunk/LayoutTests/fast/dynamic/crash-subtree-layout-when-auto-size-enabled.html (259186 => 259187)
--- trunk/LayoutTests/fast/dynamic/crash-subtree-layout-when-auto-size-enabled.html 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/LayoutTests/fast/dynamic/crash-subtree-layout-when-auto-size-enabled.html 2020-03-30 07:33:06 UTC (rev 259187)
@@ -15,7 +15,7 @@
<div>Pass if no crash or assert.<div id=resizeThis></div></div>
<script>
if (window.internals)
- internals.enableAutoSizeMode(true, 800, 600);
+ internals.enableFixedWidthAutoSizeMode(true, 800, 600);
if (window.testRunner) {
testRunner.waitUntilDone();
Modified: trunk/LayoutTests/fast/dynamic/mail-autosize-viewport-unit.html (259186 => 259187)
--- trunk/LayoutTests/fast/dynamic/mail-autosize-viewport-unit.html 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/LayoutTests/fast/dynamic/mail-autosize-viewport-unit.html 2020-03-30 07:33:06 UTC (rev 259187)
@@ -25,7 +25,7 @@
</style>
<script>
if (window.internals)
- internals.enableAutoSizeMode(true, 2000, 600);
+ internals.enableFixedWidthAutoSizeMode(true, 2000, 600);
if (window.testRunner)
testRunner.dumpAsText();
@@ -45,7 +45,7 @@
+ window.getComputedStyle(w10, null).getPropertyValue("width") + " "
+ window.getComputedStyle(w0, null).getPropertyValue("width");
if (window.internals)
- internals.enableAutoSizeMode(false, 0, 0, 0, 0);
+ internals.enableFixedWidthAutoSizeMode(false, 0, 0, 0, 0);
</script>
</body>
</html>
Modified: trunk/Source/WebCore/ChangeLog (259186 => 259187)
--- trunk/Source/WebCore/ChangeLog 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebCore/ChangeLog 2020-03-30 07:33:06 UTC (rev 259187)
@@ -1,3 +1,29 @@
+2020-03-29 Antoine Quint <[email protected]>
+
+ [AutoSizing] Bring back the old auto-sizing code as a deprecated codepath for compatibility reasons
+ https://bugs.webkit.org/show_bug.cgi?id=209669
+ <rdar://problem/60111081>
+
+ Reviewed by Alan Bujtas and Darin Adler.
+
+ We changed the auto-sizing code for webkit.org/b/196743 in r244098, but some clients need it and we bring it back
+ via two exclusive auto-sizing mode: fixed-width (the existing mode) and size-to-content (the resurrected mode).
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::autoSizeIfEnabled):
+ (WebCore::FrameView::performFixedWidthAutoSize):
+ (WebCore::FrameView::performSizeToContentAutoSize):
+ (WebCore::FrameView::enableFixedWidthAutoSizeMode):
+ (WebCore::FrameView::enableSizeToContentAutoSizeMode):
+ (WebCore::FrameView::enableAutoSizeMode):
+ * page/FrameView.h:
+ * testing/Internals.cpp:
+ (WebCore::Internals::resetToConsistentState):
+ (WebCore::Internals::enableFixedWidthAutoSizeMode):
+ (WebCore::Internals::enableAutoSizeMode): Deleted.
+ * testing/Internals.h:
+ * testing/Internals.idl:
+
2020-03-29 Darin Adler <[email protected]>
Move TextIterator::rangeFromLocationAndLength off of live ranges
Modified: trunk/Source/WebCore/page/FrameView.cpp (259186 => 259187)
--- trunk/Source/WebCore/page/FrameView.cpp 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebCore/page/FrameView.cpp 2020-03-30 07:33:06 UTC (rev 259187)
@@ -3423,11 +3423,33 @@
if (!firstChild)
return;
- LOG(Layout, "FrameView %p autoSizeIfEnabled", this);
SetForScope<bool> changeInAutoSize(m_inAutoSize, true);
if (layoutContext().subtreeLayoutRoot())
layoutContext().convertSubtreeLayoutToFullLayout();
+ switch (m_autoSizeMode) {
+ case AutoSizeMode::SizeToContent:
+ performSizeToContentAutoSize();
+ break;
+ case AutoSizeMode::FixedWidth:
+ performFixedWidthAutoSize();
+ break;
+ }
+
+ if (auto* page = frame().page())
+ page->chrome().client().intrinsicContentsSizeChanged(m_autoSizeContentSize);
+
+ m_didRunAutosize = true;
+}
+
+void FrameView::performFixedWidthAutoSize()
+{
+ LOG(Layout, "FrameView %p performFixedWidthAutoSize", this);
+
+ auto* document = frame().document();
+ auto* renderView = document->renderView();
+ auto* firstChild = renderView->firstChild();
+
ScrollbarMode horizonalScrollbarMode = ScrollbarAlwaysOff;
ScrollbarMode verticalScrollbarMode = ScrollbarAlwaysOff;
setVerticalScrollbarLock(false);
@@ -3442,7 +3464,7 @@
Ref<FrameView> protectedThis(*this);
document->updateStyleIfNeeded();
document->updateLayoutIgnorePendingStylesheets();
- // While the final content size could slightly be different after the next resize/layout (see below), we intentionally save and report
+ // While the final content size could slightly be different after the next resize/layout (see below), we intentionally save and report
// the current value to avoid unstable layout (e.g. content "height: 100%").
// See also webkit.org/b/173561
m_autoSizeContentSize = contentsSize();
@@ -3451,11 +3473,93 @@
auto finalHeight = m_autoSizeFixedMinimumHeight ? std::max(m_autoSizeFixedMinimumHeight, m_autoSizeContentSize.height()) : m_autoSizeContentSize.height();
resize(finalWidth, finalHeight);
document->updateLayoutIgnorePendingStylesheets();
- if (auto* page = frame().page())
- page->chrome().client().intrinsicContentsSizeChanged(m_autoSizeContentSize);
- m_didRunAutosize = true;
}
+void FrameView::performSizeToContentAutoSize()
+{
+ LOG(Layout, "FrameView %p performSizeToContentAutoSize", this);
+
+ auto* document = frame().document();
+ auto* renderView = document->renderView();
+
+ IntSize minAutoSize(1, 1);
+
+ // Start from the minimum size and allow it to grow.
+ resize(minAutoSize.width(), minAutoSize.height());
+ IntSize size = frameRect().size();
+ // Do the resizing twice. The first time is basically a rough calculation using the preferred width
+ // which may result in a height change during the second iteration.
+ for (int i = 0; i < 2; i++) {
+ // Update various sizes including contentsSize, scrollHeight, etc.
+ document->updateLayoutIgnorePendingStylesheets();
+ int width = renderView->minPreferredLogicalWidth();
+ int height = renderView->documentRect().height();
+ IntSize newSize(width, height);
+
+ // Check to see if a scrollbar is needed for a given dimension and
+ // if so, increase the other dimension to account for the scrollbar.
+ // Since the dimensions are only for the view rectangle, once a
+ // dimension exceeds the maximum, there is no need to increase it further.
+ if (newSize.width() > m_autoSizeConstraint.width()) {
+ RefPtr<Scrollbar> localHorizontalScrollbar = horizontalScrollbar();
+ if (!localHorizontalScrollbar)
+ localHorizontalScrollbar = createScrollbar(HorizontalScrollbar);
+ newSize.expand(0, localHorizontalScrollbar->occupiedHeight());
+
+ // Don't bother checking for a vertical scrollbar because the width is at
+ // already greater the maximum.
+ } else if (newSize.height() > m_autoSizeConstraint.height()) {
+ RefPtr<Scrollbar> localVerticalScrollbar = verticalScrollbar();
+ if (!localVerticalScrollbar)
+ localVerticalScrollbar = createScrollbar(VerticalScrollbar);
+ newSize.expand(localVerticalScrollbar->occupiedWidth(), 0);
+
+ // Don't bother checking for a horizontal scrollbar because the height is
+ // already greater the maximum.
+ }
+
+ // Ensure the size is at least the min bounds.
+ newSize = newSize.expandedTo(minAutoSize);
+
+ // Bound the dimensions by the max bounds and determine what scrollbars to show.
+ ScrollbarMode horizonalScrollbarMode = ScrollbarAlwaysOff;
+ if (newSize.width() > m_autoSizeConstraint.width()) {
+ newSize.setWidth(m_autoSizeConstraint.width());
+ horizonalScrollbarMode = ScrollbarAlwaysOn;
+ }
+ ScrollbarMode verticalScrollbarMode = ScrollbarAlwaysOff;
+ if (newSize.height() > m_autoSizeConstraint.height()) {
+ newSize.setHeight(m_autoSizeConstraint.height());
+ verticalScrollbarMode = ScrollbarAlwaysOn;
+ }
+
+ if (newSize == size)
+ continue;
+
+ // While loading only allow the size to increase (to avoid twitching during intermediate smaller states)
+ // unless autoresize has just been turned on or the maximum size is smaller than the current size.
+ if (m_didRunAutosize && size.height() <= m_autoSizeConstraint.height() && size.width() <= m_autoSizeConstraint.width()
+ && !frame().loader().isComplete() && (newSize.height() < size.height() || newSize.width() < size.width()))
+ break;
+
+ // The first time around, resize to the minimum height again; otherwise,
+ // on pages (e.g. quirks mode) where the body/document resize to the view size,
+ // we'll end up not shrinking back down after resizing to the computed preferred width.
+ resize(newSize.width(), i ? newSize.height() : minAutoSize.height());
+ // Force the scrollbar state to avoid the scrollbar code adding them and causing them to be needed. For example,
+ // a vertical scrollbar may cause text to wrap and thus increase the height (which is the only reason the scollbar is needed).
+ setVerticalScrollbarLock(false);
+ setHorizontalScrollbarLock(false);
+ setScrollbarModes(horizonalScrollbarMode, verticalScrollbarMode, true, true);
+ }
+ // All the resizing above may have invalidated style (for example if viewport units are being used).
+
+ document->updateStyleIfNeeded();
+ // FIXME: Use the final layout's result as the content size (webkit.org/b/173561).
+ document->updateLayoutIgnorePendingStylesheets();
+ m_autoSizeContentSize = contentsSize();
+}
+
void FrameView::setAutoSizeFixedMinimumHeight(int fixedMinimumHeight)
{
if (m_autoSizeFixedMinimumHeight == fixedMinimumHeight)
@@ -4465,12 +4569,23 @@
return &renderView->frameView() == this;
}
-void FrameView::enableAutoSizeMode(bool enable, const IntSize& viewSize)
+void FrameView::enableFixedWidthAutoSizeMode(bool enable, const IntSize& viewSize)
{
+ enableAutoSizeMode(enable, viewSize, AutoSizeMode::FixedWidth);
+}
+
+void FrameView::enableSizeToContentAutoSizeMode(bool enable, const IntSize& viewSize)
+{
+ enableAutoSizeMode(enable, viewSize, AutoSizeMode::SizeToContent);
+}
+
+void FrameView::enableAutoSizeMode(bool enable, const IntSize& viewSize, AutoSizeMode mode)
+{
ASSERT(!enable || !viewSize.isEmpty());
if (m_shouldAutoSize == enable && m_autoSizeConstraint == viewSize)
return;
+ m_autoSizeMode = mode;
m_shouldAutoSize = enable;
m_autoSizeConstraint = viewSize;
m_autoSizeContentSize = contentsSize();
Modified: trunk/Source/WebCore/page/FrameView.h (259186 => 259187)
--- trunk/Source/WebCore/page/FrameView.h 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebCore/page/FrameView.h 2020-03-30 07:33:06 UTC (rev 259187)
@@ -399,9 +399,11 @@
bool isVisuallyNonEmpty() const { return m_contentQualifiesAsVisuallyNonEmpty; }
void checkAndDispatchDidReachVisuallyNonEmptyState();
- WEBCORE_EXPORT void enableAutoSizeMode(bool enable, const IntSize& minSize);
+ WEBCORE_EXPORT void enableFixedWidthAutoSizeMode(bool enable, const IntSize& minSize);
+ WEBCORE_EXPORT void enableSizeToContentAutoSizeMode(bool enable, const IntSize& maxSize);
WEBCORE_EXPORT void setAutoSizeFixedMinimumHeight(int);
- bool isAutoSizeEnabled() const { return m_shouldAutoSize; }
+ bool isFixedWidthAutoSizeEnabled() const { return m_shouldAutoSize && m_autoSizeMode == AutoSizeMode::FixedWidth; }
+ bool isSizeToContentAutoSizeEnabled() const { return m_shouldAutoSize && m_autoSizeMode == AutoSizeMode::SizeToContent; }
IntSize autoSizingIntrinsicContentSize() const { return m_autoSizeContentSize; }
WEBCORE_EXPORT void forceLayout(bool allowSubtreeLayout = false);
@@ -704,7 +706,12 @@
void forceLayoutParentViewIfNeeded();
void flushPostLayoutTasksQueue();
void performPostLayoutTasks();
+
+ enum class AutoSizeMode : uint8_t { FixedWidth, SizeToContent };
+ void enableAutoSizeMode(bool enable, const IntSize& minSize, AutoSizeMode);
void autoSizeIfEnabled();
+ void performFixedWidthAutoSize();
+ void performSizeToContentAutoSize();
void applyRecursivelyWithVisibleRect(const WTF::Function<void (FrameView& frameView, const IntRect& visibleRect)>&);
void resumeVisibleImageAnimations(const IntRect& visibleRect);
@@ -931,6 +938,7 @@
bool m_hasFlippedBlockRenderers { false };
bool m_speculativeTilingDelayDisabledForTesting { false };
+ AutoSizeMode m_autoSizeMode { AutoSizeMode::FixedWidth };
// If true, automatically resize the frame view around its content.
bool m_shouldAutoSize { false };
bool m_inAutoSize { false };
Modified: trunk/Source/WebCore/testing/Internals.cpp (259186 => 259187)
--- trunk/Source/WebCore/testing/Internals.cpp 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebCore/testing/Internals.cpp 2020-03-30 07:33:06 UTC (rev 259187)
@@ -491,7 +491,7 @@
page.setTopContentInset(0);
mainFrameView->setUseFixedLayout(false);
mainFrameView->setFixedLayoutSize(IntSize());
- mainFrameView->enableAutoSizeMode(false, { });
+ mainFrameView->enableFixedWidthAutoSizeMode(false, { });
#if USE(COORDINATED_GRAPHICS)
mainFrameView->setFixedVisibleContentRect(IntRect());
#endif
@@ -3581,12 +3581,12 @@
frame()->loader().reload(ReloadOption::ExpiredOnly);
}
-void Internals::enableAutoSizeMode(bool enabled, int width, int height)
+void Internals::enableFixedWidthAutoSizeMode(bool enabled, int width, int height)
{
auto* document = contextDocument();
if (!document || !document->view())
return;
- document->view()->enableAutoSizeMode(enabled, { width, height });
+ document->view()->enableFixedWidthAutoSizeMode(enabled, { width, height });
}
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
Modified: trunk/Source/WebCore/testing/Internals.h (259186 => 259187)
--- trunk/Source/WebCore/testing/Internals.h 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebCore/testing/Internals.h 2020-03-30 07:33:06 UTC (rev 259187)
@@ -538,7 +538,7 @@
void forceReload(bool endToEnd);
void reloadExpiredOnly();
- void enableAutoSizeMode(bool enabled, int width, int height);
+ void enableFixedWidthAutoSizeMode(bool enabled, int width, int height);
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
void initializeMockCDM();
Modified: trunk/Source/WebCore/testing/Internals.idl (259186 => 259187)
--- trunk/Source/WebCore/testing/Internals.idl 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebCore/testing/Internals.idl 2020-03-30 07:33:06 UTC (rev 259187)
@@ -564,7 +564,7 @@
void forceReload(boolean endToEnd);
void reloadExpiredOnly();
- void enableAutoSizeMode(boolean enabled, long width, long height);
+ void enableFixedWidthAutoSizeMode(boolean enabled, long width, long height);
[Conditional=VIDEO] sequence<DOMString> mediaResponseSources(HTMLMediaElement media);
[Conditional=VIDEO] sequence<DOMString> mediaResponseContentRanges(HTMLMediaElement media);
Modified: trunk/Source/WebKit/ChangeLog (259186 => 259187)
--- trunk/Source/WebKit/ChangeLog 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/ChangeLog 2020-03-30 07:33:06 UTC (rev 259187)
@@ -1,3 +1,55 @@
+2020-03-29 Antoine Quint <[email protected]>
+
+ [AutoSizing] Bring back the old auto-sizing code as a deprecated codepath for compatibility reasons
+ https://bugs.webkit.org/show_bug.cgi?id=209669
+ <rdar://problem/60111081>
+
+ Reviewed by Alan Bujtas and Darin Adler.
+
+ We changed the auto-sizing code for webkit.org/b/196743 in r244098, but some clients need it and we bring it back
+ via a new dedicated -[WKWebView _setSizeToContentAutoSizeMaximumSize:] SPI.
+
+ * Shared/WebPageCreationParameters.cpp:
+ (WebKit::WebPageCreationParameters::encode const):
+ (WebKit::WebPageCreationParameters::decode):
+ * Shared/WebPageCreationParameters.h:
+ * UIProcess/API/Cocoa/WKViewPrivate.h:
+ * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView sizeToContentAutoSizeMaximumSize]):
+ (-[WKView setSizeToContentAutoSizeMaximumSize:]):
+ * UIProcess/API/mac/WKWebViewMac.mm:
+ (-[WKWebView _sizeToContentAutoSizeMaximumSize]):
+ (-[WKWebView _setSizeToContentAutoSizeMaximumSize:]):
+ * UIProcess/Cocoa/WebViewImpl.h:
+ * UIProcess/Cocoa/WebViewImpl.mm:
+ (WebKit::WebViewImpl::setSizeToContentAutoSizeMaximumSize):
+ (WebKit::WebViewImpl::sizeToContentAutoSizeMaximumSize const):
+ (WebKit::WebViewImpl::setIntrinsicContentSize):
+ * UIProcess/DrawingAreaProxy.h:
+ (WebKit::DrawingAreaProxy::sizeToContentAutoSizeMaximumSizeDidChange):
+ * UIProcess/WebPageProxy.cpp:
+ * UIProcess/WebPageProxy.h:
+ (WebKit::WebPageProxy::sizeToContentAutoSizeMaximumSize const):
+ * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
+ * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
+ (WebKit::TiledCoreAnimationDrawingAreaProxy::sizeToContentAutoSizeMaximumSizeDidChange):
+ (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
+ (WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry):
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::m_processDisplayName):
+ (WebKit::WebPage::reinitializeWebPage):
+ (WebKit::WebPage::setMinimumSizeForAutoLayout):
+ (WebKit::WebPage::setSizeToContentAutoSizeMaximumSize):
+ (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
+ * WebProcess/WebPage/WebPage.h:
+ (WebKit::WebPage::sizeToContentAutoSizeMaximumSize const):
+ * WebProcess/WebPage/WebPage.messages.in:
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
+
2020-03-29 Darin Adler <[email protected]>
Move TextIterator::rangeFromLocationAndLength off of live ranges
Modified: trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp (259186 => 259187)
--- trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp 2020-03-30 07:33:06 UTC (rev 259187)
@@ -67,6 +67,7 @@
encoder << mayStartMediaWhenInWindow;
encoder << mediaPlaybackIsSuspended;
encoder << minimumSizeForAutoLayout;
+ encoder << sizeToContentAutoSizeMaximumSize;
encoder << autoSizingShouldExpandToViewHeight;
encoder << viewportSizeForCSSViewportUnits;
encoder.encodeEnum(scrollPinningBehavior);
@@ -248,6 +249,8 @@
return WTF::nullopt;
if (!decoder.decode(parameters.minimumSizeForAutoLayout))
return WTF::nullopt;
+ if (!decoder.decode(parameters.sizeToContentAutoSizeMaximumSize))
+ return WTF::nullopt;
if (!decoder.decode(parameters.autoSizingShouldExpandToViewHeight))
return WTF::nullopt;
if (!decoder.decode(parameters.viewportSizeForCSSViewportUnits))
Modified: trunk/Source/WebKit/Shared/WebPageCreationParameters.h (259186 => 259187)
--- trunk/Source/WebKit/Shared/WebPageCreationParameters.h 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/Shared/WebPageCreationParameters.h 2020-03-30 07:33:06 UTC (rev 259187)
@@ -118,6 +118,7 @@
bool mediaPlaybackIsSuspended { false };
WebCore::IntSize minimumSizeForAutoLayout;
+ WebCore::IntSize sizeToContentAutoSizeMaximumSize;
bool autoSizingShouldExpandToViewHeight;
Optional<WebCore::IntSize> viewportSizeForCSSViewportUnits;
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKViewPrivate.h (259186 => 259187)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKViewPrivate.h 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKViewPrivate.h 2020-03-30 07:33:06 UTC (rev 259187)
@@ -58,6 +58,7 @@
+ (void)hideWordDefinitionWindow;
@property (readwrite) NSSize minimumSizeForAutoLayout;
+@property (readwrite) NSSize sizeToContentAutoSizeMaximumSize;
@property (readwrite) BOOL shouldClipToVisibleRect;
@property (readwrite) BOOL shouldExpandToViewHeightForAutoLayout;
@property (readonly, getter=isUsingUISideCompositing) BOOL usingUISideCompositing;
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h (259186 => 259187)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h 2020-03-30 07:33:06 UTC (rev 259187)
@@ -508,6 +508,7 @@
@property (nonatomic, setter=_setShouldExpandContentToViewHeightForAutoLayout:) BOOL _shouldExpandContentToViewHeightForAutoLayout WK_API_AVAILABLE(macos(10.12));
@property (nonatomic, setter=_setMinimumLayoutWidth:) CGFloat _minimumLayoutWidth WK_API_AVAILABLE(macos(10.12));
+@property (nonatomic, setter=_setSizeToContentAutoSizeMaximumSize:) CGSize _sizeToContentAutoSizeMaximumSize;
@property (nonatomic, setter=_setAlwaysShowsHorizontalScroller:) BOOL _alwaysShowsHorizontalScroller WK_API_AVAILABLE(macos(10.13.4));
@property (nonatomic, setter=_setAlwaysShowsVerticalScroller:) BOOL _alwaysShowsVerticalScroller WK_API_AVAILABLE(macos(10.13.4));
Modified: trunk/Source/WebKit/UIProcess/API/mac/WKView.mm (259186 => 259187)
--- trunk/Source/WebKit/UIProcess/API/mac/WKView.mm 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/UIProcess/API/mac/WKView.mm 2020-03-30 07:33:06 UTC (rev 259187)
@@ -1268,6 +1268,16 @@
_data->_impl->setMinimumSizeForAutoLayout(NSSizeToCGSize(minimumSizeForAutoLayout));
}
+- (NSSize)sizeToContentAutoSizeMaximumSize
+{
+ return NSSizeFromCGSize(_data->_impl->sizeToContentAutoSizeMaximumSize());
+}
+
+- (void)setSizeToContentAutoSizeMaximumSize:(NSSize)sizeToContentAutoSizeMaximumSize
+{
+ _data->_impl->setSizeToContentAutoSizeMaximumSize(NSSizeToCGSize(sizeToContentAutoSizeMaximumSize));
+}
+
- (BOOL)shouldExpandToViewHeightForAutoLayout
{
return _data->_impl->shouldExpandToViewHeightForAutoLayout();
Modified: trunk/Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm (259186 => 259187)
--- trunk/Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm 2020-03-30 07:33:06 UTC (rev 259187)
@@ -1400,6 +1400,21 @@
_impl->setClipsToVisibleRect(expandsToFit);
}
+- (CGSize)_sizeToContentAutoSizeMaximumSize
+{
+ return _page->minimumSizeForAutoLayout();
+}
+
+- (void)_setSizeToContentAutoSizeMaximumSize:(CGSize)size
+{
+ BOOL expandsToFit = size.width > 0 && size.height > 0;
+
+ _page->setSizeToContentAutoSizeMaximumSize(WebCore::IntSize(size.width, size.height));
+ _page->setMainFrameIsScrollable(!expandsToFit);
+
+ _impl->setClipsToVisibleRect(expandsToFit);
+}
+
- (BOOL)_clipsToVisibleRect
{
return _impl->clipsToVisibleRect();
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h (259186 => 259187)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h 2020-03-30 07:33:06 UTC (rev 259187)
@@ -224,6 +224,8 @@
void setMinimumSizeForAutoLayout(CGSize);
CGSize minimumSizeForAutoLayout() const;
+ void setSizeToContentAutoSizeMaximumSize(CGSize);
+ CGSize sizeToContentAutoSizeMaximumSize() const;
void setShouldExpandToViewHeightForAutoLayout(bool);
bool shouldExpandToViewHeightForAutoLayout() const;
void setIntrinsicContentSize(CGSize);
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (259186 => 259187)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2020-03-30 07:33:06 UTC (rev 259187)
@@ -1926,6 +1926,21 @@
return m_page->minimumSizeForAutoLayout();
}
+void WebViewImpl::setSizeToContentAutoSizeMaximumSize(CGSize sizeToContentAutoSizeMaximumSize)
+{
+ bool expandsToFit = sizeToContentAutoSizeMaximumSize.width > 0 && sizeToContentAutoSizeMaximumSize.height > 0;
+
+ m_page->setSizeToContentAutoSizeMaximumSize(WebCore::IntSize(sizeToContentAutoSizeMaximumSize));
+ m_page->setMainFrameIsScrollable(!expandsToFit);
+
+ setClipsToVisibleRect(expandsToFit);
+}
+
+CGSize WebViewImpl::sizeToContentAutoSizeMaximumSize() const
+{
+ return m_page->sizeToContentAutoSizeMaximumSize();
+}
+
void WebViewImpl::setShouldExpandToViewHeightForAutoLayout(bool shouldExpandToViewHeightForAutoLayout)
{
m_page->setAutoSizingShouldExpandToViewHeight(shouldExpandToViewHeightForAutoLayout);
@@ -1942,6 +1957,7 @@
// so we can report that that dimension is flexible. If not, we need to report our intrinsic width
// so that autolayout will know to provide space for us.
+ // FIXME: what to do here?
CGSize intrinsicContentSizeAcknowledgingFlexibleWidth = intrinsicContentSize;
if (intrinsicContentSize.width < m_page->minimumSizeForAutoLayout().width())
intrinsicContentSizeAcknowledgingFlexibleWidth.width = NSViewNoIntrinsicMetric;
Modified: trunk/Source/WebKit/UIProcess/DrawingAreaProxy.h (259186 => 259187)
--- trunk/Source/WebKit/UIProcess/DrawingAreaProxy.h 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/UIProcess/DrawingAreaProxy.h 2020-03-30 07:33:06 UTC (rev 259187)
@@ -80,6 +80,7 @@
virtual void colorSpaceDidChange() { }
virtual void minimumSizeForAutoLayoutDidChange() { }
+ virtual void sizeToContentAutoSizeMaximumSizeDidChange() { }
virtual void adjustTransientZoom(double, WebCore::FloatPoint) { }
virtual void commitTransientZoom(double, WebCore::FloatPoint) { }
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (259186 => 259187)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-03-30 07:33:06 UTC (rev 259187)
@@ -7699,6 +7699,7 @@
parameters.mayStartMediaWhenInWindow = m_mayStartMediaWhenInWindow;
parameters.mediaPlaybackIsSuspended = m_mediaPlaybackIsSuspended;
parameters.minimumSizeForAutoLayout = m_minimumSizeForAutoLayout;
+ parameters.sizeToContentAutoSizeMaximumSize = m_sizeToContentAutoSizeMaximumSize;
parameters.autoSizingShouldExpandToViewHeight = m_autoSizingShouldExpandToViewHeight;
parameters.viewportSizeForCSSViewportUnits = m_viewportSizeForCSSViewportUnits;
parameters.scrollPinningBehavior = m_scrollPinningBehavior;
@@ -8368,6 +8369,25 @@
#endif
}
+void WebPageProxy::setSizeToContentAutoSizeMaximumSize(const IntSize& size)
+{
+ if (m_sizeToContentAutoSizeMaximumSize == size)
+ return;
+
+ m_sizeToContentAutoSizeMaximumSize = size;
+
+ if (!hasRunningProcess())
+ return;
+
+ send(Messages::WebPage::SetSizeToContentAutoSizeMaximumSize(size));
+ m_drawingArea->sizeToContentAutoSizeMaximumSizeDidChange();
+
+#if USE(APPKIT)
+ if (m_sizeToContentAutoSizeMaximumSize.width() <= 0)
+ didChangeIntrinsicContentSize(IntSize(-1, -1));
+#endif
+}
+
void WebPageProxy::setAutoSizingShouldExpandToViewHeight(bool shouldExpand)
{
if (m_autoSizingShouldExpandToViewHeight == shouldExpand)
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (259186 => 259187)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2020-03-30 07:33:06 UTC (rev 259187)
@@ -1344,6 +1344,9 @@
WebCore::IntSize minimumSizeForAutoLayout() const { return m_minimumSizeForAutoLayout; }
void setMinimumSizeForAutoLayout(const WebCore::IntSize&);
+ WebCore::IntSize sizeToContentAutoSizeMaximumSize() const { return m_sizeToContentAutoSizeMaximumSize; }
+ void setSizeToContentAutoSizeMaximumSize(const WebCore::IntSize&);
+
bool autoSizingShouldExpandToViewHeight() const { return m_autoSizingShouldExpandToViewHeight; }
void setAutoSizingShouldExpandToViewHeight(bool);
@@ -2603,6 +2606,8 @@
bool m_suppressVisibilityUpdates { false };
bool m_autoSizingShouldExpandToViewHeight { false };
WebCore::IntSize m_minimumSizeForAutoLayout;
+ WebCore::IntSize m_sizeToContentAutoSizeMaximumSize;
+
Optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
// Visual viewports
Modified: trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h (259186 => 259187)
--- trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h 2020-03-30 07:33:06 UTC (rev 259187)
@@ -42,6 +42,7 @@
void sizeDidChange() override;
void colorSpaceDidChange() override;
void minimumSizeForAutoLayoutDidChange() override;
+ void sizeToContentAutoSizeMaximumSizeDidChange() override;
void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override;
void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override;
@@ -71,6 +72,9 @@
// The last minimum layout size we sent to the web process.
WebCore::IntSize m_lastSentMinimumSizeForAutoLayout;
+ // The last maxmium size for size-to-content auto-sizing we sent to the web process.
+ WebCore::IntSize m_lastSentSizeToContentAutoSizeMaximumSize;
+
CallbackMap m_callbacks;
};
Modified: trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm (259186 => 259187)
--- trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm 2020-03-30 07:33:06 UTC (rev 259187)
@@ -90,6 +90,19 @@
sendUpdateGeometry();
}
+void TiledCoreAnimationDrawingAreaProxy::sizeToContentAutoSizeMaximumSizeDidChange()
+{
+ if (!m_webPageProxy.hasRunningProcess())
+ return;
+
+ // We only want one UpdateGeometry message in flight at once, so if we've already sent one but
+ // haven't yet received the reply we'll just return early here.
+ if (m_isWaitingForDidUpdateGeometry)
+ return;
+
+ sendUpdateGeometry();
+}
+
void TiledCoreAnimationDrawingAreaProxy::enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext& layerTreeContext)
{
m_webPageProxy.enterAcceleratedCompositingMode(layerTreeContext);
@@ -107,10 +120,11 @@
m_isWaitingForDidUpdateGeometry = false;
IntSize minimumSizeForAutoLayout = m_webPageProxy.minimumSizeForAutoLayout();
+ IntSize sizeToContentAutoSizeMaximumSize = m_webPageProxy.sizeToContentAutoSizeMaximumSize();
// If the WKView was resized while we were waiting for a DidUpdateGeometry reply from the web process,
// we need to resend the new size here.
- if (m_lastSentSize != m_size || m_lastSentMinimumSizeForAutoLayout != minimumSizeForAutoLayout)
+ if (m_lastSentSize != m_size || m_lastSentMinimumSizeForAutoLayout != minimumSizeForAutoLayout || m_lastSentSizeToContentAutoSizeMaximumSize != sizeToContentAutoSizeMaximumSize)
sendUpdateGeometry();
}
@@ -123,6 +137,7 @@
void TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry()
{
m_lastSentMinimumSizeForAutoLayout = m_webPageProxy.minimumSizeForAutoLayout();
+ m_lastSentSizeToContentAutoSizeMaximumSize = m_webPageProxy.sizeToContentAutoSizeMaximumSize();
m_lastSentSize = m_size;
m_isWaitingForDidUpdateGeometry = true;
}
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (259186 => 259187)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2020-03-30 07:33:06 UTC (rev 259187)
@@ -1507,12 +1507,20 @@
RefPtr<FrameView> view = m_frame->coreFrame()->view();
if (int width = webPage->minimumSizeForAutoLayout().width()) {
int height = std::max(webPage->minimumSizeForAutoLayout().height(), 1);
- view->enableAutoSizeMode(true, { width, height });
+ view->enableFixedWidthAutoSizeMode(true, { width, height });
if (webPage->autoSizingShouldExpandToViewHeight())
view->setAutoSizeFixedMinimumHeight(webPage->size().height());
}
+ IntSize sizeToContentAutoSizeMaximumSize = webPage->sizeToContentAutoSizeMaximumSize();
+ if (sizeToContentAutoSizeMaximumSize.width() && sizeToContentAutoSizeMaximumSize.height()) {
+ view->enableSizeToContentAutoSizeMode(true, sizeToContentAutoSizeMaximumSize);
+
+ if (webPage->autoSizingShouldExpandToViewHeight())
+ view->setAutoSizeFixedMinimumHeight(webPage->size().height());
+ }
+
if (auto viewportSizeForViewportUnits = webPage->viewportSizeForCSSViewportUnits())
view->setViewportSizeForCSSViewportUnits(*viewportSizeForViewportUnits);
view->setProhibitsScrolling(shouldDisableScrolling);
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (259186 => 259187)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-03-30 07:33:06 UTC (rev 259187)
@@ -633,6 +633,7 @@
updateIsInWindow(true);
setMinimumSizeForAutoLayout(parameters.minimumSizeForAutoLayout);
+ setSizeToContentAutoSizeMaximumSize(parameters.sizeToContentAutoSizeMaximumSize);
setAutoSizingShouldExpandToViewHeight(parameters.autoSizingShouldExpandToViewHeight);
setViewportSizeForCSSViewportUnits(parameters.viewportSizeForCSSViewportUnits);
@@ -794,6 +795,7 @@
}
setMinimumSizeForAutoLayout(parameters.minimumSizeForAutoLayout);
+ setSizeToContentAutoSizeMaximumSize(parameters.sizeToContentAutoSizeMaximumSize);
if (m_activityState != parameters.activityState)
setActivityState(parameters.activityState, ActivityStateChangeAsynchronous, Vector<CallbackID>());
@@ -5678,13 +5680,27 @@
m_minimumSizeForAutoLayout = size;
if (size.width() <= 0) {
- corePage()->mainFrame().view()->enableAutoSizeMode(false, { });
+ corePage()->mainFrame().view()->enableFixedWidthAutoSizeMode(false, { });
return;
}
- corePage()->mainFrame().view()->enableAutoSizeMode(true, { size.width(), std::max(size.height(), 1) });
+ corePage()->mainFrame().view()->enableFixedWidthAutoSizeMode(true, { size.width(), std::max(size.height(), 1) });
}
+void WebPage::setSizeToContentAutoSizeMaximumSize(const IntSize& size)
+{
+ if (m_sizeToContentAutoSizeMaximumSize == size)
+ return;
+
+ m_sizeToContentAutoSizeMaximumSize = size;
+ if (size.width() <= 0 || size.height() <= 0) {
+ corePage()->mainFrame().view()->enableSizeToContentAutoSizeMode(false, { });
+ return;
+ }
+
+ corePage()->mainFrame().view()->enableSizeToContentAutoSizeMode(true, size);
+}
+
void WebPage::setAutoSizingShouldExpandToViewHeight(bool shouldExpand)
{
if (m_autoSizingShouldExpandToViewHeight == shouldExpand)
@@ -6432,10 +6448,10 @@
void WebPage::updateIntrinsicContentSizeIfNeeded(const WebCore::IntSize& size)
{
- if (!minimumSizeForAutoLayout().width())
+ if (!minimumSizeForAutoLayout().width() && !sizeToContentAutoSizeMaximumSize().width() && !sizeToContentAutoSizeMaximumSize().height())
return;
ASSERT(mainFrameView());
- ASSERT(mainFrameView()->isAutoSizeEnabled());
+ ASSERT(mainFrameView()->isFixedWidthAutoSizeEnabled() || mainFrameView()->isSizeToContentAutoSizeEnabled());
ASSERT(!mainFrameView()->needsLayout());
if (m_lastSentIntrinsicContentSize == size)
return;
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (259186 => 259187)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2020-03-30 07:33:06 UTC (rev 259187)
@@ -1065,6 +1065,9 @@
void setMinimumSizeForAutoLayout(const WebCore::IntSize&);
WebCore::IntSize minimumSizeForAutoLayout() const { return m_minimumSizeForAutoLayout; }
+ void setSizeToContentAutoSizeMaximumSize(const WebCore::IntSize&);
+ WebCore::IntSize sizeToContentAutoSizeMaximumSize() const { return m_sizeToContentAutoSizeMaximumSize; }
+
void setAutoSizingShouldExpandToViewHeight(bool shouldExpand);
bool autoSizingShouldExpandToViewHeight() { return m_autoSizingShouldExpandToViewHeight; }
@@ -1907,6 +1910,7 @@
HashSet<unsigned long> m_trackedNetworkResourceRequestIdentifiers;
WebCore::IntSize m_minimumSizeForAutoLayout;
+ WebCore::IntSize m_sizeToContentAutoSizeMaximumSize;
bool m_autoSizingShouldExpandToViewHeight { false };
Optional<WebCore::IntSize> m_viewportSizeForCSSViewportUnits;
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (259186 => 259187)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2020-03-30 07:33:06 UTC (rev 259187)
@@ -461,6 +461,7 @@
SetAlwaysShowsVerticalScroller(bool alwaysShowsVerticalScroller)
SetMinimumSizeForAutoLayout(WebCore::IntSize size)
+ SetSizeToContentAutoSizeMaximumSize(WebCore::IntSize size)
SetAutoSizingShouldExpandToViewHeight(bool shouldExpand)
SetViewportSizeForCSSViewportUnits(Optional<WebCore::IntSize> viewportSize)
Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (259186 => 259187)
--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2020-03-30 03:22:09 UTC (rev 259186)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2020-03-30 07:33:06 UTC (rev 259187)
@@ -584,7 +584,7 @@
IntSize size = viewSize;
IntSize contentSize = IntSize(-1, -1);
- if (!m_webPage.minimumSizeForAutoLayout().width() || m_webPage.autoSizingShouldExpandToViewHeight())
+ if (!m_webPage.minimumSizeForAutoLayout().width() || m_webPage.autoSizingShouldExpandToViewHeight() || (!m_webPage.sizeToContentAutoSizeMaximumSize().width() && !m_webPage.sizeToContentAutoSizeMaximumSize().height()))
m_webPage.setSize(size);
FrameView* frameView = m_webPage.mainFrameView();
@@ -594,7 +594,7 @@
m_webPage.layoutIfNeeded();
- if (m_webPage.minimumSizeForAutoLayout().width() && frameView) {
+ if (frameView && (m_webPage.minimumSizeForAutoLayout().width() || (m_webPage.sizeToContentAutoSizeMaximumSize().width() && m_webPage.sizeToContentAutoSizeMaximumSize().height()))) {
contentSize = frameView->autoSizingIntrinsicContentSize();
size = contentSize;
}