WebKit Bugzilla
Attachment 341572 Details for
Bug 186091
: WebKit memory management: Safari jetsams on some websites when zooming and scrolling
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
visible-rect-adjustment.patch (text/plain), 4.77 KB, created by
Antti Koivisto
on 2018-05-30 07:43:57 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2018-05-30 07:43:57 PDT
Size:
4.77 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 232290) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,32 @@ >+2018-05-30 Antti Koivisto <antti@apple.com> >+ >+ WebKit memory management: Safari jetsams on some websites when zooming and scrolling >+ https://bugs.webkit.org/show_bug.cgi?id=186091 >+ <rdar://problem/36315010> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When zooming a page rapidly the visible rect and the page zoom level may get momentarily out of sync. >+ When this happens we may generate tiles for a much larger area than needed and run out of memory >+ building the next layer tree transaction. Running out of memory is more likely if the page has lots of >+ tiled layers in addition to the main content layer. >+ >+ We already have code for dealing with the scale mismatch for zoom-out case (where this would cause >+ visibly missing tiles). This patch enables the same exact adjustment for zoom-in case (where the >+ symptom is creating too many tiles). >+ >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::adjustExposedRectForNewScale): >+ >+ Do some renames to make it clear that this can both expand and contract the visible rect. >+ Bail out if there is nothing to do. >+ >+ (WebKit::WebPage::updateVisibleContentRects): >+ >+ Call adjustExposedRectForNewScale directly and unconditionally. >+ >+ (WebKit::adjustExposedRectForBoundedScale): Deleted. >+ > 2018-05-29 Tim Horton <timothy_horton@apple.com> > > Fix the build >Index: Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >=================================================================== >--- Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (revision 232149) >+++ Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (working copy) >@@ -299,13 +299,13 @@ static FloatPoint relativeCenterAfterCon > > static inline FloatRect adjustExposedRectForNewScale(const FloatRect& exposedRect, double exposedRectScale, double newScale) > { >- double overscaledWidth = exposedRect.width(); >- double missingHorizonalMargin = exposedRect.width() * exposedRectScale / newScale - overscaledWidth; >+ if (exposedRectScale == newScale) >+ return exposedRect; > >- double overscaledHeight = exposedRect.height(); >- double missingVerticalMargin = exposedRect.height() * exposedRectScale / newScale - overscaledHeight; >+ double horizontalChange = exposedRect.width() * exposedRectScale / newScale - exposedRect.width(); >+ double verticalChange = exposedRect.height() * exposedRectScale / newScale - exposedRect.height(); > >- return FloatRect(exposedRect.x() - missingHorizonalMargin / 2, exposedRect.y() - missingVerticalMargin / 2, exposedRect.width() + missingHorizonalMargin, exposedRect.height() + missingVerticalMargin); >+ return FloatRect(exposedRect.x() - horizontalChange / 2, exposedRect.y() - verticalChange / 2, exposedRect.width() + horizontalChange, exposedRect.height() + verticalChange); > } > > void WebPage::restorePageState(const HistoryItem& historyItem) >@@ -2807,14 +2807,6 @@ static inline void adjustVelocityDataFor > scaleChangeRate = 0; > } > >-static inline FloatRect adjustExposedRectForBoundedScale(const FloatRect& exposedRect, double exposedRectScale, double newScale) >-{ >- if (exposedRectScale < newScale) >- return exposedRect; >- >- return adjustExposedRectForNewScale(exposedRect, exposedRectScale, newScale); >-} >- > std::optional<float> WebPage::scaleFromUIProcess(const VisibleContentRectUpdateInfo& visibleContentRectUpdateInfo) const > { > auto transactionIDForLastScaleSentToUIProcess = downcast<RemoteLayerTreeDrawingArea>(*m_drawingArea).lastCommittedTransactionID(); >@@ -2885,7 +2877,7 @@ void WebPage::updateVisibleContentRects( > > float scaleToUse = scaleFromUIProcess.value_or(m_page->pageScaleFactor()); > FloatRect exposedContentRect = visibleContentRectUpdateInfo.exposedContentRect(); >- FloatRect adjustedExposedContentRect = adjustExposedRectForBoundedScale(exposedContentRect, visibleContentRectUpdateInfo.scale(), scaleToUse); >+ FloatRect adjustedExposedContentRect = adjustExposedRectForNewScale(exposedContentRect, visibleContentRectUpdateInfo.scale(), scaleToUse); > m_drawingArea->setExposedContentRect(adjustedExposedContentRect); > > IntPoint scrollPosition = roundedIntPoint(visibleContentRectUpdateInfo.unobscuredContentRect().location()); >@@ -2901,7 +2893,7 @@ void WebPage::updateVisibleContentRects( > hasSetPageScale = true; > send(Messages::WebPageProxy::PageScaleFactorDidChange(scaleFromUIProcess.value())); > } >- >+ > if (!hasSetPageScale && m_isInStableState) { > m_page->setPageScaleFactor(scaleToUse, scrollPosition, true); > hasSetPageScale = true;
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
Flags:
ggaren
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186091
:
341572
|
341657
|
341658