016cfabdf1a6797ca1585595ee133547fb4d45e0
[WebKit-https.git] / WebKit / mac / ChangeLog
1 2009-03-03  Anders Carlsson  <andersca@apple.com>
2
3         Reviewed by Darin Adler.
4
5         Fix <rdar://problem/6633834>.
6         
7         * Plugins/Hosted/NetscapePluginHostManager.mm:
8         (WebKit::NetscapePluginHostManager::instantiatePlugin):
9         Create a new plug-in instance if the plug-in host has crashed.
10         
11         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
12         (WebKit::NetscapePluginInstanceProxy::invalidate):
13         Add a null check for the plug-in host proxy.
14
15 2009-03-02  Sam Weinig  <sam@webkit.org>
16
17         Reviewed by Mark Rowe.
18
19         Enable Geolocation (except on Tiger and Leopard).
20
21         * Configurations/WebKit.xcconfig:
22
23 2009-03-02  Anders Carlsson  <andersca@apple.com>
24
25         Reviewed by Dan Bernstein.
26
27         WebKit part of <rdar://problem/6638658>.
28         
29         * Plugins/Hosted/NetscapePluginHostManager.h:
30         * Plugins/Hosted/NetscapePluginHostManager.mm:
31         (WebKit::NetscapePluginHostManager::createPropertyListFile):
32         Spawn the plug-in host and wait for it to create the property list.
33         
34         * Plugins/WebBasePluginPackage.mm:
35         (-[WebBasePluginPackage createPropertyListFile]):
36         Factor code out into a new method.
37         
38         (-[WebBasePluginPackage pListForPath:createFile:]):
39         Call the newly added createPropertyListFile method.
40         
41         * Plugins/WebNetscapePluginPackage.mm:
42         (-[WebNetscapePluginPackage createPropertyListFile]):
43         Tell the plug-in host manager to create a property list file for us.
44
45 2009-03-02  Sam Weinig  <sam@webkit.org>
46
47         Reviewed by Geoffrey Garen.
48
49         Fix for <rdar://problem/6507404> Add Geolocation support.
50
51         This is not yet turned on for any Mac platform.
52
53         Add SPI to ask the embedding application whether to allow
54         Geolocation for an origin.
55
56         * WebCoreSupport/WebChromeClient.h:
57         * WebCoreSupport/WebChromeClient.mm:
58         (WebChromeClient::shouldAllowGeolocationForFrame):
59         * WebView/WebUIDelegatePrivate.h:
60
61 2009-03-02  Anders Carlsson  <andersca@apple.com>
62
63         Fix PowerPC build.
64
65         * Plugins/WebNetscapePluginPackage.mm:
66         (-[WebNetscapePluginPackage _tryLoad]):
67
68 2009-03-02  Anders Carlsson  <andersca@apple.com>
69
70         Reviewed by John Sullivan, Ada Chan.
71
72         Factor loading code out into its own method and get rid of a bunch of gotos.
73         
74         * Plugins/WebNetscapePluginPackage.mm:
75         (-[WebNetscapePluginPackage _tryLoad]):
76         (-[WebNetscapePluginPackage load]):
77
78 2009-03-02  Anders Carlsson  <andersca@apple.com>
79
80         Build fix.
81
82         * Plugins/WebNetscapeDeprecatedFunctions.h:
83
84 2009-03-02  Anders Carlsson  <andersca@apple.com>
85
86         Reviewed by John Sullivan.
87
88         Rename WebNetscapePluginPackage.m to WebNetscapePluginPackage.mm
89
90         * Plugins/WebNetscapePluginPackage.m: Removed.
91         * Plugins/WebNetscapePluginPackage.mm: Copied from mac/Plugins/WebNetscapePluginPackage.m.
92
93 2009-03-01  Anders Carlsson  <andersca@apple.com>
94
95         Reviewed by Sam Weinig.
96
97         WebKit side of <rdar://problem/6449689>
98
99         Pass the visible name to the plug-in host.
100         
101         * Plugins/Hosted/NetscapePluginHostManager.mm:
102         (WebKit::NetscapePluginHostManager::spawnPluginHost):
103
104 2009-02-27  Alice Liu  <alice.liu@apple.com>
105
106         Fix <rdar://problem/6531265> REGRESSION (r39185): adding ".jpeg"
107         extension to images that already have .jpg extension
108
109         Reviewed by Oliver Hunt.
110
111         * WebView/WebHTMLView.mm:
112         (-[NSString matchesExtensionEquivalent:]):
113         (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]):
114         Relax the check for the proper extension to allow for known
115         equivalents, special-cased in matchesExtensionEquivalent function.
116
117 2009-02-27  Anders Carlsson  <andersca@apple.com>
118
119         Reviewed by Geoffrey Garen.
120
121         <rdar://problem/6631436>
122         CrashTracer: [USER] 1 crash in Safari at com.apple.WebKit • WebKit::NetscapePluginInstanceProxy::addValueToArray + 55
123         
124         Port the NPN_Evaluate code over from WebCore instead of using the frame loader.
125         
126         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
127         (WebKit::NetscapePluginInstanceProxy::evaluate):
128
129 2009-02-27  Anders Carlsson  <andersca@apple.com>
130
131         Reviewed by Geoffrey Garen.
132
133         WebKit side of <rdar://problem/6626814>.
134         
135         * Plugins/Hosted/NetscapePluginHostProxy.mm:
136         (WKPCInvokeDefault):
137         Make InvokeDefault async.
138         
139         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
140         (WebKit::NetscapePluginInstanceProxy::addValueToArray):
141         Handle passing NPObjects back to the plug-in host.
142         
143         * Plugins/Hosted/ProxyInstance.h:
144         (WebKit::ProxyInstance::objectID):
145         Add objectID getter.
146         
147         * Plugins/Hosted/WebKitPluginClient.defs:
148         Make InvokeDefault a simpleroutine.
149
150 2009-02-27  Timothy Hatcher  <timothy@apple.com>
151
152         Fixes an exception by null checking the WebResource before adding it to
153         the subresources array.
154
155         <rdar://problem/5950769> Bug in [WebDataSource subresources] can throw an exception
156
157         Reviewed by Geoff Garen and Anders Carlsson.
158
159         * WebView/WebDataSource.mm:
160         (-[WebDataSource subresources]): Null check the WebResource before adding it.
161
162 2009-02-27  Timothy Hatcher  <timothy@apple.com>
163
164         Adds a workaround for Automator creating a WebView from a secondary thread.
165
166         <rdar://problem/6631951> REGRESSION (Safari 4 Beta): Automator crash on
167         secondary thread beneath -[WebView initWithFrame:frameName:groupName:]
168
169         Reviewed by Geoff Garen.
170
171         * WebView/WebView.mm:
172         (needsWebViewInitThreadWorkaround): Check for com.apple.Automator.
173
174 2009-02-27  Adam Barth  <abarth@webkit.org>
175
176         Reviewed by Eric Seidel.
177
178         Add a preference to reduce the power of file:// URLs.
179
180         * WebView/WebPreferenceKeysPrivate.h:
181         * WebView/WebPreferences.mm:
182         (+[WebPreferences initialize]):
183         (-[WebPreferences allowUniversalAccessFromFileUrls]):
184         (-[WebPreferences setAllowUniversalAccessFromFileUrls:]):
185         * WebView/WebPreferencesPrivate.h:
186         * WebView/WebView.mm:
187         (-[WebView _preferencesChangedNotification:]):
188
189 2009-02-27  Simon Fraser  <simon.fraser@apple.com>
190
191         Reviewed by Anders Carlsson
192
193         https://bugs.webkit.org/show_bug.cgi?id=24242
194         
195         setCursor(), and resetCursorRects() on Tiger, were using global, not local
196         coordinates for elementAtPoint:
197         
198         * WebView/WebHTMLView.mm:
199         (resetCursorRects):
200         (setCursor):
201
202 2009-02-27  Adam Barth  <abarth@webkit.org>
203
204         Reviewed by Eric Seidel.
205
206         Add a preference to reduce the power of file:// URLs.
207
208         * WebView/WebPreferenceKeysPrivate.h:
209         * WebView/WebPreferences.mm:
210         (+[WebPreferences initialize]):
211         (-[WebPreferences allowUniversalAccessFromFileUrls]):
212         (-[WebPreferences setAllowUniversalAccessFromFileUrls:]):
213         * WebView/WebPreferencesPrivate.h:
214         * WebView/WebView.mm:
215         (-[WebView _preferencesChangedNotification:]):
216
217 2009-02-26  Adele Peterson  <adele@apple.com>
218
219         Reviewed by Geoff Garen.
220
221         Fix for <rdar://problem/6618166>
222         https://bugs.webkit.org/show_bug.cgi?id=24216
223         (REGRESSION r36919) Safari 4 Beta causes MSN Messenger's text entry field to lose focus after entering a message
224
225         During a series of firstResponder changes, at some point while the WebHTMLView was losing first responder status,
226         we incorrectly marked the page as active, and then when the WebHTMLView became first responder again, setActive did nothing.
227         This change restores behavior from before r36919 to check if the WebHTMLView is in the middle of losing first responder when calling setActive.
228
229         In addition to updating editing/selection/designmode-no-caret.html results, I also made sure the test cases that were 
230         fixed in r36919 and r38570 are still fixed.
231
232         * WebView/WebHTMLView.mm:
233         (-[WebHTMLView resignFirstResponder]): Keep track if we're in the process of resigning first responder.
234         (-[WebHTMLView _isResigningFirstResponder]): Added.
235         * WebView/WebHTMLViewInternal.h:
236         * WebView/WebView.mm: (-[WebView _updateFocusedAndActiveStateForFrame:]): Don't set the page to be active
237         if the document view is currently resigning first responder.
238
239 2009-02-25  Anders Carlsson  <andersca@apple.com>
240
241         Reviewed by Kevin Decker.
242
243         Fix <rdar://problem/6623697>.
244         
245         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
246         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
247         (WebKit::NetscapePluginInstanceProxy::print):
248         Ask the plug-in host to print, create a CGImage of the returned bytes and draw
249         the image into the passed in context.
250         
251         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
252         (-[WebHostedNetscapePluginView drawRect:]):
253         When printing, call NetscapePluginInstanceProxy::print.
254         
255         * Plugins/Hosted/WebKitPluginHost.defs:
256
257 2009-02-19  Alexey Proskuryakov  <ap@webkit.org>
258
259         Reviewed by Darin Adler.
260
261         https://bugs.webkit.org/show_bug.cgi?id=24024
262         REGRESSION (r39845): Assertion failure in -[WebHistoryItem dictionaryRepresentation] when
263         archiving a submission to about:blank
264
265         I don't know how to make an automated test for this bug.
266
267         * History/WebHistory.mm: (-[WebHistory _visitedURL:withTitle:method:wasFailure:]):
268         Account for the fact that HTTP method may be non-empty for non-HTTP requests.
269
270 2009-02-25  Chris Fleizach  <cfleizach@apple.com>
271
272         Reviewed by Beth Dakin.
273
274         Naming change from
275         Bug 24143: Crash occurs at WebCore::AccessibilityTable::isTableExposableThroughAccessibility() when applying a link in GMail
276         https://bugs.webkit.org/show_bug.cgi?id=24143
277
278         * WebView/WebFrame.mm:
279         (-[WebFrame _accessibilityTree]):
280
281 2009-02-25  Simon Fraser  <simon.fraser@apple.com>
282
283         Build fix with ACCELERATED_COMPOSITING turned on.
284         
285         I missed a spot in my last commit in renaming to
286         _stoppedAcceleratedCompositingForFrame:
287         
288         * WebView/WebHTMLView.mm:
289         (-[WebHTMLView close]):
290
291 2009-02-25  Simon Fraser  <simon.fraser@apple.com>
292
293         Reviewed by Dan Bernstein
294
295         https://bugs.webkit.org/show_bug.cgi?id=23854
296
297         Make an observable property, _isUsingAcceleratedCompositing, on
298         WebView that DumpRenderTree can use to specialize behavior.
299         
300         This is implemented via a count of Frames that are using
301         accelerated compositing.
302
303         * WebView/WebHTMLView.mm:
304         (-[WebHTMLViewPrivate clear]):
305         (-[WebHTMLView close]):
306         (-[WebHTMLView attachRootLayer:]):
307         (-[WebHTMLView detachRootLayer]):
308         * WebView/WebView.mm:
309         (+[WebView automaticallyNotifiesObserversForKey:]):
310         (-[WebView _startedAcceleratedCompositingForFrame:]):
311         (-[WebView _stoppedAcceleratedCompositingForFrame:]):
312         (-[WebView _isUsingAcceleratedCompositing]):
313         * WebView/WebViewInternal.h:
314         * WebView/WebViewPrivate.h:
315
316 2009-02-24  Sam Weinig  <sam@webkit.org>
317
318         Reviewed by Geoffrey Garen.
319
320         Related to <rdar://problem/6590295>
321         Allow disabling javascript: urls.
322
323         * WebView/WebView.mm:
324         (-[WebView _setJavaScriptURLsAreAllowed:]):
325         * WebView/WebViewPrivate.h:
326
327 2009-02-24  Mark Rowe  <mrowe@apple.com>
328
329         Reviewed by Oliver Hunt.
330
331         <rdar://problem/6259220> Rename AVAILABLE_AFTER_WEBKIT_VERSION_3_1 (etc.) to match the other macros
332
333         * Carbon/CarbonUtils.h:
334         * Carbon/HIWebView.h:
335         * Plugins/WebPlugin.h:
336         * Plugins/WebPluginViewFactory.h:
337         * WebView/WebUIDelegate.h:
338
339 2009-02-24  Peter Ammon  <pammon@apple.com>
340
341         Reviewed by Mark Rowe.
342
343         Fix <rdar://problem/6251410> Services can modify non-editable content in Safari
344
345         * WebView/WebHTMLView.mm:
346         (-[WebHTMLView validRequestorForSendType:returnType:]): Return self only if we can handle
347         both the send and return type.  We should also handle a nil send or return type by ignoring
348         the argument and returning whether we can handle the other type passed in.
349
350 2009-02-23  Anders Carlsson  <andersca@apple.com>
351
352         Reviewed by Geoffrey Garen and Darin Adler.
353
354         WebKit side of <rdar://problem/6613151>.
355         
356         Make sure to vm_deallocate all memory we get from MIG callbacks.
357         
358         * Plugins/Hosted/NetscapePluginHostProxy.mm:
359         (DataDeallocator::DataDeallocator):
360         (DataDeallocator::~DataDeallocator):
361         Add a simple deallocator class.
362         
363         (WKPCStatusText):
364         (WKPCLoadURL):
365         (WKPCBooleanAndDataReply):
366         (WKPCEvaluate):
367         (WKPCGetStringIdentifier):
368         (WKPCInvoke):
369         (WKPCInvokeDefault):
370         (WKPCConstruct):
371         (WKPCSetProperty):
372         Use the new deallocator class.
373
374 2009-02-23  Anders Carlsson  <andersca@apple.com>
375
376         Reviewed by Darin Adler.
377
378         Fix <rdar://problem/6450656>.
379         
380         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
381         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
382         (WebKit::NetscapePluginInstanceProxy::insertText):
383         Add insert text which just calls the new WKPH function.
384         
385         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
386         (-[WebHostedNetscapePluginView inputContext]):
387         Get the input context from the shared input panel.
388         
389         (-[WebHostedNetscapePluginView keyDown:]):
390         Let the shared input panel have a go at the event first.
391         
392         * Plugins/Hosted/WebKitPluginHost.defs:
393         Add new InsertText function.
394
395 2009-02-23  Mark Rowe  <mrowe@apple.com>
396
397         Fix the build after r41126.
398
399         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
400         (WebKit::NetscapePluginInstanceProxy::invoke):
401         (WebKit::NetscapePluginInstanceProxy::invokeDefault):
402         (WebKit::NetscapePluginInstanceProxy::construct):
403
404 2009-02-22  Dan Bernstein  <mitz@apple.com>
405
406         Reviewed by Darin Adler.
407
408         - fix <rdar://problem/5966123> REGRESSION (r30741): Generic Sun Applet loading logo appears half off screen
409
410         * WebCoreSupport/WebFrameLoaderClient.mm: Correct a copy & paste error
411         in r30741, and assign the height value, rather than the width, to the
412         "height" parameter.
413
414 2009-02-21  Anders Carlsson  <andersca@apple.com>
415
416         Fix build.
417         
418         * Plugins/Hosted/WebTextInputWindowController.m:
419
420 2009-02-20  Anders Carlsson  <andersca@apple.com>
421
422         Reviewed by Dan Bernstein.
423
424         Add a shared floating text input window implementation, to be used by the hosted plug-in view.
425         
426         * Plugins/Hosted/WebTextInputWindowController.h: Added.
427         * Plugins/Hosted/WebTextInputWindowController.m: Added.
428
429 2009-02-20  Kevin Decker  <kdecker@apple.com>
430
431         Reviewed by andersca.
432     
433         <rdar://problem/6496140> Safari sometimes hangs in WKSetMetadataURL for several seconds after downloading a file
434          
435          Spawn a background thread for WKSetMetadataURL because this function will not return until mds has journaled the data
436          we are trying to set. Depending on what other I/O is going on, it can take some time. 
437
438         * Misc/WebNSFileManagerExtras.m: Import pthread.h and FoundationExtras.h
439         (setMetaData): Added. Calls WKSetMetadataURL().
440         (-[NSFileManager _webkit_setMetadataURL:referrer:atPath:]): Call setMetaData on a background thread 
441  
442 2009-02-19  Dan Bernstein  <mitz@apple.com>
443
444         Reviewed by Sam Weinig.
445
446         - WebKit part of fixing https://bugs.webkit.org/show_bug.cgi?id=24027
447           Do not send loader callbacks during CSS styling
448
449         * WebView/WebView.mm:
450         (-[WebView _preferencesChangedNotification:]): Reverted the
451         iChat-specific quirk added in <http://trac.webkit.org/changeset/41071>.
452
453 2009-02-18  Dan Bernstein  <mitz@apple.com>
454
455         Reviewed by Brady Eidson.
456
457         - WebKit part of fixing <rdar://problem/6507512> Crash in iChat at CSSStyleSelector::adjustRenderStyle
458
459         * WebView/WebView.mm:
460         (-[WebView _preferencesChangedNotification:]): Activate the WebCore
461         workaround for this crash in iChat.
462
463 2009-02-18  Anders Carlsson  <andersca@apple.com>
464
465         Reviewed by Sam Weinig.
466
467         Fix for <rdar://problem/6542390>
468         
469         There's no need to call setDefersLoading here - we already defer anything a plug-in can do that
470         would cause a load to begin.
471         
472         * Plugins/WebNetscapePluginView.mm:
473         (-[WebNetscapePluginView sendEvent:isDrawRect:]):
474
475 2009-02-18  Adam Roben  <aroben@apple.com>
476
477         Add SPI to get WebKit's custom pointing-hand cursor
478
479         Reviewed by John Sullivan.
480
481         * WebView/WebView.mm:
482         (+[WebView _pointingHandCursor]): Added. Returns the custom
483         pointing-hand cursor that WebKit uses.
484         * WebView/WebViewPrivate.h: Added +_pointingHandCursor.
485
486 2009-02-17  Eric Carlson  <eric.carlson@apple.com>
487
488         Reviewed by Antti Koivisto.
489
490         https://bugs.webkit.org/show_bug.cgi?id=23917
491         Allow a WebKit plug-in to act as a proxy for the <audio> and <video>
492         element.
493
494         * Plugins/WebPluginContainerPrivate.h:
495         * Plugins/WebPluginController.mm:
496         (mediaProxyClient): New, cast to HTMLMediaElement if it is a video or audio element
497         (-[WebPluginController _setMediaPlayerProxy:forElement:]): New, pass proxy to HTMLMediaElement
498         (-[WebPluginController _postMediaPlayerNotification:forElement:]): New, deliver event to HTMLMediaElement
499
500         * WebCoreSupport/WebFrameLoaderClient.mm:
501         (WebFrameLoaderClient::createPlugin): Don't allow a media player proxy plug-in to be chosen by
502         file extension, only want a match for the new MIME type proxy plug-ins should have.
503
504 2009-02-13  Anders Carlsson  <andersca@apple.com>
505
506         Reviewed by Kevin Decker.
507
508         <rdar://problem/6584834> ESPN radio live stream link hangs Safari 
509
510         When a plug-in invokes JavaScript code that will destroy the plug-in, we need to
511         defer destruction until we're done executing the script.
512         
513         * Plugins/Hosted/NetscapePluginHostProxy.mm:
514         (WebKit::PluginDestroyDeferrer::PluginDestroyDeferrer):
515         (WebKit::PluginDestroyDeferrer::~PluginDestroyDeferrer):
516         Add a simple RAII object for deferring destruction of the plug-in instance.
517         
518         (WKPCEvaluate):
519         (WKPCInvoke):
520         (WKPCInvokeDefault):
521         (WKPCConstruct):
522         (WKPCGetProperty):
523         (WKPCSetProperty):
524         (WKPCRemoveProperty):
525         (WKPCHasProperty):
526         (WKPCHasMethod):
527         Use the PluginDestroyDeferrer.
528         
529         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
530         (WebKit::NetscapePluginInstanceProxy::pluginID):
531         Assert that the plug-in ID is not 0 here.
532         
533         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
534         (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
535         Initialize the call depth.
536         
537         (WebKit::NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy):
538         Set the plug-in ID to 0 to aid debugging.
539         
540         (WebKit::NetscapePluginInstanceProxy::willCallPluginFunction):
541         Increment the call depth.
542         
543         (WebKit::NetscapePluginInstanceProxy::didCallPluginFunction):
544         Decrement the call depth, if it's 0 and we should stop the plug-in, do so.
545         
546         (WebKit::NetscapePluginInstanceProxy::shouldStop):
547         If we're called this with a non-zero call depth, set shouldStopSoon to true.
548         
549         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
550         (-[WebHostedNetscapePluginView shouldStop]):
551         Call the proxy.
552
553 2009-02-12  Brady Eidson  <beidson@apple.com>
554
555         Reviewed by Kevin Decker
556
557         <rdar://problem/6582180> - Wrong HTTP method applied to history item.
558
559         * WebCoreSupport/WebFrameLoaderClient.mm:
560         (WebFrameLoaderClient::updateGlobalHistory): Check the original request, not any
561           redirected request.
562
563 2009-02-12  Anders Carlsson  <andersca@apple.com>
564
565         Reviewed by Kevin Decker.
566
567         <rdar://problem/6579412> 
568         REGRESSION (3.2.1-ToT): Crash in Silverlight viewing streaming lecture
569         
570         * Plugins/WebNetscapePluginView.h:
571         * Plugins/WebNetscapePluginView.mm:
572         (-[WebNetscapePluginView userAgent]):
573         Apply workaround for Silverlight workaround.
574         
575         (-[WebNetscapePluginView _createPlugin]):
576         Check if the plug-in that we're creating is the silverlight plug-in.
577
578 2009-02-12  Brady Eidson  <beidson@apple.com>
579
580         Reviewed by Darin Adler
581
582         Fix potential ref-count or null-deref problems with C++ objects as Obj-C members.
583
584         * History/WebBackForwardList.mm:
585         (-[WebBackForwardList dealloc]): Null check before deref()'ing.
586         (-[WebBackForwardList finalize]): Ditto.
587
588         * Misc/WebIconFetcher.mm:
589         (-[WebIconFetcher dealloc]): Null check before deref()'ing.
590         (-[WebIconFetcher finalize]): Ditto.
591
592         * WebCoreSupport/WebEditorClient.mm: Change to use RefPtr<> instead of ref()/deref().
593         (-[WebEditCommand initWithEditCommand:]):
594         (-[WebEditCommand dealloc]):
595         (-[WebEditCommand finalize]):
596         (-[WebEditCommand command]):
597
598         * WebView/WebArchive.mm: Change to use RefPtr<> instead of ref()/deref().
599         (-[WebArchivePrivate init]):
600         (-[WebArchivePrivate initWithCoreArchive:]):
601         (-[WebArchivePrivate coreArchive]):
602         (-[WebArchivePrivate setCoreArchive:]):
603         (-[WebArchivePrivate dealloc]):
604         (-[WebArchivePrivate finalize]):
605
606         * WebView/WebDataSource.mm: 
607         (-[WebDataSourcePrivate dealloc]): Null check before deref()'ing.
608         (-[WebDataSourcePrivate finalize]): Ditto.
609
610 2009-02-12  Brady Eidson  <beidson@apple.com>
611
612         Reviewed by Kevin Decker
613
614         <rdar://problem/6579750> - Crash in WebArchivePrivate in Tiger TextEdit
615
616         NSHTMLReader tries to create a WebArchive from a random chunk of data.  Previously, WebArchive creation would
617         fail and return nil and NSHTMLReader would try something else.  When we changed the behavior to return an invalid
618         WebArchive object, things started getting weird.
619
620         * WebView/WebArchive.mm:
621         (-[WebArchivePrivate setCoreArchive:]): Null check the pointer before calling ->deref()
622         (-[WebArchivePrivate dealloc]): Remove the ASSERT which is now invalid, and null check the pointer before ->deref().
623         (-[WebArchivePrivate finalize]): Ditto
624         (-[WebArchive initWithData:]): If the LegacyWebArchive cannot be created, return nil instead of an invalid object.
625
626 2009-02-11  Mark Rowe  <mrowe@apple.com>
627
628         Fix the build.
629
630         * History/WebHistory.mm:
631         (-[WebHistoryPrivate visitedURL:withTitle:]): Use ASSERT_UNUSED in a manner that makes sense.
632
633 2009-02-11  Brady Eidson  <beidson@apple.com>
634
635         Reviewed by Mark Rowe
636
637         <rdar://problem/6570573> Some visit counts in History.plist have insanely high values, can roll over to negative
638
639         Remove the item from the date caches before registering the visit.  Otherwise it might not be successfully removed 
640         and when we add it back later it will exist in the list twice.  This will cause the entry to be written out twice,
641         which would lead to doubling (or more!) the visit count on next launch when these multiple items are merged.
642
643         * History/WebHistory.mm:
644         (-[WebHistoryPrivate visitedURL:withTitle:]): Swap the removeItemFromDateCaches and visitedWithTitle calls.
645         (-[WebHistoryPrivate addItem:discardDuplicate:]): Add a mode that allows the entry being added to be discarded
646           if an entry for the URL already exists.  Use that mode when reading the History.plist so only the most
647           recent entry for a given URL will be used.
648         (-[WebHistoryPrivate addItems:]):
649         (-[WebHistoryPrivate loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]): 
650
651 2009-02-11  Dimitri Dupuis-latour  <dupuislatour@apple.com>
652
653         Added a preference to disable some Inspector's panels (rdar://6419624, rdar://6419645).
654         This is controlled via the 'WebKitInspectorHiddenPanels' key; if nothing is specified, all panels are shown.
655
656         Reviewed by Timothy Hatcher.
657
658         * WebCoreSupport/WebInspectorClient.h:
659         * WebCoreSupport/WebInspectorClient.mm:
660         (WebInspectorClient::hiddenPanels):
661
662 2009-02-11  Alexey Proskuryakov  <ap@webkit.org>
663
664         Reviewed by Darin Adler.
665
666         <rdar://problem/6562920> Pasted text should be normalized to NFC
667
668         * Misc/WebNSURLExtras.mm: (-[NSURL _web_userVisibleString]): Route the URL string through
669         -[NSString precomposedStringWithCanonicalMapping].
670
671         * WebCoreSupport/WebPasteboardHelper.mm:
672         (WebPasteboardHelper::plainTextFromPasteboard): Ditto. 
673
674         * WebView/WebHTMLView.mm:
675         (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]):
676         Ditto. The affected cases are all plain text ones - RTF, RTFD and HTML are assumed to be
677         precomposed already, and the conversion is performed outside WebKit for those anyway.
678
679 2009-02-10  John Sullivan  <sullivan@apple.com>
680
681         Reviewed by Dan Bernstein
682         
683         <https://bugs.webkit.org/show_bug.cgi?id=23889>, <rdar://problem/6572300>
684         Negative visit counts stored in History.plist aren't corrected.
685         
686         It's not clear how a huge negative visit count ended up in History.plist, but we can't
687         trust data read from disk so we can at least reset this to something sane. WebCore has
688         no guard against a visit count overflowing an int, but that seems very unlikely to have
689         caused this.
690
691         * History/WebHistoryItem.mm:
692         (-[WebHistoryItem initFromDictionaryRepresentation:]):
693         If a negative visit count is in the dictionary, replace it with 1. If a negative daily or
694         weekly visit count is in the dictionary, replace it with 0. 
695
696 2009-02-10  John Sullivan  <sullivan@apple.com>
697
698         Reviewed by Dan Bernstein
699         
700         <https://bugs.webkit.org/show_bug.cgi?id=23891>
701         [WebHistoryItem _setVisitCount:] is unused and should be removed
702
703         * History/WebHistoryItem.mm:
704         (-[WebHistoryItem _setVisitCount:]):
705         removed this unused method, which is a synonym for setVisitCount: that was introduced
706         recently and abandoned even more recently
707
708         * History/WebHistoryItemInternal.h:
709         removed declaration of _setVisitCount:
710
711 2009-02-10  Anders Carlsson  <andersca@apple.com>
712
713         Reviewed by Mark Rowe.
714
715         <rdar://problem/6573916> 
716         CrashTracer: [USER] 1 crash in Safari at com.apple.WebKit • WebKit::NetscapePluginInstanceProxy::pluginHostDied + 25.
717         
718         * Plugins/Hosted/NetscapePluginHostManager.mm:
719         (WebKit::NetscapePluginHostManager::instantiatePlugin):
720         If we failed to instantiate the plug-in, invalidate the instance proxy.
721         
722         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
723         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
724         (WebKit::NetscapePluginInstanceProxy::invalidate):
725         Remove the instance from the plug-in host's set.
726         
727         (WebKit::NetscapePluginInstanceProxy::destroy):
728         Call invalidate().
729
730 2009-02-09  Mark Rowe  <mrowe@apple.com>
731
732         Reviewed by Dan Bernstein.
733
734         Fix <https://bugs.webkit.org/show_bug.cgi?id=23863> / <rdar://problem/6571390>.
735         Bug 23863: Reproducible crash in Mail with TOT WebKit when creating a new message
736
737         * WebView/WebHTMLView.mm:
738         (-[WebHTMLView _removeMouseMovedObserverUnconditionally]): Nil-check _private as it may have not
739         yet been initialized if this WebHTMLView was loaded from a nib.
740         (-[WebHTMLView _removeSuperviewObservers]): Ditto.
741
742 2009-02-09  Eric Seidel  <eric@webkit.org>
743
744         Reviewed by Dave Hyatt.
745
746         Rename Selection to VisibleSelection to allow us to separate
747         the selections the user works with from the ones used by
748         the JS editing APIs.
749         https://bugs.webkit.org/show_bug.cgi?id=23852
750
751         * WebView/WebFrame.mm:
752         (-[WebFrame _selectNSRange:]):
753         * WebView/WebView.mm:
754         (-[WebView textIteratorForRect:]):
755
756 2009-02-06  Anders Carlsson  <andersca@apple.com>
757
758         Reviewed by Kevin Decker.
759         
760         Fix crash when plug-in host dies.
761         
762         * Plugins/Hosted/HostedNetscapePluginStream.mm:
763         (WebKit::HostedNetscapePluginStream::didFail):
764
765 2009-02-05  Eric Seidel  <eric@webkit.org>
766
767         Reviewed by Justin Garcia.
768
769         DOMSelection.getRangeAt() returns a different range than the selection
770         https://bugs.webkit.org/show_bug.cgi?id=23601
771
772         Rename toRange to toNormalizedRange and add new firstRange which returns an unmodified range
773
774         * WebView/WebFrame.mm:
775         (-[WebFrame _rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
776         (-[WebFrame _markDOMRange]):
777         (-[WebFrame _replaceSelectionWithText:selectReplacement:smartReplace:]):
778         (-[WebFrame _selectedNSRange]):
779         * WebView/WebHTMLView.mm:
780         (-[WebHTMLView _selectedRange]):
781         (-[WebTextCompleteController doCompletion]):
782         (-[WebHTMLView selectedAttributedString]):
783         * WebView/WebView.mm:
784         (-[WebView textIteratorForRect:]):
785         (-[WebView selectedDOMRange]):
786
787 2009-02-06  Geoffrey Garen  <ggaren@apple.com>
788
789         Reviewed by Sam Weinig.
790
791         Part III of <rdar://problem/6552272>.
792         
793         Refactored to use the redirect data WebCore makes available, instead of
794         tracking loading state in WebKit.
795         
796         * History/WebHistory.mm:
797         (-[WebHistoryPrivate dealloc]):
798         (-[WebHistory _visitedURL:withTitle:method:wasFailure:]):
799         (-[WebHistory _visitedURLForRedirectWithoutHistoryItem:]):
800         * History/WebHistoryInternal.h:
801         * WebCoreSupport/WebFrameLoaderClient.h:
802         * WebCoreSupport/WebFrameLoaderClient.mm:
803         (WebFrameLoaderClient::updateGlobalHistory):
804         (WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
805
806 2009-02-06  Anders Carlsson  <andersca@apple.com>
807
808         Reviewed by Sam Weinig.
809
810         <rdar://problem/6562220> 
811         CrashTracer: [USER] 21 crashes in Safari at com.apple.WebKit • WebKit::NetscapePluginHostProxy::port
812         
813         Make the handling of crashes in the plug-in host more robust.
814         
815         * Plugins/Hosted/NetscapePluginHostProxy.h:
816         Add m_portSet.
817         
818         * Plugins/Hosted/NetscapePluginHostProxy.mm:
819         (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
820         Initialize m_portSet.
821         
822         (WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy):
823         Free m_portSet.
824         
825         (WebKit::NetscapePluginHostProxy::processRequests):
826         Listen for messages on the port set. If we get a message to the port death notification port,
827         then call pluginHostDied. Otherwise, process the message.
828         
829         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
830         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
831         (WebKit::NetscapePluginInstanceProxy::cleanup):
832         Factor code that should be shared between destroy() and pluginHostDied() into cleanup.
833         
834         (WebKit::NetscapePluginInstanceProxy::destroy):
835         Call cleanup().
836         
837         (WebKit::NetscapePluginInstanceProxy::pluginHostDied):
838         Call cleanup().
839         
840         (WebKit::NetscapePluginInstanceProxy::processRequestsAndWaitForReply):
841         Call NetscapePluginHostProxy::processRequests.
842         
843         * Plugins/Hosted/ProxyInstance.mm:
844         (WebKit::ProxyInstance::invalidate):
845         Add a null check for the host proxy.
846
847 2009-02-06  Dan Bernstein  <mitz@apple.com>
848
849         - try to fix the Tiger build
850
851         * Misc/WebNSArrayExtras.h:
852
853 2009-02-06  Anders Carlsson  <andersca@apple.com>
854
855         Reviewed by Dan Bernstein.
856
857         <rdar://problem/6563650> 
858         Add Netscape plug-in API to tell the browser not to load streams (some plug-ins handle network loading manually)
859                 
860         * Plugins/WebNetscapePluginView.mm:
861         (-[WebNetscapePluginView loadStream]):
862         (-[WebNetscapePluginView pluginView:receivedData:]):
863         (-[WebNetscapePluginView _shouldCancelSrcStream]):
864
865 2009-02-05  Maciej Stachowiak  <mjs@apple.com> and Brady Eidson  <beidson@apple.com>
866
867         Reviewed by Dan Bernstein and Geoff Garen.
868
869         - WebKit code to track per-day and per-week visit counts in history
870
871         For now this data is only exposed via SPI for performance reasons.
872         
873         * History/WebHistoryItem.mm:
874         (-[WebHistoryItem initFromDictionaryRepresentation:]): Add parsing support
875         for new data.
876         (-[WebHistoryItem _recordInitialVisit]): Tell WebCore to record an initial visit.
877         (-[WebHistoryItem dictionaryRepresentation]): Add saving support for new data.
878         (-[WebHistoryItem _getDailyVisitCounts:]): SPI accessor.
879         (-[WebHistoryItem _getWeeklyVisitCounts:]): SPI accessor.
880         * History/WebHistoryItemInternal.h: Declare new methods.
881         * History/WebHistoryItemPrivate.h: Ditto.
882
883         * History/WebHistory.mm:
884         (-[WebHistoryPrivate visitedURL:withTitle:]): For the initial visit, use
885         the new _recordInitialVisit method instead of setting visit count to 1.
886
887         * Misc/WebNSArrayExtras.h:
888         * Misc/WebNSArrayExtras.m:
889         (-[NSArray _webkit_numberAtIndex:]): Helper to retrieve an NSNumber or nil from an NSArray
890         (-[NSArray _webkit_stringAtIndex:]): Helper to retrieve an NSString of nil from an NSArray
891         
892 2009-02-05  Aaron Boodman  <aa@chromium.org>
893
894         Reviewed by Dave Hyatt.
895
896         https://bugs.webkit.org/show_bug.cgi?id=23708
897         Adds documentElementAvailable() callback to FrameLoaderClient.
898
899         * WebCoreSupport/WebFrameLoaderClient.h:
900         Stub out documentElementAvailable().
901         * WebCoreSupport/WebFrameLoaderClient.mm:
902         Ditto.
903
904 2009-02-05  Dan Bernstein  <mitz@apple.com>
905
906         - build fix
907
908         * WebView/WebScriptDebugger.mm:
909         (WebScriptDebugger::initGlobalCallFrame):
910
911 2009-02-05  Beth Dakin  <bdakin@apple.com>
912
913         Reviewed by John Sullivan and Brady Eidson.
914
915         Fix for <rdar://problem/6557595> REGRESSION: In Mail, selecting a 
916         mail note message doesn't display it in Mail's preview pane
917
918         This was failing because revision 36962 removed a version of 
919         setVerticalScrollingMode that mail calls. This patch simply adds 
920         that method back.
921
922         * WebView/WebDynamicScrollBarsView.m:
923         (-[WebDynamicScrollBarsView setVerticalScrollingMode:]):
924
925 2009-02-04  Anders Carlsson  <andersca@apple.com>
926
927         Build fix fix.
928
929         * WebView/WebScriptDebugger.mm:
930         (WebScriptDebugger::initGlobalCallFrame):
931
932 2009-02-04  Anders Carlsson  <andersca@apple.com>
933
934         Reviewed by Sam Weinig.
935         
936         Change PCHasProperty, PCHasMethod and PCGetProperty into simpleroutines.
937         
938         Rename PHEvaluateReply to PHBooleanAndDataReply and add PHBooleanReply.
939         
940         * Plugins/Hosted/NetscapePluginHostProxy.mm:
941         (WKPCEvaluate):
942         (WKPCInvoke):
943         (WKPCGetProperty):
944         (WKPCHasProperty):
945         (WKPCHasMethod):
946         * Plugins/Hosted/WebKitPluginClient.defs:
947         * Plugins/Hosted/WebKitPluginHost.defs:
948
949 2009-02-04  Anders Carlsson  <andersca@apple.com>
950
951         Reviewed by Mark Rowe.
952
953         Fix 64-bit build.
954         
955         * WebView/WebScriptDebugger.mm:
956         (WebScriptDebugger::initGlobalCallFrame):
957
958 2009-02-04  Geoffrey Garen  <ggaren@apple.com>
959
960         Reviewed by Mark Rowe.
961         
962         Part I of <rdar://problem/6552272>.
963
964         Clear the redirectURLs entry when first visiting a site, so sites that
965         only redirect you the first time you visit them can later learn that
966         they don't redirect.
967
968         * History/WebHistory.mm:
969         (-[WebHistory _visitedURL:withTitle:method:wasFailure:serverRedirectURL:isClientRedirect:]):
970
971 2009-02-04  Timothy Hatcher  <timothy@apple.com>
972
973         Change the WebSourceId typedef from int to intptr_t now that <rdar://problem/6263297> is fixed.
974
975         <rdar://problem/6263293> WebScriptDebugDelegate should use intptr_t for sourceId, not int
976
977         Reviewed by Oliver Hunt.
978
979         * WebView/WebScriptDebugDelegate.h:
980
981 2009-02-04  Timothy Hatcher  <timothy@apple.com>
982
983         Switched over from using the WebSafeForwarder for the Script Debug
984         delegate and added high performance CallScriptDebugDelegate functions.
985
986         <rdar://problem/6508457> Launching widget in Dashcode debugger is
987         super-slow due forwardInvocation: calling debug delegate
988
989         Reviewed by Oliver Hunt.
990
991         * DefaultDelegates/WebDefaultScriptDebugDelegate.h: Removed.
992         * DefaultDelegates/WebDefaultScriptDebugDelegate.m: Removed.
993         * WebView/WebScriptDebugger.mm:
994         (WebScriptDebugger::initGlobalCallFrame): Use CallScriptDebugDelegate.
995         (WebScriptDebugger::sourceParsed): Ditto.
996         (WebScriptDebugger::callEvent): Ditto.
997         (WebScriptDebugger::atStatement): Ditto.
998         (WebScriptDebugger::returnEvent): Ditto.
999         (WebScriptDebugger::exception): Ditto.
1000         * WebView/WebView.mm:
1001         (-[WebViewPrivate dealloc]): Removed scriptDebugDelegateForwarder.
1002         (-[WebView _cacheScriptDebugDelegateImplementations]): Added. Gets the
1003         method implementations for the script debug delegate. Also caches what
1004         didParseSource method to use.
1005         (WebViewGetScriptDebugDelegateImplementations): Added. Returns the
1006         WebScriptDebugDelegateImplementations structure.
1007         (-[WebView setScriptDebugDelegate:]): Call _cacheScriptDebugDelegateImplementations.
1008         (CallDelegate): Added more overloaded versions that take different arguments.
1009         (CallScriptDebugDelegate): Added overloaded versions that take different arguments.
1010         * WebView/WebViewInternal.h:
1011
1012 2009-02-03  Simon Fraser  <simon.fraser@apple.com>
1013
1014         Reviewed by Dave Hyatt
1015
1016         https://bugs.webkit.org/show_bug.cgi?id=23365
1017         
1018         Hook up accelerated compositing layers the native
1019         view system on Mac.
1020
1021         * WebCoreSupport/WebChromeClient.h:
1022         * WebCoreSupport/WebChromeClient.mm:
1023         (WebChromeClient::attachRootGraphicsLayer):
1024         (WebChromeClient::setNeedsOneShotDrawingSynchronization):
1025         New methods to hook up the root GraphicsLayer to the native
1026         view system, and to synchronize layer changes with view-based
1027         drawing when layers come and go.
1028
1029         * WebView/WebHTMLView.mm:
1030         (-[WebHTMLViewPrivate clear]):
1031         Clear the pointer to layerHostingView.
1032
1033         (-[WebHTMLView _setAsideSubviews]):
1034         (-[WebHTMLView willRemoveSubview:]):
1035         Keep the special layer-hosting view in the subviews even 
1036         when the rest of the subviews are ripped out for
1037         painting.
1038
1039         (-[WebHTMLView _isUsingAcceleratedCompositing]):
1040         New utility method for DumpRenderTree to know if we're
1041         hosting layers.
1042
1043         (-[WebHTMLView drawRect:]):
1044         Call -disableScreenUpdatesUntilFlush if we have to
1045         synchronize layer changes with painting.
1046
1047         (-[WebHTMLView attachRootLayer:]):
1048         (-[WebHTMLView detachRootLayer]):
1049         Attach and detach the root GraphicsLayer.
1050
1051         * WebView/WebViewInternal.h:
1052         * WebView/WebHTMLViewInternal.h:
1053         * WebView/WebHTMLViewPrivate.h:
1054         New method declarations.
1055         
1056         * WebView/WebView.mm:
1057         (-[WebView _needsOneShotDrawingSynchronization]):
1058         (-[WebView _setNeedsOneShotDrawingSynchronization:]):
1059         Set the flag to say if we need to synchronize layer
1060         changes and painting on the next -drawRect: call.
1061
1062         (-[WebView viewWillMoveToWindow:]):
1063         (-[WebView viewDidMoveToWindow]):
1064         Call new notifications that the view was added to or removed from
1065         the window, which are required by the layer hosting mechanism.
1066
1067 2009-02-02  Geoffrey Garen  <ggaren@apple.com>
1068
1069         Build fix.
1070
1071         * Plugins/WebPluginController.mm:
1072         (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]):
1073
1074 2009-02-02  Geoffrey Garen  <ggaren@apple.com>
1075
1076         Reviewed by Sam Weinig.
1077
1078         Track redirects in global history.
1079
1080         * History/WebHistory.mm:
1081         (-[WebHistoryPrivate dealloc]):
1082         (-[WebHistoryPrivate lastVisitedEntry]):
1083         (-[WebHistoryPrivate setLastVisitedEntry:]): Remember the last global history
1084         entry in case we're asked to add redirect information to it later.
1085
1086         (-[WebHistory _visitedURL:withTitle:method:wasFailure:serverRedirectURL:isClientRedirect:]):
1087         (-[WebHistory _visitedURLForRedirectWithoutHistoryItem:]): Record redirect
1088         information in global history.
1089
1090         * History/WebHistoryInternal.h:
1091         * WebCoreSupport/WebFrameLoaderClient.h: See above and below.
1092
1093         * WebCoreSupport/WebFrameLoaderClient.mm:
1094         (WebFrameLoaderClient::updateGlobalHistory):
1095         (WebFrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem): Record redirect
1096         information in global history.
1097
1098         * WebView/WebFrame.mm:
1099         (-[WebFrame loadRequest:]):
1100         (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]):
1101         * WebView/WebFramePrivate.h: Updated for rename and extra parameter.
1102
1103 2009-02-02  Anders Carlsson  <andersca@apple.com>
1104
1105         Reviewed by Dan Bernstein.
1106
1107         Work around a limitation in MIG where two functions can't have the same name even if they're
1108         not in the same subsystem.
1109         
1110         * Plugins/Hosted/NetscapePluginHostProxy.mm:
1111         (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
1112         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
1113         (WebKit::NetscapePluginInstanceProxy::processRequestsAndWaitForReply):
1114         * Plugins/Hosted/WebKitPluginClient.defs:
1115         * Plugins/Hosted/WebKitPluginHost.defs:
1116
1117 2009-02-02  Anders Carlsson  <andersca@apple.com>
1118
1119         Reviewed by Sam Weinig.
1120
1121         Implement WKPCGetPluginElementObject.
1122         
1123         * Plugins/Hosted/NetscapePluginHostProxy.mm:
1124         (WKPCGetPluginElementNPObject):
1125         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
1126         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
1127         (WebKit::NetscapePluginInstanceProxy::getPluginElementNPObject):
1128         * Plugins/Hosted/WebKitPluginClient.defs:
1129         * Plugins/WebBaseNetscapePluginView.h:
1130         * Plugins/WebBaseNetscapePluginView.mm:
1131         (-[WebBaseNetscapePluginView WebCore::]):
1132
1133 2009-02-02  Anders Carlsson  <andersca@apple.com>
1134
1135         Build fix.
1136         
1137         * WebView/WebHTMLView.mm:
1138
1139 2009-02-02  Anders Carlsson  <andersca@apple.com>
1140
1141         Reviewed by Dan Bernstein.
1142
1143         Make WebBaseNetscapePluginView hold a reference to a HTMLPlugInElement instead of a DOMElement.
1144         
1145         * Plugins/Hosted/WebHostedNetscapePluginView.h:
1146         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
1147         (-[WebHostedNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
1148         * Plugins/WebBaseNetscapePluginView.h:
1149         * Plugins/WebBaseNetscapePluginView.mm:
1150         (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
1151         (-[WebBaseNetscapePluginView _windowClipRect]):        
1152         (-[WebBaseNetscapePluginView visibleRect]):
1153         (-[WebBaseNetscapePluginView dataSource]):
1154         * Plugins/WebKitPluginContainerView.h: Removed.
1155         * Plugins/WebKitPluginContainerView.mm: Removed.
1156         * Plugins/WebNetscapePluginView.h:
1157         * Plugins/WebNetscapePluginView.mm:
1158         (-[WebNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
1159         (-[WebNetscapePluginView getVariable:value:]):
1160         * WebCoreSupport/WebFrameLoaderClient.mm:
1161         (WebFrameLoaderClient::createPlugin):
1162
1163 2009-02-02  Anders Carlsson  <andersca@apple.com>
1164
1165         Reviewed by Dan Bernstein.
1166
1167         Update for changes to WebCore.
1168         
1169         * WebCoreSupport/WebFrameLoaderClient.h:
1170         * WebCoreSupport/WebFrameLoaderClient.mm:
1171         (WebFrameLoaderClient::createPlugin):
1172
1173 2009-02-02  Anders Carlsson  <andersca@apple.com>
1174
1175         Reviewed by Oliver Hunt.
1176
1177         When a new Web View was not created, report back to the plug-in host.
1178         
1179         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
1180         (WebKit::NetscapePluginInstanceProxy::performRequest):
1181         * Plugins/Hosted/WebKitPluginHost.defs:
1182
1183 2009-02-02  Anders Carlsson  <andersca@apple.com>
1184
1185         Reviewed by Kevin Decker.
1186
1187         Draw the regular missing plug-in icon instead of a red rect when a plug-in has crashed.
1188         
1189         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
1190         (-[WebHostedNetscapePluginView drawRect:]):
1191
1192 2009-02-02  Holger Hans Peter Freyther  <zecke@selfish.org>
1193
1194         Reviewed by Darin Adler.
1195
1196         Move Frame::forceLayout, Frame::adjustPageHeight and Frame::forceLayoutWithPageWidthRange to FrameView
1197
1198         https://bugs.webkit.org/show_bug.cgi?id=23428
1199
1200         FrameView::forceLayout could be killed but the comment might
1201         contain a value over the the plain FrameView::layout...
1202
1203         Adjust the WebCore/WebKit consumers of these methods.
1204
1205         * WebView/WebFrame.mm:
1206         (-[WebFrame _computePageRectsWithPrintWidthScaleFactor:printHeight:]):
1207         * WebView/WebHTMLView.mm:
1208         (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
1209         (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]):
1210
1211 2009-01-31  John Sullivan  <sullivan@apple.com>
1212
1213         https://bugs.webkit.org/show_bug.cgi?id=23665
1214
1215         Cleaned up code to add/remove NSNotification observers, to avoid performance hit
1216         of calling removeObserver with unspecified notifications, or calling removeObserver
1217         multiple times for the same notification.
1218
1219         Reviewed by Darin Adler
1220
1221         * WebView/WebHTMLView.mm:
1222         added observingMouseMovedNotifications, observingSuperviewNotifications, and 
1223         observingWindowNotifications as BOOL ivars of _private object
1224         (-[WebHTMLView _removeMouseMovedObserverUnconditionally]):
1225         moved to file-internal section of file, added leading underscore, now bails out
1226         if we aren't observing the relevant notifications, now records that we are no longer
1227         observing the relevant notifications
1228         (-[WebHTMLView _removeSuperviewObservers]):
1229         ditto, also stores [NSNoticationCenter defaultCenter] in local var to avoid objc dispatch
1230         (-[WebHTMLView _removeWindowObservers]):
1231         ditto
1232         (-[WebHTMLView close]):
1233         replace general removeObserver: call with three specific calls for all the notifications
1234         that this class actually observes
1235         (-[WebHTMLView addMouseMovedObserver]):
1236         bail out if already observing relevant notifications, now records that we are observing
1237         the relevant notifications
1238         (-[WebHTMLView removeMouseMovedObserver]):
1239         updated for name change
1240         (-[WebHTMLView addSuperviewObservers]):
1241         bail out if already observing relevant notifications, now records that we are observing
1242         the relevant notifications; also stores [NSNoticationCenter defaultCenter] in local var 
1243         to avoid objc dispatch
1244         (-[WebHTMLView addWindowObservers]):
1245         ditto
1246         (-[WebHTMLView viewWillMoveToSuperview:]):
1247         updated for name change
1248         (-[WebHTMLView viewWillMoveToWindow:]):
1249         updated for name changes
1250
1251 2009-01-31  Darin Adler  <darin@apple.com>
1252
1253         Reviewed by Mark Rowe.
1254
1255         Fix code that assumes all command selectors end in colons.
1256         rdar://problem/6545874
1257
1258         * WebView/WebHTMLView.mm:
1259         (commandNameForSelector): Don't assert, just return a null string, when
1260         the selector doesn't end in a colon.
1261
1262 2009-01-30  Adam Barth  <abarth@webkit.org>
1263
1264         Reviewed by Sam Weinig.
1265
1266         Add a pref to disable web security.
1267
1268         * WebView/WebPreferenceKeysPrivate.h:
1269         * WebView/WebPreferencesPrivate.h:
1270         * WebView/WebPreferences.mm:
1271         (+[WebPreferences initialize]):
1272         (-[WebPreferences isWebSecurityEnabled]):
1273         (-[WebPreferences setWebSecurityEnabled:]):
1274         * WebView/WebView.mm:
1275         (-[WebView _preferencesChangedNotification:]):
1276
1277 2009-01-30  Holger Hans Peter Freyther  <zecke@selfish.org>
1278
1279         Reviewed by Darin Adler.
1280
1281         Move Frame::sendResizeEvent and Frame::sendScrollEvent to EventHandler
1282
1283         Carry out the move and catch up in two call sites.
1284
1285         * WebView/WebHTMLView.mm:
1286         (-[WebHTMLView _frameOrBoundsChanged]):
1287
1288 2009-01-30  Holger Hans Peter Freyther  <zecke@selfish.org>
1289
1290         Reviewed by Darin Adler.
1291
1292         isFrameSet was moved from Frame to Document. Update the
1293         WebKit usage.
1294
1295         * WebView/WebFrame.mm:
1296         (-[WebFrame _isFrameSet]):
1297         * WebView/WebHTMLView.mm:
1298         (-[WebHTMLView knowsPageRange:]):
1299
1300 2009-01-30  Geoffrey Garen  <ggaren@apple.com>
1301
1302         Build fix.
1303
1304         * WebView/WebFramePrivate.h:
1305
1306 2009-01-30  Geoffrey Garen  <ggaren@apple.com>
1307
1308         Reviewed by Sam Weinig.
1309
1310         Split "lockHistory" into "lockHistory" and "lockBackForwardList" in
1311         preparation for setting them differently during a redirect.
1312
1313         * WebView/WebPDFView.mm:
1314         (-[WebPDFView PDFViewWillClickOnLink:withURL:]):
1315
1316 2009-01-30  Anders Carlsson  <andersca@apple.com>
1317
1318         Reviewed by Sam Weinig.
1319
1320         Fix <rdar://problem/6544048>
1321         
1322         Have NetscapePluginInstanceProxy keep track of all the ProxyInstance objects associated.
1323         
1324         When the plug-in instance is destroyed, invalidate all proxy instances.
1325         
1326         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
1327         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
1328         (WebKit::NetscapePluginInstanceProxy::destroy):
1329         (WebKit::NetscapePluginInstanceProxy::addInstance):
1330         (WebKit::NetscapePluginInstanceProxy::removeInstance):
1331         * Plugins/Hosted/ProxyInstance.h:
1332         * Plugins/Hosted/ProxyInstance.mm:
1333         (WebKit::ProxyInstance::ProxyInstance):
1334         (WebKit::ProxyInstance::~ProxyInstance):
1335         (WebKit::ProxyInstance::invalidate):
1336
1337 2009-01-30  Anders Carlsson  <andersca@apple.com>
1338
1339         Reviewed by Sam Weinig.
1340
1341         Fix <rdar://problem/6490778>.
1342         
1343         Change the NPRuntime related functions to use IdentifierRep directly, and make sure to always
1344         validate IdentifierReps before dereferencing them.
1345         
1346         * Plugins/Hosted/NetscapePluginHostProxy.mm:
1347         (WKPCEvaluate):
1348         (WKPCGetStringIdentifier):
1349         (WKPCGetIntIdentifier):
1350         (identifierFromIdentifierRep):
1351         (WKPCInvoke):
1352         (WKPCGetProperty):
1353         (WKPCSetProperty):
1354         (WKPCRemoveProperty):
1355         (WKPCHasProperty):
1356         (WKPCHasMethod):
1357         (WKPCIdentifierInfo):
1358
1359 2009-01-30  Brady Eidson  <beidson@apple.com>
1360
1361         Reviewed by Sam Weinig
1362
1363         Remove FrameLoaderClient code that is now handled by FrameLoader itself
1364
1365         * WebCoreSupport/WebFrameLoaderClient.mm:
1366         (WebFrameLoaderClient::frameLoadCompleted):
1367
1368 2009-01-29  Stephanie Lewis <slewis@apple.com>
1369
1370         RS by Oliver Hunt.
1371
1372         Update the order files.
1373
1374         * WebKit.order:
1375
1376 2009-01-29  Sam Weinig  <sam@webkit.org>
1377
1378         Reviewed by Anders Carlsson.
1379
1380         Second step in tracking the urls a HistoryItem was redirected through
1381         Add SPI to access the array of redirect urls associated with a HistoryItem.
1382
1383         * History/WebHistoryItem.mm:
1384         (-[WebHistoryItem dictionaryRepresentation]):
1385         (-[WebHistoryItem _redirectURLs]):
1386         * History/WebHistoryItemPrivate.h:
1387
1388 2009-01-29  Anders Carlsson  <andersca@apple.com>
1389
1390         Reviewed by Dan Bernstein.
1391
1392         Always activate the plug-in host process if we're in "modal mode" and are being told to activate.
1393         
1394         * Plugins/Hosted/NetscapePluginHostProxy.h:
1395         * Plugins/Hosted/NetscapePluginHostProxy.mm:
1396         (WebKit::NetscapePluginHostProxy::pluginHostDied):
1397         Call endModal here.
1398         
1399         (WebKit::NetscapePluginHostProxy::applicationDidBecomeActive):
1400         If we're modal, we should always bring the plug-in host process to the front.
1401         
1402         (WebKit::NetscapePluginHostProxy::beginModal):
1403         Add an observer for the NSApplicationWillBecomeActiveNotification callback.
1404         
1405         (WebKit::NetscapePluginHostProxy::endModal):
1406         Remove the observer.
1407
1408 2009-01-29  Sam Weinig  <sam@webkit.org>
1409
1410         Reviewed by Mark Rowe.
1411
1412         First step in tracking the urls a HistoryItem was redirected through.
1413
1414         * History/WebHistoryItem.mm:
1415         (-[WebHistoryItem initFromDictionaryRepresentation:]):
1416         (-[WebHistoryItem dictionaryRepresentation]):
1417         * Misc/WebNSDictionaryExtras.h:
1418         * Misc/WebNSDictionaryExtras.m:
1419         (-[NSDictionary _webkit_arrayForKey:]): Add helper.
1420
1421 2009-01-29  Anders Carlsson  <andersca@apple.com>
1422
1423         Reviewed by Sam Weinig.
1424
1425         Pass the PSN of the client to the host, and get the PSN of the host back when checking in.
1426         
1427         * Plugins/Hosted/NetscapePluginHostManager.h:
1428         * Plugins/Hosted/NetscapePluginHostManager.mm:
1429         (WebKit::NetscapePluginHostManager::hostForPackage):
1430         Get the current PSN and pass it to spawnPluginHost.
1431         
1432         (WebKit::NetscapePluginHostManager::spawnPluginHost):
1433         Pass the PSN to the "check in" function.
1434         
1435         * Plugins/Hosted/NetscapePluginHostProxy.h:
1436         * Plugins/Hosted/NetscapePluginHostProxy.mm:
1437         (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
1438         
1439         (WebKit::NetscapePluginHostProxy::pluginHostDied):
1440         Fix a bug noticed by Julien Chaffraix. Call endModal if necessary.
1441         
1442         (WebKit::NetscapePluginHostProxy::beginModal):
1443         (WebKit::NetscapePluginHostProxy::endModal):
1444         (WebKit::NetscapePluginHostProxy::setModal):
1445         Split out the code that does all of the work into beginModal and endModal methods.
1446         
1447         * Plugins/Hosted/WebKitPluginHost.defs:
1448         * Plugins/WebNetscapePluginView.mm:
1449         (-[WebNetscapePluginView loadStream]):
1450
1451 2009-01-29  David Kilzer  <ddkilzer@apple.com>
1452
1453         Remove semi-colons from the end of ObjC method implementations
1454
1455         Rubber-stamped by Adam Roben.
1456
1457         $ find WebKit -name \*.m -o -name \*.mm -exec perl -e 'undef $/; $s = <>; while ($s =~ m/[\n\r][-+].*;[\s\r\n]+\{/g) { print "$ARGV: $&\n"; }' {} \;
1458
1459         * DefaultDelegates/WebDefaultUIDelegate.m:
1460         (-[WebDefaultUIDelegate webView:setResizable:]):
1461         (-[WebDefaultUIDelegate webView:dragDestinationActionMaskForDraggingInfo:]):
1462         (-[WebDefaultUIDelegate webView:dragSourceActionMaskForPoint:]):
1463         (-[WebDefaultUIDelegate webView:willPerformDragSourceAction:fromPoint:withPasteboard:]):
1464         * History/WebBackForwardList.mm:
1465         (-[WebBackForwardList addItem:]):
1466         (-[WebBackForwardList backListWithLimit:]):
1467         (-[WebBackForwardList forwardListWithLimit:]):
1468         * History/WebHistoryItem.mm:
1469         (-[WebHistoryItem alternateTitle]):
1470         (-[WebHistoryItem setViewState:]):
1471         * Misc/WebCoreStatistics.mm:
1472         (+[WebCoreStatistics garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging:]):
1473         * Misc/WebKitNSStringExtras.m:
1474         (-[NSString _web_drawAtPoint:font:textColor:]):
1475         * Plugins/WebNetscapePluginView.mm:
1476         (-[WebNetscapePluginView setAttributeKeys:andValues:]):
1477         * WebCoreSupport/WebEditorClient.mm:
1478         (-[WebEditCommand command]):
1479         * WebView/WebFrame.mm:
1480         (-[WebFrame _getVisibleRect:]):
1481         * WebView/WebHTMLRepresentation.mm:
1482         (-[WebHTMLRepresentation _redirectDataToManualLoader:forPluginView:]):
1483         * WebView/WebHTMLView.mm:
1484         (-[WebHTMLView elementAtPoint:allowShadowContent:]):
1485         * WebView/WebPreferences.mm:
1486         (-[WebPreferences setAllowsAnimatedImages:]):
1487         (-[WebPreferences setAutosaves:]):
1488         (-[WebPreferences PDFDisplayMode]):
1489         * WebView/WebView.mm:
1490         (+[WebView _viewClass:andRepresentationClass:forMIMEType:]):
1491         (-[WebView _viewClass:andRepresentationClass:forMIMEType:]):
1492         (+[WebView _unregisterViewClassAndRepresentationClassForMIMEType:]):
1493         (+[WebView _registerViewClass:representationClass:forURLScheme:]):
1494         (-[WebView _shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:]):
1495         (-[WebView _insertNewlineInQuotedContent]):
1496
1497 2009-01-28  Geoffrey Garen  <ggaren@apple.com>
1498
1499         Reviewed by Sam Weinig.
1500
1501         Updated for WebCore rename.
1502         
1503         * WebView/WebView.mm:
1504         (-[WebView setCustomTextEncodingName:]):
1505
1506 2009-01-28  David Kilzer  <ddkilzer@apple.com>
1507
1508         Add missing declaration for -[NSURL(WebNSURLExtras) _webkit_isFileURL]
1509
1510         Reviewed by Dan Bernstein.
1511
1512         * Misc/WebNSURLExtras.h:
1513         (-[NSURL(WebNSURLExtras) _webkit_isFileURL]): Added missing
1514         declaration after the implementation was added in r9258.
1515
1516 2009-01-28  Sam Weinig  <sam@webkit.org>
1517
1518         Reviewed by Geoff Garen.
1519
1520         Fix for <rdar://problem/6129678>
1521         REGRESSION (Safari 3-4): Local variable not accessible from Dashcode console or variables view
1522
1523         * WebView/WebScriptDebugDelegate.mm:
1524         (-[WebScriptCallFrame scopeChain]): Wrap JSActivations in DebuggerActivations.
1525
1526 2009-01-27  Anders Carlsson  <andersca@apple.com>
1527
1528         Reviewed by Oliver Hunt.
1529
1530         Fix two bugs with Core Animation based plug-ins.
1531         
1532         1. The plug-in view was marked as opaque even though it's not. 
1533            (This would leave garbage in the plug-in view).
1534         2. The plug-in layer needs to have autoresizing turned on.
1535         
1536         * Plugins/WebNetscapePluginView.mm:
1537         (-[WebNetscapePluginView setLayer:]):
1538
1539 2009-01-27  Brady Eidson  <beidson@apple.com>
1540
1541         Reviewed by Dan Bernstein
1542
1543         Rework FrameLoaderClient to work on a CachedFrame basis instead of CachedPage
1544
1545         * History/WebHistoryItem.mm:
1546
1547         * WebCoreSupport/WebFrameLoaderClient.h:
1548         * WebCoreSupport/WebFrameLoaderClient.mm:
1549         (WebFrameLoaderClient::savePlatformDataToCachedFrame):
1550         (WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
1551         * WebKit.order:
1552
1553 2009-01-26  Anders Carlsson  <andersca@apple.com>
1554
1555         Reviewed by Dan Bernstein.
1556
1557         Add the ability for plug-ins to make WebKit operate in "modal mode"
1558         
1559         * Plugins/Hosted/NetscapePluginHostProxy.h:
1560         * Plugins/Hosted/NetscapePluginHostProxy.mm:
1561         (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
1562         (WebKit::NetscapePluginHostProxy::pluginHostDied):
1563         If the plug-in crashes while we're modal, make sure to leave the modal mode.
1564         
1565         (WebKit::NetscapePluginHostProxy::setModal):
1566         (WKPCSetModal):
1567         * Plugins/Hosted/WebKitPluginClient.defs:
1568
1569 2009-01-26  John Sullivan  <sullivan@apple.com>
1570
1571         fixed <rdar://problem/6530053> REGRESSION (Leopard): Shift-tab in http authentication window gets 
1572         stuck in the Name field rather than cycling around
1573
1574         Reviewed by Dan Bernstein
1575
1576         * Panels/English.lproj/WebAuthenticationPanel.nib/designable.nib:
1577         * Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib:
1578         The two static text fields and the last button all had their "next key view" outlets set to the
1579         name field, which caused shift-tab from the name field to do the wrong thing. Fixed by making each
1580         selectable view have exactly one "next key view" set to it.
1581
1582 2009-01-26  Anders Carlsson  <andersca@apple.com>
1583
1584         Reviewed by Sam Weinig.
1585
1586         Add the ability for a plug-in to show or hide the menu bar.
1587         
1588         * Plugins/Hosted/NetscapePluginHostProxy.h:
1589         * Plugins/Hosted/NetscapePluginHostProxy.mm:
1590         (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
1591         (WebKit::NetscapePluginHostProxy::pluginHostDied):
1592         (WebKit::NetscapePluginHostProxy::setMenuBarVisible):
1593         (WKPCSetMenuBarVisible):
1594         * Plugins/Hosted/WebKitPluginClient.defs:
1595
1596 2009-01-26  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1597
1598         Reviewed by Gavin Barraclough.
1599
1600         Bug 23552: Dashcode evaluator no longer works after making ExecStates actual call frames
1601         <https://bugs.webkit.org/show_bug.cgi?id=23552>
1602         <rdar://problem/6398839>
1603
1604         Dashcode will crash when using the evaluator because it saves a global call
1605         frame, even after global code has finished executing, and then uses this as
1606         a launching pad to execute new JS in the evaluator. The fix is to detect
1607         when Dashcode is attempting to do this and execute code from a global call
1608         frame instead.        
1609
1610         * ForwardingHeaders/runtime/Protect.h: Added.
1611         * WebView/WebScriptDebugDelegate.mm:
1612         (-[WebScriptCallFrame _initWithGlobalObject:debugger:caller:debuggerCallFrame:]):
1613         Added debugger, a WebScriptDebugger* argument.
1614         (-[WebScriptCallFrame evaluateWebScript:]): Detect when Dashcode is using
1615         a stale WebScriptCallFrame to execute new JS and evaluate it starting from
1616         the global object's global call frame instead.
1617         * WebView/WebScriptDebugger.h:
1618         (WebScriptDebugger::globalObject): Added.
1619         (WebScriptDebugger::globalCallFrame): Added.
1620         * WebView/WebScriptDebugger.mm:
1621         (WebScriptDebugger::WebScriptDebugger): Initialize m_globalObject.
1622         (WebScriptDebugger::initGlobalCallFrame): Created as a clone of callEvent
1623         so that the global call frame can be saved immediately after being created.
1624         (WebScriptDebugger::callEvent): Pass 'this' as the debugger argument of
1625         WebScriptCallFrame's _initWithGlobalObject method.
1626
1627 2009-01-26  Anders Carlsson  <andersca@apple.com>
1628
1629         Reviewed by Oliver Hunt.
1630
1631         Make WKPCInvoke a simpleroutine.
1632         
1633         * Plugins/Hosted/NetscapePluginHostProxy.mm:
1634         (WKPCInvoke):
1635         * Plugins/Hosted/WebKitPluginClient.defs:
1636
1637 2009-01-26  Anders Carlsson  <andersca@apple.com>
1638
1639         Reviewed by Sam Weinig.
1640
1641         Implement using plug-in objects as constructors, and setting and getting properties from a plug-in object.
1642         
1643         * Plugins/Hosted/NetscapePluginHostProxy.mm:
1644         (WKPCBooleanAndDataReply):
1645         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
1646         (WebKit::NetscapePluginInstanceProxy::Reply::):
1647         (WebKit::NetscapePluginInstanceProxy::BooleanAndDataReply::BooleanAndDataReply):
1648         Rename NPObjectInvokeReply to BooleanAndDataReply.
1649         
1650         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
1651         (WebKit::NetscapePluginInstanceProxy::addValueToArray):
1652         Fix a cut and paste error.
1653         
1654         (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
1655         Handle NPObjects.
1656         
1657         * Plugins/Hosted/ProxyInstance.h:
1658         * Plugins/Hosted/ProxyInstance.mm:
1659         (WebKit::ProxyField::valueFromInstance):
1660         (WebKit::ProxyField::setValueToInstance):
1661         Call the ProxyInstance method.
1662         
1663         (WebKit::ProxyInstance::~ProxyInstance):
1664         Release the NPObject.
1665         
1666         (WebKit::ProxyInstance::supportsConstruct):
1667         Ask the plug-in host if an instance supports construct.
1668         
1669         (WebKit::ProxyInstance::fieldValue):
1670         (WebKit::ProxyInstance::setFieldValue):
1671         Call the plug-in host methods.
1672         
1673         * Plugins/Hosted/WebKitPluginHostTypes.h:
1674         Rename ObjectValueType to JSObjectValueType, and add NPObjectValueType.
1675
1676 2009-01-26  Mark Rowe  <mrowe@apple.com>
1677
1678         Fix the build.
1679
1680         Remove -Wformat=2 from the warning flags as newer versions of GCC emit
1681         warnings about non-literal format strings for uses of our UI_STRING macro.
1682
1683         * Configurations/Base.xcconfig:
1684
1685 2009-01-26  Mark Rowe  <mrowe@apple.com>
1686
1687         Rubber-stamped by Sam Weinig.
1688
1689         Clean up after r40240.
1690
1691         * Configurations/Base.xcconfig: Don't dead code strip in debug builds for now as it leads to link errors.
1692         * Plugins/Hosted/HostedNetscapePluginStream.mm: Revert change that is no longer needed now that WebKitPluginHost.defs
1693         is back in the build.
1694
1695 2009-01-25  Darin Adler  <darin@apple.com>
1696
1697         * Plugins/Hosted/HostedNetscapePluginStream.mm: Added a missing extern "C".
1698
1699 2009-01-25  Darin Adler  <darin@apple.com>
1700
1701         Discussed with Mark Rowe; not sure he reviewed it.
1702
1703         * Configurations/Base.xcconfig: Add all the same warnings as in WebCore except for
1704         -Wcast-qual and -Wunused-parameter, which both need to be off at least for now.
1705
1706 2009-01-25  Mark Rowe  <mrowe@apple.com>
1707
1708         Rubber-stamped by Dan Bernstein.
1709
1710         Improve the consistency of settings in our .xcconfig files.
1711
1712         * Configurations/Base.xcconfig: Only dead code strip the normal variant.
1713         Handle all cases in GCC_GENERATE_DEBUGGING_SYMBOLS.
1714
1715 2009-01-25  Darin Adler  <darin@apple.com>
1716
1717         Reviewed by Sam Weinig.
1718
1719         Bug 23522: use checked casts for render tree
1720         https://bugs.webkit.org/show_bug.cgi?id=23522
1721
1722         Step one: RenderText.
1723
1724         * WebView/WebRenderNode.mm:
1725         (copyRenderNode): Use toRenderText.
1726
1727 2009-01-23  Brady Eidson  <beidson@apple.com>
1728
1729         Rubberstamped by Darin Adler
1730
1731         Rename CachedPagePlatformData to CachedFramePlatformData to more accurately reflect its true role.
1732
1733         * WebCoreSupport/WebCachedFramePlatformData.h: Copied from WebKit/mac/WebCoreSupport/WebCachedPagePlatformData.h.
1734         (WebCachedFramePlatformData::WebCachedFramePlatformData):
1735         * WebCoreSupport/WebCachedPagePlatformData.h: Removed.
1736
1737         * WebCoreSupport/WebFrameLoaderClient.mm:
1738         (WebFrameLoaderClient::savePlatformDataToCachedPage):
1739         (WebFrameLoaderClient::transitionToCommittedFromCachedPage):
1740
1741         * WebKit.order:
1742
1743 2009-01-23  Adele Peterson  <adele@apple.com>
1744
1745         Build fix.
1746
1747         Use new linesBoundingBox method instead of
1748         boundingBoxWidth and boundingBoxHeight for RenderText objects.
1749
1750         * WebView/WebRenderNode.mm: (copyRenderNode):
1751
1752 2009-01-23  Anders Carlsson  <andersca@apple.com>
1753
1754         Fix 64-bit build.
1755         
1756         * Plugins/Hosted/ProxyInstance.mm:
1757         (WebKit::proxyClass):
1758
1759 2009-01-23  Anders Carlsson  <andersca@apple.com>
1760
1761         Fix GCC 4.0 build.
1762         
1763         * Configurations/Base.xcconfig:
1764
1765 2009-01-23  Anders Carlsson  <andersca@apple.com>
1766
1767         Reviewed by Sam Weinig.
1768
1769         Turn on -Wmissing-prototypes and fix the resulting warnings.
1770
1771         * Configurations/Base.xcconfig:
1772         * History/WebHistory.mm:
1773         (timeIntervalForBeginningOfDay):
1774         * History/WebHistoryItem.mm:
1775         (historyItemWrappers):
1776         * Misc/WebNSPasteboardExtras.mm:
1777         (imageFromElement):
1778         * WebView/WebFrame.mm:
1779         * WebView/WebScriptDebugger.mm:
1780         (toNSString):
1781
1782 2009-01-22  Mark Rowe  <mrowe@apple.com>
1783
1784         Rubber-stamped by Anders Carlsson.
1785
1786         Disable GCC_WARN_ABOUT_MISSING_PROTOTYPES temporarily.
1787
1788         Current versions of Xcode only respect it for C and Objective-C files,
1789         and our code doesn't currently compile if it is applied to C++ and
1790         Objective-C++ files.
1791
1792         * Configurations/Base.xcconfig:
1793
1794 2009-01-22  Anders Carlsson  <andersca@apple.com>
1795
1796         Reviewed by Sam Weinig.
1797
1798         Add support for Invoke and InvokeDefault. Clean up code.
1799         
1800         * Plugins/Hosted/NetscapePluginHostProxy.mm:
1801         (WKPCBooleanReply):
1802         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
1803         (WebKit::NetscapePluginInstanceProxy::Reply::):
1804         (WebKit::NetscapePluginInstanceProxy::BooleanReply::BooleanReply):
1805         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
1806         (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
1807         * Plugins/Hosted/ProxyInstance.h:
1808         * Plugins/Hosted/ProxyInstance.mm:
1809         (WebKit::ProxyInstance::invoke):
1810         (WebKit::ProxyInstance::invokeMethod):
1811         (WebKit::ProxyInstance::supportsInvokeDefaultMethod):
1812         (WebKit::ProxyInstance::invokeDefaultMethod):
1813         (WebKit::ProxyInstance::methodsNamed):
1814         (WebKit::ProxyInstance::fieldNamed):
1815         * Plugins/Hosted/WebKitPluginClient.defs:
1816         * Plugins/Hosted/WebKitPluginHost.defs:
1817         * Plugins/Hosted/WebKitPluginHostTypes.h:
1818
1819 2009-01-22  Eric Roman  <eroman@chromium.og>
1820
1821         Reviewed by Eric Seidel.
1822
1823         https://bugs.webkit.org/show_bug.cgi?id=20806
1824         Deprecate RSSFeedReferrer() and setRSSFeedReferrer().
1825
1826         * History/WebHistoryItem.mm:
1827         (-[WebHistoryItem RSSFeedReferrer]):
1828         (-[WebHistoryItem setRSSFeedReferrer:]):
1829
1830 2009-01-22  Anders Carlsson  <andersca@apple.com>
1831
1832         Reviewed by Kevin Decker.
1833
1834         Don't crash or hang when we fail to instantiate a plug-in.
1835         
1836         * Plugins/Hosted/NetscapePluginHostManager.mm:
1837         (WebKit::NetscapePluginHostManager::instantiatePlugin):
1838         Return 0 on failure.
1839         
1840         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
1841         (-[WebHostedNetscapePluginView JSC::Bindings::createPluginBindingsInstance:JSC::Bindings::]):
1842         Null check for the proxy member.
1843
1844 2009-01-21  David Hyatt  <hyatt@apple.com>
1845
1846         Devirtualize width/height/x/y on RenderObject and move the methods to RenderBox.
1847
1848         Reviewed by Eric Seidel and Darin Adler
1849
1850         * WebView/WebRenderNode.mm:
1851         (copyRenderNode):
1852
1853 2009-01-21  Anders Carlsson  <andersca@apple.com>
1854
1855         Reviewed by Sam Weinig.
1856
1857         More browser->plug-in scripting support.
1858         
1859         * Plugins/Hosted/NetscapePluginHostProxy.mm:
1860         (WKPCNPObjectHasPropertyReply):
1861         (WKPCNPObjectHasMethodReply):
1862         (WKPCNPObjectInvokeReply):
1863         MIG reply functions.
1864         
1865         (WKPCIdentifierInfo):
1866         Return information about an identifier given its 64-bit value.
1867         
1868         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
1869         Add new reply structs.
1870         
1871         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
1872         (WebKit::NetscapePluginInstanceProxy::addValueToArray):
1873         Split out code that adds values to the arrays from marshalValue.
1874         
1875         (WebKit::NetscapePluginInstanceProxy::marshalValue):
1876         Call addValueToArray.
1877     
1878         (WebKit::NetscapePluginInstanceProxy::marshalValues):
1879         Marshal a list of values.
1880         
1881         (WebKit::NetscapePluginInstanceProxy::createBindingsInstance):
1882         Actually create a proxy instance.
1883         
1884         * Plugins/Hosted/ProxyInstance.h:
1885         * Plugins/Hosted/ProxyInstance.mm:
1886         (WebKit::ProxyClass::methodsNamed):
1887         (WebKit::ProxyClass::fieldNamed):
1888         Add a proxy ProxyClass class that just forwards everything to the ProxyInstance class.
1889         
1890         (WebKit::proxyClass):
1891         Shared proxyClass getter.
1892         
1893         (WebKit::ProxyField::ProxyField):
1894         (WebKit::ProxyField::valueFromInstance):
1895         (WebKit::ProxyField::setValueToInstance):
1896         Add a proxy ProxyField class that just forwards everything to the ProxyInstance class.
1897         
1898         (WebKit::ProxyMethod::ProxyMethod):
1899         (WebKit::ProxyMethod::serverIdentifier):
1900         (WebKit::ProxyMethod::numParameters):
1901         Add a dummy ProxyMethod class.
1902         
1903         (WebKit::ProxyInstance::invokeMethod):
1904         Call _WKPHNPObjectInvoke.
1905         
1906         (WebKit::ProxyInstance::defaultValue):
1907         (WebKit::ProxyInstance::stringValue):
1908         (WebKit::ProxyInstance::numberValue):
1909         (WebKit::ProxyInstance::booleanValue):
1910         (WebKit::ProxyInstance::valueOf):
1911         Add dummy implementations (taken from CInstance).
1912         
1913         (WebKit::ProxyInstance::methodsNamed):
1914         Call _WKPHNPObjectHasMethod to determine whether a method with the given name exists.
1915         
1916         (WebKit::ProxyInstance::fieldNamed):
1917         Call _WKPHNPObjectHasProperty to determine whether a property with the given name exists.
1918         
1919         * Plugins/Hosted/WebKitPluginClient.defs:
1920         * Plugins/Hosted/WebKitPluginHost.defs:
1921         Add new MIG definitions.
1922
1923 2009-01-21  Mark Rowe  <mrowe@apple.com>
1924
1925         Reviewed by Tim Hatcher.
1926
1927         Clean up how we force invocations of API that happened on background threads over to the main thread.
1928
1929         This was previously accomplished in a somewhat ad-hoc manner using a mutable dictionary to pass arguments
1930         and return values back from the function.  The new approach is to use a proxy object that forwards an
1931         NSInvocation over to the main thread and applies it to the target object, which leads to a much cleaner
1932         call site.
1933
1934         * Misc/WebNSObjectExtras.h:
1935         * Misc/WebNSObjectExtras.mm:
1936         (-[WebMainThreadInvoker initWithTarget:]):
1937         (-[WebMainThreadInvoker forwardInvocation:]):
1938         (-[WebMainThreadInvoker methodSignatureForSelector:]):
1939         (-[WebMainThreadInvoker handleException:]):
1940         (-[NSInvocation _webkit_invokeAndHandleException:]): Execute the invocation and forward any exception that was
1941         raised back to the WebMainThreadInvoker.
1942         (-[NSObject _webkit_invokeOnMainThread]):
1943
1944         The following methods are updated to use the proxy object to forward methods to the main thread:
1945
1946         * WebView/WebArchive.mm:
1947         (-[WebArchive initWithMainResource:subresources:subframeArchives:]):
1948         (-[WebArchive mainResource]):
1949         (-[WebArchive subresources]):
1950         (-[WebArchive subframeArchives]):
1951         * WebView/WebResource.mm:
1952         (-[WebResource data]):
1953         (-[WebResource URL]):
1954         (-[WebResource MIMEType]):
1955         (-[WebResource textEncodingName]):
1956         (-[WebResource frameName]):
1957         (-[WebResource _ignoreWhenUnarchiving]):
1958         (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]):
1959         (-[WebResource _initWithData:URL:response:]):
1960         (-[WebResource _suggestedFilename]):
1961         (-[WebResource _response]):
1962         (-[WebResource _stringValue]):
1963         * WebView/WebView.mm:
1964         (-[WebView initWithFrame:frameName:groupName:]):
1965         (-[WebView initWithCoder:]):
1966
1967 2009-01-20  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
1968
1969         Reviewed by George Staikos.
1970
1971         Fixes: https://bugs.webkit.org/show_bug.cgi?id=23434 (Add WML <input> element support)
1972
1973         Protect text field related WebEditorClient.mm methods against non-HTMLElement callers.
1974         WebEditorClient.mm relies on HTMLInputElement as input element. Ignore calls from non-HTMLElement elements.
1975
1976         * WebCoreSupport/WebEditorClient.mm:
1977         (WebEditorClient::textFieldDidBeginEditing):
1978         (WebEditorClient::textFieldDidEndEditing):
1979         (WebEditorClient::textDidChangeInTextField):
1980         (WebEditorClient::doTextFieldCommandFromEvent):
1981         (WebEditorClient::textWillBeDeletedInTextField):
1982         (WebEditorClient::textDidChangeInTextArea):
1983
1984 2009-01-19  Anders Carlsson  <andersca@apple.com>
1985
1986         Reviewed by Sam Weinig.
1987
1988         Add and implement GetScriptableNPObject.
1989         
1990         * Plugins/Hosted/NetscapePluginHostProxy.mm:
1991         (WKPCGetScriptableNPObjectReply):
1992         Create a new reply struct and set it as the current reply.
1993         
1994         (WKPCEvaluate):
1995         Get rid of an unused variable.
1996         
1997         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
1998         (WebKit::NetscapePluginInstanceProxy::Reply::):
1999         (WebKit::NetscapePluginInstanceProxy::GetScriptableNPObjectReply::GetScriptableNPObjectReply):
2000         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2001         (WebKit::NetscapePluginInstanceProxy::createBindingsInstance):
2002         Call _WKPHGetScriptableNPObject and wait for a reply.
2003         
2004         * Plugins/Hosted/ProxyInstance.h: Added.
2005         * Plugins/Hosted/ProxyInstance.mm: Added.
2006         Add empty files.
2007         
2008         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
2009         (-[WebHostedNetscapePluginView JSC::Bindings::createPluginBindingsInstance:JSC::Bindings::]):
2010         Call NetscapePluginInstanceProxy::createBindingsInstance.
2011         
2012         * Plugins/Hosted/WebKitPluginClient.defs:
2013         * Plugins/Hosted/WebKitPluginHost.defs:
2014         Add new declarations.
2015
2016 2009-01-19  Sam Weinig  <sam@webkit.org>
2017
2018         Rubber-stamped by Gavin Barraclough.
2019
2020         Remove temporary operator-> from JSValuePtr.
2021
2022         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2023         (WebKit::NetscapePluginInstanceProxy::invoke):
2024         (WebKit::NetscapePluginInstanceProxy::hasMethod):
2025         (WebKit::NetscapePluginInstanceProxy::marshalValue):
2026         * WebView/WebFrame.mm:
2027         (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
2028         * WebView/WebView.mm:
2029         (aeDescFromJSValue):
2030
2031 2009-01-19  Anders Carlsson  <andersca@apple.com>
2032
2033         Reviewed by Sam Weinig.
2034
2035         Make Evaluate an asynchronous method that has a reply method.
2036         
2037         * Plugins/Hosted/NetscapePluginHostProxy.mm:
2038         (WKPCEvaluate):
2039         * Plugins/Hosted/WebKitPluginClient.defs:
2040         * Plugins/Hosted/WebKitPluginHost.defs:
2041
2042 2009-01-19  Brady Eidson  <beidson@apple.com>
2043
2044         Rubberstamped by Tim Hatcher
2045
2046         Fix long standing typo.
2047
2048         * History/WebBackForwardList.h:
2049
2050 2009-01-19  Mark Rowe  <mrowe@apple.com>
2051
2052         Fix the build!
2053
2054         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2055         (WebKit::NetscapePluginInstanceProxy::demarshalValue):
2056         (WebKit::NetscapePluginInstanceProxy::demarshalValues):
2057
2058 2009-01-18  Mark Rowe  <mrowe@apple.com>
2059
2060         Reviewed by Anders Carlsson.
2061
2062         Fix <https://bugs.webkit.org/show_bug.cgi?id=23414>.
2063         Bug 23414: Reproducible crash accessing View menu with plugins disabled
2064
2065         * WebView/WebFrame.mm:
2066         (-[WebFrame _canProvideDocumentSource]): Null-check the PluginData before using it.
2067
2068 2009-01-17  David Hyatt  <hyatt@apple.com>
2069
2070         Eliminate dependencies on "backslashAsCurrencySymbol()" from WebKit, and make sure these alterations
2071         are done in WebCore instead.
2072
2073         Reviewed by Oliver Hunt
2074
2075         * WebView/WebFrame.mm:
2076         (-[WebFrame _selectedString]):
2077         (-[WebFrame _stringForRange:]):
2078
2079 2009-01-17  Eric Carlson  <eric.carlson@apple.com>
2080
2081         Reviewed by Adele Peterson
2082
2083         Complete <rdar://problem/6293969>
2084
2085         * WebCoreSupport/WebSystemInterface.m:
2086         (InitWebCoreSystemInterface): Remove UseSharedMediaUI
2087
2088 2009-01-15  Brady Eidson  <beidson@apple.com>
2089
2090         Reviewed by Dan Bernstein
2091
2092         Fix problem where a URL visited as non-GET once is flagged as non-GET forever.
2093
2094         * History/WebHistory.mm:
2095         (-[WebHistory _visitedURL:withTitle:method:wasFailure:]): Always update the HTTPNonGet
2096           flag for all loads with an HTTP Method
2097
2098 2009-01-14  Anders Carlsson  <andersca@apple.com>
2099
2100         Reviewed by Sam Weinig.
2101
2102         Implement InvokeDefault, Construct, GetProperty and SetProperty.
2103         
2104         Fully implement marshalValue.
2105         
2106         * Plugins/Hosted/NetscapePluginHostProxy.mm:
2107         (WKPCInvokeDefault):
2108         (WKPCConstruct):
2109         (WKPCGetProperty):
2110         (WKPCSetProperty):
2111         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
2112         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2113         (WebKit::NetscapePluginInstanceProxy::evaluate):
2114         (WebKit::NetscapePluginInstanceProxy::invoke):
2115         (WebKit::NetscapePluginInstanceProxy::invokeDefault):
2116         (WebKit::NetscapePluginInstanceProxy::construct):
2117         (WebKit::NetscapePluginInstanceProxy::getProperty):
2118         (WebKit::NetscapePluginInstanceProxy::setProperty):
2119         (WebKit::NetscapePluginInstanceProxy::marshalValue):
2120         (WebKit::NetscapePluginInstanceProxy::demarshalValue):
2121         * Plugins/Hosted/WebKitPluginClient.defs:
2122
2123 2009-01-14  Anders Carlsson  <andersca@apple.com>
2124
2125         Reviewed by Sam Weinig.
2126
2127         Demarshal arguments and pass them to the JS call.
2128         
2129         * Plugins/Hosted/NetscapePluginHostProxy.mm:
2130         (WKPCInvoke):
2131         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
2132         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2133         (WebKit::NetscapePluginInstanceProxy::invoke):
2134         (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
2135         (WebKit::NetscapePluginInstanceProxy::demarshalValues):
2136
2137 2009-01-14  Mark Rowe  <mrowe@apple.com>
2138
2139         Reviewed by Timothy Hatcher.
2140
2141         <rdar://problem/6496520> REGRESSION: In Mail, a crash occurs when attempting to display a mail message
2142
2143         Move WebArchive and WebResource to use the same approach for initializing themselves on the main thread
2144         that WebView uses.
2145
2146         * WebView/WebArchive.mm:
2147         (-[WebArchive initWithMainResource:subresources:subframeArchives:]): Use _webkit_performSelectorOnMainThread:withObject:.
2148         (-[WebArchive _initWithArguments:]):
2149         * WebView/WebResource.mm:
2150         (-[WebResource _initWithArguments:]): Unbox the BOOL argument.
2151
2152 2009-01-14  Darin Adler  <darin@apple.com>
2153
2154         Reviewed by Oliver Hunt.
2155
2156         Fix crash I ran into while printing. I was unable to reproduce it, but also,
2157         it's clear there's no guarantee that the frame will be non-zero in this case,
2158         so it seems fine to check it.
2159
2160         * WebView/WebHTMLView.mm: (-[WebHTMLView reapplyStyles]): Check frame for zero
2161         and don't do anything with it if it's zero.
2162
2163 2009-01-14  Dan Bernstein  <mitz@apple.com>
2164
2165         Reviewed by John Sullivan.
2166
2167         - update copyright
2168
2169         * Info.plist:
2170
2171 2009-01-12  Anders Carlsson  <andersca@apple.com>
2172
2173         Reviewed by Darin Adler.
2174
2175         Add a bunch of methods to WebKitPluginClient.defs, and implement them.
2176         
2177         * Plugins/Hosted/NetscapePluginHostProxy.mm:
2178         (WebKit::fromUTF8WithLatin1Fallback):
2179         If the length isn't specified, get it by calling strlen.
2180         
2181         (WKPCEvaluate):
2182         Evaluate doesn't take any arguments.
2183         
2184         (WKPCGetIntIdentifier):
2185         Call _NPN_GetIntIdentifier.
2186         
2187         (identifierFromServerIdentifier):
2188         New helper function that returns a JSC Identifier from an NPIdentifier.
2189         
2190         (WKPCInvoke):
2191         Call identifierFromServerIdentifier.
2192         
2193         (WKPCRemoveProperty):
2194         (WKPCHasProperty):
2195         (WKPCHasMethod):
2196         Call NetscapePluginInstanceProxy.
2197
2198         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
2199         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2200         (WebKit::NetscapePluginInstanceProxy::removeProperty):
2201         (WebKit::NetscapePluginInstanceProxy::hasProperty):
2202         (WebKit::NetscapePluginInstanceProxy::hasMethod):
2203
2204         * Plugins/Hosted/WebKitPluginClient.defs:
2205         Add new definitions.
2206
2207 2009-01-13  Anders Carlsson  <andersca@apple.com>
2208
2209         Fix build.
2210
2211         * WebView/WebView.mm:
2212         (-[WebView _initWithArguments:]):
2213
2214 2009-01-13  Timothy Hatcher  <timothy@apple.com>
2215
2216         Adds a workaround for the flip4mac installer plugin decoding a WebView from a NIB on a secondary thread.
2217
2218         <rdar://problem/6489788> New WebKit thread checks break installation of flip4mac (thread violation)
2219
2220         Reviewed by Darin Adler.
2221
2222         * Misc/WebKitVersionChecks.h: Add WEBKIT_FIRST_VERSION_WITHOUT_WEBVIEW_INIT_THREAD_WORKAROUND.
2223         * Misc/WebNSObjectExtras.h: Add _webkit_performSelectorOnMainThread:withObject:.
2224         * Misc/WebNSObjectExtras.mm:
2225         (-[NSObject _webkit_performSelectorWithArguments:]): Renamed from _webkit_getPropertyWithArguments.
2226         Passes the optional object to the selector.
2227         (-[NSObject _webkit_performSelectorOnMainThread:withObject:]): Renamed from _webkit_getPropertyOnMainThread:.
2228         Put the optional object into the arguments dictionary.
2229         (-[NSObject _webkit_getPropertyOnMainThread:]): Call _webkit_performSelectorOnMainThread with a nil object.
2230         * WebView/WebResource.mm:
2231         (-[WebResource _ignoreWhenUnarchiving]): Use _cmd instead of making the selector again.
2232         (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]): Use the new
2233         _webkit_performSelectorOnMainThread:withObject: method instead of performSelectorOnMainThread.
2234         * WebView/WebView.mm:
2235         (-[WebView _initWithArguments:]): Added. Pulls arguments out of the dictionary and calls the right init method.
2236         (needsWebViewInitThreadWorkaround): Checks if the thead is not the main thread and if we are in the Installer bundle.
2237         (-[WebView initWithFrame:frameName:groupName:]): Call needsWebViewInitThreadWorkaround and use _webkit_performSelectorOnMainThread
2238         to call _initWithArguments: passing the frame, frameName and groupName.
2239         (-[WebView initWithCoder:]): Ditto, except pass the coder to _initWithArguments:.
2240
2241 2009-01-12  Gavin Barraclough  <barraclough@apple.com>
2242
2243         Reviewed by Oliver Hunt.
2244
2245         Deprecate JSValuePtr::getNumber() - two ways to get a number should  be enough.
2246
2247         * WebView/WebView.mm:
2248         (aeDescFromJSValue):
2249
2250 2009-01-12  Brady Eidson  <beidson@apple.com>
2251
2252         Reviewed by Darin Adler
2253
2254         <rdar://problem/6468274> - Track Non-get requests in global history
2255
2256         * History/WebHistory.mm:
2257         (-[WebHistory _visitedURL:withTitle:method:wasFailure:]):
2258         * History/WebHistoryInternal.h:
2259
2260         * History/WebHistoryItem.mm:
2261         (-[WebHistoryItem initFromDictionaryRepresentation:]):
2262         (-[WebHistoryItem dictionaryRepresentation]):
2263         (-[WebHistoryItem _lastVisitWasHTTPNonGet]):
2264         * History/WebHistoryItemPrivate.h:
2265
2266         * WebCoreSupport/WebFrameLoaderClient.mm:
2267         (WebFrameLoaderClient::updateGlobalHistory): Only pass the method through if it was an HTTP load
2268
2269 2009-01-12  Anders Carlsson  <andersca@apple.com>
2270
2271         Reviewed by Sam Weinig.
2272
2273         Move marshalling into NetscapePluginInstanceProxy.
2274         
2275         Add support for marshallin strings.
2276         
2277         * Plugins/Hosted/NetscapePluginHostProxy.mm:
2278         (WKPCEvaluate):
2279         (WKPCInvoke):
2280         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
2281         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2282         (WebKit::NetscapePluginInstanceProxy::evaluate):
2283         (WebKit::NetscapePluginInstanceProxy::invoke):
2284         (WebKit::NetscapePluginInstanceProxy::marshalValue):
2285         * Plugins/Hosted/WebKitPluginHostTypes.h:
2286
2287 2009-01-12  Anders Carlsson  <andersca@apple.com>
2288
2289         Reviewed by Sam Weinig.
2290
2291         Implement WKPCInvoke.
2292         
2293         * Plugins/Hosted/NetscapePluginHostProxy.mm:
2294         (WKPCEvaluate):
2295         (WKPCInvoke):
2296         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
2297         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2298         (WebKit::NetscapePluginInstanceProxy::idForObject):
2299         (WebKit::NetscapePluginInstanceProxy::invoke):
2300         * Plugins/Hosted/WebKitPluginClient.defs:
2301
2302 2009-01-12  Anders Carlsson  <andersca@apple.com>
2303
2304         Reviewed by Sam Weinig.
2305
2306         Move marshalling code to NetscapePluginInstanceProxy. Add support for marshalling JS objects.
2307         
2308         * Plugins/Hosted/NetscapePluginHostProxy.mm:
2309         (WKPCEvaluate):
2310         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
2311         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2312         (WebKit::NetscapePluginInstanceProxy::marshalValue):
2313         * Plugins/Hosted/WebKitPluginHostTypes.h:
2314
2315 2009-01-12  Julien Chaffraix  <jchaffraix@pleyo.com>
2316
2317         Reviewed by Darin Adler.
2318
2319         Bug 22861: Turn the FontCache into a singleton
2320         https://bugs.webkit.org/show_bug.cgi?id=22861
2321
2322         * Misc/WebCoreStatistics.mm:
2323         (+[WebCoreStatistics cachedFontDataCount]):
2324         (+[WebCoreStatistics cachedFontDataInactiveCount]):
2325         (+[WebCoreStatistics purgeInactiveFontData]):
2326         Redirected all the static calls to the global FontCache
2327         instance.
2328
2329 2009-01-11  Dmitry Titov  <dimich@chromium.org>
2330
2331         Reviewed by Darin Adler.
2332
2333         https://bugs.webkit.org/show_bug.cgi?id=23207
2334         Moved currentTime() to from WebCore to WTF.
2335
2336         * WebView/WebFrame.mm: a different header file included.
2337
2338 2009-01-10  Darin Adler  <darin@apple.com>
2339
2340         Reviewed by Sam Weinig.
2341
2342         <rdar://problem/5845089> REGRESSION (r30044): Mail custom stationery missing images
2343         because of change to -[HTMLObjectElement data]
2344
2345         * WebView/WebView.mm:
2346         (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): Added a thread
2347         violation check because I saw this being done off the main thread while testing Mail, and it
2348         caused problems. Put all the one time initialization under a single guard to make things just
2349         a little faster other times, and to make it clearer which things are one-time. Added a call to
2350         the new patchMailRemoveAttributesMethod function.
2351         (-[WebView initWithFrame:frameName:groupName:]): Added a thread violation check here too,
2352         because I assumed it would be slightly better to have a public method name in the violation
2353         message. This calls commonInitialization later, so it will hit that one eventually.
2354         (objectElementDataAttribute): Added. Just returns the value of the "data" attribute.
2355         (recursivelyRemoveMailAttributes): Added. Patch to an internal Mail method that in turn patches
2356         a WebKit method and removes the patch again on the way out.
2357         (patchMailRemoveAttributesMethod): Added. On Leopard only, checks the Mail version, and then
2358         applies the patch that fixes this bug.
2359
2360 2009-01-09  Dan Bernstein  <mitz@apple.com>
2361
2362         Reviewed by Darin Adler.
2363
2364         - fixed <rdar://problem/6234347> Add/change conditional key
2365           bindings for changing paragraph- and character-level writing
2366           direction (to match NSTextView)
2367
2368         * WebView/WebHTMLView.mm:
2369         (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): Added
2370         code to validate makeBaseWritingDirectionLeftToRight: and
2371         makeBaseWritingDirectionRightToLeft:.
2372         (writingDirectionKeyBindingsEnabled): Changed this function to
2373         always return YES, except on Tiger and Leopard.
2374         (-[WebHTMLView makeBaseWritingDirectionLeftToRight:]): Renamed
2375         changeBaseWritingDirectionToLTR: to this.
2376         (-[WebHTMLView makeBaseWritingDirectionRightToLeft:]): Renamed
2377         changeBaseWritingDirectionToRTL: to this.
2378         (-[WebHTMLView changeBaseWritingDirectionToLTR:]): Now calls
2379         makeBaseWritingDirectionLeftToRight:.
2380         (-[WebHTMLView changeBaseWritingDirectionToRTL:]): Now calls
2381         makeBaseWritingDirectionRightToLeft:.
2382         * WebView/WebView.mm: Added makeBaseWritingDirectionLeftToRight
2383         and makeBaseWritingDirectionRightToLeft to
2384         FOR_EACH_RESPONDER_SELECTOR.
2385
2386 2009-01-08  Anders Carlsson  <andersca@apple.com>
2387
2388         Reviewed by Sam Weinig.
2389
2390         Add and implement WKPCGetStringIdentifier.
2391         
2392         * Plugins/Hosted/NetscapePluginHostProxy.mm:
2393         (WKPCGetStringIdentifier):
2394         * Plugins/Hosted/WebKitPluginClient.defs:
2395
2396 2009-01-08  Stephanie Lewis  <slewis@gmail.com>
2397
2398         Fix Tiger build.        
2399
2400         * WebView/WebTextIterator.mm:
2401
2402 2009-01-08  Anders Carlsson  <andersca@apple.com>
2403
2404         Reviewed by Sam Weinig.
2405
2406         Add basic support for evaluating scripts.
2407         
2408         * Plugins/Hosted/NetscapePluginHostProxy.mm:
2409         (WebKit::fromUTF8WithLatin1Fallback):
2410         (WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy):
2411         (WKPCReleaseObject):
2412         (marshalValue):
2413         (WKPCEvaluate):
2414         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
2415         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2416         (WebKit::NetscapePluginInstanceProxy::releaseObject):
2417         (WebKit::NetscapePluginInstanceProxy::evaluate):
2418         * Plugins/Hosted/WebKitPluginClient.defs:
2419         * Plugins/Hosted/WebKitPluginHostTypes.h:
2420
2421 2009-01-08  David Hyatt  <hyatt@apple.com>
2422
2423         Fix for <rdar://problem/6465682> REGRESSION: In Mail, can't force a message to auto scroll
2424
2425         Add a new ChromeClient method for handling exposure of scrolled rects.
2426
2427         Reviewed by Oliver Hunt
2428
2429         * WebCoreSupport/WebChromeClient.h:
2430         * WebCoreSupport/WebChromeClient.mm:
2431         (WebChromeClient::scrollRectIntoView):
2432
2433 2009-01-08  Darin Adler  <darin@apple.com>
2434
2435         Reviewed by Tim Hatcher.
2436
2437         Bug 23185: add a currentRange method to the WebTextIterator SPI
2438         https://bugs.webkit.org/show_bug.cgi?id=23185
2439         rdar://problem/6455834
2440
2441         I also noticed a garbage-collection-related threading issue that I fixed, and
2442         that the SPI for getting text was unnecessarily inefficient, so I fixed that too.
2443
2444         * WebView/WebTextIterator.h: Moved currentNode and currentText into a "deprecated"
2445         category. Added currentTextPointer and currentTextLength.
2446
2447         * WebView/WebTextIterator.mm: Changed m_textIterator into an OwnPtr, and also
2448         used _textIterator to be consistent with ObjC rather than C++ naming.
2449         (+[WebTextIteratorPrivate initialize]): Added. Calls WebCoreObjCFinalizeOnMainThread,
2450         since the finalize method here works with main-thread only WebCore objects. 
2451         (-[WebTextIterator initWithRange:]): Changed since _textIterator is an OwnPtr now.
2452         (-[WebTextIterator advance]): Changed name of m_textIterator. Removed null assertion,
2453         since I don't think it provides much value.
2454         (-[WebTextIterator atEnd]): Ditto.
2455         (-[WebTextIterator currentRange]): Added.
2456         (-[WebTextIterator currentTextPointer]): Added.
2457         (-[WebTextIterator currentTextLength]): Added.
2458         (-[WebTextIterator currentNode]): Did same as above, but also put into new category.
2459         (-[WebTextIterator currentText]): Ditto.
2460
2461 2009-01-08  Eric Carlson  <eric.carlson@apple.com>
2462
2463         Reviewed by Adele Peterson.
2464
2465         Simplify Mac interfaces for drawing media controller elements
2466
2467         <rdar://problem/6293969>
2468
2469         * WebCoreSupport/WebSystemInterface.m:
2470         (InitWebCoreSystemInterface): Update for changes to media controller functions
2471
2472 2009-01-07  Anders Carlsson  <andersca@apple.com>
2473
2474         Reviewed by Dan Bernstein.
2475
2476         Fix build.
2477         
2478         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
2479         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2480         (WebKit::NetscapePluginInstanceProxy::idForObject):
2481
2482 2009-01-07  Anders Carlsson  <andersca@apple.com>
2483
2484         Reviewed by Dan Bernstein.
2485
2486         Add a way for a plug-in to get a reference to the Window JS object.
2487
2488         * Plugins/Hosted/NetscapePluginHostProxy.mm:
2489         (WKPCGetWindowNPObject):
2490         Call the appropriate instance.
2491         
2492         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
2493         Add object ID counter.
2494         
2495         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2496         (WebKit::NetscapePluginInstanceProxy::destroy):
2497         Clear the object ID map.
2498         
2499         (WebKit::NetscapePluginInstanceProxy::idForObject):
2500         New method that returns a unique ID for a given JS object.
2501         
2502         (WebKit::NetscapePluginInstanceProxy::getWindowNPObject):
2503         Return the object ID for the window JS object.
2504         
2505         * Plugins/Hosted/WebKitPluginClient.defs:
2506         Add GetWindowNPObject.
2507
2508 2009-01-07  Darin Adler  <darin@apple.com>
2509
2510         Reviewed by Oliver Hunt.
2511
2512         Bug 23160: add setMemoryCacheClientCallsEnabled SPI so Safari can be faster with activity window closed
2513         https://bugs.webkit.org/show_bug.cgi?id=23160
2514
2515         * WebView/WebView.mm:
2516         (-[WebView setMemoryCacheDelegateCallsEnabled:]): Added.
2517         (-[WebView areMemoryCacheDelegateCallsEnabled]): Added
2518         * WebView/WebViewPrivate.h: Ditto.
2519
2520 2009-01-05  Gavin Barraclough  <baraclough@apple.com>
2521
2522         Rubber Stamped by Oliver Hunt.
2523
2524         Replace all uses of JSValue* with new wrapper class, JSValuePtr.
2525         See JavaScriptCore/ChangeLog for more detailed description.
2526
2527         * WebView/WebFrame.mm:
2528         (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
2529         * WebView/WebScriptDebugDelegate.mm:
2530         (-[WebScriptCallFrame _convertValueToObjcValue:]):
2531         (-[WebScriptCallFrame exception]):
2532         (-[WebScriptCallFrame evaluateWebScript:]):
2533         * WebView/WebView.mm:
2534         (aeDescFromJSValue):
2535         (-[WebView aeDescByEvaluatingJavaScriptFromString:]):
2536
2537 2009-01-06  Pierre-Olivier Latour  <pol@apple.com>
2538
2539         Reviewed by Darin Adler.
2540
2541         Exposed through WebFrame private interface the new WebCore API AnimationController::numberOfActiveAnimations() to be used by DRT.
2542
2543         https://bugs.webkit.org/show_bug.cgi?id=23126
2544
2545         * WebView/WebFrame.mm:
2546         (-[WebFrame _numberOfActiveAnimations]):
2547         * WebView/WebFramePrivate.h:
2548
2549 2009-01-05  David Kilzer  <ddkilzer@apple.com>
2550
2551         Add SPI to enable, disable and check state of WebIconDatabase
2552
2553         Reviewed by Darin Adler & Timothy Hatcher.
2554
2555         Add -[WebIconDatabase isEnabled] and -[WebIconDatabase setEnabled:]
2556         SPI to make it possible to enable, disable and check the state of
2557         the icon database.
2558
2559         * Misc/WebIconDatabase.mm:
2560         (-[WebIconDatabase init]): Extracted code into -_startUpIconDatabase.
2561         (-[WebIconDatabase iconForURL:withSize:cache:]): Switched to use
2562         -isEnabled instead of -_isEnabled.
2563         (-[WebIconDatabase iconURLForURL:]): Ditto.
2564         (-[WebIconDatabase retainIconForURL:]): Ditto.
2565         (-[WebIconDatabase releaseIconForURL:]): Ditto.
2566         (-[WebIconDatabase isEnabled]): Renamed from -_isEnabled in
2567         WebInternal category.
2568         (-[WebIconDatabase setEnabled:]): Added.  Takes care of changing
2569         the enabled/disabled state of the icon database.
2570         (-[WebIconDatabase removeAllIcons]): Switched to use -isEnabled
2571         instead of -_isEnabled.
2572         (-[WebIconDatabase _startUpIconDatabase]): Added.  Extrated from
2573         -init.
2574         (-[WebIconDatabase _shutDownIconDatabase]): Added.  Remove
2575         observers when the icon database is disabled.
2576         * Misc/WebIconDatabaseInternal.h: Added declarations for
2577         -_startUpIconDatabase and -_shutDownIconDatabase.
2578         * Misc/WebIconDatabasePrivate.h: Added declarations for
2579         -isEnabled and -setEnabled:.
2580
2581 2009-01-05  Brady Eidson  <beidson@apple.com>
2582
2583         Reviewed by Jon Honeycutt
2584
2585         Expose setting the last-visit-was-failure flag on a history items in preparation for <rdar://problem/6173319>
2586
2587         * History/WebHistoryItem.mm:
2588         (-[WebHistoryItem _setLastVisitWasFailure:]):
2589         * History/WebHistoryItemPrivate.h:
2590
2591 2009-01-05  Adam Treat  <adam.treat@torchmobile.com>
2592
2593         Another blind mac build fix
2594
2595         * WebCoreSupport/WebChromeClient.mm:
2596         (WebChromeClient::contentsSizeChanged):
2597
2598 2009-01-05  Adam Treat  <adam.treat@torchmobile.com>
2599
2600         Blind mac build fix
2601
2602         * WebCoreSupport/WebChromeClient.mm:
2603
2604 2009-01-05  Adam Treat  <adam.treat@torchmobile.com>
2605
2606         Fix mac build
2607
2608         * WebCoreSupport/WebChromeClient.h:
2609
2610 2009-01-05  Adam Treat  <adam.treat@torchmobile.com>
2611
2612         Reviewed by George Staikos.
2613
2614         Build fix for contentsSizeChanged
2615
2616         * WebCoreSupport/WebChromeClient.h:
2617         * WebCoreSupport/WebChromeClient.mm:
2618         (WebChromeClient::contentsSizeChanged):
2619
2620 2009-01-02  Darin Adler  <darin@apple.com>
2621
2622         Reviewed by Sam Weinig.
2623
2624         Bug 23072: REGRESSION (r37371): In the Dictionary application, scroll bar appears
2625         inside its web view when resizing its window
2626         https://bugs.webkit.org/show_bug.cgi?id=23072
2627         rdar://problem/6368028
2628
2629         The first attempt at fixing this did not work.
2630         This time I was able to reproduce the bug and test the fix.
2631
2632         * WebCoreSupport/WebFrameLoaderClient.mm:
2633         (applyAppleDictionaryApplicationQuirkNonInlinePart): Changed the arguments and
2634         function names around a bit to make even less code at the call site.
2635         (applyAppleDictionaryApplicationQuirk): Put the check for whether this is the
2636         Dictionary application in here.
2637         (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache): Put a call to
2638         applyAppleDictionaryApplicationQuirk here. This was a case I had missed before,
2639         when the script is cached. This fixes one of the two problems with the initial
2640         patch; the other fix is in WebCore.
2641         (WebFrameLoaderClient::dispatchWillSendRequest): Changed the
2642         applyAppleDictionaryApplicationQuirk call here to work the new simpler way.
2643
2644         * WebView/WebView.mm: Had to add an include due to changes in WebCore header includes.
2645
2646 2009-01-02  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2647
2648         Reviewed by Darin Adler.
2649
2650         Bug 23060: REGRESSION (r38629): Cannot scroll a WebHTMLView using Home/End/Page up/Page down
2651         <https://bugs.webkit.org/show_bug.cgi?id=23060>
2652         <rdar://problem/6467830>
2653
2654         After r38629, all keyboard events get sent by Editor to the EditorClient, even
2655         if the selection is not editable. If the event's command is unsupported by
2656         WebHTMLView, WebHTMLView mistakenly thinks that the event was handled when it
2657         was not. When using the page up / page down keys, the events generated are of
2658         the form scrollPageUp rather than movePageUp, so they are unsupported by
2659         WebHTMLView and cause this bug to occur.
2660
2661         * WebView/WebHTMLView.mm:
2662         (-[WebHTMLView doCommandBySelector:]):
2663
2664 2009-01-02  Darin Adler  <darin@apple.com>
2665
2666         Reviewed by Oliver Hunt.
2667
2668         Bug 23072: REGRESSION (r37371): In the Dictionary application, scroll bar appears inside its web view when resizing its window
2669         https://bugs.webkit.org/show_bug.cgi?id=23072
2670         rdar://problem/6368028
2671
2672         * WebCoreSupport/WebFrameLoaderClient.mm:
2673         (isAppleDictionaryApplication): Added.
2674         (applyAppleDictionaryApplicationQuirk): Added. Under the right conditions, sets
2675         a flag to ask HTMLFrameElementBase to ignore the scrolling attribute.
2676         (WebFrameLoaderClient::dispatchWillSendRequest): Call the two functions above to
2677         apply the quirk when the relevant script is loaded.
2678
2679 2008-12-26  Dan Bernstein  <mitz@apple.com>
2680
2681         Reviewed by Sam Weinig.
2682
2683         - fix <rdar://problem/6467608> lastVisitWasFailure flag persists in
2684           global history after a successful visit
2685
2686         * History/WebHistory.mm:
2687         (-[WebHistory _visitedURL:withTitle:wasFailure:]): Changed to always
2688         update the wasFailure flag on the HistoryItem.
2689
2690 2008-12-23  Darin Adler  <darin@apple.com>
2691
2692         Reviewed by Alexey Proskuryakov (a slightly earlier version).
2693
2694         - fix https://bugs.webkit.org/show_bug.cgi?id=22976
2695           crash due to Mail's use of WebArchive and WebResource on non-main thread
2696
2697         * Misc/WebKitLogging.h: Improved comments for ASSERT_MAIN_THREAD. Got rid of
2698         WebKitRunningOnMainThread function, which was just a cover for pthread_main_np.
2699         * Misc/WebKitLogging.m: Ditto.
2700
2701         * Misc/WebKitVersionChecks.h: Added a version after which we won't do the
2702         main thread workaround.
2703
2704         * Misc/WebNSObjectExtras.h: Added a new method, _webkit_getPropertyOnMainThread:,
2705         which performs a selector on the main thread, waits for it to complete, and then
2706         returns the value on the caller thread.
2707         * Misc/WebNSObjectExtras.mm: Added.
2708
2709         * WebView/WebArchive.mm:
2710         (-[WebArchive init]): Added WebCoreThreadViolationCheck.
2711         (-[WebArchive initWithMainResource:subresources:subframeArchives:]): Perform
2712         initialization on main thread if needMailThreadWorkaround is true.
2713         Also added WebCoreThreadViolationCheck.
2714         (-[WebArchive initWithData:]): Added WebCoreThreadViolationCheck.
2715         (-[WebArchive mainResource]): Get property on main thread if
2716         needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck.
2717         (-[WebArchive subresources]): Ditto.
2718         (-[WebArchive subframeArchives]): Ditto.
2719         (-[WebArchive data]): Ditto.
2720         (-[WebArchive _initWithCoreLegacyWebArchive:]): Added WebCoreThreadViolationCheck.
2721         (-[WebArchive _coreLegacyWebArchive]): Ditto.
2722         (-[WebArchive _initWithArguments:]): Added. Used to implement the cross-thread
2723         version of initWithMainResource above.
2724
2725         * WebView/WebResource.mm:
2726         (-[WebResource initWithCoder:]): Added WebCoreThreadViolationCheck.
2727         (-[WebResource data]): Get property on main thread if
2728         needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck.
2729         (-[WebResource URL]): Ditto.
2730         (-[WebResource MIMEType]): Ditto.
2731         (-[WebResource textEncodingName]): Ditto.
2732         (-[WebResource frameName]): Ditto.
2733         (-[WebResource _ignoreWhenUnarchiving]): Ditto.
2734         (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]):
2735         Perform initialization on main thread if needMailThreadWorkaround is true.
2736         Also added WebCoreThreadViolationCheck.
2737         (-[WebResource _suggestedFilename]): Added. Helper for _fileWrapperRepresentation.
2738         (-[WebResource _fileWrapperRepresentation]): Rewrote to use methods instead of
2739         getting at coreResource directly.
2740         (-[WebResource _response]): Get property on main thread if
2741         needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck.
2742         (-[WebResource _stringValue]): Ditto.
2743         (+[WebResource _needMailThreadWorkaroundIfCalledOffMainThread]): Added.
2744         (-[WebResource _initWithArguments:]): Added. Used to implement the cross-thread
2745         version of _initWithData above.
2746
2747         * WebView/WebResourceInternal.h: Changed to include WebResourcePrivate.h since internal
2748         clients have access to the SPI as well as the API. Added definition of MAIL_THREAD_WORKAROUND
2749         and the needMainThreadWorkaround helper function.
2750
2751         * Misc/WebIconDatabase.mm: Removed include of now-defunct FoundationExtras.h
2752         file. This probably fixes clean builds.
2753         * WebCoreSupport/WebIconDatabaseClient.mm: Ditto.
2754
2755         * WebCoreSupport/WebFrameLoaderClient.mm: Removed include of WebResourcePrivate.h,
2756         since it's not actually used.
2757         * WebView/WebDataSource.mm: Ditto.
2758         * WebView/WebHTMLRepresentation.mm: Ditto.
2759
2760 2008-12-23  Darin Adler  <darin@apple.com>
2761
2762         Reviewed by Dan Bernstein.
2763
2764         - fix https://bugs.webkit.org/show_bug.cgi?id=22979
2765           crash seen in -[WebView drawsBackground] when quitting
2766           <rdar://problem/6464601>
2767
2768         * WebView/WebView.mm:
2769         (-[WebView drawsBackground]): Added comment and a null check for _private.
2770
2771 2008-12-22  Kevin Decker  <kdecker@apple.com>
2772
2773         Reviewed by Anders Carlsson.
2774
2775         <rdar://problem/6449588> REGRESSION (r38279-r38280): Minimize them remaximize a window with a flash plugin, plugin doesn't resume at full speed
2776         
2777         * Plugins/WebBaseNetscapePluginView.mm:
2778         (-[WebBaseNetscapePluginView windowDidDeminiaturize:]): Deminiaturizing should restart timers, not stop timers.
2779
2780 2008-12-19  Geoffrey Garen  <ggaren@apple.com>
2781
2782         Reviewed by Darin Adler, Adele Peterson, Brady Eidson.
2783         
2784         Added SPI for getting an unsorted vector of all items in history.
2785         
2786         * History/WebHistory.h:
2787         * History/WebHistory.mm:
2788         (-[WebHistory allItems]):
2789
2790 2008-12-18  Dan Bernstein  <mitz@apple.com>
2791
2792         Reviewed by Sam Weinig.
2793
2794         - implement FrameLoaderClient::shouldUseCredentialStorage() by calling
2795           a new resource load delegae method.
2796
2797         * WebCoreSupport/WebFrameLoaderClient.h:
2798         * WebCoreSupport/WebFrameLoaderClient.mm:
2799         (WebFrameLoaderClient::shouldUseCredentialStorage): Added. Calls the
2800         delegate method. If the method is unimplemented, returns true for
2801         backwards compatibility.
2802         * WebView/WebView.mm: 
2803         (-[WebView _cacheResourceLoadDelegateImplementations]): Initialize the
2804         shouldUseCredentialStorageFunc member.
2805         (CallResourceLoadDelegateReturningBoolean): Added.
2806         * WebView/WebViewInternal.h:
2807         * WebView/WebResourceLoadDelegatePrivate.h: Declared the delegate method
2808         -webView:resource:shouldUseCredentialStorageForDataSource:.
2809
2810 2008-12-18  Cameron Zwarich  <zwarich@apple.com>
2811
2812         Reviewed by Jonathan Honeycutt.
2813
2814         Fix an apparent typo in r39385 that is causing lots of crashes.
2815
2816         * WebCoreSupport/WebFrameLoaderClient.mm:
2817         (WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout):
2818
2819 2008-12-18  Brady Eidson  <beidson@apple.com>
2820
2821         Reviewed by John Sullivan
2822
2823         Initial visit to a website creates history items that start with a visit count of
2824         zero instead of one
2825
2826         * History/WebHistory.mm:
2827         (-[WebHistoryPrivate visitedURL:withTitle:]): Set the visit count on new items
2828
2829         * History/WebHistoryItem.mm:
2830         (-[WebHistoryItem _setVisitCount:]): Call through to the WebCore item
2831         * History/WebHistoryItemInternal.h:
2832
2833 2008-12-18  Sam Weinig  <sam@webkit.org>
2834
2835         Reviewed by John Sullivan.
2836
2837         Implement FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout() by calling
2838         a new private frame load delegate method.
2839
2840         * WebCoreSupport/WebFrameLoaderClient.h:
2841         * WebCoreSupport/WebFrameLoaderClient.mm:
2842         (WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout):
2843         * WebView/WebView.mm:
2844         (-[WebView _cacheFrameLoadDelegateImplementations]):
2845         * WebView/WebViewInternal.h:
2846         * WebView/WebViewPrivate.h:
2847
2848 2008-12-16  Antti Koivisto  <antti@apple.com>
2849
2850         Reviewed by John Sullivan.
2851         
2852         Add version check for shift-reload behavior.
2853
2854         * Misc/WebKitVersionChecks.h:
2855         * WebView/WebFrame.mm:
2856         (-[WebFrame reload]):
2857
2858 2008-12-16  Anders Carlsson  <andersca@apple.com>
2859
2860         Reviewed by Dan Bernstein.
2861
2862         Start sending keyboard events to the plug-in host.
2863         
2864         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
2865         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2866         (WebKit::NetscapePluginInstanceProxy::keyEvent):
2867         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
2868         (-[WebHostedNetscapePluginView keyDown:]):
2869         (-[WebHostedNetscapePluginView keyUp:]):
2870         * Plugins/Hosted/WebKitPluginHost.defs:
2871
2872 2008-12-16  Anders Carlsson  <andersca@apple.com>
2873
2874         Reviewed by Kevin Decker.
2875
2876         <rdar://problem/6450538>
2877         
2878         Fix flag enumeration.
2879         
2880         * Plugins/Hosted/WebKitPluginHostTypes.h:
2881
2882 2008-12-16  Anders Carlsson  <andersca@apple.com>
2883
2884         Reviewed by Kevin Decker.
2885
2886         Instead of passing a gazillion booleans to WKPCLoadURL, pass a single set of flags.
2887         
2888         * Plugins/Hosted/NetscapePluginHostProxy.mm:
2889         (WKPCLoadURL):
2890         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
2891         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2892         (WebKit::NetscapePluginInstanceProxy::loadURL):
2893         * Plugins/Hosted/WebKitPluginClient.defs:
2894         * Plugins/Hosted/WebKitPluginHostTypes.h:
2895
2896 2008-12-16  Anders Carlsson  <andersca@apple.com>
2897
2898         Reviewed by Kevin Decker.
2899
2900         Add trailing null to headers to avoid a crash in the plug-in host.
2901         
2902         * Plugins/Hosted/HostedNetscapePluginStream.mm:
2903         (WebKit::HostedNetscapePluginStream::didReceiveResponse):
2904
2905 2008-12-15  Mark Rowe  <mrowe@apple.com>
2906
2907         Rubber-stamped by Cameron Zwarich.
2908
2909         <rdar://problem/6289933> Change WebKit-related projects to build with GCC 4.2 on Leopard.
2910
2911         * Configurations/Base.xcconfig:
2912         * Configurations/DebugRelease.xcconfig:
2913
2914 2008-12-15  Stephanie Lewis  <slewis@apple.com>
2915
2916         Fix build.
2917
2918         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2919
2920 2008-12-15  Anders Carlsson  <andersca@apple.com>
2921
2922         Reviewed by Sam Weinig.
2923
2924         Change InstantiatePlugin to be asynchronous so we won't deadlock if the plug-in tries to call
2925         back into us while it's being instantiated.
2926         
2927         * Plugins/Hosted/NetscapePluginHostManager.mm:
2928         (WebKit::NetscapePluginHostManager::instantiatePlugin):
2929         * Plugins/Hosted/NetscapePluginHostProxy.h:
2930         (WebKit::NetscapePluginHostProxy::clientPort):
2931         * Plugins/Hosted/NetscapePluginHostProxy.mm:
2932         (WKPCInstantiatePluginReply):
2933         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
2934         (WebKit::NetscapePluginInstanceProxy::Reply::):
2935         (WebKit::NetscapePluginInstanceProxy::Reply::Reply):
2936         (WebKit::NetscapePluginInstanceProxy::Reply::~Reply):
2937         (WebKit::NetscapePluginInstanceProxy::InstantiatePluginReply::InstantiatePluginReply):
2938         (WebKit::NetscapePluginInstanceProxy::setCurrentReply):
2939         (WebKit::NetscapePluginInstanceProxy::waitForReply):
2940         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2941         (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
2942         (WebKit::NetscapePluginInstanceProxy::processRequestsAndWaitForReply):
2943         * Plugins/Hosted/WebKitPluginClient.defs:
2944         * Plugins/Hosted/WebKitPluginHost.defs:
2945
2946 2008-12-15  Anders Carlsson  <andersca@apple.com>
2947
2948         Reviewed by Darin Adler.
2949
2950         Let WebKit generate a plug-in ID instead of having the plug-in host do it.
2951
2952         * Plugins/Hosted/NetscapePluginHostManager.mm:
2953         (WebKit::NetscapePluginHostManager::instantiatePlugin):
2954         Create the plug-in proxy before instantiating the plug-in.
2955         
2956         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
2957         (WebKit::NetscapePluginInstanceProxy::create):
2958         (WebKit::NetscapePluginInstanceProxy::setRenderContextID):
2959         (WebKit::NetscapePluginInstanceProxy::setUseSoftwareRenderer):
2960         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
2961         (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
2962         * Plugins/Hosted/WebKitPluginHost.defs:
2963
2964 2008-12-15  Anders Carlsson  <andersca@apple.com>
2965
2966         Reviewed by Sam Weinig.
2967
2968         LoadURL doesn't need to be asynchronous.
2969         
2970         * Plugins/Hosted/NetscapePluginHostProxy.mm:
2971         (WKPCLoadURL):
2972         * Plugins/Hosted/WebKitPluginClient.defs:
2973         * Plugins/Hosted/WebKitPluginHost.defs:
2974
2975 2008-12-15  Antti Koivisto  <antti@apple.com>
2976
2977         Reviewed by Darin Adler.
2978         
2979         - Add [WebFrame reloadFromOrigin] for performing end-to-end reload.
2980         - Add corresponding IBAction to WebView.
2981         - Temporarily make [WebFrame reload] trigger end-to-end reload if shift modifier is pressed when it is called.
2982
2983         * WebView/WebFrame.h:
2984         * WebView/WebFrame.mm:
2985         (-[WebFrame reload]):
2986         (-[WebFrame reloadFromOrigin]): 
2987         * WebView/WebFramePrivate.h: Match the FrameLoadType enum in WebCore.
2988         * WebView/WebView.h:
2989         * WebView/WebView.mm:
2990         (-[WebView reloadFromOrigin:]):
2991
2992 2008-12-14  Dan Bernstein  <mitz@apple.com>
2993
2994         Reviewed by Darin Adler.
2995
2996         - fix <rdar://problem/3258561> WebHistoryAllItemsRemovedNotification
2997           should add items to userInfo
2998
2999         * History/WebHistory.mm:
3000         (-[WebHistoryPrivate allItems]): Added this helper method, which returns
3001         all values in the _entriesByURL dictionary.
3002         (-[WebHistory removeAllItems]): Changed to send the array of all items
3003         in the notification.
3004
3005 2008-12-13  Darin Adler  <darin@apple.com>
3006
3007         - <rdar://problem/6441035> WebTextIterator class not exported in WebKit
3008
3009         * WebKit.exp: Added the class. We forgot to export it when we added
3010         the WebTextIterator SPI.
3011
3012 2008-12-12  Darin Adler  <darin@apple.com>
3013
3014         Rubber stamped by Adam Roben.
3015
3016         - fix <rdar://problem/5648301> Can't tab around to text fields in Safari
3017           login sheet after clicking static text, due to AppKit key loop change
3018
3019         * Panels/English.lproj/WebAuthenticationPanel.nib/classes.nib: Removed.
3020         * Panels/English.lproj/WebAuthenticationPanel.nib/designable.nib: Added.
3021         * Panels/English.lproj/WebAuthenticationPanel.nib/info.nib: Removed.
3022         * Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib:
3023         Set nextKeyView of the selectable static texts to the editable text.
3024         Updated nib format.
3025
3026 2008-12-12  Stephanie Lewis  <slewis@apple.com>
3027
3028         Reviewed by Geoff Garen.
3029
3030         Shrink Cache Sizes.
3031
3032         * WebView/WebView.mm:
3033         (+[WebView _setCacheModel:]):
3034
3035 2008-12-12  Anders Carlsson  <andersca@apple.com>
3036
3037         Reviewed by Tim Hatcher.
3038
3039         Don't try to free the dummy "1" port state.
3040         
3041         * Plugins/WebNetscapePluginView.mm:
3042         (-[WebNetscapePluginView sendEvent:isDrawRect:]):
3043         (-[WebNetscapePluginView updateAndSetWindow]):
3044
3045 2008-12-11  Cameron Zwarich  <zwarich@apple.com>
3046
3047         Rubber-stamped by Mark Rowe.
3048
3049         Roll out r39212 due to assertion failures during layout tests, multiple
3050         layout test failures, memory leaks, and obvious incorrectness.
3051
3052         * WebView/WebPreferenceKeysPrivate.h:
3053         * WebView/WebPreferences.mm:
3054         (-[WebPreferences fullDocumentTeardownEnabled]):
3055         * WebView/WebPreferencesPrivate.h:
3056
3057 2008-12-11  Stephanie Lewis  <slewis@apple.com>
3058
3059         Fix build.
3060
3061         * WebView/WebView.mm:
3062
3063 2008-12-11  Stephanie Lewis  <slewis@apple.com>
3064
3065         Reviewed by Oliver Hunt.
3066
3067         Empty Web cache before quitting a debug build in order
3068         to report accurate CachedResource leaks.
3069
3070         * WebView/WebView.mm:
3071         (-[WebView _close]):
3072
3073 2008-12-11  Anders Carlsson  <andersca@apple.com>
3074
3075         Fix Tiger build.
3076
3077         * Misc/WebNSDataExtras.h:
3078
3079 2008-12-11  Anders Carlsson  <andersca@apple.com>
3080
3081         Reviewed by Cameron Zwarich.
3082
3083         https://bugs.webkit.org/show_bug.cgi?id=22797
3084         REGRESSION: Crash at http://news.cnet.com/8301-17939_109-10119149-2.html
3085
3086         Make sure to protect the stream because destroyStream can otherwise cause it to be deleted.
3087         
3088         * Plugins/WebBaseNetscapePluginStream.mm:
3089         (WebNetscapePluginStream::destroyStreamWithReason):
3090
3091 2008-12-10  Glenn Wilson  <gwilson@google.com>
3092
3093         Reviewed by Adam Roben.
3094
3095         Added new methods for overriding default WebPreference values
3096         and for resetting preferences to their defaults.
3097         https://bugs.webkit.org/show_bug.cgi?id=20534
3098
3099         * WebView/WebPreferenceKeysPrivate.h:
3100         * WebView/WebPreferences.mm:
3101         (-[WebPreferences resetToDefaults]): new method
3102         (-[WebPreferences overridePreference:flag:]): new method
3103         * WebView/WebPreferencesPrivate.h: new method signatures
3104
3105 2008-12-10  Anders Carlsson  <andersca@apple.com>
3106
3107         Reviewed by Darin Adler.
3108
3109         Implement support for NPN_PostURL/NPN_PostURLNotify in WebKit.
3110         
3111         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
3112         Add stopAllStreams.
3113         
3114         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
3115         (WebKit::NetscapePluginInstanceProxy::stopAllStreams):
3116         Factored out this from ::destroy.
3117         
3118         (WebKit::NetscapePluginInstanceProxy::destroy):
3119         Call stopAllStreams().
3120         
3121         (WebKit::NetscapePluginInstanceProxy::pluginHostDied):
3122         Ditto.
3123         
3124         (WebKit::NetscapePluginInstanceProxy::loadURL):
3125         Handle post being true. This code has been copied from WebNetscapePluginView.mm (for now).
3126
3127 2008-12-10  Anders Carlsson  <andersca@apple.com>
3128
3129         Reviewed by Darin Adler.
3130
3131         Move two NSData category methods to WebNSDataExtras.m.
3132         
3133         * Misc/WebNSDataExtras.h:
3134         * Misc/WebNSDataExtras.m:
3135         (-[NSData _web_startsWithBlankLine]):
3136         (-[NSData _web_locationAfterFirstBlankLine]):
3137         * Plugins/WebNetscapePluginView.mm:
3138
3139 2008-12-10  Alice Liu  <alice.liu@apple.com>
3140
3141         fixed https://bugs.webkit.org/show_bug.cgi?id=20685
3142
3143         Reviewed by Darin Adler.
3144
3145         * Misc/WebNSPasteboardExtras.mm:
3146         Ask image for its file extension instead of falling back on MIME type and file path.
3147         Also moved this code to before setting the pasteboard data so as not to set any if
3148         no extension can be determined.
3149         (-[NSPasteboard _web_declareAndWriteDragImageForElement:URL:title:archive:source:]):
3150
3151         * WebView/WebHTMLView.mm:
3152         Fixed a separate but related long-standing bug of how the filename for the promised
3153         drag data is determined by asking the image for a proper file extension. 
3154         (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]):
3155
3156 2008-12-09  Anders Carlsson  <andersca@apple.com>
3157
3158         Reviewed by Darin Adler.
3159
3160         Fix typecast.
3161
3162         * WebView/WebHTMLView.mm:
3163         (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]):
3164
3165 2008-12-09  Anders Carlsson  <andersca@apple.com>
3166
3167         Reviewed by Darin Adler.
3168
3169         Implement software rendering of hosted plug-ins.
3170         
3171         * Plugins/Hosted/NetscapePluginHostProxy.mm:
3172         (WKPCInvalidateRect):
3173         New MiG function. This is called by the plug-in host when it has drawn something.
3174         
3175         * Plugins/Hosted/WebHostedNetscapePluginView.h:
3176         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
3177         (-[WebHostedNetscapePluginView createPlugin]):
3178         Create a software renderer.
3179         
3180         (-[WebHostedNetscapePluginView destroyPlugin]):
3181         Destroy the software renderer.
3182         
3183         (-[WebHostedNetscapePluginView drawRect:]):
3184         Draw using the software renderer.
3185         
3186         * Plugins/Hosted/WebKitPluginClient.defs:
3187         Add InvalidateRect.
3188
3189 2008-12-09  Brett Wilson  <brettw@chromium.org>
3190
3191         Reviewed by Dave Hyatt.
3192
3193         https://bugs.webkit.org/show_bug.cgi?id=22177
3194
3195         Add a callback on ChromeClient that the state of form elements on
3196         the page has changed. This is to allow clients implementing session
3197         saving to know when the current state is dirty.
3198
3199         * WebCoreSupport/WebChromeClient.h:
3200         (WebChromeClient::formStateDidChange):
3201
3202 2008-12-09  Anders Carlsson  <andersca@apple.com>
3203
3204         Reviewed by Dan Bernstein.
3205
3206         Make sure to pause null events for hosted plug-ins as well.
3207
3208         * WebView/WebHTMLView.mm:
3209         (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]):
3210
3211 2008-12-09  Anders Carlsson  <andersca@apple.com>
3212
3213         Reviewed by Darin Adler.
3214
3215         * Plugins/Hosted/NetscapePluginHostProxy.h:
3216         * Plugins/Hosted/NetscapePluginHostProxy.mm:
3217         (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
3218         (WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy):
3219         Unfortunately we can't use a libdispatch source right now, because of <rdar://problem/6393180>.
3220
3221 2008-12-09  Timothy Hatcher  <timothy@apple.com>
3222
3223         Implement a few methods needed to keep Dictionary.app working on Leopard.
3224
3225         <rdar://problem/6002160> Internal changes to WebKit in Safari 4
3226         Developer Preview might break Dictionary
3227
3228         Reviewed by Dan Bernstein.
3229
3230         * WebView/WebFrame.mm:
3231         (-[WebFrame convertNSRangeToDOMRange:]): Added. Calls _convertNSRangeToDOMRange.
3232         (-[WebFrame convertDOMRangeToNSRange:]): Added. Calls _convertDOMRangeToNSRange.
3233         * WebView/WebHTMLView.mm:
3234         (-[WebHTMLView _bridge]): Added. Returns the WebFrame, which has the methods
3235         that Dictionary.app is using.
3236
3237 2008-12-08  Anders Carlsson  <andersca@apple.com>
3238
3239         Reviewed by Darin Adler.
3240
3241         More work towards getting NPN_GetURL working.
3242         
3243         * Plugins/Hosted/HostedNetscapePluginStream.h:
3244         Inherit from NetscapePlugInStreamLoaderClient.
3245         
3246         (WebKit::HostedNetscapePluginStream::streamID):
3247         * Plugins/Hosted/HostedNetscapePluginStream.mm:
3248         (WebKit::HostedNetscapePluginStream::startStream):
3249         Keep track of the resposne URL and the MIME type. Pass the response URL to the 
3250         plug-in host.
3251         
3252         (WebKit::HostedNetscapePluginStream::didFinishLoading):
3253         Disconnect the stream.
3254         
3255         (WebKit::HostedNetscapePluginStream::start):
3256         Create a plug-in stream loader and start loading.
3257         
3258         (WebKit::HostedNetscapePluginStream::stop):
3259         Cancel the load.
3260         
3261         * Plugins/Hosted/NetscapePluginHostProxy.mm:
3262         (WKPCLoadURL):
3263         Fix the parameter order.
3264         
3265         (WKPCCancelLoadURL):
3266         New function that cancels a load of a stream with a given reason.
3267         
3268         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
3269         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
3270         (WebKit::NetscapePluginInstanceProxy::destroy):
3271         Stop the streams.
3272         
3273         (WebKit::NetscapePluginInstanceProxy::pluginStream):
3274         Return a plug-in stream given a stream ID.
3275         
3276         (WebKit::NetscapePluginInstanceProxy::disconnectStream):
3277         Remove the stream from the streams map.
3278         
3279         (WebKit::NetscapePluginInstanceProxy::loadRequest):
3280         Create a stream and load it.
3281         
3282         * Plugins/Hosted/WebKitPluginClient.defs:
3283         Add CancelLoadURL.
3284         
3285         * Plugins/Hosted/WebKitPluginHost.defs:
3286         Add responseURL to StartStream.
3287         
3288         * Plugins/WebBaseNetscapePluginView.h:
3289         * Plugins/WebBaseNetscapePluginView.mm:
3290         (-[WebBaseNetscapePluginView pluginPackage]):
3291         Move this down to the base class from WebNetscapePluginView.
3292         
3293         * Plugins/WebNetscapePluginView.h:
3294         * Plugins/WebNetscapePluginView.mm:
3295
3296 2008-12-08  Dan Bernstein  <mitz@apple.com>
3297
3298         Reviewed by John Sullivan.
3299
3300         - WebKit/mac part of tracking the global history item for a WebView
3301
3302         * WebView/WebView.mm:
3303         (-[WebView _globalHistoryItem]): Added. Returns the page's global
3304         history item.
3305         * WebView/WebViewPrivate.h:
3306
3307 2008-12-06  Simon Fraser  <simon.fraser@apple.com>
3308
3309         Reviewed by Dave Hyatt
3310
3311         https://bugs.webkit.org/show_bug.cgi?id=15671
3312
3313         VisiblePosition::caretRect() was renaemd to absoluteCaretBounds().
3314         
3315         * WebView/WebFrame.mm:
3316         (-[WebFrame _caretRectAtNode:offset:affinity:]):
3317
3318 2008-12-06  David Kilzer  <ddkilzer@apple.com>
3319
3320         Bug 22666: Clean up data structures used when collecting URLs of subresources for webarchives
3321
3322         <https://bugs.webkit.org/show_bug.cgi?id=22666>
3323
3324         Reviewed by Darin Adler.
3325
3326         * DOM/WebDOMOperations.mm:
3327         (-[DOMNode _subresourceURLs]): Changed from using Vector<KURL> to
3328         ListHashSet<KURL> when calling WebCore::Node::getSubresourceURLs().
3329
3330 2008-12-05  Alexey Proskuryakov  <ap@webkit.org>
3331
3332         Reviewed by Darin Adler.
3333
3334         <rdar://problem/6405599> Tiger Mail crashes when using "Mail Contents of This Page"
3335         in Safari before opening a mail message in Mail
3336
3337         * Carbon/CarbonWindowAdapter.m: Removed.
3338         * Carbon/CarbonWindowAdapter.mm: Copied from WebKit/mac/Carbon/CarbonWindowAdapter.m.
3339         (+[CarbonWindowAdapter initialize]):
3340         * History/WebBackForwardList.mm:
3341         (+[WebBackForwardList initialize]):
3342         * History/WebHistoryItem.mm:
3343         (+[WebHistoryItem initialize]):
3344         * Misc/WebElementDictionary.mm:
3345         (+[WebElementDictionary initialize]):
3346         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
3347         (+[WebHostedNetscapePluginView initialize]):
3348         * Plugins/WebBaseNetscapePluginView.mm:
3349         * Plugins/WebBasePluginPackage.m: Removed.
3350         * Plugins/WebBasePluginPackage.mm: Copied from WebKit/mac/Plugins/WebBasePluginPackage.m.
3351         (+[WebBasePluginPackage initialize]):
3352         * Plugins/WebNetscapePluginView.mm:
3353         (+[WebNetscapePluginView initialize]):
3354         * WebCoreSupport/WebEditorClient.mm:
3355         (+[WebEditCommand initialize]):
3356         * WebCoreSupport/WebFrameLoaderClient.mm:
3357         * WebView/WebArchive.mm:
3358         (+[WebArchivePrivate initialize]):
3359         * WebView/WebDataSource.mm:
3360         (+[WebDataSourcePrivate initialize]):
3361         * WebView/WebHTMLView.mm:
3362         (+[WebHTMLViewPrivate initialize]):
3363         (+[WebHTMLView initialize]):
3364         * WebView/WebResource.mm:
3365         (+[WebResourcePrivate initialize]):
3366         * WebView/WebView.mm:
3367         (+[WebViewPrivate initialize]):
3368         Call JSC::initializeThreading();
3369
3370 2008-12-04  Stephanie Lewis  <slewis@apple.com>
3371
3372         Fix build.
3373
3374         * Plugins/Hosted/NetscapePluginHostProxy.mm:
3375         (WKPCLoadURL):
3376
3377 2008-12-04  Anders Carlsson  <andersca@apple.com>
3378
3379         Reviewed by Sam Weinig.
3380
3381         More work on streams.
3382         
3383         * Plugins/Hosted/HostedNetscapePluginStream.h: Added.
3384         (WebKit::HostedNetscapePluginStream::create):
3385         * Plugins/Hosted/HostedNetscapePluginStream.mm: Added.
3386         (WebKit::HostedNetscapePluginStream::HostedNetscapePluginStream):
3387         (WebKit::HostedNetscapePluginStream::startStreamWithResponse):
3388         (WebKit::HostedNetscapePluginStream::startStream):
3389         (WebKit::HostedNetscapePluginStream::didReceiveData):
3390         (WebKit::HostedNetscapePluginStream::didFinishLoading):
3391         (WebKit::HostedNetscapePluginStream::didReceiveResponse):
3392         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
3393         (WebKit::NetscapePluginInstanceProxy::pluginView):
3394         (WebKit::NetscapePluginInstanceProxy::hostProxy):
3395         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
3396         (WebKit::NetscapePluginInstanceProxy::PluginRequest::PluginRequest):
3397         (WebKit::NetscapePluginInstanceProxy::PluginRequest::requestID):
3398         (WebKit::NetscapePluginInstanceProxy::PluginRequest::request):
3399         (WebKit::NetscapePluginInstanceProxy::PluginRequest::frameName):
3400         (WebKit::NetscapePluginInstanceProxy::PluginRequest::didStartFromUserGesture):
3401         (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
3402         (WebKit::NetscapePluginInstanceProxy::performRequest):
3403         (WebKit::NetscapePluginInstanceProxy::evaluateJavaScript):
3404         (WebKit::NetscapePluginInstanceProxy::requestTimerFired):
3405         (WebKit::NetscapePluginInstanceProxy::loadRequest):
3406         * Plugins/Hosted/WebKitPluginHost.defs:
3407
3408 2008-12-04  Anders Carlsson  <andersca@apple.com>
3409
3410         Reviewed by Sam Weinig.
3411
3412         Start implementing WKPCLoadURL. Currently this has copied a lot of code from WebNetscapePluginView
3413         but once we have a more complete implementation of NPStreams we can start refactoring things so that the
3414         implementations can share more code.
3415         
3416         * Plugins/Hosted/NetscapePluginHostProxy.mm:
3417         (WKPCLoadURL):
3418         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
3419         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
3420         (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
3421         (WebKit::NetscapePluginInstanceProxy::loadURL):
3422         (WebKit::NetscapePluginInstanceProxy::performRequest):
3423         (WebKit::NetscapePluginInstanceProxy::requestTimerFired):
3424         (WebKit::NetscapePluginInstanceProxy::loadRequest):
3425         * Plugins/Hosted/WebKitPluginClient.defs:
3426         * Plugins/Hosted/WebKitPluginHost.defs:
3427
3428 2008-12-04  Anders Carlsson  <andersca@apple.com>
3429
3430         Reviewed by Dan Bernstein.
3431         
3432         Move requestWithURLCString to WebBaseNetscapePluginView.
3433         
3434         * Plugins/WebBaseNetscapePluginView.h:
3435         * Plugins/WebBaseNetscapePluginView.mm:
3436         (-[WebBaseNetscapePluginView requestWithURLCString:]):
3437         * Plugins/WebNetscapePluginView.mm:
3438
3439 2008-12-03  Anders Carlsson  <andersca@apple.com>
3440
3441         Reviewed by Sam Weinig.
3442
3443         Move WebPluginRequest to its own file.
3444         
3445         * Plugins/WebNetscapePluginView.mm:
3446         * Plugins/WebPluginRequest.h: Added.
3447         * Plugins/WebPluginRequest.m: Added.
3448         (-[WebPluginRequest initWithRequest:frameName:notifyData:sendNotification:didStartFromUserGesture:]):
3449         (-[WebPluginRequest dealloc]):
3450         (-[WebPluginRequest request]):
3451         (-[WebPluginRequest frameName]):
3452         (-[WebPluginRequest isCurrentEventUserGesture]):
3453         (-[WebPluginRequest sendNotification]):
3454         (-[WebPluginRequest notifyData]):
3455
3456 2008-12-03  Anders Carlsson  <andersca@apple.com>
3457
3458         Handle the CA model.
3459
3460         * Plugins/WebNetscapePluginView.mm:
3461         (-[WebNetscapePluginView setWindowIfNecessary]):
3462
3463 2008-12-03  Anders Carlsson  <andersca@apple.com>
3464
3465         Reviewed by Kevin Decker.
3466         
3467         <rdar://problem/6412293>
3468         Call NPP_SetWindow for CA plug-ins.
3469         
3470         * Plugins/WebNetscapePluginView.mm:
3471         (-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]):
3472         (-[WebNetscapePluginView restorePortState:]):
3473         (-[WebNetscapePluginView isNewWindowEqualToOldWindow]):
3474         (-[WebNetscapePluginView updateAndSetWindow]):
3475         (-[WebNetscapePluginView setWindowIfNecessary]):
3476
3477 2008-12-03  Anders Carlsson  <andersca@apple.com>
3478
3479         Fix the release build.
3480
3481         * Plugins/Hosted/NetscapePluginHostProxy.mm:
3482         (WebKit::NetscapePluginHostProxy::deadNameNotificationCallback):
3483
3484 2008-12-03  Anders Carlsson  <andersca@apple.com>
3485
3486         Reviewed by Dan Bernstein.
3487
3488         <rdar://problem/6412234>
3489         Don't crash if we can't launch the plug-in host.
3490
3491         * Plugins/Hosted/NetscapePluginHostManager.mm:
3492         (WebKit::NetscapePluginHostManager::instantiatePlugin):
3493
3494 2008-12-02  Anders Carlsson  <andersca@apple.com>
3495
3496         Reviewed by Dan Bernstein.
3497
3498         Start processing messages sent to the client port.
3499         
3500         * Plugins/Hosted/NetscapePluginHostProxy.h:
3501         * Plugins/Hosted/NetscapePluginHostProxy.mm:
3502         Add a map from ports to plug-in proxies. Turn the set of instances into a map from
3503         pluginID to instance proxy.
3504         
3505         (WKPCStatusText):
3506         Look up the right instance proxy and call status().
3507         
3508         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
3509         (WebKit::NetscapePluginInstanceProxy::pluginID):
3510         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
3511         (WebKit::NetscapePluginInstanceProxy::status):
3512         Implement this.
3513         
3514         * Plugins/Hosted/WebKitPluginClient.defs:
3515         Add the plug-in ID to StatusText.
3516
3517 2008-12-02  Gregory Hughes  <ghughes@apple.com>
3518
3519         Reviewed by Beth Dakin.
3520
3521         Bug 22513: ZOOM: text selection does not send correct zoom bounds
3522
3523         When zoomed, text selection must send the zoom bounds in flipped
3524         screen coordinates.
3525
3526         * WebCoreSupport/WebViewFactory.mm:
3527         (-[WebViewFactory accessibilityConvertScreenRect:]):
3528
3529 2008-12-02  Anders Carlsson  <andersca@apple.com>
3530
3531         Reviewed by Dan Bernstein.
3532
3533         Create a client mach port and pass it to the plug-in host.
3534         
3535         * Plugins/Hosted/NetscapePluginHostManager.h:
3536         * Plugins/Hosted/NetscapePluginHostManager.mm:
3537         (WebKit::NetscapePluginHostManager::hostForPackage):
3538         (WebKit::NetscapePluginHostManager::spawnPluginHost):
3539         * Plugins/Hosted/NetscapePluginHostProxy.h:
3540         * Plugins/Hosted/NetscapePluginHostProxy.mm:
3541         (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
3542         * Plugins/Hosted/WebKitPluginHost.defs:
3543
3544 2008-12-02  Anders Carlsson  <andersca@apple.com>
3545
3546         Reviewed by Sam Weinig.
3547
3548         Let the plug-in views know if the plug-in host crashes.
3549         
3550         * Plugins/Hosted/NetscapePluginHostManager.h:
3551         * Plugins/Hosted/NetscapePluginHostManager.mm:
3552         (WebKit::NetscapePluginHostManager::instantiatePlugin):
3553         * Plugins/Hosted/NetscapePluginHostProxy.h:
3554         * Plugins/Hosted/NetscapePluginHostProxy.mm:
3555         (WebKit::NetscapePluginHostProxy::pluginHostDied):
3556         (WebKit::NetscapePluginHostProxy::addPluginInstance):
3557         (WebKit::NetscapePluginHostProxy::removePluginInstance):
3558         
3559         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
3560         (WebKit::NetscapePluginInstanceProxy::create):
3561         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
3562         Keep a pointer to the host proxy.
3563         
3564         (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
3565         Add the instance to the host set.
3566         
3567         (WebKit::NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy):
3568         Remove the instance form the host set.
3569         
3570         (WebKit::NetscapePluginInstanceProxy::pluginHostDied):
3571         Tell the plug-in view that the plug-in died.
3572
3573         * Plugins/Hosted/WebHostedNetscapePluginView.h:
3574         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
3575         (-[WebHostedNetscapePluginView createPlugin]):
3576         Pass the plug-in view to the instantiatePlugin.
3577         
3578         (-[WebHostedNetscapePluginView pluginHostDied]):
3579         Handle the plug-in host crashing.
3580         
3581         (-[WebHostedNetscapePluginView drawRect:]):
3582         Fill the plug-in view with a nice red shade if the plug-in crashes.
3583
3584 2008-12-01  Anders Carlsson  <andersca@apple.com>
3585
3586         Reviewed by Dan Bernstein.
3587
3588         Recover if the plug-in host dies and we try to instantiate another plugin before we get the port death notification
3589         
3590         * Plugins/Hosted/NetscapePluginHostManager.h:
3591         * Plugins/Hosted/NetscapePluginHostManager.mm:
3592         (WebKit::NetscapePluginHostManager::pluginHostDied):
3593         Remove the plug-in host from the map.
3594         
3595         (WebKit::NetscapePluginHostManager::instantiatePlugin):
3596         NetscapePluginHostProxy is no longer refcounted.
3597
3598         * Plugins/Hosted/NetscapePluginHostProxy.h:
3599         This is no longer refcounted. Add a set of plug-in instances (unused for now).
3600         
3601         * Plugins/Hosted/NetscapePluginHostProxy.mm:
3602         (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
3603         Create a death notification port.
3604         
3605         (WebKit::NetscapePluginHostProxy::pluginHostDied):
3606         Tell the manager that we're gone and delete ourselves.
3607         
3608         (WebKit::NetscapePluginHostProxy::deathPortCallback):
3609         New CFMachPort callback.
3610
3611 2008-12-01  Anders Carlsson  <andersca@apple.com>
3612
3613         Reviewed by Dan Bernstein.
3614
3615         Move instantiatePlugin to NetscapePluginHostManager.
3616         
3617         * Plugins/Hosted/NetscapePluginHostManager.h:
3618         * Plugins/Hosted/NetscapePluginHostManager.mm:
3619         (WebKit::NetscapePluginHostManager::instantiatePlugin):
3620         * Plugins/Hosted/NetscapePluginHostProxy.h:
3621         * Plugins/Hosted/NetscapePluginHostProxy.mm:
3622         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
3623         (-[WebHostedNetscapePluginView createPlugin]):
3624
3625 2008-12-01  Anders Carlsson  <andersca@apple.com>
3626
3627         Reviewed by Dan Bernstein.
3628
3629         Pass the plug-in host port directly to the instance proxy.
3630         
3631         * Plugins/Hosted/NetscapePluginHostProxy.mm:
3632         (WebKit::NetscapePluginHostProxy::instantiatePlugin):
3633         * Plugins/Hosted/NetscapePluginInstanceProxy.h:
3634         (WebKit::NetscapePluginInstanceProxy::create):
3635         * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
3636         (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
3637         (WebKit::NetscapePluginInstanceProxy::resize):
3638         (WebKit::NetscapePluginInstanceProxy::destroy):
3639         (WebKit::NetscapePluginInstanceProxy::focusChanged):
3640         (WebKit::NetscapePluginInstanceProxy::windowFocusChanged):
3641         (WebKit::NetscapePluginInstanceProxy::windowFrameChanged):
3642         (WebKit::NetscapePluginInstanceProxy::startTimers):
3643         (WebKit::NetscapePluginInstanceProxy::mouseEvent):
3644         (WebKit::NetscapePluginInstanceProxy::stopTimers):
3645
3646 2008-12-01  Anders Carlsson  <andersca@apple.com>
3647
3648         Try to fix the Tiger build.
3649
3650         * Plugins/WebNetscapePluginView.mm:
3651
3652 2008-12-01  Anders Carlsson  <andersca@apple.com>
3653
3654         Rename _layer to _pluginLayer where I forgot to do so.
3655         
3656         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
3657         (-[WebHostedNetscapePluginView destroyPlugin]):
3658         * Plugins/WebNetscapePluginView.h:
3659         * Plugins/WebNetscapePluginView.mm:
3660         (-[WebNetscapePluginView createPlugin]):
3661         (-[WebNetscapePluginView setLayer:]):
3662         (-[WebNetscapePluginView destroyPlugin]):
3663
3664 2008-12-01  Anders Carlsson  <andersca@apple.com>
3665
3666         Reviewed by Adam Roben.
3667
3668         Make sure to re-insert layers as needed so they won't be lost when the layer backed
3669         view is removed from the view hierarchy.
3670
3671         * Plugins/Hosted/WebHostedNetscapePluginView.h:
3672         Add _pluginLayer ivar.
3673         
3674         * Plugins/Hosted/WebHostedNetscapePluginView.mm:
3675         (-[WebHostedNetscapePluginView createPlugin]):
3676         Don't add the layer here.
3677         
3678         (-[WebHostedNetscapePluginView setLayer:]):
3679         Instead, add it here.
3680         
3681         (-[WebHostedNetscapePluginView destroyPlugin]):
3682         Set _pluginLayer to 0.
3683         
3684         * Plugins/WebNetscapePluginView.mm:        
3685         (-[WebNetscapePluginView createPlugin]):
3686         Don't add the layer here.
3687         
3688         (-[WebNetscapePluginView setLayer:]):
3689         Do it here.
3690
3691 2008-11-30  Antti Koivisto  <antti@apple.com>
3692
3693         Reviewed by Mark Rowe.
3694         
3695         https://bugs.webkit.org/show_bug.cgi?id=22557
3696         
3697         Report free size in central and thread caches too.
3698
3699         * Misc/WebCoreStatistics.mm:
3700         (+[WebCoreStatistics memoryStatistics]):
3701
3702 2008-11-29  Antti Koivisto  <antti@apple.com>
3703
3704         Reviewed by Dan Bernstein.
3705
3706         https://bugs.webkit.org/show_bug.cgi?id=22557
3707         Add statistics for JavaScript GC heap.
3708
3709         * Misc/WebCoreStatistics.mm:
3710         (+[WebCoreStatistics javaScriptObjectsCount]):
3711         (+[WebCoreStatistics memoryStatistics]):
3712
3713 2008-11-29  Antti Koivisto  <antti@apple.com>
3714
3715         Reviewed by Alexey Proskuryakov.
3716         
3717         https://bugs.webkit.org/show_bug.cgi?id=22557
3718         
3719         - Add purgeable memory statistics to cache statistics.
3720         - Add method for getting fastMalloc statistics.
3721         - Add method to force returning free memory back to system.
3722
3723         * Misc/WebCache.mm:
3724         (+[WebCache statistics]):
3725         * Misc/WebCoreStatistics.h:
3726         * Misc/WebCoreStatistics.mm:
3727         (+[WebCoreStatistics stopIgnoringWebCoreNodeLeaks]):
3728         (+[WebCoreStatistics memoryStatistics]):
3729         (+[WebCoreStatistics returnFreeMemoryToSystem]):
3730
3731 2008-11-26  Mark Rowe  <mrowe@apple.com>
3732
3733         Fix the Tiger build.
3734
3735         mig.h does not always define __MigTypeCheck on Tiger, which leads to problems when the generated
3736         code is built with -Wundef.
3737
3738         * Plugins/Hosted/WebKitPluginHostTypes.h:
3739
3740 2008-11-26  Anders Carlsson  <andersca@apple.com>
3741
3742         Fix build.
3743
3744         * Configurations/Base.xcconfig:
3745
3746 2008-11-26  Anders Carlsson  <andersca@apple.com>
3747
3748         Reviewed by Mark Rowe.
3749
3750         Move WebHostedNetscapePluginView.{h|mm} to Plugins/Hosted.
3751         
3752         (-[WebHostedNetscapePluginView handleMouseMoved:]):
3753         (-[WebHostedNetscapePluginView setAttributeKeys:andValues:]):
3754         Fix a leak.
3755         
3756         (-[WebHostedNetscapePluginView createPlugin]):
3757         Instantiate the plug-in, store the plug-in proxy in the _proxy ivar.
3758         
3759         (-[WebHostedNetscapePluginView loadStream]):
3760         (-[WebHostedNetscapePluginView shouldStop]):
3761         Add stubs for these.
3762         
3763         (-[WebHostedNetscapePluginView updateAndSetWindow]):
3764         (-[WebHostedNetscapePluginView windowFocusChanged:]):
3765         (-[WebHostedNetscapePluginView destroyPlugin]):
3766         (-[WebHostedNetscapePluginView startTimers]):
3767         (-[WebHostedNetscapePluginView stopTimers]):
3768         (-[WebHostedNetscapePluginView focusChanged]):
3769         (-[WebHostedNetscapePluginView windowFrameDidChange:]):
3770         (-[WebHostedNetscapePluginView mouseDown:]):
3771         (-[WebHostedNetscapePluginView mouseUp:]):
3772         (-[WebHostedNetscapePluginView mouseDragged:]):
3773         (-[WebHostedNetscapePluginView mouseEntered:]):
3774         (-[WebHostedNetscapePluginView mouseExited:]):
3775         Call the proxy.
3776         
3777         (-[WebHostedNetscapePluginView addWindowObservers]):
3778         (-[WebHostedNetscapePluginView removeWindowObservers]):
3779         Add/remove observers for when the window frame changes.
3780         
3781         * Plugins/WebHostedNetscapePluginView.h: Removed.
3782         * Plugins/WebHostedNetscapePluginView.mm: Removed.
3783
3784 2008-11-26  Anders Carlsson  <andersca@apple.com>
3785
3786         Reviewed by Mark Rowe.
3787
3788         Add the plug-in host proxy and plug-in instance proxy objects.
3789
3790         These are just simple objects that forward their calls to the plug-in host.
3791         
3792         * Plugins/Hosted/NetscapePluginHostProxy.h: Added.
3793         (WebKit::NetscapePluginHostProxy::create):
3794         (WebKit::NetscapePluginHostProxy::port):
3795         * Plugins/Hosted/NetscapePluginHostProxy.mm: Added.
3796         (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
3797         (WebKit::NetscapePluginHostProxy::instantiatePlugin):
3798         * Plugins/Hosted/NetscapePluginInstanceProxy.h: Added.
3799         (WebKit::NetscapePluginInstanceProxy::create):
3800         (WebKit::NetscapePluginInstanceProxy::renderContextID):
3801         (WebKit::NetscapePluginInstanceProxy::useSoftwareRenderer):
3802         * Plugins/Hosted/NetscapePluginInstanceProxy.mm: Added.
3803         (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
3804         (WebKit::NetscapePluginInstanceProxy::resize):
3805         (WebKit::NetscapePluginInstanceProxy::destroy):
3806         (WebKit::NetscapePluginInstanceProxy::focusChanged):
3807         (WebKit::NetscapePluginInstanceProxy::windowFocusChanged):
3808         (WebKit::NetscapePluginInstanceProxy::windowFrameChanged):
3809         (WebKit::NetscapePluginInstanceProxy::startTimers):
3810         (WebKit::NetscapePluginInstanceProxy::mouseEvent):
3811         (WebKit::NetscapePluginInstanceProxy::stopTimers):
3812
3813 2008-11-26  Anders Carlsson  <andersca@apple.com>
3814
3815         Reviewed by Dan Bernstein, Mark Rowe and Kevin Decker.
3816
3817         Add the plug-in host manager singleton.
3818         
3819         * Plugins/Hosted/NetscapePluginHostManager.h: Added.
3820         * Plugins/Hosted/NetscapePluginHostManager.mm: Added.
3821         
3822         (WebKit::NetscapePluginHostManager::hostForPackage):
3823         If there's an existing host proxy available, just return it. Otherwise spawn a new plug-in host and
3824         create a new plug-in host proxy from the new plug-in host port.
3825         
3826         (WebKit::NetscapePluginHostManager::spawnPluginHost):
3827         Pass the plug-in host path and the preferred CPU type to the plug-in agent. When the plug-in host has
3828         finished launching, pass it the path to the plug-in bundle.
3829         
3830         (WebKit::NetscapePluginHostManager::initializeVendorPort):
3831         Check in with the plug-in agent and get the new plug-in vendor port back.
3832
3833 2008-11-26  Anders Carlsson  <andersca@apple.com>
3834
3835         Reviewed by Mark Rowe.
3836
3837         * Plugins/Hosted/WebKitPluginHostTypes.h:
3838         Add copyright headers and fix the spacing around the *'s.
3839
3840 2008-11-26  Anders Carlsson  <andersca@apple.com>
3841
3842         Reviewed by Dan Bernstein.
3843         
3844         * Plugins/Hosted/WebKitPluginHost.defs:
3845         Add copyright headers.
3846         
3847         * Plugins/Hosted/WebKitPluginHostTypes.h: Added.
3848         Forgot to add this.
3849
3850 2008-11-26  Anders Carlsson  <andersca@apple.com>
3851
3852         Reviewed by Dan Bernstein.
3853
3854         Add plug-in host .defs.
3855
3856         * Plugins/Hosted/WebKitPluginAgent.defs: Added.
3857         * Plugins/Hosted/WebKitPluginAgentReply.defs: Added.
3858         * Plugins/Hosted/WebKitPluginClient.defs: Added.
3859         * Plugins/Hosted/WebKitPluginHost.defs: Added.
3860         * Plugins/Hosted/WebKitPluginHostTypes.defs: Added.
3861
3862 2008-11-26  Anders Carlsson  <andersca@apple.com>
3863
3864         Reviewed by Mark Rowe and Kevin Decker.
3865
3866         Minor plug-in changes.
3867         
3868         * Plugins/WebBaseNetscapePluginView.h:
3869         Add add/remove observer method declarations.
3870         
3871         * Plugins/WebBaseNetscapePluginView.mm:
3872         (-[WebBaseNetscapePluginView isFlipped]):
3873         Move this down from WebNetscapePluginView.
3874         
3875         * Plugins/WebNetscapePluginPackage.h:
3876         * Plugins/WebNetscapePluginPackage.m:
3877         (-[WebNetscapePluginPackage pluginHostArchitecture]):
3878         Getter for the plug-in host architecture.
3879         
3880         * Plugins/WebNetscapePluginView.mm:
3881
3882 2008-11-25  Dan Bernstein  <mitz@apple.com>
3883
3884         Reviewed by Mark Rowe.
3885
3886         - include the text direction submenu in context menus when appropriate
3887
3888         * WebView/WebPreferences.mm:
3889         (+[WebPreferences initialize]): Changed the default
3890         textDirectionSubmenuInclusionBehavior to "automatically", which includes
3891         the menu when the selection is confined to a single paragraph the either
3892         has right-to-left base writing direction or contains right-to-left or
3893         embedded text. Left the default for Tiger and Leopard to be "never".
3894
3895 2008-11-24  Darin Fisher  <darin@chromium.org>
3896
3897         Fix bustage.
3898
3899         * History/WebHistory.mm:
3900
3901 2008-11-24  Glenn Wilson  <gwilson@chromium.org>
3902
3903         Reviewed by Alexey Proskuryakov.
3904
3905         http://bugs.webkit.org/show_bug.cgi?id=15643
3906
3907         Added API support for the "trailing whitespace" work-around.  This includes an APIs
3908         to get and set the state of this configuration variable.
3909
3910         * WebCoreSupport/WebEditorClient.h:
3911         * WebCoreSupport/WebEditorClient.mm:
3912         (WebEditorClient::selectTrailingWhitespaceEnabled):
3913         * WebView/WebView.mm:
3914         (-[WebView setSelectTrailingWhitespaceEnabled:]):
3915         (-[WebView isSelectTrailingWhitespaceEnabled]):
3916         (-[WebView setSmartInsertDeleteEnabled:]):
3917         * WebView/WebViewPrivate.h:
3918
3919 2008-11-24  Darin Adler  <darin@apple.com>
3920
3921         Reviewed by Dan Bernstein.
3922
3923         - https://bugs.webkit.org/show_bug.cgi?id=22470
3924           remove unneeded URL argument from FrameLoaderClient::updateGlobalHistory
3925
3926         * WebCoreSupport/WebFrameLoaderClient.h: Remove argument.
3927         * WebCoreSupport/WebFrameLoaderClient.mm:
3928         (WebFrameLoaderClient::updateGlobalHistory): Get the URL from the
3929         DocumentLoader, just as we do the title and the failure flag.
3930
3931 2008-11-24  Darin Adler  <darin@apple.com>
3932
3933         Reviewed by Dan Bernstein.
3934
3935         - finish https://bugs.webkit.org/show_bug.cgi?id=22295
3936           track which history items are from page load failures
3937
3938         Last time around I did this only for the back/forward list and missed the
3939         global history list.
3940
3941         * History/WebHistory.mm:
3942         (-[WebHistory _visitedURL:withTitle:wasFailure:]): Added wasFailure argument.
3943         Set the flag on the newly created history item. Also eliminated the use of
3944         autorelease on the added-items array.
3945         * History/WebHistoryInternal.h: Ditto.
3946
3947         * WebCoreSupport/WebFrameLoaderClient.mm:
3948         (WebFrameLoaderClient::updateGlobalHistory): Added code to check for failure
3949         and pass the argument in to WebHistory. Given that this function gets other
3950         data from the DocumentLoader, I think we should get rid of the KURL argument,
3951         but that's a separate issue so I don't do it in this patch.
3952
3953 2008-11-24  Simon Fraser  <simon.fraser@apple.com>
3954
3955         Fix call to Frame::selectionBounds in Tiger build.
3956         
3957         * WebView/WebHTMLView.mm:
3958         (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
3959
3960 2008-11-24  Simon Fraser  <simon.fraser@apple.com>
3961
3962         Reviewed by Dan Bernstein
3963
3964         Via: https://bugs.webkit.org/show_bug.cgi?id=22433
3965         
3966         Rename RenderView::selectionRect() to selectionBounds(), to remove
3967         longstanding ambiguity with the base class selectionRect() method.
3968         Do the same on Frame for consistency with RenderView.
3969
3970         * WebView/WebHTMLView.mm:
3971         (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
3972         (-[WebHTMLView selectionRect]):
3973         (-[WebHTMLView selectionImageRect]):
3974
3975 2008-11-20  Pierre-Olivier Latour  <pol@apple.com>
3976
3977         Reviewed by Dan Bernstein.
3978
3979         WebKit should be using Device RGB colorspace everywhere for
3980         consistency.
3981
3982         https://bugs.webkit.org/show_bug.cgi?id=22300
3983
3984         * WebView/WebHTMLView.mm:
3985         (-[WebHTMLView _dragImageForURL:withLabel:]):
3986         (-[WebHTMLView _colorAsString:]):
3987
3988 2008-11-20  Darin Adler  <darin@apple.com>
3989
3990         Earlier version reviewed by Justin Garcia.
3991
3992         - part of fix for <rdar://problem/4108572> REGRESSION: Can't extend selection with shift-arrow in read only mode
3993           Also resolves <rdar://problem/5000134>.
3994
3995         * WebView/WebHTMLView.mm: Removed some unused code, and made the Tiger workaround for bug 3789278
3996         be Tiger-only.
3997         (-[WebHTMLView resignFirstResponder]): Removed code setting unused resigningFirstResponder flag.
3998         (-[WebHTMLView _wantsKeyDownForEvent:]): Added. Returns YES.
3999         (-[WebHTMLView insertText:]): Don't try to insert text if the selection is not editable. We used
4000         to prevent even processing the input, but that's not practical since some commands need to work
4001         even in non-editable regions.
4002
4003 2008-11-20  Anders Carlsson  <andersca@apple.com>
4004
4005         Reviewed by Jon Honeycutt.
4006
4007         Move some frame/page checking code down to the base class.
4008         
4009         * Plugins/WebBaseNetscapePluginView.mm:
4010         (-[WebBaseNetscapePluginView start]):
4011         * Plugins/WebNetscapePluginView.mm:
4012         (-[WebNetscapePluginView _createPlugin]):
4013
4014 2008-11-19  Anders Carlsson  <andersca@apple.com>
4015
4016         Reviewed by Dan Bernstein.
4017
4018         Test: plugins/netscape-plugin-setwindow-size-2.html
4019         
4020         Fix bug where NPP_SetWindow wasn't getting called for some plug-ins.
4021         
4022         * Plugins/WebNetscapePluginView.mm:
4023         (-[WebNetscapePluginView updateAndSetWindow]):
4024         Don't bail if the drawing model is not the CA drawing model. Remove some code 
4025         that was doing the wrong thing.
4026
4027 2008-11-19  Darin Fisher  <darin@chromium.org>
4028
4029         Reviewed by Geoff Garen.
4030
4031         https://bugs.webkit.org/show_bug.cgi?id=22345
4032         Define ScriptValue as a thin container for a JSC::Value*.
4033
4034         * WebView/WebFrame.mm:
4035         (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
4036         * WebView/WebView.mm:
4037         (-[WebView aeDescByEvaluatingJavaScriptFromString:]):
4038
4039 2008-11-19  Anders Carlsson  <andersca@apple.com>
4040
4041         Reviewed by Sam Weinig.
4042
4043         <rdar://problem/6383762> WebKit r38340 crash on key press in plugin
4044         
4045         Set the value to 0 before calling NPP_GetValue, in case the plug-in returns NPERR_NO_ERROR but does not 
4046         update the value.
4047         
4048         * Plugins/WebNetscapePluginView.mm:
4049         (-[WebNetscapePluginView createPlugin]):
4050
4051 2008-11-19  Anders Carlsson  <andersca@apple.com>
4052
4053         Reviewed by Sam Weinig.
4054
4055         Make sure to copy the MIME type.
4056         
4057         * Plugins/WebBaseNetscapePluginView.mm:
4058         (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]):
4059
4060 2008-11-19  Geoffrey Garen  <ggaren@apple.com>
4061
4062         Reviewed by Darin Adler.
4063         
4064         First step toward fixing <rdar://problem/6263293> WebScriptDebugDelegate
4065         should use intptr_t for sourceId, not int
4066         
4067         Added a conditional typedef (currently disabled) to switch sourceId to
4068         intptr_t in non-Tiger, non-Leopard builds.
4069
4070         * DefaultDelegates/WebDefaultScriptDebugDelegate.m:
4071         (-[WebDefaultScriptDebugDelegate webView:didParseSource:fromURL:sourceId:forWebFrame:]):
4072         (-[WebDefaultScriptDebugDelegate webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:]):
4073         (-[WebDefaultScriptDebugDelegate webView:didEnterCallFrame:sourceId:line:forWebFrame:]):
4074         (-[WebDefaultScriptDebugDelegate webView:willExecuteStatement:sourceId:line:forWebFrame:]):
4075         (-[WebDefaultScriptDebugDelegate webView:willLeaveCallFrame:sourceId:line:forWebFrame:]):
4076         (-[WebDefaultScriptDebugDelegate webView:exceptionWasRaised:sourceId:line:forWebFrame:]):
4077         * WebView/WebScriptDebugDelegate.h:
4078         * WebView/WebScriptDebugger.mm:
4079         (WebScriptDebugger::sourceParsed):
4080         (WebScriptDebugger::callEvent):
4081         (WebScriptDebugger::atStatement):
4082         (WebScriptDebugger::returnEvent):
4083         (WebScriptDebugger::exception):
4084
4085 2008-11-18  Dan Bernstein  <mitz@apple.com>
4086
4087         Reviewed by Mark Rowe.
4088
4089         - fix https://bugs.webkit.org/show_bug.cgi?id=22331
4090           <rdar://problem/6381657> REGRESSION: Contextual menu no longer has an "Inspect Element" item
4091
4092         * WebView/WebUIDelegatePrivate.h: Reorder new enum values after existing
4093         ones.
4094
4095 2008-11-17  Beth Dakin  <bdakin@apple.com>
4096
4097         Reviewed by Adele Peterson.
4098
4099         Fix for <rdar://problem/6373102> REGRESSION (r36919): In a new mail 
4100         message, the caret appears in message body by default
4101
4102         This fixes a regression caused by http://trac.webkit.org/changeset/36919. 
4103         That change was too sweeping; we do not want to 
4104         unconditionally set the page to be active, but we can be looser 
4105         than the original constraints. This patch set the window active if 
4106         the first responder is or is a descendant of the main frame's frame 
4107         view.
4108
4109         * WebView/WebView.mm:
4110         (-[WebView _updateFocusedAndActiveStateForFrame:]):
4111
4112 2008-11-18  Alexey Proskuryakov  <ap@webkit.org>
4113
4114         Reviewed by Darin Adler.
4115
4116         https://bugs.webkit.org/show_bug.cgi?id=22337
4117         Enable workers by default
4118
4119         * Configurations/WebKit.xcconfig: Define ENABLE_WORKERS (change from ENABLE_WORKER_THREADS,
4120         which was accidentally committed before).
4121
4122 2008-11-17  Geoffrey Garen  <ggaren@apple.com>
4123
4124         Not reviewed.
4125         
4126         Try to fix Mac build.
4127
4128         * WebView/WebScriptDebugDelegate.mm:
4129
4130 2008-11-17  Pierre-Olivier Latour  <pol@apple.com>
4131
4132         Reviewed by Sam Weinig.
4133
4134         Added SPI to allow pausing a running CSS transition or animation
4135         at a given time for testing purposes.
4136
4137         https://bugs.webkit.org/show_bug.cgi?id=21261
4138
4139         * WebView/WebFrame.mm:
4140         (-[WebFrame _pauseAnimation:onNode:atTime:]):
4141         (-[WebFrame _pauseTransitionOfProperty:onNode:atTime:]):
4142         * WebView/WebFramePrivate.h:
4143
4144 2008-11-17  Geoffrey Garen  <ggaren@apple.com>
4145
4146         Reviewed by Sam Weinig.
4147
4148         Updated for JavaScriptCore renames.
4149
4150         * ForwardingHeaders/runtime/Completion.h: Copied from ForwardingHeaders/runtime/Interpreter.h.
4151         * ForwardingHeaders/runtime/Interpreter.h: Removed.
4152         * WebView/WebScriptDebugDelegate.mm:
4153
4154 2008-11-16  Greg Bolsinga  <bolsinga@apple.com>
4155
4156         Reviewed by Darin Adler.
4157
4158         https://bugs.webkit.org/show_bug.cgi?id=21810
4159         Remove use of static C++ objects that are destroyed at exit time (destructors)
4160
4161         Use DEFINE_STATIC_LOCAL for static RetainPtr<T>
4162
4163         * Misc/WebNSPasteboardExtras.mm: Use DEFINE_STATIC_LOCAL
4164         (+[NSPasteboard _web_writableTypesForURL]):
4165         (_createWritableTypesForImageWithoutArchive): Created so accessor has one line initialization
4166         (_writableTypesForImageWithoutArchive): Use create function for one line initialization
4167         (_createWritableTypesForImageWithArchive): Created so accessor has one line initialization
4168         (_writableTypesForImageWithArchive): Use create function for one line initialization
4169         * WebCoreSupport/WebPasteboardHelper.mm: Use DEFINE_STATIC_LOCAL
4170         (WebPasteboardHelper::insertablePasteboardTypes):
4171         * WebView/WebHTMLRepresentation.mm: Use DEFINE_STATIC_LOCAL
4172         (+[WebHTMLRepresentation supportedMIMETypes]):
4173         (+[WebHTMLRepresentation supportedNonImageMIMETypes]):
4174         (+[WebHTMLRepresentation supportedImageMIMETypes]):
4175
4176 2008-11-16  Darin Adler  <darin@apple.com>
4177
4178         Reviewed by Dan Bernstein.
4179
4180         - https://bugs.webkit.org/show_bug.cgi?id=22295
4181           track which history items are from page load failures
4182
4183         * History/WebHistoryItem.mm: Added lastVisitWasFailureKey.
4184         (-[WebHistoryItem initFromDictionaryRepresentation:]): Set the lastVisitWasFailure
4185         flag in the history item if the dictionary had lastVisitWasFailureKey true.
4186         (-[WebHistoryItem dictionaryRepresentation]): Set the lastVisitWasFailureKey boolean
4187         in the dictionary if the history item had the lastVisitWasFailure flag.
4188         (-[WebHistoryItem lastVisitWasFailure]): Added.
4189
4190         * History/WebHistoryItemInternal.h: Moved include of WebBackForwardList here from
4191         WebHistoryItemPrivate.h; removed other unneeded includes.
4192
4193         * History/WebHistoryItemPrivate.h: Added lastVisitWasFailure method.
4194         Removed unneeded includes.
4195
4196         * Misc/WebNSDictionaryExtras.h: Added _webkit_boolForKey.
4197         * Misc/WebNSDictionaryExtras.m:
4198         (-[NSDictionary _webkit_boolForKey:]): Added.
4199
4200 2008-11-14  Greg Bolsinga  <bolsinga@apple.com>
4201
4202         Reviewed by Darin Adler.
4203         
4204         https://bugs.webkit.org/show_bug.cgi?id=21810
4205         Remove use of static C++ objects that are destroyed at exit time (destructors)
4206
4207         Create DEFINE_STATIC_LOCAL macro. Change static local objects to leak to avoid 
4208         exit-time destructor. Update code that was changed to fix this issue that ran 
4209         into a gcc bug (<rdar://problem/6354696> Codegen issue with C++ static reference 
4210         in gcc build 5465). Also typdefs for template types needed to be added in some 
4211         cases so the type could make it through the macro successfully.
4212
4213         Basically code of the form:
4214         static T m;
4215         becomes:
4216         DEFINE_STATIC_LOCAL(T, m, ());
4217
4218         Also any code of the form:
4219         static T& m = *new T;
4220         also becomes:
4221         DEFINE_STATIC_LOCAL(T, m, ());
4222
4223         * ForwardingHeaders/wtf/StdLibExtras.h: Added.
4224         * History/WebBackForwardList.mm:
4225         (backForwardLists):
4226         * History/WebHistoryItem.mm:
4227         (historyItemWrappers):
4228         * Misc/WebStringTruncator.m:
4229         (fontFromNSFont):
4230         * Plugins/WebBaseNetscapePluginStream.mm:
4231         (streams):
4232         * WebView/WebView.mm:
4233         (aeDescFromJSValue):
4234
4235 2008-11-14  Dan Bernstein  <mitz@apple.com>
4236
4237         Reviewed by Darin Adler.
4238
4239         - <rdar://problem/6234333> Implement action methods for setting and clearing character-level directionality
4240         - part of <rdar://problem/6234337> Add a Text Direction menu to the default context menu when appropriate
4241
4242         * WebCoreSupport/WebViewFactory.mm:
4243         (-[WebViewFactory contextMenuItemTagTextDirectionMenu]): Added.
4244         *&nbs