WebCore:
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Nov 2006 19:16:18 +0000 (19:16 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Nov 2006 19:16:18 +0000 (19:16 +0000)
        Reviewed and landed by Anders.

        Adjust platform Qt/KDE code to the recent loader
        changes.

        * CMakeLists.txt:
        * loader/DocumentLoader.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::createEmptyDocument):
        * loader/FrameLoader.h:
        * loader/FrameLoaderClient.h:
        * loader/qt/DocumentLoaderQt.cpp: Added.
        (WebCore::canonicalizedTitle):
        (WebCore::DocumentLoader::DocumentLoader):
        (WebCore::DocumentLoader::frameLoader):
        (WebCore::DocumentLoader::~DocumentLoader):
        (WebCore::DocumentLoader::URL):
        (WebCore::DocumentLoader::unreachableURL):
        (WebCore::DocumentLoader::replaceRequestURLForAnchorScroll):
        (WebCore::DocumentLoader::isStopping):
        (WebCore::DocumentLoader::clearErrors):
        (WebCore::DocumentLoader::stopLoading):
        (WebCore::DocumentLoader::setupForReplace):
        (WebCore::DocumentLoader::commitIfReady):
        (WebCore::DocumentLoader::finishedLoading):
        (WebCore::DocumentLoader::setCommitted):
        (WebCore::DocumentLoader::isCommitted):
        (WebCore::DocumentLoader::setLoading):
        (WebCore::DocumentLoader::isLoading):
        (WebCore::DocumentLoader::doesProgressiveLoad):
        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
        (WebCore::DocumentLoader::updateLoading):
        (WebCore::DocumentLoader::setFrame):
        (WebCore::DocumentLoader::attachToFrame):
        (WebCore::DocumentLoader::detachFromFrame):
        (WebCore::DocumentLoader::prepareForLoadStart):
        (WebCore::DocumentLoader::loadingStartedTime):
        (WebCore::DocumentLoader::setIsClientRedirect):
        (WebCore::DocumentLoader::isClientRedirect):
        (WebCore::DocumentLoader::setPrimaryLoadComplete):
        (WebCore::DocumentLoader::isLoadingInAPISense):
        (WebCore::DocumentLoader::stopRecordingResponses):
        (WebCore::DocumentLoader::title):
        (WebCore::DocumentLoader::triggeringAction):
        (WebCore::DocumentLoader::setTriggeringAction):
        (WebCore::DocumentLoader::setOverrideEncoding):
        (WebCore::DocumentLoader::overrideEncoding):
        (WebCore::DocumentLoader::setTitle):
        (WebCore::DocumentLoader::URLForHistory):
        * loader/qt/FrameLoaderClientQt.cpp: Added.
        (WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
        (WebCore::FrameLoaderClientQt::~FrameLoaderClientQt):
        (WebCore::FrameLoaderClientQt::detachFrameLoader):
        (WebCore::FrameLoaderClientQt::hasWebView):
        (WebCore::FrameLoaderClientQt::hasFrameView):
        (WebCore::FrameLoaderClientQt::hasBackForwardList):
        (WebCore::FrameLoaderClientQt::resetBackForwardList):
        (WebCore::FrameLoaderClientQt::provisionalItemIsTarget):
        (WebCore::FrameLoaderClientQt::loadProvisionalItemFromPageCache):
        (WebCore::FrameLoaderClientQt::invalidateCurrentItemPageCache):
        (WebCore::FrameLoaderClientQt::privateBrowsingEnabled):
        (WebCore::FrameLoaderClientQt::makeDocumentView):
        (WebCore::FrameLoaderClientQt::makeRepresentation):
        (WebCore::FrameLoaderClientQt::forceLayout):
        (WebCore::FrameLoaderClientQt::forceLayoutForNonHTML):
        (WebCore::FrameLoaderClientQt::updateHistoryForCommit):
        (WebCore::FrameLoaderClientQt::updateHistoryForBackForwardNavigation):
        (WebCore::FrameLoaderClientQt::updateHistoryForReload):
        (WebCore::FrameLoaderClientQt::updateHistoryForStandardLoad):
        (WebCore::FrameLoaderClientQt::updateHistoryForInternalLoad):
        (WebCore::FrameLoaderClientQt::updateHistoryAfterClientRedirect):
        (WebCore::FrameLoaderClientQt::setCopiesOnScroll):
        (WebCore::FrameLoaderClientQt::tokenForLoadErrorReset):
        (WebCore::FrameLoaderClientQt::resetAfterLoadError):
        (WebCore::FrameLoaderClientQt::doNotResetAfterLoadError):
        (WebCore::FrameLoaderClientQt::willCloseDocument):
        (WebCore::FrameLoaderClientQt::detachedFromParent1):
        (WebCore::FrameLoaderClientQt::detachedFromParent2):
        (WebCore::FrameLoaderClientQt::detachedFromParent3):
        (WebCore::FrameLoaderClientQt::detachedFromParent4):
        (WebCore::FrameLoaderClientQt::loadedFromPageCache):
        (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents):
        (WebCore::FrameLoaderClientQt::dispatchDidReceiveServerRedirectForProvisionalLoad):
        (WebCore::FrameLoaderClientQt::dispatchDidCancelClientRedirect):
        (WebCore::FrameLoaderClientQt::dispatchWillPerformClientRedirect):
        (WebCore::FrameLoaderClientQt::dispatchDidChangeLocationWithinPage):
        (WebCore::FrameLoaderClientQt::dispatchWillClose):
        (WebCore::FrameLoaderClientQt::dispatchDidStartProvisionalLoad):
        (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle):
        (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
        (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
        (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout):
        (WebCore::FrameLoaderClientQt::dispatchShow):
        (WebCore::FrameLoaderClientQt::cancelPolicyCheck):
        (WebCore::FrameLoaderClientQt::dispatchWillSubmitForm):
        (WebCore::FrameLoaderClientQt::dispatchDidLoadMainResource):
        (WebCore::FrameLoaderClientQt::clearLoadingFromPageCache):
        (WebCore::FrameLoaderClientQt::isLoadingFromPageCache):
        (WebCore::FrameLoaderClientQt::revertToProvisionalState):
        (WebCore::FrameLoaderClientQt::clearUnarchivingState):
        (WebCore::FrameLoaderClientQt::progressStarted):
        (WebCore::FrameLoaderClientQt::progressCompleted):
        (WebCore::FrameLoaderClientQt::setMainFrameDocumentReady):
        (WebCore::FrameLoaderClientQt::willChangeTitle):
        (WebCore::FrameLoaderClientQt::didChangeTitle):
        (WebCore::FrameLoaderClientQt::finishedLoading):
        (WebCore::FrameLoaderClientQt::finalSetupForReplace):
        (WebCore::FrameLoaderClientQt::setDefersLoading):
        (WebCore::FrameLoaderClientQt::isArchiveLoadPending):
        (WebCore::FrameLoaderClientQt::cancelPendingArchiveLoad):
        (WebCore::FrameLoaderClientQt::clearArchivedResources):
        (WebCore::FrameLoaderClientQt::canShowMIMEType):
        (WebCore::FrameLoaderClientQt::representationExistsForURLScheme):
        (WebCore::FrameLoaderClientQt::generatedMIMETypeForURLScheme):
        (WebCore::FrameLoaderClientQt::frameLoadCompleted):
        (WebCore::FrameLoaderClientQt::restoreScrollPositionAndViewState):
        (WebCore::FrameLoaderClientQt::provisionalLoadStarted):
        (WebCore::FrameLoaderClientQt::shouldTreatURLAsSameAsCurrent):
        (WebCore::FrameLoaderClientQt::addHistoryItemForFragmentScroll):
        (WebCore::FrameLoaderClientQt::didFinishLoad):
        (WebCore::FrameLoaderClientQt::prepareForDataSourceReplacement):
        (WebCore::FrameLoaderClientQt::setTitle):
        (WebCore::FrameLoaderClientQt::userAgent):
        * loader/qt/FrameLoaderClientQt.h: Added.
        * loader/qt/FrameLoaderQt.cpp:
        (WebCore::FrameLoader::submitForm):
        (WebCore::FrameLoader::overrideMediaType):
        (WebCore::FrameLoader::getHistoryLength):
        (WebCore::FrameLoader::referrer):
        (WebCore::FrameLoader::detachFromParent):
        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
        (WebCore::FrameLoader::goBackOrForward):
        (WebCore::FrameLoader::historyURL):
        (WebCore::FrameLoader::didFirstLayout):
        (WebCore::FrameLoader::canGoBackOrForward):
        (WebCore::FrameLoader::partClearedInBegin):
        (WebCore::FrameLoader::saveDocumentState):
        (WebCore::FrameLoader::restoreDocumentState):
        (WebCore::FrameLoader::didChangeTitle):
        (WebCore::FrameLoader::redirectDataToPlugin):
        (WebCore::PolicyCheck::PolicyCheck):
        (WebCore::PolicyCheck::clear):
        (WebCore::PolicyCheck::set):
        (WebCore::PolicyCheck::call):
        (WebCore::PolicyCheck::clearRequest):
        * loader/qt/NavigationActionQt.cpp: Added.
        (WebCore::navigationType):
        (WebCore::NavigationAction::NavigationAction):
        * loader/qt/ResourceLoaderQt.cpp: Added.
        (WebCore::ResourceLoader::ResourceLoader):
        (WebCore::ResourceLoader::~ResourceLoader):
        (WebCore::ResourceLoader::setDefersLoading):
        (WebCore::ResourceLoader::cancel):
        (WebCore::ResourceLoader::loadsBlocked):
        * platform/MimeTypeRegistry.cpp:
        (WebCore::initialiseSupportedImageMIMETypes):
        * platform/network/qt/ResourceHandleManager.cpp:
        (WebCore::ResourceHandleManager::slotResult):
        (WebCore::ResourceHandleManager::cancel):
        * platform/qt/ChromeClientQt.cpp: Added.
        (WebCore::rootWindowForFrame):
        (WebCore::ChromeClientQt::ChromeClientQt):
        (WebCore::ChromeClientQt::~ChromeClientQt):
        (WebCore::ChromeClientQt::setWindowRect):
        (WebCore::ChromeClientQt::windowRect):
        (WebCore::ChromeClientQt::pageRect):
        (WebCore::ChromeClientQt::scaleFactor):
        (WebCore::ChromeClientQt::focus):
        (WebCore::ChromeClientQt::unfocus):
        (WebCore::ChromeClientQt::createWindow):
        (WebCore::ChromeClientQt::createModalDialog):
        (WebCore::ChromeClientQt::show):
        (WebCore::ChromeClientQt::canRunModal):
        (WebCore::ChromeClientQt::runModal):
        (WebCore::ChromeClientQt::setToolbarsVisible):
        (WebCore::ChromeClientQt::toolbarsVisible):
        (WebCore::ChromeClientQt::setStatusbarVisible):
        (WebCore::ChromeClientQt::statusbarVisible):
        (WebCore::ChromeClientQt::setScrollbarsVisible):
        (WebCore::ChromeClientQt::scrollbarsVisible):
        (WebCore::ChromeClientQt::setMenubarVisible):
        (WebCore::ChromeClientQt::menubarVisible):
        (WebCore::ChromeClientQt::setResizable):
        * platform/qt/ChromeClientQt.h: Added.
        * platform/qt/EditorClientQt.cpp:
        (WebCore::EditorClientQt::shouldBeginEditing):
        (WebCore::EditorClientQt::shouldEndEditing):
        (WebCore::EditorClientQt::shouldApplyStyle):
        (WebCore::EditorClientQt::didBeginEditing):
        (WebCore::EditorClientQt::respondToChangedContents):
        (WebCore::EditorClientQt::didEndEditing):
        * platform/qt/EditorClientQt.h:
        * platform/qt/FrameQt.cpp:
        (WebCore::FrameQt::FrameQt):
        (WebCore::FrameQt::~FrameQt):
        (WebCore::FrameQt::keyEvent):
        * platform/qt/FrameQt.h:
        * platform/qt/FrameQtClient.cpp:
        (WebCore::FrameQtClientDefault::openURL):
        (WebCore::FrameQtClientDefault::didReceiveData):
        (WebCore::FrameQtClientDefault::receivedAllData):
        * platform/qt/ImageQt.cpp:
        * platform/qt/MimeTypeRegistryQt.cpp: Added.
        (WebCore::getMIMETypeForUTI):
        (WebCore::MimeTypeRegistry::getMIMETypeForExtension):
        * platform/qt/PageQt.cpp:
        * platform/qt/PlatformKeyboardEventQt.cpp:
        (WebCore::keyIdentifierForQtKeyCode):
        * platform/qt/ScreenQt.cpp:
        * platform/qt/TemporaryLinkStubs.cpp:
        (WebCore::TextField::TextField):
        (WebCore::screenDepth):
        (WebCore::screenDepthPerComponent):
        (WebCore::screenIsMonochrome):
        (WebCore::screenRect):
        (WebCore::screenAvailableRect):

WebKitQt:

        Reviewed and landed by Anders.

        Adjusting to the recent loader changes, making it compile
        and work.

        * QtLauncher/main.cpp:
        (main):
        * WebKitPart/WebKitPart.cpp:
        (WebKitPart::closeUrl):
        (WebKitPart::initView):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17703 268f45cc-cd09-0410-ab3c-d52691b4dbfc

30 files changed:
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/loader/DocumentLoader.h
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoader.h
WebCore/loader/FrameLoaderClient.h
WebCore/loader/qt/DocumentLoaderQt.cpp [new file with mode: 0644]
WebCore/loader/qt/FrameLoaderClientQt.cpp [new file with mode: 0644]
WebCore/loader/qt/FrameLoaderClientQt.h [new file with mode: 0644]
WebCore/loader/qt/FrameLoaderQt.cpp
WebCore/loader/qt/NavigationActionQt.cpp [new file with mode: 0644]
WebCore/loader/qt/ResourceLoaderQt.cpp [new file with mode: 0644]
WebCore/platform/MimeTypeRegistry.cpp
WebCore/platform/network/qt/ResourceHandleManager.cpp
WebCore/platform/qt/ChromeClientQt.cpp [new file with mode: 0644]
WebCore/platform/qt/ChromeClientQt.h [new file with mode: 0644]
WebCore/platform/qt/EditorClientQt.cpp
WebCore/platform/qt/EditorClientQt.h
WebCore/platform/qt/FrameQt.cpp
WebCore/platform/qt/FrameQt.h
WebCore/platform/qt/FrameQtClient.cpp
WebCore/platform/qt/ImageQt.cpp
WebCore/platform/qt/MimeTypeRegistryQt.cpp [new file with mode: 0644]
WebCore/platform/qt/PageQt.cpp
WebCore/platform/qt/PlatformKeyboardEventQt.cpp
WebCore/platform/qt/ScreenQt.cpp
WebCore/platform/qt/TemporaryLinkStubs.cpp
WebKitQt/ChangeLog
WebKitQt/QtLauncher/main.cpp
WebKitQt/WebKitPart/WebKitPart.cpp

index f43030a88c59c328614fea960724afc25cae112a..0019ad3eab6e7020074bf4c0d36a1347b94b942c 100644 (file)
@@ -8,6 +8,7 @@ include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/ForwardingHeaders
    ${CMAKE_CURRENT_SOURCE_DIR}/loader
    ${CMAKE_CURRENT_SOURCE_DIR}/loader/icon
+   ${CMAKE_CURRENT_SOURCE_DIR}/loader/qt
    ${CMAKE_CURRENT_BINARY_DIR}/css
    ${CMAKE_CURRENT_SOURCE_DIR}/css
    ${CMAKE_CURRENT_SOURCE_DIR}/dom
@@ -944,7 +945,9 @@ set(WebCore_SRCS
     page/MouseEventWithHitTestResults.cpp
     page/Frame.cpp
     page/Page.cpp
-    page/FrameView.cpp
+    page/Chrome.cpp
+    page/FrameView.cpp    
+    page/PageState.cpp
     xml/XPathUtil.cpp
     xml/XPathPredicate.cpp
     xml/XPathVariableReference.cpp
@@ -980,7 +983,17 @@ set(WebCore_SRCS
     loader/TextDocument.cpp
     loader/TextResourceDecoder.cpp
     loader/loader.cpp
+    loader/icon/IconLoader.cpp
+    loader/icon/IconDatabase.cpp
+    loader/icon/IconDataCache.cpp
+    loader/icon/SQLTransaction.cpp
+    loader/icon/SQLStatement.cpp
+    loader/icon/SQLDatabase.cpp
     loader/qt/FrameLoaderQt.cpp
+    loader/qt/FrameLoaderClientQt.cpp
+    loader/qt/DocumentLoaderQt.cpp
+    loader/qt/NavigationActionQt.cpp
+    loader/qt/ResourceLoaderQt.cpp
     platform/CString.cpp
     platform/AtomicString.cpp
     platform/AffineTransform.cpp
@@ -1014,6 +1027,8 @@ set(WebCore_SRCS
     platform/StringImpl.cpp
     platform/FloatRect.cpp
     platform/Path.cpp
+    platform/MimeTypeRegistry.cpp
+    platform/qt/MimeTypeRegistryQt.cpp
     platform/qt/EditorClientQt.cpp
     platform/qt/SoundQt.cpp
     platform/qt/LoaderFunctionsQt.cpp
@@ -1036,12 +1051,12 @@ set(WebCore_SRCS
     platform/qt/FontDataQt.cpp
     platform/qt/SharedTimerQt.cpp
     platform/qt/PopupMenuQt.cpp
+    platform/qt/ChromeClientQt.cpp
     platform/network/FormData.cpp
     platform/network/ResourceHandle.cpp
     platform/network/qt/ResourceHandleManager.cpp
     platform/network/qt/ResourceHandleQt.cpp
     platform/qt/FloatPointQt.cpp
-    platform/qt/ListBoxQt.cpp
     platform/qt/FloatRectQt.cpp
     platform/qt/IntPointQt.cpp
     platform/qt/IntRectQt.cpp
@@ -1209,6 +1224,7 @@ target_link_libraries(WebCore-unity
   kjs-unity
   pcre-unity
   z
+  sqlite3
 )
 ELSE (WEBKIT_USE_KDE_SUPPORT)
 target_link_libraries(WebCore-unity
@@ -1221,6 +1237,7 @@ target_link_libraries(WebCore-unity
   kjs-unity
   pcre-unity
   z
+  sqlite3
 )
 ENDIF (WEBKIT_USE_KDE_SUPPORT)
 
index 0d11f23a636d1d08f24f80421b244342c0d37061..699199adf5c0095f4a8b5120cd1b9b04ef051576 100644 (file)
@@ -1,3 +1,222 @@
+2006-11-10  Zack Rusin  <zack@kde.org>
+
+        Reviewed and landed by Anders.
+
+        Adjust platform Qt/KDE code to the recent loader
+        changes. 
+
+        * CMakeLists.txt:
+        * loader/DocumentLoader.h:
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::createEmptyDocument):
+        * loader/FrameLoader.h:
+        * loader/FrameLoaderClient.h:
+        * loader/qt/DocumentLoaderQt.cpp: Added.
+        (WebCore::canonicalizedTitle):
+        (WebCore::DocumentLoader::DocumentLoader):
+        (WebCore::DocumentLoader::frameLoader):
+        (WebCore::DocumentLoader::~DocumentLoader):
+        (WebCore::DocumentLoader::URL):
+        (WebCore::DocumentLoader::unreachableURL):
+        (WebCore::DocumentLoader::replaceRequestURLForAnchorScroll):
+        (WebCore::DocumentLoader::isStopping):
+        (WebCore::DocumentLoader::clearErrors):
+        (WebCore::DocumentLoader::stopLoading):
+        (WebCore::DocumentLoader::setupForReplace):
+        (WebCore::DocumentLoader::commitIfReady):
+        (WebCore::DocumentLoader::finishedLoading):
+        (WebCore::DocumentLoader::setCommitted):
+        (WebCore::DocumentLoader::isCommitted):
+        (WebCore::DocumentLoader::setLoading):
+        (WebCore::DocumentLoader::isLoading):
+        (WebCore::DocumentLoader::doesProgressiveLoad):
+        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
+        (WebCore::DocumentLoader::updateLoading):
+        (WebCore::DocumentLoader::setFrame):
+        (WebCore::DocumentLoader::attachToFrame):
+        (WebCore::DocumentLoader::detachFromFrame):
+        (WebCore::DocumentLoader::prepareForLoadStart):
+        (WebCore::DocumentLoader::loadingStartedTime):
+        (WebCore::DocumentLoader::setIsClientRedirect):
+        (WebCore::DocumentLoader::isClientRedirect):
+        (WebCore::DocumentLoader::setPrimaryLoadComplete):
+        (WebCore::DocumentLoader::isLoadingInAPISense):
+        (WebCore::DocumentLoader::stopRecordingResponses):
+        (WebCore::DocumentLoader::title):
+        (WebCore::DocumentLoader::triggeringAction):
+        (WebCore::DocumentLoader::setTriggeringAction):
+        (WebCore::DocumentLoader::setOverrideEncoding):
+        (WebCore::DocumentLoader::overrideEncoding):
+        (WebCore::DocumentLoader::setTitle):
+        (WebCore::DocumentLoader::URLForHistory):
+        * loader/qt/FrameLoaderClientQt.cpp: Added.
+        (WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
+        (WebCore::FrameLoaderClientQt::~FrameLoaderClientQt):
+        (WebCore::FrameLoaderClientQt::detachFrameLoader):
+        (WebCore::FrameLoaderClientQt::hasWebView):
+        (WebCore::FrameLoaderClientQt::hasFrameView):
+        (WebCore::FrameLoaderClientQt::hasBackForwardList):
+        (WebCore::FrameLoaderClientQt::resetBackForwardList):
+        (WebCore::FrameLoaderClientQt::provisionalItemIsTarget):
+        (WebCore::FrameLoaderClientQt::loadProvisionalItemFromPageCache):
+        (WebCore::FrameLoaderClientQt::invalidateCurrentItemPageCache):
+        (WebCore::FrameLoaderClientQt::privateBrowsingEnabled):
+        (WebCore::FrameLoaderClientQt::makeDocumentView):
+        (WebCore::FrameLoaderClientQt::makeRepresentation):
+        (WebCore::FrameLoaderClientQt::forceLayout):
+        (WebCore::FrameLoaderClientQt::forceLayoutForNonHTML):
+        (WebCore::FrameLoaderClientQt::updateHistoryForCommit):
+        (WebCore::FrameLoaderClientQt::updateHistoryForBackForwardNavigation):
+        (WebCore::FrameLoaderClientQt::updateHistoryForReload):
+        (WebCore::FrameLoaderClientQt::updateHistoryForStandardLoad):
+        (WebCore::FrameLoaderClientQt::updateHistoryForInternalLoad):
+        (WebCore::FrameLoaderClientQt::updateHistoryAfterClientRedirect):
+        (WebCore::FrameLoaderClientQt::setCopiesOnScroll):
+        (WebCore::FrameLoaderClientQt::tokenForLoadErrorReset):
+        (WebCore::FrameLoaderClientQt::resetAfterLoadError):
+        (WebCore::FrameLoaderClientQt::doNotResetAfterLoadError):
+        (WebCore::FrameLoaderClientQt::willCloseDocument):
+        (WebCore::FrameLoaderClientQt::detachedFromParent1):
+        (WebCore::FrameLoaderClientQt::detachedFromParent2):
+        (WebCore::FrameLoaderClientQt::detachedFromParent3):
+        (WebCore::FrameLoaderClientQt::detachedFromParent4):
+        (WebCore::FrameLoaderClientQt::loadedFromPageCache):
+        (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents):
+        (WebCore::FrameLoaderClientQt::dispatchDidReceiveServerRedirectForProvisionalLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidCancelClientRedirect):
+        (WebCore::FrameLoaderClientQt::dispatchWillPerformClientRedirect):
+        (WebCore::FrameLoaderClientQt::dispatchDidChangeLocationWithinPage):
+        (WebCore::FrameLoaderClientQt::dispatchWillClose):
+        (WebCore::FrameLoaderClientQt::dispatchDidStartProvisionalLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle):
+        (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout):
+        (WebCore::FrameLoaderClientQt::dispatchShow):
+        (WebCore::FrameLoaderClientQt::cancelPolicyCheck):
+        (WebCore::FrameLoaderClientQt::dispatchWillSubmitForm):
+        (WebCore::FrameLoaderClientQt::dispatchDidLoadMainResource):
+        (WebCore::FrameLoaderClientQt::clearLoadingFromPageCache):
+        (WebCore::FrameLoaderClientQt::isLoadingFromPageCache):
+        (WebCore::FrameLoaderClientQt::revertToProvisionalState):
+        (WebCore::FrameLoaderClientQt::clearUnarchivingState):
+        (WebCore::FrameLoaderClientQt::progressStarted):
+        (WebCore::FrameLoaderClientQt::progressCompleted):
+        (WebCore::FrameLoaderClientQt::setMainFrameDocumentReady):
+        (WebCore::FrameLoaderClientQt::willChangeTitle):
+        (WebCore::FrameLoaderClientQt::didChangeTitle):
+        (WebCore::FrameLoaderClientQt::finishedLoading):
+        (WebCore::FrameLoaderClientQt::finalSetupForReplace):
+        (WebCore::FrameLoaderClientQt::setDefersLoading):
+        (WebCore::FrameLoaderClientQt::isArchiveLoadPending):
+        (WebCore::FrameLoaderClientQt::cancelPendingArchiveLoad):
+        (WebCore::FrameLoaderClientQt::clearArchivedResources):
+        (WebCore::FrameLoaderClientQt::canShowMIMEType):
+        (WebCore::FrameLoaderClientQt::representationExistsForURLScheme):
+        (WebCore::FrameLoaderClientQt::generatedMIMETypeForURLScheme):
+        (WebCore::FrameLoaderClientQt::frameLoadCompleted):
+        (WebCore::FrameLoaderClientQt::restoreScrollPositionAndViewState):
+        (WebCore::FrameLoaderClientQt::provisionalLoadStarted):
+        (WebCore::FrameLoaderClientQt::shouldTreatURLAsSameAsCurrent):
+        (WebCore::FrameLoaderClientQt::addHistoryItemForFragmentScroll):
+        (WebCore::FrameLoaderClientQt::didFinishLoad):
+        (WebCore::FrameLoaderClientQt::prepareForDataSourceReplacement):
+        (WebCore::FrameLoaderClientQt::setTitle):
+        (WebCore::FrameLoaderClientQt::userAgent):
+        * loader/qt/FrameLoaderClientQt.h: Added.
+        * loader/qt/FrameLoaderQt.cpp:
+        (WebCore::FrameLoader::submitForm):
+        (WebCore::FrameLoader::overrideMediaType):
+        (WebCore::FrameLoader::getHistoryLength):
+        (WebCore::FrameLoader::referrer):
+        (WebCore::FrameLoader::detachFromParent):
+        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
+        (WebCore::FrameLoader::goBackOrForward):
+        (WebCore::FrameLoader::historyURL):
+        (WebCore::FrameLoader::didFirstLayout):
+        (WebCore::FrameLoader::canGoBackOrForward):
+        (WebCore::FrameLoader::partClearedInBegin):
+        (WebCore::FrameLoader::saveDocumentState):
+        (WebCore::FrameLoader::restoreDocumentState):
+        (WebCore::FrameLoader::didChangeTitle):
+        (WebCore::FrameLoader::redirectDataToPlugin):
+        (WebCore::PolicyCheck::PolicyCheck):
+        (WebCore::PolicyCheck::clear):
+        (WebCore::PolicyCheck::set):
+        (WebCore::PolicyCheck::call):
+        (WebCore::PolicyCheck::clearRequest):
+        * loader/qt/NavigationActionQt.cpp: Added.
+        (WebCore::navigationType):
+        (WebCore::NavigationAction::NavigationAction):
+        * loader/qt/ResourceLoaderQt.cpp: Added.
+        (WebCore::ResourceLoader::ResourceLoader):
+        (WebCore::ResourceLoader::~ResourceLoader):
+        (WebCore::ResourceLoader::setDefersLoading):
+        (WebCore::ResourceLoader::cancel):
+        (WebCore::ResourceLoader::loadsBlocked):
+        * platform/MimeTypeRegistry.cpp:
+        (WebCore::initialiseSupportedImageMIMETypes):
+        * platform/network/qt/ResourceHandleManager.cpp:
+        (WebCore::ResourceHandleManager::slotResult):
+        (WebCore::ResourceHandleManager::cancel):
+        * platform/qt/ChromeClientQt.cpp: Added.
+        (WebCore::rootWindowForFrame):
+        (WebCore::ChromeClientQt::ChromeClientQt):
+        (WebCore::ChromeClientQt::~ChromeClientQt):
+        (WebCore::ChromeClientQt::setWindowRect):
+        (WebCore::ChromeClientQt::windowRect):
+        (WebCore::ChromeClientQt::pageRect):
+        (WebCore::ChromeClientQt::scaleFactor):
+        (WebCore::ChromeClientQt::focus):
+        (WebCore::ChromeClientQt::unfocus):
+        (WebCore::ChromeClientQt::createWindow):
+        (WebCore::ChromeClientQt::createModalDialog):
+        (WebCore::ChromeClientQt::show):
+        (WebCore::ChromeClientQt::canRunModal):
+        (WebCore::ChromeClientQt::runModal):
+        (WebCore::ChromeClientQt::setToolbarsVisible):
+        (WebCore::ChromeClientQt::toolbarsVisible):
+        (WebCore::ChromeClientQt::setStatusbarVisible):
+        (WebCore::ChromeClientQt::statusbarVisible):
+        (WebCore::ChromeClientQt::setScrollbarsVisible):
+        (WebCore::ChromeClientQt::scrollbarsVisible):
+        (WebCore::ChromeClientQt::setMenubarVisible):
+        (WebCore::ChromeClientQt::menubarVisible):
+        (WebCore::ChromeClientQt::setResizable):
+        * platform/qt/ChromeClientQt.h: Added.
+        * platform/qt/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::shouldBeginEditing):
+        (WebCore::EditorClientQt::shouldEndEditing):
+        (WebCore::EditorClientQt::shouldApplyStyle):
+        (WebCore::EditorClientQt::didBeginEditing):
+        (WebCore::EditorClientQt::respondToChangedContents):
+        (WebCore::EditorClientQt::didEndEditing):
+        * platform/qt/EditorClientQt.h:
+        * platform/qt/FrameQt.cpp:
+        (WebCore::FrameQt::FrameQt):
+        (WebCore::FrameQt::~FrameQt):
+        (WebCore::FrameQt::keyEvent):
+        * platform/qt/FrameQt.h:
+        * platform/qt/FrameQtClient.cpp:
+        (WebCore::FrameQtClientDefault::openURL):
+        (WebCore::FrameQtClientDefault::didReceiveData):
+        (WebCore::FrameQtClientDefault::receivedAllData):
+        * platform/qt/ImageQt.cpp:
+        * platform/qt/MimeTypeRegistryQt.cpp: Added.
+        (WebCore::getMIMETypeForUTI):
+        (WebCore::MimeTypeRegistry::getMIMETypeForExtension):
+        * platform/qt/PageQt.cpp:
+        * platform/qt/PlatformKeyboardEventQt.cpp:
+        (WebCore::keyIdentifierForQtKeyCode):
+        * platform/qt/ScreenQt.cpp:
+        * platform/qt/TemporaryLinkStubs.cpp:
+        (WebCore::TextField::TextField):
+        (WebCore::screenDepth):
+        (WebCore::screenDepthPerComponent):
+        (WebCore::screenIsMonochrome):
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+
 2006-11-10  Brady Eidson <beidson@apple.com>
 
         Reviewed by Mitz
index d42635ddf2ca479c7d918fec1bde36a21d0e9146..fc21ddaf1750ef0501e3f9adb95ac088ee13e2f1 100644 (file)
@@ -62,6 +62,8 @@ namespace WebCore {
     public:
 #if PLATFORM(MAC)
         DocumentLoader(NSURLRequest *);
+#elif PLATFORM(QT)
+        DocumentLoader();
 #endif
         virtual ~DocumentLoader();
 
index 3ff2c1544b364e1675a3c8e67282bfa943b96382..0559546884a5a775ce43012f6c9d8be8b6f9cb70 100644 (file)
@@ -2214,6 +2214,11 @@ void FrameLoader::createEmptyDocument()
         loadEmptyDocumentSynchronously();
         updateBaseURLForEmptyDocument();
     }
+#elif PLATFORM(QT)
+    if (!m_frame->document()) {
+        begin();
+        end();
+    }
 #endif
 }
 
index 9fac2a88c669ba3296b2bb0d0186e40eedbca60e..61b94b5d8cf8f5f6c3fe69f6fbad16752885bdec 100644 (file)
@@ -25,6 +25,8 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+#ifndef FrameLoader_h
+#define FrameLoader_h
 
 #include "CachePolicy.h"
 #include "FrameLoaderTypes.h"
@@ -644,3 +646,5 @@ namespace WebCore {
     };
 
 }
+
+#endif
index 950e96944bdc18241ad55d42f1791d6b4d1d2644..011d74b34e85a662d8854ebd173deac29d4bfc11 100644 (file)
@@ -25,6 +25,8 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+#ifndef FrameLoaderClient_h
+#define FrameLoaderClient_j
 
 #include "FrameLoaderTypes.h"
 #include <wtf/Forward.h>
@@ -233,3 +235,5 @@ namespace WebCore {
     };
 
 }
+
+#endif
diff --git a/WebCore/loader/qt/DocumentLoaderQt.cpp b/WebCore/loader/qt/DocumentLoaderQt.cpp
new file mode 100644 (file)
index 0000000..838db69
--- /dev/null
@@ -0,0 +1,416 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DocumentLoader.h"
+
+#include "Document.h"
+#include "FrameLoader.h"
+#include "FrameQt.h"
+#include "PlatformString.h"
+#include "XMLTokenizer.h"
+#include <wtf/Assertions.h>
+
+#include <QDateTime>
+
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
+
+namespace WebCore {
+
+/*
+ * Performs three operations:
+ *  1. Convert backslashes to currency symbols
+ *  2. Convert control characters to spaces
+ *  3. Trim leading and trailing spaces
+ */
+static inline String canonicalizedTitle(const String& title, Frame* frame)
+{
+    ASSERT(!title.isEmpty());
+    
+    const UChar* characters = title.characters();
+    unsigned length = title.length();
+    unsigned i;
+    
+    // Find the first non-canonical character
+    for (i = 0; i < length; ++i) {
+        UChar c = characters[i];
+        if (c < 0x20 || c == 0x7F || c == '\\')
+            break;
+    }
+
+    // Optimization for titles that have no non-canonical characters and no leading or trailing spaces
+    if (i == length && characters[0] != ' ' && characters[length - 1] != ' ')
+        return title;
+
+    Vector<UChar> stringBuilder(length);
+    unsigned builderIndex = 0;
+    
+    // Skip leading spaces and leading characters that would convert to spaces
+    for (i = 0; i < length; ++i) {
+        UChar c = characters[i];
+        if (!(c <= 0x20 || c == 0x7F))
+            break;
+    }
+    
+    // Replace control characters with spaces, and backslashes with currency symbols
+    for (; i < length; ++i) {
+        UChar c = characters[i];
+        if (c < 0x20 || c == 0x7F)
+            c = ' ';
+        else if (c == '\\')
+            c = frame->backslashAsCurrencySymbol();
+        stringBuilder[builderIndex++] = c;
+    }
+
+    // Strip trailing spaces
+    while (builderIndex > 0) {
+        --builderIndex;
+        if (stringBuilder[builderIndex] != ' ')
+            break;
+    }
+    
+    if (builderIndex == 0 && stringBuilder[builderIndex] == ' ')
+        return "";
+    
+    stringBuilder.resize(builderIndex + 1);
+    return String::adopt(stringBuilder);
+}
+
+DocumentLoader::DocumentLoader()
+    : m_frame(0)
+    , m_loadingStartedTime(0)
+    , m_committed(false)
+    , m_stopping(false)
+    , m_loading(false)
+    , m_gotFirstByte(false)
+    , m_primaryLoadComplete(false)
+    , m_isClientRedirect(false)
+{
+}
+
+FrameLoader* DocumentLoader::frameLoader() const
+{
+    if (!m_frame)
+        return 0;
+    return m_frame->loader();
+}
+
+DocumentLoader::~DocumentLoader()
+{
+    ASSERT(!m_frame || frameLoader()->activeDocumentLoader() != this ||
+           !frameLoader()->isLoading());
+}
+
+KURL DocumentLoader::URL() const
+{
+    KURL url;
+    notImplemented();
+    return url;
+}
+
+KURL DocumentLoader::unreachableURL() const
+{
+    KURL url;
+    notImplemented();
+    return url;
+}
+
+void DocumentLoader::replaceRequestURLForAnchorScroll(const KURL& URL)
+{
+    notImplemented();
+}
+
+bool DocumentLoader::isStopping() const
+{
+    return m_stopping;
+}
+
+void DocumentLoader::clearErrors()
+{
+}
+
+// Cancels the data source's pending loads.  Conceptually, a data source only loads
+// one document at a time, but one document may have many related resources. 
+// stopLoading will stop all loads initiated by the data source, 
+// but not loads initiated by child frames' data sources -- that's the WebFrame's job.
+void DocumentLoader::stopLoading()
+{
+    // Always attempt to stop the frame because it may still be loading/parsing after the data source
+    // is done loading and not stopping it can cause a world leak.
+    if (m_committed)
+        m_frame->loader()->stopLoading(false);
+    
+    if (!m_loading)
+        return;
+    
+    RefPtr<Frame> protectFrame(m_frame);
+    RefPtr<DocumentLoader> protectLoader(this);
+
+    m_stopping = true;
+
+    FrameLoader* frameLoader = DocumentLoader::frameLoader();
+    
+    if (frameLoader->hasMainResourceLoader())
+        // Stop the main resource loader and let it send the cancelled message.
+        frameLoader->cancelMainResourceLoad();
+    //else if (frameLoader->isLoadingSubresources())
+        // The main resource loader already finished loading. Set the cancelled error on the 
+        // document and let the subresourceLoaders send individual cancelled messages below.
+        //setMainDocumentError(frameLoader->cancelledError(m_request.get()));
+    //else
+        // If there are no resource loaders, we need to manufacture a cancelled message.
+        // (A back/forward navigation has no resource loaders because its resources are cached.)
+        //mainReceivedError(frameLoader->cancelledError(m_request.get()), true);
+    
+    frameLoader->stopLoadingSubresources();
+    frameLoader->stopLoadingPlugIns();
+    
+    m_stopping = false;
+}
+
+void DocumentLoader::setupForReplace()
+{
+    frameLoader()->setupForReplace();
+    m_committed = false;
+}
+
+void DocumentLoader::commitIfReady()
+{
+    notImplemented();
+    if (m_gotFirstByte && !m_committed) {
+        m_committed = true;
+        //frameLoader()->commitProvisionalLoad(0);
+    }
+}
+
+void DocumentLoader::finishedLoading()
+{
+    m_gotFirstByte = true;   
+    commitIfReady();
+    frameLoader()->finishedLoadingDocument(this);
+    m_frame->loader()->end();
+}
+
+void DocumentLoader::setCommitted(bool f)
+{
+    m_committed = f;
+}
+
+bool DocumentLoader::isCommitted() const
+{
+    return m_committed;
+}
+
+void DocumentLoader::setLoading(bool f)
+{
+    m_loading = f;
+}
+
+bool DocumentLoader::isLoading() const
+{
+    return m_loading;
+}
+
+bool DocumentLoader::doesProgressiveLoad(const String& MIMEType) const
+{
+    return !frameLoader()->isReplacing() || MIMEType == "text/html";
+}
+
+void DocumentLoader::setupForReplaceByMIMEType(const String& newMIMEType)
+{
+    if (!m_gotFirstByte)
+        return;
+
+    //String oldMIMEType = [m_response.get() MIMEType];
+    //FIXME: get the mimetype correctly (then remove notImplemented())
+    notImplemented();
+    String oldMIMEType;
+    
+    if (!doesProgressiveLoad(oldMIMEType)) {
+        frameLoader()->revertToProvisional(this);
+        setupForReplace();
+    }
+    
+    frameLoader()->finishedLoadingDocument(this);
+    m_frame->loader()->end();
+    
+    frameLoader()->setReplacing();
+    m_gotFirstByte = false;
+    
+    if (doesProgressiveLoad(newMIMEType)) {
+        frameLoader()->revertToProvisional(this);
+        setupForReplace();
+    }
+    
+    frameLoader()->stopLoadingSubresources();
+    frameLoader()->stopLoadingPlugIns();
+
+    frameLoader()->finalSetupForReplace(this);
+}
+
+void DocumentLoader::updateLoading()
+{
+    ASSERT(this == frameLoader()->activeDocumentLoader());
+    setLoading(frameLoader()->isLoading());
+}
+
+void DocumentLoader::setFrame(Frame* frame)
+{
+    if (m_frame == frame)
+        return;
+    ASSERT(frame && !m_frame);
+    m_frame = frame;
+    attachToFrame();
+}
+
+void DocumentLoader::attachToFrame()
+{
+    ASSERT(m_frame);
+}
+
+void DocumentLoader::detachFromFrame()
+{
+    ASSERT(m_frame);
+    m_frame = 0;
+}
+
+void DocumentLoader::prepareForLoadStart()
+{
+    ASSERT(!m_stopping);
+    setPrimaryLoadComplete(false);
+    ASSERT(frameLoader());
+    clearErrors();
+    
+    // Mark the start loading time.
+    m_loadingStartedTime = QDateTime::currentDateTime().toTime_t();
+    
+    setLoading(true);
+    
+    frameLoader()->prepareForLoadStart();
+}
+
+double DocumentLoader::loadingStartedTime() const
+{
+    return m_loadingStartedTime;
+}
+
+void DocumentLoader::setIsClientRedirect(bool flag)
+{
+    m_isClientRedirect = flag;
+}
+
+bool DocumentLoader::isClientRedirect() const
+{
+    return m_isClientRedirect;
+}
+
+void DocumentLoader::setPrimaryLoadComplete(bool flag)
+{
+    m_primaryLoadComplete = flag;
+    notImplemented();
+    if (flag) {
+        //if (frameLoader()->hasMainResourceLoader()) {
+        //    setMainResourceData(frameLoader()->mainResourceData());
+        //    frameLoader()->releaseMainResourceLoader();
+        //}
+        updateLoading();
+    }
+}
+
+bool DocumentLoader::isLoadingInAPISense() const
+{
+    // Once a frame has loaded, we no longer need to consider subresources,
+    // but we still need to consider subframes.
+    if (frameLoader()->state() != FrameStateComplete) {
+        if (!m_primaryLoadComplete && isLoading())
+            return true;
+        if (frameLoader()->isLoadingSubresources())
+            return true;
+        if (Document* doc = m_frame->document())
+            if (Tokenizer* tok = doc->tokenizer())
+                if (tok->processingData())
+                    return true;
+    }
+    return frameLoader()->subframeIsLoading();
+}
+
+void DocumentLoader::stopRecordingResponses()
+{
+    notImplemented();
+}
+
+String DocumentLoader::title() const
+{
+    return m_pageTitle;
+}
+
+const NavigationAction& DocumentLoader::triggeringAction() const
+{
+    return m_triggeringAction;
+}
+
+void DocumentLoader::setTriggeringAction(const NavigationAction& action)
+{
+    m_triggeringAction = action;
+}
+
+void DocumentLoader::setOverrideEncoding(const String& enc)
+{
+    m_overrideEncoding = enc;
+}
+
+String DocumentLoader::overrideEncoding() const
+{
+    return m_overrideEncoding;
+}
+
+void DocumentLoader::setTitle(const String& title)
+{
+    if (title.isEmpty())
+        return;
+
+    String trimmed = canonicalizedTitle(title, m_frame);
+    if (!trimmed.isEmpty() && m_pageTitle != trimmed) {
+        frameLoader()->willChangeTitle(this);
+        m_pageTitle = trimmed;
+        frameLoader()->didChangeTitle(this);
+    }
+}
+
+KURL DocumentLoader::URLForHistory() const
+{
+    // Return the URL to be used for history and B/F list.
+    // Returns nil for WebDataProtocol URLs that aren't alternates 
+    // for unreachable URLs, because these can't be stored in history.
+    KURL url;
+    notImplemented();
+    return url;
+}
+
+}
+
diff --git a/WebCore/loader/qt/FrameLoaderClientQt.cpp b/WebCore/loader/qt/FrameLoaderClientQt.cpp
new file mode 100644 (file)
index 0000000..9f94e96
--- /dev/null
@@ -0,0 +1,492 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "FrameLoaderClientQt.h"
+
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
+
+namespace WebCore
+{
+
+FrameLoaderClientQt::FrameLoaderClientQt()
+{
+    notImplemented();
+}
+
+
+FrameLoaderClientQt::~FrameLoaderClientQt()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::detachFrameLoader()
+{
+    notImplemented();
+}
+
+
+bool FrameLoaderClientQt::hasWebView() const
+{
+    notImplemented();
+    return false;
+}
+
+
+bool FrameLoaderClientQt::hasFrameView() const
+{
+    notImplemented();
+    return false;
+}
+
+
+bool FrameLoaderClientQt::hasBackForwardList() const
+{
+    notImplemented();
+    return false;
+}
+
+
+void FrameLoaderClientQt::resetBackForwardList()
+{
+    notImplemented();
+}
+
+
+bool FrameLoaderClientQt::provisionalItemIsTarget() const
+{
+    notImplemented();
+    return false;
+}
+
+
+bool FrameLoaderClientQt::loadProvisionalItemFromPageCache()
+{
+    notImplemented();
+    return false;
+}
+
+
+void FrameLoaderClientQt::invalidateCurrentItemPageCache()
+{
+    notImplemented();
+}
+
+
+bool FrameLoaderClientQt::privateBrowsingEnabled() const
+{
+    notImplemented();
+    return false;
+}
+
+
+void FrameLoaderClientQt::makeDocumentView()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::makeRepresentation(DocumentLoader*)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::forceLayout()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::forceLayoutForNonHTML()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::updateHistoryForCommit()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::updateHistoryForBackForwardNavigation()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::updateHistoryForReload()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::updateHistoryForStandardLoad()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::updateHistoryForInternalLoad()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::updateHistoryAfterClientRedirect()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::setCopiesOnScroll()
+{
+    notImplemented();
+}
+
+
+LoadErrorResetToken* FrameLoaderClientQt::tokenForLoadErrorReset()
+{
+    notImplemented();
+    return 0;
+}
+
+
+void FrameLoaderClientQt::resetAfterLoadError(LoadErrorResetToken*)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::doNotResetAfterLoadError(LoadErrorResetToken*)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::willCloseDocument()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::detachedFromParent1()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::detachedFromParent2()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::detachedFromParent3()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::detachedFromParent4()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::loadedFromPageCache()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchDidHandleOnloadEvents()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchDidReceiveServerRedirectForProvisionalLoad()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchDidCancelClientRedirect()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchWillPerformClientRedirect(const KURL&,
+                                                            double interval,
+                                                            double fireDate)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchDidChangeLocationWithinPage()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchWillClose()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchDidStartProvisionalLoad()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchDidReceiveTitle(const String& title)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchDidCommitLoad()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchDidFinishLoad()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchDidFirstLayout()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchShow()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::cancelPolicyCheck()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchWillSubmitForm(FramePolicyFunction,
+                                                 PassRefPtr<FormState>)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::dispatchDidLoadMainResource(DocumentLoader*)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::clearLoadingFromPageCache(DocumentLoader*)
+{
+    notImplemented();
+}
+
+
+bool FrameLoaderClientQt::isLoadingFromPageCache(DocumentLoader*)
+{
+    notImplemented();
+    return false;
+}
+
+
+void FrameLoaderClientQt::revertToProvisionalState(DocumentLoader*)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::clearUnarchivingState(DocumentLoader*)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::progressStarted()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::progressCompleted()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::setMainFrameDocumentReady(bool)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::willChangeTitle(DocumentLoader*)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::didChangeTitle(DocumentLoader*)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::finishedLoading(DocumentLoader*)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::finalSetupForReplace(DocumentLoader*)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::setDefersLoading(bool)
+{
+    notImplemented();
+}
+
+
+bool FrameLoaderClientQt::isArchiveLoadPending(ResourceLoader*) const
+{
+    notImplemented();
+    return false;
+}
+
+
+void FrameLoaderClientQt::cancelPendingArchiveLoad(ResourceLoader*)
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::clearArchivedResources()
+{
+    notImplemented();
+}
+
+
+bool FrameLoaderClientQt::canShowMIMEType(const String& MIMEType) const
+{
+    notImplemented();
+    return false;
+}
+
+
+bool FrameLoaderClientQt::representationExistsForURLScheme(
+    const String& URLScheme) const
+{
+    notImplemented();
+    return false;
+}
+
+
+String FrameLoaderClientQt::generatedMIMETypeForURLScheme(const String& URLScheme) const
+{
+    notImplemented();
+    return String();
+}
+
+
+void FrameLoaderClientQt::frameLoadCompleted()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::restoreScrollPositionAndViewState()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::provisionalLoadStarted()
+{
+    notImplemented();
+}
+
+
+bool FrameLoaderClientQt::shouldTreatURLAsSameAsCurrent(const KURL&) const
+{
+    notImplemented();
+    return false;
+}
+
+
+void FrameLoaderClientQt::addHistoryItemForFragmentScroll()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::didFinishLoad()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::prepareForDataSourceReplacement()
+{
+    notImplemented();
+}
+
+
+void FrameLoaderClientQt::setTitle(const String& title, const KURL&)
+{
+    notImplemented();
+}
+
+
+String FrameLoaderClientQt::userAgent()
+{
+    notImplemented();
+    return String();
+}
+
+}
diff --git a/WebCore/loader/qt/FrameLoaderClientQt.h b/WebCore/loader/qt/FrameLoaderClientQt.h
new file mode 100644 (file)
index 0000000..11cecf1
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef FrameLoaderClientQt_H
+#define FrameLoaderClientQt_H
+
+#include "FrameLoaderClient.h"
+#include "KURL.h"
+#include "FrameQt.h"
+#include "FrameLoader.h"
+
+namespace WebCore {
+
+    class DocumentLoader;
+    class Element;
+    class FormState;
+    class NavigationAction;
+    class String;
+    class ResourceLoader;
+
+    struct LoadErrorResetToken;
+
+    class FrameLoaderClientQt : public FrameLoaderClient
+    {
+    public:
+        FrameLoaderClientQt();
+        ~FrameLoaderClientQt();
+        virtual void detachFrameLoader();
+
+        virtual bool hasWebView() const; // mainly for assertions
+        virtual bool hasFrameView() const; // ditto
+
+        virtual bool hasBackForwardList() const;
+        virtual void resetBackForwardList();
+
+        virtual bool provisionalItemIsTarget() const;
+        virtual bool loadProvisionalItemFromPageCache();
+        virtual void invalidateCurrentItemPageCache();
+
+        virtual bool privateBrowsingEnabled() const;
+
+        virtual void makeDocumentView();
+        virtual void makeRepresentation(DocumentLoader*);
+        virtual void forceLayout();
+        virtual void forceLayoutForNonHTML();
+
+        virtual void updateHistoryForCommit();
+
+        virtual void updateHistoryForBackForwardNavigation();
+        virtual void updateHistoryForReload();
+        virtual void updateHistoryForStandardLoad();
+        virtual void updateHistoryForInternalLoad();
+
+        virtual void updateHistoryAfterClientRedirect();
+
+        virtual void setCopiesOnScroll();
+
+        virtual LoadErrorResetToken* tokenForLoadErrorReset();
+        virtual void resetAfterLoadError(LoadErrorResetToken*);
+        virtual void doNotResetAfterLoadError(LoadErrorResetToken*);
+
+        virtual void willCloseDocument();
+
+        virtual void detachedFromParent1();
+        virtual void detachedFromParent2();
+        virtual void detachedFromParent3();
+        virtual void detachedFromParent4();
+
+        virtual void loadedFromPageCache();
+
+        virtual void dispatchDidHandleOnloadEvents();
+        virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
+        virtual void dispatchDidCancelClientRedirect();
+        virtual void dispatchWillPerformClientRedirect(const KURL&, double interval, double fireDate);
+        virtual void dispatchDidChangeLocationWithinPage();
+        virtual void dispatchWillClose();
+
+        virtual void dispatchDidStartProvisionalLoad();
+        virtual void dispatchDidReceiveTitle(const String& title);
+        virtual void dispatchDidCommitLoad();
+
+        virtual void dispatchDidFinishLoad();
+        virtual void dispatchDidFirstLayout();
+
+        virtual void dispatchShow();
+        virtual void cancelPolicyCheck();
+
+        virtual void dispatchWillSubmitForm(FramePolicyFunction, PassRefPtr<FormState>);
+
+        virtual void dispatchDidLoadMainResource(DocumentLoader*);
+        virtual void clearLoadingFromPageCache(DocumentLoader*);
+        virtual bool isLoadingFromPageCache(DocumentLoader*);
+        virtual void revertToProvisionalState(DocumentLoader*);
+        virtual void clearUnarchivingState(DocumentLoader*);
+
+        virtual void progressStarted();
+        virtual void progressCompleted();
+        virtual void setMainFrameDocumentReady(bool);
+        virtual void willChangeTitle(DocumentLoader*);
+        virtual void didChangeTitle(DocumentLoader*);
+        virtual void finishedLoading(DocumentLoader*);
+        virtual void finalSetupForReplace(DocumentLoader*);
+
+        virtual void setDefersLoading(bool);
+        virtual bool isArchiveLoadPending(ResourceLoader*) const;
+        virtual void cancelPendingArchiveLoad(ResourceLoader*);
+        virtual void clearArchivedResources();
+        virtual bool canShowMIMEType(const String& MIMEType) const;
+        virtual bool representationExistsForURLScheme(const String& URLScheme) const;
+        virtual String generatedMIMETypeForURLScheme(const String& URLScheme) const;
+
+        virtual void frameLoadCompleted();
+        virtual void restoreScrollPositionAndViewState();
+        virtual void provisionalLoadStarted();
+        virtual bool shouldTreatURLAsSameAsCurrent(const KURL&) const;
+        virtual void addHistoryItemForFragmentScroll();
+        virtual void didFinishLoad();
+        virtual void prepareForDataSourceReplacement();
+        virtual void setTitle(const String& title, const KURL&);
+
+        virtual String userAgent();
+    };
+
+}
+
+#endif
index 1b68b1c00ba6760cb311c86913a1209fd61302fc..fb96490f608b53da889d2fd5aaf4a4931454418c 100644 (file)
 #include "FrameLoadRequest.h"
 #include "FrameLoader.h"
 #include "FramePrivate.h"
+#include "FrameLoaderClient.h"
+#include "DocumentLoader.h"
+#include "FrameView.h"
+#include "FormState.h"
 #include "GraphicsContext.h"
 #include "HTMLDocument.h"
 #include "HTMLElement.h"
@@ -82,16 +86,17 @@ void FrameLoader::submitForm(const FrameLoadRequest& frameLoadRequest, Event*)
     // FIXME: Frame targeting is only one of the ways the submission could end up doing something other
     // than replacing this frame's content, so this check is flawed. On the other hand, the check is hardly
     // needed any more now that we reset m_submittedFormURL on each mouse or key down event.
-    Frame* target = m_frame->tree()->find(request.frameName());
+    Frame* target = m_frame->tree()->find(frameLoadRequest.frameName());
     if (m_frame->tree()->isDescendantOf(target)) {
-        if (m_submittedFormURL == request.resourceRequest().url())
+        if (m_submittedFormURL == frameLoadRequest.resourceRequest().url())
             return;
-        m_submittedFormURL = request.resourceRequest().url();
+        m_submittedFormURL = frameLoadRequest.resourceRequest().url();
     }
 
     if (QtFrame(m_frame)->client())
-        QtFrame(m_frame)->client()->submitForm(request.resourceRequest().httpMethod(),
-            request.resourceRequest().url(), &request.resourceRequest().httpBody());
+        QtFrame(m_frame)->client()->submitForm(frameLoadRequest.resourceRequest().httpMethod(),
+                                               frameLoadRequest.resourceRequest().url(),
+                                               &frameLoadRequest.resourceRequest().httpBody());
 
     clearRecordedFormValues();
 }
@@ -142,6 +147,176 @@ KURL FrameLoader::originalRequestURL() const
     return KURL();
 }
 
+String FrameLoader::overrideMediaType() const
+{
+    // no-op
+    return String();
+}
+
+int FrameLoader::getHistoryLength()
+{
+    notImplemented();
+    return 0;
+}
+
+String FrameLoader::referrer() const
+{
+    notImplemented();
+    return String();
+}
+
+
+void FrameLoader::detachFromParent()
+{
+    RefPtr<Frame> protect(m_frame);
+
+    closeDocument();
+    stopAllLoaders();
+    m_client->detachedFromParent1();
+    detachChildren();
+    m_client->detachedFromParent2();
+    setDocumentLoader(0);
+    m_client->detachedFromParent3();
+
+    if (Frame* parent = m_frame->tree()->parent())
+        parent->tree()->removeChild(m_frame);
+    m_frame->setView(0);
+    
+    m_client->detachedFromParent4();
+}
+
+
+void FrameLoader::checkLoadCompleteForThisFrame()
+{
+    ASSERT(m_client->hasWebView());
+    notImplemented();
+    
+    switch (m_state) {
+    case FrameStateProvisional: {
+    }
+        
+    case FrameStateCommittedPage: {
+        DocumentLoader* dl = m_documentLoader.get();            
+        if (dl->isLoadingInAPISense())
+            return;
+
+        markLoadComplete();
+
+        // FIXME: Is this subsequent work important if we already navigated away?
+        // Maybe there are bugs because of that, or extra work we can skip because
+        // the new page is ready.
+
+        m_client->forceLayoutForNonHTML();
+             
+        // If the user had a scroll point, scroll to it, overriding the anchor point if any.
+        if ((isBackForwardLoadType(m_loadType) || m_loadType == FrameLoadTypeReload)
+            && m_client->hasBackForwardList())
+            m_client->restoreScrollPositionAndViewState();
+
+        m_client->progressCompleted();
+        return;
+    }
+        
+    case FrameStateComplete:
+        // Even if already complete, we might have set a previous item on a frame that
+        // didn't do any data loading on the past transaction. Make sure to clear these out.
+        m_client->frameLoadCompleted();
+        return;
+    }
+
+}
+
+void FrameLoader::goBackOrForward(int distance)
+{
+    notImplemented();
+}
+
+KURL FrameLoader::historyURL(int distance)
+{
+    notImplemented();
+    return KURL();
+}
+
+void FrameLoader::didFirstLayout()
+{
+    if (isBackForwardLoadType(m_loadType) && m_client->hasBackForwardList())
+        m_client->restoreScrollPositionAndViewState();
+
+    m_firstLayoutDone = true;
+    m_client->dispatchDidFirstLayout();
+}
+
+bool FrameLoader::canGoBackOrForward(int distance) const
+{
+    notImplemented();
+    return false;
+}
+
+void FrameLoader::partClearedInBegin()
+{
+    notImplemented();
+}
+
+void FrameLoader::saveDocumentState()
+{
+    // Do not save doc state if the page has a password field and a form that would be submitted via https.
+    notImplemented();
+}
+
+void FrameLoader::restoreDocumentState()
+{
+    notImplemented();
+}
+
+void FrameLoader::didChangeTitle(DocumentLoader* loader)
+{
+    notImplemented();
+    m_client->didChangeTitle(loader);
+}
+
+void FrameLoader::redirectDataToPlugin(Widget* pluginWidget)
+{
+    notImplemented();
+}
+
+PolicyCheck::PolicyCheck()
+    : m_contentFunction(0)
+{
+}
+
+void PolicyCheck::clear()
+{
+    clearRequest();
+    m_contentFunction = 0;
+}
+
+
+void PolicyCheck::set(ContentPolicyDecisionFunction function, void* argument)
+{
+    m_formState = 0;
+    m_frameName = String();
+
+    m_contentFunction = function;
+    m_argument = argument;
+}
+
+void PolicyCheck::call()
+{
+    notImplemented();
+}
+
+void PolicyCheck::call(PolicyAction action)
+{
+    ASSERT(m_contentFunction);
+    m_contentFunction(m_argument, action);
+}
+
+void PolicyCheck::clearRequest()
+{
+    m_formState = 0;
+    m_frameName = String();
+}
+
 }
 
 // vim: ts=4 sw=4 et
diff --git a/WebCore/loader/qt/NavigationActionQt.cpp b/WebCore/loader/qt/NavigationActionQt.cpp
new file mode 100644 (file)
index 0000000..2fc2bfd
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "NavigationAction.h"
+
+#include "FrameLoader.h"
+
+namespace WebCore {
+
+static NavigationType navigationType(FrameLoadType frameLoadType, bool isFormSubmission, bool haveEvent)
+{
+    if (isFormSubmission)
+        return NavigationTypeFormSubmitted;
+    if (haveEvent)
+        return NavigationTypeLinkClicked;
+    if (frameLoadType == FrameLoadTypeReload)
+        return NavigationTypeReload;
+    if (isBackForwardLoadType(frameLoadType))
+        return NavigationTypeBackForward;
+    return NavigationTypeOther;
+}
+
+NavigationAction::NavigationAction()
+    : m_type(NavigationTypeOther)
+{
+}
+
+NavigationAction::NavigationAction(const KURL& URL, NavigationType type)
+    : m_URL(URL)
+    , m_type(type)
+{
+}
+
+NavigationAction::NavigationAction(const KURL& URL, FrameLoadType frameLoadType,
+                                   bool isFormSubmission)
+    : m_URL(URL)
+    , m_type(navigationType(frameLoadType, isFormSubmission, 0))
+{
+}
+
+NavigationAction::NavigationAction(const KURL& URL, NavigationType type, PassRefPtr<Event> event)
+    : m_URL(URL)
+    , m_type(type)
+    , m_event(event)
+{
+}
+
+NavigationAction::NavigationAction(const KURL& URL, FrameLoadType frameLoadType,
+                                   bool isFormSubmission, PassRefPtr<Event> event)
+    : m_URL(URL)
+    , m_type(navigationType(frameLoadType, isFormSubmission, event))
+    , m_event(event)
+{
+}
+
+}
diff --git a/WebCore/loader/qt/ResourceLoaderQt.cpp b/WebCore/loader/qt/ResourceLoaderQt.cpp
new file mode 100644 (file)
index 0000000..572b185
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ResourceLoader.h"
+
+#include "FrameLoader.h"
+#include "FrameQt.h"
+#include "Page.h"
+#include <wtf/Assertions.h>
+#include <wtf/RefPtr.h>
+
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
+
+namespace WebCore {
+
+ResourceLoader::ResourceLoader(Frame* frame)
+    : m_reachedTerminalState(false)
+    , m_cancelled(false)
+    , m_calledDidFinishLoad(false)
+    , m_frame(frame)
+    , m_defersLoading(frame->page()->defersLoading())
+{
+}
+
+ResourceLoader::~ResourceLoader()
+{
+    ASSERT(m_reachedTerminalState);
+}
+
+void ResourceLoader::setDefersLoading(bool defers)
+{
+    notImplemented();
+    m_defersLoading = defers;
+}
+
+void ResourceLoader::cancel()
+{
+    notImplemented();
+}
+
+// FIXME: We should move this to ResourceHandle, once it implements all the connection callbacks
+bool ResourceLoader::loadsBlocked()
+{
+    notImplemented();
+    return false;
+}
+
+}
index 51ef6dc36f3c55d9effec91603282676333373e8..885c7ce5ea760502619207b235c6bc6f9f4044fb 100644 (file)
 #include "MimeTypeRegistry.h"
 #include "wtf/HashMap.h"
 #include "wtf/HashSet.h"
+#if PLATFORM(MAC)
 #include <ApplicationServices/ApplicationServices.h>
 #include "WebCoreSystemInterface.h"
-
+#endif
 #include "StringHash.h"
 
 namespace WebCore
@@ -72,12 +73,12 @@ static void initialiseSupportedImageMIMETypes()
 
 #else
     //assume that all implementations at least support
-    supportedImageMIMETypes->add("jpg", "image/jpeg");
-    supportedImageMIMETypes->add("jpeg", "image/jpeg");
-    supportedImageMIMETypes->add("png", "image/png");
-    supportedImageMIMETypes->add("gif", "image/gif");
-    supportedImageMIMETypes->add("bmp", "image/bmp");
-#endif;
+    supportedImageMIMETypes->add("image/jpeg");
+    supportedImageMIMETypes->add("image/jpeg");
+    supportedImageMIMETypes->add("image/png");
+    supportedImageMIMETypes->add("image/gif");
+    supportedImageMIMETypes->add("image/bmp");
+#endif
 }
 
 static void initialiseSupportedNonImageMimeTypes()
