2010-01-24 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jan 2010 04:11:38 +0000 (04:11 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jan 2010 04:11:38 +0000 (04:11 +0000)
commit957c019d26fd6baf3d0101051ff2417b751f42c7
tree3d5a9dd0b5296f7a55ca11f286647f68c8361884
parentbf06e3c78c16e79e57dc6482d714f4d8b9071dbc
2010-01-24  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dan Bernstein.

        Content with heavily nested residual style is so slow, it seems like a hang
        https://bugs.webkit.org/show_bug.cgi?id=34059
        <rdar://problem/7292906>

        Test cast: fast/parser/residual-style-hang.html

        * html/HTMLParser.cpp:
        (WebCore::HTMLParser::handleResidualStyleCloseTagAcrossBlocks):
        Limit the number of iterations of the main loop to 5.

        The reason this limit is necessary is that otherwise, N misnested open tags followed
        by N misnested close tags will cause O(N^2) of work due to cloning and attaching subtrees;
        at a fixed limit, the cost is at worst O(N).

        The code that was in the loop originally ran exactly once - the loop was added in
        r21472 to fix <https://bugs.webkit.org/show_bug.cgi?id=13603>. I have verified that
        with the iteration limit, the bug is still fixed, both with the original test case
        and with the layout tests tht were added.
2010-01-24  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dan Bernstein.

        Content with heavily nested residual style is so slow, it seems like a hang
        https://bugs.webkit.org/show_bug.cgi?id=34059
        <rdar://problem/7292906>

        Test case for the above bug fix.

        * fast/parser/residual-style-hang-expected.txt: Added.
        * fast/parser/residual-style-hang.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/parser/residual-style-hang-expected.txt [new file with mode: 0644]
LayoutTests/fast/parser/residual-style-hang.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLParser.cpp