Changeset 39173 in webkit
- Timestamp:
- Dec 10, 2008, 8:41:50 AM (16 years ago)
- Location:
- trunk/WebKit/qt
- Files:
-
- 14 edited
-
Api/qwebdatabase.cpp (modified) (3 diffs)
-
Api/qwebdatabase.h (modified) (1 diff)
-
Api/qwebframe.cpp (modified) (6 diffs)
-
Api/qwebframe.h (modified) (2 diffs)
-
Api/qwebpage.cpp (modified) (6 diffs)
-
Api/qwebpage.h (modified) (4 diffs)
-
Api/qwebsecurityorigin.cpp (modified) (1 diff)
-
Api/qwebsettings.cpp (modified) (3 diffs)
-
Api/qwebsettings.h (modified) (1 diff)
-
ChangeLog (modified) (1 diff)
-
QtLauncher/main.cpp (modified) (1 diff)
-
WebCoreSupport/ChromeClientQt.cpp (modified) (2 diffs)
-
WebCoreSupport/EditorClientQt.cpp (modified) (1 diff)
-
tests/qwebpage/tst_qwebpage.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/qt/Api/qwebdatabase.cpp
r38904 r39173 101 101 102 102 /*! 103 Returns the path to the web database on disk.103 Returns the file name of the web database. 104 104 105 The pathcan be used to access the database through the QtSql database module, for example:105 The name can be used to access the database through the QtSql database module, for example: 106 106 \code 107 107 QWebDatabase webdb = ... 108 108 QSqlDatabase sqldb = QSqlDatabase::addDatabase("QSQLITE", "myconnection"); 109 sqldb.setDatabaseName(webdb. absoluteFilePath());109 sqldb.setDatabaseName(webdb.fileName()); 110 110 if (sqldb.open()) { 111 111 QStringList tables = sqldb.tables(); … … 117 117 is not very efficient because Sqlite is used as WebKit's database backend. 118 118 */ 119 QString QWebDatabase:: absoluteFilePath() const119 QString QWebDatabase::fileName() const 120 120 { 121 121 return DatabaseTracker::tracker().fullPathForDatabase(d->origin.get(), d->name, false); … … 136 136 will be destroyed. 137 137 */ 138 void QWebDatabase::remove ()138 void QWebDatabase::removeDatabase(const QWebDatabase &db) 139 139 { 140 DatabaseTracker::tracker().deleteDatabase(d ->origin.get(),d->name);140 DatabaseTracker::tracker().deleteDatabase(db.d->origin.get(), db.d->name); 141 141 } 142 142 -
trunk/WebKit/qt/Api/qwebdatabase.h
r38400 r39173 43 43 qint64 expectedSize() const; 44 44 qint64 size() const; 45 QString absoluteFilePath() const;45 QString fileName() const; 46 46 QWebSecurityOrigin origin() const; 47 void remove(); 47 48 static void removeDatabase(const QWebDatabase &db); 48 49 49 50 private: -
trunk/WebKit/qt/Api/qwebframe.cpp
r38904 r39173 304 304 \endtable 305 305 306 This function returns a multi map to support multiple meta tags with the same name attribute.306 This function returns a multi map to support multiple meta tags with the same attribute name. 307 307 */ 308 308 QMultiMap<QString, QString> QWebFrame::metaData() const … … 663 663 \a dx and \a dy may be negative. 664 664 665 \sa QWebFrame::scroll Offset666 */ 667 668 void QWebFrame::scroll(int dx, int dy) const665 \sa QWebFrame::scrollPosition 666 */ 667 668 void QWebFrame::scroll(int dx, int dy) 669 669 { 670 670 if (!d->frame->view()) … … 675 675 676 676 /*! 677 \property QWebFrame::scrollOffset 678 \brief The offset from the start this frame is currently scrolled to. 679 */ 680 681 QPoint QWebFrame::scrollOffset() const 677 \property QWebFrame::scrollPosition 678 \since 4.5 679 \brief the position the frame is currently scrolled to. 680 */ 681 682 QPoint QWebFrame::scrollPosition() const 682 683 { 683 684 if (!d->frame->view()) … … 688 689 } 689 690 690 void QWebFrame::setScroll Offset(const QPoint &offset) const691 { 692 QPoint current = scroll Offset();693 int dx = offset.x() - current.x();694 int dy = offset.y() - current.y();691 void QWebFrame::setScrollPosition(const QPoint &pos) 692 { 693 QPoint current = scrollPosition(); 694 int dx = pos.x() - current.x(); 695 int dy = pos.y() - current.y(); 695 696 scroll(dx, dy); 696 697 } … … 1027 1028 This signal is emitted shortly before the history of navigated pages 1028 1029 is changed, for example when navigating back in the history. 1030 1031 The \a item parameter refers to the currently displayed frame. 1029 1032 1030 1033 A potential use-case for this signal is to store custom data in … … 1147 1150 /*! 1148 1151 \since 4.5 1149 Returns the bounding boxof the element.1152 Returns the bounding rect of the element. 1150 1153 */ 1151 1154 QRect QWebHitTestResult::boundingRect() const -
trunk/WebKit/qt/Api/qwebframe.h
r38396 r39173 106 106 Q_PROPERTY(QIcon icon READ icon) 107 107 Q_PROPERTY(QSize contentsSize READ contentsSize) 108 Q_PROPERTY(QPoint scroll Offset READ scrollOffset WRITE setScrollOffset)108 Q_PROPERTY(QPoint scrollPosition READ scrollPosition WRITE setScrollPosition) 109 109 private: 110 110 QWebFrame(QWebPage *parent, QWebFrameData *frameData); … … 150 150 int scrollBarMaximum(Qt::Orientation orientation) const; 151 151 152 void scroll(int, int) const;153 QPoint scroll Offset() const;154 void setScroll Offset(const QPoint &offset) const;152 void scroll(int, int); 153 QPoint scrollPosition() const; 154 void setScrollPosition(const QPoint &pos); 155 155 156 156 void render(QPainter *painter, const QRegion &clip); -
trunk/WebKit/qt/Api/qwebpage.cpp
r39132 r39173 1820 1820 1821 1821 /*! 1822 \property QWebPage:: editable1822 \property QWebPage::contentEditable 1823 1823 \brief whether the content in this QWebPage is editable or not 1824 1824 \since 4.5 … … 1828 1828 \c{contenteditable} attribute set are editable. 1829 1829 */ 1830 void QWebPage::set Editable(bool editable)1830 void QWebPage::setContentEditable(bool editable) 1831 1831 { 1832 1832 if (d->editable != editable) { … … 1848 1848 } 1849 1849 1850 bool QWebPage::is Editable() const1850 bool QWebPage::isContentEditable() const 1851 1851 { 1852 1852 return d->editable; … … 2043 2043 if (extension == ChooseMultipleFilesExtension) { 2044 2044 // FIXME: do not ignore suggestedFiles 2045 QStringList suggestedFiles = reinterpret_cast<const ChooseMultipleFilesExtensionOption*>(option)->suggestedFiles;2045 QStringList suggestedFiles = static_cast<const ChooseMultipleFilesExtensionOption*>(option)->suggestedFileNames; 2046 2046 QStringList names = QFileDialog::getOpenFileNames(d->view, QString::null); 2047 reinterpret_cast<ChooseMultipleFilesExtensionReturn*>(output)->files = names;2047 static_cast<ChooseMultipleFilesExtensionReturn*>(output)->fileNames = names; 2048 2048 return true; 2049 2049 } … … 2472 2472 /*! 2473 2473 \fn void QWebPage::contentsChanged() 2474 2475 This signal is emitted whenever the content changes during editing. 2476 2477 \sa selectedText() 2474 \since 4.5 2475 2476 This signal is emitted whenever the text in form elements changes 2477 as well as other editable content. 2478 2479 \sa contentEditable(), QWebFrame::toHtml(), QWebFrame::toPlainText() 2478 2480 */ 2479 2481 … … 2585 2587 2586 2588 /*! 2587 \fn void QWebPage::exceededDatabaseQuota(QWebFrame* frame, QString databaseName); 2589 \fn void QWebPage::databaseQuotaExceeded(QWebFrame* frame, QString databaseName); 2590 \since 4.5 2588 2591 2589 2592 This signal is emitted whenever a web site is asking to store data to the database \a databaseName -
trunk/WebKit/qt/Api/qwebpage.h
r39132 r39173 68 68 Q_PROPERTY(LinkDelegationPolicy linkDelegationPolicy READ linkDelegationPolicy WRITE setLinkDelegationPolicy) 69 69 Q_PROPERTY(QPalette palette READ palette WRITE setPalette) 70 Q_PROPERTY(bool editable READ isEditable WRITE setEditable)70 Q_PROPERTY(bool contentEditable READ isContentEditable WRITE setContentEditable) 71 71 Q_ENUMS(LinkDelegationPolicy NavigationType WebAction) 72 72 public: … … 229 229 QPalette palette() const; 230 230 231 void set Editable(bool editable);232 bool is Editable() const;231 void setContentEditable(bool editable); 232 bool isContentEditable() const; 233 233 234 234 #ifndef QT_NO_CONTEXTMENU … … 250 250 public: 251 251 QWebFrame *parentFrame; 252 QStringList suggestedFile s;252 QStringList suggestedFileNames; 253 253 }; 254 254 255 255 class ChooseMultipleFilesExtensionReturn : public ExtensionReturn { 256 256 public: 257 QStringList file s;257 QStringList fileNames; 258 258 }; 259 259 … … 288 288 void microFocusChanged(); 289 289 void contentsChanged(); 290 void exceededDatabaseQuota(QWebFrame* frame, QString databaseName);290 void databaseQuotaExceeded(QWebFrame* frame, QString databaseName); 291 291 292 292 protected: -
trunk/WebKit/qt/Api/qwebsecurityorigin.cpp
r38904 r39173 37 37 38 38 QWebSecurityOrigin provides access to the security domains defined by web sites. 39 An origin isconsists of a host name, a scheme, and a port number. Web sites with the same39 An origin consists of a host name, a scheme, and a port number. Web sites with the same 40 40 security origin can access each other's resources for client-side scripting or databases. 41 41 -
trunk/WebKit/qt/Api/qwebsettings.cpp
r39136 r39173 169 169 settings->setZoomsTextOnly(value); 170 170 171 value = attributes.value(QWebSettings::Print BackgroundElements,172 global->attributes.value(QWebSettings::Print BackgroundElements));171 value = attributes.value(QWebSettings::PrintElementBackgrounds, 172 global->attributes.value(QWebSettings::PrintElementBackgrounds)); 173 173 settings->setShouldPrintBackgrounds(value); 174 174 … … 292 292 \value ZoomTextOnly Specifies whether the zoom factor on a frame applies to 293 293 only the text or all content. 294 \value Print BackgroundElements Specifies whether the background color and images294 \value PrintElementBackgrounds Specifies whether the background color and images 295 295 are also drawn when the page is printed. 296 296 */ … … 319 319 d->attributes.insert(QWebSettings::LinksIncludedInFocusChain, true); 320 320 d->attributes.insert(QWebSettings::ZoomTextOnly, false); 321 d->attributes.insert(QWebSettings::Print BackgroundElements, true);321 d->attributes.insert(QWebSettings::PrintElementBackgrounds, true); 322 322 d->attributes.insert(QWebSettings::OfflineStorageDatabaseEnabled, true); 323 323 d->attributes.insert(QWebSettings::OfflineWebApplicationCacheEnabled, true); -
trunk/WebKit/qt/Api/qwebsettings.h
r38396 r39173 61 61 LinksIncludedInFocusChain, 62 62 ZoomTextOnly, 63 Print BackgroundElements,63 PrintElementBackgrounds, 64 64 OfflineStorageDatabaseEnabled, 65 65 OfflineWebApplicationCacheEnabled, -
trunk/WebKit/qt/ChangeLog
r39170 r39173 1 2008-12-10 Holger Hans Peter Freyther <zecke@selfish.org> 2 3 Reviewed by Simon Hausmann. 4 5 API changes discussed with Simon Hausmann, Tor Arne 6 Vestbø, Ariya Hidayat... 7 8 * Api/qwebdatabase.cpp: 9 (QWebDatabase::fileName): 10 (QWebDatabase::removeDatabase): 11 * Api/qwebdatabase.h: 12 * Api/qwebframe.cpp: 13 (QWebFrame::scroll): 14 (QWebFrame::scrollPosition): 15 (QWebFrame::setScrollPosition): 16 * Api/qwebframe.h: 17 * Api/qwebpage.cpp: 18 (QWebPage::setContentEditable): 19 (QWebPage::isContentEditable): 20 (QWebPage::extension): 21 * Api/qwebpage.h: 22 * Api/qwebsecurityorigin.cpp: 23 * Api/qwebsettings.cpp: 24 (QWebSettingsPrivate::apply): 25 (QWebSettings::QWebSettings): 26 * Api/qwebsettings.h: 27 * QtLauncher/main.cpp: 28 (MainWindow::setEditable): 29 * WebCoreSupport/ChromeClientQt.cpp: 30 (WebCore::ChromeClientQt::exceededDatabaseQuota): 31 (WebCore::ChromeClientQt::runOpenPanel): 32 * WebCoreSupport/EditorClientQt.cpp: 33 (WebCore::EditorClientQt::isEditable): 34 * tests/qwebpage/tst_qwebpage.cpp: 35 (tst_QWebPage::database): 36 1 37 2008-12-09 Balazs Kelemen <Kelemen.Balazs.3@stud.u-szeged.hu> 2 38 -
trunk/WebKit/qt/QtLauncher/main.cpp
r39170 r39173 175 175 176 176 void setEditable(bool on) { 177 view->page()->set Editable(on);177 view->page()->setContentEditable(on); 178 178 formatMenuAction->setVisible(on); 179 179 } -
trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
r39132 r39173 389 389 DatabaseTracker::tracker().setQuota(frame->document()->securityOrigin(), quota); 390 390 #endif 391 emit m_webPage-> exceededDatabaseQuota(QWebFramePrivate::kit(frame), databaseName);391 emit m_webPage->databaseQuotaExceeded(QWebFramePrivate::kit(frame), databaseName); 392 392 } 393 393 … … 403 403 if (!fileChooser->filenames().isEmpty()) 404 404 for (int i = 0; i < fileChooser->filenames().size(); ++i) 405 option.suggestedFile s += fileChooser->filenames()[i];405 option.suggestedFileNames += fileChooser->filenames()[i]; 406 406 407 407 QWebPage::ChooseMultipleFilesExtensionReturn output; 408 408 m_webPage->extension(QWebPage::ChooseMultipleFilesExtension, &option, &output); 409 409 410 if (!output.file s.isEmpty()) {410 if (!output.fileNames.isEmpty()) { 411 411 Vector<String> names; 412 for (int i = 0; i < output.file s.count(); ++i)413 names.append(output.file s[i]);412 for (int i = 0; i < output.fileNames.count(); ++i) 413 names.append(output.fileNames.at(i)); 414 414 fileChooser->chooseFiles(names); 415 415 } -
trunk/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
r38738 r39173 247 247 bool EditorClientQt::isEditable() 248 248 { 249 return m_page->is Editable();249 return m_page->isContentEditable(); 250 250 } 251 251 -
trunk/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
r38820 r39173 381 381 382 382 qRegisterMetaType<QWebFrame*>("QWebFrame*"); 383 QSignalSpy spy(m_page, SIGNAL( exceededDatabaseQuota(QWebFrame *, QString)));383 QSignalSpy spy(m_page, SIGNAL(databaseQuotaExceeded(QWebFrame *, QString))); 384 384 m_view->setHtml(QString("<html><head><script>var db; db=openDatabase('testdb', '1.0', 'test database API', 50000); </script></head><body><div></div></body></html>"), QUrl("http://www.myexample.com")); 385 385 QTRY_COMPARE(spy.count(), 1); … … 405 405 QList<QWebDatabase> dbs = origin.databases(); 406 406 if (dbs.count() > 0) { 407 QString file Path = dbs[0].absoluteFilePath();408 QVERIFY(QFile::exists(file Path));409 dbs[0].remove();410 QVERIFY(!QFile::exists(file Path));407 QString fileName = dbs[0].fileName(); 408 QVERIFY(QFile::exists(fileName)); 409 QWebDatabase::removeDatabase(dbs[0]); 410 QVERIFY(!QFile::exists(fileName)); 411 411 } 412 412 QTest::qWait(1000);
Note:
See TracChangeset
for help on using the changeset viewer.