Changeset 65785 in webkit
- Timestamp:
- Aug 22, 2010 11:38:38 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r65783 r65785 1 2010-08-22 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 HTML5 TreeBuilder builds wrong DOM for <a><svg><tr><input></a> 6 https://bugs.webkit.org/show_bug.cgi?id=44390 7 8 * html5lib/resources/adoption01.dat: 9 1 10 2010-08-22 Andreas Kling <andreas.kling@nokia.com> 2 11 -
trunk/LayoutTests/html5lib/resources/adoption01.dat
r65769 r65785 192 192 | <a> 193 193 | <svg svg> 194 | <svg tr> 195 | <a> 196 | <svg input> 197 | <a> 194 | <svg tr> 195 | <svg input> -
trunk/WebCore/ChangeLog
r65784 r65785 1 2010-08-22 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 HTML5 TreeBuilder builds wrong DOM for <a><svg><tr><input></a> 6 https://bugs.webkit.org/show_bug.cgi?id=44390 7 8 The HTML5 spec has changed since Adam and I original wrote 9 the HTMLTreeBuilder. Most important for this change was resolution of: 10 http://www.w3.org/Bugs/Public/show_bug.cgi?id=9580 11 12 I also removed our "phrasing" tag support since that was also removed 13 from the spec as part of other bug fixes. 14 15 This is tested by tonyg's <a><svg><tr><input></a> test in adoption01.dat. 16 17 * html/HTMLTreeBuilder.cpp: 18 (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag): 19 (WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody): 20 (WebCore::HTMLTreeBuilder::furthestBlockForFormattingElement): 21 (WebCore::HTMLTreeBuilder::processEndTag): 22 1 23 2010-08-22 Andreas Kling <andreas.kling@nokia.com> 2 24 -
trunk/WebCore/html/HTMLTreeBuilder.cpp
r65769 r65785 134 134 135 135 // http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#special 136 bool isSpecialTag(const AtomicString& tagName) 137 { 136 bool isSpecialNode(Node* node) 137 { 138 if (node->namespaceURI() != xhtmlNamespaceURI) 139 return false; 140 const AtomicString& tagName = node->localName(); 138 141 return tagName == addressTag 139 142 || tagName == articleTag … … 242 245 } 243 246 244 // http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#phrasing245 bool isPhrasingTag(const AtomicString& tagName)246 {247 return !isSpecialTag(tagName) && !isScopingTag(tagName) && !isFormattingTag(tagName);248 }249 250 bool isNotFormattingAndNotPhrasing(const Element* element)251 {252 // The spec often says "node is not in the formatting category, and is not253 // in the phrasing category". !phrasing && !formatting == scoping || special254 // scoping || special is easier to compute.255 // FIXME: localName() is wrong for non-html content.256 const AtomicString& tagName = element->localName();257 return isScopingTag(tagName) || isSpecialTag(tagName);258 }259 260 247 HTMLFormElement* closestFormAncestor(Element* element) 261 248 { … … 766 753 break; 767 754 } 768 if (is NotFormattingAndNotPhrasing(node) && !node->hasTagName(addressTag) && !node->hasTagName(divTag) && !node->hasTagName(pTag))755 if (isSpecialNode(node) && !node->hasTagName(addressTag) && !node->hasTagName(divTag) && !node->hasTagName(pTag)) 769 756 break; 770 757 nodeRecord = nodeRecord->next(); … … 1727 1714 return; 1728 1715 } 1729 if (is NotFormattingAndNotPhrasing(node)) {1716 if (isSpecialNode(node)) { 1730 1717 parseError(token); 1731 1718 return; … … 1743 1730 if (record->element() == formattingElement) 1744 1731 return furthestBlock; 1745 if (is NotFormattingAndNotPhrasing(record->element()))1732 if (isSpecialNode(record->element())) 1746 1733 furthestBlock = record; 1747 1734 } … … 2495 2482 // FIXME: This code just wants an Element* iterator, instead of an ElementRecord* 2496 2483 HTMLElementStack::ElementRecord* nodeRecord = m_tree.openElements()->topRecord(); 2497 if (!nodeRecord->element()->hasLocalName(token.name())) {2484 if (!nodeRecord->element()->hasLocalName(token.name())) 2498 2485 parseError(token); 2499 // FIXME: This return is not in the spec but it needed for now2500 // to prevent walking off the bottom of the stack.2501 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=101182502 if (!m_tree.openElements()->contains(token.name()))2503 return;2504 }2505 2486 while (1) { 2506 2487 if (nodeRecord->element()->hasLocalName(token.name())) { 2507 2488 m_tree.openElements()->popUntilPopped(nodeRecord->element()); 2508 return;2489 break; 2509 2490 } 2510 2491 nodeRecord = nodeRecord->next(); 2511 if (nodeRecord->element()->namespaceURI() == xhtmlNamespaceURI) { 2512 processUsingSecondaryInsertionModeAndAdjustInsertionMode(token); 2513 // FIXME: This is a hack around a spec bug and is likely wrong. 2514 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=9581 2515 if (nodeRecord != m_tree.openElements()->topRecord()) 2516 return; 2517 } 2492 if (nodeRecord->element()->namespaceURI() == xhtmlNamespaceURI) 2493 break; 2518 2494 } 2519 return;2520 }2495 } 2496 // Any other end tag (also the last two steps of "An end tag, if the current node is not an element in the HTML namespace." 2521 2497 processUsingSecondaryInsertionModeAndAdjustInsertionMode(token); 2522 2498 break;
Note: See TracChangeset
for help on using the changeset viewer.