Chromium Code Reviews| Index: Source/core/html/parser/HTMLConstructionSite.h |
| diff --git a/Source/core/html/parser/HTMLConstructionSite.h b/Source/core/html/parser/HTMLConstructionSite.h |
| index e541bd05591fd559ab21b87e380b9b2df4b56371..f5c3c4e32eb699ef343e4cae0e5c2e8929f564e8 100644 |
| --- a/Source/core/html/parser/HTMLConstructionSite.h |
| +++ b/Source/core/html/parser/HTMLConstructionSite.h |
| @@ -41,7 +41,9 @@ namespace WebCore { |
| struct HTMLConstructionSiteTask { |
| enum Operation { |
| Insert, |
| + InsertAlreadyParsedChild, |
| Reparent, |
| + TakeAllChildren, |
| }; |
| explicit HTMLConstructionSiteTask(Operation op) |
| @@ -50,6 +52,15 @@ struct HTMLConstructionSiteTask { |
| { |
| } |
| + ContainerNode* oldParent() |
| + { |
| + // It's sort of ugly, but we store the |oldParent| in the |child| field |
| + // of the task so that we don't bloat the HTMLConstructionSiteTask |
| + // object in the common case of the Insert operation. |
| + ASSERT(child->isContainerNode()); |
| + return static_cast<ContainerNode*>(child.get()); |
|
eseidel
2013/05/07 00:49:40
I believe there is a toContainerNode() which does
|
| + } |
| + |
| Operation operation; |
| RefPtr<ContainerNode> parent; |
| RefPtr<Node> nextChild; |
| @@ -108,6 +119,12 @@ public: |
| void insertHTMLBodyStartTagInBody(AtomicHTMLToken*); |
| void reparent(HTMLElementStack::ElementRecord* newParent, HTMLElementStack::ElementRecord* child); |
| + void reparent(HTMLElementStack::ElementRecord* newParent, HTMLStackItem* child); |
| + // insertAlreadyParsedChild assumes that |child| has already been parsed (i.e., we're just |
| + // moving it around in the tree rather than parsing it for the first time). That means |
| + // this function doesn't call beginParsingChildren / finishParsingChildren. |
| + void insertAlreadyParsedChild(HTMLStackItem* newParent, HTMLElementStack::ElementRecord* child); |
| + void takeAllChildren(HTMLStackItem* newParent, HTMLElementStack::ElementRecord* oldParent); |
| PassRefPtr<HTMLStackItem> createElementFromSavedToken(HTMLStackItem*); |