WebKit Bugzilla
Attachment 370662 Details for
Bug 198261
: Move VelocityData to WebCore
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198261-20190526173236.patch (text/plain), 43.26 KB, created by
Simon Fraser (smfr)
on 2019-05-26 17:32:37 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-05-26 17:32:37 PDT
Size:
43.26 KB
patch
obsolete
>Subversion Revision: 245777 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 97d72698773019b29415749c1390cd99cc2346ea..19a2aa5ac2d776d8e122ee1076bc243de5157a7e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,30 @@ >+2019-05-26 Simon Fraser <simon.fraser@apple.com> >+ >+ Move VelocityData to WebCore >+ https://bugs.webkit.org/show_bug.cgi?id=198261 >+ >+ Reviewed by Antti Koivisto. >+ >+ Move VelocityData and HistoricalVelocityData to WebCore for future use in overflow scroll. >+ >+ VisibleContentRectUpdateInfo can now store a VelocityData (its timestamp is used as >+ the timetamp for the entire update). >+ >+ No behavior change. >+ >+ * Headers.cmake: >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * page/FrameView.cpp: >+ (WebCore::FrameView::setScrollVelocity): >+ * page/FrameView.h: >+ * platform/graphics/TiledBacking.h: >+ (WebCore::VelocityData::VelocityData): Deleted. >+ (WebCore::VelocityData::velocityOrScaleIsChanging const): Deleted. >+ * platform/graphics/ca/TileController.cpp: >+ (WebCore::TileController::adjustTileCoverageRect const): >+ * platform/graphics/ca/TileController.h: >+ > 2019-05-26 Simon Fraser <simon.fraser@apple.com> > > Add a GraphicsLayer::Type for ScrolledContents >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 800bddcef13920e4ba73fff38bd7e6477c3ec15d..60ce3c8e6daf3e37bbc3ef0d0247b1489dd1c1dd 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,45 @@ >+2019-05-26 Simon Fraser <simon.fraser@apple.com> >+ >+ Move VelocityData to WebCore >+ https://bugs.webkit.org/show_bug.cgi?id=198261 >+ >+ Reviewed by Antti Koivisto. >+ >+ Move VelocityData and HistoricalVelocityData to WebCore for future use in overflow scroll. >+ >+ VisibleContentRectUpdateInfo can now store a VelocityData (its timestamp is used as >+ the timetamp for the entire update). >+ >+ * Shared/VisibleContentRectUpdateInfo.cpp: >+ (WebKit::VisibleContentRectUpdateInfo::encode const): >+ (WebKit::VisibleContentRectUpdateInfo::decode): >+ (WebKit::operator<<): >+ * Shared/VisibleContentRectUpdateInfo.h: >+ (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): >+ (WebKit::VisibleContentRectUpdateInfo::scrollVelocity const): >+ (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView const): >+ (WebKit::VisibleContentRectUpdateInfo::timestamp const): >+ (WebKit::operator==): >+ (WebKit::VisibleContentRectUpdateInfo::horizontalVelocity const): Deleted. >+ (WebKit::VisibleContentRectUpdateInfo::verticalVelocity const): Deleted. >+ (WebKit::VisibleContentRectUpdateInfo::scaleChangeRate const): Deleted. >+ * Shared/WebCoreArgumentCoders.cpp: >+ (IPC::ArgumentCoder<VelocityData>::encode): >+ (IPC::ArgumentCoder<VelocityData>::decode): >+ * Shared/WebCoreArgumentCoders.h: >+ * UIProcess/ios/WKContentView.mm: >+ (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): >+ (WebKit::HistoricalVelocityData::VelocityData::VelocityData): Deleted. >+ (WebKit::HistoricalVelocityData::HistoricalVelocityData): Deleted. >+ (WebKit::HistoricalVelocityData::velocityForNewData): Deleted. >+ (WebKit::HistoricalVelocityData::clear): Deleted. >+ (WebKit::HistoricalVelocityData::append): Deleted. >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::dynamicViewportSizeUpdate): >+ (WebKit::WebPage::viewportConfigurationChanged): >+ (WebKit::adjustVelocityDataForBoundedScale): >+ (WebKit::WebPage::updateVisibleContentRects): >+ > 2019-05-24 Youenn Fablet <youenn@apple.com> > > REGRESSION (r245715?) [WK2] Layout Test http/wpt/cache-storage/cache-storage-networkprocess-crash.html is a flaky failure >diff --git a/Source/WebCore/Headers.cmake b/Source/WebCore/Headers.cmake >index c2c7c2249e3f1ec07164a9309865b57582328913..2b666767cec849eb41c472bc78bcba7abef000fd 100644 >--- a/Source/WebCore/Headers.cmake >+++ b/Source/WebCore/Headers.cmake >@@ -1089,6 +1089,7 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS > platform/graphics/TextRun.h > platform/graphics/TiledBacking.h > platform/graphics/TrackPrivateBase.h >+ platform/graphics/VelocityData.h > platform/graphics/VideoTrackPrivate.h > platform/graphics/WidthCache.h > platform/graphics/WindRule.h >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index ca248f3eba6144ed468157443b707be72a423d58..2e2cfd14109813ab510017a122c1faf00201f33d 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -1779,6 +1779,7 @@ platform/graphics/ShadowBlur.cpp > platform/graphics/StringTruncator.cpp > platform/graphics/SurrogatePairAwareTextIterator.cpp > platform/graphics/TextRun.cpp >+platform/graphics/VelocityData.cpp > platform/graphics/WOFFFileFormat.cpp > platform/graphics/WidthIterator.cpp > >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index cee0d4c0a5b8091c0a321b2cfc0d6d742943cfe5..92f82efbc644ae9c7f051a61cf986ab6e66778f1 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -292,6 +292,7 @@ > 0F15DA8A0F3AAEE70000CE47 /* CSSAnimationControllerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15DA890F3AAEE70000CE47 /* CSSAnimationControllerPrivate.h */; }; > 0F15ED5C1B7EC7C500EDDFEB /* WillChangeData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15ED5A1B7EC7C500EDDFEB /* WillChangeData.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F1774801378B772009DA76A /* ScrollAnimatorIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F17747E1378B771009DA76A /* ScrollAnimatorIOS.h */; }; >+ 0F1A0C38229A481800D37ADB /* VelocityData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1A0C36229A481800D37ADB /* VelocityData.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F37F0852202BF9800A89C0B /* ScrollingTreeScrollingNodeDelegateMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F37F0842202ACB700A89C0B /* ScrollingTreeScrollingNodeDelegateMac.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F3DD45012F5EA1B000D9190 /* ShadowBlur.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3DD44E12F5EA1B000D9190 /* ShadowBlur.h */; }; > 0F3F0E5A157030C3006DA57F /* RenderGeometryMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3F0E58157030C3006DA57F /* RenderGeometryMap.h */; }; >@@ -5628,6 +5629,7 @@ > 0F15ED5A1B7EC7C500EDDFEB /* WillChangeData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WillChangeData.h; sourceTree = "<group>"; }; > 0F17747E1378B771009DA76A /* ScrollAnimatorIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimatorIOS.h; sourceTree = "<group>"; }; > 0F17747F1378B772009DA76A /* ScrollAnimatorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollAnimatorIOS.mm; sourceTree = "<group>"; }; >+ 0F1A0C36229A481800D37ADB /* VelocityData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VelocityData.h; sourceTree = "<group>"; }; > 0F26A7A72054C2270090A141 /* TemplateContentDocumentFragment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TemplateContentDocumentFragment.cpp; sourceTree = "<group>"; }; > 0F26A7A92054C3CF0090A141 /* HTMLBDIElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLBDIElement.cpp; sourceTree = "<group>"; }; > 0F26A7AA2054EC5A0090A141 /* HTMLUnknownElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLUnknownElement.cpp; sourceTree = "<group>"; }; >@@ -5699,6 +5701,7 @@ > 0F580FA11496939100FB5BD8 /* WebTiledBackingLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTiledBackingLayer.h; sourceTree = "<group>"; }; > 0F580FA21496939100FB5BD8 /* WebTiledBackingLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebTiledBackingLayer.mm; sourceTree = "<group>"; }; > 0F580FAE149800D400FB5BD8 /* AnimationUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationUtilities.h; sourceTree = "<group>"; }; >+ 0F5A57CA229B18AE0025EDA9 /* VelocityData.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = VelocityData.cpp; sourceTree = "<group>"; }; > 0F5B7A5210F65D7A00376302 /* RenderEmbeddedObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderEmbeddedObject.cpp; sourceTree = "<group>"; }; > 0F5B7A5310F65D7A00376302 /* RenderEmbeddedObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderEmbeddedObject.h; sourceTree = "<group>"; }; > 0F5E200518E771FC003EC3E5 /* PlatformCAAnimationCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCAAnimationCocoa.h; sourceTree = "<group>"; }; >@@ -24530,6 +24533,8 @@ > 076E11BE1F683E0D00177395 /* TrackPrivateBase.cpp */, > BE913D7F181EF8E500DCB09E /* TrackPrivateBase.h */, > E4AFCFA40DAF29A300F5F55C /* UnitBezier.h */, >+ 0F5A57CA229B18AE0025EDA9 /* VelocityData.cpp */, >+ 0F1A0C36229A481800D37ADB /* VelocityData.h */, > 075BA84720618AA500FCB4AD /* VideoFullscreenLayerManager.h */, > BEF29EEA1715DD0900C4B4C9 /* VideoTrackPrivate.h */, > 1411DCB0164C39A800D49BC1 /* WidthCache.h */, >@@ -31928,6 +31933,7 @@ > F513A3EA15FF4841001526DB /* ValidationMessageClient.h in Headers */, > 15C7708D100D3C6B005BA267 /* ValidityState.h in Headers */, > FD3160AF12B026F700C1A359 /* VectorMath.h in Headers */, >+ 0F1A0C38229A481800D37ADB /* VelocityData.h in Headers */, > BCA257151293C010007A263D /* VerticalPositionCache.h in Headers */, > 52B0D4C01C57FD660077CE53 /* VideoFullscreenChangeObserver.h in Headers */, > 3FBC4AF4189881560046EE38 /* VideoFullscreenInterfaceAVKit.h in Headers */, >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index fcdef0cce2ffef75abdfd39f976f3f64a3f2942e..08b0814fa0b9db3269e3abc2f48475c916c28b5b 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -99,6 +99,7 @@ > #include "StyleScope.h" > #include "TextResourceDecoder.h" > #include "TiledBacking.h" >+#include "VelocityData.h" > #include "VisualViewport.h" > #include "WheelEventTestTrigger.h" > #include <wtf/text/TextStream.h> >@@ -5051,10 +5052,10 @@ void FrameView::setCustomSizeForResizeEvent(IntSize customSize) > sendResizeEventIfNeeded(); > } > >-void FrameView::setScrollVelocity(double horizontalVelocity, double verticalVelocity, double scaleChangeRate, MonotonicTime timestamp) >+void FrameView::setScrollVelocity(const VelocityData& velocityData) > { > if (TiledBacking* tiledBacking = this->tiledBacking()) >- tiledBacking->setVelocity(VelocityData(horizontalVelocity, verticalVelocity, scaleChangeRate, timestamp)); >+ tiledBacking->setVelocity(velocityData); > } > #endif // PLATFORM(IOS_FAMILY) > >diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h >index d36e565645c3794e6a8513178d6edbff0cfdb9e8..390301f375871c154306d83c3b98e57d3f473228 100644 >--- a/Source/WebCore/page/FrameView.h >+++ b/Source/WebCore/page/FrameView.h >@@ -137,7 +137,7 @@ public: > IntSize customSizeForResizeEvent() const { return m_customSizeForResizeEvent; } > WEBCORE_EXPORT void setCustomSizeForResizeEvent(IntSize); > >- WEBCORE_EXPORT void setScrollVelocity(double horizontalVelocity, double verticalVelocity, double scaleChangeRate, MonotonicTime timestamp); >+ WEBCORE_EXPORT void setScrollVelocity(const VelocityData&); > #else > bool useCustomFixedPositionLayoutRect() const { return false; } > #endif >diff --git a/Source/WebCore/platform/graphics/TiledBacking.h b/Source/WebCore/platform/graphics/TiledBacking.h >index 444387c737b519e3c5099d6fa9e9d7b36ea355cc..525c4f3a67589a0bcf60a38a0af76f1441cdef45 100644 >--- a/Source/WebCore/platform/graphics/TiledBacking.h >+++ b/Source/WebCore/platform/graphics/TiledBacking.h >@@ -41,6 +41,7 @@ class FloatSize; > class IntRect; > class IntSize; > class PlatformCALayer; >+struct VelocityData; > > enum ScrollingModeIndication { > SynchronousScrollingBecauseOfLackOfScrollingCoordinatorIndication, >@@ -49,26 +50,6 @@ enum ScrollingModeIndication { > AsyncScrollingIndication > }; > >-struct VelocityData { >- double horizontalVelocity; >- double verticalVelocity; >- double scaleChangeRate; >- MonotonicTime lastUpdateTime; >- >- VelocityData(double horizontal = 0, double vertical = 0, double scaleChange = 0, MonotonicTime updateTime = MonotonicTime()) >- : horizontalVelocity(horizontal) >- , verticalVelocity(vertical) >- , scaleChangeRate(scaleChange) >- , lastUpdateTime(updateTime) >- { >- } >- >- bool velocityOrScaleIsChanging() const >- { >- return horizontalVelocity || verticalVelocity || scaleChangeRate; >- } >-}; >- > class TiledBacking { > public: > virtual ~TiledBacking() = default; >diff --git a/Source/WebCore/platform/graphics/VelocityData.cpp b/Source/WebCore/platform/graphics/VelocityData.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..b20529df850cd3cdd4c17ab1425ad76d5919c510 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/VelocityData.cpp >@@ -0,0 +1,46 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "VelocityData.h" >+ >+#include <wtf/text/TextStream.h> >+ >+namespace WebCore { >+ >+TextStream& operator<<(TextStream& ts, const VelocityData& velocityData) >+{ >+ ts.dumpProperty("timestamp", velocityData.lastUpdateTime.secondsSinceEpoch().value()); >+ if (velocityData.horizontalVelocity) >+ ts.dumpProperty("horizontalVelocity", velocityData.horizontalVelocity); >+ if (velocityData.verticalVelocity) >+ ts.dumpProperty("verticalVelocity", velocityData.verticalVelocity); >+ if (velocityData.scaleChangeRate) >+ ts.dumpProperty("scaleChangeRate", velocityData.scaleChangeRate); >+ >+ return ts; >+} >+ >+} // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/VelocityData.h b/Source/WebCore/platform/graphics/VelocityData.h >new file mode 100644 >index 0000000000000000000000000000000000000000..4bbe29ad15718376721a7e07d357a610c4755a07 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/VelocityData.h >@@ -0,0 +1,126 @@ >+/* >+ * Copyright (C) 2012-2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "FloatPoint.h" >+#include <wtf/MonotonicTime.h> >+#include <wtf/Optional.h> >+ >+namespace WTF { >+class TextStream; >+} >+ >+namespace WebCore { >+ >+struct VelocityData { >+ float horizontalVelocity { 0 }; >+ float verticalVelocity { 0 }; >+ float scaleChangeRate { 0 }; >+ MonotonicTime lastUpdateTime; >+ >+ VelocityData(float horizontal = 0, float vertical = 0, float scaleChange = 0, MonotonicTime updateTime = MonotonicTime()) >+ : horizontalVelocity(horizontal) >+ , verticalVelocity(vertical) >+ , scaleChangeRate(scaleChange) >+ , lastUpdateTime(updateTime) >+ { >+ } >+ >+ bool velocityOrScaleIsChanging() const >+ { >+ return horizontalVelocity || verticalVelocity || scaleChangeRate; >+ } >+ >+ bool equalIgnoringTimestamp(const VelocityData& other) const >+ { >+ return horizontalVelocity == other.horizontalVelocity >+ && verticalVelocity == other.verticalVelocity >+ && scaleChangeRate == other.scaleChangeRate; >+ } >+}; >+ >+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const VelocityData&); >+ >+class HistoricalVelocityData { >+public: >+ HistoricalVelocityData() = default; >+ >+ VelocityData velocityForNewData(FloatPoint newPosition, double scale, MonotonicTime timestamp) >+ { >+ // Due to all the source of rect update, the input is very noisy. To smooth the output, we accumulate all changes >+ // within 1 frame as a single update. No speed computation is ever done on data within the same frame. >+ const Seconds filteringThreshold(1.0 / 60); >+ >+ VelocityData velocityData; >+ if (m_historySize > 0) { >+ unsigned oldestDataIndex; >+ unsigned distanceToLastHistoricalData = m_historySize - 1; >+ if (distanceToLastHistoricalData <= m_latestDataIndex) >+ oldestDataIndex = m_latestDataIndex - distanceToLastHistoricalData; >+ else >+ oldestDataIndex = m_historySize - (distanceToLastHistoricalData - m_latestDataIndex); >+ >+ Seconds timeDelta = timestamp - m_positionHistory[oldestDataIndex].timestamp; >+ if (timeDelta > filteringThreshold) { >+ Data& oldestData = m_positionHistory[oldestDataIndex]; >+ velocityData = VelocityData((newPosition.x() - oldestData.position.x()) / timeDelta.seconds(), (newPosition.y() - oldestData.position.y()) / timeDelta.seconds(), (scale - oldestData.scale) / timeDelta.seconds(), timestamp); >+ } >+ } >+ >+ Seconds timeSinceLastAppend = timestamp - m_lastAppendTimestamp; >+ if (timeSinceLastAppend > filteringThreshold) >+ append(newPosition, scale, timestamp); >+ else >+ m_positionHistory[m_latestDataIndex] = { timestamp, newPosition, scale }; >+ >+ return velocityData; >+ } >+ >+ void clear() { m_historySize = 0; } >+ >+private: >+ void append(FloatPoint newPosition, double scale, MonotonicTime timestamp) >+ { >+ m_latestDataIndex = (m_latestDataIndex + 1) % maxHistoryDepth; >+ m_positionHistory[m_latestDataIndex] = { timestamp, newPosition, scale }; >+ m_historySize = std::min(m_historySize + 1, maxHistoryDepth); >+ m_lastAppendTimestamp = timestamp; >+ } >+ >+ static constexpr unsigned maxHistoryDepth = 3; >+ >+ unsigned m_historySize { 0 }; >+ unsigned m_latestDataIndex { 0 }; >+ MonotonicTime m_lastAppendTimestamp; >+ >+ struct Data { >+ MonotonicTime timestamp; >+ FloatPoint position; >+ double scale; >+ } m_positionHistory[maxHistoryDepth]; >+}; >+ >+} // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/ca/TileController.cpp b/Source/WebCore/platform/graphics/ca/TileController.cpp >index 432f0b8c84640fa6c548eef18b74518564a7d872..2546ac7c9c312163bcc2cd8ac3ac08dc676e5375 100644 >--- a/Source/WebCore/platform/graphics/ca/TileController.cpp >+++ b/Source/WebCore/platform/graphics/ca/TileController.cpp >@@ -34,6 +34,7 @@ > #include "Region.h" > #include "TileCoverageMap.h" > #include "TileGrid.h" >+#include "VelocityData.h" > #include <utility> > #include <wtf/MainThread.h> > #include <wtf/text/TextStream.h> >@@ -428,6 +429,7 @@ void TileController::adjustTileCoverageRect(FloatRect& coverageRect, const Float > if (!m_velocity.horizontalVelocity && !m_velocity.verticalVelocity) { > if (m_velocity.scaleChangeRate > 0) { > coverageRect = visibleRect; >+ LOG_WITH_STREAM(Tiling, stream << "TileController " << this << " computeTileCoverageRect - zooming, coverage is visible rect " << coverageRect); > return; > } > futureRect.setWidth(futureRect.width() + horizontalMargin); >@@ -448,8 +450,9 @@ void TileController::adjustTileCoverageRect(FloatRect& coverageRect, const Float > if (futureRect.y() < 0) > futureRect.setY(0); > >+ LOG_WITH_STREAM(Tiling, stream << "TileController " << this << " computeTileCoverageRect - coverage " << coverageRect << " expanded to " << unionRect(coverageRect, futureRect) << " velocity " << m_velocity); >+ > coverageRect.unite(futureRect); >- return; > #else > UNUSED_PARAM(contentsScale); > >diff --git a/Source/WebCore/platform/graphics/ca/TileController.h b/Source/WebCore/platform/graphics/ca/TileController.h >index 5797e8644080af1f064d06d3c8ae68718920d173..dbb049abe54317bd11bf08b6379df2acf68a17c3 100644 >--- a/Source/WebCore/platform/graphics/ca/TileController.h >+++ b/Source/WebCore/platform/graphics/ca/TileController.h >@@ -32,6 +32,7 @@ > #include "PlatformCALayerClient.h" > #include "TiledBacking.h" > #include "Timer.h" >+#include "VelocityData.h" > #include <wtf/Deque.h> > #include <wtf/Noncopyable.h> > #include <wtf/RetainPtr.h> >diff --git a/Source/WebKit/Shared/VisibleContentRectUpdateInfo.cpp b/Source/WebKit/Shared/VisibleContentRectUpdateInfo.cpp >index e9a883d28bfe6671cd2856446174114d3750e169..66d8073428e8cda0246f25d28d562ed5ef4fa8e0 100644 >--- a/Source/WebKit/Shared/VisibleContentRectUpdateInfo.cpp >+++ b/Source/WebKit/Shared/VisibleContentRectUpdateInfo.cpp >@@ -43,12 +43,9 @@ void VisibleContentRectUpdateInfo::encode(IPC::Encoder& encoder) const > encoder << m_customFixedPositionRect; > encoder << m_obscuredInsets; > encoder << m_unobscuredSafeAreaInsets; >+ encoder << m_scrollVelocity; > encoder << m_lastLayerTreeTransactionID; > encoder << m_scale; >- encoder << m_timestamp; >- encoder << m_horizontalVelocity; >- encoder << m_verticalVelocity; >- encoder << m_scaleChangeRate; > encoder << m_inStableState; > encoder << m_isFirstUpdateForNewViewSize; > encoder << m_isChangingObscuredInsetsInteractively; >@@ -74,18 +71,12 @@ bool VisibleContentRectUpdateInfo::decode(IPC::Decoder& decoder, VisibleContentR > return false; > if (!decoder.decode(result.m_unobscuredSafeAreaInsets)) > return false; >+ if (!decoder.decode(result.m_scrollVelocity)) >+ return false; > if (!decoder.decode(result.m_lastLayerTreeTransactionID)) > return false; > if (!decoder.decode(result.m_scale)) > return false; >- if (!decoder.decode(result.m_timestamp)) >- return false; >- if (!decoder.decode(result.m_horizontalVelocity)) >- return false; >- if (!decoder.decode(result.m_verticalVelocity)) >- return false; >- if (!decoder.decode(result.m_scaleChangeRate)) >- return false; > if (!decoder.decode(result.m_inStableState)) > return false; > if (!decoder.decode(result.m_isFirstUpdateForNewViewSize)) >@@ -132,14 +123,8 @@ TextStream& operator<<(TextStream& ts, const VisibleContentRectUpdateInfo& info) > if (info.enclosedInScrollableAncestorView()) > ts.dumpProperty("enclosedInScrollableAncestorView", info.enclosedInScrollableAncestorView()); > >- ts.dumpProperty("timestamp", info.timestamp().secondsSinceEpoch().value()); > ts.dumpProperty("allowShrinkToFit", info.allowShrinkToFit()); >- if (info.horizontalVelocity()) >- ts.dumpProperty("horizontalVelocity", info.horizontalVelocity()); >- if (info.verticalVelocity()) >- ts.dumpProperty("verticalVelocity", info.verticalVelocity()); >- if (info.scaleChangeRate()) >- ts.dumpProperty("scaleChangeRate", info.scaleChangeRate()); >+ ts.dumpProperty("scrollVelocity", info.scrollVelocity()); > > return ts; > } >diff --git a/Source/WebKit/Shared/VisibleContentRectUpdateInfo.h b/Source/WebKit/Shared/VisibleContentRectUpdateInfo.h >index 814ca54c21d3f5335672e1ce23b5f6cb8d5f8eac..50a8f9e6b33dcbac16df96ce42f92327896b0ee9 100644 >--- a/Source/WebKit/Shared/VisibleContentRectUpdateInfo.h >+++ b/Source/WebKit/Shared/VisibleContentRectUpdateInfo.h >@@ -27,6 +27,7 @@ > > #include <WebCore/FloatRect.h> > #include <WebCore/LengthBox.h> >+#include <WebCore/VelocityData.h> > #include <wtf/MonotonicTime.h> > #include <wtf/text/WTFString.h> > >@@ -45,7 +46,7 @@ class VisibleContentRectUpdateInfo { > public: > VisibleContentRectUpdateInfo() = default; > >- VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedContentRect, const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatBoxExtent& contentInsets, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& customFixedPositionRect, const WebCore::FloatBoxExtent& obscuredInsets, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double scale, bool inStableState, bool isFirstUpdateForNewViewSize, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, bool enclosedInScrollableAncestorView, MonotonicTime timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId) >+ VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedContentRect, const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatBoxExtent& contentInsets, const WebCore::FloatRect& unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& customFixedPositionRect, const WebCore::FloatBoxExtent& obscuredInsets, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double scale, bool inStableState, bool isFirstUpdateForNewViewSize, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, bool enclosedInScrollableAncestorView, const WebCore::VelocityData& scrollVelocity, uint64_t lastLayerTreeTransactionId) > : m_exposedContentRect(exposedContentRect) > , m_unobscuredContentRect(unobscuredContentRect) > , m_contentInsets(contentInsets) >@@ -54,12 +55,9 @@ public: > , m_customFixedPositionRect(customFixedPositionRect) > , m_obscuredInsets(obscuredInsets) > , m_unobscuredSafeAreaInsets(unobscuredSafeAreaInsets) >+ , m_scrollVelocity(scrollVelocity) > , m_lastLayerTreeTransactionID(lastLayerTreeTransactionId) > , m_scale(scale) >- , m_timestamp(timestamp) >- , m_horizontalVelocity(horizontalVelocity) >- , m_verticalVelocity(verticalVelocity) >- , m_scaleChangeRate(scaleChangeRate) > , m_inStableState(inStableState) > , m_isFirstUpdateForNewViewSize(isFirstUpdateForNewViewSize) > , m_isChangingObscuredInsetsInteractively(isChangingObscuredInsetsInteractively) >@@ -74,6 +72,7 @@ public: > 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::VelocityData& scrollVelocity() const { return m_scrollVelocity; } > const WebCore::FloatBoxExtent& obscuredInsets() const { return m_obscuredInsets; } > const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets() const { return m_unobscuredSafeAreaInsets; } > >@@ -83,14 +82,10 @@ public: > bool isChangingObscuredInsetsInteractively() const { return m_isChangingObscuredInsetsInteractively; } > bool allowShrinkToFit() const { return m_allowShrinkToFit; } > bool enclosedInScrollableAncestorView() const { return m_enclosedInScrollableAncestorView; } >- >- MonotonicTime timestamp() const { return m_timestamp; } >- double horizontalVelocity() const { return m_horizontalVelocity; } >- double verticalVelocity() const { return m_verticalVelocity; } >- double scaleChangeRate() const { return m_scaleChangeRate; } >- > uint64_t lastLayerTreeTransactionID() const { return m_lastLayerTreeTransactionID; } > >+ MonotonicTime timestamp() const { return m_scrollVelocity.lastUpdateTime; } >+ > void encode(IPC::Encoder&) const; > static bool decode(IPC::Decoder&, VisibleContentRectUpdateInfo&); > >@@ -105,12 +100,9 @@ private: > WebCore::FloatRect m_customFixedPositionRect; // When visual viewports are enabled, this is the layout viewport. > WebCore::FloatBoxExtent m_obscuredInsets; > WebCore::FloatBoxExtent m_unobscuredSafeAreaInsets; >+ WebCore::VelocityData m_scrollVelocity; > uint64_t m_lastLayerTreeTransactionID { 0 }; > double m_scale { -1 }; >- MonotonicTime m_timestamp; >- double m_horizontalVelocity { 0 }; >- double m_verticalVelocity { 0 }; >- double m_scaleChangeRate { 0 }; > bool m_inStableState { false }; > bool m_isFirstUpdateForNewViewSize { false }; > bool m_isChangingObscuredInsetsInteractively { false }; >@@ -129,9 +121,7 @@ inline bool operator==(const VisibleContentRectUpdateInfo& a, const VisibleConte > && a.customFixedPositionRect() == b.customFixedPositionRect() > && a.obscuredInsets() == b.obscuredInsets() > && a.unobscuredSafeAreaInsets() == b.unobscuredSafeAreaInsets() >- && a.horizontalVelocity() == b.horizontalVelocity() >- && a.verticalVelocity() == b.verticalVelocity() >- && a.scaleChangeRate() == b.scaleChangeRate() >+ && a.scrollVelocity().equalIgnoringTimestamp(b.scrollVelocity()) > && a.inStableState() == b.inStableState() > && a.isFirstUpdateForNewViewSize() == b.isFirstUpdateForNewViewSize() > && a.allowShrinkToFit() == b.allowShrinkToFit() >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >index d4def8e9f596a7664509ba07e0e7b1877f31dc74..c984c4c99abb68833117f64cb0ebc021a8d008df 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >@@ -81,6 +81,7 @@ > #include <WebCore/TimingFunction.h> > #include <WebCore/TransformationMatrix.h> > #include <WebCore/UserStyleSheet.h> >+#include <WebCore/VelocityData.h> > #include <WebCore/ViewportArguments.h> > #include <WebCore/WindowFeatures.h> > #include <pal/SessionID.h> >@@ -923,6 +924,36 @@ bool ArgumentCoder<ViewportAttributes>::decode(Decoder& decoder, ViewportAttribu > return SimpleArgumentCoder<ViewportAttributes>::decode(decoder, viewportAttributes); > } > >+void ArgumentCoder<VelocityData>::encode(Encoder& encoder, const VelocityData& velocityData) >+{ >+ encoder << velocityData.horizontalVelocity << velocityData.verticalVelocity << velocityData.scaleChangeRate << velocityData.lastUpdateTime; >+} >+ >+bool ArgumentCoder<VelocityData>::decode(Decoder& decoder, VelocityData& velocityData) >+{ >+ float horizontalVelocity; >+ if (!decoder.decode(horizontalVelocity)) >+ return false; >+ >+ float verticalVelocity; >+ if (!decoder.decode(verticalVelocity)) >+ return false; >+ >+ float scaleChangeRate; >+ if (!decoder.decode(scaleChangeRate)) >+ return false; >+ >+ MonotonicTime lastUpdateTime; >+ if (!decoder.decode(lastUpdateTime)) >+ return false; >+ >+ velocityData.horizontalVelocity = horizontalVelocity; >+ velocityData.verticalVelocity = verticalVelocity; >+ velocityData.scaleChangeRate = scaleChangeRate; >+ velocityData.lastUpdateTime = lastUpdateTime; >+ >+ return true; >+} > > void ArgumentCoder<MimeClassInfo>::encode(Encoder& encoder, const MimeClassInfo& mimeClassInfo) > { >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.h b/Source/WebKit/Shared/WebCoreArgumentCoders.h >index d882fb68d891aa2eec717cf4a2af3b043bf302f2..fb7730719b64058f5f2bc49a0e9a4a7621e41dc4 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.h >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.h >@@ -125,6 +125,7 @@ struct TextIndicatorData; > #if ENABLE(POINTER_EVENTS) > struct TouchActionData; > #endif >+struct VelocityData; > struct ViewportAttributes; > struct WindowFeatures; > >@@ -334,6 +335,11 @@ template<> struct ArgumentCoder<WebCore::ViewportAttributes> { > static bool decode(Decoder&, WebCore::ViewportAttributes&); > }; > >+template<> struct ArgumentCoder<WebCore::VelocityData> { >+ static void encode(Encoder&, const WebCore::VelocityData&); >+ static bool decode(Decoder&, WebCore::VelocityData&); >+}; >+ > template<> struct ArgumentCoder<WebCore::MimeClassInfo> { > static void encode(Encoder&, const WebCore::MimeClassInfo&); > static Optional<WebCore::MimeClassInfo> decode(Decoder&); >diff --git a/Source/WebKit/UIProcess/ios/WKContentView.mm b/Source/WebKit/UIProcess/ios/WKContentView.mm >index 55d80ca55dfc556544278f6102cdaaf9d01501c0..56b4562c796a714b9a0937d66828137b88b46923 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentView.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentView.mm >@@ -60,103 +60,12 @@ > #import <WebCore/NotImplemented.h> > #import <WebCore/PlatformScreen.h> > #import <WebCore/Quirks.h> >+#import <WebCore/VelocityData.h> > #import <pal/spi/cocoa/QuartzCoreSPI.h> > #import <wtf/RetainPtr.h> > #import <wtf/text/TextStream.h> > > >-namespace WebKit { >-using namespace WebCore; >-using namespace WebKit; >- >-class HistoricalVelocityData { >-public: >- struct VelocityData { >- VelocityData() >- : horizontalVelocity(0) >- , verticalVelocity(0) >- , scaleChangeRate(0) >- { >- } >- >- VelocityData(double horizontalVelocity, double verticalVelocity, double scaleChangeRate) >- : horizontalVelocity(horizontalVelocity) >- , verticalVelocity(verticalVelocity) >- , scaleChangeRate(scaleChangeRate) >- { >- } >- >- double horizontalVelocity; >- double verticalVelocity; >- double scaleChangeRate; >- }; >- >- HistoricalVelocityData() >- : m_historySize(0) >- , m_latestDataIndex(0) >- { >- } >- >- VelocityData velocityForNewData(CGPoint newPosition, double scale, MonotonicTime timestamp) >- { >- // Due to all the source of rect update, the input is very noisy. To smooth the output, we accumulate all changes >- // within 1 frame as a single update. No speed computation is ever done on data within the same frame. >- const Seconds filteringThreshold(1.0 / 60); >- >- VelocityData velocityData; >- if (m_historySize > 0) { >- unsigned oldestDataIndex; >- unsigned distanceToLastHistoricalData = m_historySize - 1; >- if (distanceToLastHistoricalData <= m_latestDataIndex) >- oldestDataIndex = m_latestDataIndex - distanceToLastHistoricalData; >- else >- oldestDataIndex = m_historySize - (distanceToLastHistoricalData - m_latestDataIndex); >- >- Seconds timeDelta = timestamp - m_history[oldestDataIndex].timestamp; >- if (timeDelta > filteringThreshold) { >- Data& oldestData = m_history[oldestDataIndex]; >- velocityData = VelocityData((newPosition.x - oldestData.position.x) / timeDelta.seconds(), (newPosition.y - oldestData.position.y) / timeDelta.seconds(), (scale - oldestData.scale) / timeDelta.seconds()); >- } >- } >- >- Seconds timeSinceLastAppend = timestamp - m_lastAppendTimestamp; >- if (timeSinceLastAppend > filteringThreshold) >- append(newPosition, scale, timestamp); >- else >- m_history[m_latestDataIndex] = { timestamp, newPosition, scale }; >- return velocityData; >- } >- >- void clear() { m_historySize = 0; } >- >-private: >- void append(CGPoint newPosition, double scale, MonotonicTime timestamp) >- { >- m_latestDataIndex = (m_latestDataIndex + 1) % maxHistoryDepth; >- m_history[m_latestDataIndex] = { timestamp, newPosition, scale }; >- >- unsigned size = m_historySize + 1; >- if (size <= maxHistoryDepth) >- m_historySize = size; >- >- m_lastAppendTimestamp = timestamp; >- } >- >- >- static const unsigned maxHistoryDepth = 3; >- >- unsigned m_historySize; >- unsigned m_latestDataIndex; >- MonotonicTime m_lastAppendTimestamp; >- >- struct Data { >- MonotonicTime timestamp; >- CGPoint position; >- double scale; >- } m_history[maxHistoryDepth]; >-}; >-} // namespace WebKit >- > @interface WKInspectorIndicationView : UIView > @end > >@@ -223,7 +132,7 @@ @implementation WKContentView { > RetainPtr<_UILayerHostView> _visibilityPropagationView; > #endif > >- WebKit::HistoricalVelocityData _historicalKinematicData; >+ WebCore::HistoricalVelocityData _historicalKinematicData; > > RetainPtr<NSUndoManager> _undoManager; > RetainPtr<WKQuirkyNSUndoManager> _quirkyUndoManager; >@@ -463,11 +372,13 @@ - (void)didUpdateVisibleRect:(CGRect)visibleContentRect > return; > > MonotonicTime timestamp = MonotonicTime::now(); >- WebKit::HistoricalVelocityData::VelocityData velocityData; >+ WebCore::VelocityData velocityData; > if (!isStableState) > velocityData = _historicalKinematicData.velocityForNewData(visibleContentRect.origin, zoomScale, timestamp); >- else >+ else { > _historicalKinematicData.clear(); >+ velocityData = { 0, 0, 0, timestamp }; >+ } > > WebKit::RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy(); > >@@ -489,10 +400,7 @@ - (void)didUpdateVisibleRect:(CGRect)visibleContentRect > isChangingObscuredInsetsInteractively, > _webView._allowsViewportShrinkToFit, > enclosedInScrollableAncestorView, >- timestamp, >- velocityData.horizontalVelocity, >- velocityData.verticalVelocity, >- velocityData.scaleChangeRate, >+ velocityData, > downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*drawingArea).lastCommittedLayerTreeTransactionID()); > > LOG_WITH_STREAM(VisibleRects, stream << "-[WKContentView didUpdateVisibleRect]" << visibleContentRectUpdateInfo.dump()); >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index c119d4f1247ef65c6b88dacedccb7e81e71e2fb0..3817be235dd644e2ce6b749c1dd39bf2852088ee 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -3116,7 +3116,7 @@ void WebPage::dynamicViewportSizeUpdate(const FloatSize& viewLayoutSize, const W > newExposedContentRect.moveBy(adjustmentDelta); > } > >- frameView.setScrollVelocity(0, 0, 0, MonotonicTime::now()); >+ frameView.setScrollVelocity({ 0, 0, 0, MonotonicTime::now() }); > > IntPoint roundedUnobscuredContentRectPosition = roundedIntPoint(newUnobscuredContentRect.location()); > frameView.setUnobscuredContentSize(newUnobscuredContentRect.size()); >@@ -3289,7 +3289,7 @@ void WebPage::viewportConfigurationChanged(ZoomToInitialScale zoomToInitialScale > minimumLayoutSizeInScrollViewCoordinates.scale(1 / scale); > IntSize minimumLayoutSizeInDocumentCoordinates = roundedIntSize(minimumLayoutSizeInScrollViewCoordinates); > frameView.setUnobscuredContentSize(minimumLayoutSizeInDocumentCoordinates); >- frameView.setScrollVelocity(0, 0, 0, MonotonicTime::now()); >+ frameView.setScrollVelocity({ 0, 0, 0, MonotonicTime::now() }); > > // FIXME: We could send down the obscured margins to find a better exposed rect and unobscured rect. > // It is not a big deal at the moment because the tile coverage will always extend past the obscured bottom inset. >@@ -3360,15 +3360,15 @@ void WebPage::applicationDidBecomeActive() > m_page->applicationDidBecomeActive(); > } > >-static inline void adjustVelocityDataForBoundedScale(double& horizontalVelocity, double& verticalVelocity, double& scaleChangeRate, double exposedRectScale, double minimumScale, double maximumScale) >+static inline void adjustVelocityDataForBoundedScale(VelocityData& velocityData, double exposedRectScale, double minimumScale, double maximumScale) > { >- if (scaleChangeRate) { >- horizontalVelocity = 0; >- verticalVelocity = 0; >+ if (velocityData.scaleChangeRate) { >+ velocityData.horizontalVelocity = 0; >+ velocityData.verticalVelocity = 0; > } > > if (exposedRectScale >= maximumScale || exposedRectScale <= minimumScale) >- scaleChangeRate = 0; >+ velocityData.scaleChangeRate = 0; > } > > Optional<float> WebPage::scaleFromUIProcess(const VisibleContentRectUpdateInfo& visibleContentRectUpdateInfo) const >@@ -3476,12 +3476,9 @@ void WebPage::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visi > m_page->setUnobscuredSafeAreaInsets(visibleContentRectUpdateInfo.unobscuredSafeAreaInsets()); > m_page->setEnclosedInScrollableAncestorView(visibleContentRectUpdateInfo.enclosedInScrollableAncestorView()); > >- double horizontalVelocity = visibleContentRectUpdateInfo.horizontalVelocity(); >- double verticalVelocity = visibleContentRectUpdateInfo.verticalVelocity(); >- double scaleChangeRate = visibleContentRectUpdateInfo.scaleChangeRate(); >- adjustVelocityDataForBoundedScale(horizontalVelocity, verticalVelocity, scaleChangeRate, visibleContentRectUpdateInfo.scale(), m_viewportConfiguration.minimumScale(), m_viewportConfiguration.maximumScale()); >- >- frameView.setScrollVelocity(horizontalVelocity, verticalVelocity, scaleChangeRate, visibleContentRectUpdateInfo.timestamp()); >+ VelocityData scrollVelocity = visibleContentRectUpdateInfo.scrollVelocity(); >+ adjustVelocityDataForBoundedScale(scrollVelocity, visibleContentRectUpdateInfo.scale(), m_viewportConfiguration.minimumScale(), m_viewportConfiguration.maximumScale()); >+ frameView.setScrollVelocity(scrollVelocity); > > if (m_isInStableState) { > if (visibleContentRectUpdateInfo.unobscuredContentRect() != visibleContentRectUpdateInfo.unobscuredContentRectRespectingInputViewBounds())
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198261
:
370656
|
370659
|
370660
| 370662