WebCore:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 5 Nov 2006 01:06:47 +0000 (01:06 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 5 Nov 2006 01:06:47 +0000 (01:06 +0000)
        Reviewed by Maciej.

        - converted more of the loader machinery to work with cross-platform
          data structures instead of Macintosh-specific ones

          converted most uses of NSURL to KURL and NSEvent to DOM Event in
          loader classes

          moved download function out of FrameLoader.h to avoid reference to
          NSURLConnection

          added DOM Event parameters to various functions so that the handlers
          can use the DOM Event instead of the global "current NSEvent";
          includes Frame::submitForm, HTMLFormElement::prepareSubmit,
          HTMLFormElement::submit, FrameLoader::load

          moved the setMainFrame call that hands ownership to the Page
          into one of the Frame constructors, and removed it from all
          the clients

          removed const from Event parameter to the urlSelected function
          (we rarely use const with DOM elements)

          removed some redundant includes and declarations from various
          header files

          removed NSURL parameter from userAgent function -- if we need it we
          can add it back, but converting from NSURL to KURL and back is
          inefficient enough that it's best to have it out for now (since it's
          been unused for years) -- if we add it back, we can choose an
          appropriate parameter type that's always inexpensive to pass

          did some basic cleanup in the IconLoader class, including removing
          an unnecessary loop that added icon data a byte at a time

          renamed safeLoad to load, since it's no different from the other
          FrameLoader load functions, safety-wise

          fixed some code that was trying to distinguish null frame name from
          empty string frame name -- both should be handled the same, but callers
          were doing it by checking for empty and turning it into null (in a way
          that was causing extra round trips between NSString and WebCore::String)

          corrected all uses of "get" and "post" to be uppercase "GET" and "POST"
          and got rid of case-insensitive compares of methods

        * WebCore.exp:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/kjs_navigator.cpp:
        (KJS::Navigator::getValueProperty):
        * bridge/mac/FrameMac.h:
        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::submitForm):
        (WebCore::FrameMac::urlSelected):
        (WebCore::FrameMac::userAgent):
        * bridge/mac/FrameViewMac.mm:
        * bridge/mac/WebCoreAXObject.mm:
        (-[WebCoreAXObject rendererForView:]):
        * bridge/mac/WebCorePageBridge.h:
        * bridge/mac/WebCorePageBridge.mm:
        * bridge/mac/WebCoreSettings.mm:
        * bridge/win/FrameWin.cpp:
        (WebCore::FrameWin::urlSelected):
        (WebCore::FrameWin::submitForm):
        * bridge/win/FrameWin.h:
        * dom/MouseRelatedEvent.cpp:
        * dom/MouseRelatedEvent.h:
        * dom/UIEvent.cpp:
        (WebCore::UIEvent::~UIEvent):
        * dom/UIEvent.h:
        * dom/UIEventWithKeyState.h:
        * dom/XMLTokenizer.cpp:
        (WebCore::openFunc):
        * html/HTMLAnchorElement.cpp:
        (WebCore::HTMLAnchorElement::defaultEventHandler):
        * html/HTMLButtonElement.cpp:
        (WebCore::HTMLButtonElement::defaultEventHandler):
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::submitClick):
        (WebCore::HTMLFormElement::prepareSubmit):
        (WebCore::HTMLFormElement::submit):
        * html/HTMLFormElement.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::defaultEventHandler):
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
        * loader/DocumentLoader.h:
        * loader/FrameLoader.h:
        * loader/FrameLoaderClient.h:
        * loader/NavigationAction.h:
        (WebCore::NavigationAction::event):
        * loader/icon/IconLoader.cpp:
        (WebCore::IconLoader::create):
        (WebCore::IconLoader::startLoading):
        (WebCore::IconLoader::didReceiveData):
        (WebCore::IconLoader::didFinishLoading):
        * loader/icon/IconLoader.h:
        * loader/loader.cpp:
        * loader/mac/DocumentLoaderMac.mm:
        (WebCore::DocumentLoader::URL):
        (WebCore::DocumentLoader::unreachableURL):
        (WebCore::DocumentLoader::replaceRequestURLForAnchorScroll):
        (WebCore::DocumentLoader::URLForHistory):
        * loader/mac/FrameLoaderMac.mm:
        (WebCore::FrameLoader::load):
        (WebCore::FrameLoader::willSendRequest):
        (WebCore::FrameLoader::clientRedirected):
        (WebCore::FrameLoader::shouldReload):
        (WebCore::FrameLoader::notifyIconChanged):
        (WebCore::FrameLoader::URL):
        (WebCore::FrameLoader::reloadAllowingStaleData):
        (WebCore::FrameLoader::reload):
        (WebCore::FrameLoader::didChangeTitle):
        (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
        (WebCore::FrameLoader::post):
        (WebCore::FrameLoader::addExtraFieldsToRequest):
        (WebCore::FrameLoader::loadResourceSynchronously):
        * loader/mac/IconLoaderMac.mm:
        (WebCore::IconLoader::notifyIconChanged):
        * loader/mac/LoaderFunctionsMac.mm:
        * loader/mac/MainResourceLoaderMac.mm:
        (WebCore::shouldLoadAsEmptyDocument):
        (WebCore::MainResourceLoader::continueAfterContentPolicy):
        * loader/mac/NavigationActionMac.mm:
        (WebCore::navigationType):
        (WebCore::NavigationAction::NavigationAction):
        * loader/mac/ResourceLoaderMac.mm:
        * loader/mac/SubresourceLoaderMac.mm:
        * page/Frame.cpp:
        (WebCore::Frame::Frame):
        (WebCore::Frame::urlSelected):
        (WebCore::Frame::submitFormAgain):
        (WebCore::Frame::submitForm):
        (WebCore::Frame::endIfNotLoading):
        (WebCore::Frame::hitTestResultAtPoint):
        * page/Frame.h:
        * page/FramePrivate.h:
        * platform/gdk/FrameGdk.cpp:
        (WebCore::FrameGdk::FrameGdk):
        (WebCore::FrameGdk::submitForm):
        (WebCore::FrameGdk::urlSelected):
        * platform/gdk/FrameGdk.h:
        * platform/mac/TextFieldMac.mm:
        * platform/network/HTTPHeaderMap.h:
        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleClient.h:
        * platform/network/ResourceHandleInternal.h:
        * platform/network/mac/ResourceHandleMac.mm:
        * platform/network/mac/ResourceResponseMac.h:
        * platform/network/mac/ResourceResponseMac.mm:
        (-[NSURLResponse WebCore]):
        * platform/network/win/ResourceHandleWin.cpp:
        * platform/qt/FrameQt.cpp:
        (WebCore::FrameQt::submitForm):
        (WebCore::FrameQt::urlSelected):
        * platform/qt/FrameQt.h:
        * rendering/RenderLineEdit.cpp:
        (WebCore::RenderLineEdit::returnPressed):
        * xml/XSLTProcessor.cpp:
        (WebCore::docLoaderFunc):
        * xml/xmlhttprequest.cpp:

WebKit:

        Reviewed by Maciej.

        - converted more of the loader machinery to work with cross-platform
          data structures instead of Macintosh-specific ones

          store the computed user agent string as a WebCore::String instead
          of an NSString to avoid overhead converting it every time we get it

        * COM/WebFrame.cpp:
        (WebFrame::initWithName):
        * ChangeLog:
        * Misc/WebElementDictionary.m:
        (-[WebElementDictionary _image]):
        (-[WebElementDictionary _targetWebFrame]):
        * WebCoreSupport/WebFrameLoaderClient.h:
        * WebCoreSupport/WebFrameLoaderClient.mm:
        (WebFrameLoaderClient::dispatchWillPerformClientRedirect):
        (WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent):
        (WebFrameLoaderClient::setTitle):
        (WebFrameLoaderClient::userAgent):
        (WebFrameLoaderClient::actionDictionary):
        * WebCoreSupport/WebPageBridge.mm:
        (WebCore::if):
        * WebView/WebDataSource.mm:
        (-[WebDataSource _URL]):
        (-[WebDataSource _URLForHistory]):
        (-[WebDataSource unreachableURL]):
        * WebView/WebHTMLView.m:
        (-[WebHTMLView elementAtPoint:allowShadowContent:]):
        * WebView/WebPDFView.mm:
        (-[WebPDFView PDFViewWillClickOnLink:withURL:]):
        (-[WebPDFView _path]):
        * WebView/WebView.mm:
        (-[WebViewPrivate init]):
        (-[WebViewPrivate dealloc]):
        (-[WebViewPrivate finalize]):
        (-[WebView _preferencesChangedNotification:]):
        (-[WebView _cachedResponseForURL:]):
        (-[WebView setApplicationNameForUserAgent:]):
        (-[WebView setCustomUserAgent:]):
        (-[WebView customUserAgent]):
        (-[WebView userAgentForURL:]):
        (-[WebView _computeUserAgent]):
        (-[WebView WebCore::]):
        * WebView/WebViewInternal.h:

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

85 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/kjs_navigator.cpp
WebCore/bridge/mac/FrameMac.h
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/FrameViewMac.mm
WebCore/bridge/mac/WebCoreAXObject.mm
WebCore/bridge/mac/WebCorePageBridge.h
WebCore/bridge/mac/WebCorePageBridge.mm
WebCore/bridge/mac/WebCoreSettings.mm
WebCore/bridge/win/FrameWin.cpp
WebCore/bridge/win/FrameWin.h
WebCore/dom/MouseRelatedEvent.cpp
WebCore/dom/MouseRelatedEvent.h
WebCore/dom/UIEvent.cpp
WebCore/dom/UIEvent.h
WebCore/dom/UIEventWithKeyState.h
WebCore/dom/XMLTokenizer.cpp
WebCore/html/HTMLAnchorElement.cpp
WebCore/html/HTMLButtonElement.cpp
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLFormElement.h
WebCore/html/HTMLInputElement.cpp
WebCore/html/HTMLSelectElement.cpp
WebCore/ksvg2/css/SVGCSSParser.cpp
WebCore/ksvg2/css/SVGCSSStyleSelector.cpp
WebCore/ksvg2/css/SVGRenderStyleDefs.cpp
WebCore/ksvg2/css/SVGRenderStyleDefs.h
WebCore/ksvg2/ksvg.h [deleted file]
WebCore/ksvg2/misc/KCanvasRenderingStyle.cpp
WebCore/ksvg2/svg/SVGDOMImplementation.cpp
WebCore/ksvg2/svg/SVGFEDiffuseLightingElement.cpp
WebCore/ksvg2/svg/SVGHelper.cpp
WebCore/ksvg2/svg/SVGMatrix.cpp
WebCore/ksvg2/svg/SVGPathSeg.h
WebCore/ksvg2/svg/SVGScriptElement.cpp
WebCore/ksvg2/svg/SVGStyledElement.cpp
WebCore/ksvg2/svg/SVGTransform.cpp
WebCore/loader/DocumentLoader.h
WebCore/loader/FrameLoader.h
WebCore/loader/FrameLoaderClient.h
WebCore/loader/NavigationAction.h
WebCore/loader/icon/IconLoader.cpp
WebCore/loader/icon/IconLoader.h
WebCore/loader/loader.cpp
WebCore/loader/mac/DocumentLoaderMac.mm
WebCore/loader/mac/FrameLoaderMac.mm
WebCore/loader/mac/IconLoaderMac.mm
WebCore/loader/mac/LoaderFunctionsMac.mm
WebCore/loader/mac/MainResourceLoaderMac.mm
WebCore/loader/mac/NavigationActionMac.mm
WebCore/loader/mac/ResourceLoaderMac.mm
WebCore/loader/mac/SubresourceLoaderMac.mm
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/FramePrivate.h
WebCore/platform/gdk/FrameGdk.cpp
WebCore/platform/gdk/FrameGdk.h
WebCore/platform/mac/TextFieldMac.mm
WebCore/platform/network/HTTPHeaderMap.h
WebCore/platform/network/ResourceHandle.h
WebCore/platform/network/ResourceHandleClient.h
WebCore/platform/network/ResourceHandleInternal.h
WebCore/platform/network/mac/ResourceHandleMac.mm
WebCore/platform/network/mac/ResourceResponseMac.h
WebCore/platform/network/mac/ResourceResponseMac.mm
WebCore/platform/network/win/ResourceHandleWin.cpp
WebCore/platform/qt/FrameQt.cpp
WebCore/platform/qt/FrameQt.h
WebCore/rendering/RenderLineEdit.cpp
WebCore/rendering/RenderSVGImage.cpp
WebCore/xml/XSLTProcessor.cpp
WebCore/xml/xmlhttprequest.cpp
WebKit/COM/WebFrame.cpp
WebKit/ChangeLog
WebKit/Misc/WebElementDictionary.m
WebKit/WebCoreSupport/WebFrameLoaderClient.h
WebKit/WebCoreSupport/WebFrameLoaderClient.mm
WebKit/WebCoreSupport/WebPageBridge.mm
WebKit/WebView/WebDataSource.mm
WebKit/WebView/WebHTMLView.m
WebKit/WebView/WebPDFView.mm
WebKit/WebView/WebView.mm
WebKit/WebView/WebViewInternal.h

index 95c0098b88db5a9bb66840d85a4e0aae74762f89..5f4e731dbf104a1f54b8565a49634464f4930997 100644 (file)
@@ -1,3 +1,168 @@
+2006-11-04  Darin Adler  <darin@apple.com>
+
+        Reviewed by Maciej.
+
+        - converted more of the loader machinery to work with cross-platform
+          data structures instead of Macintosh-specific ones
+
+          converted most uses of NSURL to KURL and NSEvent to DOM Event in
+          loader classes
+
+          moved download function out of FrameLoader.h to avoid reference to
+          NSURLConnection
+
+          added DOM Event parameters to various functions so that the handlers
+          can use the DOM Event instead of the global "current NSEvent";
+          includes Frame::submitForm, HTMLFormElement::prepareSubmit,
+          HTMLFormElement::submit, FrameLoader::load
+
+          moved the setMainFrame call that hands ownership to the Page
+          into one of the Frame constructors, and removed it from all
+          the clients
+
+          removed const from Event parameter to the urlSelected function
+          (we rarely use const with DOM elements)
+
+          removed some redundant includes and declarations from various
+          header files
+
+          removed NSURL parameter from userAgent function -- if we need it we
+          can add it back, but converting from NSURL to KURL and back is
+          inefficient enough that it's best to have it out for now (since it's
+          been unused for years) -- if we add it back, we can choose an
+          appropriate parameter type that's always inexpensive to pass
+
+          did some basic cleanup in the IconLoader class, including removing
+          an unnecessary loop that added icon data a byte at a time
+
+          renamed safeLoad to load, since it's no different from the other
+          FrameLoader load functions, safety-wise
+
+          fixed some code that was trying to distinguish null frame name from
+          empty string frame name -- both should be handled the same, but callers
+          were doing it by checking for empty and turning it into null (in a way
+          that was causing extra round trips between NSString and WebCore::String)
+
+          corrected all uses of "get" and "post" to be uppercase "GET" and "POST"
+          and got rid of case-insensitive compares of methods
+
+        * WebCore.exp:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/kjs_navigator.cpp:
+        (KJS::Navigator::getValueProperty):
+        * bridge/mac/FrameMac.h:
+        * bridge/mac/FrameMac.mm:
+        (WebCore::FrameMac::submitForm):
+        (WebCore::FrameMac::urlSelected):
+        (WebCore::FrameMac::userAgent):
+        * bridge/mac/FrameViewMac.mm:
+        * bridge/mac/WebCoreAXObject.mm:
+        (-[WebCoreAXObject rendererForView:]):
+        * bridge/mac/WebCorePageBridge.h:
+        * bridge/mac/WebCorePageBridge.mm:
+        * bridge/mac/WebCoreSettings.mm:
+        * bridge/win/FrameWin.cpp:
+        (WebCore::FrameWin::urlSelected):
+        (WebCore::FrameWin::submitForm):
+        * bridge/win/FrameWin.h:
+        * dom/MouseRelatedEvent.cpp:
+        * dom/MouseRelatedEvent.h:
+        * dom/UIEvent.cpp:
+        (WebCore::UIEvent::~UIEvent):
+        * dom/UIEvent.h:
+        * dom/UIEventWithKeyState.h:
+        * dom/XMLTokenizer.cpp:
+        (WebCore::openFunc):
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::defaultEventHandler):
+        * html/HTMLButtonElement.cpp:
+        (WebCore::HTMLButtonElement::defaultEventHandler):
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::submitClick):
+        (WebCore::HTMLFormElement::prepareSubmit):
+        (WebCore::HTMLFormElement::submit):
+        * html/HTMLFormElement.h:
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::defaultEventHandler):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
+        * loader/DocumentLoader.h:
+        * loader/FrameLoader.h:
+        * loader/FrameLoaderClient.h:
+        * loader/NavigationAction.h:
+        (WebCore::NavigationAction::event):
+        * loader/icon/IconLoader.cpp:
+        (WebCore::IconLoader::create):
+        (WebCore::IconLoader::startLoading):
+        (WebCore::IconLoader::didReceiveData):
+        (WebCore::IconLoader::didFinishLoading):
+        * loader/icon/IconLoader.h:
+        * loader/loader.cpp:
+        * loader/mac/DocumentLoaderMac.mm:
+        (WebCore::DocumentLoader::URL):
+        (WebCore::DocumentLoader::unreachableURL):
+        (WebCore::DocumentLoader::replaceRequestURLForAnchorScroll):
+        (WebCore::DocumentLoader::URLForHistory):
+        * loader/mac/FrameLoaderMac.mm:
+        (WebCore::FrameLoader::load):
+        (WebCore::FrameLoader::willSendRequest):
+        (WebCore::FrameLoader::clientRedirected):
+        (WebCore::FrameLoader::shouldReload):
+        (WebCore::FrameLoader::notifyIconChanged):
+        (WebCore::FrameLoader::URL):
+        (WebCore::FrameLoader::reloadAllowingStaleData):
+        (WebCore::FrameLoader::reload):
+        (WebCore::FrameLoader::didChangeTitle):
+        (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
+        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
+        (WebCore::FrameLoader::post):
+        (WebCore::FrameLoader::addExtraFieldsToRequest):
+        (WebCore::FrameLoader::loadResourceSynchronously):
+        * loader/mac/IconLoaderMac.mm:
+        (WebCore::IconLoader::notifyIconChanged):
+        * loader/mac/LoaderFunctionsMac.mm:
+        * loader/mac/MainResourceLoaderMac.mm:
+        (WebCore::shouldLoadAsEmptyDocument):
+        (WebCore::MainResourceLoader::continueAfterContentPolicy):
+        * loader/mac/NavigationActionMac.mm:
+        (WebCore::navigationType):
+        (WebCore::NavigationAction::NavigationAction):
+        * loader/mac/ResourceLoaderMac.mm:
+        * loader/mac/SubresourceLoaderMac.mm:
+        * page/Frame.cpp:
+        (WebCore::Frame::Frame):
+        (WebCore::Frame::urlSelected):
+        (WebCore::Frame::submitFormAgain):
+        (WebCore::Frame::submitForm):
+        (WebCore::Frame::endIfNotLoading):
+        (WebCore::Frame::hitTestResultAtPoint):
+        * page/Frame.h:
+        * page/FramePrivate.h:
+        * platform/gdk/FrameGdk.cpp:
+        (WebCore::FrameGdk::FrameGdk):
+        (WebCore::FrameGdk::submitForm):
+        (WebCore::FrameGdk::urlSelected):
+        * platform/gdk/FrameGdk.h:
+        * platform/mac/TextFieldMac.mm:
+        * platform/network/HTTPHeaderMap.h:
+        * platform/network/ResourceHandle.h:
+        * platform/network/ResourceHandleClient.h:
+        * platform/network/ResourceHandleInternal.h:
+        * platform/network/mac/ResourceHandleMac.mm:
+        * platform/network/mac/ResourceResponseMac.h:
+        * platform/network/mac/ResourceResponseMac.mm:
+        (-[NSURLResponse WebCore]):
+        * platform/network/win/ResourceHandleWin.cpp:
+        * platform/qt/FrameQt.cpp:
+        (WebCore::FrameQt::submitForm):
+        (WebCore::FrameQt::urlSelected):
+        * platform/qt/FrameQt.h:
+        * rendering/RenderLineEdit.cpp:
+        (WebCore::RenderLineEdit::returnPressed):
+        * xml/XSLTProcessor.cpp:
+        (WebCore::docLoaderFunc):
+        * xml/xmlhttprequest.cpp:
+
 2006-11-03  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Adele.
index 98cdfc99e79732d06f21b8513c2c91561bac56ec..d53fe571a4959884c8478f02aaff8214335be1a1 100644 (file)
@@ -130,10 +130,13 @@ _WebCoreSetShouldUseFontSmoothing
 _WebCoreShouldUseFontSmoothing
 _WebCoreTextFloatWidth
 __Z26ReportBlockedObjCExceptionP11NSException
+__ZN7WebCore10EventNames10clickEventE
+__ZN7WebCore10EventNames12keydownEventE
+__ZN7WebCore10MouseEventC1ERKNS_12AtomicStringEbbPNS_9DOMWindowEiiiiibbbbtPNS_15EventTargetNodeEPNS_9ClipboardEb
 __ZN7WebCore10StringImplD1Ev
 __ZN7WebCore11FrameLoader11stopLoadingEP7NSError
 __ZN7WebCore11FrameLoader11stopLoadingEv
-__ZN7WebCore11FrameLoader12shouldReloadEP5NSURLS2_
+__ZN7WebCore11FrameLoader12shouldReloadERKNS_4KURLES3_
 __ZN7WebCore11FrameLoader14detachChildrenEv
 __ZN7WebCore11FrameLoader16detachFromParentEv
 __ZN7WebCore11FrameLoader19requestFromDelegateEP12NSURLRequestRP11objc_objectRP7NSError
@@ -148,12 +151,12 @@ __ZN7WebCore11FrameLoader29sendRemainingDelegateMessagesEP11objc_objectP13NSURLR
 __ZN7WebCore11FrameLoader4loadEP12NSURLRequest
 __ZN7WebCore11FrameLoader4loadEP12NSURLRequestRKNS_16NavigationActionENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE
 __ZN7WebCore11FrameLoader4loadEP12NSURLRequestRKNS_6StringE
-__ZN7WebCore11FrameLoader4loadEP5NSURLRKNS_6StringENS_13FrameLoadTypeES5_P7NSEventPNS_7ElementERKN3WTF7HashMapIS3_S3_NSB_7StrHashIS3_EENSB_10HashTraitsIS3_EESG_EE
 __ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE
 __ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderENS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE
+__ZN7WebCore11FrameLoader4loadERKNS_4KURLEPNS_5EventE
+__ZN7WebCore11FrameLoader4loadERKNS_4KURLERKNS_6StringENS_13FrameLoadTypeES6_PNS_5EventEPNS_7ElementERKN3WTF7HashMapIS4_S4_NSC_7StrHashIS4_EENSC_10HashTraitsIS4_EESH_EE
 __ZN7WebCore11FrameLoader6reloadEv
 __ZN7WebCore11FrameLoader7canLoadEP5NSURLRKNS_6StringERb
-__ZN7WebCore11FrameLoader8safeLoadEP5NSURL
 __ZN7WebCore11FrameLoader9setClientEPNS_17FrameLoaderClientE
 __ZN7WebCore11RenderLayer18gAlignCenterAlwaysE
 __ZN7WebCore11selectRangeEPNS_19SelectionControllerEPNS_5RangeENS_9EAffinityEb
@@ -162,12 +165,13 @@ __ZN7WebCore13HitTestResultC1ERKNS_8IntPointE
 __ZN7WebCore13HitTestResultC1ERKS0_
 __ZN7WebCore13HitTestResultD1Ev
 __ZN7WebCore13HitTestResultaSERKS0_
+__ZN7WebCore13KeyboardEventC1ERKNS_12AtomicStringEbbPNS_9DOMWindowERKNS_6StringEjbbbbb
 __ZN7WebCore14DocumentLoader12setCommittedEb
 __ZN7WebCore14DocumentLoader13attachToFrameEv
 __ZN7WebCore14DocumentLoader15detachFromFrameEv
 __ZN7WebCore14DocumentLoader19prepareForLoadStartEv
 __ZN7WebCore14DocumentLoader19setOverrideEncodingERKNS_6StringE
-__ZN7WebCore14DocumentLoader32replaceRequestURLForAnchorScrollEP5NSURL
+__ZN7WebCore14DocumentLoader32replaceRequestURLForAnchorScrollERKNS_4KURLE
 __ZN7WebCore14DocumentLoader7requestEv
 __ZN7WebCore14DocumentLoaderC2EP12NSURLRequest
 __ZN7WebCore14DocumentLoaderD2Ev
@@ -188,6 +192,7 @@ __ZN7WebCore16NavigationActionC1Ev
 __ZN7WebCore17FrameLoaderClientD2Ev
 __ZN7WebCore19SelectionController5clearEv
 __ZN7WebCore19SelectionController9selectAllEv
+__ZN7WebCore21PlatformKeyboardEventC1EP7NSEventb
 __ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE
 __ZN7WebCore26NetscapePlugInStreamLoader6createEPNS_5FrameEP11objc_object
 __ZN7WebCore4KURLC1EP5NSURL
@@ -293,10 +298,10 @@ __ZNK7WebCore12AtomicString16deprecatedStringEv
 __ZNK7WebCore12RenderObject25backslashAsCurrencySymbolEv
 __ZNK7WebCore13HitTestResult10isSelectedEv
 __ZNK7WebCore13HitTestResult11boundingBoxEv
-__ZNK7WebCore13HitTestResult15spellingToolTipEv
 __ZNK7WebCore13HitTestResult11targetFrameEv
 __ZNK7WebCore13HitTestResult11textContentEv
 __ZNK7WebCore13HitTestResult15absoluteLinkURLEv
+__ZNK7WebCore13HitTestResult15spellingToolTipEv
 __ZNK7WebCore13HitTestResult16absoluteImageURLEv
 __ZNK7WebCore13HitTestResult16altDisplayStringEv
 __ZNK7WebCore13HitTestResult18titleDisplayStringEv
index 889235c829120bde8345b84de5abdc04414c3575..950ba346193e8fd53ebeb101dbb9e4f56ddec068 100644 (file)
                85031B3F0A44EFC700F992E0 /* ClipboardEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B290A44EFC700F992E0 /* ClipboardEvent.cpp */; };
                85031B400A44EFC700F992E0 /* ClipboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B2A0A44EFC700F992E0 /* ClipboardEvent.h */; };
                85031B410A44EFC700F992E0 /* Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B2B0A44EFC700F992E0 /* Event.cpp */; };
