Changeset 561 for trunk/src/3rdparty/webkit/WebKit
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 50 edited
- 97 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/3rdparty/webkit/WebKit/ChangeLog
r2 r561 1 2009-10-27 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Updated license 6 7 * LICENSE: 8 9 2009-10-26 Sam Weinig <sam@webkit.org> 10 11 Reviewed by Anders Carlsson. 12 13 Move some WebView event handling code into its own file, WebViewEventHandling.mm 14 15 * WebKit.xcodeproj/project.pbxproj: 16 17 2009-10-19 John Gregg <johnnyg@google.com> 18 19 Reviewed by Dimitri Glazkov. 20 21 set ENABLE_NOTIFICATIONS=1 for Chromium 22 https://bugs.webkit.org/show_bug.cgi?id=29949 23 24 * chromium/features.gypi: 25 26 2009-10-13 Drew Wilson <atwilson@atwilson-macpro.local> 27 28 Reviewed by David Levin. 29 30 Enable SHARED_WORKERS for Chromium 31 https://bugs.webkit.org/show_bug.cgi?id=30289 32 33 * chromium/features.gypi: 34 Turned on ENABLE_SHARED_WORKERS by default. This doesn't actually turn on 35 SharedWorkers yet, as Chromium overrides this flag in its feature_overrides.gypi. 36 37 2009-10-12 Yaar Schnitman <yaar@chromium.org> 38 39 Reviewed by Dimitri Glazkov. 40 41 Chromium Port - Windows 42 https://bugs.webkit.org/show_bug.cgi?id=29969 43 44 * chromium/DEPS: Added gtest dep required by windows and incremented some of the deps revisions. 45 46 2009-10-06 Simon Fraser <simon.fraser@apple.com> 47 48 Reviewed by Mark Rowe. 49 50 accessibility/media-element.html crashes (and has incorrect result) 51 https://bugs.webkit.org/show_bug.cgi?id=30108 52 53 Fix up the accessibilty label for the newly added fullscreen button, 54 and update the test result accordingly. 55 56 * English.lproj/Localizable.strings: 57 58 2009-10-05 Kevin Decker <kdecker@apple.com> 59 60 Reviewed by Dan Bernstein. 61 62 * WebKit.xcodeproj/project.pbxproj: Add WebPluginHalterClient to the project. 63 64 2009-10-05 Yaar Schnitman <yaar@chromium.org> 65 66 Reviewed by Dimitri Glazkov. 67 68 One of the dependencies' SVN url was missing a @ before the revision number. 69 70 https://bugs.webkit.org/show_bug.cgi?id=30101 71 72 * chromium/DEPS: 73 74 2009-10-05 Pierre d'Herbemont <pdherbemont@webkit.org> 75 76 Reviewed by Simon Fraser 77 78 Support fullscreen in MediaPlayer (Mac) 79 https://bugs.webkit.org/show_bug.cgi?id=26742 80 81 Add new files for video fullscreen. 82 83 * WebKit.xcodeproj/project.pbxproj: 84 85 2009-10-05 Pavel Feldman <pfeldman@chromium.org> 86 87 Reviewed by Timothy Hatcher. 88 89 Web Inspector: add testing harness for Web Inspector. 90 91 https://bugs.webkit.org/show_bug.cgi?id=30010 92 93 * WebKit.xcodeproj/project.pbxproj: 94 95 2009-10-04 Fumitoshi Ukai <ukai@chromium.org> 96 97 Reviewed by Eric Seidel 98 99 Enable Web Sockets in chromium build. 100 https://bugs.webkit.org/show_bug.cgi?id=29917 101 102 * chromium/features.gypi: 103 104 2009-10-02 Yaar Schnitman <yaar@chromium.org> 105 106 Reviewed by Dimitri Glazkov. 107 108 Added gyp_webkit that does a subset of the things gyp_chromium does 109 plus some specialization for an upstream chromium build. 110 111 https://bugs.webkit.org/show_bug.cgi?id=29986 112 113 * chromium/DEPS: Points to gyp_webkit instead of gyp_chromium. 114 * chromium/gyp_webkit: A new python file. 115 116 2009-10-01 Yaar Schnitman <yaar@chromium.org> 117 118 Reviewed by Dimitri Glazkov. 119 120 Make it possible to override the list of feature defines when building 121 downstream. 122 123 https://bugs.webkit.org/show_bug.cgi?id=29979 124 125 * chromium/features.gypi: 126 127 2009-10-01 Yaar Schnitman <yaar@chromium.org> 128 129 Reviewed by Dimitri Glazkov. 130 131 Added windows-specific dependencies, updated some revisions and 132 re-organized file to make revision tracking easier. Also removed 133 extensions/v8 dependency that is no longer needed upstream. 134 135 https://bugs.webkit.org/show_bug.cgi?id=29973 136 137 * chromium/DEPS: 138 139 2009-09-30 Yaar Schnitman <yaar@chromium.org> 140 141 Reviewed by Dimitri Glazkov. 142 143 1. Keeping up with downstream revisions. 144 2. Turning off v8 snapshot build step. 145 146 https://bugs.webkit.org/show_bug.cgi?id=29928 147 148 * chromium/DEPS 149 150 2009-09-29 Brady Eidson <beidson@apple.com> 151 152 Reviewed by John Sullivan. 153 154 WebKit Mac API should provide a delegate interface for global history. 155 <rdar://problem/7042773> and https://webkit.org/b/29904 156 157 * WebKit.xcodeproj/project.pbxproj: 158 159 2009-09-28 Yaar Schnitman <yaar@chromium.org> 160 161 Reviewed by Dimitri Glazkov. 162 163 https://bugs.webkit.org/show_bug.cgi?id=29722 164 165 * chromium/DEPS: Describes the chromium port's dependencies and 166 is used by gclient to fetch them. 167 * chromium/webkit.gyp: Currently only builds webcore but in 168 the future will also build the webkit api. 169 170 2009-09-26 David Kilzer <ddkilzer@apple.com> 171 172 Part 2 of 2: <http://webkit.org/b/29753> DerivedSources.make broken for non-Mac targets 173 174 Reviewed by Darin Adler. 175 176 Fix ENABLE_ORIENTATION_EVENTS for non-Mac platforms. 177 178 * chromium/features.gypi: Added 'ENABLE_ORIENTATION_EVENTS=0' to 179 disable this feature by default. 180 181 2009-09-22 Yaar Schnitman <yaar@chromium.org> 182 183 Reviewed by David Levin. 184 185 Create chromium directory and ported chromium.org's features.gypi for 186 the webkit chromium port. 187 188 https://bugs.webkit.org/show_bug.cgi?id=29617 189 190 * chromium/features.gypi: Added. 191 192 2009-09-21 Dan Bernstein <mitz@apple.com> 193 194 Reviewed by Anders Carlsson. 195 196 <rdar://problem/4137135> iFrame with PDF not being handled correctly on 197 usps.com 198 https://bugs.webkit.org/show_bug.cgi?id=4151 199 200 * WebKit.xcodeproj/project.pbxproj: Added WebPDFDocumentExtras.{h,mm} 201 and WebJSPDFDoc.{h,mm} and changed WebPDFRepresentation to 202 Objective-C++. 203 204 2009-09-07 Steve Block <steveblock@google.com> 205 206 Reviewed by Adam Barth. 207 208 Adds a mock Geolocation service. This will be used to provide predictable behavior of the 209 Geolocation API for use in LayoutTests. Later changes will integrate the the mock 210 Geolocation service with DumpRenderTree. 211 https://bugs.webkit.org/show_bug.cgi?id=28264 212 213 * WebKit.xcodeproj/project.pbxproj: Modified. Adds WebGeolocationMock. 214 215 2009-09-03 John Sullivan <sullivan@apple.com> 216 217 Reviewed by Adam Roben 218 219 * StringsNotToBeLocalized.txt: 220 Brought this file up to date. 221 222 2009-08-31 Mark Rowe <mrowe@apple.com> 223 224 Rubber-stamped by Beth Dakin. 225 226 Remove WebViewEditingContextMenu.nib and WebViewEditingContextMenuOld.nib. 227 We stopped using these back in r18592 when we switched over to context menus 228 driven by WebCore. 229 230 * English.lproj/WebViewEditingContextMenu.nib/classes.nib: Removed. 231 * English.lproj/WebViewEditingContextMenu.nib/info.nib: Removed. 232 * English.lproj/WebViewEditingContextMenu.nib/objects.nib: Removed. 233 * English.lproj/WebViewEditingContextMenuOld.nib/classes.nib: Removed. 234 * English.lproj/WebViewEditingContextMenuOld.nib/info.nib: Removed. 235 * English.lproj/WebViewEditingContextMenuOld.nib/objects.nib: Removed. 236 * WebKit.xcodeproj/project.pbxproj: 237 238 2009-08-28 Chris Fleizach <cfleizach@apple.com> 239 240 Reviewed by John Sullivan. 241 242 update-webkit-localizable-strings script can no longer complete 243 https://bugs.webkit.org/show_bug.cgi?id=28792 244 245 * English.lproj/Localizable.strings: 246 247 2009-08-27 John Sullivan <sullivan@apple.com> 248 249 * StringsNotToBeLocalized.txt: 250 Brought up to date, other than the problem mentioned in https://bugs.webkit.org/show_bug.cgi?id=28792 251 252 2009-08-25 Eric Carlson <eric.carlson@apple.com> 253 254 Reviewed by Oliver Hunt. 255 256 <video> and <audio> controller should be accessible 257 https://bugs.webkit.org/show_bug.cgi?id=28081 258 259 Add localized strings for media controller accessiblility. 260 261 * English.lproj/Localizable.strings: 262 263 2009-08-20 Chris Fleizach <cfleizach@apple.com> 264 265 Reviewed by Darin Adler. 266 267 Enable various "grouping" ARIA roles 268 https://bugs.webkit.org/show_bug.cgi?id=28486 269 270 * English.lproj/Localizable.strings: 271 272 2009-08-18 Drew Wilson <atwilson@google.com> 273 274 Reviewed by Eric Seidel. 275 276 Need to extend DumpRenderTree to expose number of worker threads. 277 https://bugs.webkit.org/show_bug.cgi?id=28292 278 279 * WebKit.xcodeproj/project.pbxproj: 280 Added WebWorkersPrivate APIs to mac WebKit to expose workerThreadCount() for DumpRenderTree. 281 282 2009-08-06 Mark Rowe <mrowe@apple.com> 283 284 Rubber-stamped by Sam Weinig. 285 286 Add explicit dependencies for our build verification scripts to ensure that they always run after linking has completed. 287 288 * WebKit.xcodeproj/project.pbxproj: 289 290 2009-08-06 Mark Rowe <mrowe@apple.com> 291 292 Bring a little order to our otherwise out of control lives. 293 294 * WebKit.xcodeproj/project.pbxproj: 295 296 2009-08-06 Mark Rowe <mrowe@apple.com> 297 298 Build fix. 299 300 Don't attempt to build a file that Anders just deleted. 301 302 * WebKit.xcodeproj/project.pbxproj: 303 304 2009-07-29 David Kilzer <ddkilzer@apple.com> 305 306 <http://webkit.org/b/27788> Don't export WebPluginController.h as a private header 307 308 Reviewed by Mark Rowe. 309 310 WebPluginController.h includes WebPluginContainerCheck.h, which 311 is not a private header. Since WebPluginController.h doesn't 312 appear to be used anywhere, remove its private header status. 313 314 * WebKit.xcodeproj/project.pbxproj: Remove private header 315 attribute from WebPluginController.h. 316 317 2009-07-28 Maxime Simon <simon.maxime@gmail.com> 318 319 Reviewed by David Levin. 320 321 Added FrameLoaderClient for Haiku WebCore support. 322 https://bugs.webkit.org/show_bug.cgi?id=26952 323 324 * haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp: Added. 325 (WebCore::FrameLoaderClientHaiku::FrameLoaderClientHaiku): 326 (WebCore::FrameLoaderClientHaiku::setFrame): 327 (WebCore::FrameLoaderClientHaiku::setWebView): 328 (WebCore::FrameLoaderClientHaiku::detachFrameLoader): 329 (WebCore::FrameLoaderClientHaiku::hasWebView): 330 (WebCore::FrameLoaderClientHaiku::hasBackForwardList): 331 (WebCore::FrameLoaderClientHaiku::resetBackForwardList): 332 (WebCore::FrameLoaderClientHaiku::provisionalItemIsTarget): 333 (WebCore::FrameLoaderClientHaiku::makeRepresentation): 334 (WebCore::FrameLoaderClientHaiku::forceLayout): 335 (WebCore::FrameLoaderClientHaiku::forceLayoutForNonHTML): 336 (WebCore::FrameLoaderClientHaiku::updateHistoryForCommit): 337 (WebCore::FrameLoaderClientHaiku::updateHistoryForBackForwardNavigation): 338 (WebCore::FrameLoaderClientHaiku::updateHistoryForReload): 339 (WebCore::FrameLoaderClientHaiku::updateHistoryForStandardLoad): 340 (WebCore::FrameLoaderClientHaiku::updateHistoryForInternalLoad): 341 (WebCore::FrameLoaderClientHaiku::updateHistoryAfterClientRedirect): 342 (WebCore::FrameLoaderClientHaiku::setCopiesOnScroll): 343 (WebCore::FrameLoaderClientHaiku::tokenForLoadErrorReset): 344 (WebCore::FrameLoaderClientHaiku::resetAfterLoadError): 345 (WebCore::FrameLoaderClientHaiku::doNotResetAfterLoadError): 346 (WebCore::FrameLoaderClientHaiku::willCloseDocument): 347 (WebCore::FrameLoaderClientHaiku::detachedFromParent2): 348 (WebCore::FrameLoaderClientHaiku::detachedFromParent3): 349 (WebCore::FrameLoaderClientHaiku::dispatchDidHandleOnloadEvents): 350 (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveServerRedirectForProvisionalLoad): 351 (WebCore::FrameLoaderClientHaiku::dispatchDidCancelClientRedirect): 352 (WebCore::FrameLoaderClientHaiku::dispatchWillPerformClientRedirect): 353 (WebCore::FrameLoaderClientHaiku::dispatchDidChangeLocationWithinPage): 354 (WebCore::FrameLoaderClientHaiku::dispatchWillClose): 355 (WebCore::FrameLoaderClientHaiku::dispatchDidStartProvisionalLoad): 356 (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveTitle): 357 (WebCore::FrameLoaderClientHaiku::dispatchDidCommitLoad): 358 (WebCore::FrameLoaderClientHaiku::dispatchDidFinishDocumentLoad): 359 (WebCore::FrameLoaderClientHaiku::dispatchDidFinishLoad): 360 (WebCore::FrameLoaderClientHaiku::dispatchDidFirstLayout): 361 (WebCore::FrameLoaderClientHaiku::dispatchDidFirstVisuallyNonEmptyLayout): 362 (WebCore::FrameLoaderClientHaiku::dispatchShow): 363 (WebCore::FrameLoaderClientHaiku::cancelPolicyCheck): 364 (WebCore::FrameLoaderClientHaiku::dispatchWillSubmitForm): 365 (WebCore::FrameLoaderClientHaiku::dispatchDidLoadMainResource): 366 (WebCore::FrameLoaderClientHaiku::revertToProvisionalState): 367 (WebCore::FrameLoaderClientHaiku::postProgressStartedNotification): 368 (WebCore::FrameLoaderClientHaiku::postProgressEstimateChangedNotification): 369 (WebCore::FrameLoaderClientHaiku::postProgressFinishedNotification): 370 (WebCore::FrameLoaderClientHaiku::progressStarted): 371 (WebCore::FrameLoaderClientHaiku::progressCompleted): 372 (WebCore::FrameLoaderClientHaiku::setMainFrameDocumentReady): 373 (WebCore::FrameLoaderClientHaiku::willChangeTitle): 374 (WebCore::FrameLoaderClientHaiku::didChangeTitle): 375 (WebCore::FrameLoaderClientHaiku::finishedLoading): 376 (WebCore::FrameLoaderClientHaiku::canShowMIMEType): 377 (WebCore::FrameLoaderClientHaiku::representationExistsForURLScheme): 378 (WebCore::FrameLoaderClientHaiku::generatedMIMETypeForURLScheme): 379 (WebCore::FrameLoaderClientHaiku::frameLoadCompleted): 380 (WebCore::FrameLoaderClientHaiku::saveViewStateToItem): 381 (WebCore::FrameLoaderClientHaiku::restoreViewState): 382 (WebCore::FrameLoaderClientHaiku::restoreScrollPositionAndViewState): 383 (WebCore::FrameLoaderClientHaiku::provisionalLoadStarted): 384 (WebCore::FrameLoaderClientHaiku::shouldTreatURLAsSameAsCurrent): 385 (WebCore::FrameLoaderClientHaiku::addHistoryItemForFragmentScroll): 386 (WebCore::FrameLoaderClientHaiku::didFinishLoad): 387 (WebCore::FrameLoaderClientHaiku::prepareForDataSourceReplacement): 388 (WebCore::FrameLoaderClientHaiku::setTitle): 389 (WebCore::FrameLoaderClientHaiku::userAgent): 390 (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveIcon): 391 (WebCore::FrameLoaderClientHaiku::frameLoaderDestroyed): 392 (WebCore::FrameLoaderClientHaiku::canHandleRequest): 393 (WebCore::FrameLoaderClientHaiku::partClearedInBegin): 394 (WebCore::FrameLoaderClientHaiku::updateGlobalHistory): 395 (WebCore::FrameLoaderClientHaiku::updateGlobalHistoryRedirectLinks): 396 (WebCore::FrameLoaderClientHaiku::shouldGoToHistoryItem): 397 (WebCore::FrameLoaderClientHaiku::saveScrollPositionAndViewStateToItem): 398 (WebCore::FrameLoaderClientHaiku::canCachePage): 399 (WebCore::FrameLoaderClientHaiku::setMainDocumentError): 400 (WebCore::FrameLoaderClientHaiku::committedLoad): 401 (WebCore::FrameLoaderClientHaiku::cancelledError): 402 (WebCore::FrameLoaderClientHaiku::blockedError): 403 (WebCore::FrameLoaderClientHaiku::cannotShowURLError): 404 (WebCore::FrameLoaderClientHaiku::interruptForPolicyChangeError): 405 (WebCore::FrameLoaderClientHaiku::cannotShowMIMETypeError): 406 (WebCore::FrameLoaderClientHaiku::fileDoesNotExistError): 407 (WebCore::FrameLoaderClientHaiku::shouldFallBack): 408 (WebCore::FrameLoaderClientHaiku::createDocumentLoader): 409 (WebCore::FrameLoaderClientHaiku::download): 410 (WebCore::FrameLoaderClientHaiku::assignIdentifierToInitialRequest): 411 (WebCore::FrameLoaderClientHaiku::dispatchWillSendRequest): 412 (WebCore::FrameLoaderClientHaiku::shouldUseCredentialStorage): 413 (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveAuthenticationChallenge): 414 (WebCore::FrameLoaderClientHaiku::dispatchDidCancelAuthenticationChallenge): 415 (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveResponse): 416 (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveContentLength): 417 (WebCore::FrameLoaderClientHaiku::dispatchDidFinishLoading): 418 (WebCore::FrameLoaderClientHaiku::dispatchDidFailLoading): 419 (WebCore::FrameLoaderClientHaiku::dispatchDidLoadResourceFromMemoryCache): 420 (WebCore::FrameLoaderClientHaiku::dispatchDidLoadResourceByXMLHttpRequest): 421 (WebCore::FrameLoaderClientHaiku::dispatchDidFailProvisionalLoad): 422 (WebCore::FrameLoaderClientHaiku::dispatchDidFailLoad): 423 (WebCore::FrameLoaderClientHaiku::dispatchCreatePage): 424 (WebCore::FrameLoaderClientHaiku::dispatchDecidePolicyForMIMEType): 425 (WebCore::FrameLoaderClientHaiku::dispatchDecidePolicyForNewWindowAction): 426 (WebCore::FrameLoaderClientHaiku::dispatchDecidePolicyForNavigationAction): 427 (WebCore::FrameLoaderClientHaiku::dispatchUnableToImplementPolicy): 428 (WebCore::FrameLoaderClientHaiku::startDownload): 429 (WebCore::FrameLoaderClientHaiku::createFrame): 430 (WebCore::FrameLoaderClientHaiku::objectContentType): 431 (WebCore::FrameLoaderClientHaiku::createPlugin): 432 (WebCore::FrameLoaderClientHaiku::redirectDataToPlugin): 433 (WebCore::FrameLoaderClientHaiku::pluginWillHandleLoadError): 434 (WebCore::FrameLoaderClientHaiku::createJavaAppletWidget): 435 (WebCore::FrameLoaderClientHaiku::overrideMediaType): 436 (WebCore::FrameLoaderClientHaiku::windowObjectCleared): 437 (WebCore::FrameLoaderClientHaiku::documentElementAvailable): 438 (WebCore::FrameLoaderClientHaiku::didPerformFirstNavigation): 439 (WebCore::FrameLoaderClientHaiku::registerForIconNotification): 440 (WebCore::FrameLoaderClientHaiku::savePlatformDataToCachedFrame): 441 (WebCore::FrameLoaderClientHaiku::transitionToCommittedFromCachedFrame): 442 (WebCore::FrameLoaderClientHaiku::transitionToCommittedForNewPage): 443 * haiku/WebCoreSupport/FrameLoaderClientHaiku.h: Added. 444 (WebCore::FrameLoaderClientHaiku::~FrameLoaderClientHaiku): 445 446 2009-07-28 Maxime Simon <simon.maxime@gmail.com> 447 448 Reviewed by David Levin. 449 450 Added ChromeClient for Haiku WebCore support. 451 https://bugs.webkit.org/show_bug.cgi?id=26952 452 453 * haiku/WebCoreSupport/ChromeClientHaiku.cpp: Added. 454 (WebCore::ChromeClientHaiku::ChromeClientHaiku): 455 (WebCore::ChromeClientHaiku::~ChromeClientHaiku): 456 (WebCore::ChromeClientHaiku::chromeDestroyed): 457 (WebCore::ChromeClientHaiku::setWindowRect): 458 (WebCore::ChromeClientHaiku::windowRect): 459 (WebCore::ChromeClientHaiku::pageRect): 460 (WebCore::ChromeClientHaiku::scaleFactor): 461 (WebCore::ChromeClientHaiku::focus): 462 (WebCore::ChromeClientHaiku::unfocus): 463 (WebCore::ChromeClientHaiku::canTakeFocus): 464 (WebCore::ChromeClientHaiku::takeFocus): 465 (WebCore::ChromeClientHaiku::createWindow): 466 (WebCore::ChromeClientHaiku::createModalDialog): 467 (WebCore::ChromeClientHaiku::show): 468 (WebCore::ChromeClientHaiku::canRunModal): 469 (WebCore::ChromeClientHaiku::runModal): 470 (WebCore::ChromeClientHaiku::setToolbarsVisible): 471 (WebCore::ChromeClientHaiku::toolbarsVisible): 472 (WebCore::ChromeClientHaiku::setStatusbarVisible): 473 (WebCore::ChromeClientHaiku::statusbarVisible): 474 (WebCore::ChromeClientHaiku::setScrollbarsVisible): 475 (WebCore::ChromeClientHaiku::scrollbarsVisible): 476 (WebCore::ChromeClientHaiku::setMenubarVisible): 477 (WebCore::ChromeClientHaiku::menubarVisible): 478 (WebCore::ChromeClientHaiku::setResizable): 479 (WebCore::ChromeClientHaiku::addMessageToConsole): 480 (WebCore::ChromeClientHaiku::canRunBeforeUnloadConfirmPanel): 481 (WebCore::ChromeClientHaiku::runBeforeUnloadConfirmPanel): 482 (WebCore::ChromeClientHaiku::closeWindowSoon): 483 (WebCore::ChromeClientHaiku::runJavaScriptAlert): 484 (WebCore::ChromeClientHaiku::runJavaScriptConfirm): 485 (WebCore::ChromeClientHaiku::runJavaScriptPrompt): 486 (WebCore::ChromeClientHaiku::setStatusbarText): 487 (WebCore::ChromeClientHaiku::shouldInterruptJavaScript): 488 (WebCore::ChromeClientHaiku::tabsToLinks): 489 (WebCore::ChromeClientHaiku::windowResizerRect): 490 (WebCore::ChromeClientHaiku::repaint): 491 (WebCore::ChromeClientHaiku::scroll): 492 (WebCore::ChromeClientHaiku::screenToWindow): 493 (WebCore::ChromeClientHaiku::windowToScreen): 494 (WebCore::ChromeClientHaiku::platformWindow): 495 (WebCore::ChromeClientHaiku::contentsSizeChanged): 496 (WebCore::ChromeClientHaiku::scrollRectIntoView): 497 (WebCore::ChromeClientHaiku::addToDirtyRegion): 498 (WebCore::ChromeClientHaiku::scrollBackingStore): 499 (WebCore::ChromeClientHaiku::updateBackingStore): 500 (WebCore::ChromeClientHaiku::mouseDidMoveOverElement): 501 (WebCore::ChromeClientHaiku::setToolTip): 502 (WebCore::ChromeClientHaiku::print): 503 (WebCore::ChromeClientHaiku::exceededDatabaseQuota): 504 (WebCore::ChromeClientWx::reachedMaxAppCacheSize): 505 (WebCore::ChromeClientHaiku::requestGeolocationPermissionForFrame): 506 (WebCore::ChromeClientHaiku::runOpenPanel): 507 (WebCore::ChromeClientHaiku::setCursor): 508 (WebCore::ChromeClientHaiku::formStateDidChange): 509 (WebCore::ChromeClientHaiku::createHTMLParserQuirks): 510 * haiku/WebCoreSupport/ChromeClientHaiku.h: Added. 511 512 2009-07-28 Robert Hogan <robert@roberthogan.net> 513 514 Reviewed by Simon Hausmann. 515 516 Add WebKit version API to Qt. 517 518 Get the current version of WebKit from WebKit/mac/Configurations/Version.xcconfig 519 at compile time and make it available to webkit ports through WebKitVersion.h. 520 521 https://bugs.webkit.org/show_bug.cgi?id=27158 522 523 * scripts/generate-webkitversion.pl: Added 524 525 2009-07-24 Andrei Popescu <andreip@google.com> 526 527 ApplicationCache should have size limit 528 https://bugs.webkit.org/show_bug.cgi?id=22700 529 530 Updated the project after adding WebApplicationCache.h/mm 531 532 * WebKit.xcodeproj/project.pbxproj: 533 534 2009-07-16 Maxime Simon <simon.maxime@gmail.com> 535 536 Reviewed by Eric Seidel. 537 538 Added InspectorClient for Haiku WebCore support. 539 https://bugs.webkit.org/show_bug.cgi?id=26952 540 541 Adding two files, InspectorClientHaiku.h and InspectorClientHaiku.cpp 542 543 * haiku/WebCoreSupport/InspectorClientHaiku.cpp: Added. 544 (WebCore::InspectorClientHaiku::inspectorDestroyed): 545 (WebCore::InspectorClientHaiku::createPage): 546 (WebCore::InspectorClientHaiku::localizedStringsURL): 547 (WebCore::InspectorClientHaiku::hiddenPanels): 548 (WebCore::InspectorClientHaiku::showWindow): 549 (WebCore::InspectorClientHaiku::closeWindow): 550 (WebCore::InspectorClientHaiku::attachWindow): 551 (WebCore::InspectorClientHaiku::detachWindow): 552 (WebCore::InspectorClientHaiku::setAttachedWindowHeight): 553 (WebCore::InspectorClientHaiku::highlight): 554 (WebCore::InspectorClientHaiku::hideHighlight): 555 (WebCore::InspectorClientHaiku::inspectedURLChanged): 556 (WebCore::InspectorClientHaiku::populateSetting): 557 (WebCore::InspectorClientHaiku::storeSetting): 558 (WebCore::InspectorClientHaiku::removeSetting): 559 * haiku/WebCoreSupport/InspectorClientHaiku.h: Added. 560 561 2009-07-16 Maxime Simon <simon.maxime@gmail.com> 562 563 Reviewed by Oliver Hunt. 564 565 Added EditorClient for Haiku WebCore support. 566 https://bugs.webkit.org/show_bug.cgi?id=26952 567 568 Adding two files, EditorClientHaiku.h and EditorClientHaiku.cpp 569 570 * haiku/WebCoreSupport/EditorClientHaiku.cpp: Added. 571 (WebCore::EditorClientHaiku::EditorClientHaiku): 572 (WebCore::EditorClientHaiku::setPage): 573 (WebCore::EditorClientHaiku::pageDestroyed): 574 (WebCore::EditorClientHaiku::shouldDeleteRange): 575 (WebCore::EditorClientHaiku::shouldShowDeleteInterface): 576 (WebCore::EditorClientHaiku::smartInsertDeleteEnabled): 577 (WebCore::EditorClientHaiku::isSelectTrailingWhitespaceEnabled): 578 (WebCore::EditorClientHaiku::isContinuousSpellCheckingEnabled): 579 (WebCore::EditorClientHaiku::toggleContinuousSpellChecking): 580 (WebCore::EditorClientHaiku::isGrammarCheckingEnabled): 581 (WebCore::EditorClientHaiku::toggleGrammarChecking): 582 (WebCore::EditorClientHaiku::spellCheckerDocumentTag): 583 (WebCore::EditorClientHaiku::isEditable): 584 (WebCore::EditorClientHaiku::shouldBeginEditing): 585 (WebCore::EditorClientHaiku::shouldEndEditing): 586 (WebCore::EditorClientHaiku::shouldInsertNode): 587 (WebCore::EditorClientHaiku::shouldInsertText): 588 (WebCore::EditorClientHaiku::shouldChangeSelectedRange): 589 (WebCore::EditorClientHaiku::shouldApplyStyle): 590 (WebCore::EditorClientHaiku::shouldMoveRangeAfterDelete): 591 (WebCore::EditorClientHaiku::didBeginEditing): 592 (WebCore::EditorClientHaiku::respondToChangedContents): 593 (WebCore::EditorClientHaiku::respondToChangedSelection): 594 (WebCore::EditorClientHaiku::didEndEditing): 595 (WebCore::EditorClientHaiku::didWriteSelectionToPasteboard): 596 (WebCore::EditorClientHaiku::didSetSelectionTypesForPasteboard): 597 (WebCore::EditorClientHaiku::registerCommandForUndo): 598 (WebCore::EditorClientHaiku::registerCommandForRedo): 599 (WebCore::EditorClientHaiku::clearUndoRedoOperations): 600 (WebCore::EditorClientHaiku::canUndo): 601 (WebCore::EditorClientHaiku::canRedo): 602 (WebCore::EditorClientHaiku::undo): 603 (WebCore::EditorClientHaiku::redo): 604 (WebCore::EditorClientHaiku::handleKeyboardEvent): 605 (WebCore::EditorClientHaiku::handleInputMethodKeydown): 606 (WebCore::EditorClientHaiku::textFieldDidBeginEditing): 607 (WebCore::EditorClientHaiku::textFieldDidEndEditing): 608 (WebCore::EditorClientHaiku::textDidChangeInTextField): 609 (WebCore::EditorClientHaiku::doTextFieldCommandFromEvent): 610 (WebCore::EditorClientHaiku::textWillBeDeletedInTextField): 611 (WebCore::EditorClientHaiku::textDidChangeInTextArea): 612 (WebCore::EditorClientHaiku::ignoreWordInSpellDocument): 613 (WebCore::EditorClientHaiku::learnWord): 614 (WebCore::EditorClientHaiku::checkSpellingOfString): 615 (WebCore::EditorClientHaiku::getAutoCorrectSuggestionForMisspelledWord): 616 (WebCore::EditorClientHaiku::checkGrammarOfString): 617 (WebCore::EditorClientHaiku::updateSpellingUIWithGrammarString): 618 (WebCore::EditorClientHaiku::updateSpellingUIWithMisspelledWord): 619 (WebCore::EditorClientHaiku::showSpellingUI): 620 (WebCore::EditorClientHaiku::spellingUIIsShowing): 621 (WebCore::EditorClientHaiku::getGuessesForWord): 622 (WebCore::EditorClientHaiku::setInputMethodState): 623 (WebCore::EditorClientHaiku::isEditing): 624 * haiku/WebCoreSupport/EditorClientHaiku.h: Added. 625 626 2009-07-16 Maxime Simon <simon.maxime@gmail.com> 627 628 Reviewed by Eric Seidel. 629 630 Added DragClient for Haiku WebCore support. 631 https://bugs.webkit.org/show_bug.cgi?id=26952 632 633 Adding two files, DragClientHaiku.h and DragClientHaiku.cpp 634 635 * haiku/WebCoreSupport/DragClientHaiku.cpp: Added. 636 (WebCore::DragClientHaiku::actionMaskForDrag): 637 (WebCore::DragClientHaiku::willPerformDragDestinationAction): 638 (WebCore::DragClientHaiku::dragControllerDestroyed): 639 (WebCore::DragClientHaiku::dragSourceActionMaskForPoint): 640 (WebCore::DragClientHaiku::willPerformDragSourceAction): 641 (WebCore::DragClientHaiku::startDrag): 642 (WebCore::DragClientHaiku::createDragImageForLink): 643 * haiku/WebCoreSupport/DragClientHaiku.h: Added. 644 645 2009-07-16 Maxime Simon <simon.maxime@gmail.com> 646 647 Reviewed by Oliver Hunt. 648 649 Added ContextMenuClient for Haiku WebCore support. 650 https://bugs.webkit.org/show_bug.cgi?id=26952 651 652 Adding two files, ContextMenuClientHaiku.h 653 and ContextMenuClientHaiku.cpp 654 655 * haiku/WebCoreSupport/ContextMenuClientHaiku.cpp: Added. 656 (WebCore::ContextMenuClientHaiku::contextMenuDestroyed): 657 (WebCore::ContextMenuClientHaiku::getCustomMenuFromDefaultItems): 658 (WebCore::ContextMenuClientHaiku::contextMenuItemSelected): 659 (WebCore::ContextMenuClientHaiku::downloadURL): 660 (WebCore::ContextMenuClientHaiku::lookUpInDictionary): 661 (WebCore::ContextMenuClientHaiku::speak): 662 (WebCore::ContextMenuClientHaiku::isSpeaking): 663 (WebCore::ContextMenuClientHaiku::stopSpeaking): 664 (WebCore::ContextMenuClientHaiku::searchWithGoogle): 665 * haiku/WebCoreSupport/ContextMenuClientHaiku.h: Added. 666 667 2009-07-10 Adam Roben <aroben@apple.com> 668 669 Sort all our Xcode projects 670 671 Accomplished using sort-Xcode-project-file. 672 673 Requested by Dave Kilzer. 674 675 * WebKit.xcodeproj/project.pbxproj: 676 677 2009-07-02 Adam Roben <aroben@apple.com> 678 679 Fix warnings from update-webkit-localizable-strings 680 681 Rubber-stamped by Eric Carlson. 682 683 * English.lproj/Localizable.strings: Updated. 684 685 2009-07-02 Adam Roben <aroben@apple.com> 686 687 Update StringsNotToBeLocalized.txt for (not so) recent changes 688 689 Bug 26926: StringsNotToBeLocalized.txt is out-of-date 690 <https://bugs.webkit.org/show_bug.cgi?id=26926> 691 692 Reviewed by John Sullivan. 693 694 * StringsNotToBeLocalized.txt: 695 696 2009-07-02 Pierre d'Herbemont <pdherbemont@apple.com> 697 698 Reviewed by Simon Fraser. 699 700 <rdar://problem/6518119> 701 702 Add localized strings for media controller status messages. 703 704 * English.lproj/Localizable.strings: Localized text. 705 706 2009-06-08 Dan Bernstein <mitz@apple.com> 707 708 Rubber-stamped by Mark Rowe. 709 710 - updated the project after giving Objective-C++ the .mm extension 711 712 * WebKit.xcodeproj/project.pbxproj: 713 714 2009-06-04 Sam Weinig <sam@webkit.org> 715 716 Reviewed by Alice Liu. 717 718 Move WebView internal data into WebViewData.h/mm. 719 720 * WebKit.xcodeproj/project.pbxproj: 721 722 2009-06-03 Sam Weinig <sam@webkit.org> 723 724 Reviewed by Mark Rowe. 725 726 Added WebDelegateImplementationCaching.h/mm 727 728 * WebKit.xcodeproj/project.pbxproj: 729 730 2009-06-03 Sam Weinig <sam@webkit.org> 731 732 Reviewed by Mark Rowe. 733 734 Add WebViewInternal.mm. 735 736 * WebKit.xcodeproj/project.pbxproj: 737 738 2009-06-03 Dan Bernstein <mitz@apple.com> 739 740 Reviewed by Anders Carlsson. 741 742 - WebKit project part of eliminating WebCoreTextRenderer 743 744 * WebKit.xcodeproj/project.pbxproj: Changed WebKitNSStringExtras.m to 745 compile as Objective-C++. 746 747 2009-06-01 Darin Adler <darin@apple.com> 748 749 Reviewed by Maciej Stachowiak. 750 751 Bug 26113: break WebTextCompletionController out into its own source file 752 https://bugs.webkit.org/show_bug.cgi?id=26113 753 754 * WebKit.xcodeproj/project.pbxproj: Add WebTextCompletionController.h/mm. 755 756 2009-05-28 Mark Rowe <mrowe@apple.com> 757 758 Rubber-stamped by Anders Carlsson. 759 760 Symlink WebKitPluginHost.app in to place if needed. 761 762 * WebKit.xcodeproj/project.pbxproj: 763 764 2009-05-24 Darin Adler <darin@apple.com> 765 766 * StringsNotToBeLocalized.txt: Updated for recent changes. Got rid of most full-file exceptions. 767 768 2009-05-16 Anders Carlsson <andersca@apple.com> 769 770 Reviewed by Sam Weinig and Dan Bernstein. 771 772 Fix <rdar://problem/6889644>. 773 774 * English.lproj/Localizable.strings: 775 776 2009-05-10 Alexey Proskuryakov <ap@webkit.org> 777 778 Reviewed by Dan Bernstein. 779 780 <rdar://problem/6870383> Have to enter credentials twice when downloading from a protected page 781 782 * WebKit.xcodeproj/project.pbxproj: Renamed Misc/WebDownload.m as WebDownload.mm, so that 783 it could use C++ code from AuthenticaitonMac.h. 784 785 2009-04-27 Douglas R. Davidson <ddavidso@apple.com> 786 787 Add localizable strings for 788 <rdar://problem/6724106> WebViews need to implement text checking 789 790 Reviewed by Justin Garcia. 791 792 * English.lproj/Localizable.strings: 793 794 2009-04-27 Kevin Decker <kdecker@apple.com> 795 796 Reviewed by Anders Carlsson. 797 798 <rdar://problem/6352982> 799 800 * WebKit.xcodeproj/project.pbxproj: Added WebNetscapeContainerCheckContextInfo.mm to the project. 801 802 2009-04-23 Kevin Decker <kdecker@apple.com> 803 804 Reviewed by Anders Carlsson. 805 806 * WebKit.xcodeproj/project.pbxproj: Added WebNetscapeContainerCheckPrivate.mm and header to the project. 807 808 2009-04-21 Adam Roben <aroben@apple.com> 809 810 Update StringsNotToBeLocalized.txt for recent changes 811 812 Rubber-stamped by John Sullivan. 813 814 * StringsNotToBeLocalized.txt: 815 816 2009-04-19 Darin Adler <darin@apple.com> 817 818 * StringsNotToBeLocalized.txt: Updated for recent changes. 819 820 2009-04-17 David Kilzer <ddkilzer@apple.com> 821 822 Simplify FEATURE_DEFINES definition 823 824 Reviewed by Darin Adler. 825 826 This moves FEATURE_DEFINES and its related ENABLE_FEATURE_NAME 827 variables to their own FeatureDefines.xcconfig file. It also 828 extracts a new ENABLE_GEOLOCATION variable so that 829 FEATURE_DEFINES only needs to be defined once. 830 831 * WebKit.xcodeproj/project.pbxproj: Added 832 FeatureDefines.xcconfig file. 833 834 2009-04-10 Timothy Hatcher <timothy@apple.com> 835 836 Remove DOMDocumentPrivate.h now that <rdar://problem/6730996> is fixed. 837 838 Rubber-stamped by Mark Rowe. 839 840 * WebKit.xcodeproj/project.pbxproj: 841 842 2009-04-09 Mike Thole <mthole@apple.com> 843 844 Reviewed by Adam Roben. 845 846 * WebKit.xcodeproj/project.pbxproj: 847 Set the Localizable.strings encoding to UTF-16. 848 849 2009-04-07 Anders Carlsson <andersca@apple.com> 850 851 Try to fix the Leopard build once more. 852 853 * WebKit.xcodeproj/project.pbxproj: 854 855 2009-04-07 Anders Carlsson <andersca@apple.com> 856 857 Another attempt at fixing the build. 858 859 * WebKit.xcodeproj/project.pbxproj: 860 861 2009-04-02 Adele Peterson <adele@apple.com> 862 863 Reviewed by Darin Adler. 864 865 * WebKit.xcodeproj/project.pbxproj: 866 Add WebDOMOperationsInternal.h and make WebDOMOperationsPrivate.h private. 867 868 2009-04-01 Greg Bolsinga <bolsinga@apple.com> 869 870 Reviewed by Mark Rowe. 871 872 https://bugs.webkit.org/show_bug.cgi?id=24990 873 Put SECTORDER_FLAGS into xcconfig files. 874 875 * WebKit.xcodeproj/project.pbxproj: 876 877 2009-03-27 Darin Adler <darin@apple.com> 878 879 * StringsNotToBeLocalized.txt: Updated for recent changes. 880 881 2009-03-16 Darin Adler <darin@apple.com> 882 883 Reviewed by Dan Bernstein. 884 885 * English.lproj/Localizable.strings: Updated. 886 * StringsNotToBeLocalized.txt: Updated for recent changes. 887 888 2009-03-13 Greg Bolsinga <bolsinga@apple.com> 889 890 Reviewed by Simon Fraser. 891 892 Update Geolocation perimission dialogs to be asynchronous. 893 https://bugs.webkit.org/show_bug.cgi?id=24505 894 895 Add WebGeolocation, a wrapper around WebCore::Geolocation. It mimics the 896 coding style set by WebSecurityOrigin. 897 898 * WebKit.xcodeproj/project.pbxproj: 899 900 2009-03-13 Anders Carlsson <andersca@apple.com> 901 902 Reviewed by Dan Bernstein. 903 904 <rdar://problem/6610666> Revise the Cocoa event model text API 905 906 Remove nptextinput.h 907 908 * WebKit.xcodeproj/project.pbxproj: 909 910 2009-03-03 David Kilzer <ddkilzer@apple.com> 911 912 <rdar://problem/6581203> WebCore and WebKit should install the same set of headers during installhdrs phase as build phase 913 914 Reviewed by Mark Rowe. 915 916 The fix is to add INSTALLHDRS_COPY_PHASE = YES and 917 INSTALLHDRS_SCRIPT_PHASE = YES to WebKit.xcconfig, then to 918 make sure various build phase scripts work with the installhdrs 919 build phase. 920 921 * WebKit.xcodeproj/project.pbxproj: 922 - Added shell code to prevent running "Check For Global 923 Initializers", "Check For Exit Time Destructors" and "Check 924 For Weak VTables" scripts during the installhdrs build phase. 925 - Removed UMBRELLA_FRAMEWORKS_DIR from the Debug and Release 926 targets since it's no longer needed after defining 927 WEBCORE_PRIVATE_HEADERS_DIR in WebKit.xcconfig. 928 929 2009-03-03 David Kilzer <ddkilzer@apple.com> 930 931 Remove last vestiges of JAVASCRIPTCORE_PRIVATE_HEADERS_DIR from WebKit 932 933 Reviewed by Adam Roben. 934 935 Use of JAVASCRIPTCORE_PRIVATE_HEADERS_DIR was removed in r37465 936 since NPAPI headers had migrated from JavaScriptCore to WebCore 937 before that. 938 939 * WebKit.xcodeproj/project.pbxproj: Removed 940 JAVASCRIPTCORE_PRIVATE_HEADERS_DIR build setting from from Debug 941 and Release configurations. 942 943 2009-03-02 Anders Carlsson <andersca@apple.com> 944 945 WebNetscapePluginPackage.mm is an Objective-C++ file. 946 947 * WebKit.xcodeproj/project.pbxproj: 948 949 2009-03-02 Anders Carlsson <andersca@apple.com> 950 951 Reviewed by John Sullivan. 952 953 Rename WebNetscapePluginPackage.m to WebNetscapePluginPackage.mm 954 955 * WebKit.xcodeproj/project.pbxproj: 956 957 2009-02-20 Anders Carlsson <andersca@apple.com> 958 959 Reviewed by Dan Bernstein. 960 961 Add new files. 962 963 * WebKit.xcodeproj/project.pbxproj: 964 965 2009-02-13 Darin Adler <darin@apple.com> 966 967 * StringsNotToBeLocalized.txt: Updated for recent changes. 968 969 2009-02-07 Darin Adler <darin@apple.com> 970 971 * StringsNotToBeLocalized.txt: Updated for recent changes. 972 973 2009-02-04 Timothy Hatcher <timothy@apple.com> 974 975 Removed the WebDefaultScriptDebugDelegate now that we have CallScriptDebugDelegate. 976 977 <rdar://problem/6508457> Launching widget in Dashcode debugger is 978 super-slow due forwardInvocation: calling debug delegate 979 980 Reviewed by Oliver Hunt. 981 982 * WebKit.xcodeproj/project.pbxproj: 983 984 2009-02-02 Anders Carlsson <andersca@apple.com> 985 986 Reviewed by Dan Bernstein. 987 988 Remove WebKitPluginContainerView.{h|mm}, they aren't used anywhere. 989 990 * WebKit.xcodeproj/project.pbxproj: 991 992 2009-01-26 Mark Rowe <mrowe@apple.com> 993 994 Rubber-stamped by Sam Weinig. 995 996 Clean up after r40240. 997 998 * WebKit.xcodeproj/project.pbxproj: Reinstate WebKitPluginHost.defs. 999 1000 2009-01-25 Darin Adler <darin@apple.com> 1001 1002 Try to fix full build on Mac Leopard. 1003 1004 * WebKit.xcodeproj/project.pbxproj: Removed WebKitPluginClient.defs from the WebKit target. 1005 Maybe this is temporary, but I had to do it to get the full build to succeed. 1006 1007 2009-01-25 Mark Rowe <mrowe@apple.com> 1008 1009 Rubber-stamped by Dan Bernstein. 1010 1011 Improve the consistency of settings in our .xcconfig files. 1012 1013 * WebKit.xcodeproj/project.pbxproj: 1014 1015 2009-01-23 Brady Eidson <beidson@apple.com> 1016 1017 Rubberstamped by Darin Adler 1018 1019 Rename CachedPagePlatformData to CachedFramePlatformData to more accurately reflect its true role. 1020 1021 * WebKit.xcodeproj/project.pbxproj: 1022 1023 2009-01-20 Anders Carlsson <andersca@apple.com> 1024 1025 Reviewed by Sam Weinig. 1026 1027 Add ProxyInstance files. 1028 1029 * WebKit.xcodeproj/project.pbxproj: 1030 1 1031 2009-01-04 David Kilzer <ddkilzer@apple.com> 2 1032 -
trunk/src/3rdparty/webkit/WebKit/LICENSE
r2 r561 1 Copyright (C) 2005 Apple Computer, Inc.All rights reserved.1 Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 2 3 3 Redistribution and use in source and binary forms, with or without 4 4 modification, are permitted provided that the following conditions 5 5 are met: 6 7 6 1. Redistributions of source code must retain the above copyright 8 notice, this list of conditions and the following disclaimer. 7 notice, this list of conditions and the following disclaimer. 9 8 2. Redistributions in binary form must reproduce the above copyright 10 9 notice, this list of conditions and the following disclaimer in the 11 documentation and/or other materials provided with the distribution. 12 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of 13 its contributors may be used to endorse or promote products derived 14 from this software without specific prior written permission. 10 documentation and/or other materials provided with the distribution. 15 11 16 THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS"AND ANY12 THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY 17 13 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 14 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY15 DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY 20 16 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 17 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 ONANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.18 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 19 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 20 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 21 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -
trunk/src/3rdparty/webkit/WebKit/StringsNotToBeLocalized.txt
r2 r561 8 8 " Mac OS X %@; %@) AppleWebKit/%@ (KHTML, like Gecko) %@" 9 9 " Mac OS X %@; %@) AppleWebKit/%@ (KHTML, like Gecko)" 10 " webViewDrawResizer delegate call"10 " Version/3.2.1" 11 11 "#" 12 12 "%" … … 43 43 "-" 44 44 "-1px" 45 "-createPluginMIMETypesPreferences" 45 46 "-khtml-text-decorations-in-effect" 46 47 "." … … 48 49 ".download" 49 50 ".html" 51 ".jpg" 50 52 ".svg" 51 53 ".xhtml" … … 53 55 "/Frameworks/PDFKit.framework" 54 56 "/Library/Internet Plug-Ins" 55 "/System/Library/Frameworks/Accelerate.framework/Accelerate"56 57 "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LangAnalysis.framework/LangAnalysis" 57 58 "/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/HIToolbox" … … 59 60 "/tmp/XXXXXX.tiff" 60 61 "0" 62 "062AEEE3-9E42-44DC-A8A9-236B216FE011" 61 63 "1" 62 64 "1000" … … 72 74 "6EB8D98F-2723-4472-88D3-5936F9D6E631" 73 75 "7" 76 "7.1" 74 77 "9" 75 78 ":" 76 79 "://" 77 80 ":/?#" 81 ";" 78 82 "<!" 79 83 "<%@ %@>" … … 93 97 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-." 94 98 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+.-" 99 "ARIAApplicationLog" 100 "ARIAApplicationMarquee" 101 "ARIAApplicationStatus" 102 "ARIAApplicationTimer" 103 "ARIADocument" 104 "ARIADocumentArticle" 105 "ARIADocumentNote" 106 "ARIADocumentRegion" 107 "ARIALandmarkApplication" 108 "ARIALandmarkBanner" 109 "ARIALandmarkComplementary" 110 "ARIALandmarkContentInfo" 111 "ARIALandmarkMain" 112 "ARIALandmarkNavigation" 113 "ARIALandmarkSearch" 114 "ARIAUserInterfaceTooltip" 95 115 "AXEnhancedUserInterface" 116 "AccessibleBase" 96 117 "AccessibleObjectFromWindow" 97 118 "AllowsUndo" … … 100 121 "AppleLanguages" 101 122 "AppleTextDirection" 123 "AudioElement" 102 124 "BEGIN:VCALENDAR" 103 125 "BEGIN:VCARD" 104 126 "BP_CreatePluginMIMETypesPreferences" 105 127 "CFDictionaryPropertyBag" 106 "CFNetwork"107 "CFNetwork_debug"108 "CFURLCacheCopySharedURLCache"109 128 "CSS" 129 "Change Back to \\U201C%@\\U201D" 110 130 "Content-Encoding" 111 131 "Content-Length" 112 132 "Content-Type" 133 "CurrentTimeDisplay" 134 "D" 113 135 "DCMDictionaryServiceWindowShow" 114 136 "DELEGATE METHODS" 115 137 "DOCBASE" 138 "DOMHTMLObjectElement" 139 "DOMNode" 116 140 "DYLD_FRAMEWORK_PATH" 117 141 "DefaultDownloadDelegate" … … 121 145 "DeleteWordBackward" 122 146 "DeleteWordForward" 147 "DisableWebKitDeveloperExtras" 123 148 "FD3B2381-0BB6-4B59-AF09-0E599C8901CF" 124 149 "FastMallocFreeSizeInCaches" … … 127 152 "FastMallocReturnedSize" 128 153 "FrameName" 154 "FullscreenButton" 129 155 "GEN_DOMObject" 156 "GET" 130 157 "GroupName" 131 158 "HIDictionaryWindowShow" 159 "HTTP " 132 160 "Helvetica" 161 "HostedNetscapePluginStream" 133 162 "IDNScriptWhiteList" 134 163 "IDNScriptWhiteList.txt" … … 146 175 "ImmSetCandidateWindow" 147 176 "ImmSetOpenStatus" 177 "IncludeDebugMenu" 148 178 "InsertBacktab" 149 179 "InsertNewline" … … 154 184 "JavaScriptHeapSize" 155 185 "Joy!peff" 156 "KWQScrollBar"157 186 "LTR" 158 187 "Library/Caches" 159 188 "Library/Internet Plug-Ins" 160 189 "LresultFromObject" 161 "Lucida Grande"162 "MIMEType"163 190 "MIME\\Database\\Content Type" 164 191 "MainPageJavaScript.js" 165 192 "MemoryStream" 193 "MenuCommands" 194 "Microsoft/com.microsoft.Messenger" 166 195 "MoveDown" 167 196 "MoveDownAndModifySelection" … … 190 219 "Mozilla/5.0 (Macintosh; U; " 191 220 "Mozilla/5.0 (Windows; U; %s; %s) AppleWebKit/%s (KHTML, like Gecko)%s%s" 221 "MuteButton" 192 222 "NP_GetEntryPoints" 193 223 "NP_Initialize" … … 202 232 "NSView" 203 233 "NeXT smart paste pasteboard type" 234 "NetscapePluginInstanceProxy" 204 235 "PDFDocument" 205 236 "PDFPreviewView" … … 208 239 "PDFViewDisplayModeChanged" 209 240 "PDFViewScaleChanged" 241 "PNG" 210 242 "POST" 211 243 "PPC" 244 "PauseButton" 245 "PlayButton" 212 246 "Quartz.framework" 213 247 "RTL" 214 248 "Referer" 249 "ReturnToRealtimeButton" 250 "RewindButton" 215 251 "SAMILang" 216 252 "SAMIStyle" 217 253 "Safari.exe" 254 "SeekBackButton" 255 "SeekForwardButton" 256 "SelectAll" 257 "Slider" 258 "SliderThumb" 259 "StatusDisplay" 260 "TimeRemainingDisplay" 218 261 "Times" 219 262 "ToggleBold" … … 222 265 "U+001B" 223 266 "UTF-8" 267 "UnMuteButton" 224 268 "UseBackForwardList" 225 269 "User-Agent" 270 "VideoElement" 226 271 "Volumes" 272 "W" 227 273 "WEBKIT_UNSET_DYLD_FRAMEWORK_PATH" 228 274 "WebActionButtonKey" … … 271 317 "WebError" 272 318 "WebFrame" 319 "WebFrameCanSuspendActiveDOMObjectsKey" 320 "WebFrameHasPluginsKey" 321 "WebFrameHasUnloadListenerKey" 322 "WebFrameMainDocumentErrorKey" 273 323 "WebFramePolicyListener" 324 "WebFrameUsesApplicationCacheKey" 325 "WebFrameUsesDatabasesKey" 326 "WebFrameUsesGeolocationKey" 274 327 "WebHTMLRepresentation" 275 328 "WebHistory" … … 300 353 "WebJavaScriptTextInputPanel" 301 354 "WebKitClassFactory" 355 "WebKitDeveloperExtras" 302 356 "WebKitErrorDomain" 303 357 "WebKitErrorMIMETypeKey" … … 306 360 "WebKitHistoryAgeInDaysLimit" 307 361 "WebKitHistoryItemLimit" 308 "WebKitInspector Attached"309 "WebKit InspectorAttachedViewHeight"362 "WebKitInspectorHiddenPanels" 363 "WebKitLocalCache" 310 364 "WebKitLogLevel" 311 365 "WebKitOmitPDFSupport" … … 348 402 "WebPluginWillPresentNativeUserInterface" 349 403 "WebPreferences" 404 "WebPreferences%d" 405 "WebPreferencesChangedNotification" 406 "WebPreferencesRemovedNotification" 350 407 "WebProgressEstimateChangedNotification" 351 408 "WebProgressFinishedNotification" … … 359 416 "WebResourceTextEncodingName" 360 417 "WebResourceURL" 361 "WebScriptCallFrame"362 "WebScriptDebugServer"363 418 "WebScriptErrorDescription" 364 419 "WebScriptErrorDomain" … … 376 431 "WebURLProtectionSpace" 377 432 "WebURLResponse" 433 "WebURLsWithTitlesPboardType" 378 434 "WebView" 379 435 "WebViewDidBeginEditingNotification" … … 383 439 "WebViewDidEndEditingNotification" 384 440 "WebViewWindowClass" 441 "WebWorkersPrivate" 442 "Windows %d.%d" 443 "Windows 95" 444 "Windows 98" 445 "Windows 98; Win 9x 4.90" 446 "Windows NT %d.%d" 385 447 "XSL" 386 448 "XXXXXX-" … … 400 462 "\r" 401 463 "\xFF\xD8\xFF\xE0" 464 "_isUsingAcceleratedCompositing" 402 465 "_top" 403 466 "a" 404 467 "ab" 405 468 "about:" 469 "actions" 470 "anchorPoint" 406 471 "applewebdata" 407 472 "applewebdata://%@" 473 "application.pdf" 408 474 "application/atom+xml" 409 475 "application/octet-stream" … … 419 485 "b" 420 486 "basefont" 487 "bounds" 421 488 "bundlePath" 422 489 "c" … … 424 491 "canGoForward" 425 492 "com.RealNetworks.RealOne Player" 493 "com.adiumX.adiumX" 426 494 "com.adobe.Acrobat" 427 495 "com.adobe.Acrobat.Pro" … … 434 502 "com.adobe.distiller" 435 503 "com.adobe.dreamweaver-9.0" 504 "com.alientechnology.Proteus" 505 "com.app4mac.KidsBrowsercom.app4mac.wKiosk" 436 506 "com.apple.Aperture" 437 507 "com.apple.AppKit" 508 "com.apple.Automator" 509 "com.apple.Automator." 510 "com.apple.AutomatorRunner" 511 "com.apple.Dashcode" 438 512 "com.apple.Dictionary" 439 513 "com.apple.HIWebView" … … 441 515 "com.apple.JavaPluginCocoa" 442 516 "com.apple.KeyboardUIModeDidChange" 517 "com.apple.Mail" 443 518 "com.apple.QuickTime Plugin.plugin" 444 519 "com.apple.Safari" … … 446 521 "com.apple.WebKit" 447 522 "com.apple.WebKit.PluginAgent" 523 "com.apple.Xcode" 524 "com.apple.dashboard.client" 525 "com.apple.helpviewer" 448 526 "com.apple.hiview" 527 "com.apple.iChat" 449 528 "com.apple.iWeb" 529 "com.apple.installer" 450 530 "com.apple.mail" 451 531 "com.apple.quicktime.webplugin" 452 532 "com.apple.universalaccess" 533 "com.barebones.bbedit" 534 "com.barebones.textwrangler" 535 "com.barebones.yojimbo" 536 "com.culturedcode.xyle" 537 "com.e-frontier.shade10" 538 "com.equinux.iSale4" 539 "com.equinux.iSale5" 540 "com.freeverse.bumpercar" 541 "com.growl.growlframework" 542 "com.intrarts.PandoraMan" 543 "com.karelia.Sandvox" 453 544 "com.lizardtech.NPDjVu" 545 "com.macrabbit.CSSEdit" 546 "com.macromates.textmate" 547 "com.macromedia.Flash Player.plugin" 454 548 "com.macromedia.fireworks" 549 "com.microsoft.SilverlightPlugin" 455 550 "com.microsoft.WMP.defaultplugin" 456 "copyData" 551 "com.omnigroup.OmniWeb5" 552 "com.panic.Coda" 553 "com.ranchero.NetNewsWire" 554 "com.realmacsoftware.rapidweaverpro" 555 "com.red-sweater.marsedit" 556 "com.sunrisebrowser.Sunrise" 557 "com.thinkmac.NewsLife" 558 "com.yahoo.messenger3" 559 "contents" 560 "contentsRect" 561 "cp949" 457 562 "cpuType" 563 "de.codingmonkeys.SubEthaEdit" 458 564 "dir" 459 565 "displayTitle" … … 461 567 "en" 462 568 "estimatedProgress" 463 " eval"569 "fi.karppinen.Pyro" 464 570 "file:" 465 571 "frameName" 466 572 "ftp:" 573 "fullFrame" 574 "groupName" 467 575 "htm" 468 576 "html" 577 "http" 578 "http:" 469 579 "http://" 470 580 "http://www.google.com/search?q=" 471 581 "https" 582 "https:" 472 583 "i" 473 584 "icon.db" … … 481 592 "image/tiff" 482 593 "img" 594 "info.colloquy" 483 595 "insertText:" 596 "inspectorStartsAttached" 484 597 "isLoading" 485 598 "isindex" 486 599 "javascript:" 600 "jpeg" 487 601 "js" 602 "kioskmode" 603 "ks_c_5601-1987" 604 "kungfoo.tv.ecto" 488 605 "lastVisitWasFailure" 606 "lastVisitWasHTTPNonGet" 489 607 "lastVisitedDate" 490 608 "line-through" … … 498 616 "mainFrameTitle" 499 617 "mainFrameURL" 500 "mainResource"501 618 "mimeType" 619 "missingImage" 502 620 "name: %@\npath: %@\nmimeTypes:\n%@\npluginDescription:%@" 621 "net.hmdt-web.Shiira" 622 "nullPlugin" 503 623 "nullplugin" 504 624 "oleacc.dll" 625 "opacity" 626 "org.xlife.NewsFire" 627 "panEastCursor" 628 "panIcon" 629 "panNorthCursor" 630 "panNorthEastCursor" 631 "panNorthWestCursor" 632 "panSouthCursor" 633 "panSouthEastCursor" 634 "panSouthWestCursor" 635 "panWestCursor" 505 636 "pluginHostPath" 506 637 "pluginspage" 638 "position" 639 "public.url" 640 "public.url-name" 507 641 "r" 508 642 "r+b" 643 "redirectURLs" 509 644 "rgb(%.0f,%.0f,%.0f)" 510 645 "rgba(%.0f,%.0f,%.0f,%f)" 511 646 "s" 647 "searchCancel" 648 "searchCancelPressed" 649 "searchMagnifier" 650 "searchMagnifierResults" 512 651 "sourceURL" 513 652 "src" 514 653 "sub" 515 "sub frameArchives"516 "sub resources"654 "sublayerTransform" 655 "sublayers" 517 656 "text/calendar" 518 657 "text/directory" … … 531 670 "text/x-vcard" 532 671 "text/x-vcf" 533 "text EncodingName"672 "textAreaResizeCorner" 534 673 "tiff" 674 "transform" 535 675 "txt" 536 676 "u" 677 "uk.co.opencommunity.vienna2" 537 678 "userAgent" 679 "userInfo" 538 680 "utf-16" 539 "vImagePermuteChannels_ARGB8888" 681 "verticalTextCursor" 682 "visibleName" 540 683 "visitCount" 541 684 "webkit-fake-url" … … 545 688 "xml" 546 689 "xsl" 690 "zoomInCursor" 691 "zoomOutCursor" 547 692 "{A3676398-4485-4a9d-87DC-CB5A40E6351D}" 548 693 "~/Library/Icons" … … 551 696 WebKit/mac/History/WebHistoryItem.mm:"children" 552 697 WebKit/mac/History/WebHistoryItem.mm:"title" 553 WebKit/mac/History/WebURLsWithTitles.h:"WebURLsWithTitlesPboardType"554 698 WebKit/mac/Misc/WebCache.mm:"Images" 555 699 WebKit/mac/Misc/WebKitLogging.h:"<not running on main thread>" 556 700 WebKit/mac/Misc/WebKitVersionChecks.m:"WebKit" 557 WebKit/mac/Misc/WebNSNotificationCenterExtras.m 558 WebKit/mac/Misc/WebNSObjectExtras.mm:"selector" 559 WebKit/mac/Misc/WebNSObjectExtras.mm:"value" 560 WebKit/mac/Misc/WebNSPasteboardExtras.mm 701 WebKit/mac/Misc/WebNSNotificationCenterExtras.m:"name" 702 WebKit/mac/Misc/WebNSNotificationCenterExtras.m:"object" 561 703 WebKit/mac/Misc/WebNSURLExtras.mm:"file" 562 704 WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm:" OK\n" 563 705 WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm:": " 564 WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm:"HTTP "565 706 WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm:"identity" 707 WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm:"localization" 566 708 WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:" OK\n" 567 709 WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:": " 568 WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:"HTTP "569 710 WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm:"identity" 711 WebKit/mac/Plugins/WebBaseNetscapePluginView.mm:"DIRECT" 712 WebKit/mac/Plugins/WebBaseNetscapePluginView.mm:"PROXY " 713 WebKit/mac/Plugins/WebBaseNetscapePluginView.mm:"SOCKS " 714 WebKit/mac/Plugins/WebBaseNetscapePluginView.mm:"basic" 715 WebKit/mac/Plugins/WebBaseNetscapePluginView.mm:"digest" 716 WebKit/mac/Plugins/WebBaseNetscapePluginView.mm:"true" 570 717 WebKit/mac/Plugins/WebBasePluginPackage.mm:"Java Applet Plugin Enabler" 571 WebKit/mac/Plugins/WebNetscapePluginPackage.m :"RealPlayer Plugin"572 WebKit/mac/Plugins/WebNetscapePluginPackage.m :"main"718 WebKit/mac/Plugins/WebNetscapePluginPackage.mm:"RealPlayer Plugin" 719 WebKit/mac/Plugins/WebNetscapePluginPackage.mm:"main" 573 720 WebKit/mac/Plugins/WebNetscapePluginView.mm:"height" 574 721 WebKit/mac/Plugins/WebNetscapePluginView.mm:"width" 575 WebKit/mac/Plugins/nptextinput.h576 722 WebKit/mac/WebCoreSupport/WebChromeClient.mm:"dialog" 577 723 WebKit/mac/WebCoreSupport/WebChromeClient.mm:"fullscreen" … … 590 736 WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:"height" 591 737 WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:"width" 738 WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"Menlo" 739 WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"Monaco" 592 740 WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"Web Inspector 2" 593 741 WebKit/mac/WebCoreSupport/WebInspectorClient.mm:"inspector" 594 WebKit/mac/WebView/WebArchive.mm:"result"595 742 WebKit/mac/WebView/WebHTMLView.mm:"'%@'" 596 743 WebKit/mac/WebView/WebHTMLView.mm:"Version:" … … 618 765 WebKit/mac/WebView/WebHTMLView.mm:"white" 619 766 WebKit/mac/WebView/WebPreferenceKeysPrivate.h 620 WebKit/mac/WebView/WebPreferences.mm 621 WebKit/mac/WebView/WebResource.mm:"URL" 622 WebKit/mac/WebView/WebResource.mm:"data" 623 WebKit/mac/WebView/WebResource.mm:"response" 624 WebKit/mac/WebView/WebResource.mm:"result" 767 WebKit/mac/WebView/WebPreferences.mm:"Apple Chancery" 768 WebKit/mac/WebView/WebPreferences.mm:"Courier" 769 WebKit/mac/WebView/WebPreferences.mm:"ISO-8859-1" 770 WebKit/mac/WebView/WebPreferences.mm:"Identifier" 771 WebKit/mac/WebView/WebPreferences.mm:"Papyrus" 772 WebKit/mac/WebView/WebPreferences.mm:"Values" 625 773 WebKit/mac/WebView/WebView.mm:"At least one WebView is still open." 626 774 WebKit/mac/WebView/WebView.mm:"At least one WebView was closed with fast teardown." … … 628 776 WebKit/mac/WebView/WebView.mm:"Search With Google" 629 777 WebKit/mac/WebView/WebView.mm:"control" 778 WebKit/mac/WebView/WebView.mm:"data" 779 WebKit/mac/WebView/WebView.mm:"decoder" 780 WebKit/mac/WebView/WebView.mm:"frame" 630 781 WebKit/mac/WebView/WebView.mm:"return " 631 WebKit/win/AccessibleBase.cpp 632 WebKit/win/DOMCoreClasses.h 782 WebKit/win/AccessibleBase.cpp:"Alt+" 783 WebKit/win/AccessibleBase.cpp:"Ctrl+" 784 WebKit/win/AccessibleBase.cpp:"Description: " 785 WebKit/win/AccessibleBase.cpp:"Shift+" 786 WebKit/win/AccessibleBase.cpp:"Win+" 633 787 WebKit/win/ProgIDMacros.h:"OpenSource" 634 788 WebKit/win/ProgIDMacros.h:"WebKit." … … 636 790 WebKit/win/WebCache.cpp:"scripts" 637 791 WebKit/win/WebCache.cpp:"style sheets" 792 WebKit/win/WebCoreSupport/WebInspectorClient.cpp:"Courier New" 638 793 WebKit/win/WebCoreSupport/WebInspectorClient.cpp:"Web Inspector " 639 794 WebKit/win/WebCoreSupport/WebInspectorClient.cpp:"Web Inspector" … … 641 796 WebKit/win/WebDatabaseManager.cpp:"Databases" 642 797 WebKit/win/WebHistoryItem.cpp:"title" 643 WebKit/win/WebKitDLL.cpp644 798 WebKit/win/WebPreferenceKeysPrivate.h 645 799 WebKit/win/WebPreferences.cpp:"Arial" … … 647 801 WebKit/win/WebPreferences.cpp:"Courier New" 648 802 WebKit/win/WebPreferences.cpp:"Times New Roman" 649 WebKit/win/WebScriptCallFrame.cpp:"False"650 WebKit/win/WebScriptCallFrame.cpp:"True"651 WebKit/win/WebScriptCallFrame.cpp:"undefined"652 803 WebKit/win/WebURLResponse.cpp:"Extension" 653 804 WebKit/win/WebView.cpp:"Cancel" … … 657 808 WebKit/win/WebView.cpp:"Paste" 658 809 WebKit/win/WebView.cpp:"Redo" 659 WebKit/win/WebView.cpp:"SelectAll"660 810 WebKit/win/WebView.cpp:"Undo" 661 WebKit/win/WebView.cpp:"Windows %d.%d"662 WebKit/win/WebView.cpp:"Windows 95"663 WebKit/win/WebView.cpp:"Windows 98"664 WebKit/win/WebView.cpp:"Windows 98; Win 9x 4.90"665 WebKit/win/WebView.cpp:"Windows NT %d.%d"666 811 WebKit/win/WebView.cpp:"about" -
trunk/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
r2 r561 1 1 WEBKIT_API_HEADERS = $$PWD/qwebframe.h \ 2 $$PWD/qgraphicswebview.h \ 2 3 $$PWD/qwebkitglobal.h \ 3 4 $$PWD/qwebpage.h \ … … 6 7 $$PWD/qwebhistoryinterface.h \ 7 8 $$PWD/qwebdatabase.h \ 8 $$PWD/qwebsecurityorigin.h 9 $$PWD/qwebsecurityorigin.h \ 10 $$PWD/qwebelement.h \ 11 $$PWD/qwebpluginfactory.h \ 12 $$PWD/qwebhistory.h \ 13 $$PWD/qwebinspector.h \ 14 $$PWD/qwebkitversion.h -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.cpp
r2 r561 20 20 #include "config.h" 21 21 #include "qwebdatabase.h" 22 22 23 #include "qwebdatabase_p.h" 23 24 #include "qwebsecurityorigin.h" … … 33 34 \brief The QWebDatabase class provides access to HTML 5 databases created with JavaScript. 34 35 36 \inmodule QtWebKit 37 35 38 The upcoming HTML 5 standard includes support for SQL databases that web sites can create and 36 access on a local computer through JavaScript. QWebDatabase is the C++ interface to these databases. 39 access on a local computer through JavaScript. QWebDatabase is the C++ interface to these 40 databases. 37 41 38 For more information refer to the \l{http://www.w3.org/html/wg/html5/#sql}{HTML 5 Draft Standard}. 42 To get access to all databases defined by a security origin, use QWebSecurityOrigin::databases(). 43 Each database has an internal name(), as well as a user-friendly name, provided by displayName(). 44 45 WebKit uses SQLite to create and access the local SQL databases. The location of the database 46 file in the local file system is returned by fileName(). You can access the database directly 47 through the QtSql database module. 48 49 For each database the web site can define an expectedSize(). The current size of the database 50 in bytes is returned by size(). 51 52 For more information refer to the \l{http://dev.w3.org/html5/webdatabase/}{HTML 5 Draft Standard}. 39 53 40 54 \sa QWebSecurityOrigin … … 44 58 Constructs a web database from \a other. 45 59 */ 46 QWebDatabase::QWebDatabase(const QWebDatabase& other) : d(other.d) 60 QWebDatabase::QWebDatabase(const QWebDatabase& other) 61 : d(other.d) 47 62 { 48 63 } … … 70 85 QString QWebDatabase::displayName() const 71 86 { 87 #if ENABLE(DATABASE) 72 88 DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get()); 73 89 return details.displayName(); 90 #else 91 return QString(); 92 #endif 74 93 } 75 94 … … 79 98 qint64 QWebDatabase::expectedSize() const 80 99 { 100 #if ENABLE(DATABASE) 81 101 DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get()); 82 102 return details.expectedUsage(); 103 #else 104 return 0; 105 #endif 83 106 } 84 107 … … 88 111 qint64 QWebDatabase::size() const 89 112 { 113 #if ENABLE(DATABASE) 90 114 DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get()); 91 115 return details.currentUsage(); 116 #else 117 return 0; 118 #endif 92 119 } 93 120 … … 115 142 116 143 \note Concurrent access to a database from multiple threads or processes 117 is not very efficient because S qlite is used as WebKit's database backend.144 is not very efficient because SQLite is used as WebKit's database backend. 118 145 */ 119 146 QString QWebDatabase::fileName() const 120 147 { 148 #if ENABLE(DATABASE) 121 149 return DatabaseTracker::tracker().fullPathForDatabase(d->origin.get(), d->name, false); 150 #else 151 return QString(); 152 #endif 122 153 } 123 154 … … 133 164 134 165 /*! 135 Removes the database , \a db, from its security origin. All data stored in this database136 will be destroyed.166 Removes the database \a db from its security origin. All data stored in the 167 database \a db will be destroyed. 137 168 */ 138 void QWebDatabase::removeDatabase(const QWebDatabase &db)169 void QWebDatabase::removeDatabase(const QWebDatabase& db) 139 170 { 171 #if ENABLE(DATABASE) 140 172 DatabaseTracker::tracker().deleteDatabase(db.d->origin.get(), db.d->name); 173 #endif 174 } 175 176 /*! 177 \since 4.6 178 179 Deletes all web databases in the configured offline storage path. 180 181 \sa QWebSettings::setOfflineStoragePath() 182 */ 183 void QWebDatabase::removeAllDatabases() 184 { 185 #if ENABLE(DATABASE) 186 DatabaseTracker::tracker().deleteAllDatabases(); 187 #endif 141 188 } 142 189 … … 147 194 { 148 195 } 196 -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h
r2 r561 32 32 class QWebSecurityOrigin; 33 33 34 class QWEBKIT_EXPORT QWebDatabase 35 { 34 class QWEBKIT_EXPORT QWebDatabase { 36 35 public: 37 36 QWebDatabase(const QWebDatabase& other); … … 46 45 QWebSecurityOrigin origin() const; 47 46 48 static void removeDatabase(const QWebDatabase &db); 47 static void removeDatabase(const QWebDatabase&); 48 static void removeAllDatabases(); 49 49 50 50 private: -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase_p.h
r2 r561 28 28 29 29 30 class QWebDatabasePrivate : public QSharedData 31 { 30 class QWebDatabasePrivate : public QSharedData { 32 31 public: 33 32 WebCore::String name; -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
r2 r561 21 21 #include "config.h" 22 22 #include "qwebframe.h" 23 24 #include "CallFrame.h" 25 #include "Document.h" 26 #include "DocumentLoader.h" 27 #include "DragData.h" 28 #include "Element.h" 29 #include "FocusController.h" 30 #include "Frame.h" 31 #include "FrameLoaderClientQt.h" 32 #include "FrameTree.h" 33 #include "FrameView.h" 34 #include "GCController.h" 35 #include "GraphicsContext.h" 36 #include "HTMLMetaElement.h" 37 #include "HitTestResult.h" 38 #include "IconDatabase.h" 39 #include "InspectorController.h" 40 #include "JSDOMBinding.h" 41 #include "JSDOMWindowBase.h" 42 #include "JSLock.h" 43 #include "JSObject.h" 44 #include "NodeList.h" 45 #include "Page.h" 46 #include "PlatformMouseEvent.h" 47 #include "PlatformWheelEvent.h" 48 #include "PrintContext.h" 49 #include "PutPropertySlot.h" 50 #include "RenderTreeAsText.h" 51 #include "RenderView.h" 52 #include "ResourceRequest.h" 53 #include "ScriptController.h" 54 #include "ScriptSourceCode.h" 55 #include "ScriptValue.h" 56 #include "Scrollbar.h" 57 #include "SelectionController.h" 58 #include "SubstituteData.h" 59 #include "htmlediting.h" 60 #include "markup.h" 61 #include "qt_instance.h" 62 #include "qt_runtime.h" 63 #include "qwebelement.h" 64 #include "qwebframe_p.h" 23 65 #include "qwebpage.h" 24 66 #include "qwebpage_p.h" 25 #include "qwebframe_p.h"26 67 #include "qwebsecurityorigin.h" 27 68 #include "qwebsecurityorigin_p.h" 28 29 #include "DocumentLoader.h"30 #include "FocusController.h"31 #include "FrameLoaderClientQt.h"32 #include "Frame.h"33 #include "FrameTree.h"34 #include "FrameView.h"35 #include "IconDatabase.h"36 #include "InspectorController.h"37 #include "Page.h"38 #include "PutPropertySlot.h"39 #include "ResourceRequest.h"40 #include "RenderView.h"41 #include "SelectionController.h"42 #include "Scrollbar.h"43 #include "PrintContext.h"44 #include "SubstituteData.h"45 46 #include "markup.h"47 #include "RenderTreeAsText.h"48 #include "Element.h"49 #include "Document.h"50 #include "DragData.h"51 #include "RenderView.h"52 #include "GraphicsContext.h"53 #include "PlatformMouseEvent.h"54 #include "PlatformWheelEvent.h"55 #include "GraphicsContext.h"56 #include "HitTestResult.h"57 58 #include "CallFrame.h"59 #include "JSDOMBinding.h"60 #include "JSDOMWindow.h"61 #include "JSLock.h"62 #include "JSObject.h"63 #include "qt_instance.h"64 #include "qt_runtime.h"65 69 #include "runtime.h" 66 70 #include "runtime_object.h" 67 71 #include "runtime_root.h" 68 #include "ScriptController.h"69 #include "ScriptSourceCode.h"70 #include "ScriptValue.h"71 72 72 #include "wtf/HashMap.h" 73 73 #include <QMultiMap> 74 74 #include <qdebug.h> 75 75 #include <qevent.h> 76 76 #include <qfileinfo.h> 77 77 #include <qpainter.h> 78 #include <QMultiMap> 78 #include <qprinter.h> 79 #include <qregion.h> 80 81 #if QT_VERSION < 0x040400 82 #include "qwebnetworkinterface.h" 83 #endif 84 79 85 #if QT_VERSION >= 0x040400 80 86 #include <qnetworkrequest.h> 81 #else82 #include "qwebnetworkinterface.h"83 87 #endif 84 #include <qregion.h>85 #include <qprinter.h>86 #include "HTMLMetaElement.h"87 #include "NodeList.h"88 88 89 89 using namespace WebCore; … … 96 96 void QWEBKIT_EXPORT qt_drt_setJavaScriptProfilingEnabled(QWebFrame* qframe, bool enabled) 97 97 { 98 #if ENABLE(JAVASCRIPT_DEBUGGER) 98 99 Frame* frame = QWebFramePrivate::core(qframe); 99 100 InspectorController* controller = frame->page()->inspectorController(); … … 104 105 else 105 106 controller->disableProfiler(); 106 } 107 108 void QWebFramePrivate::init(QWebFrame *qframe, WebCore::Page *webcorePage, QWebFrameData *frameData) 107 #endif 108 } 109 110 // Pause a given CSS animation or transition on the target node at a specific time. 111 // If the animation or transition is already paused, it will update its pause time. 112 // This method is only intended to be used for testing the CSS animation and transition system. 113 bool QWEBKIT_EXPORT qt_drt_pauseAnimation(QWebFrame *qframe, const QString &animationName, double time, const QString &elementId) 114 { 115 Frame* frame = QWebFramePrivate::core(qframe); 116 if (!frame) 117 return false; 118 119 AnimationController* controller = frame->animation(); 120 if (!controller) 121 return false; 122 123 Document* doc = frame->document(); 124 Q_ASSERT(doc); 125 126 Node* coreNode = doc->getElementById(elementId); 127 if (!coreNode || !coreNode->renderer()) 128 return false; 129 130 return controller->pauseAnimationAtTime(coreNode->renderer(), animationName, time); 131 } 132 133 bool QWEBKIT_EXPORT qt_drt_pauseTransitionOfProperty(QWebFrame *qframe, const QString &propertyName, double time, const QString &elementId) 134 { 135 Frame* frame = QWebFramePrivate::core(qframe); 136 if (!frame) 137 return false; 138 139 AnimationController* controller = frame->animation(); 140 if (!controller) 141 return false; 142 143 Document* doc = frame->document(); 144 Q_ASSERT(doc); 145 146 Node* coreNode = doc->getElementById(elementId); 147 if (!coreNode || !coreNode->renderer()) 148 return false; 149 150 return controller->pauseTransitionAtTime(coreNode->renderer(), propertyName, time); 151 } 152 153 // Returns the total number of currently running animations (includes both CSS transitions and CSS animations). 154 int QWEBKIT_EXPORT qt_drt_numberOfActiveAnimations(QWebFrame *qframe) 155 { 156 Frame* frame = QWebFramePrivate::core(qframe); 157 if (!frame) 158 return false; 159 160 AnimationController* controller = frame->animation(); 161 if (!controller) 162 return false; 163 164 return controller->numberOfActiveAnimations(); 165 } 166 167 void QWEBKIT_EXPORT qt_drt_clearFrameName(QWebFrame* qFrame) 168 { 169 Frame* frame = QWebFramePrivate::core(qFrame); 170 frame->tree()->clearName(); 171 } 172 173 int QWEBKIT_EXPORT qt_drt_javaScriptObjectsCount() 174 { 175 return JSDOMWindowBase::commonJSGlobalData()->heap.globalObjectCount(); 176 } 177 178 void QWEBKIT_EXPORT qt_drt_garbageCollector_collect() 179 { 180 gcController().garbageCollectNow(); 181 } 182 183 void QWEBKIT_EXPORT qt_drt_garbageCollector_collectOnAlternateThread(bool waitUntilDone) 184 { 185 gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone); 186 } 187 188 // Returns the value of counter in the element specified by \a id. 189 QString QWEBKIT_EXPORT qt_drt_counterValueForElementById(QWebFrame* qFrame, const QString& id) 190 { 191 Frame* frame = QWebFramePrivate::core(qFrame); 192 if (Document* document = frame->document()) { 193 Element* element = document->getElementById(id); 194 return WebCore::counterValueForElement(element); 195 } 196 return QString(); 197 } 198 199 // Suspend active DOM objects in this frame. 200 void QWEBKIT_EXPORT qt_suspendActiveDOMObjects(QWebFrame* qFrame) 201 { 202 Frame* frame = QWebFramePrivate::core(qFrame); 203 if (frame->document()) 204 frame->document()->suspendActiveDOMObjects(); 205 } 206 207 // Resume active DOM objects in this frame. 208 void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* qFrame) 209 { 210 Frame* frame = QWebFramePrivate::core(qFrame); 211 if (frame->document()) 212 frame->document()->resumeActiveDOMObjects(); 213 } 214 215 QWebFrameData::QWebFrameData(WebCore::Page* parentPage, WebCore::Frame* parentFrame, 216 WebCore::HTMLFrameOwnerElement* ownerFrameElement, 217 const WebCore::String& frameName) 218 : name(frameName) 219 , ownerElement(ownerFrameElement) 220 , page(parentPage) 221 , allowsScrolling(true) 222 , marginWidth(0) 223 , marginHeight(0) 224 { 225 frameLoaderClient = new FrameLoaderClientQt(); 226 frame = Frame::create(page, ownerElement, frameLoaderClient); 227 228 // FIXME: All of the below should probably be moved over into WebCore 229 frame->tree()->setName(name); 230 if (parentFrame) 231 parentFrame->tree()->appendChild(frame); 232 } 233 234 void QWebFramePrivate::init(QWebFrame *qframe, QWebFrameData *frameData) 109 235 { 110 236 q = qframe; … … 113 239 marginWidth = frameData->marginWidth; 114 240 marginHeight = frameData->marginHeight; 115 116 frameLoaderClient = new FrameLoaderClientQt(); 117 RefPtr<Frame> newFrame = Frame::create(webcorePage, frameData->ownerElement, frameLoaderClient); 118 frame = newFrame.get(); 241 frame = frameData->frame.get(); 242 frameLoaderClient = frameData->frameLoaderClient; 119 243 frameLoaderClient->setFrame(qframe, frame); 120 121 // FIXME: All of the below should probably be moved over into WebCore122 frame->tree()->setName(frameData->name);123 if (QWebFrame* _parentFrame = parentFrame())124 QWebFramePrivate::core(_parentFrame)->tree()->appendChild(frame);125 126 // balanced by adoptRef in FrameLoaderClientQt::createFrame127 if (frameData->ownerElement)128 frame->ref();129 244 130 245 frame->init(); … … 145 260 } 146 261 262 void QWebFramePrivate::renderPrivate(QPainter *painter, QWebFrame::RenderLayer layer, const QRegion &clip) 263 { 264 if (!frame->view() || !frame->contentRenderer()) 265 return; 266 267 QVector<QRect> vector = clip.rects(); 268 if (vector.isEmpty()) 269 return; 270 271 GraphicsContext context(painter); 272 if (context.paintingDisabled() && !context.updatingControlTints()) 273 return; 274 275 WebCore::FrameView* view = frame->view(); 276 view->layoutIfNeededRecursive(); 277 278 for (int i = 0; i < vector.size(); ++i) { 279 const QRect& clipRect = vector.at(i); 280 QRect intersectedRect = clipRect.intersected(view->frameRect()); 281 282 painter->save(); 283 painter->setClipRect(clipRect, Qt::IntersectClip); 284 285 int x = view->x(); 286 int y = view->y(); 287 288 if (layer & QWebFrame::ContentsLayer) { 289 context.save(); 290 291 int scrollX = view->scrollX(); 292 int scrollY = view->scrollY(); 293 294 QRect rect = intersectedRect; 295 context.translate(x, y); 296 rect.translate(-x, -y); 297 context.translate(-scrollX, -scrollY); 298 rect.translate(scrollX, scrollY); 299 context.clip(view->visibleContentRect()); 300 301 view->paintContents(&context, rect); 302 303 context.restore(); 304 } 305 306 if (layer & QWebFrame::ScrollBarLayer 307 && !view->scrollbarsSuppressed() 308 && (view->horizontalScrollbar() || view->verticalScrollbar())) { 309 context.save(); 310 311 QRect rect = intersectedRect; 312 context.translate(x, y); 313 rect.translate(-x, -y); 314 315 view->paintScrollbars(&context, rect); 316 317 context.restore(); 318 } 319 320 if (layer & QWebFrame::PanIconLayer) 321 view->paintPanScrollIcon(&context); 322 323 painter->restore(); 324 } 325 } 326 327 static bool webframe_scrollOverflow(WebCore::Frame* frame, int dx, int dy) 328 { 329 if (!frame || !frame->document() || !frame->eventHandler()) 330 return false; 331 332 Node* node = frame->document()->focusedNode(); 333 if (!node) 334 node = frame->document()->elementFromPoint(frame->eventHandler()->currentMousePosition().x(), 335 frame->eventHandler()->currentMousePosition().y()); 336 if (!node) 337 return false; 338 339 RenderObject* renderer = node->renderer(); 340 if (!renderer) 341 return false; 342 343 if (renderer->isListBox()) 344 return false; 345 346 RenderLayer* renderLayer = renderer->enclosingLayer(); 347 if (!renderLayer) 348 return false; 349 350 bool scrolledHorizontal = false; 351 bool scrolledVertical = false; 352 353 if (dx > 0) 354 scrolledHorizontal = renderLayer->scroll(ScrollRight, ScrollByPixel, dx); 355 else if (dx < 0) 356 scrolledHorizontal = renderLayer->scroll(ScrollLeft, ScrollByPixel, qAbs(dx)); 357 358 if (dy > 0) 359 scrolledVertical = renderLayer->scroll(ScrollDown, ScrollByPixel, dy); 360 else if (dy < 0) 361 scrolledVertical = renderLayer->scroll(ScrollUp, ScrollByPixel, qAbs(dy)); 362 363 return (scrolledHorizontal || scrolledVertical); 364 } 365 147 366 /*! 148 367 \class QWebFrame 149 368 \since 4.4 150 369 \brief The QWebFrame class represents a frame in a web page. 370 371 \inmodule QtWebKit 151 372 152 373 QWebFrame represents a frame inside a web page. Each QWebPage … … 159 380 160 381 The page() function returns a pointer to the web page object. See 161 \l{ Elements of QWebView} for an explanation of how web382 \l{QWebView}{Elements of QWebView} for an explanation of how web 162 383 frames are related to a web page and web view. 384 385 The QWebFrame class also offers methods to retrieve both the URL currently 386 loaded by the frame (see url()) as well as the URL originally requested 387 to be loaded (see requestedUrl()). These methods make possible the retrieval 388 of the URL before and after a DNS resolution or a redirection occurs during 389 the load process. The requestedUrl() also matches to the URL added to the 390 frame history (\l{QWebHistory}) if load is successful. 163 391 164 392 The title of an HTML frame can be accessed with the title() property. … … 184 412 */ 185 413 414 /*! 415 \enum QWebFrame::RenderLayer 416 417 This enum describes the layers available for rendering using \l{QWebFrame::}{render()}. 418 The layers can be OR-ed together from the following list: 419 420 \value ContentsLayer The web content of the frame 421 \value ScrollBarLayer The scrollbars of the frame 422 \value PanIconLayer The icon used when panning the frame 423 424 \value AllLayers Includes all the above layers 425 */ 426 186 427 QWebFrame::QWebFrame(QWebPage *parent, QWebFrameData *frameData) 187 428 : QObject(parent) … … 189 430 { 190 431 d->page = parent; 191 d->init(this, parent->d->page,frameData);432 d->init(this, frameData); 192 433 193 434 if (!frameData->url.isEmpty()) { 194 435 WebCore::ResourceRequest request(frameData->url, frameData->referrer); 195 d->frame->loader()->load(request, frameData->name );436 d->frame->loader()->load(request, frameData->name, false); 196 437 } 197 438 } … … 202 443 { 203 444 d->page = parent->d->page; 204 d->init(this, parent->d->page->d->page,frameData);445 d->init(this, frameData); 205 446 } 206 447 … … 225 466 javaScriptWindowObjectCleared() signal. 226 467 468 If Javascript is not enabled for this page, then this method does nothing. 469 227 470 The \a object will never be explicitly deleted by QtWebKit. 228 471 */ … … 247 490 javaScriptWindowObjectCleared() signal. 248 491 492 If Javascript is not enabled for this page, then this method does nothing. 493 249 494 The ownership of \a object is specified using \a own. 250 495 */ 251 496 void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership) 252 497 { 253 JSC::JSLock lock(false); 254 JSDOMWindow* window = toJSDOMWindow(d->frame); 498 if (!page()->settings()->testAttribute(QWebSettings::JavascriptEnabled)) 499 return; 500 501 JSC::JSLock lock(JSC::SilenceAssertionsOnly); 502 JSDOMWindow* window = toJSDOMWindow(d->frame, mainThreadNormalWorld()); 255 503 JSC::Bindings::RootObject* root = d->frame->script()->bindingRootObject(); 256 504 if (!window) { … … 261 509 JSC::ExecState* exec = window->globalExec(); 262 510 263 JSC::JSObject* runtimeObject =264 JSC::Bindings::Instance::createRuntimeObject(exec, JSC::Bindings::QtInstance::getQtInstance(object, root, ownership));511 JSC::JSObject* runtimeObject = 512 JSC::Bindings::QtInstance::getQtInstance(object, root, ownership)->createRuntimeObject(exec); 265 513 266 514 JSC::PutPropertySlot slot; … … 269 517 270 518 /*! 271 Returns the frame's content , converted to HTML.519 Returns the frame's content as HTML, enclosed in HTML and BODY tags. 272 520 273 521 \sa setHtml(), toPlainText() … … 281 529 282 530 /*! 283 Returns the content of this frame converted to plain text. 531 Returns the content of this frame converted to plain text, completely 532 stripped of all HTML formatting. 284 533 285 534 \sa toHtml() … … 291 540 292 541 Element *documentElement = d->frame->document()->documentElement(); 293 return documentElement->innerText(); 542 if (documentElement) 543 return documentElement->innerText(); 544 return QString(); 294 545 } 295 546 … … 317 568 if (d->frame->document()) 318 569 return d->frame->loader()->documentLoader()->title(); 319 elsereturn QString();570 return QString(); 320 571 } 321 572 … … 353 604 QMultiMap<QString, QString> QWebFrame::metaData() const 354 605 { 355 if (!d->frame->document())356 return QMap<QString, QString>();357 358 QMultiMap<QString, QString> map;606 if (!d->frame->document()) 607 return QMap<QString, QString>(); 608 609 QMultiMap<QString, QString> map; 359 610 Document* doc = d->frame->document(); 360 611 RefPtr<NodeList> list = doc->getElementsByTagName("meta"); … … 395 646 396 647 /*! 648 \since 4.6 649 \property QWebFrame::requestedUrl 650 651 The URL requested to loaded by the frame currently viewed. The URL may differ from 652 the one returned by url() if a DNS resolution or a redirection occurs. 653 654 \sa url(), setUrl() 655 */ 656 QUrl QWebFrame::requestedUrl() const 657 { 658 // There are some possible edge cases to be handled here, 659 // apart from checking if activeDocumentLoader is valid: 660 // 661 // * Method can be called while processing an unsucessful load. 662 // In this case, frameLoaderClient will hold the current error 663 // (m_loadError), and we will make use of it to recover the 'failingURL'. 664 // * If the 'failingURL' holds a null'ed string though, we fallback 665 // to 'outgoingReferrer' (it yet is safer than originalRequest). 666 FrameLoader* loader = d->frame->loader(); 667 FrameLoaderClientQt* loaderClient = d->frameLoaderClient; 668 669 if (!loader->activeDocumentLoader() 670 || !loaderClient->m_loadError.isNull()) { 671 if (!loaderClient->m_loadError.failingURL().isNull()) 672 return QUrl(loaderClient->m_loadError.failingURL()); 673 else if (!loader->outgoingReferrer().isEmpty()) 674 return QUrl(loader->outgoingReferrer()); 675 } 676 677 return loader->originalRequest().url(); 678 } 679 /*! 680 \since 4.6 681 \property QWebFrame::baseUrl 682 \brief the base URL of the frame, can be used to resolve relative URLs 683 \since 4.6 684 */ 685 686 QUrl QWebFrame::baseUrl() const 687 { 688 return d->frame->loader()->baseURL(); 689 } 690 691 /*! 397 692 \property QWebFrame::icon 398 693 \brief the icon associated with this frame … … 468 763 request.setHTTPBody(WebCore::FormData::create(postData.constData(), postData.size())); 469 764 470 d->frame->loader()->load(request );765 d->frame->loader()->load(request, false); 471 766 472 767 if (d->parentFrame()) … … 510 805 request.setHTTPMethod("POST"); 511 806 break; 807 #if QT_VERSION >= 0x040600 808 case QNetworkAccessManager::DeleteOperation: 809 request.setHTTPMethod("DELETE"); 810 break; 811 #endif 512 812 case QNetworkAccessManager::UnknownOperation: 513 813 // eh? … … 524 824 request.setHTTPBody(WebCore::FormData::create(body.constData(), body.size())); 525 825 526 d->frame->loader()->load(request );826 d->frame->loader()->load(request, false); 527 827 528 828 if (d->parentFrame()) … … 536 836 537 837 The \a html is loaded immediately; external objects are loaded asynchronously. 838 839 If a script in the \a html runs longer than the default script timeout (currently 10 seconds), 840 for example due to being blocked by a modal JavaScript alert dialog, this method will return 841 as soon as possible after the timeout and any subsequent \a html will be loaded asynchronously. 538 842 539 843 When using this method WebKit assumes that external resources such as JavaScript programs or style … … 542 846 for the encoding to be specified by web server. 543 847 544 \sa toHtml() 848 \note This method will not affect session or global history for the frame. 849 850 \sa toHtml(), setContent() 545 851 */ 546 852 void QWebFrame::setHtml(const QString &html, const QUrl &baseUrl) … … 550 856 const QByteArray utf8 = html.toUtf8(); 551 857 WTF::RefPtr<WebCore::SharedBuffer> data = WebCore::SharedBuffer::create(utf8.constData(), utf8.length()); 552 WebCore::SubstituteData substituteData(data, WebCore::String("text/html"), WebCore::String("utf-8"), kurl);553 d->frame->loader()->load(request, substituteData );858 WebCore::SubstituteData substituteData(data, WebCore::String("text/html"), WebCore::String("utf-8"), KURL()); 859 d->frame->loader()->load(request, substituteData, false); 554 860 } 555 861 … … 563 869 The \a data is loaded immediately; external objects are loaded asynchronously. 564 870 565 \sa toHtml() 871 \note This method will not affect session or global history for the frame. 872 873 \sa toHtml(), setHtml() 566 874 */ 567 875 void QWebFrame::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl) … … 573 881 if (actualMimeType.isEmpty()) 574 882 actualMimeType = QLatin1String("text/html"); 575 WebCore::SubstituteData substituteData(buffer, WebCore::String(actualMimeType), WebCore::String(), kurl); 576 d->frame->loader()->load(request, substituteData); 577 } 578 883 WebCore::SubstituteData substituteData(buffer, WebCore::String(actualMimeType), WebCore::String(), KURL()); 884 d->frame->loader()->load(request, substituteData, false); 885 } 579 886 580 887 /*! … … 635 942 if (d->frame->view()) { 636 943 d->frame->view()->setHorizontalScrollbarMode((ScrollbarMode)policy); 637 d->frame->view()->updateDefaultScrollbarState();638 944 } 639 945 } else { … … 641 947 if (d->frame->view()) { 642 948 d->frame->view()->setVerticalScrollbarMode((ScrollbarMode)policy); 643 d->frame->view()->updateDefaultScrollbarState();644 949 } 645 950 } … … 678 983 Scrollbar *sb; 679 984 sb = (orientation == Qt::Horizontal) ? d->horizontalScrollBar() : d->verticalScrollBar(); 680 if (sb) {985 if (sb) 681 986 return sb->value(); 682 }683 987 return 0; 684 988 } … … 708 1012 int QWebFrame::scrollBarMinimum(Qt::Orientation orientation) const 709 1013 { 1014 Q_UNUSED(orientation) 710 1015 return 0; 1016 } 1017 1018 /*! 1019 \since 4.6 1020 Returns the geometry for the scrollbar with orientation \a orientation. 1021 1022 If the scrollbar does not exist an empty rect is returned. 1023 */ 1024 QRect QWebFrame::scrollBarGeometry(Qt::Orientation orientation) const 1025 { 1026 Scrollbar *sb; 1027 sb = (orientation == Qt::Horizontal) ? d->horizontalScrollBar() : d->verticalScrollBar(); 1028 if (sb) 1029 return sb->frameRect(); 1030 return QRect(); 711 1031 } 712 1032 … … 715 1035 Scrolls the frame \a dx pixels to the right and \a dy pixels downward. Both 716 1036 \a dx and \a dy may be negative. 717 1037 718 1038 \sa QWebFrame::scrollPosition 719 1039 */ … … 723 1043 if (!d->frame->view()) 724 1044 return; 725 1045 726 1046 d->frame->view()->scrollBy(IntSize(dx, dy)); 1047 } 1048 1049 /*! 1050 \since 4.7 1051 \internal 1052 Scrolls nested frames starting at this frame, \a dx pixels to the right 1053 and \a dy pixels downward. Both \a dx and \a dy may be negative. First attempts 1054 to scroll elements with CSS overflow followed by this frame. If this 1055 frame doesn't scroll, attempts to scroll the parent 1056 1057 \sa QWebFrame::scroll 1058 */ 1059 bool QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int dx, int dy) 1060 { 1061 Frame* frame = QWebFramePrivate::core(qFrame); 1062 bool scrolledHorizontal = false; 1063 bool scrolledVertical = false; 1064 bool scrolledOverflow = webframe_scrollOverflow(frame, dx, dy); 1065 1066 if (!scrolledOverflow) { 1067 if (!frame || !frame->view()) 1068 return false; 1069 1070 do { 1071 IntSize scrollOffset = frame->view()->scrollOffset(); 1072 IntPoint maxScrollOffset = frame->view()->maximumScrollPosition(); 1073 1074 if (dx > 0) // scroll right 1075 scrolledHorizontal = scrollOffset.width() < maxScrollOffset.x(); 1076 else if (dx < 0) // scroll left 1077 scrolledHorizontal = scrollOffset.width() > 0; 1078 1079 if (dy > 0) // scroll down 1080 scrolledVertical = scrollOffset.height() < maxScrollOffset.y(); 1081 else if (dy < 0) //scroll up 1082 scrolledVertical = scrollOffset.height() > 0; 1083 1084 if (scrolledHorizontal || scrolledVertical) { 1085 frame->view()->scrollBy(IntSize(dx, dy)); 1086 return true; 1087 } 1088 frame = frame->tree()->parent(); 1089 } while (frame && frame->view()); 1090 } 1091 return (scrolledHorizontal || scrolledVertical || scrolledOverflow); 727 1092 } 728 1093 … … 736 1101 { 737 1102 if (!d->frame->view()) 738 return QPoint(0, 0);1103 return QPoint(0, 0); 739 1104 740 1105 IntSize ofs = d->frame->view()->scrollOffset(); … … 751 1116 752 1117 /*! 1118 \since 4.6 1119 Render the \a layer of the frame using \a painter clipping to \a clip. 1120 1121 \sa print() 1122 */ 1123 1124 void QWebFrame::render(QPainter* painter, RenderLayer layer, const QRegion& clip) 1125 { 1126 if (!clip.isEmpty()) 1127 d->renderPrivate(painter, layer, clip); 1128 else if (d->frame->view()) 1129 d->renderPrivate(painter, layer, QRegion(d->frame->view()->frameRect())); 1130 } 1131 1132 /*! 753 1133 Render the frame into \a painter clipping to \a clip. 754 755 \sa print()756 1134 */ 757 1135 void QWebFrame::render(QPainter *painter, const QRegion &clip) 758 1136 { 759 if (!d->frame->view() || !d->frame->contentRenderer()) 1137 d->renderPrivate(painter, AllLayers, clip); 1138 } 1139 1140 /*! 1141 Render the frame into \a painter. 1142 */ 1143 void QWebFrame::render(QPainter *painter) 1144 { 1145 if (!d->frame->view()) 760 1146 return; 761 1147 762 d->frame->view()->layoutIfNeededRecursive(); 763 764 GraphicsContext ctx(painter); 765 QVector<QRect> vector = clip.rects(); 766 WebCore::FrameView* view = d->frame->view(); 767 for (int i = 0; i < vector.size(); ++i) { 768 if (i > 0) { 769 painter->save(); 770 painter->setClipRect(vector.at(i), Qt::IntersectClip); 771 } 772 773 view->paint(&ctx, vector.at(i)); 774 775 if (i > 0) 776 painter->restore(); 777 } 778 } 779 780 /*! 781 Render the frame into \a painter. 782 */ 783 void QWebFrame::render(QPainter *painter) 784 { 785 if (!d->frame->view() || !d->frame->contentRenderer()) 786 return; 787 788 d->frame->view()->layoutIfNeededRecursive(); 789 790 GraphicsContext ctx(painter); 791 WebCore::FrameView* view = d->frame->view(); 792 view->paint(&ctx, view->frameRect()); 1148 d->renderPrivate(painter, AllLayers, QRegion(d->frame->view()->frameRect())); 793 1149 } 794 1150 … … 839 1195 840 1196 /*! 1197 \property QWebFrame::focus 1198 \since 4.6 1199 1200 Returns true if this frame has keyboard input focus; otherwise, returns false. 1201 */ 1202 bool QWebFrame::hasFocus() const 1203 { 1204 WebCore::Frame* ff = d->frame->page()->focusController()->focusedFrame(); 1205 return ff && QWebFramePrivate::kit(ff) == this; 1206 } 1207 1208 /*! 1209 \since 4.6 1210 1211 Gives keyboard input focus to this frame. 1212 */ 1213 void QWebFrame::setFocus() 1214 { 1215 QWebFramePrivate::core(this)->page()->focusController()->setFocusedFrame(QWebFramePrivate::core(this)); 1216 } 1217 1218 /*! 841 1219 Returns the position of the frame relative to it's parent frame. 842 1220 */ … … 862 1240 \property QWebFrame::contentsSize 863 1241 \brief the size of the contents in this frame 1242 1243 \sa contentsSizeChanged() 864 1244 */ 865 1245 QSize QWebFrame::contentsSize() const … … 872 1252 873 1253 /*! 1254 \since 4.6 1255 1256 Returns the document element of this frame. 1257 1258 The document element provides access to the entire structured 1259 content of the frame. 1260 */ 1261 QWebElement QWebFrame::documentElement() const 1262 { 1263 WebCore::Document *doc = d->frame->document(); 1264 if (!doc) 1265 return QWebElement(); 1266 return QWebElement(doc->documentElement()); 1267 } 1268 1269 /*! 1270 \since 4.6 1271 Returns a new list of elements matching the given CSS selector \a selectorQuery. 1272 If there are no matching elements, an empty list is returned. 1273 1274 \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector} syntax is 1275 used for the query. 1276 1277 \sa QWebElement::findAll() 1278 */ 1279 QWebElementCollection QWebFrame::findAllElements(const QString &selectorQuery) const 1280 { 1281 return documentElement().findAll(selectorQuery); 1282 } 1283 1284 /*! 1285 \since 4.6 1286 Returns the first element in the frame's document that matches the 1287 given CSS selector \a selectorQuery. If there is no matching element, a 1288 null element is returned. 1289 1290 \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector} syntax is 1291 used for the query. 1292 1293 \sa QWebElement::findFirst() 1294 */ 1295 QWebElement QWebFrame::findFirstElement(const QString &selectorQuery) const 1296 { 1297 return documentElement().findFirst(selectorQuery); 1298 } 1299 1300 /*! 874 1301 Performs a hit test on the frame contents at the given position \a pos and returns the hit test result. 875 1302 */ … … 879 1306 return QWebHitTestResult(); 880 1307 881 HitTestResult result = d->frame->eventHandler()->hitTestResultAtPoint(d->frame->view()->windowToContents(pos), /*allowShadowContent*/ false); 1308 HitTestResult result = d->frame->eventHandler()->hitTestResultAtPoint(d->frame->view()->windowToContents(pos), /*allowShadowContent*/ false, /*ignoreClipping*/ true); 1309 1310 if (result.scrollbar()) 1311 return QWebHitTestResult(); 1312 882 1313 return QWebHitTestResult(new QWebHitTestResultPrivate(result)); 883 1314 } … … 916 1347 printContext.begin(pageRect.width()); 917 1348 918 printContext.computePageRects(pageRect, /* headerHeight*/0, /*footerHeight*/0, /*userScaleFactor*/1.0, pageHeight);1349 printContext.computePageRects(pageRect, /* headerHeight */ 0, /* footerHeight */ 0, /* userScaleFactor */ 1.0, pageHeight); 919 1350 920 1351 int docCopies; 921 1352 int pageCopies; 922 if (printer->collateCopies() == true){1353 if (printer->collateCopies()) { 923 1354 docCopies = 1; 924 1355 pageCopies = printer->numCopies(); … … 994 1425 QVariant rc; 995 1426 if (proxy) { 996 JSC::JSValuePtr v = proxy->evaluate(ScriptSourceCode(scriptSource)).jsValue(); 997 if (v) { 998 int distance = 0; 999 rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject()->globalExec(), v, QMetaType::Void, &distance); 1000 } 1427 JSC::JSValue v = d->frame->script()->executeScript(ScriptSourceCode(scriptSource)).jsValue(); 1428 int distance = 0; 1429 rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject(mainThreadNormalWorld())->globalExec(), v, QMetaType::Void, &distance); 1001 1430 } 1002 1431 return rc; … … 1080 1509 1081 1510 /*! 1511 \fn void QWebFrame::contentsSizeChanged(const QSize &size) 1512 \since 4.6 1513 1514 This signal is emitted when the frame's contents size changes 1515 to \a size. 1516 1517 \sa contentsSize() 1518 */ 1519 1520 /*! 1521 \fn void QWebFrame::loadStarted() 1522 \since 4.6 1523 1524 This signal is emitted when a new load of this frame is started. 1525 1526 \sa loadFinished() 1527 */ 1528 1529 /*! 1530 \fn void QWebFrame::loadFinished(bool ok) 1531 \since 4.6 1532 1533 This signal is emitted when a load of this frame is finished. 1534 \a ok will indicate whether the load was successful or any error occurred. 1535 1536 \sa loadStarted() 1537 */ 1538 1539 /*! 1082 1540 \class QWebHitTestResult 1083 1541 \since 4.4 … … 1085 1543 page content after a hit test. 1086 1544 1545 \inmodule QtWebKit 1546 1087 1547 QWebHitTestResult is returned by QWebFrame::hitTestContent() to provide 1088 1548 information about the content of the web page at the specified position. … … 1100 1560 : isContentEditable(false) 1101 1561 , isContentSelected(false) 1562 , isScrollBar(false) 1102 1563 { 1103 1564 if (!hitTest.innerNode()) 1104 1565 return; 1105 1566 pos = hitTest.point(); 1106 boundingRect = hitTest.boundingBox();1107 title = hitTest.title( );1567 WebCore::TextDirection dir; 1568 title = hitTest.title(dir); 1108 1569 linkText = hitTest.textContent(); 1109 1570 linkUrl = hitTest.absoluteLinkURL(); … … 1111 1572 alternateText = hitTest.altDisplayString(); 1112 1573 imageUrl = hitTest.absoluteImageURL(); 1574 innerNode = hitTest.innerNode(); 1113 1575 innerNonSharedNode = hitTest.innerNonSharedNode(); 1576 boundingRect = innerNonSharedNode ? innerNonSharedNode->renderer()->absoluteBoundingBoxRect(true) : IntRect(); 1114 1577 WebCore::Image *img = hitTest.image(); 1115 1578 if (img) { … … 1121 1584 if (wframe) 1122 1585 linkTargetFrame = QWebFramePrivate::kit(wframe); 1586 linkElement = QWebElement(hitTest.URLElement()); 1123 1587 1124 1588 isContentEditable = hitTest.isContentEditable(); 1125 1589 isContentSelected = hitTest.isSelected(); 1590 isScrollBar = hitTest.scrollbar(); 1126 1591 1127 1592 if (innerNonSharedNode && innerNonSharedNode->document() 1128 1593 && innerNonSharedNode->document()->frame()) 1129 1594 frame = QWebFramePrivate::kit(innerNonSharedNode->document()->frame()); 1595 1596 enclosingBlock = QWebElement(WebCore::enclosingBlock(innerNode.get())); 1130 1597 } 1131 1598 … … 1204 1671 1205 1672 /*! 1673 \since 4.6 1674 Returns the block element that encloses the element hit. 1675 1676 A block element is an element that is rendered using the 1677 CSS "block" style. This includes for example text 1678 paragraphs. 1679 */ 1680 QWebElement QWebHitTestResult::enclosingBlockElement() const 1681 { 1682 if (!d) 1683 return QWebElement(); 1684 return d->enclosingBlock; 1685 } 1686 1687 /*! 1206 1688 Returns the title of the nearest enclosing HTML element. 1207 1689 */ … … 1244 1726 1245 1727 /*! 1728 \since 4.6 1729 Returns the element that represents the link. 1730 1731 \sa linkTargetFrame() 1732 */ 1733 QWebElement QWebHitTestResult::linkElement() const 1734 { 1735 if (!d) 1736 return QWebElement(); 1737 return d->linkElement; 1738 } 1739 1740 /*! 1246 1741 Returns the frame that will load the link if it is activated. 1742 1743 \sa linkElement() 1247 1744 */ 1248 1745 QWebFrame *QWebHitTestResult::linkTargetFrame() const … … 1305 1802 1306 1803 /*! 1804 \since 4.6 1805 Returns the underlying DOM element as QWebElement. 1806 */ 1807 QWebElement QWebHitTestResult::element() const 1808 { 1809 if (!d || !d->innerNonSharedNode || !d->innerNonSharedNode->isElementNode()) 1810 return QWebElement(); 1811 1812 return QWebElement(static_cast<WebCore::Element*>(d->innerNonSharedNode.get())); 1813 } 1814 1815 /*! 1307 1816 Returns the frame the hit test was executed in. 1308 1817 */ … … 1313 1822 return d->frame; 1314 1823 } 1315 -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h
r2 r561 1 1 /* 2 Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)2 Copyright (C) 2008,2009 Nokia Corporation and/or its subsidiary(-ies) 3 3 Copyright (C) 2007 Staikos Computing Services Inc. 4 4 … … 50 50 class QWebHistoryItem; 51 51 class QWebSecurityOrigin; 52 class QWebElement; 53 class QWebElementCollection; 52 54 53 55 namespace WebCore { … … 60 62 class QWebFrame; 61 63 62 class QWEBKIT_EXPORT QWebHitTestResult 63 { 64 class QWEBKIT_EXPORT QWebHitTestResult { 64 65 public: 65 66 QWebHitTestResult(); … … 72 73 QPoint pos() const; 73 74 QRect boundingRect() const; 75 QWebElement enclosingBlockElement() const; 74 76 QString title() const; 75 77 … … 78 80 QUrl linkTitle() const; 79 81 QWebFrame *linkTargetFrame() const; 82 QWebElement linkElement() const; 80 83 81 84 QString alternateText() const; // for img, area, input and applet … … 86 89 bool isContentEditable() const; 87 90 bool isContentSelected() const; 91 92 QWebElement element() const; 88 93 89 94 QWebFrame *frame() const; … … 98 103 }; 99 104 100 class QWEBKIT_EXPORT QWebFrame : public QObject 101 { 105 class QWEBKIT_EXPORT QWebFrame : public QObject { 102 106 Q_OBJECT 103 107 Q_PROPERTY(qreal textSizeMultiplier READ textSizeMultiplier WRITE setTextSizeMultiplier DESIGNABLE false) … … 105 109 Q_PROPERTY(QString title READ title) 106 110 Q_PROPERTY(QUrl url READ url WRITE setUrl) 111 Q_PROPERTY(QUrl requestedUrl READ requestedUrl) 112 Q_PROPERTY(QUrl baseUrl READ baseUrl) 107 113 Q_PROPERTY(QIcon icon READ icon) 108 114 Q_PROPERTY(QSize contentsSize READ contentsSize) 109 115 Q_PROPERTY(QPoint scrollPosition READ scrollPosition WRITE setScrollPosition) 116 Q_PROPERTY(bool focus READ hasFocus) 110 117 private: 111 118 QWebFrame(QWebPage *parent, QWebFrameData *frameData); … … 136 143 void setUrl(const QUrl &url); 137 144 QUrl url() const; 145 QUrl requestedUrl() const; 146 QUrl baseUrl() const; 138 147 QIcon icon() const; 139 148 QMultiMap<QString, QString> metaData() const; … … 151 160 int scrollBarMinimum(Qt::Orientation orientation) const; 152 161 int scrollBarMaximum(Qt::Orientation orientation) const; 162 QRect scrollBarGeometry(Qt::Orientation orientation) const; 153 163 154 164 void scroll(int, int); … … 156 166 void setScrollPosition(const QPoint &pos); 157 167 158 void render(QPainter *painter, const QRegion &clip); 159 void render(QPainter *painter); 168 enum RenderLayer { 169 ContentsLayer = 0x10, 170 ScrollBarLayer = 0x20, 171 PanIconLayer = 0x40, 172 173 AllLayers = 0xff 174 }; 175 176 void render(QPainter*); 177 void render(QPainter*, const QRegion& clip); 178 void render(QPainter*, RenderLayer layer, const QRegion& clip = QRegion()); 160 179 161 180 void setTextSizeMultiplier(qreal factor); … … 164 183 qreal zoomFactor() const; 165 184 void setZoomFactor(qreal factor); 185 186 bool hasFocus() const; 187 void setFocus(); 166 188 167 189 QPoint pos() const; 168 190 QRect geometry() const; 169 191 QSize contentsSize() const; 192 193 QWebElement documentElement() const; 194 QWebElementCollection findAllElements(const QString &selectorQuery) const; 195 QWebElement findFirstElement(const QString &selectorQuery) const; 170 196 171 197 QWebHitTestResult hitTestContent(const QPoint &pos) const; … … 191 217 192 218 void iconChanged(); 219 220 void contentsSizeChanged(const QSize &size); 221 222 void loadStarted(); 223 void loadFinished(bool ok); 193 224 194 225 private: -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
r2 r561 28 28 #include "KURL.h" 29 29 #include "PlatformString.h" 30 #include "qwebelement.h" 30 31 #include "wtf/RefPtr.h" 31 32 #include "Frame.h" 32 33 33 namespace WebCore 34 { 34 namespace WebCore { 35 35 class FrameLoaderClientQt; 36 36 class FrameView; … … 40 40 class QWebPage; 41 41 42 class QWebFrameData { 43 public: 44 QWebFrameData(WebCore::Page*, WebCore::Frame* parentFrame = 0, 45 WebCore::HTMLFrameOwnerElement* = 0, 46 const WebCore::String& frameName = WebCore::String()); 42 47 43 class QWebFrameData44 {45 public:46 48 WebCore::KURL url; 47 49 WebCore::String name; 48 50 WebCore::HTMLFrameOwnerElement* ownerElement; 51 WebCore::Page* page; 52 RefPtr<WebCore::Frame> frame; 53 WebCore::FrameLoaderClientQt* frameLoaderClient; 49 54 50 55 WebCore::String referrer; … … 54 59 }; 55 60 56 class QWebFramePrivate 57 { 61 class QWebFramePrivate { 58 62 public: 59 63 QWebFramePrivate() … … 68 72 , marginHeight(-1) 69 73 {} 70 void init(QWebFrame *qframe, WebCore::Page *page, 71 QWebFrameData *frameData); 74 void init(QWebFrame* qframe, QWebFrameData* frameData); 72 75 73 76 inline QWebFrame *parentFrame() { return qobject_cast<QWebFrame*>(q->parent()); } … … 76 79 WebCore::Scrollbar* verticalScrollBar() const; 77 80 78 Qt::ScrollBarPolicy horizontalScrollBarPolicy;79 Qt::ScrollBarPolicy verticalScrollBarPolicy;80 81 81 static WebCore::Frame* core(QWebFrame*); 82 82 static QWebFrame* kit(WebCore::Frame*); 83 83 84 void renderPrivate(QPainter*, QWebFrame::RenderLayer, const QRegion& clip); 85 86 bool scrollOverflow(int dx, int dy); 87 84 88 QWebFrame *q; 89 Qt::ScrollBarPolicy horizontalScrollBarPolicy; 90 Qt::ScrollBarPolicy verticalScrollBarPolicy; 85 91 WebCore::FrameLoaderClientQt *frameLoaderClient; 86 92 WebCore::Frame *frame; … … 92 98 }; 93 99 94 class QWebHitTestResultPrivate 95 { 100 class QWebHitTestResultPrivate { 96 101 public: 97 QWebHitTestResultPrivate() : isContentEditable(false), isContentSelected(false) {}102 QWebHitTestResultPrivate() : isContentEditable(false), isContentSelected(false), isScrollBar(false) {} 98 103 QWebHitTestResultPrivate(const WebCore::HitTestResult &hitTest); 99 104 100 105 QPoint pos; 101 106 QRect boundingRect; 107 QWebElement enclosingBlock; 102 108 QString title; 103 109 QString linkText; … … 105 111 QString linkTitle; 106 112 QPointer<QWebFrame> linkTargetFrame; 113 QWebElement linkElement; 107 114 QString alternateText; 108 115 QUrl imageUrl; … … 110 117 bool isContentEditable; 111 118 bool isContentSelected; 119 bool isScrollBar; 112 120 QPointer<QWebFrame> frame; 121 RefPtr<WebCore::Node> innerNode; 113 122 RefPtr<WebCore::Node> innerNonSharedNode; 114 123 }; -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
r2 r561 21 21 #include "qwebhistory.h" 22 22 #include "qwebhistory_p.h" 23 #include "qwebframe_p.h" 23 24 24 25 #include "PlatformString.h" … … 29 30 30 31 #include <QSharedData> 32 #include <QDebug> 33 34 enum { 35 InitialHistoryVersion = 1, 36 DefaultHistoryVersion = InitialHistoryVersion 37 }; 31 38 32 39 /*! 33 40 \class QWebHistoryItem 34 \ingroup explicitly-shared35 41 \since 4.4 36 42 \brief The QWebHistoryItem class represents one item in the history of a QWebPage 43 44 \inmodule QtWebKit 37 45 38 46 Each QWebHistoryItem instance represents an entry in the history stack of a Web page, … … 52 60 \endtable 53 61 54 \note QWebHistoryItem objects are value based and \l{explicitly shared}. 62 \note QWebHistoryItem objects are value based, but \e{explicitly shared}. Changing 63 a QWebHistoryItem instance by calling setUserData() will change all copies of that 64 instance. 55 65 56 66 \sa QWebHistory, QWebPage::history(), QWebHistoryInterface … … 58 68 59 69 /*! 60 Constructs a history item from \a other. 70 Constructs a history item from \a other. The new item and \a other 71 will share their data, and modifying either this item or \a other will 72 modify both instances. 61 73 */ 62 74 QWebHistoryItem::QWebHistoryItem(const QWebHistoryItem &other) … … 66 78 67 79 /*! 68 Assigns the \a other history item to this. 80 Assigns the \a other history item to this. This item and \a other 81 will share their data, and modifying either this item or \a other will 82 modify both instances. 69 83 */ 70 84 QWebHistoryItem &QWebHistoryItem::operator=(const QWebHistoryItem &other) … … 163 177 164 178 Stores user specific data \a userData with the history item. 179 180 \note All copies of this item will be modified. 165 181 166 182 \sa userData() … … 193 209 \since 4.4 194 210 \brief The QWebHistory class represents the history of a QWebPage 211 212 \inmodule QtWebKit 195 213 196 214 Each QWebPage instance contains a history of visited pages that can be accessed … … 214 232 clear() function. 215 233 234 QWebHistory's state can be saved to a QDataStream using the >> operator and loaded 235 by using the << operator. 236 216 237 \sa QWebHistoryItem, QWebHistoryInterface, QWebPage 217 238 */ … … 235 256 void QWebHistory::clear() 236 257 { 237 RefPtr<WebCore::HistoryItem> current = d->lst->currentItem();238 int capacity = d->lst->capacity();239 d->lst->setCapacity(0); 240 241 WebCore::Page* page = d->lst->page();258 //shortcut to private BackForwardList 259 WebCore::BackForwardList* lst = d->lst; 260 261 //clear visited links 262 WebCore::Page* page = lst->page(); 242 263 if (page && page->groupPtr()) 243 264 page->groupPtr()->removeVisitedLinks(); 244 265 245 d->lst->setCapacity(capacity); 246 d->lst->addItem(current.get()); 247 d->lst->goToItem(current.get()); 266 //if count() == 0 then just return 267 if (!lst->entries().size()) 268 return; 269 270 RefPtr<WebCore::HistoryItem> current = lst->currentItem(); 271 int capacity = lst->capacity(); 272 lst->setCapacity(0); 273 274 lst->setCapacity(capacity); //revert capacity 275 lst->addItem(current.get()); //insert old current item 276 lst->goToItem(current.get()); //and set it as current again 277 278 d->page()->updateNavigationActions(); 248 279 } 249 280 … … 258 289 259 290 QList<QWebHistoryItem> ret; 260 for ( inti = 0; i < items.size(); ++i) {291 for (unsigned i = 0; i < items.size(); ++i) { 261 292 QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get()); 262 293 ret.append(QWebHistoryItem(priv)); … … 277 308 278 309 QList<QWebHistoryItem> ret; 279 for ( inti = 0; i < items.size(); ++i) {310 for (unsigned i = 0; i < items.size(); ++i) { 280 311 QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get()); 281 312 ret.append(QWebHistoryItem(priv)); … … 296 327 297 328 QList<QWebHistoryItem> ret; 298 for ( inti = 0; i < items.size(); ++i) {329 for (unsigned i = 0; i < items.size(); ++i) { 299 330 QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get()); 300 331 ret.append(QWebHistoryItem(priv)); … … 332 363 void QWebHistory::back() 333 364 { 334 d->lst->goBack(); 335 WebCore::Page* page = d->lst->page(); 336 page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward); 365 if (canGoBack()) { 366 d->lst->goBack(); 367 WebCore::Page* page = d->lst->page(); 368 page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward); 369 } 337 370 } 338 371 … … 345 378 void QWebHistory::forward() 346 379 { 347 d->lst->goForward(); 348 WebCore::Page* page = d->lst->page(); 349 page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward); 380 if (canGoForward()) { 381 d->lst->goForward(); 382 WebCore::Page* page = d->lst->page(); 383 page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward); 384 } 350 385 } 351 386 … … 406 441 QWebHistoryItem QWebHistory::itemAt(int i) const 407 442 { 408 WebCore::HistoryItem *item = d->lst->itemAtIndex(i); 409 410 QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(item); 443 QWebHistoryItemPrivate *priv; 444 if (i < 0 || i >= count()) 445 priv = new QWebHistoryItemPrivate(0); 446 else { 447 WebCore::HistoryItem *item = d->lst->entries()[i].get(); 448 priv = new QWebHistoryItemPrivate(item); 449 } 411 450 return QWebHistoryItem(priv); 412 451 } … … 442 481 } 443 482 483 /*! 484 \since 4.6 485 \fn QDataStream& operator<<(QDataStream& stream, const QWebHistory& history) 486 \relates QWebHistory 487 488 \brief The operator<< function streams a history into a data stream. 489 490 It saves the \a history into the specified \a stream. 491 */ 492 493 QDataStream& operator<<(QDataStream& target, const QWebHistory& history) 494 { 495 QWebHistoryPrivate* d = history.d; 496 497 int version = DefaultHistoryVersion; 498 499 target << version; 500 target << history.count() << history.currentItemIndex(); 501 502 const WebCore::HistoryItemVector &items = d->lst->entries(); 503 for (unsigned i = 0; i < items.size(); i++) 504 items[i].get()->saveState(target, version); 505 506 return target; 507 } 508 509 /*! 510 \fn QDataStream& operator>>(QDataStream& stream, QWebHistory& history) 511 \relates QWebHistory 512 \since 4.6 513 514 \brief The operator>> function loads a history from a data stream. 515 516 Loads a QWebHistory from the specified \a stream into the given \a history. 517 */ 518 519 QDataStream& operator>>(QDataStream& source, QWebHistory& history) 520 { 521 QWebHistoryPrivate* d = history.d; 522 523 int version; 524 525 source >> version; 526 527 if (version == 1) { 528 int count; 529 int currentIndex; 530 source >> count >> currentIndex; 531 532 history.clear(); 533 // only if there are elements 534 if (count) { 535 // after clear() is new clear HistoryItem (at the end we had to remove it) 536 WebCore::HistoryItem* nullItem = d->lst->currentItem(); 537 for (int i = 0; i < count; i++) { 538 WTF::PassRefPtr<WebCore::HistoryItem> item = WebCore::HistoryItem::create(); 539 item->restoreState(source, version); 540 d->lst->addItem(item); 541 } 542 d->lst->removeItem(nullItem); 543 history.goToItem(history.itemAt(currentIndex)); 544 } 545 } 546 547 d->page()->updateNavigationActions(); 548 549 return source; 550 } 551 552 QWebPagePrivate* QWebHistoryPrivate::page() 553 { 554 return QWebFramePrivate::kit(lst->page()->mainFrame())->page()->handle(); 555 } -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h
r2 r561 36 36 37 37 class QWebHistoryItemPrivate; 38 class QWEBKIT_EXPORT QWebHistoryItem 39 {38 39 class QWEBKIT_EXPORT QWebHistoryItem { 40 40 public: 41 41 QWebHistoryItem(const QWebHistoryItem &other); … … 61 61 friend class QWebPage; 62 62 friend class WebCore::FrameLoaderClientQt; 63 friend class QWebHistoryItemPrivate; 64 //friend QDataStream & operator<<(QDataStream& out,const QWebHistoryItem& hist); 65 //friend QDataStream & operator>>(QDataStream& in,QWebHistoryItem& hist); 63 66 QExplicitlySharedDataPointer<QWebHistoryItemPrivate> d; 64 67 }; 65 68 69 66 70 class QWebHistoryPrivate; 67 class QWEBKIT_EXPORT QWebHistory 68 { 71 class QWEBKIT_EXPORT QWebHistory { 69 72 public: 70 73 void clear(); … … 99 102 friend class QWebPage; 100 103 friend class QWebPagePrivate; 104 friend QWEBKIT_EXPORT QDataStream& operator>>(QDataStream&, QWebHistory&); 105 friend QWEBKIT_EXPORT QDataStream& operator<<(QDataStream&, const QWebHistory&); 101 106 102 107 Q_DISABLE_COPY(QWebHistory) … … 105 110 }; 106 111 112 QWEBKIT_EXPORT QDataStream& operator<<(QDataStream& stream, const QWebHistory& history); 113 QWEBKIT_EXPORT QDataStream& operator>>(QDataStream& stream, QWebHistory& history); 114 107 115 #endif -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h
r2 r561 23 23 #include "BackForwardList.h" 24 24 #include "HistoryItem.h" 25 #include <QtCore/qglobal.h> 26 #include <QtCore/qshareddata.h> 25 27 26 class QWebHistoryItemPrivate : public QSharedData 27 { 28 class QWebPagePrivate; 29 30 class Q_AUTOTEST_EXPORT QWebHistoryItemPrivate : public QSharedData { 28 31 public: 29 QWebHistoryItemPrivate(WebCore::HistoryItem *i) 32 static QExplicitlySharedDataPointer<QWebHistoryItemPrivate> get(QWebHistoryItem* q) 33 { 34 return q->d; 35 } 36 QWebHistoryItemPrivate(WebCore::HistoryItem* i) 30 37 { 31 38 if (i) … … 38 45 item->deref(); 39 46 } 40 WebCore::HistoryItem *item; 47 48 WebCore::HistoryItem* item; 41 49 }; 42 50 43 class QWebHistoryPrivate : public QSharedData 44 { 51 class QWebHistoryPrivate : public QSharedData { 45 52 public: 46 QWebHistoryPrivate(WebCore::BackForwardList *l)53 QWebHistoryPrivate(WebCore::BackForwardList* l) 47 54 { 48 55 l->ref(); … … 53 60 lst->deref(); 54 61 } 55 WebCore::BackForwardList *lst; 62 63 QWebPagePrivate* page(); 64 65 WebCore::BackForwardList* lst; 56 66 }; 57 67 -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.cpp
r2 r561 29 29 30 30 31 static QWebHistoryInterface *default_interface;31 static QWebHistoryInterface* default_interface; 32 32 33 33 static bool gRoutineAdded; … … 35 35 static void gCleanupInterface() 36 36 { 37 if (default_interface && default_interface->parent() == 0)37 if (default_interface && !default_interface->parent()) 38 38 delete default_interface; 39 39 default_interface = 0; … … 48 48 \a defaultInterface if it does not have a parent. 49 49 */ 50 void QWebHistoryInterface::setDefaultInterface(QWebHistoryInterface *defaultInterface)50 void QWebHistoryInterface::setDefaultInterface(QWebHistoryInterface* defaultInterface) 51 51 { 52 52 if (default_interface == defaultInterface) 53 53 return; 54 if (default_interface && default_interface->parent() == 0) 54 55 if (default_interface && !default_interface->parent()) 55 56 delete default_interface; 56 57 … … 71 72 default interface has been set, QtWebkit will not track history. 72 73 */ 73 QWebHistoryInterface *QWebHistoryInterface::defaultInterface()74 QWebHistoryInterface* QWebHistoryInterface::defaultInterface() 74 75 { 75 76 return default_interface; … … 80 81 \since 4.4 81 82 \brief The QWebHistoryInterface class provides an interface to implement link history. 83 84 \inmodule QtWebKit 82 85 83 86 The QWebHistoryInterface is an interface that can be used to … … 92 95 Constructs a new QWebHistoryInterface with parent \a parent. 93 96 */ 94 QWebHistoryInterface::QWebHistoryInterface(QObject *parent) : QObject(parent) 97 QWebHistoryInterface::QWebHistoryInterface(QObject* parent) 98 : QObject(parent) 95 99 { 96 100 } -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebhistoryinterface.h
r2 r561 27 27 #include "qwebkitglobal.h" 28 28 29 class QWEBKIT_EXPORT QWebHistoryInterface : public QObject 30 { 29 class QWEBKIT_EXPORT QWebHistoryInterface : public QObject { 31 30 Q_OBJECT 32 31 public: -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebkitglobal.h
r2 r561 23 23 #include <QtCore/qglobal.h> 24 24 25 #if defined(Q_OS_WIN) 26 # if defined(QT_NODLL) 27 # undef QT_MAKEDLL 28 # undef QT_DLL 29 # elif defined(QT_MAKEDLL) /* create a Qt DLL library */ 30 # if defined(QT_DLL) 31 # undef QT_DLL 32 # endif 33 # if defined(BUILD_WEBKIT) 34 # define QWEBKIT_EXPORT Q_DECL_EXPORT 35 # else 36 # define QWEBKIT_EXPORT Q_DECL_IMPORT 37 # endif 38 # elif defined(QT_DLL) /* use a Qt DLL library */ 39 # define QWEBKIT_EXPORT Q_DECL_IMPORT 25 #if defined(QT_MAKEDLL) /* create a Qt DLL library */ 26 # if defined(BUILD_WEBKIT) 27 # define QWEBKIT_EXPORT Q_DECL_EXPORT 28 # else 29 # define QWEBKIT_EXPORT Q_DECL_IMPORT 40 30 # endif 31 #elif defined(QT_DLL) /* use a Qt DLL library */ 32 # define QWEBKIT_EXPORT Q_DECL_IMPORT 41 33 #endif 42 34 -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
r2 r561 28 28 #include "qwebhistory.h" 29 29 #include "qwebhistory_p.h" 30 #include "qwebinspector.h" 31 #include "qwebinspector_p.h" 30 32 #include "qwebsettings.h" 33 #include "qwebkitversion.h" 31 34 32 35 #include "Frame.h" … … 35 38 #include "FrameLoaderClientQt.h" 36 39 #include "FrameView.h" 40 #include "FormState.h" 41 #include "ApplicationCacheStorage.h" 37 42 #include "ChromeClientQt.h" 38 43 #include "ContextMenu.h" … … 43 48 #include "DragData.h" 44 49 #include "EditorClientQt.h" 50 #include "SecurityOrigin.h" 45 51 #include "Settings.h" 46 52 #include "Page.h" … … 58 64 #include "PlatformKeyboardEvent.h" 59 65 #include "PlatformWheelEvent.h" 66 #include "PluginDatabase.h" 60 67 #include "ProgressTracker.h" 61 68 #include "RefPtr.h" 69 #include "RenderTextControl.h" 70 #include "TextIterator.h" 62 71 #include "HashMap.h" 72 #include "HTMLFormElement.h" 73 #include "HTMLInputElement.h" 74 #include "HTMLNames.h" 63 75 #include "HitTestResult.h" 64 76 #include "WindowFeatures.h" 65 77 #include "LocalizedStrings.h" 78 #include "Cache.h" 66 79 #include "runtime/InitializeThreading.h" 80 #include "PageGroup.h" 81 #include "QWebPageClient.h" 67 82 68 83 #include <QApplication> … … 87 102 #include <QStyle> 88 103 #include <QSysInfo> 104 #include <QTextCharFormat> 89 105 #if QT_VERSION >= 0x040400 90 106 #include <QNetworkAccessManager> … … 93 109 #include "qwebnetworkinterface.h" 94 110 #endif 111 #if defined(Q_WS_X11) 112 #include <QX11Info> 113 #endif 95 114 96 115 using namespace WebCore; 116 117 void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories() 118 { 119 PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false); 120 121 Vector<String> paths; 122 String qtPath(qgetenv("QTWEBKIT_PLUGIN_PATH").data()); 123 qtPath.split(UChar(':'), /* allowEmptyEntries */ false, paths); 124 125 db->setPluginDirectories(paths); 126 db->refresh(); 127 } 97 128 98 129 bool QWebPagePrivate::drtRun = false; … … 112 143 } 113 144 145 class QWebPageWidgetClient : public QWebPageClient { 146 public: 147 QWebPageWidgetClient(QWidget* view) 148 : view(view) 149 { 150 Q_ASSERT(view); 151 } 152 153 virtual void scroll(int dx, int dy, const QRect&); 154 virtual void update(const QRect& dirtyRect); 155 virtual void setInputMethodEnabled(bool enable); 156 virtual bool inputMethodEnabled() const; 157 #if QT_VERSION >= 0x040600 158 virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable); 159 #endif 160 161 #ifndef QT_NO_CURSOR 162 virtual QCursor cursor() const; 163 virtual void updateCursor(const QCursor& cursor); 164 #endif 165 166 virtual QPalette palette() const; 167 virtual int screenNumber() const; 168 virtual QWidget* ownerWidget() const; 169 170 virtual QObject* pluginParent() const; 171 172 QWidget* view; 173 }; 174 175 void QWebPageWidgetClient::scroll(int dx, int dy, const QRect& rectToScroll) 176 { 177 view->scroll(qreal(dx), qreal(dy), rectToScroll); 178 } 179 180 void QWebPageWidgetClient::update(const QRect & dirtyRect) 181 { 182 view->update(dirtyRect); 183 } 184 185 void QWebPageWidgetClient::setInputMethodEnabled(bool enable) 186 { 187 view->setAttribute(Qt::WA_InputMethodEnabled, enable); 188 } 189 190 bool QWebPageWidgetClient::inputMethodEnabled() const 191 { 192 return view->testAttribute(Qt::WA_InputMethodEnabled); 193 } 194 195 #if QT_VERSION >= 0x040600 196 void QWebPageWidgetClient::setInputMethodHint(Qt::InputMethodHint hint, bool enable) 197 { 198 if (enable) 199 view->setInputMethodHints(view->inputMethodHints() | hint); 200 else 201 view->setInputMethodHints(view->inputMethodHints() & ~hint); 202 } 203 #endif 204 #ifndef QT_NO_CURSOR 205 QCursor QWebPageWidgetClient::cursor() const 206 { 207 return view->cursor(); 208 } 209 210 void QWebPageWidgetClient::updateCursor(const QCursor& cursor) 211 { 212 view->setCursor(cursor); 213 } 214 #endif 215 216 QPalette QWebPageWidgetClient::palette() const 217 { 218 return view->palette(); 219 } 220 221 int QWebPageWidgetClient::screenNumber() const 222 { 223 #if defined(Q_WS_X11) 224 if (view) 225 return view->x11Info().screen(); 226 #endif 227 228 return 0; 229 } 230 231 QWidget* QWebPageWidgetClient::ownerWidget() const 232 { 233 return view; 234 } 235 236 QObject* QWebPageWidgetClient::pluginParent() const 237 { 238 return view; 239 } 240 114 241 // Lookup table mapping QWebPage::WebActions to the associated Editor commands 115 static const char* editorCommandWebActions[] = 242 static const char* editorCommandWebActions[] = 116 243 { 117 244 0, // OpenLink, … … 119 246 0, // OpenLinkInNewWindow, 120 247 0, // OpenFrameInNewWindow, 121 248 122 249 0, // DownloadLinkToDisk, 123 250 0, // CopyLinkToClipboard, 124 251 125 252 0, // OpenImageInNewWindow, 126 253 0, // DownloadImageToDisk, 127 254 0, // CopyImageToClipboard, 128 255 129 256 0, // Back, 130 257 0, // Forward, 131 258 0, // Stop, 132 259 0, // Reload, 133 260 134 261 "Cut", // Cut, 135 262 "Copy", // Copy, 136 263 "Paste", // Paste, 137 264 138 265 "Undo", // Undo, 139 266 "Redo", // Redo, … … 164 291 "DeleteWordBackward", // DeleteStartOfWord, 165 292 "DeleteWordForward", // DeleteEndOfWord, 166 293 167 294 0, // SetTextDirectionDefault, 168 295 0, // SetTextDirectionLeftToRight, 169 296 0, // SetTextDirectionRightToLeft, 170 297 171 298 "ToggleBold", // ToggleBold, 172 299 "ToggleItalic", // ToggleItalic, 173 300 "ToggleUnderline", // ToggleUnderline, 174 301 175 302 0, // InspectElement, 176 303 … … 179 306 180 307 "SelectAll", // SelectAll 308 0, // ReloadAndBypassCache, 309 310 "PasteAndMatchStyle", // PasteAndMatchStyle 311 "RemoveFormat", // RemoveFormat 312 "Strikethrough", // ToggleStrikethrough, 313 "Subscript", // ToggleSubscript 314 "Superscript", // ToggleSuperscript 315 "InsertUnorderedList", // InsertUnorderedList 316 "InsertOrderedList", // InsertOrderedList 317 "Indent", // Indent 318 "Outdent", // Outdent, 319 320 "AlignCenter", // AlignCenter, 321 "AlignJustified", // AlignJustified, 322 "AlignLeft", // AlignLeft, 323 "AlignRight", // AlignRight, 181 324 182 325 0 // WebActionCount … … 188 331 if ((action > QWebPage::NoWebAction) && (action < int(sizeof(editorCommandWebActions) / sizeof(const char*)))) 189 332 return editorCommandWebActions[action]; 190 191 333 return 0; 192 334 } 193 194 #ifndef QT_NO_CURSOR195 SetCursorEvent::SetCursorEvent(const QCursor& cursor)196 : QEvent(static_cast<QEvent::Type>(EventType))197 , m_cursor(cursor)198 {}199 200 QCursor SetCursorEvent::cursor() const201 {202 return m_cursor;203 }204 #endif205 335 206 336 // If you change this make sure to also adjust the docs for QWebPage::userAgentForUrl … … 233 363 QWebPagePrivate::QWebPagePrivate(QWebPage *qq) 234 364 : q(qq) 365 , client(0) 366 #if QT_VERSION < 0x040600 235 367 , view(0) 236 , viewportSize(QSize(0,0)) 368 #endif 369 , inspectorFrontend(0) 370 , inspector(0) 371 , inspectorIsInternalOnly(false) 372 , viewportSize(QSize(0, 0)) 373 , clickCausedFocus(false) 237 374 { 238 375 WebCore::InitializeLoggingChannelsIfNecessary(); 239 376 JSC::initializeThreading(); 240 WebCore:: FrameLoader::setLocalLoadPolicy(WebCore::FrameLoader::AllowLocalLoadsForLocalAndSubstituteData);377 WebCore::SecurityOrigin::setLocalLoadPolicy(WebCore::SecurityOrigin::AllowLocalLoadsForLocalAndSubstituteData); 241 378 242 379 chromeClient = new ChromeClientQt(q); … … 244 381 editorClient = new EditorClientQt(q); 245 382 page = new Page(chromeClient, contextMenuClient, editorClient, 246 new DragClientQt(q), new InspectorClientQt(q)); 247 248 // ### should be configurable 249 page->settings()->setDefaultTextEncodingName("iso-8859-1"); 383 new DragClientQt(q), new InspectorClientQt(q), 0); 250 384 251 385 settings = new QWebSettings(page->settings()); … … 264 398 forwardUnsupportedContent = false; 265 399 editable = false; 400 useFixedLayout = false; 266 401 linkPolicy = QWebPage::DontDelegateLinks; 267 402 #ifndef QT_NO_CONTEXTMENU … … 271 406 history.d = new QWebHistoryPrivate(page->backForwardList()); 272 407 memset(actions, 0, sizeof(actions)); 408 409 PageGroup::setShouldTrackVisitedLinks(true); 273 410 } 274 411 … … 306 443 { 307 444 if (!mainFrame) { 308 QWebFrameData frameData; 309 frameData.ownerElement = 0; 310 frameData.allowsScrolling = true; 311 frameData.marginWidth = 0; 312 frameData.marginHeight = 0; 445 QWebFrameData frameData(page); 313 446 mainFrame = new QWebFrame(q, &frameData); 314 447 … … 351 484 const QList<WebCore::ContextMenuItem> *items, QBitArray *visitedWebActions) 352 485 { 353 QMenu* menu = new QMenu( view);486 QMenu* menu = new QMenu(q->view()); 354 487 for (int i = 0; i < items->count(); ++i) { 355 488 const ContextMenuItem &item = items->at(i); … … 390 523 subMenu->setTitle(item.title()); 391 524 menu->addAction(subMenu->menuAction()); 392 } else {525 } else 393 526 delete subMenu; 394 }395 527 break; 396 528 } … … 400 532 } 401 533 #endif // QT_NO_CONTEXTMENU 402 403 QWebFrame *QWebPagePrivate::frameAt(const QPoint &pos) const404 {405 QWebFrame *frame = mainFrame;406 407 redo:408 QList<QWebFrame*> children = frame->childFrames();409 for (int i = 0; i < children.size(); ++i) {410 if (children.at(i)->geometry().contains(pos)) {411 frame = children.at(i);412 goto redo;413 }414 }415 if (frame->geometry().contains(pos))416 return frame;417 return 0;418 }419 534 420 535 void QWebPagePrivate::_q_webActionTriggered(bool checked) … … 427 542 } 428 543 544 void QWebPagePrivate::_q_cleanupLeakMessages() 545 { 546 #ifndef NDEBUG 547 // Need this to make leak messages accurate. 548 cache()->setCapacities(0, 0, 0); 549 #endif 550 } 551 429 552 void QWebPagePrivate::updateAction(QWebPage::WebAction action) 430 553 { … … 441 564 switch (action) { 442 565 case QWebPage::Back: 443 enabled = loader->canGoBackOrForward(-1);566 enabled = page->canGoBackOrForward(-1); 444 567 break; 445 568 case QWebPage::Forward: 446 enabled = loader->canGoBackOrForward(1);569 enabled = page->canGoBackOrForward(1); 447 570 break; 448 571 case QWebPage::Stop: … … 450 573 break; 451 574 case QWebPage::Reload: 575 case QWebPage::ReloadAndBypassCache: 452 576 enabled = !loader->isLoading(); 453 577 break; … … 495 619 updateAction(QWebPage::Stop); 496 620 updateAction(QWebPage::Reload); 621 updateAction(QWebPage::ReloadAndBypassCache); 497 622 } 498 623 … … 536 661 updateAction(QWebPage::InsertParagraphSeparator); 537 662 updateAction(QWebPage::InsertLineSeparator); 663 updateAction(QWebPage::PasteAndMatchStyle); 664 updateAction(QWebPage::RemoveFormat); 665 updateAction(QWebPage::ToggleStrikethrough); 666 updateAction(QWebPage::ToggleSubscript); 667 updateAction(QWebPage::ToggleSuperscript); 668 updateAction(QWebPage::InsertUnorderedList); 669 updateAction(QWebPage::InsertOrderedList); 670 updateAction(QWebPage::Indent); 671 updateAction(QWebPage::Outdent); 672 updateAction(QWebPage::AlignCenter); 673 updateAction(QWebPage::AlignJustified); 674 updateAction(QWebPage::AlignLeft); 675 updateAction(QWebPage::AlignRight); 538 676 } 539 677 … … 547 685 } 548 686 549 void QWebPagePrivate::mouseMoveEvent(Q MouseEvent *ev)687 void QWebPagePrivate::mouseMoveEvent(QGraphicsSceneMouseEvent* ev) 550 688 { 551 689 WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); … … 557 695 } 558 696 559 void QWebPagePrivate::mouse PressEvent(QMouseEvent *ev)697 void QWebPagePrivate::mouseMoveEvent(QMouseEvent *ev) 560 698 { 561 699 WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); … … 563 701 return; 564 702 703 bool accepted = frame->eventHandler()->mouseMoved(PlatformMouseEvent(ev, 0)); 704 ev->setAccepted(accepted); 705 } 706 707 void QWebPagePrivate::mousePressEvent(QGraphicsSceneMouseEvent* ev) 708 { 709 WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); 710 if (!frame->view()) 711 return; 712 565 713 if (tripleClickTimer.isActive() 566 && (ev->pos() - tripleClick).manhattanLength()714 && (ev->pos().toPoint() - tripleClick).manhattanLength() 567 715 < QApplication::startDragDistance()) { 568 716 mouseTripleClickEvent(ev); … … 578 726 } 579 727 580 void QWebPagePrivate::mouseDoubleClickEvent(QMouseEvent *ev) 728 void QWebPagePrivate::mousePressEvent(QMouseEvent *ev) 729 { 730 WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); 731 if (!frame->view()) 732 return; 733 734 RefPtr<WebCore::Node> oldNode; 735 if (page->focusController()->focusedFrame() 736 && page->focusController()->focusedFrame()->document()) 737 oldNode = page->focusController()->focusedFrame()->document()->focusedNode(); 738 739 if (tripleClickTimer.isActive() 740 && (ev->pos() - tripleClick).manhattanLength() 741 < QApplication::startDragDistance()) { 742 mouseTripleClickEvent(ev); 743 return; 744 } 745 746 bool accepted = false; 747 PlatformMouseEvent mev(ev, 1); 748 // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton 749 if (mev.button() != NoButton) 750 accepted = frame->eventHandler()->handleMousePressEvent(mev); 751 ev->setAccepted(accepted); 752 753 RefPtr<WebCore::Node> newNode; 754 if (page->focusController()->focusedFrame() 755 && page->focusController()->focusedFrame()->document()) 756 newNode = page->focusController()->focusedFrame()->document()->focusedNode(); 757 758 if (newNode && oldNode != newNode) 759 clickCausedFocus = true; 760 } 761 762 void QWebPagePrivate::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *ev) 581 763 { 582 764 WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); … … 592 774 593 775 tripleClickTimer.start(QApplication::doubleClickInterval(), q); 776 tripleClick = ev->pos().toPoint(); 777 } 778 779 void QWebPagePrivate::mouseDoubleClickEvent(QMouseEvent *ev) 780 { 781 WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); 782 if (!frame->view()) 783 return; 784 785 bool accepted = false; 786 PlatformMouseEvent mev(ev, 2); 787 // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton 788 if (mev.button() != NoButton) 789 accepted = frame->eventHandler()->handleMousePressEvent(mev); 790 ev->setAccepted(accepted); 791 792 tripleClickTimer.start(QApplication::doubleClickInterval(), q); 594 793 tripleClick = ev->pos(); 595 794 } 596 795 597 void QWebPagePrivate::mouseTripleClickEvent(Q MouseEvent *ev)796 void QWebPagePrivate::mouseTripleClickEvent(QGraphicsSceneMouseEvent *ev) 598 797 { 599 798 WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); … … 609 808 } 610 809 611 void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev) 810 void QWebPagePrivate::mouseTripleClickEvent(QMouseEvent *ev) 811 { 812 WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); 813 if (!frame->view()) 814 return; 815 816 bool accepted = false; 817 PlatformMouseEvent mev(ev, 3); 818 // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton 819 if (mev.button() != NoButton) 820 accepted = frame->eventHandler()->handleMousePressEvent(mev); 821 ev->setAccepted(accepted); 822 } 823 824 void QWebPagePrivate::handleClipboard(QEvent* ev, Qt::MouseButton button) 825 { 826 #ifndef QT_NO_CLIPBOARD 827 if (QApplication::clipboard()->supportsSelection()) { 828 bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode(); 829 Pasteboard::generalPasteboard()->setSelectionMode(true); 830 WebCore::Frame* focusFrame = page->focusController()->focusedOrMainFrame(); 831 if (button == Qt::LeftButton) { 832 if (focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) { 833 focusFrame->editor()->copy(); 834 ev->setAccepted(true); 835 } 836 } else if (button == Qt::MidButton) { 837 if (focusFrame && (focusFrame->editor()->canPaste() || focusFrame->editor()->canDHTMLPaste())) { 838 focusFrame->editor()->paste(); 839 ev->setAccepted(true); 840 } 841 } 842 Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode); 843 } 844 #endif 845 } 846 847 void QWebPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev) 612 848 { 613 849 WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); … … 622 858 ev->setAccepted(accepted); 623 859 624 #ifndef QT_NO_CLIPBOARD 625 if (QApplication::clipboard()->supportsSelection()) { 626 bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode(); 627 Pasteboard::generalPasteboard()->setSelectionMode(true); 628 WebCore::Frame* focusFrame = page->focusController()->focusedOrMainFrame(); 629 if (ev->button() == Qt::LeftButton) { 630 if(focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) { 631 focusFrame->editor()->copy(); 632 ev->setAccepted(true); 633 } 634 } else if (ev->button() == Qt::MidButton) { 635 if(focusFrame && (focusFrame->editor()->canPaste() || focusFrame->editor()->canDHTMLPaste())) { 636 focusFrame->editor()->paste(); 637 ev->setAccepted(true); 638 } 860 handleClipboard(ev, ev->button()); 861 handleSoftwareInputPanel(ev->button()); 862 } 863 864 void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button) 865 { 866 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) 867 Frame* frame = page->focusController()->focusedFrame(); 868 if (!frame) 869 return; 870 871 if (client && client->inputMethodEnabled() 872 && frame->document()->focusedNode() 873 && button == Qt::LeftButton && qApp->autoSipEnabled()) { 874 QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel( 875 client->ownerWidget()->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel)); 876 if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) { 877 QEvent event(QEvent::RequestSoftwareInputPanel); 878 QApplication::sendEvent(client->ownerWidget(), &event); 639 879 } 640 Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode); 641 } 642 #endif 880 } 881 882 clickCausedFocus = false; 883 #endif 884 } 885 886 void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev) 887 { 888 WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); 889 if (!frame->view()) 890 return; 891 892 bool accepted = false; 893 PlatformMouseEvent mev(ev, 0); 894 // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton 895 if (mev.button() != NoButton) 896 accepted = frame->eventHandler()->handleMouseReleaseEvent(mev); 897 ev->setAccepted(accepted); 898 899 handleClipboard(ev, ev->button()); 900 handleSoftwareInputPanel(ev->button()); 643 901 } 644 902 645 903 #ifndef QT_NO_CONTEXTMENU 646 void QWebPagePrivate::contextMenuEvent( QContextMenuEvent *ev)904 void QWebPagePrivate::contextMenuEvent(const QPoint& globalPos) 647 905 { 648 906 QMenu *menu = q->createStandardContextMenu(); 649 907 if (menu) { 650 menu->exec( ev->globalPos());908 menu->exec(globalPos); 651 909 delete menu; 652 910 } … … 673 931 674 932 #ifndef QT_NO_WHEELEVENT 933 void QWebPagePrivate::wheelEvent(QGraphicsSceneWheelEvent* ev) 934 { 935 WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); 936 if (!frame->view()) 937 return; 938 939 WebCore::PlatformWheelEvent pev(ev); 940 bool accepted = frame->eventHandler()->handleWheelEvent(pev); 941 ev->setAccepted(accepted); 942 } 943 675 944 void QWebPagePrivate::wheelEvent(QWheelEvent *ev) 676 945 { … … 743 1012 bool handled = false; 744 1013 WebCore::Frame* frame = page->focusController()->focusedOrMainFrame(); 745 WebCore::Editor* editor = frame->editor();746 1014 // we forward the key event to WebCore first to handle potential DOM 747 1015 // defined event handlers and later on end up in EditorClientQt::handleKeyboardEvent … … 752 1020 handled = true; 753 1021 QFont defaultFont; 754 if ( view)755 defaultFont = view->font();1022 if (q->view()) 1023 defaultFont = q->view()->font(); 756 1024 QFontMetrics fm(defaultFont); 757 int fontHeight = fm.height(); 758 if (!handleScrolling(ev)) { 1025 if (!handleScrolling(ev, frame)) { 759 1026 switch (ev->key()) { 1027 case Qt::Key_Back: 1028 q->triggerAction(QWebPage::Back); 1029 break; 1030 case Qt::Key_Forward: 1031 q->triggerAction(QWebPage::Forward); 1032 break; 1033 case Qt::Key_Stop: 1034 q->triggerAction(QWebPage::Stop); 1035 break; 1036 case Qt::Key_Refresh: 1037 q->triggerAction(QWebPage::Reload); 1038 break; 760 1039 case Qt::Key_Backspace: 761 1040 if (ev->modifiers() == Qt::ShiftModifier) … … 763 1042 else 764 1043 q->triggerAction(QWebPage::Back); 1044 break; 765 1045 default: 766 1046 handled = false; … … 785 1065 } 786 1066 787 void QWebPagePrivate::focusInEvent(QFocusEvent *ev)1067 void QWebPagePrivate::focusInEvent(QFocusEvent*) 788 1068 { 789 1069 FocusController *focusController = page->focusController(); 790 Frame *frame = focusController->focusedFrame();791 1070 focusController->setActive(true); 792 if (frame) { 793 frame->selection()->setFocused(true); 794 } else { 1071 focusController->setFocused(true); 1072 if (!focusController->focusedFrame()) 795 1073 focusController->setFocusedFrame(QWebFramePrivate::core(mainFrame)); 796 } 797 } 798 799 void QWebPagePrivate::focusOutEvent(QFocusEvent *ev) 1074 } 1075 1076 void QWebPagePrivate::focusOutEvent(QFocusEvent*) 800 1077 { 801 1078 // only set the focused frame inactive so that we stop painting the caret … … 804 1081 FocusController *focusController = page->focusController(); 805 1082 focusController->setActive(false); 806 Frame *frame = focusController->focusedFrame(); 807 if (frame) { 808 frame->selection()->setFocused(false); 809 } 810 } 811 812 void QWebPagePrivate::dragEnterEvent(QDragEnterEvent *ev) 1083 focusController->setFocused(false); 1084 } 1085 1086 void QWebPagePrivate::dragEnterEvent(QGraphicsSceneDragDropEvent* ev) 1087 { 1088 #ifndef QT_NO_DRAGANDDROP 1089 DragData dragData(ev->mimeData(), ev->pos().toPoint(), 1090 QCursor::pos(), dropActionToDragOp(ev->possibleActions())); 1091 Qt::DropAction action = dragOpToDropAction(page->dragController()->dragEntered(&dragData)); 1092 ev->setDropAction(action); 1093 if (action != Qt::IgnoreAction) 1094 ev->accept(); 1095 #endif 1096 } 1097 1098 void QWebPagePrivate::dragEnterEvent(QDragEnterEvent* ev) 813 1099 { 814 1100 #ifndef QT_NO_DRAGANDDROP … … 822 1108 } 823 1109 824 void QWebPagePrivate::dragLeaveEvent(Q DragLeaveEvent *ev)1110 void QWebPagePrivate::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev) 825 1111 { 826 1112 #ifndef QT_NO_DRAGANDDROP … … 831 1117 } 832 1118 833 void QWebPagePrivate::dragMoveEvent(QDragMoveEvent *ev) 1119 void QWebPagePrivate::dragLeaveEvent(QDragLeaveEvent* ev) 1120 { 1121 #ifndef QT_NO_DRAGANDDROP 1122 DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone); 1123 page->dragController()->dragExited(&dragData); 1124 ev->accept(); 1125 #endif 1126 } 1127 1128 void QWebPagePrivate::dragMoveEvent(QGraphicsSceneDragDropEvent* ev) 1129 { 1130 #ifndef QT_NO_DRAGANDDROP 1131 DragData dragData(ev->mimeData(), ev->pos().toPoint(), 1132 QCursor::pos(), dropActionToDragOp(ev->possibleActions())); 1133 Qt::DropAction action = dragOpToDropAction(page->dragController()->dragUpdated(&dragData)); 1134 ev->setDropAction(action); 1135 if (action != Qt::IgnoreAction) 1136 ev->accept(); 1137 #endif 1138 } 1139 1140 void QWebPagePrivate::dragMoveEvent(QDragMoveEvent* ev) 834 1141 { 835 1142 #ifndef QT_NO_DRAGANDDROP … … 843 1150 } 844 1151 845 void QWebPagePrivate::dropEvent(QDropEvent *ev) 1152 void QWebPagePrivate::dropEvent(QGraphicsSceneDragDropEvent* ev) 1153 { 1154 #ifndef QT_NO_DRAGANDDROP 1155 DragData dragData(ev->mimeData(), ev->pos().toPoint(), 1156 QCursor::pos(), dropActionToDragOp(ev->possibleActions())); 1157 Qt::DropAction action = dragOpToDropAction(page->dragController()->performDrag(&dragData)); 1158 if (action != Qt::IgnoreAction) 1159 ev->accept(); 1160 #endif 1161 } 1162 1163 void QWebPagePrivate::dropEvent(QDropEvent* ev) 846 1164 { 847 1165 #ifndef QT_NO_DRAGANDDROP … … 854 1172 } 855 1173 856 void QWebPagePrivate::leaveEvent(QEvent *ev)1174 void QWebPagePrivate::leaveEvent(QEvent*) 857 1175 { 858 1176 // Fake a mouse move event just outside of the widget, since all … … 897 1215 } 898 1216 1217 RenderObject* renderer = 0; 1218 RenderTextControl* renderTextControl = 0; 1219 1220 if (frame->selection()->rootEditableElement()) 1221 renderer = frame->selection()->rootEditableElement()->shadowAncestorNode()->renderer(); 1222 1223 if (renderer && renderer->isTextControl()) 1224 renderTextControl = toRenderTextControl(renderer); 1225 1226 Vector<CompositionUnderline> underlines; 1227 1228 for (int i = 0; i < ev->attributes().size(); ++i) { 1229 const QInputMethodEvent::Attribute& a = ev->attributes().at(i); 1230 switch (a.type) { 1231 case QInputMethodEvent::TextFormat: { 1232 QTextCharFormat textCharFormat = a.value.value<QTextFormat>().toCharFormat(); 1233 QColor qcolor = textCharFormat.underlineColor(); 1234 underlines.append(CompositionUnderline(a.start, a.length, Color(makeRGBA(qcolor.red(), qcolor.green(), qcolor.blue(), qcolor.alpha())), false)); 1235 break; 1236 } 1237 case QInputMethodEvent::Cursor: { 1238 frame->setCaretVisible(a.length); //if length is 0 cursor is invisible 1239 if (a.length > 0) { 1240 RenderObject* caretRenderer = frame->selection()->caretRenderer(); 1241 if (caretRenderer) { 1242 QColor qcolor = a.value.value<QColor>(); 1243 caretRenderer->style()->setColor(Color(makeRGBA(qcolor.red(), qcolor.green(), qcolor.blue(), qcolor.alpha()))); 1244 } 1245 } 1246 break; 1247 } 1248 #if QT_VERSION >= 0x040600 1249 case QInputMethodEvent::Selection: { 1250 if (renderTextControl) { 1251 renderTextControl->setSelectionStart(a.start); 1252 renderTextControl->setSelectionEnd(a.start + a.length); 1253 } 1254 break; 1255 } 1256 #endif 1257 } 1258 } 1259 899 1260 if (!ev->commitString().isEmpty()) 900 1261 editor->confirmComposition(ev->commitString()); 901 else {1262 else if (!ev->preeditString().isEmpty()) { 902 1263 QString preedit = ev->preeditString(); 903 // ### FIXME: use the provided QTextCharFormat (use color at least)904 Vector<CompositionUnderline> underlines;905 underlines.append(CompositionUnderline(0, preedit.length(), Color(0,0,0), false));906 1264 editor->setComposition(preedit, underlines, preedit.length(), 0); 907 1265 } … … 939 1297 } 940 1298 #ifndef QT_NO_SHORTCUT 941 else if (editorActionForKeyEvent(event) != QWebPage::NoWebAction) {1299 else if (editorActionForKeyEvent(event) != QWebPage::NoWebAction) 942 1300 event->accept(); 943 } 944 #endif 945 } 946 } 947 948 bool QWebPagePrivate::handleScrolling(QKeyEvent *ev) 1301 #endif 1302 } 1303 } 1304 1305 bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame) 949 1306 { 950 1307 ScrollDirection direction; … … 993 1350 } 994 1351 995 if (!mainFrame->d->frame->eventHandler()->scrollOverflow(direction, granularity)) 996 mainFrame->d->frame->view()->scroll(direction, granularity); 997 998 return true; 1352 return frame->eventHandler()->scrollRecursively(direction, granularity); 999 1353 } 1000 1354 … … 1010 1364 QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const 1011 1365 { 1012 switch(property) { 1013 case Qt::ImMicroFocus: { 1014 Frame *frame = d->page->focusController()->focusedFrame(); 1015 if (frame) { 1366 Frame* frame = d->page->focusController()->focusedFrame(); 1367 if (!frame) 1368 return QVariant(); 1369 1370 WebCore::Editor* editor = frame->editor(); 1371 1372 RenderObject* renderer = 0; 1373 RenderTextControl* renderTextControl = 0; 1374 1375 if (frame->selection()->rootEditableElement()) 1376 renderer = frame->selection()->rootEditableElement()->shadowAncestorNode()->renderer(); 1377 1378 if (renderer && renderer->isTextControl()) 1379 renderTextControl = toRenderTextControl(renderer); 1380 1381 switch (property) { 1382 case Qt::ImMicroFocus: { 1016 1383 return QVariant(frame->selection()->absoluteCaretBounds()); 1017 1384 } 1018 return QVariant(); 1019 } 1020 case Qt::ImFont: { 1021 QWebView *webView = qobject_cast<QWebView *>(d->view); 1022 if (webView) 1023 return QVariant(webView->font()); 1024 return QVariant(); 1025 } 1026 case Qt::ImCursorPosition: { 1027 Frame *frame = d->page->focusController()->focusedFrame(); 1028 if (frame) { 1029 Selection selection = frame->selection()->selection(); 1030 if (selection.isCaret()) { 1031 return QVariant(selection.start().offset()); 1385 case Qt::ImFont: { 1386 if (renderTextControl) { 1387 RenderStyle* renderStyle = renderTextControl->style(); 1388 return QVariant(QFont(renderStyle->font().font())); 1032 1389 } 1390 return QVariant(QFont()); 1033 1391 } 1034 return QVariant(); 1035 } 1036 case Qt::ImSurroundingText: { 1037 Frame *frame = d->page->focusController()->focusedFrame(); 1038 if (frame) { 1039 Document *document = frame->document(); 1040 if (document->focusedNode()) { 1041 return QVariant(document->focusedNode()->nodeValue()); 1392 case Qt::ImCursorPosition: { 1393 if (renderTextControl) { 1394 if (editor->hasComposition()) { 1395 RefPtr<Range> range = editor->compositionRange(); 1396 return QVariant(renderTextControl->selectionEnd() - TextIterator::rangeLength(range.get())); 1397 } 1398 return QVariant(renderTextControl->selectionEnd()); 1042 1399 } 1400 return QVariant(); 1043 1401 } 1044 return QVariant(); 1045 } 1046 case Qt::ImCurrentSelection: 1047 return QVariant(selectedText()); 1048 default: 1049 return QVariant(); 1050 } 1051 } 1402 case Qt::ImSurroundingText: { 1403 if (renderTextControl) { 1404 QString text = renderTextControl->text(); 1405 RefPtr<Range> range = editor->compositionRange(); 1406 if (range) { 1407 text.remove(range->startPosition().offsetInContainerNode(), TextIterator::rangeLength(range.get())); 1408 } 1409 return QVariant(text); 1410 } 1411 return QVariant(); 1412 } 1413 case Qt::ImCurrentSelection: { 1414 if (renderTextControl) { 1415 int start = renderTextControl->selectionStart(); 1416 int end = renderTextControl->selectionEnd(); 1417 if (end > start) 1418 return QVariant(QString(renderTextControl->text()).mid(start,end-start)); 1419 } 1420 return QVariant(); 1421 1422 } 1423 #if QT_VERSION >= 0x040600 1424 case Qt::ImAnchorPosition: { 1425 if (renderTextControl) { 1426 if (editor->hasComposition()) { 1427 RefPtr<Range> range = editor->compositionRange(); 1428 return QVariant(renderTextControl->selectionStart() - TextIterator::rangeLength(range.get())); 1429 } 1430 return QVariant(renderTextControl->selectionStart()); 1431 } 1432 return QVariant(); 1433 } 1434 case Qt::ImMaximumTextLength: { 1435 if (frame->selection()->isContentEditable()) { 1436 if (frame->document() && frame->document()->focusedNode()) { 1437 if (frame->document()->focusedNode()->hasTagName(HTMLNames::inputTag)) { 1438 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedNode()); 1439 return QVariant(inputElement->maxLength()); 1440 } 1441 } 1442 return QVariant(InputElement::s_maximumLength); 1443 } 1444 return QVariant(0); 1445 } 1446 #endif 1447 default: 1448 return QVariant(); 1449 } 1450 } 1451 1452 /*! 1453 \internal 1454 */ 1455 void QWebPagePrivate::setInspector(QWebInspector* insp) 1456 { 1457 if (inspector) 1458 inspector->d->setFrontend(0); 1459 1460 if (inspectorIsInternalOnly) { 1461 QWebInspector* inspToDelete = inspector; 1462 inspector = 0; 1463 inspectorIsInternalOnly = false; 1464 delete inspToDelete; // Delete after to prevent infinite recursion 1465 } 1466 1467 inspector = insp; 1468 1469 // Give inspector frontend web view if previously created 1470 if (inspector && inspectorFrontend) 1471 inspector->d->setFrontend(inspectorFrontend); 1472 } 1473 1474 /*! 1475 \internal 1476 Returns the inspector and creates it if it wasn't created yet. 1477 The instance created here will not be available through QWebPage's API. 1478 */ 1479 QWebInspector* QWebPagePrivate::getOrCreateInspector() 1480 { 1481 if (!inspector) { 1482 QWebInspector* insp = new QWebInspector; 1483 insp->setPage(q); 1484 inspectorIsInternalOnly = true; 1485 1486 Q_ASSERT(inspector); // Associated through QWebInspector::setPage(q) 1487 } 1488 return inspector; 1489 } 1490 1491 /*! \internal */ 1492 InspectorController* QWebPagePrivate::inspectorController() 1493 { 1494 return page->inspectorController(); 1495 } 1496 1052 1497 1053 1498 /*! … … 1062 1507 \value FindWrapsAroundDocument Makes findText() restart from the beginning of the document if the end 1063 1508 was reached and the text was not found. 1509 \value HighlightAllOccurrences Highlights all existing occurrences of a specific string. 1064 1510 */ 1065 1511 … … 1096 1542 1097 1543 Actions only have an effect when they are applicable. The availability of 1098 actions can be be determined by checking \l{QAction::}{ enabled()} on the1544 actions can be be determined by checking \l{QAction::}{isEnabled()} on the 1099 1545 action returned by \l{QWebPage::}{action()}. 1100 1546 … … 1115 1561 \value Stop Stop loading the current page. 1116 1562 \value Reload Reload the current page. 1563 \value ReloadAndBypassCache Reload the current page, but do not use any local cache. (Added in Qt 4.6) 1117 1564 \value Cut Cut the content currently selected into the clipboard. 1118 1565 \value Copy Copy the content currently selected into the clipboard. … … 1156 1603 \value InsertLineSeparator Insert a new line. 1157 1604 \value SelectAll Selects all content. 1605 \value PasteAndMatchStyle Paste content from the clipboard with current style. 1606 \value RemoveFormat Removes formatting and style. 1607 \value ToggleStrikethrough Toggle the formatting between strikethrough and normal style. 1608 \value ToggleSubscript Toggle the formatting between subscript and baseline. 1609 \value ToggleSuperscript Toggle the formatting between supercript and baseline. 1610 \value InsertUnorderedList Toggles the selection between an ordered list and a normal block. 1611 \value InsertOrderedList Toggles the selection between an ordered list and a normal block. 1612 \value Indent Increases the indentation of the currently selected format block by one increment. 1613 \value Outdent Decreases the indentation of the currently selected format block by one increment. 1614 \value AlignCenter Applies center alignment to content. 1615 \value AlignJustified Applies full justification to content. 1616 \value AlignLeft Applies left justification to content. 1617 \value AlignRight Applies right justification to content. 1618 1619 1158 1620 \omitvalue WebActionCount 1159 1621 … … 1171 1633 \since 4.4 1172 1634 \brief The QWebPage class provides an object to view and edit web documents. 1635 1636 \inmodule QtWebKit 1173 1637 1174 1638 QWebPage holds a main frame responsible for web content, settings, the history … … 1199 1663 Suppose we have a \c Thumbnail class as follows: 1200 1664 1201 \snippet doc/src/snippets/webkit/webpage/main.cpp 01665 \snippet webkitsnippets/webpage/main.cpp 0 1202 1666 1203 1667 The \c Thumbnail's constructor takes in a \a url. We connect our QWebPage … … 1205 1669 \c render(). 1206 1670 1207 \snippet doc/src/snippets/webkit/webpage/main.cpp 11671 \snippet webkitsnippets/webpage/main.cpp 1 1208 1672 1209 1673 The \c render() function shows how we can paint a thumbnail using a 1210 1674 QWebPage object. 1211 1675 1212 \snippet doc/src/snippets/webkit/webpage/main.cpp 21676 \snippet webkitsnippets/webpage/main.cpp 2 1213 1677 1214 1678 We begin by setting the \l{QWebPage::viewportSize()}{viewportSize} and … … 1222 1686 1223 1687 /*! 1224 Constructs an empty QWeb Viewwith parent \a parent.1688 Constructs an empty QWebPage with parent \a parent. 1225 1689 */ 1226 1690 QWebPage::QWebPage(QObject *parent) … … 1231 1695 1232 1696 connect(this, SIGNAL(loadProgress(int)), this, SLOT(_q_onLoadProgressChanged(int))); 1697 #ifndef NDEBUG 1698 connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(_q_cleanupLeakMessages())); 1699 #endif 1233 1700 } 1234 1701 … … 1238 1705 QWebPage::~QWebPage() 1239 1706 { 1707 d->createMainFrame(); 1240 1708 FrameLoader *loader = d->mainFrame->d->frame->loader(); 1241 1709 if (loader) 1242 1710 loader->detachFromParent(); 1711 if (d->inspector) 1712 d->inspector->setPage(0); 1243 1713 delete d; 1244 1714 } … … 1265 1735 QWebFrame *QWebPage::currentFrame() const 1266 1736 { 1737 d->createMainFrame(); 1267 1738 return static_cast<WebCore::FrameLoaderClientQt *>(d->page->focusController()->focusedOrMainFrame()->loader()->client())->webFrame(); 1268 1739 } 1269 1740 1741 1742 /*! 1743 \since 4.6 1744 1745 Returns the frame at the given point \a pos. 1746 1747 \sa mainFrame(), currentFrame() 1748 */ 1749 QWebFrame* QWebPage::frameAt(const QPoint& pos) const 1750 { 1751 QWebFrame* webFrame = mainFrame(); 1752 if (!webFrame->geometry().contains(pos)) 1753 return 0; 1754 QWebHitTestResult hitTestResult = webFrame->hitTestContent(pos); 1755 return hitTestResult.frame(); 1756 } 1757 1270 1758 /*! 1271 1759 Returns a pointer to the view's history of navigated web pages. … … 1273 1761 QWebHistory *QWebPage::history() const 1274 1762 { 1763 d->createMainFrame(); 1275 1764 return &d->history; 1276 1765 } … … 1283 1772 void QWebPage::setView(QWidget *view) 1284 1773 { 1285 d->view = view; 1286 setViewportSize(view ? view->size() : QSize(0, 0)); 1774 if (this->view() != view) { 1775 d->view = view; 1776 if (!view) { 1777 delete d->client; 1778 d->client = 0; 1779 } else { 1780 if (!d->client) 1781 d->client = new QWebPageWidgetClient(view); 1782 else 1783 static_cast<QWebPageWidgetClient*>(d->client)->view = view; 1784 } 1785 setViewportSize(view ? view->size() : QSize(0, 0)); 1786 } 1287 1787 } 1288 1788 … … 1294 1794 QWidget *QWebPage::view() const 1295 1795 { 1796 #if QT_VERSION < 0x040600 1296 1797 return d->view; 1798 #else 1799 return d->view.data(); 1800 #endif 1297 1801 } 1298 1802 … … 1319 1823 void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg) 1320 1824 { 1825 Q_UNUSED(frame) 1321 1826 #ifndef QT_NO_MESSAGEBOX 1322 QMessageBox::information( d->view, tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Ok);1827 QMessageBox::information(view(), tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Ok); 1323 1828 #endif 1324 1829 } … … 1332 1837 bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg) 1333 1838 { 1839 Q_UNUSED(frame) 1334 1840 #ifdef QT_NO_MESSAGEBOX 1335 1841 return true; 1336 1842 #else 1337 return QMessageBox::Yes == QMessageBox::information( d->view, tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Yes, QMessageBox::No);1843 return QMessageBox::Yes == QMessageBox::information(view(), tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Yes, QMessageBox::No); 1338 1844 #endif 1339 1845 } … … 1344 1850 1345 1851 If the prompt was cancelled by the user the implementation should return false; otherwise the 1346 result should be written to \a result and true should be returned. 1852 result should be written to \a result and true should be returned. If the prompt was not cancelled by the 1853 user, the implementation should return true and the result string must not be null. 1347 1854 1348 1855 The default implementation uses QInputDialog::getText. … … 1350 1857 bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QString& defaultValue, QString* result) 1351 1858 { 1859 Q_UNUSED(frame) 1352 1860 bool ok = false; 1353 1861 #ifndef QT_NO_INPUTDIALOG 1354 QString x = QInputDialog::getText( d->view, tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), msg, QLineEdit::Normal, defaultValue, &ok);1355 if (ok && result) {1862 QString x = QInputDialog::getText(view(), tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), msg, QLineEdit::Normal, defaultValue, &ok); 1863 if (ok && result) 1356 1864 *result = x; 1357 }1358 1865 #endif 1359 1866 return ok; 1867 } 1868 1869 /*! 1870 \fn bool QWebPage::shouldInterruptJavaScript() 1871 \since 4.6 1872 This function is called when a JavaScript program is running for a long period of time. 1873 1874 If the user wanted to stop the JavaScript the implementation should return true; otherwise false. 1875 1876 The default implementation executes the query using QMessageBox::information with QMessageBox::Yes and QMessageBox::No buttons. 1877 1878 \warning Because of binary compatibility constraints, this function is not virtual. If you want to 1879 provide your own implementation in a QWebPage subclass, reimplement the shouldInterruptJavaScript() 1880 slot in your subclass instead. QtWebKit will dynamically detect the slot and call it. 1881 */ 1882 bool QWebPage::shouldInterruptJavaScript() 1883 { 1884 #ifdef QT_NO_MESSAGEBOX 1885 return false; 1886 #else 1887 return QMessageBox::Yes == QMessageBox::information(view(), tr("JavaScript Problem - %1").arg(mainFrame()->url().host()), tr("The script on this page appears to have a problem. Do you want to stop the script?"), QMessageBox::Yes, QMessageBox::No); 1888 #endif 1360 1889 } 1361 1890 … … 1373 1902 QWebPage *QWebPage::createWindow(WebWindowType type) 1374 1903 { 1375 QWebView *webView = qobject_cast<QWebView *>( d->view);1904 QWebView *webView = qobject_cast<QWebView *>(view()); 1376 1905 if (webView) { 1377 1906 QWebView *newView = webView->createWindow(type); … … 1422 1951 \sa action() 1423 1952 */ 1424 void QWebPage::triggerAction(WebAction action, bool checked)1953 void QWebPage::triggerAction(WebAction action, bool) 1425 1954 { 1426 1955 WebCore::Frame *frame = d->page->focusController()->focusedOrMainFrame(); … … 1434 1963 if (QWebFrame *targetFrame = d->hitTestResult.linkTargetFrame()) { 1435 1964 WTF::RefPtr<WebCore::Frame> wcFrame = targetFrame->d->frame; 1436 targetFrame->d->frame->loader()->loadFrameRequestWithFormAndValues(frameLoadRequest(d->hitTestResult.linkUrl(), wcFrame.get()), 1437 /*lockHistory*/ false, /*event*/ 0, 1438 /*HTMLFormElement*/ 0, /*formValues*/ 1439 WTF::HashMap<String, String>()); 1965 targetFrame->d->frame->loader()->loadFrameRequest(frameLoadRequest(d->hitTestResult.linkUrl(), wcFrame.get()), 1966 /*lockHistory*/ false, /*lockBackForwardList*/ false, /*event*/ 0, 1967 /*FormState*/ 0, SendReferrer); 1440 1968 break; 1441 1969 } … … 1451 1979 break; 1452 1980 } 1453 case CopyLinkToClipboard: 1981 case CopyLinkToClipboard: { 1982 #if defined(Q_WS_X11) 1983 bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode(); 1984 Pasteboard::generalPasteboard()->setSelectionMode(true); 1454 1985 editor->copyURL(d->hitTestResult.linkUrl(), d->hitTestResult.linkText()); 1455 break; 1986 Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode); 1987 #endif 1988 editor->copyURL(d->hitTestResult.linkUrl(), d->hitTestResult.linkText()); 1989 break; 1990 } 1456 1991 case OpenImageInNewWindow: 1457 1992 openNewWindow(d->hitTestResult.imageUrl(), frame); … … 1478 2013 break; 1479 2014 case Reload: 1480 mainFrame()->d->frame->loader()->reload(); 2015 mainFrame()->d->frame->loader()->reload(/*endtoendreload*/false); 2016 break; 2017 case ReloadAndBypassCache: 2018 mainFrame()->d->frame->loader()->reload(/*endtoendreload*/true); 1481 2019 break; 1482 2020 case SetTextDirectionDefault: … … 1489 2027 editor->setBaseWritingDirection(RightToLeftWritingDirection); 1490 2028 break; 1491 case InspectElement: 1492 if (!d->hitTestResult.isNull()) 2029 case InspectElement: { 2030 if (!d->hitTestResult.isNull()) { 2031 d->getOrCreateInspector(); // Make sure the inspector is created 2032 d->inspector->show(); // The inspector is expected to be shown on inspection 1493 2033 d->page->inspectorController()->inspect(d->hitTestResult.d->innerNonSharedNode.get()); 1494 else1495 d->page->inspectorController()->show();1496 break;2034 } 2035 break; 2036 } 1497 2037 default: 1498 2038 command = QWebPagePrivate::editorCommandForWebActions(action); … … 1530 2070 WebCore::FrameView* view = frame->d->frame->view(); 1531 2071 view->setFrameRect(QRect(QPoint(0, 0), size)); 1532 frame->d->frame->forceLayout();2072 view->forceLayout(); 1533 2073 view->adjustViewSize(); 1534 2074 } 1535 2075 } 1536 2076 2077 QSize QWebPage::preferredContentsSize() const 2078 { 2079 QWebFrame* frame = d->mainFrame; 2080 if (frame) { 2081 WebCore::FrameView* view = frame->d->frame->view(); 2082 if (view && view->useFixedLayout()) 2083 return d->mainFrame->d->frame->view()->fixedLayoutSize(); 2084 } 2085 2086 return d->fixedLayoutSize; 2087 } 2088 2089 /*! 2090 \property QWebPage::preferredContentsSize 2091 \since 4.6 2092 \brief the size of the fixed layout 2093 2094 The size affects the layout of the page in the viewport. If set to a fixed size of 2095 1024x768 for example then webkit will layout the page as if the viewport were that size 2096 rather than something different. 2097 */ 2098 void QWebPage::setPreferredContentsSize(const QSize &size) const 2099 { 2100 d->fixedLayoutSize = size; 2101 2102 QWebFrame *frame = mainFrame(); 2103 if (frame->d->frame && frame->d->frame->view()) { 2104 WebCore::FrameView* view = frame->d->frame->view(); 2105 2106 if (size.isValid()) { 2107 view->setUseFixedLayout(true); 2108 view->setFixedLayoutSize(size); 2109 view->forceLayout(); 2110 } else if (view->useFixedLayout()) { 2111 view->setUseFixedLayout(false); 2112 view->forceLayout(); 2113 } 2114 } 2115 } 1537 2116 1538 2117 /*! … … 1556 2135 #endif 1557 2136 { 2137 Q_UNUSED(frame) 1558 2138 if (type == NavigationTypeLinkClicked) { 1559 2139 switch (d->linkPolicy) { … … 1562 2142 1563 2143 case DelegateExternalLinks: 1564 if (WebCore:: FrameLoader::shouldTreatSchemeAsLocal(request.url().scheme()))2144 if (WebCore::SecurityOrigin::shouldTreatURLSchemeAsLocal(request.url().scheme())) 1565 2145 return true; 1566 2146 emit linkClicked(request.url()); … … 1585 2165 QString QWebPage::selectedText() const 1586 2166 { 2167 d->createMainFrame(); 1587 2168 return d->page->focusController()->focusedOrMainFrame()->selectedText(); 1588 2169 } … … 1802 2383 break; 1803 2384 2385 case PasteAndMatchStyle: 2386 text = tr("Paste and Match Style"); 2387 break; 2388 case RemoveFormat: 2389 text = tr("Remove formatting"); 2390 break; 2391 2392 case ToggleStrikethrough: 2393 text = tr("Strikethrough"); 2394 checkable = true; 2395 break; 2396 case ToggleSubscript: 2397 text = tr("Subscript"); 2398 checkable = true; 2399 break; 2400 case ToggleSuperscript: 2401 text = tr("Superscript"); 2402 checkable = true; 2403 break; 2404 case InsertUnorderedList: 2405 text = tr("Insert Bulleted List"); 2406 checkable = true; 2407 break; 2408 case InsertOrderedList: 2409 text = tr("Insert Numbered List"); 2410 checkable = true; 2411 break; 2412 case Indent: 2413 text = tr("Indent"); 2414 break; 2415 case Outdent: 2416 text = tr("Outdent"); 2417 break; 2418 case AlignCenter: 2419 text = tr("Center"); 2420 break; 2421 case AlignJustified: 2422 text = tr("Justify"); 2423 break; 2424 case AlignLeft: 2425 text = tr("Align Left"); 2426 break; 2427 case AlignRight: 2428 text = tr("Align Right"); 2429 break; 2430 1804 2431 case NoWebAction: 1805 2432 return 0; … … 1864 2491 d->mouseMoveEvent(static_cast<QMouseEvent*>(ev)); 1865 2492 break; 2493 case QEvent::GraphicsSceneMouseMove: 2494 d->mouseMoveEvent(static_cast<QGraphicsSceneMouseEvent*>(ev)); 2495 break; 1866 2496 case QEvent::MouseButtonPress: 1867 2497 d->mousePressEvent(static_cast<QMouseEvent*>(ev)); 2498 break; 2499 case QEvent::GraphicsSceneMousePress: 2500 d->mousePressEvent(static_cast<QGraphicsSceneMouseEvent*>(ev)); 1868 2501 break; 1869 2502 case QEvent::MouseButtonDblClick: 1870 2503 d->mouseDoubleClickEvent(static_cast<QMouseEvent*>(ev)); 1871 2504 break; 2505 case QEvent::GraphicsSceneMouseDoubleClick: 2506 d->mouseDoubleClickEvent(static_cast<QGraphicsSceneMouseEvent*>(ev)); 2507 break; 1872 2508 case QEvent::MouseButtonRelease: 1873 2509 d->mouseReleaseEvent(static_cast<QMouseEvent*>(ev)); 1874 2510 break; 2511 case QEvent::GraphicsSceneMouseRelease: 2512 d->mouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent*>(ev)); 2513 break; 1875 2514 #ifndef QT_NO_CONTEXTMENU 1876 2515 case QEvent::ContextMenu: 1877 d->contextMenuEvent(static_cast<QContextMenuEvent*>(ev)); 2516 d->contextMenuEvent(static_cast<QContextMenuEvent*>(ev)->globalPos()); 2517 break; 2518 case QEvent::GraphicsSceneContextMenu: 2519 d->contextMenuEvent(static_cast<QGraphicsSceneContextMenuEvent*>(ev)->screenPos()); 1878 2520 break; 1879 2521 #endif … … 1881 2523 case QEvent::Wheel: 1882 2524 d->wheelEvent(static_cast<QWheelEvent*>(ev)); 2525 break; 2526 case QEvent::GraphicsSceneWheel: 2527 d->wheelEvent(static_cast<QGraphicsSceneWheelEvent*>(ev)); 1883 2528 break; 1884 2529 #endif … … 1899 2544 d->dragEnterEvent(static_cast<QDragEnterEvent*>(ev)); 1900 2545 break; 2546 case QEvent::GraphicsSceneDragEnter: 2547 d->dragEnterEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev)); 2548 break; 1901 2549 case QEvent::DragLeave: 1902 2550 d->dragLeaveEvent(static_cast<QDragLeaveEvent*>(ev)); 2551 break; 2552 case QEvent::GraphicsSceneDragLeave: 2553 d->dragLeaveEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev)); 1903 2554 break; 1904 2555 case QEvent::DragMove: 1905 2556 d->dragMoveEvent(static_cast<QDragMoveEvent*>(ev)); 1906 2557 break; 2558 case QEvent::GraphicsSceneDragMove: 2559 d->dragMoveEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev)); 2560 break; 1907 2561 case QEvent::Drop: 1908 2562 d->dropEvent(static_cast<QDropEvent*>(ev)); 2563 break; 2564 case QEvent::GraphicsSceneDrop: 2565 d->dropEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev)); 1909 2566 break; 1910 2567 #endif … … 1964 2621 // FIXME: mac port calls this if there is no selectedDOMRange 1965 2622 //frame->setSelectionFromNone(); 1966 } else {2623 } else 1967 2624 frame->removeEditingStyleFromBodyElement(); 1968 }1969 2625 } 1970 2626 … … 1980 2636 /*! 1981 2637 \property QWebPage::forwardUnsupportedContent 1982 \brief whether QWebPage should forward unsupported content through the 1983 unsupportedContent signal 1984 1985 If disabled the download of such content is aborted immediately. 2638 \brief whether QWebPage should forward unsupported content 2639 2640 If enabled, the unsupportedContent() signal is emitted with a network reply that 2641 can be used to read the content. 2642 2643 If disabled, the download of such content is aborted immediately. 1986 2644 1987 2645 By default unsupported content is not forwarded. … … 2030 2688 d->page->contextMenuController()->clearContextMenu(); 2031 2689 2032 if (QWebFrame* webFrame = d->frameAt(event->pos())) {2690 if (QWebFrame* webFrame = frameAt(event->pos())) { 2033 2691 Frame* frame = QWebFramePrivate::core(webFrame); 2034 if (Scrollbar* scrollbar = frame->view()->scrollbar UnderMouse(PlatformMouseEvent(event, 1))) {2692 if (Scrollbar* scrollbar = frame->view()->scrollbarAtPoint(PlatformMouseEvent(event, 1).pos())) 2035 2693 return scrollbar->contextMenu(PlatformMouseEvent(event, 1)); 2036 }2037 2694 } 2038 2695 … … 2064 2721 } 2065 2722 2723 d->createMainFrame(); 2066 2724 WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame(); 2067 2725 HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos), /*allowShadowContent*/ false); 2068 2726 2069 d->hitTestResult = QWebHitTestResult(new QWebHitTestResultPrivate(result)); 2727 if (result.scrollbar()) 2728 d->hitTestResult = QWebHitTestResult(); 2729 else 2730 d->hitTestResult = QWebHitTestResult(new QWebHitTestResultPrivate(result)); 2070 2731 WebCore::ContextMenu menu(result); 2071 2732 menu.populate(); … … 2086 2747 for (int i = 0; i < QWebPage::WebActionCount; ++i) { 2087 2748 if (originallyEnabledWebActions.at(i)) { 2088 if (QAction *a = this->action(QWebPage::WebAction(i))) {2749 if (QAction *a = this->action(QWebPage::WebAction(i))) 2089 2750 a->setEnabled(true); 2090 }2091 2751 } 2092 2752 } … … 2111 2771 file selection is allowed. 2112 2772 2773 \omitvalue ErrorPageExtension (introduced in Qt 4.6) 2774 */ 2775 2776 /*! 2777 \enum QWebPage::ErrorDomain 2778 \since 4.6 2779 \internal 2780 2781 \value QtNetwork 2782 \value Http 2783 \value WebKit 2113 2784 */ 2114 2785 … … 2118 2789 \brief The ExtensionOption class provides an extended input argument to QWebPage's extension support. 2119 2790 2791 \inmodule QtWebKit 2792 2120 2793 \sa QWebPage::extension() 2794 */ 2795 2796 /*! 2797 \class QWebPage::ErrorPageExtensionOption 2798 \since 4.6 2799 \brief The ErrorPageExtensionOption class describes the option 2800 for the error page extension. 2801 2802 \inmodule QtWebKit 2803 2804 The ErrorPageExtensionOption class holds the \a url for which an error occoured as well as 2805 the associated \a frame. 2806 2807 The error itself is reported by an error \a domain, the \a error code as well as \a errorString. 2808 2809 \sa QWebPage::ErrorPageExtensionReturn 2810 */ 2811 2812 /*! 2813 \class QWebPage::ErrorPageExtensionReturn 2814 \since 4.6 2815 \brief The ErrorPageExtensionReturn describes the error page, which will be shown for the 2816 frame for which the error occured. 2817 2818 \inmodule QtWebKit 2819 2820 The ErrorPageExtensionReturn class holds the data needed for creating an error page. Some are 2821 optional such as \a contentType, which defaults to "text/html", as well as the \a encoding, which 2822 is assumed to be UTF-8 if not indicated otherwise. 2823 2824 The error page is stored in the \a content byte array, as HTML content. In order to convert a 2825 QString to a byte array, the QString::toUtf8() method can be used. 2826 2827 External objects such as stylesheets or images referenced in the HTML are located relative to 2828 \a baseUrl. 2829 2830 \sa QWebPage::ErrorPageExtensionOption, QString::toUtf8() 2831 */ 2832 2833 /*! 2834 \fn QWebPage::ErrorPageExtensionReturn::ErrorPageExtensionReturn() 2835 2836 Constructs a new error page object. 2121 2837 */ 2122 2838 … … 2127 2843 for the multiple files selection extension. 2128 2844 2845 \inmodule QtWebKit 2846 2129 2847 The ChooseMultipleFilesExtensionOption class holds the frame originating the request 2130 2848 and the suggested filenames which might be provided. … … 2139 2857 for the multiple files selection extension. 2140 2858 2859 \inmodule QtWebKit 2860 2141 2861 The ChooseMultipleFilesExtensionReturn class holds the filenames selected by the user 2142 2862 when the extension is invoked. … … 2163 2883 // FIXME: do not ignore suggestedFiles 2164 2884 QStringList suggestedFiles = static_cast<const ChooseMultipleFilesExtensionOption*>(option)->suggestedFileNames; 2165 QStringList names = QFileDialog::getOpenFileNames( d->view, QString::null);2885 QStringList names = QFileDialog::getOpenFileNames(view(), QString::null); 2166 2886 static_cast<ChooseMultipleFilesExtensionReturn*>(output)->fileNames = names; 2167 2887 return true; … … 2188 2908 2189 2909 /*! 2190 Finds the next occurrence of the string, \a subString, in the page, using the given \a options. 2191 Returns true of \a subString was found and selects the match visually; otherwise returns false. 2910 Finds the specified string, \a subString, in the page, using the given \a options. 2911 2912 If the HighlightAllOccurrences flag is passed, the function will highlight all occurrences 2913 that exist in the page. All subsequent calls will extend the highlight, rather than 2914 replace it, with occurrences of the new string. 2915 2916 If the HighlightAllOccurrences flag is not passed, the function will select an occurrence 2917 and all subsequent calls will replace the current occurrence with the next one. 2918 2919 To clear the selection, just pass an empty string. 2920 2921 Returns true if \a subString was found; otherwise returns false. 2192 2922 */ 2193 2923 bool QWebPage::findText(const QString &subString, FindFlags options) … … 2197 2927 caseSensitivity = ::TextCaseSensitive; 2198 2928 2199 ::FindDirection direction = ::FindDirectionForward; 2200 if (options & FindBackward) 2201 direction = ::FindDirectionBackward; 2202 2203 const bool shouldWrap = options & FindWrapsAroundDocument; 2204 2205 return d->page->findString(subString, caseSensitivity, direction, shouldWrap); 2929 if (options & HighlightAllOccurrences) { 2930 if (subString.isEmpty()) { 2931 d->page->unmarkAllTextMatches(); 2932 return true; 2933 } else 2934 return d->page->markAllMatchesForText(subString, caseSensitivity, true, 0); 2935 } else { 2936 ::FindDirection direction = ::FindDirectionForward; 2937 if (options & FindBackward) 2938 direction = ::FindDirectionBackward; 2939 2940 const bool shouldWrap = options & FindWrapsAroundDocument; 2941 2942 return d->page->findString(subString, caseSensitivity, direction, shouldWrap); 2943 } 2206 2944 } 2207 2945 … … 2225 2963 QString QWebPage::chooseFile(QWebFrame *parentFrame, const QString& suggestedFile) 2226 2964 { 2965 Q_UNUSED(parentFrame) 2227 2966 #ifndef QT_NO_FILEDIALOG 2228 return QFileDialog::getOpenFileName( d->view, QString::null, suggestedFile);2967 return QFileDialog::getOpenFileName(view(), QString::null, suggestedFile); 2229 2968 #else 2230 2969 return QString::null; … … 2264 3003 Sets the QNetworkAccessManager \a manager responsible for serving network requests for this 2265 3004 QWebPage. 3005 3006 \note It is currently not supported to change the network access manager after the 3007 QWebPage has used it. The results of doing this are undefined. 2266 3008 2267 3009 \sa networkAccessManager() … … 2323 3065 The default implementation returns the following value: 2324 3066 2325 "Mozilla/5.0 (%Platform%; %Security%; %Subplatform%; %Locale%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko , Safari/419.3) %AppVersion"3067 "Mozilla/5.0 (%Platform%; %Security%; %Subplatform%; %Locale%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko) %AppVersion Safari/%WebKitVersion%" 2326 3068 2327 3069 In this string the following values are replaced at run-time: … … 2331 3073 \o %Locale% is replaced with QLocale::name(). The locale is determined from the view of the QWebPage. If no view is set on the QWebPage, 2332 3074 then a default constructed QLocale is used instead. 2333 \o %WebKitVersion% currently expands to 527+3075 \o %WebKitVersion% is the version of WebKit the application was compiled against. 2334 3076 \o %AppVersion% expands to QCoreApplication::applicationName()/QCoreApplication::applicationVersion() if they're set; otherwise defaulting to Qt and the current Qt version. 2335 3077 \endlist … … 2340 3082 QString ua = QLatin1String("Mozilla/5.0 (" 2341 3083 2342 // Pla stform3084 // Platform 2343 3085 #ifdef Q_WS_MAC 2344 3086 "Macintosh" … … 2349 3091 #elif defined Q_WS_X11 2350 3092 "X11" 3093 #elif defined Q_OS_SYMBIAN 3094 "SymbianOS" 2351 3095 #else 2352 3096 "Unknown" 2353 3097 #endif 2354 "; " 3098 // Placeholder for Platform Version 3099 "%1; " 2355 3100 2356 3101 // Placeholder for security strength (N or U) 2357 "% 1; "3102 "%2; " 2358 3103 2359 3104 // Subplatform" … … 2361 3106 "AIX" 2362 3107 #elif defined Q_OS_WIN32 2363 "% 2"3108 "%3" 2364 3109 #elif defined Q_OS_DARWIN 2365 3110 #ifdef __i386__ || __x86_64__ … … 2413 3158 #elif defined Q_OS_ULTRIX 2414 3159 "DEC Ultrix" 3160 #elif defined Q_WS_S60 3161 "Series60" 2415 3162 #elif defined Q_OS_UNIX 2416 3163 "UNIX BSD/SYSV system" … … 2420 3167 "Unknown" 2421 3168 #endif 2422 "; "); 3169 // Placeholder for SubPlatform Version 3170 "%4; "); 3171 3172 // Platform Version 3173 QString osVer; 3174 #ifdef Q_OS_SYMBIAN 3175 QSysInfo::SymbianVersion symbianVersion = QSysInfo::symbianVersion(); 3176 switch (symbianVersion) { 3177 case QSysInfo::SV_9_2: 3178 osVer = "/9.2"; 3179 break; 3180 case QSysInfo::SV_9_3: 3181 osVer = "/9.3"; 3182 break; 3183 case QSysInfo::SV_9_4: 3184 osVer = "/9.4"; 3185 break; 3186 default: 3187 osVer = "Unknown"; 3188 } 3189 #endif 3190 ua = ua.arg(osVer); 2423 3191 2424 3192 QChar securityStrength(QLatin1Char('N')); 2425 3193 #if !defined(QT_NO_OPENSSL) 2426 if (QSslSocket::supportsSsl()) 2427 securityStrength = QLatin1Char('U'); 3194 // we could check QSslSocket::supportsSsl() here, but this makes 3195 // OpenSSL, certificates etc being loaded in all cases were QWebPage 3196 // is used. This loading is not needed for non-https. 3197 securityStrength = QLatin1Char('U'); 3198 // this may lead to a false positive: We indicate SSL since it is 3199 // compiled in even though supportsSsl() might return false 2428 3200 #endif 2429 3201 ua = ua.arg(securityStrength); … … 2431 3203 #if defined Q_OS_WIN32 2432 3204 QString ver; 2433 switch (QSysInfo::WindowsVersion) {3205 switch (QSysInfo::WindowsVersion) { 2434 3206 case QSysInfo::WV_32s: 2435 3207 ver = "Windows 3.1"; … … 2459 3231 ver = "Windows NT 6.0"; 2460 3232 break; 3233 #if QT_VERSION > 0x040500 3234 case QSysInfo::WV_WINDOWS7: 3235 ver = "Windows NT 6.1"; 3236 break; 3237 #endif 2461 3238 case QSysInfo::WV_CE: 2462 3239 ver = "Windows CE"; … … 2475 3252 #endif 2476 3253 3254 // SubPlatform Version 3255 QString subPlatformVer; 3256 #ifdef Q_OS_SYMBIAN 3257 QSysInfo::S60Version s60Version = QSysInfo::s60Version(); 3258 switch (s60Version) { 3259 case QSysInfo::SV_S60_3_1: 3260 subPlatformVer = "/3.1"; 3261 break; 3262 case QSysInfo::SV_S60_3_2: 3263 subPlatformVer = "/3.2"; 3264 break; 3265 case QSysInfo::SV_S60_5_0: 3266 subPlatformVer = "/5.0"; 3267 break; 3268 default: 3269 subPlatformVer = " Unknown"; 3270 } 3271 #endif 3272 ua = ua.arg(subPlatformVer); 3273 2477 3274 // Language 2478 3275 QLocale locale; 2479 if ( d->view)2480 locale = d->view->locale();3276 if (view()) 3277 locale = view()->locale(); 2481 3278 QString name = locale.name(); 2482 3279 name[2] = QLatin1Char('-'); … … 2485 3282 2486 3283 // webkit/qt version 2487 ua.append(QLatin1String("AppleWebKit/" WEBKIT_VERSION " (KHTML, like Gecko, Safari/419.3) ")); 3284 ua.append(QString(QLatin1String("AppleWebKit/%1 (KHTML, like Gecko) ")) 3285 .arg(QString(qWebKitVersion()))); 2488 3286 2489 3287 // Application name/version 2490 3288 QString appName = QCoreApplication::applicationName(); 2491 3289 if (!appName.isEmpty()) { 2492 ua.append( QLatin1Char(' ') +appName);3290 ua.append(appName); 2493 3291 #if QT_VERSION >= 0x040400 2494 3292 QString appVer = QCoreApplication::applicationVersion(); … … 2501 3299 ua.append(QLatin1String(qVersion())); 2502 3300 } 3301 3302 ua.append(QString(QLatin1String(" Safari/%1")) 3303 .arg(qWebKitVersion())); 3304 2503 3305 return ua; 2504 3306 } 2505 3307 2506 3308 2507 void QWebPagePrivate::_q_onLoadProgressChanged(int) { 3309 void QWebPagePrivate::_q_onLoadProgressChanged(int) 3310 { 2508 3311 m_totalBytes = page->progress()->totalPageAndResourceBytesToLoad(); 2509 3312 m_bytesReceived = page->progress()->totalBytesReceived(); … … 2517 3320 \sa bytesReceived() 2518 3321 */ 2519 quint64 QWebPage::totalBytes() const { 3322 quint64 QWebPage::totalBytes() const 3323 { 3324 return d->m_totalBytes; 3325 } 3326 3327 3328 /*! 3329 Returns the number of bytes that were received from the network to render the current page. 3330 3331 \sa totalBytes() 3332 */ 3333 quint64 QWebPage::bytesReceived() const 3334 { 2520 3335 return d->m_bytesReceived; 2521 }2522 2523 2524 /*!2525 Returns the number of bytes that were received from the network to render the current page.2526 2527 \sa totalBytes()2528 */2529 quint64 QWebPage::bytesReceived() const {2530 return d->m_totalBytes;2531 3336 } 2532 3337 … … 2650 3455 \fn void QWebPage::unsupportedContent(QNetworkReply *reply) 2651 3456 2652 This signal s is emitted when webkit cannot handle a link the user navigated to.2653 2654 At signal emission s time the metadata of the QNetworkReply \a reply is available.3457 This signal is emitted when WebKit cannot handle a link the user navigated to. 3458 3459 At signal emission time the meta-data of the QNetworkReply \a reply is available. 2655 3460 2656 3461 \note This signal is only emitted if the forwardUnsupportedContent property is set to true. -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
r2 r561 26 26 27 27 #include <QtCore/qobject.h> 28 #include <QtCore/qurl.h> 28 29 #include <QtGui/qwidget.h> 29 30 … … 31 32 class QNetworkProxy; 32 33 class QUndoStack; 33 class QUrl;34 34 class QMenu; 35 35 class QNetworkRequest; … … 38 38 QT_END_NAMESPACE 39 39 40 class QWebElement; 40 41 class QWebFrame; 41 42 class QWebNetworkRequest; … … 53 54 class EditorClientQt; 54 55 class FrameLoaderClientQt; 55 class FrameLoadRequest;56 56 class InspectorClientQt; 57 57 class ResourceHandle; 58 58 class HitTestResult; 59 class QNetworkReplyHandler; 60 61 struct FrameLoadRequest; 59 62 } 60 63 61 class QWEBKIT_EXPORT QWebPage : public QObject 62 { 64 class QWEBKIT_EXPORT QWebPage : public QObject { 63 65 Q_OBJECT 64 66 … … 66 68 Q_PROPERTY(QString selectedText READ selectedText) 67 69 Q_PROPERTY(QSize viewportSize READ viewportSize WRITE setViewportSize) 70 Q_PROPERTY(QSize preferredContentsSize READ preferredContentsSize WRITE setPreferredContentsSize) 68 71 Q_PROPERTY(bool forwardUnsupportedContent READ forwardUnsupportedContent WRITE setForwardUnsupportedContent) 69 72 Q_PROPERTY(LinkDelegationPolicy linkDelegationPolicy READ linkDelegationPolicy WRITE setLinkDelegationPolicy) … … 148 151 149 152 SelectAll, 153 ReloadAndBypassCache, 154 155 PasteAndMatchStyle, 156 RemoveFormat, 157 158 ToggleStrikethrough, 159 ToggleSubscript, 160 ToggleSuperscript, 161 InsertUnorderedList, 162 InsertOrderedList, 163 Indent, 164 Outdent, 165 166 AlignCenter, 167 AlignJustified, 168 AlignLeft, 169 AlignRight, 150 170 151 171 WebActionCount … … 155 175 FindBackward = 1, 156 176 FindCaseSensitively = 2, 157 FindWrapsAroundDocument = 4 177 FindWrapsAroundDocument = 4, 178 HighlightAllOccurrences = 8 158 179 }; 159 180 Q_DECLARE_FLAGS(FindFlags, FindFlag) … … 175 196 QWebFrame *mainFrame() const; 176 197 QWebFrame *currentFrame() const; 198 QWebFrame* frameAt(const QPoint& pos) const; 177 199 178 200 QWebHistory *history() const; … … 216 238 void setViewportSize(const QSize &size) const; 217 239 240 QSize preferredContentsSize() const; 241 void setPreferredContentsSize(const QSize &size) const; 242 218 243 virtual bool event(QEvent*); 219 244 bool focusNextPrevChild(bool next); … … 243 268 244 269 enum Extension { 245 ChooseMultipleFilesExtension 270 ChooseMultipleFilesExtension, 271 ErrorPageExtension 246 272 }; 247 273 class ExtensionOption … … 261 287 }; 262 288 289 enum ErrorDomain { QtNetwork, Http, WebKit }; 290 class ErrorPageExtensionOption : public ExtensionOption { 291 public: 292 QUrl url; 293 QWebFrame* frame; 294 ErrorDomain domain; 295 int error; 296 QString errorString; 297 }; 298 299 class ErrorPageExtensionReturn : public ExtensionReturn { 300 public: 301 ErrorPageExtensionReturn() : contentType(QLatin1String("text/html")), encoding(QLatin1String("utf-8")) {}; 302 QString contentType; 303 QString encoding; 304 QUrl baseUrl; 305 QByteArray content; 306 }; 307 308 263 309 virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0); 264 310 virtual bool supportsExtension(Extension extension) const; 265 311 266 312 inline QWebPagePrivate* handle() const { return d; } 313 314 public Q_SLOTS: 315 bool shouldInterruptJavaScript(); 267 316 268 317 Q_SIGNALS: … … 318 367 Q_PRIVATE_SLOT(d, void _q_onLoadProgressChanged(int)) 319 368 Q_PRIVATE_SLOT(d, void _q_webActionTriggered(bool checked)) 369 Q_PRIVATE_SLOT(d, void _q_cleanupLeakMessages()) 370 320 371 QWebPagePrivate *d; 321 372 … … 323 374 friend class QWebPagePrivate; 324 375 friend class QWebView; 376 friend class QGraphicsWebView; 377 friend class QWebInspector; 325 378 friend class WebCore::ChromeClientQt; 326 379 friend class WebCore::EditorClientQt; … … 328 381 friend class WebCore::InspectorClientQt; 329 382 friend class WebCore::ResourceHandle; 383 friend class WebCore::QNetworkReplyHandler; 330 384 }; 331 385 -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
r2 r561 26 26 #include <qpointer.h> 27 27 #include <qevent.h> 28 #include <qgraphicssceneevent.h> 28 29 29 30 #include "qwebpage.h" … … 36 37 #include <wtf/RefPtr.h> 37 38 38 namespace WebCore 39 { 39 namespace WebCore { 40 40 class ChromeClientQt; 41 41 class ContextMenuClientQt; … … 44 44 class EditorClientQt; 45 45 class Element; 46 class InspectorController; 46 47 class Node; 47 48 class Page; 48 49 #ifndef QT_NO_CURSOR 50 class SetCursorEvent : public QEvent { 51 public: 52 static const int EventType = 724; 53 SetCursorEvent(const QCursor&); 54 55 QCursor cursor() const; 56 private: 57 QCursor m_cursor; 58 }; 59 #endif 49 class Frame; 60 50 } 61 51 … … 66 56 QT_END_NAMESPACE 67 57 68 class QWebPagePrivate 69 { 58 class QWebInspector; 59 class QWebPageClient; 60 61 class QWebPagePrivate { 70 62 public: 71 QWebPagePrivate(QWebPage 63 QWebPagePrivate(QWebPage*); 72 64 ~QWebPagePrivate(); 73 65 void createMainFrame(); 74 66 #ifndef QT_NO_CONTEXTMENU 75 QMenu *createContextMenu(const WebCore::ContextMenu *webcoreMenu, const QList<WebCore::ContextMenuItem> *items, QBitArray *visitedWebActions);67 QMenu* createContextMenu(const WebCore::ContextMenu* webcoreMenu, const QList<WebCore::ContextMenuItem>* items, QBitArray* visitedWebActions); 76 68 #endif 77 78 QWebFrame *frameAt(const QPoint &pos) const;79 80 69 void _q_onLoadProgressChanged(int); 81 70 void _q_webActionTriggered(bool checked); 71 void _q_cleanupLeakMessages(); 82 72 void updateAction(QWebPage::WebAction action); 83 73 void updateNavigationActions(); … … 87 77 88 78 void mouseMoveEvent(QMouseEvent*); 79 void mouseMoveEvent(QGraphicsSceneMouseEvent*); 89 80 void mousePressEvent(QMouseEvent*); 81 void mousePressEvent(QGraphicsSceneMouseEvent*); 90 82 void mouseDoubleClickEvent(QMouseEvent*); 83 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*); 91 84 void mouseTripleClickEvent(QMouseEvent*); 85 void mouseTripleClickEvent(QGraphicsSceneMouseEvent*); 92 86 void mouseReleaseEvent(QMouseEvent*); 87 void mouseReleaseEvent(QGraphicsSceneMouseEvent*); 93 88 #ifndef QT_NO_CONTEXTMENU 94 void contextMenuEvent( QContextMenuEvent*);89 void contextMenuEvent(const QPoint& globalPos); 95 90 #endif 96 91 #ifndef QT_NO_WHEELEVENT 97 92 void wheelEvent(QWheelEvent*); 93 void wheelEvent(QGraphicsSceneWheelEvent*); 98 94 #endif 99 95 void keyPressEvent(QKeyEvent*); … … 102 98 void focusOutEvent(QFocusEvent*); 103 99 104 void dragEnterEvent(QDragEnterEvent *); 105 void dragLeaveEvent(QDragLeaveEvent *); 106 void dragMoveEvent(QDragMoveEvent *); 107 void dropEvent(QDropEvent *); 100 void dragEnterEvent(QDragEnterEvent*); 101 void dragEnterEvent(QGraphicsSceneDragDropEvent*); 102 void dragLeaveEvent(QDragLeaveEvent*); 103 void dragLeaveEvent(QGraphicsSceneDragDropEvent*); 104 void dragMoveEvent(QDragMoveEvent*); 105 void dragMoveEvent(QGraphicsSceneDragDropEvent*); 106 void dropEvent(QDropEvent*); 107 void dropEvent(QGraphicsSceneDragDropEvent*); 108 108 109 109 void inputMethodEvent(QInputMethodEvent*); 110 110 111 111 void shortcutOverrideEvent(QKeyEvent*); 112 void leaveEvent(QEvent *); 113 bool handleScrolling(QKeyEvent*); 112 void leaveEvent(QEvent*); 113 void handleClipboard(QEvent*, Qt::MouseButton); 114 void handleSoftwareInputPanel(Qt::MouseButton); 115 bool handleScrolling(QKeyEvent*, WebCore::Frame*); 116 117 void setInspector(QWebInspector*); 118 QWebInspector* getOrCreateInspector(); 119 WebCore::InspectorController* inspectorController(); 114 120 115 121 #ifndef QT_NO_SHORTCUT … … 126 132 127 133 QWebPage *q; 134 QWebPageClient* client; 128 135 #ifndef QT_NO_UNDOSTACK 129 136 QUndoStack *undoStack; 130 137 #endif 131 QWidget *view; 138 139 #if QT_VERSION >= 0x040600 140 QWeakPointer<QWidget> view; 141 #else 142 QWidget* view; 143 #endif 132 144 133 145 bool insideOpenCall; … … 137 149 QPoint tripleClick; 138 150 QBasicTimer tripleClickTimer; 151 152 bool clickCausedFocus; 139 153 140 154 #if QT_VERSION < 0x040400 … … 155 169 156 170 QSize viewportSize; 171 QSize fixedLayoutSize; 157 172 QWebHistory history; 158 173 QWebHitTestResult hitTestResult; … … 163 178 QPalette palette; 164 179 bool editable; 180 bool useFixedLayout; 165 181 166 182 QAction *actions[QWebPage::WebActionCount]; … … 168 184 QWebPluginFactory *pluginFactory; 169 185 186 QWidget* inspectorFrontend; 187 QWebInspector* inspector; 188 bool inspectorIsInternalOnly; // True if created through the Inspect context menu action 189 170 190 static bool drtRun; 171 191 }; -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
r2 r561 26 26 \brief The QWebPluginFactory class creates plugins to be embedded into web 27 27 pages. 28 29 \inmodule QtWebKit 28 30 29 31 QWebPluginFactory is a factory for creating plugins for QWebPage. A plugin … … 48 50 \since 4.4 49 51 \brief the QWebPluginFactory::Plugin structure describes the properties of a plugin a QWebPluginFactory can create. 52 53 \inmodule QtWebKit 50 54 */ 51 55 … … 69 73 \since 4.4 70 74 \brief The QWebPluginFactory::MimeType structure describes a mime type supported by a plugin. 75 76 \inmodule QtWebKit 77 */ 78 79 /*! 80 Returns true if this mimetype is the same as the \a other mime type. 81 */ 82 bool QWebPluginFactory::MimeType::operator==(const MimeType& other) const 83 { 84 return name == other.name 85 && description == other.description 86 && fileExtensions == other.fileExtensions; 87 } 88 89 /*! 90 \fn bool QWebPluginFactory::MimeType::operator!=(const MimeType& other) const 91 92 Returns true if this mimetype is different from the \a other mime type. 71 93 */ 72 94 … … 137 159 138 160 \code 139 <object type="application/x-pdf" data="http://qt software.com/document.pdf" width="500" height="400">161 <object type="application/x-pdf" data="http://qt.nokia.com/document.pdf" width="500" height="400"> 140 162 <param name="showTableOfContents" value="true" /> 141 163 <param name="hideThumbnails" value="false" /> … … 150 172 \o "application/x-pdf" 151 173 \row \o url 152 \o "http://qt software.com/document.pdf"174 \o "http://qt.nokia.com/document.pdf" 153 175 \row \o argumentNames 154 176 \o "showTableOfContents" "hideThumbnails" … … 174 196 \brief The ExtensionOption class provides an extended input argument to QWebPluginFactory's extension support. 175 197 198 \inmodule QtWebKit 199 176 200 \sa QWebPluginFactory::extension() 177 201 */ … … 181 205 \since 4.4 182 206 \brief The ExtensionOption class provides an extended output argument to QWebPluginFactory's extension support. 207 208 \inmodule QtWebKit 183 209 184 210 \sa QWebPluginFactory::extension() -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h
r2 r561 32 32 class QWebPluginFactoryPrivate; 33 33 34 class QWEBKIT_EXPORT QWebPluginFactory : public QObject 35 { 34 class QWEBKIT_EXPORT QWebPluginFactory : public QObject { 36 35 Q_OBJECT 37 36 public: 38 struct MimeType {37 struct QWEBKIT_EXPORT MimeType { 39 38 QString name; 40 39 QString description; 41 40 QStringList fileExtensions; 41 bool operator==(const MimeType& other) const; 42 inline bool operator!=(const MimeType& other) const { return !operator==(other); } 42 43 }; 43 44 … … 48 49 }; 49 50 50 explicit QWebPluginFactory(QObject *parent = 0);51 explicit QWebPluginFactory(QObject* parent = 0); 51 52 virtual ~QWebPluginFactory(); 52 53 … … 54 55 virtual void refreshPlugins(); 55 56 56 virtual QObject *create(const QString &mimeType,57 const QUrl &url,58 const QStringList &argumentNames,59 const QStringList &argumentValues) const = 0;57 virtual QObject *create(const QString& mimeType, 58 const QUrl&, 59 const QStringList& argumentNames, 60 const QStringList& argumentValues) const = 0; 60 61 61 62 enum Extension { … … 65 66 class ExtensionReturn 66 67 {}; 67 virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);68 virtual bool extension(Extension extension, const ExtensionOption* option = 0, ExtensionReturn* output = 0); 68 69 virtual bool supportsExtension(Extension extension) const; 69 70 70 71 private: 71 QWebPluginFactoryPrivate *d;72 QWebPluginFactoryPrivate* d; 72 73 }; 73 74 -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
r2 r561 31 31 using namespace WebCore; 32 32 33 void QWEBKIT_EXPORT qt_drt_whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains) 34 { 35 SecurityOrigin::whiteListAccessFromOrigin(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains); 36 } 37 38 void QWEBKIT_EXPORT qt_drt_resetOriginAccessWhiteLists() 39 { 40 SecurityOrigin::resetOriginAccessWhiteLists(); 41 } 42 33 43 /*! 34 44 \class QWebSecurityOrigin … … 36 46 \brief The QWebSecurityOrigin class defines a security boundary for web sites. 37 47 48 \inmodule QtWebKit 49 38 50 QWebSecurityOrigin provides access to the security domains defined by web sites. 39 An origin consists of a host name, a scheme, and a port number. Web sites with the same 40 security origin can access each other's resources for client-side scripting or databases. 41 42 ### diagram 51 An origin consists of a host name, a scheme, and a port number. Web sites 52 with the same security origin can access each other's resources for client-side 53 scripting or databases. 43 54 44 55 For example the site \c{http://www.example.com/my/page.html} is allowed to share the same … … 48 59 because they are of a different security origin. 49 60 50 QWebSecurity also provides access to all databases defined within a security origin. 61 Call QWebFrame::securityOrigin() to get the QWebSecurityOrigin for a frame in a 62 web page, and use host(), scheme() and port() to identify the security origin. 63 64 Use databases() to access the databases defined within a security origin. The 65 disk usage of the origin's databases can be limited with setDatabaseQuota(). 66 databaseQuota() and databaseUsage() report the current limit as well as the 67 current usage. 51 68 52 69 For more information refer to the … … 102 119 qint64 QWebSecurityOrigin::databaseUsage() const 103 120 { 121 #if ENABLE(DATABASE) 104 122 return DatabaseTracker::tracker().usageForOrigin(d->origin.get()); 123 #else 124 return 0; 125 #endif 105 126 } 106 127 … … 110 131 qint64 QWebSecurityOrigin::databaseQuota() const 111 132 { 133 #if ENABLE(DATABASE) 112 134 return DatabaseTracker::tracker().quotaForOrigin(d->origin.get()); 135 #else 136 return 0; 137 #endif 113 138 } 114 139 … … 122 147 void QWebSecurityOrigin::setDatabaseQuota(qint64 quota) 123 148 { 149 #if ENABLE(DATABASE) 124 150 DatabaseTracker::tracker().setQuota(d->origin.get(), quota); 151 #endif 125 152 } 126 153 … … 145 172 QList<QWebSecurityOrigin> QWebSecurityOrigin::allOrigins() 146 173 { 174 QList<QWebSecurityOrigin> webOrigins; 175 176 #if ENABLE(DATABASE) 147 177 Vector<RefPtr<SecurityOrigin> > coreOrigins; 148 178 DatabaseTracker::tracker().origins(coreOrigins); 149 QList<QWebSecurityOrigin> webOrigins;150 179 151 180 for (unsigned i = 0; i < coreOrigins.size(); ++i) { … … 153 182 webOrigins.append(priv); 154 183 } 184 #endif 185 155 186 return webOrigins; 156 187 } … … 161 192 QList<QWebDatabase> QWebSecurityOrigin::databases() const 162 193 { 194 QList<QWebDatabase> databases; 195 196 #if ENABLE(DATABASE) 163 197 Vector<String> nameVector; 164 QList<QWebDatabase> databases; 198 165 199 if (!DatabaseTracker::tracker().databaseNamesForOrigin(d->origin.get(), nameVector)) 166 200 return databases; … … 172 206 databases.append(webDatabase); 173 207 } 208 #endif 209 174 210 return databases; 175 211 } 176 212 213 /*! 214 \since 4.6 215 216 Adds the given \a scheme to the list of schemes that are considered equivalent 217 to the \c file: scheme. They are not subject to cross domain restrictions. 218 */ 219 void QWebSecurityOrigin::addLocalScheme(const QString& scheme) 220 { 221 SecurityOrigin::registerURLSchemeAsLocal(scheme); 222 } 223 224 /*! 225 \since 4.6 226 227 Removes the given \a scheme from the list of local schemes. 228 229 \sa addLocalScheme() 230 */ 231 void QWebSecurityOrigin::removeLocalScheme(const QString& scheme) 232 { 233 SecurityOrigin::removeURLSchemeRegisteredAsLocal(scheme); 234 } 235 236 /*! 237 \since 4.6 238 Returns a list of all the schemes that were set by the application as local schemes, 239 \sa addLocalScheme(), removeLocalScheme() 240 */ 241 QStringList QWebSecurityOrigin::localSchemes() 242 { 243 QStringList list; 244 const URLSchemesMap& map = SecurityOrigin::localURLSchemes(); 245 URLSchemesMap::const_iterator end = map.end(); 246 for (URLSchemesMap::const_iterator i = map.begin(); i != end; ++i) { 247 const QString scheme = *i; 248 list.append(scheme); 249 } 250 return list; 251 } -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
r2 r561 35 35 class QWebFrame; 36 36 37 class QWEBKIT_EXPORT QWebSecurityOrigin 38 { 37 class QWEBKIT_EXPORT QWebSecurityOrigin { 39 38 public: 40 39 static QList<QWebSecurityOrigin> allOrigins(); 40 static void addLocalScheme(const QString& scheme); 41 static void removeLocalScheme(const QString& scheme); 42 static QStringList localSchemes(); 41 43 42 44 ~QWebSecurityOrigin(); -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin_p.h
r2 r561 24 24 #include "RefPtr.h" 25 25 26 class QWebSecurityOriginPrivate : public QSharedData 27 { 26 class QWebSecurityOriginPrivate : public QSharedData { 28 27 public: 29 28 QWebSecurityOriginPrivate(WebCore::SecurityOrigin* o) -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
r2 r561 23 23 #include "qwebpage.h" 24 24 #include "qwebpage_p.h" 25 #include "qwebplugindatabase_p.h" 25 26 26 27 #include "Cache.h" 28 #include "CrossOriginPreflightResultCache.h" 29 #include "FontCache.h" 27 30 #include "Page.h" 28 31 #include "PageCache.h" … … 35 38 #include "ApplicationCacheStorage.h" 36 39 #include "DatabaseTracker.h" 37 40 #include "FileSystem.h" 41 42 #include <QApplication> 43 #include <QDesktopServices> 44 #include <QDir> 38 45 #include <QHash> 39 46 #include <QSharedData> … … 41 48 #include <QFileInfo> 42 49 43 class QWebSettingsPrivate 44 { 50 #if ENABLE(QT_BEARER) 51 #include "NetworkStateNotifier.h" 52 #endif 53 54 void QWEBKIT_EXPORT qt_networkAccessAllowed(bool isAllowed) 55 { 56 #if ENABLE(QT_BEARER) 57 WebCore::networkStateNotifier().setNetworkAccessAllowed(isAllowed); 58 #endif 59 } 60 61 class QWebSettingsPrivate { 45 62 public: 46 QWebSettingsPrivate(WebCore::Settings *wcSettings = 0)63 QWebSettingsPrivate(WebCore::Settings* wcSettings = 0) 47 64 : settings(wcSettings) 48 65 { … … 53 70 QHash<int, bool> attributes; 54 71 QUrl userStyleSheetLocation; 55 QString localStorageDatabasePath; 72 QString defaultTextEncoding; 73 QString localStoragePath; 56 74 QString offlineWebApplicationCachePath; 57 75 qint64 offlineStorageDefaultQuota; 58 76 59 77 void apply(); 60 WebCore::Settings *settings;78 WebCore::Settings* settings; 61 79 }; 62 80 … … 78 96 } 79 97 80 Q_GLOBAL_STATIC(QList<QWebSettingsPrivate 98 Q_GLOBAL_STATIC(QList<QWebSettingsPrivate*>, allSettings); 81 99 82 100 void QWebSettingsPrivate::apply() … … 85 103 settings->setTextAreasAreResizable(true); 86 104 87 QWebSettingsPrivate *global = QWebSettings::globalSettings()->d;105 QWebSettingsPrivate* global = QWebSettings::globalSettings()->d; 88 106 89 107 QString family = fontFamilies.value(QWebSettings::StandardFont, … … 162 180 settings->setUserStyleSheetLocation(WebCore::KURL(location)); 163 181 164 QString localStoragePath = !localStorageDatabasePath.isEmpty() ? localStorageDatabasePath : global->localStorageDatabasePath; 165 settings->setLocalStorageDatabasePath(localStoragePath); 182 QString encoding = !defaultTextEncoding.isEmpty() ? defaultTextEncoding: global->defaultTextEncoding; 183 settings->setDefaultTextEncodingName(encoding); 184 185 QString storagePath = !localStoragePath.isEmpty() ? localStoragePath : global->localStoragePath; 186 settings->setLocalStorageDatabasePath(storagePath); 166 187 167 188 value = attributes.value(QWebSettings::ZoomTextOnly, … … 181 202 settings->setOfflineWebApplicationCacheEnabled(value); 182 203 183 value = attributes.value(QWebSettings::LocalStorageDatabaseEnabled, 184 global->attributes.value(QWebSettings::LocalStorageDatabaseEnabled)); 204 value = attributes.value(QWebSettings::LocalStorageEnabled, 205 global->attributes.value(QWebSettings::LocalStorageEnabled)); 206 185 207 settings->setLocalStorageEnabled(value); 208 209 value = attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls, 210 global->attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls)); 211 settings->setAllowUniversalAccessFromFileURLs(value); 212 settings->setUsesPageCache(WebCore::pageCache()->capacity()); 186 213 } else { 187 QList<QWebSettingsPrivate 214 QList<QWebSettingsPrivate*> settings = *::allSettings(); 188 215 for (int i = 0; i < settings.count(); ++i) 189 216 settings[i]->apply(); … … 197 224 QWebPage instances where the particular setting is not overriden already. 198 225 */ 199 QWebSettings *QWebSettings::globalSettings()200 { 201 static QWebSettings *global = 0;226 QWebSettings* QWebSettings::globalSettings() 227 { 228 static QWebSettings* global = 0; 202 229 if (!global) 203 230 global = new QWebSettings; … … 211 238 by QWebPage and QWebFrame. 212 239 240 \inmodule QtWebKit 241 213 242 Each QWebPage object has its own QWebSettings object, which configures the 214 243 settings for that page. If a setting is not configured, then it is looked 215 244 up in the global settings object, which can be accessed using 216 QWebSettings::globalSettings(). 217 218 QWebSettings allows configuring font properties such as font size and font 219 family, the location of a custom stylesheet, and generic attributes like java 220 script, plugins, etc. The \l{QWebSettings::WebAttribute}{WebAttribute} 221 enum further describes this. 222 223 QWebSettings also configures global properties such as the web page memory 224 cache and the web page icon database, local database storage and offline 245 globalSettings(). 246 247 QWebSettings allows configuration of browser properties, such as font sizes and 248 families, the location of a custom style sheet, and generic attributes like 249 JavaScript and plugins. Individual attributes are set using the setAttribute() 250 function. The \l{QWebSettings::WebAttribute}{WebAttribute} enum further describes 251 each attribute. 252 253 QWebSettings also configures global properties such as the Web page memory 254 cache and the Web page icon database, local database storage and offline 225 255 applications storage. 256 257 \section1 Enabling Plugins 258 259 Support for browser plugins can enabled by setting the 260 \l{QWebSettings::PluginsEnabled}{PluginsEnabled} attribute. For many applications, 261 this attribute is enabled for all pages by setting it on the 262 \l{globalSettings()}{global settings object}. 226 263 227 264 \section1 Web Application Support … … 237 274 for each application by calling setOfflineStorageDefaultQuota(). 238 275 239 \sa QWebPage::settings(), QWebView::settings(), { Browser}276 \sa QWebPage::settings(), QWebView::settings(), {Web Browser} 240 277 */ 241 278 … … 285 322 \value AutoLoadImages Specifies whether images are automatically loaded in 286 323 web pages. 324 \value DnsPrefetchEnabled Specifies whether QtWebkit will try to pre-fetch DNS entries to 325 speed up browsing. This only works as a global attribute. Only for Qt 4.6 and later. 287 326 \value JavascriptEnabled Enables or disables the running of JavaScript 288 327 programs. … … 297 336 can read or write to the clipboard. 298 337 \value DeveloperExtrasEnabled Enables extra tools for Web developers. 299 Currently this enables the "Inspect" element in the context menu, 300 which shows the WebKit WebInspector for web site debugging. 338 Currently this enables the "Inspect" element in the context menu as 339 well as the use of QWebInspector which controls the WebKit WebInspector 340 for web site debugging. 301 341 \value LinksIncludedInFocusChain Specifies whether hyperlinks should be 302 342 included in the keyboard focus chain. … … 306 346 are also drawn when the page is printed. 307 347 \value OfflineStorageDatabaseEnabled Specifies whether support for the HTML 5 308 offline storage feature is enabled or not. 348 offline storage feature is enabled or not. Disabled by default. 309 349 \value OfflineWebApplicationCacheEnabled Specifies whether support for the HTML 5 310 web application cache feature is enabled or not. 311 \value LocalStorageDatabaseEnabled Specifies whether support for the HTML 5 312 local storage feature is enabled or not. 350 web application cache feature is enabled or not. Disabled by default. 351 \value LocalStorageEnabled Specifies whether support for the HTML 5 352 local storage feature is enabled or not. Disabled by default. 353 \value LocalStorageDatabaseEnabled \e{This enum value is deprecated.} Use 354 QWebSettings::LocalStorageEnabled instead. 355 \value LocalContentCanAccessRemoteUrls Specifies whether locally loaded documents are allowed to access remote urls. 313 356 */ 314 357 … … 322 365 d->fontSizes.insert(QWebSettings::MinimumFontSize, 0); 323 366 d->fontSizes.insert(QWebSettings::MinimumLogicalFontSize, 0); 324 d->fontSizes.insert(QWebSettings::DefaultFontSize, 1 4);325 d->fontSizes.insert(QWebSettings::DefaultFixedFontSize, 1 4);367 d->fontSizes.insert(QWebSettings::DefaultFontSize, 16); 368 d->fontSizes.insert(QWebSettings::DefaultFixedFontSize, 13); 326 369 d->fontFamilies.insert(QWebSettings::StandardFont, QLatin1String("Arial")); 327 370 d->fontFamilies.insert(QWebSettings::FixedFont, QLatin1String("Courier New")); … … 332 375 333 376 d->attributes.insert(QWebSettings::AutoLoadImages, true); 377 d->attributes.insert(QWebSettings::DnsPrefetchEnabled, false); 334 378 d->attributes.insert(QWebSettings::JavascriptEnabled, true); 335 379 d->attributes.insert(QWebSettings::LinksIncludedInFocusChain, true); 336 380 d->attributes.insert(QWebSettings::ZoomTextOnly, false); 337 381 d->attributes.insert(QWebSettings::PrintElementBackgrounds, true); 338 d->attributes.insert(QWebSettings::OfflineStorageDatabaseEnabled, true); 339 d->attributes.insert(QWebSettings::OfflineWebApplicationCacheEnabled, true); 340 d->attributes.insert(QWebSettings::LocalStorageDatabaseEnabled, true); 382 d->attributes.insert(QWebSettings::OfflineStorageDatabaseEnabled, false); 383 d->attributes.insert(QWebSettings::OfflineWebApplicationCacheEnabled, false); 384 d->attributes.insert(QWebSettings::LocalStorageEnabled, false); 385 d->attributes.insert(QWebSettings::LocalContentCanAccessRemoteUrls, false); 341 386 d->offlineStorageDefaultQuota = 5 * 1024 * 1024; 342 387 d->defaultTextEncoding = QLatin1String("iso-8859-1"); 343 388 } 344 389 … … 346 391 \internal 347 392 */ 348 QWebSettings::QWebSettings(WebCore::Settings *settings)393 QWebSettings::QWebSettings(WebCore::Settings* settings) 349 394 : d(new QWebSettingsPrivate(settings)) 350 395 { … … 381 426 int defaultValue = 0; 382 427 if (d->settings) { 383 QWebSettingsPrivate *global = QWebSettings::globalSettings()->d;428 QWebSettingsPrivate* global = QWebSettings::globalSettings()->d; 384 429 defaultValue = global->fontSizes.value(type); 385 430 } … … 404 449 Specifies the location of a user stylesheet to load with every web page. 405 450 406 The \a location can be a URL or a path on the local filesystem. 451 The \a location must be either a path on the local filesystem, or a data URL 452 with UTF-8 and Base64 encoded data, such as: 453 454 "data:text/css;charset=utf-8;base64,cCB7IGJhY2tncm91bmQtY29sb3I6IHJlZCB9Ow==;" 407 455 408 456 \sa userStyleSheetUrl() 409 457 */ 410 void QWebSettings::setUserStyleSheetUrl(const QUrl &location)458 void QWebSettings::setUserStyleSheetUrl(const QUrl& location) 411 459 { 412 460 d->userStyleSheetLocation = location; … … 425 473 426 474 /*! 475 \since 4.6 476 Specifies the default text encoding system. 477 478 The \a encoding, must be a string describing an encoding such as "utf-8", 479 "iso-8859-1", etc. If left empty a default value will be used. For a more 480 extensive list of encoding names see \l{QTextCodec} 481 482 \sa defaultTextEncoding() 483 */ 484 void QWebSettings::setDefaultTextEncoding(const QString& encoding) 485 { 486 d->defaultTextEncoding = encoding; 487 d->apply(); 488 } 489 490 /*! 491 \since 4.6 492 Returns the default text encoding. 493 494 \sa setDefaultTextEncoding() 495 */ 496 QString QWebSettings::defaultTextEncoding() const 497 { 498 return d->defaultTextEncoding; 499 } 500 501 /*! 427 502 Sets the path of the icon database to \a path. The icon database is used 428 503 to store "favicons" associated with web sites. … … 432 507 Setting an empty path disables the icon database. 433 508 */ 434 void QWebSettings::setIconDatabasePath(const QString &path)509 void QWebSettings::setIconDatabasePath(const QString& path) 435 510 { 436 511 WebCore::iconDatabase()->delayDatabaseCleanup(); … … 455 530 QString QWebSettings::iconDatabasePath() 456 531 { 457 if (WebCore::iconDatabase()->isEnabled() && WebCore::iconDatabase()->isOpen()) {532 if (WebCore::iconDatabase()->isEnabled() && WebCore::iconDatabase()->isOpen()) 458 533 return WebCore::iconDatabase()->databasePath(); 459 } else {534 else 460 535 return QString(); 461 }462 536 } 463 537 … … 481 555 \sa setIconDatabasePath() 482 556 */ 483 QIcon QWebSettings::iconForUrl(const QUrl &url)557 QIcon QWebSettings::iconForUrl(const QUrl& url) 484 558 { 485 559 WebCore::Image* image = WebCore::iconDatabase()->iconForPageURL(WebCore::KURL(url).string(), 486 560 WebCore::IntSize(16, 16)); 487 if (!image) {561 if (!image) 488 562 return QPixmap(); 489 } 490 QPixmap *icon = image->nativeImageForCurrentFrame();491 if (!icon) {563 564 QPixmap* icon = image->nativeImageForCurrentFrame(); 565 if (!icon) 492 566 return QPixmap(); 493 } 494 return *icon; 495 } 567 568 return* icon; 569 } 570 571 /* 572 Returns the plugin database object. 573 574 QWebPluginDatabase *QWebSettings::pluginDatabase() 575 { 576 static QWebPluginDatabase* database = 0; 577 if (!database) 578 database = new QWebPluginDatabase(); 579 return database; 580 } 581 */ 496 582 497 583 /*! … … 504 590 \sa webGraphic() 505 591 */ 506 void QWebSettings::setWebGraphic(WebGraphic type, const QPixmap &graphic)507 { 508 WebGraphicHash *h = graphics();592 void QWebSettings::setWebGraphic(WebGraphic type, const QPixmap& graphic) 593 { 594 WebGraphicHash* h = graphics(); 509 595 if (graphic.isNull()) 510 596 h->remove(type); … … 528 614 529 615 /*! 530 Sets the maximum number of pages to hold in the memory cache to \a pages. 616 Frees up as much memory as possible by cleaning all memory caches such 617 as page, object and font cache. 618 619 \since 4.6 620 */ 621 void QWebSettings::clearMemoryCaches() 622 { 623 // Turn the cache on and off. Disabling the object cache will remove all 624 // resources from the cache. They may still live on if they are referenced 625 // by some Web page though. 626 if (!WebCore::cache()->disabled()) { 627 WebCore::cache()->setDisabled(true); 628 WebCore::cache()->setDisabled(false); 629 } 630 631 int pageCapacity = WebCore::pageCache()->capacity(); 632 // Setting size to 0, makes all pages be released. 633 WebCore::pageCache()->setCapacity(0); 634 WebCore::pageCache()->releaseAutoreleasedPagesNow(); 635 WebCore::pageCache()->setCapacity(pageCapacity); 636 637 // Invalidating the font cache and freeing all inactive font data. 638 WebCore::fontCache()->invalidate(); 639 640 // Empty the Cross-Origin Preflight cache 641 WebCore::CrossOriginPreflightResultCache::shared().empty(); 642 } 643 644 /*! 645 Sets the maximum number of pages to hold in the memory page cache to \a pages. 646 647 The Page Cache allows for a nicer user experience when navigating forth or back 648 to pages in the forward/back history, by pausing and resuming up to \a pages 649 per page group. 650 651 For more information about the feature, please refer to: 652 653 http://webkit.org/blog/427/webkit-page-cache-i-the-basics/ 531 654 */ 532 655 void QWebSettings::setMaximumPagesInCache(int pages) 533 656 { 657 QWebSettingsPrivate* global = QWebSettings::globalSettings()->d; 534 658 WebCore::pageCache()->setCapacity(qMax(0, pages)); 659 global->apply(); 535 660 } 536 661 … … 549 674 The \a cacheMinDeadCapacity specifies the \e minimum number of bytes that 550 675 dead objects should consume when the cache is under pressure. 551 676 552 677 \a cacheMaxDead is the \e maximum number of bytes that dead objects should 553 678 consume when the cache is \bold not under pressure. … … 561 686 void QWebSettings::setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity) 562 687 { 563 bool disableCache = cacheMinDeadCapacity == 0 && cacheMaxDead == 0 && totalCapacity == 0;688 bool disableCache = !cacheMinDeadCapacity && !cacheMaxDead && !totalCapacity; 564 689 WebCore::cache()->setDisabled(disableCache); 565 690 … … 573 698 \a which. 574 699 */ 575 void QWebSettings::setFontFamily(FontFamily which, const QString &family)700 void QWebSettings::setFontFamily(FontFamily which, const QString& family) 576 701 { 577 702 d->fontFamilies.insert(which, family); … … 587 712 QString defaultValue; 588 713 if (d->settings) { 589 QWebSettingsPrivate *global = QWebSettings::globalSettings()->d;714 QWebSettingsPrivate* global = QWebSettings::globalSettings()->d; 590 715 defaultValue = global->fontFamilies.value(which); 591 716 } … … 609 734 /*! 610 735 \fn void QWebSettings::setAttribute(WebAttribute attribute, bool on) 611 736 612 737 Enables or disables the specified \a attribute feature depending on the 613 738 value of \a on. … … 628 753 bool defaultValue = false; 629 754 if (d->settings) { 630 QWebSettingsPrivate *global = QWebSettings::globalSettings()->d;755 QWebSettingsPrivate* global = QWebSettings::globalSettings()->d; 631 756 defaultValue = global->attributes.value(attr); 632 757 } … … 706 831 } 707 832 708 /* 709 \ internal833 /*! 834 \since 4.6 710 835 \relates QWebSettings 711 836 712 837 Sets the path for HTML5 offline web application cache storage to \a path. 713 838 839 An application cache acts like an HTTP cache in some sense. For documents 840 that use the application cache via JavaScript, the loader mechinery will 841 first ask the application cache for the contents, before hitting the 842 network. 843 844 The feature is described in details at: 845 http://dev.w3.org/html5/spec/Overview.html#appcache 846 714 847 \a path must point to an existing directory where the cache is stored. 715 848 … … 718 851 \sa offlineWebApplicationCachePath() 719 852 */ 720 void QW EBKIT_EXPORT qt_websettings_setOfflineWebApplicationCachePath(const QString& path)853 void QWebSettings::setOfflineWebApplicationCachePath(const QString& path) 721 854 { 722 855 #if ENABLE(OFFLINE_WEB_APPLICATIONS) … … 725 858 } 726 859 727 /* 728 \ internal860 /*! 861 \since 4.6 729 862 \relates QWebSettings 730 863 731 864 Returns the path of the HTML5 offline web application cache storage 732 865 or an empty string if the feature is disabled. … … 734 867 \sa setOfflineWebApplicationCachePath() 735 868 */ 736 QString QW EBKIT_EXPORT qt_websettings_offlineWebApplicationCachePath()869 QString QWebSettings::offlineWebApplicationCachePath() 737 870 { 738 871 #if ENABLE(OFFLINE_WEB_APPLICATIONS) … … 743 876 } 744 877 745 /* 746 \since 4.5 878 /*! 879 \since 4.6 880 881 Sets the value of the quota for the offline web application cache 882 to \a maximumSize. 883 */ 884 void QWebSettings::setOfflineWebApplicationCacheQuota(qint64 maximumSize) 885 { 886 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 887 WebCore::cacheStorage().setMaximumSize(maximumSize); 888 #endif 889 } 890 891 /*! 892 \since 4.6 893 894 Returns the value of the quota for the offline web application cache. 895 */ 896 qint64 QWebSettings::offlineWebApplicationCacheQuota() 897 { 898 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 899 return WebCore::cacheStorage().maximumSize(); 900 #else 901 return 0; 902 #endif 903 } 904 905 /*! 906 \since 4.6 747 907 \relates QWebSettings 748 908 749 Sets the path for HTML5 local storage databases to \a path. 750 751 \a path must point to an existing directory where the cache is stored. 752 753 Setting an empty path disables the feature. 754 755 \sa localStorageDatabasePath() 756 */ 757 void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* settings, const QString& path) 758 { 759 QWebSettingsPrivate *d = settings->handle(); 760 d->localStorageDatabasePath = path; 909 Sets the path for HTML5 local storage to \a path. 910 911 For more information on HTML5 local storage see the 912 \l{http://www.w3.org/TR/webstorage/#the-localstorage-attribute}{Web Storage standard}. 913 914 Support for local storage can enabled by setting the 915 \l{QWebSettings::LocalStorageEnabled}{LocalStorageEnabled} attribute. 916 917 \sa localStoragePath() 918 */ 919 void QWebSettings::setLocalStoragePath(const QString& path) 920 { 921 d->localStoragePath = path; 761 922 d->apply(); 762 923 } 763 924 764 /* 765 \since 4. 5925 /*! 926 \since 4.6 766 927 \relates QWebSettings 767 928 768 Returns the path for HTML5 local storage databases 769 or an empty string if the feature is disabled. 770 771 \sa setLocalStorageDatabasePath() 772 */ 773 QString QWEBKIT_EXPORT qt_websettings_localStorageDatabasePath(QWebSettings* settings) 774 { 775 return settings->handle()->localStorageDatabasePath; 929 Returns the path for HTML5 local storage. 930 931 \sa setLocalStoragePath() 932 */ 933 QString QWebSettings::localStoragePath() const 934 { 935 return d->localStoragePath; 936 } 937 938 /*! 939 \since 4.6 940 \relates QWebSettings 941 942 Enables WebKit persistent data and sets the path to \a path. 943 If the \a path is empty the path for persistent data is set to the 944 user-specific data location specified by 945 \l{QDesktopServices::DataLocation}{DataLocation}. 946 947 \sa localStoragePath() 948 */ 949 void QWebSettings::enablePersistentStorage(const QString& path) 950 { 951 QString storagePath; 952 953 if (path.isEmpty()) { 954 storagePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation); 955 956 if (storagePath.isEmpty()) 957 storagePath = WebCore::pathByAppendingComponent(QDir::homePath(), QCoreApplication::applicationName()); 958 } else 959 storagePath = path; 960 961 WebCore::makeAllDirectories(storagePath); 962 963 QWebSettings::setIconDatabasePath(storagePath); 964 QWebSettings::setOfflineWebApplicationCachePath(storagePath); 965 QWebSettings::setOfflineStoragePath(WebCore::pathByAppendingComponent(storagePath, "Databases")); 966 QWebSettings::globalSettings()->setLocalStoragePath(WebCore::pathByAppendingComponent(storagePath, "LocalStorage")); 967 QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalStorageEnabled, true); 968 QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true); 969 QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true); 776 970 } 777 971 -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
r2 r561 28 28 #include <QtCore/qshareddata.h> 29 29 30 namespace WebCore 31 { 30 namespace WebCore { 32 31 class Settings; 33 32 } 34 33 35 34 class QWebPage; 35 class QWebPluginDatabase; 36 36 class QWebSettingsPrivate; 37 37 QT_BEGIN_NAMESPACE … … 39 39 QT_END_NAMESPACE 40 40 41 class QWEBKIT_EXPORT QWebSettings 42 { 41 class QWEBKIT_EXPORT QWebSettings { 43 42 public: 44 43 enum FontFamily { … … 64 63 OfflineStorageDatabaseEnabled, 65 64 OfflineWebApplicationCacheEnabled, 66 LocalStorageDatabaseEnabled 65 LocalStorageEnabled, 66 #ifdef QT_DEPRECATED 67 LocalStorageDatabaseEnabled = LocalStorageEnabled, 68 #endif 69 LocalContentCanAccessRemoteUrls, 70 DnsPrefetchEnabled 67 71 }; 68 72 enum WebGraphic { … … 96 100 QUrl userStyleSheetUrl() const; 97 101 102 void setDefaultTextEncoding(const QString &encoding); 103 QString defaultTextEncoding() const; 104 98 105 static void setIconDatabasePath(const QString &location); 99 106 static QString iconDatabasePath(); 100 107 static void clearIconDatabase(); 101 108 static QIcon iconForUrl(const QUrl &url); 109 110 //static QWebPluginDatabase *pluginDatabase(); 102 111 103 112 static void setWebGraphic(WebGraphic type, const QPixmap &graphic); … … 112 121 static void setOfflineStorageDefaultQuota(qint64 maximumSize); 113 122 static qint64 offlineStorageDefaultQuota(); 123 124 static void setOfflineWebApplicationCachePath(const QString& path); 125 static QString offlineWebApplicationCachePath(); 126 static void setOfflineWebApplicationCacheQuota(qint64 maximumSize); 127 static qint64 offlineWebApplicationCacheQuota(); 128 129 void setLocalStoragePath(const QString& path); 130 QString localStoragePath() const; 131 132 static void clearMemoryCaches(); 133 134 static void enablePersistentStorage(const QString& path = QString()); 114 135 115 136 inline QWebSettingsPrivate* handle() const { return d; } -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
r2 r561 2 2 Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 3 Copyright (C) 2008 Holger Hans Peter Freyther 4 Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in> 4 5 5 6 This library is free software; you can redistribute it and/or … … 21 22 #include "config.h" 22 23 #include "qwebview.h" 24 25 #include "QWebPageClient.h" 23 26 #include "qwebframe.h" 24 27 #include "qwebpage_p.h" … … 28 31 #include "qpainter.h" 29 32 #include "qprinter.h" 30 31 class QWebViewPrivate 32 { 33 #include "qdir.h" 34 #include "qfile.h" 35 36 class QWebViewPrivate { 33 37 public: 34 38 QWebViewPrivate(QWebView *view) 35 39 : view(view) 36 40 , page(0) 37 #ifndef QT_NO_CURSOR 38 , cursorSetByWebCore(false) 39 , usesWebCoreCursor(true) 40 #endif 41 {} 41 , renderHints(QPainter::TextAntialiasing) 42 { 43 Q_ASSERT(view); 44 } 45 46 void _q_pageDestroyed(); 42 47 43 48 QWebView *view; 44 49 QWebPage *page; 45 50 46 47 #ifndef QT_NO_CURSOR 48 /* 49 * We keep track of if we have called setCursor and if the CursorChange 50 * event is sent due our setCursor call and if we currently use the WebCore 51 * Cursor and use it to decide if we can update to another WebCore Cursor. 52 */ 53 bool cursorSetByWebCore; 54 bool usesWebCoreCursor; 55 56 void setCursor(const QCursor& newCursor) 57 { 58 webCoreCursor = newCursor; 59 60 if (usesWebCoreCursor) { 61 cursorSetByWebCore = true; 62 view->setCursor(webCoreCursor); 63 } 64 } 65 66 QCursor webCoreCursor; 67 #endif 51 QPainter::RenderHints renderHints; 68 52 }; 53 54 void QWebViewPrivate::_q_pageDestroyed() 55 { 56 page = 0; 57 view->setPage(0); 58 } 69 59 70 60 /*! … … 75 65 \ingroup advanced 76 66 67 \inmodule QtWebKit 68 77 69 QWebView is the main widget component of the QtWebKit web browsing module. 78 70 It can be used in various applications to display web content live from the 79 71 Internet. 80 72 81 The image below shows QWebView previewed in \QD with the Trolltechwebsite.73 The image below shows QWebView previewed in \QD with a Nokia website. 82 74 83 75 \image qwebview-url.png 84 76 85 77 A web site can be loaded onto QWebView with the load() function. Like all 86 Qt Widgets, the show() function must be invoked in order to display78 Qt widgets, the show() function must be invoked in order to display 87 79 QWebView. The snippet below illustrates this: 88 80 89 \snippet doc/src/snippets/webkit/simple/main.cpp Using QWebView81 \snippet webkitsnippets/simple/main.cpp Using QWebView 90 82 91 83 Alternatively, setUrl() can also be used to load a web site. If you have … … 144 136 on QtGui, so you should use a QApplication instead of QCoreApplication. 145 137 146 \sa {Previewer Example}, {Browser} 138 \sa {Previewer Example}, {Web Browser}, {Form Extractor Example}, 139 {Google Chat Example}, {Fancy Browser Example} 147 140 */ 148 141 … … 157 150 d = new QWebViewPrivate(this); 158 151 159 #if !defined(Q_WS_QWS) 152 #if !defined(Q_WS_QWS) && !defined(Q_OS_SYMBIAN) 160 153 setAttribute(Qt::WA_InputMethodEnabled); 161 154 #endif … … 172 165 QWebView::~QWebView() 173 166 { 174 if (d->page) 167 if (d->page) { 168 #if QT_VERSION >= 0x040600 169 d->page->d->view.clear(); 170 #else 175 171 d->page->d->view = 0; 172 #endif 173 delete d->page->d->client; 174 d->page->d->client = 0; 175 } 176 176 177 177 if (d->page && d->page->parent() == this) … … 203 203 \sa page() 204 204 */ 205 void QWebView::setPage(QWebPage *page)205 void QWebView::setPage(QWebPage* page) 206 206 { 207 207 if (d->page == page) 208 208 return; 209 209 if (d->page) { 210 if (d->page->parent() == this) { 210 d->page->d->client = 0; // unset the page client 211 if (d->page->parent() == this) 211 212 delete d->page; 212 } else {213 else 213 214 d->page->disconnect(this); 214 }215 215 } 216 216 d->page = page; … … 220 220 // #### connect signals 221 221 QWebFrame *mainFrame = d->page->mainFrame(); 222 connect(mainFrame, SIGNAL(titleChanged( const QString&)),223 this, SIGNAL(titleChanged( const QString&)));222 connect(mainFrame, SIGNAL(titleChanged(QString)), 223 this, SIGNAL(titleChanged(QString))); 224 224 connect(mainFrame, SIGNAL(iconChanged()), 225 225 this, SIGNAL(iconChanged())); 226 connect(mainFrame, SIGNAL(urlChanged( const QUrl &)),227 this, SIGNAL(urlChanged( const QUrl &)));226 connect(mainFrame, SIGNAL(urlChanged(QUrl)), 227 this, SIGNAL(urlChanged(QUrl))); 228 228 229 229 connect(d->page, SIGNAL(loadStarted()), … … 233 233 connect(d->page, SIGNAL(loadFinished(bool)), 234 234 this, SIGNAL(loadFinished(bool))); 235 connect(d->page, SIGNAL(statusBarMessage( const QString &)),236 this, SIGNAL(statusBarMessage( const QString &)));237 connect(d->page, SIGNAL(linkClicked( const QUrl &)),238 this, SIGNAL(linkClicked( const QUrl &)));235 connect(d->page, SIGNAL(statusBarMessage(QString)), 236 this, SIGNAL(statusBarMessage(QString))); 237 connect(d->page, SIGNAL(linkClicked(QUrl)), 238 this, SIGNAL(linkClicked(QUrl))); 239 239 240 240 connect(d->page, SIGNAL(microFocusChanged()), 241 241 this, SLOT(updateMicroFocus())); 242 connect(d->page, SIGNAL(destroyed()), 243 this, SLOT(_q_pageDestroyed())); 242 244 } 243 245 setAttribute(Qt::WA_OpaquePaintEvent, d->page); … … 250 252 \note The view remains the same until enough data has arrived to display the new \a url. 251 253 252 \sa setUrl(), url(), urlChanged() 254 \sa setUrl(), url(), urlChanged(), QUrl::fromUserInput() 253 255 */ 254 256 void QWebView::load(const QUrl &url) … … 326 328 It is equivalent to 327 329 328 \snippet doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp 0330 \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 0 329 331 */ 330 332 QWebHistory *QWebView::history() const … … 338 340 It is equivalent to 339 341 340 \snippet doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp 1342 \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 1 341 343 342 344 \sa QWebSettings::globalSettings() … … 430 432 selected text to the clipboard. 431 433 432 \snippet doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp 2434 \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 2 433 435 434 436 \sa pageAction() … … 534 536 535 537 /*! 536 Finds the next occurrence of the string, \a subString, in the page, using 537 the given \a options. Returns true of \a subString was found and selects 538 the match visually; otherwise returns false. 538 \property QWebView::renderHints 539 \since 4.6 540 \brief the default render hints for the view 541 542 These hints are used to initialize QPainter before painting the Web page. 543 544 QPainter::TextAntialiasing is enabled by default. 545 546 \note This property is not available on Symbian. However, the getter and 547 setter functions can still be used directly. 548 549 \sa QPainter::renderHints() 550 */ 551 552 /*! 553 \since 4.6 554 Returns the render hints used by the view to render content. 555 556 \sa QPainter::renderHints() 557 */ 558 QPainter::RenderHints QWebView::renderHints() const 559 { 560 return d->renderHints; 561 } 562 563 /*! 564 \since 4.6 565 Sets the render hints used by the view to the specified \a hints. 566 567 \sa QPainter::setRenderHints() 568 */ 569 void QWebView::setRenderHints(QPainter::RenderHints hints) 570 { 571 if (hints == d->renderHints) 572 return; 573 d->renderHints = hints; 574 update(); 575 } 576 577 /*! 578 \since 4.6 579 If \a enabled is true, enables the specified render \a hint; otherwise 580 disables it. 581 582 \sa renderHints, QPainter::renderHints() 583 */ 584 void QWebView::setRenderHint(QPainter::RenderHint hint, bool enabled) 585 { 586 QPainter::RenderHints oldHints = d->renderHints; 587 if (enabled) 588 d->renderHints |= hint; 589 else 590 d->renderHints &= ~hint; 591 if (oldHints != d->renderHints) 592 update(); 593 } 594 595 596 /*! 597 Finds the specified string, \a subString, in the page, using the given \a options. 598 599 If the HighlightAllOccurrences flag is passed, the function will highlight all occurrences 600 that exist in the page. All subsequent calls will extend the highlight, rather than 601 replace it, with occurrences of the new string. 602 603 If the HighlightAllOccurrences flag is not passed, the function will select an occurrence 604 and all subsequent calls will replace the current occurrence with the next one. 605 606 To clear the selection, just pass an empty string. 607 608 Returns true if \a subString was found; otherwise returns false. 539 609 540 610 \sa selectedText(), selectionChanged() … … 567 637 d->page->event(e); 568 638 #ifndef QT_NO_CURSOR 569 } else if (e->type() == static_cast<QEvent::Type>(WebCore::SetCursorEvent::EventType)) {570 d->setCursor(static_cast<WebCore::SetCursorEvent*>(e)->cursor());571 639 #if QT_VERSION >= 0x040400 572 640 } else if (e->type() == QEvent::CursorChange) { 573 // Okay we might use the WebCore Cursor now. 574 d->usesWebCoreCursor = d->cursorSetByWebCore; 575 d->cursorSetByWebCore = false; 576 577 // Go back to the WebCore Cursor. QWidget::unsetCursor is appromixated with this 578 if (!d->usesWebCoreCursor && cursor().shape() == Qt::ArrowCursor) { 579 d->usesWebCoreCursor = true; 580 d->setCursor(d->webCoreCursor); 581 } 582 #endif 583 #endif 584 } else if (e->type() == QEvent::Leave) { 641 // An unsetCursor will set the cursor to Qt::ArrowCursor. 642 // Thus this cursor change might be a QWidget::unsetCursor() 643 // If this is not the case and it came from WebCore, the 644 // QWebPageClient already has set its cursor internally 645 // to Qt::ArrowCursor, so updating the cursor is always 646 // right, as it falls back to the last cursor set by 647 // WebCore. 648 // FIXME: Add a QEvent::CursorUnset or similar to Qt. 649 if (cursor().shape() == Qt::ArrowCursor) 650 d->page->d->client->resetCursor(); 651 #endif 652 #endif 653 } else if (e->type() == QEvent::Leave) 585 654 d->page->event(e); 586 }587 655 } 588 656 … … 607 675 It is equivalent to 608 676 609 \snippet doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp 3677 \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 3 610 678 611 679 \sa reload(), pageAction(), loadFinished() … … 623 691 It is equivalent to 624 692 625 \snippet doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp 4693 \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 4 626 694 627 695 \sa forward(), pageAction() … … 639 707 It is equivalent to 640 708 641 \snippet doc/src/snippets/code/src_3rdparty_webkit_WebKit_qt_Api_qwebview.cpp 5709 \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 5 642 710 643 711 \sa back(), pageAction() … … 681 749 QWebFrame *frame = d->page->mainFrame(); 682 750 QPainter p(this); 751 p.setRenderHints(d->renderHints); 683 752 684 753 frame->render(&p, ev->region()); … … 686 755 #ifdef QWEBKIT_TIME_RENDERING 687 756 int elapsed = time.elapsed(); 688 qDebug()<<"paint event on "<<ev->region()<<", took to render = "<<elapsed; 689 #endif 690 } 691 692 /*! 693 This function is called whenever WebKit wants to create a new window of the given \a type, for example as a result of 694 a JavaScript request to open a document in a new window. 757 qDebug() << "paint event on " << ev->region() << ", took to render = " << elapsed; 758 #endif 759 } 760 761 /*! 762 This function is called from the createWindow() method of the associated QWebPage, 763 each time the page wants to create a new window of the given \a type. This might 764 be the result, for example, of a JavaScript request to open a document in a new window. 765 766 \note If the createWindow() method of the associated page is reimplemented, this 767 method is not called, unless explicitly done so in the reimplementation. 695 768 696 769 \sa QWebPage::createWindow() … … 882 955 void QWebView::changeEvent(QEvent *e) 883 956 { 884 if (d->page && e->type() == QEvent::PaletteChange) {957 if (d->page && e->type() == QEvent::PaletteChange) 885 958 d->page->setPalette(palette()); 886 }887 959 QWidget::changeEvent(e); 888 960 } … … 907 979 \fn void QWebView::statusBarMessage(const QString& text) 908 980 909 This signal is emitted when the status bar \a text is changed by the page.981 This signal is emitted when the status bar \a text is changed by the page. 910 982 */ 911 983 … … 915 987 This signal is emitted whenever the icon of the page is loaded or changes. 916 988 917 \sa icon() 989 In order for icons to be loaded, you will need to set an icon database path 990 using QWebSettings::setIconDatabasePath(). 991 992 \sa icon(), QWebSettings::setIconDatabasePath() 918 993 */ 919 994 … … 965 1040 \sa QWebPage::linkDelegationPolicy() 966 1041 */ 1042 1043 #include "moc_qwebview.cpp" 1044 -
trunk/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
r2 r561 26 26 #include <QtGui/qwidget.h> 27 27 #include <QtGui/qicon.h> 28 #include <QtGui/qpainter.h> 28 29 #include <QtCore/qurl.h> 29 30 #if QT_VERSION >= 0x040400 … … 40 41 class QWebNetworkRequest; 41 42 42 class QWEBKIT_EXPORT QWebView : public QWidget 43 { 43 class QWEBKIT_EXPORT QWebView : public QWidget { 44 44 Q_OBJECT 45 45 Q_PROPERTY(QString title READ title) … … 51 51 Q_PROPERTY(qreal textSizeMultiplier READ textSizeMultiplier WRITE setTextSizeMultiplier DESIGNABLE false) 52 52 Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor) 53 54 Q_PROPERTY(QPainter::RenderHints renderHints READ renderHints WRITE setRenderHints) 55 Q_FLAGS(QPainter::RenderHints) 53 56 public: 54 explicit QWebView(QWidget *parent = 0);57 explicit QWebView(QWidget* parent = 0); 55 58 virtual ~QWebView(); 56 59 57 QWebPage *page() const;58 void setPage(QWebPage *page);60 QWebPage* page() const; 61 void setPage(QWebPage* page); 59 62 60 void load(const QUrl &url);63 void load(const QUrl& url); 61 64 #if QT_VERSION < 0x040400 && !defined(qdoc) 62 void load(const QWebNetworkRequest &request);65 void load(const QWebNetworkRequest& request); 63 66 #else 64 void load(const QNetworkRequest &request,67 void load(const QNetworkRequest& request, 65 68 QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, 66 69 const QByteArray &body = QByteArray()); 67 70 #endif 68 void setHtml(const QString &html, const QUrl &baseUrl = QUrl());69 void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());71 void setHtml(const QString& html, const QUrl& baseUrl = QUrl()); 72 void setContent(const QByteArray& data, const QString& mimeType = QString(), const QUrl& baseUrl = QUrl()); 70 73 71 QWebHistory *history() const;72 QWebSettings *settings() const;74 QWebHistory* history() const; 75 QWebSettings* settings() const; 73 76 74 77 QString title() const; … … 79 82 QString selectedText() const; 80 83 81 QAction *pageAction(QWebPage::WebAction action) const;84 QAction* pageAction(QWebPage::WebAction action) const; 82 85 void triggerPageAction(QWebPage::WebAction action, bool checked = false); 83 86 … … 100 103 qreal textSizeMultiplier() const; 101 104 102 bool findText(const QString &subString, QWebPage::FindFlags options = 0); 105 QPainter::RenderHints renderHints() const; 106 void setRenderHints(QPainter::RenderHints hints); 107 void setRenderHint(QPainter::RenderHint hint, bool enabled = true); 103 108 104 virtual bool event(QEvent *); 109 bool findText(const QString& subString, QWebPage::FindFlags options = 0); 110 111 virtual bool event(QEvent*); 105 112 106 113 public Q_SLOTS: … … 110 117 void reload(); 111 118 112 void print(QPrinter *printer) const;119 void print(QPrinter*) const; 113 120 114 121 Q_SIGNALS: … … 118 125 void titleChanged(const QString& title); 119 126 void statusBarMessage(const QString& text); 120 void linkClicked(const QUrl &url);127 void linkClicked(const QUrl&); 121 128 void selectionChanged(); 122 129 void iconChanged(); 123 void urlChanged(const QUrl &url);130 void urlChanged(const QUrl&); 124 131 125 132 protected: 126 void resizeEvent(QResizeEvent *e);127 void paintEvent(QPaintEvent *ev);133 void resizeEvent(QResizeEvent*); 134 void paintEvent(QPaintEvent*); 128 135 129 136 virtual QWebView *createWindow(QWebPage::WebWindowType type); … … 142 149 virtual void keyPressEvent(QKeyEvent*); 143 150 virtual void keyReleaseEvent(QKeyEvent*); 144 virtual void dragEnterEvent(QDragEnterEvent 145 virtual void dragLeaveEvent(QDragLeaveEvent 146 virtual void dragMoveEvent(QDragMoveEvent 147 virtual void dropEvent(QDropEvent 151 virtual void dragEnterEvent(QDragEnterEvent*); 152 virtual void dragLeaveEvent(QDragLeaveEvent*); 153 virtual void dragMoveEvent(QDragMoveEvent*); 154 virtual void dropEvent(QDropEvent*); 148 155 virtual void focusInEvent(QFocusEvent*); 149 156 virtual void focusOutEvent(QFocusEvent*); … … 154 161 private: 155 162 friend class QWebPage; 156 QWebViewPrivate *d; 163 QWebViewPrivate* d; 164 Q_PRIVATE_SLOT(d, void _q_pageDestroyed()) 157 165 }; 158 166 -
trunk/src/3rdparty/webkit/WebKit/qt/ChangeLog
r2 r561 1 2009-04-02 Takumi Asaki <takumi.asaki@nokia.com> 2 3 Reviewed by Simon Hausmann. 4 5 Fix pre-edit handling of text fields with input methods. 6 7 The input method sends an empty preeditString() if all characters of 8 the preedit should be deleted. So inputMethodEvent() has to use 9 preeditString() if it's empty. 1 2010-01-14 Simon Hausmann <simon.hausmann@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Update Symbian .def symbol export files after private API additions. 6 7 * symbian/bwins/QtWebKitu.def: 8 * symbian/eabi/QtWebKitu.def: 9 10 2009-12-18 Joe Ligman <joseph.ligman@nokia.com> 11 12 Reviewed by Kenneth Rohde Christiansen. 13 14 [Qt] Add new API to QWebFrame to scrollRecursively starting with any css overflow 15 then checking current frame and then ancestors 16 https://bugs.webkit.org/show_bug.cgi?id=32668 17 18 * Api/qwebframe.cpp: 19 (QWebFramePrivate::scrollOverflow): 20 (QWebFrame::scrollRecursively): 21 * Api/qwebframe.h: 22 * Api/qwebframe_p.h: 23 * tests/qwebframe/qwebframe.qrc: 24 * tests/qwebframe/testiframe.html: Added. 25 * tests/qwebframe/testiframe2.html: Added. 26 * tests/qwebframe/tst_qwebframe.cpp: 27 28 2010-01-07 Yael Aharon <yael.aharon@nokia.com> 29 30 Reviewed by Kenneth Rohde Christiansen. 31 32 [Qt] Allow the application to override online/offline network status 33 https://bugs.webkit.org/show_bug.cgi?id=32684 34 35 Add a setting so that applications can overide the network status. 36 Applications that use this setting still need to block network access 37 through QNAM. 38 39 * Api/qwebsettings.cpp: 40 (qt_networkAccessAllowed): 41 42 2010-01-07 Yongjun Zhang <yongjun.zhang@nokia.com>, Laszlo Gombos <laszlo.1.gombos@nokia.com> 43 44 Reviewed by Simon Hausmann. 45 46 [Qt] need an API to suspend and resume active Javascript DOM objects. 47 https://bugs.webkit.org/show_bug.cgi?id=31673 48 49 Add suspend and resume DOM objects private API to QWebFrame. 50 51 * Api/qwebframe.cpp: 52 (qt_suspendActiveDOMObjects): 53 (qt_resumeActiveDOMObjects): 54 55 2009-12-30 Janne Koskinen <janne.p.koskinen@digia.com> 56 57 Reviewed by Simon Hausmann. 58 59 Upstream Symbian def files from Qt 4.6. 60 61 These files define the ABI of QtWebKit on Symbian. 62 63 * symbian/bwins/QtWebKitu.def: Added. 64 * symbian/eabi/QtWebKitu.def: Added. 65 66 2009-12-14 Holger Hans Peter Freyther <zecke@selfish.org> 67 68 Reviewed by Kenneth Rohde Christiansen. 69 70 [Qt] Fix JavaScript prompt behavior for empty/null strings. 71 https://bugs.webkit.org/show_bug.cgi?id=30914 72 73 The patch is based on the work done by Gupta Manish. 74 75 In the default implementation of the JavaScript prompt 76 we are using a QInputDialog to get the text and this has 77 one quirk with regard to not entering any text. 78 79 In other WebKit ports and in Firefox an empty string is 80 returned but in the Qt case it is a null string. 81 82 Change the API documentation in QWebPage to mention we want to 83 have a non null string but do the fixup in the ChromeClientQt 84 to support existing code. 85 86 * Api/qwebpage.cpp: 87 (QWebPage::javaScriptPrompt): Change API documentation 88 * WebCoreSupport/ChromeClientQt.cpp: 89 (WebCore::ChromeClientQt::runJavaScriptPrompt): Fixup null QString 90 91 2009-12-21 David Boddie <dboddie@trolltech.com> 92 93 Reviewed by Simon Hausmann. 94 95 Doc: Minor fixes to language. 96 97 * Api/qwebpage.cpp: 98 99 2009-12-15 Holger Hans Peter Freyther <zecke@selfish.org> 100 101 Reviewed by NOBODY (OOPS!). 102 103 [Qt] Do not disable the inspector on show and hide 104 https://bugs.webkit.org/show_bug.cgi?id=31851 105 106 On Qt/X11 with some window managers the window will be 107 hidden when switching windows. In this case all the results 108 are gone when coming back to the window. 109 110 Attempt to use the CloseEvent to figure out if the window 111 was closed and withdrawn as this is more friendly to the 112 user of the inspector client. 113 114 * Api/qwebinspector.cpp: 115 (QWebInspector::event): 116 (QWebInspector::hideEvent): 117 118 2009-12-13 Simon Hausmann <hausmann@webkit.org> 119 120 Reviewed by Holger Freyther. 121 122 [Qt] Re-enable QWebView::renderHints property for Qt for Symbian 123 124 https://bugs.webkit.org/show_bug.cgi?id=28273 125 126 The bug in Qt's moc that triggered a linking error when declaring this 127 property has been fixed and we can remove the workaround. 128 129 * Api/qwebview.h: 130 131 2009-11-30 Abhinav Mithal <abhinav.mithal@nokia.com> 132 133 Reviewed by Simon Hausmann. 134 135 [Qt][Symbian] Report SymbianOS in user agent string for Symbian 136 https://bugs.webkit.org/show_bug.cgi?id=31961 137 138 * Api/qwebpage.cpp: 139 (QWebPage::userAgentForUrl): 140 141 2009-11-28 Simon Hausmann <simon.hausmann@nokia.com> 142 143 Reviewed by Kenneth Rohde Christiansen. 144 145 [Qt] SoftwareInputPanelRequest event sent when clicking in newly loaded page 146 147 https://bugs.webkit.org/show_bug.cgi?id=31401 148 149 Don't set the event unless there is a focused node we can use 150 for editing afterwards. 151 152 * Api/qwebpage.cpp: 153 (QWebPagePrivate::handleSoftwareInputPanel): 154 * tests/qwebpage/tst_qwebpage.cpp: 155 (tst_QWebPage::inputMethods): 156 157 2009-11-23 David Boddie <dboddie@trolltech.com> 158 159 Reviewed by Simon Hausmann. 160 161 Updated the QWebElement documentation with links to examples and 162 external resources. 163 Fixed the project file for the webelement snippet and tidied up the 164 markers used for quoting the code. 165 166 * Api/qwebelement.cpp: 167 * docs/webkitsnippets/webelement/main.cpp: 168 (findAll): 169 * docs/webkitsnippets/webelement/webelement.pro: 170 171 2009-11-23 Simon Hausmann <simon.hausmann@nokia.com> 172 173 Reviewed by Kenneth Rohde Christiansen. 174 175 [Qt] Wrong runtime instance objects of wrapped QObjects may be used if 176 the wrapped object died before the gc removed the instance. 177 178 https://bugs.webkit.org/show_bug.cgi?id=31681 179 180 Added a unit-test to verify that wrapping a QObject with the 181 same identity as a previously but now dead object works. 182 183 * tests/qwebframe/tst_qwebframe.cpp: 184 185 2009-11-19 Olivier Goffart <ogoffart@trolltech.com> 186 187 Reviewed by Simon Hausmann. 188 189 [Qt] Normalize signal and slot signatures. 190 191 * Api/qgraphicswebview.cpp: 192 (QGraphicsWebView::setPage): 193 * Api/qwebview.cpp: 194 (QWebView::setPage): 195 * WebCoreSupport/FrameLoaderClientQt.cpp: 196 (WebCore::FrameLoaderClientQt::setFrame): 197 * docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp: 198 (wrapInFunction): 199 * tests/qwebframe/tst_qwebframe.cpp: 200 * tests/qwebpage/tst_qwebpage.cpp: 201 (tst_QWebPage::modified): 202 (tst_QWebPage::database): 203 204 2009-11-18 Paul Olav Tvete <paul.tvete@nokia.com> 205 206 Reviewed by Simon Hausmann. 207 208 [Qt] Make the QWebElement::render() test pass when pixmaps aren't 32 bit. 209 210 * tests/qwebelement/tst_qwebelement.cpp: 211 (tst_QWebElement::render): 212 213 2009-11-18 Simon Hausmann <simon.hausmann@nokia.com> 214 215 Reviewed by Tor Arne VestbÞ. 216 217 Clarify and simplify the legal section in the overview documentation, 218 after review with our legal team. 219 220 * docs/qtwebkit.qdoc: 221 222 2009-11-18 Simon Hausmann <simon.hausmann@nokia.com> 223 224 Reviewed and suggested by Tor Arne VestbÞ. 225 226 Fix the autotest after commit ecbb2c0dd21bfc197e1f7b53150ec9b1a1d8cb8f 227 to compare the Qt::ImFont property's family against an explicitly 228 previously configured family. 229 230 * tests/qwebpage/tst_qwebpage.cpp: 231 (tst_QWebPage::inputMethods): 232 233 2009-11-16 Simon Hausmann <simon.hausmann@nokia.com> 234 235 Reviewed by Kenneth Rohde Christiansen. 236 237 API documentation fixes. 238 239 * Api/qgraphicswebview.cpp: Removed duplicate docs. 240 * Api/qwebelement.cpp: Added missing docs. 241 * Api/qwebsettings.cpp: Ditto. 242 243 2009-11-14 Antonio Gomes <tonikitoo@webkit.org> 244 245 Reviewed by Antti Koivisto. 246 247 [Qt] Broken back/forward after using ErrorPageExtension to set error page 248 https://bugs.webkit.org/show_bug.cgi?id=30573 249 250 Implemented autotests for covering the back/forward 251 reset problem involving error pages. 252 253 * tests/qwebpage/tst_qwebpage.cpp: 254 (tst_QWebPage::errorPageExtension): 255 256 2009-11-16 Holger Hans Peter Freyther <zecke@selfish.org> 257 258 Reviewed by NOBODY (OOPS!). 259 260 [Qt] Do not show the QWidget when the WebCore::Widget is hidden 261 https://bugs.webkit.org/show_bug.cgi?id=31203 262 263 The clipping code was making a QWidget visible even if the 264 WebCore::Widget was hidden. Fix the bug by calling setVisible 265 only if the WebCore::Widget is shown. 266 267 * WebCoreSupport/FrameLoaderClientQt.cpp: 268 (WebCore::QtPluginWidget::show): Override WebCore::Widget 269 (WebCore::QtPluginWidget::hide): Override WebCore::Widget 270 (WebCore::QtPluginWidget::handleVisibility): New method to call setVisible when we are visible 271 (FrameLoaderClientQt::createPlugin): Hide the QWidget by default 272 273 2009-11-09 Benjamin Poulain <benjamin.poulain@nokia.com> 274 275 Reviewed by Kenneth Rohde Christiansen. 276 277 https://bugs.webkit.org/show_bug.cgi?id=30628 278 Add an API to get all the attributes from a QWebElement. 279 280 * Api/qwebelement.cpp: 281 (QWebElement::attributesName): 282 * Api/qwebelement.h: 283 * tests/qwebelement/tst_qwebelement.cpp: 284 (tst_QWebElement::listAttributes): 285 286 2009-11-13 Andras Becsi <becsi.andras@stud.u-szeged.hu> 287 288 Reviewed by Kenneth Rohde Christiansen. 289 290 [Qt] Enable Page Cache if setMaximumPagesInCache needs it. 291 This fixes https://bugs.webkit.org/show_bug.cgi?id=31266. 292 293 * Api/qwebsettings.cpp: 294 (QWebSettingsPrivate::apply): 295 (QWebSettings::setMaximumPagesInCache): 296 297 2009-11-13 Tor Arne VestbÞ <tor.arne.vestbo@nokia.com> 298 299 Reviewed by Simon Hausmann. 300 301 Update documentation for the Qt API 302 303 * Api/qgraphicswebview.cpp: 304 * Api/qwebelement.cpp: 305 * Api/qwebframe.cpp: 306 * Api/qwebsettings.cpp: 307 * Api/qwebview.cpp: 308 309 2009-11-13 Tor Arne VestbÞ <tor.arne.vestbo@nokia.com> 310 311 Reviewed by Simon Hausmann. 312 313 Use correct install-path when running qdoc3 314 315 * docs/docs.pri: 316 317 2009-11-12 Antonio Gomes <tonikitoo@webkit.org> 318 319 Reviewed by Jan Alonzo. 320 321 [Qt] Various doc fixes 322 https://bugs.webkit.org/show_bug.cgi?id=31358 323 324 QWebPage's constructor docs are mentioning "QWebView": 325 "Constructs an empty QWebView with parent". 326 327 * Api/qwebpage.cpp: 328 329 2009-11-11 Antonio Gomes <tonikitoo@webkit.org> 330 331 Reviewed by Kenneth Christiansen. 332 333 [Qt] Various doc fixes 334 https://bugs.webkit.org/show_bug.cgi?id=31358 335 336 Fixed wrong documentation: item's dimensions do fit to Web page 337 content by default. 338 339 Kenneth agreed to land this as a followup patch to the 340 just landed documentation patch. 341 342 * Api/qgraphicswebview.cpp: 343 344 2009-11-11 David Boddie <dboddie@trolltech.com> 345 346 Reviewed by Kenneth Christiansen. 347 348 [Qt] Various doc fixes 349 https://bugs.webkit.org/show_bug.cgi?id=31323 350 351 Fixed and synchronized QWebView related documentation. 352 353 * Api/qgraphicswebview.cpp: 354 * Api/qwebview.cpp: 355 356 2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> 357 358 Reviewed by Kenneth Rohde Christiansen. 359 360 [Qt] Few classes have virtual functions but non-virtual destructor 361 https://bugs.webkit.org/show_bug.cgi?id=31269 362 363 * Api/qgraphicswebview.cpp: 364 (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate): Add virtual 365 destructor. 366 367 2009-10-30 Tor Arne VestbÞ <tor.arne.vestbo@nokia.com> 368 369 Reviewed by NOBODY (OOPS!). 370 371 [Qt] Use the default timeout interval for JS as the HTML tokenizer delay for setHtml() 372 373 This ensures that long-running JavaScript (for example due to a modal alert() dialog), 374 will not trigger a deferred load after only 500ms (the default tokenizer delay) while 375 still giving a reasonable timeout (10 seconds) to prevent deadlock. 376 377 https://bugs.webkit.org/show_bug.cgi?id=29381 378 379 * Api/qwebframe.cpp: Document the behaviour 380 * WebCoreSupport/FrameLoaderClientQt.cpp: set the custom tokenizer delay for substitute loads 381 * tests/qwebframe/tst_qwebframe.cpp: Add test 382 383 2009-11-13 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 384 385 Reviewed by Kenneth Rohde Christiansen. 386 387 [Qt] Fix initial QWebView focus behavior. 388 389 focusController->setFocused(true) was not always called. 390 https://bugs.webkit.org/show_bug.cgi?id=31466 391 392 * Api/qwebpage.cpp: 393 (QWebPagePrivate::focusInEvent): 394 395 2009-11-12 Benjamin Poulain <benjamin.poulain@nokia.com> 396 397 Reviewed by Kenneth Rohde Christiansen. 398 399 Custom printing shrink factors 400 https://bugs.webkit.org/show_bug.cgi?id=29042 401 402 This reverts commit r49769. The public API for this needs to be reviewed 403 before its inclusion in Qt. 404 405 * Api/qwebsettings.cpp: 406 (QWebSettingsPrivate::apply): 407 (QWebSettings::QWebSettings): 408 * Api/qwebsettings.h: 409 410 2009-11-11 Liang QI <liang.qi@nokia.com> 411 Update documentation for the Qt API 412 413 * Api/qgraphicswebview.cpp: 414 * Api/qwebelement.cpp: 415 * Api/qwebframe.cpp: 416 * Api/qwebsettings.cpp: 417 * Api/qwebview.cpp: 418 419 2009-11-13 Tor Arne VestbÞ <tor.arne.vestbo@nokia.com> 420 421 Reviewed by Simon Hausmann. 422 423 424 [Qt] Fix tst_qwebpage and tst_qwebframe compilation on Symbian. 425 426 * tests/qwebframe/qwebframe.pro: 427 * tests/qwebframe/tst_qwebframe.cpp: 428 * tests/qwebpage/qwebpage.pro: 429 * tests/qwebpage/tst_qwebpage.cpp: 430 431 2009-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org> 432 433 Reviewed by Simon Hausmann. 434 435 Fix a crash in the layout test plugins/document-open.html 436 437 * Api/qwebframe.cpp: 438 (QWebFrame::toPlainText): 439 440 2009-11-11 Warwick Allison <warwick.allison@nokia.com>, Simon Hausmann <simon.hausmann@nokia.com> 441 442 Reviewed by Tor Arne VestbÞ. 443 444 [Qt] Regression: Preserve the parent of plugin objects when using 445 QtWebKit with only a QWebPage. 446 447 * WebCoreSupport/FrameLoaderClientQt.cpp: 448 (WebCore::FrameLoaderClientQt::createPlugin): Don't reparent 449 plugins to 0. 450 * tests/qwebpage/tst_qwebpage.cpp: 451 (PluginCounterPage::PluginCounterPage): Initialize m_pluginParent to 0. 452 (PluginCounterPage::~PluginCounterPage): Delete the plugin parent later 453 (after the page) 454 (PluginTracerPage::createPlugin): Assign a dummy parent to the plugin. 455 (PluginTracerPage::PluginTracerPage): Set up the plugin parent. 456 (tst_QWebPage::createViewlessPlugin): Verify that for viewless pages the 457 plugin parent remains unchanged. 458 459 2009-11-11 David Boddie <dboddie@trolltech.com> 460 461 [Qt] Doc: Added internal or hidden placeholder documentation. 462 463 * Api/qwebpage.cpp: 464 465 2009-11-11 Martin Smith <msmith@trolltech.com> 466 467 [Qt] doc: Changed Trolltech to Nokia 468 469 * Api/qwebview.cpp: 470 471 2009-11-10 Kenneth Rohde Christiansen <kenneth@webkit.org> 472 473 Unreviewed documentation fixes. 474 475 Added a few improvements from Jocelyn Turcotte to the 476 createWindow docs. 477 478 * Api/qwebview.cpp: 479 480 2009-11-10 Kenneth Rohde Christiansen <kenneth@webkit.org> 481 482 Unreviewed documentation fix. 483 484 [Qt] Make qwebpage's createWindow not qwebview dependent. 485 https://bugs.webkit.org/show_bug.cgi?id=30771 486 487 Update documentation to make it clear that a reimplementation 488 of the createWindow method of the associated QWebPage can 489 result in the QWebView::createWindow method to never be called. 490 491 * Api/qwebview.cpp: 492 493 2009-11-11 Simon Hausmann <simon.hausmann@nokia.com> 494 495 Reviewed by Tor Arne VestbÞ. 496 497 Fix enabling of software input panel when activating editable elements 498 in QGraphicsWebView. 499 500 * Api/qgraphicswebview.cpp: 501 (QGraphicsWebViewPrivate::inputMethodEnabled): Implement method to 502 query for input method support. 503 * Api/qwebpage.cpp: 504 (QWebPageWidgetClient::inputMethodEnabled): Ditto for QWidget. 505 (QWebPagePrivate::handleSoftwareInputPanel): Don't use view() to 506 test for input method support. Instead query using QWebPageClient 507 and send the SIPR event to the ownerWidget() instead of the view(). 508 The latter is null for QGraphicsWebView. 509 * tests/qwebpage/tst_qwebpage.cpp: 510 (EventSpy::EventSpy): 511 (EventSpy::eventFilter): 512 (tst_QWebPage::inputMethods): Modify the test to verify that SIPR 513 events are dispatched when activating focusable content. 514 515 2009-11-09 Benjamin Poulain <benjamin.poulain@nokia.com> 516 517 Reviewed by Kenneth Rohde Christiansen. 518 519 https://bugs.webkit.org/show_bug.cgi?id=30772 520 Add a non-const iterator to QWebElementCollection. 521 Move the two attributes of the iterator to private. 522 523 * Api/qwebelement.h: 524 (const_iterator::begin): 525 (const_iterator::end): 526 (const_iterator::constBegin): 527 (const_iterator::constEnd): 528 (const_iterator::iterator::iterator): 529 (const_iterator::iterator::operator*): 530 (const_iterator::iterator::operator==): 531 (const_iterator::iterator::operator!=): 532 (const_iterator::iterator::operator<): 533 (const_iterator::iterator::operator<=): 534 (const_iterator::iterator::operator>): 535 (const_iterator::iterator::operator>=): 536 (const_iterator::iterator::operator++): 537 (const_iterator::iterator::operator--): 538 (const_iterator::iterator::operator+=): 539 (const_iterator::iterator::operator-=): 540 (const_iterator::iterator::operator+): 541 (const_iterator::iterator::operator-): 542 * tests/qwebelement/tst_qwebelement.cpp: 543 (tst_QWebElement::nonConstIterator): 544 (tst_QWebElement::constIterator): 545 546 2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> 547 548 Reviewed by Kenneth Christiansen. 549 550 [Qt] Remove the sessionStorage setting (per Page) 551 https://bugs.webkit.org/show_bug.cgi?id=31249 552 553 This setting allows to run sessionStorage on/off on a per page 554 basis. Remove this prematurely exposed API. 555 556 * Api/qwebsettings.cpp: 557 (QWebSettingsPrivate::apply): 558 (QWebSettings::QWebSettings): 559 * tests/qwebpage/tst_qwebpage.cpp: 560 (tst_QWebPage::database): 561 (tst_QWebPage::testOptionalJSObjects): 562 563 2009-11-09 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 564 565 Reviewed by Simon Hausmann. 566 567 [Qt] Remove the QWebPage:webInspectorTriggered signal. 568 User customization of the communication between QWebPage 569 and QWebInspector will be properly designed in the next version. 570 https://bugs.webkit.org/show_bug.cgi?id=30773 571 572 * Api/qwebinspector.cpp: 573 * Api/qwebpage.cpp: 574 (QWebPagePrivate::getOrCreateInspector): 575 (QWebPage::triggerAction): 576 * Api/qwebpage.h: 577 * QtLauncher/main.cpp: 578 (MainWindow::MainWindow): 579 580 2009-11-05 Simon Hausmann <hausmann@webkit.org> 581 582 Reviewed by Tor Arne VestbÞ. 583 584 Added a missing re-implementation of QGraphicsItem::inputMethodQuery(). 585 586 * Api/qgraphicswebview.cpp: 587 (QGraphicsWebView::inputMethodQuery): 588 * Api/qgraphicswebview.h: 589 590 2009-11-04 Simon Hausmann <hausmann@webkit.org> 591 592 Reviewed by Tor Arne VestbÞ. 593 594 Provide a dummy re-implementation of QGraphicsLayoutItem::sizeHint(), 595 similar to QWebView. 596 597 * Api/qgraphicswebview.cpp: 598 (QGraphicsWebView::sizeHint): 599 * Api/qgraphicswebview.h: 600 601 2009-11-04 Simon Hausmann <hausmann@webkit.org> 602 603 Reviewed by Tor Arne VestbÞ. 604 605 Removed zoomFactoryChanged() signal and added 606 linkClicked() to QGraphicsWebView, for consistency with 607 QWebView. 608 609 * Api/qgraphicswebview.cpp: 610 (QGraphicsWebView::setPage): 611 (QGraphicsWebView::setZoomFactor): 612 * Api/qgraphicswebview.h: 613 614 2009-11-04 Simon Hausmann <hausmann@webkit.org> 615 616 Reviewed by Tor Arne VestbÞ. 617 618 Added QGraphicsWebView::findText() for convenience and consistency 619 with QWebView. 620 621 * Api/qgraphicswebview.cpp: 622 (QGraphicsWebView::findText): 623 * Api/qgraphicswebview.h: 624 625 2009-11-04 Simon Hausmann <hausmann@webkit.org> 626 627 Reviewed by Tor Arne VestbÞ. 628 629 Added QGraphicsWebView::pageAction() and triggerPageAction(), for 630 consistency with QWebView. 631 632 * Api/qgraphicswebview.cpp: 633 (QGraphicsWebView::pageAction): 634 (QGraphicsWebView::triggerPageAction): 635 * Api/qgraphicswebview.h: 636 637 2009-11-04 Simon Hausmann <hausmann@webkit.org> 638 639 Reviewed by Tor Arne VestbÞ. 640 641 Removed QGraphicsWebView::toHtml() after API review. 642 643 That's consistent with QWebView and also based on the assumption that 644 toHtml() is called less frequently than setHtml(). 645 646 * Api/qgraphicswebview.cpp: 647 * Api/qgraphicswebview.h: 648 * tests/qgraphicswebview/tst_qgraphicswebview.cpp: 649 (tst_QGraphicsWebView::qgraphicswebview): 650 651 2009-11-04 Simon Hausmann <hausmann@webkit.org> 652 653 Reviewed by Tor Arne VestbÞ. 654 655 Removed the interactive property of QGraphicsWebView. 656 657 There are clearly use-cases for this feature, but it will require 658 more work to make this fully work with an enum to have fine-grained 659 control over the interactivity levels. For now it is easy to achieve 660 in user-code what the boolean property did. 661 662 * Api/qgraphicswebview.cpp: 663 (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): 664 (QGraphicsWebView::hoverMoveEvent): 665 (QGraphicsWebView::mouseMoveEvent): 666 (QGraphicsWebView::mousePressEvent): 667 (QGraphicsWebView::mouseReleaseEvent): 668 (QGraphicsWebView::mouseDoubleClickEvent): 669 (QGraphicsWebView::keyPressEvent): 670 (QGraphicsWebView::keyReleaseEvent): 671 (QGraphicsWebView::dragLeaveEvent): 672 (QGraphicsWebView::dragMoveEvent): 673 (QGraphicsWebView::dropEvent): 674 (QGraphicsWebView::wheelEvent): 675 (QGraphicsWebView::inputMethodEvent): 676 * Api/qgraphicswebview.h: 677 * tests/qgraphicswebview/tst_qgraphicswebview.cpp: 678 (tst_QGraphicsWebView::qgraphicswebview): 679 680 2009-11-04 Simon Hausmann <hausmann@webkit.org> 681 682 Reviewed by Tor Arne VestbÞ. 683 684 Make the QGraphicsWebView constructor explicit. 685 686 * Api/qgraphicswebview.h: 687 688 2009-11-05 Simon Hausmann <hausmann@webkit.org> 689 690 Last Qt 4.5 build fix (*sigh*) 691 692 * tests/qwebpage/tst_qwebpage.cpp: 693 (inputMethodHints): inputMethodHints() is only used for 694 Qt 4.6, so guard the whole function. 695 696 2009-11-05 Simon Hausmann <hausmann@webkit.org> 697 698 Another prospective build fix against Qt 4.5 (build bot) 699 700 Don't compile & run the QGraphicsWebView portion of the 701 input methods auto test with Qt 4.5. 702 703 * tests/qwebpage/tst_qwebpage.cpp: 704 (tst_QWebPage::inputMethods_data): 705 (inputMethodHints): 706 (inputMethodEnabled): 707 (tst_QWebPage::inputMethods): 708 709 2009-11-05 Simon Hausmann <hausmann@webkit.org> 710 711 Prospective build fix against Qt 4.5 (build bot) 712 713 * Api/qgraphicswebview.cpp: 714 (QGraphicsWebViewPrivate::setInputMethodEnabled): Guard the 715 use of Qt 4.6 specific API with #ifdefs. 716 717 2009-11-01 Simon Hausmann <hausmann@webkit.org> 718 719 Reviewed by Kenneth Christiansen. 720 721 [Qt] Fix enabling of input method support on QGraphicsWebView. 722 https://bugs.webkit.org/show_bug.cgi?id=30605 723 724 Instead of setting the unsupported widget attribute on the 725 QGraphicsWidget in setInputMethodEnabled() set the 726 ItemAcceptsInputMethod GraphicsItem flag directly. 727 728 Changed the existing input method auto test to run once 729 on a QWebView and once on a QGraphicsWebView. 730 731 * Api/qgraphicswebview.cpp: 732 (QGraphicsWebViewPrivate::setInputMethodEnabled): 733 * tests/qwebpage/tst_qwebpage.cpp: 734 (tst_QWebPage::inputMethods_data): 735 (inputMethodHints): 736 (inputMethodEnabled): 737 (tst_QWebPage::inputMethods): 738 739 2009-11-04 Simon Hausmann <hausmann@webkit.org> 740 741 Reviewed by Kenneth Christiansen. 742 743 Added QGraphicsWebView::modified property, for consistency 744 with QWebView. 745 746 * Api/qgraphicswebview.cpp: 747 (QGraphicsWebView::isModified): 748 * Api/qgraphicswebview.h: 749 * tests/qgraphicswebview/tst_qgraphicswebview.cpp: 750 (tst_QGraphicsWebView::qgraphicswebview): 751 752 2009-11-04 Simon Hausmann <hausmann@webkit.org> 753 754 Reviewed by Kenneth Christiansen. 755 756 Removed status and progress properties of QGraphicsWebView. 757 Added loadProgress and statusBarMessage signals instead, 758 after API review. 759 760 * Api/qgraphicswebview.cpp: 761 (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): 762 (QGraphicsWebView::setPage): 763 * Api/qgraphicswebview.h: 764 * tests/qgraphicswebview/tst_qgraphicswebview.cpp: 765 (tst_QGraphicsWebView::qgraphicswebview): 766 767 2009-11-04 Yael Aharon <yael.aharon@nokia.com> 768 769 Reviewed by Simon Hausmann. 770 771 [Qt] REGRESSION: Allow applications to use their own QWidget bypassing QWebView. 772 https://bugs.webkit.org/show_bug.cgi?id=30979 773 774 Decouple QWebViewPrivate from QWebPageClient, and automatically create 775 QWebPageWidgetClient whenever the view is QWidget based. 776 777 * Api/qwebpage.cpp: 778 (QWebPageWidgetClient::QWebPageWidgetClient): 779 (QWebPageWidgetClient::scroll): 780 (QWebPageWidgetClient::update): 781 (QWebPageWidgetClient::setInputMethodEnabled): 782 (QWebPageWidgetClient::setInputMethodHint): 783 (QWebPageWidgetClient::cursor): 784 (QWebPageWidgetClient::updateCursor): 785 (QWebPageWidgetClient::palette): 786 (QWebPageWidgetClient::screenNumber): 787 (QWebPageWidgetClient::ownerWidget): 788 (QWebPageWidgetClient::pluginParent): 789 (QWebPage::setView): 790 * Api/qwebview.cpp: 791 (QWebView::~QWebView): 792 (QWebView::setPage): 793 (QWebView::event): 794 795 2009-11-03 Andras Becsi <becsi.andras@stud.u-szeged.hu> 796 797 Reviewed by Simon Hausmann. 798 799 [Qt] Fix build of unit-test after r50454. 800 801 * tests/qwebpage/tst_qwebpage.cpp: 802 803 2009-11-03 Simon Hausmann <hausmann@webkit.org> 804 805 Reviewed by Tor Arne VestbÞ. 806 807 Make QWebPluginDatabase private API for now. 808 809 https://bugs.webkit.org/show_bug.cgi?id=30775 810 811 * Api/headers.pri: 812 * Api/qwebplugindatabase.cpp: 813 * Api/qwebplugindatabase_p.h: Renamed from WebKit/qt/Api/qwebplugindatabase.h. 814 * Api/qwebsettings.cpp: 815 * Api/qwebsettings.h: 816 * QtLauncher/main.cpp: 817 (MainWindow::setupUI): 818 * tests/tests.pro: 819 820 2009-11-03 Simon Hausmann <hausmann@webkit.org> 821 822 Rubber-stamped by Tor Arne VestbÞ. 823 824 Oops, also remove the API docs of the removed networkRequestStarted() signal. 825 826 * Api/qwebpage.cpp: 827 828 2009-11-03 Simon Hausmann <hausmann@webkit.org> 829 830 Reviewed by Tor Arne VestbÞ. 831 832 Replace the QWebPage::networkRequestStarted() signal with the originatingObject 833 property set to the QWebFrame that belongs to the request. 834 835 https://bugs.webkit.org/show_bug.cgi?id=29975 836 837 * Api/qwebpage.h: 838 * WebCoreSupport/FrameLoaderClientQt.cpp: 839 (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction): 840 (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction): 841 (WebCore::FrameLoaderClientQt::startDownload): 842 * tests/qwebpage/tst_qwebpage.cpp: 843 (tst_QWebPage::loadFinished): 844 (TestNetworkManager::createRequest): 845 (tst_QWebPage::originatingObjectInNetworkRequests): 846 847 2009-11-02 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 848 849 Reviewed by Adam Barth. 850 851 QWebView crash fix. 852 853 The QWebView should not crash if the stop() method is called from 854 a function triggered by the loadProgress signal. 855 856 A null pointer protection was added in the ProgressTracker::incrementProgress. 857 858 New autotest was created. 859 860 https://bugs.webkit.org/show_bug.cgi?id=29425 861 862 * tests/qwebview/tst_qwebview.cpp: 863 (WebViewCrashTest::WebViewCrashTest): 864 (WebViewCrashTest::loading): 865 (tst_QWebView::crashTests): 866 867 2009-10-30 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 868 869 Reviewed by Tor Arne VestbÞ. 870 871 [Qt] Remove the QWebInspector::windowTitleChanged signal, 872 QEvent::WindowTitleChange can be used to achieve the same. 873 https://bugs.webkit.org/show_bug.cgi?id=30927 874 875 * Api/qwebinspector.cpp: 876 * Api/qwebinspector.h: 877 * WebCoreSupport/InspectorClientQt.cpp: 878 (WebCore::InspectorClientQt::updateWindowTitle): 879 880 2009-10-29 Laszlo Gombos <laszlo.1.gombos@nokia.com> 881 882 Reviewed by Tor Arne VestbÞ. 883 884 [Qt] Implement DELETE HTTP method for XmlHttpRequest 885 https://bugs.webkit.org/show_bug.cgi?id=30894 886 887 No new tests as this functionality is already tested by the 888 xmlhttprequest LayoutTests. As this patch depends on an unreleased 889 version of the dependent QtNetwork library and the tests will be 890 enabled later once the dependent library is released (and the 891 buildbot is updated). 892 893 * Api/qwebframe.cpp: 894 (QWebFrame::load): 895 896 2009-10-29 Kenneth Rohde Christiansen <kenneth@webkit.org> 897 898 Reviewed by Tor Arne VestbÞ. 899 900 Remove QWebView::guessUrlFromString() and replace its use 901 with the new QUrl::fromUserInput() if using Qt 4.6 or newer. 902 903 * Api/qwebview.cpp: 904 * Api/qwebview.h: 905 * QGVLauncher/main.cpp: 906 (urlFromUserInput): 907 (WebPage::applyProxy): 908 (MainWindow::load): 909 * QtLauncher/main.cpp: 910 (urlFromUserInput): 911 (MainWindow::MainWindow): 912 (MainWindow::changeLocation): 913 * tests/qwebview/tst_qwebview.cpp: 914 915 2009-10-28 Kenneth Rohde Christiansen <kenneth@webkit.org> 916 917 Reviewed by Tor Arne VestbÞ. 918 919 Serialize directly to the stream, and not first to an QByteArray, 920 that is later serialized. That is slower and also uses more bytes. 921 922 * Api/qwebhistory.cpp: 923 (operator<<): 924 (operator>>): 925 926 2009-10-28 Shinichiro Hamaji <hamaji@chromium.org> 927 928 Reviewed by Eric Seidel. 929 930 [Qt] WebFrame::counterValueForElementById must not be exposed 931 https://bugs.webkit.org/show_bug.cgi?id=30882 932 933 * Api/qwebframe.cpp: 934 (qt_drt_counterValueForElementById): 935 * Api/qwebframe.h: 936 937 2009-10-27 Shinichiro Hamaji <hamaji@chromium.org> 938 939 Reviewed by Darin Adler. 940 941 Provide a way to get counter values with layoutTestContoller 942 https://bugs.webkit.org/show_bug.cgi?id=30555 943 944 * Api/qwebframe.cpp: 945 (QWebFrame::counterValueForElementById): 946 (QWebHitTestResult::frame): 947 * Api/qwebframe.h: 948 949 2009-10-28 Antonio Gomes <tonikitoo@webkit.org> 950 951 Pushing missing WebKit/qt/tests/qwebframe/resources/ dir from bug 29248. 952 953 [Qt] [API] Make it possible to have 'invisible' loads 954 https://bugs.webkit.org/show_bug.cgi?id=29248 955 956 * tests/qwebframe/resources/image2.png: Copied from WebKit/qt/tests/qwebelement/image.png. 957 958 2009-10-28 Kenneth Rohde Christiansen <kenneth@webkit.org> 959 960 Reviewed by Tor Arne VestbÞ. 961 962 [Qt] QWebHistory::saveState() is inconsistent with the Qt API 963 https://bugs.webkit.org/show_bug.cgi?id=30710 964 965 Make the versioning internal and enforce it in the WebCore 966 part. Adjust the comments, as well as remove now dead code. 967 968 * Api/qwebhistory.cpp: 969 (operator<<): 970 (operator>>): 971 * Api/qwebhistory.h: 972 973 2009-10-28 Kenneth Rohde Christiansen <kenneth@webkit.org> 974 975 Reviewed by Holger Freyther. 976 977 [Qt] QWebHistory::saveState() is inconsistent with the Qt API 978 https://bugs.webkit.org/show_bug.cgi?id=30710 979 980 Remove the QWebHistory::saveState() and ::restoreState() as 981 they are inconsistent with the Qt API. 982 983 Update unittests to reflect the change. 984 985 * Api/qwebhistory.cpp: 986 (operator<<): 987 (operator>>): 988 * Api/qwebhistory.h: 989 * tests/qwebhistory/tst_qwebhistory.cpp: 990 (saveHistory): 991 (restoreHistory): 992 (tst_QWebHistory::saveAndRestore_crash_1): 993 (tst_QWebHistory::saveAndRestore_crash_2): 994 (tst_QWebHistory::saveAndRestore_crash_3): 995 (tst_QWebHistory::clear): 996 997 2009-10-27 Antonio Gomes <tonikitoo@webkit.org> 998 999 Reviewed by Holger Freyther. 1000 1001 Complementary fix to bug 30779. 1002 1003 By mistake I used QWeakPointer's toStrongRef() method which docs 1004 explicitly say to not be used in this situation (when the tracked 1005 pointer is devired from QObject). Instead QWeakPointer's data() 1006 is recommended. 1007 1008 * Api/qwebpage.cpp: 1009 (QWebPage::view): 1010 1011 2009-10-27 Holger Hans Peter Freyther <zecke@selfish.org> 1012 1013 Reviewed by Simon Fraser. 1014 1015 Change HitTestResult methods to use (3d) transformation aware methods 1016 https://bugs.webkit.org/show_bug.cgi?id=27347 1017 1018 The HitTestResult::boundingBox method was removed. The 1019 RenderObject must be used directly. In contrast to the 1020 old HitTestResult::boundingBox method this code must use 1021 a (3d) transformation aware method to not run into an 1022 assert in SVGRenderBase::mapLocalToContainer. 1023 1024 * Api/qwebframe.cpp: 1025 (QWebHitTestResultPrivate::QWebHitTestResultPrivate): 1026 1027 2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org> 1028 1029 Rubberstamped by Oliver Hunt. 1030 1031 Change two methods to be internal for DRT use only. 1032 1033 Part of [Qt] Review all new API in Qt 4.6 1034 https://bugs.webkit.org/show_bug.cgi?id=29843#c11 1035 1036 * Api/qwebsecurityorigin.cpp: 1037 (qt_drt_whiteListAccessFromOrigin): 1038 (qt_drt_resetOriginAccessWhiteLists): 1039 (QWebSecurityOrigin::localSchemes): 1040 * Api/qwebsecurityorigin.h: 1041 1042 2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org> 1043 1044 Reviewed by Tor Arne VestbÞ. 1045 1046 Make sure that initiating a rotation while rotating won't make 1047 it end up at rotation positions that are not a multiply of 1048 180 degrees. 1049 1050 * QGVLauncher/main.cpp: 1051 (MainView::animatedFlip): 1052 1053 2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org> 1054 1055 Unreviewed Qt build fix. 1056 1057 Update the tests as well to the new API change. 1058 1059 * tests/qwebelement/tst_qwebelement.cpp: 1060 (tst_QWebElement::clear): 1061 1062 2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org> 1063 1064 Rubberstamped by Tor Arne VestbÞ. 1065 1066 [Qt] QWebElement::removeChildren() should be 1067 QWebElement::removeAllChildren() 1068 https://bugs.webkit.org/show_bug.cgi?id=30630 1069 1070 * Api/qwebelement.cpp: 1071 (QWebElement::removeAllChildren): 1072 * Api/qwebelement.h: 1073 1074 2009-10-27 Antonio Gomes <tonikitoo@webkit.org> 1075 1076 Reviewed by Antti Koivisto and Holger Freyther. 1077 1078 Make QWebPagePrivate's (QWidget) view to be a QWeakPointer. 1079 https://bugs.webkit.org/show_bug.cgi?id=30779 1080 1081 The fact that it was been set from external objects of qwebpage 1082 and not being deleted internally can lead to dangling references. 1083 1084 * Api/qgraphicswebview.cpp: 1085 (QGraphicsWebView::~QGraphicsWebView): 1086 * Api/qwebpage.cpp: 1087 (QWebPagePrivate::QWebPagePrivate): 1088 (QWebPagePrivate::createContextMenu): 1089 (QWebPagePrivate::handleSoftwareInputPanel): 1090 (QWebPagePrivate::keyPressEvent): 1091 (QWebPage::setView): 1092 (QWebPage::view): 1093 (QWebPage::javaScriptAlert): 1094 (QWebPage::javaScriptConfirm): 1095 (QWebPage::javaScriptPrompt): 1096 (QWebPage::shouldInterruptJavaScript): 1097 (QWebPage::createWindow): 1098 (QWebPage::extension): 1099 (QWebPage::chooseFile): 1100 (QWebPage::userAgentForUrl): 1101 * Api/qwebpage_p.h: 1102 * Api/qwebview.cpp: 1103 (QWebView::~QWebView): 1104 1105 2009-10-26 Kenneth Rohde Christiansen <kenneth@webkit.org> 1106 1107 Unreviewed documentation fix from David Boddie (Qt Doc Team) 1108 1109 Removes the check around the RenderHints property documentation 1110 that was clearly added to synchronize the source and header files 1111 when the #if !defined(Q_OS_SYMBIAN) guards was added to the 1112 property. 1113 1114 The documentation has also been updated to ensure that Symbian 1115 users know that there is no actual RenderHints property on their 1116 platform. 1117 1118 * Api/qwebview.cpp: 1119 1120 2009-10-26 Kenneth Rohde Christiansen <kenneth@webkit.org> 1121 1122 Unreviewed documentation fix from David Boddie (Qt Doc Team) 1123 1124 Ensure that qdoc will always see the RenderHints property. 1125 1126 The property was only defined in the header file if the Q_OS_SYMBIAN 1127 symbol was not defined, resulting in the property not showing up 1128 in the Qt documentation just because one platform doesn't support it. 1129 1130 A follow up commit will improve the documentation for the property 1131 and note that it is not supported on the Symbiam platform. 1132 1133 * Api/qwebview.h: 1134 1135 2009-10-26 Benjamin Poulain <benjamin.poulain@nokia.com> 1136 1137 Reviewed by Tor Arne VestbÞ. 1138 1139 [Qt] Reintroduce QWebElementCollection 1140 1141 Revert the patch that has replaced QWebElementCollection 1142 with QList<QWebElement>. Update the tests accordingly. 1143 1144 Remove the constness of the return type of QWebElement operator[]. 1145 1146 https://bugs.webkit.org/show_bug.cgi?id=30767 1147 1148 * Api/qwebelement.cpp: 1149 (QWebElement::findAll): 1150 (QWebElementCollectionPrivate::QWebElementCollectionPrivate): 1151 (QWebElementCollectionPrivate::create): 1152 (QWebElementCollection::QWebElementCollection): 1153 (QWebElementCollection::operator=): 1154 (QWebElementCollection::~QWebElementCollection): 1155 (QWebElementCollection::operator+): 1156 (QWebElementCollection::append): 1157 (QWebElementCollection::count): 1158 (QWebElementCollection::at): 1159 (QWebElementCollection::toList): 1160 * Api/qwebelement.h: 1161 (const_iterator::begin): 1162 (const_iterator::end): 1163 (const_iterator::operator[]): 1164 * Api/qwebframe.cpp: 1165 (QWebFrame::findAllElements): 1166 * Api/qwebframe.h: 1167 * QtLauncher/main.cpp: 1168 (MainWindow::selectElements): 1169 * tests/qwebelement/tst_qwebelement.cpp: 1170 (tst_QWebElement::simpleCollection): 1171 (tst_QWebElement::iteration): 1172 (tst_QWebElement::emptyCollection): 1173 (tst_QWebElement::appendCollection): 1174 (tst_QWebElement::nullSelect): 1175 (tst_QWebElement::hasSetFocus): 1176 (tst_QWebElement::render): 1177 * tests/qwebpage/tst_qwebpage.cpp: 1178 (tst_QWebPage::inputMethods): 1179 1180 2009-10-24 Laszlo Gombos <laszlo.1.gombos@nokia.com> 1181 1182 Reviewed by Holger Freyther. 1183 1184 [Qt] [Symbian] Set the capability and memory required to run QtWebKit for Symbian 1185 https://bugs.webkit.org/show_bug.cgi?id=30476 1186 1187 Assign ReadUserData WriteUserData NetworkServices Symbian capabilities 1188 to all QtWebkit executables. 1189 1190 * QGVLauncher/QGVLauncher.pro: 1191 * QtLauncher/QtLauncher.pro: 1192 * tests/benchmarks/loading/tst_loading.pro: 1193 * tests/benchmarks/painting/tst_painting.pro: 1194 * tests/qgraphicswebview/qgraphicswebview.pro: 1195 * tests/qwebelement/qwebelement.pro: 1196 * tests/qwebframe/qwebframe.pro: 1197 * tests/qwebhistory/qwebhistory.pro: 1198 * tests/qwebhistoryinterface/qwebhistoryinterface.pro: 1199 * tests/qwebpage/qwebpage.pro: 1200 * tests/qwebplugindatabase/qwebplugindatabase.pro: 1201 * tests/qwebview/qwebview.pro: 1202 1203 2009-10-22 Gavin Barraclough <barraclough@apple.com> 1204 1205 Reviewed by NOBODY (speculative build fix - qt is currently already broken!) 1206 Build fix following bug #30696. 1207 1208 * Api/qwebelement.cpp: 1209 (setupScriptContext): 1210 * Api/qwebframe.cpp: 1211 (QWebFrame::evaluateJavaScript): 1212 1213 2009-10-22 Shu Chang <Chang.Shu@nokia.com> 1214 1215 Reviewed by Eric Seidel. 1216 1217 [Qt] Enable track visited links in QWebPage 1218 https://bugs.webkit.org/show_bug.cgi?id=30574 1219 1220 Test: fast/history/clicked-link-is-visited.html 1221 1222 * Api/qwebpage.cpp: 1223 (QWebPagePrivate::QWebPagePrivate): 1224 1225 2009-10-22 Girish Ramakrishnan <girish@forwardbias.in> 1226 1227 Reviewed by Eric Seidel. 1228 1229 [Qt] Add Print Shortcut to QtLauncher 1230 1231 https://bugs.webkit.org/show_bug.cgi?id=30682 1232 1233 * QtLauncher/main.cpp: 1234 (MainWindow::setupUI): 1235 1236 2009-10-22 Antonio Gomes <tonikitoo@webkit.org> 1237 1238 Rubberstamped by Tor Arne VestbÞ. 1239 1240 Code standarlization for QGVLauncher. 1241 1242 1) Made member initilization lists in constructors 1243 to be per line. 1244 2) Made applyProxy method inline as all other methods in 1245 WebPage class. 1246 1247 * QGVLauncher/main.cpp: 1248 (WebPage::WebPage): 1249 (WebPage::applyProxy): 1250 (MainView::MainView): 1251 (MainWindow::MainWindow): 1252 (MainWindow::init): 1253 1254 2009-10-22 Antonio Gomes <tonikitoo@webkit.org> 1255 1256 Reviewed by Tor Arne VestbÞ. 1257 1258 Add a Y-Axis rotation to QGVLauncher. 1259 1260 It uses the QStateMachine API from Qt 4.6. 1261 1262 * QGVLauncher/main.cpp: 1263 (WebView::WebView): 1264 (WebView::setYRotation): 1265 (WebView::yRotation): 1266 (MainView::flip): 1267 (MainView::animatedYFlip): 1268 (SharedScene::SharedScene): 1269 (SharedScene::webView): 1270 (MainWindow::init): 1271 (MainWindow::animatedYFlip): 1272 (MainWindow::buildUI): 1273 1274 2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org> 1275 1276 Reviewed By Adam Barth. 1277 1278 Add some actions to the menu for cursor debugging. 1279 1280 GraphicsView based launcher only. 1281 1282 * QGVLauncher/main.cpp: 1283 (MainView::setWaitCursor): 1284 (MainView::resetCursor): 1285 (MainView::flip): 1286 (MainWindow::setWaitCursor): 1287 (MainWindow::resetCursor): 1288 (MainWindow::buildUI): 1289 1290 2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org> 1291 1292 Rubberstamped by Adam Barth. 1293 1294 Remove clipRenderToViewport as agreed upon in 1295 https://bugs.webkit.org/show_bug.cgi?id=29843 1296 1297 * Api/qwebframe.cpp: 1298 * Api/qwebframe.h: 1299 * Api/qwebframe_p.h: 1300 (QWebFramePrivate::QWebFramePrivate): 1301 1302 2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org> 1303 1304 Reviewed by Adam Barth. 1305 1306 Update the tests to test the new render functionality, and take 1307 into consideration that render() clips to the frame itself as well 1308 as the viewport. 1309 1310 QWebFrame::render() now always clips, so the old tests were bogus. 1311 1312 Rendering pure contents (no scrollbars etc) without clipping can now 1313 be accomplished using QWebFrame::documentElement()->render(...) 1314 1315 * Api/qwebframe.cpp: 1316 * Api/qwebframe.h: 1317 * Api/qwebframe_p.h: 1318 (QWebFramePrivate::QWebFramePrivate): 1319 * tests/qwebframe/tst_qwebframe.cpp: 1320 1321 2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org> 1322 1323 Rubberstamped by Adam Barth. 1324 1325 As we do not support rendering a QWebFrame without it being clipped 1326 the the frame as well as the viewport, we now set the viewport size 1327 to the size of the contents. 1328 1329 Rendering pure contents (no scrollbars etc) without clipping can be 1330 acomplished using QWebFrame::documentElement()->render(...) 1331 1332 * tests/qwebelement/tst_qwebelement.cpp: 1333 (tst_QWebElement::render): 1334 1335 2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org> 1336 1337 Reviewed by Tor Arne VestbÞ. 1338 1339 Add menu item to dump the plugin list to the console, 1340 which can be handy for debugging. 1341 1342 * QtLauncher/main.cpp: 1343 (MainWindow::dumpPlugins): 1344 (MainWindow::setupUI): 1345 1346 2009-10-19 Kenneth Rohde Christiansen <kenneth@webkit.org> 1347 1348 Reviewed by Tor Arne VestbÞ. 1349 1350 Introduce new render method on QWebFrame, which supports specifying 1351 which layers to render (scrollbars, contents, pan-icon). 1352 1353 * Api/qwebframe.cpp: 1354 (QWebFramePrivate::renderPrivate): 1355 (QWebFrame::render): 1356 * Api/qwebframe.h: 1357 * Api/qwebframe_p.h: 1358 1359 2009-10-19 Antonio Gomes <tonikitoo@webkit.org> 1360 1361 Reviewed by Ariya Hidayat. 1362 1363 [Qt] Infinite loop (leading to crash) when setting cursor in QGraphicsWebView 1364 https://bugs.webkit.org/show_bug.cgi?id=30549 1365 1366 Patch reimplements QGraphicsItem's itemChange method, and make 1367 CursorChange event to be emitted after cursor has already been 1368 set. 1369 1370 QWidget::setCursor send the event just after it sets the cursor, 1371 then patch makes both behaviors compatible. 1372 1373 * Api/qgraphicswebview.cpp: 1374 (QGraphicsWebView::itemChange): 1375 * Api/qgraphicswebview.h: 1376 1377 2009-10-19 Nate Chapin <japhet@chromium.org> 1378 1379 Unreviewed, build fix. 1380 1381 Update call to FrameLoader::loadFrameRequest(). 1382 1383 * Api/qwebpage.cpp: 1384 (QWebPage::triggerAction): 1385 1386 2009-10-19 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com> 1387 1388 Reviewed by Ariya Hidayat. 1389 1390 Add QWebElement::render API which allows rendering of single 1391 element. 1392 1393 * Api/qwebelement.cpp: 1394 (QWebElement::render): 1395 * Api/qwebelement.h: 1396 * tests/qwebelement/tst_qwebelement.cpp: 1397 (tst_QWebElement::render): 1398 * tests/qwebelement/qwebelement.qrc: 1399 * tests/qwebelement/image.png: Added. 1400 1401 2009-10-19 Markus Goetz <Markus.Goetz@nokia.com> 1402 1403 Reviewed by Ariya Hidayat. 1404 1405 QWebPage: Doc: setNetworkAccessManager should only be called once. 1406 1407 * Api/qwebpage.cpp: 1408 1409 2009-10-19 Antonio Gomes <tonikitoo@webkit.org> 1410 1411 Reviewed by Tor Arne. 1412 1413 Wrong ifdef combination in QGraphicsWebView's event method. 1414 1415 * Api/qgraphicswebview.cpp: 1416 (QGraphicsWebView::event): 1417 1418 2009-10-19 Girish Ramakrishnan <girish@forwardbias.in> 1419 1420 Reviewed by Holger Freyther. 1421 1422 [Qt] Windowed Plugins: Don't crash when client is 0. 1423 1424 Client is 0 when we use QWebPage without a QWebView or QGraphicsWebView. 1425 In addition, setFrameRect()/updatePluginWidget() is called even if the 1426 plugin was not succesfully loaded. updatePluginWidget() updates the 1427 window rect which is, in theory, useful to draw something that indicates 1428 that we didn't load successfully. 1429 1430 So, a status check is added to setNPWindowIfNeeded. 1431 1432 https://bugs.webkit.org/show_bug.cgi?id=30380 1433 1434 * tests/qwebpage/qwebpage.pro: 1435 * tests/qwebpage/tst_qwebpage.cpp: 1436 (takeScreenshot): 1437 (tst_QWebPage::screenshot_data): 1438 (tst_QWebPage::screenshot): 1439 * tests/resources/test.swf: Copied from LayoutTests/fast/replaced/resources/test.swf. 1440 1441 2009-10-19 Girish Ramakrishnan <girish@forwardbias.in> 1442 1443 Reviewed by Holger Freyther. 1444 1445 [Qt] Windowed Plugins: Fix crash when QWebPage is deleted after QWebView. 1446 1447 Fixes various sources of crashes: 1448 1. The PluginContainer is a child of QWebView. When the view gets deleted, 1449 the PluginView is not notified about the deletion of PluginContainer. 1450 2. QWebView destructor does not set client to 0. 1451 3. Sometimes pending paint events are sent after the plugin has died, so add 1452 a check in PluginView::setNPWindowIfNeeded. 1453 1454 https://bugs.webkit.org/show_bug.cgi?id=30354 1455 1456 * Api/qwebview.cpp: 1457 (QWebView::~QWebView): 1458 * tests/qwebview/qwebview.pro: 1459 * tests/qwebview/tst_qwebview.cpp: 1460 (tst_QWebView::reusePage_data): 1461 (tst_QWebView::reusePage): 1462 1463 2009-10-19 Jakob Truelsen <antialize@gmail.com> 1464 1465 Reviewed by Adam Barth. 1466 1467 https://bugs.webkit.org/show_bug.cgi?id=29042 1468 1469 Allow one to costumize the minimal and maximal shrink factors, 1470 Added methods setPrintingMinimumShrinkFactor, printingMinimumShrinkFactor, 1471 setPrintingMaximumShrinkFactor, printingMaximumShrinkFactor to QWebSettings. 1472 1473 1474 * Api/qwebsettings.cpp: 1475 (QWebSettingsPrivate::apply): 1476 (QWebSettings::QWebSettings): 1477 (QWebSettings::setPrintingMinimumShrinkFactor): 1478 (QWebSettings::printingMinimumShrinkFactor): 1479 (QWebSettings::setPrintingMaximumShrinkFactor): 1480 (QWebSettings::printingMaximumShrinkFactor): 1481 * Api/qwebsettings.h: 1482 1483 2009-10-18 Kenneth Rohde Christiansen <kenneth@webkit.org> 1484 1485 Reviewed by Simon Hausmann. 1486 1487 Rename fixedContentsSize property to preferredContentsSize as 1488 agreed upon with Simon Hausmann and Matthias Ettrich. 1489 1490 * Api/qwebpage.cpp: 1491 (QWebPage::preferredContentsSize): 1492 (QWebPage::setPreferredContentsSize): 1493 * Api/qwebpage.h: 1494 * WebCoreSupport/FrameLoaderClientQt.cpp: 1495 (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): 1496 1497 2009-10-16 Antonio Gomes <tonikitoo@webkit.org> 1498 1499 Reviewed by Simon Hausmann. 1500 1501 [Qt] QGLauncher leaks WebPage object 1502 https://bugs.webkit.org/show_bug.cgi?id=30465 1503 1504 Make 'SharedScene' to own 'WebPage' reference and delete it at its destructor. 1505 1506 * Api/qwebpage.cpp: 1507 (QWebPage::view): 1508 * Api/qwebpage_p.h: 1509 * QGVLauncher/main.cpp: 1510 (SharedScene::SharedScene): 1511 (SharedScene::~SharedScene): 1512 1513 2009-10-16 Antonio Gomes <tonikitoo@webkit.org> 1514 1515 Reviewed by Simon Hausmann. 1516 1517 [Qt] "dangling" pointer to qwebpage's view object can leads QGLauncher to crash 1518 https://bugs.webkit.org/show_bug.cgi?id=30459 1519 1520 Remove all setView(ev->widget()) calls in QWebPage and QGWV event handling methods, 1521 since QWebPageClient would do the trick. 1522 1523 * Api/qgraphicswebview.cpp: 1524 (QGraphicsWebView::hoverMoveEvent): 1525 * Api/qwebpage.cpp: 1526 (QWebPagePrivate::mouseMoveEvent): 1527 (QWebPagePrivate::mousePressEvent): 1528 (QWebPagePrivate::mouseDoubleClickEvent): 1529 (QWebPagePrivate::mouseReleaseEvent): 1530 (QWebPagePrivate::wheelEvent): 1531 (QWebPagePrivate::dragEnterEvent): 1532 (QWebPagePrivate::dragLeaveEvent): 1533 (QWebPagePrivate::dragMoveEvent): 1534 1535 2009-10-16 Tor Arne VestbÞ <tor.arne.vestbo@nokia.com> 1536 1537 Pull out r49676 as it caused build breakges on Symbian 1538 1539 * Api/qwebpage.cpp: 1540 1541 2009-10-16 Yael Aharon <yael.aharon@nokia.com> 1542 1543 Reviewed by Tor Arne VestbÞ. 1544 1545 [Qt] Need a way to inform the application when a Netscape plugin is created or deleted 1546 https://bugs.webkit.org/show_bug.cgi?id=30179 1547 1548 Added "c" style static methods for the application to hook up for 1549 receiving notifications when a plugin is created or destroyed. 1550 1551 * Api/qwebpage.cpp: 1552 1553 2009-10-15 Antonio Gomes <tonikitoo@webkit.org> 1554 1555 Rubberstamped by Tor Arne. 1556 1557 Make QGLauncher's WebPage class constructor to get a QObject* as parent (not QWidget*). 1558 1559 * QGVLauncher/main.cpp: 1560 (WebPage::WebPage): 1561 1562 2009-10-15 Antonio Gomes <tonikitoo@webkit.org> 1563 1564 Reviewed by Tor Arne. 1565 1566 [Qt] QGLauncher crashes while closing a window 1567 https://bugs.webkit.org/show_bug.cgi?id=30385 1568 1569 Set page's pageClient reference to '0' at QGWV deletion. 1570 1571 * Api/qgraphicswebview.cpp: 1572 (QGraphicsWebView::~QGraphicsWebView): 1573 * tests/qgraphicswebview/tst_qgraphicswebview.cpp: 1574 (WebPage::WebPage): 1575 (WebPage::aborting): 1576 (tst_QGraphicsWebView::crashOnViewlessWebPages): 1577 1578 2009-10-13 Antonio Gomes <tonikitoo@webkit.org> 1579 1580 Reviewed by Simon Hausmann. 1581 1582 [Qt] Make context menu to work in QGraphicsWebView 1583 https://bugs.webkit.org/show_bug.cgi?id=30336 1584 1585 * Api/qgraphicswebview.cpp: 1586 (QGraphicsWebView::event): 1587 1588 2009-10-13 Girish Ramakrishnan <girish@forwardbias.in> 1589 1590 Reviewed by Simon Hausmann. 1591 1592 [Qt] Plugins : Remove all traces of winId. Use ownerWidget() instead. 1593 1594 This is a bug for two reasons: 1595 1. Everytime we use winId(), we end up creating a native widget. This causes an 1596 unnecessary copy of contents from the backing store to the native widget. 1597 2. Neither windowed nor windowless plugins require the winId of the QWebView or 1598 QGraphicsView. 1599 1600 Introduce ownerWidget() which returns a QWidget * without creating a native widget 1601 (as opposed to QWidget::find(winId)). 1602 1603 https://bugs.webkit.org/show_bug.cgi?id=30170 1604 1605 * Api/qgraphicswebview.cpp: 1606 (QGraphicsWebViewPrivate::ownerWidget): 1607 * Api/qwebview.cpp: 1608 (QWebViewPrivate::ownerWidget): 1609 1610 2009-10-13 Antonio Gomes <tonikitoo@webkit.org> 1611 1612 Reviewed by Simon Hausmann. 1613 1614 [Qt] Add some initial autotests for QWebPage's ErrorPageExtention 1615 https://bugs.webkit.org/show_bug.cgi?id=30296 1616 1617 * tests/qwebpage/tst_qwebpage.cpp: 1618 (ErrorPage::ErrorPage): 1619 (ErrorPage::supportsExtension): 1620 (ErrorPage::extension): 1621 (tst_QWebPage::errorPageExtension): 1622 1623 2009-10-13 Antonio Gomes <tonikitoo@webkit.org> 1624 1625 Reviewed by Simon Hausmann. 1626 1627 [Qt] better handle possible edge cases on qwebframe::requestedUrl use 1628 https://bugs.webkit.org/show_bug.cgi?id=30216 1629 1630 QWebFrame::requestedUrl can be called at any time during the load 1631 process, including: 1632 1633 * An error handling (whereas an alternate error page for unsuccessful 1634 load is being set); 1635 * A ssl error exception call; 1636 * During navigation notifications/callbacks (titleChanged, urlChanged, 1637 progresses, addHistoryEntry, etc); 1638 * Among others. 1639 1640 This patch makes requestedUrl calls to fallback to FrameLoaderClient 1641 m_loadError's failingURL when an error has occurred, unless it is 1642 null/empty. 1643 1644 Also, m_loadError is now being reset at each the main frame starts a 1645 load, in order to avoid previous load errors footprints. 1646 1647 * Api/qwebframe.cpp: 1648 (QWebFrame::requestedUrl): 1649 * WebCoreSupport/FrameLoaderClientQt.cpp: 1650 (WebCore::FrameLoaderClientQt::postProgressStartedNotification): 1651 1652 2009-10-12 Jakub Wieczorek <faw217@gmail.com> 1653 1654 Reviewed by Simon Hausmann. 1655 1656 [Qt] Missing default value for the default text encoding. 1657 https://bugs.webkit.org/show_bug.cgi?id=30311 1658 1659 QtWebKit has provided a default, hardcoded value for default charset but since 1660 the addition of the defaultTextEncoding setting in QWebSettings, that hardcoded 1661 value has had no effect. 1662 1663 Added a regression test and unskipped fast/dom/Document/document-charset.html, 1664 which is passing now. 1665 1666 * Api/qwebpage.cpp: 1667 (QWebPagePrivate::QWebPagePrivate): 1668 * Api/qwebsettings.cpp: 1669 (QWebSettings::QWebSettings): 1670 * tests/qwebpage/tst_qwebpage.cpp: 1671 (tst_QWebPage::defaultTextEncoding): 1672 1673 2009-10-12 Kenneth Rohde Christiansen <kenneth@webkit.org> 1674 1675 Reviewed by Simon Hausmann. 1676 1677 Implement the new palette() methods on the page clients 1678 1679 * Api/qgraphicswebview.cpp: 1680 (QGraphicsWebViewPrivate::palette): 1681 * Api/qwebview.cpp: 1682 (QWebViewPrivate::palette): 1683 1684 2009-10-12 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 1685 1686 Reviewed by Simon Hausmann. 1687 1688 QWebPage's createViewlessPlugin autotest crash fix. 1689 1690 It is possible that plugins that are QWidgets or QGraphicsWidgets 1691 are created before a view has been assigned to a QWebPage. The 1692 plug-ins won't be fully functional, as by design, they should 1693 visualise something, but they won't crash and will stay in memory. 1694 1695 An autotest that covers this use-case, is included. 1696 1697 https://bugs.webkit.org/show_bug.cgi?id=30118 1698 1699 * WebCoreSupport/FrameLoaderClientQt.cpp: 1700 (WebCore::FrameLoaderClientQt::createPlugin): 1701 * tests/qwebpage/tst_qwebpage.cpp: 1702 (PluginTrackedPageWidget::PluginTrackedPageWidget): 1703 (PluginTrackedPageGraphicsWidget::PluginTrackedPageGraphicsWidget): 1704 (PluginTrackedPageGraphicsWidget::createPlugin): 1705 (tst_QWebPage::destroyPlugin): 1706 (tst_QWebPage::createViewlessPlugin): 1707 1708 2009-10-09 Joe Ligman <joseph.ligman@nokia.com> 1709 1710 Reviewed by Simon Hausmann. 1711 1712 Sets Qt::WA_InputMethodEnabled and Qt::ImhHiddenText for password fields in EditorClientQt 1713 setInputMethodState. This change is needed so widgets such as the s60 software 1714 input panel can receive input method events for password fields. 1715 It's up to the Qt platform to determine which widget will receive input method 1716 events when these flags are set. 1717 Also added implementation for setInputMethodEnabled and setInputMethodHint 1718 to QGraphicsWebViewPrivate and QWebViewPrivate. This change removes the direct 1719 dependency on QWebView and uses QWebPageClient. 1720 Added autotest to tst_qwebpage.cpp 1721 https://bugs.webkit.org/show_bug.cgi?id=30023 1722 1723 * Api/qgraphicswebview.cpp: 1724 (QGraphicsWebViewPrivate::setInputMethodEnabled): 1725 (QGraphicsWebViewPrivate::setInputMethodHint): 1726 * Api/qwebview.cpp: 1727 (QWebViewPrivate::setInputMethodEnabled): 1728 (QWebViewPrivate::setInputMethodHint): 1729 * WebCoreSupport/EditorClientQt.cpp: 1730 (WebCore::EditorClientQt::setInputMethodState): 1731 * tests/qwebpage/tst_qwebpage.cpp: 1732 (tst_QWebPage::inputMethods): 1733 1734 2009-10-08 Adam Barth <abarth@webkit.org> 1735 1736 Reviewed by Eric Seidel. 1737 1738 Move executeScript from FrameLoader to ScriptController 1739 https://bugs.webkit.org/show_bug.cgi?id=30200 1740 1741 Update API call. 1742 1743 * Api/qwebframe.cpp: 1744 (QWebFrame::evaluateJavaScript): 1745 1746 2009-10-08 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 1747 1748 Reviewed by Simon Hausmann. 1749 1750 Part of testOptionalJSObjects autotest was marked as "expect to fail". 1751 1752 Two places in tst_QWebPage::testOptionalJSObjects were marked as 1753 expected to fail. The problem concern checking if a feature is enabled 1754 or disabled. According to discussion on webkit dev mailing list 1755 a disabled feature should be invisible from java script level, but 1756 there are exceptions from the rule. So we decided to disable the test 1757 for now. 1758 1759 https://bugs.webkit.org/show_bug.cgi?id=29867 1760 1761 * tests/qwebpage/tst_qwebpage.cpp: 1762 (tst_QWebPage::testOptionalJSObjects): 1763 1764 2009-10-07 Adam Barth <abarth@webkit.org> 1765 1766 Reviewed by Darin Adler. 1767 1768 Factor PolicyChecker out of FrameLoader 1769 https://bugs.webkit.org/show_bug.cgi?id=30155 1770 1771 Move the policy callback to the policy object. 1772 1773 * WebCoreSupport/FrameLoaderClientQt.cpp: 1774 (WebCore::FrameLoaderClientQt::callPolicyFunction): 1775 1776 2009-10-07 Antonio Gomes <tonikitoo@webkit.org> 1777 1778 Reviewed by Simon Hausmann. 1779 1780 [Qt] Get rid of useless loadFailed signal in QGraphicsWebView 1781 https://bugs.webkit.org/show_bug.cgi?id=30166 1782 1783 * Api/qgraphicswebview.cpp: 1784 (QGraphicsWebViewPrivate::_q_doLoadFinished): 1785 * Api/qgraphicswebview.h: 1786 * QGVLauncher/main.cpp: 1787 (MainWindow::init): 1788 (MainWindow::loadFinished): 1789 1790 2009-10-07 Girish Ramakrishnan <girish@forwardbias.in> 1791 1792 Reviewed by Simon Hausmann. 1793 1794 Add a simple rotation effect to QGVLauncher 1795 1796 https://bugs.webkit.org/show_bug.cgi?id=30162 1797 1798 * QGVLauncher/main.cpp: 1799 (MainView::animatedFlip): 1800 (MainWindow::animatedFlip): 1801 (MainWindow::buildUI): 1802 1803 2009-10-07 Volker Hilsheimer <volker.hilsheimer@nokia.com> 1804 1805 Reviewed by Simon Hausmann. 1806 1807 Doc: Document HTML and status as properties. 1808 1809 * Api/qgraphicswebview.cpp: 1810 1811 2009-10-07 Martin Smith <msmith@trolltech.com> 1812 1813 Reviewed by Simon Hausmann. 1814 1815 Fix qdoc warning about disabled renderHints property 1816 on Symbian. 1817 1818 * Api/qwebview.cpp: 1819 * Api/qwebview.h: 1820 1821 2009-10-06 Adam Barth <abarth@webkit.org> 1822 1823 Reviewed by Eric Seidel. 1824 1825 Move setLocalLoadPolicy and friends to SecurityOrigin 1826 https://bugs.webkit.org/show_bug.cgi?id=30110 1827 1828 Call the new API. 1829 1830 * Api/qwebpage.cpp: 1831 (QWebPagePrivate::QWebPagePrivate): 1832 1833 2009-10-06 Benjamin C Meyer <bmeyer@rim.com> 1834 1835 Reviewed by Ariya Hidayat. 1836 1837 When the drag data contains an image set it on the QDrag so it will be visible to the user. 1838 1839 * WebCoreSupport/DragClientQt.cpp: 1840 (WebCore::DragClientQt::startDrag): 1841 1842 2009-10-06 Pavel Feldman <pfeldman@chromium.org> 1843 1844 Reviewed by Timothy Hatcher. 1845 1846 Web Inspector: close inspector client view on 1847 InspectorController::close API call. 1848 1849 In order to run batch web inspector layout tests (and not affect 1850 subsequent tests) we should close inspector client's view upon 1851 InspectorController::close API call. 1852 1853 https://bugs.webkit.org/show_bug.cgi?id=30009 1854 1855 * WebCoreSupport/InspectorClientQt.cpp: 1856 (WebCore::InspectorClientQt::createPage): 1857 1858 2009-10-06 Janne Koskinen <janne.p.koskinen@digia.com> 1859 1860 Reviewed by Simon Hausmann. 1861 1862 [Qt] don't enable input methods on Symbian by default. 1863 https://bugs.webkit.org/show_bug.cgi?id=30117 1864 1865 If input methods are enabled Symbian FEP will be launched on every 1866 pointer event making webpage navigation impossible with QWebView. 1867 1868 * Api/qwebview.cpp: 1869 (QWebView::QWebView): 1870 1871 2009-10-05 Holger Hans Peter Freyther <zecke@selfish.org> 1872 1873 Reviewed by Simon Hausmann. 1874 1875 QtLauncher: print the number of loaded urls 1876 1877 When using the -r mode print the number of URLs loaded so far. This 1878 is extremly useful when opening the same URL over and over again and 1879 one wants to see the progress. 1880 1881 * QtLauncher/main.cpp: 1882 (URLLoader::URLLoader): 1883 (URLLoader::loadNext): 1884 1885 2009-10-05 Girish Ramakrishnan <girish@forwardbias.in> 1886 1887 Reviewed by Simon Hausmann. 1888 1889 Add screenshot option to menubar 1890 1891 https://bugs.webkit.org/show_bug.cgi?id=30067 1892 1893 * QtLauncher/main.cpp: 1894 (MainWindow::screenshot): 1895 (MainWindow::setupUI): 1896 1897 2009-10-05 Girish Ramakrishnan <girish@forwardbias.in> 1898 1899 Reviewed by Simon Hausmann. 1900 1901 Setting the env QTLAUNCHER_USE_ARGB_VISUALS makes Qt use WA_TranslucentWindow. 1902 1903 https://bugs.webkit.org/show_bug.cgi?id=30068 1904 1905 * QtLauncher/main.cpp: 1906 (MainWindow::MainWindow): 1907 1908 2009-10-05 Kenneth Rohde Christiansen <kenneth@webkit.org> 1909 1910 Rubberstamped by Simon Hausmann. 1911 1912 Add documentation to the ErrorPageExtension. 1913 1914 * Api/qwebpage.cpp: 1915 1916 2009-10-02 Yael Aharon <yael.aharon@nokia.com> 1917 1918 Reviewed by Simon Hausmann. 1919 1920 [Qt] Inform the application when a new request is created 1921 https://bugs.webkit.org/show_bug.cgi?id=29975 1922 1923 Add a signal to QWebPage, to inform the application when a request is created. 1924 1925 * Api/qwebpage.cpp: 1926 * Api/qwebpage.h: 1927 * tests/qwebpage/tst_qwebpage.cpp: 1928 (tst_QWebPage::loadFinished): 1929 1930 2009-10-05 Kenneth Rohde Christiansen <kenneth@webkit.org> 1931 1932 Reviewed by Simon Hausmann. 1933 1934 ErrorPageExtension: Add a pointer to the QWebFrame that had 1935 an error. 1936 1937 * Api/qwebpage.h: 1938 * WebCoreSupport/FrameLoaderClientQt.cpp: 1939 (WebCore::FrameLoaderClientQt::callErrorPageExtension): 1940 1941 2009-10-05 Kenneth Rohde Christiansen <kenneth@webkit.org> 1942 1943 Reviewed by Tor Arne VestbÞ. 1944 1945 Do not empty the offline web appcache when clearing 1946 memory caches. That one is not in memory, but stored 1947 in sqlite. 1948 1949 * Api/qwebsettings.cpp: 1950 (QWebSettings::clearMemoryCaches): 1951 1952 2009-10-05 J-P Nurmi <jpnurmi@gmail.com> 1953 1954 Reviewed by Simon Hausmann. 1955 1956 Added QGraphicsWidget-plugins support to FrameLoaderClientQt. 1957 1958 https://bugs.webkit.org/show_bug.cgi?id=29710 1959 1960 * Api/qgraphicswebview.cpp: 1961 (QGraphicsWebViewPrivate::pluginParent): 1962 * Api/qwebview.cpp: 1963 (QWebViewPrivate::pluginParent): 1964 * WebCoreSupport/FrameLoaderClientQt.cpp: 1965 (WebCore::): 1966 (WebCore::FrameLoaderClientQt::createPlugin): 1967 1968 2009-10-03 Adam Barth <abarth@webkit.org> 1969 1970 Unreview build fix. I wish I had a try server... 1971 1972 * Api/qwebpage.cpp: 1973 (QWebPagePrivate::updateAction): 1974 1975 2009-10-02 Norbert Leser <norbert.leser@nokia.com> 1976 1977 Reviewed by Simon Hausmann. 1978 1979 Conditionally guard cursor code (cursor and updateCursor functions) with !QT_NO_CURSOR. 1980 Otherwise, it is inconsistent with class declaration of QCursor. 1981 1982 * Api/qgraphicswebview.cpp: 1983 * Api/qwebview.cpp: 1984 1985 2009-10-02 Prasanth Ullattil <prasanth.ullattil@nokia.com> 1986 1987 Reviewed by Simon Hausmann. 1988 1989 Fix compiler warnings about unused function arguments. 1990 1991 * Api/qwebframe.cpp: 1992 (QWebFrame::scrollBarMinimum): 1993 * Api/qwebpage.cpp: 1994 (QWebPagePrivate::focusInEvent): 1995 (QWebPagePrivate::focusOutEvent): 1996 (QWebPagePrivate::leaveEvent): 1997 (QWebPage::javaScriptAlert): 1998 (QWebPage::javaScriptConfirm): 1999 (QWebPage::javaScriptPrompt): 2000 (QWebPage::triggerAction): 2001 (QWebPage::acceptNavigationRequest): 2002 (QWebPage::chooseFile): 2003 * WebCoreSupport/ChromeClientQt.cpp: 2004 (WebCore::ChromeClientQt::repaint): 2005 (WebCore::ChromeClientQt::mouseDidMoveOverElement): 2006 (WebCore::ChromeClientQt::reachedMaxAppCacheSize): 2007 * WebCoreSupport/ContextMenuClientQt.cpp: 2008 (WebCore::ContextMenuClientQt::downloadURL): 2009 * WebCoreSupport/FrameLoaderClientQt.cpp: 2010 (WebCore::FrameLoaderClientQt::dispatchWillPerformClientRedirect): 2011 (WebCore::FrameLoaderClientQt::setMainFrameDocumentReady): 2012 (WebCore::FrameLoaderClientQt::representationExistsForURLScheme): 2013 (WebCore::FrameLoaderClientQt::generatedMIMETypeForURLScheme): 2014 (WebCore::FrameLoaderClientQt::shouldGoToHistoryItem): 2015 (WebCore::FrameLoaderClientQt::pluginWillHandleLoadError): 2016 (WebCore::FrameLoaderClientQt::assignIdentifierToInitialRequest): 2017 (WebCore::FrameLoaderClientQt::dispatchDidFinishLoading): 2018 (WebCore::FrameLoaderClientQt::createJavaAppletWidget): 2019 * WebCoreSupport/InspectorClientQt.cpp: 2020 (WebCore::InspectorClientQt::setAttachedWindowHeight): 2021 (WebCore::InspectorClientQt::highlight): 2022 (WebCore::InspectorClientQt::removeSetting): 2023 2024 2009-10-01 Simon Hausmann <simon.hausmann@nokia.com> 2025 2026 Reviewed by Tor Arne VestbÞ. 2027 2028 Make Software Input Panel requests work with QGraphicsWebView 2029 _and_ QWebView by sharing the event code in handleSoftwareInputPanel(). 2030 2031 * Api/qwebpage.cpp: 2032 (QWebPagePrivate::mouseReleaseEvent): 2033 (QWebPagePrivate::handleSoftwareInputPanel): 2034 * Api/qwebpage_p.h: 2035 2036 2009-10-01 Alexis Menard <alexis.menard@nokia.com> 2037 2038 Reviewed by Tor Arne VestbÞ. 2039 2040 Rename QWebGraphicsItem to QGraphicsWebView 2041 2042 * Api/headers.pri: 2043 * Api/qwebpage.h: 2044 * Api/qwebgraphicsitem.cpp: Renamed. 2045 * Api/qwebgraphicsitem.h: Renamed. 2046 * WebKit/qt/QGVLauncher/main.cpp: 2047 * tests/tests.pro: 2048 * tests/qwebgraphicsitem/qwebgraphicsitem.pro: Renamed. 2049 * tests/qwebgraphicsitem/tst_qwebgraphicsitem.cpp: Renamed. 2050 2051 2009-10-01 Antonio Gomes <tonikitoo@webkit.org> 2052 2053 Reviewed by Simon Hausmann. 2054 2055 https://bugs.webkit.org/show_bug.cgi?id=29248 2056 [Qt] [API] Make it possible to have 'invisible' loads 2057 2058 Make QWebFrame's setHtml and setContent methods to not change 2059 session and global history at all. 2060 2061 * Api/qwebframe.cpp: 2062 (QWebFrame::setHtml): 2063 (QWebFrame::setContent): 2064 * tests/qwebframe/qwebframe.pro: 2065 * tests/qwebframe/tst_qwebframe.cpp: 2066 2067 2009-10-01 Kristian Amlie <kristian.amlie@nokia.com> 2068 2069 Reviewed by Simon Hausmann. 2070 2071 Fixed software input panel support on web input elements. 2072 2073 Send the RequestSoftwareInputPanel event if the element supports focus 2074 and the element is clicked. 2075 2076 * Api/qwebpage.cpp: 2077 (QWebPagePrivate::QWebPagePrivate): 2078 (QWebPagePrivate::mousePressEvent): 2079 (QWebPagePrivate::mouseReleaseEvent): 2080 * Api/qwebpage_p.h: 2081 2082 2009-10-01 Joe Ligman <joseph.ligman@nokia.com> 2083 2084 Reviewed by Simon Hausmann. 2085 2086 Implementation for QWebPage::inputMethodQuery and QWebPagePrivate::inputMethodEvent 2087 2088 https://bugs.webkit.org/show_bug.cgi?id=29681 2089 2090 Some additional changes from Kristian Amlie <kristian.amlie@nokia.com>: 2091 2092 * Fixed surrounding text to exclude preedit string 2093 * Avoid emission of microFocusChanged during setComposition() 10 2094 11 2095 * Api/qwebpage.cpp: 12 2096 (QWebPagePrivate::inputMethodEvent): 13 14 2009-03-30 Simon Hausmann <simon.hausmann@nokia.com> 15 16 Rubber-stamped by Tor Arne VestbÞ. 17 18 Document that setHtml/setContent loads only the html/data immediately, not external objects. 19 20 * Api/qwebframe.cpp: 2097 (QWebPage::inputMethodQuery): 2098 * WebCoreSupport/EditorClientQt.cpp: 2099 (WebCore::EditorClientQt::respondToChangedSelection): 2100 * tests/qwebpage/tst_qwebpage.cpp: 2101 (tst_QWebPage::inputMethods): 2102 2103 2009-09-30 Kenneth Rohde Christiansen <kenneth@webkit.org> 2104 2105 Reviewed by David Hyatt. 2106 2107 Add the failed URL to the ErrorPageExtension, as it is quite 2108 useful for creating error pages. 2109 2110 * Api/qwebpage.h: 2111 * WebCoreSupport/FrameLoaderClientQt.cpp: 2112 (WebCore::FrameLoaderClientQt::callErrorPageExtension): 2113 2114 2009-09-29 Andras Becsi <becsi.andras@stud.u-szeged.hu> 2115 2116 Reviewed by Tor Arne VestbÞ. 2117 2118 [Qt] Default font size reconciliation to 16px/13px to match other platform's de-facto standard. 2119 This fixes https://bugs.webkit.org/show_bug.cgi?id=19674. 2120 2121 * Api/qwebsettings.cpp: 2122 (QWebSettings::QWebSettings): 2123 2124 2009-09-29 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 2125 2126 Reviewed by Simon Hausmann. 2127 2128 https://bugs.webkit.org/show_bug.cgi?id=29844 2129 2130 QWebPage dependency autotest fix. 2131 2132 Fix for database() autotest. All opened databases should be removed at 2133 end of test. 2134 2135 * tests/qwebpage/tst_qwebpage.cpp: 2136 (tst_QWebPage::database): 2137 2138 2009-09-29 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 2139 2140 Reviewed by Simon Hausmann. 2141 2142 Some QWebHistory and QWebPage autotest crash fixes. 2143 2144 Some checking for m_mainFrame were added. MainFrame should be created 2145 at some point of QWebPage live cicle. 2146 2147 https://bugs.webkit.org/show_bug.cgi?id=29803 2148 2149 * Api/qwebpage.cpp: 2150 (QWebPage::~QWebPage): 2151 (QWebPage::currentFrame): 2152 (QWebPage::history): 2153 (QWebPage::selectedText): 2154 (QWebPage::updatePositionDependentActions): 2155 * tests/qwebpage/tst_qwebpage.cpp: 2156 (tst_QWebPage::crashTests_LazyInitializationOfMainFrame): 2157 2158 2009-09-29 Kenneth Rohde Christiansen <kenneth@webkit.org> 2159 2160 Reviewed by Simon Hausmann and Tor Arne VestbÞ. 2161 2162 Implement QWebPage Extension for error pages, incl. 2163 an example on how to use it in QtLauncher. 2164 2165 Correct our use of ResourceError. 2166 2167 * Api/qwebpage.h: 2168 (ExtensionOption::): 2169 (ExtensionOption::ErrorPageExtensionReturn::ErrorPageExtensionReturn): 2170 * QtLauncher/main.cpp: 2171 (WebPage::supportsExtension): 2172 (MainWindow::MainWindow): 2173 (MainWindow::selectElements): 2174 (WebPage::extension): 2175 * WebCoreSupport/FrameLoaderClientQt.cpp: 2176 (WebCore::FrameLoaderClientQt::cancelledError): 2177 (WebCore::FrameLoaderClientQt::blockedError): 2178 (WebCore::FrameLoaderClientQt::cannotShowURLError): 2179 (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError): 2180 (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError): 2181 (WebCore::FrameLoaderClientQt::fileDoesNotExistError): 2182 (WebCore::FrameLoaderClientQt::callErrorPageExtension): 2183 (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad): 2184 (WebCore::FrameLoaderClientQt::dispatchDidFailLoad): 2185 * WebCoreSupport/FrameLoaderClientQt.h: 2186 2187 2009-09-28 Andre Poenitz <andre.poenitz@trolltech.com> 2188 2189 Reviewed by Simon Hausmann. 2190 2191 Compile fix with namespaced Qt. 2192 2193 * Api/qwebinspector_p.h: 2194 2195 2009-09-27 Joe Ligman <joseph.ligman@mindspring.com> 2196 2197 Reviewed by Simon Hausmann. 2198 2199 [Qt] Adding API setFocus and hasFocus to QWebElement. This API is needed for 2200 clients that want to check/set the focus node of the document. 2201 https://bugs.webkit.org/show_bug.cgi?id=29682 2202 2203 * Api/qwebelement.cpp: 2204 (QWebElement::hasFocus): 2205 (QWebElement::setFocus): 2206 * Api/qwebelement.h: 2207 * tests/qwebelement/tst_qwebelement.cpp: 2208 (tst_QWebElement::hasSetFocus): 2209 2210 2009-09-25 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 2211 2212 Reviewed by Simon Hausmann. 2213 2214 [Qt] Make tst_qwebframe work if Qt built without SSL support 2215 https://bugs.webkit.org/show_bug.cgi?id=29735 2216 2217 * tests/qwebframe/tst_qwebframe.cpp: Missing #ifndef blocks added. 2218 2219 2009-09-24 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2220 2221 Reviewed by Simon Hausmann. 2222 2223 [Qt] Update QWebElement API to remove script related methods. 2224 QWebElement::evaluateScript is the only one kept, these are 2225 removed to postpone most of the QtWebKit<->JavaScript API design 2226 after 4.6. 2227 https://bugs.webkit.org/show_bug.cgi?id=29708 2228 2229 * Api/qwebelement.cpp: 2230 * Api/qwebelement.h: 2231 Methods removed: 2232 - QWebElement::callFunction 2233 - QWebElement::functions 2234 - QWebElement::scriptableProperty 2235 - QWebElement::setScriptableProperty 2236 - QWebElement::scriptableProperties 2237 * tests/qwebelement/tst_qwebelement.cpp: 2238 (tst_QWebElement::evaluateScript): 2239 2240 2009-09-25 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2241 2242 Reviewed by Simon Hausmann. 2243 2244 [Qt] Rename QWebElement::evaluateScript 2245 to QWebElement::evaluateJavaScript. 2246 https://bugs.webkit.org/show_bug.cgi?id=29709 2247 2248 * Api/qwebelement.cpp: 2249 (QWebElement::evaluateJavaScript): 2250 * Api/qwebelement.h: 2251 * tests/qwebelement/tst_qwebelement.cpp: 2252 (tst_QWebElement::evaluateJavaScript): 2253 2254 2009-09-25 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2255 2256 Reviewed by Simon Hausmann. 2257 2258 [Qt] Update the stypeProperty API of QWebElement. 2259 https://bugs.webkit.org/show_bug.cgi?id=29711 2260 2261 * Api/qwebelement.cpp: 2262 (QWebElement::styleProperty): 2263 - Merge the stypeProperty and the computedStyleProperty methods 2264 - Remove the default value for the style resolving enum 2265 - Rename ResolveRule to StyleResolveStrategy 2266 (QWebElement::setStyleProperty): 2267 - Remove the priority argument since it is possible to control the 2268 behaviour by adding !important or removing in the value. 2269 * Api/qwebelement.h: 2270 * tests/qwebelement/tst_qwebelement.cpp: 2271 (tst_QWebElement::style): 2272 (tst_QWebElement::computedStyle): 2273 * tests/qwebframe/tst_qwebframe.cpp: 2274 2275 2009-09-24 Jon Honeycutt <jhoneycutt@apple.com> 2276 2277 Reviewed by Alice Liu. 2278 2279 * Api/qwebpage.cpp: 2280 (QWebPagePrivate::QWebPagePrivate): 2281 Pass 0 for new Page constructor argument. 2282 2283 2009-09-24 Martin Smith <msmith@trolltech.com> 2284 2285 Reviewed by Simon Hausmann. 2286 2287 qdoc: Added \brief texts to all the since 4.6 functions. 2288 2289 * Api/qwebhistory.cpp: 2290 2291 2009-09-23 J-P Nurmi <jpnurmi@gmail.com> 2292 2293 Reviewed by Simon Hausmann. 2294 2295 Prevent QWebPage::setView() from changing the viewport size on the fly 2296 in case the view doesn't actually change. QWebPage::setView() is 2297 called upon every QWebGraphicsItem::hoverMoveEvent(), which forced 2298 the viewport size to be equal to the size of the whole graphics view. 2299 2300 https://bugs.webkit.org/show_bug.cgi?id=29676 2301 2302 * Api/qwebpage.cpp: 2303 (QWebPage::setView): 2304 2305 2009-09-23 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 2306 2307 Reviewed by Simon Hausmann. 2308 2309 [Qt] Crash fix in QWebHistory back and forward methods. 2310 2311 QWebHistory::back() and QWebHistory::forward() were crashing on 2312 ASSERT in WebCore::BackForwardList. The methods should check 2313 canGoBack() and canGoForward() at the beginning. 2314 2315 https://bugs.webkit.org/show_bug.cgi?id=29675 2316 2317 * Api/qwebhistory.cpp: 2318 (QWebHistory::back): 2319 (QWebHistory::forward): 2320 2321 2009-09-23 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 2322 2323 Reviewed by Simon Hausmann. 2324 2325 [Qt] Bug fix. QWebHistory should call QWebPage::updateNavigationActions 2326 2327 In QWebHistory's methods that change item count or current item call 2328 to QWebPage::updateNavigationActions should be executed. 2329 QWebHistory::clear() and QWebHistory::restorState() were changed. 2330 New helper method, QWebPagePrivate accesor, were created in 2331 QWebHistoryPrivate class. 2332 Two autotest were developed. 2333 2334 https://bugs.webkit.org/show_bug.cgi?id=29246 2335 2336 * Api/qwebhistory.cpp: 2337 (QWebHistory::clear): 2338 (QWebHistory::restoreState): 2339 (QWebHistoryPrivate::page): 2340 * Api/qwebhistory_p.h: 2341 * tests/qwebhistory/tst_qwebhistory.cpp: 2342 (tst_QWebHistory::saveAndRestore_1): 2343 (tst_QWebHistory::clear): 2344 2345 2009-09-23 Norbert Leser <norbert.leser@nokia.com> 2346 2347 Reviewed by Tor Arne VestbÞ. 2348 2349 Need to guard QX11Info include with Q_WS_X11. 2350 That class may not be available (in QT 4.5 for Symbian, for instance). 2351 Completes fixes in r48627 and r48604. 2352 2353 * Api/qwebgraphicsitem.cpp: 21 2354 * Api/qwebview.cpp: 22 2355 23 2009-03-26 Simon Hausmann <simon.hausmann@nokia.com> 24 25 Rubber-stamped by Tor Arne VestbÞ. 26 27 Fix the documentation of the QLocale usage in userAgentForUrl. 28 29 * Api/qwebpage.cpp: 30 31 2009-03-20 Erik L. Bunce <elbunce@xendom.com> 32 33 Reviewed by Simon Hausmann. 34 35 Fix for InsertParagraphSeparator and InsertLineSeparator so that 36 QWebPage::action() creates QActions for them. Also make sure they get 37 updated appropriately. 38 39 * Api/qwebpage.cpp: 40 (QWebPagePrivate::updateEditorActions): 41 (QWebPage::action): 2356 2009-09-22 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2357 2358 Reviewed by Simon Hausmann. 2359 2360 [Qt] Add default timeout while waiting for signals in QWebPage auto 2361 tests. 2362 https://bugs.webkit.org/show_bug.cgi?id=29637 2363 42 2364 * tests/qwebpage/tst_qwebpage.cpp: 43 (tst_QWebPage::textEditing): 44 45 2009-03-20 Erik L. Bunce <elbunce@xendom.com> 2365 (waitForSignal): 2366 2367 2009-09-22 Tor Arne VestbÞ <tor.arne.vestbo@nokia.com> 2368 2369 Reivewed by Simon Hausmann. 2370 2371 Fix the Qt/Mac build after r48604 (Implement new QWebPageClient class) 2372 2373 There's no QWidget::x11Info() on Mac, and setPlatformPluginWidget() 2374 takes a QWidget*, not a QWebPageClient* 2375 2376 * Api/qwebgraphicsitem.cpp: 2377 (QWebGraphicsItemPrivate::screenNumber): 2378 * Api/qwebview.cpp: 2379 (QWebViewPrivate::screenNumber): 2380 2381 2009-09-21 Kenneth Rohde Christiansen <kenneth@webkit.org> 2382 2383 Reviewed by Simon Hausmann. 2384 2385 For Qt, platformPageClient() will now return a class derived from 2386 the QWebPageClient, so the patch adapts our Qt hooks to go though 2387 this class and not depend on the QWebView. 2388 2389 * Api/qwebgraphicsitem.cpp: 2390 (QWebGraphicsItemPrivate::scroll): 2391 (QWebGraphicsItemPrivate::update): 2392 (QWebGraphicsItemPrivate::cursor): 2393 (QWebGraphicsItemPrivate::updateCursor): 2394 (QWebGraphicsItemPrivate::screenNumber): 2395 (QWebGraphicsItemPrivate::winId): 2396 (QWebGraphicsItem::event): 2397 (QWebGraphicsItem::setPage): 2398 * Api/qwebgraphicsitem.h: 2399 * Api/qwebpage.cpp: 2400 (QWebPagePrivate::QWebPagePrivate): 2401 * Api/qwebpage_p.h: 2402 * Api/qwebview.cpp: 2403 (QWebViewPrivate::scroll): 2404 (QWebViewPrivate::update): 2405 (QWebViewPrivate::cursor): 2406 (QWebViewPrivate::updateCursor): 2407 (QWebViewPrivate::screenNumber): 2408 (QWebViewPrivate::winId): 2409 (QWebView::setPage): 2410 (QWebView::event): 2411 * WebCoreSupport/ChromeClientQt.cpp: 2412 (WebCore::ChromeClientQt::repaint): 2413 (WebCore::ChromeClientQt::scroll): 2414 (WebCore::ChromeClientQt::platformPageClient): 2415 2416 2009-09-21 Yael Aharon <yael.aharon@nokia.com> 2417 2418 Reviewed by Simon Hausmann. 2419 2420 https://bugs.webkit.org/show_bug.cgi?id=29609 2421 Build fix for windows when using Qt 4.5.0. 2422 2423 * Api/qwebpage.cpp: 2424 (QWebPage::userAgentForUrl): 2425 2426 2009-09-19 Benjamin Poulain <benjamin.poulain@nokia.com> 2427 2428 Reviewed by Simon Hausmann. 2429 2430 https://bugs.webkit.org/show_bug.cgi?id=29345 2431 The tests of QWebFrame did not use QTRY_VERIFY for 2432 tests involving the event loop. 2433 2434 * tests/qwebframe/tst_qwebframe.cpp: 2435 * tests/util.h: Added. Copy of tests/shared/util.h of Qt 2436 2437 2009-09-19 Jakub Wieczorek <faw217@gmail.com> 2438 2439 Reviewed by Simon Hausmann. 2440 2441 [Qt] Add an autotest stub for QWebGraphicsItem. 2442 2443 It just calls all the functions and makes sure they don't crash. 2444 2445 * tests/qwebgraphicsitem/qwebgraphicsitem.pro: Added. 2446 * tests/qwebgraphicsitem/tst_qwebgraphicsitem.cpp: Added. 2447 (tst_QWebGraphicsItem::qwebgraphicsitem): 2448 * tests/tests.pro: 2449 2450 2009-09-18 Norbert Leser <norbert.leser@nokia.com> 2451 2452 Reviewed by Eric Seidel. 2453 2454 Corrected the Symbian specific UID3 values to be assigned 2455 from the "unprotected" pool that permits self-signing of 2456 those test and demo executables. (Added new UID3 values 2457 where they were missing for new components.) 2458 2459 * QGVLauncher/QGVLauncher.pro: 2460 * QtLauncher/QtLauncher.pro: 2461 * tests/benchmarks/loading/tst_loading.pro: 2462 * tests/benchmarks/painting/tst_painting.pro: 2463 * tests/qwebelement/qwebelement.pro: 2464 * tests/qwebframe/qwebframe.pro: 2465 * tests/qwebhistory/qwebhistory.pro: 2466 * tests/qwebhistoryinterface/qwebhistoryinterface.pro: 2467 * tests/qwebpage/qwebpage.pro: 2468 * tests/qwebplugindatabase/qwebplugindatabase.pro: 2469 * tests/qwebview/qwebview.pro: 2470 2471 2009-09-17 Kenneth Rohde Christiansen <kenneth@webkit.org> 2472 2473 Reviewed by Simon Hausmann. 2474 2475 Make PlatformWindow return something else than PlatformWidget 2476 https://bugs.webkit.org/show_bug.cgi?id=29085 2477 2478 Reflect the rename of platformWindow and it's return type. 2479 2480 * WebCoreSupport/ChromeClientQt.cpp: 2481 (WebCore::ChromeClientQt::platformPageClient): 2482 * WebCoreSupport/ChromeClientQt.h: 2483 2484 2009-09-18 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2485 2486 Reviewed by Simon Hausmann. 2487 2488 [Qt] Add persistence support for configuration options in the 2489 inspector. 2490 2491 * Api/qwebinspector.cpp: 2492 * QtLauncher/main.cpp: 2493 (main): 2494 * WebCoreSupport/InspectorClientQt.cpp: 2495 (WebCore::InspectorClientQt::populateSetting): 2496 (WebCore::InspectorClientQt::storeSetting): 2497 (WebCore::variantToSetting): 2498 (WebCore::settingToVariant): 2499 2500 2009-09-18 Simon Hausmann <simon.hausmann@nokia.com> 2501 2502 Reviewed by Ariya Hidayat. 2503 2504 Fixed a bunch of documentation warnings. 2505 2506 * Api/qwebgraphicsitem.cpp: 2507 * Api/qwebplugindatabase.cpp: 2508 * Api/qwebpluginfactory.cpp: 2509 * Api/qwebsecurityorigin.cpp: 2510 2511 2009-09-18 Warwick Allison <warwick.allison@nokia.com> 2512 2513 Reviewed by Simon Hausmann. 2514 2515 Added a test that console output works. 2516 2517 * tests/qwebpage/tst_qwebpage.cpp: 2518 (ConsolePage::ConsolePage): 2519 (ConsolePage::javaScriptConsoleMessage): 2520 (tst_QWebPage::consoleOutput): 2521 2522 2009-09-17 Kenneth Rohde Christiansen <kenneth@webkit.org> 2523 2524 Reviewed by Simon Hausmann. 2525 2526 Improve documentation for Page Cache. 2527 2528 * Api/qwebsettings.cpp: 2529 2530 2009-09-17 Tor Arne VestbÞ <tor.arne.vestbo@nokia.com> 2531 2532 Reviewed by Simon Hausmann. 2533 2534 [Qt] Update QWebSettings::setUserStyleSheetUrl() docs and test 2535 2536 https://bugs.webkit.org/show_bug.cgi?id=29081 2537 2538 The documentation now specifies that the URL has to be a local file 2539 or a a data-URL (with utf-8 and base64-encoded data), as these are the 2540 only two schemes that the current code path accepts. 2541 2542 The auto-test has been updated to reflect this limitation. 2543 2544 At a later point we should concider adding API for the new way of 2545 doing both user defined stylesheets and scripts. 2546 2547 * Api/qwebsettings.cpp: 2548 * tests/qwebpage/tst_qwebpage.cpp: 2549 2550 2009-09-17 Janne Koskinen <janne.p.koskinen@digia.com> 2551 2552 Reviewed by Simon Hausmann. 2553 2554 Symbian build fix. 2555 2556 Moved the #ifdefs around _q_cleanupLeakMessages() into the function 2557 definition. 2558 2559 QMake is not being able to distinguish between release and debug builds 2560 in Symbian build. This is a Symbian toolchain issue. 2561 2562 * Api/qwebpage.cpp: 2563 (QWebPagePrivate::_q_cleanupLeakMessages): 2564 * Api/qwebpage.h: 2565 * Api/qwebpage_p.h: 2566 2567 2009-09-17 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2568 2569 Reviewed by Simon Hausmann. 2570 2571 Small cosmetic documentation fixlet in the QWebInspector. 2572 2573 * Api/qwebinspector.cpp: 2574 2575 2009-09-16 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 2576 2577 Reviewed by Eric Seidel. 2578 2579 Detect and add Windows7 properly to the user agent. 2580 2581 * Api/qwebpage.cpp: 2582 (QWebPage::userAgentForUrl): 2583 2584 2009-09-16 Andras Becsi <andrewbecsi@yahoo.co.uk> 2585 2586 Rubberstamped by Kenneth Christiansen. 2587 2588 [Qt] Build fix for previous changes. 2589 2590 * QGVLauncher/main.cpp: 2591 (MainView::flip): 2592 2593 2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org> 2594 2595 Unreviewed potential Qt < 4.6 build fix. 2596 2597 * QGVLauncher/main.cpp: 2598 (MainView::flip): 2599 2600 2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org> 2601 2602 Reviewed by Simon Hausmann. 2603 2604 Add a "Flip effect" to our GraphicsView based launcher. 2605 2606 * QGVLauncher/main.cpp: 2607 (MainView::resizeEvent): 2608 (MainView::flip): 2609 (MainWindow::flip): 2610 (MainWindow::buildUI): 2611 2612 2009-09-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 2613 2614 Rubber-stamped by Simon Hausmann. 2615 2616 [Qt] Typo fix. Pass the window object to the Format 2617 menu. In this way Qt can free its internal graphical 2618 objects during exit. 2619 2620 * QtLauncher/main.cpp: 2621 (MainWindow::setupUI): 2622 2623 2009-09-16 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 46 2624 47 2625 Reviewed by Tor Arne VestbÞ. 48 2626 49 Fix QWebPage::WebActions action states to more closely match when they are 50 actually applicable and remove erroneous documentation. 51 52 * Most WebActions implemented using editor commands now use the 53 Editor::Command::isEnabled() to control their availability. 54 * SelectAll is always enabled (since it's editor command is). 55 * SetTextDirection{} family of WebActions are available when canEdit() is true 56 and not just canEditRichly(). 57 58 Fix and clarify documentation about the availability of various web actions. 2627 [Qt] Build break fix on gcc ARM. 2628 2629 * Api/qwebgraphicsitem.cpp: 2630 (QWebGraphicsItemPrivate::_q_doLoadProgress): 2631 2632 2009-09-16 Warwick Allison <warwick.allison@nokia.com> 2633 2634 Reviewed by Simon Hausmann. 2635 2636 Fix a crash in QWebFrame::hasFocus() with a simple null pointer check 2637 when the focused frame is null. We do the same check in other places 2638 where we call kit(). 2639 2640 * Api/qwebframe.cpp: 2641 (QWebFrame::hasFocus): 2642 2643 2009-09-16 Jure Repinc <jlp@holodeck1.com> 2644 2645 Reviewed by Simon Hausmann. 2646 2647 Fixed a typo found during translation. 2648 2649 * WebCoreSupport/FrameLoaderClientQt.cpp: 2650 (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError): 2651 2652 2009-09-14 Jakub Wieczorek <faw217@gmail.com> 2653 2654 Reviewed by Simon Hausmann. 2655 2656 [Qt] QWebGraphicsItem should check for null QWebPage. 2657 https://bugs.webkit.org/show_bug.cgi?id=29185 2658 2659 Don't crash in QWebGraphicsItem when the page is still null, by 2660 either checking if it's the case or constructing the default one. 2661 2662 * Api/qwebgraphicsitem.cpp: 2663 (QWebGraphicsItem::icon): 2664 (QWebGraphicsItem::setZoomFactor): 2665 (QWebGraphicsItem::zoomFactor): 2666 (QWebGraphicsItem::setGeometry): 2667 (QWebGraphicsItem::load): 2668 (QWebGraphicsItem::setHtml): 2669 (QWebGraphicsItem::toHtml): 2670 (QWebGraphicsItem::setContent): 2671 (QWebGraphicsItem::history): 2672 (QWebGraphicsItem::settings): 2673 2674 2009-09-11 David Boddie <dboddie@trolltech.com> 2675 2676 Reviewed by Simon Hausmann. 2677 2678 Doc: Note that Netscape plugins are only available on desktop platforms. 2679 2680 * docs/qtwebkit.qdoc: 2681 2682 2009-09-11 Martin Smith <msmith@trolltech.com> 2683 2684 Reviewed by Simon Hausmann. 2685 2686 Adjust the name of the contentspage for the documentation 2687 to the new name used in Qt 4.6. 2688 2689 * docs/qtwebkit.qdoc: 2690 2691 2009-09-11 Ariya Hidayat <ariya.hidayat@nokia.com> 2692 2693 Reviewed by Simon Hausmann. 2694 2695 Changed URLs from qtsoftware.com to qt.nokia.com, as part of a general 2696 renaming. 2697 2698 * Api/qwebpluginfactory.cpp: 2699 * docs/webkitsnippets/simple/main.cpp: 2700 (main): 2701 * docs/webkitsnippets/webpage/main.cpp: 2702 (main): 2703 2704 2009-09-11 Volker Hilsheimer <volker.hilsheimer@nokia.com> 2705 2706 Reviewed by Simon Hausmann. 2707 2708 Restructure the documentation, both on a file and on a content level. 2709 2710 * Api/qwebdatabase.cpp: 2711 * Api/qwebelement.cpp: 2712 * Api/qwebframe.cpp: 2713 * Api/qwebhistory.cpp: 2714 * Api/qwebhistoryinterface.cpp: 2715 * Api/qwebpage.cpp: 2716 * Api/qwebpluginfactory.cpp: 2717 * Api/qwebsecurityorigin.cpp: 2718 * Api/qwebsettings.cpp: 2719 * Api/qwebview.cpp: 2720 * docs/qtwebkit.qdoc: 2721 2722 2009-09-11 Yongjun Zhang <yongjun.zhang@nokia.com> 2723 2724 Reviewed by Simon Hausmann. 2725 2726 https://bugs.webkit.org/show_bug.cgi?id=29136 2727 [Qt] emit microFocusChanged() signal when no QWidget-based view is present. 2728 2729 emit microFocusChange() signal regardless of view. 2730 2731 * WebCoreSupport/EditorClientQt.cpp: 2732 (WebCore::EditorClientQt::setInputMethodState): 2733 2734 2009-09-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2735 2736 Reviewed by Simon Hausmann. 2737 2738 https://bugs.webkit.org/show_bug.cgi?id=28806 2739 2740 [Qt] Make the WebInspector available as a QWidget. 2741 2742 * Api/headers.pri: 2743 * Api/qwebelement.cpp: 2744 (QWebElement::enclosingElement): 2745 * Api/qwebelement.h: 2746 * Api/qwebinspector.cpp: Added. 2747 * Api/qwebinspector.h: Added. 2748 * Api/qwebinspector_p.h: Added. 2749 * Api/qwebpage.cpp: 2750 (QWebPagePrivate::QWebPagePrivate): 2751 (QWebPagePrivate::setInspector): 2752 (QWebPagePrivate::getOrCreateInspector): 2753 (QWebPagePrivate::inspectorController): 2754 (QWebPage::~QWebPage): 2755 (QWebPage::triggerAction): 2756 * Api/qwebpage.h: 2757 * Api/qwebpage_p.h: 2758 * Api/qwebsettings.cpp: 2759 * QtLauncher/main.cpp: 2760 (MainWindow::MainWindow): 2761 * WebCoreSupport/InspectorClientQt.cpp: 2762 (WebCore::InspectorClientWebPage::InspectorClientWebPage): 2763 (WebCore::InspectorClientWebPage::createWindow): 2764 (WebCore::InspectorClientQt::createPage): 2765 (WebCore::InspectorClientQt::showWindow): 2766 (WebCore::InspectorClientQt::closeWindow): 2767 (WebCore::InspectorClientQt::attachWindow): 2768 (WebCore::InspectorClientQt::detachWindow): 2769 (WebCore::InspectorClientQt::updateWindowTitle): 2770 * WebCoreSupport/InspectorClientQt.h: 2771 * docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp: Added. 2772 2773 2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2774 2775 Reviewed by Eric Seidel. 2776 2777 [Qt] Fix comparison between signed and unsigned integer warnings 2778 https://bugs.webkit.org/show_bug.cgi?id=29162 2779 2780 No functional change. 2781 2782 * Api/qwebelement.cpp: 2783 (QWebElement::findAll): 2784 * Api/qwebhistory.cpp: 2785 (QWebHistory::items): 2786 (QWebHistory::backItems): 2787 (QWebHistory::forwardItems): 2788 (QWebHistory::saveState): 2789 * Api/qwebplugindatabase.cpp: 2790 (QWebPluginDatabase::setSearchPaths): 2791 * WebCoreSupport/ChromeClientQt.cpp: 2792 (WebCore::ChromeClientQt::runOpenPanel): 2793 * WebCoreSupport/FrameLoaderClientQt.cpp: 2794 (WebCore::FrameLoaderClientQt::createPlugin): 2795 2796 2009-09-10 Simon Hausmann <hausmann@webkit.org> 2797 2798 Rubber-stamped by Ariya Hidayat. 2799 2800 Fix a bunch of qdoc warnings: Invalid references, non-standard 2801 wording, etc. 2802 2803 * Api/qwebelement.cpp: 2804 * Api/qwebgraphicsitem.cpp: 2805 * Api/qwebsecurityorigin.cpp: 2806 2807 2009-09-10 Simon Hausmann <hausmann@webkit.org> 2808 2809 Reviewed by Ariya Hidayat. 2810 2811 Fix context menu event delivery with QWebGraphicsItem. 2812 2813 Re-implement the correct context menu virtual function using 2814 a QGraphicsSceneContextMenuEvent and forward & handle it in 2815 QWebPage. 2816 2817 * Api/qwebgraphicsitem.cpp: 2818 (QWebGraphicsItem::contextMenuEvent): 2819 * Api/qwebgraphicsitem.h: 2820 * Api/qwebpage.cpp: 2821 (QWebPagePrivate::contextMenuEvent): 2822 (QWebPage::event): 2823 * Api/qwebpage_p.h: 2824 2825 2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2826 2827 Unreviewed. 2828 2829 Build fix for QtWebKit for Mac after r48219. 2830 2831 qevent and qstyleoption are QtGui interfaces. 2832 2833 * Api/qwebgraphicsitem.cpp: 2834 * Api/qwebgraphicsitem.h: 2835 2836 2009-09-09 Simon Hausmann <hausmann@webkit.org> 2837 2838 Reviewed by Tor Arne VestbÞ. 2839 2840 Call the right base class function QGraphicsWidget::event() instead 2841 of skipping it and using QObject::event() instead. 2842 2843 * Api/qwebgraphicsitem.cpp: 2844 (QWebGraphicsItem::event): 2845 2846 2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org> 2847 2848 Unreviewed. 2849 2850 Fix comment at Tor Arne VestbÞ's request. 2851 2852 * Api/qwebgraphicsitem.cpp: 2853 (QWebGraphicsItem::sceneEvent): 2854 (QWebGraphicsItem::event): 2855 2856 2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org> 2857 2858 Reviewed by Tor Arne VestbÞ. 2859 2860 Implement some virtual event methods so that we can fix 2861 event-related bugs in Qt patch releases. 2862 2863 * Api/qwebgraphicsitem.cpp: 2864 (QWebGraphicsItem::sceneEvent): 2865 (QWebGraphicsItem::event): 2866 * Api/qwebgraphicsitem.h: 2867 2868 2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>, Antonio Gomes <antonio.gomes@openbossa.org> 2869 2870 Reviewed by Simon Hausmann. 2871 2872 Add a new QGraphicsWidget based version of the "QWebView" 2873 under the name "QWebGraphicsItem". 2874 2875 https://bugs.webkit.org/show_bug.cgi?id=28862 2876 2877 Includes an alternative Qt launcher using the QGraphicsView. 2878 2879 * Api/headers.pri: 2880 * Api/qwebgraphicsitem.cpp: Added. 2881 * Api/qwebgraphicsitem.h: Added. 2882 * Api/qwebpage.h: 2883 * QGVLauncher/QGVLauncher.pro: Copied from WebKit/qt/QtLauncher/QtLauncher.pro. 2884 * QGVLauncher/main.cpp: Added. 2885 * WebCoreSupport/ChromeClientQt.cpp: 2886 (WebCore::ChromeClientQt::repaint): 2887 (WebCore::ChromeClientQt::scroll): 2888 2889 2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org> 2890 2891 Unreviewed build fix. 2892 2893 Potential build fix for Qt 4.5 2894 2895 * Api/qwebpage.cpp: 2896 (QWebPagePrivate::mousePressEvent): 2897 2898 2009-09-08 Benjamin Poulain <benjamin.poulain@nokia.com> 2899 2900 Reviewed by Simon Hausmann. 2901 2902 https://bugs.webkit.org/show_bug.cgi?id=29007 2903 Add a test for the signal QWebFrame::javaScriptWindowObjectCleared() 2904 2905 * tests/qwebframe/tst_qwebframe.cpp: 2906 2907 2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2908 2909 Reviewed by Simon Hausmann. 2910 2911 [Qt] Fix unused variable warnings 2912 https://bugs.webkit.org/show_bug.cgi?id=29018 2913 2914 * Api/qwebpage.cpp: 2915 (QWebPagePrivate::keyPressEvent): 2916 * WebCoreSupport/FrameLoaderClientQt.cpp: 2917 (WebCore::FrameLoaderClientQt::startDownload): 2918 (WebCore::FrameLoaderClientQt::createFrame): 2919 2920 2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2921 2922 Reviewed by Ariya Hidayat. 2923 2924 [Qt] Use the declaration order in initializer lists 2925 https://bugs.webkit.org/show_bug.cgi?id=29017 2926 2927 * Api/qwebframe_p.h: 2928 2929 2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org> 2930 2931 Reviewed by Simon Hausmann. 2932 2933 Add support for handling QGraphicsScene events. 2934 2935 * Api/qwebpage.cpp: 2936 (QWebPagePrivate::mouseMoveEvent): 2937 (QWebPagePrivate::mousePressEvent): 2938 (QWebPagePrivate::mouseDoubleClickEvent): 2939 (QWebPagePrivate::mouseTripleClickEvent): 2940 (QWebPagePrivate::handleClipboard): 2941 (QWebPagePrivate::mouseReleaseEvent): 2942 (QWebPagePrivate::wheelEvent): 2943 (QWebPagePrivate::dragEnterEvent): 2944 (QWebPagePrivate::dragLeaveEvent): 2945 (QWebPagePrivate::dragMoveEvent): 2946 (QWebPagePrivate::dropEvent): 2947 (QWebPage::event): 2948 * Api/qwebpage_p.h: 2949 2950 2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org> 2951 2952 Reviewed by Simon Hausmann. 2953 2954 [Qt] Make cursor set cleaner in QtWebKit Api: eliminate SetCursorEvent hack. 2955 https://bugs.webkit.org/show_bug.cgi?id=28865 2956 2957 Clean up the unserCursor hack to use the QCursor set 2958 as a property of the QWidget by WebCore::WidgetQt. 2959 2960 Remove all code that are no longer necessary for getting 2961 cursor change events. 2962 2963 Patch by Kenneth Rohde Christiansen <kenneth@webkit.org> and 2964 Antonio Gomes <antonio.gomes@openbossa.org> on 2009-09-07 2965 2966 * Api/qwebpage.cpp: 2967 * Api/qwebpage_p.h: 2968 * Api/qwebview.cpp: 2969 (QWebViewPrivate::QWebViewPrivate): 2970 (QWebView::event): 2971 2972 2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2973 2974 Reviewed by Simon Hausmann. 2975 2976 [Qt] QtWebKit single API to enable persistency 2977 https://bugs.webkit.org/show_bug.cgi?id=28682 2978 2979 Disable LocalStorage, ApplicationCache, HTML5 offline storage by 2980 default. 2981 2982 If persistency is enabled the default directory for LocalStorage and 2983 ApplicationCache is now based on QDesktopServices::DataLocation and not 2984 QDesktopServices::CacheLocation (as it is expected to keep this data 2985 around after a reboot). 2986 2987 If persistency is enabled initialize HTML5 offline storage as well - this 2988 fixed offline Storage for QtLauncher. 2989 2990 * Api/qwebpage.cpp: 2991 (QWebPagePrivate::QWebPagePrivate): 2992 * Api/qwebsettings.cpp: 2993 (QWebSettings::QWebSettings): 2994 (QWebSettings::enablePersistentStorage): 2995 * Api/qwebsettings.h: Add a new API called enablePersistentStorage 2996 * QtLauncher/main.cpp: Use the new enablePersistentStorage API 2997 (main): 2998 2999 2009-09-07 Jakub Wieczorek <faw217@gmail.com> 3000 3001 Reviewed by Simon Hausmann. 3002 3003 Speed up the QWebPluginInfo::supportsMimeType() function. 3004 https://bugs.webkit.org/show_bug.cgi?id=27651 3005 3006 Instead of going through the MIME types list constructed with 3007 mimeTypes() function, look up the internal mimeToDescriptions map. 3008 3009 * Api/qwebplugindatabase.cpp: 3010 (QWebPluginInfo::supportsMimeType): 3011 3012 2009-09-07 Jakub Wieczorek <faw217@gmail.com> 3013 3014 Reviewed by Simon Hausmann. 3015 3016 Speed up the QWebPluginInfo::mimeTypes() function. 3017 https://bugs.webkit.org/show_bug.cgi?id=27651 3018 3019 Instead of constructing a list of MIME types every time it is called, 3020 do this only once. 3021 3022 * Api/qwebplugindatabase.cpp: 3023 (QWebPluginInfo::mimeTypes): 3024 (QWebPluginInfo::operator=): 3025 * Api/qwebplugindatabase.h: 3026 * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: 3027 (tst_QWebPluginDatabase::operatorassign_data): 3028 (tst_QWebPluginDatabase::operatorassign): 3029 3030 2009-09-07 Jakub Wieczorek <faw217@gmail.com> 3031 3032 Reviewed by Simon Hausmann. 3033 3034 Remove the private classes from QWebPluginDatabase. 3035 https://bugs.webkit.org/show_bug.cgi?id=27651 3036 3037 Instead, hold the PluginDatabase and PluginPackage objects as class 3038 members and take care of refcounting on our own instead of using RefPtr. 3039 3040 This way we not only made the code cleaner but also got rid of 3041 redundant allocations when constructing null QWebPluginInfo objects. 3042 3043 The private classes have been forward-declared and the d-pointers left 3044 to be on the safe side. 3045 3046 * Api/qwebplugindatabase.cpp: 3047 (QWebPluginInfo::QWebPluginInfo): 3048 (QWebPluginInfo::~QWebPluginInfo): 3049 (QWebPluginInfo::name): 3050 (QWebPluginInfo::description): 3051 (QWebPluginInfo::mimeTypes): 3052 (QWebPluginInfo::path): 3053 (QWebPluginInfo::isNull): 3054 (QWebPluginInfo::setEnabled): 3055 (QWebPluginInfo::isEnabled): 3056 (QWebPluginInfo::operator==): 3057 (QWebPluginInfo::operator!=): 3058 (QWebPluginInfo::operator=): 3059 (QWebPluginDatabase::QWebPluginDatabase): 3060 (QWebPluginDatabase::~QWebPluginDatabase): 3061 (QWebPluginDatabase::plugins): 3062 (QWebPluginDatabase::searchPaths): 3063 (QWebPluginDatabase::setSearchPaths): 3064 (QWebPluginDatabase::addSearchPath): 3065 (QWebPluginDatabase::refresh): 3066 (QWebPluginDatabase::pluginForMimeType): 3067 (QWebPluginDatabase::setPreferredPluginForMimeType): 3068 * Api/qwebplugindatabase.h: 3069 * Api/qwebplugindatabase_p.h: Removed. 3070 3071 2009-09-05 Jakub Wieczorek <faw217@gmail.com> 3072 3073 Reviewed by Eric Seidel. 3074 3075 [Qt] r47424 broke binary compatibility 3076 https://bugs.webkit.org/show_bug.cgi?id=28996 3077 3078 Append the new DnsPrefetchEnabled attribute at the end of the enum. 3079 3080 * Api/qwebsettings.h: 3081 3082 2009-09-04 Mark Mentovai <mark@chromium.org> 3083 3084 Reviewed by Dave Hyatt. 3085 3086 https://bugs.webkit.org/show_bug.cgi?id=28614 3087 3088 Account for scrollbar state changes that occur during layout. 3089 3090 * Api/qwebframe.cpp: 3091 (QWebFrame::setScrollBarPolicy): 3092 3093 Eliminate duplicated (and incorrect) scrollbar mode tracking between 3094 FrameView and ScrollView. 3095 3096 2009-09-04 Laszlo Gombos <laszlo.1.gombos@nokia.com> 3097 3098 Reviewed by Eric Seidel. 3099 3100 [Qt] Fix tst_QWebPage::database autotest failure 3101 https://bugs.webkit.org/show_bug.cgi?id=28961 3102 3103 Make sure that the test case enables the feature before 3104 the feature gets tested 3105 3106 * tests/qwebpage/tst_qwebpage.cpp: 3107 (tst_QWebPage::database): 3108 3109 2009-09-04 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 3110 3111 Reviewed by Eric Seidel. 3112 3113 Any QtWebKit application crashes on exit if the inspector is 3114 used during the session rather then exiting. 3115 3116 If a QWebView has a QWebPage that is destroyed the QWebView 3117 does not update its pointer and will crash the next time 3118 it access the page pointers (such as in its destructor). 3119 3120 InspectorClientView should not call deleteLater when the page 3121 is destroyed because it does not have a parent and is a top 3122 level widget. close() needs to be called so that QApplication 3123 can exit the application if quitOnLastWindowClosed is set 3124 and a InspectorClientView is the last window, otherwise 3125 the application will never exit. 3126 3127 * Api/qwebview.cpp: 3128 (QWebViewPrivate::_q_pageDestroyed): 3129 (QWebView::setPage): 3130 * Api/qwebview.h: 3131 * WebCoreSupport/InspectorClientQt.cpp: 3132 (WebCore::InspectorClientView::InspectorClientView): 3133 3134 2009-09-03 Adam Barth <abarth@webkit.org> 3135 3136 Reviewed by eric@webkit.org. 3137 3138 https://bugs.webkit.org/show_bug.cgi?id=24696 3139 3140 Stub implementations of mixed content methods of FrameLoaderClient. 3141 3142 * WebCoreSupport/FrameLoaderClientQt.cpp: 3143 (WebCore::FrameLoaderClientQt::didDisplayInsecureContent): 3144 (WebCore::FrameLoaderClientQt::didRunInsecureContent): 3145 * WebCoreSupport/FrameLoaderClientQt.h: 3146 3147 2009-09-03 Laszlo Gombos <laszlo.1.gombos@nokia.com> 3148 3149 Reviewed by Eric Seidel. 3150 3151 [Qt] Add a setting to turn SessionStorage on/off 3152 https://bugs.webkit.org/show_bug.cgi?id=28836 3153 3154 * Api/qwebsettings.cpp: 3155 (QWebSettingsPrivate::apply): 3156 (QWebSettings::QWebSettings): 3157 * Api/qwebsettings.h: 3158 * tests/qwebpage/tst_qwebpage.cpp: 3159 (testFlag): 3160 (tst_QWebPage::testOptionalJSObjects): 3161 3162 2009-09-02 Richard Moore <rich@kde.org> 3163 3164 Reviewed by Tor Arne VestbÞ. 3165 3166 [Qt] Make sure we relayout the page after evaluating JS 3167 3168 https://bugs.webkit.org/show_bug.cgi?id=28235 3169 3170 QtWebKit does not always seem to reflow the page when evaluating 3171 javascript. This patch changes the way evaluateJavaScript works to 3172 use the frameloader which ensures that this is done properly. 3173 3174 * Api/qwebframe.cpp: 3175 (QWebFrame::evaluateJavaScript): 3176 * tests/qwebframe/tst_qwebframe.cpp: 3177 3178 2009-08-28 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 3179 3180 Reviewed by Holger Freyther. 3181 3182 https://bugs.webkit.org/show_bug.cgi?id=25889 3183 [GTK] scrollbar policy for main frame is not implementable 3184 3185 Add empty implementation for new ChromeClient method. 3186 3187 * WebCoreSupport/ChromeClientQt.h: 3188 (WebCore::ChromeClientQt::scrollbarsModeDidChange): 3189 3190 2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 3191 3192 Reviewed by Ariya Hidayat. 3193 3194 QWebHistory::clear() modifications. 3195 3196 Clear() method was changed. If QWebHistory is empty (there is no 3197 elements even current) clear() do nothing. If there at least one 3198 element clear() will delete everything apart of current. 3199 3200 New autotests in QWebHistory 3201 3202 New autotests were added to QWebHistory. They should check some crashes 3203 in save and restore state process and clear() method and general 3204 behavior on where QWebHistory::count() == 0 or QWebHistory::count() == 1 3205 3206 Bugzilla: https://bugs.webkit.org/show_bug.cgi?id=28711 3207 3208 * Api/qwebhistory.cpp: 3209 (QWebHistory::clear): 3210 * tests/qwebhistory/tst_qwebhistory.cpp: 3211 (tst_QWebHistory::back): 3212 (tst_QWebHistory::forward): 3213 (tst_QWebHistory::saveAndRestore_crash_1): 3214 (tst_QWebHistory::saveAndRestore_crash_2): 3215 (tst_QWebHistory::saveAndRestore_crash_3): 3216 (tst_QWebHistory::clear): 3217 3218 2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 3219 3220 Reviewed by Ariya Hidayat. 3221 3222 [Qt] Cleanup, old and commented part of source code was removed. 3223 Fix some formatting problems. 3224 3225 https://bugs.webkit.org/show_bug.cgi?id=28712 3226 3227 * Api/qwebhistory_p.h: 3228 (QWebHistoryPrivate::QWebHistoryPrivate): 3229 3230 2009-08-26 Adam Barth <abarth@webkit.org> 3231 3232 Reviewed by Oliver Hunt. 3233 3234 Don't let local files access web URLs 3235 https://bugs.webkit.org/show_bug.cgi?id=28480 3236 3237 * Api/qwebsettings.cpp: 3238 (QWebSettings::QWebSettings): 3239 3240 2009-08-25 Antonio Gomes <antonio.gomes@openbossa.org> 3241 3242 Reviewed by Ariya Hidayat. 3243 3244 Bug 28708 - Make possible to better use ResourceError in FrameLoaderClientQt class. 3245 3246 * Api/qwebframe.cpp: 3247 (QWebFrame::requestedUrl): 3248 * WebCoreSupport/FrameLoaderClientQt.cpp: 3249 (WebCore::FrameLoaderClientQt::FrameLoaderClientQt): 3250 (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad): 3251 (WebCore::FrameLoaderClientQt::postProgressFinishedNotification): 3252 (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad): 3253 (WebCore::FrameLoaderClientQt::dispatchDidFailLoad): 3254 * WebCoreSupport/FrameLoaderClientQt.h: 3255 3256 2009-08-22 Adam Barth <abarth@webkit.org> 3257 3258 Revert 47684. We're going to do this later once clients have had a 3259 chance to opt into the setting they like. 3260 3261 * Api/qwebsettings.cpp: 3262 (QWebSettings::QWebSettings): 3263 3264 2009-08-22 Adam Barth <abarth@webkit.org> 3265 3266 Reviewed by Eric Seidel. 3267 3268 Don't let local files access web URLs 3269 https://bugs.webkit.org/show_bug.cgi?id=28480 3270 3271 * Api/qwebsettings.cpp: 3272 (QWebSettings::QWebSettings): 3273 3274 2009-08-19 Aaron Boodman <aa@chromium.org> 3275 3276 Speculative build break fix for qt. 3277 3278 * Api/qwebsecurityorigin.cpp: 3279 (QWebSecurityOrigin::whiteListAccessFromOrigin): 3280 * Api/qwebsecurityorigin.h: 3281 3282 2009-08-19 Aaron Boodman <aa@chromium.org> 3283 3284 Reviewed by David Levin. 3285 3286 https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to 3287 specify a more granular policy for cross-origin XHR access. 3288 3289 * Api/qwebsecurityorigin.cpp: Add API to manipulate origin access whitelists. 3290 (QWebSecurityOrigin::whiteListAccessFromOrigin): Ditto. 3291 (QWebSecurityOrigin::resetOriginAccessWhiteLists): Ditto. 3292 * Api/qwebsecurityorigin.h: Ditto. 3293 3294 2009-08-18 Markus Goetz <Markus.Goetz@nokia.com> 3295 3296 Reviwed by Ariya Hidayat. 3297 3298 [Qt] For prefecthDNS, the pre-fetching has to be enabled in the 3299 WebSettings. 3300 3301 * Api/qwebsettings.cpp: 3302 (QWebSettings::QWebSettings): 3303 * Api/qwebsettings.h: 3304 3305 2009-08-17 Darin Adler <darin@apple.com> 3306 3307 Try to fix Qt build again. 3308 3309 * WebCoreSupport/EditorClientQt.cpp: Move "using namespace". 3310 3311 2009-08-17 Darin Adler <darin@apple.com> 3312 3313 Try to fix Qt build. 3314 3315 * WebCoreSupport/EditorClientQt.cpp: 3316 (WebCore::EditorClientQt::shouldShowDeleteInterface): 3317 Use getAttribute(classAttr) instead of className() function. 3318 3319 2009-08-14 Yongjun Zhang <yongjun.zhang@nokia.com> 3320 3321 Reviewed by Simon Hausmann. 3322 3323 RVCT elftran fails to resolve QPainter::staticMetaObject coming with 3324 QWebView::RenderHints property. 3325 3326 This is a temporary fix and will be revereted when the right symbols 3327 exported from Qt lib in S60. 3328 3329 https://bugs.webkit.org/show_bug.cgi?id=28181 3330 3331 * Api/qwebview.h: 3332 3333 2009-08-14 Laszlo Gombos <laszlo.1.gombos@nokia.com> 3334 3335 Reviewed by Simon Hausmann. 3336 3337 [Qt] Public API to configure the storage path for HTML5 localStorage 3338 https://bugs.webkit.org/show_bug.cgi?id=28036 3339 3340 Disables LocalStorage for QtWebKit by default by setting 3341 QWebSettings::LocalStorageEnabled to false. 3342 3343 Sets up a default for the LocalStorage path so that clients would only 3344 need to enable the LocalStorageEnabled setting to turn on LocalStoragre 3345 support. 3346 3347 Turn on LocalStorage support for QtLauncher and the relevant test 3348 since LocalStorage is now disabled by default for QtWebkit. 3349 3350 * Api/qwebpage.cpp: 3351 (defaultCachePath): 3352 (initializeApplicationCachePathIfNecessary): 3353 (QWebPagePrivate::QWebPagePrivate): 3354 * Api/qwebsettings.cpp: 3355 (QWebSettingsPrivate::apply): 3356 (QWebSettings::QWebSettings): 3357 (QWebSettings::setLocalStoragePath): 3358 (QWebSettings::localStoragePath): 3359 * Api/qwebsettings.h: 3360 * QtLauncher/main.cpp: 3361 (main): 3362 * tests/qwebpage/tst_qwebpage.cpp: 3363 (tst_QWebPage::multiplePageGroupsAndLocalStorage): 3364 3365 2009-08-14 Yael Aharon <yael.aharon@nokia.com> 3366 3367 Reviewed by Simon Hausmann. 3368 3369 [Qt] Allow applications to register their own local URL scheme. 3370 https://bugs.webkit.org/show_bug.cgi?id=28240 3371 3372 * Api/qwebsecurityorigin.cpp: 3373 (QWebSecurityOrigin::addLocalScheme): 3374 (QWebSecurityOrigin::removeLocalScheme): 3375 (QWebSecurityOrigin::localSchemes): 3376 * Api/qwebsecurityorigin.h: 3377 * tests/qwebpage/tst_qwebpage.cpp: 3378 (tst_QWebPage::localURLSchemes): 3379 3380 2009-08-13 Mark Rowe <mrowe@apple.com> 3381 3382 Try and fix the Qt build. 3383 3384 * Api/qwebelement.cpp: 3385 3386 2009-08-13 Kavindra Devi Palaraja <kavindra.palaraja@nokia.com> 3387 3388 Reviewed by Simon Hausmann. 3389 3390 Doc - Some cleanup on the documentation of QWebElement 3391 3392 * Api/qwebelement.cpp: 3393 3394 2009-08-13 Norbert Leser <norbert.leser@nokia.com> 3395 3396 Reviewed by Simon Hausmann. 3397 3398 Symbian target components (library and executable files) 3399 require Unique Identifiers (i.e., UID3). 3400 These identifiers are defined in the respective project 3401 files, conditionally for "symbian" platform. 3402 3403 * QtLauncher/QtLauncher.pro: 3404 * tests/qwebelement/qwebelement.pro: 3405 * tests/qwebframe/qwebframe.pro: 3406 * tests/qwebhistory/qwebhistory.pro: 3407 * tests/qwebhistoryinterface/qwebhistoryinterface.pro: 3408 * tests/qwebpage/qwebpage.pro: 3409 * tests/qwebview/qwebview.pro: 3410 3411 2009-08-12 George Wright <george.wright@torchmobile.com> 3412 3413 Reviewed by Adam Treat. 3414 3415 Initialise zoom levels independent of whether a URL is valid or not to 3416 fix https://bugs.webkit.org/show_bug.cgi?id=28162 3417 3418 * QtLauncher/main.cpp: 3419 (MainWindow::MainWindow): 3420 3421 2009-08-12 Joerg Bornemann <joerg.bornemann@trolltech.com> 3422 3423 Reviewed by Simon Hausmann. 3424 3425 QtWebKit compile fix for Windows CE 3426 3427 There's no getenv on Windows CE, use qgetenv instead. 3428 3429 * Api/qwebpage.cpp: 3430 (qt_drt_overwritePluginDirectories): 3431 3432 2009-08-10 Kavindra Palaraja <kavindra.palaraja@nokia.com> 3433 3434 Reviewed by Simon Hausmann. 3435 3436 Various fixes and improvements to the QWebPluginInfo, QWebPluginDatabase and QWebSettings documentation. 3437 3438 * Api/qwebplugindatabase.cpp: 3439 * Api/qwebsettings.cpp: 3440 3441 2009-08-08 Volker Hilsheimer <volker.hilsheimer@nokia.com> 3442 3443 Reviewed by Simon Hausmann. 3444 3445 Doc: there is no group of explicitly shared classes, only one class uses this. 3446 3447 Explain the implications in the QWebHistoryItem documentation, and get rid 3448 of the "group". 3449 3450 * Api/qwebhistory.cpp: 3451 3452 2009-08-05 Csaba Osztrogonac <oszi@inf.u-szeged.hu> 3453 3454 Reviewed by Simon Hausmann. 3455 3456 [Qt] Fix build error caused by http://trac.webkit.org/changeset/46763 3457 3458 * Api/qwebpluginfactory.h: Export macro added. 3459 3460 2009-08-04 Antonio Gomes <antonio.gomes@openbossa.org> 3461 3462 Reviewed by Simon Hausmann. 3463 3464 [Qt] QWebFrame::requestedUrl method can mis-behave in case of unhandled sslErrors. 3465 https://bugs.webkit.org/show_bug.cgi?id=27804 3466 3467 * Api/qwebframe.cpp: 3468 (QWebFrame::requestedUrl): 3469 * tests/qwebframe/tst_qwebframe.cpp: 3470 3471 2009-08-04 Simon Hausmann <simon.hausmann@nokia.com> 3472 3473 Reviewed by Tor Arne VestbÞ. 3474 3475 Rename QWebPlugin to QWebPluginInfo, as discussed on IRC. 3476 3477 * Api/qwebplugindatabase.cpp: 3478 (QWebPluginInfoPrivate::QWebPluginInfoPrivate): 3479 (QWebPluginInfo::QWebPluginInfo): 3480 (QWebPluginInfo::~QWebPluginInfo): 3481 (QWebPluginInfo::name): 3482 (QWebPluginInfo::description): 3483 (QWebPluginInfo::mimeTypes): 3484 (QWebPluginInfo::supportsMimeType): 3485 (QWebPluginInfo::path): 3486 (QWebPluginInfo::isNull): 3487 (QWebPluginInfo::setEnabled): 3488 (QWebPluginInfo::isEnabled): 3489 (QWebPluginInfo::operator==): 3490 (QWebPluginInfo::operator!=): 3491 (QWebPluginInfo::operator=): 3492 (QWebPluginDatabase::plugins): 3493 (QWebPluginDatabase::pluginForMimeType): 3494 (QWebPluginDatabase::setPreferredPluginForMimeType): 3495 * Api/qwebplugindatabase.h: 3496 * Api/qwebplugindatabase_p.h: 3497 * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: 3498 (tst_QWebPluginDatabase::installedPlugins): 3499 (tst_QWebPluginDatabase::searchPaths): 3500 (tst_QWebPluginDatabase::null_data): 3501 (tst_QWebPluginDatabase::null): 3502 (tst_QWebPluginDatabase::pluginForMimeType): 3503 (tst_QWebPluginDatabase::enabled): 3504 (tst_QWebPluginDatabase::operatorequal_data): 3505 (tst_QWebPluginDatabase::operatorequal): 3506 (tst_QWebPluginDatabase::preferredPlugin): 3507 3508 2009-08-04 Simon Hausmann <simon.hausmann@nokia.com> 3509 3510 Reviewed by Adam Treat. 3511 3512 Replace QWebPlugin::MimeType with a typedef to 3513 QWebPluginFactory::MimeType. 3514 3515 * Api/qwebplugindatabase.cpp: 3516 * Api/qwebplugindatabase.h: 3517 * Api/qwebpluginfactory.cpp: 3518 (QWebPluginFactory::MimeType::operator==): 3519 * Api/qwebpluginfactory.h: 3520 3521 2009-08-04 Jakub Wieczorek <faw217@gmail.com> 3522 3523 Reviewed by Simon Hausmann. 3524 3525 Add QWebPluginDatabase API to the Qt API. 3526 3527 https://bugs.webkit.org/show_bug.cgi?id=27651 3528 3529 * Api/headers.pri: 3530 * Api/qwebplugindatabase.cpp: Added. 3531 (QWebPluginPrivate::QWebPluginPrivate): 3532 (QWebPluginDatabasePrivate::QWebPluginDatabasePrivate): 3533 (QWebPlugin::MimeType::operator==): 3534 (QWebPlugin::QWebPlugin): 3535 (QWebPlugin::~QWebPlugin): 3536 (QWebPlugin::name): 3537 (QWebPlugin::description): 3538 (QWebPlugin::mimeTypes): 3539 (QWebPlugin::supportsMimeType): 3540 (QWebPlugin::path): 3541 (QWebPlugin::isNull): 3542 (QWebPlugin::setEnabled): 3543 (QWebPlugin::isEnabled): 3544 (QWebPlugin::operator==): 3545 (QWebPlugin::operator!=): 3546 (QWebPlugin::operator=): 3547 (QWebPluginDatabase::QWebPluginDatabase): 3548 (QWebPluginDatabase::~QWebPluginDatabase): 3549 (QWebPluginDatabase::plugins): 3550 (QWebPluginDatabase::defaultSearchPaths): 3551 (QWebPluginDatabase::searchPaths): 3552 (QWebPluginDatabase::setSearchPaths): 3553 (QWebPluginDatabase::addSearchPath): 3554 (QWebPluginDatabase::refresh): 3555 (QWebPluginDatabase::pluginForMimeType): 3556 (QWebPluginDatabase::setPreferredPluginForMimeType): 3557 * Api/qwebplugindatabase.h: Added. 3558 * Api/qwebplugindatabase_p.h: Added. 3559 * Api/qwebsettings.cpp: 3560 (QWebSettings::pluginDatabase): 3561 * Api/qwebsettings.h: 3562 * tests/qwebplugindatabase/qwebplugindatabase.pro: Added. 3563 * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: Added. 3564 (tst_QWebPluginDatabase::installedPlugins): 3565 (tst_QWebPluginDatabase::searchPaths): 3566 (tst_QWebPluginDatabase::null_data): 3567 (tst_QWebPluginDatabase::null): 3568 (tst_QWebPluginDatabase::pluginForMimeType): 3569 (tst_QWebPluginDatabase::enabled): 3570 (tst_QWebPluginDatabase::operatorequal_data): 3571 (tst_QWebPluginDatabase::operatorequal): 3572 (tst_QWebPluginDatabase::preferredPlugin): 3573 * tests/tests.pro: 3574 3575 2009-08-03 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu> 3576 3577 Reviewed by Simon Hausmann. 3578 3579 Do memory cleanup when running robotized QtLauncher in debug as well. 3580 3581 * QtLauncher/main.cpp: 3582 (launcherMain): 3583 (main): 3584 3585 2009-07-30 Laszlo Gombos <laszlo.1.gombos@nokia.com> 3586 3587 Reviewed by Tor Arne VestbÞ. 3588 3589 [Qt] Initialize HTML5 Application Cache for QtWebKit to a sensible default 3590 https://bugs.webkit.org/show_bug.cgi?id=27866 3591 3592 * Api/qwebpage.cpp: 3593 (initializeApplicationCachePathIfNecessary): 3594 (QWebPagePrivate::QWebPagePrivate): 3595 3596 2009-07-31 Jakob Petsovits <jakob.petsovits@torchmobile.com> 3597 3598 Reviewed by Adam Treat. 3599 3600 Build QtWebKit without benchmark tests for Qt < 4.5. 3601 https://bugs.webkit.org/show_bug.cgi?id=27886 3602 3603 The QBENCHMARK macro is only available from 4.5 on, 3604 so builds for Qt < 4.5 shouldn't try to build those. 3605 3606 * tests/tests.pro: 3607 3608 2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org> 3609 3610 Reviewed by Adam Treat. 3611 3612 Fix warning by migrating use of QString.sprintf(...) to 3613 QString.arg().arg()... 3614 3615 * WebCoreSupport/EditorClientQt.cpp: 3616 (dumpRange): 3617 3618 2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org> 3619 3620 Reviewed by Tor Arne VestbÞ. 3621 3622 Expose the Offline Web Application Cache in the Qt API. 3623 3624 * Api/qwebsettings.cpp: 3625 (QWebSettings::QWebSettings): 3626 (QWebSettings::setOfflineWebApplicationCachePath): 3627 (QWebSettings::offlineWebApplicationCachePath): 3628 (QWebSettings::setOfflineWebApplicationCacheQuota): 3629 (QWebSettings::offlineWebApplicationCacheQuota): 3630 * Api/qwebsettings.h: 3631 3632 2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org> 3633 3634 Reviewed by Adam Treat. 3635 3636 Add missing Q_OBJECT to class inheriting from QObject. 3637 3638 * tests/qwebframe/tst_qwebframe.cpp: 3639 3640 2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org> 3641 3642 Reviewed by Adam Treat. 3643 3644 Fix indentation. 3645 3646 * tests/qwebframe/tst_qwebframe.cpp: 3647 3648 2009-07-30 Volker Hilsheimer <volker.hilsheimer@nokia.com> 3649 3650 Reviewed by Simon Hausmann. 3651 3652 Fix documentation links to examples. 3653 3654 * Api/qwebview.cpp: 3655 3656 2009-07-30 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu> 3657 3658 Reviewed by Simon Hausmann. 3659 3660 Allocate MainWindow on heap in robotized QtLauncher as well. 3661 3662 * QtLauncher/main.cpp: 3663 (main): 3664 3665 2009-07-29 Kevin McCullough <kmccullough@apple.com> 3666 3667 Reviewed by Darin Adler. 3668 3669 Added foundation work to allow a testing infrastructure for the Web 3670 Inspector. 3671 3672 * WebCoreSupport/InspectorClientQt.cpp: 3673 (WebCore::InspectorClientQt::inspectorWindowObjectCleared): 3674 * WebCoreSupport/InspectorClientQt.h: 3675 3676 2009-07-29 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 3677 3678 Reviewed by Simon Hausmann. 3679 3680 [Qt] In debug mode, this fix frees cached resources 3681 and other unreferenced objects (by calling the 3682 garbage collector) to remove the LEAK messages. 3683 https://bugs.webkit.org/show_bug.cgi?id=27767 3684 3685 * Api/qwebframe.cpp: 3686 (qt_drt_cache_clear): 3687 * QtLauncher/main.cpp: 3688 (main): 3689 3690 2009-07-28 Kenneth Rohde Christiansen <kenneth@webkit.org> 3691 3692 Fix the Qt build by adapting to the changes of ScriptObject. 3693 3694 * Api/qwebelement.cpp: 3695 (setupScriptObject): 3696 3697 2009-07-28 Robert Hogan <robert@roberthogan.net> 3698 3699 Reviewed by Simon Hausmann. 3700 3701 Add WebKit version API to Qt. 3702 3703 Get the current version of WebKit from WebKit/mac/Configurations/Version.xcconfig 3704 at compile time and make it available to Qt applications through 3705 qWebKitVersion(). 3706 3707 Also amend the User Agent string to place the Safari clause outside 3708 the final bracket and to the end of the UA string. 3709 3710 https://bugs.webkit.org/show_bug.cgi?id=27158 3711 3712 Minor build tweak by Simon Hausmann (adding export macros to new functions). 3713 3714 * Api/headers.pri: 3715 * Api/qwebkitversion.cpp: Added. 3716 (webKitVersion): 3717 (webKitMajorVersion): 3718 (webKitMinorVersion): 3719 * Api/qwebkitversion.h: Added. 3720 * Api/qwebpage.cpp: 3721 (QWebPage::userAgentForUrl): 3722 * tests/qwebview/tst_qwebview.cpp: 3723 (tst_QWebView::getWebKitVersion): 3724 3725 2009-07-28 Simon Hausmann <simon.hausmann@nokia.com> 3726 3727 Rubber-stamped by Ariya Hidayat. 3728 3729 Fix compilation with the precompiled header. 3730 3731 * WebKit_pch.h: Don't include JSDOMBinding.h and MathObject.h, 3732 as they include AtomicString.h. AtomicString.cpp needs to enable 3733 a #define before including AtomicString.h, which breaks if the PCH 3734 forces the inclusion beforehand. 3735 3736 2009-07-28 Ariya Hidayat <ariya.hidayat@nokia.com> 3737 3738 Reviewed by Simon Hausmann. 3739 3740 Added tests to ensure that scroll position can be changed 3741 programmatically, even when the scroll bar policy is set to off. 3742 3743 * tests/qwebframe/tst_qwebframe.cpp: 3744 3745 2009-07-28 Tor Arne VestbÞ <tor.arne.vestbo@nokia.com> 3746 3747 Reviewed by Simon Hausmann. 3748 3749 Fix a few compilation warnings in the QWebFrame tests. 3750 3751 * tests/qwebframe/tst_qwebframe.cpp: 3752 3753 2009-07-28 Andre Pedralho <andre.pedralho@openbossa.org> 3754 3755 Reviewed by Simon Hausmann. 3756 3757 Fixed tst_QWebFrame::hasSetFocus test which was using 3758 an undefined resource. 3759 https://bugs.webkit.org/show_bug.cgi?id=27512 3760 3761 * tests/qwebframe/tst_qwebframe.cpp: 3762 3763 2009-07-28 Simon Hausmann <simon.hausmann@nokia.com> 3764 3765 Reviewed by Ariya Hidayat. 3766 3767 Make it possible to pass relative file names to QtLauncher. 3768 3769 * QtLauncher/main.cpp: 3770 (MainWindow::MainWindow): 3771 3772 2009-07-27 Alexey Proskuryakov <ap@webkit.org> 3773 3774 Reviewed by Darin Adler. 3775 3776 https://bugs.webkit.org/show_bug.cgi?id=27735 3777 Give a helpful name to JSLock constructor argument 3778 3779 * Api/qwebframe.cpp: 3780 (QWebFrame::addToJavaScriptWindowObject): 3781 3782 2009-07-27 Volker Hilsheimer <volker.hilsheimer@nokia.com> 3783 3784 Reviewed by Simon Hausmann. 3785 3786 QWebView's "enabled" parameter should default to true, as with QGraphicsView and 3787 QPainter. 3788 3789 * Api/qwebview.cpp: Add reference to QPainter::renderHints(). 3790 * Api/qwebview.h: Add default for enabled argument. 3791 3792 2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com> 3793 3794 Reviewed by Simon Hausmann. 3795 3796 More documentation cleanups in the QWebElement class overview. 3797 3798 * Api/qwebelement.cpp: 3799 3800 2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com> 3801 3802 Reviewed by Simon Hausmann. 3803 3804 Clean up documentation of QWebElement's findFirst and findAll functions, 3805 as well as their QWebFrame counterparts. 3806 3807 * Api/qwebelement.cpp: 3808 * Api/qwebframe.cpp: 3809 3810 2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com> 3811 3812 Reviewed by Simon Hausmann. 3813 3814 Various documentation cleanups 3815 3816 * Fixed qdoc warnings 3817 * Hide QWebNetworkInterface from the class overview 3818 * Mention QWebElement in the module overview 3819 * More cleanups 3820 3821 * Api/qwebframe.cpp: 3822 * Api/qwebnetworkinterface.cpp: 3823 * Api/qwebview.cpp: 3824 * docs/qtwebkit.qdoc: 3825 3826 2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com> 3827 3828 Reviewed by Simon Hausmann. 3829 3830 Added missing class diagram referenced from the docs, taken from the Qt 3831 documentation. 3832 3833 * docs/qtwebkit.qdocconf: Register the image directory with 3834 qdoc. 3835 * docs/qwebview-diagram.png: Added. 3836 3837 2009-07-24 Antonio Gomes <antonio.gomes@openbossa.org> 3838 3839 Reviewed by Adam Treat. 3840 3841 As per discussion on IRC, changed originalUrl by requestedUrl. 3842 3843 * Api/qwebframe.cpp: 3844 (QWebFrame::requestedUrl): 3845 * Api/qwebframe.h: 3846 * tests/qwebframe/tst_qwebframe.cpp: 3847 3848 2009-07-24 Andre Pedralho <andre.pedralho@openbossa.org> 3849 3850 Reviewed by Adam Treat. 3851 3852 Removed void QWebFrame::renderContents(...) and added the Q_PROPERTY 3853 clipRenderToViewport to control whether QWebFrame::render would call 3854 FrameView::paintContents rather than FrameView::paint and do not clip 3855 the frame content to viewport. 3856 3857 3858 * Api/qwebframe.cpp: 3859 (QWebFramePrivate::renderPrivate): 3860 (QWebFrame::clipRenderToViewport): 3861 (QWebFrame::setClipRenderToViewport): 3862 * Api/qwebframe.h: 3863 * Api/qwebframe_p.h: 3864 (QWebFramePrivate::QWebFramePrivate): 3865 * tests/qwebframe/tst_qwebframe.cpp: 3866 3867 2009-07-24 Antonio Gomes <antonio.gomes@openbossa.org> 3868 3869 Reviewed by Simon Hausmann. 3870 3871 [QT] Implement originalUrl getter method to the API 3872 https://bugs.webkit.org/show_bug.cgi?id=25867 3873 3874 * Api/qwebframe.cpp: 3875 (QWebFrame::originalUrl): 3876 * Api/qwebframe.h: 3877 * tests/qwebframe/qwebframe.qrc: 3878 * tests/qwebframe/test1.html: Added. 3879 * tests/qwebframe/test2.html: Added. 3880 * tests/qwebframe/tst_qwebframe.cpp: 3881 3882 2009-07-24 Kenneth Rohde Christiansen <kenneth@webkit.org> 3883 3884 Build fix for Qt. 3885 3886 Fix build issue introduced in 46344 3887 ([Bug 22700] ApplicationCache should have size limit) 3888 3889 Remove method only added to the Qt ChromeClient. 3890 3891 * WebCoreSupport/ChromeClientQt.h: 3892 3893 2009-07-24 Andrei Popescu <andreip@google.com> 3894 3895 Reviewed by Anders Carlsson. 3896 3897 ApplicationCache should have size limit 3898 https://bugs.webkit.org/show_bug.cgi?id=22700 3899 3900 * WebCoreSupport/ChromeClientQt.cpp: 3901 (WebCore::ChromeClientQt::reachedMaxAppCacheSize): 3902 Adds empty implementation of the reachedMaxAppCacheSize callback. 3903 * WebCoreSupport/ChromeClientQt.h: 3904 3905 2009-07-23 Laszlo Gombos <laszlo.1.gombos@nokia.com> 3906 3907 Reviewed by Simon Hausmann. 3908 3909 [Qt] Add simple proxy support for QtLauncher 3910 https://bugs.webkit.org/show_bug.cgi?id=27495 3911 3912 Picks up proxy settings from the http_proxy environment 3913 variable. 3914 3915 * QtLauncher/QtLauncher.pro: Add QtNetwork dependency for all 3916 platforms. 3917 * QtLauncher/main.cpp: 3918 (MainWindow::MainWindow): 3919 3920 2009-07-23 Simon Hausmann <simon.hausmann@nokia.com> 3921 3922 Reviewed by Holger Freyther. 3923 3924 Added a testcase to verify that cached methods in the QOBject bindings 3925 remain alife even after garbage collection. 3926 3927 * tests/qwebpage/tst_qwebpage.cpp: 3928 (tst_QWebPage::protectBindingsRuntimeObjectsFromCollector): 3929 3930 2009-07-23 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> 3931 3932 Reviewed by Simon Hausmann. 3933 3934 Fixing two issues related to QtLauncher 3935 - MainWindow objects are not always freed after close 3936 - JavaScript window.close() sometimes crashes 3937 https://bugs.webkit.org/show_bug.cgi?id=27601 3938 3939 * QtLauncher/main.cpp: 3940 (MainWindow::MainWindow): 3941 (main): 3942 3943 2009-07-21 Volker Hilsheimer <volker.hilsheimer@nokia.com> 3944 3945 Reviewed by Simon Hausmann. 3946 3947 Various improvements to the API documentation. 3948 3949 * Updated link to W3c Database spec 3950 * Formatting fixes, cleanups 3951 * Add missing \since 4.6 tags to QWebPage::frameAt 3952 * Extend QWebDatabase and QWebSecurityOrigin docs. 3953 3954 * Api/qwebdatabase.cpp: 3955 * Api/qwebpage.cpp: 3956 * Api/qwebsecurityorigin.cpp: 3957 * Api/qwebview.cpp: 3958 3959 2009-07-21 Tor Arne VestbÞ <tor.arne.vestbo@nokia.com> 3960 3961 Rubber-stamped by Simon Hausmann. 3962 3963 Remove preliminary-tag from QWebElement 3964 3965 * Api/qwebelement.cpp: 3966 3967 2009-07-20 Kenneth Rohde Christiansen <kenneth@webkit.org> 3968 3969 Reviewed by Eric Seidel. 3970 3971 Fix Qt code to follow the WebKit Coding Style. 3972 3973 * Api/qcookiejar.cpp: 3974 (QCookieJar::setCookieJar): 3975 (QCookieJar::cookieJar): 3976 * Api/qcookiejar.h: 3977 * Api/qwebdatabase.cpp: 3978 (QWebDatabase::QWebDatabase): 3979 (QWebDatabase::removeDatabase): 3980 * Api/qwebdatabase.h: 3981 * Api/qwebdatabase_p.h: 3982 * Api/qwebelement.h: 3983 * Api/qwebframe.cpp: 3984 (QWebFrame::title): 3985 (QWebFrame::print): 3986 * Api/qwebframe.h: 3987 * Api/qwebframe_p.h: 3988 * Api/qwebhistory.cpp: 3989 (QWebHistory::clear): 3990 * Api/qwebhistory.h: 3991 * Api/qwebhistory_p.h: 3992 * Api/qwebhistoryinterface.cpp: 3993 (gCleanupInterface): 3994 (QWebHistoryInterface::setDefaultInterface): 3995 (QWebHistoryInterface::defaultInterface): 3996 (QWebHistoryInterface::QWebHistoryInterface): 3997 * Api/qwebhistoryinterface.h: 3998 * Api/qwebnetworkinterface.cpp: 3999 (QWebNetworkManager::started): 4000 (QWebNetworkManager::finished): 4001 (QWebNetworkInterfacePrivate::parseDataUrl): 4002 (QWebNetworkInterface::addJob): 4003 (WebCoreHttp::onResponseHeaderReceived): 4004 (WebCoreHttp::onReadyRead): 4005 * Api/qwebnetworkinterface.h: 4006 * Api/qwebnetworkinterface_p.h: 4007 * Api/qwebpage.cpp: 4008 (QWebPagePrivate::editorCommandForWebActions): 4009 (QWebPagePrivate::createContextMenu): 4010 (QWebPagePrivate::focusInEvent): 4011 (QWebPage::fixedContentsSize): 4012 (QWebPage::setContentEditable): 4013 (QWebPage::swallowContextMenuEvent): 4014 (QWebPage::findText): 4015 * Api/qwebpage.h: 4016 * Api/qwebpage_p.h: 4017 * Api/qwebpluginfactory.h: 4018 * Api/qwebsecurityorigin.h: 4019 * Api/qwebsecurityorigin_p.h: 4020 * Api/qwebsettings.cpp: 4021 (QWebSettingsPrivate::QWebSettingsPrivate): 4022 (QWebSettingsPrivate::apply): 4023 (QWebSettings::globalSettings): 4024 (QWebSettings::QWebSettings): 4025 (QWebSettings::fontSize): 4026 (QWebSettings::setUserStyleSheetUrl): 4027 (QWebSettings::setDefaultTextEncoding): 4028 (QWebSettings::setIconDatabasePath): 4029 (QWebSettings::iconDatabasePath): 4030 (QWebSettings::iconForUrl): 4031 (QWebSettings::setWebGraphic): 4032 (QWebSettings::setFontFamily): 4033 (QWebSettings::fontFamily): 4034 (QWebSettings::testAttribute): 4035 (qt_websettings_setLocalStorageDatabasePath): 4036 * Api/qwebsettings.h: 4037 * Api/qwebview.cpp: 4038 (QWebView::setPage): 4039 (QWebView::event): 4040 * Api/qwebview.h: 4041 4042 2009-07-20 Holger Hans Peter Freyther <zecke@selfish.org> 4043 4044 Reviewed by Simon Hausmann. 4045 4046 [Qt] Add test for loading webpages... 4047 4048 Performance test for loading webpages. Wait for the loadFinished 4049 signal to be fired. This should include a non empty layout. 4050 4051 * tests/benchmarks/loading/tst_loading.cpp: Added. 4052 (waitForSignal): 4053 (tst_Loading::init): 4054 (tst_Loading::cleanup): 4055 (tst_Loading::load_data): 4056 (tst_Loading::load): 4057 * tests/benchmarks/loading/tst_loading.pro: Added. 4058 * tests/tests.pro: 4059 4060 2009-07-20 Holger Hans Peter Freyther <zecke@selfish.org> 4061 4062 Reviewed by Simon Hausmann. 4063 4064 [Qt] Add a test case for drawing a simple viewrect to a QPixmap 4065 4066 * tests/benchmarks/painting/tst_painting.cpp: Added. 4067 (waitForSignal): 4068 (tst_Painting::init): 4069 (tst_Painting::cleanup): 4070 (tst_Painting::paint_data): 4071 (tst_Painting::paint): 4072 * tests/benchmarks/painting/tst_painting.pro: Added. 4073 * tests/tests.pro: 4074 4075 2009-07-20 Laszlo Gombos <laszlo.1.gombos@nokia.com> 4076 4077 Reviewed by Holger Freyther. 4078 4079 [Qt] Add an option for QtLauncher to build without QtUiTools dependency 4080 https://bugs.webkit.org/show_bug.cgi?id=27438 4081 4082 Based on Norbert Leser's work. 4083 4084 * QtLauncher/main.cpp: 4085 (WebPage::createPlugin): 4086 4087 2009-07-17 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 4088 4089 Reviewed by Adam Treat. 4090 4091 Coding style fixes. 4092 4093 * Api/qcookiejar.cpp: 4094 (QCookieJarPrivate::QCookieJarPrivate): 4095 (qHash): 4096 (QCookieJar::cookieJar): 4097 * Api/qwebelement.cpp: 4098 (QWebElement::functions): 4099 (QWebElement::scriptableProperties): 4100 * Api/qwebframe.cpp: 4101 (QWebFrame::metaData): 4102 (QWebFrame::scrollBarValue): 4103 (QWebFrame::scroll): 4104 (QWebFrame::scrollPosition): 4105 (QWebFrame::print): 4106 * Api/qwebnetworkinterface.cpp: 4107 (decodePercentEncoding): 4108 (QWebNetworkRequestPrivate::init): 4109 (QWebNetworkRequestPrivate::setURL): 4110 (QWebNetworkRequest::QWebNetworkRequest): 4111 (QWebNetworkRequest::operator=): 4112 (QWebNetworkRequest::setUrl): 4113 (QWebNetworkRequest::setHttpHeader): 4114 (QWebNetworkRequest::httpHeaderField): 4115 (QWebNetworkRequest::setHttpHeaderField): 4116 (QWebNetworkRequest::setPostData): 4117 (QWebNetworkJob::setResponse): 4118 (QWebNetworkJob::frame): 4119 (QWebNetworkManager::add): 4120 (QWebNetworkManager::cancel): 4121 (QWebNetworkManager::started): 4122 (QWebNetworkManager::data): 4123 (QWebNetworkManager::finished): 4124 (QWebNetworkManager::addHttpJob): 4125 (QWebNetworkManager::cancelHttpJob): 4126 (QWebNetworkManager::httpConnectionClosed): 4127 (QWebNetworkInterfacePrivate::sendFileData): 4128 (QWebNetworkInterfacePrivate::parseDataUrl): 4129 (QWebNetworkManager::doWork): 4130 (QWebNetworkInterface::setDefaultInterface): 4131 (QWebNetworkInterface::defaultInterface): 4132 (QWebNetworkInterface::QWebNetworkInterface): 4133 (QWebNetworkInterface::addJob): 4134 (QWebNetworkInterface::cancelJob): 4135 (WebCoreHttp::WebCoreHttp): 4136 (WebCoreHttp::request): 4137 (WebCoreHttp::scheduleNextRequest): 4138 (WebCoreHttp::getConnection): 4139 (WebCoreHttp::onResponseHeaderReceived): 4140 (WebCoreHttp::onReadyRead): 4141 (WebCoreHttp::onRequestFinished): 4142 (WebCoreHttp::onAuthenticationRequired): 4143 (WebCoreHttp::onProxyAuthenticationRequired): 4144 * Api/qwebpage.cpp: 4145 (QWebPagePrivate::QWebPagePrivate): 4146 (QWebPagePrivate::mouseReleaseEvent): 4147 (QWebPagePrivate::inputMethodEvent): 4148 (QWebPagePrivate::shortcutOverrideEvent): 4149 (QWebPage::inputMethodQuery): 4150 (QWebPage::javaScriptPrompt): 4151 (QWebPage::updatePositionDependentActions): 4152 (QWebPage::userAgentForUrl): 4153 (QWebPagePrivate::_q_onLoadProgressChanged): 4154 (QWebPage::totalBytes): 4155 (QWebPage::bytesReceived): 4156 * Api/qwebsettings.cpp: 4157 (QWebSettings::iconForUrl): 4158 (QWebSettings::setObjectCacheCapacities): 4159 * Api/qwebview.cpp: 4160 (QWebView::paintEvent): 4161 (QWebView::changeEvent): 4162 4163 2009-07-17 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 4164 4165 Reviewed by Simon Hausmann. 4166 4167 Overwrite the plugin directories for the DRT. 4168 Part of https://bugs.webkit.org/show_bug.cgi?id=27215 4169 4170 * Api/qwebpage.cpp: 4171 (qt_drt_overwritePluginDirectories): Only set the plugin directories 4172 to the ones in the QTWEBKIT_PLUGIN_PATH environment variable. 4173 4174 2009-07-16 Xiaomei Ji <xji@chromium.org> 4175 4176 Reviewed by Dan Bernstein. 4177 4178 This is the 2nd part of fixing "RTL: tooltip does not get its directionlity from its element's." 4179 https://bugs.webkit.org/show_bug.cgi?id=24187 4180 4181 Add one extra parameter to the callee of HitTestResult::title() due to the signature change. 4182 4183 * Api/qwebframe.cpp: 4184 (QWebHitTestResultPrivate::QWebHitTestResultPrivate): Add direction as a parameter to the callee of HitTestResult::title(). 4185 * WebCoreSupport/ChromeClientQt.cpp: 4186 (WebCore::ChromeClientQt::mouseDidMoveOverElement): Add direction as a parameter to the callee of HitTestResult::title(). 4187 4188 2009-07-16 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 4189 4190 Reviewed by Adam Treat. 4191 4192 Add new action to qwebpage to reload without cache. 59 4193 60 4194 * Api/qwebpage.cpp: 61 4195 (QWebPagePrivate::updateAction): 62 (QWebPagePrivate::updateEditorActions): 4196 (QWebPagePrivate::updateNavigationActions): 4197 (QWebPage::triggerAction): 4198 * Api/qwebpage.h: 4199 4200 2009-07-16 Xiaomei Ji <xji@chromium.org> 4201 4202 Reviewed by Darin Adler. 4203 4204 Fix tooltip does not get its directionality from its element's directionality. 4205 https://bugs.webkit.org/show_bug.cgi?id=24187 4206 4207 Per mitz's suggestion in comment #6, while getting the plain-text 4208 title, we also get the directionality of the title. How to handle 4209 the directionality is up to clients. Clients could ignore it, 4210 or use attribute or unicode control characters to display the title 4211 as what they want. 4212 4213 4214 * WebCoreSupport/ChromeClientQt.cpp: 4215 (WebCore::ChromeClientQt::setToolTip): Add directionality as 2nd parameter to setToopTip() (without handling it yet). 4216 * WebCoreSupport/ChromeClientQt.h: Add directionality as 2nd parameter to setToolTip(). 4217 4218 2009-07-15 Yael Aharon <yael.aharon@nokia.com> 4219 4220 Reviewed by Simon Hausmann. 4221 4222 https://bugs.webkit.org/show_bug.cgi?id=27285 4223 4224 When the user clicks a link with a target attribute, the newly created window should be visible. 4225 Make new windows created in Qtlauncher visible. 4226 4227 * QtLauncher/main.cpp: 4228 (WebPage::createWindow): 4229 4230 2009-07-14 Adam Treat <adam.treat@torchmobile.com> 4231 4232 Reviewed by Zack Rusin. 4233 4234 https://bugs.webkit.org/show_bug.cgi?id=26983 4235 4236 The default constructed values for QSize and WebCore::IntSize are different. The former 4237 produces an invalid size whereas the latter produces a size of zero. This was causing 4238 a layout to be triggered when constructing a view and an assert to be hit. This patch fixes 4239 the crash by taking care not to cause an unnecessary layout triggered by ScrollView::setFixedLayoutSize. 4240 4241 * WebCoreSupport/FrameLoaderClientQt.cpp: 4242 (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): 4243 4244 2009-07-13 Simon Hausmann <simon.hausmann@nokia.com> 4245 4246 Reviewed by Ariya Hidayat. 4247 4248 Fix qdoc warnings for QWebPage::shouldInterruptJavaScript() and mention 4249 how to re-implement it. 4250 4251 * Api/qwebpage.cpp: 4252 4253 2009-07-13 Simon Hausmann <hausmann@webkit.org> 4254 4255 Reviewed by Ariya Hidayat. 4256 4257 Fix crash with plugins when the plugin stream is cancelled. 4258 4259 Similar to r26667 handle the case where didReceiveResponse on the 4260 plugin view results in failure to set up the stream and 4261 setMainDocumentError being called instead. This will set the 4262 m_pluginView back to 0 and we need check for it before calling 4263 didReceiveData. 4264 4265 This was triggered by consecutive execution of 4266 LayoutTests/plugins/return-error-from-new-stream-callback-in-full-frame-plugin.html 4267 followed by LayoutTests/scrollbars/scrollbar-crash-on-refresh.html 4268 4269 * WebCoreSupport/FrameLoaderClientQt.cpp: 4270 (WebCore::FrameLoaderClientQt::committedLoad): 4271 4272 2009-07-13 Simon Hausmann <hausmann@webkit.org> 4273 4274 Reviewed by Ariya Hidayat. 4275 4276 Added QWebDatabase::removeAllDatabases, as a way to delete all 4277 databases from the offline storage path. 4278 4279 Used by the Qt DRT. 4280 4281 * Api/qwebdatabase.cpp: 4282 (QWebDatabase::removeAllDatabases): 4283 * Api/qwebdatabase.h: 4284 4285 2009-07-13 Simon Hausmann <hausmann@webkit.org> 4286 4287 Reviewed by Ariya Hidayat. 4288 4289 Added loadStarted() and loadFinished() signals to QWebFrame, 4290 to allow load tracking of individual frames, as opposed to 4291 QWebPage's loadStarted/loadFinished signals that are emitted 4292 whenever _any_ child frame loads/finishes. 4293 4294 * Api/qwebframe.cpp: Document new signals. 4295 * Api/qwebframe.h: Add new signals. 4296 * WebCoreSupport/FrameLoaderClientQt.cpp: 4297 (WebCore::FrameLoaderClientQt::setFrame): Connect new signals. 4298 4299 2009-07-13 Simon Hausmann <hausmann@webkit.org> 4300 4301 Reviewed by Ariya Hidayat. 4302 4303 Add hooks for the GCController JavaScript interface needed by the 4304 Qt DRT. 4305 4306 Fixed sort order of includes in qwebframe.cpp. 4307 4308 * Api/qwebframe.cpp: 4309 (qt_drt_javaScriptObjectsCount): 4310 (qt_drt_garbageCollector_collect): 4311 (qt_drt_garbageCollector_collectOnAlternateThread): 4312 4313 2009-07-13 Simon Hausmann <hausmann@webkit.org> 4314 4315 Reviewed by Ariya Hidayat. 4316 4317 Add hooks for the GCController JavaScript interface needed by the 4318 Qt DRT. 4319 4320 Fixed sort order of includes in qwebframe.cpp. 4321 4322 * Api/qwebframe.cpp: 4323 (qt_drt_javaScriptObjectsCount): 4324 (qt_drt_garbageCollector_collect): 4325 (qt_drt_garbageCollector_collectOnAlternateThread): 4326 4327 2009-07-12 Brent Fulgham <bfulgham@gmail.com> 4328 4329 Speculative build fix after http://trac.webkit.org/changeset/45786. 4330 4331 * WebCoreSupport/ChromeClientQt.cpp: 4332 (WebCore::ChromeClientQt::addMessageToConsole): 4333 * WebCoreSupport/ChromeClientQt.h: 4334 4335 2009-07-10 Yael Aharon <yael.aharon@nokia.com> 4336 4337 Reviewed by Holger Freyther. 4338 4339 https://bugs.webkit.org/show_bug.cgi?id=27136 4340 4341 Fix a bug where webkit hangs when executing infinite JavaScript loop. 4342 4343 * Api/qwebpage.cpp: 4344 (QWebPage::shouldInterruptJavaScript): 4345 * Api/qwebpage.h: 4346 * WebCoreSupport/ChromeClientQt.cpp: 4347 (WebCore::ChromeClientQt::shouldInterruptJavaScript): 63 4348 * tests/qwebpage/tst_qwebpage.cpp: 64 (tst_QWebPage::textSelection): 65 66 2009-03-19 Ariya Hidayat <ariya.hidayat@trolltech.com> 67 68 Reviewed by Simon Hausmann. 69 70 Fixes pedantic compilation in QtWebKit. 71 72 There are no semi-colons after namespace declarations. 4349 (JSTestPage::JSTestPage): 4350 (JSTestPage::shouldInterruptJavaScript): 4351 (tst_QWebPage::infiniteLoopJS): 4352 4353 2009-07-10 Simon Hausmann <simon.hausmann@nokia.com> 4354 4355 Reviewed by Holger Freyther. 4356 4357 https://bugs.webkit.org/show_bug.cgi?id=27108 4358 4359 Fix crash when in frame tree of a new frame before the new frame 4360 has been installed in the frame tree, similar to r35088. 4361 4362 After calling Frame::init() the frame it may have been removed from the 4363 frame tree again through JavaScript. Detect this by checking the page() 4364 afterwards. 4365 4366 To make this check safe the Frame::init() code was moved into 4367 QWebFrameData's constructor, where a RefPtr holds a reference to the frame. 4368 After the check back in FrameLoaderClientQt we would hold the single 4369 reference left and after release() the frame, its frame loader, its 4370 client as well as the QWebFrame should have disappeared then. 4371 4372 * Api/qwebframe.cpp: 4373 (QWebFramePrivate::init): Only call Frame::init here, the rest is 4374 done in QWebFrameData's constructor. 4375 (QWebFrame::QWebFrame): 4376 * Api/qwebframe_p.h: Adjust declaration. 4377 (QWebFrameData::QWebFrameData): Create the Frame here. 4378 * Api/qwebpage.cpp: 4379 (QWebPagePrivate::createMainFrame): Adjust and simplify 4380 to new QWebFrame constructor. 4381 * WebCoreSupport/FrameLoaderClientQt.cpp: 4382 (WebCore::FrameLoaderClientQt::createFrame): Adjust to 4383 new QWebFrame construction using QWebFrameData and add the 4384 check like in r35088. 4385 4386 2009-07-09 Beth Dakin <bdakin@apple.com> 4387 4388 Reviewed by Dave Hyatt. 4389 4390 Make Widget RefCounted to fix: 4391 4392 <rdar://problem/7038831> REGRESSION (TOT): In Mail, a crash occurs 4393 at WebCore::Widget::afterMouseDown() after clicking To Do's close 4394 box 4395 <rdar://problem/6978804> WER #16: Repro Access Violation in 4396 WebCore::PluginView::bindingInstance (1310178023) 4397 -and- 4398 <rdar://problem/6991251> WER #13: Crash in WebKit! 4399 WebCore::PluginView::performRequest+203 (1311461169) 4400 4401 * WebCoreSupport/FrameLoaderClientQt.cpp: 4402 (WebCore::FrameLoaderClientQt::createPlugin): 4403 (WebCore::FrameLoaderClientQt::createJavaAppletWidget): 4404 * WebCoreSupport/FrameLoaderClientQt.h: 4405 4406 2009-07-08 Pradeepto Bhattacharya <pradeepto@kde.org> 4407 4408 Reviewed by Ariya Hidayat. 4409 4410 Build fix. 4411 4412 * WebCoreSupport/FrameLoaderClientQt.h: Removed the slot slotCallPolicyFunction(). 4413 4414 2009-07-08 Simon Hausmann <hausmann@webkit.org> 4415 4416 Reviewed by Tor Arne VestbÞ. 4417 4418 https://bugs.webkit.org/show_bug.cgi?id=27080 4419 4420 Fix DRT instability issues with fast/loader/submit-form-while-parsing-2.html 4421 4422 When the form is submitted we call the policy function in the frame 4423 loader delayed with a queued connection. That queued connection 4424 sometimes interferes with the javascript timeout set in the testcase. 4425 4426 Eliminate the entire delayed policy function mechanism and instead always 4427 call back directly, like in the other ports. In most other places we called 4428 the slot directly anyway. 4429 4430 * WebCoreSupport/FrameLoaderClientQt.cpp: 4431 (WebCore::FrameLoaderClientQt::FrameLoaderClientQt): Remove m_policyFunction. 4432 (WebCore::FrameLoaderClientQt::callPolicyFunction): Call the policy function directly instead 4433 of emitting the queued signal. 4434 (WebCore::FrameLoaderClientQt::cancelPolicyCheck): Call callPolicyFunction directly. 4435 (WebCore::FrameLoaderClientQt::dispatchWillSubmitForm): Ditto. 4436 (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType): Ditto. 4437 (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction): Ditto. 4438 (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction): Ditto. 4439 * WebCoreSupport/FrameLoaderClientQt.h: Remove m_policyFunction as well as the associated 4440 signal. 4441 4442 2009-07-07 Simon Hausmann <hausmann@webkit.org> 4443 4444 Reviewed by Holger Freyther. 4445 4446 Add Qt DRT hook for clearing the frame name. 4447 4448 * Api/qwebframe.cpp: 4449 (qt_drt_clearFrameName): 4450 4451 2009-07-05 Simon Hausmann <hausmann@webkit.org> 4452 4453 Reviewed by Holger Freyther. 4454 4455 Fix two qdoc warnings. 4456 4457 Added missing \property for QWebFrame::hasFocus and added \a 4458 tag for pos of QWebPage::frameAt. 4459 4460 * Api/qwebframe.cpp: 4461 * Api/qwebpage.cpp: 4462 4463 2009-07-04 Holger Hans Peter Freyther <zecke@selfish.org> 4464 4465 Reviewed by Simon Hausmann. 4466 4467 Use the recently introduced FocusController::setFocused 4468 4469 Use the recently introduced FocusController::setFocused 4470 in the Qt platform. The SelectionController will be updated 4471 from within the FocusController now. 4472 4473 * Api/qwebpage.cpp: 4474 (QWebPagePrivate::focusInEvent): 4475 (QWebPagePrivate::focusOutEvent): 4476 4477 2009-07-02 Simon Hausmann <simon.hausmann@nokia.com> 4478 4479 Reviewed by Ariya Hidayat. 4480 4481 Improve documentation of QWebFrame::setFocus and hasFocus() 4482 Added missing Q_PROPERTY for QWebFrame::hasFocus. 4483 4484 * Api/qwebframe.cpp: Clarify the docs. 4485 * Api/qwebframe.h: add Q_PROPERTY(focus). 4486 4487 2009-07-02 Joe Ligman <joseph.ligman@nokia.com> 4488 4489 Reviewed by Simon Hausmann. 4490 4491 Bug 26855: [Qt] New methods for QWebFrame to check and set focus. 4492 4493 Added new public methods QWebFrame::hasFocus() and QWebFrame::setFocus() 4494 Added auto test. 4495 4496 * Api/qwebframe.cpp: 4497 (QWebFrame::hasFocus): 4498 (QWebFrame::setFocus): 4499 * Api/qwebframe.h: 4500 * tests/qwebframe/tst_qwebframe.cpp: 4501 4502 2009-07-01 Robert Hogan <robert@roberthogan.net> 4503 4504 Reviewed by NOBODY. 4505 4506 Fix Qt segfault when javascript disabled. 4507 If clients call addToJavaScriptWindowObject even though JavascriptEnabled is false 4508 webkit will segfault on the assert: 4509 ASSERTION FAILED: _rootObject 4510 (../../../WebCore/bridge/runtime.cpp:52 4511 JSC::Bindings::Instance::Instance(WTF::PassRefPtr<JSC::Bindings::RootObject>)) 4512 Fix is to ensure JavaScript is enabled when client calls addToJavaScriptWindowObject. 4513 4514 https://bugs.webkit.org/show_bug.cgi?id=26906 4515 4516 * Api/qwebframe.cpp: 4517 (QWebFrame::addToJavaScriptWindowObject): 4518 4519 2009-07-01 Jakub Wieczorek <faw217@gmail.com> 4520 4521 Reviewed by Simon Hausmann. 4522 4523 [Qt] Move some API headers from WebCore.pro to headers.pri so that they 4524 get installed when running make install from the build directory. 4525 4526 * Api/headers.pri: 4527 4528 2009-07-01 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu> 4529 4530 Reviewed by Simon Hausmann. 4531 4532 Fixed robotized QtLauncher to work when there is no index.html in the user's home. 4533 4534 * QtLauncher/main.cpp: 4535 (main): 4536 4537 2009-06-30 Brian Weinstein <bweinstein@apple.com> 4538 4539 Reviewed by Adam Roben. 4540 4541 Renamed scrollbarUnderPoint to scrollbarAtPoint to follow conventions. 4542 4543 * Api/qwebpage.cpp: 4544 (QWebPage::swallowContextMenuEvent): 4545 4546 2009-06-30 Joe Ligman <joseph.ligman@nokia.com> 4547 4548 Reviewed by Adam Treat. 4549 4550 Bug 26422: [Qt] QWebPagePrivate::frameAt calculates wrong frame 4551 4552 Added a public method QWebPage::frameAt 4553 Removed QWebPagePrivate::frameAt, which calcuated the wrong frame 4554 Modified QWebPage::swallowContextMenuEvent to use the new frameAt method 4555 New test case for frameAt added to tst_qwebpage.cpp 4556 4557 * Api/qwebpage.cpp: 4558 (QWebPage::frameAt): 4559 (QWebPage::swallowContextMenuEvent): 4560 * Api/qwebpage.h: 4561 * Api/qwebpage_p.h: 4562 * tests/qwebpage/frametest/iframe.html: Added. 4563 * tests/qwebpage/frametest/iframe2.html: Added. 4564 * tests/qwebpage/frametest/iframe3.html: Added. 4565 * tests/qwebpage/tst_qwebpage.cpp: 4566 (frameAtHelper): 4567 (tst_QWebPage::frameAt): 4568 * tests/qwebpage/tst_qwebpage.qrc: 4569 4570 2009-06-30 Jakub Wieczorek <faw217@gmail.com> 4571 4572 Reviewed by Simon Hausmann. 4573 4574 Add QWebFrame::baseUrl() function that exposes the base URL of a frame. 4575 Autotests included. 4576 4577 * Api/qwebframe.cpp: 4578 (QWebFrame::baseUrl): 4579 * Api/qwebframe.h: 4580 * tests/qwebframe/tst_qwebframe.cpp: 4581 4582 2009-06-29 Simon Hausmann <simon.hausmann@nokia.com> 4583 4584 Fix the Qt build, add missing isSpeaking() implementation to 4585 ContextMenuClient. 4586 4587 * WebCoreSupport/ContextMenuClientQt.cpp: 4588 (WebCore::ContextMenuClientQt::isSpeaking): 4589 * WebCoreSupport/ContextMenuClientQt.h: 4590 4591 2009-06-28 Sriram Yadavalli <sriram.yadavalli@nokia.com> 4592 4593 Reviewed by Eric Seidel. 4594 4595 [Qt] Fix build break for Qt 4596 https://bugs.webkit.org/show_bug.cgi?id=26779 4597 4598 * Api/qwebpage.cpp: 4599 (QWebPage::swallowContextMenuEvent): 4600 4601 2009-06-27 Simon Hausmann <simon.hausmann@nokia.com> 4602 4603 Build fix for Qt under Windows. 4604 4605 * Api/qwebhistory.h: Use consistent export linkage for the datastream operators. 4606 4607 2009-06-26 Brian Weinstein <bweinstein@apple.com> 4608 4609 Reviewed by Simon Fraser. 4610 4611 Changed call of scrollbarUnderMouse to scrollbarUnderPoint to match new API. 4612 4613 * Api/qwebpage.cpp: 4614 (QWebPage::swallowContextMenuEvent): 4615 4616 2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 4617 4618 Reviewed by Simon Hausmann. 4619 4620 Add support for saving and loading of QWebHistory to and from a QByteArray. 4621 4622 This includes streaming operators for QWebHistory. for convenience. 4623 4624 New autotests that test QWebHistory and QWebHistoryItem serialization. 4625 4626 * Api/qwebhistory.cpp: 4627 (QWebHistory::restoreState): 4628 (QWebHistory::saveState): 4629 (operator<<): 4630 (operator>>): 4631 * Api/qwebhistory.h: 4632 * Api/qwebhistory_p.h: 4633 * tests/qwebhistory/tst_qwebhistory.cpp: 4634 (tst_QWebHistory::): 4635 (tst_QWebHistory::init): 4636 (tst_QWebHistory::title): 4637 (tst_QWebHistory::count): 4638 (tst_QWebHistory::back): 4639 (tst_QWebHistory::forward): 4640 (tst_QWebHistory::itemAt): 4641 (tst_QWebHistory::goToItem): 4642 (tst_QWebHistory::items): 4643 (tst_QWebHistory::serialize_1): 4644 (tst_QWebHistory::serialize_2): 4645 (tst_QWebHistory::serialize_3): 4646 (tst_QWebHistory::saveAndRestore_1): 4647 (tst_QWebHistory::saveAndRestore_2): 4648 (tst_QWebHistory::saveAndRestore_3): 4649 4650 2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 4651 4652 Reviewed by Simon Hausmann. 4653 4654 Fix the behaviour of QWebHistory::itemAt to interpret the specified index as absolute index. 4655 4656 Returns an invalid QWebHistoryItem if the index is out of range. 4657 4658 * Api/qwebhistory.cpp: 4659 (QWebHistory::itemAt): 4660 * tests/qwebhistory/tst_qwebhistory.cpp: 4661 (tst_QWebHistory::itemAt): 4662 4663 2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 4664 4665 Reviewed by Simon Hausmann. 4666 4667 Added a few autotest to QWebHistory. 4668 4669 * tests/qwebhistory/data/page1.html: Added. 4670 * tests/qwebhistory/data/page2.html: Added. 4671 * tests/qwebhistory/data/page3.html: Added. 4672 * tests/qwebhistory/data/page4.html: Added. 4673 * tests/qwebhistory/data/page5.html: Added. 4674 * tests/qwebhistory/data/page6.html: Added. 4675 * tests/qwebhistory/qwebhistory.pro: Added. 4676 * tests/qwebhistory/tst_qwebhistory.cpp: Added. 4677 (tst_QWebHistory::): 4678 (tst_QWebHistory::tst_QWebHistory): 4679 (tst_QWebHistory::~tst_QWebHistory): 4680 (tst_QWebHistory::init): 4681 (tst_QWebHistory::cleanup): 4682 (tst_QWebHistory::title): 4683 (tst_QWebHistory::count): 4684 (tst_QWebHistory::back): 4685 (tst_QWebHistory::forward): 4686 (tst_QWebHistory::goToItem): 4687 (tst_QWebHistory::items): 4688 * tests/qwebhistory/tst_qwebhistory.qrc: Added. 4689 * tests/tests.pro: 4690 4691 2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> 4692 4693 Reviewed by Simon Hausmann. 4694 4695 Fix support for documenting functions prefixed with QWEBKIT_EXPORT 4696 4697 Add QWEBKIT_EXPORT to the list of macros to ignore by qdoc. 4698 4699 * docs/qtwebkit.qdocconf: 4700 4701 2009-06-26 Yongjun Zhang <yongjun.zhang@nokia.com> 4702 4703 Reviewed by Eric Seidel. 4704 4705 Bug 20303: [Qt] Key events are not working in frames. 4706 4707 Send scrolling events to current focused frame, bubble the event 4708 up to parent frame if it is not handled. Use EventHandler's new 4709 shared scrolling code. 4710 4711 * Api/qwebpage.cpp: 4712 (QWebPagePrivate::keyPressEvent): 4713 (QWebPagePrivate::handleScrolling): 4714 * Api/qwebpage_p.h: 4715 4716 2009-06-25 Jakub Wieczorek <faw217@gmail.com> 4717 4718 Reviewed by Adam Treat. 4719 4720 Add highlight functionality to the QWebPage::findText() method. Introduced is 4721 new HighlightAllOccurrences flag which passed to the function will make it mark 4722 all existing occurrences of specified string in the page. 4723 4724 * Api/qwebpage.cpp: 4725 (QWebPage::findText): 4726 * Api/qwebpage.h: 4727 * Api/qwebview.cpp: 4728 4729 2009-06-19 Daniel Teske <qt-info@nokia.com> 4730 4731 Reviewed by Simon Hausmann. 4732 4733 Remove warnings for QString() constructions from const char * 4734 4735 By explicitly wrapping it with QLatin1String() / QLatin1Char() 4736 4737 * Api/qwebelement.cpp: 4738 (QWebElement::classes): Use QLatin1String. 4739 (QWebElement::addClass): Ditto. 4740 (QWebElement::removeClass): Ditto. 4741 (QWebElement::toggleClass): Ditto. 4742 4743 2009-06-18 Friedemann Kleint <Friedemann.Kleint@nokia.com> 4744 4745 Reviewed by Simon Hausmann. 4746 4747 Fixed MinGW compilation. 4748 4749 * Api/qwebelement.cpp: 4750 (QWebElement::evaluateScript): 4751 4752 2009-06-18 Markus Goetz <Markus.Goetz@nokia.com> 4753 4754 Reviewed by Simon Hausman. 4755 4756 Clarify in docs how to compile with debug information. 4757 4758 * docs/qtwebkit.qdoc: 4759 4760 2009-06-17 Markus Goetz <Markus.Goetz@nokia.com> 4761 4762 Reviewed by Simon Hausmann. 4763 4764 QWebPage: Don't call supportsSsl() 4765 4766 This stops QWebPage from loading the OpenSSL libs, 4767 certificates etc. when they are not needed for the non-HTTPS case. 4768 4769 Loading the SSL libraries can be a very slow operation. 4770 4771 * Api/qwebpage.cpp: 4772 (QWebPage::userAgentForUrl): 4773 4774 2009-06-16 David Boddie <dboddie@trolltech.com> 4775 4776 Reviewed by Simon Hausmann. 4777 4778 Doc: Fixed QWebPage::forwardUnsupportedContent documentation and added 4779 more information about Web plugins. 4780 4781 * Api/qwebpage.cpp: 4782 * Api/qwebsettings.cpp: 4783 * docs/qtwebkit.qdoc: 4784 4785 2009-06-16 Morten Engvoldsen <morten.engvoldsen@nokia.com> 4786 4787 Reviewed by Ariya Hidayat. 4788 4789 Clearifying QWebFrame docs 4790 4791 Adding docs to toHtml() and toPlainText() 4792 4793 * Api/qwebframe.cpp: 4794 4795 2009-06-15 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 4796 4797 Reviewed by Adam Treat. 4798 4799 Support the back/forward/stop/refresh multimedia keys and accept the 4800 event when handling backspace and shift backspace as we should. 4801 4802 * Api/qwebpage.cpp: 4803 (QWebPagePrivate::keyPressEvent): 4804 4805 2009-06-15 Andre Pedralho <andre.pedralho@openbossa.org> 4806 4807 Reviewed by Adam Treat. 4808 4809 https://bugs.webkit.org/show_bug.cgi?id=26351 4810 Remove bool QWebHitTestResult::isScrollBar() const and make sure a null QWebHitTestResult is returned instead. 4811 4812 * Api/qwebframe.cpp: 4813 (QWebFrame::hitTestContent): 4814 * Api/qwebframe.h: 4815 * Api/qwebpage.cpp: 4816 (QWebPage::updatePositionDependentActions): 4817 4818 2009-06-15 Simon Hausmann <simon.hausmann@nokia.com> 4819 4820 Reviewed by Adam Treat. 4821 4822 Fix the logic for disabling the fixed layout feature, when an invalid 4823 QSize is set. 4824 4825 * Api/qwebpage.cpp: 4826 (QWebPage::setFixedContentsSize): 4827 4828 2009-06-13 Adam Barth <abarth@webkit.org> 4829 4830 Reviewed by Darin Fisher. 4831 4832 https://bugs.webkit.org/show_bug.cgi?id=24492 4833 4834 Move registerURLSchemeAsLocal from FrameLoader to SecurityOrigin. 4835 4836 * Api/qwebpage.cpp: 4837 (QWebPage::acceptNavigationRequest): 4838 4839 2009-06-10 Antonio Gomes <antonio.gomes@openbossa.org> 4840 4841 Reviewed by Ariya Hidayat. 4842 4843 Documented ResolveRule and StylePriority enum values as well as their use in 4844 QWebElement::styleProperty and QWebElement::setStyleProperty methods. 4845 4846 Based on the work of Simon Hausmann. 4847 4848 * Api/qwebelement.cpp: 4849 (QWebElement::styleProperty): 4850 (QWebElement::setStyleProperty): 4851 * Api/qwebelement.h: 4852 4853 2009-06-09 Ariya Hidayat <ariya.hidayat@nokia.com> 4854 4855 Rubber-stamped by Simon Hausmann. 4856 4857 Fix qdoc warning, function parameter string must be referred. 4858 4859 * Api/qwebview.cpp: 4860 4861 2009-06-09 Simon Hausmann <simon.hausmann@nokia.com> 4862 4863 Reviewed by Ariya Hidayat. 4864 4865 Renamed QWebSettings::AllowUniversalAccessFromFileUrls to 4866 LocalContentCanAccessRemoteUrls, as discussed in the API review. 4867 4868 * Api/qwebsettings.cpp: 4869 (QWebSettingsPrivate::apply): 4870 (QWebSettings::QWebSettings): 4871 * Api/qwebsettings.h: 4872 4873 2009-06-09 Simon Hausmann <simon.hausmann@nokia.com> 4874 4875 Reviewed by Ariya Hidayat. 4876 4877 Merged useFixedLayout property with fixedLayoutSize and 4878 renamed the latter to fixedContentsSize. 4879 4880 * Api/qwebpage.cpp: 4881 (QWebPage::fixedContentsSize): 4882 (QWebPage::setFixedContentsSize): 4883 * Api/qwebpage.h: 4884 * WebCoreSupport/FrameLoaderClientQt.cpp: 4885 (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): 4886 4887 2009-06-09 Simon Hausmann <simon.hausmann@nokia.com> 4888 4889 Reviewed by Ariya Hidayat. 4890 4891 Renamed QWebHitTestResult::linkTarget to linkElement() and made it return 4892 a QWebElement. The link target itself is always the target DOM attribute. 4893 4894 * Api/qwebframe.cpp: 4895 (QWebHitTestResultPrivate::QWebHitTestResultPrivate): 4896 (QWebHitTestResult::linkElement): 4897 * Api/qwebframe.h: 4898 * Api/qwebframe_p.h: 4899 * tests/qwebframe/tst_qwebframe.cpp: 4900 4901 2009-06-08 Simon Hausmann <simon.hausmann@nokia.com> 4902 4903 Reviewed by Holger Freyther. 4904 4905 Renamed QWebElement::enclosingBlock to enclosingBlockElement 4906 and changed the return type to QWebElement, as discussed in 4907 the API review. This API is more generic and through 4908 QWebElement's geometry() it is possible to retrieve the 4909 same information. 4910 4911 * Api/qwebelement.cpp: 4912 (QWebElement::QWebElement): 4913 * Api/qwebelement.h: 4914 * Api/qwebframe.cpp: 4915 (QWebHitTestResultPrivate::QWebHitTestResultPrivate): 4916 (QWebHitTestResult::enclosingBlockElement): 4917 * Api/qwebframe.h: 4918 * Api/qwebframe_p.h: 4919 4920 2009-06-05 Tor Arne VestbÞ <tor.arne.vestbo@nokia.com> 4921 4922 Reviewed by Simon Hausmann. 4923 4924 [Qt] Add missing includes of config.h 4925 4926 * Api/qcookiejar.cpp: 4927 * Api/qwebnetworkinterface.cpp: 4928 * Plugins/ICOHandler.cpp: 4929 * WebCoreSupport/DragClientQt.cpp: 4930 * WebCoreSupport/EditCommandQt.cpp: 4931 4932 2009-06-03 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 4933 4934 Reviewed by Simon Hausmann. 4935 4936 Add API to make it possible to clear all memory caches used by 4937 QtWebKit. 4938 4939 * Api/qwebsettings.cpp: 4940 (QWebSettings::clearMemoryCaches): 4941 * Api/qwebsettings.h: 4942 4943 2009-06-01 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 4944 4945 Rubber-stamped by Gustavo Noronha. 4946 4947 Before guessing the url trim the string to remove whitespace added to the start/end by the user. 4948 4949 * Api/qwebview.cpp: 4950 (QWebView::guessUrlFromString): 4951 * tests/qwebview/tst_qwebview.cpp: 4952 (tst_QWebView::guessUrlFromString_data): 4953 4954 2009-06-01 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 4955 4956 Rubber-stamped by Gustavo Noronha. 4957 4958 Use QLatin1Char() to compile when QT_NO_CAST_FROM_ASCII and QT_NO_CAST_TO_ASCII is defined 4959 4960 * Api/qwebview.cpp: 4961 (QWebView::guessUrlFromString): 4962 4963 2009-06-01 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 4964 4965 Rubber-stamped by Gustavo Noronha. 4966 4967 Cleanup autotest file 4968 - use proper includes 4969 - remove useless constructor and destructor 4970 - add missing newline at the end of the file 4971 4972 * tests/qwebview/tst_qwebview.cpp: 4973 4974 2009-06-01 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 4975 4976 Rubber-stamped by Gustavo Noronha. 4977 4978 Add a missing space between two words in the documentation. 4979 4980 * Api/qwebview.cpp: 4981 4982 2009-05-26 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 4983 4984 Reviewed by Holger Freyther. 4985 4986 https://bugs.webkit.org/show_bug.cgi?id=25823 4987 4988 Add an API to generate a QUrl out of a string correcting for errors and missing information. 4989 See the API documentation for more details about the function. 4990 4991 Autotests: included 4992 4993 * Api/qwebview.cpp: 4994 (QWebView::guessUrlFromString): 4995 * Api/qwebview.h: 4996 * QtLauncher/main.cpp: 4997 (MainWindow::MainWindow): 4998 (MainWindow::changeLocation): 4999 * tests/qwebview/.gitignore: Added. 5000 * tests/qwebview/qwebview.pro: 5001 (tst_QWebView::initTestCase): 5002 (tst_QWebView::cleanupTestCase): 5003 (tst_QWebView::init): 5004 (tst_QWebView::cleanup): 5005 (tst_QWebView::guessUrlFromString_data): 5006 (tst_QWebView::guessUrlFromString): 5007 5008 2009-05-23 David Kilzer <ddkilzer@apple.com> 5009 5010 Part 2 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr 5011 5012 <https://bugs.webkit.org/show_bug.cgi?id=25495> 5013 5014 Reviewed by Oliver Hunt. 5015 5016 * WebCoreSupport/ChromeClientQt.h: 5017 (WebCore::ChromeClientQt::createHTMLParserQuirks): Return a 5018 PassOwnPtr<> instead of a raw HTMLParserQuirks pointer. 5019 5020 2009-05-23 Jakob Truelsen <antialize@gmail.com> 5021 5022 Reviewed by Holger Freyther. 5023 5024 https://bugs.webkit.org/show_bug.cgi?id=25863 5025 5026 Expose the default text encoding property to Qt. 5027 5028 * Api/qwebsettings.cpp: 5029 (QWebSettingsPrivate::apply): 5030 (QWebSettings::setDefaultTextEncoding): 5031 (QWebSettings::defaultTextEncoding): 5032 * Api/qwebsettings.h: 5033 5034 2009-05-21 Antonio Gomes <antonio.gomes@openbossa.org> 5035 5036 Reviewed by Simon Hausmann. 5037 5038 [Qt] Additional test for resource load (CSS file) for QWebFrame. 5039 5040 * tests/qwebframe/qwebframe.qrc: 5041 * tests/qwebframe/style.css: Added. 5042 * tests/qwebframe/tst_qwebframe.cpp: 5043 5044 2009-05-22 Simon Hausmann <simon.hausmann@nokia.com> 5045 5046 Unreviewed Qt build fix. 5047 5048 Provide dummy implementation of pure virtual EditorClient method. 5049 5050 * WebCoreSupport/EditorClientQt.cpp: 5051 (WebCore::EditorClientQt::getAutoCorrectSuggestionForMisspelledWord): 5052 * WebCoreSupport/EditorClientQt.h: 5053 5054 2009-05-20 Ariya Hidayat <ariya.hidayat@nokia.com> 5055 5056 Reviewed by Simon Hausmann and Holger Freyther. 5057 5058 [Qt] Add renderHints property to QWebView. 5059 5060 * Api/qwebview.cpp: 5061 (QWebViewPrivate::QWebViewPrivate): 5062 (QWebView::renderHints): 5063 (QWebView::setRenderHints): 5064 (QWebView::setRenderHint): 5065 (QWebView::paintEvent): 5066 * Api/qwebview.h: 5067 * tests/qwebview/qwebview.pro: Added. 5068 * tests/qwebview/tst_qwebview.cpp: Added. 5069 (tst_QWebView::tst_QWebView): 5070 (tst_QWebView::~tst_QWebView): 5071 (tst_QWebView::init): 5072 (tst_QWebView::cleanup): 5073 (tst_QWebView::renderHints): 5074 * tests/tests.pro: 5075 5076 2009-05-20 Holger Hans Peter Freyther <zecke@selfish.org> 5077 5078 Reviewed by Darin Adler. 5079 5080 https://bugs.webkit.org/show_bug.cgi?id=25834 5081 5082 Make ChromeClient a interface again 5083 5084 With recent additions to ChromeClient.h empty defaults were 5085 added. This is bad for porters as these changes go unnoticed 5086 and at runtime no notImplemented warning is logged and grepping 5087 for notImplemented will not show anything. Change this Client 5088 to be like the other Clients again and always have pure virtuals 5089 (but for stuff inside #ifdef PLATFORM(MAC)). 5090 5091 Update the various WebKit/* implementations to compile again. 5092 5093 * WebCoreSupport/ChromeClientQt.cpp: 5094 (WebCore::ChromeClientQt::setCursor): 5095 (WebCore::ChromeClientQt::requestGeolocationPermissionForFrame): 5096 * WebCoreSupport/ChromeClientQt.h: 5097 (WebCore::ChromeClientQt::scrollRectIntoView): 5098 5099 2009-05-19 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 5100 5101 Reviewed by Simon Hausmann. 5102 5103 Fix a plugin bug in the WebKit code, similar to the one in WebCore. 5104 5105 The problem is when a non visible QtPluginWidget would show it self 5106 in a sibling frame. The problem was due to our clipping. In Qt, 5107 if setMask is set with an empty QRegion, no clipping will 5108 be performed, so in that case we hide the PluginContainer 5109 5110 * WebCoreSupport/FrameLoaderClientQt.cpp: 5111 (WebCore::): 5112 5113 2009-05-18 Zoltan Horvath <horvath.zoltan.6@stud.u-szeged.hu> 5114 5115 Reviewed by Ariya Hidayat. 5116 5117 Makes QtLauncher to accept multiple urls in command line and opens these in separate windows. 5118 5119 * QtLauncher/main.cpp: 5120 (MainWindow::newWindow): 5121 (main): 5122 5123 2009-05-14 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 5124 5125 Reviewed by Ariya Hidayat. 5126 5127 Add a comment to QWebView::iconChanged(), mentioning that you will 5128 need to set the icon database path for icons to be loaded, and thus 5129 receive the signal. 5130 5131 * Api/qwebview.cpp: 5132 5133 2009-05-14 Yael Aharon <yael.aharon@nokia.com> 5134 5135 Reviewed by Ariya Hidayat. 5136 5137 Fix setHtml test case by adding <head> tag to the expected result. This tag is automatically added by WebKit. 5138 5139 * tests/qwebframe/tst_qwebframe.cpp: 5140 5141 2009-05-14 Yael Aharon <yael.aharon@nokia.com> 5142 5143 Reviewed by Ariya Hidayat. 5144 5145 Add a test case for the signal urlChanged(). 5146 * tests/qwebframe/tst_qwebframe.cpp: 5147 5148 2009-05-13 Yael Aharon <yael.aharon@nokia.com> 5149 5150 Reviewed by Ariya Hidayat. 5151 5152 Move emitting the signal QWebFrame::urlChanged to FrameLoaderClientQt::dispatchDidCommitLoad(). 5153 This is to ensure that urlChanged() is emitted even if the frame has no title. 5154 5155 * WebCoreSupport/FrameLoaderClientQt.cpp: 5156 (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle): 5157 (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad): 5158 5159 2009-05-13 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 5160 5161 Rubberstamped by Ariya Hidayat. 5162 5163 Fix coding style: Add {} to contents of if, containing a for loop. 5164 5165 * Api/qwebelement.cpp: 5166 (QWebElement::styleProperty): 5167 5168 2009-05-12 Antonio Gomes <antonio.gomes@openbossa.org> 5169 5170 Reviewed by Ariya Hidayat. 5171 5172 Fixed a possible crash @styleProperty when there is no embedded/external CSS set. 5173 5174 * Api/qwebelement.cpp: 5175 (QWebElement::styleProperty): 5176 * tests/qwebelement/tst_qwebelement.cpp: 5177 (tst_QWebElement::style): 5178 5179 2009-05-12 Antonio Gomes <antonio.gomes@openbossa.org> 5180 5181 Reviewed by Ariya Hidayat. 5182 5183 Added external CSS test cases to QWebElement::styleProperty() method. 5184 5185 Also some ::styleProperty() tests cleanup. 5186 5187 * tests/qwebelement/tst_qwebelement.cpp: 5188 (tst_QWebElement::style): 5189 5190 2009-05-12 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 5191 5192 Reviewed by Ariya Hidayat. 5193 5194 Many methods were not considering the case of the element not having 5195 siblings or children when inserting nodes, and thus broke in some 5196 situations. This patch fixes that. 5197 5198 * Api/qwebelement.cpp: 5199 (QWebElement::prependInside): 5200 (QWebElement::appendOutside): 5201 (QWebElement::encloseWith): 5202 5203 2009-05-08 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 5204 5205 Reviewed by Ariya Hidayat. 5206 5207 Make is possible to mark a style property as important while setting 5208 it. Also support the normal CSS property syntax "!important", while 5209 accepting spaces between the ! and the important keyword. 5210 5211 * Api/qwebelement.cpp: 5212 (QWebElement::setStyleProperty): 5213 * Api/qwebelement.h: 5214 * tests/qwebelement/tst_qwebelement.cpp: 5215 (tst_QWebElement::style): 5216 5217 2009-05-08 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 5218 5219 Reviewed by Ariya Hidayat. 5220 5221 Working with Antonio Gomes. 5222 5223 Add support for finding the style property actually applied to the element. 5224 5225 * Api/qwebelement.cpp: 5226 (QWebElement::styleProperty): 5227 * Api/qwebelement.h: 5228 * tests/qwebelement/tst_qwebelement.cpp: 5229 (tst_QWebElement::style): 5230 5231 2009-05-11 Norbert Leser <norbert.leser@nokia.com> 5232 5233 Reviewed by Darin Adler. 5234 5235 Bug 24538: class/struct mixup in forward declarations 5236 https://bugs.webkit.org/show_bug.cgi?id=24538 5237 5238 * Api/qwebpage.h: 5239 5240 2009-05-11 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5241 5242 Reviewed by Holger Freyther. 5243 5244 Fix Qt build when ENABLE_DATABASE is turned off 5245 5246 https://bugs.webkit.org/show_bug.cgi?id=25587 5247 5248 * Api/qwebdatabase.cpp: 5249 (QWebDatabase::displayName): 5250 (QWebDatabase::expectedSize): 5251 (QWebDatabase::size): 5252 (QWebDatabase::fileName): 5253 (QWebDatabase::removeDatabase): 5254 * Api/qwebdatabase_p.h: 5255 * Api/qwebsecurityorigin.cpp: 5256 (QWebSecurityOrigin::allOrigins): 5257 (QWebSecurityOrigin::databases): 5258 5259 2009-05-05 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 5260 5261 Reviewed by Simon Hausmann. 5262 5263 Improve behaviour of the QWebElement enclose* functions, to work 5264 similar to the jQuery wrap functions. We now enclose the contents 5265 of the element in the child of the deepest descendant element 5266 within the structure of the enclose element structure given. 5267 5268 * Api/qwebelement.cpp: 5269 (findInsertionPoint): 5270 (QWebElement::encloseContentsWith): 5271 (QWebElement::encloseWith): 5272 (QWebElement::replace): 5273 * tests/qwebelement/tst_qwebelement.cpp: 5274 (tst_QWebElement::encloseContentsWith): 5275 (tst_QWebElement::encloseWith): 5276 5277 2009-05-06 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 5278 5279 Reviewed by Simon Hausmann. 5280 5281 After commit rev @43215, setHtml() without a <head> tag, 5282 automatically adds it, so update our test case to respect this. 5283 5284 * tests/qwebelement/tst_qwebelement.cpp: 5285 (tst_QWebElement::textHtml): 5286 5287 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com> 5288 5289 Unreviewed Qt build fix. 5290 5291 Dont' use ENABLE() in Qt API headers, as they are not available when building 5292 against the API. 73 5293 74 5294 * Api/qwebdatabase.h: 75 5295 * Api/qwebsecurityorigin.h: 76 5296 77 2009-03-19 David Boddie <dboddie@trolltech.com> 78 79 Reviewed by Simon Hausmann. 80 81 Doc: Removed obsolete warning about Flash and other plugins. 82 83 * Api/qwebsettings.cpp: 84 85 2009-03-19 Paul Olav Tvete <paul.tvete@nokia.com> 86 87 Reviewed by Simon Hausmann. 88 89 Properly escape tooltip text 90 91 ManualTest: http://xkcd.com/554/ 92 5297 2009-05-05 Ben Murdoch <benm@google.com> 5298 5299 Reviewed by Eric Seidel. 5300 5301 Add #if ENABLE(DATABASE) guards around database code so toggling ENABLE_DATABASE off does not break builds. 5302 https://bugs.webkit.org/show_bug.cgi?id=24776 5303 5304 * Api/qwebdatabase.cpp: 5305 * Api/qwebdatabase.h: 5306 * Api/qwebdatabase_p.h: 5307 * Api/qwebsecurityorigin.cpp: 5308 (QWebSecurityOrigin::databaseUsage): 5309 (QWebSecurityOrigin::databaseQuota): 5310 (QWebSecurityOrigin::setDatabaseQuota): 5311 * Api/qwebsecurityorigin.h: 93 5312 * WebCoreSupport/ChromeClientQt.cpp: 94 (WebCore::ChromeClientQt::setToolTip): 95 96 2009-03-03 Ariya Hidayat <ariya.hidayat@trolltech.com> 97 98 Rubber-stamped by Simon Hausmann. 99 100 [Qt] Create and update the action for SelectAll. 101 102 * Api/qwebpage.cpp: 103 (QWebPagePrivate::updateAction): 104 (QWebPagePrivate::updateEditorActions): 105 (QWebPage::action): 106 * tests/qwebpage/tst_qwebpage.cpp: 107 (tst_QWebPage::textSelection): 108 109 2009-02-25 Kavindra Palaraja <kavindra.palaraja@nokia.com> 110 111 Reviewed by Simon Hausmann. 112 113 Fix the documentation for the linkHovered signal. 114 115 * Api/qwebpage.cpp: 116 117 2009-02-23 Thiago Macieira <thiago.macieira@nokia.com> 118 119 Reviewed by Simon Hausmann. 120 121 Fix the Copyright notices in a few files 122 123 * WebKit_pch.h: 124 125 2008-12-13 Holger Hans Peter Freyther <zecke@selfish.org> 126 127 Reviewed by NOBODY (OOPS!). 5313 (WebCore::ChromeClientQt::exceededDatabaseQuota): 5314 * WebCoreSupport/ChromeClientQt.h: 5315 5316 2009-05-05 Simon Hausmann <simon.hausmann@nokia.com> 5317 5318 Reviewed by Tor Arne VestbÞ. 5319 5320 Various improvements to the class documentation, including a simple snippet for QWebElement. 5321 5322 * Api/qwebelement.cpp: 5323 * Api/qwebframe.cpp: 5324 * docs/webkitsnippets/webelement/main.cpp: Added. 5325 * docs/webkitsnippets/webelement/webelement.pro: Added. 5326 5327 2009-05-05 Simon Hausmann <simon.hausmann@nokia.com> 5328 5329 Reviewed by Ariya Hidayat. 5330 5331 Simplify variant conversion by moving the null check into 5332 convertValueToQVariant. 5333 5334 * Api/qwebframe.cpp: 5335 (QWebFrame::evaluateJavaScript): Moved null check into conversion function. 5336 * tests/qwebframe/tst_qwebframe.cpp: 5337 Added test to verify the correct conversion of null values to QVariant. 5338 5339 2009-05-01 Geoffrey Garen <ggaren@apple.com> 5340 5341 Rubber Stamped by Sam Weinig. 5342 5343 Renamed JSValuePtr => JSValue. 5344 5345 * Api/qwebelement.cpp: 5346 (setupScriptContext): 5347 (setupScriptObject): 5348 (QWebElement::evaluateScript): 5349 (QWebElement::functions): 5350 (QWebElement::scriptableProperty): 5351 (QWebElement::setScriptableProperty): 5352 (QWebElement::scriptableProperties): 5353 5354 2009-05-01 Pavel Feldman <pfeldman@chromium.org> 5355 5356 Reviewed by Timothy Hatcher. 5357 5358 Add a FrameLoaderClient callback for the ResourceRetrievedByXMLHttpRequest. 5359 5360 https://bugs.webkit.org/show_bug.cgi?id=25347 5361 5362 * WebCoreSupport/FrameLoaderClientQt.cpp: 5363 (WebCore::FrameLoaderClientQt::dispatchDidLoadResourceByXMLHttpRequest): 5364 * WebCoreSupport/FrameLoaderClientQt.h: 5365 5366 2009-04-30 David Kilzer <ddkilzer@apple.com> 5367 5368 Provide a mechanism to create a quirks delegate for HTMLParser 5369 5370 Reviewed by David Hyatt. 5371 5372 * WebCoreSupport/ChromeClientQt.h: 5373 (WebCore::ChromeClientQt::createHTMLParserQuirks): Added. The 5374 default implementation of this factory method returns 0. 5375 5376 2009-04-30 Ariya Hidayat <ariya.hidayat@nokia.com> 5377 5378 Unreviewed build fix after r43072. 5379 5380 * Api/qwebframe.cpp: 5381 (qt_drt_setJavaScriptProfilingEnabled): Enclose with JAVASCRIPT_DEBUGGER. 5382 5383 2009-04-30 Ariya Hidayat <ariya.hidayat@nokia.com> 5384 5385 Unreviewed build fix after r43063. 5386 5387 * WebCoreSupport/ChromeClientQt.cpp: 5388 (WebCore::ChromeClientQt::addMessageToConsole): 5389 * WebCoreSupport/ChromeClientQt.h: 5390 5391 2009-04-30 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 5392 5393 Reviewed by Simon Hausmann. 5394 5395 Implement encloseContentsWith and rename wrap to encloseWith. 5396 5397 Also in encloseWith, make sure that you cannot enclose with 5398 non-enclosable elements. 5399 5400 * Api/qwebelement.cpp: 5401 (QWebElement::encloseContentsWith): 5402 (QWebElement::encloseWith): 5403 * Api/qwebelement.h: 5404 * tests/qwebelement/tst_qwebelement.cpp: 5405 (tst_QWebElement::encloseContentsWith): 5406 (tst_QWebElement::encloseWith): 5407 5408 2009-04-30 Holger Hans Peter Freyther <zecke@selfish.org> 5409 5410 Reviewed by Darin Adler. 128 5411 129 5412 The Qt API exposes a global history patch CSSStyleSelector to make API consumers work again … … 162 5445 * tests/tests.pro: 163 5446 5447 2009-04-30 Ariya Hidayat <ariya.hidayat@nokia.com> 5448 5449 Unreviewed build fix, after r43035. 5450 5451 Temporarily use Position::deprecatedEditingOffset(). 5452 5453 * Api/qwebpage.cpp: 5454 (QWebPage::inputMethodQuery): 5455 5456 2009-03-27 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 5457 5458 Reviewed by Simon Hausmann. 5459 5460 Update the page actions when a finishing loading even if the frame is 5461 not the top frame such as when browsing inside of a website with frames. 5462 https://bugs.webkit.org/show_bug.cgi?id=24890 5463 5464 * WebCoreSupport/FrameLoaderClientQt.cpp: 5465 (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad): 5466 * tests/qwebpage/frametest/frame_a.html: Added. 5467 * tests/qwebpage/frametest/index.html: Added. 5468 * tests/qwebpage/tst_qwebpage.cpp: 5469 (tst_QWebPage::backActionUpdate): 5470 5471 2009-04-29 Ariya Hidayat <ariya.hidayat@nokia.com> 5472 5473 Reviewed by Simon Hausmann. 5474 5475 Implement QWebElement::evaluateScript. 5476 5477 * Api/qwebelement.cpp: 5478 (setupScriptContext): 5479 (QWebElement::evaluateScript): 5480 * Api/qwebelement.h: 5481 * tests/qwebelement/tst_qwebelement.cpp: 5482 (tst_QWebElement::evaluateScript): 5483 5484 2009-04-29 Simon Hausmann <simon.hausmann@nokia.com> 5485 5486 Reviewed by Ariya Hidayat. 5487 5488 Replaced QWebElementCollection with QList<QWebElement>. 5489 5490 * Api/qwebelement.cpp: 5491 (QWebElement::findAll): 5492 * Api/qwebelement.h: 5493 * Api/qwebframe.cpp: 5494 (QWebFrame::findAllElements): 5495 * Api/qwebframe.h: 5496 * QtLauncher/main.cpp: 5497 (MainWindow::selectElements): 5498 * tests/qwebelement/tst_qwebelement.cpp: 5499 (tst_QWebElement::simpleCollection): 5500 (tst_QWebElement::namespaceURI): 5501 (tst_QWebElement::nullSelect): 5502 5503 2009-04-28 Simon Hausmann <simon.hausmann@nokia.com> 5504 5505 Reviewed by Tor Arne VestbÞ. 5506 5507 QWebElement API changes after another round of API review: 5508 5509 * Fix argument names of findAll/findFirst 5510 * Split up toXml into innerXml and outerXml 5511 * Removed confusing toggleClass overload 5512 * Fixed casing of namespaceUri to follow QXmlStreamReader 5513 * Removed tagName from firstChild/nextSibling/etc. 5514 * Renamed append/prepend/insertAfter/insertBefore to [append|prepend][Inside|Outside] 5515 * Renamed wrapWith() back to wrap() 5516 * Made clone() const 5517 * Renamed remove() to takeFromDocument(), added removeFromDocument() 5518 * Renamed clear() to removeChildren() 5519 * Renamed scriptsFunctions/callScriptFunction to functions()/callFunction() 5520 * Renamed scriptProperty to scriptableProperty 5521 5522 * Api/qwebelement.cpp: 5523 (QWebElement::findAll): 5524 (QWebElement::findFirst): 5525 (QWebElement::setOuterXml): 5526 (QWebElement::toOuterXml): 5527 (QWebElement::setInnerXml): 5528 (QWebElement::toInnerXml): 5529 (QWebElement::namespaceUri): 5530 (QWebElement::firstChild): 5531 (QWebElement::lastChild): 5532 (QWebElement::nextSibling): 5533 (QWebElement::previousSibling): 5534 (QWebElement::callFunction): 5535 (QWebElement::functions): 5536 (QWebElement::scriptableProperty): 5537 (QWebElement::setScriptableProperty): 5538 (QWebElement::scriptableProperties): 5539 (QWebElement::appendInside): 5540 (QWebElement::prependInside): 5541 (QWebElement::prependOutside): 5542 (QWebElement::appendOutside): 5543 (QWebElement::clone): 5544 (QWebElement::takeFromDocument): 5545 (QWebElement::removeFromDocument): 5546 (QWebElement::removeChildren): 5547 (QWebElement::wrap): 5548 (QWebElement::replace): 5549 * Api/qwebelement.h: 5550 * Api/qwebframe.cpp: 5551 (QWebFrame::findAllElements): 5552 (QWebFrame::findFirstElement): 5553 * Api/qwebframe.h: 5554 * tests/qwebelement/tst_qwebelement.cpp: 5555 (tst_QWebElement::textHtml): 5556 (tst_QWebElement::classes): 5557 (tst_QWebElement::namespaceURI): 5558 (tst_QWebElement::foreachManipulation): 5559 (tst_QWebElement::callFunction): 5560 (tst_QWebElement::callFunctionSubmitForm): 5561 (tst_QWebElement::functionNames): 5562 (tst_QWebElement::properties): 5563 (tst_QWebElement::appendAndPrepend): 5564 (tst_QWebElement::insertBeforeAndAfter): 5565 (tst_QWebElement::remove): 5566 (tst_QWebElement::clear): 5567 (tst_QWebElement::replaceWith): 5568 5569 2009-04-28 Simon Hausmann <simon.hausmann@nokia.com> 5570 5571 Reviewed by Tor Arne VestbÞ. 5572 5573 Fix some qdoc warnings. 5574 5575 * Api/qwebframe.cpp: Fix links. 5576 * Api/qwebnetworkinterface.cpp: Make docs internal. 5577 * Api/qwebnetworkinterface.h: Ditto. 5578 * Api/qwebpage.cpp: Fix property name in \property. 5579 5580 2009-04-24 Simon Hausmann <simon.hausmann@nokia.com> 5581 5582 Rubber-stamped by Ariya Hidayat. 5583 5584 Fix qdoc warning about link to QAction::isEnabled. 5585 5586 * Api/qwebpage.cpp: 5587 5588 2009-04-24 Simon Hausmann <simon.hausmann@nokia.com> 5589 5590 Reviewed by Ariya Hidayat. 5591 5592 Added support for generating API docs in the Qt build using "make docs" 5593 5594 Added code snippets and overview from the Qt sources references in the API docs. 5595 5596 * Api/qwebpage.cpp: Adjust paths to snippets. 5597 * Api/qwebview.cpp: Ditto. 5598 * docs/docs.pri: Added. 5599 * docs/qtwebkit.qdoc: Added. 5600 * docs/qtwebkit.qdocconf: Added. 5601 * docs/webkitsnippets/qtwebkit_build_snippet.qdoc: Added. 5602 * docs/webkitsnippets/qtwebkit_qwebview_snippet.cpp: Added. 5603 * docs/webkitsnippets/simple/main.cpp: Added. 5604 * docs/webkitsnippets/simple/simple.pro: Added. 5605 * docs/webkitsnippets/webpage/main.cpp: Added. 5606 * docs/webkitsnippets/webpage/webpage.pro: Added. 5607 5608 2009-04-23 Antonio Gomes <antonio.gomes@openbossa.org> 5609 5610 Reviewed by Ariya Hidayat. 5611 5612 [Qt] Added QWebElement::computedStyleProperty method. 5613 5614 * Api/qwebelement.cpp: 5615 (QWebElement::computedStyleProperty): 5616 * Api/qwebelement.h: 5617 * tests/qwebelement/tst_qwebelement.cpp: 5618 (tst_QWebElement::computedStyle): 5619 5620 2009-04-23 Tor Arne VestbÞ <tor.arne.vestbo@nokia.com> 5621 5622 Rubber-stamped by Ariya Hidayat. 5623 5624 [Qt] Rename QWebElement arguments from html to markup 5625 5626 * Api/qwebelement.cpp: 5627 (QWebElement::append): 5628 (QWebElement::prepend): 5629 (QWebElement::insertBefore): 5630 (QWebElement::insertAfter): 5631 * Api/qwebelement.h: 5632 5633 2009-04-21 Antonio Gomes <antonio.gomes@openbossa.org> 5634 5635 Reviewed by Ariya Hidayat. 5636 5637 QWebElementSelection renamed to QWebElementCollection. 5638 5639 * Api/qwebelement.cpp: 5640 (QWebElement::findAll): 5641 (QWebElementCollectionPrivate::QWebElementCollectionPrivate): 5642 (QWebElementCollectionPrivate::create): 5643 (QWebElementCollection::QWebElementCollection): 5644 (QWebElementCollection::operator=): 5645 (QWebElementCollection::~QWebElementCollection): 5646 (QWebElementCollection::operator+): 5647 (QWebElementCollection::append): 5648 (QWebElementCollection::count): 5649 (QWebElementCollection::at): 5650 (QWebElementCollection::toList): 5651 * Api/qwebelement.h: 5652 * Api/qwebframe.cpp: 5653 (QWebFrame::findAllElements): 5654 * Api/qwebframe.h: 5655 * QtLauncher/main.cpp: 5656 (MainWindow::selectElements): 5657 * tests/qwebelement/tst_qwebelement.cpp: 5658 (tst_QWebElement::simpleCollection): 5659 (tst_QWebElement::iteration): 5660 (tst_QWebElement::emptyCollection): 5661 (tst_QWebElement::appendCollection): 5662 (tst_QWebElement::nullSelect): 5663 5664 2009-04-17 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5665 5666 Reviewed by Simon Hausmann. 5667 5668 https://bugs.webkit.org/show_bug.cgi?id=25242 5669 5670 Remove QtCore 4.5 dependency from QWebElement test 5671 5672 * tests/qwebelement/tst_qwebelement.cpp: 5673 (tst_QWebElement::iteration): Use QList::count() instead of QList::length() 5674 5675 2009-04-16 Holger Hans Peter Freyther <zecke@selfish.org> 5676 5677 Rubber-stamped by Simon Hausmann. 5678 5679 Make the operator== and operator!= non inline to 5680 allow looking at the d-pointer in the future. 5681 5682 * Api/qwebelement.cpp: 5683 (QWebElement::operator==): 5684 (QWebElement::operator!=): 5685 * Api/qwebelement.h: 5686 5687 2009-04-15 Antonio Gomes <antonio.gomes@openbossa.org> 5688 5689 Reviewed by Ariya Hidayat. 5690 5691 Rename extend() method in QWebElementSelection to append(). 5692 5693 * Api/qwebelement.cpp: 5694 (QWebElementSelection::append): 5695 * Api/qwebelement.h: 5696 * tests/qwebelement/tst_qwebelement.cpp: 5697 (tst_QWebElement::appendSelection): 5698 5699 2009-04-15 Antonio Gomes <antonio.gomes@openbossa.org> 5700 5701 Reviewed by Simon Hausmann. 5702 5703 Fixed nit/typo in QWebElement documentation. 5704 5705 * Api/qwebelement.cpp: 5706 5707 2009-04-14 Laszlo Gombos <laszlo.1.gombos@nokia.com> 5708 5709 Reviewed by Simon Hausmann. 5710 5711 https://bugs.webkit.org/show_bug.cgi?id=24841 5712 5713 Fix linking against QtWebKit for Symbian and other platforms 5714 where the OS ABI distinguishes between an import or an export situation. 5715 5716 * Api/qwebkitglobal.h: Instead of white-listing Win, remove the test. 5717 5718 2009-04-14 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 5719 5720 Reviewed by Tor Arne VestbÞ. 5721 5722 Rename QWebElement::setHtml and html to setXml and toXml respectivily. 5723 5724 Also add a mean to define the scope (inner or other). 5725 5726 * Api/qwebelement.cpp: 5727 (QWebElement::setXml): 5728 (QWebElement::toXml): 5729 * Api/qwebelement.h: 5730 * tests/qwebelement/tst_qwebelement.cpp: 5731 (tst_QWebElement::textHtml): 5732 (tst_QWebElement::foreachManipulation): 5733 5734 2009-04-14 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org> 5735 5736 Reviewed by Tor Arne VestbÞ. 5737 5738 Rename QWebElement::setText() and text() to ::setPlainText and 5739 ::toPlainText, respectively. 5740 5741 * Api/qwebelement.cpp: 5742 (QWebElement::setPlainText): 5743 (QWebElement::toPlainText): 5744 * Api/qwebelement.h: 5745 * tests/qwebelement/tst_qwebelement.cpp: 5746 (tst_QWebElement::textHtml): 5747 (tst_QWebElement::simpleSelection): 5748 (tst_QWebElement::appendAndPrepend): 5749 (tst_QWebElement::insertBeforeAndAfter): 5750 (tst_QWebElement::replaceWith): 5751 (tst_QWebElement::wrap): 5752 (tst_QWebElement::firstChildNextSiblingWithTag): 5753 (tst_QWebElement::lastChildPreviousSiblingWithTag): 5754 5755 2009-04-06 Tor Arne VestbÞ <tor.arne.vestbo@nokia.com> 5756 5757 Reviewed by Simon Hausmann. 5758 5759 [Qt] Rename DOM API select function to findFirst, findAll, etc. 5760 5761 * Api/qwebelement.cpp: 5762 (QWebElement::findAll): 5763 (QWebElement::findFirst): 5764 * Api/qwebelement.h: 5765 * Api/qwebframe.cpp: 5766 (QWebFrame::findAllElements): 5767 (QWebFrame::findFirstElement): 5768 * Api/qwebframe.h: 5769 * QtLauncher/main.cpp: 5770 (MainWindow::selectElements): 5771 * tests/qwebelement/tst_qwebelement.cpp: 5772 (tst_QWebElement::simpleSelection): 5773 (tst_QWebElement::attributesNS): 5774 (tst_QWebElement::classes): 5775 (tst_QWebElement::namespaceURI): 5776 (tst_QWebElement::iteration): 5777 (tst_QWebElement::foreachManipulation): 5778 (tst_QWebElement::callFunctionSubmitForm): 5779 (tst_QWebElement::documentElement): 5780 (tst_QWebElement::frame): 5781 (tst_QWebElement::style): 5782 (tst_QWebElement::extendSelection): 5783 (tst_QWebElement::properties): 5784 (tst_QWebElement::appendAndPrepend): 5785 (tst_QWebElement::insertBeforeAndAfter): 5786 (tst_QWebElement::remove): 5787 (tst_QWebElement::clear): 5788 (tst_QWebElement::replaceWith): 5789 (tst_QWebElement::wrap): 5790 (tst_QWebElement::nullSelect): 5791 (tst_QWebElement::firstChildNextSibling): 5792 (tst_QWebElement::firstChildNextSiblingWithTag): 5793 (tst_QWebElement::lastChildPreviousSibling): 5794 (tst_QWebElement::lastChildPreviousSiblingWithTag): 5795 5796 2009-04-06 Simon Hausmann <simon.hausmann@nokia.com> 5797 Ariya Hidayat <ariya.hidayat@nokia.com> 5798 Tor Arne VestbÞ <tor.arne.vestbo@nokia.com> 5799 Genevieve Mak <gen@staikos.net> 5800 5801 Reviewed by Tor Arne VestbÞ, Simon Hausmann 5802 5803 First revision of new API in the Qt port to access the DOM. 5804 5805 * Api/headers.pri: Added qwebelement.h to the API headers. 5806 * Api/qwebelement.cpp: Added. 5807 * Api/qwebelement.h: Added. 5808 * Api/qwebframe.cpp: 5809 (QWebFrame::documentElement): Added accessor for the document element. 5810 (QWebFrame::selectElements): Added convenienc query method. 5811 (QWebFrame::selectElement): Ditto. 5812 (QWebHitTestResult::element): Added accessor for underlying DOM element. 5813 * Api/qwebframe.h: 5814 * QtLauncher/main.cpp: Simple test gui for element selections. 5815 * tests/qwebelement/qwebelement.pro: Added. 5816 * tests/qwebelement/tst_qwebelement.cpp: Added. 5817 * tests/tests.pro: Added QWebElement & QWebElementSelection unit tests. 5818 5819 2009-04-02 Simon Hausmann <simon.hausmann@nokia.com> 5820 5821 Fix the Qt build. 5822 5823 * Api/qwebpage.cpp: 5824 (QWebPage::triggerAction): Adapted code to renamed loadFrameRequest function. 5825 5826 2009-04-02 Takumi Asaki <takumi.asaki@nokia.com> 5827 5828 Reviewed by Simon Hausmann. 5829 5830 Fix pre-edit handling of text fields with input methods. 5831 5832 The input method sends an empty preeditString() if all characters of 5833 the preedit should be deleted. So inputMethodEvent() has to use 5834 preeditString() if it's empty. 5835 5836 * Api/qwebpage.cpp: 5837 (QWebPagePrivate::inputMethodEvent): 5838 5839 2009-03-30 Simon Hausmann <simon.hausmann@nokia.com> 5840 5841 Rubber-stamped by Tor Arne VestbÞ. 5842 5843 Document that setHtml/setContent loads only the html/data immediately, not external objects. 5844 5845 * Api/qwebframe.cpp: 5846 * Api/qwebview.cpp: 5847 5848 2009-03-29 Darin Adler <darin@apple.com> 5849 5850 Try to fix Qt build. 5851 5852 * WebCoreSupport/EditorClientQt.cpp: Added include of HTMLElement.h. 5853 5854 * WebCoreSupport/FrameLoaderClientQt.cpp: Added include of FormState.h. 5855 (WebCore::FrameLoaderClientQt::prepareForDataSourceReplacement): 5856 Removed unneeded call to detachChildren, which is called by FrameLoader 5857 right after this. 5858 (WebCore::FrameLoaderClientQt::createFrame): Use loadURLIntoChildFrame 5859 as other platforms do in the corresponding functions. 5860 5861 2009-03-27 Erik L. Bunce <elbunce@xendom.com> 5862 5863 Reviewed by Simon Hausmann. 5864 5865 https://bugs.webkit.org/show_bug.cgi?id=24869 5866 5867 Fixes an incorrect case in tst_qwebpage. 5868 5869 * tests/qwebpage/tst_qwebpage.cpp: 5870 (tst_QWebPage::cursorMovements): 5871 5872 2009-03-27 Erik L. Bunce <elbunce@xendom.com> 5873 5874 Reviewed by Simon Hausmann. 5875 5876 https://bugs.webkit.org/show_bug.cgi?id=24746 5877 5878 Add new editing related QWebPage::WebActions 5879 * Clipboard: PasteAndMatchStyle 5880 * Formatting: RemoveFormat, ToggleStrikethrough, ToggleSubscript, and 5881 ToggleSuperscript 5882 * List Editing: InsertUnorderedList, InsertOrderedList, Indent, Outdent 5883 * Paragraph Justification: AlignCenter, AlignJustified, AlignLeft, AlignRight 5884 5885 Improved selection and editing tests. 5886 5887 * Api/qwebpage.cpp: 5888 (QWebPagePrivate::updateEditorActions): 5889 (QWebPage::action): 5890 * Api/qwebpage.h: 5891 * tests/qwebpage/tst_qwebpage.cpp: 5892 (tst_QWebPage::textSelection): 5893 (tst_QWebPage::textEditing): 5894 5895 2009-03-26 Simon Hausmann <simon.hausmann@nokia.com> 5896 5897 Rubber-stamped by Tor Arne VestbÞ. 5898 5899 Fix the documentation of the QLocale usage in userAgentForUrl. 5900 5901 * Api/qwebpage.cpp: 5902 5903 2009-03-20 Erik L. Bunce <elbunce@xendom.com> 5904 5905 Reviewed by Simon Hausmann. 5906 5907 Fix for InsertParagraphSeparator and InsertLineSeparator so that 5908 QWebPage::action() creates QActions for them. Also make sure they get 5909 updated appropriately. 5910 5911 * Api/qwebpage.cpp: 5912 (QWebPagePrivate::updateEditorActions): 5913 (QWebPage::action): 5914 * tests/qwebpage/tst_qwebpage.cpp: 5915 (tst_QWebPage::textEditing): 5916 5917 2009-03-20 Erik L. Bunce <elbunce@xendom.com> 5918 5919 Reviewed by Tor Arne VestbÞ. 5920 5921 Fix QWebPage::WebActions action states to more closely match when they are 5922 actually applicable and remove erroneous documentation. 5923 5924 * Most WebActions implemented using editor commands now use the 5925 Editor::Command::isEnabled() to control their availability. 5926 * SelectAll is always enabled (since it's editor command is). 5927 * SetTextDirection{} family of WebActions are available when canEdit() is true 5928 and not just canEditRichly(). 5929 5930 Fix and clarify documentation about the availability of various web actions. 5931 5932 * Api/qwebpage.cpp: 5933 (QWebPagePrivate::updateAction): 5934 (QWebPagePrivate::updateEditorActions): 5935 * tests/qwebpage/tst_qwebpage.cpp: 5936 (tst_QWebPage::textSelection): 5937 5938 2009-03-19 Ariya Hidayat <ariya.hidayat@trolltech.com> 5939 5940 Reviewed by Simon Hausmann. 5941 5942 Fixes pedantic compilation in QtWebKit. 5943 5944 There are no semi-colons after namespace declarations. 5945 5946 * Api/qwebdatabase.h: 5947 * Api/qwebsecurityorigin.h: 5948 5949 2009-03-19 David Boddie <dboddie@trolltech.com> 5950 5951 Reviewed by Simon Hausmann. 5952 5953 Doc: Removed obsolete warning about Flash and other plugins. 5954 5955 * Api/qwebsettings.cpp: 5956 5957 2009-03-19 Paul Olav Tvete <paul.tvete@nokia.com> 5958 5959 Reviewed by Simon Hausmann. 5960 5961 Properly escape tooltip text 5962 5963 ManualTest: http://xkcd.com/554/ 5964 5965 * WebCoreSupport/ChromeClientQt.cpp: 5966 (WebCore::ChromeClientQt::setToolTip): 5967 5968 2009-03-10 Adam Treat <adam.treat@torchmobile.com> 5969 5970 Build fix for Qt after r41555. 5971 5972 * Api/qwebpage.cpp: 5973 (QWebPage::acceptNavigationRequest): 5974 5975 2009-03-10 Xan Lopez <xlopez@igalia.com> 5976 5977 Build fix, no review. 5978 5979 * Api/qwebpage.cpp: 5980 (QWebPage::inputMethodQuery): 5981 5982 2009-03-07 Adam Treat <adam.treat@torchmobile.com> 5983 5984 Reviewed by Cameron Zwarich. 5985 5986 These methods are clearly returning the wrong values as the two were 5987 returning swapped information. 5988 5989 * Api/qwebpage.cpp: 5990 (QWebPage::totalBytes): 5991 (QWebPage::bytesReceived): 5992 5993 2009-03-05 Ariya Hidayat <ariya.hidayat@nokia.com> 5994 5995 Rubber-stamped by Simon Hausmann. 5996 5997 [Qt] NPAPI plugins are supported, adjust the API documentation. 5998 5999 * Api/qwebsettings.cpp: 6000 6001 2009-03-04 Adam Barth <abath@webkit.org> 6002 6003 Reviewed by Alexey Proskuryakov. 6004 6005 https://bugs.webkit.org/show_bug.cgi?id=24356 6006 6007 Fix WebKit style for allowUniversalAccessFromFileURLs. 6008 6009 * Api/qwebsettings.cpp: 6010 (QWebSettingsPrivate::apply): 6011 6012 2009-03-03 Adam Barth <abarth@webkit.org> 6013 6014 Reviewed by Alexey Proskuryakov. 6015 6016 https://bugs.webkit.org/show_bug.cgi?id=24340 6017 6018 Expose AllowUniversalAccessFromFileUrls to Qt clients. 6019 6020 * Api/qwebsettings.cpp: 6021 (QWebSettingsPrivate::apply): 6022 (QWebSettings::QWebSettings): 6023 * Api/qwebsettings.h: 6024 6025 2009-03-03 Ariya Hidayat <ariya.hidayat@trolltech.com> 6026 6027 Rubber-stamped by Simon Hausmann. 6028 6029 [Qt] Create and update the action for SelectAll. 6030 6031 * Api/qwebpage.cpp: 6032 (QWebPagePrivate::updateAction): 6033 (QWebPagePrivate::updateEditorActions): 6034 (QWebPage::action): 6035 * tests/qwebpage/tst_qwebpage.cpp: 6036 (tst_QWebPage::textSelection): 6037 6038 2009-03-02 Adam Treat <adam.treat@torchmobile.com> 6039 6040 Reviewed by Eric Seidel. 6041 6042 Add three new drt helper functions that enable all of the tests in 6043 LayoutTests/animation/* and LayoutTests/transitions/* to now pass. 6044 6045 * Api/qwebframe.cpp: 6046 (qt_drt_pauseAnimation): 6047 (qt_drt_pauseTransitionOfProperty): 6048 (qt_drt_numberOfActiveAnimations): 6049 6050 2009-03-02 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 6051 6052 Reviewed by George Staikos. 6053 6054 https://bugs.webkit.org/show_bug.cgi?id=21230 6055 On X11 match the behavior of Firefox and also copy the url to the 6056 clipboard selection when the action Copy Link Location is executed. 6057 6058 * Api/qwebpage.cpp: 6059 (QWebPage::triggerAction): 6060 6061 2009-02-25 Kavindra Palaraja <kavindra.palaraja@nokia.com> 6062 6063 Reviewed by Simon Hausmann. 6064 6065 Fix the documentation for the linkHovered signal. 6066 6067 * Api/qwebpage.cpp: 6068 6069 2009-02-23 Adam Treat <adam.treat@torchmobile.com> 6070 6071 Reviewed by Darin Adler. 6072 6073 https://bugs.webkit.org/show_bug.cgi?id=24094 6074 Make sure to empty the cache on exit to get rid of superfluous leak messages 6075 for CachedResource's in order to keep the leak messages accurate. This 6076 is analagous to what the Mac port is doing on application exit when all 6077 WebView's have been closed. 6078 6079 * Api/qwebpage.cpp: 6080 (QWebPagePrivate::_q_cleanupLeakMessages): 6081 (QWebPage::QWebPage): 6082 * Api/qwebpage.h: 6083 * Api/qwebpage_p.h: 6084 6085 2009-02-23 Thiago Macieira <thiago.macieira@nokia.com> 6086 6087 Reviewed by Simon Hausmann. 6088 6089 Fix the Copyright notices in a few files 6090 6091 * WebKit_pch.h: 6092 164 6093 2009-02-16 Simon Hausmann <simon.hausmann@nokia.com> 165 6094 … … 172 6101 PluginDatabase if plugins are disabled in the settings. 173 6102 6103 2009-02-13 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 6104 6105 Reviewed by Nikolas Zimmermann. 6106 6107 https://bugs.webkit.org/show_bug.cgi?id=23738 6108 Expose the url elements target frame string. This is the sister function 6109 to the existing linkTargetFrame which returns the QWebFrame*. When the 6110 linkTargetFrame is 0 it is useful to know what the target was to be. 6111 6112 * Api/qwebframe.cpp: 6113 (QWebHitTestResultPrivate::QWebHitTestResultPrivate): 6114 (QWebHitTestResult::linkTarget): 6115 * Api/qwebframe.h: 6116 * Api/qwebframe_p.h: 6117 * tests/qwebframe/tst_qwebframe.cpp: 6118 174 6119 2009-02-13 David Boddie <dboddie@trolltech.com> 175 6120 … … 187 6132 188 6133 * Api/qwebsettings.cpp: 6134 6135 2009-02-11 Dimitri Dupuis-latour <dupuislatour@apple.com> 6136 6137 Stub out InspectorClientQt::hiddenPanels. 6138 6139 Reviewed by Timothy Hatcher. 6140 6141 * WebCoreSupport/InspectorClientQt.cpp: 6142 (WebCore::InspectorClientQt::hiddenPanels): 6143 * WebCoreSupport/InspectorClientQt.h: 189 6144 190 6145 2009-02-10 Karsten Heimrich <kheimric@trolltech.com> … … 198 6153 (WebCore::FrameLoaderClientQt::dispatchDidChangeLocationWithinPage): 199 6154 update and emit in case we navigate inside a webpage 6155 6156 2009-02-10 Adam Treat <adam.treat@torchmobile.com> 6157 6158 Fix the Qt build as class Selection is now VisibleSelection. 6159 6160 * Api/qwebpage.cpp: 6161 (QWebPage::inputMethodQuery): 6162 6163 2009-02-06 Geoffrey Garen <ggaren@apple.com> 6164 6165 Build fix. 6166 6167 * WebCoreSupport/FrameLoaderClientQt.cpp: 6168 (WebCore::FrameLoaderClientQt::updateGlobalHistoryRedirectLinks): 6169 * WebCoreSupport/FrameLoaderClientQt.h: 200 6170 201 6171 2009-02-06 Kavindra Palaraja <kavindra.palaraja@nokia.com> … … 219 6189 models. 220 6190 6191 2009-02-06 Aaron Boodman <aa@chromium.org> 6192 6193 Reviewed by Holger Freyther. 6194 6195 * WebCoreSupport/FrameLoaderClientQt.cpp: 6196 (WebCore::FrameLoaderClientQt::documentElementAvailable):) 6197 Fix compile error in Qt build introduced by the below change (r40694). 6198 6199 2009-02-05 Aaron Boodman <aa@chromium.org> 6200 6201 Reviewed by Dave Hyatt. 6202 6203 https://bugs.webkit.org/show_bug.cgi?id=23708 6204 Adds documentElementAvailable() callback to FrameLoaderClient. 6205 6206 * WebCoreSupport/FrameLoaderClientQt.cpp: 6207 (WebCore::FrameLoaderClient::documentElementAvailable): 6208 Stub out documentElementAvailable(). 6209 * WebCoreSupport/FrameLoaderClientQt.h: 6210 Ditto. 6211 221 6212 2009-02-04 David Boddie <dboddie@trolltech.com> 222 6213 … … 235 6226 236 6227 * tests/qwebframe/tst_qwebframe.cpp: 6228 6229 2009-02-02 Geoffrey Garen <ggaren@apple.com> 6230 6231 Build fix. 6232 6233 * Api/qwebframe.cpp: 6234 (QWebFrame::QWebFrame): 6235 (QWebFrame::load): 6236 (QWebFrame::setHtml): 6237 (QWebFrame::setContent): 6238 6239 2009-02-02 Geoffrey Garen <ggaren@apple.com> 6240 6241 Build fix. 6242 6243 * WebCoreSupport/FrameLoaderClientQt.cpp: 6244 (WebCore::FrameLoaderClientQt::createFrame): 6245 6246 2009-02-02 Geoffrey Garen <ggaren@apple.com> 6247 6248 Reviewed by Sam Weinig. 6249 6250 Track redirects in global history. 6251 6252 Keep Qt building. 6253 6254 * WebCoreSupport/FrameLoaderClientQt.cpp: 6255 (WebCore::FrameLoaderClientQt::updateGlobalHistoryForRedirectWithoutHistoryItem): 6256 (WebCore::FrameLoaderClientQt::createFrame): 6257 * WebCoreSupport/FrameLoaderClientQt.h: 6258 6259 2009-02-02 Anders Carlsson <andersca@apple.com> 6260 6261 Reviewed by Dan Bernstein. 6262 6263 Update for changes to WebCore. 6264 6265 * WebCoreSupport/FrameLoaderClientQt.cpp: 6266 (WebCore::FrameLoaderClientQt::createPlugin): 6267 (WebCore::FrameLoaderClientQt::createJavaAppletWidget): 6268 * WebCoreSupport/FrameLoaderClientQt.h: 6269 6270 2009-02-02 Adam Treat <adam.treat@torchmobile.com> 6271 6272 Reviewed by Nikolas Zimmermann. 6273 6274 https://bugs.webkit.org/show_bug.cgi?id=23587 6275 Refactor HitTestRequest to eliminate all the ugly boolean arguments and 6276 use an enum bitflag instead. Cleanup all the code that constructs the 6277 various HitTestRequests to make the code more readable. 6278 6279 * Api/qwebframe.cpp: 6280 (QWebFrame::hitTestContent): 6281 6282 2009-02-02 Adam Treat <adam.treat@torchmobile.com> 6283 6284 Fix the Qt build to call forceLayout on the view instead. 6285 6286 * Api/qwebpage.cpp: 6287 (QWebPage::setFixedLayoutSize): 6288 (QWebPage::setUseFixedLayout): 6289 6290 2009-02-02 Holger Hans Peter Freyther <zecke@selfish.org> 6291 6292 Reviewed by Darin Adler. 6293 6294 Move Frame::forceLayout, Frame::adjustPageHeight and Frame::forceLayoutWithPageWidthRange to FrameView 6295 6296 https://bugs.webkit.org/show_bug.cgi?id=23428 6297 6298 FrameView::forceLayout could be killed but the comment might 6299 contain a value over the the plain FrameView::layout... 6300 6301 Adjust the WebCore/WebKit consumers of these methods. 6302 6303 * Api/qwebpage.cpp: 6304 (QWebPage::setViewportSize): 6305 * WebCoreSupport/FrameLoaderClientQt.cpp: 6306 (WebCore::FrameLoaderClientQt::forceLayout): 6307 6308 2009-01-30 Geoffrey Garen <ggaren@apple.com> 6309 6310 Build fix. 6311 6312 * WebCoreSupport/FrameLoaderClientQt.cpp: 6313 (WebCore::FrameLoaderClientQt::createFrame): 6314 6315 2009-01-30 Holger Hans Peter Freyther <zecke@selfish.org> 6316 6317 Reviewed by Simon Hausmann. 6318 6319 https://bugs.webkit.org/show_bug.cgi?id=22056 6320 6321 Kill FrameLoaderClient.cpp, move the code over to Frame::createView 6322 6323 FrameLoaderClient is supposed to be an interface, move the 6324 to be shared code to Frame which is a controller and is 6325 allowed to create a FrameView. 6326 6327 * WebCoreSupport/FrameLoaderClientQt.cpp: 6328 (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): 6329 6330 2009-01-30 Geoffrey Garen <ggaren@apple.com> 6331 6332 Reviewed by Sam Weinig. 6333 6334 Split "lockHistory" into "lockHistory" and "lockBackForwardList" in 6335 preparation for setting them differently during a redirect. 6336 6337 * Api/qwebpage.cpp: 6338 (QWebPage::triggerAction): 6339 6340 2009-01-30 Brady Eidson <beidson@apple.com> 6341 6342 Reviewed by Sam Weinig 6343 6344 Remove FrameLoaderClient code that is now handled by FrameLoader itself 6345 6346 * WebCoreSupport/FrameLoaderClientQt.cpp: 6347 (WebCore::FrameLoaderClientQt::frameLoadCompleted): 237 6348 238 6349 2009-01-30 Simon Hausmann <simon.hausmann@nokia.com> … … 248 6359 * Api/qwebsettings.h: 249 6360 6361 2009-01-28 Adam Treat <adam.treat@torchmobile.com> 6362 6363 Reviewed by Nikolas Zimmermann and George Staikos. 6364 6365 https://bugs.webkit.org/show_bug.cgi?id=23557 6366 Do not clip the QWebFrame::hitTestContent method to the visible viewport 6367 and add a regression test to make sure it works. 6368 6369 * Api/qwebframe.cpp: 6370 (QWebFrame::hitTestContent): 6371 * tests/qwebframe/tst_qwebframe.cpp: 6372 250 6373 2009-01-28 Ariya Hidayat <ariya.hidayat@trolltech.com> 251 6374 … … 265 6388 Reviewed by Simon Hausmann. 266 6389 267 http:// www.qtsoftware.com/developer/task-tracker/index_html?id=238391&method=entry6390 http://qt.nokia.com/developer/task-tracker/index_html?id=238391&method=entry 268 6391 269 6392 [Qt] If QPainter fails to start on a QPrinter instance, do not … … 272 6395 * Api/qwebframe.cpp: 273 6396 (QWebFrame::print): 6397 6398 2009-01-27 Brady Eidson <beidson@apple.com> 6399 6400 Reviewed by Dan Bernstein 6401 6402 Rework FrameLoaderClient to work on a CachedFrame basis instead of CachedPage 6403 6404 * WebCoreSupport/FrameLoaderClientQt.cpp: 6405 (WebCore::FrameLoaderClientQt::savePlatformDataToCachedFrame): 6406 (WebCore::FrameLoaderClientQt::transitionToCommittedFromCachedFrame): 6407 * WebCoreSupport/FrameLoaderClientQt.h: 6408 6409 2009-01-26 Simon Fraser <simon.fraser@apple.com> 6410 6411 Reviewed by David Hyatt 6412 6413 Back out r40285, because it was checked in with no bug number, no 6414 testcase, is rendering change that did not get thorough review, 6415 and broke the Mac build. 6416 6417 * Api/qwebframe.cpp: 6418 (QWebFrame::hitTestContent): 6419 6420 2009-01-26 Adam Treat <adam.treat@torchmobile.com> 6421 6422 Reviewed by Nikolas Zimmermann. 6423 6424 Do not clip the QWebFrame::hitTestContent method to the visible viewport. 6425 6426 * Api/qwebframe.cpp: 6427 (QWebFrame::hitTestContent): 274 6428 275 6429 2009-01-26 David Boddie <dboddie@trolltech.com> … … 334 6488 335 6489 * Api/qwebhistory.h: 6490 6491 2009-01-24 Adam Treat <adam.treat@torchmobile.com> 6492 6493 Oops, fix the Qt build. 6494 6495 * Api/qwebframe.cpp: 6496 (QWebFrame::render): 6497 6498 2009-01-24 Adam Treat <adam.treat@torchmobile.com> 6499 6500 Reviewed by Nikolas Zimmermann. 6501 6502 Add QWebFrame::renderContents() method which allows arbitary rendering 6503 of any content region within the QWebFrame. It also does not draw any 6504 scrollbars. 6505 6506 * Api/qwebframe.cpp: 6507 (QWebFrame::renderContents): 6508 * Api/qwebframe.h: 336 6509 337 6510 2009-01-23 Ariya Hidayat <ariya.hidayat@trolltech.com> … … 408 6581 Rubber-stamped by Simon Hausmann. 409 6582 410 http:// www.qtsoftware.com/developer/task-tracker/index_html?id=219344&method=entry6583 http://qt.nokia.com/developer/task-tracker/index_html?id=219344&method=entry 411 6584 412 6585 [Qt] API documentation for QWebPage::WebAction enum. 413 6586 414 6587 * Api/qwebpage.cpp: 6588 6589 2009-01-16 Ariya Hidayat <ariya.hidayat@trolltech.com> 6590 6591 Another attempt at fixing the Qt build. 6592 6593 * Api/qwebframe.cpp: 6594 (QWebFrame::addToJavaScriptWindowObject): 415 6595 416 6596 2009-01-14 Ariya Hidayat <ariya.hidayat@trolltech.com> … … 456 6636 Reviewed by Simon Hausmann. 457 6637 458 http:// www.qtsoftware.com/developer/task-tracker/index_html?id=241144&method=entry6638 http://qt.nokia.com/developer/task-tracker/index_html?id=241144&method=entry 459 6639 460 6640 [Qt] Create actions for text selection and editing for QWebPage. … … 484 6664 (tst_QWebPage::cursorMovements): 485 6665 486 2009-01-13 Ariya Hidayat <ariya.hidayat@trolltech.com>487 488 Rubber-stamped by Tor Arne VestbÞ.489 490 [Qt] Missing piece from my previous commit:491 Disable and enable the cursor navigation actions when contentEditable492 is changed.493 494 * Api/qwebpage.cpp:495 (QWebPagePrivate::updateEditorActions):496 497 2009-01-13 Ariya Hidayat <ariya.hidayat@trolltech.com>498 499 Reviewed by Tor Arne VestbÞ.500 501 [Qt] Create actions for cursor navigation for QWebPage.502 Also properly disable and enable them when contentEditable is toggled.503 504 * Api/qwebpage.cpp:505 (QWebPagePrivate::updateAction):506 (QWebPage::action):507 508 6666 2009-01-08 Yongjun Zhang <yongjun.zhang@nokia.com> 509 6667 … … 524 6682 * WebCoreSupport/ChromeClientQt.cpp: 525 6683 (WebCore::ChromeClientQt::repaint): 6684 6685 2009-01-13 Ariya Hidayat <ariya.hidayat@trolltech.com> 6686 6687 Rubber-stamped by Tor Arne VestbÞ. 6688 6689 [Qt] Missing piece from my previous commit: 6690 Disable and enable the cursor navigation actions when contentEditable 6691 is changed. 6692 6693 * Api/qwebpage.cpp: 6694 (QWebPagePrivate::updateEditorActions): 6695 6696 2009-01-13 Ariya Hidayat <ariya.hidayat@trolltech.com> 6697 6698 Reviewed by Tor Arne VestbÞ. 6699 6700 [Qt] Create actions for cursor navigation for QWebPage. 6701 Also properly disable and enable them when contentEditable is toggled. 6702 6703 * Api/qwebpage.cpp: 6704 (QWebPagePrivate::updateAction): 6705 (QWebPage::action): 526 6706 527 6707 2009-01-13 Simon Hausmann <simon.hausmann@nokia.com> … … 682 6862 Reviewed by George Staikos. 683 6863 6864 Add Qt API to QWebHitTestResult::isScrollBar method 6865 6866 * Api/qwebframe.cpp: 6867 (QWebHitTestResultPrivate::QWebHitTestResultPrivate): 6868 (QWebHitTestResult::isScrollBar): 6869 * Api/qwebframe.h: 6870 * Api/qwebframe_p.h: 6871 (QWebHitTestResultPrivate::QWebHitTestResultPrivate): 6872 6873 2009-01-07 Adam Treat <adam.treat@torchmobile.com> 6874 6875 Reviewed by George Staikos. 6876 6877 Add Qt API for QWebFrame::scrollBarGeometry method 6878 6879 * Api/qwebframe.cpp: 6880 (QWebFrame::scrollBarGeometry): 6881 * Api/qwebframe.h: 6882 6883 2009-01-07 Adam Treat <adam.treat@torchmobile.com> 6884 6885 Reviewed by George Staikos. 6886 684 6887 Fix unused variable warnings 685 6888 … … 706 6909 * Api/qwebkitglobal.h: 707 6910 6911 2009-01-06 Adam Treat <adam.treat@torchmobile.com> 6912 6913 Reviewed by Simon Hausmann. 6914 6915 Update the documentation to reflect when these API changes will land in 6916 upstream Qt 6917 6918 * Api/qwebframe.cpp: 6919 * Api/qwebpage.cpp: 6920 6921 2009-01-05 Adam Treat <adam.treat@torchmobile.com> 6922 6923 Reviewed by George Staikos. 6924 6925 Add Qt API for QWebFrame::contentsSizeChanged signal 6926 6927 * Api/qwebframe.cpp: 6928 * Api/qwebframe.h: 6929 * WebCoreSupport/ChromeClientQt.cpp: 6930 (WebCore::ChromeClientQt::contentsSizeChanged): 6931 * WebCoreSupport/ChromeClientQt.h: 6932 708 6933 2009-01-05 Adam Treat <adam.treat@torchmobile.com> 709 6934 … … 715 6940 * Api/qwebframe.cpp: 716 6941 (QWebFrame::setScrollBarPolicy): 6942 * WebCoreSupport/FrameLoaderClientQt.cpp: 6943 (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): 6944 6945 2009-01-04 Adam Treat <adam.treat@torchmobile.com> 6946 6947 Reviewed by George Staikos. 6948 6949 Add new API to QWebHitTestResult to return a rect for the smallest enclosing 6950 block element of the hit test 6951 6952 * Api/qwebframe.cpp: 6953 (QWebHitTestResultPrivate::QWebHitTestResultPrivate): 6954 (QWebHitTestResult::enclosingBlock): 6955 * Api/qwebframe.h: 6956 * Api/qwebframe_p.h: 6957 6958 2008-12-30 Adam Treat <adam.treat@torchmobile.com> 6959 6960 Reviewed by George Staikos. 6961 6962 Make the qt port build and work with the new fixedLayoutSize feature 6963 6964 * Api/qwebpage.cpp: 6965 (QWebPagePrivate::QWebPagePrivate): 6966 (QWebPage::fixedLayoutSize): 6967 (QWebPage::setFixedLayoutSize): 6968 (QWebPage::useFixedLayout): 6969 (QWebPage::setUseFixedLayout): 6970 * Api/qwebpage.h: 6971 * Api/qwebpage_p.h: 717 6972 * WebCoreSupport/FrameLoaderClientQt.cpp: 718 6973 (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage): -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
r2 r561 40 40 #include "DatabaseTracker.h" 41 41 #include "SecurityOrigin.h" 42 #include "QWebPageClient.h" 42 43 43 44 #include "qwebpage.h" … … 46 47 #include "qwebsecurityorigin.h" 47 48 #include "qwebsecurityorigin_p.h" 49 #include "qwebview.h" 48 50 49 51 #include <qtooltip.h> … … 229 231 } 230 232 231 void ChromeClientQt::addMessageToConsole( const String& message, unsigned int lineNumber,232 const String& sourceID)233 void ChromeClientQt::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, 234 unsigned int lineNumber, const String& sourceID) 233 235 { 234 236 QString x = message; … … 277 279 FrameLoaderClientQt *fl = static_cast<FrameLoaderClientQt*>(f->loader()->client()); 278 280 bool rc = m_webPage->javaScriptPrompt(fl->webFrame(), (QString)message, (QString)defaultValue, &x); 279 result = x; 281 282 // Fix up a quirk in the QInputDialog class. If no input happened the string should be empty 283 // but it is null. See https://bugs.webkit.org/show_bug.cgi?id=30914. 284 if (rc && result.isNull()) 285 result = String(""); 286 else 287 result = x; 288 280 289 return rc; 281 290 } … … 289 298 bool ChromeClientQt::shouldInterruptJavaScript() 290 299 { 291 notImplemented(); 292 return false; 300 bool shouldInterrupt = false; 301 QMetaObject::invokeMethod(m_webPage, "shouldInterruptJavaScript", Qt::DirectConnection, Q_RETURN_ARG(bool, shouldInterrupt)); 302 return shouldInterrupt; 293 303 } 294 304 … … 303 313 } 304 314 305 void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, bool immediate, bool repaintContentOnly)315 void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, bool, bool) 306 316 { 307 317 // No double buffer, so only update the QWidget if content changed. 308 318 if (contentChanged) { 309 QWidget* view = m_webPage->view(); 310 if (view) { 319 if (platformPageClient()) { 311 320 QRect rect(windowRect); 312 321 rect = rect.intersected(QRect(QPoint(0, 0), m_webPage->viewportSize())); 313 322 if (!rect.isEmpty()) 314 view->update(rect);323 platformPageClient()->update(rect); 315 324 } 316 325 emit m_webPage->repaintRequested(windowRect); … … 323 332 void ChromeClientQt::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect&) 324 333 { 325 QWidget* view = m_webPage->view(); 326 if (view) 327 view->scroll(delta.width(), delta.height(), scrollViewRect); 334 if (platformPageClient()) 335 platformPageClient()->scroll(delta.width(), delta.height(), scrollViewRect); 328 336 emit m_webPage->scrollRequested(delta.width(), delta.height(), scrollViewRect); 329 337 } … … 341 349 } 342 350 343 PlatformWidget ChromeClientQt::platformWindow() const 344 { 345 return m_webPage->view(); 346 } 347 348 void ChromeClientQt::contentsSizeChanged(Frame*, const IntSize&) const 349 { 350 } 351 352 void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags) 353 { 351 PlatformPageClient ChromeClientQt::platformPageClient() const 352 { 353 return m_webPage->d->client; 354 } 355 356 void ChromeClientQt::contentsSizeChanged(Frame* frame, const IntSize& size) const 357 { 358 emit QWebFramePrivate::kit(frame)->contentsSizeChanged(size); 359 } 360 361 void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned) 362 { 363 TextDirection dir; 354 364 if (result.absoluteLinkURL() != lastHoverURL 355 || result.title( ) != lastHoverTitle365 || result.title(dir) != lastHoverTitle 356 366 || result.textContent() != lastHoverContent) { 357 367 lastHoverURL = result.absoluteLinkURL(); 358 lastHoverTitle = result.title( );368 lastHoverTitle = result.title(dir); 359 369 lastHoverContent = result.textContent(); 360 370 emit m_webPage->linkHovered(lastHoverURL.prettyURL(), … … 363 373 } 364 374 365 void ChromeClientQt::setToolTip(const String &tip )375 void ChromeClientQt::setToolTip(const String &tip, TextDirection) 366 376 { 367 377 #ifndef QT_NO_TOOLTIP … … 387 397 } 388 398 399 #if ENABLE(DATABASE) 389 400 void ChromeClientQt::exceededDatabaseQuota(Frame* frame, const String& databaseName) 390 401 { 391 402 quint64 quota = QWebSettings::offlineStorageDefaultQuota(); 392 #if ENABLE(DATABASE) 403 393 404 if (!DatabaseTracker::tracker().hasEntryForOrigin(frame->document()->securityOrigin())) 394 405 DatabaseTracker::tracker().setQuota(frame->document()->securityOrigin(), quota); 406 407 emit m_webPage->databaseQuotaExceeded(QWebFramePrivate::kit(frame), databaseName); 408 } 395 409 #endif 396 emit m_webPage->databaseQuotaExceeded(QWebFramePrivate::kit(frame), databaseName); 397 } 410 411 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 412 void ChromeClientQt::reachedMaxAppCacheSize(int64_t) 413 { 414 // FIXME: Free some space. 415 notImplemented(); 416 } 417 #endif 398 418 399 419 void ChromeClientQt::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileChooser) … … 407 427 408 428 if (!fileChooser->filenames().isEmpty()) 409 for ( inti = 0; i < fileChooser->filenames().size(); ++i)429 for (unsigned i = 0; i < fileChooser->filenames().size(); ++i) 410 430 option.suggestedFileNames += fileChooser->filenames()[i]; 411 431 … … 429 449 } 430 450 431 } 451 bool ChromeClientQt::setCursor(PlatformCursorHandle) 452 { 453 notImplemented(); 454 return false; 455 } 456 457 void ChromeClientQt::requestGeolocationPermissionForFrame(Frame*, Geolocation*) 458 { 459 // See the comment in WebCore/page/ChromeClient.h 460 notImplemented(); 461 } 462 463 } -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
r2 r561 84 84 virtual void setResizable(bool); 85 85 86 virtual void addMessageToConsole( const String& message, unsigned int lineNumber,87 const String& sourceID);86 virtual void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, 87 unsigned int lineNumber, const String& sourceID); 88 88 89 89 virtual bool canRunBeforeUnloadConfirmPanel(); … … 106 106 virtual IntPoint screenToWindow(const IntPoint&) const; 107 107 virtual IntRect windowToScreen(const IntRect&) const; 108 virtual Platform Widget platformWindow() const;108 virtual PlatformPageClient platformPageClient() const; 109 109 virtual void contentsSizeChanged(Frame*, const IntSize&) const; 110 110 111 virtual void scrollbarsModeDidChange() const { } 111 112 virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags); 112 113 113 virtual void setToolTip(const String& );114 virtual void setToolTip(const String&, TextDirection); 114 115 115 116 virtual void print(Frame*); 116 117 #if ENABLE(DATABASE) 117 118 virtual void exceededDatabaseQuota(Frame*, const String&); 118 119 #endif 120 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 121 virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); 122 #endif 119 123 virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); 120 124 121 125 virtual void formStateDidChange(const Node*) { } 126 127 virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() { return 0; } 128 129 virtual bool setCursor(PlatformCursorHandle); 130 131 virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const {} 132 133 virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*); 122 134 123 135 QWebPage* m_webPage; -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp
r2 r561 53 53 } 54 54 55 void ContextMenuClientQt::downloadURL(const KURL& url)55 void ContextMenuClientQt::downloadURL(const KURL&) 56 56 { 57 57 notImplemented(); … … 68 68 } 69 69 70 bool ContextMenuClientQt::isSpeaking() 71 { 72 notImplemented(); 73 return false; 74 } 75 70 76 void ContextMenuClientQt::stopSpeaking() 71 77 { -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h
r2 r561 45 45 virtual void lookUpInDictionary(Frame*); 46 46 virtual void speak(const String&); 47 virtual bool isSpeaking(); 47 48 virtual void stopSpeaking(); 48 49 virtual void searchWithGoogle(const Frame*); -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/DragClientQt.cpp
r2 r561 24 24 */ 25 25 26 #include "config.h" 26 27 #include "DragClientQt.h" 27 28 … … 66 67 if (view) { 67 68 QDrag *drag = new QDrag(view); 69 if (clipboardData->hasImage()) 70 drag->setPixmap(qvariant_cast<QPixmap>(clipboardData->imageData())); 68 71 drag->setMimeData(clipboardData); 69 72 drag->start(); -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditCommandQt.cpp
r2 r561 18 18 */ 19 19 20 #include "config.h" 20 21 #include <wtf/Platform.h> 21 22 #include "EditCommandQt.h" -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
r2 r561 2 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * Copyright (C) 2006 Zack Rusin <zack@kde.org> 4 * Copyright (C) 2006, 2008 Apple Computer, Inc.4 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 5 5 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) 6 6 * … … 35 35 #include "qwebpage_p.h" 36 36 37 #include "CSSStyleDeclaration.h" 37 38 #include "Document.h" 38 39 #include "EditCommandQt.h" 39 #include "Page.h"40 40 #include "Editor.h" 41 41 #include "FocusController.h" 42 42 #include "Frame.h" 43 #include "HTMLElement.h" 44 #include "HTMLInputElement.h" 45 #include "HTMLNames.h" 43 46 #include "KeyboardCodes.h" 44 47 #include "KeyboardEvent.h" 48 #include "NotImplemented.h" 49 #include "Page.h" 45 50 #include "Page.h" 46 51 #include "PlatformKeyboardEvent.h" 47 #include "NotImplemented.h" 48 #include "Node.h" 52 #include "QWebPageClient.h" 49 53 #include "Range.h" 50 54 … … 84 88 if (!range) 85 89 return QLatin1String("(null)"); 86 QString str;87 90 WebCore::ExceptionCode code; 88 str.sprintf("range from %ld of %ls to %ld of %ls", 89 range->startOffset(code), dumpPath(range->startContainer(code)).unicode(), 90 range->endOffset(code), dumpPath(range->endContainer(code)).unicode()); 91 92 QString str = QString("range from %1 of %2 to %3 of %4") 93 .arg(range->startOffset(code)).arg(dumpPath(range->startContainer(code))) 94 .arg(range->endOffset(code)).arg(dumpPath(range->endContainer(code))); 95 91 96 return str; 92 97 } … … 95 100 namespace WebCore { 96 101 102 using namespace HTMLNames; 97 103 98 104 bool EditorClientQt::shouldDeleteRange(Range* range) … … 107 113 { 108 114 if (QWebPagePrivate::drtRun) 109 return element-> className() == "needsDeletionUI";115 return element->getAttribute(classAttr) == "needsDeletionUI"; 110 116 return false; 111 117 } … … 217 223 m_page->d->updateEditorActions(); 218 224 emit m_page->selectionChanged(); 219 emit m_page->microFocusChanged(); 225 Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame(); 226 if (!frame->editor()->ignoreCompositionSelectionChange()) 227 emit m_page->microFocusChanged(); 220 228 } 221 229 … … 547 555 } 548 556 557 String EditorClientQt::getAutoCorrectSuggestionForMisspelledWord(const String&) 558 { 559 notImplemented(); 560 return String(); 561 } 562 549 563 void EditorClientQt::checkGrammarOfString(const UChar*, int, Vector<GrammarDetail>&, int*, int*) 550 564 { … … 585 599 void EditorClientQt::setInputMethodState(bool active) 586 600 { 587 QWidget *view = m_page->view(); 588 if (view) { 589 view->setAttribute(Qt::WA_InputMethodEnabled, active); 590 emit m_page->microFocusChanged(); 601 QWebPageClient* webPageClient = m_page->d->client; 602 if (webPageClient) { 603 #if QT_VERSION >= 0x040600 604 bool isPasswordField = false; 605 if (!active) { 606 // Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag 607 // for password fields. The Qt platform is responsible for determining which widget 608 // will receive input method events for password fields. 609 Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame(); 610 if (frame && frame->document() && frame->document()->focusedNode()) { 611 if (frame->document()->focusedNode()->hasTagName(HTMLNames::inputTag)) { 612 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedNode()); 613 active = isPasswordField = inputElement->isPasswordField(); 614 } 615 } 616 } 617 webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField); 618 #endif 619 webPageClient->setInputMethodEnabled(active); 591 620 } 621 emit m_page->microFocusChanged(); 592 622 } 593 623 -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.h
r2 r561 99 99 virtual void learnWord(const String&); 100 100 virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); 101 virtual String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord); 101 102 virtual void checkGrammarOfString(const UChar*, int length, Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); 102 103 virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&); -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
r2 r561 33 33 #include "CSSComputedStyleDeclaration.h" 34 34 #include "CSSPropertyNames.h" 35 #include "FormState.h" 35 36 #include "FrameLoaderClientQt.h" 36 37 #include "FrameTree.h" 37 38 #include "FrameView.h" 38 39 #include "DocumentLoader.h" 40 #include "JSDOMWindowBase.h" 39 41 #include "MIMETypeRegistry.h" 40 42 #include "ResourceResponse.h" … … 46 48 #include "ResourceRequest.h" 47 49 #include "HistoryItem.h" 50 #include "HTMLAppletElement.h" 48 51 #include "HTMLFormElement.h" 52 #include "HTMLPlugInElement.h" 49 53 #include "NotImplemented.h" 50 54 #include "QNetworkReplyHandler.h" … … 52 56 #include "ResourceHandle.h" 53 57 #include "Settings.h" 58 #include "ScriptString.h" 59 #include "QWebPageClient.h" 54 60 55 61 #include "qwebpage.h" 62 #include "qwebpage_p.h" 56 63 #include "qwebframe.h" 57 64 #include "qwebframe_p.h" … … 64 71 #include <QDebug> 65 72 #if QT_VERSION >= 0x040400 73 #include <QGraphicsScene> 74 #include <QGraphicsWidget> 66 75 #include <QNetworkRequest> 67 76 #include <QNetworkReply> … … 141 150 , m_hasSentResponseToPlugin(false) 142 151 , m_firstData(false) 143 , m_policyFunction(0) 144 , m_loadSucceeded(false) 145 { 146 connect(this, SIGNAL(sigCallPolicyFunction(int)), this, SLOT(slotCallPolicyFunction(int)), Qt::QueuedConnection); 152 , m_loadError (ResourceError()) 153 { 147 154 } 148 155 … … 163 170 connect(this, SIGNAL(loadStarted()), 164 171 m_webFrame->page(), SIGNAL(loadStarted())); 172 connect(this, SIGNAL(loadStarted()), 173 m_webFrame, SIGNAL(loadStarted())); 165 174 connect(this, SIGNAL(loadProgress(int)), 166 175 m_webFrame->page(), SIGNAL(loadProgress(int))); 167 176 connect(this, SIGNAL(loadFinished(bool)), 168 177 m_webFrame->page(), SIGNAL(loadFinished(bool))); 169 connect(this, SIGNAL(titleChanged(const QString&)), 170 m_webFrame, SIGNAL(titleChanged(const QString&))); 178 connect(this, SIGNAL(loadFinished(bool)), 179 m_webFrame, SIGNAL(loadFinished(bool))); 180 connect(this, SIGNAL(titleChanged(QString)), 181 m_webFrame, SIGNAL(titleChanged(QString))); 171 182 } 172 183 … … 178 189 void FrameLoaderClientQt::callPolicyFunction(FramePolicyFunction function, PolicyAction action) 179 190 { 180 ASSERT(!m_policyFunction); 181 ASSERT(function); 182 183 m_policyFunction = function; 184 emit sigCallPolicyFunction(action); 185 } 186 187 void FrameLoaderClientQt::slotCallPolicyFunction(int action) 188 { 189 if (!m_frame || !m_policyFunction) 190 return; 191 FramePolicyFunction function = m_policyFunction; 192 m_policyFunction = 0; 193 (m_frame->loader()->*function)(WebCore::PolicyAction(action)); 191 (m_frame->loader()->policyChecker()->*function)(action); 194 192 } 195 193 … … 200 198 } 201 199 202 void FrameLoaderClientQt::savePlatformDataToCached Page(CachedPage*)203 { 204 notImplemented(); 205 } 206 207 void FrameLoaderClientQt::transitionToCommittedFromCached Page(CachedPage*)200 void FrameLoaderClientQt::savePlatformDataToCachedFrame(CachedFrame*) 201 { 202 notImplemented(); 203 } 204 205 void FrameLoaderClientQt::transitionToCommittedFromCachedFrame(CachedFrame*) 208 206 { 209 207 } … … 216 214 QBrush brush = m_webFrame->page()->palette().brush(QPalette::Base); 217 215 QColor backgroundColor = brush.style() == Qt::SolidPattern ? brush.color() : QColor(); 218 WebCore::FrameLoaderClient::transitionToCommittedForNewPage(m_frame, m_webFrame->page()->viewportSize(), 219 backgroundColor, !backgroundColor.alpha(), 220 /*fixedLayoutSize*/ IntSize(), 221 /*useFixedLayout*/ false, 222 (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Horizontal), 223 (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Vertical)); 216 217 QWebPage* page = m_webFrame->page(); 218 const QSize preferredLayoutSize = page->preferredContentsSize(); 219 220 m_frame->createView(m_webFrame->page()->viewportSize(), 221 backgroundColor, !backgroundColor.alpha(), 222 preferredLayoutSize.isValid() ? IntSize(preferredLayoutSize) : IntSize(), 223 preferredLayoutSize.isValid(), 224 (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Horizontal), 225 (ScrollbarMode)m_webFrame->scrollBarPolicy(Qt::Vertical)); 224 226 } 225 227 … … 233 235 void FrameLoaderClientQt::forceLayout() 234 236 { 235 m_frame->forceLayout(true); 237 FrameView* view = m_frame->view(); 238 if (view) 239 view->forceLayout(true); 236 240 } 237 241 … … 284 288 285 289 286 void FrameLoaderClientQt::dispatchWillPerformClientRedirect(const KURL& url, 287 double interval, 288 double fireDate) 290 void FrameLoaderClientQt::dispatchWillPerformClientRedirect(const KURL& url, double, double) 289 291 { 290 292 if (dumpFrameLoaderCallbacks) … … 333 335 return; 334 336 335 336 337 // ### hack338 emit m_webFrame->urlChanged(m_webFrame->url());339 337 emit titleChanged(title); 340 338 } … … 349 347 return; 350 348 349 emit m_webFrame->urlChanged(m_webFrame->url()); 351 350 m_webFrame->page()->d->updateNavigationActions(); 352 351 … … 364 363 365 364 if (QWebPagePrivate::drtRun) { 366 int unloadEventCount = m_frame-> eventHandler()->pendingFrameUnloadEventCount();365 int unloadEventCount = m_frame->domWindow()->pendingUnloadEventListeners(); 367 366 if (unloadEventCount) 368 367 printf("%s - has %u onunload handler(s)\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), unloadEventCount); … … 381 380 printf("%s - didFinishLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); 382 381 383 m_loadSucceeded = true; 384 385 if (m_frame->tree()->parent() || !m_webFrame) 382 // Clears the previous error. 383 m_loadError = ResourceError(); 384 385 if (!m_webFrame) 386 386 return; 387 387 m_webFrame->page()->d->updateNavigationActions(); … … 409 409 { 410 410 // qDebug() << "FrameLoaderClientQt::cancelPolicyCheck"; 411 m_policyFunction = 0;412 411 } 413 412 … … 417 416 { 418 417 notImplemented(); 419 Q_ASSERT(!m_policyFunction);420 418 // FIXME: This is surely too simple 421 419 callPolicyFunction(function, PolicyUse); … … 437 435 { 438 436 if (m_webFrame && m_frame->page()) { 437 // A new load starts, so lets clear the previous error. 438 m_loadError = ResourceError(); 439 439 emit loadStarted(); 440 440 postProgressEstimateChangedNotification(); … … 468 468 469 469 if (m_webFrame && m_frame->page()) 470 emit loadFinished(m_load Succeeded);471 } 472 473 void FrameLoaderClientQt::setMainFrameDocumentReady(bool b)470 emit loadFinished(m_loadError.isNull()); 471 } 472 473 void FrameLoaderClientQt::setMainFrameDocumentReady(bool) 474 474 { 475 475 // this is only interesting once we provide an external API for the DOM … … 521 521 } 522 522 523 bool FrameLoaderClientQt::representationExistsForURLScheme(const String& URLScheme) const523 bool FrameLoaderClientQt::representationExistsForURLScheme(const String&) const 524 524 { 525 525 return false; … … 527 527 528 528 529 String FrameLoaderClientQt::generatedMIMETypeForURLScheme(const String& URLScheme) const529 String FrameLoaderClientQt::generatedMIMETypeForURLScheme(const String&) const 530 530 { 531 531 notImplemented(); … … 537 537 { 538 538 // Note: Can be called multiple times. 539 // Even if already complete, we might have set a previous item on a frame that540 // didn't do any data loading on the past transaction. Make sure to clear these out.541 m_frame->loader()->setPreviousHistoryItem(0);542 539 } 543 540 … … 565 562 void FrameLoaderClientQt::prepareForDataSourceReplacement() 566 563 { 567 m_frame->loader()->detachChildren();568 564 } 569 565 … … 615 611 } 616 612 613 void FrameLoaderClientQt::documentElementAvailable() 614 { 615 return; 616 } 617 617 618 void FrameLoaderClientQt::didPerformFirstNavigation() const 618 619 { … … 634 635 } 635 636 636 bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *item) const 637 void FrameLoaderClientQt::updateGlobalHistoryRedirectLinks() 638 { 639 } 640 641 bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *) const 637 642 { 638 643 return true; 644 } 645 646 void FrameLoaderClientQt::didDisplayInsecureContent() 647 { 648 notImplemented(); 649 } 650 651 void FrameLoaderClientQt::didRunInsecureContent(WebCore::SecurityOrigin*) 652 { 653 notImplemented(); 639 654 } 640 655 … … 681 696 if (!m_hasSentResponseToPlugin) { 682 697 m_pluginView->didReceiveResponse(loader->response()); 698 // didReceiveResponse sets up a new stream to the plug-in. on a full-page plug-in, a failure in 699 // setting up this stream can cause the main document load to be cancelled, setting m_pluginView 700 // to null 701 if (!m_pluginView) 702 return; 683 703 m_hasSentResponseToPlugin = true; 684 704 } … … 689 709 WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::ResourceRequest& request) 690 710 { 691 return ResourceError("Error", -999, request.url().prettyURL(),711 ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().prettyURL(), 692 712 QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8)); 713 error.setIsCancellation(true); 714 return error; 693 715 } 694 716 … … 706 728 WebCore::ResourceError FrameLoaderClientQt::blockedError(const WebCore::ResourceRequest& request) 707 729 { 708 return ResourceError(" Error", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(),730 return ResourceError("WebKit", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(), 709 731 QCoreApplication::translate("QWebFrame", "Request blocked", 0, QCoreApplication::UnicodeUTF8)); 710 732 } … … 713 735 WebCore::ResourceError FrameLoaderClientQt::cannotShowURLError(const WebCore::ResourceRequest& request) 714 736 { 715 return ResourceError(" Error", WebKitErrorCannotShowURL, request.url().string(),737 return ResourceError("WebKit", WebKitErrorCannotShowURL, request.url().string(), 716 738 QCoreApplication::translate("QWebFrame", "Cannot show URL", 0, QCoreApplication::UnicodeUTF8)); 717 739 } … … 719 741 WebCore::ResourceError FrameLoaderClientQt::interruptForPolicyChangeError(const WebCore::ResourceRequest& request) 720 742 { 721 return ResourceError(" Error", WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(),722 QCoreApplication::translate("QWebFrame", "Frame load interrup ed by policy change", 0, QCoreApplication::UnicodeUTF8));743 return ResourceError("WebKit", WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(), 744 QCoreApplication::translate("QWebFrame", "Frame load interrupted by policy change", 0, QCoreApplication::UnicodeUTF8)); 723 745 } 724 746 725 747 WebCore::ResourceError FrameLoaderClientQt::cannotShowMIMETypeError(const WebCore::ResourceResponse& response) 726 748 { 727 return ResourceError(" Error", WebKitErrorCannotShowMIMEType, response.url().string(),749 return ResourceError("WebKit", WebKitErrorCannotShowMIMEType, response.url().string(), 728 750 QCoreApplication::translate("QWebFrame", "Cannot show mimetype", 0, QCoreApplication::UnicodeUTF8)); 729 751 } … … 731 753 WebCore::ResourceError FrameLoaderClientQt::fileDoesNotExistError(const WebCore::ResourceResponse& response) 732 754 { 733 return ResourceError(" Error", -998 /* ### */, response.url().string(),755 return ResourceError("QtNetwork", QNetworkReply::ContentNotFoundError, response.url().string(), 734 756 QCoreApplication::translate("QWebFrame", "File does not exist", 0, QCoreApplication::UnicodeUTF8)); 735 757 } 736 758 737 WebCore::ResourceError FrameLoaderClientQt::pluginWillHandleLoadError(const WebCore::ResourceResponse& response)759 WebCore::ResourceError FrameLoaderClientQt::pluginWillHandleLoadError(const WebCore::ResourceResponse&) 738 760 { 739 761 notImplemented(); … … 750 772 { 751 773 RefPtr<DocumentLoader> loader = DocumentLoader::create(request, substituteData); 752 if (substituteData.isValid()) 774 if (substituteData.isValid()) { 753 775 loader->setDeferMainResourceDataLoad(false); 776 // Use the default timeout interval for JS as the HTML tokenizer delay. This ensures 777 // that long-running JavaScript will still allow setHtml() to be synchronous, while 778 // still giving a reasonable timeout to prevent deadlock. 779 double delay = JSDOMWindowBase::commonJSGlobalData()->timeoutChecker.timeoutInterval() / 1000.0f; 780 m_frame->page()->setCustomHTMLTokenizerTimeDelay(delay); 781 } else { 782 m_frame->page()->setCustomHTMLTokenizerTimeDelay(-1); 783 } 754 784 return loader.release(); 755 785 } … … 773 803 } 774 804 775 void FrameLoaderClientQt::assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader* loader, const WebCore::ResourceRequest& request)805 void FrameLoaderClientQt::assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader*, const WebCore::ResourceRequest& request) 776 806 { 777 807 if (dumpResourceLoadCallbacks) … … 820 850 } 821 851 822 void FrameLoaderClientQt::dispatchDidFinishLoading(WebCore::DocumentLoader* loader, unsigned long)852 void FrameLoaderClientQt::dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long) 823 853 { 824 854 } … … 842 872 } 843 873 844 void FrameLoaderClientQt::dispatchDidFailProvisionalLoad(const WebCore::ResourceError&) 874 void FrameLoaderClientQt::dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const WebCore::ScriptString&) 875 { 876 notImplemented(); 877 } 878 879 void FrameLoaderClientQt::callErrorPageExtension(const WebCore::ResourceError& error) 880 { 881 QWebPage* page = m_webFrame->page(); 882 if (page->supportsExtension(QWebPage::ErrorPageExtension)) { 883 QWebPage::ErrorPageExtensionOption option; 884 885 if (error.domain() == "QtNetwork") 886 option.domain = QWebPage::QtNetwork; 887 else if (error.domain() == "HTTP") 888 option.domain = QWebPage::Http; 889 else if (error.domain() == "WebKit") 890 option.domain = QWebPage::WebKit; 891 else 892 return; 893 894 option.url = QUrl(error.failingURL()); 895 option.frame = m_webFrame; 896 option.error = error.errorCode(); 897 option.errorString = error.localizedDescription(); 898 899 QWebPage::ErrorPageExtensionReturn output; 900 if (!page->extension(QWebPage::ErrorPageExtension, &option, &output)) 901 return; 902 903 KURL baseUrl(output.baseUrl); 904 KURL failingUrl(option.url); 905 906 WebCore::ResourceRequest request(baseUrl); 907 WTF::RefPtr<WebCore::SharedBuffer> buffer = WebCore::SharedBuffer::create(output.content.constData(), output.content.length()); 908 WebCore::SubstituteData substituteData(buffer, output.contentType, output.encoding, failingUrl); 909 m_frame->loader()->load(request, substituteData, false); 910 } 911 } 912 913 void FrameLoaderClientQt::dispatchDidFailProvisionalLoad(const WebCore::ResourceError& error) 845 914 { 846 915 if (dumpFrameLoaderCallbacks) 847 916 printf("%s - didFailProvisionalLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); 848 917 849 m_loadSucceeded = false; 850 } 851 852 void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError&) 918 m_loadError = error; 919 if (!error.isNull() && !error.isCancellation()) 920 callErrorPageExtension(error); 921 } 922 923 void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError& error) 853 924 { 854 925 if (dumpFrameLoaderCallbacks) 855 926 printf("%s - didFailLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); 856 927 857 m_loadSucceeded = false; 928 m_loadError = error; 929 if (!error.isNull() && !error.isCancellation()) 930 callErrorPageExtension(error); 858 931 } 859 932 … … 871 944 { 872 945 // we need to call directly here 873 Q_ASSERT(!m_policyFunction);874 m_policyFunction = function;875 946 if (canShowMIMEType(MIMEType)) 876 slotCallPolicyFunction(PolicyUse);947 callPolicyFunction(function, PolicyUse); 877 948 else 878 slotCallPolicyFunction(PolicyDownload);949 callPolicyFunction(function, PolicyDownload); 879 950 } 880 951 881 952 void FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState>, const WebCore::String&) 882 953 { 883 Q_ASSERT(!m_policyFunction);884 954 Q_ASSERT(m_webFrame); 885 m_policyFunction = function;886 955 #if QT_VERSION < 0x040400 887 956 QWebNetworkRequest r(request); 888 957 #else 889 QNetworkRequest r(request.toNetworkRequest( ));958 QNetworkRequest r(request.toNetworkRequest(m_webFrame)); 890 959 #endif 891 960 QWebPage* page = m_webFrame->page(); … … 900 969 } 901 970 902 slotCallPolicyFunction(PolicyIgnore);971 callPolicyFunction(function, PolicyIgnore); 903 972 return; 904 973 } 905 slotCallPolicyFunction(PolicyUse);974 callPolicyFunction(function, PolicyUse); 906 975 } 907 976 908 977 void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState>) 909 978 { 910 Q_ASSERT(!m_policyFunction);911 979 Q_ASSERT(m_webFrame); 912 m_policyFunction = function;913 980 #if QT_VERSION < 0x040400 914 981 QWebNetworkRequest r(request); 915 982 #else 916 QNetworkRequest r(request.toNetworkRequest( ));983 QNetworkRequest r(request.toNetworkRequest(m_webFrame)); 917 984 #endif 918 985 QWebPage*page = m_webFrame->page(); … … 927 994 } 928 995 929 slotCallPolicyFunction(PolicyIgnore);996 callPolicyFunction(function, PolicyIgnore); 930 997 return; 931 998 } 932 slotCallPolicyFunction(PolicyUse);999 callPolicyFunction(function, PolicyUse); 933 1000 } 934 1001 … … 944 1011 return; 945 1012 946 QWebPage *page = m_webFrame->page(); 947 emit m_webFrame->page()->downloadRequested(request.toNetworkRequest()); 1013 emit m_webFrame->page()->downloadRequested(request.toNetworkRequest(m_webFrame)); 948 1014 #endif 949 1015 } … … 955 1021 return 0; 956 1022 957 QWebFrameData frameData ;1023 QWebFrameData frameData(m_frame->page(), m_frame, ownerElement, name); 958 1024 frameData.url = url; 959 frameData.name = name;960 frameData.ownerElement = ownerElement;961 1025 frameData.referrer = referrer; 962 1026 frameData.allowsScrolling = allowsScrolling; … … 964 1028 frameData.marginHeight = marginHeight; 965 1029 966 QWebFrame* webFrame = new QWebFrame(m_webFrame, &frameData); 1030 QPointer<QWebFrame> webFrame = new QWebFrame(m_webFrame, &frameData); 1031 // The creation of the frame may have run arbitrary JavaScript that removed it from the page already. 1032 if (!webFrame->d->frame->page()) { 1033 frameData.frame.release(); 1034 ASSERT(webFrame.isNull()); 1035 return 0; 1036 } 1037 967 1038 emit m_webFrame->page()->frameCreated(webFrame); 968 1039 969 RefPtr<Frame> childFrame = adoptRef(webFrame->d->frame);970 971 1040 // ### set override encoding if we have one 972 1041 973 FrameLoadType loadType = m_frame->loader()->loadType(); 974 FrameLoadType childLoadType = FrameLoadTypeRedirectWithLockedHistory; 975 976 childFrame->loader()->loadURL(frameData.url, frameData.referrer, String(), childLoadType, 0, 0); 1042 frameData.frame->loader()->loadURLIntoChildFrame(frameData.url, frameData.referrer, frameData.frame.get()); 977 1043 978 1044 // The frame's onload handler may have removed it from the document. 979 if (! childFrame->tree()->parent())1045 if (!frameData.frame->tree()->parent()) 980 1046 return 0; 981 1047 982 return childFrame.release();1048 return frameData.frame.release(); 983 1049 } 984 1050 … … 1032 1098 { 1033 1099 public: 1034 QtPluginWidget(QWidget* w = 0): Widget(w) {} 1100 QtPluginWidget(QWidget* w = 0) 1101 : Widget(w) 1102 , m_visible(false) 1103 {} 1104 1035 1105 ~QtPluginWidget() 1036 1106 { … … 1059 1129 clipRect.move(-windowRect.x(), -windowRect.y()); 1060 1130 clipRect.intersect(platformWidget()->rect()); 1061 platformWidget()->setMask(QRegion(clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height())); 1062 } 1131 1132 QRegion clipRegion = QRegion(clipRect); 1133 platformWidget()->setMask(clipRegion); 1134 1135 handleVisibility(); 1136 } 1137 1138 virtual void hide() 1139 { 1140 m_visible = false; 1141 Widget::hide(); 1142 } 1143 1144 virtual void show() 1145 { 1146 m_visible = true; 1147 if (!platformWidget()) 1148 return; 1149 1150 handleVisibility(); 1151 } 1152 1153 private: 1154 void handleVisibility() 1155 { 1156 if (!m_visible) 1157 return; 1158 1159 // if setMask is set with an empty QRegion, no clipping will 1160 // be performed, so in that case we hide the platformWidget 1161 QRegion mask = platformWidget()->mask(); 1162 platformWidget()->setVisible(!mask.isEmpty()); 1163 } 1164 1165 bool m_visible; 1063 1166 }; 1064 1167 1065 Widget* FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, Element* element, const KURL& url, const Vector<String>& paramNames, 1168 #if QT_VERSION >= 0x040600 1169 class QtPluginGraphicsWidget: public Widget 1170 { 1171 public: 1172 static RefPtr<QtPluginGraphicsWidget> create(QGraphicsWidget* w = 0) 1173 { 1174 return adoptRef(new QtPluginGraphicsWidget(w)); 1175 } 1176 1177 ~QtPluginGraphicsWidget() 1178 { 1179 if (graphicsWidget) 1180 graphicsWidget->deleteLater(); 1181 } 1182 virtual void invalidateRect(const IntRect& r) 1183 { 1184 QGraphicsScene* scene = graphicsWidget ? graphicsWidget->scene() : 0; 1185 if (scene) 1186 scene->update(QRect(r)); 1187 } 1188 virtual void frameRectsChanged() 1189 { 1190 if (!graphicsWidget) 1191 return; 1192 1193 IntRect windowRect = convertToContainingWindow(IntRect(0, 0, frameRect().width(), frameRect().height())); 1194 graphicsWidget->setGeometry(QRect(windowRect)); 1195 1196 // FIXME: clipping of graphics widgets 1197 } 1198 virtual void show() 1199 { 1200 if (graphicsWidget) 1201 graphicsWidget->show(); 1202 } 1203 virtual void hide() 1204 { 1205 if (graphicsWidget) 1206 graphicsWidget->hide(); 1207 } 1208 private: 1209 QtPluginGraphicsWidget(QGraphicsWidget* w = 0): Widget(0), graphicsWidget(w) {} 1210 1211 QGraphicsWidget* graphicsWidget; 1212 }; 1213 #endif 1214 1215 PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, 1066 1216 const Vector<String>& paramValues, const String& mimeType, bool loadManually) 1067 1217 { … … 1076 1226 QString classid(element->getAttribute("classid")); 1077 1227 1078 for ( inti = 0; i < paramNames.size(); ++i) {1228 for (unsigned i = 0; i < paramNames.size(); ++i) { 1079 1229 params.append(paramNames[i]); 1080 1230 if (paramNames[i] == "classid") 1081 1231 classid = paramValues[i]; 1082 1232 } 1083 for ( inti = 0; i < paramValues.size(); ++i)1233 for (unsigned i = 0; i < paramValues.size(); ++i) 1084 1234 values.append(paramValues[i]); 1085 1235 … … 1099 1249 styleSheet += QLatin1Char(';'); 1100 1250 1101 for ( inti = 0; i < numqStyleSheetProperties; ++i) {1251 for (unsigned i = 0; i < numqStyleSheetProperties; ++i) { 1102 1252 CSSPropertyID property = qstyleSheetProperties[i]; 1103 1253 … … 1124 1274 QWidget* widget = qobject_cast<QWidget*>(object); 1125 1275 if (widget) { 1126 QWidget* view = m_webFrame->page()->view(); 1127 if (view) 1128 widget->setParent(view); 1129 QtPluginWidget* w = new QtPluginWidget(); 1276 QWidget* parentWidget = 0; 1277 if (m_webFrame->page()->d->client) 1278 parentWidget = qobject_cast<QWidget*>(m_webFrame->page()->d->client->pluginParent()); 1279 if (parentWidget) // don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose. 1280 widget->setParent(parentWidget); 1281 widget->hide(); 1282 RefPtr<QtPluginWidget> w = adoptRef(new QtPluginWidget()); 1130 1283 w->setPlatformWidget(widget); 1131 1284 // Make sure it's invisible until properly placed into the layout … … 1133 1286 return w; 1134 1287 } 1288 #if QT_VERSION >= 0x040600 1289 QGraphicsWidget* graphicsWidget = qobject_cast<QGraphicsWidget*>(object); 1290 if (graphicsWidget) { 1291 QGraphicsObject* parentWidget = 0; 1292 if (m_webFrame->page()->d->client) 1293 parentWidget = qobject_cast<QGraphicsObject*>(m_webFrame->page()->d->client->pluginParent()); 1294 graphicsWidget->hide(); 1295 if (parentWidget) // don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose. 1296 graphicsWidget->setParentItem(parentWidget); 1297 RefPtr<QtPluginGraphicsWidget> w = QtPluginGraphicsWidget::create(graphicsWidget); 1298 // Make sure it's invisible until properly placed into the layout 1299 w->setFrameRect(IntRect(0, 0, 0, 0)); 1300 return w; 1301 } 1302 #endif 1135 1303 // FIXME: make things work for widgetless plugins as well 1136 1304 delete object; 1137 1305 } else { // NPAPI Plugins 1138 PluginView*pluginView = PluginView::create(m_frame, pluginSize, element, url,1306 RefPtr<PluginView> pluginView = PluginView::create(m_frame, pluginSize, element, url, 1139 1307 paramNames, paramValues, mimeType, loadManually); 1140 1308 return pluginView; … … 1151 1319 } 1152 1320 1153 Widget* FrameLoaderClientQt::createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL,1154 const Vector<String>& paramNames, const Vector<String>& paramValues)1321 PassRefPtr<Widget> FrameLoaderClientQt::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, 1322 const Vector<String>&, const Vector<String>&) 1155 1323 { 1156 1324 notImplemented(); -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
r2 r561 60 60 friend class ::QWebFrame; 61 61 void callPolicyFunction(FramePolicyFunction function, PolicyAction action); 62 private slots: 63 void slotCallPolicyFunction(int); 62 void callErrorPageExtension(const ResourceError&); 64 63 signals: 65 void sigCallPolicyFunction(int);66 64 void loadStarted(); 67 65 void loadProgress(int d); … … 99 97 virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long, const WebCore::ResourceError&); 100 98 virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int); 99 virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const WebCore::ScriptString& sourceString); 101 100 102 101 virtual void dispatchDidHandleOnloadEvents(); … … 148 147 149 148 virtual void updateGlobalHistory(); 149 virtual void updateGlobalHistoryRedirectLinks(); 150 150 virtual bool shouldGoToHistoryItem(HistoryItem*) const; 151 152 virtual void didDisplayInsecureContent(); 153 virtual void didRunInsecureContent(SecurityOrigin*); 151 154 152 155 virtual ResourceError cancelledError(const ResourceRequest&); … … 178 181 virtual String userAgent(const WebCore::KURL&); 179 182 180 virtual void savePlatformDataToCached Page(WebCore::CachedPage*);181 virtual void transitionToCommittedFromCached Page(WebCore::CachedPage*);183 virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); 184 virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); 182 185 virtual void transitionToCommittedForNewPage(); 183 186 … … 187 190 virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, 188 191 const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) ; 189 virtual Widget* createPlugin(const IntSize&,Element*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool);192 virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool); 190 193 virtual void redirectDataToPlugin(Widget* pluginWidget); 191 194 192 virtual Widget* createJavaAppletWidget(const IntSize&,Element*, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues);195 virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues); 193 196 194 197 virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType); … … 196 199 197 200 virtual void windowObjectCleared(); 201 virtual void documentElementAvailable(); 198 202 virtual void didPerformFirstNavigation() const; 199 203 … … 207 211 ResourceResponse m_response; 208 212 bool m_firstData; 209 FramePolicyFunction m_policyFunction;210 213 211 214 // Plugin view to redirect data to … … 213 216 bool m_hasSentResponseToPlugin; 214 217 215 bool m_loadSucceeded;218 ResourceError m_loadError; 216 219 }; 217 220 -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
r2 r561 32 32 #include "InspectorClientQt.h" 33 33 34 #include "qwebinspector.h" 35 #include "qwebinspector_p.h" 34 36 #include "qwebpage.h" 35 37 #include "qwebpage_p.h" 36 38 #include "qwebview.h" 37 39 40 #include <QtCore/QSettings> 38 41 #include <QtCore/QCoreApplication> 39 42 … … 45 48 namespace WebCore { 46 49 47 class InspectorClientWebPage : public QWebPage 48 { 50 static const QLatin1String settingStoragePrefix("Qt/QtWebKit/QWebInspector/"); 51 static const QLatin1String settingStorageTypeSuffix(".type"); 52 53 static InspectorController::Setting variantToSetting(const QVariant& qvariant); 54 static QVariant settingToVariant(const InspectorController::Setting& icSetting); 55 56 class InspectorClientWebPage : public QWebPage { 49 57 Q_OBJECT 50 58 friend class InspectorClientQt; 51 59 public: 60 InspectorClientWebPage(QObject* parent = 0) 61 : QWebPage(parent) 62 { 63 settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, false); 64 } 65 52 66 QWebPage* createWindow(QWebPage::WebWindowType) 53 67 { 54 QW idget *w = new QWebView(0);55 QWebPage *page = new QWebPage(w);56 page->setView(w);57 connect(page, SIGNAL(destroyed()), w, SLOT(deleteLater()));68 QWebView* view = new QWebView; 69 QWebPage* page = new QWebPage; 70 view->setPage(page); 71 view->setAttribute(Qt::WA_DeleteOnClose); 58 72 return page; 59 73 } 60 61 Q_SIGNALS:62 void attachRequested();63 void detachRequested();64 74 }; 65 66 67 class InspectorClientView : public QWebView {68 public:69 InspectorClientView(InspectorController* controller)70 : QWebView(0)71 , m_controller(controller)72 {73 setPage(new InspectorClientWebPage);74 connect(page(), SIGNAL(destroyed()), SLOT(deleteLater()));75 }76 77 protected:78 79 void closeEvent(QCloseEvent* ev)80 {81 QWidget::closeEvent(ev);82 m_controller->setWindowVisible(false);83 }84 85 private:86 InspectorController* m_controller;87 };88 89 75 90 76 InspectorClientQt::InspectorClientQt(QWebPage* page) … … 99 85 Page* InspectorClientQt::createPage() 100 86 { 101 if (m_webPage) 102 return m_webPage->d->page; 103 104 InspectorClientView* view = new InspectorClientView(m_inspectedWebPage->d->page->inspectorController()); 105 m_webPage.set(qobject_cast<InspectorClientWebPage*>(view->page())); 106 m_webPage->mainFrame()->load(QString::fromLatin1("qrc:/webkit/inspector/inspector.html")); 107 m_webPage->view()->setMinimumSize(400,300); 108 return m_webPage->d->page; 87 QWebView* inspectorView = new QWebView; 88 InspectorClientWebPage* inspectorPage = new InspectorClientWebPage(inspectorView); 89 inspectorView->setPage(inspectorPage); 90 m_inspectorView.set(inspectorView); 91 92 inspectorPage->mainFrame()->load(QString::fromLatin1("qrc:/webkit/inspector/inspector.html")); 93 m_inspectedWebPage->d->inspectorFrontend = inspectorView; 94 m_inspectedWebPage->d->getOrCreateInspector()->d->setFrontend(inspectorView); 95 96 return m_inspectorView->page()->d->page; 109 97 } 110 98 … … 115 103 } 116 104 105 String InspectorClientQt::hiddenPanels() 106 { 107 notImplemented(); 108 return String(); 109 } 110 117 111 void InspectorClientQt::showWindow() 118 112 { 119 if (!m_webPage)120 return;121 122 113 updateWindowTitle(); 123 m_webPage->view()->show(); 124 m_inspectedWebPage->d->page->inspectorController()->setWindowVisible(true); 114 115 m_inspectedWebPage->d->inspectorController()->setWindowVisible(true, true); 116 // We don't allow the inspector to ask for widget visibility itself because showWindow is 117 // not always called when we want. 118 // Inspecting an element or calling QWebInspector::show() should already have made the 119 // widget visible. 125 120 } 126 121 127 122 void InspectorClientQt::closeWindow() 128 123 { 129 if (!m_webPage) 130 return; 131 132 m_webPage->view()->hide(); 133 m_inspectedWebPage->d->page->inspectorController()->setWindowVisible(false); 134 } 135 136 bool InspectorClientQt::windowVisible() 137 { 138 if (!m_webPage) 139 return false; 140 return m_webPage->view()->isVisible(); 124 if (m_inspectedWebPage->d->inspector) 125 m_inspectedWebPage->d->inspector->close(); 141 126 } 142 127 143 128 void InspectorClientQt::attachWindow() 144 129 { 145 if (!m_webPage) 146 return; 147 148 emit m_webPage->attachRequested(); 130 notImplemented(); 149 131 } 150 132 151 133 void InspectorClientQt::detachWindow() 152 134 { 153 if (!m_webPage) 154 return; 155 156 emit m_webPage->detachRequested(); 157 } 158 159 void InspectorClientQt::setAttachedWindowHeight(unsigned height) 160 { 161 notImplemented(); 162 } 163 164 void InspectorClientQt::highlight(Node* node) 135 notImplemented(); 136 } 137 138 void InspectorClientQt::setAttachedWindowHeight(unsigned) 139 { 140 notImplemented(); 141 } 142 143 void InspectorClientQt::highlight(Node*) 165 144 { 166 145 notImplemented(); … … 178 157 } 179 158 159 void InspectorClientQt::inspectorWindowObjectCleared() 160 { 161 notImplemented(); 162 } 163 180 164 void InspectorClientQt::updateWindowTitle() 181 165 { 182 if (!m_webPage) 166 if (m_inspectedWebPage->d->inspector) { 167 QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2").arg(m_inspectedURL); 168 m_inspectedWebPage->d->inspector->setWindowTitle(caption); 169 } 170 } 171 172 void InspectorClientQt::populateSetting(const String& key, InspectorController::Setting& setting) 173 { 174 QSettings qsettings; 175 if (qsettings.status() == QSettings::AccessError) { 176 // QCoreApplication::setOrganizationName and QCoreApplication::setApplicationName haven't been called 177 qWarning("QWebInspector: QSettings couldn't read configuration setting [%s].", 178 qPrintable(static_cast<QString>(key))); 183 179 return; 184 185 QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2"); 186 m_webPage->view()->setWindowTitle(caption.arg(m_inspectedURL)); 187 } 188 189 void InspectorClientQt::populateSetting(const String& key, InspectorController::Setting& setting) 190 { 191 notImplemented(); 180 } 181 182 QString settingKey(settingStoragePrefix + key); 183 QString storedValueType = qsettings.value(settingKey + settingStorageTypeSuffix).toString(); 184 QVariant storedValue = qsettings.value(settingKey); 185 storedValue.convert(QVariant::nameToType(storedValueType.toAscii().data())); 186 setting = variantToSetting(storedValue); 192 187 } 193 188 194 189 void InspectorClientQt::storeSetting(const String& key, const InspectorController::Setting& setting) 195 190 { 196 notImplemented(); 197 } 198 199 void InspectorClientQt::removeSetting(const String& key) 200 { 201 notImplemented(); 191 QSettings qsettings; 192 if (qsettings.status() == QSettings::AccessError) { 193 qWarning("QWebInspector: QSettings couldn't persist configuration setting [%s].", 194 qPrintable(static_cast<QString>(key))); 195 return; 196 } 197 198 QVariant valueToStore = settingToVariant(setting); 199 QString settingKey(settingStoragePrefix + key); 200 qsettings.setValue(settingKey, valueToStore); 201 qsettings.setValue(settingKey + settingStorageTypeSuffix, QVariant::typeToName(valueToStore.type())); 202 } 203 204 void InspectorClientQt::removeSetting(const String&) 205 { 206 notImplemented(); 207 } 208 209 static InspectorController::Setting variantToSetting(const QVariant& qvariant) 210 { 211 InspectorController::Setting retVal; 212 213 switch (qvariant.type()) { 214 case QVariant::Bool: 215 retVal.set(qvariant.toBool()); 216 break; 217 case QVariant::Double: 218 retVal.set(qvariant.toDouble()); 219 break; 220 case QVariant::Int: 221 retVal.set((long)qvariant.toInt()); 222 break; 223 case QVariant::String: 224 retVal.set(qvariant.toString()); 225 break; 226 case QVariant::StringList: { 227 QStringList qsList = qvariant.toStringList(); 228 int listCount = qsList.count(); 229 Vector<String> vector(listCount); 230 for (int i = 0; i < listCount; ++i) 231 vector[i] = qsList[i]; 232 retVal.set(vector); 233 break; 234 } 235 } 236 237 return retVal; 238 } 239 240 static QVariant settingToVariant(const InspectorController::Setting& icSetting) 241 { 242 QVariant retVal; 243 244 switch (icSetting.type()) { 245 case InspectorController::Setting::StringType: 246 retVal.setValue(static_cast<QString>(icSetting.string())); 247 break; 248 case InspectorController::Setting::StringVectorType: { 249 const Vector<String>& vector = icSetting.stringVector(); 250 Vector<String>::const_iterator iter; 251 QStringList qsList; 252 for (iter = vector.begin(); iter != vector.end(); ++iter) 253 qsList << *iter; 254 retVal.setValue(qsList); 255 break; 256 } 257 case InspectorController::Setting::DoubleType: 258 retVal.setValue(icSetting.doubleValue()); 259 break; 260 case InspectorController::Setting::IntegerType: 261 retVal.setValue((int)icSetting.integerValue()); 262 break; 263 case InspectorController::Setting::BooleanType: 264 retVal.setValue(icSetting.booleanValue()); 265 break; 266 } 267 268 return retVal; 202 269 } 203 270 -
trunk/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h
r2 r561 36 36 37 37 class QWebPage; 38 class QWebView; 38 39 39 40 namespace WebCore { … … 41 42 class Page; 42 43 class String; 43 class InspectorClientWebPage;44 44 45 45 class InspectorClientQt : public InspectorClient { … … 53 53 virtual String localizedStringsURL(); 54 54 55 virtual String hiddenPanels(); 56 55 57 virtual void showWindow(); 56 58 virtual void closeWindow(); 57 virtual bool windowVisible();58 59 59 60 virtual void attachWindow(); … … 70 71 virtual void removeSetting(const String& key); 71 72 73 virtual void inspectorWindowObjectCleared(); 74 72 75 private: 73 76 void updateWindowTitle(); 74 77 QWebPage* m_inspectedWebPage; 75 OwnPtr< InspectorClientWebPage> m_webPage;78 OwnPtr<QWebView> m_inspectorView; 76 79 QString m_inspectedURL; 77 80 }; -
trunk/src/3rdparty/webkit/WebKit/qt/WebKit_pch.h
r2 r561 78 78 #include <wtf/AlwaysInline.h> 79 79 #include <wtf/GetPtr.h> 80 81 #include "../../WebCore/bindings/js/JSDOMBinding.h"82 #include "../../JavaScriptCore/runtime/MathObject.h"83 80 #endif -
trunk/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
r2 r561 6 6 QT += testlib network 7 7 QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR 8 !symbian:DEFINES += SRCDIR=\\\"$$PWD/resources\\\" 9 10 symbian { 11 TARGET.UID3 = 0xA000E53D 12 TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices 13 } -
trunk/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.qrc
r2 r561 2 2 <qresource prefix="/"> 3 3 <file>image.png</file> 4 <file>style.css</file> 5 <file>test1.html</file> 6 <file>test2.html</file> 7 <file>testiframe.html</file> 8 <file>testiframe2.html</file> 4 9 </qresource> 5 10 </RCC> -
trunk/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
r2 r561 22 22 23 23 #include <qwebpage.h> 24 #include <qwebelement.h> 24 25 #include <qwidget.h> 25 26 #include <qwebview.h> … … 29 30 #include <QApplication> 30 31 #include <QComboBox> 32 #include <QPicture> 31 33 #include <QRegExp> 32 34 #include <QNetworkRequest> 35 #include <QNetworkReply> 36 #ifndef QT_NO_OPENSSL 37 #include <qsslerror.h> 38 #endif 39 #include "../util.h" 40 41 #if defined(Q_OS_SYMBIAN) 42 # define SRCDIR "" 43 #endif 44 33 45 //TESTED_CLASS= 34 46 //TESTED_FILES= … … 571 583 void symmetricUrl(); 572 584 void progressSignal(); 585 void urlChange(); 573 586 void domCycles(); 587 void requestedUrl(); 588 void javaScriptWindowObjectCleared_data(); 589 void javaScriptWindowObjectCleared(); 590 void javaScriptWindowObjectClearedOnEvaluate(); 574 591 void setHtml(); 575 592 void setHtmlWithResource(); 593 void setHtmlWithBaseURL(); 594 void setHtmlWithJSAlert(); 576 595 void ipv6HostEncoding(); 577 596 void metaData(); 578 597 void popupFocus(); 598 void hitTestContent(); 579 599 void jsByteArray(); 580 600 void ownership(); 601 void nullValue(); 602 void baseUrl_data(); 603 void baseUrl(); 604 void hasSetFocus(); 605 void render(); 606 void scrollPosition(); 607 void evaluateWillCauseRepaint(); 608 void qObjectWrapperWithSameIdentity(); 609 void scrollRecursively(); 610 581 611 private: 582 612 QString evalJS(const QString&s) { … … 678 708 m_myObject = new MyQObject(); 679 709 m_page->mainFrame()->addToJavaScriptWindowObject("myObject", m_myObject); 710 QDir::setCurrent(SRCDIR); 680 711 } 681 712 … … 2125 2156 } 2126 2157 2158 void tst_QWebFrame::urlChange() 2159 { 2160 QSignalSpy urlSpy(m_page->mainFrame(), SIGNAL(urlChanged(QUrl))); 2161 2162 QUrl dataUrl("data:text/html,<h1>Test"); 2163 m_view->setUrl(dataUrl); 2164 2165 ::waitForSignal(m_page->mainFrame(), SIGNAL(urlChanged(QUrl))); 2166 2167 QCOMPARE(urlSpy.size(), 1); 2168 2169 QUrl dataUrl2("data:text/html,<html><head><title>title</title></head><body><h1>Test</body></html>"); 2170 m_view->setUrl(dataUrl2); 2171 2172 ::waitForSignal(m_page->mainFrame(), SIGNAL(urlChanged(QUrl))); 2173 2174 QCOMPARE(urlSpy.size(), 2); 2175 } 2176 2177 2127 2178 void tst_QWebFrame::domCycles() 2128 2179 { … … 2132 2183 } 2133 2184 2185 class FakeReply : public QNetworkReply { 2186 Q_OBJECT 2187 2188 public: 2189 FakeReply(const QNetworkRequest& request, QObject* parent = 0) 2190 : QNetworkReply(parent) 2191 { 2192 setOperation(QNetworkAccessManager::GetOperation); 2193 setRequest(request); 2194 if (request.url() == QUrl("qrc:/test1.html")) { 2195 setHeader(QNetworkRequest::LocationHeader, QString("qrc:/test2.html")); 2196 setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl("qrc:/test2.html")); 2197 } 2198 #ifndef QT_NO_OPENSSL 2199 else if (request.url() == QUrl("qrc:/fake-ssl-error.html")) 2200 setError(QNetworkReply::SslHandshakeFailedError, tr("Fake error !")); // force a ssl error 2201 #endif 2202 else if (request.url() == QUrl("http://abcdef.abcdef/")) 2203 setError(QNetworkReply::HostNotFoundError, tr("Invalid URL")); 2204 2205 open(QIODevice::ReadOnly); 2206 QTimer::singleShot(0, this, SLOT(timeout())); 2207 } 2208 ~FakeReply() 2209 { 2210 close(); 2211 } 2212 virtual void abort() {} 2213 virtual void close() {} 2214 2215 protected: 2216 qint64 readData(char*, qint64) 2217 { 2218 return 0; 2219 } 2220 2221 private slots: 2222 void timeout() 2223 { 2224 if (request().url() == QUrl("qrc://test1.html")) 2225 emit error(this->error()); 2226 else if (request().url() == QUrl("http://abcdef.abcdef/")) 2227 emit metaDataChanged(); 2228 #ifndef QT_NO_OPENSSL 2229 else if (request().url() == QUrl("qrc:/fake-ssl-error.html")) 2230 return; 2231 #endif 2232 2233 emit readyRead(); 2234 emit finished(); 2235 } 2236 }; 2237 2238 class FakeNetworkManager : public QNetworkAccessManager { 2239 Q_OBJECT 2240 2241 public: 2242 FakeNetworkManager(QObject* parent) : QNetworkAccessManager(parent) { } 2243 2244 protected: 2245 virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest& request, QIODevice* outgoingData) 2246 { 2247 QString url = request.url().toString(); 2248 if (op == QNetworkAccessManager::GetOperation) 2249 if (url == "qrc:/test1.html" || url == "http://abcdef.abcdef/") 2250 return new FakeReply(request, this); 2251 #ifndef QT_NO_OPENSSL 2252 else if (url == "qrc:/fake-ssl-error.html") { 2253 FakeReply* reply = new FakeReply(request, this); 2254 QList<QSslError> errors; 2255 emit sslErrors(reply, errors << QSslError(QSslError::UnspecifiedError)); 2256 return reply; 2257 } 2258 #endif 2259 2260 return QNetworkAccessManager::createRequest(op, request, outgoingData); 2261 } 2262 }; 2263 2264 void tst_QWebFrame::requestedUrl() 2265 { 2266 QWebPage page; 2267 QWebFrame* frame = page.mainFrame(); 2268 2269 // in few seconds, the image should be completely loaded 2270 QSignalSpy spy(&page, SIGNAL(loadFinished(bool))); 2271 FakeNetworkManager* networkManager = new FakeNetworkManager(&page); 2272 page.setNetworkAccessManager(networkManager); 2273 2274 frame->setUrl(QUrl("qrc:/test1.html")); 2275 QTest::qWait(200); 2276 QCOMPARE(spy.count(), 1); 2277 QCOMPARE(frame->requestedUrl(), QUrl("qrc:/test1.html")); 2278 QCOMPARE(frame->url(), QUrl("qrc:/test2.html")); 2279 2280 frame->setUrl(QUrl("qrc:/non-existent.html")); 2281 QTest::qWait(200); 2282 QCOMPARE(spy.count(), 2); 2283 QCOMPARE(frame->requestedUrl(), QUrl("qrc:/non-existent.html")); 2284 QCOMPARE(frame->url(), QUrl("qrc:/non-existent.html")); 2285 2286 frame->setUrl(QUrl("http://abcdef.abcdef")); 2287 QTest::qWait(200); 2288 QCOMPARE(spy.count(), 3); 2289 QCOMPARE(frame->requestedUrl(), QUrl("http://abcdef.abcdef/")); 2290 QCOMPARE(frame->url(), QUrl("http://abcdef.abcdef/")); 2291 2292 #ifndef QT_NO_OPENSSL 2293 qRegisterMetaType<QList<QSslError> >("QList<QSslError>"); 2294 qRegisterMetaType<QNetworkReply* >("QNetworkReply*"); 2295 2296 QSignalSpy spy2(page.networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>))); 2297 frame->setUrl(QUrl("qrc:/fake-ssl-error.html")); 2298 QTest::qWait(200); 2299 QCOMPARE(spy2.count(), 1); 2300 QCOMPARE(frame->requestedUrl(), QUrl("qrc:/fake-ssl-error.html")); 2301 QCOMPARE(frame->url(), QUrl("qrc:/fake-ssl-error.html")); 2302 #endif 2303 } 2304 2305 void tst_QWebFrame::javaScriptWindowObjectCleared_data() 2306 { 2307 QTest::addColumn<QString>("html"); 2308 QTest::addColumn<int>("signalCount"); 2309 QTest::newRow("with <script>") << "<html><body><script></script><p>hello world</p></body></html>" << 1; 2310 QTest::newRow("without <script>") << "<html><body><p>hello world</p></body></html>" << 0; 2311 } 2312 2313 void tst_QWebFrame::javaScriptWindowObjectCleared() 2314 { 2315 QWebPage page; 2316 QWebFrame* frame = page.mainFrame(); 2317 QSignalSpy spy(frame, SIGNAL(javaScriptWindowObjectCleared())); 2318 QFETCH(QString, html); 2319 frame->setHtml(html); 2320 2321 QFETCH(int, signalCount); 2322 QCOMPARE(spy.count(), signalCount); 2323 } 2324 2325 void tst_QWebFrame::javaScriptWindowObjectClearedOnEvaluate() 2326 { 2327 QWebPage page; 2328 QWebFrame* frame = page.mainFrame(); 2329 QSignalSpy spy(frame, SIGNAL(javaScriptWindowObjectCleared())); 2330 frame->setHtml("<html></html>"); 2331 QCOMPARE(spy.count(), 0); 2332 frame->evaluateJavaScript("var a = 'a';"); 2333 QCOMPARE(spy.count(), 1); 2334 // no new clear for a new script: 2335 frame->evaluateJavaScript("var a = 1;"); 2336 QCOMPARE(spy.count(), 1); 2337 } 2338 2134 2339 void tst_QWebFrame::setHtml() 2135 2340 { 2136 QString html("<html>< body><p>hello world</p></body></html>");2341 QString html("<html><head></head><body><p>hello world</p></body></html>"); 2137 2342 m_view->page()->mainFrame()->setHtml(html); 2138 2343 QCOMPARE(m_view->page()->mainFrame()->toHtml(), html); … … 2155 2360 QCOMPARE(frame->evaluateJavaScript("document.images[0].width").toInt(), 128); 2156 2361 QCOMPARE(frame->evaluateJavaScript("document.images[0].height").toInt(), 128); 2362 2363 QString html2 = 2364 "<html>" 2365 "<head>" 2366 "<link rel='stylesheet' href='qrc:/style.css' type='text/css' />" 2367 "</head>" 2368 "<body>" 2369 "<p id='idP'>some text</p>" 2370 "</body>" 2371 "</html>"; 2372 2373 // in few seconds, the CSS should be completey loaded 2374 frame->setHtml(html2); 2375 QTest::qWait(200); 2376 QCOMPARE(spy.size(), 2); 2377 2378 QWebElement p = frame->documentElement().findAll("p").at(0); 2379 QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("red")); 2380 } 2381 2382 void tst_QWebFrame::setHtmlWithBaseURL() 2383 { 2384 QString html("<html><body><p>hello world</p><img src='resources/image2.png'/></body></html>"); 2385 2386 QWebPage page; 2387 QWebFrame* frame = page.mainFrame(); 2388 2389 // in few seconds, the image should be completey loaded 2390 QSignalSpy spy(&page, SIGNAL(loadFinished(bool))); 2391 2392 frame->setHtml(html, QUrl::fromLocalFile(QDir::currentPath())); 2393 QTest::qWait(200); 2394 QCOMPARE(spy.count(), 1); 2395 2396 QCOMPARE(frame->evaluateJavaScript("document.images.length").toInt(), 1); 2397 QCOMPARE(frame->evaluateJavaScript("document.images[0].width").toInt(), 128); 2398 QCOMPARE(frame->evaluateJavaScript("document.images[0].height").toInt(), 128); 2399 2400 // no history item has to be added. 2401 QCOMPARE(m_view->page()->history()->count(), 0); 2402 } 2403 2404 class MyPage : public QWebPage 2405 { 2406 public: 2407 MyPage() : QWebPage(), alerts(0) {} 2408 int alerts; 2409 2410 protected: 2411 virtual void javaScriptAlert(QWebFrame*, const QString& msg) 2412 { 2413 alerts++; 2414 QCOMPARE(msg, QString("foo")); 2415 // Should not be enough to trigger deferred loading, since we've upped the HTML 2416 // tokenizer delay in the Qt frameloader. See HTMLTokenizer::continueProcessing() 2417 QTest::qWait(1000); 2418 } 2419 }; 2420 2421 void tst_QWebFrame::setHtmlWithJSAlert() 2422 { 2423 QString html("<html><head></head><body><script>alert('foo');</script><p>hello world</p></body></html>"); 2424 MyPage page; 2425 m_view->setPage(&page); 2426 page.mainFrame()->setHtml(html); 2427 QCOMPARE(page.alerts, 1); 2428 QCOMPARE(m_view->page()->mainFrame()->toHtml(), html); 2157 2429 } 2158 2430 … … 2245 2517 view.show(); 2246 2518 view.setFocus(); 2247 QTest::qWait(200); 2248 QVERIFY2(view.hasFocus(), 2249 "The WebView should be created"); 2519 QTRY_VERIFY(view.hasFocus()); 2250 2520 2251 2521 // open the popup by clicking. check if focus is on the popup … … 2253 2523 QObject* webpopup = firstChildByClassName(&view, "WebCore::QWebPopup"); 2254 2524 QComboBox* combo = qobject_cast<QComboBox*>(webpopup); 2255 QTest::qWait(500); 2256 QVERIFY2(!view.hasFocus() && combo->view()->hasFocus(), 2257 "Focus sould be on the Popup"); 2525 QTRY_VERIFY(!view.hasFocus() && combo->view()->hasFocus()); // Focus should be on the popup 2258 2526 2259 2527 // hide the popup and check if focus is on the page 2260 2528 combo->hidePopup(); 2261 QTest::qWait(500); 2262 QVERIFY2(view.hasFocus() && !combo->view()->hasFocus(), 2263 "Focus sould be back on the WebView"); 2529 QTRY_VERIFY(view.hasFocus() && !combo->view()->hasFocus()); // Focus should be back on the WebView 2264 2530 2265 2531 // triple the flashing time, should at least blink twice already … … 2273 2539 QVERIFY2(m_popupTestPaintCount >= 4, 2274 2540 "The input field should have a blinking caret"); 2541 } 2542 2543 void tst_QWebFrame::hitTestContent() 2544 { 2545 QString html("<html><body><p>A paragraph</p><br/><br/><br/><a href=\"about:blank\" target=\"_foo\">link text</a></body></html>"); 2546 2547 QWebPage page; 2548 QWebFrame* frame = page.mainFrame(); 2549 frame->setHtml(html); 2550 page.setViewportSize(QSize(200, 0)); //no height so link is not visible 2551 QWebHitTestResult result = frame->hitTestContent(QPoint(10, 100)); 2552 QCOMPARE(result.linkText(), QString("link text")); 2553 QWebElement link = result.linkElement(); 2554 QCOMPARE(link.attribute("target"), QString("_foo")); 2275 2555 } 2276 2556 … … 2352 2632 } 2353 2633 2634 void tst_QWebFrame::nullValue() 2635 { 2636 QVariant v = m_view->page()->mainFrame()->evaluateJavaScript("null"); 2637 QVERIFY(v.isNull()); 2638 } 2639 2640 void tst_QWebFrame::baseUrl_data() 2641 { 2642 QTest::addColumn<QString>("html"); 2643 QTest::addColumn<QUrl>("loadUrl"); 2644 QTest::addColumn<QUrl>("url"); 2645 QTest::addColumn<QUrl>("baseUrl"); 2646 2647 QTest::newRow("null") << QString() << QUrl() 2648 << QUrl("about:blank") << QUrl("about:blank"); 2649 2650 QTest::newRow("foo") << QString() << QUrl("http://foobar.baz/") 2651 << QUrl("http://foobar.baz/") << QUrl("http://foobar.baz/"); 2652 2653 QString html = "<html>" 2654 "<head>" 2655 "<base href=\"http://foobaz.bar/\" />" 2656 "</head>" 2657 "</html>"; 2658 QTest::newRow("customBaseUrl") << html << QUrl("http://foobar.baz/") 2659 << QUrl("http://foobar.baz/") << QUrl("http://foobaz.bar/"); 2660 } 2661 2662 void tst_QWebFrame::baseUrl() 2663 { 2664 QFETCH(QString, html); 2665 QFETCH(QUrl, loadUrl); 2666 QFETCH(QUrl, url); 2667 QFETCH(QUrl, baseUrl); 2668 2669 m_page->mainFrame()->setHtml(html, loadUrl); 2670 QCOMPARE(m_page->mainFrame()->url(), url); 2671 QCOMPARE(m_page->mainFrame()->baseUrl(), baseUrl); 2672 } 2673 2674 void tst_QWebFrame::hasSetFocus() 2675 { 2676 QString html("<html><body><p>top</p>" \ 2677 "<iframe width='80%' height='30%'/>" \ 2678 "</body></html>"); 2679 2680 QSignalSpy loadSpy(m_page, SIGNAL(loadFinished(bool))); 2681 m_page->mainFrame()->setHtml(html); 2682 2683 QTest::qWait(200); 2684 QCOMPARE(loadSpy.size(), 1); 2685 2686 QList<QWebFrame*> children = m_page->mainFrame()->childFrames(); 2687 QWebFrame* frame = children.at(0); 2688 QString innerHtml("<html><body><p>another iframe</p>" \ 2689 "<iframe width='80%' height='30%'/>" \ 2690 "</body></html>"); 2691 frame->setHtml(innerHtml); 2692 2693 QTest::qWait(200); 2694 QCOMPARE(loadSpy.size(), 2); 2695 2696 m_page->mainFrame()->setFocus(); 2697 QTRY_VERIFY(m_page->mainFrame()->hasFocus()); 2698 2699 for (int i = 0; i < children.size(); ++i) { 2700 children.at(i)->setFocus(); 2701 QTRY_VERIFY(children.at(i)->hasFocus()); 2702 QVERIFY(!m_page->mainFrame()->hasFocus()); 2703 } 2704 2705 m_page->mainFrame()->setFocus(); 2706 QTRY_VERIFY(m_page->mainFrame()->hasFocus()); 2707 } 2708 2709 void tst_QWebFrame::render() 2710 { 2711 QString html("<html>" \ 2712 "<head><style>" \ 2713 "body, iframe { margin: 0px; border: none; }" \ 2714 "</style></head>" \ 2715 "<body><iframe width='100px' height='100px'/></body>" \ 2716 "</html>"); 2717 2718 QWebPage page; 2719 page.mainFrame()->setHtml(html); 2720 2721 QList<QWebFrame*> frames = page.mainFrame()->childFrames(); 2722 QWebFrame *frame = frames.at(0); 2723 QString innerHtml("<body style='margin: 0px;'><img src='qrc:/image.png'/></body>"); 2724 frame->setHtml(innerHtml); 2725 2726 QPicture picture; 2727 2728 QSize size = page.mainFrame()->contentsSize(); 2729 page.setViewportSize(size); 2730 2731 // render contents layer only (the iframe is smaller than the image, so it will have scrollbars) 2732 QPainter painter1(&picture); 2733 frame->render(&painter1, QWebFrame::ContentsLayer); 2734 painter1.end(); 2735 2736 QCOMPARE(size.width(), picture.boundingRect().width() + frame->scrollBarGeometry(Qt::Vertical).width()); 2737 QCOMPARE(size.height(), picture.boundingRect().height() + frame->scrollBarGeometry(Qt::Horizontal).height()); 2738 2739 // render everything, should be the size of the iframe 2740 QPainter painter2(&picture); 2741 frame->render(&painter2, QWebFrame::AllLayers); 2742 painter2.end(); 2743 2744 QCOMPARE(size.width(), picture.boundingRect().width()); // width: 100px 2745 QCOMPARE(size.height(), picture.boundingRect().height()); // height: 100px 2746 } 2747 2748 void tst_QWebFrame::scrollPosition() 2749 { 2750 // enlarged image in a small viewport, to provoke the scrollbars to appear 2751 QString html("<html><body><img src='qrc:/image.png' height=500 width=500/></body></html>"); 2752 2753 QWebPage page; 2754 page.setViewportSize(QSize(200, 200)); 2755 2756 QWebFrame* frame = page.mainFrame(); 2757 frame->setHtml(html); 2758 frame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); 2759 frame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); 2760 2761 // try to set the scroll offset programmatically 2762 frame->setScrollPosition(QPoint(23, 29)); 2763 QCOMPARE(frame->scrollPosition().x(), 23); 2764 QCOMPARE(frame->scrollPosition().y(), 29); 2765 2766 int x = frame->evaluateJavaScript("window.scrollX").toInt(); 2767 int y = frame->evaluateJavaScript("window.scrollY").toInt(); 2768 QCOMPARE(x, 23); 2769 QCOMPARE(y, 29); 2770 } 2771 2772 void tst_QWebFrame::evaluateWillCauseRepaint() 2773 { 2774 QWebView view; 2775 QString html("<html><body>top<div id=\"junk\" style=\"display: block;\">" 2776 "junk</div>bottom</body></html>"); 2777 view.setHtml(html); 2778 view.show(); 2779 2780 QTest::qWait(200); 2781 2782 view.page()->mainFrame()->evaluateJavaScript( 2783 "document.getElementById('junk').style.display = 'none';"); 2784 2785 ::waitForSignal(view.page(), SIGNAL(repaintRequested(QRect))); 2786 2787 QTest::qWait(2000); 2788 } 2789 2790 class TestFactory : public QObject 2791 { 2792 Q_OBJECT 2793 public: 2794 TestFactory() 2795 : obj(0), counter(0) 2796 {} 2797 2798 Q_INVOKABLE QObject* getNewObject() 2799 { 2800 delete obj; 2801 obj = new QObject(this); 2802 obj->setObjectName(QLatin1String("test") + QString::number(++counter)); 2803 return obj; 2804 2805 } 2806 2807 QObject* obj; 2808 int counter; 2809 }; 2810 2811 void tst_QWebFrame::qObjectWrapperWithSameIdentity() 2812 { 2813 m_view->setHtml("<script>function triggerBug() { document.getElementById('span1').innerText = test.getNewObject().objectName; }</script>" 2814 "<body><span id='span1'>test</span></body>"); 2815 2816 QWebFrame* mainFrame = m_view->page()->mainFrame(); 2817 QCOMPARE(mainFrame->toPlainText(), QString("test")); 2818 2819 mainFrame->addToJavaScriptWindowObject("test", new TestFactory, QScriptEngine::ScriptOwnership); 2820 2821 mainFrame->evaluateJavaScript("triggerBug();"); 2822 QCOMPARE(mainFrame->toPlainText(), QString("test1")); 2823 2824 mainFrame->evaluateJavaScript("triggerBug();"); 2825 QCOMPARE(mainFrame->toPlainText(), QString("test2")); 2826 } 2827 2828 bool QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int dx, int dy); 2829 2830 void tst_QWebFrame::scrollRecursively() 2831 { 2832 // The test content is 2833 // a nested frame set 2834 // The main frame scrolls 2835 // and has two children 2836 // an iframe and a div overflow 2837 // both scroll 2838 QWebView webView; 2839 QWebPage* webPage = webView.page(); 2840 QSignalSpy loadSpy(webPage, SIGNAL(loadFinished(bool))); 2841 QUrl url = QUrl("qrc:///testiframe.html"); 2842 webPage->mainFrame()->load(url); 2843 QTRY_COMPARE(loadSpy.count(), 1); 2844 2845 QList<QWebFrame*> children = webPage->mainFrame()->childFrames(); 2846 QVERIFY(children.count() == 1); 2847 2848 // 1st test 2849 // call scrollRecursively over mainframe 2850 // verify scrolled 2851 // verify scroll postion changed 2852 QPoint scrollPosition(webPage->mainFrame()->scrollPosition()); 2853 QVERIFY(qtwebkit_webframe_scrollRecursively(webPage->mainFrame(), 10, 10)); 2854 QVERIFY(scrollPosition != webPage->mainFrame()->scrollPosition()); 2855 2856 // 2nd test 2857 // call scrollRecursively over child iframe 2858 // verify scrolled 2859 // verify child scroll position changed 2860 // verify parent's scroll position did not change 2861 scrollPosition = webPage->mainFrame()->scrollPosition(); 2862 QPoint childScrollPosition = children.at(0)->scrollPosition(); 2863 QVERIFY(qtwebkit_webframe_scrollRecursively(children.at(0), 10, 10)); 2864 QVERIFY(scrollPosition == webPage->mainFrame()->scrollPosition()); 2865 QVERIFY(childScrollPosition != children.at(0)->scrollPosition()); 2866 2867 // 3rd test 2868 // call scrollRecursively over div overflow 2869 // verify scrolled == true 2870 // verify parent and child frame's scroll postion did not change 2871 QWebElement div = webPage->mainFrame()->documentElement().findFirst("#content1"); 2872 QMouseEvent evpres(QEvent::MouseMove, div.geometry().center(), Qt::NoButton, Qt::NoButton, Qt::NoModifier); 2873 webPage->event(&evpres); 2874 scrollPosition = webPage->mainFrame()->scrollPosition(); 2875 childScrollPosition = children.at(0)->scrollPosition(); 2876 QVERIFY(qtwebkit_webframe_scrollRecursively(webPage->mainFrame(), 5, 5)); 2877 QVERIFY(childScrollPosition == children.at(0)->scrollPosition()); 2878 QVERIFY(scrollPosition == webPage->mainFrame()->scrollPosition()); 2879 2880 // 4th test 2881 // call scrollRecursively twice over childs iframe 2882 // verify scrolled == true first time 2883 // verify parent's scroll == true second time 2884 // verify parent and childs scroll position changed 2885 childScrollPosition = children.at(0)->scrollPosition(); 2886 QVERIFY(qtwebkit_webframe_scrollRecursively(children.at(0), -10, -10)); 2887 QVERIFY(childScrollPosition != children.at(0)->scrollPosition()); 2888 scrollPosition = webPage->mainFrame()->scrollPosition(); 2889 QVERIFY(qtwebkit_webframe_scrollRecursively(children.at(0), -10, -10)); 2890 QVERIFY(scrollPosition != webPage->mainFrame()->scrollPosition()); 2891 2892 } 2893 2354 2894 QTEST_MAIN(tst_QWebFrame) 2355 2895 #include "tst_qwebframe.moc" -
trunk/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
r2 r561 5 5 QT += testlib network 6 6 QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR 7 8 symbian { 9 TARGET.UID3 = 0xA000E53C 10 TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices 11 } -
trunk/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
r2 r561 3 3 include(../../../../WebKit.pri) 4 4 SOURCES += tst_qwebpage.cpp 5 RESOURCES += tst_qwebpage.qrc 5 6 QT += testlib network 6 7 QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR 8 !symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" 9 10 symbian { 11 TARGET.UID3 = 0xA000E53E 12 TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices 13 } -
trunk/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
r2 r561 1 1 /* 2 2 Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in> 3 4 4 5 This library is free software; you can redistribute it and/or … … 21 22 #include <QtTest/QtTest> 22 23 24 #include <qgraphicsscene.h> 25 #include <qgraphicsview.h> 26 #include <qgraphicswebview.h> 27 #include <qwebelement.h> 23 28 #include <qwebpage.h> 24 29 #include <qwidget.h> 30 #include <QGraphicsWidget> 25 31 #include <qwebview.h> 26 32 #include <qwebframe.h> … … 33 39 #include <qwebdatabase.h> 34 40 #include <QPushButton> 41 #include <QDir> 42 43 #if defined(Q_OS_SYMBIAN) 44 # define SRCDIR "" 45 #endif 35 46 36 47 // Will try to wait for the condition while allowing event processing … … 60 71 * \p false on timeout 61 72 */ 62 static bool waitForSignal(QObject* obj, const char* signal, int timeout = 0)73 static bool waitForSignal(QObject* obj, const char* signal, int timeout = 10000) 63 74 { 64 75 QEventLoop loop; … … 75 86 } 76 87 88 class EventSpy : public QObject, public QList<QEvent::Type> 89 { 90 Q_OBJECT 91 public: 92 EventSpy(QObject* objectToSpy) 93 { 94 objectToSpy->installEventFilter(this); 95 } 96 97 virtual bool eventFilter(QObject* receiver, QEvent* event) 98 { 99 append(event->type()); 100 return false; 101 } 102 }; 103 77 104 class tst_QWebPage : public QObject 78 105 { … … 93 120 94 121 void acceptNavigationRequest(); 122 void infiniteLoopJS(); 95 123 void loadFinished(); 96 124 void acceptNavigationRequestWithNewWindow(); … … 100 128 void database(); 101 129 void createPlugin(); 130 void destroyPlugin_data(); 102 131 void destroyPlugin(); 132 void createViewlessPlugin_data(); 103 133 void createViewlessPlugin(); 104 134 void multiplePageGroupsAndLocalStorage(); … … 106 136 void textSelection(); 107 137 void textEditing(); 108 109 private: 110 138 void backActionUpdate(); 139 void frameAt(); 140 void requestCache(); 141 void protectBindingsRuntimeObjectsFromCollector(); 142 void localURLSchemes(); 143 void testOptionalJSObjects(); 144 void testEnablePersistentStorage(); 145 void consoleOutput(); 146 void inputMethods_data(); 147 void inputMethods(); 148 void defaultTextEncoding(); 149 void errorPageExtension(); 150 151 void crashTests_LazyInitializationOfMainFrame(); 152 153 void screenshot_data(); 154 void screenshot(); 155 156 void originatingObjectInNetworkRequests(); 111 157 112 158 private: … … 190 236 } 191 237 238 class JSTestPage : public QWebPage 239 { 240 Q_OBJECT 241 public: 242 JSTestPage(QObject* parent = 0) 243 : QWebPage(parent) {} 244 245 public slots: 246 bool shouldInterruptJavaScript() { 247 return true; 248 } 249 }; 250 251 void tst_QWebPage::infiniteLoopJS() 252 { 253 JSTestPage* newPage = new JSTestPage(m_view); 254 m_view->setPage(newPage); 255 m_view->setHtml(QString("<html><bodytest</body></html>"), QUrl()); 256 m_view->page()->mainFrame()->evaluateJavaScript("var run = true;var a = 1;while(run){a++;}"); 257 } 192 258 193 259 void tst_QWebPage::loadFinished() 194 260 { 261 qRegisterMetaType<QWebFrame*>("QWebFrame*"); 262 qRegisterMetaType<QNetworkRequest*>("QNetworkRequest*"); 195 263 QSignalSpy spyLoadStarted(m_view, SIGNAL(loadStarted())); 196 264 QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool))); … … 212 280 QTRY_COMPARE(spyLoadFinished.count(), 1); 213 281 QCOMPARE(spyLoadFinished.count(), 1); 282 } 283 284 class ConsolePage : public QWebPage 285 { 286 public: 287 ConsolePage(QObject* parent = 0) : QWebPage(parent) {} 288 289 virtual void javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID) 290 { 291 messages.append(message); 292 lineNumbers.append(lineNumber); 293 sourceIDs.append(sourceID); 294 } 295 296 QStringList messages; 297 QList<int> lineNumbers; 298 QStringList sourceIDs; 299 }; 300 301 void tst_QWebPage::consoleOutput() 302 { 303 ConsolePage page; 304 page.mainFrame()->evaluateJavaScript("this is not valid JavaScript"); 305 QCOMPARE(page.messages.count(), 1); 306 QCOMPARE(page.lineNumbers.at(0), 1); 214 307 } 215 308 … … 278 371 279 372 QList<QUrl> requestedUrls; 373 QList<QNetworkRequest> requests; 280 374 281 375 protected: 282 376 virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest &request, QIODevice* outgoingData) { 377 requests.append(request); 283 378 requestedUrls.append(request.url()); 284 379 return QNetworkAccessManager::createRequest(op, request, outgoingData); … … 292 387 networkManager->requestedUrls.clear(); 293 388 294 m_page->settings()->setUserStyleSheetUrl(QUrl("data:text/css,p { background-image: url('http://does.not/exist.png');}")); 389 m_page->settings()->setUserStyleSheetUrl(QUrl("data:text/css;charset=utf-8;base64," 390 + QByteArray("p { background-image: url('http://does.not/exist.png');}").toBase64())); 295 391 m_view->setHtml("<p>hello world</p>"); 296 392 QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool)))); 297 393 298 QVERIFY(networkManager->requestedUrls.count() >= 2); 299 QCOMPARE(networkManager->requestedUrls.at(0), QUrl("data:text/css,p { background-image: url('http://does.not/exist.png');}")); 300 QCOMPARE(networkManager->requestedUrls.at(1), QUrl("http://does.not/exist.png")); 394 QVERIFY(networkManager->requestedUrls.count() >= 1); 395 QCOMPARE(networkManager->requestedUrls.at(0), QUrl("http://does.not/exist.png")); 301 396 } 302 397 … … 354 449 QVERIFY(m_page->history()->count() == 2); 355 450 m_page->mainFrame()->setUrl(QUrl("data:text/html,<body>This is fifth page")); 356 QVERIFY(::waitForSignal(m_page, SIGNAL(saveFrameStateRequested(QWebFrame*, 451 QVERIFY(::waitForSignal(m_page, SIGNAL(saveFrameStateRequested(QWebFrame*,QWebHistoryItem*)))); 357 452 } 358 453 … … 381 476 QVERIFY(QWebSettings::offlineStorageDefaultQuota() == 1024 * 1024); 382 477 478 m_page->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true); 479 m_page->settings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true); 480 383 481 QString dbFileName = path + "Databases.db"; 384 482 … … 387 485 388 486 qRegisterMetaType<QWebFrame*>("QWebFrame*"); 389 QSignalSpy spy(m_page, SIGNAL(databaseQuotaExceeded(QWebFrame *,QString)));487 QSignalSpy spy(m_page, SIGNAL(databaseQuotaExceeded(QWebFrame*,QString))); 390 488 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")); 391 489 QTRY_COMPARE(spy.count(), 1); … … 408 506 QTest::qWait(200); 409 507 508 // Remove all databases. 410 509 QWebSecurityOrigin origin = m_page->mainFrame()->securityOrigin(); 411 510 QList<QWebDatabase> dbs = origin.databases(); 412 if (dbs.count() > 0) {413 QString fileName = dbs[ 0].fileName();511 for (int i = 0; i < dbs.count(); i++) { 512 QString fileName = dbs[i].fileName(); 414 513 QVERIFY(QFile::exists(fileName)); 415 QWebDatabase::removeDatabase(dbs[ 0]);514 QWebDatabase::removeDatabase(dbs[i]); 416 515 QVERIFY(!QFile::exists(fileName)); 417 516 } 517 QVERIFY(!origin.databases().size()); 518 // Remove removed test :-) 519 QWebDatabase::removeAllDatabases(); 520 QVERIFY(!origin.databases().size()); 418 521 QTest::qWait(1000); 419 522 } … … 554 657 } 555 658 556 class PluginTrackedPage : public QWebPage 557 { 659 660 // Standard base class for template PluginTracerPage. In tests it is used as interface. 661 class PluginCounterPage : public QWebPage { 558 662 public: 559 560 int count; 561 QPointer<QWidget> widget; 562 563 PluginTrackedPage(QWidget *parent = 0) : QWebPage(parent), count(0) { 663 int m_count; 664 QPointer<QObject> m_widget; 665 QObject* m_pluginParent; 666 PluginCounterPage(QObject* parent = 0) 667 : QWebPage(parent) 668 , m_count(0) 669 , m_widget(0) 670 , m_pluginParent(0) 671 { 564 672 settings()->setAttribute(QWebSettings::PluginsEnabled, true); 565 673 } 566 567 virtual QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&) { 568 count++; 569 QWidget *w = new QWidget; 570 widget = w; 571 return w; 674 ~PluginCounterPage() 675 { 676 if (m_pluginParent) 677 m_pluginParent->deleteLater(); 572 678 } 573 679 }; 574 680 681 template<class T> 682 class PluginTracerPage : public PluginCounterPage { 683 public: 684 PluginTracerPage(QObject* parent = 0) 685 : PluginCounterPage(parent) 686 { 687 // this is a dummy parent object for the created plugin 688 m_pluginParent = new T; 689 } 690 virtual QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&) 691 { 692 m_count++; 693 m_widget = new T; 694 // need a cast to the specific type, as QObject::setParent cannot be called, 695 // because it is not virtual. Instead it is necesary to call QWidget::setParent, 696 // which also takes a QWidget* instead of a QObject*. Therefore we need to 697 // upcast to T*, which is a QWidget. 698 static_cast<T*>(m_widget.data())->setParent(static_cast<T*>(m_pluginParent)); 699 return m_widget; 700 } 701 }; 702 703 class PluginFactory { 704 public: 705 enum FactoredType {QWidgetType, QGraphicsWidgetType}; 706 static PluginCounterPage* create(FactoredType type, QObject* parent = 0) 707 { 708 PluginCounterPage* result = 0; 709 switch (type) { 710 case QWidgetType: 711 result = new PluginTracerPage<QWidget>(parent); 712 break; 713 case QGraphicsWidgetType: 714 result = new PluginTracerPage<QGraphicsWidget>(parent); 715 break; 716 default: {/*Oops*/}; 717 } 718 return result; 719 } 720 721 static void prepareTestData() 722 { 723 QTest::addColumn<int>("type"); 724 QTest::newRow("QWidget") << (int)PluginFactory::QWidgetType; 725 QTest::newRow("QGraphicsWidget") << (int)PluginFactory::QGraphicsWidgetType; 726 } 727 }; 728 729 void tst_QWebPage::destroyPlugin_data() 730 { 731 PluginFactory::prepareTestData(); 732 } 733 575 734 void tst_QWebPage::destroyPlugin() 576 735 { 577 PluginTrackedPage* page = new PluginTrackedPage(m_view); 736 QFETCH(int, type); 737 PluginCounterPage* page = PluginFactory::create((PluginFactory::FactoredType)type, m_view); 578 738 m_view->setPage(page); 579 739 … … 581 741 QString content("<html><body><object type=\"application/x-qt-plugin\" classid=\"QProgressBar\"></object></body></html>"); 582 742 m_view->setHtml(content); 583 QVERIFY(page-> widget != 0);584 QCOMPARE(page-> count, 1);743 QVERIFY(page->m_widget); 744 QCOMPARE(page->m_count, 1); 585 745 586 746 // navigate away, the plugin widget should be destructed 587 747 m_view->setHtml("<html><body>Hi</body></html>"); 588 748 QTestEventLoop::instance().enterLoop(1); 589 QVERIFY(page->widget == 0); 749 QVERIFY(!page->m_widget); 750 } 751 752 void tst_QWebPage::createViewlessPlugin_data() 753 { 754 PluginFactory::prepareTestData(); 590 755 } 591 756 592 757 void tst_QWebPage::createViewlessPlugin() 593 758 { 594 PluginTrackedPage* page = new PluginTrackedPage; 759 QFETCH(int, type); 760 PluginCounterPage* page = PluginFactory::create((PluginFactory::FactoredType)type); 595 761 QString content("<html><body><object type=\"application/x-qt-plugin\" classid=\"QProgressBar\"></object></body></html>"); 596 762 page->mainFrame()->setHtml(content); 597 QCOMPARE(page->count, 1); 598 QVERIFY(page->widget != 0); 763 QCOMPARE(page->m_count, 1); 764 QVERIFY(page->m_widget); 765 QVERIFY(page->m_pluginParent); 766 QVERIFY(page->m_widget->parent() == page->m_pluginParent); 599 767 delete page; 768 600 769 } 601 770 … … 603 772 void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName); 604 773 QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page); 605 void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* settings, const QString& path);606 774 607 775 void tst_QWebPage::multiplePageGroupsAndLocalStorage() … … 614 782 QWebView view2; 615 783 616 qt_websettings_setLocalStorageDatabasePath(view1.page()->settings(), QDir::toNativeSeparators(QDir::currentPath() + "/path1")); 784 view1.page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true); 785 view1.page()->settings()->setLocalStoragePath(QDir::toNativeSeparators(QDir::currentPath() + "/path1")); 617 786 qt_webpage_setGroupName(view1.page(), "group1"); 618 qt_websettings_setLocalStorageDatabasePath(view2.page()->settings(), QDir::toNativeSeparators(QDir::currentPath() + "/path2")); 787 view2.page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true); 788 view2.page()->settings()->setLocalStoragePath(QDir::toNativeSeparators(QDir::currentPath() + "/path2")); 619 789 qt_webpage_setGroupName(view2.page(), "group2"); 620 790 QCOMPARE(qt_webpage_groupName(view1.page()), QString("group1")); … … 833 1003 page->triggerAction(QWebPage::MoveToStartOfBlock); 834 1004 QVERIFY(page->isSelectionCollapsed()); 835 QCOMPARE(page->selectionStartOffset(), 2);1005 QCOMPARE(page->selectionStartOffset(), 0); 836 1006 837 1007 // cursor will be after the word "you!" … … 870 1040 "<p>May the source<br/>be with you!</p></body></html>"); 871 1041 page->mainFrame()->setHtml(content); 872 873 // this will select the first paragraph874 QString script = "var range = document.createRange(); " \875 "var node = document.getElementById(\"one\"); " \876 "range.selectNode(node); " \877 "getSelection().addRange(range);";878 page->mainFrame()->evaluateJavaScript(script);879 QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox"));880 1042 881 1043 // these actions must exist … … 894 1056 QVERIFY(page->action(QWebPage::SelectEndOfDocument) != 0); 895 1057 896 // right now they are disabled because contentEditable is false 1058 // right now they are disabled because contentEditable is false and 1059 // there isn't an existing selection to modify 897 1060 QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), false); 898 1061 QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), false); … … 911 1074 QCOMPARE(page->action(QWebPage::SelectAll)->isEnabled(), true); 912 1075 913 // make it editable before navigating the cursor 914 page->setContentEditable(true); 915 916 // here the actions are enabled after contentEditable is true 917 QCOMPARE(page->action(QWebPage::SelectAll)->isEnabled(), true); 1076 // this will select the first paragraph 1077 QString selectScript = "var range = document.createRange(); " \ 1078 "var node = document.getElementById(\"one\"); " \ 1079 "range.selectNode(node); " \ 1080 "getSelection().addRange(range);"; 1081 page->mainFrame()->evaluateJavaScript(selectScript); 1082 QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox")); 1083 1084 // here the actions are enabled after a selection has been created 918 1085 QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), true); 919 1086 QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), true); … … 929 1096 QCOMPARE(page->action(QWebPage::SelectEndOfDocument)->isEnabled(), true); 930 1097 1098 // make it editable before navigating the cursor 1099 page->setContentEditable(true); 1100 1101 // cursor will be before the word "The", this makes sure there is a charet 1102 page->triggerAction(QWebPage::MoveToStartOfDocument); 1103 QVERIFY(page->isSelectionCollapsed()); 1104 QCOMPARE(page->selectionStartOffset(), 0); 1105 1106 // here the actions are enabled after contentEditable is true 1107 QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), true); 1108 QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), true); 1109 QCOMPARE(page->action(QWebPage::SelectNextWord)->isEnabled(), true); 1110 QCOMPARE(page->action(QWebPage::SelectPreviousWord)->isEnabled(), true); 1111 QCOMPARE(page->action(QWebPage::SelectNextLine)->isEnabled(), true); 1112 QCOMPARE(page->action(QWebPage::SelectPreviousLine)->isEnabled(), true); 1113 QCOMPARE(page->action(QWebPage::SelectStartOfLine)->isEnabled(), true); 1114 QCOMPARE(page->action(QWebPage::SelectEndOfLine)->isEnabled(), true); 1115 QCOMPARE(page->action(QWebPage::SelectStartOfBlock)->isEnabled(), true); 1116 QCOMPARE(page->action(QWebPage::SelectEndOfBlock)->isEnabled(), true); 1117 QCOMPARE(page->action(QWebPage::SelectStartOfDocument)->isEnabled(), true); 1118 QCOMPARE(page->action(QWebPage::SelectEndOfDocument)->isEnabled(), true); 1119 931 1120 delete page; 932 1121 } … … 940 1129 page->mainFrame()->setHtml(content); 941 1130 942 // this will select the first paragraph943 QString script = "var range = document.createRange(); " \944 "var node = document.getElementById(\"one\"); " \945 "range.selectNode(node); " \946 "getSelection().addRange(range);";947 page->mainFrame()->evaluateJavaScript(script);948 QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox"));949 950 1131 // these actions must exist 1132 QVERIFY(page->action(QWebPage::Cut) != 0); 1133 QVERIFY(page->action(QWebPage::Copy) != 0); 1134 QVERIFY(page->action(QWebPage::Paste) != 0); 951 1135 QVERIFY(page->action(QWebPage::DeleteStartOfWord) != 0); 952 1136 QVERIFY(page->action(QWebPage::DeleteEndOfWord) != 0); … … 959 1143 QVERIFY(page->action(QWebPage::InsertParagraphSeparator) != 0); 960 1144 QVERIFY(page->action(QWebPage::InsertLineSeparator) != 0); 1145 QVERIFY(page->action(QWebPage::PasteAndMatchStyle) != 0); 1146 QVERIFY(page->action(QWebPage::RemoveFormat) != 0); 1147 QVERIFY(page->action(QWebPage::ToggleStrikethrough) != 0); 1148 QVERIFY(page->action(QWebPage::ToggleSubscript) != 0); 1149 QVERIFY(page->action(QWebPage::ToggleSuperscript) != 0); 1150 QVERIFY(page->action(QWebPage::InsertUnorderedList) != 0); 1151 QVERIFY(page->action(QWebPage::InsertOrderedList) != 0); 1152 QVERIFY(page->action(QWebPage::Indent) != 0); 1153 QVERIFY(page->action(QWebPage::Outdent) != 0); 1154 QVERIFY(page->action(QWebPage::AlignCenter) != 0); 1155 QVERIFY(page->action(QWebPage::AlignJustified) != 0); 1156 QVERIFY(page->action(QWebPage::AlignLeft) != 0); 1157 QVERIFY(page->action(QWebPage::AlignRight) != 0); 961 1158 962 1159 // right now they are disabled because contentEditable is false 1160 QCOMPARE(page->action(QWebPage::Cut)->isEnabled(), false); 1161 QCOMPARE(page->action(QWebPage::Paste)->isEnabled(), false); 963 1162 QCOMPARE(page->action(QWebPage::DeleteStartOfWord)->isEnabled(), false); 964 1163 QCOMPARE(page->action(QWebPage::DeleteEndOfWord)->isEnabled(), false); … … 971 1170 QCOMPARE(page->action(QWebPage::InsertParagraphSeparator)->isEnabled(), false); 972 1171 QCOMPARE(page->action(QWebPage::InsertLineSeparator)->isEnabled(), false); 1172 QCOMPARE(page->action(QWebPage::PasteAndMatchStyle)->isEnabled(), false); 1173 QCOMPARE(page->action(QWebPage::RemoveFormat)->isEnabled(), false); 1174 QCOMPARE(page->action(QWebPage::ToggleStrikethrough)->isEnabled(), false); 1175 QCOMPARE(page->action(QWebPage::ToggleSubscript)->isEnabled(), false); 1176 QCOMPARE(page->action(QWebPage::ToggleSuperscript)->isEnabled(), false); 1177 QCOMPARE(page->action(QWebPage::InsertUnorderedList)->isEnabled(), false); 1178 QCOMPARE(page->action(QWebPage::InsertOrderedList)->isEnabled(), false); 1179 QCOMPARE(page->action(QWebPage::Indent)->isEnabled(), false); 1180 QCOMPARE(page->action(QWebPage::Outdent)->isEnabled(), false); 1181 QCOMPARE(page->action(QWebPage::AlignCenter)->isEnabled(), false); 1182 QCOMPARE(page->action(QWebPage::AlignJustified)->isEnabled(), false); 1183 QCOMPARE(page->action(QWebPage::AlignLeft)->isEnabled(), false); 1184 QCOMPARE(page->action(QWebPage::AlignRight)->isEnabled(), false); 1185 1186 // Select everything 1187 page->triggerAction(QWebPage::SelectAll); 1188 1189 // make sure it is enabled since there is a selection 1190 QCOMPARE(page->action(QWebPage::Copy)->isEnabled(), true); 973 1191 974 1192 // make it editable before navigating the cursor 975 1193 page->setContentEditable(true); 976 1194 1195 // clear the selection 1196 page->triggerAction(QWebPage::MoveToStartOfDocument); 1197 QVERIFY(page->isSelectionCollapsed()); 1198 QCOMPARE(page->selectionStartOffset(), 0); 1199 1200 // make sure it is disabled since there isn't a selection 1201 QCOMPARE(page->action(QWebPage::Copy)->isEnabled(), false); 1202 977 1203 // here the actions are enabled after contentEditable is true 1204 QCOMPARE(page->action(QWebPage::Paste)->isEnabled(), true); 978 1205 QCOMPARE(page->action(QWebPage::DeleteStartOfWord)->isEnabled(), true); 979 1206 QCOMPARE(page->action(QWebPage::DeleteEndOfWord)->isEnabled(), true); … … 986 1213 QCOMPARE(page->action(QWebPage::InsertParagraphSeparator)->isEnabled(), true); 987 1214 QCOMPARE(page->action(QWebPage::InsertLineSeparator)->isEnabled(), true); 1215 QCOMPARE(page->action(QWebPage::PasteAndMatchStyle)->isEnabled(), true); 1216 QCOMPARE(page->action(QWebPage::ToggleStrikethrough)->isEnabled(), true); 1217 QCOMPARE(page->action(QWebPage::ToggleSubscript)->isEnabled(), true); 1218 QCOMPARE(page->action(QWebPage::ToggleSuperscript)->isEnabled(), true); 1219 QCOMPARE(page->action(QWebPage::InsertUnorderedList)->isEnabled(), true); 1220 QCOMPARE(page->action(QWebPage::InsertOrderedList)->isEnabled(), true); 1221 QCOMPARE(page->action(QWebPage::Indent)->isEnabled(), true); 1222 QCOMPARE(page->action(QWebPage::Outdent)->isEnabled(), true); 1223 QCOMPARE(page->action(QWebPage::AlignCenter)->isEnabled(), true); 1224 QCOMPARE(page->action(QWebPage::AlignJustified)->isEnabled(), true); 1225 QCOMPARE(page->action(QWebPage::AlignLeft)->isEnabled(), true); 1226 QCOMPARE(page->action(QWebPage::AlignRight)->isEnabled(), true); 1227 1228 // make sure these are disabled since there isn't a selection 1229 QCOMPARE(page->action(QWebPage::Cut)->isEnabled(), false); 1230 QCOMPARE(page->action(QWebPage::RemoveFormat)->isEnabled(), false); 1231 1232 // make sure everything is selected 1233 page->triggerAction(QWebPage::SelectAll); 1234 1235 // this is only true if there is an editable selection 1236 QCOMPARE(page->action(QWebPage::Cut)->isEnabled(), true); 1237 QCOMPARE(page->action(QWebPage::RemoveFormat)->isEnabled(), true); 988 1238 989 1239 delete page; 990 1240 } 991 1241 1242 void tst_QWebPage::requestCache() 1243 { 1244 TestPage page; 1245 QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool))); 1246 1247 page.mainFrame()->setUrl(QString("data:text/html,<a href=\"data:text/html,Reached\" target=\"_blank\">Click me</a>")); 1248 QTRY_COMPARE(loadSpy.count(), 1); 1249 QTRY_COMPARE(page.navigations.count(), 1); 1250 1251 page.mainFrame()->setUrl(QString("data:text/html,<a href=\"data:text/html,Reached\" target=\"_blank\">Click me2</a>")); 1252 QTRY_COMPARE(loadSpy.count(), 2); 1253 QTRY_COMPARE(page.navigations.count(), 2); 1254 1255 page.triggerAction(QWebPage::Stop); 1256 QVERIFY(page.history()->canGoBack()); 1257 page.triggerAction(QWebPage::Back); 1258 1259 QTRY_COMPARE(loadSpy.count(), 3); 1260 QTRY_COMPARE(page.navigations.count(), 3); 1261 QCOMPARE(page.navigations.at(0).request.attribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork).toInt(), 1262 (int)QNetworkRequest::PreferNetwork); 1263 QCOMPARE(page.navigations.at(1).request.attribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork).toInt(), 1264 (int)QNetworkRequest::PreferNetwork); 1265 QCOMPARE(page.navigations.at(2).request.attribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork).toInt(), 1266 (int)QNetworkRequest::PreferCache); 1267 } 1268 1269 void tst_QWebPage::backActionUpdate() 1270 { 1271 QWebView view; 1272 QWebPage *page = view.page(); 1273 QAction *action = page->action(QWebPage::Back); 1274 QVERIFY(!action->isEnabled()); 1275 QSignalSpy loadSpy(page, SIGNAL(loadFinished(bool))); 1276 QUrl url = QUrl("qrc:///frametest/index.html"); 1277 page->mainFrame()->load(url); 1278 QTRY_COMPARE(loadSpy.count(), 1); 1279 QVERIFY(!action->isEnabled()); 1280 QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(10, 10)); 1281 QTRY_COMPARE(loadSpy.count(), 2); 1282 1283 QVERIFY(action->isEnabled()); 1284 } 1285 1286 void frameAtHelper(QWebPage* webPage, QWebFrame* webFrame, QPoint framePosition) 1287 { 1288 if (!webFrame) 1289 return; 1290 1291 framePosition += QPoint(webFrame->pos()); 1292 QList<QWebFrame*> children = webFrame->childFrames(); 1293 for (int i = 0; i < children.size(); ++i) { 1294 if (children.at(i)->childFrames().size() > 0) 1295 frameAtHelper(webPage, children.at(i), framePosition); 1296 1297 QRect frameRect(children.at(i)->pos() + framePosition, children.at(i)->geometry().size()); 1298 QVERIFY(children.at(i) == webPage->frameAt(frameRect.topLeft())); 1299 } 1300 } 1301 1302 void tst_QWebPage::frameAt() 1303 { 1304 QWebView webView; 1305 QWebPage* webPage = webView.page(); 1306 QSignalSpy loadSpy(webPage, SIGNAL(loadFinished(bool))); 1307 QUrl url = QUrl("qrc:///frametest/iframe.html"); 1308 webPage->mainFrame()->load(url); 1309 QTRY_COMPARE(loadSpy.count(), 1); 1310 frameAtHelper(webPage, webPage->mainFrame(), webPage->mainFrame()->pos()); 1311 } 1312 1313 void tst_QWebPage::inputMethods_data() 1314 { 1315 QTest::addColumn<QString>("viewType"); 1316 QTest::newRow("QWebView") << "QWebView"; 1317 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) 1318 QTest::newRow("QGraphicsWebView") << "QGraphicsWebView"; 1319 #endif 1320 } 1321 1322 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) 1323 static Qt::InputMethodHints inputMethodHints(QObject* object) 1324 { 1325 if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object)) 1326 return o->inputMethodHints(); 1327 if (QWidget* w = qobject_cast<QWidget*>(object)) 1328 return w->inputMethodHints(); 1329 return Qt::InputMethodHints(); 1330 } 1331 #endif 1332 1333 static bool inputMethodEnabled(QObject* object) 1334 { 1335 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) 1336 if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object)) 1337 return o->flags() & QGraphicsItem::ItemAcceptsInputMethod; 1338 #endif 1339 if (QWidget* w = qobject_cast<QWidget*>(object)) 1340 return w->testAttribute(Qt::WA_InputMethodEnabled); 1341 return false; 1342 } 1343 1344 void tst_QWebPage::inputMethods() 1345 { 1346 QFETCH(QString, viewType); 1347 QWebPage* page = new QWebPage; 1348 QObject* view = 0; 1349 QObject* container = 0; 1350 if (viewType == "QWebView") { 1351 QWebView* wv = new QWebView; 1352 wv->setPage(page); 1353 view = wv; 1354 container = view; 1355 } 1356 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) 1357 else if (viewType == "QGraphicsWebView") { 1358 QGraphicsWebView* wv = new QGraphicsWebView; 1359 wv->setPage(page); 1360 view = wv; 1361 1362 QGraphicsView* gv = new QGraphicsView; 1363 QGraphicsScene* scene = new QGraphicsScene(gv); 1364 gv->setScene(scene); 1365 scene->addItem(wv); 1366 wv->setGeometry(QRect(0, 0, 500, 500)); 1367 1368 container = gv; 1369 } 1370 #endif 1371 else 1372 QVERIFY2(false, "Unknown view type"); 1373 1374 page->settings()->setFontFamily(QWebSettings::SerifFont, "FooSerifFont"); 1375 page->mainFrame()->setHtml("<html><body>" \ 1376 "<input type='text' id='input1' style='font-family: serif' value='' maxlength='20'/><br>" \ 1377 "<input type='password'/>" \ 1378 "</body></html>"); 1379 page->mainFrame()->setFocus(); 1380 1381 EventSpy viewEventSpy(container); 1382 1383 QWebElementCollection inputs = page->mainFrame()->documentElement().findAll("input"); 1384 1385 QMouseEvent evpres(QEvent::MouseButtonPress, inputs.at(0).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier); 1386 page->event(&evpres); 1387 QMouseEvent evrel(QEvent::MouseButtonRelease, inputs.at(0).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier); 1388 page->event(&evrel); 1389 1390 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) 1391 QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel)); 1392 #endif 1393 viewEventSpy.clear(); 1394 1395 page->event(&evpres); 1396 page->event(&evrel); 1397 1398 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) 1399 QVERIFY(viewEventSpy.contains(QEvent::RequestSoftwareInputPanel)); 1400 #endif 1401 1402 //ImMicroFocus 1403 QVariant variant = page->inputMethodQuery(Qt::ImMicroFocus); 1404 QRect focusRect = variant.toRect(); 1405 QVERIFY(inputs.at(0).geometry().contains(variant.toRect().topLeft())); 1406 1407 //ImFont 1408 variant = page->inputMethodQuery(Qt::ImFont); 1409 QFont font = variant.value<QFont>(); 1410 QCOMPARE(page->settings()->fontFamily(QWebSettings::SerifFont), font.family()); 1411 1412 QList<QInputMethodEvent::Attribute> inputAttributes; 1413 1414 //Insert text. 1415 { 1416 QInputMethodEvent eventText("QtWebKit", inputAttributes); 1417 QSignalSpy signalSpy(page, SIGNAL(microFocusChanged())); 1418 page->event(&eventText); 1419 QCOMPARE(signalSpy.count(), 0); 1420 } 1421 1422 { 1423 QInputMethodEvent eventText("", inputAttributes); 1424 eventText.setCommitString(QString("QtWebKit"), 0, 0); 1425 page->event(&eventText); 1426 } 1427 1428 #if QT_VERSION >= 0x040600 1429 //ImMaximumTextLength 1430 variant = page->inputMethodQuery(Qt::ImMaximumTextLength); 1431 QCOMPARE(20, variant.toInt()); 1432 1433 //Set selection 1434 inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 3, 2, QVariant()); 1435 QInputMethodEvent eventSelection("",inputAttributes); 1436 page->event(&eventSelection); 1437 1438 //ImAnchorPosition 1439 variant = page->inputMethodQuery(Qt::ImAnchorPosition); 1440 int anchorPosition = variant.toInt(); 1441 QCOMPARE(anchorPosition, 3); 1442 1443 //ImCursorPosition 1444 variant = page->inputMethodQuery(Qt::ImCursorPosition); 1445 int cursorPosition = variant.toInt(); 1446 QCOMPARE(cursorPosition, 5); 1447 1448 //ImCurrentSelection 1449 variant = page->inputMethodQuery(Qt::ImCurrentSelection); 1450 QString selectionValue = variant.value<QString>(); 1451 QCOMPARE(selectionValue, QString("eb")); 1452 #endif 1453 1454 //ImSurroundingText 1455 variant = page->inputMethodQuery(Qt::ImSurroundingText); 1456 QString value = variant.value<QString>(); 1457 QCOMPARE(value, QString("QtWebKit")); 1458 1459 #if QT_VERSION >= 0x040600 1460 { 1461 QList<QInputMethodEvent::Attribute> attributes; 1462 // Clear the selection, so the next test does not clear any contents. 1463 QInputMethodEvent::Attribute newSelection(QInputMethodEvent::Selection, 0, 0, QVariant()); 1464 attributes.append(newSelection); 1465 QInputMethodEvent event("composition", attributes); 1466 page->event(&event); 1467 } 1468 1469 // A ongoing composition should not change the surrounding text before it is committed. 1470 variant = page->inputMethodQuery(Qt::ImSurroundingText); 1471 value = variant.value<QString>(); 1472 QCOMPARE(value, QString("QtWebKit")); 1473 #endif 1474 1475 //ImhHiddenText 1476 QMouseEvent evpresPassword(QEvent::MouseButtonPress, inputs.at(1).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier); 1477 page->event(&evpresPassword); 1478 QMouseEvent evrelPassword(QEvent::MouseButtonRelease, inputs.at(1).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier); 1479 page->event(&evrelPassword); 1480 1481 QVERIFY(inputMethodEnabled(view)); 1482 #if QT_VERSION >= 0x040600 1483 QVERIFY(inputMethodHints(view) & Qt::ImhHiddenText); 1484 1485 page->event(&evpres); 1486 page->event(&evrel); 1487 QVERIFY(!(inputMethodHints(view) & Qt::ImhHiddenText)); 1488 #endif 1489 1490 page->mainFrame()->setHtml("<html><body><p>nothing to input here"); 1491 viewEventSpy.clear(); 1492 1493 QWebElement para = page->mainFrame()->findFirstElement("p"); 1494 { 1495 QMouseEvent evpres(QEvent::MouseButtonPress, para.geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier); 1496 page->event(&evpres); 1497 QMouseEvent evrel(QEvent::MouseButtonRelease, para.geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier); 1498 page->event(&evrel); 1499 } 1500 1501 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) 1502 QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel)); 1503 #endif 1504 1505 delete container; 1506 } 1507 1508 // import a little DRT helper function to trigger the garbage collector 1509 void QWEBKIT_EXPORT qt_drt_garbageCollector_collect(); 1510 1511 void tst_QWebPage::protectBindingsRuntimeObjectsFromCollector() 1512 { 1513 QSignalSpy loadSpy(m_view, SIGNAL(loadFinished(bool))); 1514 1515 PluginPage* newPage = new PluginPage(m_view); 1516 m_view->setPage(newPage); 1517 1518 m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, true); 1519 1520 m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='lineedit' id='mylineedit'/></body></html>")); 1521 QTRY_COMPARE(loadSpy.count(), 1); 1522 1523 newPage->mainFrame()->evaluateJavaScript("function testme(text) { var lineedit = document.getElementById('mylineedit'); lineedit.setText(text); lineedit.selectAll(); }"); 1524 1525 newPage->mainFrame()->evaluateJavaScript("testme('foo')"); 1526 1527 qt_drt_garbageCollector_collect(); 1528 1529 // don't crash! 1530 newPage->mainFrame()->evaluateJavaScript("testme('bar')"); 1531 } 1532 1533 void tst_QWebPage::localURLSchemes() 1534 { 1535 int i = QWebSecurityOrigin::localSchemes().size(); 1536 QWebSecurityOrigin::removeLocalScheme("file"); 1537 QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i); 1538 QWebSecurityOrigin::addLocalScheme("file"); 1539 QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i); 1540 QString myscheme = "myscheme"; 1541 QWebSecurityOrigin::addLocalScheme(myscheme); 1542 QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i + 1); 1543 QVERIFY(QWebSecurityOrigin::localSchemes().contains(myscheme)); 1544 QWebSecurityOrigin::removeLocalScheme(myscheme); 1545 QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i); 1546 QWebSecurityOrigin::removeLocalScheme(myscheme); 1547 QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i); 1548 } 1549 1550 static inline bool testFlag(QWebPage& webPage, QWebSettings::WebAttribute settingAttribute, const QString& jsObjectName, bool settingValue) 1551 { 1552 webPage.settings()->setAttribute(settingAttribute, settingValue); 1553 return webPage.mainFrame()->evaluateJavaScript(QString("(window.%1 != undefined)").arg(jsObjectName)).toBool(); 1554 } 1555 1556 void tst_QWebPage::testOptionalJSObjects() 1557 { 1558 // Once a feature is enabled and the JS object is accessed turning off the setting will not turn off 1559 // the visibility of the JS object any more. For this reason this test uses two QWebPage instances. 1560 // Part of the test is to make sure that the QWebPage instances do not interfere with each other so turning on 1561 // a feature for one instance will not turn it on for another. 1562 1563 QWebPage webPage1; 1564 QWebPage webPage2; 1565 1566 webPage1.currentFrame()->setHtml(QString("<html><body>test</body></html>"), QUrl()); 1567 webPage2.currentFrame()->setHtml(QString("<html><body>test</body></html>"), QUrl()); 1568 1569 QEXPECT_FAIL("","Feature enabled/disabled checking problem. Look at bugs.webkit.org/show_bug.cgi?id=29867", Continue); 1570 QCOMPARE(testFlag(webPage1, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), false); 1571 QCOMPARE(testFlag(webPage2, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", true), true); 1572 QEXPECT_FAIL("","Feature enabled/disabled checking problem. Look at bugs.webkit.org/show_bug.cgi?id=29867", Continue); 1573 QCOMPARE(testFlag(webPage1, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), false); 1574 QCOMPARE(testFlag(webPage2, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), true); 1575 1576 QCOMPARE(testFlag(webPage1, QWebSettings::LocalStorageEnabled, "localStorage", false), false); 1577 QCOMPARE(testFlag(webPage2, QWebSettings::LocalStorageEnabled, "localStorage", true), true); 1578 QCOMPARE(testFlag(webPage1, QWebSettings::LocalStorageEnabled, "localStorage", false), false); 1579 QCOMPARE(testFlag(webPage2, QWebSettings::LocalStorageEnabled, "localStorage", false), true); 1580 } 1581 1582 void tst_QWebPage::testEnablePersistentStorage() 1583 { 1584 QWebPage webPage; 1585 1586 // By default all persistent options should be disabled 1587 QCOMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), false); 1588 QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), false); 1589 QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), false); 1590 QVERIFY(webPage.settings()->iconDatabasePath().isEmpty()); 1591 1592 QWebSettings::enablePersistentStorage(); 1593 1594 // Give it some time to initialize - icon database needs it 1595 QTest::qWait(1000); 1596 1597 QCOMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), true); 1598 QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), true); 1599 QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), true); 1600 1601 QVERIFY(!webPage.settings()->offlineStoragePath().isEmpty()); 1602 QVERIFY(!webPage.settings()->offlineWebApplicationCachePath().isEmpty()); 1603 QVERIFY(!webPage.settings()->iconDatabasePath().isEmpty()); 1604 } 1605 1606 void tst_QWebPage::defaultTextEncoding() 1607 { 1608 QWebFrame* mainFrame = m_page->mainFrame(); 1609 1610 QString defaultCharset = mainFrame->evaluateJavaScript("document.defaultCharset").toString(); 1611 QVERIFY(!defaultCharset.isEmpty()); 1612 QCOMPARE(QWebSettings::globalSettings()->defaultTextEncoding(), defaultCharset); 1613 1614 m_page->settings()->setDefaultTextEncoding(QString("utf-8")); 1615 QString charset = mainFrame->evaluateJavaScript("document.defaultCharset").toString(); 1616 QCOMPARE(charset, QString("utf-8")); 1617 QCOMPARE(m_page->settings()->defaultTextEncoding(), charset); 1618 1619 m_page->settings()->setDefaultTextEncoding(QString()); 1620 charset = mainFrame->evaluateJavaScript("document.defaultCharset").toString(); 1621 QVERIFY(!charset.isEmpty()); 1622 QCOMPARE(charset, defaultCharset); 1623 1624 QWebSettings::globalSettings()->setDefaultTextEncoding(QString("utf-8")); 1625 charset = mainFrame->evaluateJavaScript("document.defaultCharset").toString(); 1626 QCOMPARE(charset, QString("utf-8")); 1627 QCOMPARE(QWebSettings::globalSettings()->defaultTextEncoding(), charset); 1628 } 1629 1630 class ErrorPage : public QWebPage 1631 { 1632 public: 1633 1634 ErrorPage(QWidget* parent = 0): QWebPage(parent) 1635 { 1636 } 1637 1638 virtual bool supportsExtension(Extension extension) const 1639 { 1640 return extension == ErrorPageExtension; 1641 } 1642 1643 virtual bool extension(Extension, const ExtensionOption* option, ExtensionReturn* output) 1644 { 1645 const ErrorPageExtensionOption* info = static_cast<const ErrorPageExtensionOption*>(option); 1646 ErrorPageExtensionReturn* errorPage = static_cast<ErrorPageExtensionReturn*>(output); 1647 1648 if (info->frame == mainFrame()) { 1649 errorPage->content = "data:text/html,error"; 1650 return true; 1651 } 1652 1653 return false; 1654 } 1655 }; 1656 1657 void tst_QWebPage::errorPageExtension() 1658 { 1659 ErrorPage* page = new ErrorPage; 1660 m_view->setPage(page); 1661 1662 QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool))); 1663 1664 page->mainFrame()->load(QUrl("qrc:///frametest/index.html")); 1665 QTRY_COMPARE(spyLoadFinished.count(), 1); 1666 1667 page->mainFrame()->setUrl(QUrl("http://non.existent/url")); 1668 QTest::qWait(2000); 1669 QTRY_COMPARE(spyLoadFinished.count(), 2); 1670 QCOMPARE(page->mainFrame()->toPlainText(), QString("data:text/html,error")); 1671 QCOMPARE(page->history()->count(), 2); 1672 QCOMPARE(page->history()->currentItem().url(), QUrl("http://non.existent/url")); 1673 QCOMPARE(page->history()->canGoBack(), true); 1674 QCOMPARE(page->history()->canGoForward(), false); 1675 1676 page->triggerAction(QWebPage::Back); 1677 QTest::qWait(2000); 1678 QCOMPARE(page->history()->canGoBack(), false); 1679 QCOMPARE(page->history()->canGoForward(), true); 1680 1681 page->triggerAction(QWebPage::Forward); 1682 QTest::qWait(2000); 1683 QCOMPARE(page->history()->canGoBack(), true); 1684 QCOMPARE(page->history()->canGoForward(), false); 1685 1686 page->triggerAction(QWebPage::Back); 1687 QTest::qWait(2000); 1688 QCOMPARE(page->history()->canGoBack(), false); 1689 QCOMPARE(page->history()->canGoForward(), true); 1690 QCOMPARE(page->history()->currentItem().url(), QUrl("qrc:///frametest/index.html")); 1691 1692 m_view->setPage(0); 1693 } 1694 1695 void tst_QWebPage::crashTests_LazyInitializationOfMainFrame() 1696 { 1697 { 1698 QWebPage webPage; 1699 } 1700 { 1701 QWebPage webPage; 1702 webPage.selectedText(); 1703 } 1704 { 1705 QWebPage webPage; 1706 webPage.triggerAction(QWebPage::Back, true); 1707 } 1708 { 1709 QWebPage webPage; 1710 QPoint pos(10,10); 1711 webPage.updatePositionDependentActions(pos); 1712 } 1713 } 1714 1715 static void takeScreenshot(QWebPage* page) 1716 { 1717 QWebFrame* mainFrame = page->mainFrame(); 1718 page->setViewportSize(mainFrame->contentsSize()); 1719 QImage image(page->viewportSize(), QImage::Format_ARGB32); 1720 QPainter painter(&image); 1721 mainFrame->render(&painter); 1722 painter.end(); 1723 } 1724 1725 void tst_QWebPage::screenshot_data() 1726 { 1727 QTest::addColumn<QString>("html"); 1728 QTest::newRow("WithoutPlugin") << "<html><body id='b'>text</body></html>"; 1729 QTest::newRow("WindowedPlugin") << QString("<html><body id='b'>text<embed src='resources/test.swf'></embed></body></html>"); 1730 QTest::newRow("WindowlessPlugin") << QString("<html><body id='b'>text<embed src='resources/test.swf' wmode='transparent'></embed></body></html>"); 1731 } 1732 1733 void tst_QWebPage::screenshot() 1734 { 1735 QDir::setCurrent(SRCDIR); 1736 1737 QFETCH(QString, html); 1738 QWebPage* page = new QWebPage; 1739 page->settings()->setAttribute(QWebSettings::PluginsEnabled, true); 1740 QWebFrame* mainFrame = page->mainFrame(); 1741 mainFrame->setHtml(html, QUrl::fromLocalFile(QDir::currentPath())); 1742 if (html.contains("</embed>")) { 1743 // some reasonable time for the PluginStream to feed test.swf to flash and start painting 1744 QTest::qWait(2000); 1745 } 1746 1747 // take screenshot without a view 1748 takeScreenshot(page); 1749 1750 QWebView* view = new QWebView; 1751 view->setPage(page); 1752 1753 // take screenshot when attached to a view 1754 takeScreenshot(page); 1755 1756 delete page; 1757 delete view; 1758 1759 QDir::setCurrent(QApplication::applicationDirPath()); 1760 } 1761 1762 void tst_QWebPage::originatingObjectInNetworkRequests() 1763 { 1764 TestNetworkManager* networkManager = new TestNetworkManager(m_page); 1765 m_page->setNetworkAccessManager(networkManager); 1766 networkManager->requests.clear(); 1767 1768 m_view->setHtml(QString("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html," 1769 "<head><meta http-equiv='refresh' content='1'></head>foo \">" 1770 "<frame src=\"data:text/html,bar\"></frameset>"), QUrl()); 1771 QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool)))); 1772 1773 QCOMPARE(networkManager->requests.count(), 2); 1774 1775 QList<QWebFrame*> childFrames = m_page->mainFrame()->childFrames(); 1776 QCOMPARE(childFrames.count(), 2); 1777 1778 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) 1779 for (int i = 0; i < 2; ++i) 1780 QVERIFY(qobject_cast<QWebFrame*>(networkManager->requests.at(i).originatingObject()) == childFrames.at(i)); 1781 #endif 1782 } 992 1783 993 1784 QTEST_MAIN(tst_QWebPage) -
trunk/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
r2 r561 1 1 2 2 TEMPLATE = subdirs 3 SUBDIRS = qwebframe qwebpage qwebhistoryinterface 3 SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory 4 greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro
Note:
See TracChangeset
for help on using the changeset viewer.