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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp

Issue 2242703002: Fix frameset within fragment asserts in HTMLTreeBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up asserts Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/parser/frameset-in-fragment.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp
index ff36b586a035cec8d33d12914b22a5cf36811420..0fb848deec675ee3d1c820d4eda383149ab07e80 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp
@@ -619,7 +619,12 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken* token)
m_tree.openElements()->bodyElement()->remove(ASSERT_NO_EXCEPTION);
m_tree.openElements()->popUntil(m_tree.openElements()->bodyElement());
m_tree.openElements()->popHTMLBodyElement();
- ASSERT(m_tree.openElements()->top() == m_tree.openElements()->htmlElement());
+
+ // Note: in the fragment case the root is a DocumentFragment instead of
+ // a proper html element which is a quirk in Blink's implementation.
+ DCHECK(!isParsingTemplateContents());
+ DCHECK(!isParsingFragment() || toDocumentFragment(m_tree.openElements()->topNode()));
+ DCHECK(isParsingFragment() || m_tree.openElements()->top() == m_tree.openElements()->htmlElement());
m_tree.insertHTMLElement(token);
setInsertionMode(InFramesetMode);
return;
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/parser/frameset-in-fragment.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698