OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 bool HTMLImport::precedes(HTMLImport* import) | 47 bool HTMLImport::precedes(HTMLImport* import) |
48 { | 48 { |
49 for (HTMLImport* i = this; i; i = traverseNext(i)) { | 49 for (HTMLImport* i = this; i; i = traverseNext(i)) { |
50 if (i == import) | 50 if (i == import) |
51 return true; | 51 return true; |
52 } | 52 } |
53 | 53 |
54 return false; | 54 return false; |
55 } | 55 } |
56 | 56 |
| 57 bool HTMLImport::formsCycle() const |
| 58 { |
| 59 for (const HTMLImport* i = this->parent(); i; i = i->parent()) { |
| 60 if (i->document() == this->document()) |
| 61 return true; |
| 62 } |
| 63 |
| 64 return false; |
| 65 |
| 66 } |
| 67 |
57 void HTMLImport::appendImport(HTMLImport* child) | 68 void HTMLImport::appendImport(HTMLImport* child) |
58 { | 69 { |
59 appendChild(child); | 70 appendChild(child); |
60 | 71 |
61 // This prevents HTML parser from going beyond the | 72 // This prevents HTML parser from going beyond the |
62 // blockage line before the precise state is computed by recalcState(). | 73 // blockage line before the precise state is computed by recalcState(). |
63 if (child->isSync()) | 74 if (child->isSync()) |
64 m_state = HTMLImportState::blockedState(); | 75 m_state = HTMLImportState::blockedState(); |
65 | 76 |
66 stateWillChange(); | 77 stateWillChange(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 child->showTree(highlight, depth + 1); | 134 child->showTree(highlight, depth + 1); |
124 } | 135 } |
125 | 136 |
126 void HTMLImport::showThis() | 137 void HTMLImport::showThis() |
127 { | 138 { |
128 fprintf(stderr, "%p state=%d", this, m_state.peekValueForDebug()); | 139 fprintf(stderr, "%p state=%d", this, m_state.peekValueForDebug()); |
129 } | 140 } |
130 #endif | 141 #endif |
131 | 142 |
132 } // namespace WebCore | 143 } // namespace WebCore |
OLD | NEW |