Commit 8d4f8c86 authored by eric@webkit.org's avatar eric@webkit.org

2010-07-12 Eric Seidel <eric@webkit.org>

        Reviewed by Adam Barth.

        HTML tags should break out of foreign content
        https://bugs.webkit.org/show_bug.cgi?id=42106

        * html5lib/runner-expected-html5.txt:
2010-07-12  Eric Seidel  <eric@webkit.org>

        Reviewed by Adam Barth.

        HTML tags should break out of foreign content
        https://bugs.webkit.org/show_bug.cgi?id=42106

        Implement another paragraph of the spec to pass another
        bunch of foreign content tests.

        This fixes a bunch of tests in html5lib/runner.html.
        After this change we only have 4 remaining foreign content failures.

        * html/HTMLTreeBuilder.cpp:
        (WebCore::HTMLTreeBuilder::processStartTag):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 28cf3305
2010-07-12 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
HTML tags should break out of foreign content
https://bugs.webkit.org/show_bug.cgi?id=42106
* html5lib/runner-expected-html5.txt:
2010-07-12 Zhenyao Mo <zmo@google.com>
Reviewed by Darin Fisher.
......@@ -386,46 +386,7 @@ Expected:
resources/tests8.dat: PASS
resources/tests9.dat:
13
14
15
18
19
Test 13 of 25 in resources/tests9.dat failed. Input:
<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <table>
| <caption>
| <math math>
| <math mi>
| "foo"
| <math mi>
| "bar"
| <math p>
| "baz"
| <math p>
| "quux"
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <table>
| <caption>
| <math math>
| <math mi>
| "foo"
| <math mi>
| "bar"
| <p>
| "baz"
| <p>
| "quux"
Test 14 of 25 in resources/tests9.dat failed. Input:
<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi>baz</table><p>quux
......@@ -442,8 +403,8 @@ Got:
| <math mi>
| "bar"
| "baz"
| <math p>
| "quux"
| <p>
| "quux"
Expected:
| <!DOCTYPE html>
| <html>
......@@ -459,136 +420,8 @@ Expected:
| "baz"
| <p>
| "quux"
Test 15 of 25 in resources/tests9.dat failed. Input:
<!DOCTYPE html><body><table><colgroup><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <math math>
| <math mi>
| "foo"
| <math mi>
| "bar"
| <math p>
| "baz"
| <math p>
| "quux"
| <table>
| <colgroup>
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <math math>
| <math mi>
| "foo"
| <math mi>
| "bar"
| <p>
| "baz"
| <table>
| <colgroup>
| <p>
| "quux"
Test 18 of 25 in resources/tests9.dat failed. Input:
<!DOCTYPE html><body></body></html><math><mi>foo</mi><mi>bar</mi><p>baz
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <math math>
| <math mi>
| "foo"
| <math mi>
| "bar"
| <math p>
| "baz"
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <math math>
| <math mi>
| "foo"
| <math mi>
| "bar"
| <p>
| "baz"
Test 19 of 25 in resources/tests9.dat failed. Input:
<!DOCTYPE html><body></body><math><mi>foo</mi><mi>bar</mi><p>baz
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <math math>
| <math mi>
| "foo"
| <math mi>
| "bar"
| <math p>
| "baz"
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <math math>
| <math mi>
| "foo"
| <math mi>
| "bar"
| <p>
| "baz"
resources/tests10.dat:
13
14
15
18
19
Test 13 of 25 in resources/tests10.dat failed. Input:
<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g><p>baz</table><p>quux
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <table>
| <caption>
| <svg svg>
| <svg g>
| "foo"
| <svg g>
| "bar"
| <svg p>
| "baz"
| <svg p>
| "quux"
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <table>
| <caption>
| <svg svg>
| <svg g>
| "foo"
| <svg g>
| "bar"
| <p>
| "baz"
| <p>
| "quux"
Test 14 of 25 in resources/tests10.dat failed. Input:
<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g>baz</table><p>quux
......@@ -605,8 +438,8 @@ Got:
| <svg g>
| "bar"
| "baz"
| <svg p>
| "quux"
| <p>
| "quux"
Expected:
| <!DOCTYPE html>
| <html>
......@@ -622,95 +455,6 @@ Expected:
| "baz"
| <p>
| "quux"
Test 15 of 25 in resources/tests10.dat failed. Input:
<!DOCTYPE html><body><table><colgroup><svg><g>foo</g><g>bar</g><p>baz</table><p>quux
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <svg svg>
| <svg g>
| "foo"
| <svg g>
| "bar"
| <svg p>
| "baz"
| <svg p>
| "quux"
| <table>
| <colgroup>
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <svg svg>
| <svg g>
| "foo"
| <svg g>
| "bar"
| <p>
| "baz"
| <table>
| <colgroup>
| <p>
| "quux"
Test 18 of 25 in resources/tests10.dat failed. Input:
<!DOCTYPE html><body></body></html><svg><g>foo</g><g>bar</g><p>baz
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <svg svg>
| <svg g>
| "foo"
| <svg g>
| "bar"
| <svg p>
| "baz"
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <svg svg>
| <svg g>
| "foo"
| <svg g>
| "bar"
| <p>
| "baz"
Test 19 of 25 in resources/tests10.dat failed. Input:
<!DOCTYPE html><body></body><svg><g>foo</g><g>bar</g><p>baz
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <svg svg>
| <svg g>
| "foo"
| <svg g>
| "bar"
| <svg p>
| "baz"
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <svg svg>
| <svg g>
| "foo"
| <svg g>
| "bar"
| <p>
| "baz"
resources/tests11.dat: PASS
resources/tests12.dat:
......
2010-07-12 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
HTML tags should break out of foreign content
https://bugs.webkit.org/show_bug.cgi?id=42106
Implement another paragraph of the spec to pass another
bunch of foreign content tests.
This fixes a bunch of tests in html5lib/runner.html.
After this change we only have 4 remaining foreign content failures.
* html/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTag):
2010-07-12 Zhenyao Mo <zmo@google.com>
Reviewed by Darin Fisher.
......@@ -143,6 +143,12 @@ void HTMLElementStack::pop()
popCommon();
}
void HTMLElementStack::popUntilElementWithNamespace(const AtomicString& namespaceURI)
{
while (top()->namespaceURI() != namespaceURI)
pop();
}
void HTMLElementStack::popUntil(const AtomicString& tagName)
{
while (!top()->hasLocalName(tagName)) {
......
......@@ -83,6 +83,7 @@ public:
void pop();
void popUntil(const AtomicString& tagName);
void popUntilElementWithNamespace(const AtomicString& namespaceURI);
void popUntil(Element*);
void popUntilPopped(const AtomicString& tagName);
void popUntilPopped(Element*);
......
......@@ -1491,7 +1491,51 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
processUsingSecondaryInsertionModeAndAdjustInsertionMode(token);
return;
}
notImplemented();
if (token.name() == bTag
|| token.name() == bigTag
|| token.name() == blockquoteTag
|| token.name() == bodyTag
|| token.name() == brTag
|| token.name() == centerTag
|| token.name() == codeTag
|| token.name() == ddTag
|| token.name() == divTag
|| token.name() == dlTag
|| token.name() == dtTag
|| token.name() == emTag
|| token.name() == embedTag
|| isNumberedHeaderTag(token.name())
|| token.name() == headTag
|| token.name() == hrTag
|| token.name() == iTag
|| token.name() == imgTag
|| token.name() == liTag
|| token.name() == listingTag
|| token.name() == menuTag
|| token.name() == metaTag
|| token.name() == nobrTag
|| token.name() == olTag
|| token.name() == pTag
|| token.name() == preTag
|| token.name() == rubyTag
|| token.name() == sTag
|| token.name() == smallTag
|| token.name() == spanTag
|| token.name() == strongTag
|| token.name() == strikeTag
|| token.name() == subTag
|| token.name() == supTag
|| token.name() == tableTag
|| token.name() == ttTag
|| token.name() == uTag
|| token.name() == ulTag
|| token.name() == varTag
|| (token.name() == fontTag && (token.getAttributeItem(colorAttr) || token.getAttributeItem(faceAttr) || token.getAttributeItem(sizeAttr)))) {
m_tree.openElements()->popUntilElementWithNamespace(xhtmlNamespaceURI);
setInsertionMode(m_secondaryInsertionMode);
processStartTag(token);
return;
}
const AtomicString& currentNamespace = m_tree.currentElement()->namespaceURI();
if (currentNamespace == MathMLNames::mathmlNamespaceURI)
adjustMathMLAttributes(token);
......@@ -2592,11 +2636,7 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
parseError(token);
// FIXME: Following the spec would infinitely recurse on <svg><svg>
// http://www.w3.org/Bugs/Public/show_bug.cgi?id=10115
while (m_tree.currentElement()) {
if (m_tree.currentElement()->namespaceURI() == xhtmlNamespaceURI)
break;
m_tree.openElements()->pop();
}
m_tree.openElements()->popUntilElementWithNamespace(xhtmlNamespaceURI);
setInsertionMode(m_secondaryInsertionMode);
processEndOfFile(token);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment