Diff
Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (194296 => 194297)
--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog 2015-12-18 23:05:50 UTC (rev 194296)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog 2015-12-18 23:05:55 UTC (rev 194297)
@@ -1,3 +1,19 @@
+2015-12-18 Matthew Hanson <[email protected]>
+
+ Merge r194246. rdar://problem/23824469
+
+ 2015-12-17 Simon Fraser <[email protected]>
+
+ Disable viewport "shrink to fit" outside of multitasking mode
+ https://bugs.webkit.org/show_bug.cgi?id=152403
+ rdar://problem/23818102
+
+ Reviewed by Tim Horton.
+
+ This test no longer does shrink-to-fit, so starts with a min and initial scale of 1.
+
+ * fast/viewport/ios/width-is-device-width-overflowing-expected.txt:
+
2015-12-17 Matthew Hanson <[email protected]>
Merge r191076. rdar://problem/23941411
Modified: branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog (194296 => 194297)
--- branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog 2015-12-18 23:05:50 UTC (rev 194296)
+++ branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog 2015-12-18 23:05:55 UTC (rev 194297)
@@ -1,5 +1,48 @@
2015-12-18 Matthew Hanson <[email protected]>
+ Merge r194246. rdar://problem/23824469
+
+ 2015-12-17 Simon Fraser <[email protected]>
+
+ Disable viewport "shrink to fit" outside of multitasking mode
+ https://bugs.webkit.org/show_bug.cgi?id=152403
+ rdar://problem/23818102
+
+ Reviewed by Tim Horton.
+
+ Plumb through a value that indicates whether the WKWebView is in split screen,
+ and use it to conditionally enable shrink-to-fit mode only in split screen.
+
+ * Shared/VisibleContentRectUpdateInfo.cpp: Added m_allowShrinkToFit, and sort
+ the member variables, and encoding order, to optimize packing, with some initializers.
+ (WebKit::VisibleContentRectUpdateInfo::encode):
+ (WebKit::VisibleContentRectUpdateInfo::decode):
+ * Shared/VisibleContentRectUpdateInfo.h:
+ (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
+ (WebKit::VisibleContentRectUpdateInfo::allowShrinkToFit):
+ (WebKit::operator==):
+ * UIProcess/API/Cocoa/WKWebView.mm: Add _allowsViewportShrinkToFit member variable,
+ with getter and setter.
+ (-[WKWebView _updateVisibleContentRects]): Unwrap the line.
+ (-[WKWebView _setAllowsViewportShrinkToFit:]):
+ (-[WKWebView _allowsViewportShrinkToFit]):
+ * UIProcess/API/Cocoa/WKWebViewPrivate.h: _allowsViewportShrinkToFit SPI.
+ * UIProcess/WebPageProxy.h: Pass allowShrinkToFit through.
+ * UIProcess/ios/WKContentView.mm: Ditto.
+ (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::updateVisibleContentRects): Padd allowShrinkToFit to the web process via the VisibleContentRectUpdateInfo.
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences): Store m_ignoreViewportScalingConstraints in a member variable since we can't
+ get back to the prefs later.
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::updateVisibleContentRects): This is the behavior change: call setCanIgnoreScalingConstraints()
+ on the viewport configuration, consulting the pref (via m_ignoreViewportScalingConstraints) and the new
+ visibleContentRectUpdateInfo.allowShrinkToFit().
+
+2015-12-18 Matthew Hanson <[email protected]>
+
Merge r194206. rdar://problem/23824469
2015-12-16 Simon Fraser <[email protected]>
Modified: branches/safari-601.1.46-branch/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp (194296 => 194297)
--- branches/safari-601.1.46-branch/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp 2015-12-18 23:05:50 UTC (rev 194296)
+++ branches/safari-601.1.46-branch/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp 2015-12-18 23:05:55 UTC (rev 194297)
@@ -36,14 +36,15 @@
encoder << m_unobscuredRect;
encoder << m_unobscuredRectInScrollViewCoordinates;
encoder << m_customFixedPositionRect;
+ encoder << m_lastLayerTreeTransactionID;
encoder << m_scale;
- encoder << m_inStableState;
- encoder << m_isChangingObscuredInsetsInteractively;
encoder << m_timestamp;
encoder << m_horizontalVelocity;
encoder << m_verticalVelocity;
encoder << m_scaleChangeRate;
- encoder << m_lastLayerTreeTransactionID;
+ encoder << m_inStableState;
+ encoder << m_isChangingObscuredInsetsInteractively;
+ encoder << m_allowShrinkToFit;
}
bool VisibleContentRectUpdateInfo::decode(IPC::ArgumentDecoder& decoder, VisibleContentRectUpdateInfo& result)
@@ -56,12 +57,10 @@
return false;
if (!decoder.decode(result.m_customFixedPositionRect))
return false;
+ if (!decoder.decode(result.m_lastLayerTreeTransactionID))
+ return false;
if (!decoder.decode(result.m_scale))
return false;
- if (!decoder.decode(result.m_inStableState))
- return false;
- if (!decoder.decode(result.m_isChangingObscuredInsetsInteractively))
- return false;
if (!decoder.decode(result.m_timestamp))
return false;
if (!decoder.decode(result.m_horizontalVelocity))
@@ -70,8 +69,12 @@
return false;
if (!decoder.decode(result.m_scaleChangeRate))
return false;
- if (!decoder.decode(result.m_lastLayerTreeTransactionID))
+ if (!decoder.decode(result.m_inStableState))
return false;
+ if (!decoder.decode(result.m_isChangingObscuredInsetsInteractively))
+ return false;
+ if (!decoder.decode(result.m_allowShrinkToFit))
+ return false;
return true;
}
Modified: branches/safari-601.1.46-branch/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h (194296 => 194297)
--- branches/safari-601.1.46-branch/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h 2015-12-18 23:05:50 UTC (rev 194296)
+++ branches/safari-601.1.46-branch/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h 2015-12-18 23:05:55 UTC (rev 194297)
@@ -37,27 +37,22 @@
class VisibleContentRectUpdateInfo {
public:
- VisibleContentRectUpdateInfo()
- : m_scale(-1)
- , m_inStableState(false)
- , m_isChangingObscuredInsetsInteractively(false)
- , m_lastLayerTreeTransactionID(0)
- {
- }
+ VisibleContentRectUpdateInfo() = default;
- VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId)
+ VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId)
: m_exposedRect(exposedRect)
, m_unobscuredRect(unobscuredRect)
, m_unobscuredRectInScrollViewCoordinates(unobscuredRectInScrollViewCoordinates)
, m_customFixedPositionRect(customFixedPositionRect)
+ , m_lastLayerTreeTransactionID(lastLayerTreeTransactionId)
, m_scale(scale)
- , m_inStableState(inStableState)
- , m_isChangingObscuredInsetsInteractively(isChangingObscuredInsetsInteractively)
, m_timestamp(timestamp)
, m_horizontalVelocity(horizontalVelocity)
, m_verticalVelocity(verticalVelocity)
, m_scaleChangeRate(scaleChangeRate)
- , m_lastLayerTreeTransactionID(lastLayerTreeTransactionId)
+ , m_inStableState(inStableState)
+ , m_isChangingObscuredInsetsInteractively(isChangingObscuredInsetsInteractively)
+ , m_allowShrinkToFit(allowShrinkToFit)
{
}
@@ -68,6 +63,7 @@
double scale() const { return m_scale; }
bool inStableState() const { return m_inStableState; }
bool isChangingObscuredInsetsInteractively() const { return m_isChangingObscuredInsetsInteractively; }
+ bool allowShrinkToFit() const { return m_allowShrinkToFit; }
double timestamp() const { return m_timestamp; }
double horizontalVelocity() const { return m_horizontalVelocity; }
@@ -84,14 +80,15 @@
WebCore::FloatRect m_unobscuredRect;
WebCore::FloatRect m_unobscuredRectInScrollViewCoordinates;
WebCore::FloatRect m_customFixedPositionRect;
- double m_scale;
- bool m_inStableState;
- bool m_isChangingObscuredInsetsInteractively;
- double m_timestamp;
- double m_horizontalVelocity;
- double m_verticalVelocity;
- double m_scaleChangeRate;
- uint64_t m_lastLayerTreeTransactionID;
+ uint64_t m_lastLayerTreeTransactionID { 0 };
+ double m_scale { -1 };
+ double m_timestamp { 0 };
+ double m_horizontalVelocity { 0 };
+ double m_verticalVelocity { 0 };
+ double m_scaleChangeRate { 0 };
+ bool m_inStableState { false };
+ bool m_isChangingObscuredInsetsInteractively { false };
+ bool m_allowShrinkToFit { false };
};
inline bool operator==(const VisibleContentRectUpdateInfo& a, const VisibleContentRectUpdateInfo& b)
@@ -104,7 +101,8 @@
&& a.horizontalVelocity() == b.horizontalVelocity()
&& a.verticalVelocity() == b.verticalVelocity()
&& a.scaleChangeRate() == b.scaleChangeRate()
- && a.inStableState() == b.inStableState();
+ && a.inStableState() == b.inStableState()
+ && a.allowShrinkToFit() == b.allowShrinkToFit();
}
} // namespace WebKit
Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (194296 => 194297)
--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2015-12-18 23:05:50 UTC (rev 194296)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2015-12-18 23:05:55 UTC (rev 194297)
@@ -182,6 +182,8 @@
UIInterfaceOrientation _interfaceOrientationOverride;
BOOL _overridesInterfaceOrientation;
+
+ BOOL _allowsViewportShrinkToFit;
BOOL _hasCommittedLoadForMainFrame;
BOOL _needsResetViewStateAfterCommitLoadForMainFrame;
@@ -1711,7 +1713,8 @@
unobscuredRect:unobscuredRectInContentCoordinates
unobscuredRectInScrollViewCoordinates:unobscuredRect
scale:scaleFactor minimumScale:[_scrollView minimumZoomScale]
- inStableState:isStableState isChangingObscuredInsetsInteractively:_isChangingObscuredInsetsInteractively];
+ inStableState:isStableState
+ isChangingObscuredInsetsInteractively:_isChangingObscuredInsetsInteractively];
}
- (void)_didFinishLoadForMainFrame
@@ -2792,6 +2795,16 @@
return _page->backgroundExtendsBeyondPage();
}
+- (void)_setAllowsViewportShrinkToFit:(BOOL)allowShrinkToFit
+{
+ _allowsViewportShrinkToFit = allowShrinkToFit;
+}
+
+- (BOOL)_allowsViewportShrinkToFit
+{
+ return _allowsViewportShrinkToFit;
+}
+
- (void)_beginInteractiveObscuredInsetsChange
{
ASSERT(!_isChangingObscuredInsetsInteractively);
Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (194296 => 194297)
--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h 2015-12-18 23:05:50 UTC (rev 194296)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h 2015-12-18 23:05:55 UTC (rev 194297)
@@ -118,6 +118,8 @@
// in the update block.
@property (nonatomic, setter=_setInterfaceOrientationOverride:) UIInterfaceOrientation _interfaceOrientationOverride;
+@property (nonatomic, setter=_setAllowsViewportShrinkToFit:) BOOL _allowsViewportShrinkToFit;
+
@property (nonatomic, setter=_setBackgroundExtendsBeyondPage:) BOOL _backgroundExtendsBeyondPage;
// FIXME: Remove these three properties once we expose WKWebViewContentProvider as API.
Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/WebPageProxy.h (194296 => 194297)
--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/WebPageProxy.h 2015-12-18 23:05:50 UTC (rev 194296)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/WebPageProxy.h 2015-12-18 23:05:55 UTC (rev 194297)
@@ -459,7 +459,7 @@
const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedRect(); }
const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredRect(); }
- void updateVisibleContentRects(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate);
+ void updateVisibleContentRects(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate);
void resendLastVisibleContentRects();
enum class UnobscuredRectConstraint { ConstrainedToDocumentRect, Unconstrained };
Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentView.mm (194296 => 194297)
--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentView.mm 2015-12-18 23:05:50 UTC (rev 194296)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentView.mm 2015-12-18 23:05:55 UTC (rev 194297)
@@ -377,7 +377,7 @@
FloatRect fixedPositionRectForLayout = _page->computeCustomFixedPositionRect(unobscuredRect, zoomScale, WebPageProxy::UnobscuredRectConstraint::ConstrainedToDocumentRect);
_page->updateVisibleContentRects(visibleRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, fixedPositionRectForLayout,
- zoomScale, isStableState, isChangingObscuredInsetsInteractively, timestamp, velocityData.horizontalVelocity, velocityData.verticalVelocity, velocityData.scaleChangeRate);
+ zoomScale, isStableState, isChangingObscuredInsetsInteractively, _webView._allowsViewportShrinkToFit, timestamp, velocityData.horizontalVelocity, velocityData.verticalVelocity, velocityData.scaleChangeRate);
RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy();
FloatRect fixedPositionRect = _page->computeCustomFixedPositionRect(_page->unobscuredContentRect(), zoomScale);
Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (194296 => 194297)
--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2015-12-18 23:05:50 UTC (rev 194296)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2015-12-18 23:05:55 UTC (rev 194297)
@@ -181,12 +181,12 @@
callback->performCallbackWithReturnValue(beforeText, markedText, selectedText, afterText, location, length);
}
-void WebPageProxy::updateVisibleContentRects(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate)
+void WebPageProxy::updateVisibleContentRects(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate)
{
if (!isValid())
return;
- VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(exposedRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, customFixedPositionRect, scale, inStableState, isChangingObscuredInsetsInteractively, timestamp, horizontalVelocity, verticalVelocity, scaleChangeRate, downcast<RemoteLayerTreeDrawingAreaProxy>(*drawingArea()).lastCommittedLayerTreeTransactionID());
+ VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(exposedRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, customFixedPositionRect, scale, inStableState, isChangingObscuredInsetsInteractively, allowShrinkToFit, timestamp, horizontalVelocity, verticalVelocity, scaleChangeRate, downcast<RemoteLayerTreeDrawingAreaProxy>(*drawingArea()).lastCommittedLayerTreeTransactionID());
if (visibleContentRectUpdateInfo == m_lastVisibleContentRectUpdate)
return;
Modified: branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (194296 => 194297)
--- branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-12-18 23:05:50 UTC (rev 194296)
+++ branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-12-18 23:05:55 UTC (rev 194297)
@@ -2934,7 +2934,8 @@
m_drawingArea->updatePreferences(store);
#if PLATFORM(IOS)
- m_viewportConfiguration.setCanIgnoreScalingConstraints(store.getBoolValueForKey(WebPreferencesKey::ignoreViewportScalingConstraintsKey()));
+ m_ignoreViewportScalingConstraints = store.getBoolValueForKey(WebPreferencesKey::ignoreViewportScalingConstraintsKey());
+ m_viewportConfiguration.setCanIgnoreScalingConstraints(m_ignoreViewportScalingConstraints);
m_viewportConfiguration.setForceAlwaysUserScalable(store.getBoolValueForKey(WebPreferencesKey::forceAlwaysUserScalableKey()));
#endif
}
Modified: branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h (194296 => 194297)
--- branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h 2015-12-18 23:05:50 UTC (rev 194296)
+++ branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h 2015-12-18 23:05:55 UTC (rev 194297)
@@ -1186,6 +1186,10 @@
bool m_mainFrameIsScrollable;
+#if PLATFORM(IOS)
+ bool m_ignoreViewportScalingConstraints { false };
+#endif
+
#if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
bool m_readyToFindPrimarySnapshottedPlugin;
bool m_didFindPrimarySnapshottedPlugin;
Modified: branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (194296 => 194297)
--- branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2015-12-18 23:05:50 UTC (rev 194296)
+++ branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2015-12-18 23:05:55 UTC (rev 194297)
@@ -2948,6 +2948,9 @@
if (scrollPosition != frameView.scrollPosition())
m_dynamicSizeUpdateHistory.clear();
+ if (m_viewportConfiguration.setCanIgnoreScalingConstraints(m_ignoreViewportScalingConstraints && visibleContentRectUpdateInfo.allowShrinkToFit()))
+ viewportConfigurationChanged();
+
frameView.setUnobscuredContentSize(visibleContentRectUpdateInfo.unobscuredRect().size());
double horizontalVelocity = visibleContentRectUpdateInfo.horizontalVelocity();