-               85031B420A44EFC700F992E0 /* Event.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B2C0A44EFC700F992E0 /* Event.h */; };
+               85031B420A44EFC700F992E0 /* Event.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B2C0A44EFC700F992E0 /* Event.h */; settings = {ATTRIBUTES = (Private, ); }; };
                85031B430A44EFC700F992E0 /* KeyboardEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B2D0A44EFC700F992E0 /* KeyboardEvent.cpp */; };
-               85031B440A44EFC700F992E0 /* KeyboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B2E0A44EFC700F992E0 /* KeyboardEvent.h */; };
+               85031B440A44EFC700F992E0 /* KeyboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B2E0A44EFC700F992E0 /* KeyboardEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
                85031B450A44EFC700F992E0 /* MouseEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B2F0A44EFC700F992E0 /* MouseEvent.cpp */; };
-               85031B460A44EFC700F992E0 /* MouseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B300A44EFC700F992E0 /* MouseEvent.h */; };
+               85031B460A44EFC700F992E0 /* MouseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B300A44EFC700F992E0 /* MouseEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
                85031B470A44EFC700F992E0 /* MouseRelatedEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B310A44EFC700F992E0 /* MouseRelatedEvent.cpp */; };
-               85031B480A44EFC700F992E0 /* MouseRelatedEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B320A44EFC700F992E0 /* MouseRelatedEvent.h */; };
+               85031B480A44EFC700F992E0 /* MouseRelatedEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B320A44EFC700F992E0 /* MouseRelatedEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
                85031B490A44EFC700F992E0 /* MutationEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B330A44EFC700F992E0 /* MutationEvent.cpp */; };
                85031B4A0A44EFC700F992E0 /* MutationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B340A44EFC700F992E0 /* MutationEvent.h */; };
                85031B4B0A44EFC700F992E0 /* RegisteredEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B350A44EFC700F992E0 /* RegisteredEventListener.cpp */; };
                85031B4C0A44EFC700F992E0 /* RegisteredEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B360A44EFC700F992E0 /* RegisteredEventListener.h */; };
                85031B4D0A44EFC700F992E0 /* UIEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B370A44EFC700F992E0 /* UIEvent.cpp */; };
-               85031B4E0A44EFC700F992E0 /* UIEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B380A44EFC700F992E0 /* UIEvent.h */; };
-               85031B4F0A44EFC700F992E0 /* UIEventWithKeyState.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */; };
+               85031B4E0A44EFC700F992E0 /* UIEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B380A44EFC700F992E0 /* UIEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               85031B4F0A44EFC700F992E0 /* UIEventWithKeyState.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */; settings = {ATTRIBUTES = (Private, ); }; };
                85031B500A44EFC700F992E0 /* WheelEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B3A0A44EFC700F992E0 /* WheelEvent.cpp */; };
                85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B3B0A44EFC700F992E0 /* WheelEvent.h */; };
                85032DD70AA8C9BE007D3B7D /* DOMCSSCharsetRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 85032DC30AA8C9BE007D3B7D /* DOMCSSCharsetRule.h */; };
                935C475F09AC4CAE00A6AAB4 /* HistoryMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935C475E09AC4CAE00A6AAB4 /* HistoryMac.mm */; };
                935C476109AC4CD100A6AAB4 /* Length.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476009AC4CD100A6AAB4 /* Length.h */; settings = {ATTRIBUTES = (Private, ); }; };
                935C476309AC4CE600A6AAB4 /* MouseEventWithHitTestResults.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476209AC4CE600A6AAB4 /* MouseEventWithHitTestResults.h */; };
-               935C476809AC4D4300A6AAB4 /* PlatformKeyboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476609AC4D4300A6AAB4 /* PlatformKeyboardEvent.h */; };
+               935C476809AC4D4300A6AAB4 /* PlatformKeyboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476609AC4D4300A6AAB4 /* PlatformKeyboardEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
                935C476909AC4D4300A6AAB4 /* PlatformMouseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476709AC4D4300A6AAB4 /* PlatformMouseEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
                935C476B09AC4D4F00A6AAB4 /* PlatformWheelEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476A09AC4D4F00A6AAB4 /* PlatformWheelEvent.h */; };
                935C476D09AC4D6300A6AAB4 /* FoundationExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476C09AC4D6300A6AAB4 /* FoundationExtras.h */; };
                9392F1500AD1862300691BD4 /* CounterNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9392F14F0AD1862300691BD4 /* CounterNode.cpp */; };
                9392F1520AD1862B00691BD4 /* CounterListItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 9392F1510AD1862B00691BD4 /* CounterListItem.h */; };
                939885C308B7E3D100E707C4 /* EventNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 939885C108B7E3D100E707C4 /* EventNames.cpp */; };
-               939885C408B7E3D100E707C4 /* EventNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 939885C208B7E3D100E707C4 /* EventNames.h */; };
+               939885C408B7E3D100E707C4 /* EventNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 939885C208B7E3D100E707C4 /* EventNames.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93A1EAA00A5634C9006960A0 /* ImageDocumentMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93A1EA9F0A5634C9006960A0 /* ImageDocumentMac.mm */; };
                93A1EAA80A563508006960A0 /* ImageDocumentMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 93A1EAA70A563508006960A0 /* ImageDocumentMac.h */; };
                93AC8DE10A955FAC00239794 /* TextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AC8DE00A955FAC00239794 /* TextStyle.h */; };
                A88AD50A095248F0001DD196 /* SVGViewElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F8EA089701F400BA5114 /* SVGViewElement.h */; };
                A88AD50B095248F0001DD196 /* SVGZoomAndPan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F8EB089701F400BA5114 /* SVGZoomAndPan.cpp */; };
                A88AD50C095248F0001DD196 /* SVGZoomAndPan.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F8EC089701F400BA5114 /* SVGZoomAndPan.h */; };
-               A88AD50D095248F0001DD196 /* ksvg.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C0F8ED089701F400BA5114 /* ksvg.h */; };
                A88AD52F09524B92001DD196 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */; };
                A88AD5AA09525131001DD196 /* SVGCSSStyleSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F6FB089701F100BA5114 /* SVGCSSStyleSelector.cpp */; };
                A8C4A7FD09D563270003AC8D /* StyledElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C4A7EB09D563270003AC8D /* StyledElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A8C0F8EA089701F400BA5114 /* SVGViewElement.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGViewElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0F8EB089701F400BA5114 /* SVGZoomAndPan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGZoomAndPan.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0F8EC089701F400BA5114 /* SVGZoomAndPan.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SVGZoomAndPan.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               A8C0F8ED089701F400BA5114 /* ksvg.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = ksvg.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB54089701F700BA5114 /* KRenderingDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRenderingDevice.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB55089701F700BA5114 /* KRenderingDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KRenderingDevice.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                A8C0FB5B089701F700BA5114 /* KRenderingPaintServer.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KRenderingPaintServer.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                A8C0F7F1089701F300BA5114 /* events */,
                                A8C0F6EA089701F100BA5114 /* misc */,
                                A8C0F7FC089701F300BA5114 /* svg */,
-                               A8C0F8ED089701F400BA5114 /* ksvg.h */,
                        );
                        path = ksvg2;
                        sourceTree = "<group>";
                                A88AD508095248F0001DD196 /* SVGUseElement.h in Headers */,
                                A88AD50A095248F0001DD196 /* SVGViewElement.h in Headers */,
                                A88AD50C095248F0001DD196 /* SVGZoomAndPan.h in Headers */,
-                               A88AD50D095248F0001DD196 /* ksvg.h in Headers */,
                                6552E7AA096AA11B0006F248 /* WebCoreFrameNamespaces.h in Headers */,
                                A81655E5096BC13900601058 /* SVGMaskElement.h in Headers */,
                                A81369CA097374F600D74463 /* HTMLIsIndexElement.h in Headers */,
index 84ed5bc868ce4e89e4e96b2dfe74eba8f1922031..734567ebb3b8cab5a47c252e75fd52c81f17179e 100644 (file)
@@ -161,17 +161,18 @@ bool Navigator::getOwnPropertySlot(ExecState *exec, const Identifier& propertyNa
   return getStaticPropertySlot<NavigatorFunc, Navigator, JSObject>(exec, &NavigatorTable, this, propertyName, slot);
 }
 
-JSValue *Navigator::getValueProperty(ExecState *exec, int token) const
+JSValue* Navigator::getValueProperty(ExecState* exec, int token) const
 {
-  String userAgent = m_frame->userAgent();
   switch (token) {
   case AppCodeName:
     return jsString("Mozilla");
   case AppName:
     return jsString("Netscape");
-  case AppVersion:
-    // We assume the string is something like Mozilla/version (properties)
+  case AppVersion: {
+    // Version is everything in the user agent string past the "Mozilla/" prefix.
+    const String userAgent = m_frame->userAgent();
     return jsString(userAgent.substring(userAgent.find('/') + 1));
+  }
   case Product:
     return jsString("Gecko");
   case ProductSub:
@@ -183,7 +184,7 @@ JSValue *Navigator::getValueProperty(ExecState *exec, int token) const
   case Language:
     return jsString(defaultLanguage());
   case UserAgent:
-    return jsString(userAgent);
+    return jsString(m_frame->userAgent());
   case Platform:
     return jsString(WEBCORE_NAVIGATOR_PLATFORM);
   case _Plugins:
index f4940e41c1fef09b0a48087562a662670f902ce8..10e36280bcdf76ad45dab680899adff539af9e07 100644 (file)
@@ -97,9 +97,9 @@ public:
     ~FrameMac();
 
     // FIXME: Merge these and move them into FrameLoader.
-    virtual void urlSelected(const FrameLoadRequest&, const Event* triggeringEvent);
+    virtual void urlSelected(const FrameLoadRequest&, Event*);
     virtual Frame* createFrame(const KURL&, const String& name, Element* ownerElement, const String& referrer);
-    virtual void submitForm(const FrameLoadRequest&);
+    virtual void submitForm(const FrameLoadRequest&, Event*);
 
     virtual Plugin* createPlugin(Element*, const KURL&,
         const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType);
index ad3af2b92bf9dd1a604bc2b408360024e0688b60..fdc64f245b4c3d828c8d848c35c07fbb24914221 100644 (file)
@@ -36,7 +36,6 @@
 #import "ClipboardMac.h"
 #import "Cursor.h"
 #import "DOMInternal.h"
-#import "DOMWindow.h"
 #import "DocumentLoader.h"
 #import "Event.h"
 #import "EventNames.h"
@@ -188,7 +187,7 @@ FrameMac::~FrameMac()
 
 #pragma mark BEGIN LOADING FUNCTIONS
 
-void FrameMac::submitForm(const FrameLoadRequest& request)
+void FrameMac::submitForm(const FrameLoadRequest& request, Event* event)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
@@ -216,7 +215,7 @@ void FrameMac::submitForm(const FrameLoadRequest& request)
         d->m_submittedFormURL = request.resourceRequest().url();
     }
 
-    loader()->load(request, true, _currentEvent,
+    loader()->load(request, true, event,
         d->m_formAboutToBeSubmitted.get(), d->m_formValuesAboutToBeSubmitted);
 
     clearRecordedFormValues();
@@ -224,14 +223,14 @@ void FrameMac::submitForm(const FrameLoadRequest& request)
     END_BLOCK_OBJC_EXCEPTIONS;
 }
 
-void FrameMac::urlSelected(const FrameLoadRequest& request, const Event* /*triggeringEvent*/)
+void FrameMac::urlSelected(const FrameLoadRequest& request, Event* event)
 {
     FrameLoadRequest copy = request;
     if (copy.resourceRequest().httpReferrer().isEmpty())
         copy.resourceRequest().setHTTPReferrer(referrer());
 
     // FIXME: How do we know that userGesture is always true?
-    loader()->load(copy, true, _currentEvent, 0, HashMap<String, String>());
+    loader()->load(copy, true, event, 0, HashMap<String, String>());
 }
 
 Frame* FrameMac::createFrame(const KURL& url, const String& name, Element* ownerElement, const String& referrer)
@@ -806,7 +805,7 @@ void FrameMac::stopRedirectionTimer()
 
 String FrameMac::userAgent() const
 {
-    return loader()->client()->userAgent(url().getNSURL());
+    return loader()->client()->userAgent();
 }
 
 String FrameMac::mimeTypeForFileName(const String& fileName) const
index 5e2dc56459d8e7fe0062a915ec48e84b75adf25e..9c725979869f7f9c8db1ee956880a695c756db9d 100644 (file)
@@ -26,8 +26,8 @@
 #import "config.h"
 #import "FrameView.h"
 
-#import "Document.h"
 #import "BlockExceptions.h"
+#import "Document.h"
 #import "FrameMac.h"
 #import "MouseEventWithHitTestResults.h"
 #import "PlatformScrollBar.h"
index 433ed4d203a0e32e4eeaaf3a07cdd387f0ca3182..b1e995dcbe28cc91ec58ae26d453772deec63985 100644 (file)
@@ -2317,7 +2317,7 @@ static VisiblePosition endOfStyleRange (const VisiblePosition visiblePos)
     return NSAccessibilityUnignoredAncestor(obj->document()->axObjectCache()->get(obj));
 }
 
