OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 continue; | 148 continue; |
149 if (candidate->attributes().size() != newItemAttributeCount) | 149 if (candidate->attributes().size() != newItemAttributeCount) |
150 continue; | 150 continue; |
151 | 151 |
152 candidates.append(candidate); | 152 candidates.append(candidate); |
153 } | 153 } |
154 | 154 |
155 if (candidates.size() < kNoahsArkCapacity) | 155 if (candidates.size() < kNoahsArkCapacity) |
156 return; // There's room for the new element in the ark. There's no need
to copy out the remainingCandidates. | 156 return; // There's room for the new element in the ark. There's no need
to copy out the remainingCandidates. |
157 | 157 |
158 remainingCandidates.append(candidates); | 158 remainingCandidates.appendVector(candidates); |
159 } | 159 } |
160 | 160 |
161 void HTMLFormattingElementList::ensureNoahsArkCondition(HTMLStackItem* newItem) | 161 void HTMLFormattingElementList::ensureNoahsArkCondition(HTMLStackItem* newItem) |
162 { | 162 { |
163 Vector<HTMLStackItem*> candidates; | 163 Vector<HTMLStackItem*> candidates; |
164 tryToEnsureNoahsArkConditionQuickly(newItem, candidates); | 164 tryToEnsureNoahsArkConditionQuickly(newItem, candidates); |
165 if (candidates.isEmpty()) | 165 if (candidates.isEmpty()) |
166 return; | 166 return; |
167 | 167 |
168 // We pre-allocate and re-use this second vector to save one malloc per | 168 // We pre-allocate and re-use this second vector to save one malloc per |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 if (entry.isMarker()) | 209 if (entry.isMarker()) |
210 fprintf(stderr, "marker\n"); | 210 fprintf(stderr, "marker\n"); |
211 else | 211 else |
212 entry.element()->showNode(); | 212 entry.element()->showNode(); |
213 } | 213 } |
214 } | 214 } |
215 | 215 |
216 #endif | 216 #endif |
217 | 217 |
218 } | 218 } |
OLD | NEW |