WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-42096-20100712113209.patch (text/plain), 8.68 KB, created by
Eric Seidel (no email)
on 2010-07-12 11:32:15 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eric Seidel (no email)
Created:
2010-07-12 11:32:15 PDT
Size:
8.68 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index e2f65c40c917322e026e4acb48b489d3788f8ccb..c7788d098451734b28e0d80aa1d12b980560ee7e 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -2,6 +2,15 @@ > > Reviewed by NOBODY (OOPS!). > >+ HTMLTreeBuilder needs to support mixing SVG and MathML content >+ https://bugs.webkit.org/show_bug.cgi?id=42096 >+ >+ * html5lib/runner-expected-html5.txt: >+ >+2010-07-12 Eric Seidel <eric@webkit.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ > Update HTMLTreeBuilder now that MathMLNames is always generated > https://bugs.webkit.org/show_bug.cgi?id=42059 > >diff --git a/LayoutTests/html5lib/runner-expected-html5.txt b/LayoutTests/html5lib/runner-expected-html5.txt >index 6d8634271825cc931a838e18539cc81002962deb..59e5ee98411b775a71a516bf6741acaff1aaddb9 100644 >--- a/LayoutTests/html5lib/runner-expected-html5.txt >+++ b/LayoutTests/html5lib/runner-expected-html5.txt >@@ -728,24 +728,25 @@ Got: > | "foo" > | <math math> > | <math mtext> >-| <math i> >+| <i> > | "baz" > | <math annotation-xml> >-| <math svg> >-| <math desc> >-| <math b> >+| <svg svg> >+| <svg desc> >+| <b> > | "eggs" >-| <math g> >-| <math foreignobject> >-| <math p> >+| <svg g> >+| <svg foreignObject> >+| <p> > | "spam" >-| <math table> >-| <math tr> >-| <math td> >-| <math img> >-| <math g> >-| "quux" >-| "bar" >+| <table> >+| <tbody> >+| <tr> >+| <td> >+| <img> >+| <g> >+| "quux" >+| "bar" > Expected: > | <!DOCTYPE html> > | <html> >@@ -785,24 +786,25 @@ Got: > | "foo" > | <math math> > | <math mtext> >-| <math i> >+| <i> > | "baz" > | <math annotation-xml> >-| <math svg> >-| <math desc> >-| <math b> >+| <svg svg> >+| <svg desc> >+| <b> > | "eggs" >-| <math g> >-| <math foreignobject> >-| <math p> >+| <svg g> >+| <svg foreignObject> >+| <p> > | "spam" >-| <math table> >-| <math tr> >-| <math td> >-| <math img> >-| <math g> >-| "quux" >-| "bar" >+| <table> >+| <tbody> >+| <tr> >+| <td> >+| <img> >+| <g> >+| "quux" >+| "bar" > Expected: > | <!DOCTYPE html> > | <html> >diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog >index 31c2254b42ef2b40064f13f473cdd7b248d8c9dc..c80c69691cde2fe8c5e14c92ccc7e5f2c6d56c9e 100644 >--- a/WebCore/ChangeLog >+++ b/WebCore/ChangeLog >@@ -2,6 +2,26 @@ > > Reviewed by NOBODY (OOPS!). > >+ HTMLTreeBuilder needs to support mixing SVG and MathML content >+ https://bugs.webkit.org/show_bug.cgi?id=42096 >+ >+ This is just a direct transcription of another paragraph of the >+ HTML5 spec. >+ >+ This improved a couple results in html5lib/runner.html, but more >+ work to do yet to pass all the foreign content tests. >+ >+ * html/HTMLTreeBuilder.cpp: >+ (WebCore::HTMLTreeBuilder::processStartTag): >+ (WebCore::HTMLTreeBuilder::processEndTag): >+ (WebCore::HTMLTreeBuilder::processUsingSecondaryInsertionModeAndAdjustInsertionMode): >+ * html/HTMLTreeBuilder.h: >+ * mathml/mathtags.in: >+ >+2010-07-12 Eric Seidel <eric@webkit.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ > Update HTMLTreeBuilder now that MathMLNames is always generated > https://bugs.webkit.org/show_bug.cgi?id=42059 > >diff --git a/WebCore/html/HTMLTreeBuilder.cpp b/WebCore/html/HTMLTreeBuilder.cpp >index 00f94c83867b2b7cf536f9b137ac75c2b193092a..74db2f28209a5dcb4972581890b8e9e6de95ca28 100644 >--- a/WebCore/html/HTMLTreeBuilder.cpp >+++ b/WebCore/html/HTMLTreeBuilder.cpp >@@ -1148,6 +1148,30 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token) > processStartTagForInBody(token); > } > >+namespace { >+ >+bool shouldProcessUsingSecondaryInsertionMode(AtomicHTMLToken& token, Element* currentElement) >+{ >+ ASSERT(token.type() == HTMLToken::StartTag); >+ if (currentElement->hasTagName(MathMLNames::miTag) >+ || currentElement->hasTagName(MathMLNames::moTag) >+ || currentElement->hasTagName(MathMLNames::mnTag) >+ || currentElement->hasTagName(MathMLNames::msTag) >+ || currentElement->hasTagName(MathMLNames::mtextTag)) { >+ return (token.name() != MathMLNames::mglyphTag >+ && token.name() != MathMLNames::malignmarkTag); >+ } >+ if (currentElement->hasTagName(MathMLNames::annotation_xmlTag)) >+ return token.name() == SVGNames::svgTag; >+ if (currentElement->hasTagName(SVGNames::foreignObjectTag) >+ || currentElement->hasTagName(SVGNames::descTag) >+ || currentElement->hasTagName(SVGNames::titleTag)) >+ return true; >+ return currentElement->namespaceURI() == HTMLNames::xhtmlNamespaceURI; >+} >+ >+} >+ > void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token) > { > ASSERT(token.type() == HTMLToken::StartTag); >@@ -1463,6 +1487,10 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token) > break; > case InForeignContentMode: { > // FIXME: We're missing a bunch of if branches here. >+ if (shouldProcessUsingSecondaryInsertionMode(token, m_tree.currentElement())) { >+ processUsingSecondaryInsertionModeAndAdjustInsertionMode(token); >+ return; >+ } > notImplemented(); > const AtomicString& currentNamespace = m_tree.currentElement()->namespaceURI(); > if (currentNamespace == MathMLNames::mathmlNamespaceURI) >@@ -2278,11 +2306,11 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token) > } > nodeRecord = nodeRecord->next(); > if (nodeRecord->element()->namespaceURI() == xhtmlNamespaceURI) >- processEndTagUsingSecondaryInsertionModeAndAdjustInsertionMode(token); >+ processUsingSecondaryInsertionModeAndAdjustInsertionMode(token); > } > return; > } >- processEndTagUsingSecondaryInsertionModeAndAdjustInsertionMode(token); >+ processUsingSecondaryInsertionModeAndAdjustInsertionMode(token); > break; > } > } >@@ -2310,11 +2338,12 @@ private: > // This handles both secondary insertion mode processing, as well as updating > // the insertion mode. These are separate steps in the spec, but always occur > // right after one another. >-void HTMLTreeBuilder::processEndTagUsingSecondaryInsertionModeAndAdjustInsertionMode(AtomicHTMLToken& token) >+void HTMLTreeBuilder::processUsingSecondaryInsertionModeAndAdjustInsertionMode(AtomicHTMLToken& token) > { >+ ASSERT(token.type() == HTMLToken::StartTag || token.type() == HTMLToken::EndTag); > { > FakeInsertionMode fakeMode(this, m_secondaryInsertionMode); >- processEndTag(token); >+ processToken(token); > } > if (insertionMode() == InForeignContentMode && m_tree.openElements()->hasOnlyHTMLElementsInScope()) > setInsertionMode(m_secondaryInsertionMode); >diff --git a/WebCore/html/HTMLTreeBuilder.h b/WebCore/html/HTMLTreeBuilder.h >index 578421769485f5d3b3fe9f78010fc01d7b487e9b..74e33989aa6326f689bf037bb023a4b2b0d1fde1 100644 >--- a/WebCore/html/HTMLTreeBuilder.h >+++ b/WebCore/html/HTMLTreeBuilder.h >@@ -153,7 +153,7 @@ private: > void processDefaultForAfterHeadMode(AtomicHTMLToken&); > void processDefaultForInTableTextMode(AtomicHTMLToken&); > >- void processEndTagUsingSecondaryInsertionModeAndAdjustInsertionMode(AtomicHTMLToken&); >+ void processUsingSecondaryInsertionModeAndAdjustInsertionMode(AtomicHTMLToken&); > > PassRefPtr<NamedNodeMap> attributesForIsindexInput(AtomicHTMLToken&); > >diff --git a/WebCore/mathml/mathtags.in b/WebCore/mathml/mathtags.in >index e9cc4adf260843e0ab03d3fc2ada78b11510d011..5bb369a83fba6e483f34a93ec3bf4a78606a6894 100644 >--- a/WebCore/mathml/mathtags.in >+++ b/WebCore/mathml/mathtags.in >@@ -18,3 +18,10 @@ mo interfaceName=MathMLTextElement > mtext interfaceName=MathMLTextElement > msub interfaceName=MathMLElement > msup interfaceName=MathMLElement >+ >+#if 0 // Curently only for MathMLNames used by HTMLTreeBuilder. >+ms >+mglyph >+malignmark >+annotation-xml >+#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
abarth
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 42096
: 61249