-- (RenderObject*) rendererForView:(NSView*)view
+- (RenderObject*)rendererForView:(NSView*)view
 {
     // check for WebCore NSView that lets us find its widget
     Frame* frame = m_renderer->document()->frame();
index c8a7700b39264b85545fbef0fddf3a2f4c598070..461fe9730d4ce25fbad0a1bf059fa710dc0fdea2 100644 (file)
@@ -51,8 +51,6 @@ class WebCoreFrameBridge;
 - (id)initWithChromeClient:(PassRefPtr<WebCore::ChromeClient>)chromeClient;
 - (void)close;
 
-- (void)setMainFrame:(WebCoreFrameBridge *)mainFrame;
-
 - (WebCoreFrameBridge *)mainFrame;
 
 - (void)setGroupName:(NSString *)groupName;
index 8f9aa76c56069c26c7dfe3ce6c8d78113bfc4a77..06f68f4e490d2908f9e87a5afa038c2bcdd6a2a3 100644 (file)
@@ -79,12 +79,6 @@ static void initializeLoggingChannelsIfNecessary()
     return self;
 }
 
-- (void)setMainFrame:(WebCoreFrameBridge *)mainFrame
-{
-    if (_page)
-        _page->setMainFrame(adoptRef([mainFrame _frame]));
-}
-
 - (void)dealloc
 {
     ASSERT(_closed);
index 021241d7ab70d744f99fbd9bf986fa126cf6244f..f4250e66b854d63e46aaed7e3fe9029a92d23062 100644 (file)
@@ -27,9 +27,8 @@
 #import "config.h"
 #import "WebCoreSettings.h"
 
-#import "Settings.h"
 #import "Page.h"
-#import "WebCoreFrameBridge.h"
+#import "Settings.h"
 
 using namespace WebCore;
 
index d5c37afdb2949e5f648b9526f0ebaba0a28d64e5..38a886515eb025fd927e45ee505bec8748637e3f 100644 (file)
@@ -62,13 +62,13 @@ FrameWin::~FrameWin()
     clearRecordedFormValues();    
 }
 
-void FrameWin::urlSelected(const FrameLoadRequest& request, const Event* /*triggeringEvent*/)
+void FrameWin::urlSelected(const FrameLoadRequest& request, Event* /*triggeringEvent*/)
 {
     if (m_client)
         m_client->openURL(request.resourceRequest().url().url(), request.lockHistory());
 }
 
