| OLD | NEW |
| 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 30 matching lines...) Expand all Loading... |
| 41 #include "platform/NotImplemented.h" | 41 #include "platform/NotImplemented.h" |
| 42 #include "platform/text/TextBreakIterator.h" | 42 #include "platform/text/TextBreakIterator.h" |
| 43 #include <limits> | 43 #include <limits> |
| 44 | 44 |
| 45 namespace blink { | 45 namespace blink { |
| 46 | 46 |
| 47 static const unsigned maximumHTMLParserDOMTreeDepth = 512; | 47 static const unsigned maximumHTMLParserDOMTreeDepth = 512; |
| 48 | 48 |
| 49 static inline void setAttributes(Element* element, AtomicHTMLToken* token) | 49 static inline void setAttributes(Element* element, AtomicHTMLToken* token) |
| 50 { | 50 { |
| 51 element->stripScriptingAttributes(token->attributes()); | |
| 52 element->parserSetAttributes(token->attributes()); | 51 element->parserSetAttributes(token->attributes()); |
| 53 } | 52 } |
| 54 | 53 |
| 55 static bool shouldUseLengthLimit(const ContainerNode& node) | 54 static bool shouldUseLengthLimit(const ContainerNode& node) |
| 56 { | 55 { |
| 57 return !isHTMLScriptElement(node) | 56 return !isHTMLScriptElement(node) |
| 58 && !isHTMLStyleElement(node); | 57 && !isHTMLStyleElement(node); |
| 59 } | 58 } |
| 60 | 59 |
| 61 static unsigned textLengthLimitForContainer(const ContainerNode& node) | 60 static unsigned textLengthLimitForContainer(const ContainerNode& node) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 83 } | 82 } |
| 84 | 83 |
| 85 static inline void executeInsertTask(HTMLConstructionSiteTask& task) | 84 static inline void executeInsertTask(HTMLConstructionSiteTask& task) |
| 86 { | 85 { |
| 87 ASSERT(task.operation == HTMLConstructionSiteTask::Insert); | 86 ASSERT(task.operation == HTMLConstructionSiteTask::Insert); |
| 88 | 87 |
| 89 insert(task); | 88 insert(task); |
| 90 | 89 |
| 91 if (task.child->isElementNode()) { | 90 if (task.child->isElementNode()) { |
| 92 Element& child = toElement(*task.child); | 91 Element& child = toElement(*task.child); |
| 93 child.beginParsingChildren(); | |
| 94 if (task.selfClosing) | 92 if (task.selfClosing) |
| 95 child.finishParsingChildren(); | 93 child.finishParsingChildren(); |
| 96 } | 94 } |
| 97 } | 95 } |
| 98 | 96 |
| 99 static inline void executeInsertTextTask(HTMLConstructionSiteTask& task) | 97 static inline void executeInsertTextTask(HTMLConstructionSiteTask& task) |
| 100 { | 98 { |
| 101 ASSERT(task.operation == HTMLConstructionSiteTask::InsertText); | 99 ASSERT(task.operation == HTMLConstructionSiteTask::InsertText); |
| 102 ASSERT(task.child->isTextNode()); | 100 ASSERT(task.child->isTextNode()); |
| 103 | 101 |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 return element.release(); | 360 return element.release(); |
| 363 } | 361 } |
| 364 | 362 |
| 365 void HTMLConstructionSite::PendingText::trace(Visitor* visitor) | 363 void HTMLConstructionSite::PendingText::trace(Visitor* visitor) |
| 366 { | 364 { |
| 367 visitor->trace(parent); | 365 visitor->trace(parent); |
| 368 visitor->trace(nextChild); | 366 visitor->trace(nextChild); |
| 369 } | 367 } |
| 370 | 368 |
| 371 } | 369 } |
| OLD | NEW |