Changeset 147185 in webkit


Ignore:
Timestamp:
Mar 28, 2013 5:13:05 PM (11 years ago)
Author:
rafaelw@chromium.org
Message:

[HTMLTemplateElement] <template> should be able to be a foster parent
https://bugs.webkit.org/show_bug.cgi?id=113541

Source/WebCore:

Reviewed by Eric Seidel

This adds to the check in findFosterSite to include whether the parent is a DocumentFragment which is a template contents.

Tests added to html5lib suite.

  • html/parser/HTMLConstructionSite.cpp:

(WebCore::HTMLConstructionSite::findFosterSite):

LayoutTests:

Reviewed by Eric Seidel.

  • html5lib/resources/template.dat:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147183 r147185  
     12013-03-28  Rafael Weinstein  <rafaelw@chromium.org>
     2
     3        [HTMLTemplateElement] <template> should be able to be a foster parent
     4        https://bugs.webkit.org/show_bug.cgi?id=113541
     5
     6        Reviewed by Eric Seidel.
     7
     8        * html5lib/resources/template.dat:
     9
    1102013-03-28  Tony Chang  <tony@chromium.org>
    211
  • trunk/LayoutTests/html5lib/resources/template.dat

    r146923 r147185  
    11471147|         <template>
    11481148|           content
     1149|             "Foo"
    11491150|             <table>
    1150 |             "Foo"
    11511151|   <body>
    11521152
  • trunk/Source/WebCore/ChangeLog

    r147178 r147185  
     12013-03-28  Rafael Weinstein  <rafaelw@chromium.org>
     2
     3        [HTMLTemplateElement] <template> should be able to be a foster parent
     4        https://bugs.webkit.org/show_bug.cgi?id=113541
     5
     6        Reviewed by Eric Seidel
     7
     8        This adds to the check in findFosterSite to include whether the parent is a DocumentFragment which is a template contents.
     9
     10        Tests added to html5lib suite.
     11
     12        * html/parser/HTMLConstructionSite.cpp:
     13        (WebCore::HTMLConstructionSite::findFosterSite):
     14
    1152013-03-28  Xianzhu Wang  <wangxianzhu@chromium.org>
    216
  • trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp

    r147057 r147185  
    630630        // When parsing HTML fragments, we skip step 4.2 ("Let root be a new html element with no attributes") for efficiency,
    631631        // and instead use the DocumentFragment as a root node. So we must treat the root node (DocumentFragment) as if it is a html element here.
    632         if (parent && (parent->isElementNode() || (m_isParsingFragment && parent == m_openElements.rootNode()))) {
     632        bool parentCanBeFosterParent = parent && (parent->isElementNode() || (m_isParsingFragment && parent == m_openElements.rootNode()));
     633#if ENABLE(TEMPLATE_ELEMENT)
     634        parentCanBeFosterParent = parentCanBeFosterParent || (parent && parent->isDocumentFragment() && static_cast<DocumentFragment*>(parent)->isTemplateContent());
     635#endif
     636        if (parentCanBeFosterParent) {
    633637            task.parent = parent;
    634638            task.nextChild = lastTableElement;
Note: See TracChangeset for help on using the changeset viewer.