Crash in WebProcess at com.apple.WebCore: WebCore::Page::goToItem + 46
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2011-02-20  Sam Weinig  <sam@webkit.org>
2
3         Reviewed by Dan Bernstein.
4
5         Crash in WebProcess at com.apple.WebCore: WebCore::Page::goToItem + 46
6         <rdar://problem/8942726>
7
8         * WebProcess/WebPage/WebPage.cpp:
9         (WebKit::WebPage::goForward):
10         (WebKit::WebPage::goBack):
11         (WebKit::WebPage::goToBackForwardItem):
12         Defend agains null HistoryItems.
13
14 2011-02-20  Anders Carlsson  <andersca@apple.com>
15
16         Reviewed by Maciej Stachowiak.
17
18         Crash when a plug-in requests a javascript: url that destroys the plug-in
19         https://bugs.webkit.org/show_bug.cgi?id=54837
20         <rdar://problem/9005475>
21
22         * WebProcess/Plugins/PluginProxy.cpp:
23         (WebKit::PluginProxy::destroy):
24         Null out m_pluginController.
25
26         * WebProcess/Plugins/PluginView.cpp:
27         (WebKit::PluginView::performJavaScriptURLRequest):
28         Don't access the frame through m_pluginElement since it will be nulled out
29         when the plug-in is destroyed.
30
31 2011-02-20  Anders Carlsson  <andersca@apple.com>
32
33         Reviewed by Sam Weinig.
34
35         Fix another crash when a plug-in is destroyed when evaluating JavaScript
36         https://bugs.webkit.org/show_bug.cgi?id=54834
37         <rdar://problem/9013384>
38
39         This contains three separate fixes:
40
41         - In unprotectPluginFromDestruction we can't just destroy the plug-in once
42           the count reaches zero, because the plug-in might still have code executing
43           on the stack. To fix this we use a zero-delay timer to defer destruction
44           of the plug-in.
45
46         - Trying to get the NPObject for the window using NPN_GetValue would return
47           NPERR_NO_ERROR, even if the returned NPObject was null. Fix this to return
48           NPERR_GENERIC_ERROR instead.
49
50         - Protect the plug-in from destruction anytime an NPAPI call that sends a 
51           synchronous IPC message is made.
52
53         * PluginProcess/PluginControllerProxy.cpp:
54         (WebKit::PluginControllerProxy::PluginControllerProxy):
55         (WebKit::PluginControllerProxy::destroy):
56         (WebKit::PluginControllerProxy::unprotectPluginFromDestruction):
57         * PluginProcess/PluginControllerProxy.h:
58         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
59         (WebKit::PluginDestructionProtector::PluginDestructionProtector):
60         (WebKit::NPN_GetValue):
61         (WebKit::NPN_Evaluate):
62         (WebKit::NPN_GetProperty):
63         (WebKit::NPN_SetProperty):
64         (WebKit::NPN_RemoveProperty):
65         (WebKit::NPN_HasProperty):
66         (WebKit::NPN_HasMethod):
67         (WebKit::NPN_Enumerate):
68         (WebKit::NPN_Construct):
69         (WebKit::NPN_GetValueForURL):
70         (WebKit::NPN_SetValueForURL):
71
72 2011-02-19  Sam Weinig  <sam@webkit.org>
73
74         Reviewed by Anders Carlsson.
75
76         Add phase in addition to momentumPhase to platform wheel events
77         Part of <rdar://problem/8945362>
78
79         Rename existing phase to momentumPhase.
80
81         * Shared/WebEvent.h:
82         (WebKit::WebWheelEvent::momentumPhase):
83         * Shared/WebEventConversion.cpp:
84         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
85         * Shared/WebWheelEvent.cpp:
86         (WebKit::WebWheelEvent::WebWheelEvent):
87         (WebKit::WebWheelEvent::encode):
88         (WebKit::WebWheelEvent::decode):
89         * Shared/mac/WebEventFactory.mm:
90         (WebKit::phaseForEvent):
91         (WebKit::momentumPhaseForEvent):
92         (WebKit::WebEventFactory::createWebWheelEvent):
93
94 2011-02-19  Anders Carlsson  <andersca@apple.com>
95
96         Reviewed by Dan Bernstein.
97
98         Crash when trying to take a snapshot of an uninitialized plug-in
99         https://bugs.webkit.org/show_bug.cgi?id=54812
100
101         * WebProcess/Plugins/PluginView.cpp:
102         (WebKit::PluginView::notifyWidget):
103         Don't try to create a snapshot of the plug-in if it hasn't been initialized.
104
105 2011-02-18  Gavin Barraclough  <barraclough@apple.com>
106
107         Reviewed by Sam Weinig.
108
109         Bug 54786 - Devirtualize JSCell::classInfo()
110
111         Instead of making a virtual function call, add a pointer to the ClassInfo
112         onto Structure.
113
114         This removes a virtual function call, and paves the way towards removing all
115         the createStructure methods, and StructureFlags/AnonymousSlotCount properties
116         (these should be able to move onto ClassInfo).
117
118         Calls to Structure::create must now pass a pointer to the ClassInfo for the
119         structure. All objects now have a ClassInfo pointer, non-object cell types
120         still do not.
121
122         Changes are most mechanical, involving three steps:
123             * Remove virtual classInfo() methods.
124             * Add &s_info parameter to calls to Structure::create.
125             * Rename ClassInfo static members on classes from 'info' to 's_info',
126               for consistency.
127
128         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
129         (WebKit::JSNPMethod::JSNPMethod):
130         * WebProcess/Plugins/Netscape/JSNPMethod.h:
131         (WebKit::JSNPMethod::createStructure):
132         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
133         (WebKit::JSNPObject::JSNPObject):
134         * WebProcess/Plugins/Netscape/JSNPObject.h:
135         (WebKit::JSNPObject::createStructure):
136
137 2011-02-19  Sam Weinig  <sam@webkit.org>
138
139         Reviewed by Anders Carlsson.
140
141         Rename performLookupAtCurrentMouseLocation to performDictionaryLookupAtCurrentMouseLocation
142
143         * UIProcess/API/mac/WKView.mm:
144         (-[WKView performDictionaryLookupAtCurrentMouseLocation]):
145         * UIProcess/API/mac/WKViewPrivate.h:
146
147 2011-02-19  Charlie Reis  <creis@chromium.org>
148
149         Reviewed by Mihai Parparita.
150
151         Ensure loading has stopped in HistoryController::goToItem
152         https://bugs.webkit.org/show_bug.cgi?id=54517
153
154         Add a FrameLoaderClient callback for whether to stop loading before goToItem.
155
156         Test: http/tests/navigation/forward-to-fragment-fires-onload.html
157
158         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
159         (WebFrameLoaderClient::shouldStopLoadingForHistoryItem): Added.
160         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
161
162 2011-02-18  Sam Weinig  <sam@webkit.org>
163
164         Reviewed by Adele Peterson.
165
166         Real fix for <rdar://problem/9025723> CrashTracer: [USER] 
167         1 crash in WebProcess at com.apple.WebKit2: 
168         WebKit::WebPage::didChangeScrollOffsetForMainFrame + 31
169
170         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
171         (WebKit::WebFrameLoaderClient::didChangeScrollOffset):
172         Add null check for the FrameView. This function can be called when the
173         FrameView is being torn down during a transition to a new FrameView.
174
175         * WebProcess/WebPage/WebPage.cpp:
176         (WebKit::WebPage::didChangeScrollOffsetForMainFrame):
177         Revert last attempt.
178
179 2011-02-18  Anders Carlsson  <andersca@apple.com>
180
181         Reviewed by Sam Weinig.
182
183         Hang trying to load nytimes.com with Flash installed
184         <rdar://problem/9018113> 
185
186         * Platform/CoreIPC/Connection.cpp:
187         (CoreIPC::Connection::sendSyncMessage):
188         Call beginWaitForSyncReply() before sending the message. Otherwise, in some cases we could
189         have gotten back a synchronous request before calling beginWaitForSyncReply(), and then we wouldn't
190         process it correctly. (Which would lead to the hang).
191
192 2011-02-18  Simon Fraser  <simon.fraser@apple.com>
193
194         Reviewed by Kevin Decker.
195
196         <rdar://problem/9021296> Some plug-ins are the wrong size after zooming
197         
198         Use the same frame/bounds adjustment that we use for NSView-based
199         plugins in WebKit2, which allows plug-ins and their snapshots to
200         render with the correct size after scaling.
201
202         * WebProcess/Plugins/PluginView.cpp:
203         (WebKit::PluginView::setBoundsSize):
204         (WebKit::PluginView::viewGeometryDidChange):
205         (WebKit::PluginView::clipRectInWindowCoordinates):
206         * WebProcess/Plugins/PluginView.h:
207
208 2011-02-18  Beth Dakin  <bdakin@apple.com>
209
210         Rubber-stamped by Adele Peterson.
211
212         Fix for <rdar://problem/9025723> CrashTracer: [USER] 
213         1 crash in WebProcess at com.apple.WebKit2: 
214         WebKit::WebPage::didChangeScrollOffsetForMainFrame + 31
215
216         Simple null-check.
217         * WebProcess/WebPage/WebPage.cpp:
218         (WebKit::WebPage::didChangeScrollOffsetForMainFrame):
219
220 2011-02-18  Viatcheslav Ostapenko  <ostapenko.viatcheslav@nokia.com>
221
222         Reviewed by Kenneth Rohde Christiansen.
223
224         Tiled backing store area is too big.
225         Error in area calculcation causes size of backing store
226         up to 8 times bigger than viewport with default multipliers.
227         https://bugs.webkit.org/show_bug.cgi?id=54587
228
229         * UIProcess/TiledDrawingAreaProxy.cpp:
230         (WebKit::TiledDrawingAreaProxy::calculateKeepRect):
231         (WebKit::TiledDrawingAreaProxy::calculateCoverRect):
232
233 2011-02-18  John Sullivan  <sullivan@apple.com>
234
235         Reviewed by Maciej Stachowiak.
236
237         <rdar://problem/9026169>
238         https://bugs.webkit.org/show_bug.cgi?id=54780
239         pendingAPIRequestURL isn't updated for WKPageGoToBackForwardListItem
240
241         * UIProcess/WebPageProxy.cpp:
242         (WebKit::WebPageProxy::goToBackForwardItem):
243         Update the pending API URL.
244
245 2011-02-18  Anders Carlsson  <andersca@apple.com>
246
247         Reviewed by Sam Weinig.
248
249         Accelerated content fades in when using a layer backed WKView
250         <rdar://problem/9021586>
251
252         * UIProcess/API/mac/WKView.mm:
253         (-[WKView _enterAcceleratedCompositingMode:]):
254         Make a new nested CATransaction and disable animations when adding the layer 
255         hosting subview. This avoids an implicit fade animation that would otherwise occur.
256
257 2011-02-18  Simon Fraser  <simon.fraser@apple.com>
258
259         Reviewed by Dan Bernstein.
260
261         Plugin snapshot location is wrong for subframes
262         https://bugs.webkit.org/show_bug.cgi?id=54776
263         
264         Only change the CTM to the way that the plugin expects it
265         when painting the plugin, not when drawing the snapshot.
266         This fixes the snapshot location when painting flattened
267         frames.
268
269         * WebProcess/Plugins/PluginView.cpp:
270         (WebKit::PluginView::paint):
271
272 2011-02-18  Anders Carlsson  <andersca@apple.com>
273
274         Reviewed by Simon Fraser.
275
276         Implement NetscapePlugin::pluginComplexTextInputIdentifier
277         https://bugs.webkit.org/show_bug.cgi?id=54770
278
279         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
280         (WebKit::NetscapePlugin::pluginComplexTextInputIdentifier):
281
282 2011-02-18  Sam Weinig  <sam@webkit.org>
283
284         Reviewed by Maciej Stachowiak.
285
286         Add the ability to ask the WKPage if the main frame is pinned
287         to the right or left hand side.
288         Part of <rdar://problem/9017043>.
289
290         * UIProcess/API/C/WKPage.cpp:
291         (WKPageIsPinnedToLeftSide):
292         (WKPageIsPinnedToRightSide):
293         * UIProcess/API/C/WKPage.h:
294         Add new API calls.
295
296         * UIProcess/WebPageProxy.cpp:
297         (WebKit::WebPageProxy::WebPageProxy):
298         (WebKit::WebPageProxy::close):
299         (WebKit::WebPageProxy::processDidCrash):
300         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
301         * UIProcess/WebPageProxy.h:
302         (WebKit::WebPageProxy::isPinnedToLeftSide):
303         (WebKit::WebPageProxy::isPinnedToRightSide):
304         Initialize, reset and update the pinned state.
305
306         * UIProcess/WebPageProxy.messages.in:
307         Add message to update the pinned state.
308
309         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
310         (WebKit::WebFrameLoaderClient::didChangeScrollOffset):
311         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
312         * WebProcess/WebPage/WebPage.cpp:
313         (WebKit::WebPage::WebPage):
314         (WebKit::WebPage::didChangeScrollOffsetForMainFrame):
315         * WebProcess/WebPage/WebPage.h:
316         Cache the pinned state, and only update the UIProcess when it
317         changes.
318
319 2011-02-18  Anders Carlsson  <andersca@apple.com>
320
321         Reviewed by Simon Fraser.
322
323         Fix assertion in SharedMemory::create when trying to snapshot 0x0 plug-in
324         https://bugs.webkit.org/show_bug.cgi?id=54768
325
326         * PluginProcess/PluginControllerProxy.cpp:
327         (WebKit::PluginControllerProxy::snapshot):
328         Don't try to create a handle from a null ShareableBitmap.
329
330         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
331         (WebKit::NetscapePlugin::snapshot):
332         Check for a zero sized plug-in before trying to create a snapshot.
333
334 2011-02-18  Anders Carlsson  <andersca@apple.com>
335
336         Reviewed by Simon Fraser.
337
338         WKView flashes when entering/exiting compositing mode
339         https://bugs.webkit.org/show_bug.cgi?id=54695
340         <rdar://problem/9011554>
341
342         * UIProcess/API/mac/WKView.mm:
343         (-[WKView _exitAcceleratedCompositingMode]):
344         Remove the layer hosting view before clearing out its layer, otherwise we can get
345         white flashes when exiting accelerated compositing mode.
346
347         * WebProcess/WebPage/DrawingAreaImpl.cpp:
348         When entering accelerated compositing mode, we want to defer sending the message
349         until we've actually committed the layer tree and pushed all changes over to the
350         UI process.
351
352         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
353         Tell the layer tree host to force a repaint. This will ensure that all layer tree
354         changes are pushed over to the UI process. When that is done, send the new layer tree
355         context over to the UI process.
356
357         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
358         When exiting compositing mode in response to a didSetSize, we want to exit accelerated 
359         compositing mode right away to avoid flashes. This is safe since we've laid out the page
360         already so we won't end up reentering setRootCompositingLayer.
361
362         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
363         Tell the layer tree host to notify us when the next layer tree flush happened, so we can
364         let the UI process know. If we're entering accelerated compositing mode in response to a
365         SetSize message, the new layer tree context will be passed in the DidSetSize message.
366
367         * WebProcess/WebPage/DrawingAreaImpl.h:
368         Add layerHostDidFlushLayers.
369
370         * WebProcess/WebPage/LayerTreeHost.h:
371         Add setShouldNotifyAfterNextScheduledLayerFlush.
372
373         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
374         Add a m_notifyAfterScheduledLayerFlush flag.
375
376         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
377         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
378         Initialize m_notifyAfterScheduledLayerFlush to false.
379
380         (WebKit::LayerTreeHostMac::setShouldNotifyAfterNextScheduledLayerFlush):
381         Set m_notifyAfterScheduledLayerFlush to true.
382
383         (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback):
384         If m_notifyAfterScheduledLayerFlush is true, call DrawingAreaImpl::layerHostDidFlushLayers.
385
386 2011-02-18  Alexey Proskuryakov  <ap@apple.com>
387
388         Reviewed by Adele Peterson.
389
390         REGRESSION (WebKit2): Wrong frame printed on tivofaq.com
391         https://bugs.webkit.org/show_bug.cgi?id=54677
392         <rdar://problem/8994133>
393
394         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
395         (WebKit::area): Use visible frame bounds.
396         (WebKit::findLargestFrameInFrameSet): Added a comment explaining what we're up to here.
397         WebKit2 shouldn't be making policy decisions for the client, but it gets dangerously close
398         to that. We used to expose the same as WK1 API though.
399
400 2011-02-18  Balazs Kelemen  <kbalazs@webkit.org>
401
402         Unreviwed.
403
404         Remove CleanupHandler since we do not use it anymore.
405
406         * Shared/qt/CleanupHandler.cpp: Removed.
407         * Shared/qt/CleanupHandler.h: Removed.
408
409 2011-02-18  Alejandro G. Castro  <alex@igalia.com>
410
411         Fix GTK build by fixing signature of platformPaint(), required after r78956.
412
413         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
414         (WebKit::NetscapePlugin::platformPaint):
415
416 2011-02-17  Dan Bernstein  <mitz@apple.com>
417
418         LLVM Compiler build fix.
419
420         * UIProcess/WebResourceCacheManagerProxy.h:
421         * WebProcess/ResourceCache/WebResourceCacheManager.h:
422
423 2011-02-17  Simon Fraser  <simon.fraser@apple.com>
424
425         Fix Windows and Qt builds by fixing signature of platformPaint().
426
427         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
428         (WebKit::NetscapePlugin::platformPaint):
429         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
430         (WebKit::NetscapePlugin::platformPaint):
431
432 2011-02-17  Simon Fraser  <simon.fraser@apple.com>
433
434         Reviewed by Sam Weinig.
435
436         WebKit2 snapshots don't show plug-ins
437         https://bugs.webkit.org/show_bug.cgi?id=54716
438         
439         Fix WebKit2 plug-ins to do a software paint for
440         snapshotting.
441
442         * PluginProcess/PluginControllerProxy.h:
443         * PluginProcess/PluginControllerProxy.cpp:
444         (WebKit::PluginControllerProxy::snapshot): Respond to the snapshot
445         message by getting a sharable bitmap from the plugin, and returning
446         a handle to it in the reply.
447
448         * PluginProcess/PluginControllerProxy.messages.in: Add the snapshot
449         message.
450         
451         * Shared/Plugins/PluginQuirks.h:
452         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
453         (WebKit::NetscapePluginModule::determineQuirks): Add a quirk for the
454         ability to be snapshotted, which we only set for Flash at the moment.
455         
456         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
457         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
458         (WebKit::NetscapePlugin::snapshot): Create a shareable bitmap, and
459         paint into it.
460         (WebKit::NetscapePlugin::supportsSnapshotting): Test the quirk.
461
462         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
463         (WebKit::NetscapePlugin::platformPaint): Allow the paint to happen
464         if we're snapshotting, even when using the CoreAnimation drawing
465         model.
466         
467         * WebProcess/Plugins/Plugin.h: New snapshot method.
468         
469         * WebProcess/Plugins/PluginProxy.h:
470         * WebProcess/Plugins/PluginProxy.cpp:
471         (WebKit::PluginProxy::snapshot): Send a sync message to the plugin process,
472         asking for a snapshot in a shareble bitmap.
473         
474         * WebProcess/Plugins/PluginView.h:
475         * WebProcess/Plugins/PluginView.cpp:
476         (WebKit::PluginView::paint): Use the snapshot if we have one, to avoid
477         calling into the plugin to draw, which may run script.
478         
479         (WebKit::PluginView::notifyWidget): Generate the snapshot before
480         a flattening paint, and throw it away after.
481
482 2011-02-17  Jessie Berlin  <jberlin@apple.com>
483
484         Reviewed by Adam Roben.
485
486         WebKit2: The CFNetwork Cache should be shared between the UI Process and the Web Process on
487         Windows.
488         https://bugs.webkit.org/show_bug.cgi?id=54683
489
490         * Shared/WebProcessCreationParameters.cpp:
491         (WebKit::WebProcessCreationParameters::encode):
492         (WebKit::WebProcessCreationParameters::decode):
493         * Shared/WebProcessCreationParameters.h:
494  
495         * UIProcess/win/WebContextWin.cpp:
496         (WebKit::WebContext::platformInitializeWebProcess):
497         Make sure to remove the ending slash, as CFNetwork does not recognize the directory with
498         that slash.
499
500         * WebProcess/win/WebProcessWin.cpp:
501         (WebKit::WebProcess::platformInitializeWebProcess):
502         Create a cache using the path, disk capacity, and memory capacity and set it as default.
503
504 2011-02-17  Anders Carlsson  <andersca@apple.com>
505
506         Reviewed by Sam Weinig.
507
508         Web and/or plug-in process crashes when NPN_Evaluate destroys the plug-in
509         https://bugs.webkit.org/show_bug.cgi?id=54686
510         <rdar://problem/9013384>
511
512         This patch fixes two bugs with a plug-in calling NPN_Evaluate to destroy itself:
513
514         - The PluginProxy object would be destroyed in the middle of PluginProxy::evaluate.
515           This would cause the web process to crash.
516
517         - The PluginControllerProxy would call NPP_Destroy while the plug-in was busy running
518           code. This would cause the plug-in process to crash.
519
520         To fix this, we add protectPluginFromDestruction/unprotectPluginFromDestruction to
521         PluginControllerProxy and use it to defer calling destroy() in the plug-in process,
522         and defer actually destroying the plug-in in the web process.
523
524         https://bugs.webkit.org/show_bug.cgi?id=54171 tracks adding a test for this.
525
526         * PluginProcess/PluginControllerProxy.cpp:
527         (WebKit::PluginControllerProxy::PluginControllerProxy):
528         (WebKit::PluginControllerProxy::destroy):
529         (WebKit::PluginControllerProxy::evaluate):
530         (WebKit::PluginControllerProxy::protectPluginFromDestruction):
531         (WebKit::PluginControllerProxy::unprotectPluginFromDestruction):
532         * PluginProcess/PluginControllerProxy.h:
533         (WebKit::PluginControllerProxy::asPluginController):
534         * PluginProcess/WebProcessConnection.cpp:
535         (WebKit::WebProcessConnection::destroyPluginControllerProxy):
536         (WebKit::WebProcessConnection::didReceiveMessage):
537         (WebKit::WebProcessConnection::didReceiveSyncMessage):
538         * PluginProcess/WebProcessConnection.h:
539         (WebKit::WebProcessConnection::connection):
540         * WebProcess/Plugins/PluginController.h:
541         (WebKit::PluginController::PluginDestructionProtector::PluginDestructionProtector):
542         (WebKit::PluginController::PluginDestructionProtector::~PluginDestructionProtector):
543         * WebProcess/Plugins/PluginProxy.cpp:
544         (WebKit::PluginProxy::evaluate):
545         * WebProcess/Plugins/PluginView.cpp:
546         (WebKit::PluginView::protectPluginFromDestruction):
547         (WebKit::PluginView::unprotectPluginFromDestruction):
548         * WebProcess/Plugins/PluginView.h:
549
550 2011-02-17  Sam Weinig  <sam@webkit.org>
551
552         Build fix.
553
554         * WebProcess/WebPage/mac/WebPageMac.mm:
555         (WebKit::WebPage::performDictionaryLookupAtLocation):
556
557 2011-02-17  Sam Weinig  <sam@webkit.org>
558
559         Reviewed by Maciej Stachowiak.
560
561         WebKit2: Support Dictionary popup
562         <rdar://problem/7660670>
563
564         * Shared/TextInfo.cpp: Added.
565         (WebKit::TextInfo::encode):
566         (WebKit::TextInfo::decode):
567         * Shared/TextInfo.h: Added.
568         (WebKit::TextInfo::TextInfo):
569         Add class to represent the location and style of a run of text.
570
571         * UIProcess/PageClient.h:
572         * UIProcess/API/mac/PageClientImpl.h:
573         * UIProcess/API/mac/PageClientImpl.mm:
574         (WebKit::PageClientImpl::didPerformDictionaryLookup):
575         Invoke the dictionary popup.
576
577         * UIProcess/API/mac/WKView.mm:
578         (-[WKView performLookupAtCurrentMouseLocation]):
579         Tell the WebProcess to get get the text under the mouse and cause
580         the dictionary popup to appear.
581
582         * UIProcess/API/mac/WKViewPrivate.h:
583         Add performLookupAtCurrentMouseLocation.
584
585         * UIProcess/WebPageProxy.cpp:
586         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
587         (WebKit::WebPageProxy::didPerformDictionaryLookup):
588         * UIProcess/WebPageProxy.h:
589         * UIProcess/WebPageProxy.messages.in:
590         * WebProcess/WebPage/WebPage.cpp:
591         * WebProcess/WebPage/WebPage.h:
592         * WebProcess/WebPage/WebPage.messages.in:
593         Pipe messages through.
594
595         * WebProcess/WebPage/mac/WebPageMac.mm:
596         (WebKit::characterRangeAtPoint): Fix to return PassRefPtr
597         and not potentially stale pointers.
598
599         (WebKit::WebPage::characterIndexForPoint):
600         Change to use a RefPtr.
601
602         (WebKit::WebPage::performDictionaryLookupAtLocation):
603         Add simple heuristic to get the word at the current point (or the current selection
604         if it is at that point) and grab the style of the word to send the UIProcess.
605
606         * WebKit2.pro:
607         * WebKit2.xcodeproj/project.pbxproj:
608         * win/WebKit2.vcproj:
609         Add new files.
610
611 2011-02-17  Brian Weinstein  <bweinstein@apple.com>
612
613         Qt build fix.
614
615         * WebKit2.pro: Update after renaming of MemoryCache to ResourceCache.
616
617 2011-02-17  Brian Weinstein  <bweinstein@apple.com>
618
619         Mac build fix.
620
621         * WebKit2.xcodeproj/project.pbxproj: Use relative to group instead of absolute paths. Not everyone's home
622             directory is /Users/brian_weinstein.
623
624 2011-02-16  Brian Weinstein  <bweinstein@apple.com>
625
626         Reviewed by Brady Eidson.
627
628         WebKit2: Need a way to manage the WebCore Cache
629         https://bugs.webkit.org/show_bug.cgi?id=54501
630         
631         Implement a WebKit2 API to manage the WebCore memory cache. This API exposes three functions:
632         
633         1) A method to get a list of all security origins that have entries in the WebCore memory cache.
634         2) A method to remove all entries in the WebCore memory cache from a SecurityOrigin.
635         3) A method to remove all entries from the WebCore memory cache.
636
637         * Platform/CoreIPC/MessageID.h: Add two new MessageClasses.
638         * Shared/API/c/WKBase.h:
639         * Shared/APIObject.h: Add a CacheManager type.
640         * Shared/WebSecurityOrigin.h: Typedef WKCacheManagerRef.
641         (WebKit::WebSecurityOrigin::createFromString): Creates a WebCore::SecurityOrigin using 
642             SecurityOrigin::createFromString.
643         (WebKit::WebSecurityOrigin::toString): Calls through to SecurityOrigin::toString.
644         * UIProcess/API/C/WKAPICast.h:
645
646         * UIProcess/API/C/WKCacheManager.cpp: Added.
647         (WKCacheManagerGetTypeID): Returns the WebResourceCacheManagerProxy type.
648         (WKCacheManagerGetCacheOrigins): Calls through to WebResourceCacheManagerProxy::getCacheOrigins.
649         (callGetCacheOriginsBlockBlockAndDispose):
650         (WKCacheManagerGetCacheOrigins_b):
651         (WKCacheManagerDeleteCacheForOrigin): Calls through to WebResourceCacheManagerProxy::deleteCacheForOrigin.
652         (WKCacheManagerDeleteAllCache): Calls through to WebResourceCacheManagerProxy::deleteAllCache.
653         * UIProcess/API/C/WKCacheManager.h: Added.
654
655         * UIProcess/API/C/WKContext.cpp:
656         (WKContextGetCacheManager): Calls to get the WebResourceCacheManagerProxy.
657         * UIProcess/API/C/WKContext.h:
658
659         * UIProcess/WebResourceCacheManagerProxy.cpp: Added.
660         (WebKit::WebResourceCacheManagerProxy::create): Calls through to the constructor.
661         (WebKit::WebResourceCacheManagerProxy::WebResourceCacheManagerProxy): Initialize the m_webContext variable.
662         (WebKit::WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy):
663         (WebKit::WebResourceCacheManagerProxy::invalidate): Invalidate the callback map.
664         (WebKit::WebResourceCacheManagerProxy::getCacheOrigins): Call through to the web process to get the cache
665             origins.
666         (WebKit::WebResourceCacheManagerProxy::didGetCacheOrigins): Call the callback.
667         (WebKit::WebResourceCacheManagerProxy::deleteCacheForOrigin): Call through to the web process to delete cache
668             for the given origin. 
669         (WebKit::WebResourceCacheManagerProxy::deleteAllCache): Call through to the web process to delete all of the cache.
670         * UIProcess/WebResourceCacheManagerProxy.h: Added.
671         (WebKit::WebResourceCacheManagerProxy::clearContext):
672         (WebKit::WebResourceCacheManagerProxy::type):
673         * UIProcess/WebResourceCacheManagerProxy.messages.in: Added.
674
675         * UIProcess/WebContext.cpp:
676         (WebKit::WebContext::WebContext): Initialize new member variable.
677         (WebKit::WebContext::~WebContext):  Invalidates new member variable.
678         (WebKit::WebContext::didReceiveMessage): Passes cache messages to the cache manager.
679         * UIProcess/WebContext.h:
680         (WebKit::WebContext::cacheManagerProxy):
681         * UIProcess/WebProcessProxy.cpp:
682         (WebKit::WebProcessProxy::didReceiveMessage): Add a new message class.
683
684         * WebProcess/ResourceCache/WebResourceCacheManager.cpp: Added.
685         (WebKit::WebResourceCacheManager::shared):
686         (WebKit::WebResourceCacheManager::WebResourceCacheManager):
687         (WebKit::WebResourceCacheManager::~WebResourceCacheManager):
688         (WebKit::WebResourceCacheManager::didReceiveMessage): Calls through to didReceiveWebResourceCacheManagerMessage.
689         (WebKit::WebResourceCacheManager::getCacheOrigins): Gets a list of origins with cache entries from the memory
690             cache, and puts them into a vector to send to the UI process.
691         (WebKit::WebResourceCacheManager::deleteCacheForOrigin): Calls through to ResourceCache to delete all cache entries
692             from a given origin.
693         (WebKit::WebResourceCacheManager::deleteAllCache):
694         * WebProcess/ResourceCache/WebResourceCacheManager.h: Added.
695         * WebProcess/ResourceCache/WebResourceCacheManager.messages.in: Added.
696
697         * WebProcess/WebProcess.cpp:
698         (WebKit::WebProcess::didReceiveMessage):
699         (WebKit::WebProcess::clearResourceCaches): Tell the memory cache to evict its resources. This was done on WebKit1, 
700             but not WebKit2.
701         * WebProcess/WebProcess.h:
702         
703         * WebKit2.xcodeproj/project.pbxproj: Added new files.
704         * win/WebKit2.vcproj: Ditto.
705         * win/WebKit2Common.vsprops: Added new include directory.
706         * win/WebKit2Generated.make: Added new header.
707
708 2011-02-16  David Hyatt  <hyatt@apple.com>
709
710         Reviewed by Dan Bernstein.
711
712         https://bugs.webkit.org/show_bug.cgi?id=54244
713         
714         Convert the line box tree to floating point and eliminate font rounding hacks.  This patch removes all of the rounding
715         hacks from the Font code and makes sure all Font APIs involving width measurement and width offsets use floats.
716         
717         The line box tree's x, y and logicalWidth members have all been converted to floats and all of the line box APIs have
718         been changed as well.
719         
720         In terms of pixel adjustments, overflow is using an enclosing model (so it will be enclosingIntRect of a line box's x/y/width/height).
721         
722         Background and border painting is using a rounding model, so borders and backgrounds will round to the nearest pixel when painting.
723         
724         Replaced elements still snap to integer positions on lines, and they use a rounding model as well, although their underlying line boxes
725         still have a precise floating point position.
726
727         Justification will now allow subpixel positioning to occur as well.  Platforms that don't support subpixel positioning should already
728         be rounding justification spacing in their font code.
729
730         Many layout test results change on Mac, since rounding hacks were used there and are now gone.
731
732         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
733         (WebKit::WebPopupMenu::setUpPlatformData):
734
735 2011-02-10  Luiz Agostini  <luiz.agostini@openbossa.org>
736
737         Reviewed by Adam Roben.
738
739         HTML5 <details> and <summary>: localized text
740         https://bugs.webkit.org/show_bug.cgi?id=54260
741
742         The method defaultDetailsSummaryText was added to LocalizationStrategy class. It is used to
743         provide the default label to be used by a <details> tag that has no <summary> child.
744
745         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
746         (WebKit::WebPlatformStrategies::defaultDetailsSummaryText):
747         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
748
749 2011-02-17  Adam Roben  <aroben@apple.com>
750
751         Make sure layout is up-to-date before rendering the layer tree in DrawingAreaImpl
752
753         Fixes <http://webkit.org/b/54646> <rdar://problem/9016889> Assertion failure in
754         FrameView::paintContents when calling WKPageForceRepaint on a page that uses accelerated
755         compositing
756
757         Reviewed by Anders Carlsson.
758
759         * WebProcess/WebPage/DrawingAreaImpl.cpp:
760         (WebKit::DrawingAreaImpl::forceRepaint): Lay out before we do anything else.
761
762 2011-02-17  Alejandro G. Castro  <alex@igalia.com>
763
764         Reviewed by Martin Robinson.
765
766         [GTK] Add WKPluginSiteDataManager.cpp compilation after r78647
767         https://bugs.webkit.org/show_bug.cgi?id=54564
768
769         * GNUmakefile.am: Added files to compilation.
770         * Shared/Plugins/Netscape/NetscapePluginModule.h: used
771         npruntime_internal.h in the include to avoid problems with X
772         types.
773         * WebProcess/WebProcess.cpp:
774         (WebKit::WebProcess::setAlwaysUsesComplexTextCodePath): fixed
775         ambiguous reference to Font caused by the X headers required by
776         the plugins.
777
778 2011-02-16  Matthew Delaney  <mdelaney@apple.com>
779
780         Reviewed by Simon Fraser.
781
782         Allow acceleratesDrawing for WebKit2
783         https://bugs.webkit.org/show_bug.cgi?id=54511
784
785         Plumb through preference for accelerated drawing.
786         
787         If accelerated drawing is enabled, keep the DrawingAreaImpl in
788         accelerated compositing mode.
789
790         * Shared/WebPreferencesStore.h:
791         * UIProcess/API/C/WKPreferences.cpp:
792         (WKPreferencesSetAcceleratedDrawingEnabled):
793         (WKPreferencesGetAcceleratedDrawingEnabled):
794         * UIProcess/API/C/WKPreferencesPrivate.h:
795         * WebProcess/WebPage/DrawingAreaImpl.cpp:
796         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
797         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
798         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
799         * WebProcess/WebPage/DrawingAreaImpl.h:
800         * WebProcess/WebPage/WebPage.cpp:
801         (WebKit::WebPage::updatePreferences):
802
803 2011-02-16  Yael Aharon  <yael.aharon@nokia.com>
804
805         Reviewed by Andreas Kling.
806
807         [Qt] White screen is displayed when tiled backing store is enabled in MiniBrowser.
808         https://bugs.webkit.org/show_bug.cgi?id=54583
809
810         Make sure to invalidate all the tiles, including the last one.
811
812         * UIProcess/TiledDrawingAreaProxy.cpp:
813         (WebKit::TiledDrawingAreaProxy::invalidate):
814
815 2011-02-16  Yael Aharon  <yael.aharon@nokia.com>
816
817         Reviewed by Andreas Kling.
818
819         [Qt] Tiles are not created for webkit2 after r77286.
820         https://bugs.webkit.org/show_bug.cgi?id=54577
821
822         When using the default tile size of 1024x1024, only one tile is created.
823         Make sure to create this tile by undoing what seems to be a typo in r77286.
824
825         * UIProcess/TiledDrawingAreaProxy.cpp:
826         (WebKit::TiledDrawingAreaProxy::paint):
827         (WebKit::TiledDrawingAreaProxy::createTiles):
828
829 == Rolled over to ChangeLog-2011-02-16 ==