Changeset 120108 in webkit
- Timestamp:
- Jun 12, 2012 1:20:57 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r120107 r120108 1 2012-06-12 Shrey Banga <banga@chromium.org> 2 3 HTML parser should yield more to improve perceived page load time 4 https://bugs.webkit.org/show_bug.cgi?id=86165 5 6 Added test for parser yield times after seeing a script 7 8 Reviewed by Tony Gentilcore. 9 10 * fast/parser/parser-yield-timing-expected.txt: Added. 11 * fast/parser/parser-yield-timing.html: Added. 12 * http/tests/loading/gmail-assert-on-load-expected.txt: The test was added 13 for an assert that failed on debug builds when an iframe removed itself 14 from its parent window after blocking for 1 second. In previous builds, 15 the destroyIt() function was called without yielding to the event loop, 16 which lead to didFailLoadWithError being called. The fix for bug 86165 17 ensures that we yield after executing the script, which leads to 18 didHandleOnloadEventsForFrame being called instead. This is the cause 19 of the change in output of the test. The test still successfully removes 20 the iframe and since no asserts fail in the debug build, we should consider 21 it as passing. 22 23 1 24 2012-06-12 Pablo Flouret <pablof@motorola.com> 2 25 -
trunk/LayoutTests/http/tests/loading/gmail-assert-on-load-expected.txt
r61234 r120108 5 5 frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame 6 6 frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame 7 frame "<!--framePath //<!--frame0-->-->" - didFailLoadWithError 7 main frame - didHandleOnloadEventsForFrame 8 8 main frame - didFinishLoadForFrame 9 9 This test provokes HTMLTokenizer::timerFired to be called and from within timerFired we want to call WebCore::pageDestroyed. -
trunk/Source/WebCore/ChangeLog
r120103 r120108 1 2012-06-12 Shrey Banga <banga@chromium.org> 2 3 HTML parser should yield more to improve perceived page load time 4 https://bugs.webkit.org/show_bug.cgi?id=86165 5 6 Reviewed by Tony Gentilcore. 7 8 Test: fast/events/event-yield-timing.html 9 10 We want the parser to yield at least every 500ms to keep the page somewhat responsive and allow painting. 11 Since it would be too expensive to check the time after each token, the previous heuristic was to check every 4,096 tokens. 12 That works fine for most tokens, but a script may spend an arbitrary amount of time executing. 13 14 This patch fixes the issue by causing the parser to check the elapsed time immediately after executing a script. 15 16 * html/parser/HTMLParserScheduler.cpp: 17 (WebCore::HTMLParserScheduler::checkForYieldBeforeScript): 18 * html/parser/HTMLParserScheduler.h: 19 (WebCore::PumpSession::PumpSession): 20 (PumpSession): 21 (WebCore::HTMLParserScheduler::checkForYieldBeforeToken): 22 1 23 2012-06-12 Sami Kyostila <skyostil@chromium.org> 2 24 -
trunk/Source/WebCore/html/parser/HTMLParserScheduler.cpp
r95901 r120108 96 96 if (needsFirstPaint && document->isLayoutTimerActive()) 97 97 session.needsYield = true; 98 session.didSeeScript = true; 98 99 } 99 100 -
trunk/Source/WebCore/html/parser/HTMLParserScheduler.h
r95901 r120108 48 48 , startTime(0) 49 49 , needsYield(false) 50 , didSeeScript(false) 50 51 { 51 52 } … … 54 55 double startTime; 55 56 bool needsYield; 57 bool didSeeScript; 56 58 }; 57 59 … … 68 70 void checkForYieldBeforeToken(PumpSession& session) 69 71 { 70 if (session.processedTokens > m_parserChunkSize ) {72 if (session.processedTokens > m_parserChunkSize || session.didSeeScript) { 71 73 // currentTime() can be expensive. By delaying, we avoided calling 72 74 // currentTime() when constructing non-yielding PumpSessions. … … 75 77 76 78 session.processedTokens = 0; 79 session.didSeeScript = false; 80 77 81 double elapsedTime = currentTime() - session.startTime; 78 82 if (elapsedTime > m_parserTimeLimit)
Note: See TracChangeset
for help on using the changeset viewer.