Changeset 49748 in webkit


Ignore:
Timestamp:
Oct 17, 2009 11:27:17 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-10-17 Yuta Kitamura <yutak@chromium.org>

Reviewed by Darin Adler.

Fix inefficient string concatenation.

LayoutTests/fast/css/large-list-of-rules-crash.html contains code that
concatenate strings in an inefficient way. Concatenation of strings should be
done with Array.join method. This patch fixes this issue, and also fixes typos
in the test.

fast/css/large-list-of-rules-crash.html concatenates strings in an inefficient way
https://bugs.webkit.org/show_bug.cgi?id=30436

  • fast/css/large-list-of-rules-crash.html:
Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r49737 r49748  
     12009-10-17  Yuta Kitamura  <yutak@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Fix inefficient string concatenation.
     6       
     7        LayoutTests/fast/css/large-list-of-rules-crash.html contains code that
     8        concatenate strings in an inefficient way. Concatenation of strings should be
     9        done with Array.join method. This patch fixes this issue, and also fixes typos
     10        in the test.
     11
     12        fast/css/large-list-of-rules-crash.html concatenates strings in an inefficient way
     13        https://bugs.webkit.org/show_bug.cgi?id=30436
     14
     15        * fast/css/large-list-of-rules-crash.html:
     16
    1172009-10-17  Pavel Feldman  <pfeldman@chromium.org>
    218
  • trunk/LayoutTests/fast/css/large-list-of-rules-crash.html

    r46728 r49748  
    44
    55<script type="text/javascript">
    6 var s = "";
    7 for (i = 0 ; i < 200000 ; i++) {
    8    s += "a {}\n";
    9 }
     6var array = Array(200000);
     7for (var i = 0; i < 200000; ++i)
     8    array[i] = "a {}\n";
     9var s = array.join("");
     10
    1011var style = document.createElement("style");
    1112style.appendChild(document.createTextNode(s));
     
    1819<!-- loading a linked style sheet causes the list of CSS Rules to be rebuilt,
    1920     which caused a crash (stack overflow) -->
    20 <link rel="stylesheet" href="results/large-list-of-rules-crash.css">
    21 <link rel="stylesheet" href="results/large-list-of-rules-crash.css">
     21<link rel="stylesheet" href="resources/large-list-of-rules-crash.css">
     22<link rel="stylesheet" href="resources/large-list-of-rules-crash.css">
    2223
    2324<p>Test case for
Note: See TracChangeset for help on using the changeset viewer.