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