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