index 57a5b144282c9a45df0796fee6d138f308c210cb..5adeb0fcc2dcb38f7a9d4fd09336c65531252d0b 100644 (file)
@@ -144,7 +144,8 @@ void ResourceHandleManager::slotResult(KJob* kjob)
     if (!job)
         return;
 
-    job->setError(kjob->error());
+    //FIXME: should report an error
+    //job->setError(kjob->error());
     remove(job);
 
     ASSERT(m_frameClient);
@@ -223,7 +224,8 @@ void ResourceHandleManager::add(ResourceHandle* job, FrameQtClient* frameClient)
 void ResourceHandleManager::cancel(ResourceHandle* job)
 {
     remove(job);
-    job->setError(1);
+    //FIXME set an error state
+    //job->setError(1);
 }
 
 // Qt Resource Handle Manager
diff --git a/WebCore/platform/qt/ChromeClientQt.cpp b/WebCore/platform/qt/ChromeClientQt.cpp
new file mode 100644 (file)
index 0000000..c404fa8
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "ChromeClientQt.h"
+
+#include "Frame.h"
+#include "FrameView.h"
+#include "FrameLoadRequest.h"
+
+#include <QWidget>
+
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
+
+namespace WebCore
+{
+
+static QWidget* rootWindowForFrame(const Frame* frame)
+{
+    FrameView* frameView = (frame ? frame->view() : 0);
+    if (!frameView)
+        return 0;
+
+    return frameView->qwidget();
+}
+    
+ChromeClientQt::ChromeClientQt()
+{
+    
+}
+
+
+ChromeClientQt::~ChromeClientQt()
+{
+    
+}
+
+
+void ChromeClientQt::setWindowRect(const FloatRect&)
+{
+    notImplemented();
+#if 0
+    QWidget* widget = rootWindowForFrame(mainFrame());
+    if (widget)
+        widget->setGeometry(QRect(qRound(r.x()), qRound(r.y()),
+                                  qRound(r.width()), qRound(r.height())));
+#endif
+}
+
+
+FloatRect ChromeClientQt::windowRect()
+{
+#if 0
+    QWidget* widget = rootWindowForFrame(mainFrame());
+    if (!widget)
+        return FloatRect();
+
+    return IntRect(widget->geometry());
+#endif
+    notImplemented();
+    return IntRect(0, 0, 100, 100);
+}
+
+
+FloatRect ChromeClientQt::pageRect()
+{
+    notImplemented();
+    return FloatRect(0, 0, 100, 100);
+}
+
+
+float ChromeClientQt::scaleFactor()
+{
+    notImplemented();
+    return 1;
+}
+
+
+void ChromeClientQt::focus()
+{
+    notImplemented();
+}
+
+
+void ChromeClientQt::unfocus()
+{
+    notImplemented();
+}
+
+
+Page* ChromeClientQt::createWindow(const FrameLoadRequest&)
+{
+    notImplemented();
+    return 0;
+}
+
+
+Page* ChromeClientQt::createModalDialog(const FrameLoadRequest&)
+{
+    return 0;
+}
+
+
+void ChromeClientQt::show()
+{
+    notImplemented();
+}
+
+
+bool ChromeClientQt::canRunModal()
+{
+    notImplemented();
+    return false;
+}
+
+
+void ChromeClientQt::runModal()
+{
+    notImplemented();
+}
+
+
+void ChromeClientQt::setToolbarsVisible(bool)
+{
+    notImplemented();
+}
+
+
+bool ChromeClientQt::toolbarsVisible()
+{
+    notImplemented();
+    return false;
+}
+
+
+void ChromeClientQt::setStatusbarVisible(bool)
+{
+    notImplemented();
+}
+
+
+bool ChromeClientQt::statusbarVisible()
+{
+    notImplemented();
+    return false;
+}
+
+
+void ChromeClientQt::setScrollbarsVisible(bool)
+{
+    notImplemented();
+}
+
+
+bool ChromeClientQt::scrollbarsVisible()
+{
+    notImplemented();
+    return true;
+}
+
+
+void ChromeClientQt::setMenubarVisible(bool)
+{
+    notImplemented();
+}
+
+bool ChromeClientQt::menubarVisible()
+{
+    notImplemented();
+    return false;
+}
+
+void ChromeClientQt::setResizable(bool)
+{
+    notImplemented();
+}
+
+}
diff --git a/WebCore/platform/qt/ChromeClientQt.h b/WebCore/platform/qt/ChromeClientQt.h
new file mode 100644 (file)
index 0000000..0a4b4f0
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ChromeClientQt_H
+#define ChromeClientQt_H
+
+#include "ChromeClient.h"
+#include "FloatRect.h"
+
+namespace WebCore {
+
+    class FloatRect;
+    class Page;
+    struct FrameLoadRequest;
+    
+    class ChromeClientQt : public ChromeClient
+    {
+    public:
+        ChromeClientQt();
+        virtual ~ChromeClientQt();
+
+        virtual void setWindowRect(const FloatRect&);
+        virtual FloatRect windowRect();
+        
+        virtual FloatRect pageRect();
+        
+        virtual float scaleFactor();
+    
+        virtual void focus();
+        virtual void unfocus();
+
+        virtual Page* createWindow(const FrameLoadRequest&);
+        virtual Page* createModalDialog(const FrameLoadRequest&);
+        virtual void show();
+
+        virtual bool canRunModal();
+        virtual void runModal();
+
+        virtual void setToolbarsVisible(bool);
+        virtual bool toolbarsVisible();
+        
+        virtual void setStatusbarVisible(bool);
+        virtual bool statusbarVisible();
+        
+        virtual void setScrollbarsVisible(bool);
+        virtual bool scrollbarsVisible();
+        
+        virtual void setMenubarVisible(bool);
+        virtual bool menubarVisible();
+
+        virtual void setResizable(bool);
+    };
+
+}
+
+#endif
index cf3abc90fb20f51e206818f1e68d34920004edee..12b9bf563c5e0840240906aee855381717bae935 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
  * Copyright (C) 2006 Apple Computer, Inc.
  *
  * All rights reserved.
