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

Side by Side 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 unified diff | 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 »
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, 2014 Apple Inc. All rights reserved. 3 * Copyright (C) 2011, 2014 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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 parseError(token); 612 parseError(token);
613 if (!m_tree.openElements()->secondElementIsHTMLBodyElement() || m_tree.o penElements()->hasOnlyOneElement()) { 613 if (!m_tree.openElements()->secondElementIsHTMLBodyElement() || m_tree.o penElements()->hasOnlyOneElement()) {
614 ASSERT(isParsingFragmentOrTemplateContents()); 614 ASSERT(isParsingFragmentOrTemplateContents());
615 return; 615 return;
616 } 616 }
617 if (!m_framesetOk) 617 if (!m_framesetOk)
618 return; 618 return;
619 m_tree.openElements()->bodyElement()->remove(ASSERT_NO_EXCEPTION); 619 m_tree.openElements()->bodyElement()->remove(ASSERT_NO_EXCEPTION);
620 m_tree.openElements()->popUntil(m_tree.openElements()->bodyElement()); 620 m_tree.openElements()->popUntil(m_tree.openElements()->bodyElement());
621 m_tree.openElements()->popHTMLBodyElement(); 621 m_tree.openElements()->popHTMLBodyElement();
622 ASSERT(m_tree.openElements()->top() == m_tree.openElements()->htmlElemen t()); 622
623 // Note: in the fragment case the root is a DocumentFragment instead of
624 // a proper html element which is a quirk in Blink's implementation.
625 DCHECK(!isParsingTemplateContents());
626 DCHECK(!isParsingFragment() || toDocumentFragment(m_tree.openElements()- >topNode()));
627 DCHECK(isParsingFragment() || m_tree.openElements()->top() == m_tree.ope nElements()->htmlElement());
623 m_tree.insertHTMLElement(token); 628 m_tree.insertHTMLElement(token);
624 setInsertionMode(InFramesetMode); 629 setInsertionMode(InFramesetMode);
625 return; 630 return;
626 } 631 }
627 if (token->name() == addressTag 632 if (token->name() == addressTag
628 || token->name() == articleTag 633 || token->name() == articleTag
629 || token->name() == asideTag 634 || token->name() == asideTag
630 || token->name() == blockquoteTag 635 || token->name() == blockquoteTag
631 || token->name() == centerTag 636 || token->name() == centerTag
632 || token->name() == detailsTag 637 || token->name() == detailsTag
(...skipping 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2829 DEFINE_STRINGIFY(AfterFramesetMode) 2834 DEFINE_STRINGIFY(AfterFramesetMode)
2830 DEFINE_STRINGIFY(AfterAfterBodyMode) 2835 DEFINE_STRINGIFY(AfterAfterBodyMode)
2831 DEFINE_STRINGIFY(AfterAfterFramesetMode) 2836 DEFINE_STRINGIFY(AfterAfterFramesetMode)
2832 #undef DEFINE_STRINGIFY 2837 #undef DEFINE_STRINGIFY
2833 } 2838 }
2834 return "<unknown>"; 2839 return "<unknown>";
2835 } 2840 }
2836 #endif 2841 #endif
2837 2842
2838 } // namespace blink 2843 } // namespace blink
OLDNEW
« 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