Chromium Code Reviews| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 namespace blink { | 85 namespace blink { |
| 86 | 86 |
| 87 // Note: These are intentionally ordered so that when we concatonate | 87 // Note: These are intentionally ordered so that when we concatonate |
| 88 // strings and whitespaces the resulting whitespace is ws = min(ws1, ws2). | 88 // strings and whitespaces the resulting whitespace is ws = min(ws1, ws2). |
| 89 enum WhitespaceMode { | 89 enum WhitespaceMode { |
| 90 WhitespaceUnknown, | 90 WhitespaceUnknown, |
| 91 NotAllWhitespace, | 91 NotAllWhitespace, |
| 92 AllWhitespace, | 92 AllWhitespace, |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 enum FlushMode { | |
| 96 MandatoryFlush, | |
| 97 FacultativeFlush, // Do not flush if there is no visible changes. | |
|
eseidel
2014/08/26 16:26:39
I think you'll find more people who know the word
eustas
2014/08/27 11:31:26
Sounds good. Thanks.
| |
| 98 }; | |
| 99 | |
| 95 class AtomicHTMLToken; | 100 class AtomicHTMLToken; |
| 96 class Document; | 101 class Document; |
| 97 class Element; | 102 class Element; |
| 98 class HTMLFormElement; | 103 class HTMLFormElement; |
| 99 | 104 |
| 100 class HTMLConstructionSite FINAL { | 105 class HTMLConstructionSite FINAL { |
| 101 WTF_MAKE_NONCOPYABLE(HTMLConstructionSite); | 106 WTF_MAKE_NONCOPYABLE(HTMLConstructionSite); |
| 102 DISALLOW_ALLOCATION(); | 107 DISALLOW_ALLOCATION(); |
| 103 public: | 108 public: |
| 104 HTMLConstructionSite(Document*, ParserContentPolicy); | 109 HTMLConstructionSite(Document*, ParserContentPolicy); |
| 105 HTMLConstructionSite(DocumentFragment*, ParserContentPolicy); | 110 HTMLConstructionSite(DocumentFragment*, ParserContentPolicy); |
| 106 ~HTMLConstructionSite(); | 111 ~HTMLConstructionSite(); |
| 107 void trace(Visitor*); | 112 void trace(Visitor*); |
| 108 | 113 |
| 109 void detach(); | 114 void detach(); |
| 110 | 115 |
| 111 // executeQueuedTasks empties the queue but does not flush pending text. | 116 // executeQueuedTasks empties the queue but does not flush pending text. |
| 112 // NOTE: Possible reentrancy via JavaScript execution. | 117 // NOTE: Possible reentrancy via JavaScript execution. |
| 113 void executeQueuedTasks(); | 118 void executeQueuedTasks(); |
| 114 | 119 |
| 115 // flushPendingText turns pending text into queued Text insertions, but does not execute them. | 120 // flushPendingText turns pending text into queued Text insertions, but does not execute them. |
| 116 void flushPendingText(); | 121 void flushPendingText(FlushMode); |
| 117 | 122 |
| 118 // Called before every token in HTMLTreeBuilder::processToken, thus inlined: | 123 // Called before every token in HTMLTreeBuilder::processToken, thus inlined: |
| 119 void flush() | 124 void flush(FlushMode mode) |
| 120 { | 125 { |
| 121 if (!hasPendingTasks()) | 126 if (!hasPendingTasks()) |
| 122 return; | 127 return; |
| 123 flushPendingText(); | 128 flushPendingText(mode); |
| 124 executeQueuedTasks(); // NOTE: Possible reentrancy via JavaScript execut ion. | 129 executeQueuedTasks(); // NOTE: Possible reentrancy via JavaScript execut ion. |
| 125 ASSERT(!hasPendingTasks()); | 130 ASSERT(!hasPendingTasks()); |
| 126 } | 131 } |
| 127 | 132 |
| 128 bool hasPendingTasks() | 133 bool hasPendingTasks() |
| 129 { | 134 { |
| 130 return !m_pendingText.isEmpty() || !m_taskQueue.isEmpty(); | 135 return !m_pendingText.isEmpty() || !m_taskQueue.isEmpty(); |
| 131 } | 136 } |
| 132 | 137 |
| 133 void setDefaultCompatibilityMode(); | 138 void setDefaultCompatibilityMode(); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 307 // "whenever a node would be inserted into the current node, it must instead | 312 // "whenever a node would be inserted into the current node, it must instead |
| 308 // be foster parented." This flag tracks whether we're in that state. | 313 // be foster parented." This flag tracks whether we're in that state. |
| 309 bool m_redirectAttachToFosterParent; | 314 bool m_redirectAttachToFosterParent; |
| 310 | 315 |
| 311 bool m_inQuirksMode; | 316 bool m_inQuirksMode; |
| 312 }; | 317 }; |
| 313 | 318 |
| 314 } // namespace blink | 319 } // namespace blink |
| 315 | 320 |
| 316 #endif | 321 #endif |
| OLD | NEW |