@@ -64,6 +65,40 @@ int EditorClientQt::spellCheckerDocumentTag()
     return 0;
 }
 
+bool EditorClientQt::shouldBeginEditing(WebCore::Range*)
+{
+    notImplemented();
+    return false;
+}
+
+bool EditorClientQt::shouldEndEditing(WebCore::Range*)
+{
+    notImplemented();
+    return false;
+}
+
+bool EditorClientQt::shouldApplyStyle(WebCore::CSSStyleDeclaration*,
+                                      WebCore::Range*)
+{
+    notImplemented();
+    return false;
+}
+
+void EditorClientQt::didBeginEditing()
+{
+    notImplemented();
+}
+
+void EditorClientQt::respondToChangedContents()
+{
+    notImplemented();
+}
+
+void EditorClientQt::didEndEditing()
+{
+    notImplemented();
+}
+
 }
 
 // vim: ts=4 sw=4 et
index 8411a9ab56bfdd2d94bfd8e368a6128d6c6f0aeb..40d884ab110627d4f9f0eed6a9c05b2d64dc5718 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
  * Copyright (C) 2006 Apple Computer, Inc.
  *
  * All rights reserved.
@@ -40,7 +41,17 @@ public:
 
     virtual bool isContinuousSpellCheckingEnabled();
     virtual bool isGrammarCheckingEnabled();
