Changeset 141327 in webkit
- Timestamp:
- Jan 30, 2013 3:11:52 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r141326 r141327 1 2013-01-30 Rafael Weinstein <rafaelw@chromium.org> 2 3 [HTMLTemplateElement] prevent the parser from removing nodes from the content when the foster agency is processing formatting elements 4 https://bugs.webkit.org/show_bug.cgi?id=108377 5 6 Reviewed by Adam Barth. 7 8 Note that dump-as-markup.js is modified here to put both template content and its direct children. This was an oversight and fixing it will make it 9 easier to spot parse errors like ones that arise from this bug, where nodes are appended directly to the template element. 10 11 * html5lib/resources/template.dat: 12 * resources/dump-as-markup.js: 13 (Markup._get): 14 1 15 2013-01-30 Philip Rogers <pdr@google.com> 2 16 -
trunk/LayoutTests/html5lib/resources/template.dat
r138546 r141327 942 942 | #document-fragment 943 943 | <col> 944 945 #data 946 <body><template><i><menu>Foo</i> 947 #errors 948 #document 949 | <html> 950 | <head> 951 | <body> 952 | <template> 953 | #document-fragment 954 | <i> 955 | <menu> 956 | <i> 957 | "Foo" -
trunk/LayoutTests/resources/dump-as-markup.js
r139169 r141327 225 225 str += "#document-fragment"; 226 226 } 227 228 229 // HTML Template elements serialize their content DocumentFragment, and NOT their children. 230 if (node.namespaceURI = 'http://www.w3.org/1999/xhtml' && node.tagName == 'TEMPLATE') { 227 228 if (node.namespaceURI = 'http://www.w3.org/1999/xhtml' && node.tagName == 'TEMPLATE') 231 229 str += Markup._get(node.content, depth + 1, shadowRootList); 232 } else { 233 for (var i = 0, len = node.childNodes.length; i < len; i++) { 234 var selection = Markup._getSelectionMarker(node, i); 235 if (selection) 236 str += Markup._indent(depth + 1) + selection; 237 238 str += Markup._get(node.childNodes[i], depth + 1, shadowRootList); 239 } 230 231 for (var i = 0, len = node.childNodes.length; i < len; i++) { 232 var selection = Markup._getSelectionMarker(node, i); 233 if (selection) 234 str += Markup._indent(depth + 1) + selection; 235 236 str += Markup._get(node.childNodes[i], depth + 1, shadowRootList); 240 237 } 241 238 -
trunk/Source/WebCore/ChangeLog
r141320 r141327 1 2013-01-30 Rafael Weinstein <rafaelw@chromium.org> 2 3 [HTMLTemplateElement] prevent the parser from removing nodes from the content when the foster agency is processing formatting elements 4 https://bugs.webkit.org/show_bug.cgi?id=108377 5 6 Reviewed by Adam Barth. 7 8 https://dvcs.w3.org/hg/webcomponents/raw-file/50ce1f368c1a/spec/templates/index.html#in-body-addition 9 10 callTheAdoptionAgency now appends to the template's content when it previously would have appended to the template element itself. 11 12 New test added to html5lib. 13 14 * dom/ContainerNode.cpp: 15 (WebCore::ContainerNode::parserInsertBefore): 16 (WebCore::ContainerNode::parserAppendChild): 17 * html/parser/HTMLTreeBuilder.cpp: 18 (WebCore::HTMLTreeBuilder::callTheAdoptionAgency): 19 1 20 2013-01-30 Mark Lam <mark.lam@apple.com> 2 21 -
trunk/Source/WebCore/dom/ContainerNode.cpp
r141198 r141327 33 33 #include "Frame.h" 34 34 #include "FrameView.h" 35 #include "HTMLNames.h" 35 36 #include "InlineTextBox.h" 36 37 #include "InsertionPoint.h" … … 330 331 ASSERT(nextChild->parentNode() == this); 331 332 ASSERT(!newChild->isDocumentFragment()); 333 #if ENABLE(TEMPLATE_ELEMENT) 334 ASSERT(!hasTagName(HTMLNames::templateTag)); 335 #endif 332 336 333 337 if (nextChild->previousSibling() == newChild || nextChild == newChild) // nothing to do … … 698 702 ASSERT(!newChild->parentNode()); // Use appendChild if you need to handle reparenting (and want DOM mutation events). 699 703 ASSERT(!newChild->isDocumentFragment()); 704 #if ENABLE(TEMPLATE_ELEMENT) 705 ASSERT(!hasTagName(HTMLNames::templateTag)); 706 #endif 700 707 701 708 if (document() != newChild->document()) -
trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp
r140659 r141327 35 35 #include "HTMLParserIdioms.h" 36 36 #include "HTMLStackItem.h" 37 #include "HTMLTemplateElement.h" 37 38 #include "HTMLToken.h" 38 39 #include "HTMLTokenizer.h" … … 1588 1589 m_tree.fosterParent(lastNode->element()); 1589 1590 else { 1591 #if ENABLE(TEMPLATE_ELEMENT) 1592 if (commonAncestor->hasTagName(templateTag)) 1593 toHTMLTemplateElement(commonAncestor->node())->content()->parserAppendChild(lastNode->element()); 1594 else 1595 commonAncestor->node()->parserAppendChild(lastNode->element()); 1596 #else 1590 1597 commonAncestor->node()->parserAppendChild(lastNode->element()); 1598 #endif 1591 1599 ASSERT(lastNode->stackItem()->isElementNode()); 1592 1600 ASSERT(lastNode->element()->parentNode());
Note: See TracChangeset
for help on using the changeset viewer.