Simple line layout(regression): Calling innerText on RenderFlow with multiple children is slow.
https://bugs.webkit.org/show_bug.cgi?id=143554

Reviewed by Antti Koivisto.

Initialize render flow's segments only when the render flow changes in TextIterator.
The included performance test shows 6x speedup. (from ~10 runs/sec to ~60 runs/sec)

PerformanceTests:

* Layout/simple-line-layout-innertext.html: Added.

Source/WebCore:

Test: PerformanceTests/Layout/simple-line-layout-innertext.html.

* editing/TextIterator.cpp:
(WebCore::TextIterator::handleTextNode):
* editing/TextIterator.h:
* rendering/SimpleLineLayoutFlowContents.cpp: Instruments log shows that vector's expandCapacity could be expensive when flow has large amount of children.
(WebCore::SimpleLineLayout::initializeSegments):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@182604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/PerformanceTests/ChangeLog b/PerformanceTests/ChangeLog
index 8615dd4..44777a2 100644
--- a/PerformanceTests/ChangeLog
+++ b/PerformanceTests/ChangeLog
@@ -1,3 +1,15 @@
+2015-04-09  Zalan Bujtas  <zalan@apple.com>
+
+        Simple line layout(regression): Calling innerText on RenderFlow with multiple children is slow.
+        https://bugs.webkit.org/show_bug.cgi?id=143554
+
+        Reviewed by Antti Koivisto.
+
+        Initialize render flow's segments only when the render flow changes in TextIterator.
+        The included performance test shows 6x speedup. (from ~10 runs/sec to ~60 runs/sec)
+
+        * Layout/simple-line-layout-innertext.html: Added.
+
 2015-03-09  Chris Dumez  <cdumez@apple.com>
 
         [CG] Have Canvas use the IOSurfacePool