Changeset 74752 in webkit
- Timestamp:
- Dec 29, 2010 12:39:58 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r74750 r74752 1 2010-12-29 Tony Gentilcore <tonyg@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Assertion failure: element->inDocument() in AsyncScriptRunner::executeScriptSoon() 6 https://bugs.webkit.org/show_bug.cgi?id=51067 7 8 * fast/dom/HTMLScriptElement/move-in-beforeload-expected.txt: Added. 9 * fast/dom/HTMLScriptElement/move-in-beforeload.html: Added. 10 * fast/dom/HTMLScriptElement/remove-in-beforeload-expected.txt: Added. 11 * fast/dom/HTMLScriptElement/remove-in-beforeload.html: Added. 12 1 13 2010-12-29 Mihai Parparita <mihaip@chromium.org> 2 14 -
trunk/WebCore/ChangeLog
r74745 r74752 1 2010-12-29 Tony Gentilcore <tonyg@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Assertion failure: element->inDocument() in AsyncScriptRunner::executeScriptSoon() 6 https://bugs.webkit.org/show_bug.cgi?id=51067 7 8 Typically when a script element is removed from the document, the cached script 9 client is removed. However, during the before load event, the cached script client 10 hasn't been created yet so it can't be removed. 11 12 This patch handles that case by explicitly checking if the script element was 13 removed during the beforeload event. Also, it avoids caching the Document references 14 over the arbitrary script execution in the before load event. 15 16 Test: fast/dom/HTMLScriptElement/move-in-beforeload.html 17 fast/dom/HTMLScriptElement/remove-in-beforeload.html 18 19 * dom/ScriptElement.cpp: 20 (WebCore::ScriptElement::requestScript): 21 1 22 2010-12-29 Alexander Pavlov <apavlov@chromium.org> 2 23 -
trunk/WebCore/dom/ScriptElement.cpp
r73436 r74752 146 146 void ScriptElement::requestScript(const String& sourceUrl) 147 147 { 148 Document* document = m_element->document();149 150 148 // FIXME: Eventually we'd like to evaluate scripts which are inserted into a 151 149 // viewless document but this'll do for now. 152 150 // See http://bugs.webkit.org/show_bug.cgi?id=5727 153 if (!document->frame()) 154 return; 155 151 if (!m_element->document()->frame()) 152 return; 153 154 RefPtr<Document> originalDocument = m_element->document(); 156 155 if (!m_element->dispatchBeforeLoadEvent(sourceUrl)) 157 156 return; 157 if (!m_element->inDocument() || m_element->document() != originalDocument) 158 return; 158 159 159 160 ASSERT(!m_cachedScript); 160 m_cachedScript = document->cachedResourceLoader()->requestScript(sourceUrl, scriptCharset());161 m_cachedScript = m_element->document()->cachedResourceLoader()->requestScript(sourceUrl, scriptCharset()); 161 162 m_isExternalScript = true; 162 163
Note: See TracChangeset
for help on using the changeset viewer.