Changeset 63037 in webkit


Ignore:
Timestamp:
Jul 9, 2010 8:47:55 PM (14 years ago)
Author:
abarth@webkit.org
Message:

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

Reviewed by Eric Seidel.

HTML5 tree builder should pass some LayoutTests
https://bugs.webkit.org/show_bug.cgi?id=41991

Before this patch, we weren't attaching text nodes to the render tree,
which turns out to be important. :)

This patch fixes more than 10,000 LayoutTests.

  • html/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::attach): (WebCore::HTMLConstructionSite::attachAtSite):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r63036 r63037  
     12010-07-09  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        HTML5 tree builder should pass some LayoutTests
     6        https://bugs.webkit.org/show_bug.cgi?id=41991
     7
     8        Before this patch, we weren't attaching text nodes to the render tree,
     9        which turns out to be important.  :)
     10
     11        This patch fixes more than 10,000 LayoutTests.
     12
     13        * html/HTMLConstructionSite.cpp:
     14        (WebCore::HTMLConstructionSite::attach):
     15        (WebCore::HTMLConstructionSite::attachAtSite):
     16
    1172010-07-09  Patrick Gansterer  <paroga@paroga.com>
    218
  • trunk/WebCore/html/HTMLConstructionSite.cpp

    r62926 r63037  
    8383    if (m_redirectAttachToFosterParent) {
    8484        fosterParent(child.get());
     85        ASSERT(child->attached());
    8586        return child.release();
    8687    }
     
    9293    // for elements), however, we'll get to use this ref in the stack of
    9394    // open elements.
     95    ASSERT(parent->attached());
     96    ASSERT(!child->attached());
    9497    child->attach();
    9598    return child.release();
    9699}
    97100
    98 void HTMLConstructionSite::attachAtSite(const AttachmentSite& site, PassRefPtr<Node> child)
    99 {
     101void HTMLConstructionSite::attachAtSite(const AttachmentSite& site, PassRefPtr<Node> prpChild)
     102{
     103    RefPtr<Node> child = prpChild;
     104
    100105    if (site.nextChild) {
    101106        // FIXME: We need an insertElement which does not send mutation events.
    102107        ExceptionCode ec = 0;
    103108        site.parent->insertBefore(child, site.nextChild, ec);
    104         // FIXME: Do we need to call attach()?
    105109        ASSERT(!ec);
     110        ASSERT(site.parent->attached());
     111        if (!child->attached())
     112            child->attach();
    106113        return;
    107114    }
    108115    site.parent->parserAddChild(child);
    109     // FIXME: Do we need to call attach()?
     116    // It's slightly unfortunate that we need to hold a reference to child
     117    // here to call attach().  We should investigate whether we can rely on
     118    // |site.parent| to hold a ref at this point.
     119    ASSERT(site.parent->attached());
     120    if (!child->attached())
     121        child->attach();
    110122}
    111123
Note: See TracChangeset for help on using the changeset viewer.