Diff
Modified: trunk/Source/WebCore/ChangeLog (215445 => 215446)
--- trunk/Source/WebCore/ChangeLog 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebCore/ChangeLog 2017-04-18 02:37:18 UTC (rev 215446)
@@ -1,3 +1,32 @@
+2017-04-17 Timothy Horton <[email protected]>
+
+ Plumb all four obscured insets to WebCore, instead of just top/left
+ https://bugs.webkit.org/show_bug.cgi?id=170913
+
+ Reviewed by Wenson Hsieh.
+
+ No new tests, no observable behavior change yet.
+
+ In preparation for a future patch (for rdar://problem/31564652), plumb
+ all four obscured insets to WebCore/the Web Content process, instead of
+ just the top and left insets.
+
+ * history/HistoryItem.cpp:
+ (WebCore::HistoryItem::HistoryItem):
+ * history/HistoryItem.h:
+ (WebCore::HistoryItem::obscuredInsets):
+ (WebCore::HistoryItem::setObscuredInsets):
+ (WebCore::HistoryItem::obscuredInset): Deleted.
+ (WebCore::HistoryItem::setObscuredInset): Deleted.
+ * loader/HistoryController.cpp:
+ (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
+ * page/Page.h:
+ (WebCore::Page::obscuredInsets):
+ (WebCore::Page::setObscuredInsets):
+ (WebCore::Page::obscuredInset): Deleted.
+ (WebCore::Page::setObscuredInset): Deleted.
+ Adopt FloatBoxExtent for obscuredInsets (and adjust pluralization).
+
2017-04-17 Joseph Pecoraro <[email protected]>
Web Inspector: Doesn't show size of compressed content correctly
Modified: trunk/Source/WebCore/history/HistoryItem.cpp (215445 => 215446)
--- trunk/Source/WebCore/history/HistoryItem.cpp 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebCore/history/HistoryItem.cpp 2017-04-18 02:37:18 UTC (rev 215446)
@@ -109,7 +109,7 @@
, m_formContentType(item.m_formContentType)
, m_pruningReason(PruningReason::None)
#if PLATFORM(IOS)
- , m_obscuredInset(item.m_obscuredInset)
+ , m_obscuredInsets(item.m_obscuredInsets)
, m_scale(item.m_scale)
, m_scaleIsInitial(item.m_scaleIsInitial)
#endif
Modified: trunk/Source/WebCore/history/HistoryItem.h (215445 => 215446)
--- trunk/Source/WebCore/history/HistoryItem.h 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebCore/history/HistoryItem.h 2017-04-18 02:37:18 UTC (rev 215446)
@@ -30,6 +30,7 @@
#include "FrameLoaderTypes.h"
#include "IntPoint.h"
#include "IntRect.h"
+#include "LengthBox.h"
#include "SerializedScriptValue.h"
#include <memory>
#include <wtf/RefCounted.h>
@@ -174,8 +175,8 @@
IntRect unobscuredContentRect() const { return m_unobscuredContentRect; }
void setUnobscuredContentRect(IntRect unobscuredContentRect) { m_unobscuredContentRect = unobscuredContentRect; }
- FloatSize obscuredInset() const { return m_obscuredInset; }
- void setObscuredInset(const FloatSize& inset) { m_obscuredInset = inset; }
+ const FloatBoxExtent& obscuredInsets() const { return m_obscuredInsets; }
+ void setObscuredInsets(const FloatBoxExtent& insets) { m_obscuredInsets = insets; }
FloatSize minimumLayoutSizeInScrollViewCoordinates() const { return m_minimumLayoutSizeInScrollViewCoordinates; }
void setMinimumLayoutSizeInScrollViewCoordinates(FloatSize minimumLayoutSizeInScrollViewCoordinates) { m_minimumLayoutSizeInScrollViewCoordinates = minimumLayoutSizeInScrollViewCoordinates; }
@@ -257,7 +258,7 @@
IntRect m_unobscuredContentRect;
FloatSize m_minimumLayoutSizeInScrollViewCoordinates;
IntSize m_contentSize;
- FloatSize m_obscuredInset;
+ FloatBoxExtent m_obscuredInsets;
float m_scale { 0 }; // Note that UIWebView looks for a non-zero value, so this has to start as 0.
bool m_scaleIsInitial { false };
ViewportArguments m_viewportArguments;
Modified: trunk/Source/WebCore/loader/HistoryController.cpp (215445 => 215446)
--- trunk/Source/WebCore/loader/HistoryController.cpp 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebCore/loader/HistoryController.cpp 2017-04-18 02:37:18 UTC (rev 215446)
@@ -89,7 +89,7 @@
if (page && m_frame.isMainFrame()) {
item->setPageScaleFactor(page->pageScaleFactor() / page->viewScaleFactor());
#if PLATFORM(IOS)
- item->setObscuredInset(page->obscuredInset());
+ item->setObscuredInsets(page->obscuredInsets());
#endif
}
Modified: trunk/Source/WebCore/page/Page.h (215445 => 215446)
--- trunk/Source/WebCore/page/Page.h 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebCore/page/Page.h 2017-04-18 02:37:18 UTC (rev 215446)
@@ -25,6 +25,7 @@
#include "FrameLoaderTypes.h"
#include "LayoutMilestones.h"
#include "LayoutRect.h"
+#include "LengthBox.h"
#include "MediaProducer.h"
#include "PageVisibilityState.h"
#include "Pagination.h"
@@ -329,8 +330,8 @@
WEBCORE_EXPORT void setTopContentInset(float);
#if PLATFORM(IOS)
- FloatSize obscuredInset() const { return m_obscuredInset; }
- void setObscuredInset(FloatSize inset) { m_obscuredInset = inset; }
+ const FloatBoxExtent& obscuredInsets() const { return m_obscuredInsets; }
+ void setObscuredInsets(FloatBoxExtent insets) { m_obscuredInsets = insets; }
bool enclosedInScrollableAncestorView() const { return m_enclosedInScrollableAncestorView; }
void setEnclosedInScrollableAncestorView(bool f) { m_enclosedInScrollableAncestorView = f; }
@@ -688,7 +689,7 @@
#if PLATFORM(IOS)
// This is only used for history scroll position restoration.
- FloatSize m_obscuredInset;
+ FloatBoxExtent m_obscuredInsets;
bool m_enclosedInScrollableAncestorView { false };
#endif
Modified: trunk/Source/WebCore/platform/LengthBox.cpp (215445 => 215446)
--- trunk/Source/WebCore/platform/LengthBox.cpp 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebCore/platform/LengthBox.cpp 2017-04-18 02:37:18 UTC (rev 215446)
@@ -36,4 +36,10 @@
return ts;
}
+TextStream& operator<<(TextStream& ts, const FloatBoxExtent& box)
+{
+ ts << "top: " << box.top() << " right: " << box.right() << " bottom: " << box.bottom() << " left: " << box.left();
+ return ts;
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/LengthBox.h (215445 => 215446)
--- trunk/Source/WebCore/platform/LengthBox.h 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebCore/platform/LengthBox.h 2017-04-18 02:37:18 UTC (rev 215446)
@@ -30,7 +30,7 @@
template<typename T> class BoxExtent {
public:
BoxExtent()
- : m_sides({ { { 0 }, { 0 }, { 0 }, { 0 } } })
+ : m_sides({ { 0, 0, 0, 0 } })
{
}
@@ -158,5 +158,6 @@
using FloatBoxExtent = BoxExtent<float>;
TextStream& operator<<(TextStream&, const LengthBox&);
+TextStream& operator<<(TextStream&, const FloatBoxExtent&);
} // namespace WebCore
Modified: trunk/Source/WebKit2/ChangeLog (215445 => 215446)
--- trunk/Source/WebKit2/ChangeLog 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/ChangeLog 2017-04-18 02:37:18 UTC (rev 215446)
@@ -1,3 +1,46 @@
+2017-04-17 Timothy Horton <[email protected]>
+
+ Plumb all four obscured insets to WebCore, instead of just top/left
+ https://bugs.webkit.org/show_bug.cgi?id=170913
+
+ Reviewed by Wenson Hsieh.
+
+ * Shared/VisibleContentRectUpdateInfo.cpp:
+ (WebKit::VisibleContentRectUpdateInfo::encode):
+ (WebKit::VisibleContentRectUpdateInfo::decode):
+ (WebKit::operator<<):
+ * Shared/VisibleContentRectUpdateInfo.h:
+ (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
+ (WebKit::VisibleContentRectUpdateInfo::obscuredInsets):
+ (WebKit::operator==):
+ (WebKit::VisibleContentRectUpdateInfo::obscuredInset): Deleted.
+ * Shared/WebCoreArgumentCoders.cpp:
+ (IPC::ArgumentCoder<FloatRectInsets>::encode):
+ (IPC::ArgumentCoder<FloatRectInsets>::decode):
+ * Shared/WebCoreArgumentCoders.h:
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _didCommitLayerTree:]):
+ (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
+ (-[WKWebView _updateVisibleContentRects]):
+ * UIProcess/API/Cocoa/WKWebViewInternal.h:
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.cpp:
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/ios/PageClientImplIOS.h:
+ * UIProcess/ios/PageClientImplIOS.mm:
+ (WebKit::PageClientImpl::restorePageState):
+ * UIProcess/ios/WKContentView.h:
+ * UIProcess/ios/WKContentView.mm:
+ (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
+ (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::restorePageState):
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::restorePageState):
+ (WebKit::WebPage::updateVisibleContentRects):
+ Adopt FloatBoxExtent for obscuredInsets (and adjust pluralization).
+
2017-04-17 Joseph Pecoraro <[email protected]>
Web Inspector: Doesn't show size of compressed content correctly
Modified: trunk/Source/WebKit2/Scripts/webkit/messages.py (215445 => 215446)
--- trunk/Source/WebKit2/Scripts/webkit/messages.py 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/Scripts/webkit/messages.py 2017-04-18 02:37:18 UTC (rev 215446)
@@ -289,6 +289,7 @@
template_string = template_string.strip()
class_template_types = {
+ 'WebCore::BoxExtent': {'headers': ['<WebCore/LengthBox.h>'], 'argument_coder_headers': ['"WebCoreArgumentCoders.h"']},
'HashMap': {'headers': ['<wtf/HashMap.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
'std::optional': {'headers': ['<wtf/Optional.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
'OptionSet': {'headers': ['<wtf/OptionSet.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
Modified: trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp (215445 => 215446)
--- trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp 2017-04-18 02:37:18 UTC (rev 215446)
@@ -27,6 +27,7 @@
#include "VisibleContentRectUpdateInfo.h"
#include "WebCoreArgumentCoders.h"
+#include <WebCore/LengthBox.h>
#include <WebCore/TextStream.h>
using namespace WebCore;
@@ -39,7 +40,7 @@
encoder << m_unobscuredContentRect;
encoder << m_unobscuredRectInScrollViewCoordinates;
encoder << m_customFixedPositionRect;
- encoder << m_obscuredInset;
+ encoder << m_obscuredInsets;
encoder << m_lastLayerTreeTransactionID;
encoder << m_scale;
encoder << m_timestamp;
@@ -63,7 +64,7 @@
return false;
if (!decoder.decode(result.m_customFixedPositionRect))
return false;
- if (!decoder.decode(result.m_obscuredInset))
+ if (!decoder.decode(result.m_obscuredInsets))
return false;
if (!decoder.decode(result.m_lastLayerTreeTransactionID))
return false;
@@ -111,7 +112,7 @@
ts.dumpProperty("unobscuredRectInScrollViewCoordinates", info.unobscuredRectInScrollViewCoordinates());
ts.dumpProperty("unobscuredContentRectRespectingInputViewBounds", info.unobscuredContentRectRespectingInputViewBounds());
ts.dumpProperty("customFixedPositionRect", info.customFixedPositionRect());
- ts.dumpProperty("obscuredInset", info.obscuredInset());
+ ts.dumpProperty("obscuredInsets", info.obscuredInsets());
ts.dumpProperty("scale", info.scale());
ts.dumpProperty("inStableState", info.inStableState());
Modified: trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h (215445 => 215446)
--- trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h 2017-04-18 02:37:18 UTC (rev 215446)
@@ -26,6 +26,7 @@
#pragma once
#include <WebCore/FloatRect.h>
+#include <WebCore/LengthBox.h>
#include <wtf/MonotonicTime.h>
#include <wtf/text/WTFString.h>
@@ -46,7 +47,7 @@
VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedContentRect, const WebCore::FloatRect& unobscuredContentRect,
const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& customFixedPositionRect,
- const WebCore::FloatSize& obscuredInset, double scale, bool inStableState, bool isFirstUpdateForNewViewSize, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, bool enclosedInScrollableAncestorView,
+ const WebCore::FloatBoxExtent& obscuredInsets, double scale, bool inStableState, bool isFirstUpdateForNewViewSize, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, bool enclosedInScrollableAncestorView,
MonotonicTime timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId)
: m_exposedContentRect(exposedContentRect)
, m_unobscuredContentRect(unobscuredContentRect)
@@ -53,7 +54,7 @@
, m_unobscuredRectInScrollViewCoordinates(unobscuredRectInScrollViewCoordinates)
, m_unobscuredContentRectRespectingInputViewBounds(unobscuredContentRectRespectingInputViewBounds)
, m_customFixedPositionRect(customFixedPositionRect)
- , m_obscuredInset(obscuredInset)
+ , m_obscuredInsets(obscuredInsets)
, m_lastLayerTreeTransactionID(lastLayerTreeTransactionId)
, m_scale(scale)
, m_timestamp(timestamp)
@@ -73,7 +74,7 @@
const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates() const { return m_unobscuredRectInScrollViewCoordinates; }
const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds() const { return m_unobscuredContentRectRespectingInputViewBounds; }
const WebCore::FloatRect& customFixedPositionRect() const { return m_customFixedPositionRect; }
- const WebCore::FloatSize obscuredInset() const { return m_obscuredInset; }
+ const WebCore::FloatBoxExtent& obscuredInsets() const { return m_obscuredInsets; }
double scale() const { return m_scale; }
bool inStableState() const { return m_inStableState; }
@@ -100,7 +101,7 @@
WebCore::FloatRect m_unobscuredRectInScrollViewCoordinates;
WebCore::FloatRect m_unobscuredContentRectRespectingInputViewBounds;
WebCore::FloatRect m_customFixedPositionRect; // When visual viewports are enabled, this is the layout viewport.
- WebCore::FloatSize m_obscuredInset;
+ WebCore::FloatBoxExtent m_obscuredInsets;
uint64_t m_lastLayerTreeTransactionID { 0 };
double m_scale { -1 };
MonotonicTime m_timestamp;
@@ -121,7 +122,7 @@
&& a.exposedContentRect() == b.exposedContentRect()
&& a.unobscuredContentRect() == b.unobscuredContentRect()
&& a.customFixedPositionRect() == b.customFixedPositionRect()
- && a.obscuredInset() == b.obscuredInset()
+ && a.obscuredInsets() == b.obscuredInsets()
&& a.horizontalVelocity() == b.horizontalVelocity()
&& a.verticalVelocity() == b.verticalVelocity()
&& a.scaleChangeRate() == b.scaleChangeRate()
Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (215445 => 215446)
--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp 2017-04-18 02:37:18 UTC (rev 215446)
@@ -48,6 +48,7 @@
#include <WebCore/Image.h>
#include <WebCore/JSDOMExceptionHandling.h>
#include <WebCore/Length.h>
+#include <WebCore/LengthBox.h>
#include <WebCore/Path.h>
#include <WebCore/PluginData.h>
#include <WebCore/ProtectionSpace.h>
@@ -389,6 +390,17 @@
}
+void ArgumentCoder<FloatBoxExtent>::encode(Encoder& encoder, const FloatBoxExtent& floatBoxExtent)
+{
+ SimpleArgumentCoder<FloatBoxExtent>::encode(encoder, floatBoxExtent);
+}
+
+bool ArgumentCoder<FloatBoxExtent>::decode(Decoder& decoder, FloatBoxExtent& floatBoxExtent)
+{
+ return SimpleArgumentCoder<FloatBoxExtent>::decode(decoder, floatBoxExtent);
+}
+
+
void ArgumentCoder<FloatSize>::encode(Encoder& encoder, const FloatSize& floatSize)
{
SimpleArgumentCoder<FloatSize>::encode(encoder, floatSize);
Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h (215445 => 215446)
--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h 2017-04-18 02:37:18 UTC (rev 215446)
@@ -101,6 +101,9 @@
struct TextIndicatorData;
struct ViewportAttributes;
struct WindowFeatures;
+
+template <typename> class BoxExtent;
+using FloatBoxExtent = BoxExtent<float>;
}
#if PLATFORM(COCOA)
@@ -224,6 +227,11 @@
static void encode(Encoder&, const WebCore::FloatRect&);
static bool decode(Decoder&, WebCore::FloatRect&);
};
+
+template<> struct ArgumentCoder<WebCore::FloatBoxExtent> {
+ static void encode(Encoder&, const WebCore::FloatBoxExtent&);
+ static bool decode(Decoder&, WebCore::FloatBoxExtent&);
+};
template<> struct ArgumentCoder<WebCore::FloatSize> {
static void encode(Encoder&, const WebCore::FloatSize&);
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (215445 => 215446)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2017-04-18 02:37:18 UTC (rev 215446)
@@ -258,7 +258,7 @@
BOOL _commitDidRestoreScrollPosition;
std::optional<WebCore::FloatPoint> _scrollOffsetToRestore;
- WebCore::FloatSize _obscuredInsetWhenSaved;
+ WebCore::FloatBoxExtent _obscuredInsetsWhenSaved;
std::optional<WebCore::FloatPoint> _unobscuredCenterToRestore;
uint64_t _firstTransactionIDAfterPageRestore;
@@ -1504,7 +1504,7 @@
if (areEssentiallyEqualAsFloat(contentZoomScale(self), _scaleToRestore)) {
scaledScrollOffset.scale(_scaleToRestore);
- WebCore::FloatPoint contentOffsetInScrollViewCoordinates = scaledScrollOffset - _obscuredInsetWhenSaved;
+ WebCore::FloatPoint contentOffsetInScrollViewCoordinates = scaledScrollOffset - WebCore::FloatSize(_obscuredInsetsWhenSaved.left(), _obscuredInsetsWhenSaved.top());
changeContentOffsetBoundedInValidRange(_scrollView.get(), contentOffsetInScrollViewCoordinates);
_commitDidRestoreScrollPosition = YES;
@@ -1572,7 +1572,7 @@
_gestureController->didRestoreScrollPosition();
}
-- (void)_restorePageScrollPosition:(std::optional<WebCore::FloatPoint>)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatSize)obscuredInset scale:(double)scale
+- (void)_restorePageScrollPosition:(std::optional<WebCore::FloatPoint>)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatBoxExtent)obscuredInsets scale:(double)scale
{
if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing)
return;
@@ -1586,7 +1586,7 @@
else
_scrollOffsetToRestore = std::nullopt;
- _obscuredInsetWhenSaved = obscuredInset;
+ _obscuredInsetsWhenSaved = obscuredInsets;
_scaleToRestore = scale;
}
@@ -2403,7 +2403,7 @@
[_contentView didUpdateVisibleRect:visibleRectInContentCoordinates
unobscuredRect:unobscuredRectInContentCoordinates
unobscuredRectInScrollViewCoordinates:unobscuredRect
- obscuredInset:CGSizeMake(_obscuredInsets.left, _obscuredInsets.top)
+ obscuredInsets:_obscuredInsets
inputViewBounds:_inputViewBounds
scale:scaleFactor minimumScale:[_scrollView minimumZoomScale]
inStableState:inStableState
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (215445 => 215446)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h 2017-04-18 02:37:18 UTC (rev 215446)
@@ -37,6 +37,7 @@
#import "WKContentView.h"
#import "WKContentViewInteraction.h"
#import <WebCore/FloatRect.h>
+#import <WebCore/LengthBox.h>
#endif
#if PLATFORM(IOS)
@@ -81,7 +82,7 @@
- (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition nextValidLayerTreeTransactionID:(uint64_t)nextValidLayerTreeTransactionID;
- (void)_couldNotRestorePageState;
-- (void)_restorePageScrollPosition:(std::optional<WebCore::FloatPoint>)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatSize)topInset scale:(double)scale;
+- (void)_restorePageScrollPosition:(std::optional<WebCore::FloatPoint>)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatBoxExtent)insets scale:(double)scale;
- (void)_restorePageStateToUnobscuredCenter:(std::optional<WebCore::FloatPoint>)center scale:(double)scale; // FIXME: needs scroll origin?
- (PassRefPtr<WebKit::ViewSnapshot>)_takeViewSnapshot;
Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (215445 => 215446)
--- trunk/Source/WebKit2/UIProcess/PageClient.h 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h 2017-04-18 02:37:18 UTC (rev 215446)
@@ -296,7 +296,7 @@
virtual void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t transactionID) = 0;
virtual void couldNotRestorePageState() = 0;
- virtual void restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatSize& obscuredInsetOnSave, double scale) = 0;
+ virtual void restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale) = 0;
virtual void restorePageCenterAndScale(std::optional<WebCore::FloatPoint> center, double scale) = 0;
virtual void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, API::Object* userData) = 0;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (215445 => 215446)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2017-04-18 02:37:18 UTC (rev 215446)
@@ -121,6 +121,7 @@
#include <WebCore/FocusDirection.h>
#include <WebCore/JSDOMBinding.h>
#include <WebCore/JSDOMExceptionHandling.h>
+#include <WebCore/LengthBox.h>
#include <WebCore/MIMETypeRegistry.h>
#include <WebCore/PublicSuffix.h>
#include <WebCore/RenderEmbeddedObject.h>
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (215445 => 215446)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2017-04-18 02:37:18 UTC (rev 215446)
@@ -170,6 +170,9 @@
enum class HasInsecureContent;
enum class ShouldSample;
+
+template <typename> class BoxExtent;
+using FloatBoxExtent = BoxExtent<float>;
}
#if PLATFORM(GTK)
@@ -1521,7 +1524,7 @@
void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint& newScrollPosition, uint64_t dynamicViewportSizeUpdateID);
void couldNotRestorePageState();
- void restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatSize& obscuredInsetOnSave, double scale);
+ void restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale);
void restorePageCenterAndScale(std::optional<WebCore::FloatPoint>, double scale);
void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius);
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (215445 => 215446)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2017-04-18 02:37:18 UTC (rev 215446)
@@ -378,7 +378,7 @@
#if PLATFORM(IOS)
DynamicViewportUpdateChangedTarget(double newTargetScale, WebCore::FloatPoint newScrollPosition, uint64_t dynamicViewportSizeUpdateID)
CouldNotRestorePageState()
- RestorePageState(std::optional<WebCore::FloatPoint> scrollPosition, WebCore::FloatPoint scrollOrigin, WebCore::FloatSize obscuredInsetOnSave, double scale)
+ RestorePageState(std::optional<WebCore::FloatPoint> scrollPosition, WebCore::FloatPoint scrollOrigin, WebCore::BoxExtent<float> obscuredInsetsOnSave, double scale)
RestorePageCenterAndScale(std::optional<WebCore::FloatPoint> unobscuredCenter, double scale)
DidGetTapHighlightGeometries(uint64_t requestID, WebCore::Color color, Vector<WebCore::FloatQuad> geometries, WebCore::IntSize topLeftRadius, WebCore::IntSize topRightRadius, WebCore::IntSize bottomLeftRadius, WebCore::IntSize bottomRightRadius)
Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (215445 => 215446)
--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h 2017-04-18 02:37:18 UTC (rev 215446)
@@ -122,7 +122,7 @@
void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t transactionID) override;
void couldNotRestorePageState() override;
- void restorePageState(std::optional<WebCore::FloatPoint>, const WebCore::FloatPoint&, const WebCore::FloatSize&, double) override;
+ void restorePageState(std::optional<WebCore::FloatPoint>, const WebCore::FloatPoint&, const WebCore::FloatBoxExtent&, double) override;
void restorePageCenterAndScale(std::optional<WebCore::FloatPoint>, double) override;
void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, API::Object* userData) override;
Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (215445 => 215446)
--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm 2017-04-18 02:37:18 UTC (rev 215446)
@@ -534,9 +534,9 @@
[m_webView _couldNotRestorePageState];
}
-void PageClientImpl::restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatSize& obscuredInsetOnSave, double scale)
+void PageClientImpl::restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale)
{
- [m_webView _restorePageScrollPosition:scrollPosition scrollOrigin:scrollOrigin previousObscuredInset:obscuredInsetOnSave scale:scale];
+ [m_webView _restorePageScrollPosition:scrollPosition scrollOrigin:scrollOrigin previousObscuredInset:obscuredInsetsOnSave scale:scale];
}
void PageClientImpl::restorePageCenterAndScale(std::optional<WebCore::FloatPoint> center, double scale)
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.h (215445 => 215446)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.h 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.h 2017-04-18 02:37:18 UTC (rev 215446)
@@ -70,7 +70,7 @@
- (void)didUpdateVisibleRect:(CGRect)visibleRect
unobscuredRect:(CGRect)unobscuredRect
unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
- obscuredInset:(CGSize)topInset
+ obscuredInsets:(UIEdgeInsets)obscuredInsets
inputViewBounds:(CGRect)inputViewBounds
scale:(CGFloat)scale minimumScale:(CGFloat)minimumScale
inStableState:(BOOL)isStableState
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (215445 => 215446)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm 2017-04-18 02:37:18 UTC (rev 215446)
@@ -385,7 +385,7 @@
- (void)didUpdateVisibleRect:(CGRect)visibleContentRect
unobscuredRect:(CGRect)unobscuredContentRect
unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
- obscuredInset:(CGSize)obscuredInset
+ obscuredInsets:(UIEdgeInsets)obscuredInsets
inputViewBounds:(CGRect)inputViewBounds
scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale
inStableState:(BOOL)isStableState
@@ -414,7 +414,7 @@
unobscuredRectInScrollViewCoordinates,
unobscuredContentRectRespectingInputViewBounds,
fixedPositionRectForLayout,
- WebCore::FloatSize(obscuredInset),
+ WebCore::FloatBoxExtent(obscuredInsets.top, obscuredInsets.right, obscuredInsets.bottom, obscuredInsets.left),
zoomScale,
isStableState,
_sizeChangedSinceLastVisibleContentRectUpdate,
Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (215445 => 215446)
--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2017-04-18 02:37:18 UTC (rev 215446)
@@ -906,9 +906,9 @@
m_pageClient.couldNotRestorePageState();
}
-void WebPageProxy::restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatSize& obscuredInsetOnSave, double scale)
+void WebPageProxy::restorePageState(std::optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale)
{
- m_pageClient.restorePageState(scrollPosition, scrollOrigin, obscuredInsetOnSave, scale);
+ m_pageClient.restorePageState(scrollPosition, scrollOrigin, obscuredInsetsOnSave, scale);
}
void WebPageProxy::restorePageCenterAndScale(std::optional<WebCore::FloatPoint> center, double scale)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (215445 => 215446)
--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2017-04-18 01:30:24 UTC (rev 215445)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2017-04-18 02:37:18 UTC (rev 215446)
@@ -300,7 +300,7 @@
m_drawingArea->setExposedContentRect(historyItem.exposedContentRect());
scrollPosition = FloatPoint(historyItem.scrollPosition());
}
- send(Messages::WebPageProxy::RestorePageState(scrollPosition, frameView.scrollOrigin(), historyItem.obscuredInset(), boundedScale));
+ send(Messages::WebPageProxy::RestorePageState(scrollPosition, frameView.scrollOrigin(), historyItem.obscuredInsets(), boundedScale));
} else {
IntSize oldContentSize = historyItem.contentSize();
IntSize newContentSize = frameView.contentsSize();
@@ -3196,7 +3196,7 @@
viewportConfigurationChanged();
frameView.setUnobscuredContentSize(visibleContentRectUpdateInfo.unobscuredContentRect().size());
- m_page->setObscuredInset(visibleContentRectUpdateInfo.obscuredInset());
+ m_page->setObscuredInsets(visibleContentRectUpdateInfo.obscuredInsets());
m_page->setEnclosedInScrollableAncestorView(visibleContentRectUpdateInfo.enclosedInScrollableAncestorView());
double horizontalVelocity = visibleContentRectUpdateInfo.horizontalVelocity();