-void FrameWin::submitForm(const FrameLoadRequest& request)
+void FrameWin::submitForm(const FrameLoadRequest& request, Event*)
 {
     // FIXME: this is a hack inherited from FrameMac, and should be pushed into Frame
     const ResourceRequest& resourceRequest = request.resourceRequest();
index 42615c5ab23363d84267fde05753d79f844c14d5..39856ec483985262c39b44504a42c36df812956a 100644 (file)
@@ -49,8 +49,8 @@ public:
     ~FrameWin();
 
     virtual void createNewWindow(const FrameLoadRequest&, const WindowFeatures&, Frame*& part);
-    virtual void submitForm(const FrameLoadRequest&);
-    virtual void urlSelected(const FrameLoadRequest&, const Event* triggeringEvent);
+    virtual void submitForm(const FrameLoadRequest&, Event*);
+    virtual void urlSelected(const FrameLoadRequest&, Event*);
 
     virtual void setTitle(const String&);
     virtual void setStatusBarText(const String&);
index 4451988d13586d884d6717a9005b5fa8af6f8c81..7dd546058800abfc67b6da078709234d3d3d7061 100644 (file)
@@ -25,7 +25,7 @@
 #include "config.h"
 #include "MouseRelatedEvent.h"
 
-#include "AtomicString.h"
+#include "DOMWindow.h"
 #include "Document.h"
 #include "Frame.h"
 #include "Node.h"
index 051bd0cb3005ab3a9faa71c39f439316e6f2e740..5e1af4a74e395bce58688a9586158243e04668ea 100644 (file)
 #ifndef MouseRelatedEvent_h
 #define MouseRelatedEvent_h
 
-#include "AtomicString.h"
-#include "DOMWindow.h"
 #include "UIEventWithKeyState.h"
 
 namespace WebCore {
 
-    typedef DOMWindow AbstractView;
-
     // Internal only: Helper class for what's common between mouse and wheel events.
     class MouseRelatedEvent : public UIEventWithKeyState {
     public:
index e0ee54344f761e507ec31b7e0cac3dbf36d78f7f..ee2540c49c198b292f20dad4378d1981d801ff0d 100644 (file)
  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+
 #include "config.h"
 #include "UIEvent.h"
 
-#include "AtomicString.h"
+#include "DOMWindow.h"
 
 namespace WebCore {
 
@@ -40,6 +41,10 @@ UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelab
 {
 }
 
+UIEvent::~UIEvent()
+{
+}
+
 void UIEvent::initUIEvent(const AtomicString& typeArg, bool canBubbleArg, bool cancelableArg, AbstractView* viewArg, int detailArg)
 {
     if (dispatched())
index d85a62f5d9ecad8dabdd2d27ab1b87d2da69f62e..5d8a14c40e2ab4564f562e7e9c3f2d8b9be4dc8b 100644 (file)
 #ifndef UIEvent_h
 #define UIEvent_h
 
-#include "AtomicString.h"
-#include "DOMWindow.h"
 #include "Event.h"
 
 namespace WebCore {
 
+    class DOMWindow;
+
     typedef DOMWindow AbstractView;
 
     class UIEvent : public Event {
     public:
         UIEvent();
         UIEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, int detail);
+        virtual ~UIEvent();
 
         void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, int detail);
 
index 86415a6e152688b72ac13c0f97e3d23723d09d91..df08120a2b4325fb445d1a685bd8f61f33fdce8a 100644 (file)
 #ifndef UIEventWithKeyState_h
 #define UIEventWithKeyState_h
 
-#include "AtomicString.h"
-#include "DOMWindow.h"
 #include "UIEvent.h"
 
 namespace WebCore {
     
-    typedef DOMWindow AbstractView;
-
     class UIEventWithKeyState : public UIEvent {
     public:
         UIEventWithKeyState()
index ef79cecec9f9834114a03dc3529ecb9037bab770..92b01e4beeac852f98becd8f5c79f68344ba8d49 100644 (file)
@@ -42,6 +42,7 @@
 #include "LoaderFunctions.h"
 #include "ProcessingInstruction.h"
 #include "ResourceHandle.h"
+#include "ResourceRequest.h"
 #include "ResourceResponse.h"
 #include <libxml/parser.h>
 #include <libxml/parserInternals.h>
@@ -458,10 +459,8 @@ static void* openFunc(const char* uri)
     if (!globalDocLoader || !shouldAllowExternalLoad(uri))
         return &globalDescriptor;
 
-    KURL kurl(uri);
-    ResourceRequest request(kurl);
     ResourceResponse response;
-    Vector<char> data = ServeSynchronousRequest(cache()->loader(), globalDocLoader, request, response);
+    Vector<char> data = ServeSynchronousRequest(cache()->loader(), globalDocLoader, KURL(uri), response);
     
     return new OffsetBuffer(data);
 }
index 54aa586402090cd8004652b1b6ff63fc5f258969..bcdab65beefefdfa728989e9dc711b162dac3859 100644 (file)
@@ -115,7 +115,7 @@ bool HTMLAnchorElement::isKeyboardFocusable() const
     return document()->frame()->tabsToLinks();
 }
 
-void HTMLAnchorElement::defaultEventHandler(Event *evt)
+void HTMLAnchorElement::defaultEventHandler(Eventevt)
 {
     // React on clicks and on keypresses.
     // Don't make this KEYUP_EVENT again, it makes khtml follow links it shouldn't,
@@ -140,7 +140,7 @@ void HTMLAnchorElement::defaultEventHandler(Event *evt)
             if (document()->frame() && document()->frame()->settings())
                 editableLinkBehavior = document()->frame()->settings()->editableLinkBehavior();
                 
-            switch(editableLinkBehavior) {
+            switch (editableLinkBehavior) {
                 // Always follow the link (Safari 2.0 behavior)
                 default:
                 case Settings::EditableLinkDefaultBehavior:
index 6488d92283c2f9d3943844f6e46004f92f6ae2cc..d00811c5857ae643e1f61cd6e9ddda8994525375 100644 (file)
@@ -88,7 +88,7 @@ void HTMLButtonElement::defaultEventHandler(Event *evt)
     if (m_type != BUTTON && (evt->type() == DOMActivateEvent) && !disabled()) {
         if (form() && m_type == SUBMIT) {
             m_activeSubmit = true;
-            form()->prepareSubmit();
+            form()->prepareSubmit(evt);
             m_activeSubmit = false; // in case we were canceled
         }
         if (form() && m_type == RESET)
index c6e61d45aa0b3c6593956c32903ac117efcd8cd0..4fde5b0eca8086fe75bbe92925a72dd40b9cee6d 100644 (file)
@@ -124,7 +124,7 @@ Node* HTMLFormElement::item(unsigned index)
     return elements()->item(index);
 }
 
-void HTMLFormElement::submitClick()
+void HTMLFormElement::submitClick(Event* event)
 {
     bool submitFound = false;
     for (unsigned i = 0; i < formElements.size(); ++i) {
@@ -138,7 +138,7 @@ void HTMLFormElement::submitClick()
         }
     }
     if (!submitFound) // submit the form without a submit or image input
-        prepareSubmit();
+        prepareSubmit(event);
 }
 
 static DeprecatedCString encodeCString(const CString& cstr)
@@ -305,9 +305,9 @@ void HTMLFormElement::setBoundary( const String& bound )
     m_boundary = bound;
 }
 
-bool HTMLFormElement::prepareSubmit()
+bool HTMLFormElement::prepareSubmit(Event* event)
 {
-    Frame *frame = document()->frame();
+    Frameframe = document()->frame();
     if (m_insubmit || !frame)
         return m_insubmit;
 
@@ -320,19 +320,24 @@ bool HTMLFormElement::prepareSubmit()
     m_insubmit = false;
 
     if (m_doingsubmit)
-        submit(true);
+        submit(event, true);
 
     return m_doingsubmit;
 }
 
-void HTMLFormElement::submit(bool activateSubmitButton)
+void HTMLFormElement::submit()
+{
+    submit(0, false);
+}
+
+void HTMLFormElement::submit(Event* event, bool activateSubmitButton)
 {
     FrameView *view = document()->view();
     Frame *frame = document()->frame();
     if (!view || !frame)
         return;
 
-    if ( m_insubmit ) {
+    if (m_insubmit) {
         m_doingsubmit = true;
         return;
     }
@@ -370,9 +375,9 @@ void HTMLFormElement::submit(bool activateSubmitButton)
     FormData postData;
     if (formData(postData)) {
         if (m_post)
-            frame->submitForm("post", m_url, postData, m_target, enctype(), boundary());
+            frame->submitForm("POST", m_url, postData, m_target, enctype(), boundary(), event);
         else
-            frame->submitForm("get", m_url, postData, m_target);
+            frame->submitForm("GET", m_url, postData, m_target, String(), String(), event);
     }
 
     if (needButtonActivation && firstSuccessfulSubmitButton)
index 2e025e736bed4b5d13a8b6c0dcb66f8742a0553e..22f3ebe9ee56ce1c19d1cd2b80b68d2fd9886b78 100644 (file)
@@ -31,6 +31,7 @@
 
 namespace WebCore {
 
+class Event;
 class FormData;
 class HTMLGenericFormElement;
 class HTMLImageElement;
@@ -70,8 +71,9 @@ public:
     void registerImgElement(HTMLImageElement*);
     void removeImgElement(HTMLImageElement*);
 
-    bool prepareSubmit();
-    void submit(bool activateSubmitButton = false);
+    bool prepareSubmit(Event*);
+    void submit();
+    void submit(Event*, bool activateSubmitButton = false);
     void reset();
 
     void setMalformed(bool malformed) { m_malformed = malformed; }
@@ -82,7 +84,7 @@ public:
 
     virtual bool isURLAttribute(Attribute*) const;
     
-    void submitClick();
+    void submitClick(Event*);
     bool formWouldHaveSecureSubmission(const String& url);
 
     String name() const;
index 0becb203f8f30885189f31522d1237f3474a6522..cfad4483aa8b40a8ffc6f19014366fe79f92ebad 100644 (file)
@@ -1249,7 +1249,7 @@ void HTMLInputElement::defaultEventHandler(Event *evt)
                 form()->reset();
             else {
                 m_activeSubmit = true;
-                if (!form()->prepareSubmit()) {
+                if (!form()->prepareSubmit(evt)) {
                     xPos = 0;
                     yPos = 0;
                 }
@@ -1371,7 +1371,7 @@ void HTMLInputElement::defaultEventHandler(Event *evt)
                 blur();
                 // Make sure the form hasn't been destroyed during the blur.
                 if (form())
-                    form()->submitClick();
+                    form()->submitClick(evt);
             }
             evt->setDefaultHandled();
         }
index 1e4216b0cbd8db97f07566b2f5d6998af23a5949..b02cf92a250131cd69d77f23a163912b3b00d912 100644 (file)
@@ -564,7 +564,7 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* evt)
             blur();
             // Make sure the form hasn't been destroyed during the blur.
             if (form())
-                form()->submitClick();
+                form()->submitClick(evt);
             handled = true;
         }
         if ((keyIdentifier == "Down" || keyIdentifier == "Up" || keyIdentifier == "U+000020") && renderer() && usesMenuList()) {
index 6bfafb7c93835ca0dae8876eecd851a86835e0d3..d57888240f2657778cd0d629be4e1d2cbe206929 100644 (file)
@@ -24,8 +24,6 @@
 #include "config.h"
 #ifdef SVG_SUPPORT
 
-#include "ksvg.h"
-
 #include "SVGPaint.h"
 #include "CSSInheritedValue.h"
 #include "CSSInitialValue.h"
index 83b53f840ef3ecdf1c201c6aa597a42e88f2c625..63d4cf1b164dfd83a84e34702f4350757ad0bccb 100644 (file)
@@ -39,7 +39,6 @@
 #include "SVGStyledElement.h"
 #include "CSSValueKeywords.h"
 #include "CSSValueList.h"
-#include "ksvg.h"
 #include "ksvgcssvalues.h"
 #include "ksvgcssproperties.h"
 #include <stdlib.h>
index 1ef6de92484b92f64cdbed857764f9de98a5bb3f..f3cb57278967a03ab61cb3c365206cf2742ebc60 100644 (file)
 
 #include "config.h"
 #ifdef SVG_SUPPORT
-#include "ksvg.h"
+#include "SVGRenderStyleDefs.h"
+
 #include "RenderStyle.h"
 #include "SVGRenderStyle.h"
-#include "SVGRenderStyleDefs.h"
 
 using namespace WebCore;
 
index 303802ce2fe1b33668eb03ff81dbab2a6cdc1797..5bd0765ba5e95c858e97765a45e83821d1715c5a 100644 (file)
 #define SVGRenderStyleDefs_H
 #ifdef SVG_SUPPORT
 
+#include "Color.h"
 #include "Path.h"
+#include "PlatformString.h"
+#include "Shared.h"
+#include <wtf/RefPtr.h>
 
 // Helper macros for 'SVGRenderStyle'
 #define SVG_RS_DEFINE_ATTRIBUTE(Data, Type, Name, Initial) \
diff --git a/WebCore/ksvg2/ksvg.h b/WebCore/ksvg2/ksvg.h
deleted file mode 100644 (file)
index 348db04..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
-                  2004, 2005 Rob Buis <buis@kde.org>
-
-    This file is part of the KDE project
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-    Boston, MA 02111-1307, USA.
-*/
-
-#ifndef KSVG_H
-#define KSVG_H
-#ifdef SVG_SUPPORT
-
-#include "SVGException.h"
-
-/**
- * @short General namespace specific definitions.
- */
-namespace WebCore {
-    /**
-     * All SVG constants
-     */
-    enum SVGCSSRuleType {
-        COLOR_PROFILE_RULE = 7
-    };
-
-    enum SVGTextPathMethodType {
-        TEXTPATH_METHODTYPE_UNKNOWN    = 0,
-        TEXTPATH_METHODTYPE_ALIGN      = 1,
-        TEXTPATH_METHODTYPE_STRETCH    = 2
-    };
-
-    enum SVGTextPathSpacingType {
-        TEXTPATH_SPACINGTYPE_UNKNOWN    = 0,
-        TEXTPATH_SPACINGTYPE_AUTO       = 1,
-        TEXTPATH_SPACINGTYPE_EXACT      = 2
-    };
-
-    enum SVGEdgeModes {
-        SVG_EDGEMODE_UNKNOWN   = 0,
-        SVG_EDGEMODE_DUPLICATE = 1,
-        SVG_EDGEMODE_WRAP      = 2,
-        SVG_EDGEMODE_NONE      = 3
-    };
-
-    enum SVGMorphologyOperators {
-        SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0,
-        SVG_MORPHOLOGY_OPERATOR_ERODE   = 1,
-        SVG_MORPHOLOGY_OPERATOR_DILATE  = 2
-    };
-
-} // namespace WebCore
-
-#endif // SVG_SUPPORT
-#endif // KSVG_H
-
-// vim:ts=4:noet
index 6c351d45acaf0a8f8d857989ad027e6eb19a25b1..bafc5df3d4f3d49371acb4d8c72a9dd19eac2aab 100644 (file)
@@ -35,7 +35,6 @@
 #include "SVGLength.h"
 #include "SVGRenderStyle.h"
 #include "SVGStyledElement.h"
-#include "ksvg.h"
 
 #include <wtf/PassRefPtr.h>
 
index b33c262e87fab98a427a62433f4b1ac9bd01c1d9..e447cae76a291a2e29cf1f94ad215ecf7be3cac4 100644 (file)
@@ -34,7 +34,6 @@
 #include "SVGDocument.h"
 #include "SVGRenderStyle.h"
 #include "SVGSVGElement.h"
-#include "ksvg.h"
 #include <wtf/HashSet.h>
 
 using namespace WebCore;
index 1f3575dc1e90e15647d8462c183d1cd7dfd767fa..7de94739824ce7d7d7616b4963f3b3df4f8d525f 100644 (file)
@@ -31,7 +31,6 @@
 #include "SVGHelper.h"
 #include "SVGNames.h"
 #include "SVGRenderStyle.h"
-#include "ksvg.h"
 
 namespace WebCore {
 
index e5493cef088d9491d7fe6f65f2f6fb1ae00a51a6..2d2ef2ab41d2b3e9042d80181025ef8d9aa9bc7c 100644 (file)
@@ -30,7 +30,6 @@
 #include "SVGLength.h"
 #include "SVGSVGElement.h"
 #include "SVGStringList.h"
-#include "ksvg.h"
 #include <math.h>
 
 using namespace std;
index 3dbedcd268fe1073525635adb339ee9b6b463a39..47a19e36de80d469c6b0c0369fb209a2d9ec6b4d 100644 (file)
 
 #include "config.h"
 #ifdef SVG_SUPPORT
-#include <math.h>
+#include "SVGMatrix.h"
 
-#include "ksvg.h"
-#include "SVGHelper.h"
 #include "SVGAngle.h"
-#include "SVGMatrix.h"
+#include "SVGException.h"
+#include "SVGHelper.h"
+#include <math.h>
 
 using namespace WebCore;
 
index bfc0746d028a12b33241e76f934ddf89e68023ce..7e8ebd893f481b3795839ff92ba3f3f7c495cb36 100644 (file)
@@ -25,7 +25,6 @@
 #ifdef SVG_SUPPORT
 
 #include "PlatformString.h"
-#include "ksvg.h"
 
 namespace WebCore
 {
index 0a791264dfae9808b61140b01508ef24a2bc7bbc..1ef925368d15a68404079ba3e9222fd87b8db860 100644 (file)
@@ -26,7 +26,6 @@
 #include "Attr.h"
 #include "StringImpl.h"
 
-#include "ksvg.h"
 #include "SVGNames.h"
 #include "SVGScriptElement.h"
 
index 95507313d0e9612d11a2a170a4777f153c09828e..e0c128fec29ee1b608e24c97e577859b5813ecb3 100644 (file)
@@ -37,7 +37,6 @@
 #include "SVGNames.h"
 #include "SVGRenderStyle.h"
 #include "SVGSVGElement.h"
-#include "ksvg.h"
 #include "ksvgcssproperties.h"
 
 #include <wtf/Assertions.h>
index 2cd58f6698058e1be38344686419c06406d42c80..1abbc14378902b1da7df30c26e49ec4c4fb31984 100644 (file)
@@ -26,7 +26,6 @@
 #include "SVGMatrix.h"
 #include "SVGTransform.h"
 #include "SVGSVGElement.h"
-#include "ksvg.h"
 
 using namespace WebCore;
 
index a3da2b0a72fc894aa4402351688abd73e889661e..79777e40d9c496925652bc62d6e0c094a3480a23 100644 (file)
@@ -41,7 +41,6 @@ class NSData;
 class NSDictionary;
 class NSError;
 class NSMutableURLRequest;
-class NSURL;
 class NSURLRequest;
 class NSURLResponse;
 
@@ -53,15 +52,17 @@ namespace WebCore {
 
     class Frame;
     class FrameLoader;
+    class KURL;
 
 #if PLATFORM(MAC)
     typedef Vector<RetainPtr<NSURLResponse> > ResponseVector;
 #endif
 
     class DocumentLoader : public Shared<DocumentLoader> {
-#if PLATFORM(MAC)
     public:
+#if PLATFORM(MAC)
         DocumentLoader(NSURLRequest *);
+#endif
         virtual ~DocumentLoader();
 
         void setFrame(Frame*);
@@ -69,6 +70,7 @@ namespace WebCore {
         virtual void detachFromFrame();
 
         FrameLoader* frameLoader() const;
+#if PLATFORM(MAC)
         NSData *mainResourceData() const;
         NSURLRequest *originalRequest() const;
         NSURLRequest *originalRequestCopy() const;
@@ -76,9 +78,10 @@ namespace WebCore {
         void setRequest(NSURLRequest *);
         NSMutableURLRequest *actualRequest();
         NSURLRequest *initialRequest() const;
-        NSURL *URL() const;
-        NSURL *unreachableURL() const;
-        void replaceRequestURLForAnchorScroll(NSURL *);
+#endif
+        KURL URL() const;
+        KURL unreachableURL() const;
+        void replaceRequestURLForAnchorScroll(const KURL&);
         bool isStopping() const;
         void stopLoading();
         void setCommitted(bool);
@@ -86,13 +89,17 @@ namespace WebCore {
         bool isLoading() const;
         void setLoading(bool);
         void updateLoading();
+#if PLATFORM(MAC)
         void receivedData(NSData *);
+#endif
         void setupForReplaceByMIMEType(const String& newMIMEType);
         void finishedLoading();
+#if PLATFORM(MAC)
         NSURLResponse *response() const;
         NSError *mainDocumentError() const;
         void mainReceivedError(NSError *, bool isComplete);
         void setResponse(NSURLResponse *);
+#endif
         void prepareForLoadStart();
         bool isClientRedirect() const;
         void setIsClientRedirect(bool);
@@ -100,29 +107,38 @@ namespace WebCore {
         void setPrimaryLoadComplete(bool);
         void setTitle(const String&);
         String overrideEncoding() const;
+#if PLATFORM(MAC)
         void addResponse(NSURLResponse *);
+#endif
         const ResponseVector& responses() const;
         const NavigationAction& triggeringAction() const;
         void setTriggeringAction(const NavigationAction&);
         void setOverrideEncoding(const String&);
+#if PLATFORM(MAC)
         void setLastCheckedRequest(NSURLRequest *request);
         NSURLRequest *lastCheckedRequest() const;
+#endif
         void stopRecordingResponses();
         String title() const;
-        NSURL *URLForHistory() const;
+        KURL URLForHistory() const;
 
     private:
+#if PLATFORM(MAC)
         void setMainResourceData(NSData *);
+#endif
         void setupForReplace();
         void commitIfReady();
         void clearErrors();
         double loadingStartedTime() const;
+#if PLATFORM(MAC)
         void setMainDocumentError(NSError *);
         void commitLoad(NSData *);
+#endif
         bool doesProgressiveLoad(const String& MIMEType) const;
 
         Frame* m_frame;
 
+#if PLATFORM(MAC)
         RetainPtr<NSData> m_mainResourceData;
 
         // A reference to actual request used to create the data source.
@@ -143,7 +159,8 @@ namespace WebCore {
         RetainPtr<NSURLResponse> m_response;
     
         RetainPtr<NSError> m_mainDocumentError;    
-    
+#endif
+
         // The time when the data source was told to start loading.
         double m_loadingStartedTime;
 
@@ -162,6 +179,7 @@ namespace WebCore {
         // benefit of the various policy handlers.
         NavigationAction m_triggeringAction;
 
+#if PLATFORM(MAC)
         // The last request that we checked click policy for - kept around
         // so we can avoid asking again needlessly.
         RetainPtr<NSURLRequest> m_lastCheckedRequest;
index e838fbde05391155ddf2aa0ab9be3e70129cdc2a..297d1f368fe4fb7608fb4061d764b330921235be 100644 (file)
 @class NSData;
 @class NSDictionary;
 @class NSError;
-@class NSEvent;
 @class NSMutableURLRequest;
 @class NSURL;
 @class NSURLAuthenticationChallenge;
-@class NSURLConnection;
 @class NSURLRequest;
 @class NSURLResponse;
 
 class NSData;
 class NSDictionary;
 class NSError;
-class NSEvent;
 class NSMutableURLRequest;
 class NSURL;
 class NSURLAuthenticationChallenge;
-class NSURLConnection;
 class NSURLRequest;
 class NSURLResponse;
 
@@ -73,10 +69,10 @@ namespace WebCore {
 
     class DocumentLoader;
     class Element;
+    class Event;
     class FormData;
     class FormState;
     class Frame;
-    struct FrameLoadRequest;
     class FrameLoaderClient;
     class KURL;
     class MainResourceLoader;
@@ -87,6 +83,8 @@ namespace WebCore {
     class ResourceResponse;
     class String;
     class SubresourceLoader;
+
+    struct FrameLoadRequest;
     struct WindowFeatures;
 
     typedef HashSet<RefPtr<ResourceLoader> > ResourceLoaderSet;
@@ -98,8 +96,10 @@ namespace WebCore {
         NSURLRequest *, PassRefPtr<FormState>);
     typedef void (*NewWindowPolicyDecisionFunction)(void* argument,
         NSURLRequest *, PassRefPtr<FormState>, const String& frameName);
+#endif
     typedef void (*ContentPolicyDecisionFunction)(void* argument, PolicyAction);
 
+#if PLATFORM(MAC)
     class PolicyCheck {
     public:
         PolicyCheck();
@@ -141,15 +141,15 @@ namespace WebCore {
         void setupForReplace();
         void setupForReplaceByMIMEType(const String& newMIMEType);
         void finalSetupForReplace(DocumentLoader*);
-#if PLATFORM(MAC)
-        void safeLoad(NSURL *);
-        void load(const FrameLoadRequest&, bool userGesture, NSEvent* triggeringEvent,
-            Element* form, const HashMap<String, String>& formValues);
-        void load(NSURL *, const String& referrer, FrameLoadType, const String& target,
-            NSEvent *event, Element* form, const HashMap<String, String>& formValues);
-        void post(NSURL *, const String& referrer, const String& target,
+        void load(const KURL&, Event*);
+        void load(const FrameLoadRequest&, bool userGesture,
+            Event*, Element* form, const HashMap<String, String>& formValues);
+        void load(const KURL&, const String& referrer, FrameLoadType, const String& target,
+            Event*, Element* form, const HashMap<String, String>& formValues);
+        void post(const KURL&, const String& referrer, const String& target,
             const FormData&, const String& contentType,
-            NSEvent *, Element* form, const HashMap<String, String>&);
+            Event*, Element* form, const HashMap<String, String>& formValues);
+#if PLATFORM(MAC)
         void load(NSURLRequest *);
         void load(NSURLRequest *, const String& frameName);
         void load(NSURLRequest *, const NavigationAction&, FrameLoadType, PassRefPtr<FormState>);
@@ -205,7 +205,9 @@ namespace WebCore {
         void didCancelAuthenticationChallenge(ResourceLoader*, NSURLAuthenticationChallenge *);
         void didReceiveResponse(ResourceLoader*, NSURLResponse *);
         void didReceiveData(ResourceLoader*, NSData *, int lengthReceived);
+#endif
         void didFinishLoad(ResourceLoader*);
+#if PLATFORM(MAC)
         void didFailToLoad(ResourceLoader*, NSError *);
 #endif
         bool privateBrowsingEnabled() const;
@@ -215,7 +217,6 @@ namespace WebCore {
         NSURLRequest *initialRequest() const;
         void receivedData(NSData *);
         void setRequest(NSURLRequest *);
-        void download(NSURLConnection *, NSURLRequest *request, NSURLResponse *, id proxy);
 #endif
         void handleFallbackContent();
         bool isStopping() const;
@@ -224,15 +225,15 @@ namespace WebCore {
 #endif
 
         void finishedLoading();
-#if PLATFORM(MAC)
-        NSURL *URL() const;
-#endif
+        KURL URL() const;
 
 #if PLATFORM(MAC)
         NSError *cancelledError(NSURLRequest *) const;
         NSError *fileDoesNotExistError(NSURLResponse *) const;
         bool willUseArchive(ResourceLoader*, NSURLRequest *, NSURL *) const;
+#endif
         bool isArchiveLoadPending(ResourceLoader*) const;
+#if PLATFORM(MAC)
         void cannotShowMIMEType(NSURLResponse *);
         NSError *interruptionForPolicyChangeError(NSURLRequest *);
 #endif
@@ -243,12 +244,12 @@ namespace WebCore {
         bool representationExistsForURLScheme(const String& URLScheme);
         String generatedMIMETypeForURLScheme(const String& URLScheme);
 
-#if PLATFORM(MAC)
-        void notifyIconChanged(NSURL *iconURL);
+        void notifyIconChanged();
 
+#if PLATFORM(MAC)
         void checkNavigationPolicy(NSURLRequest *, NavigationPolicyDecisionFunction, void* argument);
-        void checkContentPolicy(const String& MIMEType, ContentPolicyDecisionFunction, void* argument);
 #endif
+        void checkContentPolicy(const String& MIMEType, ContentPolicyDecisionFunction, void* argument);
         void cancelContentPolicyCheck();
 
         void reload();
@@ -276,18 +277,18 @@ namespace WebCore {
         bool firstLayoutDone() const;
 
         void clientRedirectCancelledOrFinished(bool cancelWithLoadInProgress);
+        void clientRedirected(const KURL&, double delay, double fireDate, bool lockHistory, bool isJavaScriptFormAction);
 #if PLATFORM(MAC)
-        void clientRedirected(NSURL *, double delay, double fireDate, bool lockHistory, bool isJavaScriptFormAction);
         void commitProvisionalLoad(NSDictionary *pageCache);
-        bool shouldReload(NSURL *currentURL, NSURL *destinationURL);
 #endif
+        bool shouldReload(const KURL& currentURL, const KURL& destinationURL);
 
         bool isQuickRedirectComing() const;
 
 #if PLATFORM(MAC)
         void sendRemainingDelegateMessages(id identifier, NSURLResponse *, unsigned length, NSError *);
         NSURLRequest *requestFromDelegate(NSURLRequest *, id& identifier, NSError *& error);
-        void loadedResourceFromMemoryCache(NSURLRequest *request, NSURLResponse *response, int length);
+        void loadedResourceFromMemoryCache(NSURLRequest *, NSURLResponse *, int length);
 #endif
 
         void checkLoadComplete();
@@ -368,6 +369,8 @@ namespace WebCore {
 #if PLATFORM(MAC)
         void handleUnimplementablePolicy(NSError *);
         bool shouldReloadToHandleUnreachableURL(NSURLRequest *);
+
+        void applyUserAgent(NSMutableURLRequest *);
 #endif
 
         bool canTarget(Frame*) const;
index 5b0d28d81899c8bd0da3c1769848101eb97b5981..feeed91f63dcb9a4035e01276c55e692b6039cf9 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <wtf/Noncopyable.h>
-#include <wtf/Forward.h>
 #include "FrameLoaderTypes.h"
+#include <wtf/Forward.h>
+#include <wtf/Noncopyable.h>
 
 #if PLATFORM(MAC)
-#ifndef __OBJC__
+#ifdef __OBJC__
+@class NSURLConnection;
+#else
 class NSImage;
+class NSURLConnection;
 #endif
 #endif
 
@@ -43,6 +46,7 @@ namespace WebCore {
     class FormState;
     class Frame;
     class FrameLoader;
+    class KURL;
     class NavigationAction;
     class String;
     class ResourceLoader;
@@ -113,7 +117,7 @@ namespace WebCore {
         virtual void dispatchDidHandleOnloadEvents() = 0;
         virtual void dispatchDidReceiveServerRedirectForProvisionalLoad() = 0;
         virtual void dispatchDidCancelClientRedirect() = 0;
-        virtual void dispatchWillPerformClientRedirect(NSURL *URL, double interval, double fireDate) = 0;
+        virtual void dispatchWillPerformClientRedirect(const KURL&, double interval, double fireDate) = 0;
         virtual void dispatchDidChangeLocationWithinPage() = 0;
         virtual void dispatchWillClose() = 0;
         virtual void dispatchDidReceiveIcon(NSImage *) = 0;
@@ -188,14 +192,14 @@ namespace WebCore {
         virtual void frameLoadCompleted() = 0;
         virtual void restoreScrollPositionAndViewState() = 0;
         virtual void provisionalLoadStarted() = 0;
-        virtual bool shouldTreatURLAsSameAsCurrent(NSURL *) const = 0;
+        virtual bool shouldTreatURLAsSameAsCurrent(const KURL&) const = 0;
         virtual void addHistoryItemForFragmentScroll() = 0;
         virtual void didFinishLoad() = 0;
         virtual void prepareForDataSourceReplacement() = 0;
         virtual PassRefPtr<DocumentLoader> createDocumentLoader(NSURLRequest *) = 0;
-        virtual void setTitle(const String& title, NSURL *) = 0;
+        virtual void setTitle(const String& title, const KURL&) = 0;
 
-        virtual String userAgent(NSURL *) = 0;
+        virtual String userAgent() = 0;
 #endif
 
     protected:
index 9134f10028c29099ab03d4fb1991f81d828268fb..07cd54568c0188b8bc7ed794a34769d649a48262 100644 (file)
 #ifndef NavigationAction_h
 #define NavigationAction_h
 
+#include "Event.h"
 #include "FrameLoaderTypes.h"
+#include "HitTestResult.h"
 #include "KURL.h"
-
-#if PLATFORM(MAC)
-#include "RetainPtr.h"
-#ifdef __OBJC__
-@class NSEvent;
-#else
-class NSEvent;
-#endif
-#endif
+#include <wtf/Forward.h>
 
 namespace WebCore {
 
+    class Event;
+
     class NavigationAction {
     public:
         NavigationAction();
         NavigationAction(const KURL&, NavigationType);
         NavigationAction(const KURL&, FrameLoadType, bool isFormSubmission);
-#if PLATFORM(MAC)
-        // FIXME: Change from NSEvent to DOM event.
-        NavigationAction(const KURL&, NavigationType, NSEvent *);
-        NavigationAction(const KURL&, FrameLoadType, bool isFormSubmission, NSEvent *);
-#endif
+        NavigationAction(const KURL&, NavigationType, PassRefPtr<Event>);
+        NavigationAction(const KURL&, FrameLoadType, bool isFormSubmission, PassRefPtr<Event>);
 
         bool isEmpty() const { return m_URL.isEmpty(); }
 
-#if PLATFORM(MAC)
         KURL URL() const { return m_URL; }
         NavigationType type() const { return m_type; }
-        NSEvent *event() const { return m_event.get(); }
-#endif
+        const Event* event() const { return m_event.get(); }
 
     private:
         KURL m_URL;
         NavigationType m_type;
-#if PLATFORM(MAC)
-        RetainPtr<NSEvent> m_event;
-#endif
+        RefPtr<Event> m_event;
     };
 
 }
index de6e5580f22f0daf5df6251f4026df4b4bc51a7b..220f6163bdcca38ca964da379b707bd61a96c38d 100644 (file)
 #include "Frame.h"
 #include "IconDatabase.h"
 #include "Logging.h"
+#include "ResourceHandle.h"
 #include "ResourceResponse.h"
+#include "ResourceRequest.h"
 
-#if PLATFORM(MAC)
-#include "FrameMac.h"
-#endif
+using namespace std;
 
-using namespace WebCore;
+namespace WebCore {
 
 IconLoader::IconLoader(Frame* frame)
     : m_frame(frame)
@@ -44,11 +44,9 @@ IconLoader::IconLoader(Frame* frame)
 {
 }
 
-IconLoader* IconLoader::createForFrame(Frame* frame)
+auto_ptr<IconLoader> IconLoader::create(Frame* frame)
 {
-    if (frame)
-        return new IconLoader(frame);
-    return 0;
+    return auto_ptr<IconLoader>(new IconLoader(frame));
 }
 
 IconLoader::~IconLoader()
@@ -72,8 +70,7 @@ void IconLoader::startLoading()
     } 
     
     m_url = m_frame->iconURL();
-    ResourceRequest request(m_url);
-    m_resourceLoader = ResourceHandle::create(request, this, m_frame->document()->docLoader());
+    m_resourceLoader = ResourceHandle::create(m_url, this, m_frame->document()->docLoader());
 
     if (!m_resourceLoader)
         LOG_ERROR("Failed to start load for icon at url %s", m_frame->iconURL().url().ascii());
@@ -98,9 +95,7 @@ void IconLoader::didReceiveData(ResourceHandle* resourceLoader, const char* data
     ASSERT(resourceLoader == m_resourceLoader);
     ASSERT(data);
     ASSERT(size > -1);
-    
-    for (int i=0; i<size; ++i)
-        m_data.append(data[i]);
+    m_data.append(data, size);
 }
 
 void IconLoader::didFinishLoading(ResourceHandle* resourceLoader)
@@ -122,21 +117,20 @@ void IconLoader::didFinishLoading(ResourceHandle* resourceLoader)
     IconDatabase* iconDatabase = IconDatabase::sharedIconDatabase();
     ASSERT(iconDatabase);
     
-    KURL iconURL(m_url);
-    
     if (data)
-        iconDatabase->setIconDataForIconURL(data, size, iconURL.url());
+        iconDatabase->setIconDataForIconURL(data, size, m_url.url());
     else
-        iconDatabase->setHaveNoIconForIconURL(iconURL.url());
+        iconDatabase->setHaveNoIconForIconURL(m_url.url());
         
-    // Tell the Frame to map its url(s) to its iconURL in the database
+    // Tell the frame to map its url(s) to its iconURL in the database
     m_frame->commitIconURLToIconDatabase();
     
     // Send the notification to the app that this icon is finished loading
-    notifyIconChanged(iconURL);
+    notifyIconChanged(m_url);
 
     // ResourceLoaders delete themselves after they deliver their last data, so we can just forget about it
     m_resourceLoader = 0;
     m_data.clear();
 }
 
+}
index e7beff4fa7cfcc1b96042d3f893a6aea4eb633d5..4af0d7880cc0f0998dd5d88829557fba6f4ca20a 100644 (file)
  * (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 ICONLOADER_H_
 #define ICONLOADER_H_
 
-#include "ResourceHandle.h"
+#include "KURL.h"
+#include "ResourceHandleClient.h"
+#include <wtf/Vector.h>
 
 namespace WebCore {
 
 class Frame;
 
-class IconLoader : public ResourceHandleClient
-{
+class IconLoader : public ResourceHandleClient {
 public:
-    static IconLoader* createForFrame(Frame* frame);
+    static std::auto_ptr<IconLoader> create(Frame*);
     ~IconLoader();
     
     void startLoading();
     void stopLoading();
-    
-    // ResourceHandleClient delegate methods
+
+private:
     virtual void didReceiveResponse(ResourceHandle*, const ResourceResponse&);
     virtual void didReceiveData(ResourceHandle*, const char*, int);
     virtual void didFinishLoading(ResourceHandle*);
-private:
-    IconLoader(Frame* frame);
+
+    IconLoader(Frame*);
     
-    void notifyIconChanged(const KURL& iconURL);
+    void notifyIconChanged(const KURL&);
 
     KURL m_url;
     RefPtr<ResourceHandle> m_resourceLoader;
@@ -58,6 +60,6 @@ private:
     int m_httpStatusCode;
 }; // class Iconloader
 
-}; // namespace WebCore
+} // namespace WebCore
 
 #endif
index 6ab59f6eb80237bac8c7fd8ec1888c2c563d1fde..ca83d552c072405a0ccfb279ee7da84d91db67b7 100644 (file)
@@ -38,6 +38,7 @@
 #include "LoaderFunctions.h"
 #include "Request.h"
 #include "ResourceHandle.h"
+#include "ResourceRequest.h"
 #include "ResourceResponse.h"
 #include <wtf/Assertions.h>
 #include <wtf/Vector.h>
index 236dbba68b48b626b45ca0be9ce673b2697f08a4..403778015b96a1481c21dfc346b58bc28f71e673 100644 (file)
@@ -33,7 +33,6 @@
 #import "FrameLoader.h"
 #import "FrameMac.h"
 #import "PlatformString.h"
-#import "WebCoreFrameBridge.h"
 #import "WebCoreSystemInterface.h"
 #import "WebDataProtocol.h"
 #import "XMLTokenizer.h"
@@ -173,27 +172,27 @@ NSMutableURLRequest *DocumentLoader::actualRequest()
     return m_request.get();
 }
 
-NSURL *DocumentLoader::URL() const
+KURL DocumentLoader::URL() const
 {
     return [const_cast<DocumentLoader*>(this)->request() URL];
 }
 
-NSURL *DocumentLoader::unreachableURL() const
+KURL DocumentLoader::unreachableURL() const
 {
     return [m_originalRequest.get() _webDataRequestUnreachableURL];
 }
 
-void DocumentLoader::replaceRequestURLForAnchorScroll(NSURL *URL)
+void DocumentLoader::replaceRequestURLForAnchorScroll(const KURL& URL)
 {
-    // assert that URLs differ only by fragment ID
-    
+    NSURL *newURL = URL.getNSURL();
+
     NSMutableURLRequest *newOriginalRequest = [m_originalRequestCopy.get() mutableCopy];
-    [newOriginalRequest setURL:URL];
+    [newOriginalRequest setURL:newURL];
     m_originalRequestCopy = newOriginalRequest;
     [newOriginalRequest release];
     
     NSMutableURLRequest *newRequest = [m_request.get() mutableCopy];
-    [newRequest setURL:URL];
+    [newRequest setURL:newURL];
     m_request = newRequest;
     [newRequest release];
 }
@@ -553,7 +552,7 @@ void DocumentLoader::setTitle(const String& title)
     }
 }
 
-NSURL *DocumentLoader::URLForHistory() const
+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 
index f384ef1d27182fcf39a1e94b2fe412a455dcc89c..b2da977ae4abfa1ee4e2e430a17c2c1d94787730 100644 (file)
@@ -69,11 +69,6 @@ using namespace HTMLNames;
 
 static double storedTimeOfLastCompletedLoad;
 
-static bool isCaseInsensitiveEqual(NSString *a, NSString *b)
-{
-    return [a caseInsensitiveCompare:b] == NSOrderedSame;
-}
-
 static void cancelAll(const ResourceLoaderSet& loaders)
 {
     const ResourceLoaderSet copy = loaders;
@@ -132,16 +127,12 @@ void FrameLoader::finalSetupForReplace(DocumentLoader* loader)
     m_client->clearUnarchivingState(loader);
 }
 
-void FrameLoader::safeLoad(NSURL *URL)
+void FrameLoader::load(const KURL& URL, Event* event)
 {
-    // Call to the Frame because this is where our security checks are made.
-    FrameLoadRequest request;
-    request.resourceRequest().setURL(URL);
-    request.resourceRequest().setHTTPReferrer(urlOriginalDataAsString([m_documentLoader->request() URL]));
-    load(request, true, [NSApp currentEvent], 0, HashMap<String, String>());
+    load(ResourceRequest(URL), true, event, 0, HashMap<String, String>());
 }
 
-void FrameLoader::load(const FrameLoadRequest& request, bool userGesture, NSEvent* triggeringEvent,
+void FrameLoader::load(const FrameLoadRequest& request, bool userGesture, Event* event,
     Element* submitForm, const HashMap<String, String>& formValues)
 {
     String referrer;
@@ -170,22 +161,22 @@ void FrameLoader::load(const FrameLoadRequest& request, bool userGesture, NSEven
         else
             loadType = FrameLoadTypeStandard;    
     
-        load(request.resourceRequest().url().getNSURL(), referrer, loadType, 
-            (!request.frameName().isEmpty() ? (NSString *)request.frameName() : nil), triggeringEvent, submitForm, formValues);
+        load(request.resourceRequest().url(), referrer, loadType, 
+            request.frameName(), event, submitForm, formValues);
     } else
-        post(request.resourceRequest().url().getNSURL(), referrer, (!request.frameName().isEmpty() ? (NSString *)request.frameName() : nil), 
-            request.resourceRequest().httpBody(), request.resourceRequest().httpContentType(), triggeringEvent, submitForm, formValues);
+        post(request.resourceRequest().url(), referrer, request.frameName(), 
+            request.resourceRequest().httpBody(), request.resourceRequest().httpContentType(), event, submitForm, formValues);
 
     if (targetFrame && targetFrame != m_frame)
         [Mac(targetFrame)->bridge() activateWindow];
 }
 
-void FrameLoader::load(NSURL *URL, const String& referrer, FrameLoadType newLoadType,
-    const String& frameName, NSEvent *event, Element* form, const HashMap<String, String>& values)
+void FrameLoader::load(const KURL& URL, const String& referrer, FrameLoadType newLoadType,
+    const String& frameName, Event* event, Element* form, const HashMap<String, String>& values)
 {
     bool isFormSubmission = !values.isEmpty();
     
-    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
+    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL.getNSURL()];
     setHTTPReferrer(request, referrer);
     addExtraFieldsToRequest(request, true, event || isFormSubmission);
     if (newLoadType == FrameLoadTypeReload)
@@ -199,7 +190,7 @@ void FrameLoader::load(NSURL *URL, const String& referrer, FrameLoadType newLoad
     if (form && !values.isEmpty())
         formState = FormState::create(form, values, m_frame);
     
-    if (!frameName.isNull()) {
+    if (!frameName.isEmpty()) {
         if (Frame* targetFrame = m_frame->tree()->find(frameName))
             targetFrame->loader()->load(URL, referrer, newLoadType, String(), event, form, values);
         else
@@ -218,7 +209,7 @@ void FrameLoader::load(NSURL *URL, const String& referrer, FrameLoadType newLoad
     if (!isFormSubmission
         && newLoadType != FrameLoadTypeReload
         && newLoadType != FrameLoadTypeSame
-        && !shouldReload(URL, m_frame->url().getNSURL())
+        && !shouldReload(URL, m_frame->url())
         // We don't want to just scroll if a link from within a
         // frameset is trying to reload the frameset into _top.
         && !m_frame->isFrameSet()) {
@@ -262,7 +253,7 @@ void FrameLoader::load(NSURLRequest *request)
 
 void FrameLoader::load(NSURLRequest *request, const String& frameName)
 {
-    if (frameName.isNull()) {
+    if (frameName.isEmpty()) {
         load(request);
         return;
     }
@@ -694,9 +685,24 @@ id FrameLoader::identifierForInitialRequest(NSURLRequest *clientRequest)
     return m_client->dispatchIdentifierForInitialRequest(activeDocumentLoader(), clientRequest);
 }
 
+void FrameLoader::applyUserAgent(NSMutableURLRequest *request)
+{
+    static String lastUserAgent;
+    static RetainPtr<NSString> lastUserAgentNSString;
+
+    String userAgent = client()->userAgent();
+    ASSERT(!userAgent.isNull());
+    if (userAgent != lastUserAgent) {
+        lastUserAgent = userAgent;
+        lastUserAgentNSString = userAgent;
+    }
+
+    [request setValue:lastUserAgentNSString.get() forHTTPHeaderField:@"User-Agent"];
+}
+
 NSURLRequest *FrameLoader::willSendRequest(ResourceLoader* loader, NSMutableURLRequest *clientRequest, NSURLResponse *redirectResponse)
 {
-    [clientRequest setValue:client()->userAgent([clientRequest URL]) forHTTPHeaderField:@"User-Agent"];
+    applyUserAgent(clientRequest);
     return m_client->dispatchWillSendRequest(activeDocumentLoader(), loader->identifier(), clientRequest, redirectResponse);
 }
 
@@ -800,7 +806,7 @@ void FrameLoader::clientRedirectCancelledOrFinished(bool cancelWithLoadInProgres
     m_sentRedirectNotification = false;
 }
 
-void FrameLoader::clientRedirected(NSURL *URL, double seconds, double fireDate, bool lockHistory, bool isJavaScriptFormAction)
+void FrameLoader::clientRedirected(const KURL& URL, double seconds, double fireDate, bool lockHistory, bool isJavaScriptFormAction)
 {
     m_client->dispatchWillPerformClientRedirect(URL, seconds, fireDate);
     
@@ -814,10 +820,14 @@ void FrameLoader::clientRedirected(NSURL *URL, double seconds, double fireDate,
     m_quickRedirectComing = lockHistory && m_documentLoader && !isJavaScriptFormAction;
 }
 
-bool FrameLoader::shouldReload(NSURL *currentURL, NSURL *destinationURL)
+bool FrameLoader::shouldReload(const KURL& currentURL, const KURL& destinationURL)
 {
-    return !(([currentURL fragment] || [destinationURL fragment])
-        && [urlByRemovingFragment(currentURL) isEqual:urlByRemovingFragment(destinationURL)]);
+    // This function implements the rule: "Don't reload if navigating by fragment within
+    // the same URL, but do reload if going to a new URL or to the same URL with no
+    // fragment identifier at all."
+    if (!currentURL.hasRef() && !destinationURL.hasRef())
+        return true;
+    return !equalIgnoringRef(currentURL, destinationURL);
 }
 
 void FrameLoader::callContinueFragmentScrollAfterNavigationPolicy(void* argument,
@@ -1024,11 +1034,6 @@ void FrameLoader::setRequest(NSURLRequest *request)
     activeDocumentLoader()->setRequest(request);
 }
 
-void FrameLoader::download(NSURLConnection *connection, NSURLRequest *request, NSURLResponse *response, id proxy)
-{
-    m_client->download(connection, request, response, proxy);
-}
-
 void FrameLoader::handleFallbackContent()
 {
     m_frame->handleFallbackContent();
@@ -1063,16 +1068,16 @@ void FrameLoader::finishedLoading()
     checkLoadComplete();
 }
 
-void FrameLoader::notifyIconChanged(NSURL *iconURL)
+void FrameLoader::notifyIconChanged()
 {
     ASSERT([[WebCoreIconDatabaseBridge sharedInstance] _isEnabled]);
     NSImage *icon = [[WebCoreIconDatabaseBridge sharedInstance]
-        iconForPageURL:urlOriginalDataAsString(activeDocumentLoader()->URL())
+        iconForPageURL:urlOriginalDataAsString(activeDocumentLoader()->URL().getNSURL())
         withSize:NSMakeSize(16, 16)];
     m_client->dispatchDidReceiveIcon(icon);
 }
 
-NSURL *FrameLoader::URL() const
+KURL FrameLoader::URL() const
 {
     return activeDocumentLoader()->URL();
 }
@@ -1189,9 +1194,9 @@ void FrameLoader::reloadAllowingStaleData(const String& encoding)
         return;
 
     NSMutableURLRequest *request = [m_documentLoader->request() mutableCopy];
-    NSURL *unreachableURL = m_documentLoader->unreachableURL();
-    if (unreachableURL)
-        [request setURL:unreachableURL];
+    KURL unreachableURL = m_documentLoader->unreachableURL();
+    if (!unreachableURL.isEmpty())
+        [request setURL:unreachableURL.getNSURL()];
 
     [request setCachePolicy:NSURLRequestReturnCacheDataElseLoad];
 
@@ -1230,7 +1235,7 @@ void FrameLoader::reload()
     [request setCachePolicy:NSURLRequestReloadIgnoringCacheData];
 
     // If we're about to re-post, set up action so the application can warn the user.
-    if (isCaseInsensitiveEqual([request HTTPMethod], @"POST"))
+    if ([[request HTTPMethod] isEqualToString:@"POST"])
         loader->setTriggeringAction(NavigationAction([request URL], NavigationTypeFormResubmitted));
 
     loader->setOverrideEncoding(m_documentLoader->overrideEncoding());
@@ -1306,7 +1311,7 @@ void FrameLoader::didChangeTitle(DocumentLoader* loader)
 
     // The title doesn't get communicated to the WebView until we are committed.
     if (loader->isCommitted())
-        if (NSURL *URLForHistory = canonicalURL(loader->URLForHistory())) {
+        if (NSURL *URLForHistory = canonicalURL(loader->URLForHistory().getNSURL())) {
             // Must update the entries in the back-forward list too.
             // This must go through the WebFrame because it has the right notion of the current b/f item.
             m_client->setTitle(loader->title(), URLForHistory);
@@ -1442,7 +1447,7 @@ void FrameLoader::continueLoadAfterNavigationPolicy(NSURLRequest *request,
     // If we loaded an alternate page to replace an unreachableURL, we'll get in here with a
     // nil policyDataSource because loading the alternate page will have passed
     // through this method already, nested; otherwise, policyDataSource should still be set.
-    ASSERT(m_policyDocumentLoader || m_provisionalDocumentLoader->unreachableURL());
+    ASSERT(m_policyDocumentLoader || !m_provisionalDocumentLoader->unreachableURL().isEmpty());
 
     BOOL isTargetItem = m_client->provisionalItemIsTarget();
 
@@ -1633,9 +1638,9 @@ void FrameLoader::checkLoadCompleteForThisFrame()
                 // delegate callback.
                 if (pdl == m_provisionalDocumentLoader)
                     clearProvisionalLoad();
-                else {
-                    NSURL *unreachableURL = m_provisionalDocumentLoader->unreachableURL();
-                    if (unreachableURL && [unreachableURL isEqual:[pdl->request() URL]])
+                else if (m_documentLoader) {
+                    KURL unreachableURL = m_documentLoader->unreachableURL();
+                    if (!unreachableURL.isEmpty() && unreachableURL == [pdl->request() URL])
                         shouldReset = false;
                 }
             }
@@ -1748,8 +1753,8 @@ void FrameLoader::loadedResourceFromMemoryCache(NSURLRequest *request, NSURLResp
     sendRemainingDelegateMessages(identifier, response, length, error);
 }
 
-void FrameLoader::post(NSURL *URL, const String& referrer, const String& frameName, const FormData& formData, 
-    const String& contentType, NSEvent *event, Element* form, const HashMap<String, String>& formValues)
+void FrameLoader::post(const KURL& URL, const String& referrer, const String& frameName, const FormData& formData, 
+    const String& contentType, Event* event, Element* form, const HashMap<String, String>& formValues)
 {
     // When posting, use the NSURLRequestReloadIgnoringCacheData load flag.
     // This prevents a potential bug which may cause a page with a form that uses itself
@@ -1757,7 +1762,7 @@ void FrameLoader::post(NSURL *URL, const String& referrer, const String& frameNa
 
     // FIXME: Where's the code that implements what the comment above says?
 
-    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
+    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL.getNSURL()];
     addExtraFieldsToRequest(request, true, true);
 
     setHTTPReferrer(request, referrer);
@@ -1766,11 +1771,12 @@ void FrameLoader::post(NSURL *URL, const String& referrer, const String& frameNa
     [request setValue:contentType forHTTPHeaderField:@"Content-Type"];
 
     NavigationAction action(URL, FrameLoadTypeStandard, true, event);
+
     RefPtr<FormState> formState;
     if (form && !formValues.isEmpty())
         formState = FormState::create(form, formValues, m_frame);
 
-    if (!frameName.isNull()) {
+    if (!frameName.isEmpty()) {
         if (Frame* targetFrame = m_frame->tree()->find(frameName))
             targetFrame->loader()->load(request, action, FrameLoadTypeStandard, formState.release());
         else
@@ -1810,7 +1816,7 @@ void FrameLoader::detachFromParent()
 
 void FrameLoader::addExtraFieldsToRequest(NSMutableURLRequest *request, bool mainResource, bool alwaysFromRequest)
 {
-    [request setValue:client()->userAgent([request URL]) forHTTPHeaderField:@"User-Agent"];
+    applyUserAgent(request);
     
     if (m_loadType == FrameLoadTypeReload)
         [request setValue:@"max-age=0" forHTTPHeaderField:@"Cache-Control"];
@@ -1913,11 +1919,11 @@ void FrameLoader::loadResourceSynchronously(const ResourceRequest& request, Vect
     else
         [initialRequest setCachePolicy:[documentLoader()->request() cachePolicy]];
     
-    if (!referrer.isNull())
+    if (!referrer.isEmpty())
         setHTTPReferrer(initialRequest, referrer);
     
     [initialRequest setMainDocumentURL:[m_frame->page()->mainFrame()->loader()->documentLoader()->request() URL]];
-    [initialRequest setValue:client()->userAgent(URL) forHTTPHeaderField:@"User-Agent"];
+    applyUserAgent(initialRequest);
     
     NSError *error = nil;
     id identifier = nil;    
index 9a1b1a4459bf272fc85846b6eb49af245db2dfa8..43948a8e314dcfa4e8a2c2de5cee1b332810b2c7 100644 (file)
 #include "IconLoader.h"
 
 #include "FrameLoader.h"
-#include "FrameMac.h"
+#include "Frame.h"
 
-using namespace WebCore;
+namespace WebCore {
 
-void IconLoader::notifyIconChanged(const KURL& iconURL)
+void IconLoader::notifyIconChanged(const KURL&)
 {
-    m_frame->loader()->notifyIconChanged(iconURL.getNSURL());
+    // FIXME: Change caller to not send the URL?
+    // FIXME: Move this out of Mac-specific into platform-independent.
+    m_frame->loader()->notifyIconChanged();
 }
 
+}
index 5a8090573c6dd87d15231743692941f65521f3f8..939bc21ea53c699be48ddf9b6b5552cc36ac08e6 100644 (file)
@@ -39,7 +39,6 @@
 #import "Request.h"
 #import "ResourceHandle.h"
 #import "ResourceRequest.h"
-#import "WebCoreFrameBridge.h"
 #import "loader.h"
 #import <wtf/Vector.h>
 #import <Foundation/NSURLResponse.h>
index 028f6d4c9bed896033fcaa904e2b9c6b232c6cc9..bd8742858de8282671f8e0374e3f401b172850cb 100644 (file)
@@ -30,6 +30,8 @@
 #import "MainResourceLoader.h"
 
 #import "FrameLoader.h"
+#import "FrameLoaderClient.h"
+#import "KURL.h"
 #import "PlatformString.h"
 #import "WebCoreSystemInterface.h"
 #import "WebDataProtocol.h"
@@ -198,18 +200,9 @@ NSURLRequest *MainResourceLoader::willSendRequest(NSURLRequest *newRequest, NSUR
     return newRequest;
 }
 
-static bool shouldLoadAsEmptyDocument(NSURL *url)
+static bool shouldLoadAsEmptyDocument(const KURL& URL)
 {
-    Vector<UInt8, URLBufferLength> buffer(URLBufferLength);
-    CFIndex bytesFilled = CFURLGetBytes((CFURLRef)url, buffer.data(), URLBufferLength);
-    if (bytesFilled == -1) {
-        CFIndex bytesToAllocate = CFURLGetBytes((CFURLRef)url, NULL, 0);
-        buffer.resize(bytesToAllocate);
-        bytesFilled = CFURLGetBytes((CFURLRef)url, buffer.data(), bytesToAllocate);
-        ASSERT(bytesFilled == bytesToAllocate);
-    }
-    
-    return (bytesFilled == 0) || (bytesFilled > 5 && strncmp((char *)buffer.data(), "about:", 6) == 0);
+    return URL.isEmpty() || equalIgnoringCase(URL.protocol(), "about");
 }
 
 void MainResourceLoader::continueAfterContentPolicy(PolicyAction contentPolicy, NSURLResponse *r)
@@ -234,7 +227,7 @@ void MainResourceLoader::continueAfterContentPolicy(PolicyAction contentPolicy,
 
     case PolicyDownload:
         [m_proxy.get() setDelegate:nil];
-        frameLoader()->download(connection(), request(), r, m_proxy.get());
+        frameLoader()->client()->download(connection(), request(), r, m_proxy.get());
         m_proxy = nil;
         receivedError(interruptionForPolicyChangeError());
         return;
@@ -267,7 +260,9 @@ void MainResourceLoader::continueAfterContentPolicy(PolicyAction contentPolicy,
     if (!reachedTerminalState())
         ResourceLoader::didReceiveResponse(r);
 
-    if (frameLoader() && !frameLoader()->isStopping() && (shouldLoadAsEmptyDocument(URL) || frameLoader()->representationExistsForURLScheme([URL scheme])))
+    if (frameLoader() && !frameLoader()->isStopping()
+            && (shouldLoadAsEmptyDocument(URL)
+                || frameLoader()->representationExistsForURLScheme([URL scheme])))
         didFinishLoading();
 }
 
index a4545dcd4357d3a8613961a743b562d4eae5b308..c25eb47d0c470987e514237c36101817907c8553 100644 (file)
 
 namespace WebCore {
 
-static NavigationType navigationType(FrameLoadType frameLoadType, bool isFormSubmission,
-    NSEvent *event)
+static NavigationType navigationType(FrameLoadType frameLoadType, bool isFormSubmission, bool haveEvent)
 {
     if (isFormSubmission)
         return NavigationTypeFormSubmitted;
-    if (event)
+    if (haveEvent)
         return NavigationTypeLinkClicked;
     if (frameLoadType == FrameLoadTypeReload)
         return NavigationTypeReload;
@@ -65,7 +64,7 @@ NavigationAction::NavigationAction(const KURL& URL, FrameLoadType frameLoadType,
 {
 }
 
-NavigationAction::NavigationAction(const KURL& URL, NavigationType type, NSEvent *event)
+NavigationAction::NavigationAction(const KURL& URL, NavigationType type, PassRefPtr<Event> event)
     : m_URL(URL)
     , m_type(type)
     , m_event(event)
@@ -73,7 +72,7 @@ NavigationAction::NavigationAction(const KURL& URL, NavigationType type, NSEvent
 }
 
 NavigationAction::NavigationAction(const KURL& URL, FrameLoadType frameLoadType,
-        bool isFormSubmission, NSEvent *event)
+        bool isFormSubmission, PassRefPtr<Event> event)
     : m_URL(URL)
     , m_type(navigationType(frameLoadType, isFormSubmission, event))
     , m_event(event)
index 1b25d857213506ef71fc75c5d69fd391567c6d91..8cbe7cf74b0c1a694c91ac03fc88e65da7dfb84f 100644 (file)
@@ -32,7 +32,6 @@
 #import "FrameLoader.h"
 #import "FrameMac.h"
 #import "Page.h"
-#import "WebCoreFrameBridge.h"
 #import "WebCoreSystemInterface.h"
 #import "WebDataProtocol.h"
 #import <Foundation/NSURLAuthenticationChallenge.h>
index 8b9056ff249db52ec0a076489749aeb369ea5b1b..cfeb64beacbd181783b90c1df7f05503c6a3edb3 100644 (file)
 #import "config.h"
 #import "SubresourceLoader.h"
 
+#import "FormDataStream.h"
 #import "FrameLoader.h"
 #import "FrameMac.h"
 #import "LoaderFunctions.h"
 #import "LoaderNSURLExtras.h"
 #import "LoaderNSURLRequestExtras.h"
 #import "ResourceHandle.h"
-#import "WebCoreFrameBridge.h"
+#import "ResourceRequest.h"
 #import "WebCoreSystemInterface.h"
-#import "FormDataStream.h"
 #import <Foundation/NSURLResponse.h>
 #import <wtf/Assertions.h>
 
index 4fe728e2d2b32034ed4a2a7c2558adcbe37b841a..d20c4935e1294304071cde454d6f29e448c36e3a 100644 (file)
@@ -36,7 +36,6 @@
 #include "Cache.h"
 #include "CachedCSSStyleSheet.h"
 #include "DOMImplementation.h"
-#include "DOMWindow.h"
 #include "DocLoader.h"
 #include "DocumentType.h"
 #include "EditingText.h"
@@ -188,12 +187,15 @@ Frame::Frame(Page* page, Element* ownerElement, PassRefPtr<EditorClient> client)
     XMLNames::init();
 #endif
 
-    if (d->m_ownerElement)
-        d->m_page->incrementFrameCount();
+    if (!ownerElement)
+        page->setMainFrame(this);
+    else {
+        // FIXME: Frames were originally created with a refcount of 1.
+        // Leave this ref call here until we can straighten that out.
+        ref();
+        page->incrementFrameCount();
+    }
 
-    // FIXME: Frames were originally created with a refcount of 1, leave this
-    // ref call here until we can straighten that out.
-    ref();
 #ifndef NDEBUG
     ++FrameCounter::count;
 #endif
@@ -263,7 +265,7 @@ void Frame::changeLocation(const DeprecatedString& URL, const String& referrer,
     urlSelected(request, "_self", 0, lockHistory);
 }
 
-void Frame::urlSelected(const ResourceRequest& request, const String& _target, const Event* triggeringEvent, bool lockHistory)
+void Frame::urlSelected(const ResourceRequest& request, const String& _target, Event* triggeringEvent, bool lockHistory)
 {
   String target = _target;
   if (target.isEmpty() && d->m_doc)
@@ -355,11 +357,11 @@ void Frame::submitFormAgain()
     d->m_submitForm = 0;
     if (d->m_doc && !d->m_doc->parsing() && form)
         submitForm(form->submitAction, form->submitUrl, form->submitFormData,
-            form->target, form->submitContentType, form->submitBoundary);
+            form->target, form->submitContentType, form->submitBoundary, form->event.get());
     delete form;
 }
 
-void Frame::submitForm(const char *action, const String& url, const FormData& formData, const String& _target, const String& contentType, const String& boundary)
+void Frame::submitForm(const char *action, const String& url, const FormData& formData, const String& _target, const String& contentType, const String& boundary, Event* event)
 {
   KURL u = completeURL(url.deprecatedString());
 
@@ -408,7 +410,7 @@ void Frame::submitForm(const char *action, const String& url, const FormData& fo
       u.setQuery(query);
   } 
 
-  if (strcmp(action, "get") == 0) {
+  if (strcmp(action, "GET") == 0) {
     if (u.protocol() != "mailto")
        u.setQuery(formData.flattenToString().deprecatedString());
   } else {
@@ -432,9 +434,10 @@ void Frame::submitForm(const char *action, const String& url, const FormData& fo
     d->m_submitForm->target = _target;
     d->m_submitForm->submitContentType = contentType;
     d->m_submitForm->submitBoundary = boundary;
+    d->m_submitForm->event = event;
   } else {
       frameRequest.resourceRequest().setURL(u);
-      submitForm(frameRequest);
+      submitForm(frameRequest, event);
   }
 }
 
@@ -863,7 +866,6 @@ void Frame::begin(const KURL& url)
   d->m_url = url;
   KURL baseurl;
 
-  // We don't need KDE chained URI handling or window caption setting
   if (!d->m_url.isEmpty())
     baseurl = d->m_url;
 
@@ -907,7 +909,7 @@ void Frame::begin(const KURL& url)
   restoreDocumentState();
 
   d->m_doc->implicitOpen();
-  // clear widget
+
   if (d->m_view)
     d->m_view->resizeContents(0, 0);
 }
@@ -1033,7 +1035,7 @@ void Frame::endIfNotLoading()
         }
         
         if (!d->m_iconLoader)
-            d->m_iconLoader = IconLoader::createForFrame(this);
+            d->m_iconLoader = IconLoader::create(this).release();
         d->m_iconLoader->startLoading();
     }
 }
@@ -2778,19 +2780,17 @@ void Frame::setAutoscrollRenderer(RenderObject* renderer)
 
 HitTestResult Frame::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent)
 {
-    HitTestRequest request(true, true);
     HitTestResult result(point);
-    renderer()->layer()->hitTest(request, result);
+    if (!renderer())
+        return result;
+    renderer()->layer()->hitTest(HitTestRequest(true, true), result);
 
-    Node *n;
-    Widget *widget = 0;
     IntPoint widgetPoint(point);
-    
     while (true) {
-        n = result.innerNode();
+        Node* n = result.innerNode();
         if (!n || !n->renderer() || !n->renderer()->isWidget())
             break;
-        widget = static_cast<RenderWidget*>(n->renderer())->widget();
+        Widget* widget = static_cast<RenderWidget*>(n->renderer())->widget();
         if (!widget || !widget->isFrameView())
             break;
         Frame* frame = static_cast<HTMLFrameElement*>(n)->contentFrame();
@@ -2798,16 +2798,13 @@ HitTestResult Frame::hitTestResultAtPoint(const IntPoint& point, bool allowShado
             break;
         int absX, absY;
         n->renderer()->absolutePosition(absX, absY, true);
-        FrameView *view = static_cast<FrameView*>(widget);
-        widgetPoint.setX(widgetPoint.x() - absX + view->contentsX());
-        widgetPoint.setY(widgetPoint.y() - absY + view->contentsY());
-
-        HitTestRequest widgetHitTestRequest(true, true);
+        FrameView* view = static_cast<FrameView*>(widget);
+        widgetPoint.move(view->contentsX() - absX, view->contentsY() - absY);
         HitTestResult widgetHitTestResult(widgetPoint);
-        frame->renderer()->layer()->hitTest(widgetHitTestRequest, widgetHitTestResult);
+        frame->renderer()->layer()->hitTest(HitTestRequest(true, true), widgetHitTestResult);
         result = widgetHitTestResult;
     }
-    
+
     if (!allowShadowContent) {
         Node* node = result.innerNode();
         if (node)
@@ -2818,6 +2815,7 @@ HitTestResult Frame::hitTestResultAtPoint(const IntPoint& point, bool allowShado
             node = node->shadowAncestorNode();
         result.setInnerNonSharedNode(node); 
     }
+
     return result;
 }
 
index 416c9dad489f9ea406b090c2b51c21b96f356286..cec4aeb6b9538aa41bc2b6a9da0f2e9f21b5623a 100644 (file)
@@ -64,7 +64,6 @@ class Editor;
 class EditorClient;
 class FormData;
 class FramePrivate;
-struct FrameLoadRequest;
 class FrameLoader;
 class FrameTree;
 class KJSProxy;
@@ -81,6 +80,8 @@ class SelectionController;
 class Settings;
 class VisiblePosition;
 
+struct FrameLoadRequest;
+
 template <typename T> class Timer;
 
 struct MarkedTextUnderline {
@@ -110,18 +111,16 @@ public:
 
   // FIXME: Merge these methods and move them into FrameLoader.
   void changeLocation(const DeprecatedString& URL, const String& referrer, bool lockHistory = true, bool userGesture = false);
-  virtual void urlSelected(const ResourceRequest&, const String& target, const Event* triggeringEvent, bool lockHistory = false);
-  virtual void urlSelected(const FrameLoadRequest&, const Event* triggeringEvent) = 0;
+  void urlSelected(const ResourceRequest&, const String& target, Event*, bool lockHistory = false);
+  virtual void urlSelected(const FrameLoadRequest&, Event*) = 0;
   
   bool requestFrame(Element* ownerElement, const String& url, const AtomicString& frameName);
   virtual Frame* createFrame(const KURL& url, const String& name, Element* ownerElement, const String& referrer) = 0;
   Frame* loadSubframe(Element* ownerElement, const KURL& url, const String& name, const String& referrer);
 
-  virtual void submitForm(const FrameLoadRequest&) = 0;
-  void submitForm(const char* action, const String& url, const FormData& formData,
-                  const String& target, const String& contentType = String(),
-                  const String& boundary = String());
+  void submitForm(const char* action, const String& URL, const FormData&, const String& target, const String& contentType, const String& boundary, Event*);
   void submitFormAgain();
+  virtual void submitForm(const FrameLoadRequest&, Event*) = 0;
 
   void stop();
   void stopLoading(bool sendUnload = false);
index 6a5b3f80e6ef79a0713aa289211136b9e26198ee..0e14e997a8a4aa9280d67a8516d6ed636cfd3a3a 100644 (file)
@@ -188,6 +188,7 @@ namespace WebCore {
             String target;
             String submitContentType;
             String submitBoundary;
+            RefPtr<Event> event;
         };
         SubmitForm* m_submitForm;
 
index 854ab564c3db55df793166270620fe00252499c4..02e210b7d7a8ffccc2b822b57d1c18474137ce50 100644 (file)
@@ -172,7 +172,6 @@ FrameGdk::FrameGdk(GdkDrawable* gdkdrawable)
     settings->setFixedFontName("Courier");
     settings->setStdFontName("Arial");
     setSettings(settings);
-    page()->setMainFrame(this);
     FrameView* view = new FrameView(this);
     setView(view);
     IntRect geom = frameGeometry();
@@ -198,7 +197,7 @@ FrameGdk::~FrameGdk()
     cancelAndClear();
 }
 
-void FrameGdk::submitForm(const FrameLoadRequest& frameLoadRequest)
+void FrameGdk::submitForm(const FrameLoadRequest& frameLoadRequest, Event*)
 {
     ResourceRequest request = frameLoadRequest.m_request;
 
@@ -213,7 +212,7 @@ void FrameGdk::submitForm(const FrameLoadRequest& frameLoadRequest)
     clearRecordedFormValues();
 }
 
-void FrameGdk::urlSelected(const FrameLoadRequest& frameLoadRequest)
+void FrameGdk::urlSelected(const FrameLoadRequest& frameLoadRequest, Event*)
 {
     ResourceRequest request = frameLoadRequest.m_request;
 
index 352d57948578a0bde4d0576ff07f13a77b1eb0dc..71392ab379322988bee4e2dfae139f331c9ba6a2 100644 (file)
@@ -78,8 +78,8 @@ public:
     virtual ~FrameGdk();
 
     void handleGdkEvent(GdkEvent*);
-    virtual void submitForm(const FrameLoadRequest&);
-    virtual void urlSelected(const FrameLoadRequest&);
+    virtual void submitForm(const FrameLoadRequest&, Event*);
+    virtual void urlSelected(const FrameLoadRequest&, Event*);
 
     virtual void setTitle(const String&);
 
index 75d2ee5546895c8fe47026c95abe0939b149f935..2565457ea9d325329d0fdf593e8b6ffef603e599 100644 (file)
@@ -35,7 +35,6 @@
 #import "RenderView.h"
 #import "RenderWidget.h"
 #import "TextStyle.h"
-#import "WebCoreFrameBridge.h"
 #import "WebCoreTextField.h"
 #import "WebCoreViewFactory.h"
 #import "WidgetClient.h"
index 8a9955abf9a770de544f491dae369485a1496770..3d4e14d3603e29ff72588857d386a79f50782d7d 100644 (file)
@@ -27,7 +27,6 @@
 #ifndef HTTPHeaderMap_H_
 #define HTTPHeaderMap_H_
 
-#include "PlatformString.h"
 #include "StringHash.h"
 #include <wtf/HashMap.h>
 
index 17dab15ea9818d474940b1d7d1180901d53d2154..15aba174b8ea62052a1ceca71769d274f3342dcb 100644 (file)
 #ifndef ResourceHandle_h
 #define ResourceHandle_h
 
+#include "HTTPHeaderMap.h"
 #include "ResourceHandleClient.h" // for PlatformResponse
-#include "ResourceRequest.h"
-#include "StringHash.h"
-#include "Timer.h"
-#include <wtf/HashMap.h>
-#include <wtf/Platform.h>
 
 #if PLATFORM(WIN)
 typedef unsigned long DWORD;
@@ -47,11 +43,9 @@ typedef LONG_PTR LRESULT;
 
 #if PLATFORM(MAC)
 #ifdef __OBJC__
-@class WebCoreResourceLoaderImp;
 @class NSURLRequest;
 @class NSURLResponse;
 #else
-class WebCoreResourceLoaderImp;
 class NSURLRequest;
 class NSURLResponse;
 #endif
@@ -64,6 +58,10 @@ class FormData;
 class KURL;
 class ResourceHandleInternal;
 
+struct ResourceRequest;
+
+template <typename T> class Timer;
+
 class ResourceHandle : public Shared<ResourceHandle> {
 private:
     ResourceHandle(const ResourceRequest&, ResourceHandleClient*);
@@ -83,15 +81,15 @@ public:
 
 #if PLATFORM(MAC)
     NSURLRequest *willSendRequest(NSURLRequest *, NSURLResponse *);
-    void addData(NSData *data);
-    void finishJobAndHandle(NSData *data);
+    void addData(NSData *);
+    void finishJobAndHandle(NSData *);
     void reportError();
 #endif
 
 #if USE(WININET)
-    void setHasReceivedResponse(bool = true);
+    void setHasReceivedResponse(bool = true);
     bool hasReceivedResponse() const;
-    void fileLoadTimer(Timer<ResourceHandle>* timer);
+    void fileLoadTimer(Timer<ResourceHandle>*);
     void onHandleCreated(LPARAM);
     void onRequestRedirected(LPARAM);
     void onRequestComplete(LPARAM);
@@ -104,7 +102,6 @@ public:
 #endif
 
 #if PLATFORM(QT)
-    // Helper function
     QString extractCharsetFromHeaders(QString headers) const;
 #endif
 
index e3353371b6736d54fe8c6320199fc47990a694d4..e648bfd615ddd30e7eb2293bead1980b3d5182e2 100644 (file)
 #ifndef ResourceHandleClient_h
 #define ResourceHandleClient_h
 
+#include "Shared.h"
 #include <wtf/Platform.h>
+#include <wtf/RefPtr.h>
+
 #if USE(CFNETWORK)
 #include <ConditionalMacros.h>
 #include <CFNetwork/CFURLResponsePriv.h>
@@ -44,11 +47,8 @@ class NSURLResponse;
 
 #if PLATFORM(QT)
 #include <QString>
-#include <wtf/RefPtr.h>
 #endif
 
-#include "Shared.h"
-
 namespace WebCore {
 
 #if USE(CFNETWORK)
index d155d1bc86dac9eb835a248b773763ef16717a8a..c787ed42db2a6c5cbac11ee55151e0ea0dfdb6f2 100644 (file)
 #ifndef ResourceHandleInternal_h
 #define ResourceHandleInternal_h
 
-#include "FormData.h"
-#include "KURL.h"
-#include <wtf/HashMap.h>
-#include <wtf/Platform.h>
+#include "ResourceRequest.h"
 
 #if USE(CFNETWORK)
 #include <CFNetwork/CFURLConnectionPriv.h>
@@ -123,7 +120,7 @@ namespace WebCore {
         bool m_resend;
 #endif
 #if USE(CURL)
-        CURL *m_handle;
+        CURLm_handle;
 #endif
 #if PLATFORM(QT)
         QString m_charset;
index a9926960f096f182501a200981ec4fc8223efd16..eed65794aa38e1c21b969d1bf6ea07f9aece7b40 100644 (file)
 #import "DocLoader.h"
 #import "FrameLoader.h"
 #import "FrameMac.h"
-#import "KURL.h"
-#import "LoaderFunctions.h"
-#import "Logging.h"
 #import "ResourceRequestMac.h"
 #import "ResourceResponse.h"
 #import "ResourceResponseMac.h"
-#import "WebCoreFrameBridge.h"
 #import "SubresourceLoader.h"
 
 namespace WebCore {
index 193f6b5450455c68f4330bc4910aac34814361f7..bde1c8119726dcb7b9b80b3d3293b3d84abdf14a 100644 (file)
@@ -33,7 +33,7 @@ namespace WebCore {
 
     class ResourceResponse;
 
-    void getResourceResponse(ResourceResponse& response, NSURLResponse *nsResponse);
+    void getResourceResponse(ResourceResponse&, NSURLResponse *);
 
 }
 
index 51c882e2da1b1a7bf9919ad9d6d4a41ba9499020..ac0b141ec0924058ba80b71185b2648c3f60b1d4 100644 (file)
 #import "ResourceResponseMac.h"
 
 #import "ResourceResponse.h"
-
 #import <Foundation/Foundation.h>
+#import <limits>
 
 @interface NSURLResponse (FoundationSecretsWebCoreKnowsAbout)
 - (NSTimeInterval)_calculatedExpiration;
 @end
 
-// We would like a better value for a maximum time_t,
-// but there is no way to do that in C with any certainty.
-// INT_MAX should work well enough for our purposes.
-#define MAX_TIME_T ((time_t)INT_MAX)    
-
 namespace WebCore {
 
-   void getResourceResponse(ResourceResponse& response, NSURLResponse *nsResponse)
-   {
-       response = ResourceResponse([nsResponse URL], [nsResponse MIMEType], [nsResponse expectedContentLength], [nsResponse textEncodingName], [nsResponse suggestedFilename]);
+void getResourceResponse(ResourceResponse& response, NSURLResponse *nsResponse)
+{
+    response = ResourceResponse([nsResponse URL], [nsResponse MIMEType],
+        [nsResponse expectedContentLength], [nsResponse textEncodingName],
+        [nsResponse suggestedFilename]);
 
-       NSTimeInterval expiration = [nsResponse _calculatedExpiration];
-       expiration += kCFAbsoluteTimeIntervalSince1970;
-       response.setExpirationDate(expiration > MAX_TIME_T ? MAX_TIME_T : (time_t)expiration);
+    const time_t maxTime = std::numeric_limits<time_t>::max();
 
+    NSTimeInterval expiration = [nsResponse _calculatedExpiration];
+    expiration += kCFAbsoluteTimeIntervalSince1970;
+    response.setExpirationDate(expiration > maxTime ? maxTime : static_cast<time_t>(expiration));
 
-       if ([nsResponse isKindOfClass:[NSHTTPURLResponse class]]) {
-           NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)nsResponse;
+    if ([nsResponse isKindOfClass:[NSHTTPURLResponse class]]) {
+        NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)nsResponse;
 
-           response.setHTTPStatusCode([httpResponse statusCode]);
+        response.setHTTPStatusCode([httpResponse statusCode]);
 
-           // FIXME: it would be nice to have a way to get the real
-           // status text eventually
-           response.setHTTPStatusText("OK");
-           
-           NSDictionary *headers = [httpResponse allHeaderFields];
-           NSEnumerator *e = [headers keyEnumerator];
-           NSString *name;
-           while ((name = [e nextObject]))
-               response.httpHeaderFields().set(name, [headers objectForKey:name]);
-       } 
-   }
+        // FIXME: it would be nice to have a way to get the real status text eventually.
+        response.setHTTPStatusText("OK");
+       
+        NSDictionary *headers = [httpResponse allHeaderFields];
+        NSEnumerator *e = [headers keyEnumerator];
+        while (NSString *name = [e nextObject])
+            response.httpHeaderFields().set(name, [headers objectForKey:name]);
+   } 
+}
 
 }
index 6fa612923535c0058b9db848a3cb2afa0dfd078a..65345f041288ac5e4e693ddd3c9c606092f090a0 100644 (file)
 
 #include "CString.h"
 #include "DocLoader.h"
-#include "Frame.h"
 #include "Document.h"
+#include "Frame.h"
 #include "Page.h"
+#include "Timer.h"
 #include <windows.h>
 #include <wininet.h>
 
index ff02fec4ed811db3cd3801856c2ec678e5593dc0..cca4ef5f6654956f958de564aafdd43b317b63ef 100644 (file)
@@ -126,7 +126,7 @@ FrameQt::~FrameQt()
     cancelAndClear();
 }
 
-void FrameQt::submitForm(const FrameLoadRequest& frameLoadRequest)
+void FrameQt::submitForm(const FrameLoadRequest& frameLoadRequest, Event*)
 {
     const ResourceRequest& request = frameLoadRequest.resourceRequest();
 
@@ -142,7 +142,7 @@ void FrameQt::submitForm(const FrameLoadRequest& frameLoadRequest)
     clearRecordedFormValues();
 }
 
-void FrameQt::urlSelected(const FrameLoadRequest& frameLoadRequest, const Event*)
+void FrameQt::urlSelected(const FrameLoadRequest& frameLoadRequest, Event*)
 {
     const ResourceRequest& request = frameLoadRequest.resourceRequest();
 
index 5dcf419aaf27acda7ca5fba2cabc074483927209..2b7f031af0c6fe503cf2c6b65af6aa68880e7438 100644 (file)
@@ -48,8 +48,8 @@ public:
     FrameQt(Page*, Element*, FrameQtClient*, EditorClient* client = 0);
     virtual ~FrameQt();
 
-    virtual void submitForm(const FrameLoadRequest&);
-    virtual void urlSelected(const FrameLoadRequest&, const Event*);
+    virtual void submitForm(const FrameLoadRequest&, Event*);
+    virtual void urlSelected(const FrameLoadRequest&, Event*);
 
     virtual void setTitle(const String&);
 
index 18ce22d6c6e60e482dbb544306cac6d73744d0dd..424653731572875ec8203790847db3240bbdff44 100644 (file)
@@ -79,7 +79,7 @@ void RenderLineEdit::returnPressed(Widget*)
     }
 
     if (HTMLFormElement* fe = static_cast<HTMLGenericFormElement*>(node())->form())
-        fe->submitClick();
+        fe->submitClick(0);
 }
 
 void RenderLineEdit::performSearch(Widget*)
index a96f774c3d2cb952b2f6375ede0db91de9823d12..e14619aace025883ab47d9f273c8a397b5a27613 100644 (file)
@@ -33,7 +33,6 @@
 #include "SVGPreserveAspectRatio.h"
 #include "SVGImageElement.h"
 #include "SVGImageElement.h"
-#include "ksvg.h"
 #include <wtf/OwnPtr.h>
 
 namespace WebCore {
index 1beccf5848e7a6acdbbedecdf7a43cdfe80cd1e2..c7f55b5968d956b1a17fa5ea3dc0ef3325a4d593 100644 (file)
@@ -36,6 +36,7 @@
 #include "HTMLTokenizer.h"
 #include "LoaderFunctions.h"
 #include "ResourceHandle.h"
+#include "ResourceRequest.h"
 #include "ResourceResponse.h"
 #include "Text.h"
 #include "loader.h"
@@ -85,12 +86,11 @@ static xmlDocPtr docLoaderFunc(const xmlChar *uri,
             xmlChar *base = xmlNodeGetBase(context->document->doc, context->node);
             KURL url((const char*)base, (const char*)uri);
             xmlFree(base);
-            ResourceRequest request(url);
             ResourceResponse response;
             xmlGenericErrorFunc oldErrorFunc = xmlGenericError;
             void *oldErrorContext = xmlGenericErrorContext;
             
-            Vector<char> data = ServeSynchronousRequest(cache()->loader(), globalDocLoader, request, response);
+            Vector<char> data = ServeSynchronousRequest(cache()->loader(), globalDocLoader, url, response);
         
             xmlSetGenericErrorFunc(0, parseErrorFunc);
             // We don't specify an encoding here. Neither Gecko nor WinIE respects
index 44bf7bafd93692f338b3670a95750d6fd75ee630..a12c2cfee72072651d04a0e5323e41859c66c4e7 100644 (file)
@@ -35,6 +35,7 @@
 #include "PlatformString.h"
 #include "RegularExpression.h"
 #include "ResourceHandle.h"
+#include "ResourceRequest.h"
 #include "TextEncoding.h"
 #include "kjs_binding.h"
 #include <kjs/protect.h>
index 4f7d1a7365a63531b529032cdc4a6aad1095e0f8..c69d043f12028cb129c501072aceed93ddcf3f5e 100644 (file)
@@ -148,8 +148,6 @@ HRESULT STDMETHODCALLTYPE WebFrame::initWithName(
     }
 
     d->frame = frame;
-    frame->deref(); // Frames are created with a refcount of 1.  Release this ref, since we've assigned it to a RefPtr
-    page->setMainFrame(frame);
     FrameView* frameView = new FrameView(frame);
     d->frameView = frameView;
     frameView->deref(); // FrameViews are created with a refcount of 1.  Release this ref, since we've assigned it to a RefPtr
index 5fb3302b832a689df9b8452a5e89f8ea1cb0a8de..10b17b68afb549f6c3713ae52a781853fe47b262 100644 (file)
@@ -1,3 +1,51 @@
+2006-11-04  Darin Adler  <darin@apple.com>
+
+        Reviewed by Maciej.
+
+        - converted more of the loader machinery to work with cross-platform
+          data structures instead of Macintosh-specific ones
+
+          store the computed user agent string as a WebCore::String instead
+          of an NSString to avoid overhead converting it every time we get it
+
+        * COM/WebFrame.cpp:
+        (WebFrame::initWithName):
+        * ChangeLog:
+        * Misc/WebElementDictionary.m:
+        (-[WebElementDictionary _image]):
+        (-[WebElementDictionary _targetWebFrame]):
+        * WebCoreSupport/WebFrameLoaderClient.h:
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::dispatchWillPerformClientRedirect):
+        (WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent):
+        (WebFrameLoaderClient::setTitle):
+        (WebFrameLoaderClient::userAgent):
+        (WebFrameLoaderClient::actionDictionary):
+        * WebCoreSupport/WebPageBridge.mm:
+        (WebCore::if):
+        * WebView/WebDataSource.mm:
+        (-[WebDataSource _URL]):
+        (-[WebDataSource _URLForHistory]):
+        (-[WebDataSource unreachableURL]):
+        * WebView/WebHTMLView.m:
+        (-[WebHTMLView elementAtPoint:allowShadowContent:]):
+        * WebView/WebPDFView.mm:
+        (-[WebPDFView PDFViewWillClickOnLink:withURL:]):
+        (-[WebPDFView _path]):
+        * WebView/WebView.mm:
+        (-[WebViewPrivate init]):
+        (-[WebViewPrivate dealloc]):
+        (-[WebViewPrivate finalize]):
+        (-[WebView _preferencesChangedNotification:]):
+        (-[WebView _cachedResponseForURL:]):
+        (-[WebView setApplicationNameForUserAgent:]):
+        (-[WebView setCustomUserAgent:]):
+        (-[WebView customUserAgent]):
+        (-[WebView userAgentForURL:]):
+        (-[WebView _computeUserAgent]):
+        (-[WebView WebCore::]):
+        * WebView/WebViewInternal.h:
+
 2006-11-04  Bertrand Guiheneuf <guiheneuf@gmail.com>
 
         Reviewed by Maciej, tweaked and landed by Alexey (using a patch by Don Gibson).
index 514848ecc977ebe0564190cfc8d1070c05a30e3b..e2d0c0a77d06b0b070245b7f7e3795d9d4116374 100644 (file)
@@ -58,6 +58,7 @@ static void cacheValueForKey(const void *key, const void *value, void *self)
 }
 
 @implementation WebElementDictionary
+
 + (void)initializeLookupTable
 {
     if (lookupTable)
@@ -171,7 +172,7 @@ static void cacheValueForKey(const void *key, const void *value, void *self)
 
 - (NSImage *)_image
 {
-    Image *image = _result->image();
+    Imageimage = _result->image();
     return image ? image->getNSImage() : nil;
 }
 
@@ -204,8 +205,7 @@ static void cacheValueForKey(const void *key, const void *value, void *self)
 
 - (WebFrame *)_targetWebFrame
 {
-    FrameMac* webCoreFrame = Mac(_result->targetFrame());
-    return kit(webCoreFrame);
+    return kit(_result->targetFrame());
 }
 
 - (NSString *)_titleDisplayString
index fcc4895f61c430ea956328c62be02a9696d14275..d81028f72f6ac7de311f653581a9fe05e34efcfa 100644 (file)
@@ -109,7 +109,7 @@ private:
     virtual void dispatchDidHandleOnloadEvents();
     virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
     virtual void dispatchDidCancelClientRedirect();
-    virtual void dispatchWillPerformClientRedirect(NSURL *URL, double interval, double fireDate);
+    virtual void dispatchWillPerformClientRedirect(const WebCore::KURL&, double interval, double fireDate);
     virtual void dispatchDidChangeLocationWithinPage();
     virtual void dispatchWillClose();
     virtual void dispatchDidReceiveIcon(NSImage *);
@@ -173,7 +173,7 @@ private:
 
     virtual void setDefersLoading(bool);
 
-    virtual WebCore::String userAgent(NSURL *);
+    virtual WebCore::String userAgent();
 
     virtual bool willUseArchive(WebCore::ResourceLoader*, NSURLRequest *, NSURL *originalURL) const;
     virtual bool isArchiveLoadPending(WebCore::ResourceLoader*) const;
@@ -188,12 +188,12 @@ private:
     virtual void frameLoadCompleted();
     virtual void restoreScrollPositionAndViewState();
     virtual void provisionalLoadStarted();
-    virtual bool shouldTreatURLAsSameAsCurrent(NSURL *) const;
+    virtual bool shouldTreatURLAsSameAsCurrent(const WebCore::KURL&) const;
     virtual void addHistoryItemForFragmentScroll();
     virtual void didFinishLoad();
     virtual void prepareForDataSourceReplacement();
     virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(NSURLRequest *);
-    virtual void setTitle(const WebCore::String& title, NSURL *);
+    virtual void setTitle(const WebCore::String& title, const WebCore::KURL&);
 
     void deliverArchivedResourcesAfterDelay() const;
     bool canUseArchivedResource(NSURLRequest *) const;
@@ -203,7 +203,6 @@ private:
     WebFramePolicyListener *setUpPolicyListener(WebCore::FramePolicyFunction);
 
     NSDictionary *actionDictionary(const WebCore::NavigationAction&) const;
-    NSDictionary *elementForEvent(NSEvent *) const;
 
     bool createPageCache(WebHistoryItem *);
 
index 37814a1716b53e98d105205e4e7bed38bf8abbfa..ffe39f83e065cb49f70e13e0e5beec0cbebe8db4 100644 (file)
@@ -28,7 +28,7 @@
 
 #import "WebFrameLoaderClient.h"
 
-// Terrible hack, but needed so we can get right at the private structure.
+// Terrible hack; lets us get at the WebFrame private structure.
 #define private public
 #import "WebFrame.h"
 #undef private
@@ -39,6 +39,7 @@
 #import "WebDocumentInternal.h"
 #import "WebDocumentLoaderMac.h"
 #import "WebDownloadInternal.h"
+#import "WebElementDictionary.h"
 #import "WebFormDelegate.h"
 #import "WebFrameInternal.h"
 #import "WebFrameLoadDelegate.h"
@@ -67,6 +68,7 @@
 #import <WebCore/FrameMac.h>
 #import <WebCore/PageState.h>
 #import <WebCore/FrameTree.h>
+#import <WebCore/MouseEvent.h>
 #import <WebCore/Page.h>
 #import <WebCore/PlatformString.h>
 #import <WebCore/ResourceLoader.h>
@@ -540,11 +542,11 @@ void WebFrameLoaderClient::dispatchDidCancelClientRedirect()
     [[webView _frameLoadDelegateForwarder] webView:webView didCancelClientRedirectForFrame:m_webFrame.get()];
 }
 
-void WebFrameLoaderClient::dispatchWillPerformClientRedirect(NSURL *URL, double delay, double fireDate)
+void WebFrameLoaderClient::dispatchWillPerformClientRedirect(const KURL& URL, double delay, double fireDate)
 {
     WebView *webView = getWebView(m_webFrame.get());
     [[webView _frameLoadDelegateForwarder] webView:webView
-                         willPerformClientRedirectToURL:URL
+                         willPerformClientRedirectToURL:URL.getNSURL()
                                                   delay:delay
                                                fireDate:[NSDate dateWithTimeIntervalSince1970:fireDate]
                                                forFrame:m_webFrame.get()];
@@ -901,32 +903,6 @@ String WebFrameLoaderClient::generatedMIMETypeForURLScheme(const String& URLSche
     return [WebView _generatedMIMETypeForURLScheme:URLScheme];
 }
 
-NSDictionary *WebFrameLoaderClient::elementForEvent(NSEvent *event) const
-{
-    switch ([event type]) {
-        case NSLeftMouseDown:
-        case NSRightMouseDown:
-        case NSOtherMouseDown:
-        case NSLeftMouseUp:
-        case NSRightMouseUp:
-        case NSOtherMouseUp:
-            break;
-        default:
-            return nil;
-    }
-
-    NSView *topViewInEventWindow = [[event window] contentView];
-    NSView *viewContainingPoint = [topViewInEventWindow hitTest:
-        [topViewInEventWindow convertPoint:[event locationInWindow] fromView:nil]];
-    while (viewContainingPoint) {
-        if ([viewContainingPoint isKindOfClass:[WebView class]])
-            return [(WebView *)viewContainingPoint elementAtPoint:
-                [viewContainingPoint convertPoint:[event locationInWindow] fromView:nil]];
-        viewContainingPoint = [viewContainingPoint superview];
-    }
-    return nil;
-}
-
 void WebFrameLoaderClient::frameLoadCompleted()
 {
     // Note: Can be called multiple times.
@@ -1002,10 +978,10 @@ void WebFrameLoaderClient::provisionalLoadStarted()
     }
 }
 
-bool WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent(NSURL *URL) const
+bool WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent(const KURL& URL) const
 {
     WebHistoryItem *item = m_webFrame->_private->currentItem;
-    NSString* URLString = [URL _web_originalDataAsString];
+    NSString* URLString = [URL.getNSURL() _web_originalDataAsString];
     return [URLString isEqual:[item URLString]] || [URLString isEqual:[item originalURLString]];
 }
 
@@ -1058,10 +1034,10 @@ PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(NSURLReque
     return loader.release();
 }
 
-void WebFrameLoaderClient::setTitle(const String& title, NSURL *URL)
+void WebFrameLoaderClient::setTitle(const String& title, const KURL& URL)
 {
     NSString *titleNSString = title;
-    [[[WebHistory optionalSharedHistory] itemForURL:URL] setTitle:titleNSString];
+    [[[WebHistory optionalSharedHistory] itemForURL:URL.getNSURL()] setTitle:titleNSString];
     [m_webFrame->_private->currentItem setTitle:titleNSString];
 }
 
@@ -1179,24 +1155,43 @@ void WebFrameLoaderClient::receivedPolicyDecison(PolicyAction action)
     (core(m_webFrame.get())->loader()->*function)(action);
 }
 
-String WebFrameLoaderClient::userAgent(NSURL *URL)
+String WebFrameLoaderClient::userAgent()
 {
-    return [getWebView(m_webFrame.get()) userAgentForURL:URL];
+    return [getWebView(m_webFrame.get()) _userAgent];
 }
 
 NSDictionary *WebFrameLoaderClient::actionDictionary(const NavigationAction& action) const
 {
-    if (NSDictionary *elementInfo = elementForEvent(action.event()))
-        return [NSDictionary dictionaryWithObjectsAndKeys:
+    unsigned modifierFlags = 0;
+    const Event* event = action.event();
+    if (event && (event->isMouseEvent() || event->isKeyboardEvent())) {
+        if (static_cast<const UIEventWithKeyState*>(event)->ctrlKey())
+            modifierFlags |= NSControlKeyMask;
+        if (static_cast<const UIEventWithKeyState*>(event)->altKey())
+            modifierFlags |= NSAlternateKeyMask;
+        if (static_cast<const UIEventWithKeyState*>(event)->shiftKey())
+            modifierFlags |= NSShiftKeyMask;
+        if (static_cast<const UIEventWithKeyState*>(event)->metaKey())
+            modifierFlags |= NSCommandKeyMask;
+    }
+    if (event && event->isMouseEvent()) {
+        IntPoint point(static_cast<const MouseEvent*>(event)->clientX(),
+            static_cast<const MouseEvent*>(event)->clientY());
+        WebElementDictionary *element = [[WebElementDictionary alloc]
+            initWithHitTestResult:core(m_webFrame.get())->hitTestResultAtPoint(point, false)];
+        NSDictionary *result = [NSDictionary dictionaryWithObjectsAndKeys:
             [NSNumber numberWithInt:action.type()], WebActionNavigationTypeKey,
-            elementInfo, WebActionElementKey,
-            [NSNumber numberWithInt:[action.event() buttonNumber]], WebActionButtonKey,
-            [NSNumber numberWithInt:[action.event() modifierFlags]], WebActionModifierFlagsKey,
+            element, WebActionElementKey,
+            [NSNumber numberWithInt:static_cast<const MouseEvent*>(event)->button()], WebActionButtonKey,
+            [NSNumber numberWithInt:modifierFlags], WebActionModifierFlagsKey,
             action.URL().getNSURL(), WebActionOriginalURLKey,
             nil];
+        [element release];
+        return result;
+    }
     return [NSDictionary dictionaryWithObjectsAndKeys:
         [NSNumber numberWithInt:action.type()], WebActionNavigationTypeKey,
-        [NSNumber numberWithInt:[action.event() modifierFlags]], WebActionModifierFlagsKey,
+        [NSNumber numberWithInt:modifierFlags], WebActionModifierFlagsKey,
         action.URL().getNSURL(), WebActionOriginalURLKey,
         nil];
 }
index 192a07fde14e60b4e04716d28f2da4957be534ec..765a38e618457910f541f3fc03f2dc31ba5f235c 100644 (file)
@@ -52,9 +52,7 @@ using namespace WebCore;
     self = [super initWithChromeClient:WebChromeClient::create(webView)];
     if (self) {
         _webView = webView;
-        WebFrameBridge *mainFrame = [[WebFrameBridge alloc] initMainFrameWithPage:self frameName:frameName view:frameView];
-        [self setMainFrame:mainFrame];
-        [mainFrame release];
+        [[[WebFrameBridge alloc] initMainFrameWithPage:self frameName:frameName view:frameView] release];
     }
     return self;
 }
index eda672c28b6788dcacb790cae43bff6c89b232c4..6ed497a16fcceb1112ea08b542012cd41eee9701 100644 (file)
@@ -51,6 +51,7 @@
 #import "WebViewInternal.h"
 #import <JavaScriptCore/Assertions.h>
 #import <WebCore/FrameLoader.h>
+#import <WebCore/KURL.h>
 #import <WebCore/WebDataProtocol.h>
 #import <WebKit/DOMHTML.h>
 #import <WebKit/DOMPrivate.h>
@@ -283,7 +284,8 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
 // May return nil if not initialized with a URL.
 - (NSURL *)_URL
 {
-    return _private->loader->URL();
+    KURL URL = _private->loader->URL();
+    return URL.isEmpty() ? nil : URL.getNSURL();
 }
 
 - (void)_loadFromPageCache:(NSDictionary *)pageCache
@@ -337,7 +339,8 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
 
 - (NSURL *)_URLForHistory
 {
-    return [_private->loader->URLForHistory() _webkit_canonicalize];
+    KURL URL = _private->loader->URLForHistory().getNSURL();
+    return URL.isEmpty() ? nil : [URL.getNSURL() _webkit_canonicalize];
 }
 
 - (void)_addToUnarchiveState:(WebArchive *)archive
@@ -449,7 +452,8 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
 
 - (NSURL *)unreachableURL
 {
-    return _private->loader->unreachableURL();
+    KURL URL = _private->loader->unreachableURL();
+    return URL.isEmpty() ? nil : URL.getNSURL();
 }
 
 - (WebArchive *)webArchive
index 94b7a3e25bc1f166836dd2ae6072182b8f0ad9ec..7fa4dcb1252e288e62a6fed1426c491f4e362d9f 100644 (file)
@@ -6109,11 +6109,8 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 
 - (NSDictionary *)elementAtPoint:(NSPoint)point allowShadowContent:(BOOL)allow;
 {
-    Frame* frame = core([self _frame]);
-    HitTestResult result = HitTestResult(IntPoint(point));
-    if (frame->renderer())
-        result = frame->hitTestResultAtPoint(IntPoint(point), allow);
-    return [[[WebElementDictionary alloc] initWithHitTestResult:result] autorelease];
+    return [[[WebElementDictionary alloc] initWithHitTestResult:
+        core([self _frame])->hitTestResultAtPoint(IntPoint(point), allow)] autorelease];
 }
 
 @end
index 96cc41e736bdefc1819f7634667d5654d67765f0..5a56d5c725b7023e90f9431e359025c6fc6d0e3e 100644 (file)
 #import "WebUIDelegate.h"
 #import "WebView.h"
 #import "WebViewInternal.h"
+#import <WebCore/EventNames.h>
+#import <WebCore/KeyboardEvent.h>
+#import <WebCore/MouseEvent.h>
+#import <WebCore/PlatformKeyboardEvent.h>
 #import <JavaScriptCore/Assertions.h>
 #import <PDFKit/PDFKit.h>
 #import <WebCore/FrameLoader.h>
+#import <WebCore/KURL.h>
 #import <WebKitSystemInterface.h>
 
+using namespace WebCore;
+using namespace EventNames;
+
 #define TEMP_PREFIX "/tmp/XXXXXX-"
-#define OBJC_TEMP_PREFIX @"/tmp/XXXXXX-"
 
 #define PDFKitLaunchNotification @"PDFPreviewLaunchPreview"
 
@@ -815,12 +822,45 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
 
 #pragma mark PDFView DELEGATE METHODS
 
-// Delegates implementing the following method will be called to handle clicks on URL
-// links within the PDFView.  
 - (void)PDFViewWillClickOnLink:(PDFView *)sender withURL:(NSURL *)URL
 {
-    if (URL)
-        [[dataSource webFrame] _frameLoader]->safeLoad(URL);
+    if (!URL)
+        return;
+
+    NSWindow *window = [sender window];
+    NSEvent *nsEvent = [window currentEvent];
+    const int noButton = -1;
+    int button = noButton;
+    RefPtr<Event> event;
+    switch ([nsEvent type]) {
+        case NSLeftMouseUp:
+            button = 0;
+            break;
+        case NSRightMouseUp:
+            button = 1;
+            break;
+        case NSOtherMouseUp:
+            button = [nsEvent buttonNumber];
+            break;
+        case NSKeyDown: {
+            PlatformKeyboardEvent pe(nsEvent);
+            event = new KeyboardEvent(keydownEvent, true, true, 0,
+                pe.keyIdentifier(), pe.WindowsKeyCode(),
+                pe.ctrlKey(), pe.altKey(), pe.shiftKey(), pe.metaKey(), false);
+        }
+        default:
+            break;
+    }
+    if (button != noButton)
+        event = new MouseEvent(clickEvent, true, true, 0, [nsEvent clickCount], 0, 0, 0, 0,
+            [nsEvent modifierFlags] & NSControlKeyMask,
+            [nsEvent modifierFlags] & NSAlternateKeyMask,
+            [nsEvent modifierFlags] & NSShiftKeyMask,
+            [nsEvent modifierFlags] & NSCommandKeyMask,
+            button, 0, 0, true);
+
+    // Call to the frame loader because this is where our security checks are made.
+    [[dataSource webFrame] _frameLoader]->load(URL, event.get());
 }
 
 @end
@@ -984,18 +1024,18 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
     NSString *filename = [[dataSource response] suggestedFilename];
     NSFileManager *manager = [NSFileManager defaultManager];    
     
-    path = [@"/tmp/" stringByAppendingPathComponent: filename];
+    path = [@"/tmp/" stringByAppendingPathComponent:filename];
     if ([manager fileExistsAtPath:path]) {
-        path = [OBJC_TEMP_PREFIX stringByAppendingString:filename];
+        path = [@"" TEMP_PREFIX stringByAppendingString:filename];
+        // FIXME: Bad style to modify the path returned by fileSystemRepresentation!
         char *cpath = (char *)[path fileSystemRepresentation];
-        
-        int fd = mkstemps (cpath, strlen(cpath) - strlen(TEMP_PREFIX) + 1);
+        int fd = mkstemps(cpath, strlen(cpath) - strlen(TEMP_PREFIX) + 1);
         if (fd < 0) {
-            // Couldn't create a temporary file!  Should never happen.  Do
-            // we need an alert here?
+            // Couldn't create a temporary file! Should never happen.
+            // Do we need an alert here?
             path = nil;
         } else {
-            close (fd);
+            close(fd);
             path = [manager stringWithFileSystemRepresentation:cpath length:strlen(cpath)];
         }
     }
index 64305b4a2a188c85782ecc5cac098377330d937a..8ad859c538004ab4824e0c24c6043cdae1e1fd15 100644 (file)
@@ -254,7 +254,7 @@ macro(yankAndSelect) \
     float textSizeMultiplier;
 
     NSString *applicationNameForUserAgent;
-    NSString *userAgent;
+    String* userAgent;
     BOOL userAgentOverridden;
     
     WebPreferences *preferences;
@@ -379,7 +379,6 @@ NSString *_WebMainFrameDocumentKey =    @"mainFrameDocument";
 @implementation WebProgressItem
 @end
 
-
 static BOOL continuousSpellCheckingEnabled;
 #if !BUILDING_ON_TIGER
 static BOOL grammarCheckingEnabled;
@@ -405,6 +404,7 @@ static BOOL grammarCheckingEnabled;
 #if !BUILDING_ON_TIGER
     grammarCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebGrammarCheckingEnabled];
 #endif
+    userAgent = new String;
     
     return self;
 }
@@ -413,10 +413,11 @@ static BOOL grammarCheckingEnabled;
 {
     ASSERT(!_pageBridge);
     ASSERT(draggingDocumentView == nil);
-    
+
+    delete userAgent;
+
     [backForwardList release];
     [applicationNameForUserAgent release];
-    [userAgent release];
     [backgroundColor release];
     
     [preferences release];
@@ -437,6 +438,12 @@ static BOOL grammarCheckingEnabled;
     [super dealloc];
 }
 
+- (void)finalize
+{
+    delete userAgent;
+    [super finalize];
+}
+
 @end
 
 @implementation WebView (AllWebViews)
@@ -888,10 +895,8 @@ static bool debugWidget = true;
     WebPreferences *preferences = (WebPreferences *)[notification object];
     
     ASSERT(preferences == [self preferences]);
-    if (!_private->userAgentOverridden) {
-        [_private->userAgent release];
-        _private->userAgent = nil;
-    }
+    if (!_private->userAgentOverridden)
+        *_private->userAgent = String();
     [self _updateWebCoreSettingsFromPreferences: preferences];
 }
 
@@ -1346,7 +1351,7 @@ WebResourceDelegateImplementationCache WebViewGetResourceLoadDelegateImplementat
 - (NSCachedURLResponse *)_cachedResponseForURL:(NSURL *)URL
 {
     NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
-    [request _web_setHTTPUserAgent:[self userAgentForURL:URL]];
+    [request _web_setHTTPUserAgent:[self _userAgent]];
     NSCachedURLResponse *cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
     [request release];
     return cachedResponse;
@@ -2177,10 +2182,8 @@ NS_ENDHANDLER
     NSString *name = [applicationName copy];
     [_private->applicationNameForUserAgent release];
     _private->applicationNameForUserAgent = name;
-    if (!_private->userAgentOverridden) {
-        [_private->userAgent release];
-        _private->userAgent = nil;
-    }
+    if (!_private->userAgentOverridden)
+        *_private->userAgent = String();
 }
 
 - (NSString *)applicationNameForUserAgent
@@ -2190,15 +2193,15 @@ NS_ENDHANDLER
 
 - (void)setCustomUserAgent:(NSString *)userAgentString
 {
-    NSString *override = [userAgentString copy];
-    [_private->userAgent release];
-    _private->userAgent = override;
-    _private->userAgentOverridden = override != nil;
+    *_private->userAgent = userAgentString;
+    _private->userAgentOverridden = userAgentString != nil;
 }
 
 - (NSString *)customUserAgent
 {
-    return _private->userAgentOverridden ? [[_private->userAgent retain] autorelease] : nil;
+    if (!_private->userAgentOverridden)
+        return nil;
+    return *_private->userAgent;
 }
 
 - (void)setMediaStyle:(NSString *)mediaStyle
@@ -2260,26 +2263,7 @@ NS_ENDHANDLER
 // Since we no longer automatically spoof, this no longer requires looking at the URL.
 - (NSString *)userAgentForURL:(NSURL *)URL
 {
-    NSString *userAgent = _private->userAgent;
-    if (userAgent) {
-        return [[userAgent retain] autorelease];
-    }
-    
-    NSString *language = [NSUserDefaults _webkit_preferredLanguageCode];
-    id sourceVersion = [[NSBundle bundleForClass:[WebView class]]
-        objectForInfoDictionaryKey:(id)kCFBundleVersionKey];
-    NSString *applicationName = _private->applicationNameForUserAgent;
-
-    if ([applicationName length]) {
-        userAgent = [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X; %@) AppleWebKit/%@ (KHTML, like Gecko) %@",
-            language, sourceVersion, applicationName];
-    } else {
-        userAgent = [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X; %@) AppleWebKit/%@ (KHTML, like Gecko)",
-            language, sourceVersion];
-    }
-
-    _private->userAgent = [userAgent retain];
-    return userAgent;
+    return [self _userAgent];
 }
 
 - (void)setHostWindow:(NSWindow *)hostWindow
@@ -2706,6 +2690,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 
     [inspector showWindow:nil];
 }
+
 @end
 
 @implementation WebView (WebIBActions)
@@ -3662,11 +3647,34 @@ static WebFrameView *containingFrameView(NSView *view)
 
 @end
 
-@implementation WebView (WebViewBridge)
+@implementation WebView (WebViewInternal)
 
 - (WebPageBridge *)_pageBridge
 {
     return _private->_pageBridge;
 }
 
+- (void)_computeUserAgent
+{
+    NSString *userAgent;
+    NSString *language = [NSUserDefaults _webkit_preferredLanguageCode];
+    id sourceVersion = [[NSBundle bundleForClass:[WebView class]]
+        objectForInfoDictionaryKey:(id)kCFBundleVersionKey];
+    NSString *applicationName = _private->applicationNameForUserAgent;
+    if ([applicationName length])
+        userAgent = [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X; %@) AppleWebKit/%@ (KHTML, like Gecko) %@",
+            language, sourceVersion, applicationName];
+    else
+        userAgent = [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X; %@) AppleWebKit/%@ (KHTML, like Gecko)",
+            language, sourceVersion];
+    *_private->userAgent = userAgent;
+}
+
+- (WebCore::String&)_userAgent
+{
+    if (_private->userAgent->isNull())
+        [self _computeUserAgent];
+    return *_private->userAgent;
+}
+
 @end
index 1c67293364d3d6c33023b7b51a1629dd02787198..21410eb7545099deb6a618b0dd91eaddc862390d 100644 (file)
 @class WebPageBridge;
 @class WebBasePluginPackage;
 
+#ifdef __cplusplus
+namespace WebCore {
+    class String;
+}
+#endif
+
 @interface WebView (WebViewEditingExtras)
 - (BOOL)_interceptEditingKeyEvent:(NSEvent *)event;
 - (BOOL)_shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag;
 - (void)_addToAllWebViewsSet;
 @end
 
-@interface WebView (WebViewBridge)
+@interface WebView (WebViewInternal)
 - (WebPageBridge *)_pageBridge;
+#ifdef __cplusplus
+- (WebCore::String&)_userAgent;
+#endif
 @end
 
 id WebViewGetResourceLoadDelegate(WebView *webView);