Changeset 17396 in webkit


Ignore:
Timestamp:
Oct 27, 2006 10:08:17 PM (17 years ago)
Author:
mjs
Message:

WebCore:

Reviewed by John & Adam.

  • assorted speedups to fix perf regression from fixing correctness regression
  • WebCore.exp: exported new methods.
  • WebCore.xcodeproj/project.pbxproj: Added CachedResourceMac.mm
  • bridge/mac/WebCoreFrameBridge.h:
  • bridge/mac/WebCoreFrameBridge.mm:
  • loader/CachedResource.cpp: Removed now obsolete getCFURL.
  • loader/CachedResource.h:
  • loader/mac/CachedResourceMac.mm: Added. (WebCore::CachedResource::getNSURLRequest): New method; the NSURLRequest is now cached in the CachedObject.
  • loader/mac/FrameLoader.h:
  • loader/mac/FrameLoader.mm: (WebCore::FrameLoader::loadedResourceFromMemoryCache): New method - lets the WebKit side do faster dispatch for clients that implement the fast path delegate.
  • loader/mac/LoaderFunctionsMac.mm: (WebCore::CheckCacheObjectStatus): Instead of calling several FrameLoader methods, just call loadedResourceFromMemoryCache.
  • loader/mac/WebFrameLoaderClient.h:

WebKit:

Reviewed by John & Adam.


  • various performance improvements for resource delegate dispatch.


  • avoid any ObjC messaging when fetching the WebView
  • avoid ObjC calls to WebView to get resource load delegate and impl cache
  • cache actual method pointers, not just the fact that the method is present
  • added a new SPI resource load delegate method which allows clients to get just one message in case of synchronously loading from memory cache; if this is implemented you don't get the normal delegate calls in that case.
  • various other minor tweaks
  • WebCoreSupport/WebFrameBridge.h:
  • WebCoreSupport/WebFrameLoaderClient.h:
  • WebCoreSupport/WebFrameLoaderClient.mm: (getWebView): (WebFrameLoaderClient::hasBackForwardList): (WebFrameLoaderClient::resetBackForwardList): (WebFrameLoaderClient::privateBrowsingEnabled): (WebFrameLoaderClient::updateHistoryForStandardLoad): (WebFrameLoaderClient::resetAfterLoadError): (WebFrameLoaderClient::download): (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache): (WebFrameLoaderClient::dispatchIdentifierForInitialRequest): (WebFrameLoaderClient::dispatchWillSendRequest): (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidReceiveResponse): (WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebFrameLoaderClient::dispatchDidFinishLoading): (WebFrameLoaderClient::dispatchDidFailLoading): (WebFrameLoaderClient::dispatchDidHandleOnloadEvents): (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebFrameLoaderClient::dispatchDidCancelClientRedirect): (WebFrameLoaderClient::dispatchWillPerformClientRedirect): (WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): (WebFrameLoaderClient::dispatchWillClose): (WebFrameLoaderClient::dispatchDidReceiveIcon): (WebFrameLoaderClient::dispatchDidStartProvisionalLoad): (WebFrameLoaderClient::dispatchDidReceiveTitle): (WebFrameLoaderClient::dispatchDidCommitLoad): (WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebFrameLoaderClient::dispatchDidFailLoad): (WebFrameLoaderClient::dispatchDidFinishLoad): (WebFrameLoaderClient::dispatchDidFirstLayout): (WebFrameLoaderClient::dispatchCreatePage): (WebFrameLoaderClient::dispatchShow): (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType): (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): (WebFrameLoaderClient::dispatchUnableToImplementPolicy): (WebFrameLoaderClient::dispatchWillSubmitForm): (WebFrameLoaderClient::dispatchDidLoadMainResource): (WebFrameLoaderClient::progressStarted): (WebFrameLoaderClient::progressCompleted): (WebFrameLoaderClient::incrementProgress): (WebFrameLoaderClient::completeProgress): (WebFrameLoaderClient::setMainFrameDocumentReady): (WebFrameLoaderClient::startDownload): (WebFrameLoaderClient::willChangeTitle): (WebFrameLoaderClient::didChangeTitle): (WebFrameLoaderClient::mainFrameURL): (WebFrameLoaderClient::frameLoadCompleted):
  • WebCoreSupport/WebPageBridge.h:
  • WebKit.xcodeproj/project.pbxproj:
  • WebView/WebFrame.mm: (frame): (core): (kit): (getWebView): (-[WebFrame _addBackForwardItemClippedAtTarget:]): (-[WebFrame _canCachePage]): (-[WebFrame _purgePageCache]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _goToItem:withLoadType:]): (-[WebFrame _updateBackground]): (-[WebFrame _clearSelectionInOtherFrames]): (-[WebFrame _isMainFrame]): (-[WebFrame webView]):
  • WebView/WebResourceLoadDelegatePrivate.h: Added.
  • WebView/WebView.mm: (-[WebView _cacheResourceLoadDelegateImplementations]): (WebViewGetResourceLoadDelegate): (WebViewGetResourceLoadDelegateImplementations):
  • WebView/WebViewInternal.h:
  • WebView/WebViewPrivate.h:
