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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 } | 199 } |
200 | 200 |
201 void HTMLImportChild::shareLoader(HTMLImportChild* loader) | 201 void HTMLImportChild::shareLoader(HTMLImportChild* loader) |
202 { | 202 { |
203 ASSERT(!m_loader); | 203 ASSERT(!m_loader); |
204 m_loader = loader->m_loader; | 204 m_loader = loader->m_loader; |
205 m_loader->addImport(this); | 205 m_loader->addImport(this); |
206 stateWillChange(); | 206 stateWillChange(); |
207 } | 207 } |
208 | 208 |
209 bool HTMLImportChild::isWaitingCustomElementMicrotaskSteps() const | |
dglazkov
2014/05/16 16:10:49
"is waiting on" or "is waiting for" might feel a t
| |
210 { | |
211 if (m_loader->microtaskQueue()->isEmpty()) | |
212 return false; | |
213 | |
214 size_t ignorableStepCount = 0; | |
215 for (HTMLImport* i = firstChild(); i; i = i->next()) { | |
216 HTMLImportChild* child = toHTMLImportChild(i); | |
217 if (child->hasMicrotaskStep() && !child->isSync()) | |
218 ignorableStepCount++; | |
219 } | |
220 | |
221 return ignorableStepCount < m_loader->microtaskQueue()->size(); | |
222 } | |
223 | |
209 bool HTMLImportChild::isDone() const | 224 bool HTMLImportChild::isDone() const |
210 { | 225 { |
211 return m_loader && m_loader->isDone() && !m_loader->microtaskQueue()->needsP rocessOrStop() && !m_customElementMicrotaskStep; | 226 return m_loader && m_loader->isDone() && !isWaitingCustomElementMicrotaskSte ps() && !m_customElementMicrotaskStep; |
212 } | 227 } |
213 | 228 |
214 bool HTMLImportChild::loaderHasError() const | 229 bool HTMLImportChild::loaderHasError() const |
215 { | 230 { |
216 return m_loader && m_loader->hasError(); | 231 return m_loader && m_loader->hasError(); |
217 } | 232 } |
218 | 233 |
219 | 234 |
220 void HTMLImportChild::setClient(HTMLImportChildClient* client) | 235 void HTMLImportChild::setClient(HTMLImportChildClient* client) |
221 { | 236 { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
261 fprintf(stderr, " loader=%p first=%d, step=%p sync=%s url=%s", | 276 fprintf(stderr, " loader=%p first=%d, step=%p sync=%s url=%s", |
262 m_loader, | 277 m_loader, |
263 isFirst, | 278 isFirst, |
264 m_customElementMicrotaskStep.get(), | 279 m_customElementMicrotaskStep.get(), |
265 isSync() ? "Y" : "N", | 280 isSync() ? "Y" : "N", |
266 url().string().utf8().data()); | 281 url().string().utf8().data()); |
267 } | 282 } |
268 #endif | 283 #endif |
269 | 284 |
270 } // namespace WebCore | 285 } // namespace WebCore |
OLD | NEW |