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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp

Issue 2303193002: Add DCHECKs for catching inconsistent custom element state (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | 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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 // "9. If will execute script is true, then ..." etc. The 847 // "9. If will execute script is true, then ..." etc. The
848 // CEReactionsScope and ScriptNestingLevelIncrementer 848 // CEReactionsScope and ScriptNestingLevelIncrementer
849 // destructors implement steps 9.1-4. 849 // destructors implement steps 9.1-4.
850 } else { 850 } else {
851 // FIXME: This can't use 851 // FIXME: This can't use
852 // HTMLConstructionSite::createElement because we have to 852 // HTMLConstructionSite::createElement because we have to
853 // pass the current form element. We should rework form 853 // pass the current form element. We should rework form
854 // association to occur after construction to allow better 854 // association to occur after construction to allow better
855 // code sharing here. 855 // code sharing here.
856 element = HTMLElementFactory::createHTMLElement(token->name(), document, form, getCreateElementFlags()); 856 element = HTMLElementFactory::createHTMLElement(token->name(), document, form, getCreateElementFlags());
857 // Definition for the created element does not exist here and
858 // it cannot be custom or failed.
859 DCHECK_NE(element->getCustomElementState(), CustomElementState::Custom);
860 DCHECK_NE(element->getCustomElementState(), CustomElementState::Failed);
857 861
858 // "8. Append each attribute in the given token to element." 862 // "8. Append each attribute in the given token to element."
859 setAttributes(element, token, m_parserContentPolicy); 863 setAttributes(element, token, m_parserContentPolicy);
860 } 864 }
861 865
862 // TODO(dominicc): Implement steps 10-12 when customized built-in 866 // TODO(dominicc): Implement steps 10-12 when customized built-in
863 // elements are implemented. 867 // elements are implemented.
864 868
865 return element; 869 return element;
866 } 870 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 queueTask(task); 983 queueTask(task);
980 } 984 }
981 985
982 DEFINE_TRACE(HTMLConstructionSite::PendingText) 986 DEFINE_TRACE(HTMLConstructionSite::PendingText)
983 { 987 {
984 visitor->trace(parent); 988 visitor->trace(parent);
985 visitor->trace(nextChild); 989 visitor->trace(nextChild);
986 } 990 }
987 991
988 } // namespace blink 992 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698