Parsing of HTML tags in MathML Text Insertion Points leads to bogus parser behavior
authoradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Feb 2013 01:05:07 +0000 (01:05 +0000)
committeradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Feb 2013 01:05:07 +0000 (01:05 +0000)
commit837a7e8ba727540aa2432b8dae7cf5b9c7dbdff1
treef444b76a353cb813149e283d89fc50fb9ca52cc7
parent7d407abd0692166f53d909a73d22312aaadc6ee6
Parsing of HTML tags in MathML Text Insertion Points leads to bogus parser behavior
https://bugs.webkit.org/show_bug.cgi?id=110808

Reviewed by Adam Barth.

Source/WebCore:

When looking for various table tags in the HTMLElementStack, compare
QualifiedNames rather than just local names, where necessary.

Note that not all uses have been "fixed"; I've only changed for which
I could write a test with differing behavior. A followup patch to
rationalize the use of QualifiedName vs local names would be ideal.

Tests: html5lib/generated/run-math-data.html
       html5lib/generated/run-math-write.html

* html/parser/HTMLElementStack.cpp:
(WebCore::inScopeCommon): Added a version of inScopeCommon that
handles QualifiedNames instead of just localNames.
(WebCore::HTMLElementStack::inTableScope): When given a QualifiedName,
call the new version of inScopeCommon().
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTag):
(WebCore::HTMLTreeBuilder::processEndTagForInTableBody):
(WebCore::HTMLTreeBuilder::processTrEndTagForInRow):

LayoutTests:

* html5lib/generated/run-math-data-expected.txt: Added.
* html5lib/generated/run-math-data.html: Added.
* html5lib/generated/run-math-write-expected.txt: Added.
* html5lib/generated/run-math-write.html: Added.
* html5lib/resources/math.dat: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/html5lib/generated/run-math-data-expected.txt [new file with mode: 0644]
LayoutTests/html5lib/generated/run-math-data.html [new file with mode: 0644]
LayoutTests/html5lib/generated/run-math-write-expected.txt [new file with mode: 0644]
LayoutTests/html5lib/generated/run-math-write.html [new file with mode: 0644]
LayoutTests/html5lib/resources/math.dat [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/parser/HTMLElementStack.cpp
Source/WebCore/html/parser/HTMLTreeBuilder.cpp