Bug 131559

Summary: Aggregate multiple "respondToChangedSelection" calls to one scan for telephone numbers
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebKit2Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, commit-queue, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: All   
Attachments:
Description Flags
Patch v1 none

Description Brady Eidson 2014-04-11 13:16:29 PDT
Aggregate multiple "respondToChangedSelection" calls to one scan for telephone numbers

Turns out Editor::respondToChangedSelection is called a lot more often than when the user visible selection changes as the result of a user event.

In fact, it can be called many (hundreds!) of times during one iteration of the run loop.

We should aggregate all of those calls into a single telephone number scan.
Comment 1 Brady Eidson 2014-04-11 13:18:48 PDT
Created attachment 229157 [details]
Patch v1
Comment 2 WebKit Commit Bot 2014-04-11 14:09:43 PDT
Comment on attachment 229157 [details]
Patch v1

Clearing flags on attachment: 229157

Committed r167148: <http://trac.webkit.org/changeset/167148>
Comment 3 WebKit Commit Bot 2014-04-11 14:09:46 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Ryosuke Niwa 2014-04-11 16:20:23 PDT
Why don't we just do this in editorUIUpdateTimerFired instead of adding a separate timer?
Comment 5 Brady Eidson 2014-04-11 19:27:29 PDT
(In reply to comment #4)
> Why don't we just do this in editorUIUpdateTimerFired instead of adding a separate timer?

I saw that there was an early return before the m_editorUIUpdateTimer was started, but knew we needed to do this work every time.

Looking at it closer now, the early return was simply a:
    if (m_editorUIUpdateTimer.isActive())
        return;
check.

I agree the existing timer should be good enough here!

(I won't be near a dev environment for a few days, in case anyone else wanted to fix this before then)