HTMLConverter::aggregatedAttributesForAncestors should cache intermediate results
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Apr 2014 00:06:09 +0000 (00:06 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Apr 2014 00:06:09 +0000 (00:06 +0000)
commit1861c7679aafc1b07653fe98e3c1753d0c5a65c1
tree5f272aa2bbdcb743268b9af68254d00190a59241
parent40bb1a3cbb05c2aadbdee2ac888e50e0debbb72b
HTMLConverter::aggregatedAttributesForAncestors should cache intermediate results
https://bugs.webkit.org/show_bug.cgi?id=131400

Reviewed by Sam Weinig.

Instead of accumulating attributes from a character node to the highest ancestor,
recursively call aggregatedAttributesForElementAndItsAncestors so that aggregated
attributes are cached on each ancestor to eliminate the old O(n^2) behavior.

* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::aggregatedAttributesForAncestors):
(HTMLConverter::aggregatedAttributesForElementAndItsAncestors): Extracted from aggregatedAttributesForAncestors.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/editing/cocoa/HTMLConverter.mm