-    virtual int spellCheckerDocumentTag();
+    virtual int  spellCheckerDocumentTag();
+
+    virtual bool shouldBeginEditing(WebCore::Range*);
+    virtual bool shouldEndEditing(WebCore::Range*);
+    virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*,
+                                  WebCore::Range*);
+    
+    virtual void didBeginEditing();
+    virtual void respondToChangedContents();
+    virtual void didEndEditing();
+
 };
 
 }
index 1122a546c020f030ac39569a700fbf25b29fa680..e1fb7a5890842ab81d37d1e58bf07453ec0b8a1f 100644 (file)
 #include "DOMWindow.h"
 #include "EditorClientQt.h"
 #include "FrameLoadRequest.h"
+#include "FrameLoaderClientQt.h"
 #include "DOMImplementation.h"
 #include "ResourceHandleInternal.h"
 #include "Document.h"
 #include "Settings.h"
 #include "Plugin.h"
+#include "FrameView.h"
 #include "FramePrivate.h"
 #include "GraphicsContext.h"
 #include "HTMLDocument.h"
 #include "ResourceHandle.h"
+#include "FrameLoader.h"
 #include "PlatformMouseEvent.h"
 #include "PlatformKeyboardEvent.h"
 #include "PlatformWheelEvent.h"
 #include "MouseEventWithHitTestResults.h"
 #include "SelectionController.h"
