Title: [123289] trunk/Source/WebCore
- Revision
- 123289
- Author
- [email protected]
- Date
- 2012-07-21 01:01:22 -0700 (Sat, 21 Jul 2012)
Log Message
A start tag whose tag name is "html" in the "in body" insertion mode is a parse error
https://bugs.webkit.org/show_bug.cgi?id=91916
Reviewed by Eric Seidel.
According to the HTML5 spec, a start tag whose tag name is "html" in the "in body"
insertion mode is a parse error.
Added HTMLTreeBuilder::processHtmlStartTagForInBody(AtomicHTMLToken&) to call parseError(token).
Removed "FIXME: parse error" from HTMLConstructionSite::insertHTMLHtmlStartTagInBody and
HTMLConstructionSite::insertHTMLBodyStartTagInBody because we already marked the call sites
of these two methods with parseError(token).
No behavior change because parseError(token) is just a marker.
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagInBody):
(WebCore::HTMLConstructionSite::insertHTMLBodyStartTagInBody):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore::HTMLTreeBuilder::processStartTag):
(WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
(WebCore):
(WebCore::HTMLTreeBuilder::processStartTagForInHead):
* html/parser/HTMLTreeBuilder.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (123288 => 123289)
--- trunk/Source/WebCore/ChangeLog 2012-07-21 06:07:16 UTC (rev 123288)
+++ trunk/Source/WebCore/ChangeLog 2012-07-21 08:01:22 UTC (rev 123289)
@@ -1,3 +1,31 @@
+2012-07-21 Kwang Yul Seo <[email protected]>
+
+ A start tag whose tag name is "html" in the "in body" insertion mode is a parse error
+ https://bugs.webkit.org/show_bug.cgi?id=91916
+
+ Reviewed by Eric Seidel.
+
+ According to the HTML5 spec, a start tag whose tag name is "html" in the "in body"
+ insertion mode is a parse error.
+
+ Added HTMLTreeBuilder::processHtmlStartTagForInBody(AtomicHTMLToken&) to call parseError(token).
+ Removed "FIXME: parse error" from HTMLConstructionSite::insertHTMLHtmlStartTagInBody and
+ HTMLConstructionSite::insertHTMLBodyStartTagInBody because we already marked the call sites
+ of these two methods with parseError(token).
+
+ No behavior change because parseError(token) is just a marker.
+
+ * html/parser/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagInBody):
+ (WebCore::HTMLConstructionSite::insertHTMLBodyStartTagInBody):
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processStartTagForInBody):
+ (WebCore::HTMLTreeBuilder::processStartTag):
+ (WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
+ (WebCore):
+ (WebCore::HTMLTreeBuilder::processStartTagForInHead):
+ * html/parser/HTMLTreeBuilder.h:
+
2012-07-20 Czene Tamás <[email protected]>
double data type shoud be changed to float in ColorMatrix
Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp (123288 => 123289)
--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp 2012-07-21 06:07:16 UTC (rev 123288)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp 2012-07-21 08:01:22 UTC (rev 123289)
@@ -220,8 +220,6 @@
void HTMLConstructionSite::insertHTMLHtmlStartTagInBody(AtomicHTMLToken& token)
{
- // FIXME: parse error
-
// Fragments do not have a root HTML element, so any additional HTML elements
// encountered during fragment parsing should be ignored.
if (m_isParsingFragment)
@@ -232,7 +230,6 @@
void HTMLConstructionSite::insertHTMLBodyStartTagInBody(AtomicHTMLToken& token)
{
- // FIXME: parse error
mergeAttributesFromTokenIntoElement(token, m_openElements.bodyElement());
}
Modified: trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp (123288 => 123289)
--- trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp 2012-07-21 06:07:16 UTC (rev 123288)
+++ trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp 2012-07-21 08:01:22 UTC (rev 123289)
@@ -727,7 +727,7 @@
{
ASSERT(token.type() == HTMLTokenTypes::StartTag);
if (token.name() == htmlTag) {
- m_tree.insertHTMLHtmlStartTagInBody(token);
+ processHtmlStartTagForInBody(token);
return;
}
if (token.name() == baseTag
@@ -1140,7 +1140,7 @@
case BeforeHeadMode:
ASSERT(insertionMode() == BeforeHeadMode);
if (token.name() == htmlTag) {
- m_tree.insertHTMLHtmlStartTagInBody(token);
+ processHtmlStartTagForInBody(token);
return;
}
if (token.name() == headTag) {
@@ -1159,7 +1159,7 @@
case AfterHeadMode:
ASSERT(insertionMode() == AfterHeadMode);
if (token.name() == htmlTag) {
- m_tree.insertHTMLHtmlStartTagInBody(token);
+ processHtmlStartTagForInBody(token);
return;
}
if (token.name() == bodyTag) {
@@ -1222,7 +1222,7 @@
case InColumnGroupMode:
ASSERT(insertionMode() == InColumnGroupMode);
if (token.name() == htmlTag) {
- m_tree.insertHTMLHtmlStartTagInBody(token);
+ processHtmlStartTagForInBody(token);
return;
}
if (token.name() == colTag) {
@@ -1309,7 +1309,7 @@
case AfterAfterBodyMode:
ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
if (token.name() == htmlTag) {
- m_tree.insertHTMLHtmlStartTagInBody(token);
+ processHtmlStartTagForInBody(token);
return;
}
setInsertionMode(InBodyMode);
@@ -1318,7 +1318,7 @@
case InHeadNoscriptMode:
ASSERT(insertionMode() == InHeadNoscriptMode);
if (token.name() == htmlTag) {
- m_tree.insertHTMLHtmlStartTagInBody(token);
+ processHtmlStartTagForInBody(token);
return;
}
if (token.name() == basefontTag
@@ -1341,7 +1341,7 @@
case InFramesetMode:
ASSERT(insertionMode() == InFramesetMode);
if (token.name() == htmlTag) {
- m_tree.insertHTMLHtmlStartTagInBody(token);
+ processHtmlStartTagForInBody(token);
return;
}
if (token.name() == framesetTag) {
@@ -1362,7 +1362,7 @@
case AfterAfterFramesetMode:
ASSERT(insertionMode() == AfterFramesetMode || insertionMode() == AfterAfterFramesetMode);
if (token.name() == htmlTag) {
- m_tree.insertHTMLHtmlStartTagInBody(token);
+ processHtmlStartTagForInBody(token);
return;
}
if (token.name() == noframesTag) {
@@ -1388,7 +1388,7 @@
case InSelectMode:
ASSERT(insertionMode() == InSelectMode || insertionMode() == InSelectInTableMode);
if (token.name() == htmlTag) {
- m_tree.insertHTMLHtmlStartTagInBody(token);
+ processHtmlStartTagForInBody(token);
return;
}
if (token.name() == optionTag) {
@@ -1446,6 +1446,12 @@
}
}
+void HTMLTreeBuilder::processHtmlStartTagForInBody(AtomicHTMLToken& token)
+{
+ parseError(token);
+ m_tree.insertHTMLHtmlStartTagInBody(token);
+}
+
bool HTMLTreeBuilder::processBodyEndTagForInBody(AtomicHTMLToken& token)
{
ASSERT(token.type() == HTMLTokenTypes::EndTag);
@@ -2557,7 +2563,7 @@
{
ASSERT(token.type() == HTMLTokenTypes::StartTag);
if (token.name() == htmlTag) {
- m_tree.insertHTMLHtmlStartTagInBody(token);
+ processHtmlStartTagForInBody(token);
return true;
}
if (token.name() == baseTag
Modified: trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h (123288 => 123289)
--- trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h 2012-07-21 06:07:16 UTC (rev 123288)
+++ trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h 2012-07-21 08:01:22 UTC (rev 123289)
@@ -137,6 +137,7 @@
void processEndTagForInCell(AtomicHTMLToken&);
void processIsindexStartTagForInBody(AtomicHTMLToken&);
+ void processHtmlStartTagForInBody(AtomicHTMLToken&);
bool processBodyEndTagForInBody(AtomicHTMLToken&);
bool processTableEndTagForInTable();
bool processCaptionEndTagForInCaption();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes