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