+#include "kjs_proxy.h"
 #include "TypingCommand.h"
 #include "JSLock.h"
 #include "kjs_window.h"
@@ -94,7 +98,9 @@ static void doScroll(const RenderObject* r, bool isHorizontal, int multiplier)
 }
 #endif
 
-FrameQt::FrameQt(Page* page, Element* ownerElement, FrameQtClient* frameClient, EditorClient* editorClient)
+FrameQt::FrameQt(Page* page, Element* ownerElement,
+                 FrameQtClient* frameClient,
+                 EditorClient* editorClient)
     : Frame(page, ownerElement, (editorClient ? editorClient : new EditorClientQt()))
     , m_bindingRoot(0)
 {
@@ -116,19 +122,16 @@ FrameQt::FrameQt(Page* page, Element* ownerElement, FrameQtClient* frameClient,
 
     m_client = frameClient;
     m_client->setFrame(this);
+    //FIXME: rework once frameloaderclientqt is even close to working
+    loader()->setClient(new FrameLoaderClientQt());
 }
 
 FrameQt::~FrameQt()
 {
     setView(0);
-    clearRecordedFormValues();
+    loader()->clearRecordedFormValues();
 
-    cancelAndClear();
-}
-
-String FrameQt::userAgent() const
-{
-    return "Mozilla/5.0 (PC; U; Intel; Linux; en) AppleWebKit/420+ (KHTML, like Gecko)";
+    loader()->cancelAndClear();
 }
 
 void FrameQt::runJavaScriptAlert(String const& message)
@@ -146,18 +149,6 @@ bool FrameQt::locationbarVisible()
     return m_client->locationbarVisible();
 }
 
