Bug 130820

Summary: HTMLConverter::_processText is slow because it walks up ancestor elements
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: HTML EditingAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, enrica, kling, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 130227    
Attachments:
Description Flags
Adds a new cache none

Description Ryosuke Niwa 2014-03-26 22:30:53 PDT
Right now HTMLConverter::_processText walks up the entire ancestor chain to merge their attributed strings.
Doing that for every text node results in O(kn) runtime complexity where k is the depth of the tree and n is the number of text nodes in the tree.
Comment 1 Ryosuke Niwa 2014-03-26 22:35:46 PDT
Created attachment 227922 [details]
Adds a new cache
Comment 2 WebKit Commit Bot 2014-03-26 23:23:15 PDT
Comment on attachment 227922 [details]
Adds a new cache

Clearing flags on attachment: 227922

Committed r166347: <http://trac.webkit.org/changeset/166347>
Comment 3 WebKit Commit Bot 2014-03-26 23:23:18 PDT
All reviewed patches have been landed.  Closing bug.