Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: Source/WebCore/html/parser/HTMLTreeBuilder.cpp

Issue 12518024: Merge 144128 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/html/parser/HTMLElementStack.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 } 1226 }
1227 if (isTableCellContextTag(token->name())) { 1227 if (isTableCellContextTag(token->name())) {
1228 parseError(token); 1228 parseError(token);
1229 processFakeStartTag(trTag); 1229 processFakeStartTag(trTag);
1230 ASSERT(insertionMode() == InRowMode); 1230 ASSERT(insertionMode() == InRowMode);
1231 processStartTag(token); 1231 processStartTag(token);
1232 return; 1232 return;
1233 } 1233 }
1234 if (isCaptionColOrColgroupTag(token->name()) || isTableBodyContextTag(to ken->name())) { 1234 if (isCaptionColOrColgroupTag(token->name()) || isTableBodyContextTag(to ken->name())) {
1235 // FIXME: This is slow. 1235 // FIXME: This is slow.
1236 if (!m_tree.openElements()->inTableScope(tbodyTag.localName()) && !m _tree.openElements()->inTableScope(theadTag.localName()) && !m_tree.openElements ()->inTableScope(tfootTag.localName())) { 1236 if (!m_tree.openElements()->inTableScope(tbodyTag) && !m_tree.openEl ements()->inTableScope(theadTag) && !m_tree.openElements()->inTableScope(tfootTa g)) {
1237 ASSERT(isParsingFragmentOrTemplateContents()); 1237 ASSERT(isParsingFragmentOrTemplateContents());
1238 parseError(token); 1238 parseError(token);
1239 return; 1239 return;
1240 } 1240 }
1241 m_tree.openElements()->popUntilTableBodyScopeMarker(); 1241 m_tree.openElements()->popUntilTableBodyScopeMarker();
1242 ASSERT(isTableBodyContextTag(m_tree.currentStackItem()->localName()) ); 1242 ASSERT(isTableBodyContextTag(m_tree.currentStackItem()->localName()) );
1243 processFakeEndTag(m_tree.currentStackItem()->localName()); 1243 processFakeEndTag(m_tree.currentStackItem()->localName());
1244 processStartTag(token); 1244 processStartTag(token);
1245 return; 1245 return;
1246 } 1246 }
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1715 parseError(token); 1715 parseError(token);
1716 return; 1716 return;
1717 } 1717 }
1718 m_tree.openElements()->popUntilTableBodyScopeMarker(); 1718 m_tree.openElements()->popUntilTableBodyScopeMarker();
1719 m_tree.openElements()->pop(); 1719 m_tree.openElements()->pop();
1720 setInsertionMode(InTableMode); 1720 setInsertionMode(InTableMode);
1721 return; 1721 return;
1722 } 1722 }
1723 if (token->name() == tableTag) { 1723 if (token->name() == tableTag) {
1724 // FIXME: This is slow. 1724 // FIXME: This is slow.
1725 if (!m_tree.openElements()->inTableScope(tbodyTag.localName()) && !m_tre e.openElements()->inTableScope(theadTag.localName()) && !m_tree.openElements()-> inTableScope(tfootTag.localName())) { 1725 if (!m_tree.openElements()->inTableScope(tbodyTag) && !m_tree.openElemen ts()->inTableScope(theadTag) && !m_tree.openElements()->inTableScope(tfootTag)) {
1726 ASSERT(isParsingFragmentOrTemplateContents()); 1726 ASSERT(isParsingFragmentOrTemplateContents());
1727 parseError(token); 1727 parseError(token);
1728 return; 1728 return;
1729 } 1729 }
1730 m_tree.openElements()->popUntilTableBodyScopeMarker(); 1730 m_tree.openElements()->popUntilTableBodyScopeMarker();
1731 ASSERT(isTableBodyContextTag(m_tree.currentStackItem()->localName())); 1731 ASSERT(isTableBodyContextTag(m_tree.currentStackItem()->localName()));
1732 processFakeEndTag(m_tree.currentStackItem()->localName()); 1732 processFakeEndTag(m_tree.currentStackItem()->localName());
1733 processEndTag(token); 1733 processEndTag(token);
1734 return; 1734 return;
1735 } 1735 }
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1970 m_tree.generateImpliedEndTags(); 1970 m_tree.generateImpliedEndTags();
1971 // FIXME: parse error if (!m_tree.currentStackItem()->hasTagName(captionTag) ) 1971 // FIXME: parse error if (!m_tree.currentStackItem()->hasTagName(captionTag) )
1972 m_tree.openElements()->popUntilPopped(captionTag.localName()); 1972 m_tree.openElements()->popUntilPopped(captionTag.localName());
1973 m_tree.activeFormattingElements()->clearToLastMarker(); 1973 m_tree.activeFormattingElements()->clearToLastMarker();
1974 setInsertionMode(InTableMode); 1974 setInsertionMode(InTableMode);
1975 return true; 1975 return true;
1976 } 1976 }
1977 1977
1978 bool HTMLTreeBuilder::processTrEndTagForInRow() 1978 bool HTMLTreeBuilder::processTrEndTagForInRow()
1979 { 1979 {
1980 if (!m_tree.openElements()->inTableScope(trTag.localName())) { 1980 if (!m_tree.openElements()->inTableScope(trTag)) {
1981 ASSERT(isParsingFragmentOrTemplateContents()); 1981 ASSERT(isParsingFragmentOrTemplateContents());
1982 // FIXME: parse error 1982 // FIXME: parse error
1983 return false; 1983 return false;
1984 } 1984 }
1985 m_tree.openElements()->popUntilTableRowScopeMarker(); 1985 m_tree.openElements()->popUntilTableRowScopeMarker();
1986 ASSERT(m_tree.currentStackItem()->hasTagName(trTag)); 1986 ASSERT(m_tree.currentStackItem()->hasTagName(trTag));
1987 m_tree.openElements()->pop(); 1987 m_tree.openElements()->pop();
1988 setInsertionMode(InTableBodyMode); 1988 setInsertionMode(InTableBodyMode);
1989 return true; 1989 return true;
1990 } 1990 }
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
2931 ASSERT(m_isAttached); 2931 ASSERT(m_isAttached);
2932 // Warning, this may detach the parser. Do not do anything else after this. 2932 // Warning, this may detach the parser. Do not do anything else after this.
2933 m_tree.finishedParsing(); 2933 m_tree.finishedParsing();
2934 } 2934 }
2935 2935
2936 void HTMLTreeBuilder::parseError(AtomicHTMLToken*) 2936 void HTMLTreeBuilder::parseError(AtomicHTMLToken*)
2937 { 2937 {
2938 } 2938 }
2939 2939
2940 } 2940 }
OLDNEW
« no previous file with comments | « Source/WebCore/html/parser/HTMLElementStack.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698