Changeset 63116 in webkit
- Timestamp:
- Jul 12, 2010 2:13:09 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r63115 r63116 1 2010-07-12 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 HTMLTreeBuilder needs to support mixing SVG and MathML content 6 https://bugs.webkit.org/show_bug.cgi?id=42096 7 8 * html5lib/runner-expected-html5.txt: 9 1 10 2010-07-12 Eric Seidel <eric@webkit.org> 2 11 -
trunk/LayoutTests/html5lib/runner-expected-html5.txt
r63115 r63116 729 729 | <math math> 730 730 | <math mtext> 731 | < mathi>731 | <i> 732 732 | "baz" 733 733 | <math annotation-xml> 734 | < mathsvg>735 | < mathdesc>736 | < mathb>734 | <svg svg> 735 | <svg desc> 736 | <b> 737 737 | "eggs" 738 | < mathg>739 | < math foreignobject>740 | < mathp>738 | <svg g> 739 | <svg foreignObject> 740 | <p> 741 741 | "spam" 742 | <math table> 743 | <math tr> 744 | <math td> 745 | <math img> 746 | <math g> 747 | "quux" 748 | "bar" 742 | <table> 743 | <tbody> 744 | <tr> 745 | <td> 746 | <img> 747 | <g> 748 | "quux" 749 | "bar" 749 750 Expected: 750 751 | <!DOCTYPE html> … … 786 787 | <math math> 787 788 | <math mtext> 788 | < mathi>789 | <i> 789 790 | "baz" 790 791 | <math annotation-xml> 791 | < mathsvg>792 | < mathdesc>793 | < mathb>792 | <svg svg> 793 | <svg desc> 794 | <b> 794 795 | "eggs" 795 | < mathg>796 | < math foreignobject>797 | < mathp>796 | <svg g> 797 | <svg foreignObject> 798 | <p> 798 799 | "spam" 799 | <math table> 800 | <math tr> 801 | <math td> 802 | <math img> 803 | <math g> 804 | "quux" 805 | "bar" 800 | <table> 801 | <tbody> 802 | <tr> 803 | <td> 804 | <img> 805 | <g> 806 | "quux" 807 | "bar" 806 808 Expected: 807 809 | <!DOCTYPE html> -
trunk/WebCore/ChangeLog
r63115 r63116 1 2010-07-12 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 HTMLTreeBuilder needs to support mixing SVG and MathML content 6 https://bugs.webkit.org/show_bug.cgi?id=42096 7 8 This is just a direct transcription of another paragraph of the 9 HTML5 spec. 10 11 This improved a couple results in html5lib/runner.html, but more 12 work to do yet to pass all the foreign content tests. 13 14 * html/HTMLTreeBuilder.cpp: 15 (WebCore::HTMLTreeBuilder::processStartTag): 16 (WebCore::HTMLTreeBuilder::processEndTag): 17 (WebCore::HTMLTreeBuilder::processUsingSecondaryInsertionModeAndAdjustInsertionMode): 18 * html/HTMLTreeBuilder.h: 19 * mathml/mathtags.in: 20 1 21 2010-07-12 Eric Seidel <eric@webkit.org> 2 22 -
trunk/WebCore/html/HTMLTreeBuilder.cpp
r63115 r63116 1149 1149 } 1150 1150 1151 namespace { 1152 1153 bool shouldProcessUsingSecondaryInsertionMode(AtomicHTMLToken& token, Element* currentElement) 1154 { 1155 ASSERT(token.type() == HTMLToken::StartTag); 1156 if (currentElement->hasTagName(MathMLNames::miTag) 1157 || currentElement->hasTagName(MathMLNames::moTag) 1158 || currentElement->hasTagName(MathMLNames::mnTag) 1159 || currentElement->hasTagName(MathMLNames::msTag) 1160 || currentElement->hasTagName(MathMLNames::mtextTag)) { 1161 return token.name() != MathMLNames::mglyphTag 1162 && token.name() != MathMLNames::malignmarkTag; 1163 } 1164 if (currentElement->hasTagName(MathMLNames::annotation_xmlTag)) 1165 return token.name() == SVGNames::svgTag; 1166 if (currentElement->hasTagName(SVGNames::foreignObjectTag) 1167 || currentElement->hasTagName(SVGNames::descTag) 1168 || currentElement->hasTagName(SVGNames::titleTag)) 1169 return true; 1170 return currentElement->namespaceURI() == HTMLNames::xhtmlNamespaceURI; 1171 } 1172 1173 } 1174 1151 1175 void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token) 1152 1176 { … … 1464 1488 case InForeignContentMode: { 1465 1489 // FIXME: We're missing a bunch of if branches here. 1490 if (shouldProcessUsingSecondaryInsertionMode(token, m_tree.currentElement())) { 1491 processUsingSecondaryInsertionModeAndAdjustInsertionMode(token); 1492 return; 1493 } 1466 1494 notImplemented(); 1467 1495 const AtomicString& currentNamespace = m_tree.currentElement()->namespaceURI(); … … 2279 2307 nodeRecord = nodeRecord->next(); 2280 2308 if (nodeRecord->element()->namespaceURI() == xhtmlNamespaceURI) 2281 process EndTagUsingSecondaryInsertionModeAndAdjustInsertionMode(token);2309 processUsingSecondaryInsertionModeAndAdjustInsertionMode(token); 2282 2310 } 2283 2311 return; 2284 2312 } 2285 process EndTagUsingSecondaryInsertionModeAndAdjustInsertionMode(token);2313 processUsingSecondaryInsertionModeAndAdjustInsertionMode(token); 2286 2314 break; 2287 2315 } … … 2311 2339 // the insertion mode. These are separate steps in the spec, but always occur 2312 2340 // right after one another. 2313 void HTMLTreeBuilder::processEndTagUsingSecondaryInsertionModeAndAdjustInsertionMode(AtomicHTMLToken& token) 2314 { 2341 void HTMLTreeBuilder::processUsingSecondaryInsertionModeAndAdjustInsertionMode(AtomicHTMLToken& token) 2342 { 2343 ASSERT(token.type() == HTMLToken::StartTag || token.type() == HTMLToken::EndTag); 2315 2344 { 2316 2345 FakeInsertionMode fakeMode(this, m_secondaryInsertionMode); 2317 process EndTag(token);2346 processToken(token); 2318 2347 } 2319 2348 if (insertionMode() == InForeignContentMode && m_tree.openElements()->hasOnlyHTMLElementsInScope()) -
trunk/WebCore/html/HTMLTreeBuilder.h
r62926 r63116 154 154 void processDefaultForInTableTextMode(AtomicHTMLToken&); 155 155 156 void process EndTagUsingSecondaryInsertionModeAndAdjustInsertionMode(AtomicHTMLToken&);156 void processUsingSecondaryInsertionModeAndAdjustInsertionMode(AtomicHTMLToken&); 157 157 158 158 PassRefPtr<NamedNodeMap> attributesForIsindexInput(AtomicHTMLToken&); -
trunk/WebCore/mathml/mathtags.in
r60342 r63116 19 19 msub interfaceName=MathMLElement 20 20 msup interfaceName=MathMLElement 21 22 #if 0 // Curently only for MathMLNames used by HTMLTreeBuilder. 23 ms 24 mglyph 25 malignmark 26 annotation-xml 27 #endif
Note: See TracChangeset
for help on using the changeset viewer.