Changeset 61604 in webkit
- Timestamp:
- Jun 22, 2010 12:04:34 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r61602 r61604 1 2010-06-21 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Save the insertion point before beforeload events 6 https://bugs.webkit.org/show_bug.cgi?id=40973 7 8 Update expected results to show the proper document.write order. 9 10 * fast/tokenizer/write-before-load-expected.txt: 11 1 12 2010-06-21 Adam Barth <abarth@webkit.org> 2 13 -
trunk/LayoutTests/fast/tokenizer/write-before-load-expected.txt
r61602 r61604 1 1 2 7 34561 1 2 3 4 5 6 7 -
trunk/LayoutTests/fast/tokenizer/write-before-load.html
r61602 r61604 7 7 { 8 8 document.write("<script>document.write(" + number + ")</scr" + 9 "ipt> <script>document.write(" + (number + 1) + ")</scr" + "ipt>")9 "ipt> <script>document.write(" + (number + 1) + ")</scr" + "ipt> ") 10 10 } 11 11 </script> -
trunk/WebCore/ChangeLog
r61602 r61604 1 2010-06-21 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Save the insertion point before beforeload events 6 https://bugs.webkit.org/show_bug.cgi?id=40973 7 8 We need to save the insertion point before dispatching the beforeload 9 event in case someone decides to document.write during beforeload. 10 Prior to this patch, such writes would pump the lexer too much and 11 tokenize the rest of the document before executing the script. 12 13 * html/HTML5DocumentParser.cpp: 14 (WebCore::HTML5DocumentParser::dispatchBeforeLoad): 15 * html/HTML5DocumentParser.h: 16 * html/HTML5ScriptRunner.cpp: 17 (WebCore::HTML5ScriptRunner::requestScript): 18 * html/HTML5ScriptRunnerHost.h: 19 1 20 2010-06-21 Adam Barth <abarth@webkit.org> 2 21 -
trunk/WebCore/html/HTML5DocumentParser.cpp
r61470 r61604 404 404 } 405 405 406 bool HTML5DocumentParser::dispatchBeforeLoad(Element* script, const AtomicString& srcValue) 407 { 408 InsertionPointRecord savedInsertionPoint(m_input); 409 return script->dispatchBeforeLoadEvent(srcValue); 410 } 411 406 412 void HTML5DocumentParser::notifyFinished(CachedResource* cachedResource) 407 413 { -
trunk/WebCore/html/HTML5DocumentParser.h
r61470 r61604 73 73 virtual bool shouldLoadExternalScriptFromSrc(const AtomicString&); 74 74 virtual void executeScript(const ScriptSourceCode&); 75 virtual bool dispatchBeforeLoad(Element* script, const AtomicString& srcValue); 75 76 76 77 // CachedResourceClient -
trunk/WebCore/html/HTML5ScriptRunner.cpp
r61602 r61604 233 233 if (!m_host->shouldLoadExternalScriptFromSrc(srcValue)) 234 234 return; 235 236 235 // FIXME: We need to resolve the url relative to the element. 237 if (! script->dispatchBeforeLoadEvent(srcValue)) // Part of HTML5?236 if (!m_host->dispatchBeforeLoad(script, srcValue)) 238 237 return; 239 238 m_parsingBlockingScript.element = script; -
trunk/WebCore/html/HTML5ScriptRunnerHost.h
r61374 r61604 31 31 class AtomicString; 32 32 class CachedResource; 33 class Element; 33 34 class ScriptSourceCode; 34 35 … … 46 47 // Implementors should handle possible rentry before/after calling ScriptController::executeScript 47 48 virtual void executeScript(const ScriptSourceCode&) = 0; 49 virtual bool dispatchBeforeLoad(Element* script, const AtomicString& srcValue) = 0; 48 50 }; 49 51
Note: See TracChangeset
for help on using the changeset viewer.