Bug 158491

Summary: Web Inspector: reduce timer churn when processing many DOM.attributeModified messages
Product: WebKit Reporter: BJ Burg <bburg>
Component: Web InspectorAssignee: BJ Burg <bburg>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed Fix timothy: review+, bburg: commit-queue-

Description BJ Burg 2016-06-07 13:36:23 PDT
This patch fixes two issues at play in 142466 and 156250.

We currently use the Object.debounce/Object.soon proxy to try to coalesce calls to DOMTreeUpdater._attributesModified. Unfortunately, this doesn't coalesce very many calls because .soon is equivalent to using setTimeout(0). So we end up setting and clearing a timer for every attribute modification, and only coalesce calls until the timer fires. This means we also update the DOMTreeOutline multiple times per frame because this work is not done on a requestAnimationFrame, and the timer could fire many times in a frame's time slice.
Comment 1 BJ Burg 2016-06-07 13:36:37 PDT
<rdar://problem/25561452>
Comment 2 BJ Burg 2016-06-07 13:57:22 PDT
Created attachment 280736 [details]
Proposed Fix
Comment 3 BJ Burg 2016-06-07 17:30:41 PDT
Committed r201778: <http://trac.webkit.org/changeset/201778>