Changeset 58112 in webkit
- Timestamp:
- Apr 22, 2010 1:12:20 PM (14 years ago)
- Location:
- trunk/WebKit/qt
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/qt/Api/qwebpage.cpp
r58038 r58112 1885 1885 1886 1886 /*! 1887 This function is called whenever WebKit encounters a HTML object element with type "application/x-qt-plugin". 1888 The \a classid, \a url, \a paramNames and \a paramValues correspond to the HTML object element attributes and1889 c hild elements to configure the embeddable object.1887 This function is called whenever WebKit encounters a HTML object element with type "application/x-qt-plugin". It is 1888 called regardless of the value of QWebSettings::PluginsEnabled. The \a classid, \a url, \a paramNames and \a paramValues 1889 correspond to the HTML object element attributes and child elements to configure the embeddable object. 1890 1890 */ 1891 1891 QObject *QWebPage::createPlugin(const QString &classid, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues) -
trunk/WebKit/qt/Api/qwebsettings.cpp
r58072 r58112 299 299 \l{QWebSettings::PluginsEnabled}{PluginsEnabled} attribute. For many applications, 300 300 this attribute is enabled for all pages by setting it on the 301 \l{globalSettings()}{global settings object}. 301 \l{globalSettings()}{global settings object}. QtWebKit will always ignore this setting 302 \when processing Qt plugins. The decision to allow a Qt plugin is made by the client 303 \in its reimplementation of QWebPage::createPlugin. 302 304 303 305 \section1 Web Application Support … … 368 370 \value JavaEnabled Enables or disables Java applets. 369 371 Currently Java applets are not supported. 370 \value PluginsEnabled Enables or disables plugins in Web pages. 372 \value PluginsEnabled Enables or disables plugins in Web pages. Qt plugins 373 with a mimetype such as "application/x-qt-plugin" are not affected by this setting. 371 374 \value PrivateBrowsingEnabled Private browsing prevents WebKit from 372 375 recording visited pages in the history and storing web page icons. -
trunk/WebKit/qt/ChangeLog
r58111 r58112 1 2010-04-22 Robert Hogan <robert@webkit.org> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] Fix createPlugin() tests in tst_qwebpage to match behaviour of Qt plugins 6 when PluginsEnabled is false. 7 8 tst_qwebpage should have been updated as part of r56662. 9 (See https://bugs.webkit.org/show_bug.cgi?id=32196) 10 11 Updated documentation of QWebPage::createPlugin and QWebSetting::pluginsEnabled 12 to match the new behaviour. 13 14 * Api/qwebpage.cpp: Update docs. 15 * Api/qwebsettings.cpp: Update docs. 16 * tests/qwebpage/tst_qwebpage.cpp: 17 (createPlugin): 18 (tst_QWebPage::createPluginWithPluginsEnabled): 19 (tst_QWebPage::createPluginWithPluginsDisabled): 20 1 21 2010-04-22 Dave Moore <davemoore@chromium.org> 2 22 -
trunk/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
r57433 r58112 82 82 void contextMenuCrash(); 83 83 void database(); 84 void createPlugin(); 84 void createPluginWithPluginsEnabled(); 85 void createPluginWithPluginsDisabled(); 85 86 void destroyPlugin_data(); 86 87 void destroyPlugin(); … … 520 521 }; 521 522 522 void tst_QWebPage::createPlugin()523 { 524 QSignalSpy loadSpy( m_view, SIGNAL(loadFinished(bool)));525 526 PluginPage* newPage = new PluginPage( m_view);527 m_view->setPage(newPage);528 529 // plugins not enabled by default, so the plugin shouldn't be loaded530 m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>"));523 static void createPlugin(QWebView *view) 524 { 525 QSignalSpy loadSpy(view, SIGNAL(loadFinished(bool))); 526 527 PluginPage* newPage = new PluginPage(view); 528 view->setPage(newPage); 529 530 // type has to be application/x-qt-plugin 531 view->setHtml(QString("<html><body><object type='application/x-foobarbaz' classid='pushbutton' id='mybutton'/></body></html>")); 531 532 QTRY_COMPARE(loadSpy.count(), 1); 532 533 QCOMPARE(newPage->calls.count(), 0); 533 534 534 m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, true); 535 536 // type has to be application/x-qt-plugin 537 m_view->setHtml(QString("<html><body><object type='application/x-foobarbaz' classid='pushbutton' id='mybutton'/></body></html>")); 535 view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>")); 538 536 QTRY_COMPARE(loadSpy.count(), 2); 539 QCOMPARE(newPage->calls.count(), 0);540 541 m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>"));542 QTRY_COMPARE(loadSpy.count(), 3);543 537 QCOMPARE(newPage->calls.count(), 1); 544 538 { … … 571 565 QString::fromLatin1("function clicked() {\n [native code]\n}")); 572 566 573 m_view->setHtml(QString("<html><body><table>"567 view->setHtml(QString("<html><body><table>" 574 568 "<tr><object type='application/x-qt-plugin' classid='lineedit' id='myedit'/></tr>" 575 569 "<tr><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></tr>" 576 570 "</table></body></html>"), QUrl("http://foo.bar.baz")); 577 QTRY_COMPARE(loadSpy.count(), 4);571 QTRY_COMPARE(loadSpy.count(), 3); 578 572 QCOMPARE(newPage->calls.count(), 2); 579 573 { … … 607 601 QVERIFY(ci.returnValue->inherits("QPushButton")); 608 602 } 609 603 } 604 605 void tst_QWebPage::createPluginWithPluginsEnabled() 606 { 607 m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, true); 608 createPlugin(m_view); 609 } 610 611 void tst_QWebPage::createPluginWithPluginsDisabled() 612 { 613 // Qt Plugins should be loaded by QtWebKit even when PluginsEnabled is 614 // false. The client decides whether a Qt plugin is enabled or not when 615 // it decides whether or not to instantiate it. 610 616 m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, false); 611 612 m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>")); 613 QTRY_COMPARE(loadSpy.count(), 5); 614 QCOMPARE(newPage->calls.count(), 0); 615 } 616 617 createPlugin(m_view); 618 } 617 619 618 620 // Standard base class for template PluginTracerPage. In tests it is used as interface.
Note: See TracChangeset
for help on using the changeset viewer.