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