-void FrameQt::setTitle(const String& title)
-{
-    if (view() && view()->parentWidget())
-        view()->parentWidget()->setWindowTitle(title);
-}
-
-Frame* FrameQt::createFrame(const KURL& url, const String& name, Element* ownerElement, const String& referrer)
-{
-    notImplemented();
-    return 0;
-}
-
 bool FrameQt::passWheelEventToChildWidget(Node*)
 {
     notImplemented();
@@ -202,31 +193,12 @@ bool FrameQt::toolbarVisible()
     return m_client->toolbarVisible();
 }
 
-void FrameQt::createEmptyDocument()
-{
-    // Although it's not completely clear from the name of this function,
-    // it does nothing if we already have a document, and just creates an
-    // empty one if we have no document at all.
-
-    // Force creation.
-    if (!d->m_doc) {
-        begin();
-        end();
-    }
-}
-
 Range* FrameQt::markedTextRange() const
 {
     // FIXME: Handle selections.
     return 0;
 }
 
-String FrameQt::incomingReferrer() const
-{
-    notImplemented();
-    return String();
-}
-
 String FrameQt::mimeTypeForFileName(const String&) const
 {
     notImplemented();
@@ -282,12 +254,6 @@ void FrameQt::focusWindow()
         view()->qwidget()->setFocus();
 }
 