Location:
trunk
Files:
2 added
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r17395 r17396  
     12006-10-27  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by John & Adam.
     4
     5        - assorted speedups to fix perf regression from fixing correctness regression
     6
     7        * WebCore.exp: exported new methods.
     8        * WebCore.xcodeproj/project.pbxproj: Added CachedResourceMac.mm
     9        * bridge/mac/WebCoreFrameBridge.h:
     10        * bridge/mac/WebCoreFrameBridge.mm:
     11        * loader/CachedResource.cpp: Removed now obsolete getCFURL.
     12        * loader/CachedResource.h:
     13        * loader/mac/CachedResourceMac.mm: Added.
     14        (WebCore::CachedResource::getNSURLRequest): New method; the NSURLRequest is
     15        now cached in the CachedObject.
     16        * loader/mac/FrameLoader.h:
     17        * loader/mac/FrameLoader.mm:
     18        (WebCore::FrameLoader::loadedResourceFromMemoryCache): New method - lets
     19        the WebKit side do faster dispatch for clients that implement the fast path delegate.
     20        * loader/mac/LoaderFunctionsMac.mm:
     21        (WebCore::CheckCacheObjectStatus): Instead of calling several FrameLoader methods,
     22        just call loadedResourceFromMemoryCache.
     23        * loader/mac/WebFrameLoaderClient.h:
     24
    1252006-10-27  Oliver Hunt  <oliver@apple.com>
    226
     
    5882        (WebCore::enclosingDeletableElement):
    5983        (WebCore::DeleteButtonController::respondToChangedSelection):
     84
     852006-10-27  John Sullivan  <sullivan@apple.com>
     86
     87        Reviewed by Anders
     88
     89        * WebCore.exp:
     90        exported symbol for FrameMac->advanceToNextSpelling()
     91       
     92        * bridge/mac/WebCoreFrameBridge.h:
     93        * bridge/mac/WebCoreFrameBridge.mm:
     94        removed advanceToNextMisspelling callers. Clients in WebKit must now call FrameMac directly.
     95
     962006-10-27  Justin Garcia  <justin.garcia@apple.com>
     97
     98        Reviewed by harrison
     99       
     100        <http://bugs.webkit.org/show_bug.cgi?id=11423>
     101        REGRESSION: First newline missing from textarea's value
     102       
     103        The regression is that foo, return, bar in a textarea serializes as 'foobar'.
     104       
     105        Before my change in r17223, return (an InsertLineBreak) would insert a '\n'
     106        (the line break) then a br to prevent the '\n' from collapsing, since the
     107        insertion is being done at the end of a block (the textarea's shadow div).  Then,
     108        inserting "bar" would displace the br, and "foo\nbar" would serialize as "foo\nbar". 
     109        After my change in r17223, InsertLineBreak would insert a br then a '\n' (reversed
     110        the order).  Then inserting "bar" would displace the '\n' and "foo"<br>"bar" would
     111        serialize as "foobar" because when serializing RenderTextControl intentionally asks
     112        textContent to not convert brs to newlines.  It seems to think that the only brs in
     113        the shadow div will be placeholders or collapsed.
     114       
     115        We could remove this assumption, but, for consistancy's sake, I changed InsertLineBreak
     116        to insert two '\n's when at the end of a block in white-space:pre text.  This alone
     117        would have fixed the bug, but introduced a new one, because foo, return, bar would
     118        produce "foo\nbar\n" which would serialize as "foo\nbar\n" (even though the second
     119        '\n' is collapsed, because of 9661).  So, then I changed placeholder displacement to
     120        displace a '\n' if it's acting as a placeholder.  A "placeholder" is now defined as
     121        a br or '\n' that will collapse (become superfluous) when content is inserted just
     122        before it.
     123       
     124        * editing/CompositeEditCommand.cpp:
     125        (WebCore::CompositeEditCommand::removePlaceholderAt): Renamed.  Remove
     126        a br or '\n' if content inserted just before it will cause it to collapse.
     127        * editing/CompositeEditCommand.h:
     128        * editing/InsertLineBreakCommand.cpp:
     129        (WebCore::InsertLineBreakCommand::doApply): Insert the same type of node
     130        to prevent a collapse as was used for the line break.  Fixed comments.
     131        * editing/InsertTextCommand.cpp:
     132        (WebCore::InsertTextCommand::input): Call the renamed function.
     133       
     1342006-10-27  Geoffrey Garen  <ggaren@apple.com>
     135
     136        Reviewed by Brady.
     137
     138        Fixed semantic inaccuracy in String::operator NSString *(), where a NULL
     139        String became an empty NSString *, instead of nil. This will become important
     140        as we start using this conversion more.
     141       
     142        Added work-around for AppKit crash that semantic accuracy revealed.
     143       
     144        No testcase because I don't think there's a way to reflect this change
     145        in a webpage yet.
     146
     147        * platform/PlatformString.h:
     148        (WebCore::String::operator NSString*):
     149        * platform/mac/TextFieldMac.mm:
     150        (-[NSSearchFieldCell _addStringToRecentSearches:]):
     151
     1522006-10-27  David Harrison  <harrison@apple.com>
     153
     154        Reviewed by Maciej,
     155
     156        <rdar://problem/4003820> Expose blockquotes in AXAttributedStringForTextMarkerRange
     157
     158        * bridge/mac/WebCoreAXObject.mm:
     159        (blockquoteLevel):
     160        Calculate and return the blockquote level of the element.
     161       
     162        (AXAttributeStringSetBlockquoteLevel):
     163        Add, if non-zero, or clear the block quote level attribute.
     164       
     165        (AXAttributedStringAppendText):
     166        Send AXAttributeStringSetBlockquoteLevel.
     167
     1682006-10-27  Darin Adler  <darin@apple.com>
     169
     170        - fix one error in the Qt build
     171
     172        * platform/qt/GraphicsContextQt.cpp:
     173        (WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar):
     174        Updated.
     175
     1762006-10-27  Darin Adler  <darin@apple.com>
     177
     178        Reviewed by Maciej.
     179
     180        * WebCore.exp: Export more symbols needed by WebKit.
     181
     1822006-10-26  Geoffrey Garen  <ggaren@apple.com>
     183
     184        Reviewed by the Baroness Esmeralda Von Scratch N' Purr XIV.
     185
     186        Fixed layout test crash. Oops.
     187       
     188        * loader/mac/WebDocumentLoader.mm:
     189        (WebCore::canonicalizedTitle):
     190
     1912006-10-26  John Sullivan  <sullivan@apple.com>
     192
     193        Reviewed by Brady
     194       
     195        - fixed <rdar://problem/4806064> Repro crash in FrameMac::loadRequest following iTunes music store link from salon.com
     196       
     197        This restores some of the nil-handling that was implicit before some of the code was converted from
     198        Objective-C to C++.
     199
     200        * bridge/mac/FrameMac.mm:
     201        (WebCore::FrameMac::loadRequest):
     202        handle nil FrameMac
     203       
     204        * bridge/mac/WebCoreFrameBridge.mm:
     205        (-[WebCoreFrameBridge canTargetLoadInFrame:]):
     206        handle nil Frame
     207
     2082006-10-26  Geoffrey Garen  <ggaren@apple.com>
     209
     210        Reviewed by Darin, Maciej.
     211
     212        Removed many uses of NSString *.
     213        Moved a few methods from WebCoreFrameBridge to FrameLoader, replacing
     214        stringByCollapsingNonPrintingCharacters with a c++ equivalent.
     215       
     216        PLT says no performance regression.
     217       
     218        * WebCore.exp:
     219        * bridge/mac/WebCoreFrameBridge.mm:
     220        (-[WebCoreFrameBridge receivedData:textEncodingName:]):
     221        * loader/mac/FrameLoader.h:
     222        * loader/mac/FrameLoader.mm:
     223        (WebCore::FrameLoader::setupForReplaceByMIMEType):
     224        (WebCore::FrameLoader::load):
     225        (WebCore::FrameLoader::canShowMIMEType):
     226        (WebCore::FrameLoader::representationExistsForURLScheme):
     227        (WebCore::FrameLoader::generatedMIMETypeForURLScheme):
     228        (WebCore::FrameLoader::checkContentPolicy):
     229        (WebCore::FrameLoader::reloadAllowingStaleData):
     230        (WebCore::FrameLoader::invalidatePendingPolicyDecision):
     231        (WebCore::FrameLoader::checkNewWindowPolicy):
     232        (WebCore::FrameLoader::continueAfterNewWindowPolicy):
     233        (WebCore::FrameLoader::transitionToCommitted):
     234        (WebCore::FrameLoader::continueLoadRequestAfterNewWindowPolicy):
     235        (WebCore::FrameLoader::post):
     236        * loader/mac/WebDocumentLoader.h:
     237        * loader/mac/WebDocumentLoader.mm:
     238        (WebCore::DocumentLoader::doesProgressiveLoad):
     239        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
     240        (WebCore::DocumentLoader::title):
     241        (WebCore::DocumentLoader::setOverrideEncoding):
     242        (WebCore::DocumentLoader::overrideEncoding):
     243        (WebCore::DocumentLoader::setTitle):
     244        * loader/mac/WebFrameLoaderClient.h:
     245        * loader/mac/WebMainResourceLoader.mm:
     246        (WebCore::MainResourceLoader::continueAfterContentPolicy):
     247
     2482006-10-26  Timothy Hatcher  <timothy@apple.com>
     249
     250        Reviewed by Adam.
     251
     252        <rdar://problem/4796941> Table deletion outline is misplaced at nytimes.com
     253
     254        The main table at nytimes.com has a fixed width of 874px, but the table ends
     255        up overflowing to 963px. We now use overflowWidth() and overflowHeight() to correct
     256        this. The other bug was a missing top and left of 0px on the container element,
     257        causing the deletion UI to sometimes be offset below the table.
     258
     259        Now check for the element's renderer at the beginning of show() and
     260        return early if it is null.
     261
     262        * editing/DeleteButtonController.cpp:
     263        (WebCore::DeleteButtonController::updateOutlineStyle):
     264        (WebCore::DeleteButtonController::show):
     265
     2662006-10-26  Anders Carlsson  <acarlsson@apple.com>
     267
     268        Build fix.
     269
     270        * html/CanvasRenderingContext2D.cpp:
     271        Include MathExtras.h
     272       
     2732006-10-26  John Sullivan  <sullivan@apple.com>
     274
     275        Reviewed by Anders.
     276
     277        Some changes to support new grammar checking code in WebKit.
     278
     279        * WebCore.exp:
     280        added mangled symbol for Document->removeMarkers() so I can call it from WebKit
     281       
     282        * WebCore.xcodeproj/project.pbxproj:
     283        Made Document.h and DocumentMarker.h private so I can include them from WebKit.
     284        Made HTMLCollection.h private because Document.h uses it.
     285       
     286        * bridge/mac/WebCoreFrameBridge.h:
     287        * bridge/mac/WebCoreFrameBridge.mm:
     288        removed unmarkAllMisspellings(); WebKit now calls through to the Document directly
     289
     2902006-10-26  Anders Carlsson  <acarlsson@apple.com>
     291
     292        Reviewed by Brady.
     293
     294        Add reverseFind to String and use it instead of findRev.
     295        Use CString instead of DeprecatedCString in one place.
     296       
     297        * html/HTMLFormElement.cpp:
     298        (WebCore::HTMLFormElement::formData):
     299        * ksvg2/svg/SVGURIReference.cpp:
     300        (WebCore::SVGURIReference::getTarget):
     301        * loader/Decoder.cpp:
     302        (WebCore::Decoder::checkForCSSCharset):
     303        * platform/PlatformString.h:
     304        (WebCore::String::reverseFind):
     305        * platform/StringImpl.cpp:
     306        (WebCore::StringImpl::reverseFind):
     307        * platform/StringImpl.h:
     308
     3092006-10-26  John Sullivan  <sullivan@apple.com>
     310
     311        Reviewed by Darin
     312       
     313        More plumbing for grammar checking. Still no grammars is checked.
     314
     315        * dom/DocumentMarker.h:
     316        (WebCore::DocumentMarker::):
     317        added Grammar to enum of marker types; removed explicit enum values; removed unnecessary "enum"
     318       
     319        * platform/GraphicsContext.h:
     320        renamed method drawLineForMisspelling to drawLineForMisspellingOrBadGrammar;
     321        now takes a bool parameter for whether it represents bad grammar or a misspelling
     322       
     323        * platform/mac/GraphicsContextMac.mm:
     324        (WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar):
     325        Renamed from drawLineForMisspelling; uses green dot instead of red dot for grammar case. Changed
     326        an existing "assert" to "ASSERT".
     327       
     328        * rendering/InlineTextBox.h:
     329        renamed function paintSpellingMarker to paintSpellingOrGrammarMarker;
     330
     331        * rendering/InlineTextBox.cpp:
     332        (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
     333        Renamed from paintSpellingMarker; now takes a bool parameter for whether it represents
     334        bad grammar or a misspelling
     335        (WebCore::InlineTextBox::paintAllMarkersOfType):
     336        now handles markers of type Grammar
     337
     338=== Safari-521.29 ===
     339       
     3402006-10-26  Sam Weinig  <sam.weinig@gmail.com>
     341
     342        Reviewed by Mitz.
     343
     344        Fix for http://bugs.webkit.org/show_bug.cgi?id=11424
     345        Cleanup rendering code
     346
     347        - Assorted code cleanup.
     348
     349        * rendering/AutoTableLayout.cpp:
     350        * rendering/AutoTableLayout.h:
     351        (WebCore::AutoTableLayout::totalPercent):
     352        * rendering/CounterListItem.h:
     353        * rendering/CounterNode.cpp:
     354        * rendering/CounterNode.h:
     355        (WebCore::CounterNode::~CounterNode):
     356        (WebCore::CounterNode::isReset):
     357        * rendering/CounterResetNode.cpp:
     358        * rendering/CounterResetNode.h:
     359        * rendering/DataRef.h:
     360        (WebCore::DataRef::DataRef):
     361        * rendering/DeprecatedRenderSelect.h:
     362        * rendering/DeprecatedSlider.cpp:
     363        * rendering/DeprecatedSlider.h:
     364        * rendering/EllipsisBox.cpp:
     365        * rendering/EllipsisBox.h:
     366        (WebCore::EllipsisBox::EllipsisBox):
     367        * rendering/FixedTableLayout.cpp:
     368        * rendering/FixedTableLayout.h:
     369        * rendering/GapRects.h:
     370        * rendering/InlineBox.cpp:
     371        * rendering/InlineBox.h:
     372        (WebCore::InlineBox::InlineBox):
     373        (WebCore::InlineBox::setConstructed):
     374        (WebCore::InlineBox::clearTruncation):
     375        (WebCore::InlineBox::markDirty):
     376        * rendering/InlineFlowBox.cpp:
     377        * rendering/InlineFlowBox.h:
     378        (WebCore::InlineFlowBox::InlineFlowBox):
     379        (WebCore::InlineFlowBox::setConstructed):
     380        (WebCore::InlineFlowBox::setEdges):
     381        (WebCore::InlineFlowBox::setVerticalOverflowPositions):
     382        (WebCore::InlineFlowBox::setVerticalSelectionPositions):
     383        * rendering/InlineRunBox.h:
     384        (WebCore::InlineRunBox::paintBackgroundAndBorder):
     385        (WebCore::InlineRunBox::paintDecorations):
     386        * rendering/InlineTextBox.cpp:
     387        * rendering/InlineTextBox.h:
     388        (WebCore::InlineTextBox::InlineTextBox):
     389        (WebCore::InlineTextBox::end):
     390        (WebCore::InlineTextBox::textObject):
     391        * rendering/Length.h:
     392        (WebCore::Length::Length):
     393        * rendering/ListMarkerBox.cpp:
     394        * rendering/ListMarkerBox.h:
     395        * rendering/RenderPartObject.h:
     396        * rendering/RootInlineBox.cpp:
     397        * rendering/RootInlineBox.h:
     398        * rendering/SVGInlineFlowBox.cpp:
     399        * rendering/SVGInlineFlowBox.h:
     400        (WebCore::SVGInlineFlowBox::SVGInlineFlowBox):
     401        * rendering/SVGRootInlineBox.cpp:
     402        * rendering/SVGRootInlineBox.h:
     403        (WebCore::SVGRootInlineBox::SVGRootInlineBox):
     404        * rendering/TableLayout.h:
     405        (WebCore::TableLayout::TableLayout):
     406        (WebCore::TableLayout::~TableLayout):
     407        * rendering/bidi.h:
     408        (WebCore::BidiStatus::BidiStatus):
     409        (WebCore::BidiRun::BidiRun):
     410        * rendering/break_lines.h:
     411
     4122006-10-26  Justin Garcia  <justin.garcia@apple.com>
     413
     414        Reviewed by john
     415
     416        <http://bugs.webkit.org/show_bug.cgi?id=11329>
     417        Gmail Editor: Can't remove styling applied to selection after clicking "Remove Formatting" toolbar icon.
     418       
     419        * editing/Editor.cpp:
     420        (WebCore::Editor::removeFormattingAndStyle): Moved from JSEditor.
     421        Wrapped the plain text fragment in a style span with the document
     422        default style so that it will appear unstyled regardless of where
     423        it is inserted.  Could have also inserted the plain text fragment
     424        and then applied the document default style to it, but there is not
     425        yet any redundant style prevention in ApplyStyleCommand, so this
     426        is cleaner.
     427        * editing/Editor.h:
     428        * editing/JSEditor.cpp:
     429
     4302006-10-26  Oliver Hunt  <oliver@apple.com>
     431
     432        Reviewed by Anders.
     433        Fixes <rdar://problem/4800518> -- needed to update existing
     434        canvas path elements when transforms are performed on the
     435        context.
     436
     437        * html/CanvasRenderingContext2D.cpp:
     438        (WebCore::CanvasRenderingContext2D::scale):
     439        (WebCore::CanvasRenderingContext2D::rotate):
     440        (WebCore::CanvasRenderingContext2D::translate):
     441
     4422006-10-26  Nikolas Zimmermann  <zimmermann@kde.org>
     443
     444        Reviewed by Darin.
     445
     446        Fix Qt/Linux build.
     447
     448        * platform/network/qt/ResourceLoaderManager.cpp:
     449        (WebCore::ResourceLoaderManager::slotData):
     450        (WebCore::ResourceLoaderManager::slotMimetype):
     451        (WebCore::ResourceLoaderManager::remove):
     452        (WebCore::ResourceLoaderManager::add):
     453        * platform/network/qt/ResourceLoaderQt.cpp:
     454        (WebCore::ResourceLoader::receivedResponse):
     455        * platform/qt/FrameQtClient.cpp:
     456        (WebCore::FrameQtClientDefault::openURL):
     457        * platform/qt/LoaderFunctionsQt.cpp:
     458        (WebCore::ServeSynchronousRequest):
     459
     4602006-10-26  Adam Roben  <aroben@apple.com>
     461
     462        Reviewed by Adele.
     463
     464        Fix: <rdar://problem/3951815> add "type-to-select" feature for list
     465        boxes (<select> elements)
     466
     467        This also adds type-ahead find for closed menulists (popups).
     468
     469        * WebCore.xcodeproj/project.pbxproj: Version wars.
     470        * html/HTMLSelectElement.h: Add new instance variables for type-ahead
     471        find.
     472        * html/HTMLSelectElement.cpp:
     473        (WebCore::HTMLSelectElement::HTMLSelectElement): Initialize new
     474        instance variables.
     475        (WebCore::HTMLSelectElement::defaultEventHandler): Perform type-ahead
     476        find on printable character presses.
     477        (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Remove
     478        redundant check that the listIndex has changed (setSelectedIndex does
     479        this for us), and fix indentation.
     480        (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): Change an if
     481        to an else-if.
     482        (WebCore::stripLeadingWhiteSpace): Helper function for typeAheadFind()
     483        to strip leading whitespace (including non-breaking spaces) from a
     484        string.
     485        (WebCore::HTMLSelectElement::typeAheadFind): New method to perform
     486        type-ahead find.
     487        * platform/PopupMenu.h: Added new updateFromElement() method to be
     488        called from RenderMenuList::updateFromElement().
     489        * platform/mac/PopupMenuMac.mm:
     490        (WebCore::PopupMenu::updateFromElement): While we are using
     491        NSPopUpButtonCell for our popups, this method can stay empty.
     492        * rendering/RenderListBox.cpp:
     493        (WebCore::RenderListBox::updateFromElement): Scroll to reveal the first
     494        selected element.
     495        * rendering/RenderMenuList.cpp:
     496        (WebCore::RenderMenuList::updateFromElement): Tell the popup to update
     497        if it's visible.
     498
     4992006-10-26  Darin Adler  <darin@apple.com>
     500
     501        Reviewed by Anders.
     502
     503        - fix http://bugs.webkit.org/show_bug.cgi?id=11360
     504          editing/pasteboard/copy-paste-bidi intermittently fails due to disappearance of anonymous RenderBlock
     505
     506        * editing/ReplaceSelectionCommand.cpp:
     507        (WebCore::ReplaceSelectionCommand::removeRedundantStyles):
     508        Use two vectors instead of a hash map: more efficient, deterministic. There was no
     509        reason to use a hash table.
     510
     5112006-10-26  Maciej Stachowiak  <mjs@apple.com>
     512
     513        Reviewed by Anders.
     514
     515        - .5% speed improvement by avoiding excess CFURLRef allocation
     516
     517        * loader/CachedResource.cpp:
     518        (WebCore::CachedResource::getCFURL): New method. For Mac only (for now), cache the CFURL
     519        here for later reuse.
     520        * loader/CachedResource.h:
     521        * loader/mac/LoaderFunctionsMac.mm:
     522        (WebCore::CheckCacheObjectStatus): Use the cached CFURL, don't make a whole new one.
     523
     5242006-10-25  Darin Adler  <darin@apple.com>
     525
     526        Reviewed by Anders.
     527
     528        - removed 55 methods from WebCoreFrameBridge
     529        - changed callers to use Frame directly instead
     530        - put FrameLoaderTypes.h types into the WebCore namespace
     531        - first steps to get FrameLoader.h ready for cross-platform duty
     532
     533        * WebCore.exp:
     534        * WebCore.xcodeproj/project.pbxproj:
     535        * bridge/mac/BrowserExtensionMac.mm:
     536        (WebCore::BrowserExtensionMac::createNewWindow):
     537        * bridge/mac/FrameMac.h:
     538        * bridge/mac/FrameMac.mm:
     539        (WebCore::FrameMac::loadRequest):
     540        (WebCore::FrameMac::startRedirectionTimer):
     541        (WebCore::FrameMac::stopRedirectionTimer):
     542        (WebCore::FrameMac::passSubframeEventToSubframe):
     543        (WebCore::FrameMac::handledOnloadEvents):
     544        (WebCore::FrameMac::isLoadTypeReload):
     545        * bridge/mac/WebCoreFrameBridge.h:
     546        * bridge/mac/WebCoreFrameBridge.mm:
     547        (-[WebCoreFrameBridge executionContextForView:]):
     548        (updateRenderingForBindings):
     549        (-[WebCoreFrameBridge canTargetLoadInFrame:]):
     550        (-[WebCoreFrameBridge forceLayoutAdjustingViewSize:]):
     551        (-[WebCoreFrameBridge forceLayoutWithMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
     552        (-[WebCoreFrameBridge installInFrame:]):
     553        (-[WebCoreFrameBridge numPendingOrLoadingRequests]):
     554        (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
     555        (-[WebCoreFrameBridge baseWritingDirectionForSelectionStart]):
     556        (-[WebCoreFrameBridge dragOperationForDraggingInfo:]):
     557        (stringByCollapsingNonPrintingCharacters):
     558        (-[WebCoreFrameBridge startLoadingResource:withMethod:URL:customHeaders:]):
     559        (-[WebCoreFrameBridge startLoadingResource:withMethod:URL:customHeaders:postData:]):
     560        (-[WebCoreFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]):
     561        * loader/FrameLoaderTypes.h:
     562        * loader/mac/FrameLoader.h:
     563        * loader/mac/FrameLoader.mm:
     564        (WebCore::FrameLoader::FrameLoader):
     565        (WebCore::FrameLoader::setupForReplace):
     566        (WebCore::FrameLoader::load):
     567        (WebCore::FrameLoader::activeDocumentLoader):
     568        (WebCore::FrameLoader::state):
     569        (WebCore::FrameLoader::setState):
     570        (WebCore::FrameLoader::clearProvisionalLoad):
     571        (WebCore::FrameLoader::markLoadComplete):
     572        (WebCore::FrameLoader::commitProvisionalLoad):
     573        (WebCore::FrameLoader::receivedMainResourceError):
     574        (WebCore::FrameLoader::handleFallbackContent):
     575        (WebCore::FrameLoader::isLoadingMainFrame):
     576        (WebCore::FrameLoader::continueAfterNewWindowPolicy):
     577        (WebCore::FrameLoader::continueAfterNavigationPolicy):
     578        (WebCore::FrameLoader::continueAfterWillSubmitForm):
     579        (WebCore::FrameLoader::continueLoadRequestAfterNavigationPolicy):
     580        (WebCore::FrameLoader::transitionToCommitted):
     581        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
     582        (WebCore::FrameLoader::continueLoadRequestAfterNewWindowPolicy):
     583        (-[WebCoreFrameLoaderAsDelegate continueAfterNewWindowPolicy:]):
     584        (-[WebCoreFrameLoaderAsDelegate continueAfterNavigationPolicy:]):
     585        (-[WebCoreFrameLoaderAsDelegate continueAfterWillSubmitForm:]):
     586        * loader/mac/ImageDocumentMac.mm:
     587        (WebCore::finishImageLoad):
     588        * loader/mac/WebDocumentLoader.mm:
     589        (WebCore::DocumentLoader::isLoadingInAPISense):
     590        * loader/mac/WebMainResourceLoader.h:
     591        * loader/mac/WebMainResourceLoader.mm:
     592        (WebCore::MainResourceLoader::continueAfterContentPolicy):
     593        (-[WebCoreMainResourceLoaderAsPolicyDelegate continueAfterContentPolicy:]):
     594        * loader/mac/WebSubresourceLoader.mm:
     595        (-[WebCoreSubresourceHandle initWithLoader:]):
     596        * platform/mac/ListBoxMac.mm:
     597        (-[WebCoreTableView keyDown:]):
     598        (-[WebCoreTableView keyUp:]):
     599        * platform/mac/WebCoreTextField.mm:
     600        (-[WebCoreTextFieldController textView:shouldHandleEvent:]):
     601
     6022006-10-25  Steve Falkenburg  <sfalken@apple.com>
     603
     604        Reviewed by Darin.
     605
     606        Printing fixes
     607
     608        * page/Frame.cpp:
     609        (WebCore::Frame::adjustPageHeight):
     610        * page/Frame.h:
     611        (WebCore::Frame::setupRootForPrinting):
     612        (WebCore::Frame::computePageRects):
     613
     6142006-10-25  Anders Carlsson  <acarlsson@apple.com>
     615
     616        Reviewed by Geoff.
     617
     618        <rdar://problem/4799088>
     619        REGRESSION: Translation widget fails to convert data and reports a "Data unavailable" error.
     620
     621        * loader/mac/WebSubresourceLoader.h:
     622        * loader/mac/WebSubresourceLoader.mm:
     623        (-[WebCoreSubresourceHandle initWithLoader:]):
     624        Set the HTTP method before the HTTP body.
     625
     6262006-10-25  Geoffrey Garen  <ggaren@apple.com>
     627
     628        Reviewed by Adam.
     629
     630        Renamed WebFrameLoader to FrameLoader, to match class name.
     631
     632        * WebCore.xcodeproj/project.pbxproj:
     633        * bridge/mac/FrameMac.mm:
     634        * bridge/mac/WebCoreFrameBridge.mm:
     635        * loader/mac/FrameLoader.mm: Added.
     636        * loader/mac/IconLoaderMac.mm:
     637        * loader/mac/WebDocumentLoader.mm:
     638        * loader/mac/WebFrameLoader.h: Removed.
     639        * loader/mac/WebFrameLoader.mm: Removed.
     640        * loader/mac/WebLoader.mm:
     641        * loader/mac/WebMainResourceLoader.mm:
     642        * loader/mac/WebNetscapePlugInStreamLoader.mm:
     643        * loader/mac/WebSubresourceLoader.mm:
     644
     6452006-10-25  Darin Adler  <darin@apple.com>
     646
     647        - fix full builds
     648
     649        * WebCore.xcodeproj/project.pbxproj: Mark bridge/mac/WebCoreResourceLoader.h as private.
     650
     6512006-10-25  David Smith  <catfish.man@gmail.com>
     652
     653        Reviewed by Mitz.
     654
     655        Fixed REGRESSION (r17280): Repro crash when clicking a link with target="_blank"
     656        http://bugs.webkit.org/show_bug.cgi?id=11411
     657
     658        * bridge/mac/WebCoreFrameBridge.mm:
     659        (-[WebCoreFrameBridge canTargetLoadInFrame:]): Check that the target has a frame before using it.
     660
     6612006-10-25  Maciej Stachowiak  <mjs@apple.com>
     662
     663        Rubber stamped by Mitz.
     664
     665        - moved some files that are essentially part of the ResourceLoader implementation to platform/network/mac
     666
     667        * WebCore.xcodeproj/project.pbxproj:
     668        * bridge/mac/WebCoreResourceLoader.h: Moved to platform/network/mac.
     669        * bridge/mac/WebCoreResourceLoaderImp.h: Moved to platform/network/mac.
     670        * bridge/mac/WebCoreResourceLoaderImp.mm: Moved to platform/network/mac.
     671
     6722006-10-25  Maciej Stachowiak  <mjs@apple.com>
     673
     674        Rubber stamped by Mark.
     675
     676        - remove no longer existing symbol that was breaking linking
     677
     678        * WebCore.exp:
     679
     6802006-10-25  Maciej Stachowiak  <mjs@apple.com>
     681
     682        Reviewed by Mitz.
     683       
     684        - fixed "REGRESSION: Activity window doesn't always list all files until refresh"
     685        http://bugs.webkit.org/show_bug.cgi?id=11212
     686
     687        I couldn't figure out how to write a test case.
     688
     689        * bindings/js/kjs_window.cpp:
     690        (KJS::Window::clear): Avoid crashing if already detached.
     691        * bridge/mac/FrameMac.h:
     692        * bridge/mac/FrameMac.mm:
     693        (WebCore::FrameMac::clear): Change prototype to make this a proper
     694        overload for Frame::clear once again(!).
    60695
    616962006-10-27  John Sullivan  <sullivan@apple.com>
  • trunk/WebCore/WebCore.exp

    r17393 r17396  
    138138__ZN7WebCore11FrameLoader17actionInformationENS_13FrameLoadTypeEbP7NSEventP5NSURL
    139139__ZN7WebCore11FrameLoader17actionInformationENS_14NavigationTypeEP7NSEventP5NSURL
     140__ZN7WebCore11FrameLoader19requestFromDelegateEP12NSURLRequestRP11objc_objectRP7NSError
    140141__ZN7WebCore11FrameLoader21addPlugInStreamLoaderEPNS_17WebResourceLoaderE
    141142__ZN7WebCore11FrameLoader21commitProvisionalLoadEP12NSDictionary
     
    146147__ZN7WebCore11FrameLoader24removePlugInStreamLoaderEPNS_17WebResourceLoaderE
    147148__ZN7WebCore11FrameLoader25provisionalDocumentLoaderEv
     149__ZN7WebCore11FrameLoader29sendRemainingDelegateMessagesEP11objc_objectP13NSURLResponsejP7NSError
    148150__ZN7WebCore11FrameLoader4loadEP12NSURLRequest
    149151__ZN7WebCore11FrameLoader4loadEP12NSURLRequestP12NSDictionaryNS_13FrameLoadTypeEN3WTF10PassRefPtrINS_9FormStateEEE
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r17390 r17396  
    283283                654EC611097778F500DAB52C /* WebCoreFrameBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 654EC60F097778F500DAB52C /* WebCoreFrameBridge.h */; settings = {ATTRIBUTES = (Private, ); }; };
    284284                654EC612097778F500DAB52C /* WebCoreFrameBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 654EC610097778F500DAB52C /* WebCoreFrameBridge.mm */; };
     285                654F68880AF1B7C50065BDD6 /* CachedResourceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 654F68870AF1B7C50065BDD6 /* CachedResourceMac.mm */; };
    285286                6550B69D099DF0270090D781 /* CDATASection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6550B693099DF0270090D781 /* CDATASection.cpp */; };
    286287                6550B69E099DF0270090D781 /* CDATASection.h in Headers */ = {isa = PBXBuildFile; fileRef = 6550B694099DF0270090D781 /* CDATASection.h */; };
     
    31773178                654EC60F097778F500DAB52C /* WebCoreFrameBridge.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCoreFrameBridge.h; sourceTree = "<group>"; };
    31783179                654EC610097778F500DAB52C /* WebCoreFrameBridge.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreFrameBridge.mm; sourceTree = "<group>"; };
     3180                654F68870AF1B7C50065BDD6 /* CachedResourceMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = CachedResourceMac.mm; sourceTree = "<group>"; };
    31793181                6550B693099DF0270090D781 /* CDATASection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CDATASection.cpp; sourceTree = "<group>"; };
    31803182                6550B694099DF0270090D781 /* CDATASection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CDATASection.h; sourceTree = "<group>"; };
     
    75027504                        children = (
    75037505                                93A1EAA70A563508006960A0 /* ImageDocumentMac.h */,
     7506                                654F68870AF1B7C50065BDD6 /* CachedResourceMac.mm */,
    75047507                                93A1EA9F0A5634C9006960A0 /* ImageDocumentMac.mm */,
    75057508                                F587850302DE375901EA4122 /* LoaderFunctionsMac.mm */,
     
    1170011703                                853CA9EC0AEEC63C002372DC /* RenderForeignObject.cpp in Sources */,
    1170111704                                853CA9F00AEEC657002372DC /* RenderPath.cpp in Sources */,
     11705                                654F68880AF1B7C50065BDD6 /* CachedResourceMac.mm in Sources */,
    1170211706                                655A81BC0AEF67D4000975F0 /* WebCoreResourceLoaderImp.mm in Sources */,
    1170311707                        );
  • trunk/WebCore/bridge/mac/WebCoreFrameBridge.h

    r17393 r17396  
    185185@interface WebCoreFrameBridge : NSObject
    186186{
     187@public
    187188    WebCoreFrameMac* m_frame;
    188189
     
    405406- (void)frameDetached;
    406407- (void)receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
    407 - (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data;
    408408- (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalNSURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode;
    409409
  • trunk/WebCore/bridge/mac/WebCoreFrameBridge.mm

    r17393 r17396  
    21542154}
    21552155
    2156 - (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data
    2157 {
    2158     if (!m_frame)
    2159         return;
    2160        
    2161     // FIXME: If the WebKit client changes or cancels the request, WebCore does not respect this and continues the load.
    2162     NSURLRequest *request = [[NSURLRequest alloc] initWithURL:URL];
    2163     NSError *error;
    2164     id identifier;
    2165     m_frame->loader()->requestFromDelegate(request, identifier, error);   
    2166     m_frame->loader()->sendRemainingDelegateMessages(identifier, response, [data length], error);
    2167     [request release];
    2168 }
    2169 
    21702156- (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode
    21712157{
  • trunk/WebCore/loader/CachedResource.cpp

    r17300 r17396  
    166166}
    167167
    168 #if PLATFORM(MAC)
    169 CFURLRef CachedResource::getCFURL()
    170 {
    171     if (!m_cfURL) {
    172         m_cfURL = KURL(url().deprecatedString()).createCFURL();
    173         CFRelease(m_cfURL.get());
    174     }
    175        
    176     return m_cfURL.get();   
    177168}
    178 #endif
    179 
    180 }
  • trunk/WebCore/loader/CachedResource.h

    r17300 r17396  
    3838#if PLATFORM(MAC)
    3939#include "RetainPtr.h"
     40
     41#ifdef __OBJC__
     42@class NSURLRequest;
     43#else
     44class NSURLRequest;
    4045#endif
     46
     47#endif // PLATFORM(MAC)
    4148
    4249namespace WebCore {
     
    133140
    134141#if PLATFORM(MAC)
    135     CFURLRef getCFURL();
     142    NSURLRequest* getNSURLRequest();
    136143#endif
    137144
     
    146153
    147154#if PLATFORM(MAC)
    148     RetainPtr<CFURLRef> m_cfURL;
     155    RetainPtr<NSURLRequest> m_nsURLRequest;
    149156#endif
    150157
  • trunk/WebCore/loader/mac/FrameLoader.h

    r17393 r17396  
    222222        NSURLRequest *requestFromDelegate(NSURLRequest *, id& identifier, NSError *& error);
    223223        void post(NSURL *, const String& referrer, const String& target, NSArray *postData, const String& contentType, NSEvent *, Element* form, NSDictionary *formValues);
     224        void loadedResourceFromMemoryCache(NSURLRequest *request, NSURLResponse *response, int length);
    224225
    225226        void checkLoadComplete();
  • trunk/WebCore/loader/mac/FrameLoader.mm

    r17393 r17396  
    16241624}
    16251625
     1626void FrameLoader::loadedResourceFromMemoryCache(NSURLRequest *request, NSURLResponse *response, int length)
     1627{
     1628    if (m_client->dispatchDidLoadResourceFromMemoryCache(m_documentLoader.get(), request, response, length))
     1629        return;
     1630
     1631    id identifier;
     1632    NSError *error;
     1633    requestFromDelegate(request, identifier, error);
     1634    sendRemainingDelegateMessages(identifier, response, length, error);
     1635}
     1636
    16261637void FrameLoader::post(NSURL *URL, const String& referrer, const String& target, NSArray *postData,
    16271638                       const String& contentType, NSEvent *event, Element* form, NSDictionary *formValues)
  • trunk/WebCore/loader/mac/LoaderFunctionsMac.mm

    r17393 r17396  
    3636#import "FormData.h"
    3737#import "FormDataMac.h"
     38#import "FrameLoader.h"
    3839#import "WebCoreResourceLoaderImp.h"
    3940#import "Logging.h"
     
    158159    FrameMac *frame = static_cast<FrameMac *>(loader->frame());
    159160
    160     if (frame && !frame->haveToldBridgeAboutLoad(cachedObject->url())) {
    161         WebCoreFrameBridge *bridge = frame->bridge();
     161    if (!frame || frame->haveToldBridgeAboutLoad(cachedObject->url()))
     162        return;
    162163       
    163         BEGIN_BLOCK_OBJC_EXCEPTIONS;
    164         [bridge objectLoadedFromCacheWithURL:(NSURL *)cachedObject->getCFURL()
    165                                     response:(NSURLResponse *)cachedObject->response()
    166                                         data:(NSData *)cachedObject->allData()];
    167         END_BLOCK_OBJC_EXCEPTIONS;
    168 
    169         frame->didTellBridgeAboutLoad(cachedObject->url());
    170     }
     164    NSURLRequest *request = cachedObject->getNSURLRequest();
     165    NSURLResponse *response = cachedObject->response();
     166    NSData *data = cachedObject->allData();
     167   
     168    // FIXME: If the WebKit client changes or cancels the request, WebCore does not respect this and continues the load.
     169    frame->loader()->loadedResourceFromMemoryCache(request, response, [data length]);
     170   
     171    frame->didTellBridgeAboutLoad(cachedObject->url());
    171172}
    172173
  • trunk/WebCore/loader/mac/WebFrameLoaderClient.h

    r17352 r17396  
    9696        virtual void dispatchDidFinishLoading(DocumentLoader*, id identifier) = 0;
    9797        virtual void dispatchDidFailLoading(DocumentLoader*, id identifier, NSError *) = 0;
     98        virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, NSURLRequest *, NSURLResponse *, int length) = 0;
    9899
    99100        virtual void dispatchDidHandleOnloadEvents() = 0;
  • trunk/WebKit/ChangeLog

    r17393 r17396  
     12006-10-27  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by John & Adam.
     4       
     5        - various performance improvements for resource delegate dispatch.
     6       
     7        - avoid any ObjC messaging when fetching the WebView
     8        - avoid ObjC calls to WebView to get resource load delegate and impl cache
     9        - cache actual method pointers, not just the fact that the method is present
     10        - added a new SPI resource load delegate method which allows clients to get
     11          just one message in case of synchronously loading from memory cache; if this
     12          is implemented you don't get the normal delegate calls in that case.
     13        - various other minor tweaks
     14
     15        * WebCoreSupport/WebFrameBridge.h:
     16        * WebCoreSupport/WebFrameLoaderClient.h:
     17        * WebCoreSupport/WebFrameLoaderClient.mm:
     18        (getWebView):
     19        (WebFrameLoaderClient::hasBackForwardList):
     20        (WebFrameLoaderClient::resetBackForwardList):
     21        (WebFrameLoaderClient::privateBrowsingEnabled):
     22        (WebFrameLoaderClient::updateHistoryForStandardLoad):
     23        (WebFrameLoaderClient::resetAfterLoadError):
     24        (WebFrameLoaderClient::download):
     25        (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache):
     26        (WebFrameLoaderClient::dispatchIdentifierForInitialRequest):
     27        (WebFrameLoaderClient::dispatchWillSendRequest):
     28        (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
     29        (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge):
     30        (WebFrameLoaderClient::dispatchDidReceiveResponse):
     31        (WebFrameLoaderClient::dispatchDidReceiveContentLength):
     32        (WebFrameLoaderClient::dispatchDidFinishLoading):
     33        (WebFrameLoaderClient::dispatchDidFailLoading):
     34        (WebFrameLoaderClient::dispatchDidHandleOnloadEvents):
     35        (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
     36        (WebFrameLoaderClient::dispatchDidCancelClientRedirect):
     37        (WebFrameLoaderClient::dispatchWillPerformClientRedirect):
     38        (WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
     39        (WebFrameLoaderClient::dispatchWillClose):
     40        (WebFrameLoaderClient::dispatchDidReceiveIcon):
     41        (WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
     42        (WebFrameLoaderClient::dispatchDidReceiveTitle):
     43        (WebFrameLoaderClient::dispatchDidCommitLoad):
     44        (WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
     45        (WebFrameLoaderClient::dispatchDidFailLoad):
     46        (WebFrameLoaderClient::dispatchDidFinishLoad):
     47        (WebFrameLoaderClient::dispatchDidFirstLayout):
     48        (WebFrameLoaderClient::dispatchCreatePage):
     49        (WebFrameLoaderClient::dispatchShow):
     50        (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
     51        (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
     52        (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
     53        (WebFrameLoaderClient::dispatchUnableToImplementPolicy):
     54        (WebFrameLoaderClient::dispatchWillSubmitForm):
     55        (WebFrameLoaderClient::dispatchDidLoadMainResource):
     56        (WebFrameLoaderClient::progressStarted):
     57        (WebFrameLoaderClient::progressCompleted):
     58        (WebFrameLoaderClient::incrementProgress):
     59        (WebFrameLoaderClient::completeProgress):
     60        (WebFrameLoaderClient::setMainFrameDocumentReady):
     61        (WebFrameLoaderClient::startDownload):
     62        (WebFrameLoaderClient::willChangeTitle):
     63        (WebFrameLoaderClient::didChangeTitle):
     64        (WebFrameLoaderClient::mainFrameURL):
     65        (WebFrameLoaderClient::frameLoadCompleted):
     66        * WebCoreSupport/WebPageBridge.h:
     67        * WebKit.xcodeproj/project.pbxproj:
     68        * WebView/WebFrame.mm:
     69        (frame):
     70        (core):
     71        (kit):
     72        (getWebView):
     73        (-[WebFrame _addBackForwardItemClippedAtTarget:]):
     74        (-[WebFrame _canCachePage]):
     75        (-[WebFrame _purgePageCache]):
     76        (-[WebFrame _loadItem:withLoadType:]):
     77        (-[WebFrame _goToItem:withLoadType:]):
     78        (-[WebFrame _updateBackground]):
     79        (-[WebFrame _clearSelectionInOtherFrames]):
     80        (-[WebFrame _isMainFrame]):
     81        (-[WebFrame webView]):
     82        * WebView/WebResourceLoadDelegatePrivate.h: Added.
     83        * WebView/WebView.mm:
     84        (-[WebView _cacheResourceLoadDelegateImplementations]):
     85        (WebViewGetResourceLoadDelegate):
     86        (WebViewGetResourceLoadDelegateImplementations):
     87        * WebView/WebViewInternal.h:
     88        * WebView/WebViewPrivate.h:
     89
     902006-10-27  John Sullivan  <sullivan@apple.com>
     91
     92        Reviewed by Anders
     93       
     94        - fixed http://bugs.webkit.org/show_bug.cgi?id=11439
     95          REGRESSION: Another page loading crash
     96
     97        * WebView/WebFrame.mm:
     98        (-[WebFrame _createItem:]):
     99        Handle nil documentLoader the way we did before ObjC->C++ changes
     100
     1012006-10-27  John Sullivan  <sullivan@apple.com>
     102
     103        Reviewed by Anders
     104
     105        * WebView/WebHTMLView.m:
     106        (-[NSArray checkSpelling:]):
     107        call advanceToNextMisspelling directly on FrameMac, bypassing bridge
     108        (-[NSArray showGuessPanel:]):
     109        ditto
     110
     1112006-10-27  Darin Adler  <darin@apple.com>
     112
     113        - build fix
     114
     115        * WebCoreSupport/WebFrameLoaderClient.mm: Corrected header file name.
     116
     1172006-10-27  Darin Adler  <darin@apple.com>
     118
     119        Reviewed by Maciej.
     120
     121        - moved methods that are there just to be called by the frame loader client into the client
     122          in an attempt to get back some of the speed we lost yesterday
     123
     124        * DefaultDelegates/WebDefaultResourceLoadDelegate.m:
     125        (-[WebDefaultResourceLoadDelegate webView:resource:didReceiveAuthenticationChallenge:fromDataSource:]):
     126        (-[WebDefaultResourceLoadDelegate webView:resource:didCancelAuthenticationChallenge:fromDataSource:]):
     127        * WebCoreSupport/WebFrameLoaderClient.h:
     128        * WebCoreSupport/WebFrameLoaderClient.mm:
     129        (dataSource):
     130        (decisionListener):
     131        (WebFrameLoaderClient::WebFrameLoaderClient):
     132        (WebFrameLoaderClient::hasWebView):
     133        (WebFrameLoaderClient::hasFrameView):
     134        (WebFrameLoaderClient::hasBackForwardList):
     135        (WebFrameLoaderClient::resetBackForwardList):
     136        (WebFrameLoaderClient::provisionalItemIsTarget):
     137        (WebFrameLoaderClient::loadProvisionalItemFromPageCache):
     138        (WebFrameLoaderClient::invalidateCurrentItemPageCache):
     139        (WebFrameLoaderClient::privateBrowsingEnabled):
     140        (WebFrameLoaderClient::makeDocumentView):
     141        (WebFrameLoaderClient::makeRepresentation):
     142        (WebFrameLoaderClient::setDocumentViewFromPageCache):
     143        (WebFrameLoaderClient::forceLayout):
     144        (WebFrameLoaderClient::forceLayoutForNonHTML):
     145        (WebFrameLoaderClient::updateHistoryForCommit):
     146        (WebFrameLoaderClient::updateHistoryForBackForwardNavigation):
     147        (WebFrameLoaderClient::updateHistoryForReload):
     148        (WebFrameLoaderClient::updateHistoryForStandardLoad):
     149        (WebFrameLoaderClient::updateHistoryForInternalLoad):
     150        (WebFrameLoaderClient::updateHistoryAfterClientRedirect):
     151        (WebFrameLoaderClient::setCopiesOnScroll):
     152        (WebFrameLoaderClient::tokenForLoadErrorReset):
     153        (WebFrameLoaderClient::resetAfterLoadError):
     154        (WebFrameLoaderClient::doNotResetAfterLoadError):
     155        (WebFrameLoaderClient::detachedFromParent1):
     156        (WebFrameLoaderClient::detachedFromParent2):
     157        (WebFrameLoaderClient::detachedFromParent3):
     158        (WebFrameLoaderClient::detachedFromParent4):
     159        (WebFrameLoaderClient::loadedFromPageCache):
     160        (WebFrameLoaderClient::download):
     161        (WebFrameLoaderClient::dispatchIdentifierForInitialRequest):
     162        (WebFrameLoaderClient::dispatchWillSendRequest):
     163        (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
     164        (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge):
     165        (WebFrameLoaderClient::dispatchDidReceiveResponse):
     166        (WebFrameLoaderClient::dispatchDidReceiveContentLength):
     167        (WebFrameLoaderClient::dispatchDidFinishLoading):
     168        (WebFrameLoaderClient::dispatchDidFailLoading):
     169        (WebFrameLoaderClient::dispatchDidHandleOnloadEvents):
     170        (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
     171        (WebFrameLoaderClient::dispatchDidCancelClientRedirect):
     172        (WebFrameLoaderClient::dispatchWillPerformClientRedirect):
     173        (WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
     174        (WebFrameLoaderClient::dispatchWillClose):
     175        (WebFrameLoaderClient::dispatchDidReceiveIcon):
     176        (WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
     177        (WebFrameLoaderClient::dispatchDidReceiveTitle):
     178        (WebFrameLoaderClient::dispatchDidCommitLoad):
     179        (WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
     180        (WebFrameLoaderClient::dispatchDidFailLoad):
     181        (WebFrameLoaderClient::dispatchDidFinishLoad):
     182        (WebFrameLoaderClient::dispatchDidFirstLayout):
     183        (WebFrameLoaderClient::dispatchCreatePage):
     184        (WebFrameLoaderClient::dispatchShow):
     185        (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
     186        (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
     187        (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
     188        (WebFrameLoaderClient::dispatchUnableToImplementPolicy):
     189        (WebFrameLoaderClient::dispatchWillSubmitForm):
     190        (WebFrameLoaderClient::dispatchDidLoadMainResource):
     191        (WebFrameLoaderClient::clearLoadingFromPageCache):
     192        (WebFrameLoaderClient::isLoadingFromPageCache):
     193        (WebFrameLoaderClient::revertToProvisionalState):
     194        (WebFrameLoaderClient::setMainDocumentError):
     195        (WebFrameLoaderClient::clearUnarchivingState):
     196        (WebFrameLoaderClient::progressStarted):
     197        (WebFrameLoaderClient::progressCompleted):
     198        (WebFrameLoaderClient::incrementProgress):
     199        (WebFrameLoaderClient::completeProgress):
     200        (WebFrameLoaderClient::setMainFrameDocumentReady):
     201        (WebFrameLoaderClient::startDownload):
     202        (WebFrameLoaderClient::willChangeTitle):
     203        (WebFrameLoaderClient::didChangeTitle):
     204        (WebFrameLoaderClient::committedLoad):
     205        (WebFrameLoaderClient::finishedLoading):
     206        (WebFrameLoaderClient::finalSetupForReplace):
     207        (WebFrameLoaderClient::cancelledError):
     208        (WebFrameLoaderClient::cannotShowURLError):
     209        (WebFrameLoaderClient::interruptForPolicyChangeError):
     210        (WebFrameLoaderClient::cannotShowMIMETypeError):
     211        (WebFrameLoaderClient::fileDoesNotExistError):
     212        (WebFrameLoaderClient::shouldFallBack):
     213        (WebFrameLoaderClient::mainFrameURL):
     214        (WebFrameLoaderClient::setDefersCallbacks):
     215        (WebFrameLoaderClient::willUseArchive):
     216        (WebFrameLoaderClient::isArchiveLoadPending):
     217        (WebFrameLoaderClient::cancelPendingArchiveLoad):
     218        (WebFrameLoaderClient::clearArchivedResources):
     219        (WebFrameLoaderClient::canHandleRequest):
     220        (WebFrameLoaderClient::canShowMIMEType):
     221        (WebFrameLoaderClient::representationExistsForURLScheme):
     222        (WebFrameLoaderClient::generatedMIMETypeForURLScheme):
     223        (WebFrameLoaderClient::elementForEvent):
     224        (WebFrameLoaderClient::createPolicyDecider):
     225        (WebFrameLoaderClient::frameLoadCompleted):
     226        (WebFrameLoaderClient::restoreScrollPositionAndViewState):
     227        (WebFrameLoaderClient::provisionalLoadStarted):
     228        (WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent):
     229        (WebFrameLoaderClient::addHistoryItemForFragmentScroll):
     230        (WebFrameLoaderClient::didFinishLoad):
     231        (WebFrameLoaderClient::prepareForDataSourceReplacement):
     232        (WebFrameLoaderClient::createDocumentLoader):
     233        (WebFrameLoaderClient::setTitle):
     234        (WebFrameLoaderClient::canUseArchivedResource):
     235        (WebFrameLoaderClient::deliverArchivedResourcesAfterDelay):
     236        (WebFrameLoaderClient::deliverArchivedResources):
     237        (WebFrameLoaderClient::createPageCache):
     238        * WebView/WebFrame.mm:
     239        (-[NSView setWebFrame:]):
     240        (-[WebFrame _createItem:]):
     241        (-[WebFrame _loadItem:withLoadType:]):
     242        (-[WebFrame _recursiveGoToItem:fromItem:withLoadType:]):
     243        (-[WebFrame _loadURL:referrer:intoChild:]):
     244        (-[WebFrame _saveScrollPositionAndViewStateToItem:]):
     245        (-[WebFrame _hasSelection]):
     246        (-[WebFrame _clearSelection]):
     247        (-[WebFrame _setProvisionalItem:]):
     248        (-[WebFrame _setPreviousItem:]):
     249        (-[WebFrame _setCurrentItem:]):
     250        (-[WebFrame loadArchive:]):
     251        * WebView/WebFrameInternal.h:
     252        * WebView/WebHTMLView.m:
     253        (-[WebHTMLView _topHTMLView]):
     254        * WebView/WebHTMLViewPrivate.h:
     255
     2562006-10-26  Geoffrey Garen  <ggaren@apple.com>
     257
     258        Reviewed by Darin, Maciej.
     259
     260        Removed many uses of NSString * from WebCore.
     261       
     262        Changed a few files to ObjC++ for compatiblity with new WebCore methods
     263        taking WebCore::Strings as arguments.
     264       
     265        Added a static_cast to make the c++ compiler happy.
     266
     2672006-10-26  John Sullivan  <sullivan@apple.com>
     268
     269        Reviewed by Anders
     270
     271        * WebView/WebFrame.mm:
     272        now includes <WebCore/Document.h> and <WebCore/DocumentMarker.h>
     273        (-[WebFrame _unmarkAllBadGrammar]):
     274        filled in guts
     275        (-[WebFrame _unmarkAllMisspellings]):
     276        rewrote to call Document directly, bypassing bridge
     277
     2782006-10-26  John Sullivan  <sullivan@apple.com>
     279
     280        * English.lproj/WebViewEditingContextMenu.nib/info.nib:
     281        * English.lproj/WebViewEditingContextMenu.nib/objects.nib:
     282       
     283        Changed "Spelling" to "Spelling and Grammar" in context menu for post-Tiger.
     284
     285=== Safari-521.29 ===
     286
     2872006-10-26  John Sullivan  <sullivan@apple.com>
     288
     289        No review, just two localized string changes.
     290       
     291        * WebView/WebHTMLView.m:
     292        (-[NSArray validateUserInterfaceItem:]):
     293        changed "Show/Hide Spelling" to "Show/Hide Spelling and Grammar" post-Tiger to match framework change
     294
     295        * English.lproj/Localizable.strings:
     296        updated for these changes
     297
     2982006-10-25  Darin Adler  <darin@apple.com>
     299
     300        Reviewed by Anders.
     301
     302        - removed 55 methods from WebCoreFrameBridge
     303        - changed callers to use Frame directly instead
     304        - put FrameLoaderTypes.h types into the WebCore namespace
     305        - first steps to get FrameLoader.h ready for cross-platform duty
     306
     307        * DefaultDelegates/WebDefaultContextMenuDelegate.m:
     308        (-[WebDefaultUIDelegate openNewWindowWithURL:element:]):
     309        * Plugins/WebBaseNetscapePluginView.mm:
     310        (-[WebBaseNetscapePluginView requestWithURLCString:]):
     311        (-[WebBaseNetscapePluginView loadPluginRequest:]):
     312        (-[WebBaseNetscapePluginView getVariable:value:]):
     313        * Plugins/WebNetscapePluginEmbeddedView.m:
     314        (-[WebNetscapePluginEmbeddedView didStart]):
     315        * Plugins/WebNetscapePluginStream.mm:
     316        * Plugins/WebPluginContainerCheck.m:
     317        (-[WebPluginContainerCheck _continueWithPolicy:]):
     318        (-[WebPluginContainerCheck _isForbiddenFileLoad]):
     319        * WebCoreSupport/WebEditorClient.mm:
     320        (WebEditorClient::shouldDeleteRange):
     321        (WebEditorClient::shouldShowDeleteInterface):
     322        * WebCoreSupport/WebFrameBridge.mm:
     323        (-[WebFrameBridge webView]):
     324        (-[WebFrameBridge finishInitializingWithFrameName:view:]):
     325        (-[WebFrameBridge createWindowWithURL:]):
     326        (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]):
     327        (-[WebFrameBridge windowObjectCleared]):
     328        (-[WebFrameBridge createModalDialogWithURL:]):
     329        * WebCoreSupport/WebFrameLoaderClient.mm:
     330        (WebFrameLoaderClient::dispatchCreatePage):
     331        (WebFrameLoaderClient::dispatchWillSubmitForm):
     332        * WebKit.xcodeproj/project.pbxproj:
     333        * WebView/WebArchiver.m:
     334        (+[WebArchiver archiveSelectionInFrame:]):
     335        * WebView/WebDataSource.mm:
     336        (-[WebDataSource _documentFragmentWithImageResource:]):
     337        (-[WebDataSource _imageElementWithImageResource:]):
     338        * WebView/WebEditingDelegatePrivate.h:
     339        * WebView/WebFrame.mm:
     340        (core):
     341        (kit):
     342        (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]):
     343        (-[WebFrame _canCachePage]):
     344        (-[WebFrame _childFramesMatchItem:]):
     345        (-[WebFrame _URLsMatchItem:]):
     346        (-[WebFrame _loadItem:withLoadType:]):
     347        (-[WebFrame _recursiveGoToItem:fromItem:withLoadType:]):
     348        (-[WebFrame _viewWillMoveToHostWindow:]):
     349        (-[WebFrame _viewDidMoveToHostWindow]):
     350        (-[WebFrame _addChild:]):
     351        (-[WebFrame _saveDocumentAndScrollState]):
     352        (-[WebFrame _numPendingOrLoadingRequests:]):
     353        (-[WebFrame _reloadForPluginChanges]):
     354        (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]):
     355        (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]):
     356        (-[WebFrame _initWithWebFrameView:webView:coreFrame:]):
     357        (-[WebFrame _documentViews]):
     358        (-[WebFrame _updateBackground]):
     359        (-[WebFrame _unmarkAllMisspellings]):
     360        (-[WebFrame _hasSelection]):
     361        (-[WebFrame _atMostOneFrameHasSelection]):
     362        (-[WebFrame _findFrameWithSelection]):
     363        (-[WebFrame _frameLoader]):
     364        (-[WebFrame _isDescendantOfFrame:]):
     365        (-[WebFrame _setShouldCreateRenderers:]):
     366        (-[WebFrame _bodyBackgroundColor]):
     367        (-[WebFrame init]):
     368        (-[WebFrame initWithName:webFrameView:webView:]):
     369        (-[WebFrame dealloc]):
     370        (-[WebFrame finalize]):
     371        (-[WebFrame name]):
     372        (-[WebFrame webView]):
     373        (-[WebFrame DOMDocument]):
     374        (-[WebFrame frameElement]):
     375        (-[WebFrame findFrameNamed:]):
     376        (-[WebFrame parentFrame]):
     377        (-[WebFrame childFrames]):
     378        (-[WebFrame _invalidateCurrentItemPageCache]):
     379        (-[WebFrame _dispatchCreateWebViewWithRequest:]):
     380        (-[WebFrame _dispatchSourceFrame:willSubmitForm:withValues:submissionDecider:]):
     381        (-[WebFrame _prepareForDataSourceReplacement]):
     382        (-[WebFrame _provisionalLoadStarted]):
     383        * WebView/WebFrameInternal.h:
     384        * WebView/WebHTMLRepresentation.m:
     385        (-[WebHTMLRepresentation DOMDocument]):
     386        (-[WebHTMLRepresentation attributedText]):
     387        * WebView/WebHTMLView.m:
     388        (-[WebHTMLView _documentRange]):
     389        (-[WebHTMLView _documentFragmentWithPaths:]):
     390        (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]):
     391        (-[WebHTMLView _selectedRange]):
     392        (-[WebHTMLView _updateMouseoverWithEvent:]):
     393        (-[WebHTMLView _canEditRichly]):
     394        (-[WebHTMLView _hasSelection]):
     395        (-[WebHTMLView _hasSelectionOrInsertionPoint]):
     396        (-[WebHTMLView _hasInsertionPoint]):
     397        (-[WebHTMLView _isEditable]):
     398        (-[WebHTMLView _isSelectionInPasswordField]):
     399        (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
     400        (-[WebHTMLView _selectionDraggingImage]):
     401        (-[WebHTMLView _canIncreaseSelectionListLevel]):
     402        (-[WebHTMLView _canDecreaseSelectionListLevel]):
     403        (-[WebHTMLView _updateActiveState]):
     404        (-[NSArray readSelectionFromPasteboard:]):
     405        (-[NSArray validateUserInterfaceItem:]):
     406        (-[NSArray maintainsInactiveSelection]):
     407        (-[NSArray menuForEvent:]):
     408        (-[NSArray scrollWheel:]):
     409        (-[NSArray acceptsFirstMouse:]):
     410        (-[NSArray shouldDelayWindowOrderingForEvent:]):
     411        (-[NSArray mouseDown:]):
     412        (-[NSArray mouseDragged:]):
     413        (-[NSArray mouseUp:]):
     414        (-[NSArray keyDown:]):
     415        (-[NSArray keyUp:]):
     416        (-[NSArray centerSelectionInVisibleArea:]):
     417        (-[NSArray _selectionStartFontAttributesAsRTF]):
     418        (-[NSArray _emptyStyle]):
     419        (-[NSArray performKeyEquivalent:]):
     420        (-[NSArray indent:]):
     421        (-[NSArray outdent:]):
     422        (-[WebHTMLView cut:]):
     423        (-[WebHTMLView paste:]):
     424        (-[WebHTMLView _selectRangeInMarkedText:]):
     425        (-[WebTextCompleteController doCompletion]):
     426        (-[WebHTMLView selectionRect]):
     427        (-[WebHTMLView selectionImageForcingWhiteText:]):
     428        (-[WebHTMLView selectionImageRect]):
     429        (-[WebHTMLView attributedString]):
     430        (-[WebHTMLView _isMoveDrag]):
     431        (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]):
     432        * WebView/WebPolicyDelegate.mm:
     433        (-[WebPolicyDecisionListener _usePolicy:]):
     434        (-[WebPolicyDecisionListener use]):
     435        (-[WebPolicyDecisionListener ignore]):
     436        (-[WebPolicyDecisionListener download]):
     437        (-[WebPolicyDecisionListener continue]):
     438        * WebView/WebScriptDebugDelegate.m:
     439        (-[WebScriptCallFrame _initWithFrame:initWithWebFrame:]):
     440        (-[WebScriptCallFrame globalObject]):
     441        * WebView/WebView.mm:
     442        (-[WebView _attachScriptDebuggerToAllFrames]):
     443        (-[WebView _detachScriptDebuggerFromAllFrames]):
     444        (-[WebView windowScriptObject]):
     445        (incrementFrame):
     446        (-[WebView searchFor:direction:caseSensitive:wrap:]):
     447        (-[WebView writeSelectionWithPasteboardTypes:toPasteboard:]):
     448        (-[WebView removeDragCaret]):
     449        (-[WebView setScriptDebugDelegate:]):
     450        (-[WebView scriptDebugDelegate]):
     451        (-[WebView shouldClose]):
     452        (-[WebView selectedDOMRange]):
     453        (-[WebView styleDeclarationWithText:]):
     454
     4552006-10-25  Geoffrey Garen  <ggaren@apple.com>
     456
     457        Reviewed by Adam.
     458
     459        Renamed WebFrameLoader to FrameLoader, to match class name.
     460
     461        * Plugins/WebBaseNetscapePluginView.mm:
     462        * Plugins/WebNetscapePluginStream.mm:
     463        * Plugins/WebPluginController.mm:
     464        * WebCoreSupport/WebFrameBridge.mm:
     465        * WebView/WebDataSource.mm:
     466        * WebView/WebFrame.mm:
     467        * WebView/WebPDFView.mm:
     468        * WebView/WebPolicyDelegate.mm:
     469        * WebView/WebView.mm:
     470
     4712006-10-25  Mark Rowe  <bdash@webkit.org>
     472
     473        Reviewed by Anders.
     474
     475        Build fix for the Buildbot.
     476
     477        * WebView/WebHTMLView.m:
     478        (-[NSArray _addToStyle:fontA:fontB:]): Explicit cast.
     479
     4802006-10-25  Maciej Stachowiak  <mjs@apple.com>
     481
     482        Reviewed by Anders.
     483       
     484        <rdar://problem/4785575> REGRESSION: form resubmission warning occurs twice, then Safari crashes in autorelease pool
     485        <rdar://problem/4799383> REGRESSION: Crash occurs when dismissing the "Would you like to save this password" sheet
     486
     487        * WebView/WebPolicyDeciderMac.m:
     488        (-[WebPolicyDeciderMac dealloc]): release the listener, don't dealloc it
     489
     4902006-10-24  Anders Carlsson  <acarlsson@apple.com>
     491
     492        Reviewed by Darin.
     493
     494        * WebKitPrefix.h:
     495        Include FastMalloc.h from C++ code.
     496
     4972006-10-24  Darin Adler  <darin@apple.com>
     498
     499        Reviewed by Anders.
     500
     501        - converted WebFrameLoaderClient to C++
     502        - renamed frame->frameLoader() function to frame->loader()
     503        - renamed [bridge impl] to [bridge _frame]
     504        - removed some bridge methods
     505
     506        * Plugins/WebNetscapePluginStream.mm:
     507        * WebCoreSupport/WebEditorClient.mm:
     508        * WebCoreSupport/WebFrameLoaderClient.h: Added.
     509        (WebFrameLoaderClient::webFrame):
     510        * WebCoreSupport/WebFrameLoaderClient.mm: Added.
     511        (WebFrameLoaderClient::detachFrameLoader):
     512        (WebFrameLoaderClient::hasWebView):
     513        (WebFrameLoaderClient::hasFrameView):
     514        (WebFrameLoaderClient::hasBackForwardList):
     515        (WebFrameLoaderClient::resetBackForwardList):
     516        (WebFrameLoaderClient::provisionalItemIsTarget):
     517        (WebFrameLoaderClient::loadProvisionalItemFromPageCache):
     518        (WebFrameLoaderClient::invalidateCurrentItemPageCache):
     519        (WebFrameLoaderClient::privateBrowsingEnabled):
     520        (WebFrameLoaderClient::makeDocumentView):
     521        (WebFrameLoaderClient::makeRepresentation):
     522        (WebFrameLoaderClient::setDocumentViewFromPageCache):
     523        (WebFrameLoaderClient::forceLayout):
     524        (WebFrameLoaderClient::forceLayoutForNonHTML):
     525        (WebFrameLoaderClient::updateHistoryForCommit):
     526        (WebFrameLoaderClient::updateHistoryForBackForwardNavigation):
     527        (WebFrameLoaderClient::updateHistoryForReload):
     528        (WebFrameLoaderClient::updateHistoryForStandardLoad):
     529        (WebFrameLoaderClient::updateHistoryForInternalLoad):
     530        (WebFrameLoaderClient::updateHistoryAfterClientRedirect):
     531        (WebFrameLoaderClient::setCopiesOnScroll):
     532        (WebFrameLoaderClient::tokenForLoadErrorReset):
     533        (WebFrameLoaderClient::resetAfterLoadError):
     534        (WebFrameLoaderClient::doNotResetAfterLoadError):
     535        (WebFrameLoaderClient::detachedFromParent1):
     536        (WebFrameLoaderClient::detachedFromParent2):
     537        (WebFrameLoaderClient::detachedFromParent3):
     538        (WebFrameLoaderClient::detachedFromParent4):
     539        (WebFrameLoaderClient::loadedFromPageCache):
     540        (WebFrameLoaderClient::download):
     541        (WebFrameLoaderClient::dispatchIdentifierForInitialRequest):
     542        (WebFrameLoaderClient::dispatchWillSendRequest):
     543        (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
     544        (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge):
     545        (WebFrameLoaderClient::dispatchDidReceiveResponse):
     546        (WebFrameLoaderClient::dispatchDidReceiveContentLength):
     547        (WebFrameLoaderClient::dispatchDidFinishLoading):
     548        (WebFrameLoaderClient::dispatchDidFailLoading):
     549        (WebFrameLoaderClient::dispatchDidHandleOnloadEvents):
     550        (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
     551        (WebFrameLoaderClient::dispatchDidCancelClientRedirect):
     552        (WebFrameLoaderClient::dispatchWillPerformClientRedirect):
     553        (WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
     554        (WebFrameLoaderClient::dispatchWillClose):
     555        (WebFrameLoaderClient::dispatchDidReceiveIcon):
     556        (WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
     557        (WebFrameLoaderClient::dispatchDidReceiveTitle):
     558        (WebFrameLoaderClient::dispatchDidCommitLoad):
     559        (WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
     560        (WebFrameLoaderClient::dispatchDidFailLoad):
     561        (WebFrameLoaderClient::dispatchDidFinishLoad):
     562        (WebFrameLoaderClient::dispatchDidFirstLayout):
     563        (WebFrameLoaderClient::dispatchCreatePage):
     564        (WebFrameLoaderClient::dispatchShow):
     565        (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
     566        (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
     567        (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
     568        (WebFrameLoaderClient::dispatchUnableToImplementPolicy):
     569        (WebFrameLoaderClient::dispatchWillSubmitForm):
     570        (WebFrameLoaderClient::dispatchDidLoadMainResource):
     571        (WebFrameLoaderClient::clearLoadingFromPageCache):
     572        (WebFrameLoaderClient::isLoadingFromPageCache):
     573        (WebFrameLoaderClient::revertToProvisionalState):
     574        (WebFrameLoaderClient::setMainDocumentError):
     575        (WebFrameLoaderClient::clearUnarchivingState):
     576        (WebFrameLoaderClient::progressStarted):
     577        (WebFrameLoaderClient::progressCompleted):
     578        (WebFrameLoaderClient::incrementProgress):
     579        (WebFrameLoaderClient::completeProgress):
     580        (WebFrameLoaderClient::setMainFrameDocumentReady):
     581        (WebFrameLoaderClient::startDownload):
     582        (WebFrameLoaderClient::willChangeTitle):
     583        (WebFrameLoaderClient::didChangeTitle):
     584        (WebFrameLoaderClient::committedLoad):
     585        (WebFrameLoaderClient::finishedLoading):
     586        (WebFrameLoaderClient::finalSetupForReplace):
     587        (WebFrameLoaderClient::cancelledError):
     588        (WebFrameLoaderClient::cannotShowURLError):
     589        (WebFrameLoaderClient::interruptForPolicyChangeError):
     590        (WebFrameLoaderClient::cannotShowMIMETypeError):
     591        (WebFrameLoaderClient::fileDoesNotExistError):
     592        (WebFrameLoaderClient::shouldFallBack):
     593        (WebFrameLoaderClient::mainFrameURL):
     594        (WebFrameLoaderClient::setDefersCallbacks):
     595        (WebFrameLoaderClient::willUseArchive):
     596        (WebFrameLoaderClient::isArchiveLoadPending):
     597        (WebFrameLoaderClient::cancelPendingArchiveLoad):
     598        (WebFrameLoaderClient::clearArchivedResources):
     599        (WebFrameLoaderClient::canHandleRequest):
     600        (WebFrameLoaderClient::canShowMIMEType):
     601        (WebFrameLoaderClient::representationExistsForURLScheme):
     602        (WebFrameLoaderClient::generatedMIMETypeForURLScheme):
     603        (WebFrameLoaderClient::elementForEvent):
     604        (WebFrameLoaderClient::createPolicyDecider):
     605        (WebFrameLoaderClient::frameLoadCompleted):
     606        (WebFrameLoaderClient::restoreScrollPositionAndViewState):
     607        (WebFrameLoaderClient::provisionalLoadStarted):
     608        (WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent):
     609        (WebFrameLoaderClient::addHistoryItemForFragmentScroll):
     610        (WebFrameLoaderClient::didFinishLoad):
     611        (WebFrameLoaderClient::prepareForDataSourceReplacement):
     612        (WebFrameLoaderClient::createDocumentLoader):
     613        (WebFrameLoaderClient::setTitle):
     614        * WebKit.xcodeproj/project.pbxproj:
     615        * WebView/WebDataSource.mm:
     616        (-[WebDataSource webFrame]):
     617        * WebView/WebFrame.mm:
     618        (frame):
     619        (-[WebFrame _loadItem:withLoadType:]):
     620        (-[WebFrame _reloadForPluginChanges]):
     621        (-[WebFrame _initWithWebFrameView:webView:bridge:]):
     622        (-[WebFrame _frameLoader]):
     623        (-[WebFrame provisionalDataSource]):
     624        (-[WebFrame dataSource]):
     625        (-[WebFrame parentFrame]):
     626        (-[WebFrame _provisionalLoadStarted]):
     627        * WebView/WebFrameInternal.h:
     628        * WebView/WebHTMLRepresentation.m:
     629        (-[WebHTMLRepresentation finishedLoadingWithDataSource:]):
     630        * WebView/WebHTMLView.m:
     631        (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
     632        (-[NSArray validateUserInterfaceItem:]):
     633        (-[NSArray scrollWheel:]):
     634        (-[NSArray acceptsFirstMouse:]):
     635        (-[NSArray shouldDelayWindowOrderingForEvent:]):
     636        (-[NSArray _selectionStartFontAttributesAsRTF]):
     637        (-[NSArray changeBaseWritingDirection:]):
     638        (-[NSArray indent:]):
     639        (-[NSArray outdent:]):
     640        (-[WebHTMLView copy:]):
     641        (-[WebHTMLView cut:]):
     642        (-[WebHTMLView paste:]):
     643        * WebView/WebView.mm:
     644        (-[WebView _dashboardRegions]):
     645        (-[WebView setProhibitsMainFrameScrolling:]):
     646        (-[WebView _setInViewSourceMode:]):
     647        (-[WebView _inViewSourceMode]):
     648        (-[WebView setEditable:]):
     649
    16502006-10-27  Geoffrey Garen  <ggaren@apple.com>
    2651
  • trunk/WebKit/WebCoreSupport/WebFrameBridge.h

    r17238 r17396  
    3737@interface WebFrameBridge : WebCoreFrameBridge <WebCoreFrameBridge>
    3838{
     39@public
    3940    WebFrame *_frame;
    4041
  • trunk/WebKit/WebCoreSupport/WebFrameLoaderClient.h

    r17365 r17396  
    133133    virtual void setMainDocumentError(WebCore::DocumentLoader*, NSError *);
    134134    virtual void clearUnarchivingState(WebCore::DocumentLoader*);
     135    virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, NSURLRequest *, NSURLResponse *, int length);
    135136
    136137    virtual void progressStarted();
  • trunk/WebKit/WebCoreSupport/WebFrameLoaderClient.mm

    r17366 r17396  
    4949#import "WebKitNSStringExtras.h"
    5050#import "WebNSURLExtras.h"
     51#import "WebPageBridge.h"
    5152#import "WebPanelAuthenticationHandler.h"
    5253#import "WebPolicyDeciderMac.h"
    5354#import "WebPolicyDelegatePrivate.h"
    5455#import "WebPreferences.h"
     56#import "WebResourceLoadDelegate.h"
    5557#import "WebResourcePrivate.h"
    56 #import "WebResourceLoadDelegate.h"
    5758#import "WebScriptDebugServerPrivate.h"
    5859#import "WebUIDelegate.h"
    5960#import "WebViewInternal.h"
    6061#import <WebCore/FrameLoader.h>
     62#import <WebCore/FrameLoaderTypes.h>
    6163#import <WebCore/FrameMac.h>
    6264#import <WebCore/FrameTree.h>
     65#import <WebCore/Page.h>
    6366#import <WebCore/PlatformString.h>
    6467#import <WebCore/WebCoreFrameBridge.h>
     
    6669#import <WebCore/WebDocumentLoader.h>
    6770#import <WebCore/WebLoader.h>
     71#import <WebKit/DOMElement.h>
     72#import <WebKit/WebDefaultResourceLoadDelegate.h>
     73#import <WebKit/WebDocumentLoaderMac.h>
     74#import <WebKit/WebResourceLoadDelegate.h>
     75#import <WebKit/WebViewInternal.h>
    6876#import <WebKitSystemInterface.h>
    6977#import <wtf/PassRefPtr.h>
    7078
    7179using namespace WebCore;
     80
     81static inline WebView* getWebView(DocumentLoader* loader)
     82{
     83    return ((WebPageBridge *)loader->frameLoader()->frame()->page()->bridge())->_webView;
     84}
     85
     86static inline WebView *getWebView(WebFrame *webFrame)
     87{
     88   Frame* coreFrame = core(webFrame);
     89   return coreFrame ? ((WebPageBridge *)coreFrame->page()->bridge())->_webView : nil;
     90}
    7291
    7392static inline WebDataSource *dataSource(DocumentLoader* loader)
     
    104123bool WebFrameLoaderClient::hasBackForwardList() const
    105124{
    106     return [[m_webFrame.get() webView] backForwardList] != nil;
     125    return [getWebView(m_webFrame.get()) backForwardList] != nil;
    107126}
    108127
     
    111130    // Note this doesn't verify the current load type as a b/f operation because it is called from
    112131    // a subframe in the case of a delegate bailing out of the nav before it even gets to provisional state.
    113     WebFrame *mainFrame = [[m_webFrame.get() webView] mainFrame];
     132    WebFrame *mainFrame = [getWebView(m_webFrame.get()) mainFrame];
    114133    WebHistoryItem *resetItem = mainFrame->_private->currentItem;
    115134    if (resetItem)
    116         [[[m_webFrame.get() webView] backForwardList] goToItem:resetItem];
     135        [[getWebView(m_webFrame.get()) backForwardList] goToItem:resetItem];
    117136}
    118137
     
    146165bool WebFrameLoaderClient::privateBrowsingEnabled() const
    147166{
    148     return [[[m_webFrame.get() webView] preferences] privateBrowsingEnabled];
     167    return [[getWebView(m_webFrame.get()) preferences] privateBrowsingEnabled];
    149168}
    150169
     
    253272        NSURL *URL = [dataSource _URLForHistory];
    254273        if (URL && ![URL _web_isEmpty]) {
    255             ASSERT([m_webFrame.get() webView]);
    256             if (![[[m_webFrame.get() webView] preferences] privateBrowsingEnabled]) {
     274            ASSERT(getWebView(m_webFrame.get()));
     275            if (![[getWebView(m_webFrame.get()) preferences] privateBrowsingEnabled]) {
    257276                WebHistoryItem *entry = [[WebHistory optionalSharedHistory] addItemForURL:URL];
    258277                if ([dataSource pageTitle])
     
    326345    if (!item)
    327346        return;
    328     [[[m_webFrame.get() webView] backForwardList] goToItem:item];
     347    [[getWebView(m_webFrame.get()) backForwardList] goToItem:item];
    329348    [item release];
    330349}
     
    373392                                        request:request
    374393                                       response:response
    375                                        delegate:[[m_webFrame.get() webView] downloadDelegate]
     394                                       delegate:[getWebView(m_webFrame.get()) downloadDelegate]
    376395                                          proxy:proxy];
    377396}
    378397
     398bool WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader* loader, NSURLRequest *request, NSURLResponse *response, int length)
     399{
     400    WebView *webView = getWebView(loader);
     401    id resourceLoadDelegate = WebViewGetResourceLoadDelegate(webView);
     402    WebResourceDelegateImplementationCache implementations = WebViewGetResourceLoadDelegateImplementations(webView);
     403
     404    if (!implementations.delegateImplementsDidLoadResourceFromMemoryCache)
     405        return false;
     406
     407    implementations.didLoadResourceFromMemoryCacheFunc(resourceLoadDelegate, @selector(webView:didLoadResourceFromMemoryCache:response:length:fromDataSource:), webView, request, response, length, dataSource(loader));
     408    return true;
     409}
     410
    379411id WebFrameLoaderClient::dispatchIdentifierForInitialRequest(DocumentLoader* loader, NSURLRequest *request)
    380412{
    381     WebView *webView = [m_webFrame.get() webView];
    382     id resourceLoadDelegate = [webView resourceLoadDelegate];
    383    
    384     if ([webView _resourceLoadDelegateImplementations].delegateImplementsIdentifierForRequest)
    385         return [resourceLoadDelegate webView:webView identifierForInitialRequest:request fromDataSource:dataSource(loader)];
     413    WebView *webView = getWebView(loader);
     414    id resourceLoadDelegate = WebViewGetResourceLoadDelegate(webView);
     415    WebResourceDelegateImplementationCache implementations = WebViewGetResourceLoadDelegateImplementations(webView);
     416
     417    if (implementations.delegateImplementsIdentifierForRequest)
     418        return implementations.identifierForRequestFunc(resourceLoadDelegate, @selector(webView:identifierForInitialRequest:fromDataSource:), webView, request, dataSource(loader));
     419
    386420    return [[[NSObject alloc] init] autorelease];
    387421}
     
    390424    NSURLRequest *request, NSURLResponse *redirectResponse)
    391425{
    392     WebView *webView = [m_webFrame.get() webView];
    393     id resourceLoadDelegate = [webView resourceLoadDelegate];
    394 
    395     if ([webView _resourceLoadDelegateImplementations].delegateImplementsWillSendRequest)
    396         return [resourceLoadDelegate webView:webView resource:identifier willSendRequest:request redirectResponse:redirectResponse fromDataSource:dataSource(loader)];
     426    WebView *webView = getWebView(loader);
     427    id resourceLoadDelegate = WebViewGetResourceLoadDelegate(webView);
     428    WebResourceDelegateImplementationCache implementations = WebViewGetResourceLoadDelegateImplementations(webView);
     429
     430    if (implementations.delegateImplementsWillSendRequest)
     431        return implementations.willSendRequestFunc(resourceLoadDelegate, @selector(webView:resource:willSendRequest:redirectResponse:fromDataSource:), webView, identifier, request, redirectResponse, dataSource(loader));
    397432
    398433    return request;
     
    402437    NSURLAuthenticationChallenge *challenge)
    403438{
    404     WebView *webView = [m_webFrame.get() webView];
     439    WebView *webView = getWebView(m_webFrame.get());
    405440    id resourceLoadDelegate = [webView resourceLoadDelegate];
    406 
    407     if ([webView _resourceLoadDelegateImplementations].delegateImplementsDidReceiveAuthenticationChallenge) {
     441    WebResourceDelegateImplementationCache implementations = WebViewGetResourceLoadDelegateImplementations(webView);
     442
     443    if (implementations.delegateImplementsDidReceiveAuthenticationChallenge) {
    408444        [resourceLoadDelegate webView:webView resource:identifier didReceiveAuthenticationChallenge:challenge fromDataSource:dataSource(loader)];
    409445        return;
     
    417453    NSURLAuthenticationChallenge *challenge)
    418454{
    419     WebView *webView = [m_webFrame.get() webView];
     455    WebView *webView = getWebView(m_webFrame.get());
    420456    id resourceLoadDelegate = [webView resourceLoadDelegate];
    421 
    422     if ([webView _resourceLoadDelegateImplementations].delegateImplementsDidCancelAuthenticationChallenge) {
     457    WebResourceDelegateImplementationCache implementations = WebViewGetResourceLoadDelegateImplementations(webView);
     458
     459    if (implementations.delegateImplementsDidCancelAuthenticationChallenge) {
    423460        [resourceLoadDelegate webView:webView resource:identifier didCancelAuthenticationChallenge:challenge fromDataSource:dataSource(loader)];
    424461        return;
     
    430467void WebFrameLoaderClient::dispatchDidReceiveResponse(DocumentLoader* loader, id identifier, NSURLResponse *response)
    431468{
    432     WebView *webView = [m_webFrame.get() webView];
    433 
    434     if ([webView _resourceLoadDelegateImplementations].delegateImplementsDidReceiveResponse)
    435         [[webView resourceLoadDelegate] webView:webView resource:identifier didReceiveResponse:response fromDataSource:dataSource(loader)];
     469    WebView *webView = getWebView(loader);
     470    id resourceLoadDelegate = WebViewGetResourceLoadDelegate(webView);
     471    WebResourceDelegateImplementationCache implementations = WebViewGetResourceLoadDelegateImplementations(webView);
     472
     473    if (implementations.delegateImplementsDidReceiveResponse)
     474        implementations.didReceiveResponseFunc(resourceLoadDelegate, @selector(webView:resource:didReceiveResponse:fromDataSource:), webView, identifier, response, dataSource(loader));
    436475}
    437476
    438477void WebFrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader* loader, id identifier, int lengthReceived)
    439478{
    440     WebView *webView = [m_webFrame.get() webView];
    441 
    442     if ([webView _resourceLoadDelegateImplementations].delegateImplementsDidReceiveContentLength)
    443         [[webView resourceLoadDelegate] webView:webView resource:identifier didReceiveContentLength:(WebNSUInteger)lengthReceived fromDataSource:dataSource(loader)];
     479    WebView *webView = getWebView(loader);
     480    id resourceLoadDelegate = WebViewGetResourceLoadDelegate(webView);
     481    WebResourceDelegateImplementationCache implementations = WebViewGetResourceLoadDelegateImplementations(webView);
     482
     483    if (implementations.delegateImplementsDidReceiveContentLength)
     484        implementations.didReceiveContentLengthFunc(resourceLoadDelegate, @selector(webView:resource:didReceiveContentLength:fromDataSource:), webView, identifier, (WebNSUInteger)lengthReceived, dataSource(loader));
    444485}
    445486
    446487void WebFrameLoaderClient::dispatchDidFinishLoading(DocumentLoader* loader, id identifier)
    447488{
    448     WebView *webView = [m_webFrame.get() webView];
     489    WebView *webView = getWebView(loader);
     490    id resourceLoadDelegate = WebViewGetResourceLoadDelegate(webView);
     491    WebResourceDelegateImplementationCache implementations = WebViewGetResourceLoadDelegateImplementations(webView);
    449492   
    450     if ([webView _resourceLoadDelegateImplementations].delegateImplementsDidFinishLoadingFromDataSource)
    451         [[webView resourceLoadDelegate] webView:webView resource:identifier didFinishLoadingFromDataSource:dataSource(loader)];
     493    if (implementations.delegateImplementsDidFinishLoadingFromDataSource)
     494        implementations.didFinishLoadingFromDataSourceFunc(resourceLoadDelegate, @selector(webView:resource:didFinishLoadingFromDataSource:), webView, identifier, dataSource(loader));
    452495}
    453496
    454497void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader* loader, id identifier, NSError *error)
    455498{
    456     WebView *webView = [m_webFrame.get() webView];
     499    WebView *webView = getWebView(m_webFrame.get());
    457500    [[webView _resourceLoadDelegateForwarder] webView:webView resource:identifier didFailLoadingWithError:error fromDataSource:dataSource(loader)];
    458501}
     
    460503void WebFrameLoaderClient::dispatchDidHandleOnloadEvents()
    461504{
    462     WebView *webView = [m_webFrame.get() webView];
     505    WebView *webView = getWebView(m_webFrame.get());
    463506    [[webView _frameLoadDelegateForwarder] webView:webView didHandleOnloadEventsForFrame:m_webFrame.get()];
    464507}
     
    466509void WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad()
    467510{
    468     WebView *webView = [m_webFrame.get() webView];
     511    WebView *webView = getWebView(m_webFrame.get());
    469512    [[webView _frameLoadDelegateForwarder] webView:webView
    470513       didReceiveServerRedirectForProvisionalLoadForFrame:m_webFrame.get()];
     
    473516void WebFrameLoaderClient::dispatchDidCancelClientRedirect()
    474517{
    475     WebView *webView = [m_webFrame.get() webView];
     518    WebView *webView = getWebView(m_webFrame.get());
    476519    [[webView _frameLoadDelegateForwarder] webView:webView didCancelClientRedirectForFrame:m_webFrame.get()];
    477520}
     
    479522void WebFrameLoaderClient::dispatchWillPerformClientRedirect(NSURL *URL, NSTimeInterval delay, NSDate *fireDate)
    480523{
    481     WebView *webView = [m_webFrame.get() webView];   
     524    WebView *webView = getWebView(m_webFrame.get());   
    482525    [[webView _frameLoadDelegateForwarder] webView:webView
    483526                         willPerformClientRedirectToURL:URL
     
    489532void WebFrameLoaderClient::dispatchDidChangeLocationWithinPage()
    490533{
    491     WebView *webView = [m_webFrame.get() webView];   
     534    WebView *webView = getWebView(m_webFrame.get());   
    492535    [[webView _frameLoadDelegateForwarder] webView:webView didChangeLocationWithinPageForFrame:m_webFrame.get()];
    493536}
     
    495538void WebFrameLoaderClient::dispatchWillClose()
    496539{
    497     WebView *webView = [m_webFrame.get() webView];   
     540    WebView *webView = getWebView(m_webFrame.get());   
    498541    [[webView _frameLoadDelegateForwarder] webView:webView willCloseFrame:m_webFrame.get()];
    499542}
     
    501544void WebFrameLoaderClient::dispatchDidReceiveIcon(NSImage *icon)
    502545{
    503     WebView *webView = [m_webFrame.get() webView];   
     546    WebView *webView = getWebView(m_webFrame.get());   
    504547    ASSERT([m_webFrame.get() _isMainFrame]);
    505548    [webView _willChangeValueForKey:_WebMainFrameIconKey];
     
    510553void WebFrameLoaderClient::dispatchDidStartProvisionalLoad()
    511554{
    512     WebView *webView = [m_webFrame.get() webView];   
     555    WebView *webView = getWebView(m_webFrame.get());   
    513556    [webView _didStartProvisionalLoadForFrame:m_webFrame.get()];
    514557    [[webView _frameLoadDelegateForwarder] webView:webView didStartProvisionalLoadForFrame:m_webFrame.get()];   
     
    517560void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title)
    518561{
    519     WebView *webView = [m_webFrame.get() webView];   
     562    WebView *webView = getWebView(m_webFrame.get());   
    520563    [[webView _frameLoadDelegateForwarder] webView:webView didReceiveTitle:title forFrame:m_webFrame.get()];
    521564}
     
    526569    ASSERT([m_webFrame->_private->webFrameView documentView] != nil);
    527570
    528     WebView *webView = [m_webFrame.get() webView];   
     571    WebView *webView = getWebView(m_webFrame.get());   
    529572    [webView _didCommitLoadForFrame:m_webFrame.get()];
    530573    [[webView _frameLoadDelegateForwarder] webView:webView didCommitLoadForFrame:m_webFrame.get()];
     
    533576void WebFrameLoaderClient::dispatchDidFailProvisionalLoad(NSError *error)
    534577{
    535     WebView *webView = [m_webFrame.get() webView];   
     578    WebView *webView = getWebView(m_webFrame.get());   
    536579    [webView _didFailProvisionalLoadWithError:error forFrame:m_webFrame.get()];
    537580    [[webView _frameLoadDelegateForwarder] webView:webView didFailProvisionalLoadWithError:error forFrame:m_webFrame.get()];
     
    541584void WebFrameLoaderClient::dispatchDidFailLoad(NSError *error)
    542585{
    543     WebView *webView = [m_webFrame.get() webView];   
     586    WebView *webView = getWebView(m_webFrame.get());   
    544587    [webView _didFailLoadWithError:error forFrame:m_webFrame.get()];
    545588    [[webView _frameLoadDelegateForwarder] webView:webView didFailLoadWithError:error forFrame:m_webFrame.get()];
     
    549592void WebFrameLoaderClient::dispatchDidFinishLoad()
    550593{
    551     WebView *webView = [m_webFrame.get() webView];   
     594    WebView *webView = getWebView(m_webFrame.get());   
    552595    [webView _didFinishLoadForFrame:m_webFrame.get()];
    553596    [[webView _frameLoadDelegateForwarder] webView:webView didFinishLoadForFrame:m_webFrame.get()];
     
    557600void WebFrameLoaderClient::dispatchDidFirstLayout()
    558601{
    559     WebView *webView = [m_webFrame.get() webView];
     602    WebView *webView = getWebView(m_webFrame.get());
    560603    [[webView _frameLoadDelegateForwarder] webView:webView didFirstLayoutInFrame:m_webFrame.get()];
    561604}
     
    563606Frame* WebFrameLoaderClient::dispatchCreatePage(NSURLRequest *request)
    564607{
    565     WebView *currentWebView = [m_webFrame.get() webView];
     608    WebView *currentWebView = getWebView(m_webFrame.get());
    566609    id wd = [currentWebView UIDelegate];
    567610    if ([wd respondsToSelector:@selector(webView:createWebViewWithRequest:)])
     
    572615void WebFrameLoaderClient::dispatchShow()
    573616{
    574     WebView *webView = [m_webFrame.get() webView];
     617    WebView *webView = getWebView(m_webFrame.get());
    575618    [[webView _UIDelegateForwarder] webViewShow:webView];
    576619}
     
    578621void WebFrameLoaderClient::dispatchDecidePolicyForMIMEType(WebPolicyDecider *decider, const String& MIMEType, NSURLRequest *request)
    579622{
    580     WebView *webView = [m_webFrame.get() webView];
     623    WebView *webView = getWebView(m_webFrame.get());
    581624
    582625    [[webView _policyDelegateForwarder] webView:webView decidePolicyForMIMEType:MIMEType request:request frame:m_webFrame.get() decisionListener:decisionListener(decider)];
     
    585628void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *decider, NSDictionary *action, NSURLRequest *request, const String& frameName)
    586629{
    587     WebView *webView = [m_webFrame.get() webView];
     630    WebView *webView = getWebView(m_webFrame.get());
    588631    [[webView _policyDelegateForwarder] webView:webView
    589632            decidePolicyForNewWindowAction:action
     
    596639    NSURLRequest *request)
    597640{
    598     WebView *webView = [m_webFrame.get() webView];
     641    WebView *webView = getWebView(m_webFrame.get());
    599642    [[webView _policyDelegateForwarder] webView:webView
    600643                decidePolicyForNavigationAction:action
     
    606649void WebFrameLoaderClient::dispatchUnableToImplementPolicy(NSError *error)
    607650{
    608     WebView *webView = [m_webFrame.get() webView];
     651    WebView *webView = getWebView(m_webFrame.get());
    609652    [[webView _policyDelegateForwarder] webView:webView unableToImplementPolicyWithError:error frame:m_webFrame.get()];   
    610653}
     
    613656    Element* form, NSDictionary *values)
    614657{
    615     [[[m_webFrame.get() webView] _formDelegate] frame:m_webFrame.get() sourceFrame:kit(sourceFrame) willSubmitForm:kit(form) withValues:values submissionListener:decisionListener(decider)];
     658    [[getWebView(m_webFrame.get()) _formDelegate] frame:m_webFrame.get() sourceFrame:kit(sourceFrame) willSubmitForm:kit(form) withValues:values submissionListener:decisionListener(decider)];
    616659}
    617660
     
    619662{
    620663    if ([WebScriptDebugServer listenerCount])
    621         [[WebScriptDebugServer sharedScriptDebugServer] webView:[m_webFrame.get() webView]
     664        [[WebScriptDebugServer sharedScriptDebugServer] webView:getWebView(m_webFrame.get())
    622665            didLoadMainResourceForDataSource:dataSource(loader)];
    623666}
     
    650693void WebFrameLoaderClient::progressStarted()
    651694{
    652     [[m_webFrame.get() webView] _progressStarted:m_webFrame.get()];
     695    [getWebView(m_webFrame.get()) _progressStarted:m_webFrame.get()];
    653696}
    654697
    655698void WebFrameLoaderClient::progressCompleted()
    656699{
    657     [[m_webFrame.get() webView] _progressCompleted:m_webFrame.get()];
     700    [getWebView(m_webFrame.get()) _progressCompleted:m_webFrame.get()];
    658701}
    659702
    660703void WebFrameLoaderClient::incrementProgress(id identifier, NSURLResponse *response)
    661704{
    662     [[m_webFrame.get() webView] _incrementProgressForIdentifier:identifier response:response];
     705    [getWebView(m_webFrame.get()) _incrementProgressForIdentifier:identifier response:response];
    663706}
    664707
    665708void WebFrameLoaderClient::incrementProgress(id identifier, NSData *data)
    666709{
    667     [[m_webFrame.get() webView] _incrementProgressForIdentifier:identifier data:data];
     710    [getWebView(m_webFrame.get()) _incrementProgressForIdentifier:identifier data:data];
    668711}
    669712
    670713void WebFrameLoaderClient::completeProgress(id identifier)
    671714{
    672     [[m_webFrame.get() webView] _completeProgressForIdentifier:identifier];
     715    [getWebView(m_webFrame.get()) _completeProgressForIdentifier:identifier];
    673716}
    674717
    675718void WebFrameLoaderClient::setMainFrameDocumentReady(bool ready)
    676719{
    677     [[m_webFrame.get() webView] setMainFrameDocumentReady:ready];
     720    [getWebView(m_webFrame.get()) setMainFrameDocumentReady:ready];
    678721}
    679722
     
    681724{
    682725    // FIXME: Should download full request.
    683     [[m_webFrame.get() webView] _downloadURL:[request URL]];
     726    [getWebView(m_webFrame.get()) _downloadURL:[request URL]];
    684727}
    685728
     
    687730{
    688731    // FIXME: Should do this only in main frame case, right?
    689     [[m_webFrame.get() webView] _willChangeValueForKey:_WebMainFrameTitleKey];
     732    [getWebView(m_webFrame.get()) _willChangeValueForKey:_WebMainFrameTitleKey];
    690733}
    691734
     
    693736{
    694737    // FIXME: Should do this only in main frame case, right?
    695     [[m_webFrame.get() webView] _didChangeValueForKey:_WebMainFrameTitleKey];
     738    [getWebView(m_webFrame.get()) _didChangeValueForKey:_WebMainFrameTitleKey];
    696739}
    697740
     
    746789NSURL *WebFrameLoaderClient::mainFrameURL()
    747790{
    748     return [[[[m_webFrame.get() webView] mainFrame] dataSource] _URL];
     791    return [[[getWebView(m_webFrame.get()) mainFrame] dataSource] _URL];
    749792}
    750793
     
    849892    // didn't do any data loading on the past transaction. Make sure to clear these out.
    850893    NSScrollView *sv = [m_webFrame->_private->webFrameView _scrollView];
    851     if ([[m_webFrame.get() webView] drawsBackground])
     894    if ([getWebView(m_webFrame.get()) drawsBackground])
    852895        [sv setDrawsBackground:YES];
    853896    [m_webFrame.get() _setPreviousItem:nil];
  • trunk/WebKit/WebCoreSupport/WebPageBridge.h

    r13090 r17396  
    3434@interface WebPageBridge : WebCorePageBridge <WebCorePageBridge>
    3535{
     36@public
    3637    WebView *_webView;
    3738}
  • trunk/WebKit/WebKit.xcodeproj/project.pbxproj

    r17390 r17396  
    4949                6550B7C7099EFAE90090D781 /* WebArchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6550B7C5099EFAE90090D781 /* WebArchiver.h */; };
    5050                6550B7C8099EFAE90090D781 /* WebArchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6550B7C6099EFAE90090D781 /* WebArchiver.m */; };
     51                656D333E0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D333D0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    5152                658A40960A14853B005E6987 /* WebDataSourceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 658A40950A14853B005E6987 /* WebDataSourceInternal.h */; };
    5253                658BA6FC0ADB39DE00AEB387 /* WebPolicyDeciderMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 658BA6FA0ADB39DE00AEB387 /* WebPolicyDeciderMac.h */; };
     
    371372                6550B7C5099EFAE90090D781 /* WebArchiver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebArchiver.h; sourceTree = "<group>"; };
    372373                6550B7C6099EFAE90090D781 /* WebArchiver.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = WebArchiver.m; sourceTree = "<group>"; };
     374                656D333D0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebResourceLoadDelegatePrivate.h; sourceTree = "<group>"; };
    373375                6578F5DE045F817400000128 /* WebDownload.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDownload.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
    374376                6578F5DF045F817400000128 /* WebDownload.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDownload.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
     
    834836                        isa = PBXGroup;
    835837                        children = (
     838                                656D333D0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h */,
    836839                                F52CA6BD02DF9D0F018635CA /* HTML */,
    837840                                51E94C0706C02CA300A9B09E /* PDF */,
     
    11921195                                4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */,
    11931196                                1CA57D620AED6A470009BDD0 /* WebGraphicsExtras.h in Headers */,
     1197                                656D333E0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h in Headers */,
    11941198                                931633EB0AEDFF930062B92D /* WebFrameLoaderClient.h in Headers */,
    11951199                        );
  • trunk/WebKit/WebView/WebFrame.mm

    r17393 r17396  
    4848#import "WebNSURLExtras.h"
    4949#import "WebNSURLRequestExtras.h"
     50#import "WebPageBridge.h"
     51#import "WebPolicyDelegatePrivate.h"
     52#import "WebNetscapePluginEmbeddedView.h"
     53#import "WebNullPluginView.h"
     54#import "WebPlugin.h"
     55#import "WebPluginController.h"
     56#import "WebPolicyDeciderMac.h"
    5057#import "WebPolicyDelegatePrivate.h"
    5158#import "WebPreferencesPrivate.h"
     
    143150@end
    144151
     152Element* core(DOMElement *element)
     153{
     154    return [element _element];
     155}
     156
     157DOMElement *kit(Element* element)
     158{
     159    return [DOMElement _elementWith:element];
     160}
     161
     162Document* core(DOMDocument *document)
     163{
     164    return [document _document];
     165}
     166
     167DOMDocument *kit(Document* document)
     168{
     169    return [DOMDocument _documentWith:document];
     170}
     171
     172HTMLElement* core(DOMHTMLElement *element)
     173{
     174    return [element _HTMLElement];
     175}
     176
     177DOMHTMLElement *kit(HTMLElement *element)
     178{
     179    return [DOMHTMLElement _HTMLElementWith:element];
     180}
     181
     182Range* core(DOMRange *range)
     183{
     184    return [range _range];
     185}
     186
     187DOMRange *kit(Range* range)
     188{
     189    return [DOMRange _rangeWith:range];
     190}
     191
     192@implementation WebFrame (WebInternal)
     193
     194
    145195static inline WebFrame *frame(WebCoreFrameBridge *bridge)
    146196{
    147     return [(WebFrameBridge *)bridge webFrame];
     197    return ((WebFrameBridge *)bridge)->_frame;
    148198}
    149199
    150200FrameMac* core(WebFrame *frame)
    151201{
    152     return [[frame _bridge] _frame];
     202    if (!frame)
     203        return 0;
     204
     205    return frame->_private->bridge->m_frame;
    153206}
    154207
    155208WebFrame *kit(Frame* frame)
    156209{
    157     return frame ? [(WebFrameBridge *)Mac(frame)->bridge() webFrame] : nil;
    158 }
    159 
    160 Element* core(DOMElement *element)
    161 {
    162     return [element _element];
    163 }
    164 
    165 DOMElement *kit(Element* element)
    166 {
    167     return [DOMElement _elementWith:element];
    168 }
    169 
    170 Document* core(DOMDocument *document)
    171 {
    172     return [document _document];
    173 }
    174 
    175 DOMDocument *kit(Document* document)
    176 {
    177     return [DOMDocument _documentWith:document];
    178 }
    179 
    180 HTMLElement* core(DOMHTMLElement *element)
    181 {
    182     return [element _HTMLElement];
    183 }
    184 
    185 DOMHTMLElement *kit(HTMLElement *element)
    186 {
    187     return [DOMHTMLElement _HTMLElementWith:element];
    188 }
    189 
    190 Range* core(DOMRange *range)
    191 {
    192     return [range _range];
    193 }
    194 
    195 DOMRange *kit(Range* range)
    196 {
    197     return [DOMRange _rangeWith:range];
    198 }
    199 
    200 @implementation WebFrame (WebInternal)
     210    return frame ? ((WebFrameBridge *)Mac(frame)->bridge())->_frame : nil;
     211}
     212
     213static inline WebView *getWebView(WebFrame *webFrame)
     214{
     215   Frame* coreFrame = core(webFrame);
     216   return coreFrame ? ((WebPageBridge *)coreFrame->page()->bridge())->_webView : nil;
     217}
    201218
    202219- (NSURLRequest *)_webDataRequestForData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)URL unreachableURL:(NSURL *)unreachableURL
     
    216233{
    217234    if ([[self dataSource] _URLForHistory] != nil) {
    218         WebHistoryItem *bfItem = [[[self webView] mainFrame] _createItemTreeWithTargetFrame:self clippedAtTarget:doClip];
     235        WebHistoryItem *bfItem = [[getWebView(self) mainFrame] _createItemTreeWithTargetFrame:self clippedAtTarget:doClip];
    219236        LOG (BackForward, "for frame %@, adding item  %@\n", [self name], bfItem);
    220         [[[self webView] backForwardList] addItem:bfItem];
     237        [[getWebView(self) backForwardList] addItem:bfItem];
    221238    }
    222239}
     
    298315- (BOOL)_canCachePage
    299316{
    300     return [[[self webView] backForwardList] _usesPageCache] && core(self)->canCachePage();
     317    return [[getWebView(self) backForwardList] _usesPageCache] && core(self)->canCachePage();
    301318}
    302319
     
    304321{
    305322    // This method implements the rule for purging the page cache.
    306     unsigned sizeLimit = [[[self webView] backForwardList] pageCacheSize];
     323    unsigned sizeLimit = [[getWebView(self) backForwardList] pageCacheSize];
    307324    unsigned pagesCached = 0;
    308     WebBackForwardList *backForwardList = [[self webView] backForwardList];
     325    WebBackForwardList *backForwardList = [getWebView(self) backForwardList];
    309326    NSArray *backList = [backForwardList backListWithLimit: 999999];
    310327    WebHistoryItem *oldestNonSnapbackItem = nil;
     
    420437        [self _frameLoader]->documentLoader()->replaceRequestURLForAnchorScroll(itemURL);
    421438       
    422         [[[self webView] _frameLoadDelegateForwarder] webView:[self webView]
     439        [[getWebView(self) _frameLoadDelegateForwarder] webView:getWebView(self)
    423440                               didChangeLocationWithinPageForFrame:self];
    424441        [_private->internalLoadDelegate webFrame:self didFinishLoadWithError:nil];
     
    437454            NSDate *cacheDate = [pageCache objectForKey: WebPageCacheEntryDateKey];
    438455            NSTimeInterval delta = [[NSDate date] timeIntervalSinceDate: cacheDate];
    439             if (delta <= [[[self webView] preferences] _backForwardCacheExpirationInterval]) {
     456            if (delta <= [[getWebView(self) preferences] _backForwardCacheExpirationInterval]) {
    440457                newDataSource = [pageCache objectForKey: WebPageCacheDataSourceKey];
    441458                [self _frameLoader]->load([newDataSource _documentLoader], loadType, 0);   
    442459                inPageCache = YES;
    443460            } else {
    444                 LOG (PageCache, "Not restoring page from back/forward cache because cache entry has expired, %@ (%3.5f > %3.5f seconds)\n", [_private->provisionalItem URL], delta, [[[self webView] preferences] _backForwardCacheExpirationInterval]);
     461                LOG (PageCache, "Not restoring page from back/forward cache because cache entry has expired, %@ (%3.5f > %3.5f seconds)\n", [_private->provisionalItem URL], delta, [[getWebView(self) preferences] _backForwardCacheExpirationInterval]);
    445462                [item setHasPageCache: NO];
    446463            }
     
    568585    // Ultimately, history item navigations should go through the policy delegate. That's covered in:
    569586    // <rdar://problem/3979539> back/forward cache navigations should consult policy delegate
    570     if ([[[self webView] _policyDelegateForwarder] webView:[self webView] shouldGoToHistoryItem:item]) {   
    571         WebBackForwardList *backForwardList = [[self webView] backForwardList];
     587    if ([[getWebView(self) _policyDelegateForwarder] webView:getWebView(self) shouldGoToHistoryItem:item]) {   
     588        WebBackForwardList *backForwardList = [getWebView(self) backForwardList];
    572589        WebHistoryItem *currItem = [backForwardList currentItem];
    573590        // Set the BF cursor before commit, which lets the user quickly click back/forward again.
     
    809826- (void)_updateBackground
    810827{
    811     BOOL drawsBackground = [[self webView] drawsBackground];
    812     NSColor *backgroundColor = [[self webView] backgroundColor];
     828    BOOL drawsBackground = [getWebView(self) drawsBackground];
     829    NSColor *backgroundColor = [getWebView(self) backgroundColor];
    813830
    814831    Frame* coreFrame = core(self);
     
    920937    // responder. It would be nicer to just notice first responder changes here instead, but there's no
    921938    // notification sent when the first responder changes in general (Radar 2573089).
    922     WebFrame *frameWithSelection = [[[self webView] mainFrame] _findFrameWithSelection];
     939    WebFrame *frameWithSelection = [[getWebView(self) mainFrame] _findFrameWithSelection];
    923940    if (frameWithSelection != self)
    924941        [frameWithSelection _clearSelection];
    925942
    926943    // While we're in the general area of selection and frames, check that there is only one now.
    927     ASSERT([[[self webView] mainFrame] _atMostOneFrameHasSelection]);
     944    ASSERT([[getWebView(self) mainFrame] _atMostOneFrameHasSelection]);
    928945}
    929946
     
    958975- (BOOL)_isMainFrame
    959976{
    960     return self == [[self webView] mainFrame];
     977   Frame* coreFrame = core(self);
     978   if (!coreFrame)
     979       return NO;
     980   return coreFrame == coreFrame->page()->mainFrame() ;
    961981}
    962982
     
    10981118- (WebView *)webView
    10991119{
    1100     Frame* coreFrame = core(self);
    1101     return coreFrame ? [coreFrame->page()->bridge() webView] : nil;
     1120    return getWebView(self);
    11021121}
    11031122
  • trunk/WebKit/WebView/WebView.mm

    r17299 r17396  
    929929    WebResourceDelegateImplementationCache *cache = &_private->resourceLoadDelegateImplementations;
    930930    id delegate = [self resourceLoadDelegate];
     931    Class delegateClass = [delegate class];
    931932
    932933    cache->delegateImplementsDidCancelAuthenticationChallenge = [delegate respondsToSelector:@selector(webView:resource:didCancelAuthenticationChallenge:fromDataSource:)];
     
    937938    cache->delegateImplementsWillSendRequest = [delegate respondsToSelector:@selector(webView:resource:willSendRequest:redirectResponse:fromDataSource:)];
    938939    cache->delegateImplementsIdentifierForRequest = [delegate respondsToSelector:@selector(webView:identifierForInitialRequest:fromDataSource:)];
    939 }
    940 
    941 - (WebResourceDelegateImplementationCache)_resourceLoadDelegateImplementations
    942 {
    943     return _private->resourceLoadDelegateImplementations;
     940    cache->delegateImplementsDidLoadResourceFromMemoryCache = [delegate respondsToSelector:@selector(webView:didLoadResourceFromMemoryCache:response:length:fromDataSource:)];
     941
     942    if (cache->delegateImplementsDidCancelAuthenticationChallenge)
     943        cache->didCancelAuthenticationChallengeFunc = (WebDidCancelAuthenticationChallengeFunc)class_getInstanceMethod(delegateClass, @selector(webView:resource:didReceiveAuthenticationChallenge:fromDataSource:))->method_imp;
     944    if (cache->delegateImplementsDidReceiveAuthenticationChallenge)
     945        cache->didReceiveAuthenticationChallengeFunc = (WebDidReceiveAuthenticationChallengeFunc)class_getInstanceMethod(delegateClass, @selector(webView:resource:didReceiveAuthenticationChallenge:fromDataSource:))->method_imp;
     946    if (cache->delegateImplementsDidFinishLoadingFromDataSource)
     947        cache->didFinishLoadingFromDataSourceFunc = (WebDidFinishLoadingFromDataSourceFunc)class_getInstanceMethod(delegateClass, @selector(webView:resource:didFinishLoadingFromDataSource:))->method_imp;
     948    if (cache->delegateImplementsDidReceiveContentLength)
     949        cache->didReceiveContentLengthFunc = (WebDidReceiveContentLengthFunc)class_getInstanceMethod(delegateClass, @selector(webView:resource:didReceiveContentLength:fromDataSource:))->method_imp;
     950    if (cache->delegateImplementsDidReceiveResponse)
     951        cache->didReceiveResponseFunc = (WebDidReceiveResponseFunc)class_getInstanceMethod(delegateClass, @selector(webView:resource:didReceiveResponse:fromDataSource:))->method_imp;
     952    if (cache->delegateImplementsWillSendRequest)
     953        cache->willSendRequestFunc = (WebWillSendRequestFunc)class_getInstanceMethod(delegateClass, @selector(webView:resource:willSendRequest:redirectResponse:fromDataSource:))->method_imp;
     954    if (cache->delegateImplementsIdentifierForRequest)
     955        cache->identifierForRequestFunc = (WebIdentifierForRequestFunc)class_getInstanceMethod(delegateClass, @selector(webView:identifierForInitialRequest:fromDataSource:))->method_imp;
     956    if (cache->delegateImplementsDidLoadResourceFromMemoryCache)
     957        cache->didLoadResourceFromMemoryCacheFunc = (WebDidLoadResourceFromMemoryCacheFunc)class_getInstanceMethod(delegateClass, @selector(webView:didLoadResourceFromMemoryCache:response:length:fromDataSource:))->method_imp;
     958}
     959
     960id WebViewGetResourceLoadDelegate(WebView *webView)
     961{
     962    return webView->_private->resourceProgressDelegate;
     963}
     964
     965WebResourceDelegateImplementationCache WebViewGetResourceLoadDelegateImplementations(WebView *webView)
     966{
     967    return webView->_private->resourceLoadDelegateImplementations;
    944968}
    945969
     
    20312055    return _private->resourceProgressDelegate;
    20322056}
    2033 
    20342057
    20352058- (void)setDownloadDelegate: delegate
  • trunk/WebKit/WebView/WebViewInternal.h

    r16752 r17396  
    5252@end
    5353
     54id WebViewGetResourceLoadDelegate(WebView *webView);
     55WebResourceDelegateImplementationCache WebViewGetResourceLoadDelegateImplementations(WebView *webView);
     56
    5457@interface WebView (WebViewMiscInternal)
    5558- (BOOL)defersCallbacks;
     
    5962- (id)_UIDelegateForwarder;
    6063- (id)_resourceLoadDelegateForwarder;
    61 - (WebResourceDelegateImplementationCache)_resourceLoadDelegateImplementations;
    6264- (id)_frameLoadDelegateForwarder;
    6365- (id)_editingDelegateForwarder;
  • trunk/WebKit/WebView/WebViewPrivate.h

    r17255 r17396  
    3030#import <WebKit/WebFramePrivate.h>
    3131
     32#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
     33#define WebNSInteger int
     34#else
     35#define WebNSInteger NSInteger
     36#endif
     37
    3238@class NSError;
    3339@class WebFrame;
     
    3642
    3743@protocol WebFormDelegate;
     44
     45
     46
     47typedef void (*WebDidCancelAuthenticationChallengeFunc)(id, SEL, WebView *, id, NSURLAuthenticationChallenge *, WebDataSource *);
     48typedef void (*WebDidReceiveAuthenticationChallengeFunc)(id, SEL, WebView *, id, NSURLAuthenticationChallenge *, WebDataSource *);
     49typedef id (*WebIdentifierForRequestFunc)(id, SEL, WebView *, NSURLRequest *, WebDataSource *);
     50typedef NSURLRequest *(*WebWillSendRequestFunc)(id, SEL, WebView *, id, NSURLRequest *, NSURLResponse *, WebDataSource *);
     51typedef void (*WebDidReceiveResponseFunc)(id, SEL, WebView *, id, NSURLResponse *, WebDataSource *);
     52typedef void (*WebDidReceiveContentLengthFunc)(id, SEL, WebView *, id, WebNSInteger, WebDataSource *);
     53typedef void (*WebDidFinishLoadingFromDataSourceFunc)(id, SEL, WebView *, id, WebDataSource *);
     54typedef void (*WebDidLoadResourceFromMemoryCacheFunc)(id, SEL, WebView *, NSURLRequest *, NSURLResponse *, WebNSInteger, WebDataSource *);
    3855
    3956typedef struct _WebResourceDelegateImplementationCache {
     
    4562    uint delegateImplementsWillSendRequest:1;
    4663    uint delegateImplementsIdentifierForRequest:1;
     64    uint delegateImplementsDidLoadResourceFromMemoryCache:1;
     65
     66    WebDidCancelAuthenticationChallengeFunc didCancelAuthenticationChallengeFunc;
     67    WebDidReceiveAuthenticationChallengeFunc didReceiveAuthenticationChallengeFunc;
     68    WebIdentifierForRequestFunc identifierForRequestFunc;
     69    WebWillSendRequestFunc willSendRequestFunc;
     70    WebDidReceiveResponseFunc didReceiveResponseFunc;
     71    WebDidReceiveContentLengthFunc didReceiveContentLengthFunc;
     72    WebDidFinishLoadingFromDataSourceFunc didFinishLoadingFromDataSourceFunc;
     73    WebDidLoadResourceFromMemoryCacheFunc didLoadResourceFromMemoryCacheFunc;
    4774} WebResourceDelegateImplementationCache;
    4875
     
    334361- (void)webView:(WebView *)sender didHandleOnloadEventsForFrame:(WebFrame *)frame;
    335362@end
     363
     364#undef WebNSInteger
Note: See TracChangeset for help on using the changeset viewer.