OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. |
6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> | 6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 dispatchErrorEvent(); | 324 dispatchErrorEvent(); |
325 else if (!cachedScript->wasCanceled()) { | 325 else if (!cachedScript->wasCanceled()) { |
326 executeScript(ScriptSourceCode(cachedScript)); | 326 executeScript(ScriptSourceCode(cachedScript)); |
327 dispatchLoadEvent(); | 327 dispatchLoadEvent(); |
328 } | 328 } |
329 cachedScript->removeClient(this); | 329 cachedScript->removeClient(this); |
330 } | 330 } |
331 | 331 |
332 void ScriptElement::notifyFinished(CachedResource* o) | 332 void ScriptElement::notifyFinished(CachedResource* o) |
333 { | 333 { |
| 334 // crbug.com/75604 causes double notification in some situations, disregardi
ng the second notification |
| 335 // is a workaround. |
| 336 if (!m_cachedScript) |
| 337 return; |
| 338 |
334 ASSERT(!m_willBeParserExecuted); | 339 ASSERT(!m_willBeParserExecuted); |
335 ASSERT_UNUSED(o, o == m_cachedScript); | 340 ASSERT_UNUSED(o, o == m_cachedScript); |
336 if (m_willExecuteInOrder) | 341 if (m_willExecuteInOrder) |
337 m_element->document()->scriptRunner()->notifyInOrderScriptReady(); | 342 m_element->document()->scriptRunner()->notifyInOrderScriptReady(); |
338 else | 343 else |
339 m_element->document()->scriptRunner()->queueScriptForExecution(this, m_c
achedScript, ScriptRunner::ASYNC_EXECUTION); | 344 m_element->document()->scriptRunner()->queueScriptForExecution(this, m_c
achedScript, ScriptRunner::ASYNC_EXECUTION); |
340 | 345 |
341 #if PLATFORM(CHROMIUM) | 346 #if PLATFORM(CHROMIUM) |
342 ASSERT(m_cachedScriptState == Set); | 347 ASSERT(m_cachedScriptState == Set); |
343 m_cachedScriptState = ZeroedInNotifyFinished; | 348 m_cachedScriptState = ZeroedInNotifyFinished; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 | 407 |
403 #if ENABLE(SVG) | 408 #if ENABLE(SVG) |
404 if (element->isSVGElement() && element->hasTagName(SVGNames::scriptTag)) | 409 if (element->isSVGElement() && element->hasTagName(SVGNames::scriptTag)) |
405 return static_cast<SVGScriptElement*>(element); | 410 return static_cast<SVGScriptElement*>(element); |
406 #endif | 411 #endif |
407 | 412 |
408 return 0; | 413 return 0; |
409 } | 414 } |
410 | 415 |
411 } | 416 } |
OLD | NEW |