-String FrameQt::overrideMediaType() const
-{
-    // no-op
-    return String();
-}
-
 void FrameQt::addMessageToConsole(const String& message, unsigned lineNumber, const String& sourceID)
 {
     qDebug("[FrameQt::addMessageToConsole] message=%s lineNumber=%d sourceID=%s",
@@ -339,12 +305,6 @@ void FrameQt::addPluginRootObject(KJS::Bindings::RootObject* root)
     m_rootObjects.append(root);
 }
 
-Widget* FrameQt::createJavaAppletWidget(const IntSize&, Element*, const HashMap<String, String>&)
-{
-    notImplemented();
-    return 0;
-}
-
 void FrameQt::registerCommandForUndo(PassRefPtr<EditCommand>)
 {
     // FIXME: Implement this in the FrameQtClient, to be used within WebKitPart.
@@ -411,31 +371,6 @@ bool FrameQt::shouldChangeSelection(const Selection& oldSelection, const Selecti
     return true;
 }
 
-void FrameQt::partClearedInBegin()
-{
-    // FIXME: This is only related to the js debugger.
-    // See WebCoreSupport/WebFrameBridge.m "windowObjectCleared",
-    // which is called by FrameMac::partClearedInBegin() ...
-}
-
-bool FrameQt::canGoBackOrForward(int distance) const
-{
-    // FIXME: Implement this in the FrameQtClient, to be used within WebKitPart.
-    notImplemented();
-    return false;
-}
-
-void FrameQt::handledOnloadEvents()
-{
-    // TODO: FrameMac doesn't need that - it seems.
-    // It must be handled differently, can't figure it out.
-    // If we won't call this here doc->parsing() remains 'true'
-    // all the time. Calling document.open(); document.write(...)
-    // from JavaScript leaves the parsing state 'true', and DRT will
-    // hang on these tests (fast/dom/Document/document-reopen.html for instance)
-    endIfNotLoading();
-}
-
 bool FrameQt::canPaste() const
 {
     // FIXME: Implement this in the FrameQtClient, to be used within WebKitPart.
@@ -490,7 +425,7 @@ bool FrameQt::keyEvent(const PlatformKeyboardEvent& keyEvent)
     }
 
     if (!keyEvent.isKeyUp())
-        prepareForUserAction();
+        loader()->resetMultipleFormSubmissionProtection();
 
     result = !EventTargetNodeCast(node)->dispatchKeyEvent(keyEvent);
 
@@ -503,12 +438,6 @@ void FrameQt::setFrameGeometry(const IntRect& r)
     setFrameGeometry(QRect(r));
 }
 
-void FrameQt::tokenizerProcessedData()
-{
-    if (d->m_doc)
-        checkCompleted();
-}
-
 FrameQtClient* FrameQt::client() const
 {
     return m_client;
@@ -530,12 +459,6 @@ KURL FrameQt::historyURL(int distance)
     return KURL();
 }
 
-int FrameQt::getHistoryLength()
-{
-    notImplemented();
-    return 0;
-}
-
 }
 
 // vim: ts=4 sw=4 et
index bf1c69c39d312306fff83fd93bd18b7c31f4fa9b..d49df465dbc1718c9973e63f082a0e1646ecaaa0 100644 (file)
@@ -116,8 +116,6 @@ public:
     void goBackOrForward(int);
 
     KURL historyURL(int distance);
