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

Side by Side Diff: Source/core/html/parser/HTMLConstructionSite.h

Issue 14759017: callTheAdoptionAgency should work asynchronously (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixenate tests Created 7 years, 7 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 | Annotate | Revision Log
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 23 matching lines...) Expand all
34 #include <wtf/Noncopyable.h> 34 #include <wtf/Noncopyable.h>
35 #include <wtf/PassRefPtr.h> 35 #include <wtf/PassRefPtr.h>
36 #include <wtf/RefPtr.h> 36 #include <wtf/RefPtr.h>
37 #include <wtf/Vector.h> 37 #include <wtf/Vector.h>
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 struct HTMLConstructionSiteTask { 41 struct HTMLConstructionSiteTask {
42 enum Operation { 42 enum Operation {
43 Insert, 43 Insert,
44 InsertAlreadyParsedChild,
44 Reparent, 45 Reparent,
46 TakeAllChildren,
45 }; 47 };
46 48
47 explicit HTMLConstructionSiteTask(Operation op) 49 explicit HTMLConstructionSiteTask(Operation op)
48 : operation(op) 50 : operation(op)
49 , selfClosing(false) 51 , selfClosing(false)
50 { 52 {
51 } 53 }
52 54
55 ContainerNode* oldParent()
56 {
57 // It's sort of ugly, but we store the |oldParent| in the |child| field
58 // of the task so that we don't bloat the HTMLConstructionSiteTask
59 // object in the common case of the Insert operation.
60 return toContainerNode(child.get());
61 }
62
53 Operation operation; 63 Operation operation;
54 RefPtr<ContainerNode> parent; 64 RefPtr<ContainerNode> parent;
55 RefPtr<Node> nextChild; 65 RefPtr<Node> nextChild;
56 RefPtr<Node> child; 66 RefPtr<Node> child;
57 bool selfClosing; 67 bool selfClosing;
58 }; 68 };
59 69
60 } // namespace WebCore 70 } // namespace WebCore
61 71
62 namespace WTF { 72 namespace WTF {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 void insertHTMLFormElement(AtomicHTMLToken*, bool isDemoted = false); 111 void insertHTMLFormElement(AtomicHTMLToken*, bool isDemoted = false);
102 void insertScriptElement(AtomicHTMLToken*); 112 void insertScriptElement(AtomicHTMLToken*);
103 void insertTextNode(const String&, WhitespaceMode = WhitespaceUnknown); 113 void insertTextNode(const String&, WhitespaceMode = WhitespaceUnknown);
104 void insertForeignElement(AtomicHTMLToken*, const AtomicString& namespaceURI ); 114 void insertForeignElement(AtomicHTMLToken*, const AtomicString& namespaceURI );
105 115
106 void insertHTMLHtmlStartTagBeforeHTML(AtomicHTMLToken*); 116 void insertHTMLHtmlStartTagBeforeHTML(AtomicHTMLToken*);
107 void insertHTMLHtmlStartTagInBody(AtomicHTMLToken*); 117 void insertHTMLHtmlStartTagInBody(AtomicHTMLToken*);
108 void insertHTMLBodyStartTagInBody(AtomicHTMLToken*); 118 void insertHTMLBodyStartTagInBody(AtomicHTMLToken*);
109 119
110 void reparent(HTMLElementStack::ElementRecord* newParent, HTMLElementStack:: ElementRecord* child); 120 void reparent(HTMLElementStack::ElementRecord* newParent, HTMLElementStack:: ElementRecord* child);
121 void reparent(HTMLElementStack::ElementRecord* newParent, HTMLStackItem* chi ld);
122 // insertAlreadyParsedChild assumes that |child| has already been parsed (i. e., we're just
123 // moving it around in the tree rather than parsing it for the first time). That means
124 // this function doesn't call beginParsingChildren / finishParsingChildren.
125 void insertAlreadyParsedChild(HTMLStackItem* newParent, HTMLElementStack::El ementRecord* child);
126 void takeAllChildren(HTMLStackItem* newParent, HTMLElementStack::ElementReco rd* oldParent);
111 127
112 PassRefPtr<HTMLStackItem> createElementFromSavedToken(HTMLStackItem*); 128 PassRefPtr<HTMLStackItem> createElementFromSavedToken(HTMLStackItem*);
113 129
114 bool shouldFosterParent() const; 130 bool shouldFosterParent() const;
115 void fosterParent(PassRefPtr<Node>); 131 void fosterParent(PassRefPtr<Node>);
116 132
117 bool indexOfFirstUnopenFormattingElement(unsigned& firstUnopenElementIndex) const; 133 bool indexOfFirstUnopenFormattingElement(unsigned& firstUnopenElementIndex) const;
118 void reconstructTheActiveFormattingElements(); 134 void reconstructTheActiveFormattingElements();
119 135
120 void generateImpliedEndTags(); 136 void generateImpliedEndTags();
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // "whenever a node would be inserted into the current node, it must instead 218 // "whenever a node would be inserted into the current node, it must instead
203 // be foster parented." This flag tracks whether we're in that state. 219 // be foster parented." This flag tracks whether we're in that state.
204 bool m_redirectAttachToFosterParent; 220 bool m_redirectAttachToFosterParent;
205 221
206 bool m_inQuirksMode; 222 bool m_inQuirksMode;
207 }; 223 };
208 224
209 } // namespace WebCore 225 } // namespace WebCore
210 226
211 #endif 227 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/parser/adoption-agency-crash-03-expected.txt ('k') | Source/core/html/parser/HTMLConstructionSite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698