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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 Reparent, | 49 Reparent, |
50 TakeAllChildren, | 50 TakeAllChildren, |
51 }; | 51 }; |
52 | 52 |
53 explicit HTMLConstructionSiteTask(Operation op) | 53 explicit HTMLConstructionSiteTask(Operation op) |
54 : operation(op) | 54 : operation(op) |
55 , selfClosing(false) | 55 , selfClosing(false) |
56 { | 56 { |
57 } | 57 } |
58 | 58 |
59 void trace(Visitor* visitor) | 59 DEFINE_INLINE_TRACE() |
60 { | 60 { |
61 visitor->trace(parent); | 61 visitor->trace(parent); |
62 visitor->trace(nextChild); | 62 visitor->trace(nextChild); |
63 visitor->trace(child); | 63 visitor->trace(child); |
64 } | 64 } |
65 | 65 |
66 ContainerNode* oldParent() | 66 ContainerNode* oldParent() |
67 { | 67 { |
68 // It's sort of ugly, but we store the |oldParent| in the |child| field | 68 // It's sort of ugly, but we store the |oldParent| in the |child| field |
69 // of the task so that we don't bloat the HTMLConstructionSiteTask | 69 // of the task so that we don't bloat the HTMLConstructionSiteTask |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 class Element; | 105 class Element; |
106 class HTMLFormElement; | 106 class HTMLFormElement; |
107 | 107 |
108 class HTMLConstructionSite final { | 108 class HTMLConstructionSite final { |
109 WTF_MAKE_NONCOPYABLE(HTMLConstructionSite); | 109 WTF_MAKE_NONCOPYABLE(HTMLConstructionSite); |
110 DISALLOW_ALLOCATION(); | 110 DISALLOW_ALLOCATION(); |
111 public: | 111 public: |
112 HTMLConstructionSite(Document*, ParserContentPolicy); | 112 HTMLConstructionSite(Document*, ParserContentPolicy); |
113 HTMLConstructionSite(DocumentFragment*, ParserContentPolicy); | 113 HTMLConstructionSite(DocumentFragment*, ParserContentPolicy); |
114 ~HTMLConstructionSite(); | 114 ~HTMLConstructionSite(); |
115 void trace(Visitor*); | 115 DECLARE_TRACE(); |
116 | 116 |
117 void detach(); | 117 void detach(); |
118 | 118 |
119 // executeQueuedTasks empties the queue but does not flush pending text. | 119 // executeQueuedTasks empties the queue but does not flush pending text. |
120 // NOTE: Possible reentrancy via JavaScript execution. | 120 // NOTE: Possible reentrancy via JavaScript execution. |
121 void executeQueuedTasks(); | 121 void executeQueuedTasks(); |
122 | 122 |
123 // flushPendingText turns pending text into queued Text insertions, but does
not execute them. | 123 // flushPendingText turns pending text into queued Text insertions, but does
not execute them. |
124 void flushPendingText(FlushMode); | 124 void flushPendingText(FlushMode); |
125 | 125 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 290 |
291 bool isEmpty() | 291 bool isEmpty() |
292 { | 292 { |
293 // When the stringbuilder is empty, the parent and whitespace should
also be "empty". | 293 // When the stringbuilder is empty, the parent and whitespace should
also be "empty". |
294 ASSERT(stringBuilder.isEmpty() == !parent); | 294 ASSERT(stringBuilder.isEmpty() == !parent); |
295 ASSERT(!stringBuilder.isEmpty() || !nextChild); | 295 ASSERT(!stringBuilder.isEmpty() || !nextChild); |
296 ASSERT(!stringBuilder.isEmpty() || (whitespaceMode == WhitespaceUnkn
own)); | 296 ASSERT(!stringBuilder.isEmpty() || (whitespaceMode == WhitespaceUnkn
own)); |
297 return stringBuilder.isEmpty(); | 297 return stringBuilder.isEmpty(); |
298 } | 298 } |
299 | 299 |
300 void trace(Visitor*); | 300 DECLARE_TRACE(); |
301 | 301 |
302 RefPtrWillBeMember<ContainerNode> parent; | 302 RefPtrWillBeMember<ContainerNode> parent; |
303 RefPtrWillBeMember<Node> nextChild; | 303 RefPtrWillBeMember<Node> nextChild; |
304 StringBuilder stringBuilder; | 304 StringBuilder stringBuilder; |
305 WhitespaceMode whitespaceMode; | 305 WhitespaceMode whitespaceMode; |
306 }; | 306 }; |
307 | 307 |
308 PendingText m_pendingText; | 308 PendingText m_pendingText; |
309 | 309 |
310 ParserContentPolicy m_parserContentPolicy; | 310 ParserContentPolicy m_parserContentPolicy; |
311 bool m_isParsingFragment; | 311 bool m_isParsingFragment; |
312 | 312 |
313 // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.
html#parsing-main-intable | 313 // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.
html#parsing-main-intable |
314 // In the "in table" insertion mode, we sometimes get into a state where | 314 // In the "in table" insertion mode, we sometimes get into a state where |
315 // "whenever a node would be inserted into the current node, it must instead | 315 // "whenever a node would be inserted into the current node, it must instead |
316 // be foster parented." This flag tracks whether we're in that state. | 316 // be foster parented." This flag tracks whether we're in that state. |
317 bool m_redirectAttachToFosterParent; | 317 bool m_redirectAttachToFosterParent; |
318 | 318 |
319 bool m_inQuirksMode; | 319 bool m_inQuirksMode; |
320 }; | 320 }; |
321 | 321 |
322 } // namespace blink | 322 } // namespace blink |
323 | 323 |
324 #endif | 324 #endif |
OLD | NEW |