Bug 208625

Summary: Make m_viewportConstrainedObjects into a WeakHashSet
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: New BugsAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarcelo, commit-queue, esprehn+autocc, ews-watchlist, fred.wang, glenn, jamesr, koivisto, kondapallykalyan, luiz, pdr, rniwa, simon.fraser, tonikitoo, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
koivisto: review+
Patch none

Description Simon Fraser (smfr) 2020-03-04 22:00:16 PST
Make m_viewportConstrainedObjects into a WeakHashSet
Comment 1 Simon Fraser (smfr) 2020-03-04 22:00:45 PST
Created attachment 392535 [details]
Patch
Comment 2 Ryosuke Niwa 2020-03-04 22:05:27 PST
Comment on attachment 392535 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=392535&action=review

> Source/WebCore/page/FrameView.h:301
> -    bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObjects && m_viewportConstrainedObjects->size() > 0; }
> +    bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObjects && m_viewportConstrainedObjects->computeSize(); }

Use !m_viewportConstrainedObjects->computeEmpty() instead. computeSize() will iterate over the entire map.
Comment 3 Simon Fraser (smfr) 2020-03-05 09:08:59 PST
Created attachment 392580 [details]
Patch
Comment 4 Antti Koivisto 2020-03-05 09:11:38 PST
Comment on attachment 392580 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=392580&action=review

> Source/WebCore/page/FrameView.h:299
> +    typedef WeakHashSet<RenderLayerModelObject> ViewportConstrainedObjectSet;

using ViewportConstrainedObjectSet = WeakHashSet<RenderLayerModelObject>;
reads better though I'm not sure this is needed in the first place.
Comment 5 Simon Fraser (smfr) 2020-03-05 09:19:04 PST
Created attachment 392583 [details]
Patch
Comment 6 WebKit Commit Bot 2020-03-05 11:06:24 PST
Comment on attachment 392583 [details]
Patch

Clearing flags on attachment: 392583

Committed r257933: <https://trac.webkit.org/changeset/257933>
Comment 7 Radar WebKit Bug Importer 2020-03-05 11:45:16 PST
<rdar://problem/60093382>