2011-08-23 Mark Rowe Merge r93420. 2011-08-18 Anders Carlsson WebProcess crashes during startup if libdispatch is initialized by WebProcessShim.dylib https://bugs.webkit.org/show_bug.cgi?id=66508 Reviewed by Mark Rowe. * mac/MainMac.cpp: (closeUnusedFileDescriptors): Check if a file descriptor is a kqueue and don't close it if that is the case. While this isn't a complete fix, (it won't work if other initializers end up creating non-kqueue file descriptors) it's good enough for Snow Leopard. For Lion, we should use the new posix_spawn API that lets you whitelist file descriptors from the parent process. 2011-08-23 Mark Rowe Merge r93546. 2011-08-21 Michael Saboff REGRESSION (r92231): Apple campus proposal PDF doesn't display in Safari https://bugs.webkit.org/show_bug.cgi?id=66464 Changed ArgumentEncoder to use system malloc instead of fastMalloc. FastMalloc uses madvise(MADV_FREE_REUSABLE) which is incompatible with mach message Out Of Line (OOL) messages that use MACH_MSG_VIRTUAL_COPY. The system malloc has no such limitation. Changed sendOutgoingMessage to use MACH_MSG_VIRTUAL_COPY again as it doesn't have size limitations that MACH_MSG_PHYSICAL_COPY. Reviewed by Anders Carlsson. * Platform/CoreIPC/ArgumentEncoder.cpp: (CoreIPC::ArgumentEncoder::~ArgumentEncoder): (CoreIPC::ArgumentEncoder::grow): * Platform/CoreIPC/mac/ConnectionMac.cpp: (CoreIPC::Connection::sendOutgoingMessage): 2011-08-23 Mark Rowe Merge r93555. 2011-08-22 Oliver Hunt Delay GC triggered NP object destruction to the next runloop cycle https://bugs.webkit.org/show_bug.cgi?id=66717 Reviewed by Anders Carlsson. Delay destruction of plugin objects caused by GC until the next runloop cycle so that they can execute JS in their finalizers. We do this using a zero delay timer coupled with a queue of objects to be finalised. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::releaseObject): * WebProcess/Plugins/Netscape/JSNPObject.h: * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::NPRuntimeObjectMap): (WebKit::NPRuntimeObjectMap::invalidate): (WebKit::NPRuntimeObjectMap::invalidateQueuedObjects): (WebKit::NPRuntimeObjectMap::addToInvalidationQueue): (WebKit::NPRuntimeObjectMap::finalize): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: * WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp: (WebKit::trySafeReleaseNPObject): * WebProcess/Plugins/Netscape/NPRuntimeUtilities.h: 2011-08-18 Lucas Forschler Merged 92729 2011-08-09 John Sullivan WKPageCopyPendingAPIRequestURL returns stale result if policy decision set to Ignore https://bugs.webkit.org/show_bug.cgi?id=65950 Reviewed by Anders Carlsson. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): Call clearPendingAPIRequestURL() if the policy decision is PolicyIgnore. 2011-08-18 Lucas Forschler Merged 91998 2011-07-29 Anders Carlsson Pass the HTTP referrer header for URLs loaded by plug-ins https://bugs.webkit.org/show_bug.cgi?id=65379 Reviewed by Sam Weinig. Set the HTTP referrer if necessary. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::loadURL): 2011-08-18 Lucas Forschler Merged 92729 2011-08-09 John Sullivan WKPageCopyPendingAPIRequestURL returns stale result if policy decision set to Ignore https://bugs.webkit.org/show_bug.cgi?id=65950 Reviewed by Anders Carlsson. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): Call clearPendingAPIRequestURL() if the policy decision is PolicyIgnore. 2011-08-11 Lucas Forschler Merged 92384 2011-08-01 Brian Weinstein WebKit2: Web Inspector always starts in undocked mode https://bugs.webkit.org/show_bug.cgi?id=65493 Reviewed by Adam Roben. When opening the inspector, the web process tells the UI process that the inspector page has loaded, but now will pass another bit of data, whether the inspector can start attached, so the UI process doesn't need to ask the web process to do another calculation on whether or not it can be attached. If the user prefers the inspector to start docked (this defaults to true), and there is room for the window, we send a message to the web process to try and attach the inspector. This makes sure that the inspector knows it is docked (in the web process). * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::attach): Update the user's docked/undocked preference if the inspector is visible when it was attached. (WebKit::WebInspectorProxy::detach): Ditto (but when it was detached). (WebKit::WebInspectorProxy::didLoadInspectorPage): If we can start docked, and the user prefers to start docked, then request the inspector be attached to the window. * UIProcess/WebInspectorProxy.h: * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformOpen): Only show the window if we are going to start undocked. * UIProcess/win/WebInspectorProxyWin.cpp: (WebKit::WebInspectorProxy::platformOpen): Ditto. * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::didLoadInspectorPage): Pass whether or not we can attach the window. (WebKit::WebInspector::requestAttachWindow): Call through to the InspectorController to attach the inspector. (WebKit::WebInspector::canAttachWindow): Ask the InspectorController if we can attach the inspector. * WebProcess/WebPage/WebInspector.h: * Shared/WebPreferencesStore.h: Add a new preference for whether or not the inspector should start attached. * UIProcess/WebInspectorProxy.messages.in: When the inspector page is loaded, tell the UI Process whether we can attach the inspector without needing another message. * WebProcess/WebPage/WebInspector.messages.in: Add a new message for RequestAttachWindow 2011-08-11 Lucas Forschler Merged 92231 2011-08-01 Michael Saboff Virtual copying of FastMalloc allocated memory causes madvise MADV_FREE_REUSABLE errors https://bugs.webkit.org/show_bug.cgi?id=65502 Reviewed by Anders Carlsson. Changed OOL message to use MACH_MSG_PHYSICAL_COPY flag instead of virtual flag so that the original memory region isn't referenced by the message and ultimately the receiving process. The additional reference caused madvise(MADV_FREE_REUSABLE) to fail when it encountered such pages. * Platform/CoreIPC/mac/ConnectionMac.cpp: (CoreIPC::Connection::sendOutgoingMessage): 2011-08-11 Lucas Forschler Merged 91961 2011-07-28 Anders Carlsson Crash when trying to encode FontInfo with a null font attribute descriptor https://bugs.webkit.org/show_bug.cgi?id=65350 * Shared/FontInfo.cpp: (WebKit::FontInfo::encode): Encode a boolean specifying whether there's a fontAttributeDictionary member variable. (WebKit::FontInfo::decode): Don't try to decode the fontAttributeDictionary member variable if none has been encoded. 2011-08-11 Lucas Forschler Merged 91939 2011-07-26 Chris Fleizach REGRESSION (Safari 5.1): JavaScript dialogs not usable with VoiceOver https://bugs.webkit.org/show_bug.cgi?id=65214 Reviewed by Anders Carlsson. Allow the ability to spin the run loop while WebProcess is waiting for a synchronous reply. This allows it to continue to serve accessibility requests while waiting and basically restores the behavior WK1 was presenting. This patch only enables this mode when accessibility is on. * Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::sendSyncMessage): (CoreIPC::Connection::waitForSyncReply): * Platform/CoreIPC/Connection.h: (CoreIPC::Connection::sendSync): * Platform/RunLoop.h: * Platform/mac/RunLoopMac.mm: (RunLoop::runForDuration): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::runJavaScriptAlert): (WebKit::WebChromeClient::runJavaScriptConfirm): (WebKit::WebChromeClient::runJavaScriptPrompt): 2011-08-11 Lucas Forschler Merged 91793 2011-07-26 Tim Horton Apply r40940 to WebKit2 to work around a Silverlight crash. https://bugs.webkit.org/show_bug.cgi?id=65205 Reviewed by Anders Carlsson. * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::NetscapePluginModule::determineQuirks): * Shared/Plugins/PluginQuirks.h: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::userAgent): 2011-08-11 Lucas Forschler Merged 91100 2011-07-15 Dan Bernstein Windows build fix. * UIProcess/win/WebView.cpp: 2011-08-11 Lucas Forschler Merged 91098 2011-07-15 Dan Bernstein Windows build fix. * UIProcess/win/WebView.h: 2011-08-11 Lucas Forschler Merged 91097 2011-07-15 Dan Bernstein REGRESSION: Mouse cursor doesn’t hide when full screen video HUD hides https://bugs.webkit.org/show_bug.cgi?id=64615 Reviewed by Anders Carlsson. * UIProcess/API/efl/PageClientImpl.cpp: (WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves): Added this stub. * UIProcess/API/efl/PageClientImpl.h: * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves): Ditto. * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/mac/PageClientImpl.h: * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves): Added. Calls +[NSCursor setHiddenUntilMouseMoves:]. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setCursorHiddenUntilMouseMoves): Added. Calls through to the PageClient. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Added SetCursorHiddenUntilMouseMoves message. * UIProcess/win/WebView.cpp: (WebKit::WebView::setCursorHiddenUntilMouseMoves): Added this stub. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::setCursorHiddenUntilMouseMoves): Added. Sends SetCursorHiddenUntilMouseMoves message to the page proxy. * WebProcess/WebCoreSupport/WebChromeClient.h: 2011-08-11 Lucas Forschler Merged 91085 2011-07-15 Anders Carlsson Find indicator should take scale factor into account https://bugs.webkit.org/show_bug.cgi?id=64611 Reviewed by Sam Weinig. * UIProcess/FindIndicator.cpp: (WebKit::FindIndicator::create): (WebKit::FindIndicator::FindIndicator): Keep track of the scale factor of the find indicator bitmap. (WebKit::FindIndicator::draw): Pass the scale factor to ShareableBitmap::draw. * UIProcess/FindIndicator.h: Add scale factor member variable. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setFindIndicator): This now takes the content image scale factor. * UIProcess/WebPageProxy.messages.in: Add the scale factor. * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindIndicator): Size the backing store correctly, and apply the scale factor to the graphics context. (WebKit::FindController::hideFindIndicator): Pass the scale factor along. 2011-08-11 Lucas Forschler Merged 88669 2011-06-13 Chris Fleizach Reviewed by Darin Adler. kAXTextMarkerForPositionParametrizedAttribute does not work correctly in WK2 https://bugs.webkit.org/show_bug.cgi?id=62547 Implement the missing screenToWindow method for WK2. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::screenToWindow): * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/mac/PageClientImpl.h: * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::screenToWindow): * UIProcess/API/qt/qwkpage.cpp: (QWKPagePrivate::screenToWindow): * UIProcess/API/qt/qwkpage_p.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::screenToWindow): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/win/WebView.cpp: (WebKit::WebView::screenToWindow): * UIProcess/win/WebView.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::screenToWindow): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::screenToWindow): * WebProcess/WebPage/WebPage.h: 2011-08-09 Gavin Barraclough Reviewed by nobody. Merged JavaScriptCore & JavaScriptGlue from 86722 to 92405. EXCEPT, Did not merge patches: 86837, 89283, 90643, 92068, 92254. ALSO, Did merge full patch (including non-JSC/JSG changes) for: 87346, 88587, 89069, 90383, 91095, 91194, 91195, 91790, 91903, 92224. 2011-08-03 Lucas Forschler Merged 92345. 2011-08-03 Jeff Miller Use of AVFoundation should default to off on Windows https://bugs.webkit.org/show_bug.cgi?id=65660 Reviewed by Darin Adler. * Shared/WebPreferencesStore.h: Change default value for AVFoundationEnabled to false on Windows, it's still true on other platforms. 2011-08-03 Lucas Forschler Merged 91435. 2011-07-20 Tim Horton Scrollbar color heuristic needs to be hooked up in WebKit1 https://bugs.webkit.org/show_bug.cgi?id=64220 Reviewed by Darin Adler. Store the scroller style on ScrollableArea, and recompute it whenever the document or body element background color changes or the base background color of the scrollview changes. Also, make sure to repaint the scrollbars whenever the style changes. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::getDocumentBackgroundColor): 2011-08-03 Lucas Forschler Merged 90705. 2011-07-10 Anders Carlsson WebKit2 is leaking NSCursors created by leakNamedCursor https://bugs.webkit.org/show_bug.cgi?id=64241 Reviewed by Oliver Hunt. * Shared/WebCoreArgumentCoders.cpp: (CoreIPC::::decode): When decoding a cursor of a known type, make sure to eagerly create the platform cursor for the cursor singleton. This way we avoid re-creating new NSCursor objects over and over for standard cursors. 2011-08-02 Lucas Forschler Merged 91616. 2011-07-22 Jessie Berlin [WebKit2] Changing the cookie accept policy in Private Browsing doesn’t work. https://bugs.webkit.org/show_bug.cgi?id=64997 Reviewed by Ada Chan. * WebProcess/Cookies/mac/WebCookieManagerMac.mm: (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Set the policy on the Cookie Storage used by the Private Browsing Storage Session as well. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2011-07-29 Lucas Forschler Merged 91964. 2011-07-28 Tim Horton REGRESSION (5.1): CJK input broken after clicking on Flash content https://bugs.webkit.org/show_bug.cgi?id=65349 Reviewed by Darin Adler. After giving Flash focus on a page and then navigating away from that page using the back button, we were not getting notified to switch back to inline (non-complex) input. Now, notify the page that it can leave complex text mode when the plugin is destroyed. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::~PluginView): 2011-07-29 Lucas Forschler Merged 91271. 2011-07-19 Brian Weinstein Add back a change that was accidentally removed in r91266. Make sure to retain the WKPasteboardFilePromiseOwner before calling draggedImage because draggedImage releases its responder. Also make the comment more explicit, to keep this mistake from being made in the future. Rubber-stamped by Darin Adler. * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::dragEnded): 2011-07-29 Lucas Forschler Merged 91266. 2011-07-18 Brian Weinstein Speculative fix for: Crash under WebPage::platformDragEnded when dragging on Mac https://bugs.webkit.org/show_bug.cgi?id=64766 Reviewed by Enrica Casucci. I was unable to reproduce this bug, but Darin Adler and I discussed the probable issue. When starting the drag, we create a WKPasteboardFilePromiseOwner, and a WKPasteboardOwner. When the drag is concluded, we call a method on the WKPasteboardFilePromiseOwner which uses the WKPasteboardOwner. However, we are not guaranteeing that the WKPasteboardOwner will be around when the WKPasteboardFilePromiseOwner method is called. The fix is to retain both the WKPasteboardFilePromiseOwner and the WKPasteboardOwner that we need, making sure that we are keeping both objects alive. This patch also uses r91222 to replace WebPage::platformDragEnded, so WebPage doesn't need to know about the drag source. * WebProcess/WebCoreSupport/WebDragClient.cpp: (WebKit::WebDragClient::dragEnded): Add a non-Mac stub method, since the Mac is the only platform that does something here. * WebProcess/WebCoreSupport/WebDragClient.h: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): Use member variables instead of local variables. (WebKit::WebDragClient::dragEnded): Move code from WebPageMac::platformDragEnded to here, and clear both member variables. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::dragEnded): Don't call platformDragEnded anymore. WebCore::DragController::dragEnded calls WebDragClient::dragEnded, which does the same thing. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: Remove platformDragEnded. 2011-07-29 Lucas Forschler Merged 91085. 2011-07-15 Anders Carlsson Find indicator should take scale factor into account https://bugs.webkit.org/show_bug.cgi?id=64611 Reviewed by Sam Weinig. * UIProcess/FindIndicator.cpp: (WebKit::FindIndicator::create): (WebKit::FindIndicator::FindIndicator): Keep track of the scale factor of the find indicator bitmap. (WebKit::FindIndicator::draw): Pass the scale factor to ShareableBitmap::draw. * UIProcess/FindIndicator.h: Add scale factor member variable. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setFindIndicator): This now takes the content image scale factor. * UIProcess/WebPageProxy.messages.in: Add the scale factor. * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindIndicator): Size the backing store correctly, and apply the scale factor to the graphics context. (WebKit::FindController::hideFindIndicator): Pass the scale factor along. 2011-07-29 Lucas Forschler Merged 90293. 2011-07-01 Darin Adler Consider backing scale factor when setting up graphics layers https://bugs.webkit.org/show_bug.cgi?id=63848 Reviewed by Simon Fraser. * WebProcess/WebPage/ca/LayerTreeHostCA.cpp: (WebKit::LayerTreeHostCA::initialize): Set contents scale on the non-composited content layer based on the backing scale factor. (WebKit::LayerTreeHostCA::createPageOverlayLayer): Set contents scale on the page overlay layer based on the backing scale factor. 2011-07-22 Lucas Forschler Merged 91146. 2011-07-15 Tim Horton Overlay scrollbars in overflow areas no longer pulse when revealed https://bugs.webkit.org/show_bug.cgi?id=64606 Reviewed by Simon Fraser. Ensure that the state of the scrollbar implementation is kept in sync with WebCore's internal representation. Previously, we synchronized them at paint time, causing pulsing to be skipped due to the scrollbars being disabled. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2011-07-22 Lucas Forschler Merged 90851. 2011-06-22 Jer Noble Full-screen: Don't change the collectionBehavior of the WebView's NSWindow if not necessary https://bugs.webkit.org/show_bug.cgi?id=63217 Reviewed by Darin Adler. Check to see if the NSWindow hosting the WebView is not on the active space before changing the window's collectionBehavior. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController beganExitFullScreenAnimation]): 2011-07-21 Lucas Forschler Merged 90198. 2011-06-30 Darin Adler Reviewed by Anders Carlsson. [WebKit2] Consider scale factor when allocating backing store https://bugs.webkit.org/show_bug.cgi?id=63766 This is the first step in considering scale factor. It considers scale factor for the primary backing store, not graphics layers, and for CG only. * Platform/cg/CGUtilities.cpp: (WebKit::paintImage): Added a scale factor argument. (WebKit::paintBitmapContext): Pass 1 for scale factor. * Platform/cg/CGUtilities.h: Updated for above. * Shared/ShareableBitmap.h: Added an overload of paint that can handle a scale factor. * Shared/UpdateInfo.cpp: (WebKit::UpdateInfo::encode): Encode scale factor. (WebKit::UpdateInfo::decode): Decode scale factor. * Shared/UpdateInfo.h: Added scale factor. * Shared/cg/ShareableBitmapCG.cpp: (WebKit::ShareableBitmap::paint): Added the overload that can handle a scale factor. * UIProcess/BackingStore.cpp: (WebKit::BackingStore::create): Take a scale factor. (WebKit::BackingStore::BackingStore): Store the scale factor. (WebKit::BackingStore::incorporateUpdate): Consider the scale factor when asserting the size is correct. * UIProcess/BackingStore.h: Add a scale factor. * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState): Check the scale factor too when deciding whether to reuse a backing store. (WebKit::DrawingAreaProxyImpl::incorporateUpdate): Pass in the scale factor when creating a backing store. * UIProcess/mac/BackingStoreMac.mm: (WebKit::BackingStore::incorporateUpdate): Take the scale factor into account when painting. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): Put the scale factor into the UpdateInfo. (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Ditto. (WebKit::DrawingAreaImpl::display): Take the scale factor into account when allocating the bitmap and creating a graphics context for it. 2011-07-21 Lucas Forschler Merged 90087. 2011-07-21 Lucas Forschler Reviewed by Dan Bernstein. [Mac] Use system cursors instead of custom bitmaps where possible https://bugs.webkit.org/show_bug.cgi?id=63679 * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): Added WKCursor. 2011-07-21 Lucas Forschler Merged 90038. 2011-06-29 Darin Adler Reviewed by Anders Carlsson. [WebKit2] Crash loading page that adds/removes frame in DOMContentLoaded/loaded https://bugs.webkit.org/show_bug.cgi?id=63483 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::createFrame): Added a check for null when creating a frame. Also added a check that was in the WebKit1 code, but not here. Strangely, the comment from the second check was still here, but not the code. 2011-07-21 Lucas Forschler Merged 89720. 2011-07-21 Lucas Forschler Reviewed by John Sullivan. Drag-and-drop tab in same window makes web process falsely report unresponsiveness https://bugs.webkit.org/show_bug.cgi?id=63369 If the view becomes invisible, stop the responsiveness timer, because we might not get any messages that will cause it to stop (such as painting notifications since we don't paint when we're not visible). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::viewStateDidChange): 2011-07-21 Lucas Forschler Merged 88667. 2011-06-13 Sam Weinig Reviewed by Darin Adler. REGRESSION (81679-81939): In Safari, Dictionary look up (tap or Ctrl-Cmd-D) doesn't work if you have clicked on a word and not moved the mouse * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::shouldUseSelection): Return early if the selection we are using is not a range. 2011-06-24 Lucas Forschler Merged 89706. 2011-06-24 Anders Carlsson Reviewed by Kevin Decker. Not possible for plug-ins to override the internal PDF viewer https://bugs.webkit.org/show_bug.cgi?id=63356 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame): (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Pass the entire resource response to shouldUseCustomRepresentationForResponse. * WebProcess/WebProcess.cpp: (WebKit::canPluginHandleResponse): Ask for the plug-in path for a plug-in that can handle the given resource response. If we fail to send the message, or if the path comes back empty, we assume that there's no plug-in that can handle it. (WebKit::WebProcess::shouldUseCustomRepresentationForResponse): If the response MIME type is in the m_mimeTypesWithCustomRepresentations map, check if there's a plug-in that can handle the given response. If that is the case, it should have precedence over the custom representation. * WebProcess/WebProcess.h: Rename shouldUseCustomRepresentationForMIMEType to shouldUseCustomRepresentationForResponse. 2011-06-22 Lucas Forschler Merged 89436. 2011-06-22 Adam Roben Don't use an alpha channel when drawing the web page on Windows We never use the alpha channel in the end anyway (because we never render into a layered window, which is the only kind of window that supports alpha). And using an alpha channel is tricky to get right since GDI doesn't support alpha (and often writes 0x0 into the alpha channel). Fixes REGRESSION (r88978): Text inside form controls looks really awful on Windows XP Reviewed by Anders Carlsson. * WebProcess/WebPage/win/DrawingAreaImplWin.cpp: (WebKit::DrawingAreaImpl::createGraphicsContext): Specify false for the hasAlpha parameter to the GraphicsContext constructor. 2011-06-22 Lucas Forschler Merged 89398. 2011-06-21 Jer Noble Reviewed by Simon Fraser. REGRESSION: Fullscreen videos are broken (affects embedded vimeo, vimeo.com, and apple.com) https://bugs.webkit.org/show_bug.cgi?id=63098 Force a repaint after completing entering full-screen mode only after the notification is sent for the QTMovie to tear down its layer. Then, the QTMovie will build up its layer again during the repaint. * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): 2011-06-14 Lucas Forschler Merged 88978. 2011-06-14 Jon Honeycutt REGRESSION(78201): Windowless Flash plug-ins are transparent on some sites https://bugs.webkit.org/show_bug.cgi?id=62690 Reviewed by Ada Chan. The bug arises when mixing CoreGraphics and GDI. When we create a Windows bitmap for a windowless plug-in to draw into, we first fill it with "clear", or all 0s. If the plug-in uses GDI to draw, the GDI calls will ignore the alpha channel, and if we then use CG to blend this bitmap onto the GraphicsContext for the rest of the page, CG will treat the 0-filled alpha channel as being transparent. To fix this, on Windows, use a GDI-backed GraphicsContext to paint the page in the WebProcess, and use GDI to blit from the UpdateInfo to the backing store in the UI process. * Platform/SharedMemory.h: (WebKit::SharedMemory::handle): Return the handle for the memory. * Shared/ShareableBitmap.h: Declared windowsContext() to return a HDC with the bitmap selected into it. Added members to store the HDC and the HBITMAP. * Shared/win/ShareableBitmapWin.cpp: Added. (WebKit::ShareableBitmap::windowsContext): Get the screen DC, and create a compatible DC from it. Create a DIB section backed by the shared memory, select it into the context, and return it. * UIProcess/win/BackingStoreWin.cpp: (WebKit::BackingStore::incorporateUpdate): Use GDI to blit from the update info's bitmap into the backing store bitmap. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::createGraphicsContext): Return a GraphicsContext from the ShareableBitmap. (WebKit::DrawingAreaImpl::display): Call createGraphicsContext(), and pass the ShareableBitmap. * WebProcess/WebPage/DrawingAreaImpl.h: Declare createGraphicsContext(), which on Windows will create a GDI-backed GraphicsContext. * WebProcess/WebPage/win/DrawingAreaImplWin.cpp: Added. (WebKit::DrawingAreaImpl::createGraphicsContext): Get a Windows context for the bitmap, and create and return a new GraphicsContext using the DC. * win/WebKit2.vcproj: Added new files. 2011-06-14 Lucas Forschler Merged 88956. 2011-06-14 Lucas Forschler Reviewed by Sam Weinig. Fix possible null dereference in webSecKeychainItemCreateFromContentOnMainThread https://bugs.webkit.org/show_bug.cgi?id=62736 * WebProcess/mac/KeychainItemShimMethods.mm: (WebKit::webSecKeychainItemCreateFromContentOnMainThread): SecKeychainItemCreateFromContent can potentially return a null keychain item, so add a null check before trying to retain it. 2011-06-14 Lucas Forschler Merged 88953. 2011-06-15 Anders Carlsson Reviewed by Dan Bernstein. Ignore responsiveness timer callbacks on closed pages https://bugs.webkit.org/show_bug.cgi?id=62735 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): Use nullptr instead of clear. (WebKit::WebPageProxy::processDidBecomeUnresponsive): Return early if the page isn't valid. (WebKit::WebPageProxy::processDidBecomeResponsive): Ditto. (WebKit::WebPageProxy::updateBackingStoreDiscardableState): Assert that the page is valid. 2011-06-14 Lucas Forschler Merged 88856. 2011-06-14 John Sullivan Reviewed by Dan Bernstein. Callers should be robust against WebImage::create() returning an image with a null snapshot * Shared/API/c/cg/WKImageCG.cpp: (WKImageCreateCGImage): Return 0 if no bitmap was created. (WKImageCreateFromCGImage): Ditto. * Shared/UserMessageCoders.h: (WebKit::UserMessageEncoder::baseEncode): Check for null before dereferencing image->bitmap() in two places. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::snapshotInViewCoordinates): Return 0 if no bitmap was created. (WebKit::WebPage::scaledSnapshotInDocumentCoordinates): Ditto. (WebKit::WebPage::createSnapshotOfVisibleContent): Bail out if no bitmap was created. 2011-06-14 Lucas Forschler Merged 88833. 2011-06-14 Stephanie Lewis Rubber stamped by Oliver Hunt. Update order files. * mac/WebKit2.order: 2011-06-14 Lucas Forschler Merged 88735. 2011-06-13 Anders Carlsson Reviewed by Sam Weinig. Crash when trying to use Netflix Watch Instantly with Silverlight 3 https://bugs.webkit.org/show_bug.cgi?id=62611 * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::NetscapePluginModule::getPluginInfo): Get the plug-in version string instead of the version number. (WebKit::PluginVersion::isValid): (WebKit::PluginVersion::PluginVersion): (WebKit::PluginVersion::parse): (WebKit::PluginVersion::isLessThan): Add a new PluginVersion class that represents a plug-in version. The idea is that this class be made cross platform. (WebKit::NetscapePluginModule::determineQuirks): Add the ReturnsNonRetainedScriptableNPObject quirk for versions of Silverlight less than 4. * Shared/Plugins/PluginQuirks.h: Add the ReturnsNonRetainedScriptableNPObject quirk. * UIProcess/Plugins/PluginInfoStore.h: Use a version string. Eventually this should hold the PluginVersion class we added. * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::pluginScriptableNPObject): If the plug-in has the ReturnsNonRetainedScriptableNPObject quirk, do an extra retain. 2011-06-14 Lucas Forschler Merged 88607. 2011-06-11 Stephanie Lewis Reviewed by Sam Weinig. https://bugs.webkit.org/show_bug.cgi?id=62480 part of Add API to launch the WebProcess. Launching it earlier can save time when loading the first page. * UIProcess/API/C/WKContext.cpp: (WKContextWarmInitialProcess): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::warmInitialProcess): * UIProcess/WebContext.h: 2011-06-14 Lucas Forschler Merged 88677. 2011-06-13 Anders Carlsson Reviewed by Dan Bernstein. BankID plug-in isn't instantiated correctly https://bugs.webkit.org/show_bug.cgi?id=62588 * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::NetscapePluginModule::determineQuirks): The BankID plug-in uses the QuickDraw drawing model but doesn't draw anything so we can use the half-baked QuickDraw support. * WebProcess/Plugins/PluginProcessConnection.cpp: (WebKit::defaultSyncMessageTimeout): Don't use a sync message timeout for the BankID plug-in since it sends synchronous Apple Events and we don't want the plug-in to die while it's waiting for a reply. 2011-06-14 Lucas Forschler Merged 88654. 2011-06-11 Jer Noble Reviewed by Anders Carlsson. Avoid flashing when exiting full-screen mode. https://bugs.webkit.org/show_bug.cgi?id=62338 Instead of making a round-trip between processes by calling forceRepaint and waiting for a callback, instead make a WebProcess-side call to forceRepaintWithoutCallback before sending the ExitAcceleratedCompositingMode message to the WebFullScreenControllerProxy. This also means we can get rid of the dragImage creation and display. Because this redraw will happen during the current run-loop instead of a future one, make sure the background color has been set before the redraw in didEnterFullScreen(). Wait to hide the full-screen window until after we have received the ExitAcceleratedCompositingMode message. By this time, repaint will have already completed. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Disable screen updates, to be re-enabled during exitAcceleratedCompositingMode. (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Don't hide the full-screen window here; wait for exitAcceleratedCompositing instead. (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): Collapse the redrawCompleted method into this one. (-[WKFullScreenWindowController close]): Remove the reference to exitCompositedModeRepaintCompleted. * WebProcess/FullScreen/WebFullScreenManager.cpp: (WebKit::WebFullScreenManager::didEnterFullScreen): Set the full screen background color first. * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): Repaint before sending the ExitAcceleratedCompositingMode message. 2011-06-14 Lucas Forschler Merged 88647. 2011-06-13 Anders Carlsson Reviewed by Dan Bernstein. Don't access freed memory in the UI process when a plug-in process crashes https://bugs.webkit.org/show_bug.cgi?id=62548 Call pluginProcessCrashedOrFailedToLaunch after sending messages to all processes about the plug-in crash, otherwise we'll try to dereference m_pluginInfo.path after the PluginProcessProxy object has been deleted. * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::didClose): 2011-06-14 Lucas Forschler Merged 88599. 2011-06-09 Jer Noble Reviewed by Darin Adler. AVPlayerLayer is adding a "fade" animation during Safari full-screen https://bugs.webkit.org/show_bug.cgi?id=62433 CoreAnimation will add default animations when certain properties are changed, unless those changes are wrapped in a CATransaction which has had its disableActions property set to true. Wrap each of these three property changes in a CATransaction and disable its actions, so that the default "fade" animation is not created in response. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): Wrap with CATransaction. (-[WKFullScreenWindowController _swapView:with:]): Ditto: * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): Ditto. 2011-06-14 Lucas Forschler Merged 88588. 2011-06-10 Anders Carlsson Reviewed by Sam Weinig. REGRESSION (WebKit2): window.showModalDialog() broken https://bugs.webkit.org/show_bug.cgi?id=62496 If dispatching a message ends up creating a nested run loop, some incoming messages can end up not being delivered until we exit from the run loop. Fix this by using a Deque instead of a Vector for incoming messages, and get one message at a time and then dispatch it. That prevents us from having any lingering messages lying around in stack allocated space. * Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::waitForMessage): (CoreIPC::Connection::dispatchMessages): * Platform/CoreIPC/Connection.h: 2011-06-14 Lucas Forschler Merged 88585. 2011-06-10 Sam Weinig Reviewed by Anders Carlsson. Unresponsive cursor is shown when displaying a modal dialog Part of https://bugs.webkit.org/show_bug.cgi?id=62494 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runModal): * UIProcess/WebPageProxy.h: Stop the responsiveness timer when calling out to show a modal dialog. 2011-06-14 Lucas Forschler Merged 87834. 2011-06-14 Lucas Forschler Build fix after r87831 * UIProcess/win/WebView.cpp: (WebKit::WebView::enterAcceleratedCompositingMode): (WebKit::WebView::exitAcceleratedCompositingMode): Added some HAVE(WKQCA) guards. 2011-06-14 Lucas Forschler Merged 87831. 2011-06-01 Adam Roben Render accelerated content into a web process-owned child HWND This allows us to use WKCACFView's far more efficient kWKCACFViewDrawingDestinationWindow mode, which gives us asynchronous rendering on a background thread and doesn't require us to read bits off the GPU back into system memory. A new class, WKCACFViewWindow, represents the child HWND. The child HWND is placed at the bottom of the z-order so it won't obscure any other child HWNDs (i.e., windowed plugins). The child HWND is made transparent to mouse events so that WKView will continue to receive mouse events even though it is obscured by the child HWND. There is now a bunch of dead code in DrawingAreaImpl to handle our old rendering model. I'll remove that in a future patch. Fixes REGRESSION (WebKit2): Accelerated CSS animations have a lower framerate than in WebKit1 Reviewed by Anders Carlsson. * Shared/LayerTreeContext.h: Added HWND member on Windows. * Shared/win/CoalescedWindowGeometriesUpdater.cpp: (WebKit::CoalescedWindowGeometriesUpdater::updateGeometries): * Shared/win/CoalescedWindowGeometriesUpdater.h: Added new BringToTopOrNot argument. Allows the caller to specify that all windows being updated should also be brought to the top of the z-order. * Shared/win/LayerTreeContextWin.cpp: (WebKit::LayerTreeContext::LayerTreeContext): (WebKit::LayerTreeContext::~LayerTreeContext): (WebKit::LayerTreeContext::encode): (WebKit::LayerTreeContext::decode): (WebKit::LayerTreeContext::isEmpty): (WebKit::operator==): Implemented based on new window member. * UIProcess/win/WebView.cpp: (WebKit::WebView::WebView): Initialize new member. (WebKit::WebView::onSizeEvent): Resize the layer host window to cover our entire view, if we have one. (WebKit::WebView::enterAcceleratedCompositingMode): Store, position, and show the layer host window. (WebKit::WebView::exitAcceleratedCompositingMode): Destroy the layer host window. (WebKit::WebView::updateChildWindowGeometries): Updated for change to CoalescedWindowGeometriesUpdater. * UIProcess/win/WebView.h: Added m_layerHostWindow member. * WebProcess/WebPage/LayerTreeHost.h: Added scheduleChildWindowGeometryUpdate. * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp: (WebKit::LayerTreeHostCAWin::supportsAcceleratedCompositing): Simplified by using WKCACFViewWindow. (WebKit::LayerTreeHostCAWin::LayerTreeHostCAWin): Removed initialization of a removed member. (WebKit::LayerTreeHostCAWin::platformInitialize): Changed to use WKCACFViewWindow, kWKCACFViewDrawingDestinationWindow, and to initialize the LayerTreeContext. (WebKit::LayerTreeHostCAWin::invalidate): Leak our window and tell it to clean up after itself. The UI process will take care of destroying the window when it finishes switching out of accelerated compositing mode. Removed a WKCACFViewUpdate call that is now handled by WKCACFViewWindow. (WebKit::LayerTreeHostCAWin::scheduleChildWindowGeometryUpdate): Added. Calls through to m_geometriesUpdater. (WebKit::LayerTreeHostCAWin::sizeDidChange): Updated to use WKCACFViewWindow. (WebKit::LayerTreeHostCAWin::contextDidChange): Update child window geometries now to keep them (almost) in sync with the accelerated content. covers the slight asynchrony that still exists. (WebKit::LayerTreeHostCAWin::setRootCompositingLayer): Don't flush any changes when we don't have a root layer. This prevents a flash of white when switching out of compositing mode. * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h: Added m_window and m_geometriesUpdater. Removed code related to the old, synchronous display model. * WebProcess/WebPage/ca/win/WKCACFViewWindow.cpp: Added. (WebKit::WKCACFViewWindow::WKCACFViewWindow): Initialize members and create our window. (WebKit::WKCACFViewWindow::~WKCACFViewWindow): Destroy our window if needed. (WebKit::WKCACFViewWindow::onCustomDestroy): Just call ::DestroyWindow. (WebKit::WKCACFViewWindow::onDestroy): Tell our view not to render into our window anymore. (WebKit::WKCACFViewWindow::onEraseBackground): Tell Windows not to erase us. (WebKit::WKCACFViewWindow::onNCDestroy): Clear out m_window since it's now pointing to a destroy window, and destroy ourselves if requested. (WebKit::WKCACFViewWindow::onPaint): Tell the view to draw, then clear our invalid region. (WebKit::WKCACFViewWindow::onPrintClient): Tell our view to draw into the given HDC. (WebKit::WKCACFViewWindow::registerClass): Register our class (duh). (WebKit::WKCACFViewWindow::staticWndProc): Get the WKCACFViewWindow pointer, or store the pointer if needed, then call through to wndProc. (WebKit::WKCACFViewWindow::wndProc): Call out to the appropriate handler function. * WebProcess/WebPage/ca/win/WKCACFViewWindow.h: Added. (WebKit::WKCACFViewWindow::setDeletesSelfWhenWindowDestroyed): Simple setter. (WebKit::WKCACFViewWindow::window): Simple getter. * WebProcess/WebPage/win/DrawingAreaImplWin.cpp: (WebKit::DrawingAreaImpl::scheduleChildWindowGeometryUpdate): Let the LayerTreeHost handle the geometry update, if we have one. * win/WebKit2.vcproj: Added WKCACFViewWindow files. 2011-06-14 Lucas Forschler Merged 87806. 2011-06-01 Adam Roben Route plugin window geometry updates through the DrawingArea This will allow the geometry updates to be handled by the LayerTreeHost in compositing mode in the future. More rep work for REGRESSION (WebKit2): Accelerated CSS animations have a lower framerate than in WebKit1 Reviewed by Anders Carlsson. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::scheduleWindowedPluginGeometryUpdate): Tell the DrawingArea, not the WebPage, about the geometry update. * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/DrawingAreaImpl.h: * WebProcess/WebPage/win/DrawingAreaImplWin.cpp: Added. (WebKit::DrawingAreaImpl::scheduleChildWindowGeometryUpdate): Moved code here... * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/win/WebPageWin.cpp: ...from here. * win/WebKit2.vcproj: Added DrawingAreaImplWin.cpp. 2011-06-14 Lucas Forschler Merged 87805. 2011-06-01 Adam Roben Move WebView's window geometry updating code to a new class This will allow us to share this code with LayerTreeHostCAWin. Prep work for REGRESSION (WebKit2): Accelerated CSS animations have a lower framerate than in WebKit1 Reviewed by Anders Carlsson. * Shared/win/CoalescedWindowGeometriesUpdater.cpp: Added. (WebKit::CoalescedWindowGeometriesUpdater::CoalescedWindowGeometriesUpdater): (WebKit::CoalescedWindowGeometriesUpdater::~CoalescedWindowGeometriesUpdater): Simple constructor/destructor. (WebKit::CoalescedWindowGeometriesUpdater::addPendingUpdate): (WebKit::setWindowRegion): (WebKit::CoalescedWindowGeometriesUpdater::updateGeometries): * Shared/win/CoalescedWindowGeometriesUpdater.h: Added. Moved code here... * UIProcess/win/WebView.cpp: (WebKit::WebView::scheduleChildWindowGeometryUpdate): (WebKit::WebView::updateChildWindowGeometries): * UIProcess/win/WebView.h: ...from here. * win/WebKit2.vcproj: Added new files. 2011-06-02 Lucas Forschler Merged 88401. 2011-06-08 John Sullivan Reviewed by Darin Adler. [WKView _setDragImage:at:linkDrag:] can crash if WKView is dealloc'ed during drag * UIProcess/API/mac/WKView.mm: (-[WKView _resendKeyDownEvent:]): Renamed self-protecting RetainPtr from "protect" to "protector" so it's a noun. (-[WKView _setDragImage:at:linkDrag:]): Added a self-protecting RetainPtr. 2011-06-07 Lucas Forschler Merged 88204. 2011-06-06 John Sullivan Reviewed by Dan Bernstein. WebKit2 find-on-page callback doesn’t handle kWKMoreThanMaximumMatchCount on PDF pages * UIProcess/API/mac/PDFViewController.mm: (WebKit::PDFViewController::findString): Return kWKMoreThanMaximumMatchCount when appropriate, a la FindController::countStringMatches(). Also, skip counting all the matches if maxMatchCount is 0, to avoid (perhaps slowly) computing a number that would be ignored. 2011-06-07 Lucas Forschler Merged 88127. 2011-06-04 Sam Weinig Reviewed by Anders Carlsson. Disable WebProcess side display throttling when in a user scroll https://bugs.webkit.org/show_bug.cgi?id=62095 Add the ability to disable WebProcess side display throttling that takes place in DrawingAreaImpl::displayTimerFired. Disable the throttling when in a user or animated scroll. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::didStartRubberBandForFrame): (WebKit::WebChromeClient::didCompleteRubberBandForFrame): (WebKit::WebChromeClient::didStartAnimatedScroll): (WebKit::WebChromeClient::didCompleteAnimatedScroll): * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::enableDisplayThrottling): (WebKit::DrawingArea::disableDisplayThrottling): * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::DrawingAreaImpl): (WebKit::DrawingAreaImpl::enableDisplayThrottling): (WebKit::DrawingAreaImpl::disableDisplayThrottling): (WebKit::DrawingAreaImpl::displayTimerFired): * WebProcess/WebPage/DrawingAreaImpl.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::wheelEvent): 2011-06-07 Lucas Forschler Merged 88123. 2011-06-04 Darin Adler Reviewed by Anders Carlsson. [Mac WebKit2] REGRESSION (r86692): Synchronous XMLHttpRequest hangs in credential shim (affects Netgear ReadyNAS admin page) https://bugs.webkit.org/show_bug.cgi?id=62094 rdar://problem/9539204 * WebKit2.xcodeproj/project.pbxproj: Added new source files. * WebProcess/mac/CoreIPCClientRunLoop.h: Added. * WebProcess/mac/CoreIPCClientRunLoop.mm: Added. (-[WKFunctionAdapter perform]): Added. (WebKit::createCoreIPCRunLoopModesArray): Added. (WebKit::coreIPCRunLoopModesArray): Added. (WebKit::callOnCoreIPCClientRunLoopAndWait): Added. * WebProcess/mac/KeychainItemShimMethods.mm: (WebKit::webFreeAttributeListContent): Use callOnCoreIPCClientRunLoopAndWait. (WebKit::webFreeKeychainItemContent): Ditto. (WebKit::webSecKeychainItemCopyContent): Ditto. (WebKit::webSecKeychainItemCreateFromContent): Ditto. (WebKit::webSecKeychainItemModifyContent): Ditto. * WebProcess/mac/SecItemShimMethods.mm: (WebKit::webSecItemCopyMatching): Ditto. (WebKit::webSecItemAdd): Ditto. (WebKit::webSecItemUpdate): Ditto. (WebKit::webSecItemDelete): Ditto. 2011-06-07 Lucas Forschler Merged 88121. 2011-06-04 Sam Weinig Reviewed by Anders Carlsson. WebKit2 needs to know when a scroll is happening due to the ScrollAnimator https://bugs.webkit.org/show_bug.cgi?id=62093 Stub out new ChromeClient functions regarding the start and end of ScrollAnimator animated scrolls, and update logic for rubber-band ending to check for main frame now that it is called for all frames. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::didStartRubberBandForFrame): (WebKit::WebChromeClient::didCompleteRubberBandForFrame): (WebKit::WebChromeClient::didStartAnimatedScroll): (WebKit::WebChromeClient::didCompleteAnimatedScroll): * WebProcess/WebCoreSupport/WebChromeClient.h: 2011-06-07 Lucas Forschler Merged 88075. 2011-06-03 Brady Eidson Reviewed by Steve Falkenburg. and https://bugs.webkit.org/show_bug.cgi?id=62064 WebBackForwardListItem::setBackForwardData actually appends data * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::setBackForwardData): Clear the Vector out before appending the replacement data. 2011-06-07 Lucas Forschler Merged 88048. 2011-06-03 Anders Carlsson Reviewed by Brady Eidson. Disable the sync message timeout for the Microsoft SharePoint plug-in https://bugs.webkit.org/show_bug.cgi?id=62043 * WebProcess/Plugins/PluginProcessConnection.cpp: (WebKit::defaultSyncMessageTimeout): 2011-06-03 Lucas Forschler Merged 87839. 2011-06-01 Jer Noble Reviewed by Maciej Stachowiak. Flash of old video frame at the end of full screen transition https://bugs.webkit.org/show_bug.cgi?id=61752 Add a new method and message, DisposeOfLayerClient, which will invalidate and release the WKRemoteLayerClient used during the full-screen animation. This ensures that the root layer used for the full-screen animation will be in a clean state at the start of the next transition. * UIProcess/WebFullScreenManagerProxy.cpp: (WebKit::WebFullScreenManagerProxy::disposeOfLayerClient): Added. * UIProcess/WebFullScreenManagerProxy.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController exitCompositedModeRepaintCompleted]): Call disposeOfLayerClient. * WebProcess/FullScreen/WebFullScreenManager.h: (WebKit::WebFullScreenManager::disposeOfLayerClient): Added. * WebProcess/FullScreen/WebFullScreenManager.messages.in: Added DisposeOfLayerClient. * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h: * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::disposeOfLayerClient): Added, invalidates and clears m_rootLayerClient. 2011-06-02 Lucas Forschler Merged 87945. 2011-06-02 Anders Carlsson Reviewed by Simon Fraser. Add quirk for plug-ins that return a retained CALayer https://bugs.webkit.org/show_bug.cgi?id=61948 * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::NetscapePluginModule::determineQuirks): Set the ReturnsRetainedCoreAnimationLayer quirk for Flash. * Shared/Plugins/PluginQuirks.h: Add ReturnsRetainedCoreAnimationLayer quirk. * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_GetValue): Handle WKNVExpectsNonretainedLayer by always returning true, and also call NetscapePlugin::setPluginReturnsNonretainedLayer(true) to add a way for plug-ins to opt into returning non-retained layers even if they have the quirk specified. * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::NetscapePlugin): Initialize m_pluginReturnsNonretainedLayer to true. * WebProcess/Plugins/Netscape/NetscapePlugin.h: (WebKit::NetscapePlugin::setPluginReturnsNonretainedLayer): Add setter. * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: (WebKit::NetscapePlugin::platformPostInitialize): If m_pluginReturnsNonretainedLayer is false, adopt the layer. 2011-06-02 Lucas Forschler Merged 87857. 2011-06-01 Sam Weinig Reviewed by Anders Carlsson. Non-users need access to the mds caches for SSL support. * WebProcess/com.apple.WebProcess.sb: 2011-06-02 Lucas Forschler Merged 87768. 2011-05-31 Jer Noble Reviewed by Darin Adler. Flash of black at the end of full screen transition at apple.com product videos https://bugs.webkit.org/show_bug.cgi?id=61756 The @"WebKitLayerHostChanged" notification is causing the QTMovie to tear down its layer (which is good) at the wrong time (which is bad). Send this notification only after the dragImage snapshot is taken. This exposed another problem, that the snapshot has a white background. Set the default background color and transparency for the view (making sure to reset them afterwards) to transparent. * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): 2011-06-02 Lucas Forschler Merged 87804. 2011-06-01 Adam Roben Windows build fix after r87755 * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp: (WebKit::LayerTreeHostCAWin::setLayerFlushSchedulingEnabled): Fixed typo. 2011-06-02 Lucas Forschler Merged 87755. 2011-05-31 Dan Bernstein Reviewed by Simon Fraser. REGRESSION (5.0.5-ToT, WebKit2): Flash to white when navigating between pages on wsj.com, other sites (when navigating away from composited page) https://bugs.webkit.org/show_bug.cgi?id=61808 WebKit1 has a mechanism to prevent the stale bits from the outgoing page from being erased until the incoming page has layout. Adapt this in WebKit2 to prevent the composited layer tree of the outgoing page from being torn down or updated until the incoming page has layout. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidFirstLayout): Unfreeze the layer tree state. (WebKit::WebFrameLoaderClient::frameLoadCompleted): Ditto. (WebKit::WebFrameLoaderClient::provisionalLoadStarted): Freeze the layer tree state. * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::setLayerTreeStateIsFrozen): Added. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::DrawingAreaImpl): Initialize new member variables. (WebKit::DrawingAreaImpl::setLayerTreeStateIsFrozen): Added. When freezing, sets the flag and disables layer flush scheduling and exiting accelerated compositing mode. When unfreezing, clears the flag and exits compositing mode if needed. (WebKit::DrawingAreaImpl::setRootCompositingLayer): Reset m_wantsToExitAcceleratedCompositingMode. (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): Ditto. (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Ditto. (WebKit::DrawingAreaImpl::exitAcceleratedCompositingModeSoon): If the layer tree state is frozen, bail out but set m_wantsToExitAcceleratedCompositingMode. * WebProcess/WebPage/DrawingAreaImpl.h: * WebProcess/WebPage/LayerTreeHost.h: * WebProcess/WebPage/ca/LayerTreeHostCA.cpp: (WebKit::LayerTreeHostCA::LayerTreeHostCA): Initialize m_layerFlushSchedulingEnabled. * WebProcess/WebPage/ca/LayerTreeHostCA.h: * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h: * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm: (WebKit::LayerTreeHostCAMac::scheduleLayerFlush): Bail out if scheduling is not enabled. (WebKit::LayerTreeHostCAMac::setLayerFlushSchedulingEnabled): Added. Sets the flag. If disabling flushing, cancels the pending flush. (WebKit::LayerTreeHostCAMac::flushPendingLayerChangesRunLoopObserverCallback): Added an assertion. * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp: (WebKit::LayerTreeHostCAWin::scheduleLayerFlush): Bail out if scheduling is not enabled. (WebKit::LayerTreeHostCAWin::setLayerFlushSchedulingEnabled): Added. Sets the flag. If disabling flushing, cancels the pending flush. * WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h: 2011-05-29 Mark Rowe Merge r87654. 2011-05-29 Sam Weinig Reviewed by Anders Carlsson. REGRESSION (r87637): nytimes.com freezes after going back to it * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::forceRepaint): Add call to setShouldNotifyAfterNextScheduledLayerFlush(false) to prevent a redundant call to layerHostDidFlushLayers which would cause the layer state to get out of sync with the UIProcess. 2011-05-29 Mark Rowe Merge r87642. 2011-05-29 Anders Carlsson Reviewed by Darin Adler. REGRESSION (87637): Entering WebKit Full Screen mode causes an assertion in DrawingAreaImpl::layerHostDidFlushLayers https://bugs.webkit.org/show_bug.cgi?id=61706 If we've already let the UI process know that we're in compositing mode, we just need to force a repaint. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::forceRepaint): 2011-05-29 Mark Rowe Merge r87652. 2011-05-29 Jer Noble Reviewed by Simon Fraser. REGRESSION (r86924): webkitRequestFullScreen does not work properly (black screen, can’t interact) https://bugs.webkit.org/show_bug.cgi?id=61710 When taking the documentElement full screen, we don't create a RenderFullScreen object and thus never enter accelerated compositing mode for the animation. Tell the WKFullScreenWindowController to enter accelerated compositing mode anyway (with an empty layer context) so as to fulfill its expectations and cause the full screen animation to complete. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Added a comment explaining when we expect the animation to complete. (-[WKFullScreenWindowController enterAcceleratedCompositingMode:WebKit::]): Remove an ASSERT which is no longer valid. * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): Tell the UIProcess to enter then exit full-screen mode. (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto. 2011-05-29 Mark Rowe Merge r87637. 2011-05-29 Darin Adler Reviewed by Anders Carlsson and Simon Fraser. When calling ForceRepaint on a page with accelerated compositing, we can get a race condition where the UI process paints the old content, resulting in showing the previous page. That happens because forceRepaint's callback waits for the next repaint to happen, but nothing notifies UI process that the page is in accelerated compositing mode. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::forceRepaint): Call layerHostDidFlushLayers instead of just calling forceRepaint on the layer tree host. 2011-05-29 Mark Rowe Merge r87638. 2011-05-29 Beth Dakin Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=61700 Need WebKit2 API to get the size of the render tree -and corresponding- * UIProcess/API/C/WKPage.cpp: (WKPageGetRenderTreeSize): * UIProcess/API/C/WKPage.h: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::renderTreeSize): (WebKit::WebPageProxy::setRenderTreeSize): * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::setRenderTreeSize): * WebProcess/WebCoreSupport/WebChromeClient.h: 2011-05-28 Mark Rowe Merge r87624. 2011-05-28 Anders Carlsson Reviewed by Dan Bernstein. REGRESSION (r86578): Flash content missing from mercurynews.com https://bugs.webkit.org/show_bug.cgi?id=61691 If the plug-in doesn't have access to the toplevel URL, make sure to return *something* to the plug-in. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::tryToShortCircuitInvoke): 2011-05-28 Mark Rowe Merge r87627. 2011-05-28 Simon Fraser Reviewed by Dan Bernstein, Maciej Stachowiak. Denying access to your keychain on login crashes WebKit2 https://bugs.webkit.org/show_bug.cgi?id=61695 Fix two sources of crashes if you hit the Deny button when WebKit2 is doing HTTP authentication. First, SecKeychainItemRequestData::attributeList() failed to initialize the length and data members of SecKeychainAttributes in the list if there was no data. This caused invalid memory reads later. Second, returning a non-zero error from the SecKeychainItemCopyContent shim method would cause a later crash in a system framework, which is not set up to handle errors. Instead, we always return noErr, and allow the authentication to fail. Finally, paranoically initialize the SecKeychainItemContext in two places to avoid uninitialized data members, and initialize length and outData to 0 in secKeychainItemCopyContent() in case SecKeychainItemCopyContent() fails to set them on error. * Shared/mac/SecKeychainItemRequestData.cpp: (WebKit::SecKeychainItemRequestData::attributeList): * UIProcess/mac/WebProcessProxyMac.mm: (WebKit::WebProcessProxy::secKeychainItemCopyContent): * WebProcess/mac/KeychainItemShimMethods.mm: (WebKit::webSecKeychainItemCopyContent): (WebKit::webSecKeychainItemCreateFromContent): 2011-05-27 Mark Rowe Merge r87580. 2011-05-27 Stephanie Lewis Unreviewed. Fix a typo in the order_file flag. * Configurations/Base.xcconfig: 2011-05-27 Mark Rowe Merge r87520. 2011-05-27 Stephanie Lewis Rubber Stamped by Adam Roben. Add Order File. Use -order_file flag since it can order more of the binary. * Configurations/Base.xcconfig: * mac/WebKit2.order: Added. 2011-05-27 Mark Rowe Merge r87228. 2011-05-24 Michael Saboff Reviewed by Geoffrey Garen. Improve handling in WebCore of low memory situations https://bugs.webkit.org/show_bug.cgi?id=61222 Added call to enable memory pressure handling for Mac case. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2011-05-27 Mark Rowe Merge r87456. 2011-05-26 Jon Lee Reviewed by Darin Adler. REGRESSION (5.0.5-Jazz): Transition to full screen video animates in wrong location when scrolled (61559) https://bugs.webkit.org/show_bug.cgi?id=61559 The CALayer that gets animated has a position that is offset by the scroll position of the web view. To fix this, we set the destination location based on the rect of the full screen, and add a position animation which keeps the position of the layer centered. This prevents glitches if others are trying to change the layer position while the animation is running. * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h: Refactor the calculation of the CALayer windowed position into a private helper function, as well as the animation setup. * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): (WebKit::WebFullScreenManagerMac::animateFullScreen): Sets up the zoom animation, and the position offset animation. (WebKit::WebFullScreenManagerMac::windowedCGTransform): Calculates the placement of the windowed layer in screen coordinates. 2011-05-27 Mark Rowe Merge r87328. 2011-05-24 Jer Noble Reviewed by Darin Adler. Video fails to play on Vimeo https://bugs.webkit.org/show_bug.cgi?id=61403 * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): Added support for wkAVAssetResolvedURL and wkQTMovieResolvedURL. 2011-05-27 Mark Rowe Merge r87421. 2011-05-25 Brian Weinstein Reviewed by Adam Roben. WebKit2: Status bar, toolbar, and menu bar checks should be in the injected bundle https://bugs.webkit.org/show_bug.cgi?id=61474 * WebProcess/InjectedBundle/API/c/WKBundlePage.h: * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: (WebKit::InjectedBundlePageUIClient::statusBarIsVisible): Call the function on the client if it exists. (WebKit::InjectedBundlePageUIClient::menuBarIsVisible): Ditto. (WebKit::InjectedBundlePageUIClient::toolbarsAreVisible): Ditto. * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::statusbarVisible): Add a possible short-circuit in the injected bundle. (WebKit::WebChromeClient::menubarVisible): Ditto. (WebKit::WebChromeClient::toolbarsVisible): Ditto. 2011-05-27 Mark Rowe Merge r87335. 2011-05-25 Mark Rowe Reviewed by Sam Weinig. Need some way to query user gesture state from injected bundle Add WKBundleIsProcessingUserGesture. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleIsPageBoxVisible): (WKBundleIsProcessingUserGesture): * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::isProcessingUserGesture): * WebProcess/InjectedBundle/InjectedBundle.h: 2011-05-27 Mark Rowe Merge r87397. 2011-05-26 Steve Falkenburg Reviewed by Adam Roben. WebKit2 bundle missing localization subdirectories https://bugs.webkit.org/show_bug.cgi?id=61512 Better fix for this. We just need to specify CFBundleAllowMixedLocalizations. * win/WebKit2WebProcess.resources/English.lproj: Removed. * win/WebKit2WebProcess.resources/Info.plist: * win/WebKit2WebProcess.resources/da.lproj: Removed. * win/WebKit2WebProcess.resources/de.lproj: Removed. * win/WebKit2WebProcess.resources/es.lproj: Removed. * win/WebKit2WebProcess.resources/fi.lproj: Removed. * win/WebKit2WebProcess.resources/fr.lproj: Removed. * win/WebKit2WebProcess.resources/it.lproj: Removed. * win/WebKit2WebProcess.resources/ja.lproj: Removed. * win/WebKit2WebProcess.resources/ko.lproj: Removed. * win/WebKit2WebProcess.resources/nb.lproj: Removed. * win/WebKit2WebProcess.resources/nl.lproj: Removed. * win/WebKit2WebProcess.resources/pl.lproj: Removed. * win/WebKit2WebProcess.resources/pt.lproj: Removed. * win/WebKit2WebProcess.resources/pt_PT.lproj: Removed. * win/WebKit2WebProcess.resources/ru.lproj: Removed. * win/WebKit2WebProcess.resources/sv.lproj: Removed. * win/WebKit2WebProcess.resources/zh_CN.lproj: Removed. * win/WebKit2WebProcess.resources/zh_TW.lproj: Removed. 2011-05-27 Mark Rowe Merge r87305. 2011-05-25 Dan Bernstein Reviewed by Anders Carlsson. REGRESSION (r86851): Plug-ins disappear when scrolled with non-1 page scale https://bugs.webkit.org/show_bug.cgi?id=61448 * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::clipRectInWindowCoordinates): Correct for page scale after intersecting the two rectangles. 2011-05-27 Mark Rowe Merge r87272. 2011-05-24 Maciej Stachowiak Reviewed by Dan Bernstein. Update the WebProcess sandbox exceptions to silence warnings for a file that is accessed uselessly https://bugs.webkit.org/show_bug.cgi?id=61349 * WebProcess/com.apple.WebProcess.sb: 2011-05-27 Mark Rowe Merge r87237. 2011-05-24 Sam Weinig Reviewed by Maciej Stachowiak. Additional sandbox extension required for quarantine database https://bugs.webkit.org/show_bug.cgi?id=61405 * WebProcess/com.apple.WebProcess.sb: Add read-data access for ~/Library/Preferences. 2011-05-27 Mark Rowe Merge r87458. 2011-05-26 Chris Fleizach Reviewed by Darin Adler. Safari's AXFocusedUIElement attribute returns WebArea object with AXSelectedTextMarkerRange of nil https://bugs.webkit.org/show_bug.cgi?id=61492 The method for determining which WebPage is actually focused and foreground was faulty. More extensive checks are required to check which WebPage should be returned as the focusable one. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::windowIsFocused): 2011-05-27 Mark Rowe Merge r87324. 2011-05-25 Jon Honeycutt REGRESSION (WebKit2): Crash in Flash on USA Today photo gallery https://bugs.webkit.org/show_bug.cgi?id=61428 Reviewed by Adam Roben. The crash occurs when Flash posts a message to a window that it creates, and in processing the message, it calls NPN_Evaluate to evaluate JavaScript that removes the plug-in from the page. Flash then crashes when we return to Flash code. * Platform/WorkItem.h: (DerefWorkItem::DerefWorkItem): Initialize m_ptr. (DerefWorkItem::execute): Deref the object. (WorkItem::createDeref): Create and return a DerefWorkItem. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::unprotectPluginFromDestruction): If the PluginView has only one reference left, deref it asynchronously. 2011-05-27 Mark Rowe Merge r87253. 2011-05-24 Sam Weinig Reviewed by Maciej Stachowiak. Enable coalesced wheel events * UIProcess/WebPageProxy.cpp: Flip the switch for coalescing wheel events rather than dropping them. 2011-05-27 Mark Rowe Merge r87275. 2011-05-24 Timothy Hatcher Make the Web Inspector bring the right window to the front when docked. rdar://problem/9464685 https://webkit.org/b/61420 Reviewed by Brian Weinstein. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformBringToFront): Order front the parent window of the Inspector's WKView. * UIProcess/win/WebInspectorProxyWin.cpp: (WebKit::WebInspectorProxy::platformBringToFront): Ditto. 2011-05-26 Lucas Forschler Merge r87225. 2011-05-24 Mark Rowe Fix the 32-bit build. Explicitly use uint32_t when encoding / decoding a type that is a typedef of OSType, as this is declared as different underlying types in 32- and 64-bit (unsigned long vs unsigned int). * Shared/mac/KeychainAttribute.cpp: (CoreIPC::encode): (CoreIPC::decode): 2011-05-26 Lucas Forschler Merge r87221. 2011-05-24 Brady Eidson Reviewed by Darin Adler. Part of and https://bugs.webkit.org/show_bug.cgi?id=61334 Should shim a few SecKeychainItem* methods on SnowLeopard Initialize the KeychainItem shim on SnowLeopard: * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::initializeShim): On SnowLeopard, shim the 4 SecKeychainItem methods: * WebProcess/mac/WebProcessShim.h: * WebProcess/mac/WebProcessShim.mm: (WebKit::shimSecKeychainItemCopyContent): (WebKit::shimSecKeychainItemCreateFromContent): (WebKit::shimSecKeychainItemModifyContent): (WebKit::shimSecKeychainItemFreeContent): (WebKit::WebKitWebProcessKeychainItemShimInitialize): * WebProcess/mac/KeychainItemShimMethods.h: Added. * WebProcess/mac/KeychainItemShimMethods.mm: Added. Manage a set of shim-controlled AttributeList data: (WebKit::shimManagedAttributeLists): (WebKit::freeAttributeListContents): (WebKit::allocateAttributeListContents): Manage a set of shim-controlled KeychainItem data: (WebKit::shimManagedKeychainItemContents): (WebKit::allocateKeychainItemContentData): Free any shim-controlled AttributeList or KeychainItem data: (WebKit::webFreeAttributeListContentOnMainThread): (WebKit::webFreeAttributeListContent): (WebKit::webFreeKeychainItemContentOnMainThread): (WebKit::webFreeKeychainItemContent): Marshall these 3 KeychainItem methods to the UIProcess: (WebKit::webSecKeychainItemCopyContentOnMainThread): (WebKit::webSecKeychainItemCopyContent): (WebKit::webSecKeychainItemCreateFromContentOnMainThread): (WebKit::webSecKeychainItemCreateFromContent): (WebKit::webSecKeychainItemModifyContentOnMainThread): (WebKit::webSecKeychainItemModifyContent): (WebKit::initializeKeychainItemShim): Container for an AttributeList entry that knows how to encode/decode: * Shared/mac/KeychainAttribute.cpp: Added. (WebKit::KeychainAttribute::KeychainAttribute): (CoreIPC::encode): (CoreIPC::decode): * Shared/mac/KeychainAttribute.h: Added. Container for the relevant arguments to the shimmed methods, to send to the UIProcess: * Shared/mac/SecKeychainItemRequestData.cpp: Added. (WebKit::SecKeychainItemRequestData::SecKeychainItemRequestData): (WebKit::SecKeychainItemRequestData::initializeWithAttributeList): (WebKit::SecKeychainItemRequestData::~SecKeychainItemRequestData): (WebKit::SecKeychainItemRequestData::attributeList): (WebKit::SecKeychainItemRequestData::encode): (WebKit::SecKeychainItemRequestData::decode): * Shared/mac/SecKeychainItemRequestData.h: Added. (WebKit::SecKeychainItemRequestData::keychainItem): (WebKit::SecKeychainItemRequestData::itemClass): (WebKit::SecKeychainItemRequestData::length): (WebKit::SecKeychainItemRequestData::data): Container for the possible output from the shimmed methods, to send back to the WebProcess: * Shared/mac/SecKeychainItemResponseData.cpp: Added. (WebKit::SecKeychainItemResponseData::SecKeychainItemResponseData): (WebKit::SecKeychainItemResponseData::encode): (WebKit::SecKeychainItemResponseData::decode): * Shared/mac/SecKeychainItemResponseData.h: Added. (WebKit::SecKeychainItemResponseData::itemClass): (WebKit::SecKeychainItemResponseData::data): (WebKit::SecKeychainItemResponseData::resultCode): (WebKit::SecKeychainItemResponseData::attributes): 2011-05-24 Lucas Forschler Rollout r87221. 2011-05-24 Lucas Forschler Merged r87179. 2011-05-24 Adam Roben Invalidate JSNPObjects when they are finalized This will cause the underlying NPObject to be released at finalization time, rather than at destruction time (which is unpredictable and could occur after the plugin has been unloaded). Test: plugins/npobject-js-wrapper-destroyed-after-plugin-unload.html Fixes Crash in deallocateNPObject when reloading yahoo.com webarchive in WebKit2 Reviewed by Oliver Hunt. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::~JSNPObject): Assert that we've already been invalidated, rather than trying to perform invalidation now (when the plugin might already be unloaded). * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::getOrCreateJSObject): (WebKit::NPRuntimeObjectMap::invalidate): Updated for m_jsNPObjects type change. (WebKit::NPRuntimeObjectMap::finalize): Added. Invalidates the JSNPObject and removes it from the map. * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: Now inherits from WeakHandleOwner. Changed m_jsNPObjects from a WeakGCMap to a HashMap of JSC::Weak objects so that we will be notified when the JSNPObjects are finalized. 2011-05-24 Lucas Forschler Merged r87170. 2011-05-24 Sam Weinig Reviewed by John Sullivan. WebKit tells client that the page has become unresponsive while the beforeUnloadConfirm dialog is up https://bugs.webkit.org/show_bug.cgi?id=61372 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Stop the unresponsiveness timer like we do for other client functions that spin a runloop. 2011-05-24 Lucas Forschler Merged r87221. 2011-05-24 Brady Eidson Reviewed by Darin Adler. Part of and https://bugs.webkit.org/show_bug.cgi?id=61334 Should shim a few SecKeychainItem* methods on SnowLeopard Initialize the KeychainItem shim on SnowLeopard: * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::initializeShim): On SnowLeopard, shim the 4 SecKeychainItem methods: * WebProcess/mac/WebProcessShim.h: * WebProcess/mac/WebProcessShim.mm: (WebKit::shimSecKeychainItemCopyContent): (WebKit::shimSecKeychainItemCreateFromContent): (WebKit::shimSecKeychainItemModifyContent): (WebKit::shimSecKeychainItemFreeContent): (WebKit::WebKitWebProcessKeychainItemShimInitialize): * WebProcess/mac/KeychainItemShimMethods.h: Added. * WebProcess/mac/KeychainItemShimMethods.mm: Added. Manage a set of shim-controlled AttributeList data: (WebKit::shimManagedAttributeLists): (WebKit::freeAttributeListContents): (WebKit::allocateAttributeListContents): Manage a set of shim-controlled KeychainItem data: (WebKit::shimManagedKeychainItemContents): (WebKit::allocateKeychainItemContentData): Free any shim-controlled AttributeList or KeychainItem data: (WebKit::webFreeAttributeListContentOnMainThread): (WebKit::webFreeAttributeListContent): (WebKit::webFreeKeychainItemContentOnMainThread): (WebKit::webFreeKeychainItemContent): Marshall these 3 KeychainItem methods to the UIProcess: (WebKit::webSecKeychainItemCopyContentOnMainThread): (WebKit::webSecKeychainItemCopyContent): (WebKit::webSecKeychainItemCreateFromContentOnMainThread): (WebKit::webSecKeychainItemCreateFromContent): (WebKit::webSecKeychainItemModifyContentOnMainThread): (WebKit::webSecKeychainItemModifyContent): (WebKit::initializeKeychainItemShim): Container for an AttributeList entry that knows how to encode/decode: * Shared/mac/KeychainAttribute.cpp: Added. (WebKit::KeychainAttribute::KeychainAttribute): (CoreIPC::encode): (CoreIPC::decode): * Shared/mac/KeychainAttribute.h: Added. Container for the relevant arguments to the shimmed methods, to send to the UIProcess: * Shared/mac/SecKeychainItemRequestData.cpp: Added. (WebKit::SecKeychainItemRequestData::SecKeychainItemRequestData): (WebKit::SecKeychainItemRequestData::initializeWithAttributeList): (WebKit::SecKeychainItemRequestData::~SecKeychainItemRequestData): (WebKit::SecKeychainItemRequestData::attributeList): (WebKit::SecKeychainItemRequestData::encode): (WebKit::SecKeychainItemRequestData::decode): * Shared/mac/SecKeychainItemRequestData.h: Added. (WebKit::SecKeychainItemRequestData::keychainItem): (WebKit::SecKeychainItemRequestData::itemClass): (WebKit::SecKeychainItemRequestData::length): (WebKit::SecKeychainItemRequestData::data): Container for the possible output from the shimmed methods, to send back to the WebProcess: * Shared/mac/SecKeychainItemResponseData.cpp: Added. (WebKit::SecKeychainItemResponseData::SecKeychainItemResponseData): (WebKit::SecKeychainItemResponseData::encode): (WebKit::SecKeychainItemResponseData::decode): * Shared/mac/SecKeychainItemResponseData.h: Added. (WebKit::SecKeychainItemResponseData::itemClass): (WebKit::SecKeychainItemResponseData::data): (WebKit::SecKeychainItemResponseData::resultCode): (WebKit::SecKeychainItemResponseData::attributes): (WebKit::SecKeychainItemResponseData::keychainItem): Actually implement the calls to the SecKeychainItem* methods in the UIProcess: * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * UIProcess/mac/WebProcessProxyMac.mm: (WebKit::WebProcessProxy::secKeychainItemCopyContent): (WebKit::WebProcessProxy::secKeychainItemCreateFromContent): (WebKit::WebProcessProxy::secKeychainItemModifyContent): * WebKit2.xcodeproj/project.pbxproj: Project file stuff * Configurations/Shim.xcconfig: 2011-05-24 Lucas Forschler Merged r87154. 2011-05-24 Brady Eidson Build fix after r87153 * WebProcess/mac/SecItemShimMethods.mm: Don't compile this code on SnowLeopard. 2011-05-24 Lucas Forschler Merged r87153. 2011-05-23 Brady Eidson Reviewed by Sam Weinig. Part of and https://bugs.webkit.org/show_bug.cgi?id=61334 Should shim a few SecKeychainItem* methods on SnowLeopard In preparation for different WebProcess shims depending on platform, move the current shim to its own files. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::initializeShim): For non-SnowLeopard platforms, call initializeSecItemShim(). * WebProcess/mac/SecItemShimMethods.h: Added. * WebProcess/mac/SecItemShimMethods.mm: Added. Actual webSecItem* methods moved from WebProcessMac.mm. (WebKit::webSecItemCopyMatchingMainThread): (WebKit::webSecItemCopyMatching): (WebKit::webSecItemAddOnMainThread): (WebKit::webSecItemAdd): (WebKit::webSecItemUpdateOnMainThread): (WebKit::webSecItemUpdate): (WebKit::webSecItemDeleteOnMainThread): (WebKit::webSecItemDelete): (WebKit::initializeSecItemShim): Initialize the callbacks via WebKitWebProcessSecItemShimInitialize * WebProcess/mac/WebProcessShim.h: * WebProcess/mac/WebProcessShim.mm: Wrap all the actual code here in a !BUILDING_ON_SNOW_LEOPARD block (WebKit::shimSecItemCopyMatching): (WebKit::shimSecItemAdd): (WebKit::shimSecItemUpdate): (WebKit::shimSecItemDelete): (WebKit::WebKitWebProcessSecItemShimInitialize): 2011-05-24 Lucas Forschler Merged r87119. 2011-05-23 Anders Carlsson Reviewed by Sam Weinig. Cap painting to 30fps on Windows https://bugs.webkit.org/show_bug.cgi?id=61337 * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::displayTimerFired): 2011-05-24 Lucas Forschler Merged r87102. 2011-05-20 Jer Noble Reviewed by Darin Adler. Video looks squished when animating to full screen. https://bugs.webkit.org/show_bug.cgi?id=61220 Instead of scaling between the client sizes of the full-screen element before and after entering full-screen, scale between their content boxes. The difference is that the client sizes can have different aspect ratios, and thus the animation can end up "squishing" the content at one end of the animation. When animating between the two content box sizes, their aspect ratios (for the case of video) are equal, so the animation will appear to scale smoothly between the two states without "squishing" the content. * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): Set the destination frame to be the content box of the current full screen element. (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto. 2011-05-24 Lucas Forschler Merged r87113. 2011-05-23 Jeremy Noble Reviewed by Darin Adler. REGRESSION (r86990:86992): World leak when all windows closed https://bugs.webkit.org/show_bug.cgi?id=61311 Three interlocking problems: 1) Calling [WKView fullScreenController] will create the controller if it doesn't all ready exist, so move the closing code into WKView, where we can bail early if there isn't a controller. 2) A retain-cycle exists between WKView and WKFullScreenWindowController. Make sure to break the cycle explicitly by clearing the _fullScreenWindowController ivar when closing the controller. 3) [NSWindowController close] was overridden without calling [super close]. Do that. * UIProcess/API/mac/WKView.mm: (-[WKView closeFullScreenWindowController]): Moved here from WebFullScreenManagerProxyMac.mm. * UIProcess/API/mac/WKViewInternal.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController close]): Call [super close]. * UIProcess/mac/WebFullScreenManagerProxyMac.mm: (WebKit::WebFullScreenManagerProxy::invalidate): 2011-05-24 Lucas Forschler Merged r87093. 2011-05-23 Sam Weinig Reviewed by Darin Adler. Terminating a WebProcess should work even while a page is being closed https://bugs.webkit.org/show_bug.cgi?id=61299 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::terminateProcess): Change validity check to only check for process validity, since terminating the process of a page that is closed or is closing is acceptable behavior. 2011-05-24 Lucas Forschler Merged r87077. 2011-05-23 Jessie Berlin Reviewed by Darin Adler. [Windows] Initial Cookie Accept Policy not set on Deserialized Storage Session. https://bugs.webkit.org/show_bug.cgi?id=61255 * WebProcess/win/WebProcessWin.cpp: (WebKit::WebProcess::platformInitializeWebProcess): Move the code to set the cookie policy before the early return that is taken when using the default storage session from the UI Process. Also, remove unnecessary #ifdefs (USE(CFURLSTORAGESESSIONS) is true if USE(CFNETWORK) is true) and add a comment explaining the early return. 2011-05-24 Lucas Forschler Merged r87046. 2011-05-21 John Sullivan Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=61244 Undo operations for a web page linger after page is destroyed * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::closePage): Clear editing commands before telling UI client to close the page (this must be done while the page is still in a window so its undo manager can be accessed, so waiting for WebPageProxy::close() is too late). 2011-05-24 Lucas Forschler Merged r87005. 2011-05-20 Jeremy Noble Reviewed by Mark Rowe. Crash in WebFullScreenManager::didExitFullScreen when closing a window in Safari. https://bugs.webkit.org/show_bug.cgi?id=61228 Do not attempt to exit full screen if we aren't in full screen to begin with, as the WebProcess won't be expecting will/didExitFullScreen notifications. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController close]): 2011-05-24 Steve Falkenburg Reviewed by Adam Roben. Disable features on safari-534-branch. * Configurations/FeatureDefines.xcconfig: 2011-05-24 Lucas Forschler Merged r86995. 2011-05-20 Andy Estes Reviewed by Darin Adler. WebView loses firstResponder status when entering full-screen mode. https://bugs.webkit.org/show_bug.cgi?id=61153 * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): If the WebView was a descendant of the browser window's first responder when entering full-screen mode, set the full-screen window's first responder to that same NSResponder. (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Do the reverse of what is done in finishedEnterFullScreenAnimation:. 2011-05-24 Lucas Forschler Merged r86992. 2011-05-20 Jeremy Noble Reviewed by Maciej Stachowiak. WebKit2: Exit full screen mode if the WebProcess crashes. https://bugs.webkit.org/show_bug.cgi?id=61151 If the WebProcess crashes, exit full-screen mode to avoid getting stuck. Move the WebFullScreenManagerProxy::invalidate() implementation into the platform-specific files, and have them close their respective platform's full-screen window. * UIProcess/WebFullScreenManagerProxy.cpp: * UIProcess/gtk/WebFullScreenManagerProxyGtk.cpp: (WebKit::WebFullScreenManagerProxy::invalidate): Added. Copied from main implementation. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController close]): Added. * UIProcess/mac/WebFullScreenManagerProxyMac.mm: (WebKit::WebFullScreenManagerProxy::invalidate): Added. * UIProcess/win/WebFullScreenManagerProxyWin.cpp: (WebKit::WebFullScreenManagerProxy::invalidate): Added. 2011-05-24 Lucas Forschler Merged r87022. 2011-05-21 Jeremy Noble Reviewed by Eric Carlson. WebKit2: fix failing fullscreen/full-screen-remove* tests. https://bugs.webkit.org/show_bug.cgi?id=61027 * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp: (WebKit::InjectedBundlePageFullScreenClient::exitFullScreenForElement): Call the exit functions (was calling the enter functions). 2011-05-23 Lucas Forschler Merge r86985. 2011-05-20 Matthew Delaney Reviewed by Steve Falkenburg. Default min DOM Timer interval is not set soon enough for first page to pick it up in WK2 https://bugs.webkit.org/show_bug.cgi?id=61215 * WebProcess/WebPage/WebPage.cpp: Simply moving the DOM min timer interval setting to before the first page creation. 2011-05-22 John Sullivan Rolled out , which I accidentally checked into the branch instead of trunk. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::closePage): 2011-05-22 Lucas Forschler Merge r86967. 2011-05-20 Sam Weinig Reviewed by Anders Carlsson. WebKit2: Media files cannot be saved in the Application Cache due to a sandbox violation https://bugs.webkit.org/show_bug.cgi?id=61199 Instead of using a sandbox extension to give permission to the application cache directory, initialize the sandbox with access to it like we do for other databases. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureWebProcess): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/com.apple.WebProcess.sb: * WebProcess/mac/WebProcessMac.mm: (WebKit::initializeSandbox): 2011-05-22 Lucas Forschler Merge r86956. 2011-05-20 Jer Noble Reviewed by Maciej Stachowiak. Win: non-full-screen content is briefly seen when entering full-screen mode (and vice versa) https://bugs.webkit.org/show_bug.cgi?id=61108 When the fullScreenController asks us to repaint, make an async repaint request, and when the callback is fired, notify the fullScreenController that repaint has completed. * UIProcess/win/WebView.cpp: (WebKit::fullScreenClientForceRepaintCompleted): Added. (WebKit::WebView::fullScreenClientForceRepaint): Added. * UIProcess/win/WebView.h: 2011-05-22 Lucas Forschler Merge r86924. 2011-05-19 Jer Noble Reviewed by Maciej Stachowiak. WebKit2: Flashing when entering and exiting full screen mode https://bugs.webkit.org/show_bug.cgi?id=56957 In the WKFullscreenWindowController, when exiting accelerated compositing mode, force a repaint, and don't actually remove the animation layer until the repaint completes. Also, move back to parenting the WebView in a layer-backed view, and work around the SnowLeopard bug which causes a crash in those situations. We no longer need to do a bunch of work in finishedEnterFullScreenAnimation, because the animation layer is "hiding" all the drawing happening in the webView underneath. In the WebFullScreenManagerMac, when asked to tear down the root layer, instead remove all its children, and set its contents to a flattened image of the full screen element and its children. This helps patch over the time where everything is re-rendering and helps give the appearance of continuousness in the animation. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): (-[WKFullScreenWindowController beganExitFullScreenAnimation]): (-[WKFullScreenWindowController enterAcceleratedCompositingMode:WebKit::]): (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): (-[WKFullScreenWindowController exitCompositedModeRepaintCompleted]): (exitCompositedModeRepaintCompleted): (-[WKFullScreenWindowController _page]): (-[WKFullScreenWindowController _manager]): (-[WKFullScreenWindow initWithContentRect:styleMask:backing:defer:]): * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): 2011-05-22 Lucas Forschler Merge r86895. 2011-05-19 Anders Carlsson Reviewed by Sam Weinig. Hang UI appears when WebProcess isn't running https://bugs.webkit.org/show_bug.cgi?id=61147 This fixes two bugs: 1. The HistoryClient related message handlers in WebContext could get invoked for pages that have been closed, and thus didn't have any subframes. Since we have a MESSAGE_CHECK that checks that the frame exists, we'd mark the currently dispatched message as invalid, which would end up calling Connection::Client::didReceiveInvalidMessage. Fix this by checking that the page exists first. 2. In the call to WebProcessProxy::didReceiveInvalidMessage we'd first invalidate the CoreIPC connection to make sure that we won't get any further messages from this connection. We'd then go ahead and terminate the web process, but because we've already invalidated the CoreIPC connection we would never get the Connection::Client::didClose callback that would call WebPageProxy::processDidCrash. Fix this by explicitly calling WebProcessProxy::didClose. Also, add logging when we receive an invalid message * UIProcess/WebContext.cpp: (WebKit::WebContext::didNavigateWithNavigationData): (WebKit::WebContext::didPerformClientRedirect): (WebKit::WebContext::didPerformServerRedirect): (WebKit::WebContext::didUpdateHistoryTitle): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didReceiveInvalidMessage): 2011-05-21 John Sullivan Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=61244 Undo operations for a web page linger after page is destroyed * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::closePage): Clear editing commands before telling UI client to close the page (this must be done while the page is still in a window so its undo manager can be accessed, so waiting for WebPageProxy::close() is too late). 2011-05-19 Lucas Forschler Reviewed by Anders Carlsson. Plug-ins at YouTube, cnn.com, nytimes vanish when their top/left is scrolled out of view when zoomed https://bugs.webkit.org/show_bug.cgi?id=61101 Scale both bounding boxes sent to m_plugin->geometryDidChange(), not just the frameRect. This fools the plugin into thinking it is drawing into an unscaled box with an unscaled view even when scaled. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::frame):Made this const so it can be used in clipRectInWindowCoordinates() (WebKit::PluginView::viewGeometryDidChange):Used IntRect::scale() rather than scaling by hand (WebKit::PluginView::clipRectInWindowCoordinates):Added scale of clipRect. * WebProcess/Plugins/PluginView.h: 2011-05-19 Lucas Forschler As originally reviewed by Anders Carlsson. and https://bugs.webkit.org/show_bug.cgi?id=61009 Processes spawned by SnowLeopard's WebProcess attempt to install WebKit2 shims. Restore r86797 to how it was supposed to be using the appropriate #ifdef, reverting the temporary r86814 in the process. The #ifdef is BUILDING_ON_SNOW_LEOPARD, not BUILDING_ON_SNOWLEOPARD! * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * WebProcess/mac/WebProcessMainMac.mm: (WebKit::WebProcessMain): 2011-05-19 Lucas Forschler Fix the WK2 SnowLeopard layouttests (again) until I can explore on a SnowLeopard machine tomorrow. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * WebProcess/mac/WebProcessMainMac.mm: (WebKit::WebProcessMain): 2011-05-19 Lucas Forschler Reviewed by Maciej Stachowiak. WK2: VoiceOver cannot move focus into a web area programmatically https://bugs.webkit.org/show_bug.cgi?id=60661 Add a makeFirstResponder method that will bring focus to the widget view within the UI process. * UIProcess/API/mac/PageClientImpl.h: * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::makeFirstResponder): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::makeFirstResponder): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::makeFirstResponder): * WebProcess/WebCoreSupport/WebChromeClient.h: 2011-05-19 Lucas Forschler Update the the context menu to reflect the system search provider on Mac. Reviewed by Sam Weinig. * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: (WebKit::WebContextMenuClient::searchWithGoogle): Add a FIXME about using NSPerformService on Mac. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): Added CopyDefaultSearchProviderDisplayName. 2011-05-19 Lucas Forschler Reviewed by Anders Carlsson. and https://bugs.webkit.org/show_bug.cgi?id=61009 Processes spawned by SnowLeopard's WebProcess attempt to install WebKit2 shims. If the WebProcess or PluginProcess forks, it shouldn't pass WebKit2 shims along to the new process in the DYLD_INSERT_LIBRARIES environment variable. Add Environment Utilities helper to strip unwanted values from an environment variable: * Platform/unix/EnvironmentUtilities.cpp: Added. (WebKit::EnvironmentUtilities::stripValuesEndingWithString): * Platform/unix/EnvironmentUtilities.h: Added. * WebKit2.xcodeproj/project.pbxproj: Strip PluginProcessShim.dylib from DYLD_INSERT_LIBRARIES: * PluginProcess/mac/PluginProcessMainMac.mm: (WebKit::PluginProcessMain): Strip WebProcessShim.dylib from DYLD_INSERT_LIBRARIES: * WebProcess/mac/WebProcessMainMac.mm: (WebKit::WebProcessMain): Unprotect SnowLeopard now that it will behave and not spawn processes trying to use WebKit2 shims: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): 2011-05-19 Lucas Forschler Reviewed by Simon Fraser. Crash in injected bundle client https://bugs.webkit.org/show_bug.cgi?id=61086 * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: (WebKit::InjectedBundlePageUIClient::shouldRubberBandInDirection): Check for existence of method in client prior to calling. 2011-05-19 Lucas Forschler Reviewed by Darin Adler. Exiting full screen will leave up invisible full-screen window, blocking all mouse clicks. https://bugs.webkit.org/show_bug.cgi?id=60982 The GraphicsLayer tree has unparented m_fullScreenRootLayer behind our backs, replacing the tiled layer with a normal one. Instead of holding on to a specific layer, assume that the w_rootLayer will only have 0 or 1 children, and if a child is present, then that is our full- screen layer. Additionally, check to see if the animating layer's presentationLayer is nil before calling it; asking a nil object for a CATransform3D will give back a struct full of garbage. In WKFullScreenWindowController, when the exit animation completes, ignore the "completed" parameter. This eliminates the possibility that the full screen window will end up left on top of the screen if the animation is cancelled and a enter full screen animation isn't forthcoming. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h: * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): 2011-05-19 Lucas Forschler Merge r86734. 2011-05-17 Dan Bernstein Reviewed by Alice Liu. REGRESSION (r86724): Repro crash loading any webpage in WebKit2 on SnowLeopard https://bugs.webkit.org/show_bug.cgi?id=61022 * WebProcess/mac/WebProcessMainMac.mm: (WebKit::WebProcessMain): As long as we are not loading the shim on Snow Leopard, we should not try to initialize it. 2011-05-17 Sheriff Bot Unreviewed, rolling out r86668. http://trac.webkit.org/changeset/86668 https://bugs.webkit.org/show_bug.cgi?id=61001 It made 52 tests crash on Qt WK2 bot (Requested by Ossy on #webkit). * UIProcess/API/qt/qgraphicswkview.cpp: * UIProcess/API/qt/qgraphicswkview.h: * UIProcess/API/qt/qwkpage.cpp: (QWKPagePrivate::createDrawingAreaProxy): 2011-05-17 Brian Weinstein Build fix after r86717. * UIProcess/API/C/win/WKView.h: Add a forward declaration of IDropTarget 2011-05-17 Brian Weinstein Reviewed by Adam Roben. WebKit2: Needs API to set a custom drop target https://bugs.webkit.org/show_bug.cgi?id=60991 Add API to set a custom drop target on a WKView. * UIProcess/API/C/win/WKView.cpp: (WKViewSetCustomDropTarget): Call through to WebView::setCustomDropTarget. * UIProcess/API/C/win/WKView.h: * UIProcess/win/WebView.cpp: (WebKit::WebView::setCustomDropTarget): Revoke the current drop target, and register the custom one. * UIProcess/win/WebView.h: 2011-05-17 Sam Weinig Reviewed by Dan Bernstein. Add API to determine if a frame has any form elements without going to javascript https://bugs.webkit.org/show_bug.cgi?id=60999 * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: (WKBundleFrameContainsAnyFormElements): * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::containsAnyFormElements): * WebProcess/WebPage/WebFrame.h: Add WKBundleFrameContainsAnyFormElements which does a walk of the document to determine if there are any form elements. 2011-05-17 Andreas Kling Reviewed by Kenneth Rohde Christiansen. [Qt][WK2] Initial support for favicons. https://bugs.webkit.org/show_bug.cgi?id=58937 Add the following API to QWKContext: - void setIconDatabasePath(QString) - void iconChangedForPageURL(QUrl) [signal] - QIcon iconForPageURL(QUrl) This is mostly analogous to the QWebSettings/QWebFrame icon API we had in WebKit1. * UIProcess/API/qt/ClientImpl.h: Added WKIconDatabaseClient methods. * UIProcess/API/qt/ClientImpl.cpp: (toQWKContext): Helper to cast from "void* clientInfo" to a QWKContext*. (qt_wk_didChangeIconForPageURL): Emits QWKContext::iconChangedForPageURL(QUrl). (qt_wk_didRemoveAllIcons): Stub. * UIProcess/API/qt/qwkcontext.h: * UIProcess/API/qt/qwkcontext_p.h: * UIProcess/API/qt/qwkcontext.cpp: (QWKContextPrivate::QWKContextPrivate): Set up and register a WKIconDatabaseClient. (QWKContext::QWKContext): Minor refactor to avoid code duplication in constructors. (QWKContext::setIconDatabasePath): Exactly what it sounds like. (QWKContext::iconForPageURL): Retrieves the favicon for a given page URL as a QIcon. * WebKit2API.pri: Add WKIconDatabase.cpp and WKIconDatabase.h to build. 2011-05-17 Brady Eidson Reviewed by Anders Carlsson. Part 4 of and https://bugs.webkit.org/show_bug.cgi?id=60595 Mac WebKit2 WebProcess needs a shim to make prompts appear to be from the UIProcess This patch actually hooks up the shim to the WebProcess shim callbacks, which messages these 4 calls up to the UIProcess and returns the result. Note that this patch uncovered the fact that CoreIPC can't sync message out from a secondary thread, so I filed https://bugs.webkit.org/show_bug.cgi?id=60975 as a followup to allow that. * Shared/mac/SecItemResponseData.cpp: (WebKit::SecItemResponseData::SecItemResponseData): Reorder the constructor arguments to be a little cleaner. * Shared/mac/SecItemResponseData.h: Call the shim callbacks for each method: * WebProcess/mac/WebProcessShim.mm: (WebKit::shimSecItemCopyMatching): (WebKit::shimSecItemAdd): (WebKit::shimSecItemUpdate): (WebKit::shimSecItemDelete): Implement the shim callbacks, which each marshall to the main thread, which then calls out to CoreIPC: * WebProcess/mac/WebProcessMac.mm: (WebKit::WebSecItemCopyMatchingMainThread): (WebKit::WebSecItemCopyMatching): (WebKit::WebSecItemAddOnMainThread): (WebKit::WebSecItemAdd): (WebKit::WebSecItemUpdateOnMainThread): (WebKit::WebSecItemUpdate): (WebKit::WebSecItemDeleteOnMainThread): (WebKit::WebSecItemDelete): Add the 4 messages and their implementations in the UIProcess: * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * UIProcess/mac/WebProcessProxyMac.mm: Added. (WebKit::WebProcessProxy::secItemCopyMatching): (WebKit::WebProcessProxy::secItemAdd): (WebKit::WebProcessProxy::secItemUpdate): (WebKit::WebProcessProxy::secItemDelete): * WebKit2.xcodeproj/project.pbxproj: 2011-05-17 Anders Carlsson Reviewed by Dan Bernstein. Incomplete page painting at dropbox.com https://bugs.webkit.org/show_bug.cgi?id=60974 When we're exiting compositing mode and haven't sent an EnterAcceleratedCompositingMode message to the UI process, we still need to send the updated bits to the ui process. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): 2011-05-17 Brady Eidson Reviewed by Anders Carlsson. Part 3 of and https://bugs.webkit.org/show_bug.cgi?id=60595 Mac WebKit2 WebProcess needs a shim to make prompts appear to be from the UIProcess Add CoreIPC stuff we'll need to marshall the SecItem calls to the UIProcess and back. Teach ArgumentCodersCF about CFDateRef, SecKeychainItemRef, and generic CFTypeRefs: * Shared/cf/ArgumentCodersCF.cpp: (CoreIPC::typeFromCFTypeRef): (CoreIPC::encode): (CoreIPC::decode): * Shared/cf/ArgumentCodersCF.h: Serializable object that contains the query CFDictionaryRef and optionally the "attributesToMatch" CFDictionaryRef: * Shared/mac/SecItemRequestData.cpp: Added. (WebKit::SecItemRequestData::SecItemRequestData): (WebKit::SecItemRequestData::encode): (WebKit::SecItemRequestData::decode): * Shared/mac/SecItemRequestData.h: Added. (WebKit::SecItemRequestData::query): (WebKit::SecItemRequestData::attributesToMatch): Serializable object that returns an OSStatus and optionally a "result object" CFTypeRef: * Shared/mac/SecItemResponseData.cpp: Added. (WebKit::SecItemResponseData::SecItemResponseData): (WebKit::SecItemResponseData::encode): (WebKit::SecItemResponseData::decode): * Shared/mac/SecItemResponseData.h: Added. (WebKit::SecItemResponseData::resultObject): (WebKit::SecItemResponseData::resultCode): * WebKit2.xcodeproj/project.pbxproj: 2011-05-17 Brady Eidson Reviewed by Anders Carlsson. Part 2 of and https://bugs.webkit.org/show_bug.cgi?id=60595 Mac WebKit2 WebProcess needs a shim to make prompts appear to be from the UIProcess Hookup some of the methods we plan to shim in the patch, but just have them call through to the actual implementations for now. Also stub-out the future shimmed versions of the methods. * WebProcess/mac/WebProcessShim.h: Add the methods to the shim callbacks. * WebProcess/mac/WebProcessShim.mm: (WebKit::shimSecItemCopyMatching): Call through to the actual function for now. (WebKit::shimSecItemAdd): Ditto. (WebKit::shimSecItemUpdate): Ditto. (WebKit::shimSecItemDelete): Ditto. (WebKit::WebKitWebProcessShimInitialize): Copy over the shim callbacks. * WebKit2.xcodeproj/project.pbxproj: Link the shim to required frameworks. * WebProcess/mac/WebProcessMac.mm: (WebKit::WebSecItemCopyMatching): Add placeholders for the future to-be-shimmed functions. (WebKit::WebSecItemAdd): Ditto. (WebKit::WebSecItemUpdate): Ditto. (WebKit::WebSecItemDelete): Ditto. (WebKit::WebProcess::initializeShim): Pass along those placeholders to the shim initializer. 2011-05-17 Brady Eidson Reviewed by Anders Carlsson. Part 1 of and https://bugs.webkit.org/show_bug.cgi?id=60595 Mac WebKit2 WebProcess needs a shim to make prompts appear to be from the UIProcess Add am empty shim for a new WebProcess shim and install it at launch. Use the same Shim.xcconfig for both the web and plugin processes: * Configurations/PluginProcessShim.xcconfig: Removed. * Configurations/Shim.xcconfig: Copied from Configurations/PluginProcessShim.xcconfig. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.h: Add initializeShim() for Mac-only * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::initializeShim): Initialize the (empty) shim callbacks. * WebProcess/mac/WebProcessMainMac.mm: (WebKit::WebProcessMain): Call initializeShim() * WebProcess/mac/WebProcessShim.h: Added. * WebProcess/mac/WebProcessShim.mm: Added. (WebKit::WebKitWebProcessShimInitialize): Empty for now. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): Install the Plugin Process shim for plugin processes and the WebProcess shim for the web content process. 2011-05-17 John Sullivan Reviewed by Adam Roben. Loose end from fix for https://bugs.webkit.org/show_bug.cgi?id=60938 * WebKit2.xcodeproj/project.pbxproj: Made new header file "private" instead of "project" so clients can access it. 2011-05-17 Andreas Kling Reviewed by Kenneth Rohde Christiansen. [Qt][WK2] Remove usage of ChunkedUpdateDrawingArea. https://bugs.webkit.org/show_bug.cgi?id=60901 To prepare for the eventual removal of the ChunkedUpdateDrawingArea, make QGraphicsWKView's "Simple" backing store type map to DrawingAreaImpl. * UIProcess/API/qt/qgraphicswkview.cpp: * UIProcess/API/qt/qgraphicswkview.h: * UIProcess/API/qt/qwkpage.cpp: (QWKPagePrivate::createDrawingAreaProxy): 2011-05-16 Martin Robinson Take another shot at fixing the WinCairo build. * Shared/cairo/LayerTreeContextCairo.cpp: Include NotImplemented.h using a framework include. 2011-05-16 Sam Weinig Reviewed by Jon Honeycutt. Add access to process pid in WebKit2 API https://bugs.webkit.org/show_bug.cgi?id=60938 * UIProcess/API/C/mac/WKPagePrivateMac.cpp: Added. (WKPageGetProcessIdentifier): * UIProcess/API/C/mac/WKPagePrivateMac.h: Added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processIdentifier): * UIProcess/WebPageProxy.h: * WebKit2.xcodeproj/project.pbxproj: Add WKPageGetProcessIdentifier as SPI for the mac. 2011-05-16 Martin Robinson Add file missing from my previous commit. * Shared/cairo/LayerTreeContextCairo.cpp: Added. 2011-05-16 Martin Robinson Try to fix the WinCairo build after r86612. Move the LayerTreeContextGtk.cpp stub to LayerTreeContextCairo.cpp and add it to the WinCairo build. * GNUmakefile.am: Update the source list. * Shared/cairo/LayerTreeContextCairo.cpp: Renamed from Source/WebKit2/Shared/gtk/LayerTreeContextGtk.cpp. * win/WebKit2.vcproj: Update the source list. 2011-05-16 Martin Robinson Reviewed by Anders Carlsson. [GTK] [WebKit2] Provide a fast version of the backing store for X11 https://bugs.webkit.org/show_bug.cgi?id=60912 Instead of allocating the backing store surface directly in WebKit2, instantiate the GtkWidgetBackingStore class which abstracts away the platform-specific details of maintaining the backing store. * UIProcess/BackingStore.h: * UIProcess/gtk/BackingStoreGtk.cpp: (WebKit::BackingStore::paint): Call into GtkWidgetBackingStore to get the Cairo surface now. (WebKit::BackingStore::incorporateUpdate): Ditto. (WebKit::BackingStore::scroll): Call into GtkWidgetBackingStore to do the actual backing store scroll. 2011-05-16 Chris Marrin Reviewed by Darin Adler. Plug-in hit testing is broken after zooming https://bugs.webkit.org/show_bug.cgi?id=60916 Construct a WebMouseEvent to send to plugin, adjusting values to take pageScaleFactor into account. Also adjusted bounds sent to viewGeometryDidChange to take pageScaleFactor into account. Both are needed or the plugin will think the mouse positions are outside its bounds. * Shared/WebEvent.h: * Shared/WebMouseEvent.cpp:Add ctor to clone a WebMouseEvent and add a scaleFactor to values (WebKit::WebMouseEvent::WebMouseEvent): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::handleEvent):Adjust mouse coords to take pageScaleFactor into account (WebKit::PluginView::viewGeometryDidChange):Adjust bounds to take pageScaleFactor into account 2011-05-16 Martin Robinson Reviewed by Anders Carlsson. GTK port of WebKit2 should switch to new DrawingAreaImpl model https://bugs.webkit.org/show_bug.cgi?id=59655 * GNUmakefile.am: Add the files necessary to use the DrawingAreaProxyImpl to the source list. The source list also needs the LayerContextTree stubs. * Shared/LayerTreeContext.h: This file should not be guarded by USE(ACCELERATED_COMPOSITING) as it's needed for the DrawingAreaProxyImpl IPC messaging. * Shared/gtk/LayerTreeContextGtk.cpp: Added this stub. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): Instead of creating the deprecated chunked drawing area, create a DrawingAreaProxyImpl. (WebKit::PageClientImpl::setViewNeedsDisplay): Here we must now queue a redraw. Previously the chunked drawing area was doing this manually. This is the appropriate place though. (WebKit::PageClientImpl::scrollView): Add an implementation that just calls into setViewNeedsDisplay. * UIProcess/API/gtk/PageClientImpl.h: Added a getter for m_viewWidget. (WebKit::PageClientImpl::viewWidget): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (callDrawingAreaPaintMethod): Added this helper which reduces code duplication between GTK+ 2.x and 3.x (webkitWebViewBaseExpose): Call the new helper now. (webkitWebViewBaseDraw): Ditto. * UIProcess/BackingStore.h: Updated to include GTK+ specific types. * UIProcess/DrawingAreaProxy.h: Ditto. * UIProcess/DrawingAreaProxy.messages.in: Do not the DrawingAreaProxyImpl-specific message with USE(ACCELERATED_COMPOSITING). * UIProcess/WebPageProxy.cpp: Removed these guards, as DrawingAreProxyImpl is used on all platforms now. (WebKit::WebPageProxy::didReceiveMessage): Ditto. * UIProcess/WebPageProxy.h: Ditto. * UIProcess/gtk/BackingStoreGtk.cpp: Added. This implementation heavily uses Cairo, but depends on GTK+/GDK in a few places. (WebKit::BackingStore::paint): (WebKit::BackingStore::incorporateUpdate): (WebKit::BackingStore::scroll): * UIProcess/gtk/WebPageProxyGtk.cpp: Added a getting for the viewWidget, which is required by BackingStoreGtk. A similar getter exists for Windows and Mac. (WebKit::WebPageProxy::viewWidget): Ditto. * WebProcess/WebPage/DrawingArea.cpp: Removed these guards as DrawingAreaProxyImpl is used on all platforms now. (WebKit::DrawingArea::create): Ditto. * WebProcess/WebPage/DrawingArea.h: Ditto. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): Do not guard this DrawingAreaProxyImpl-specific message with USE(ACCELERATED_COMPOSITING) * WebProcess/WebPage/WebPage.cpp: Removed these guards as DrawingAreaProxyImpl is used on all platforms now. (WebKit::WebPage::didReceiveMessage): Ditto. 2011-05-16 Maciej Stachowiak Reviewed by Sam Weinig. Sandbox denies Kerberos authentication https://bugs.webkit.org/show_bug.cgi?id=60921 * WebProcess/com.apple.WebProcess.sb: 2011-05-16 David Kilzer C++ exceptions should not be enabled when building with llvm-gcc-4.2 Reviewed by Mark Rowe. * Configurations/Base.xcconfig: Fixed typo. 2011-05-16 Anders Carlsson Reviewed by Dan Bernstein. If the root compositing layer changes while we're about to exit compositing mode, make sure to enter compositing mode https://bugs.webkit.org/show_bug.cgi?id=60905 * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::setRootCompositingLayer): If we have a layer tree host, but haven't yet sent a EnterAcceleratedCompositingMode message (this can happen when quickly going in and out of compositing mode), make sure to schedule a notification when the layer tree host does it next flush. This will end up sending the EnterAcceleratedCompositingMode message. 2011-05-13 Jer Noble Reviewed by Simon Fraser. Video is blank, controller is misplaced on trailers.apple.com movie in fullscreen (with two screens) https://bugs.webkit.org/show_bug.cgi?id=60826 Emit a notification when moving a CALayer from the WebProcess's main layer host to a new context. This allows listeners to invalidate their layers which may not support moving between different CAContexts (as is the case with QTMovieLayer). In order to allow listeners to determine if they are affected, the notification will pass the root CALayer in a userInfo dictionary. In WebFullScreenManagerMac, move from storing a pointer to a non-refcounted class (GraphicsLayer) to a retainable class (PlatformLayer). * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h: * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::WebFullScreenManagerMac): No need to initialize m_fullScreenRootLayer now that it is a RetainPtr<>. (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): Emit a notification after either creating or destroying the full screen layer host. (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): 2011-05-16 Siddharth Mathur Rubber-stamped by Csaba Osztrogonác. [Qt][Wk2][Symbian] Fix build after r86560 https://bugs.webkit.org/show_bug.cgi?id=60887 Temporarily fix Symbian build by re-enabling compilation of Qt/Gtk common code (as was the case for Symbian before r55875). This is a stop gap until the pure Symbian Core IPC and process launching bits land in Bug 55875 As of this revision, only the native SharedMemory implementation is in trunk. * Platform/CoreIPC/Attachment.h: Compile Qt/Gtk common code for Qt-Symbian too * Platform/CoreIPC/Connection.h: ditto * Platform/SharedMemory.h: ditto * Platform/qt/SharedMemorySymbian.cpp: stub implementations of attachment handling (WebKit::SharedMemory::Handle::releaseToAttachment): (WebKit::SharedMemory::Handle::adoptFromAttachment): 2011-05-16 Jon Lee Reviewed by Simon Fraser. Can't horizontally scroll iframes and overflow because wheel events are always accepted https://bugs.webkit.org/show_bug.cgi?id=60779 We keep track of the number of horizontal scrollbars and mouse wheel event handlers in the UI process as a means of determining whether horizontal scroll events will be handled by the web process. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willHandleHorizontalScrollEvents): Return true if there is at least one wheel event handler * UIProcess/WebPageProxy.h: Add new variable to cache the count (WebKit::WebPageProxy::numWheelEventHandlersChanged): Sets the count The rest just provides all the connections. * UIProcess/API/C/WKPage.cpp: (WKPageWillHandleHorizontalScrollEvents): * UIProcess/API/C/WKPage.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/InjectedBundle/API/c/WKBundlePage.h: * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: (WebKit::InjectedBundlePageUIClient::shouldRubberBandInDirection): * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::shouldRubberBandInDirection): Forward to injected bundle UI client (WebKit::WebChromeClient::updateCountWheelEventHandlers): Updates the web page proxy * WebProcess/WebCoreSupport/WebChromeClient.h: 2011-05-16 Anders Carlsson Reviewed by Oliver Hunt. Silverlight: Selection via keyboard selects the entire plugin instead of the contents of a TextBox https://bugs.webkit.org/show_bug.cgi?id=60898 Special-case Command-A and always return true, indicating that the plug-in handled the event. This matches WebKit1. * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: (WebKit::NetscapePlugin::platformHandleKeyboardEvent): 2011-05-16 Anders Carlsson Reviewed by Oliver Hunt. Short-circuit NPRuntime calls made by Flash during plug-in instantiation https://bugs.webkit.org/show_bug.cgi?id=60894 During plug-in instantiation, Flash makes a couple of NPRuntime calls to get the URL of the current document as well as the URL of the toplevel document. This leads to a bunch of IPC traffic that slows down instantiation. Since we know what calls Flash is making and what results are expected, we can handle the NPRuntime calls directly in the plug-in process and avoid extra IPC overhead. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::PluginControllerProxy): Initialize m_pluginCreationParameters. (WebKit::PluginControllerProxy::initialize): Set m_pluginCreationParameters to point to the creation parameters right before calling Plugin::initialize and restore it back afterwards. (WebKit::PluginControllerProxy::tryToShortCircuitInvoke): If the plug-in calling NPN_Invoke has the CanShortCircuitSomeNPRuntimeCallsDuringInitialization quirk, and we're being initialized, check for the __flash_getWindowLocation and __flash_getTopLocation function calls and return the correct values. (WebKit::PluginControllerProxy::tryToShortCircuitEvaluate): Check if the script string has the definitions of __flash_getWindowLocation or __flash_getTopLocation and just ignore them. Note that ignoring them has the effect of not adding them to the window object, which could in theory be a backwards compatibility problem if web pages were to assume that these functions existed on a page with plug-ins. In practice this is probably not a problem, especially since these functions are only used on Mac WebKit. * PluginProcess/PluginControllerProxy.h: (WebKit::PluginControllerProxy::inInitialize): Add helper function. * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::NetscapePluginModule::determineQuirks): Add the CanShortCircuitSomeNPRuntimeCallsDuringInitialization quirk for Flash on Mac. * Shared/Plugins/PluginQuirks.h: Add Mac specific CanShortCircuitSomeNPRuntimeCallsDuringInitialization quirk. 2011-05-16 Anders Carlsson Reviewed by Adam Roben. Add a returnValue parameter to tryToShortCircuitInvoke https://bugs.webkit.org/show_bug.cgi?id=60891 tryToShortCircuitInvoke needs to be able to indicate that an invoke call failed. Add a returnValue parameter and have the real return value indicate whether tryToShortCircuitInvoke did short-circuit the invoke or not. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::tryToShortCircuitInvoke): * PluginProcess/PluginControllerProxy.h: * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_Invoke): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::tryToShortCircuitInvoke): * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/PluginController.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::tryToShortCircuitInvoke): * WebProcess/Plugins/PluginView.h: 2011-05-16 Siddharth Mathur Reviewed by Csaba Osztrogonác. [Qt][Wk2][Symbian] Fix build after r86560 https://bugs.webkit.org/show_bug.cgi?id=60887 * Platform/CoreIPC/ArgumentDecoder.cpp: (CoreIPC::ArgumentDecoder::~ArgumentDecoder): guard Unix and Gtk code with USE(UNIX_DOMAIN_SOCKETS) * Platform/CoreIPC/ArgumentEncoder.cpp: (CoreIPC::ArgumentEncoder::~ArgumentEncoder): ditto 2011-05-16 Anders Carlsson Reviewed by Adam Roben. Add the ability for a plug-in controller to short-circuit calls to NPN_Invoke https://bugs.webkit.org/show_bug.cgi?id=60886 Make it possible for a plug-in controller to intercept calls to NPN_Invoke, which will be useful for avoiding sync IPC messages during instantiation. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::evaluate): Call tryToShortCircuitEvaluate. If it returns true, we don't need to call back to the web process to ask it to evaluate the script string. (WebKit::PluginControllerProxy::tryToShortCircuitInvoke): (WebKit::PluginControllerProxy::tryToShortCircuitEvaluate): Always return false for now. * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_Invoke): Get the plug-in and call tryToShortCircuitInvoke. * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::tryToShortCircuitInvoke): Call the plug-in controller. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::tryToShortCircuitInvoke): Always return false here, since there's no need to short-circuit calls for plug-ins that live in the web process. 2011-05-16 Siddharth Mathur Reviewed by Laszlo Gombos. [Qt][WK2][Symbian] Shared memory implementation for Symbian https://bugs.webkit.org/show_bug.cgi?id=55875 Use global chunks for sharing data between processes. This is an initial implementation. An outstanding issue is the correct way to close() the chunk in the SharedMemory d'tor without triggering a delete by the kernel when the ref-count temporarily goes to zero. * Platform/SharedMemory.h: platform specific handle and chunk name * Platform/qt/SharedMemorySymbian.cpp: Added. Native Symbian OS implementation using RChunk.CreateGlobal() for named chunks. The chunk name is serialized and sent over the IPC channel and opened by the remote process using RChunk.OpenGlobal(). (WebKit::SharedMemory::Handle::Handle): (WebKit::SharedMemory::Handle::~Handle): (WebKit::SharedMemory::Handle::isNull): (WebKit::SharedMemory::Handle::encode): (WebKit::SharedMemory::Handle::decode): (WebKit::SharedMemory::create): (WebKit::SharedMemory::~SharedMemory): (WebKit::SharedMemory::createHandle): (WebKit::SharedMemory::systemPageSize): * Platform/unix/SharedMemoryUnix.cpp: Exclude Qt-Symbian using HAVE(UNIX_DOMAIN_SOCKETS) * WebKit2.pro: Add SharedMemorySymbian.cpp 2011-05-16 Carlos Garcia Campos Unreviewed. Fix WebKit2 GTK build after r86489. * GNUmakefile.am: Add PluginProcess/PluginCreationParameters.cpp and PluginProcess/PluginCreationParameters.h to compilation. 2011-05-16 Carlos Garcia Campos Reviewed by Martin Robinson. [GTK] Enable building GTK port with ENABLE_PLUGIN_PROCESS=1 https://bugs.webkit.org/show_bug.cgi?id=58223 * GNUmakefile.am: Add new files to compilation. * PluginProcess/gtk/PluginControllerProxyGtk.cpp: Added. (WebKit::PluginControllerProxy::platformInitialize): (WebKit::PluginControllerProxy::platformDestroy): (WebKit::PluginControllerProxy::platformGeometryDidChange): * PluginProcess/gtk/PluginProcessGtk.cpp: Added. (WebKit::PluginProcess::platformInitialize): * UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp: Added. (WebKit::PluginProcessProxy::platformInitializePluginProcess): * WebProcess/Plugins/Netscape/gtk/PluginProxyGtk.cpp: Added. (WebKit::PluginProxy::needsBackingStore): 2011-05-16 Adam Barth Attempt to fix the Qt build. (Strict PassOwnPtr fix.) * Shared/qt/ShareableBitmapQt.cpp: (WebKit::ShareableBitmap::createGraphicsContext): 2011-05-15 Michael Saboff Reviewed by Geoffrey Garen. Suboptimal lifetime of BackingStore objects in DrawingAreaProxyImpl https://bugs.webkit.org/show_bug.cgi?id=60864 Implemented reuse of BackingStore's in DrawingAreaProxyImpl::didUpdateBackingStoreState when the size needed matches the size of the existing BackingStore. Also reduced the discardBackingStoreTimer from 5 to 2 seconds. These changes reduces memory usage up to 10MB on memory tests. * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState): (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon): 2011-05-15 Anders Carlsson Reviewed by Maciej Stachowiak. Pass the window NPObject identifier in the plug-in creation parameters https://bugs.webkit.org/show_bug.cgi?id=60865 This avoids a synchronous call when the plug-in wants to get the NPObject that corresponds to the window. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::initialize): Change this to take the PluginCreationParameters. Initialize the window NPObject. (WebKit::PluginControllerProxy::windowScriptNPObject): Just return the window NPObject; it's already been initialized. * PluginProcess/PluginControllerProxy.h: * PluginProcess/PluginCreationParameters.cpp: (WebKit::PluginCreationParameters::PluginCreationParameters): (WebKit::PluginCreationParameters::encode): (WebKit::PluginCreationParameters::decode): * PluginProcess/PluginCreationParameters.h: Add the window NPObject ID. * PluginProcess/WebProcessConnection.cpp: (WebKit::WebProcessConnection::createPlugin): Pass the creation parameters to PluginControllerProxy::initialize. * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::initialize): Initialize the window NPObject ID. * WebProcess/Plugins/PluginProxy.messages.in: Remove the GetWindowScriptNPObject message. 2011-05-15 Anders Carlsson Reviewed by Geoffrey Garen. Pass the document URL and toplevel document URL when creating a plug-in https://bugs.webkit.org/show_bug.cgi?id=60863 This is the first of a series of patches intended to reduce the IPC traffic during plug-in instantiation. * WebProcess/Plugins/Plugin.cpp: (WebKit::Plugin::Parameters::encode): Encode the URLs. (WebKit::Plugin::Parameters::decode): Decode the URLs. * WebProcess/Plugins/Plugin.h: Add the document and toplevel document URLs. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::createPlugin): Initialize the document and toplevel document URLs. 2011-05-13 Oliver Hunt Reviewed by Geoffrey Garen. Make GC validation more aggressive https://bugs.webkit.org/show_bug.cgi?id=60802 Add GC_VALIDATION calls to all the JSNPObject methods. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::invalidate): (WebKit::JSNPObject::callMethod): (WebKit::JSNPObject::callObject): (WebKit::JSNPObject::callConstructor): (WebKit::JSNPObject::getCallData): (WebKit::JSNPObject::getConstructData): (WebKit::JSNPObject::getOwnPropertySlot): (WebKit::JSNPObject::getOwnPropertyDescriptor): (WebKit::JSNPObject::put): (WebKit::JSNPObject::getOwnPropertyNames): (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): 2011-05-13 Oliver Hunt Reviewed by Geoffrey Garen. Make GC validation more aggressive https://bugs.webkit.org/show_bug.cgi?id=60802 Add GC_VALIDATION calls to all the JSNPObject methods. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::invalidate): (WebKit::JSNPObject::callMethod): (WebKit::JSNPObject::callObject): (WebKit::JSNPObject::callConstructor): (WebKit::JSNPObject::getCallData): (WebKit::JSNPObject::getConstructData): (WebKit::JSNPObject::getOwnPropertySlot): (WebKit::JSNPObject::getOwnPropertyDescriptor): (WebKit::JSNPObject::put): (WebKit::JSNPObject::getOwnPropertyNames): (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): 2011-05-14 Alexey Proskuryakov Reviewed by Sam Weinig. WebKit2: Smart cut&paste is broken https://bugs.webkit.org/show_bug.cgi?id=60840 * UIProcess/mac/TextCheckerMac.mm: (WebKit::TextChecker::isSmartInsertDeleteEnabled): Match WK1 - this default defaults to YES if not present. 2011-05-14 Dan Bernstein Reviewed by Alice Liu. WKView does not draw after forced repaint before the first update https://bugs.webkit.org/show_bug.cgi?id=60845 * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint): Added. * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::waitForBackingStoreUpdateOnNextPaint): Set m_hasReceivedFirstUpdate to true, ensuring that paint() will wait for an update if needed. * UIProcess/DrawingAreaProxyImpl.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::forceRepaint): Call DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint(). 2011-05-14 Anders Carlsson Reviewed by Sam Weinig. Document the WantsMozillaUserAgent quirk and make it Windows specific https://bugs.webkit.org/show_bug.cgi?id=60843 * Shared/Plugins/PluginQuirks.h: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::userAgent): 2011-05-14 Anders Carlsson Reviewed by Sam Weinig. Consolidate plug-in creation parameters to a single struct https://bugs.webkit.org/show_bug.cgi?id=60839 * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::create): (WebKit::PluginControllerProxy::PluginControllerProxy): * PluginProcess/PluginControllerProxy.h: * PluginProcess/PluginCreationParameters.cpp: Added. (WebKit::PluginCreationParameters::PluginCreationParameters): (WebKit::PluginCreationParameters::encode): (WebKit::PluginCreationParameters::decode): * PluginProcess/PluginCreationParameters.h: Added. * PluginProcess/WebProcessConnection.cpp: (WebKit::WebProcessConnection::createPlugin): * PluginProcess/WebProcessConnection.h: * PluginProcess/WebProcessConnection.messages.in: * Scripts/webkit2/messages.py: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::initialize): 2011-05-14 Anders Carlsson Reviewed by Kevin Decker. NPP_URLNotify is not called if a URL passed to NPN_GetURLNotify fails to load https://bugs.webkit.org/show_bug.cgi?id=60823 If a plug-in stream fails to load before it's been started, we won't destroy the stream. * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::stop): Call notifyAndDestroyStream which will call NPP_URLNotify if necessary, and also destroy the stream. (WebKit::NetscapePluginStream::notifyAndDestroyStream): Pass the request URL to NPP_URLNotify, matching other browsers. 2011-05-14 Jer Noble Reviewed by Simon Fraser. Flashing window frame and graphical glitches after exiting full screen mode. https://bugs.webkit.org/show_bug.cgi?id=60825 A layer-backed WebView throws an exception when moved from a layer-backed parent view to a non-layer-backed one, so make the WebView a child of the content view, instead of the animation view. There is an unrelated fix in beganExitFullScreen, which was calling finishedExitFullScreenAnimation: instead of finishedEnterFullScreenAnimation: when notifications come out of order. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Add the _webView to the full screen window's content view, instead of the _animationView. (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Call finishedEnterFullScreenAnimation: instead of finishedExitFullScreenAnimation:. (-[WKFullScreenWindowController enterAcceleratedCompositingMode:WebKit::]): Add the _layerHostingView to the contentView, instead of the animationView. 2011-05-14 Csaba Osztrogonác Unreviewed, rolling out r86469 and r86471, because they made hundreds tests crash on Qt. Make GC validation more aggressive https://bugs.webkit.org/show_bug.cgi?id=60802 * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::invalidate): (WebKit::JSNPObject::callMethod): (WebKit::JSNPObject::callObject): (WebKit::JSNPObject::callConstructor): (WebKit::JSNPObject::getCallData): (WebKit::JSNPObject::getConstructData): (WebKit::JSNPObject::getOwnPropertySlot): (WebKit::JSNPObject::getOwnPropertyDescriptor): (WebKit::JSNPObject::put): (WebKit::JSNPObject::getOwnPropertyNames): (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): 2011-05-14 Sheriff Bot Unreviewed, rolling out r86476. http://trac.webkit.org/changeset/86476 https://bugs.webkit.org/show_bug.cgi?id=60832 It made plugins/get-url-notify-with-url-that-fails-to- load.html crash on GTK (Requested by Ossy on #webkit). * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::stop): (WebKit::NetscapePluginStream::notifyAndDestroyStream): 2011-05-13 Enrica Casucci Reviewed by Darin Adler and Brian Weinstein. REGRESSION (WK2): Can't drag and drop a link or image from Safari to Desktop https://bugs.webkit.org/show_bug.cgi?id=60819 To support drag-and-drop to the desktop and other windows applications, we need to support the fileDescriptor and fileContentZero clipboard formats. This patch adds the support for serializing these types across the process boundary. * Platform/CoreIPC/Arguments.h: Added support for messages with 10 arguments. (CoreIPC::Arguments10::Arguments10): (CoreIPC::Arguments10::encode): (CoreIPC::Arguments10::decode): (CoreIPC::In): (CoreIPC::Out): * Platform/CoreIPC/HandleMessage.h: (CoreIPC::callMemberFunction): Added support for memebers with 10 arguments. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startDragDrop): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/win/WebDragClientWin.cpp: (WebKit::WebDragClient::startDrag): 2011-05-13 Anders Carlsson Reviewed by Sam Weinig. NPP_URLNotify is not called if a URL passed to NPN_GetURLNotify fails to load https://bugs.webkit.org/show_bug.cgi?id=60823 If a plug-in stream fails to load before it's been started, we won't destroy the stream. * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::stop): Call notifyAndDestroyStream which will call NPP_URLNotify if necessary, and also destroy the stream. (WebKit::NetscapePluginStream::notifyAndDestroyStream): Pass the request URL to NPP_URLNotify, matching other browsers. 2011-05-13 Michael Saboff Reviewed by Geoffrey Garen. Backing store may not get discarded due to stopped timer https://bugs.webkit.org/show_bug.cgi?id=60816 Changed the backing store timer to restart if it has been stopped. The evaluation is done when the view's state is changed. This change appears to be worth ~3MB (one backing store worth) during memory tests. * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::viewStateDidChange): 2011-05-13 Oliver Hunt Reviewed by Geoffrey Garen. Make GC validation more aggressive https://bugs.webkit.org/show_bug.cgi?id=60802 Add GC_VALIDATION calls to all the JSNPObject methods. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::invalidate): (WebKit::JSNPObject::callMethod): (WebKit::JSNPObject::callObject): (WebKit::JSNPObject::callConstructor): (WebKit::JSNPObject::getCallData): (WebKit::JSNPObject::getConstructData): (WebKit::JSNPObject::getOwnPropertySlot): (WebKit::JSNPObject::getOwnPropertyDescriptor): (WebKit::JSNPObject::put): (WebKit::JSNPObject::getOwnPropertyNames): (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): 2011-05-13 Anders Carlsson Reviewed by Sam Weinig. NPN_GetURL with a javascript: URL doesn't send back the result in the stream https://bugs.webkit.org/show_bug.cgi?id=60810 In NetscapePluginStream::sendJavaScriptStream, we were incorrectly passing the result URL to the stream, instead of the result. Also, store the request URL in the NetscapePluginStream object to avoid sending it over the wire. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::didEvaluateJavaScript): * PluginProcess/PluginControllerProxy.h: * PluginProcess/PluginControllerProxy.messages.in: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::loadURL): (WebKit::NetscapePlugin::didEvaluateJavaScript): (WebKit::NetscapePlugin::manualStreamDidReceiveResponse): * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::NetscapePluginStream): (WebKit::NetscapePluginStream::sendJavaScriptStream): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: (WebKit::NetscapePluginStream::create): * WebProcess/Plugins/Plugin.h: * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::didEvaluateJavaScript): * WebProcess/Plugins/PluginProxy.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performJavaScriptURLRequest): 2011-05-13 Jeff Miller Reviewed by Darin Adler. Make some page() member functions const https://bugs.webkit.org/show_bug.cgi?id=60794 * UIProcess/ChunkedUpdateDrawingAreaProxy.h: Make page() const. * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::page): Make page() const. * UIProcess/WebInspectorProxy.h: (WebKit::WebInspectorProxy::page): Make page() const. * UIProcess/gtk/ChunkedUpdateDrawingAreaProxyGtk.cpp: (WebKit::ChunkedUpdateDrawingAreaProxy::page): Make page() const. * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm: (WebKit::ChunkedUpdateDrawingAreaProxy::page): Make page() const. * UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp: (WebKit::ChunkedUpdateDrawingAreaProxy::page): Make page() const. * UIProcess/win/ChunkedUpdateDrawingAreaProxyWin.cpp: (WebKit::ChunkedUpdateDrawingAreaProxy::page): Make page() const. 2011-05-13 Adam Roben Load plugins in the order they're found Fixes REGRESSION (r69790): WebKit2 doesn't prefer plugins in the additional plugins directory Reviewed by Anders Carlsson. * UIProcess/Plugins/PluginInfoStore.cpp: (WebKit::addFromVector): Changed to use a ListHashSet instead of a HashSet to store the plugin paths. 2011-05-13 Sam Weinig Reviewed by Anders Carlsson. Prune #includes from FrameView.h (Part 2) https://bugs.webkit.org/show_bug.cgi?id=60748 - Update files that were depending on FrameView.h #including Frame.h or Page.h. * WebProcess/Plugins/PluginView.cpp: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: * WebProcess/WebPage/WebContextMenu.cpp: * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm: 2011-05-13 Martin Robinson Reviewed by Eric Seidel. [GTK] Share the GTK+ key binding code between WebKit1 and WebKit2 https://bugs.webkit.org/show_bug.cgi?id=59765 Use the new KeyBindingTranslator class from WebCore/platform/gtk. With this utility class we can now share the code with WebKit2. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::PageClientImpl): No longer need to initialize keybinding code. (WebKit::PageClientImpl::getEditorCommandsForKeyEvent): Use the new utility class. * UIProcess/API/gtk/PageClientImpl.h: Remove unnecessary members. Add utility class member. 2011-05-12 Pratik Solanki Reviewed by Antti Koivisto. Part of WebCore should use CFNetwork-based loader on Mac https://bugs.webkit.org/show_bug.cgi?id=51836 Use CFRunLoop when using CFNetwork. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformInitialize): 2011-05-12 Sam Weinig Reviewed by Gavin Barraclough. WebProcess sandbox denies file:/// accesses after you navigate to a nonexistent file https://bugs.webkit.org/show_bug.cgi?id=60745 * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::SandboxExtensionTracker::didStartProvisionalLoad): Don't attempt to re-use a non-existent committed sandbox extension. This can happen when the previous load was file: url, but did not require an extension, such as an error page. 2011-05-12 Jia Pu Reviewed by Darin Adler. Regression caused by changeset 86281 https://bugs.webkit.org/show_bug.cgi?id=60712 Removed the condition variable. [NSSpellChecker dismissCorrectionIndicatorForView:] is blocking. So handleAcceptedReplacement() triggered by dismissInternal() will return before dismissInternal() returns. So we don't need to use the condition to coordinate between these two function. In fact, all callbacks are delivered on main thread. We don't really need any locking here. Since now we don't have distinction between dismiss() and dismissSoon(). dismissSoon() has been removed. * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::dismissCorrectionPanelSoon): * UIProcess/mac/CorrectionPanel.h: * UIProcess/mac/CorrectionPanel.mm: (WebKit::CorrectionPanel::CorrectionPanel): (WebKit::CorrectionPanel::show): (WebKit::CorrectionPanel::dismiss): (WebKit::CorrectionPanel::dismissInternal): (WebKit::CorrectionPanel::handleAcceptedReplacement): 2011-05-12 Brian Weinstein Reviewed by Adam Roben. WebKit2: Implement plugin quirk for Mozilla user agent for older Flash https://bugs.webkit.org/show_bug.cgi?id=60726 Implement the quirk for versions of Flash before v10 that only request windowless plugins if we use a Mozilla user agent. * Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp: (WebKit::NetscapePluginModule::determineQuirks): If we have a plugin that handles the "application/x-shockwave-flash" MIME type with a version less than 10, tell it to use the Mozilla user agent. * Shared/Plugins/PluginQuirks.h: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::userAgent): Add an early return if the plugin uses the Mozilla user agent. * win/WebKit2.vcproj: Add PluginQuirks.h. 2011-05-12 Anders Carlsson Reviewed by Simon Fraser. PluginView::invalidateRect doesn't work for transformed plug-ins https://bugs.webkit.org/show_bug.cgi?id=60727 Ask the RenderObject to repaint the plug-in instead of using invalidateContentsAndWindow. This matches what we do in WebKit1. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::invalidateRect): 2011-05-12 Jessie Berlin Reviewed by Darin Adler. [Windows WebKit2] Use cookies set in WebKit1 https://bugs.webkit.org/show_bug.cgi?id=60274 Properly handle the case where there is no serialized default storage session by not trying to encode or decode 0, while still making sure to decode any valid storage session. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): (WebKit::WebProcessCreationParameters::encode): Only encode the storage session if there is one to encode. (WebKit::WebProcessCreationParameters::decode): Only decode the storage session there is one to decode. * Shared/WebProcessCreationParameters.h: 2011-05-11 Brian Weinstein Reviewed by Anders Carlsson. After relaunching an unresponsive web process, web page stops responding to mouse movement https://bugs.webkit.org/show_bug.cgi?id=60669 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processDidCrash): Set m_processingMouseMoveEvent to false when the WebProcess crashes. 2011-05-10 Tony Gentilcore Reviewed by Darin Adler. Perform some forward declarations suggested by include-what-you-use https://bugs.webkit.org/show_bug.cgi?id=60545 * WebProcess/WebPage/mac/WebPageMac.mm: 2011-05-12 Carlos Garcia Campos Reviewed by Martin Robinson. Fix the build with ENABLE_PLUGIN_PROCESS https://bugs.webkit.org/show_bug.cgi?id=60628 * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::initialize): Move the call to pluginController->isAcceleratedCompositingEnabled() to a #ifdef block. * WebProcess/Plugins/PluginProxy.h: Add include for . 2011-05-11 Damian Kaleta Reviewed by Brady Eidson. Need a new API that will try to restore the scrollbars' position, when navigating in the back/forward history https://bugs.webkit.org/show_bug.cgi?id=60674 * UIProcess/API/C/WKPage.cpp: (WKPageTryRestoreScrollPosition): * UIProcess/API/C/WKPage.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::tryRestoreScrollPosition): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::tryRestoreScrollPosition): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2011-05-11 Sam Weinig Reviewed by Gavin Barraclough. WebKit2 doesn't build on Mac with strict PassOwnPtr https://bugs.webkit.org/show_bug.cgi?id=60655 * Platform/CoreIPC/HandleMessage.h: (CoreIPC::handleMessageDelayed): Add explicit adoptPtr to indicate that the constructor is taking ownership. 2011-05-11 Jessie Berlin Reviewed by Steve Falkenburg. [Windows WebKit2] Use cookies set in WebKit1 https://bugs.webkit.org/show_bug.cgi?id=60274 Share the default storage session between the UI and Web Processes. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): Only encode the session parameter if it is valid. (WebKit::WebProcessCreationParameters::decode): Don't try to decode a null session data. * Shared/WebProcessCreationParameters.h: Add a parameter for a serialized default storage session, used only on Windows. * Shared/win/WebCoreArgumentCodersWin.cpp: (CoreIPC::decodeResourceRequest): Make sure to set the current storage session on any requests used by the Web Process before CFNetwork has to do anything with them, in order for CFNetwork to avoid doing anything with the Web Process's default storage session. * UIProcess/win/WebContextWin.cpp: (WebKit::WebContext::platformInitializeWebProcess): Serialize the default storage session in the UI Process and add it to the WebProcessCreationParameters. * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::cachedResponseForURL): Use the cache associated with the current storage session and make sure the request has the current storage session set on it before doing anything with it. * WebProcess/win/WebProcessWin.cpp: (WebKit::WebProcess::platformSetCacheModel): Use the default storage session. (WebKit::WebProcess::platformClearResourceCaches): Ditto. (WebKit::WebProcess::platformInitializeWebProcess): Deserialize the default storage session passed in by the UI Process and hand it to the ResourceHandle. 2011-05-11 Jia Pu Reviewed by Darin Adler. CorrectionPanel sometimes hangs in dismissSoon(). https://bugs.webkit.org/show_bug.cgi?id=60599 Make sure dismissSoon() won't wait indefinitely if handleAcceptedReplacement() sets m_resultForSynchronousDismissal to nil. Added a designated variable m_isDismissing, instead of piggy-backing m_resultForSynchronousDismissal, for condition checking. * UIProcess/mac/CorrectionPanel.h: * UIProcess/mac/CorrectionPanel.mm: (WebKit::CorrectionPanel::CorrectionPanel): (WebKit::CorrectionPanel::show): (WebKit::CorrectionPanel::dismissSoon): (WebKit::CorrectionPanel::dismissInternal): (WebKit::CorrectionPanel::handleAcceptedReplacement): 2011-05-11 Sheriff Bot Unreviewed, rolling out r86255. http://trac.webkit.org/changeset/86255 https://bugs.webkit.org/show_bug.cgi?id=60660 REGRESSION (r86255): Lots of tests crashing in CFWriteStreamCreateWithAllocatedBuffers on Windows 7 Release (WebKit2 Tests) (Requested by aroben on #webkit). * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * Shared/win/WebCoreArgumentCodersWin.cpp: (CoreIPC::decodeResourceRequest): * UIProcess/win/WebContextWin.cpp: (WebKit::WebContext::platformInitializeWebProcess): * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::cachedResponseForURL): * WebProcess/win/WebProcessWin.cpp: (WebKit::WebProcess::platformSetCacheModel): (WebKit::WebProcess::platformClearResourceCaches): (WebKit::WebProcess::platformInitializeWebProcess): 2011-05-11 Adam Roben Don't notify the plugin when a targeted javascript: URL request completes This matches Mozilla and WebKit1. Fixes REGRESSION (WebKit2): Flash plugin doesn't appear on a hanes.com page Test: plugins/get-targeted-javascript-url.html Reviewed by Anders Carlsson. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performJavaScriptURLRequest): Don't call back to the plugin if the request had a target. 2011-05-11 Jessie Berlin Reviewed by Steve Falkenburg. [Windows WebKit2] Use cookies set in WebKit1 https://bugs.webkit.org/show_bug.cgi?id=60274 Share the default storage session between the UI and Web Processes. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: Add a parameter for a serialized default storage session, used only on Windows. * Shared/win/WebCoreArgumentCodersWin.cpp: (CoreIPC::decodeResourceRequest): Make sure to set the current storage session on any requests used by the Web Process before CFNetwork has to do anything with them, in order for CFNetwork to avoid doing anything with the Web Process's default storage session. * UIProcess/win/WebContextWin.cpp: (WebKit::WebContext::platformInitializeWebProcess): Serialize the default storage session in the UI Process and add it to the WebProcessCreationParameters. * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::cachedResponseForURL): Use the cache associated with the current storage session and make sure the request has the current storage session set on it before doing anything with it. * WebProcess/win/WebProcessWin.cpp: (WebKit::WebProcess::platformSetCacheModel): Use the default storage session. (WebKit::WebProcess::platformClearResourceCaches): Ditto. (WebKit::WebProcess::platformInitializeWebProcess): Deserialize the default storage session passed in by the UI Process and hand it to the ResourceHandle. 2011-05-11 Sam Weinig Reviewed by Adam Roben. WebKit2 should tell app that is unresponsive in more cases https://bugs.webkit.org/show_bug.cgi?id=60608 * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState): (WebKit::DrawingAreaProxyImpl::sendUpdateBackingStoreState): Invoke the responsiveness time when forcing a backing store update to catch the cases of activating tabs, resizing the window, etc. 2011-05-11 Martin Robinson Try to fix the WinCairo build. * Shared/ShareableBitmap.h: Correctly include RefPtrCairo here and guard it with USE(CAIRO) instead of PLATFORM(CAIRO). 2011-05-11 John Sullivan Reviewed by Darin Adler. WebKit2 doesn't clear the pendingAPIRequestURL on in-page anchor navigation [60631] * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Call clearPendingAPIRequestURL(). 2011-05-11 Adam Roben Turn on strict PassOwnPtr on Windows Fixes Windows should build with strict PassOwnPtr enabled Reviewed by Adam Barth. * WebProcess/FullScreen/win/WebFullScreenManagerWin.cpp: (WebKit::WebFullScreenManagerWin::setRootFullScreenLayer): Use nullptr instead of 0. 2011-05-11 Jessie Berlin Reviewed by Darin Adler. [WebKit2] exceededDatabaseQuota function on WKPageUIClient needs to provide information about the usage for both the origin overall and the database in question. https://bugs.webkit.org/show_bug.cgi?id=60573 Add the currentOriginUsage parameter. * Platform/CoreIPC/HandleMessage.h: (CoreIPC::callMemberFunction): * UIProcess/API/C/WKPage.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::exceededDatabaseQuota): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebUIClient.cpp: (WebKit::WebUIClient::exceededDatabaseQuota): * UIProcess/WebUIClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::exceededDatabaseQuota): 2011-05-10 Oliver Hunt Reviewed by Geoffrey Garen. Assertion failure in JSC::Structure::typeInfo when reloading weather.com video page https://bugs.webkit.org/show_bug.cgi?id=60580 The plugin object map was incorrect trying to implement a weak map itself using destructors. Switch to a WeakGCMap and the problem is fixed. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::~JSNPObject): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::getOrCreateJSObject): (WebKit::NPRuntimeObjectMap::invalidate): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: 2011-05-10 Sam Weinig Reviewed by Dan Bernstein. Yet more quarantine related sandbox denial when downloading files * WebProcess/com.apple.WebProcess.sb: 2011-05-10 Sam Weinig Reviewed by Anders Carlsson. WebKit2: Coalesced wheel events should be saved to hand back to the client on unhandled return https://bugs.webkit.org/show_bug.cgi?id=60584 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleWheelEvent): (WebKit::canCoalesce): (WebKit::coalesce): (WebKit::coalescedWheelEvent): (WebKit::WebPageProxy::didReceiveEvent): (WebKit::WebPageProxy::processDidCrash): Reworks coalescing/merging code to happen on didReceiveEvent rather than in handleWheelEvent. This means we now store the pending events in a queue, and pull them out when we can. * UIProcess/WebPageProxy.h: Change single event containers to contain all pending/merged/coalesced events and remove unused flag. 2011-05-09 Jeremy Noble Reviewed by Darin Adler. WebKit2: Cancelling full screen before animation completes leads to full screen window staying up. https://bugs.webkit.org/show_bug.cgi?id=60531 Remove the (unused) _isAnimating ivar and replace it with two ivars: _isEnteringFullScreen and _isExitingFullScreen. These will ensure each is only called once per full screen request, and that if one exit/enter request interrupts another, that the required functions are called in order. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): Removed _isAnimating. (-[WKFullScreenWindowController exitFullScreen]): Ditto. (-[WKFullScreenWindowController beganEnterFullScreenAnimation]): Gate on _isEnteringFullScreen. Check _isExitingFullScreen and call [self finishedExitFullScreenAnimation:] if necessary. (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Gate on _isEnteringFullScreen. (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Gate on _isExitingFullScreen. Check _isEnteringFullScreen and call [self finishedEnterFullScreenAnimation:] if necessary. (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Gate on _isExitingFullScreen. 2011-05-10 Beth Dakin Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=60582 Crash switching overlay/non-overlay scrollbar preference still possible -and corresponding- * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2011-05-10 Jeff Miller Reviewed by Anders Carlsson. WebKit2: Windows clients need to know if the page overlay is installed https://bugs.webkit.org/show_bug.cgi?id=60562 Until we move all the UI for find on page into WebKit on Windows (specifically, drawing the find bouncy), WebKit clients need to know whether WebKit is drawing the page overlay or not. Keep track of this in the WebPageProxy in the UI process and provide a WebKit2 API to retrieve this information. * UIProcess/API/C/win/WKView.cpp: (WKViewIsPageOverlayInstalled): Added. * UIProcess/API/C/win/WKView.h: Added WKViewIsPageOverlayInstalled(). * UIProcess/PageClient.h: Added didInstallOrUninstallPageOverlay(). * UIProcess/WebPageProxy.h: Added didInstallOrUninstallPageOverlay(). * UIProcess/WebPageProxy.messages.in: Added DidInstallOrUninstallPageOverlay. * UIProcess/win/WebPageProxyWin.cpp: (WebKit::WebPageProxy::didInstallOrUninstallPageOverlay): Added. * UIProcess/win/WebView.cpp: (WebKit::WebView::WebView): Initialize m_pageOverlayInstalled. (WebKit::WebView::didInstallOrUninstallPageOverlay): Added. * UIProcess/win/WebView.h: Added didInstallOrUninstallPageOverlay() and m_pageOverlayInstalled. (WebKit::WebView::pageOverlayInstalled): Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::installPageOverlay): Send message to UI process to tell it the page overlay is installed. (WebKit::WebPage::uninstallPageOverlay): Send message to UI process to tell it the page overlay is uninstalled. 2011-05-10 Anders Carlsson Reviewed by Adam Roben. Remove incorrect ASSERTs from CoreIPC::Connection::processIncomingSyncReply https://bugs.webkit.org/show_bug.cgi?id=60567 It is possible to receive an incoming sync reply that is for a request we don't know about. This could happen if the sync message send timed out for example. * Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::processIncomingSyncReply): 2011-05-05 Brent Fulgham and Martin Robinson Reviewed by Anders Carlsson. [Cairo][WebKit2] Add an implementation of ShareableBitmap for Cairo https://bugs.webkit.org/show_bug.cgi?id=60293 * GNUmakefile.am: Remove ShareableBitmapGtk in favor of ShareableBitmapCairo. * Shared/ShareableBitmap.h: Added a couple Cairo-specific declarations. * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::createGraphicsContext): Added. (WebKit::ShareableBitmap::paint): Added. (WebKit::ShareableBitmap::createCairoSurface): Added. (WebKit::ShareableBitmap::releaseSurfaceData): Added. 2011-05-10 Anders Carlsson Reviewed by Sam Weinig. Extra sign in required to view video on MobileMe Gallery album https://bugs.webkit.org/show_bug.cgi?id=60560 Implement NPN_GetAuthenticationInfo. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::getAuthenticationInfo): Send a GetAuthenticationInfo message to the web process. * PluginProcess/PluginControllerProxy.h: * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::initializeProtectionSpace): Initialize a WebCore::ProtectionSpace object from NPAPI parameters. (WebKit::NPN_GetAuthenticationInfo): Make a ProtectionSpace object and then call NetscapePlugin::getAuthenticationInfo. Finally, copy the username/password and pass them back to the plug-in. * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::getAuthenticationInfo): Call the plug-in controller. * WebProcess/Plugins/PluginController.h: Add getAuthenticationInfo pure virtual member function. * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::getAuthenticationInfo): Call the real plug-in controller's getAuthenticationInfo member function. * WebProcess/Plugins/PluginProxy.messages.in: Add GetAuthenticationInfo message. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::getAuthenticationInfo): Try to get the authentication info from the credential storage. Failing that, get it from the persistent credential storage. 2011-05-10 Adam Roben Use FontSmoothingLevelWindows by default on Windows Fixes REGRESSION (r86077): Web Inspector uses CG font rendering in WebKit2 on Windows Reviewed by Darin Adler. * Shared/WebPreferencesStore.h: Added and deployed a new DEFAULT_WEBKIT_FONT_SMOOTHING_LEVEL macro to let Windows have a different default font smoothing level from other platforms. * UIProcess/API/C/WKPreferencesPrivate.h: Updated the comment about the default font smoothing level. 2011-05-06 Tony Gentilcore Reviewed by Darin Adler. Fix some unnecessary includes in headers https://bugs.webkit.org/show_bug.cgi?id=60388 * WebProcess/FullScreen/WebFullScreenManager.cpp: 2011-05-09 Jeremy Noble Reviewed by Darin Adler. Command-~/Exposé to another window while