Chromium Code Reviews| Index: Source/core/html/parser/HTMLConstructionSite.cpp |
| diff --git a/Source/core/html/parser/HTMLConstructionSite.cpp b/Source/core/html/parser/HTMLConstructionSite.cpp |
| index 9046c24ed248ed9fc30274a385c96dabd1dbab5b..3de5327d44aae5d5013fcec6dccd9da7b11558cb 100644 |
| --- a/Source/core/html/parser/HTMLConstructionSite.cpp |
| +++ b/Source/core/html/parser/HTMLConstructionSite.cpp |
| @@ -102,6 +102,12 @@ static inline void insert(HTMLConstructionSiteTask& task) |
| if (isHTMLTemplateElement(*task.parent)) |
| task.parent = toHTMLTemplateElement(task.parent.get())->content(); |
| + if (task.parent->isDocumentNode()) { |
| + Document& document = toDocument(*task.parent); |
| + if (!document.canAcceptChild(*task.child, nullptr, IGNORE_EXCEPTION)) |
| + return; |
| + } |
|
kouhei (in TOK)
2015/05/28 03:54:53
This change lg tm. Would you like to split this up
|
| + |
| if (task.nextChild) |
| task.parent->parserInsertBefore(task.child.get(), *task.nextChild); |
| else |