Changeset 64702 in webkit


Ignore:
Timestamp:
Aug 4, 2010 6:10:07 PM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-08-04 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

fast/parser/residual-style-hang.html hangs
https://bugs.webkit.org/show_bug.cgi?id=42950

Add a dump-as-markup test that shows what DOM we actually create in
this case.

Note: these results are for the existing parser.

  • fast/parser/residual-style-dom-expected.txt: Added.
  • fast/parser/residual-style-dom.html: Added.

2010-08-04 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

fast/parser/residual-style-hang.html hangs
https://bugs.webkit.org/show_bug.cgi?id=42950

We need to cap the iteration of the adoption agency algorithm to
prevent this hang. The legacy tree builder does this as well.

  • html/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r64701 r64702  
     12010-08-04  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        fast/parser/residual-style-hang.html hangs
     6        https://bugs.webkit.org/show_bug.cgi?id=42950
     7
     8        Add a dump-as-markup test that shows what DOM we actually create in
     9        this case.
     10
     11        Note: these results are for the existing parser.
     12
     13        * fast/parser/residual-style-dom-expected.txt: Added.
     14        * fast/parser/residual-style-dom.html: Added.
     15
    1162010-08-04  Andrew Wilson  <atwilson@chromium.org>
    217
  • trunk/WebCore/ChangeLog

    r64699 r64702  
     12010-08-04  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        fast/parser/residual-style-hang.html hangs
     6        https://bugs.webkit.org/show_bug.cgi?id=42950
     7
     8        We need to cap the iteration of the adoption agency algorithm to
     9        prevent this hang.  The legacy tree builder does this as well.
     10
     11        * html/HTMLTreeBuilder.cpp:
     12        (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
     13
    1142010-08-04  Adam Barth  <abarth@webkit.org>
    215
  • trunk/WebCore/html/HTMLTreeBuilder.cpp

    r64699 r64702  
    16481648void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
    16491649{
    1650     while (1) {
     1650    // The adoption agency algorithm is N^2.  We limit the number of iterations
     1651    // to stop from hanging the whole browser.  This limit is copied from the
     1652    // legacy tree builder and might need to be tweaked in the future.
     1653    static const int adoptionAgencyIterationLimit = 10;
     1654
     1655    for (int i = 0; i < adoptionAgencyIterationLimit; ++i) {
    16511656        // 1.
    16521657        Element* formattingElement = m_tree.activeFormattingElements()->closestElementInScopeWithName(token.name());
     
    16811686        HTMLElementStack::ElementRecord* nextNode = node->next();
    16821687        HTMLElementStack::ElementRecord* lastNode = furthestBlock;
    1683         while (1) {
     1688        for (int i = 0; i < adoptionAgencyIterationLimit; ++i) {
    16841689            // 6.1
    16851690            node = nextNode;
Note: See TracChangeset for help on using the changeset viewer.