-    int getHistoryLength();
-
 private:
     void init();
 
index 8c877add16856cfc0981319f9770e5c9f97717a0..1a45a1ea4db43ba0612c01292bf0bf2cf5956bdf 100644 (file)
@@ -32,6 +32,8 @@
 #include "FrameQt.h"
 #include "Document.h"
 #include "FrameTree.h"
+#include "FrameView.h"
+#include "FrameLoader.h"
 #include "ResourceHandle.h"
 #include "LoaderFunctions.h"
 #include "ResourceHandleInternal.h"
@@ -69,11 +71,11 @@ void FrameQtClientDefault::openURL(const KURL& url)
 {
     ASSERT(m_frame);
 
-    m_frame->didOpenURL(url);
+    m_frame->loader()->didOpenURL(url);
     m_assignedMimetype = false;
 
     if (!m_frame->document())
-        m_frame->createEmptyDocument();
+        m_frame->loader()->createEmptyDocument();
 
     ASSERT(m_frame->document());
 
@@ -183,15 +185,15 @@ void FrameQtClientDefault::didReceiveData(ResourceHandle* job, const char* data,
         m_assignedMimetype = true;
 
         // Assign correct mimetype _before_ calling begin()!
-        m_frame->setResponseMIMEType(d->m_mimetype);
+        m_frame->loader()->setResponseMIMEType(d->m_mimetype);
     }
 
     // TODO: Allow user overrides of the encoding...
     // This calls begin() for us, despite the misleading name
-    m_frame->setEncoding(d->m_charset, false);
+    m_frame->loader()->setEncoding(d->m_charset, false);
 
     // Feed with new data
-    m_frame->write(data, length);
+    m_frame->loader()->write(data, length);
 }
 
 FrameQt* FrameQtClientDefault::traverseNextFrameStayWithin(FrameQt* frame) const
@@ -223,7 +225,7 @@ void FrameQtClientDefault::receivedAllData(ResourceHandle* job, PlatformData dat
 {
     ASSERT(m_frame);
   
-    m_frame->end();
+    m_frame->loader()->end();
     m_assignedMimetype = false;
 }
 
index 3e2c3d907376869852cf99b81251f4f9abb3af45..8c5cd51c83ea46d1ef284a6b71b6759e9090214d 100644 (file)
@@ -77,17 +77,6 @@ Image* Image::loadPlatformResource(const char* name)
     return img;
 }
 
-bool Image::supportsType(const String& type)
-{
-    QList<QByteArray> formats = QImageReader::supportedImageFormats();
-    foreach(QByteArray format, formats) {
-        if (format == QString(type))
-            return true;
-    }
-
-    return false;
-}
-
 // Drawing Routines
 void Image::draw(GraphicsContext* ctxt, const FloatRect& dst,
                  const FloatRect& src, CompositeOperator op)
diff --git a/WebCore/platform/qt/MimeTypeRegistryQt.cpp b/WebCore/platform/qt/MimeTypeRegistryQt.cpp
new file mode 100644 (file)
index 0000000..5f2fa6f
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "MimeTypeRegistry.h"
+
+#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d\n", __FILE__, __LINE__); } while(0)
+
+namespace WebCore 
+{
+
+#if 0
+String getMIMETypeForUTI(const String & uti)
+{
+    CFStringRef utiref = uti.createCFString();
+    CFStringRef mime = UTTypeCopyPreferredTagWithClass(utiref, kUTTagClassMIMEType);
+    String mimeType = mime;
+    if (mime)
+        CFRelease(mime);
+    CFRelease(utiref);
+    return mimeType;
+}
+#endif
+
+String MimeTypeRegistry::getMIMETypeForExtension(const String &ext)
+{
+    notImplemented();
+    return ext;
+}
+
+}
index 475ddf45a50f9f1f2dc7d2ebefbfb1ffa83c1463..5c6012e0811de2e165c31aaf68c026c10273977a 100644 (file)
 
 namespace WebCore {
 
-static QWidget* rootWindowForFrame(const Frame* frame)
-{
-    FrameView* frameView = (frame ? frame->view() : 0);
-    if (!frameView)
-        return 0;
-
-    return frameView->qwidget();
-}
-
-FloatRect Page::windowRect() const
-{
-    QWidget* widget = rootWindowForFrame(mainFrame());
-    if (!widget)
-        return FloatRect();
-
-    return IntRect(widget->geometry());
-}
-
-void Page::setWindowRect(const FloatRect& r)
-{
-    QWidget* widget = rootWindowForFrame(mainFrame());
-    if (widget)
-        widget->setGeometry(QRect(qRound(r.x()), qRound(r.y()), qRound(r.width()), qRound(r.height())));
-}
-
-bool Page::canRunModal()
-{
-    notImplemented();
-    return false;
-}
-
-bool Page::canRunModalNow()
-{
-    notImplemented();
-    return false;
-}
-
-void Page::runModal() 
-{
-    notImplemented();
-}
-
 }
 
 // vim: ts=4 sw=4 et
index b6313c8d59d1307322e562584abcac12622591da..769deb54c87d551dbd7eda9dd1016323738e810a 100644 (file)
@@ -123,7 +123,7 @@ static String keyIdentifierForQtKeyCode(int keyCode)
         case Qt::Key_Delete:
             return "U+00007F";
         default:
-            return String::sprintf("U+%06X", toupper(keyCode));
+            return String::format("U+%06X", toupper(keyCode));
     }
 }
 
index 4ea4cf143038012aee996df202cdfed953cdb021..eda14463c66f4364e337d9de5de1f6e4786e9247 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "Page.h"
 #include "Frame.h"
+#include "FrameView.h"
 #include "Widget.h"
 #include "IntRect.h"
 #include "FloatRect.h"
index 85fcc369ad99c9214e63fe806abd1492a3f72c25..14eb6da2438e62d593edf0343c9a9696c12d0f5b 100644 (file)
@@ -60,7 +60,6 @@
 #include "RenderTheme.h"
 #include "TextBoundaries.h"
 #include "AXObjectCache.h"
-#include "IconDatabase.h"
 #include "IconLoader.h"
 
 using namespace WebCore;
@@ -90,7 +89,7 @@ void TextField::setSelection(int,int) { notImplemented(); }
 void TextField::setMaxResults(int) { notImplemented(); }
 bool TextField::edited() const { notImplemented(); return 0; }
 Widget::FocusPolicy TextField::focusPolicy() const { notImplemented(); return NoFocus; }
-TextField::TextField(TextField::Type) { notImplemented(); }
+TextField::TextField() { notImplemented(); }
 TextField::~TextField() { notImplemented(); }
 void TextField::setFont(WebCore::Font const&) { notImplemented(); }
 void TextField::setAlignment(HorizontalAlignment) { notImplemented(); }
@@ -137,15 +136,6 @@ void PlatformScrollbar::setRect(const IntRect&) { notImplemented(); }
 
 PlatformMouseEvent::PlatformMouseEvent(const CurrentEventTag&) { notImplemented(); }
 
-void IconLoader::stopLoading() { notImplemented(); }
-void IconLoader::startLoading() { notImplemented(); }
-IconLoader* IconLoader::createForFrame(Frame *frame) { return 0; }
-
-bool IconDatabase::isIconExpiredForIconURL(const String& url) { return false; }
-bool IconDatabase::hasEntryForIconURL(const String& url) { return false; }
-IconDatabase* IconDatabase::sharedIconDatabase() { return 0; }
-bool IconDatabase::setIconURLForPageURL(const String& iconURL, const String& pageURL) { return false; }
-
 }
 
 bool WebCore::historyContains(DeprecatedString const&) { return false; }
@@ -159,8 +149,13 @@ String WebCore::fileButtonNoFileSelectedLabel() { return "No file selected"; }
 
 void Frame::setNeedsReapplyStyles() { notImplemented(); }
 
-int WebCore::screenDepthPerComponent(const Page*) { notImplemented(); return 0; }
-bool WebCore::screenIsMonochrome(const Page*) { notImplemented(); return false; }
+int WebCore::screenDepth(Widget*) { notImplemented(); return 0; }
+int WebCore::screenDepthPerComponent(Widget*) { notImplemented(); return 0; }
+bool WebCore::screenIsMonochrome(Widget*) { notImplemented(); return false; }
+FloatRect WebCore::screenRect(Widget*)
+{ notImplemented(); return FloatRect(); }
+FloatRect WebCore::screenAvailableRect(Widget*)
+{ notImplemented(); return FloatRect(); }
 
 void WebCore::setFocusRingColorChangeFunction(void (*)()) { notImplemented(); }
 
@@ -183,7 +178,7 @@ namespace WebCore {
     
 Vector<String> supportedKeySizes() { notImplemented(); return Vector<String>(); }
 String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url) { return String(); }
-
+    
 }
 
 // vim: ts=4 sw=4 et
index ee6616e1e7d8e5632b3153b2a90205532f201fd7..92452a1bef7387e427b75c004ef2e0073b330d4b 100644 (file)
@@ -1,3 +1,16 @@
+2006-11-10  Zack Rusin  <zack@kde.org>
+
+        Reviewed and landed by Anders.
+
+        Adjusting to the recent loader changes, making it compile
+        and work.
+
+        * QtLauncher/main.cpp:
+        (main):
+        * WebKitPart/WebKitPart.cpp:
+        (WebKitPart::closeUrl):
+        (WebKitPart::initView):
+
 2006-11-03  Zack Rusin  <zack@kde.org>
 
         Reviewed by Maciej.
index adaa014991b473fd4ad913400c55a8e6a983a74a..d6d80ec725cbfc5921733b31c99ace44c9528231 100644 (file)
@@ -38,6 +38,9 @@
 #endif
 
 #include <Document.h>
+#include <FrameView.h>
+#include <ChromeClientQt.h>
+#include <KURL.h>
 
 #include <FrameQt.h>
 #include <page/Page.h>
@@ -79,9 +82,8 @@ int main(int argc, char **argv)
     QBoxLayout *l = new QVBoxLayout(&topLevel);
  
     // Initialize WebCore in Qt platform mode...
-    Page* page = new Page();
+    Page* page = new Page(new ChromeClientQt());
     Frame* frame = new FrameQt(page, 0, new FrameQtClientDefault());
-    page->setMainFrame(frame);
 
     FrameView* frameView = new FrameView(frame);
     frame->setView(frameView);
index 27fe9a111c415e205880b34cfe77d05f72c45f45..d2b6b82b7bfd4c3ee674a72073861714cfaadcfa 100644 (file)
 #include "config.h"
 #include "WebKitPart.h"
 
+#include "FrameLoader.h"
+#include "FrameView.h"
+#include "ChromeClientQt.h"
+#include "KURL.h"
+
 #include <QDebug>
 
 #include "Page.h"
@@ -76,7 +81,7 @@ bool WebKitPart::openUrl(const KUrl& url)
 
 bool WebKitPart::closeUrl()
 {
-    return m_frame->closeURL();
+    return m_frame->loader()->closeURL();
 }
 
 WebKitPart* WebKitPart::parentPart()
@@ -99,7 +104,7 @@ void WebKitPart::initView(QWidget* parentWidget, GUIProfile prof)
     m_client = new WebKitPartClient(this);
  
     // Initialize WebCore in Qt platform mode...
-    Page* page = new Page();
+    Page* page = new Page(new ChromeClientQt());
     Frame* frame = new FrameQt(page, 0, m_client);
 
     m_frame = frame;