Changeset 77212 in webkit
- Timestamp:
- Jan 31, 2011 8:34:42 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r77211 r77212 1 2011-01-31 No'am Rosenthal <noam.rosenthal@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] QWebElements example from QtWebKit Bridge documentation does not work at all 6 https://bugs.webkit.org/show_bug.cgi?id=46748 7 8 This problem disappears when we register QWebElement using qRegisterMetaType, which we now do in QtInstance. 9 Added a regression test to tst_QWebFrame. 10 11 * bridge/qt/qt_instance.cpp: 12 (JSC::Bindings::QtInstance::QtInstance): 13 1 14 2011-01-27 MORITA Hajime <morrita@google.com> 2 15 -
trunk/Source/WebCore/bridge/qt/qt_instance.cpp
r77156 r77212 35 35 #include <qmetaobject.h> 36 36 #include <qmetatype.h> 37 #include <qwebelement.h> 37 38 38 39 namespace JSC { … … 85 86 , m_ownership(ownership) 86 87 { 88 // This is a good place to register Qt metatypes that are in the QtWebKit module, as this is class will initialize if we have a QObject bridge. 89 qRegisterMetaType<QWebElement>(); 87 90 } 88 91 -
trunk/Source/WebKit/qt/ChangeLog
r77183 r77212 1 2011-01-31 No'am Rosenthal <noam.rosenthal@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] QWebElements example from QtWebKit Bridge documentation does not work at all 6 https://bugs.webkit.org/show_bug.cgi?id=46748 7 8 Problem was that we need to register QWebElement's variant-type to Qt's meta type system at some point. 9 This wasn't caught by previous tests inside tst_QWebFrame because it only appears when there's also a QWebElement property. 10 Added a regression test to tst_QWebFrame. 11 12 * tests/qwebframe/tst_qwebframe.cpp: 13 (MyWebElementSlotOnlyObject::doSomethingWithWebElement): 14 (MyWebElementSlotOnlyObject::tagName): 15 1 16 2011-01-31 Srikumar Bonda <srikumar.b@gmail.com> 2 17 -
trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
r75467 r77212 515 515 }; 516 516 517 class MyWebElementSlotOnlyObject : public QObject { 518 Q_OBJECT 519 Q_PROPERTY(QString tagName READ tagName) 520 public slots: 521 void doSomethingWithWebElement(const QWebElement& element) 522 { 523 m_tagName = element.tagName(); 524 } 525 526 public: 527 QString tagName() const 528 { 529 return m_tagName; 530 } 531 private: 532 QString m_tagName; 533 }; 534 517 535 class MyOtherQObject : public MyQObject 518 536 { … … 585 603 void findChildren(); 586 604 void overloadedSlots(); 605 void webElementSlotOnly(); 587 606 void enumerate_data(); 588 607 void enumerate(); … … 3258 3277 } 3259 3278 3279 void tst_QWebFrame::webElementSlotOnly() 3280 { 3281 MyWebElementSlotOnlyObject object; 3282 m_page->mainFrame()->setHtml("<html><head><body></body></html>"); 3283 m_page->mainFrame()->addToJavaScriptWindowObject("myWebElementSlotObject", &object); 3284 evalJS("myWebElementSlotObject.doSomethingWithWebElement(document.body)"); 3285 QCOMPARE(evalJS("myWebElementSlotObject.tagName"), QString("BODY")); 3286 } 3287 3260 3288 QTEST_MAIN(tst_QWebFrame) 3261 3289 #include "tst_qwebframe.moc"
Note: See TracChangeset
for help on using the changeset viewer.