Changeset 64036 in webkit
- Timestamp:
- Jul 26, 2010 1:53:50 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r64027 r64036 1 2009-10-30 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Use the default timeout interval for JS as the HTML tokenizer delay for setHtml() 6 7 This ensures that long-running JavaScript (for example due to a modal alert() dialog), 8 will not trigger a deferred load after only 500ms (the default tokenizer delay) while 9 still giving a reasonable timeout (10 seconds) to prevent deadlock. 10 11 https://bugs.webkit.org/show_bug.cgi?id=29381 12 13 * runtime/TimeoutChecker.h: Add getter for the timeout interval 14 1 15 2010-07-25 Patrick Gansterer <paroga@paroga.com> 2 16 -
trunk/JavaScriptCore/runtime/TimeoutChecker.h
r41126 r64036 41 41 42 42 void setTimeoutInterval(unsigned timeoutInterval) { m_timeoutInterval = timeoutInterval; } 43 unsigned timeoutInterval() const { return m_timeoutInterval; } 43 44 44 45 unsigned ticksUntilNextCheck() { return m_ticksUntilNextCheck; } -
trunk/WebKit/qt/Api/qwebframe.cpp
r62903 r64036 785 785 The \a html is loaded immediately; external objects are loaded asynchronously. 786 786 787 If a script in the \a html runs longer than the default script timeout (currently 10 seconds), 788 for example due to being blocked by a modal JavaScript alert dialog, this method will return 789 as soon as possible after the timeout and any subsequent \a html will be loaded asynchronously. 790 787 791 When using this method WebKit assumes that external resources such as JavaScript programs or style 788 792 sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external -
trunk/WebKit/qt/ChangeLog
r63974 r64036 1 2009-10-30 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Use the default timeout interval for JS as the HTML tokenizer delay for setHtml() 6 7 This ensures that long-running JavaScript (for example due to a modal alert() dialog), 8 will not trigger a deferred load after only 500ms (the default tokenizer delay) while 9 still giving a reasonable timeout (10 seconds) to prevent deadlock. 10 11 https://bugs.webkit.org/show_bug.cgi?id=29381 12 13 * Api/qwebframe.cpp: Document the behaviour 14 * WebCoreSupport/FrameLoaderClientQt.cpp: set the custom tokenizer delay for substitute loads 15 * tests/qwebframe/tst_qwebframe.cpp: Add test 16 1 17 2010-07-23 David Boddie <dboddie@trolltech.com> 2 18 -
trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
r63191 r64036 40 40 #include "DocumentLoader.h" 41 41 #include "HitTestResult.h" 42 #include "JSDOMWindowBase.h" 42 43 #include "MIMETypeRegistry.h" 43 44 #include "MouseEvent.h" … … 880 881 { 881 882 RefPtr<DocumentLoader> loader = DocumentLoader::create(request, substituteData); 882 if (!deferMainResourceDataLoad || substituteData.isValid()) 883 if (!deferMainResourceDataLoad || substituteData.isValid()) { 883 884 loader->setDeferMainResourceDataLoad(false); 885 // Use the default timeout interval for JS as the HTML tokenizer delay. This ensures 886 // that long-running JavaScript will still allow setHtml() to be synchronous, while 887 // still giving a reasonable timeout to prevent deadlock. 888 double delay = JSDOMWindowBase::commonJSGlobalData()->timeoutChecker.timeoutInterval() / 1000.0f; 889 m_frame->page()->setCustomHTMLTokenizerTimeDelay(delay); 890 } else 891 m_frame->page()->setCustomHTMLTokenizerTimeDelay(-1); 884 892 return loader.release(); 885 893 } -
trunk/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
r62898 r64036 602 602 void setHtmlWithResource(); 603 603 void setHtmlWithBaseURL(); 604 void setHtmlWithJSAlert(); 604 605 void ipv6HostEncoding(); 605 606 void metaData(); … … 2556 2557 } 2557 2558 2559 class MyPage : public QWebPage 2560 { 2561 public: 2562 MyPage() : QWebPage(), alerts(0) {} 2563 int alerts; 2564 2565 protected: 2566 virtual void javaScriptAlert(QWebFrame*, const QString& msg) 2567 { 2568 alerts++; 2569 QCOMPARE(msg, QString("foo")); 2570 // Should not be enough to trigger deferred loading, since we've upped the HTML 2571 // tokenizer delay in the Qt frameloader. See HTMLTokenizer::continueProcessing() 2572 QTest::qWait(1000); 2573 } 2574 }; 2575 2576 void tst_QWebFrame::setHtmlWithJSAlert() 2577 { 2578 QString html("<html><head></head><body><script>alert('foo');</script><p>hello world</p></body></html>"); 2579 MyPage page; 2580 m_view->setPage(&page); 2581 page.mainFrame()->setHtml(html); 2582 QCOMPARE(page.alerts, 1); 2583 QCOMPARE(m_view->page()->mainFrame()->toHtml(), html); 2584 } 2585 2558 2586 class TestNetworkManager : public QNetworkAccessManager 2559 2587 {
Note: See TracChangeset
for help on using the changeset viewer.