Changeset 63729 in webkit


Ignore:
Timestamp:
Jul 20, 2010 12:33:12 AM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-07-20 Adam Barth <abarth@webkit.org>

Reviewed by Darin Adler.

Foster parenting depends on the current element at insertion time
https://bugs.webkit.org/show_bug.cgi?id=42599

  • html5lib/runner-expected-html5.txt:

2010-07-20 Adam Barth <abarth@webkit.org>

Reviewed by Darin Adler.

Foster parenting depends on the current element at insertion time
https://bugs.webkit.org/show_bug.cgi?id=42599

We need to consider the current element at insertion-time when deciding
whether to redirect insertion to the foster parent. Previously, we
were considering the current element *both* at insertion-time and at
the time we created the guard.

  • html/HTMLConstructionSite.h: (WebCore::HTMLConstructionSite::RedirectToFosterParentGuard::RedirectToFosterParentGuard):
  • html/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processStartTagForInTable): (WebCore::HTMLTreeBuilder::processEndTagForInTable): (WebCore::HTMLTreeBuilder::defaultForInTableText):
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r63728 r63729  
     12010-07-20  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Foster parenting depends on the current element at insertion time
     6        https://bugs.webkit.org/show_bug.cgi?id=42599
     7
     8        * html5lib/runner-expected-html5.txt:
     9
    1102010-07-20  Adam Barth  <abarth@webkit.org>
    211
  • trunk/LayoutTests/html5lib/runner-expected-html5.txt

    r63728 r63729  
    2902902
    2912916
    292 7
    293292
    294293Test 2 of 9 in resources/tricky01.dat failed. Input:
     
    462461|             "
    463462"
    464 
    465 Test 7 of 9 in resources/tricky01.dat failed. Input:
    466 <table><tr><p><a><p>You should see this text.
    467 Got:
    468 | <html>
    469 |   <head>
    470 |   <body>
    471 |     <p>
    472 |       <a>
    473 |     <table>
    474 |       <tbody>
    475 |         <tr>
    476 |           <p>
    477 |             <a>
    478 |               "You should see this text."
    479 Expected:
    480 | <html>
    481 |   <head>
    482 |   <body>
    483 |     <p>
    484 |       <a>
    485 |     <p>
    486 |       <a>
    487 |         "You should see this text."
    488 |     <table>
    489 |       <tbody>
    490 |         <tr>
    491463#EOF
  • trunk/WebCore/ChangeLog

    r63727 r63729  
     12010-07-20  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Foster parenting depends on the current element at insertion time
     6        https://bugs.webkit.org/show_bug.cgi?id=42599
     7
     8        We need to consider the current element at insertion-time when deciding
     9        whether to redirect insertion to the foster parent.  Previously, we
     10        were considering the current element *both* at insertion-time and at
     11        the time we created the guard.
     12
     13        * html/HTMLConstructionSite.h:
     14        (WebCore::HTMLConstructionSite::RedirectToFosterParentGuard::RedirectToFosterParentGuard):
     15        * html/HTMLTreeBuilder.cpp:
     16        (WebCore::HTMLTreeBuilder::processStartTagForInTable):
     17        (WebCore::HTMLTreeBuilder::processEndTagForInTable):
     18        (WebCore::HTMLTreeBuilder::defaultForInTableText):
     19
    1202010-07-20  Matthew Delaney  <mdelaney@apple.com>
    221
  • trunk/WebCore/html/HTMLConstructionSite.h

    r63386 r63729  
    9191    class RedirectToFosterParentGuard : public Noncopyable {
    9292    public:
    93         RedirectToFosterParentGuard(HTMLConstructionSite& tree, bool shouldRedirect)
     93        RedirectToFosterParentGuard(HTMLConstructionSite& tree)
    9494            : m_tree(tree)
    9595            , m_wasRedirectingBefore(tree.m_redirectAttachToFosterParent)
    9696        {
    97             m_tree.m_redirectAttachToFosterParent = shouldRedirect;
     97            m_tree.m_redirectAttachToFosterParent = true;
    9898        }
    9999
  • trunk/WebCore/html/HTMLTreeBuilder.cpp

    r63387 r63729  
    215215}
    216216
    217 bool requiresRedirectToFosterParent(Element* element)
    218 {
    219     return element->hasTagName(tableTag)
    220         || isTableBodyContextTag(element->localName())
    221         || element->hasTagName(trTag);
    222 }
    223 
    224217// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#formatting
    225218bool isFormattingTag(const AtomicString& tagName)
     
    11541147    }
    11551148    parseError(token);
    1156     HTMLConstructionSite::RedirectToFosterParentGuard redirecter(m_tree, requiresRedirectToFosterParent(m_tree.currentElement()));
     1149    HTMLConstructionSite::RedirectToFosterParentGuard redirecter(m_tree);
    11571150    processStartTagForInBody(token);
    11581151}
     
    21062099    }
    21072100    // Is this redirection necessary here?
    2108     HTMLConstructionSite::RedirectToFosterParentGuard redirecter(m_tree, requiresRedirectToFosterParent(m_tree.currentElement()));
     2101    HTMLConstructionSite::RedirectToFosterParentGuard redirecter(m_tree);
    21092102    processEndTagForInBody(token);
    21102103}
     
    27132706    if (hasNonWhitespace(characters)) {
    27142707        // FIXME: parse error
    2715         HTMLConstructionSite::RedirectToFosterParentGuard redirecter(m_tree, requiresRedirectToFosterParent(m_tree.currentElement()));
     2708        HTMLConstructionSite::RedirectToFosterParentGuard redirecter(m_tree);
    27162709        m_tree.reconstructTheActiveFormattingElements();
    27172710        m_tree.insertTextNode(characters);
Note: See TracChangeset for help on using the changeset viewer.