1 2014-07-21 Andy Estes <aestes@apple.com>
3 [iOS] Handle QuickLook ResourceLoaders in the web process
4 https://bugs.webkit.org/show_bug.cgi?id=135113
6 Reviewed by David Kilzer.
8 The QuickLook framework registers a NSURLProtocol to handle loading subresources of the HTML documents it
9 generates. In order for these loads to succeed, we need to start them in the same process in which QuickLook
10 generated the main resource.
12 * WebProcess/Network/WebResourceLoadScheduler.cpp:
13 (WebKit::WebResourceLoadScheduler::scheduleLoad):
15 2014-07-21 Brady Eidson <beidson@apple.com>
17 DatabaseProcess doesn't relaunch after crashing.
18 <rdar://problem/17717343> and https://bugs.webkit.org/show_bug.cgi?id=135117
20 Reviewed by Alexey Proskuryakov.
22 * UIProcess/Databases/DatabaseProcessProxy.cpp:
23 (WebKit::DatabaseProcessProxy::didClose): Tell the WebContext.
25 * UIProcess/WebContext.cpp:
26 (WebKit::WebContext::databaseProcessCrashed): Notify supplements, then clear the DatabaseProcessProxy pointer.
27 * UIProcess/WebContext.h:
29 * UIProcess/WebContextSupplement.h:
30 (WebKit::WebContextSupplement::processDidClose): Added. No users right now, but the patch in bug 135035 will need this.
32 2014-07-20 KwangHyuk Kim <hyuki.kim@samsung.com>
34 Fix warnings caused by unused parameter.
35 https://bugs.webkit.org/show_bug.cgi?id=134975
37 Reviewed by Gyuyoung Kim.
39 Fix warnings on EwkView.cpp and LegacySessionStateCodingNone.cpp that are caused by unused parameter data.
41 * UIProcess/API/efl/EwkView.cpp:
42 (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
43 * UIProcess/LegacySessionStateCodingNone.cpp:
44 (WebKit::decodeLegacySessionState):
46 2014-07-20 Jeremy Jones <jeremyj@apple.com>
48 Disable ff/rw based on canPlayFastForward and canPlayFastRewind.
49 https://bugs.webkit.org/show_bug.cgi?id=134894
51 Reviewed by Darin Adler.
53 Add setCanPlayFastReverse
55 * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: ditto
56 * WebProcess/ios/WebVideoFullscreenManager.h: ditto
57 * WebProcess/ios/WebVideoFullscreenManager.mm: ditto
58 (WebKit::WebVideoFullscreenManager::setCanPlayFastReverse): ditto
60 2014-07-20 Jeremy Jones <jeremyj@apple.com>
62 Decrease flicker when enter and exit fullscreen.
63 https://bugs.webkit.org/show_bug.cgi?id=134919
65 Reviewed by Simon Fraser.
67 Change the sequence of tear down and use transparency to prevent flicker when entering and exiting fullscreen.
69 * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: wait to remove layerHost until didCleanupFullscreen
70 (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): removed from here
71 (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): added here
72 * WebProcess/ios/WebVideoFullscreenManager.mm:
73 (WebKit::WebVideoFullscreenManager::didSetupFullscreen): use transparent background during transition
75 2014-07-20 Dan Bernstein <mitz@apple.com>
77 <rdar://problem/17739526> REGRESSION (r171057): Crash in WebPage::getPositionInformation()
78 https://bugs.webkit.org/show_bug.cgi?id=135099
80 Reviewed by David Kilzer.
82 * WebProcess/WebPage/ios/WebPageIOS.mm:
83 (WebKit::WebPage::getPositionInformation): Added a null check.
85 2014-07-19 Zan Dobersek <zdobersek@igalia.com>
87 Consistently use uint64_t as the handle parameter type for the SetAcceleratedCompositingWindowId message
88 https://bugs.webkit.org/show_bug.cgi?id=135047
90 Reviewed by Darin Adler.
92 UIProcess' WebPageProxy is handling this parameter as an uint64_t, it should be handled as such
93 in WebProcess as well.
95 * WebProcess/WebPage/WebPage.h:
96 * WebProcess/WebPage/WebPage.messages.in: Also changed the parameter name to match other places.
97 * WebProcess/WebPage/gtk/WebPageGtk.cpp:
98 (WebKit::WebPage::setAcceleratedCompositingWindowId):
100 2014-07-18 Oliver Hunt <oliver@apple.com>
102 We don't provide an extension to the temp file used for uploads
103 https://bugs.webkit.org/show_bug.cgi?id=135079
105 Reviewed by Sam Weinig.
107 Make sure didChooseFilesForOpenPanelWithDisplayStringAndIcon vends
108 extensions for the files passed to the content process.
110 * UIProcess/WebPageProxy.cpp:
111 (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
113 2014-07-18 Tim Horton <timothy_horton@apple.com>
115 ASSERTion failures in ViewGestureController indicating that we're copying WebBackForwardList
116 https://bugs.webkit.org/show_bug.cgi?id=135080
117 <rdar://problem/17734714>
119 Reviewed by Sam Weinig.
121 * UIProcess/ios/ViewGestureControllerIOS.mm:
122 (WebKit::ViewGestureController::beginSwipeGesture):
123 (WebKit::ViewGestureController::canSwipeInDirection):
125 2014-07-18 Yongjun Zhang <yongjun_zhang@apple.com>
127 _WKActivatedElementInfo.title should fallback to innerText if the link doesn't have title attribute.
128 https://bugs.webkit.org/show_bug.cgi?id=135077
130 When populate InteractionInformationAtPosition's title value, use a link element's innerText if it
131 doesn't have title attribute.
133 Reviewed by Dan Bernstein.
135 * WebProcess/WebPage/ios/WebPageIOS.mm:
136 (WebKit::WebPage::getPositionInformation):
138 2014-07-18 Andy Estes <aestes@apple.com>
140 [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad
141 https://bugs.webkit.org/show_bug.cgi?id=135072
142 <rdar://problem/17528188>
144 Reviewed by David Kilzer.
146 * Shared/WebCoreArgumentCoders.h: Declared an ArgumentCoder for WebCore::ContentFilter.
147 * Shared/mac/WebCoreArgumentCodersMac.mm:
148 (IPC::ArgumentCoder<ContentFilter>::encode): Encoded the ContentFilter using a NSKeyedArchiver.
149 (IPC::ArgumentCoder<ContentFilter>::decode): Decoded the ContentFilter using a NSKeyedUnarchiver.
150 * UIProcess/Cocoa/WebPageProxyCocoa.mm:
151 (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::setContentFilterForBlockedLoad().
152 * UIProcess/WebFrameProxy.cpp:
153 (WebKit::WebFrameProxy::didStartProvisionalLoad): Reset m_contentFilterForBlockedLoad to nullptr.
154 (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Called ContentFilter::handleUnblockRequestAndDispatchIfSuccessful().
155 If the unblock is successful, reload the WebPageProxy.
156 * UIProcess/WebFrameProxy.h:
157 (WebKit::WebFrameProxy::setContentFilterForBlockedLoad):
158 * UIProcess/WebPageProxy.cpp:
159 (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check if this is navigation represents an unblock
160 request and ignore if so.
161 * UIProcess/WebPageProxy.h:
162 * UIProcess/WebPageProxy.messages.in: Defined ContentFilterDidBlockLoadForFrame.
163 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
164 (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): Sent ContentFilterDidBlockLoadForFrame to the WebPageProxy.
165 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
167 2014-07-18 Simon Fraser <simon.fraser@apple.com>
169 [iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place
170 https://bugs.webkit.org/show_bug.cgi?id=135078
171 <rdar://problem/17401823>
173 Reviewed by Tim Horton.
175 Fix the logging of requested scroll position and frame scale factor.
177 * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
178 (WebKit::RemoteScrollingTreeTextStream::dump):
180 2014-07-18 Joseph Pecoraro <pecoraro@apple.com>
182 [Cocoa] Use RetainPtr in _WKRemoteObjectInterface
183 https://bugs.webkit.org/show_bug.cgi?id=135062
185 Reviewed by Anders Carlsson.
187 Switch to RetainPtr instead of manual memory management of ivars.
189 * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
190 * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
191 (-[_WKRemoteObjectInterface initWithProtocol:identifier:]):
192 (-[_WKRemoteObjectInterface identifier]):
193 (-[_WKRemoteObjectInterface description]):
194 (-[_WKRemoteObjectInterface dealloc]): Deleted.
196 2014-07-18 Tim Horton <timothy_horton@apple.com>
198 Take navigation snapshots whenever the current back-forward item is going to change
199 https://bugs.webkit.org/show_bug.cgi?id=135058
200 <rdar://problem/17464515>
202 Reviewed by Dan Bernstein.
204 Instead of trying to have the UI process figure out when to take navigation snapshots by itself,
205 snapshot whenever the Web process says that the current back-forward item is going to change.
206 This fixes snapshotting timing with pushState, and lets us bottleneck snapshotting down to
207 just two places instead of 5.
209 * UIProcess/WebPageProxy.cpp:
210 (WebKit::WebPageProxy::goForward):
211 (WebKit::WebPageProxy::goBack):
212 (WebKit::WebPageProxy::goToBackForwardItem):
213 (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
214 We no longer need to special-case taking navigation snapshots
215 when the UI process changes the back forward item or upon
216 didStartProvisionalLoadForFrame, because we'll always snapshot
217 in willChangeCurrentHistoryItem in all of these cases.
219 * UIProcess/WebPageProxy.cpp:
220 (WebKit::WebPageProxy::willChangeCurrentHistoryItem):
221 * UIProcess/WebPageProxy.h:
222 * UIProcess/WebPageProxy.messages.in:
223 Add willChangeCurrentHistoryItem message, which comes from the Web process.
224 When it arrives, take a navigation snapshot.
226 * UIProcess/ios/ViewGestureControllerIOS.mm:
227 (WebKit::ViewGestureController::beginSwipeGesture):
228 Take the pre-swipe navigation snapshot before telling WebPageProxy that we're doing a swipe,
229 so that it doesn't bail from taking the snapshot because we have a snapshot up.
231 (WebKit::ViewGestureController::endSwipeGesture):
232 We no longer need to explicitly disable snapshotting while navigating, because
233 we will avoid taking the snapshot if there's a snapshot being displayed.
235 * UIProcess/mac/ViewGestureControllerMac.mm:
236 (WebKit::ViewGestureController::~ViewGestureController):
237 Remove the snapshot if it's still up when ViewGestureController is destroyed.
238 The Mac version of ViewGestureController is destroyed on Web process crashes
239 because it is a message receiver, so it is not guaranteed to have the same
240 lifetime as the WebPageProxy and friends.
242 (WebKit::ViewGestureController::trackSwipeGesture):
243 Make use of recordNavigationSnapshot.
245 (WebKit::ViewGestureController::endSwipeGesture):
246 Ditto from the Mac version.
248 * UIProcess/mac/ViewSnapshotStore.h:
249 (WebKit::ViewSnapshotStore::disableSnapshotting): Deleted.
250 (WebKit::ViewSnapshotStore::enableSnapshotting): Deleted.
251 * UIProcess/mac/ViewSnapshotStore.mm:
252 (WebKit::ViewSnapshotStore::ViewSnapshotStore):
253 (WebKit::ViewSnapshotStore::recordSnapshot):
254 Remove the snapshot disabling mechanism and bail from snapshotting if we're
255 showing a snapshot, as mentioned above.
257 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
258 (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem):
259 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
260 * WebProcess/WebPage/WebPage.cpp:
261 (WebKit::WebPage::willChangeCurrentHistoryItem):
262 * WebProcess/WebPage/WebPage.h:
263 Proxy willChangeCurrentHistoryItem from HistoryController to the UI process.
265 2014-07-18 Jon Honeycutt <jhoneycutt@apple.com>
267 REGRESSION: Crash when typing into text field that clears itself on iOS
269 <https://bugs.webkit.org/show_bug.cgi?id=135044>
270 <rdar://problem/17640443>
272 Reviewed by Darin Adler.
274 * WebProcess/WebPage/ios/WebPageIOS.mm:
275 (WebKit::WebPage::requestAutocorrectionData):
276 wordRangeFromPosition() returns null in some cases; null check range
277 before dereferencing it. Moved some variable declarations around to
278 better match our style.
280 2014-07-18 Tim Horton <timothy_horton@apple.com>
282 [WK2] Provide a mechanism to grab the back-forward list for gesture navigation purposes from another WKWebView
283 https://bugs.webkit.org/show_bug.cgi?id=134999
284 <rdar://problem/17238025>
286 Reviewed by Sam Weinig.
288 In some cases, clients may need to throw a WKWebView with no back-forward list over
289 another WKWebView, and want to participate in gesture swipe as if they were actually
290 the page being overlaid.
292 * UIProcess/API/Cocoa/WKWebView.mm:
293 (-[WKWebView setAllowsBackForwardNavigationGestures:]):
294 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
295 (-[WKWebViewConfiguration copyWithZone:]):
296 (-[WKWebViewConfiguration _alternateWebViewForNavigationGestures]):
297 (-[WKWebViewConfiguration _setAlternateWebViewForNavigationGestures:]):
298 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
299 Keep an "alternate" WKWebView "for navigation gestures", which ViewGestureController
300 will use as the real source of back-forward items, and the destination of the swipe navigation.
301 All swipe delegate callbacks will also fire from the alternate view, because it owns the items
302 and will be doing the navigation.
304 * UIProcess/ios/ViewGestureControllerIOS.mm:
305 (WebKit::ViewGestureController::setAlternateBackForwardListSourceView):
306 (WebKit::ViewGestureController::beginSwipeGesture):
307 Send navigationGestureDidBegin via the alternate view's WebPageProxy if it exists.
308 Record a new snapshot on the current page, but copy it to the alternate view if necessary,
309 so that when swiping forward from the alternate view, it will have the "right" snapshot.
310 Get the target back forward item from the alternate view.
311 Send navigationGestureWillEnd via the alternate view's WebPageProxy if it exists.
313 (WebKit::ViewGestureController::canSwipeInDirection):
314 Determine if we can swipe in a direction by looking at the alternate view's back-forward list if necessary.
316 (WebKit::ViewGestureController::endSwipeGesture):
317 Send navigationGestureDidEnd via the alternate view's WebPageProxy if it exists.
318 Perform the navigation on the alternate view if necessary.
320 (WebKit::ViewGestureController::removeSwipeSnapshot):
321 Send navigationGestureSnapshotWasRemoved via the alternate view's WebPageProxy if it exists.
323 * UIProcess/mac/ViewGestureController.h:
325 2014-07-17 David Kilzer <ddkilzer@apple.com>
327 SECTORDER_FLAGS should be defined in target's xcconfig file, not Base.xcconfig
328 <http://webkit.org/b/135006>
330 Reviewed by Darin Adler.
332 * Configurations/Base.xcconfig: Move SECTORDER_FLAGS to
334 * Configurations/DebugRelease.xcconfig: Remove empty
335 SECTORDER_FLAGS definition.
336 * Configurations/WebKit.xcconfig: Use $(CONFIGURATION) so
337 SECTORDER_FLAGS is only set on Production builds.
339 2014-07-17 Alexey Proskuryakov <ap@apple.com>
341 REGRESSION (r171167): LoaderClient processDidCrash call is made after load state changes
342 https://bugs.webkit.org/show_bug.cgi?id=135032
343 <rdar://problem/17716602>
345 Reviewed by Dan Bernstein.
347 * UIProcess/WebPageProxy.cpp:
348 (WebKit::WebPageProxy::processDidCrash): Create a transaction, so that the nested
349 transaction in resetStateAfterProcessExited() wouldn't be committed.
350 (WebKit::WebPageProxy::resetStateAfterProcessExited): Don't use auto - it was hiding
351 the most important fact that this is a stack object that can't be simply moved to
352 a different function.
354 2014-07-17 Benjamin Poulain <bpoulain@apple.com>
356 [iOS][WK2] Fix the updateVisibleContentRects synchronization for load after r171154
357 https://bugs.webkit.org/show_bug.cgi?id=135036
359 Reviewed by Dan Bernstein.
361 * WebProcess/WebPage/ios/WebPageIOS.mm:
362 (WebKit::WebPage::updateVisibleContentRects):
363 I forgot to update one of the condition after changing from lastTransaction to next transaction
366 2014-07-17 Enrica Casucci <enrica@apple.com>
368 [REGRESSION WK2]The menu bar does not show up when tapping on the caret.
369 https://bugs.webkit.org/show_bug.cgi?id=135023
370 <rdar://problem/17617282>
372 Reviewed by Benjamin Poulain and Ryosuke Niwa.
374 WKContentView needs to implement hasContent to correctly show
375 the appropriate menu bar content. The patch adds this information
378 * Shared/EditorState.cpp:
379 (WebKit::EditorState::encode):
380 (WebKit::EditorState::decode):
381 * Shared/EditorState.h:
382 (WebKit::EditorState::EditorState):
383 * UIProcess/ios/WKContentViewInteraction.mm:
384 (-[WKContentView hasContent]):
385 * WebProcess/WebPage/WebPage.cpp:
386 (WebKit::WebPage::editorState):
388 2014-07-17 Benjamin Poulain <benjamin@webkit.org>
390 [iOS][WK2] Add SPI to do a dynamic viewport update without showing any content
391 https://bugs.webkit.org/show_bug.cgi?id=135010
393 Reviewed by Darin Adler.
395 This patch add a new SPI, [WKWebView _resizeWhileHidingContentWithUpdates:] to perform all the work
396 of a dynamic viewport size update, but instead of animating the old content, it is hidden.
398 The patch is built on top of the animated resize mechanism. Instead of having an animation driving
399 the beginning and end, we let the content do that. The dynamic resize begins, it runs for as long as
400 the WebProcess needs, and it ends when first layer tree commit with the new content is processed.
402 The attribute "_isAnimatingResize" is generalized to support two modes of resizing: animated and
405 The attribute "_hasCommittedLoadForMainFrame" is rather silly. It is only needed because
406 [WKWebView _resizeWhileHidingContentWithUpdates:] is intended to be called a lot before the page
407 is initialized, and doing an animated resize would trash the WebProcess state.
408 I wish I had a better solution, this is not great.
410 * UIProcess/API/Cocoa/WKWebView.mm:
411 (-[WKWebView _processDidExit]):
412 (-[WKWebView _didCommitLoadForMainFrame]):
413 (-[WKWebView _didCommitLayerTree:]):
414 This is the key to make this work properly. We want _resizeWhileHidingContentWithUpdates: to behave
415 exactly like an animated resize to avoid bugs. So we went to the whole update mechanism using
416 _resizeAnimationTransformAdjustments to accumulate the adjustments, now we need to restore a correct
419 Calling [WKWebView _endAnimatedResize] will do exactly that, but we need to make sure we do not hit
420 the synchronization path or we would be blocked there for a while, which is what we are trying to avoid.
422 After r171154, WebPageProxy keeps track of what stage of dynamic viewport update we are in. Since we are
423 executing the layer tree update stage, with the right transaction ID, WebPageProxy already knows we have
424 everything we need and does not use any synchronous messages.
426 (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
427 (-[WKWebView _restorePageStateToExposedRect:scale:]):
428 (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
429 (-[WKWebView _scrollToContentOffset:]):
430 (-[WKWebView _frameOrBoundsChanged]):
431 (-[WKWebView _updateVisibleContentRects]):
432 (-[WKWebView _setMinimumLayoutSizeOverride:]):
433 (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
434 (-[WKWebView _setInterfaceOrientationOverride:]):
435 (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
436 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
437 (-[WKWebView _endAnimatedResize]):
438 (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
439 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
441 2014-07-17 Brent Fulgham <bfulgham@apple.com>
443 [Mac] Full screen video not always animating in the correct Space
444 https://bugs.webkit.org/show_bug.cgi?id=135020
445 <rdar://problem/17542310>
447 Reviewed by Dean Jackson.
449 The fullscreen window can "remember" the Space it was part of the first time you enter fullscreen
450 mode. Subsequent fullscreen transitions will always start from this Space, even if you move
451 the WebKit-hosted application to a different Space.
453 We can help the display system know when we've moved to a new Space by calling NSWindow's
454 'orderBack' method on the fullscreen window prior to starting the transition to fullscreen mode.
455 This method call hooks the window into the current Space so everything works properly.
457 * UIProcess/mac/WKFullScreenWindowController.mm:
458 (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): Add the
459 new fullscreen window to the current Space before starting transition to fullscreen.
461 2014-07-17 Timothy Hatcher <timothy@apple.com>
463 Make console.profile record to the Timeline.
465 https://bugs.webkit.org/show_bug.cgi?id=134643
467 Reviewed by Joseph Pecoraro.
469 * WebProcess/WebPage/WebInspector.cpp:
470 (WebKit::WebInspector::setJavaScriptProfilingEnabled):
471 (WebKit::WebInspector::startJavaScriptProfiling):
472 (WebKit::WebInspector::stopJavaScriptProfiling):
474 2014-07-17 Brady Eidson <beidson@apple.com>
476 Crash in ServicesOverlayController::~ServicesOverlayController.
477 <rdar://problem/17622172> and https://bugs.webkit.org/show_bug.cgi?id=135022
479 Reviewed by Tim Horton.
481 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
482 (WebKit::ServicesOverlayController::~ServicesOverlayController): Don’t need to uninstall the
483 PageOverlay as it has already been destroyed by this point in WebPage::~WebPage.
485 2014-07-17 Tim Horton <timothy_horton@apple.com>
487 Sometimes purgeable (or empty!) tiles are shown on screen when resuming the app
488 https://bugs.webkit.org/show_bug.cgi?id=135018
489 <rdar://problem/17615038>
491 Reviewed by Simon Fraser.
493 * UIProcess/DrawingAreaProxy.h:
494 (WebKit::DrawingAreaProxy::hideContentUntilNextUpdate):
495 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
496 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
497 (WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilNextUpdate):
498 * UIProcess/mac/RemoteLayerTreeHost.h:
499 * UIProcess/mac/RemoteLayerTreeHost.mm:
500 (WebKit::RemoteLayerTreeHost::detachRootLayer):
501 Add a mechanism to "hide" drawing area content until the next commit,
502 by detaching the root layer. RemoteLayerTreeHost will automatically reattach
503 it at the next commit.
505 * UIProcess/WebPageProxy.cpp:
506 (WebKit::WebPageProxy::viewStateDidChange):
507 * UIProcess/WebPageProxy.h:
508 Add a parameter to viewStateDidChange specifying whether dispatching the change
509 to the Web process is deferrable or not. We will also automatically use "Immediate" if
510 the view is coming in-window, like we did before.
512 * UIProcess/ios/WKContentView.mm:
513 (-[WKContentView _applicationWillEnterForeground:]):
514 Make use of the aforementioned new mechanisms to ensure that we immediately dispatch
515 view state changes when coming into the foreground, and will have removed the root layer
516 if a commit didn't come in while waitForDidUpdateViewState blocks.
518 2014-07-17 Sanghyup Lee <sh53.lee@samsung.com>
520 [EFL][WK2] Add a "focus,notfound" signal.
521 https://bugs.webkit.org/show_bug.cgi?id=134674
523 Reviewed by Gyuyoung Kim.
525 Add a "focus,notfound" signal to handover focus control to application
526 because there are no elements of webview to focus on the given direction.
528 Application can decide to move the focus to next widget of ewk_view or something else
529 by using this signal.
531 * UIProcess/API/efl/EwkViewCallbacks.h:
532 * UIProcess/API/efl/ewk_view.h:
533 * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp: Added keyDown and keyUp function.
534 (EWK2UnitTest::EWK2UnitTestBase::waitUntilDirectionChanged):
535 (EWK2UnitTest::EWK2UnitTestBase::keyDown):
536 (EWK2UnitTest::EWK2UnitTestBase::keyUp):
537 * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
538 * UIProcess/API/efl/tests/test_ewk2_view.cpp:
539 (EWK2ViewTest::FocusNotFoundCallback):
541 * UIProcess/efl/PageUIClientEfl.cpp: Removed unnecessary calls to evas_object_focus_set().
542 (WebKit::PageUIClientEfl::takeFocus):
544 2014-07-16 Brady Eidson <beidson@apple.com>
546 Reintroduce the SPI _websiteDataURLForContainerWithURL: that was removed in r171160
547 https://bugs.webkit.org/show_bug.cgi?id=134984
549 Reviewed by David Kilzer.
551 * UIProcess/API/Cocoa/WKProcessPool.mm:
552 (+[WKProcessPool _websiteDataURLForContainerWithURL:]):
553 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
555 2014-07-16 Alexey Proskuryakov <ap@apple.com>
557 A test that hangs at cleanup stage confuses webkitpy hugely
558 https://bugs.webkit.org/show_bug.cgi?id=122475
559 <rdar://problem/17184354>
561 Reviewed by Anders Carlsson.
563 Reset m_pageLoadState when the process exits cleanly - otherwise messages from a
564 new process for the same WebPageProxy would hit assertions.
566 * UIProcess/WebPageProxy.cpp:
567 (WebKit::WebPageProxy::processDidCrash):
568 (WebKit::WebPageProxy::resetStateAfterProcessExited):
570 2014-07-16 David Kilzer <ddkilzer@apple.com>
572 [iOS] Update order file paths for WebKit and WebKit2
573 <http://webkit.org/b/134993>
574 <rdar://problem/17557776>
576 Reviewed by Darin Adler.
578 * Configurations/Base.xcconfig: Add order file for iOS
581 2014-07-16 Brady Eidson <beidson@apple.com>
583 Add WebSecurityOrigin "webSecurityOriginFromDatabaseIdentifier" SPI and change _websiteDataURLForContainerWithURL: SPI
584 <rdar://problem/17454712> and https://bugs.webkit.org/show_bug.cgi?id=134984
586 Reviewed by Dan Bernstein.
588 Change _websiteDataURLForContainerWithURL: SPI to include an optional bundle identifier argument:
589 * UIProcess/API/Cocoa/WKProcessPool.mm:
590 (+[WKProcessPool _websiteDataURLForContainerWithURL:bundleIdentifierIfNotInContainer:]):
591 (+[WKProcessPool _websiteDataURLForContainerWithURL:]): Deleted.
592 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
594 Add a big shiny comment in a few key places:
595 * DatabaseProcess/DatabaseProcess.cpp:
596 (WebKit::DatabaseProcess::initializeDatabaseProcess):
597 * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
598 (WebKit::UniqueIDBDatabase::UniqueIDBDatabase):
599 * UIProcess/WebContext.cpp:
600 (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
601 (WebKit::WebContext::ensureDatabaseProcess):
603 2014-07-16 Enrica Casucci <enrica@apple.com>
605 REGRESSION (iOS WebKit2): Cannot scroll while dragging a selection.
606 https://bugs.webkit.org/show_bug.cgi?id=134992
607 <rdar://problem/17528020>
609 Reviewed by Benjamin Poulain.
611 This patch exposes the scroller and the visible content rect so that
612 UIKit can implement autoscroll when dragging the selections.
613 It also changes that way we do hit testing to allow hit test outside
614 the clipping region and fixes the way we compute the selection rectangle
615 for the block selection, ensuring that we consider also non text elements
618 * UIProcess/ios/WKContentViewInteraction.mm:
619 (-[WKContentView scroller]):
620 (-[WKContentView visibleRect]):
621 * WebProcess/WebPage/ios/WebPageIOS.mm:
622 (WebKit::selectionBoxForRange):
623 (WebKit::WebPage::rangeForWebSelectionAtPosition):
624 (WebKit::WebPage::rangeForBlockAtPoint):
625 (WebKit::WebPage::expandedRangeFromHandle):
626 (WebKit::WebPage::contractedRangeFromHandle):
627 (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
628 (WebKit::WebPage::changeBlockSelection):
630 2014-07-16 Alexey Proskuryakov <ap@apple.com>
632 <rdar://problem/17669097> REGRESSION (r170155): Sandbox violations using a wrong
633 CFNetwork cache path in WebContent process
635 Rubber-stamped by Sam Weinig.
637 Before r170155, we incorrectly checked usesNetworkProcess(), which always returns
638 false at this point in initialization sequence. But we did the right thing, as we
639 always need to set the cache path, even when network process is used for most loading.
641 * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess):
643 2014-07-16 Timothy Horton <timothy_horton@apple.com>
645 Dispatch top content inset changes immediately if synchronously waiting for view state changes
646 https://bugs.webkit.org/show_bug.cgi?id=134942
647 <rdar://problem/17666800>
649 Reviewed by Simon Fraser.
651 * UIProcess/API/mac/WKView.mm:
652 (-[WKView _dispatchSetTopContentInset]):
653 (-[WKView _setTopContentInset:]):
654 Move the check from _setTopContentInset: to _dispatchSetTopContentInset
655 that ensures that we only send the message if the top content inset changed.
657 2014-07-16 Benjamin Poulain <bpoulain@apple.com>
659 [iOS][WK2] Synchronize the dynamic viewport updates with their layer tree commit
660 https://bugs.webkit.org/show_bug.cgi?id=134965
661 Related to <rdar://problem/17082607>
663 Reviewed by Tim Horton.
665 Dynamic viewport update relies on the _resizeAnimationTransformAdjustments being applied
666 to the page at the new size during the transition.
668 Because of the races between the LayerTree Commit and DynamicViewportSizeUpdate, the transform
669 can be applied to the wrong set of tiles.
670 This is mostly a problem for unresponsive WebProcess or when the synchronization is done
673 There is at least one more case that is not handled: if synchronizeDynamicViewportUpdate()
674 completely fails to get the new page, the UIProcess is in a somewhat messy state.
675 I will look into that separately than the layer tree synchronization.
677 * UIProcess/API/Cocoa/WKWebView.mm:
678 (-[WKWebView _didCommitLayerTree:]):
679 (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
680 (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]): Deleted.
681 * UIProcess/API/Cocoa/WKWebViewInternal.h:
682 * UIProcess/PageClient.h:
683 * UIProcess/WebPageProxy.cpp:
684 (WebKit::WebPageProxy::WebPageProxy):
685 (WebKit::WebPageProxy::resetState):
686 * UIProcess/WebPageProxy.h:
687 * UIProcess/ios/PageClientImplIOS.h:
688 * UIProcess/ios/PageClientImplIOS.mm:
689 (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget):
690 * UIProcess/ios/WebPageProxyIOS.mm:
691 (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
692 (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
693 (WebKit::WebPageProxy::didCommitLayerTree):
694 (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
695 * WebProcess/WebPage/WebPage.cpp:
696 (WebKit::WebPage::WebPage):
697 (WebKit::WebPage::didCommitLoad):
698 * WebProcess/WebPage/WebPage.h:
699 * WebProcess/WebPage/WebPage.messages.in:
700 * WebProcess/WebPage/ios/WebPageIOS.mm:
701 (WebKit::WebPage::synchronizeDynamicViewportUpdate):
702 (WebKit::WebPage::updateVisibleContentRects):
703 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
704 (WebKit::RemoteLayerTreeDrawingArea::nextTransactionID):
705 (WebKit::RemoteLayerTreeDrawingArea::currentTransactionID): Deleted.
707 2014-07-16 Dan Bernstein <mitz@apple.com>
709 REGRESSION (r170653): Web Content service’s Info.plist has wrong format
710 https://bugs.webkit.org/show_bug.cgi?id=134973
712 Reviewed by Alexey Proskuryakov.
714 * WebKit2.xcodeproj/project.pbxproj: Updated the Add CFBundle Localization Info.plist Key
715 script build phases to convert Info.plist back to binary format if the
716 PLIST_FILE_OUTPUT_FORMAT build setting requires it.
718 2014-07-15 Benjamin Poulain <bpoulain@apple.com>
722 * UIProcess/API/Cocoa/WKWebView.mm:
723 (-[WKWebView _scrollToContentOffset:]):
724 On landing, I changed the min/max branches to shrunkTo/expandedTo, but the return value
725 of those was ignored.
727 2014-07-15 Dan Bernstein <mitz@apple.com>
729 WKWebView’s FormClient::willSubmitForm should use CompletionHandlerCallChecker
730 https://bugs.webkit.org/show_bug.cgi?id=134951
732 Reviewed by Tim Horton.
734 * UIProcess/API/Cocoa/WKWebView.mm:
735 (-[WKWebView _setFormDelegate:]):
737 2014-07-15 Benjamin Poulain <benjamin@webkit.org>
739 [iOS][WK2] Scrolling request from the scrolling tree must be limited to offsets in the document
740 https://bugs.webkit.org/show_bug.cgi?id=134952
741 <rdar://problem/17647116>
743 Reviewed by Enrica Casucci.
745 When we received a scroll request, we were taking that offset directly to set the UIScrollView
746 scroll position. This is a problem if a page request scrolling to an invalid position, we were
749 This patch limits the position to be inside the document.
751 -- Why not limit the scroll offset in the WebProcess when we receive the scroll request? --
753 Some pages rely on the page scale factor changing instantly, because that is how it worked
756 On WebKit2, the WebProcess cannot know the valid range because the obscured insets are changing
757 dynamically, and the page scale factor can change in response to WebProcess events (the focus
758 changing for example). To make the page works, the WebProcess does not restrict the scroll position.
760 In that architecture, the UIProcess has to sanitize the input, which was not done before this patch.
762 -- Why not use changeContentOffsetBoundedInValidRange()?
764 The scroll offset as seen by the page is relative to the unobscured rect. While the position used
765 for history item is a visual position. All we need in this case is a position in the view.
767 * UIProcess/API/Cocoa/WKWebView.mm:
768 (-[WKWebView _scrollToContentOffset:]):
769 * UIProcess/WebPageProxy.h:
770 * UIProcess/ios/WebPageProxyIOS.mm:
771 (WebKit::WebPageProxy::resendLastVisibleContentRects):
773 2014-07-15 Timothy Horton <timothy_horton@apple.com>
775 Dispatch top content inset changes immediately if synchronously waiting for view state changes
776 https://bugs.webkit.org/show_bug.cgi?id=134942
777 <rdar://problem/17666800>
779 Reviewed by Simon Fraser.
781 * UIProcess/API/mac/WKView.mm:
782 (-[WKView endDeferringViewInWindowChanges]):
783 (-[WKView endDeferringViewInWindowChangesSync]):
784 (-[WKView _dispatchSetTopContentInset]):
785 (-[WKView _setTopContentInset:]):
786 Send top content inset changes immediately before sync-waiting for new tiles from the Web Process.
787 This will ensure that the incoming contents have the right top content inset, and we don't
788 flash between the wrong inset and the right one.
790 2014-07-15 Enrica Casucci <enrica@apple.com>
792 REGRESSION(WK2 iOS): Safari hangs when switching focus from a field using the Tab key.
793 https://bugs.webkit.org/show_bug.cgi?id=134934
794 <rdar://problem/17224638>
796 Reviewed by Tim Horton.
798 * UIProcess/ios/WKContentViewInteraction.mm:
800 Tab and back tab should be handled as special keys that have
801 a command associated. The command specifies for each key the relevant
802 action. This patch implements the commands property to create the association
803 between key and command and the relevant actions that will execute the same
804 code executed when the used taps on the < > buttons in the accessory bar.
806 (-[WKContentView keyCommands]):
807 (-[WKContentView _nextAccessoryTab:]):
808 (-[WKContentView _prevAccessoryTab:]):
810 2014-07-15 Oliver Hunt <oliver@apple.com>
812 More tidying of the webcontent sandbox profile
813 https://bugs.webkit.org/show_bug.cgi?id=134938
815 Reviewed by Alexey Proskuryakov.
817 Remove some excessive abilities from the profile and make
818 the required ones explicit.
820 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
822 2014-07-14 Andreas Kling <akling@apple.com>
824 [iOS] Don't progressively re-render tiles while pinch-zooming under memory pressure.
825 <https://webkit.org/b/134915>
827 When we're under memory pressure, the last thing we want to be doing is
828 creating gratuitous new IOSurfaces. Just wait for the gesture to end before
829 rendering at the new scale.
831 Reviewed by Tim Horton.
833 * WebProcess/WebPage/ios/WebPageIOS.mm:
834 (WebKit::WebPage::updateVisibleContentRects):
836 2014-07-14 Joseph Pecoraro <pecoraro@apple.com>
838 [Cocoa] _WKRemoteObjectInterface leaks NSString ivar
839 https://bugs.webkit.org/show_bug.cgi?id=134914
841 Reviewed by Simon Fraser.
843 Release our copied NSString in dealloc.
845 * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
846 (-[_WKRemoteObjectInterface dealloc]):
848 2014-07-14 Dean Jackson <dino@apple.com>
850 [PlugIns] Check for a non-null snapshot image before trying to decode it
851 https://bugs.webkit.org/show_bug.cgi?id=134913
852 <rdar://problem/17606033>
854 Reviewed by Tim Horton.
856 Changeset r169820 introduced a bug where we could examine the pixels of
857 an image (looking for solid colors) before checking if the image actually
860 I added a null check, and moved the code around a bit to avoid checking
861 for existence three times.
863 * WebProcess/Plugins/PluginView.cpp:
864 (WebKit::PluginView::pluginSnapshotTimerFired): Check that snapshotImage exists
865 before trying to look at it.
867 2014-07-14 Anders Carlsson <andersca@apple.com>
871 * UIProcess/Cocoa/SessionStateCoding.mm:
872 (WebKit::encodeSessionState):
874 2014-07-14 Anders Carlsson <andersca@apple.com>
876 Use the legacy session coder for encoding/decoding session state
877 https://bugs.webkit.org/show_bug.cgi?id=134910
879 Reviewed by Beth Dakin.
881 * UIProcess/Cocoa/SessionStateCoding.mm:
882 (WebKit::encodeSessionState):
883 (WebKit::decodeSessionState):
885 2014-07-14 Oliver Hunt <oliver@apple.com>
887 Restrict network process to remote connections
888 https://bugs.webkit.org/show_bug.cgi?id=134908
890 Reviewed by Geoffrey Garen.
892 Further restrict network client
894 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
896 2014-07-14 Tim Horton <timothy_horton@apple.com>
898 ASSERT(isMainThread()) under OneShotDisplayLinkHandler
899 https://bugs.webkit.org/show_bug.cgi?id=134900
901 Reviewed by Simon Fraser.
903 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
904 (-[OneShotDisplayLinkHandler displayLinkFired:]):
905 isMainThread means the Web thread sometimes.
907 2014-07-14 Tim Horton <timothy_horton@apple.com>
911 * UIProcess/API/Cocoa/WKWebView.mm:
912 (-[WKWebView _frameOrBoundsChanged]):
913 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
914 * UIProcess/API/ios/WKViewIOS.mm:
915 (-[WKView _frameOrBoundsChanged]):
917 2014-07-14 Carlos Alberto Lopez Perez <clopez@igalia.com>
919 [UNIX] Log error description when failing to create shared memory file.
920 https://bugs.webkit.org/show_bug.cgi?id=134892
922 Reviewed by Darin Adler.
924 * Platform/unix/SharedMemoryUnix.cpp:
925 (WebKit::SharedMemory::create): Print the string describing the error number (errno).
927 2014-07-14 Benjamin Poulain <benjamin@webkit.org>
929 [iOS][WK2] On rotation, RemoteLayerTreeDrawingArea renders one extra frame at the wrong orientation
930 https://bugs.webkit.org/show_bug.cgi?id=134875
932 Reviewed by Tim Horton.
934 On animated resize, the size of the DrawingAreaProxy was changed before the layout parameters were
935 changed. This in turn caused the WebProcess's DrawingArea to flush the layer tree while still
936 at the wrong orientation.
938 This patch fixes the issue by making a special case for animated resize:
939 -While starting animated resize, _frameOrBoundsChanged can be called several times in response to
940 the API's client changing the WKWebView. In that case, we do not update the drawing area.
941 -After the "updateBlock" is executed and the size have been changed, the dynamic viewport update
942 is computed, the dynamicViewportSizeUpdate is sent to the WebProcess, followed by the message
943 DrawingArea::updateGeometry(). Since both messages are asynchronous, they are received in that
944 order, and the updateGeometry() is always done after the viewport configuration has been updated.
946 * UIProcess/API/Cocoa/WKWebView.mm:
947 (-[WKWebView _frameOrBoundsChanged]):
948 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
949 * UIProcess/ios/WKContentView.h:
950 * UIProcess/ios/WKContentView.mm:
951 (-[WKContentView setMinimumSize:]): Deleted.
953 2014-07-14 Benjamin Poulain <bpoulain@apple.com>
955 [iOS][WK2] Fix withinEpsilon()
956 https://bugs.webkit.org/show_bug.cgi?id=134798
958 Reviewed by Darin Adler.
960 Move the function back to WKWebView, it is no longer needed in WKContentView.
962 Use the real types as input to properly verify that the two inputs are within
963 a small value of the 32bit floating point.
965 The epsilon we use is always on 32 bits float because we want to avoid doing work for changes
966 that would not make any difference on float.
968 The source of those small changes comes from the fact UIProcess does a lot of processing
969 on CGFloat, which are double on 64bits architecture, while the WebProcess use 32bits floating point
970 for scale. When we are getting updates from the WebProcess, we should ignore any small differences
971 caused by the computations done with less precision.
973 * UIProcess/API/Cocoa/WKWebView.mm:
975 * UIProcess/ios/WKContentViewInteraction.h:
976 (withinEpsilon): Deleted.
978 2014-07-14 Bear Travis <betravis@adobe.com>
980 [Feature Queries] Enable Feature Queries on Mac
981 https://bugs.webkit.org/show_bug.cgi?id=134404
983 Reviewed by Antti Koivisto.
985 Enable Feature Queries on Mac and resume running the
988 * Configurations/FeatureDefines.xcconfig: Turn on
989 ENABLE_CSS3_CONDITIONAL_RULES.
991 2014-07-14 Anders Carlsson <andersca@apple.com>
993 Make shouldKeepCurrentBackForwardListItemInList part of WKPageLoaderClientV5 to avoid breaking ABI
994 https://bugs.webkit.org/show_bug.cgi?id=134889
996 Reviewed by Beth Dakin.
998 * UIProcess/API/C/WKPage.cpp:
999 * UIProcess/API/C/WKPageLoaderClient.h:
1001 2014-07-14 Dan Bernstein <mitz@apple.com>
1003 REGRESSION (r171045): Reproducible crash on navigation in PageClientImpl::willRecordNavigationSnapshot
1004 https://bugs.webkit.org/show_bug.cgi?id=134887
1006 Reviewed by Tim Horton.
1008 * UIProcess/mac/PageClientImpl.mm:
1009 (WebKit::PageClientImpl::navigationGestureDidBegin): nil-check m_webView. It can be nil when
1010 the client is using WKView directly.
1011 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1012 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1013 (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
1015 2014-07-14 Eric Carlson <eric.carlson@apple.com>
1017 [Mac] don't enable low power audio mode on external output devices
1018 https://bugs.webkit.org/show_bug.cgi?id=134877
1020 Reviewed by Sam Weinig.
1022 * PluginProcess/PluginProcess.h: Add an empty implementation of
1023 AudioHardwareListener::audioOutputDeviceChanged.
1025 2014-07-14 Tim Horton <timothy_horton@apple.com>
1027 [iOS] Throttle painting using a UI-process-side CADisplayLink
1028 https://bugs.webkit.org/show_bug.cgi?id=134879
1029 <rdar://problem/17641699>
1031 Reviewed by Simon Fraser.
1033 Just waiting for CA to commit is insufficient to actually throttle to 60fps,
1034 because nothing will block the main runloop from spinning.
1036 Instead, listen to a CADisplayLink, and send didUpdate to the WebProcess
1037 the first time it fires after we commit. This is not a guarantee that
1038 our content is on the screen, but we don't have any way to make that guarantee yet.
1040 This will throttle painting, rAF, etc. to the display refresh rate.
1042 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1043 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1044 (-[OneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
1045 (-[OneShotDisplayLinkHandler dealloc]):
1046 (-[OneShotDisplayLinkHandler displayLinkFired:]):
1047 (-[OneShotDisplayLinkHandler invalidate]):
1048 (-[OneShotDisplayLinkHandler schedule]):
1049 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
1050 (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
1051 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1052 (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
1053 (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): Deleted.
1055 2014-07-14 Dan Bernstein <mitz@apple.com>
1057 <rdar://problem/17657391> [iOS] Networking process writes persistent credentials to the keychain
1058 https://bugs.webkit.org/show_bug.cgi?id=134878
1060 Reviewed by Sam Weinig.
1062 Route CFNetwork’s calls to Security API through to the UI process.
1064 * NetworkProcess/ios/NetworkProcessIOS.mm:
1065 (WebKit::NetworkProcess::platformInitializeNetworkProcess): Initialize SecItemShim.
1067 * Shared/mac/SecItemShim.cpp:
1068 (WebKit::SecItemShim::initialize): On iOS, rather than using a shim library, supply
1069 CFNetwork with alternate functions to call.
1071 * Shared/mac/SecItemShim.messages.in: Removed #if !PLATFORM(IOS).
1072 * UIProcess/mac/SecItemShimProxy.messages.in: Ditto.
1074 * config.h: Define ENABLE_SEC_ITEM_SHIM to 1 on iOS as well.
1076 2014-07-14 Dan Bernstein <mitz@apple.com>
1078 <rdar://problem/17398060> NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
1079 https://bugs.webkit.org/show_bug.cgi?id=134666
1081 Reviewed by Tim Horton.
1083 A SecItem may have an attribute whose value is a SecAccessControlRef, which is not supported
1084 by ArgumentCodersCF. In debug builds, trying to encode a CFDictionary containing a value of
1085 unsupprted type causes an assertion to fail, but in release builds encoding succeeds, and
1086 only decoding fails, in this case silently, simply not delivering the
1087 SecItemShim::secItemResponse message.
1089 The fix is to teach ArgumentCodersCF about SecAccessControlRef.
1091 * Shared/cf/ArgumentCodersCF.cpp:
1092 (IPC::typeFromCFTypeRef): Check for the SecAccessControlRef type.
1093 (IPC::encode): Encode the SecAccessControl serialized into CFData.
1094 (IPC::decode): Deserialize a SecAccessControl from the decoded CFData.
1095 * Shared/cf/ArgumentCodersCF.h:
1096 * config.h: Defined HAVE_SEC_ACCESS_CONTROL.
1098 2014-07-13 Dan Bernstein <mitz@apple.com>
1100 <rdar://problem/17295636> [Cocoa] Include element snapshot in _WKActivatedElementInfo
1101 https://bugs.webkit.org/show_bug.cgi?id=134872
1103 Reviewed by Sam Weinig.
1105 * Shared/InteractionInformationAtPosition.cpp:
1106 (WebKit::InteractionInformationAtPosition::encode): Encode the image if there is one.
1107 (WebKit::InteractionInformationAtPosition::decode): Decode the image if there is one.
1108 * Shared/InteractionInformationAtPosition.h: Added an image member to the struct.
1110 * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: Exposed the boundingRect property and added
1112 * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
1113 (-[_WKActivatedElementInfo _initWithType:URL:location:title:rect:image:]): Added an image
1114 parameter, which is stored in a new ivar.
1115 (-[_WKActivatedElementInfo image]): Added this getter, which converts the ShareableBitmap
1116 into a cached Cocoa image and returns it.
1117 * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: Added image parameter to the
1118 initializer, removed _boundingRect property declaration from here.
1120 * UIProcess/ios/WKActionSheetAssistant.mm:
1121 (-[WKActionSheetAssistant showImageSheet]): Pass the image from the position information
1122 into the _WKActivatedElementInfo initializer.
1123 (-[WKActionSheetAssistant showLinkSheet]): Ditto.
1125 * WebProcess/WebPage/WebPage.cpp:
1126 (WebKit::WebPage::snapshotNode): Added.
1127 * WebProcess/WebPage/WebPage.h:
1129 * WebProcess/WebPage/ios/WebPageIOS.mm:
1130 (WebKit::WebPage::getPositionInformation): If the element is a link or an image, store a
1131 snapshot of it in the image member of the InteractionInformationAtPosition.
1133 2014-07-13 Dan Bernstein <mitz@apple.com>
1135 [Cocoa] Clean up session state API a little
1136 https://bugs.webkit.org/show_bug.cgi?id=134871
1138 Reviewed by Darin Adler.
1140 * UIProcess/API/Cocoa/WKWebView.mm:
1141 (-[WKWebView _sessionState]):
1142 (-[WKWebView _restoreFromSessionState:]): Deleted.
1143 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1145 2014-07-13 Javier Fernandez <jfernandez@igalia.com>
1147 REGRESSION(r171045) [GTK] Build broken.
1148 https://bugs.webkit.org/show_bug.cgi?id=134867
1150 Unreviewed GTK build fix after r171045.
1152 * UIProcess/API/gtk/PageClientImpl.cpp:
1153 (WebKit::PageClientImpl::willRecordNavigationSnapshot):
1154 * UIProcess/API/gtk/PageClientImpl.h:
1156 2014-07-13 Gyuyoung Kim <gyuyoung.kim@samsung.com>
1158 Unreviewed, EFL build fix since r171045.
1160 * UIProcess/CoordinatedGraphics/WebView.h:
1162 2014-07-12 Dan Bernstein <mitz@apple.com>
1164 [Cocoa] Notify the client when a navigation snapshot is taken
1165 https://bugs.webkit.org/show_bug.cgi?id=134865
1167 Reviewed by Sam Weinig.
1169 * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
1171 * UIProcess/Cocoa/NavigationState.h:
1172 * UIProcess/Cocoa/NavigationState.mm:
1173 (WebKit::NavigationState::setNavigationDelegate): Initialize new flag in
1174 m_navigationDelegateMethods.
1175 (WebKit::NavigationState::willRecordNavigationSnapshot): Added. Calls the new
1176 WKNavigationDelegate method.
1178 * UIProcess/PageClient.h: Declared new client function.
1180 * UIProcess/WebPageProxy.cpp:
1181 (WebKit::WebPageProxy::willRecordNavigationSnapshot): Added. Calls the new client function.
1182 * UIProcess/WebPageProxy.h:
1184 * UIProcess/ios/PageClientImplIOS.h:
1185 * UIProcess/ios/PageClientImplIOS.mm:
1186 (WebKit::PageClientImpl::willRecordNavigationSnapshot): Override that calls
1187 NavigationState::willRecordNavigationSnapshot.
1189 * UIProcess/mac/PageClientImpl.h:
1190 * UIProcess/mac/PageClientImpl.mm:
1191 (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
1193 * UIProcess/mac/ViewSnapshotStore.mm:
1194 (WebKit::ViewSnapshotStore::recordSnapshot): Added a call to
1195 WebPageProxy::willRecordNavigationSnapshot.
1197 2014-07-12 Gyuyoung Kim <gyuyoung.kim@samsung.com>
1199 Unreviewed, fix EFL build break since r171034.
1201 * UIProcess/CoordinatedGraphics/WebView.h:
1202 * UIProcess/efl/WebContextEfl.cpp:
1203 (WebKit::WebContext::platformMediaCacheDirectory):
1205 2014-07-12 Darin Adler <darin@apple.com>
1207 Try to fix 32-bit Mac build.
1209 * UIProcess/mac/PageClientImpl.mm:
1210 (WebKit::PageClientImpl::navigationGestureDidBegin): Added WK_API_ENABLED conditional.
1211 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1212 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1214 2014-07-12 Javier Fernandez <jfernandez@igalia.com>
1216 REGRESSION(r171034) [GTK] Build broken.
1217 https://bugs.webkit.org/show_bug.cgi?id=134861
1219 Unreviewed GTK build fix.
1221 * UIProcess/API/gtk/PageClientImpl.cpp:
1222 (WebKit::PageClientImpl::navigationGestureDidBegin):
1223 (WebKit::PageClientImpl::navigationGestureWillEnd):
1224 (WebKit::PageClientImpl::navigationGestureDidEnd):
1225 * UIProcess/API/gtk/PageClientImpl.h:
1227 2014-07-12 Javier Fernandez <jfernandez@igalia.com>
1229 REGRESSION(r171024) [GTK] Build broken.
1230 https://bugs.webkit.org/show_bug.cgi?id=134859
1232 Unreviewed GTK build fix.
1234 * UIProcess/gtk/WebContextGtk.cpp:
1235 (WebKit::WebContext::platformMediaCacheDirectory):
1237 2014-07-12 Dan Bernstein <mitz@apple.com>
1239 <rdar://problem/16020380> [Cocoa] Inform the client when back-forward navigation gestures begin and end
1240 https://bugs.webkit.org/show_bug.cgi?id=134853
1242 Reviewed by Sam Weinig.
1244 * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new WKNavigationDelegate
1247 * UIProcess/API/Cocoa/WKWebView.mm:
1248 (-[WKWebView _isShowingNavigationGestureSnapshot]): Added this getter.
1250 * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property
1251 _isShowingNavigationGestureSnapshot.
1253 * UIProcess/Cocoa/NavigationState.h:
1254 * UIProcess/Cocoa/NavigationState.mm:
1255 (WebKit::NavigationState::setNavigationDelegate): Initialize new flags in
1256 m_navigationDelegateMethods.
1257 (WebKit::NavigationState::navigationGestureDidBegin): Added. Calls the new
1258 WKNavigationDelegate method.
1259 (WebKit::NavigationState::navigationGestureWillEnd): Ditto.
1260 (WebKit::NavigationState::navigationGestureDidEnd): Ditto.
1262 * UIProcess/PageClient.h: Declared new client functions.
1264 * UIProcess/WebPageProxy.cpp:
1265 (WebKit::WebPageProxy::WebPageProxy): Initialize new member variable.
1266 (WebKit::WebPageProxy::navigationGestureDidBegin): Set m_isShowingNavigationGestureSnapshot
1267 and call the new client function.
1268 (WebKit::WebPageProxy::navigationGestureWillEnd): Call the new client function.
1269 (WebKit::WebPageProxy::navigationGestureDidEnd): Ditto.
1270 (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved): Clear
1271 m_isShowingNavigationGestureSnapshot.
1272 * UIProcess/WebPageProxy.h:
1273 (WebKit::WebPageProxy::isShowingNavigationGestureSnapshot): Added this getter.
1275 * UIProcess/ios/PageClientImplIOS.h: Declared overrides of new client functions.
1276 * UIProcess/ios/PageClientImplIOS.mm:
1277 (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
1278 NavigationState function.
1279 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1280 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1282 * UIProcess/ios/ViewGestureControllerIOS.mm:
1283 (WebKit::ViewGestureController::beginSwipeGesture): Added calls to
1284 WebPageProxy::navigationGestureDidBegin and WebPageProxy::navigationGestureWillEnd.
1285 (WebKit::ViewGestureController::endSwipeGesture): Added calls to
1286 WebPageProxy::navigationGestureDidEnd.
1287 (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
1288 WebPageProxy::navigationGestureSnapshotWasRemoved.
1290 * UIProcess/mac/PageClientImpl.h: Declared overrides of new client functions.
1291 * UIProcess/mac/PageClientImpl.mm:
1292 (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
1293 NavigationState function.
1294 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1295 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1297 * UIProcess/mac/ViewGestureControllerMac.mm:
1298 (WebKit::ViewGestureController::beginSwipeGesture): Added call to
1299 WebPageProxy::navigationGestureDidBegin.
1300 (WebKit::ViewGestureController::endSwipeGesture): Added calls to
1301 WebPageProxy::navigationGestureDidEnd.
1302 (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
1303 WebPageProxy::navigationGestureSnapshotWasRemoved.
1305 2014-07-12 Oliver Hunt <oliver@apple.com>
1307 Fix typo in prior patch
1308 https://bugs.webkit.org/show_bug.cgi?id=134858
1310 Reviewed by Sam Weinig.
1314 * UIProcess/mac/WebContextMac.mm:
1315 (WebKit::WebContext::platformDefaultCookieStorageDirectory):
1317 2014-07-12 Dan Bernstein <mitz@apple.com>
1319 [Cocoa] Client is not notified of same-document navigations
1320 https://bugs.webkit.org/show_bug.cgi?id=134855
1322 Reviewed by Sam Weinig.
1324 * UIProcess/API/APILoaderClient.h:
1325 (API::LoaderClient::didSameDocumentNavigationForFrame): Added navigationID parameter.
1327 * UIProcess/API/C/WKPage.cpp:
1328 (WKPageSetPageLoaderClient): Ditto.
1330 * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Added new enum and delegate method.
1332 * UIProcess/Cocoa/NavigationState.h: Declare override of
1333 API::LoaderClient::didSameDocumentNavigationForFrame. Added flag in
1334 m_navigationDelegateMethods struct.
1335 * UIProcess/Cocoa/NavigationState.mm:
1336 (WebKit::NavigationState::setNavigationDelegate): Initialize new m_navigationDelegateMethods
1338 (WebKit::toWKSameDocumentNavigationType): Added this helper to convert from internal to API
1340 (WebKit::NavigationState::LoaderClient::didSameDocumentNavigationForFrame): Override to call
1341 the delegate method, if implemented.
1343 * UIProcess/WebPageProxy.cpp:
1344 (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Added navigationID parameter,
1345 which is forwarded to the client.
1346 * UIProcess/WebPageProxy.h: Added navigationID parameter.
1347 * UIProcess/WebPageProxy.messages.in: Ditto.
1349 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1350 (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): Send the navigation ID.
1351 (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): Ditto.
1352 (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): Ditto.
1353 (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): Ditto.
1355 2014-07-12 Oliver Hunt <oliver@apple.com>
1357 Extend WebContent sandbox to allow some extra access for frameworks
1358 https://bugs.webkit.org/show_bug.cgi?id=134844
1360 Reviewed by Sam Weinig.
1362 Open up the webcontent sandbox a bit so that some external frameworks
1365 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1366 * Shared/WebProcessCreationParameters.cpp:
1367 (WebKit::WebProcessCreationParameters::encode):
1368 (WebKit::WebProcessCreationParameters::decode):
1369 * Shared/WebProcessCreationParameters.h:
1370 * UIProcess/WebContext.cpp:
1371 (WebKit::WebContext::createNewWebProcess):
1372 (WebKit::WebContext::mediaCacheDirectory):
1373 * UIProcess/WebContext.h:
1374 * UIProcess/mac/WebContextMac.mm:
1375 (WebKit::WebContext::platformMediaCacheDirectory):
1376 * WebProcess/cocoa/WebProcessCocoa.mm:
1377 (WebKit::WebProcess::platformInitializeWebProcess):
1379 2014-07-12 Oliver Hunt <oliver@apple.com>
1381 Temporary work around for <rdar://<rdar://problem/17513375>
1382 https://bugs.webkit.org/show_bug.cgi?id=134848
1384 Reviewed by Sam Weinig.
1386 Temporarily work around <rdar://<rdar://problem/17513375> by
1387 dropping the explicit cookie storage if it points out of the
1390 * UIProcess/mac/WebContextMac.mm:
1391 (WebKit::WebContext::platformDefaultCookieStorageDirectory):
1393 2014-07-11 Enrica Casucci <enrica@apple.com>
1395 Implement textStylingAtPosition in WK2.
1396 https://bugs.webkit.org/show_bug.cgi?id=134843
1397 <rdar://problem/17614981>
1399 Reviewed by Benjamin Poulain.
1401 Adding information about typing attributes to EditorState so
1402 that we can implement textStylingAtPosition.
1404 * Shared/EditorState.cpp:
1405 (WebKit::EditorState::encode):
1406 (WebKit::EditorState::decode):
1407 * Shared/EditorState.h:
1408 (WebKit::EditorState::EditorState):
1409 * UIProcess/ios/WKContentViewInteraction.mm:
1410 (-[WKContentView textStylingAtPosition:inDirection:]):
1411 (-[WKContentView canPerformAction:withSender:]):
1412 (-[WKContentView toggleBoldface:]):
1413 (-[WKContentView toggleItalics:]):
1414 (-[WKContentView toggleUnderline:]):
1415 * WebProcess/WebPage/WebPage.cpp:
1416 (WebKit::WebPage::editorState):
1418 2014-07-11 Oliver Hunt <oliver@apple.com>
1420 Tighten WebContent sandbox
1421 https://bugs.webkit.org/show_bug.cgi?id=134834
1423 Reviewed by Sam Weinig.
1425 Define a much tighter sandbox profile for the WebContent process
1427 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1429 2014-07-11 Antti Koivisto <antti@apple.com>
1431 REGRESSION (r170163?): Web content shifts revealing space equivalent to the find bar when clicking a link while a phrase is targeted via Cmd+F
1432 https://bugs.webkit.org/show_bug.cgi?id=134833
1433 <rdar://problem/17580021>
1435 Reviewed by Zalan Bujtas.
1437 Some versions of OS X Safari can't handle the new unfreeze timing. Revert back to DidFirstLayout on Mac.
1439 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1440 (WebKit::WebFrameLoaderClient::dispatchDidLayout):
1442 2014-07-11 Zalan Bujtas <zalan@apple.com>
1444 Subpixel layout: return integral results for offset*, client*, scroll* by default.
1445 https://bugs.webkit.org/show_bug.cgi?id=134651
1447 Reviewed by Simon Fraser.
1449 Revert to returning integral values for Element.offset* client* scroll* by default.
1450 Fractional values break number of sites(tight design) and JS frameworks(fail to handle fractional values).
1452 Since snapped dimension depends on both the original point and the width/height of the box,
1453 we need to call RenderBoxModelObject::pixelSnapped*() helpers, instead of round().
1455 Covered by existing tests
1457 * Shared/WebPreferencesDefinitions.h:
1458 * UIProcess/API/C/WKPreferencesRefPrivate.h:
1460 2014-07-10 Jinwoo Song <jinwoo7.song@samsung.com>
1462 Unreviewed EFL build fix after r170970.
1464 * UIProcess/efl/WebContextEfl.cpp:
1465 (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
1467 2014-07-10 Carlos Alberto Lopez Perez <clopez@igalia.com>
1469 REGRESSION(r170970) REGRESSION(r170974): [GTK] Build broken.
1470 https://bugs.webkit.org/show_bug.cgi?id=134825
1472 Unreviewed GTK build fix.
1474 * Shared/SessionState.h: Put ifdefs for ViewSnapshot on Mac port.
1475 * Shared/WebBackForwardListItem.h: Idem.
1476 * UIProcess/gtk/WebContextGtk.cpp:
1477 (WebKit::WebContext::platformDefaultOpenGLCacheDirectory): Implement skeleton.
1479 2014-07-10 Benjamin Poulain <bpoulain@apple.com>
1481 [iOS][WK2] It should be safe to call WKContentViewInteraction's cleanupInteraction multiple times
1482 https://bugs.webkit.org/show_bug.cgi?id=134820
1484 Reviewed by Andreas Kling.
1486 If a view is destroyed just after a crash, "cleanupInteraction" is called twice: once on crash,
1489 The code handling _interactionViewsContainerView is using KVO to monitor transform changes. It is not safe
1490 to remove the observer if we are not already observing on that view.
1492 To solve the problem, this patch makes the cleanup actually remove the view so that setup and cleanup
1493 are completely symmetrical. If cleanup is called twice, the second time would not enter the branch because
1494 the view is already nil.
1496 * UIProcess/ios/WKContentViewInteraction.mm:
1497 (-[WKContentView setupInteraction]):
1498 (-[WKContentView cleanupInteraction]):
1500 2014-07-10 Simon Fraser <simon.fraser@apple.com>
1502 [iOS WK2] Move WKInspectorHighlightView to its own file
1503 https://bugs.webkit.org/show_bug.cgi?id=134819
1505 Reviewed by Joseph Pecoraro.
1507 WKInspectorHighlightView brought a lot of path/quad-related code into WKContentView.mm,
1508 so move it into its own file.
1510 * UIProcess/WKInspectorHighlightView.h: Added.
1511 * UIProcess/WKInspectorHighlightView.mm: Added.
1512 (-[WKInspectorHighlightView dealloc]):
1513 (-[WKInspectorHighlightView _removeAllLayers]):
1514 (-[WKInspectorHighlightView _createLayers:]):
1515 (findIntersectionOnLineBetweenPoints):
1517 (layerPathWithHole):
1519 (-[WKInspectorHighlightView _layoutForNodeHighlight:]):
1520 (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
1521 (-[WKInspectorHighlightView update:]):
1522 * UIProcess/ios/WKContentView.mm:
1523 (-[WKInspectorHighlightView initWithFrame:]): Deleted.
1524 (-[WKInspectorHighlightView dealloc]): Deleted.
1525 (-[WKInspectorHighlightView _removeAllLayers]): Deleted.
1526 (-[WKInspectorHighlightView _createLayers:]): Deleted.
1527 (findIntersectionOnLineBetweenPoints): Deleted.
1528 (quadIntersection): Deleted.
1529 (layerPathWithHole): Deleted.
1530 (layerPath): Deleted.
1531 (-[WKInspectorHighlightView _layoutForNodeHighlight:]): Deleted.
1532 (-[WKInspectorHighlightView _layoutForRectsHighlight:]): Deleted.
1533 (-[WKInspectorHighlightView update:]): Deleted.
1534 * WebKit2.xcodeproj/project.pbxproj:
1536 2014-07-10 Tim Horton <timothy_horton@apple.com>
1538 REGRESSION (r170935): WKWebView is always transparent until the first layer tree commit
1539 https://bugs.webkit.org/show_bug.cgi?id=134818
1540 <rdar://problem/17632468>
1542 Reviewed by Anders Carlsson.
1544 * UIProcess/API/Cocoa/WKWebView.mm:
1545 (scrollViewBackgroundColor):
1546 r170935 made it so that we would initialize the scroll view background color to an
1547 invalid color until the first layer tree commit. We should go with white instead.
1549 2014-07-10 Enrica Casucci <enrica@apple.com>
1551 Add a mechanism to notify the UIProcess when an editing command is done executing.
1552 https://bugs.webkit.org/show_bug.cgi?id=134807
1554 Reviewed by Tim Horton.
1556 Some editing commands have an effect on some parts of the system that
1557 run inside the UIProcess. A good example are the cursor movement commands
1558 that require an update of the autocorrection/autosuggestion machinery.
1559 This patch adds a way to reliably know when the command has been executed
1560 in the WebProcess. A previous attempt at solving this problem was added in
1561 r170858 and was partially reverted in r170948.
1562 The change also removes the selectionWillChange notification added in r170858.
1564 * UIProcess/PageClient.h:
1565 * UIProcess/WebPageProxy.cpp:
1566 (WebKit::WebPageProxy::editorStateChanged):
1567 * UIProcess/WebPageProxy.h:
1568 * UIProcess/ios/PageClientImplIOS.h:
1569 * UIProcess/ios/PageClientImplIOS.mm:
1570 (WebKit::PageClientImpl::selectionWillChange): Deleted.
1571 * UIProcess/ios/WKContentViewInteraction.h:
1572 * UIProcess/ios/WKContentViewInteraction.mm:
1573 (-[WKContentView executeEditCommandWithCallback:]):
1574 (-[WKContentView _moveUp:withHistory:]):
1575 (-[WKContentView _moveDown:withHistory:]):
1576 (-[WKContentView _moveLeft:withHistory:]):
1577 (-[WKContentView _moveRight:withHistory:]):
1578 (-[WKContentView _moveToStartOfWord:withHistory:]):
1579 (-[WKContentView _moveToStartOfParagraph:withHistory:]):
1580 (-[WKContentView _moveToStartOfLine:withHistory:]):
1581 (-[WKContentView _moveToStartOfDocument:withHistory:]):
1582 (-[WKContentView _moveToEndOfWord:withHistory:]):
1583 (-[WKContentView _moveToEndOfParagraph:withHistory:]):
1584 (-[WKContentView _moveToEndOfLine:withHistory:]):
1585 (-[WKContentView _moveToEndOfDocument:withHistory:]):
1586 (-[WKContentView _selectionWillChange]): Deleted.
1587 * UIProcess/ios/WebPageProxyIOS.mm:
1588 (WebKit::WebPageProxy::executeEditCommand):
1589 (WebKit::WebPageProxy::notifySelectionWillChange): Deleted.
1590 * WebProcess/WebPage/WebPage.h:
1591 * WebProcess/WebPage/WebPage.messages.in:
1592 * WebProcess/WebPage/ios/WebPageIOS.mm:
1593 (WebKit::WebPage::executeEditCommandWithCallback):
1595 2014-07-10 Joseph Pecoraro <pecoraro@apple.com>
1597 [Mac] NSWindow warning: adding an unknown subview opening detached Inspector
1598 https://bugs.webkit.org/show_bug.cgi?id=134813
1600 Reviewed by Timothy Hatcher.
1602 * UIProcess/mac/WebInspectorProxyMac.mm:
1603 (WebKit::WebInspectorProxy::createInspectorWindow):
1604 Use a selector that will avoid the warning message.
1606 2014-07-10 Oliver Hunt <oliver@apple.com>
1608 Remove use of container relative restrictions in the network process sandbox
1609 https://bugs.webkit.org/show_bug.cgi?id=134816
1611 Reviewed by Anders Carlsson.
1613 As i'm tidying up the various sandboxes and that's meaning we
1614 need to reduce some file restrictions in the network process.
1616 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1618 2014-07-10 Pratik Solanki <psolanki@apple.com>
1620 Unreviewed iOS build fix after r170974. Define id if building a non ObjC file.
1622 * UIProcess/mac/ViewSnapshotStore.h:
1624 2014-07-10 Tim Horton <timothy_horton@apple.com>
1626 Store ViewSnapshots directly on the WebBackForwardListItem
1627 https://bugs.webkit.org/show_bug.cgi?id=134667
1628 <rdar://problem/17082639>
1630 Reviewed by Dan Bernstein.
1632 Make ViewSnapshot a refcounted class. Store it directly on the back-forward item
1633 instead of in a side map referenced by UUID. Switch to a very simple LRU eviction model for now.
1634 This fixes a ton of snapshot management bugs; for example, we would start throwing out snapshots
1635 in the page that was actively being interacted with *first* when evicting snapshots, instead of
1636 preferring older snapshots. Additionally, we would not throw away snapshots when back forward items
1639 There is definitely room for improvement of the eviction mechanism, but this is closer to a time-tested implementation.
1641 * Shared/SessionState.h:
1642 Keep a ViewSnapshot instead of a UUID on the BackForwardListItemState.
1644 * Shared/WebBackForwardListItem.h:
1645 Fix some indented namespace contents.
1647 (WebKit::WebBackForwardListItem::snapshot):
1648 (WebKit::WebBackForwardListItem::setSnapshot):
1649 (WebKit::WebBackForwardListItem::setSnapshotUUID): Deleted.
1650 (WebKit::WebBackForwardListItem::snapshotUUID): Deleted.
1651 Switch the snapshot getter/setter to operate on ViewSnapshots instead of UUIDs.
1653 * UIProcess/API/Cocoa/WKWebView.mm:
1654 (-[WKWebView _takeViewSnapshot]):
1655 * UIProcess/API/Cocoa/WKWebViewInternal.h:
1656 * UIProcess/API/mac/WKView.mm:
1657 (-[WKView _takeViewSnapshot]):
1658 * UIProcess/API/mac/WKViewInternal.h:
1659 * UIProcess/PageClient.h:
1660 * UIProcess/WebPageProxy.cpp:
1661 (WebKit::WebPageProxy::takeViewSnapshot):
1662 * UIProcess/WebPageProxy.h:
1663 * UIProcess/ios/PageClientImplIOS.h:
1664 * UIProcess/ios/PageClientImplIOS.mm:
1665 (WebKit::PageClientImpl::takeViewSnapshot):
1666 * UIProcess/mac/PageClientImpl.h:
1667 * UIProcess/mac/PageClientImpl.mm:
1668 (WebKit::PageClientImpl::takeViewSnapshot):
1669 Adopt ViewSnapshot::create, return a PassRefPtr, and class-ify ViewSnapshot.
1671 * UIProcess/ios/ViewGestureControllerIOS.mm:
1672 (WebKit::ViewGestureController::beginSwipeGesture):
1673 (WebKit::ViewGestureController::endSwipeGesture):
1674 * UIProcess/mac/ViewGestureController.h:
1675 * UIProcess/mac/ViewGestureControllerMac.mm:
1676 (WebKit::ViewGestureController::shouldUseSnapshotForSize):
1677 (WebKit::ViewGestureController::beginSwipeGesture):
1678 (WebKit::ViewGestureController::endSwipeGesture):
1679 Grab the ViewSnapshot directly from the WebBackForwardListItem, and adopt the new functions.
1681 * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
1682 (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
1683 Rename discardSnapshots to discardSnapshotImages, because we're really only discarding
1684 the images; the render tree size/background color "snapshot" remains and is useful.
1686 * UIProcess/mac/ViewSnapshotStore.h:
1687 (WebKit::ViewSnapshot::setRenderTreeSize):
1688 (WebKit::ViewSnapshot::renderTreeSize):
1689 (WebKit::ViewSnapshot::setBackgroundColor):
1690 (WebKit::ViewSnapshot::backgroundColor):
1691 (WebKit::ViewSnapshot::setDeviceScaleFactor):
1692 (WebKit::ViewSnapshot::deviceScaleFactor):
1693 (WebKit::ViewSnapshot::imageSizeInBytes):
1694 (WebKit::ViewSnapshot::surface):
1695 (WebKit::ViewSnapshot::size):
1696 (WebKit::ViewSnapshot::creationTime):
1697 Make ViewSnapshot a refcounted class.
1698 Add create functions which take an image (or slot ID), and relevant sizes.
1699 It is expected that a ViewSnapshot is created with an image, and it is only possible
1700 to remove that image, never to replace it. A new ViewSnapshot is required in that case.
1701 Add setters for things that ViewSnapshotStore sets on the snapshot after the PageClient
1702 retrieves it from the view. Add getters for things that the ViewGestureControllers need.
1704 Remove removeSnapshotImage, getSnapshot, and the snapshot map.
1706 * UIProcess/mac/ViewSnapshotStore.mm:
1707 (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
1708 (WebKit::ViewSnapshotStore::didAddImageToSnapshot):
1709 (WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
1710 Manage m_snapshotCacheSize and m_snapshotsWithImages via didAddImageToSnapshot and willRemoveImageFromSnapshot.
1711 willRemoveImageFromSnapshot will -always- be called before the ViewSnapshot is destroyed.
1713 (WebKit::ViewSnapshotStore::pruneSnapshots):
1714 Switch to a simple LRU eviction model. As previously mentioned, it's possible to do better, but
1715 this is much less broken than the previous implementation.
1717 (WebKit::ViewSnapshotStore::recordSnapshot):
1718 (WebKit::ViewSnapshotStore::discardSnapshotImages):
1719 (WebKit::ViewSnapshot::create):
1720 (WebKit::ViewSnapshot::ViewSnapshot):
1721 (WebKit::ViewSnapshot::~ViewSnapshot):
1722 (WebKit::ViewSnapshot::hasImage):
1723 (WebKit::ViewSnapshot::clearImage):
1724 (WebKit::ViewSnapshot::asLayerContents):
1725 If a surface is Empty when it comes back from being volatile, throw away the surface
1726 and notify the Store to remove it from m_snapshotCacheSize (via clearImage()).
1728 (WebKit::ViewSnapshotStore::removeSnapshotImage): Deleted.
1729 (WebKit::ViewSnapshotStore::getSnapshot): Deleted.
1730 (WebKit::ViewSnapshotStore::discardSnapshots): Deleted.
1732 2014-07-10 Beth Dakin <bdakin@apple.com>
1734 Need Setting/WKPreference that allows clients to prevent scrollbars from drawing
1735 on a secondary thread
1736 https://bugs.webkit.org/show_bug.cgi?id=134778
1738 <rdar://problem/17595333>
1740 Reviewed by Tim Horton.
1742 This is a requirement for some types of performance tests.
1745 * Shared/WebPreferencesDefinitions.h:
1747 PDFPlugin has to implement this new ScrollableArea virtual function to indicate
1748 the Setting’s value.
1749 * WebProcess/Plugins/PDF/PDFPlugin.h:
1750 * WebProcess/Plugins/PDF/PDFPlugin.mm:
1751 (WebKit::PDFPlugin::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
1754 * WebProcess/WebPage/WebPage.cpp:
1755 (WebKit::WebPage::updatePreferences):
1757 2014-07-10 Tim Horton <timothy_horton@apple.com>
1759 [iOS] Frequent assertion failures when swiping back
1761 Reviewed by Dan Bernstein.
1763 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1764 (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
1765 Don't create an unused VoidCallback. It will assert when destroyed without being called.
1767 2014-07-10 Oliver Hunt <oliver@apple.com>
1769 Pass sandbox extension for GL cache over to webprocess
1770 https://bugs.webkit.org/show_bug.cgi?id=134806
1772 Reviewed by Anders Carlsson.
1774 Add additional WebProcess parameters to pass an extension
1775 that allows access to the opengl cache directory in the
1776 host application's container.
1778 * Shared/WebProcessCreationParameters.cpp:
1779 (WebKit::WebProcessCreationParameters::encode):
1780 (WebKit::WebProcessCreationParameters::decode):
1781 * Shared/WebProcessCreationParameters.h:
1782 * UIProcess/WebContext.cpp:
1783 (WebKit::WebContext::createNewWebProcess):
1784 (WebKit::WebContext::openGLCacheDirectory):
1785 * UIProcess/WebContext.h:
1786 * UIProcess/mac/WebContextMac.mm:
1787 (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
1788 * WebProcess/cocoa/WebProcessCocoa.mm:
1789 (WebKit::WebProcess::platformInitializeWebProcess):
1791 2014-07-10 Dan Bernstein <mitz@apple.com>
1795 * WebProcess/WebPage/ServicesOverlayController.h:
1797 2014-07-09 Brady Eidson <beidson@apple.com>
1799 Phone number highlights should always be visible if the mouse hovers over.
1800 <rdar://problem/17527476> and https://bugs.webkit.org/show_bug.cgi?id=134784
1802 Reviewed by Tim Horton.
1804 This is a fairly extensive rewrite of ServicesOverlayController.
1805 It allows one selection highlight for the entire selection, and as many telephone number highlights as there are numbers.
1806 If a telephone number highlight is hovered over, it wins and is painted.
1807 If no telephone number highlight is hovered but the selection highlight is, then it is painted.
1809 The purposes of each method are self evident by their name, and the concepts are mostly the same as they used to be.
1811 The exception is establishHoveredTelephoneHighlight which gets a more detailed explanation below.
1813 * Platform/Logging.h: Add a Services logging channel.
1815 * WebProcess/WebPage/ServicesOverlayController.h:
1816 (WebKit::TelephoneNumberData::TelephoneNumberData):
1818 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1819 (WebKit::ServicesOverlayController::ServicesOverlayController):
1820 (WebKit::ServicesOverlayController::selectionRectsDidChange):
1821 (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
1822 (WebKit::ServicesOverlayController::clearHighlightState):
1823 (WebKit::ServicesOverlayController::drawRect):
1824 (WebKit::ServicesOverlayController::drawSelectionHighlight):
1825 (WebKit::ServicesOverlayController::maybeDrawTelephoneNumberHighlight):
1826 (WebKit::ServicesOverlayController::drawHighlight):
1827 (WebKit::ServicesOverlayController::clearSelectionHighlight):
1828 (WebKit::ServicesOverlayController::clearHoveredTelephoneNumberHighlight):
1829 (WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight): Starts walking the telephone number ranges and
1830 creating a highlight for each one that doesn’t already have a highlight. If that highlight is also being hovered by
1831 the mouse, then it is set as the hovered telephone number highlight and the method stops creating new highlights.
1832 (WebKit::ServicesOverlayController::maybeCreateSelectionHighlight):
1833 (WebKit::ServicesOverlayController::mouseEvent):
1834 (WebKit::ServicesOverlayController::handleClick):
1835 (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Deleted.
1836 (WebKit::ServicesOverlayController::drawCurrentHighlight): Deleted.
1838 2014-07-10 Timothy Horton <timothy_horton@apple.com>
1840 Assertions or crashes under _takeViewSnapshot when restoring windows
1841 https://bugs.webkit.org/show_bug.cgi?id=134792
1843 Reviewed by Simon Fraser.
1845 * UIProcess/API/mac/WKView.mm:
1846 (-[WKView _takeViewSnapshot]):
1847 Taking a window-server snapshot of a non-visible window tends to not succeed.
1849 2014-07-09 Pratik Solanki <psolanki@apple.com>
1851 Buffer CSS and JS resources in network process before sending over to web process
1852 https://bugs.webkit.org/show_bug.cgi?id=134560
1853 <rdar://problem/16737186>
1855 Reviewed by Antti Koivisto.
1857 For CSS and JS resources, ask the network process to buffer the entire resource instead of
1858 sending it to web process in chunks since the web process can't do anything with a partial
1861 * NetworkProcess/NetworkResourceLoader.cpp:
1862 (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1863 * Shared/Network/NetworkResourceLoadParameters.cpp:
1864 (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
1865 (WebKit::NetworkResourceLoadParameters::encode):
1866 (WebKit::NetworkResourceLoadParameters::decode):
1867 * Shared/Network/NetworkResourceLoadParameters.h:
1868 * WebProcess/Network/WebResourceLoadScheduler.cpp:
1869 (WebKit::WebResourceLoadScheduler::scheduleLoad):
1871 2014-07-09 Benjamin Poulain <bpoulain@apple.com>
1873 [iOS][WK2] Disable text quantization while actively changing the page's scale factor
1874 https://bugs.webkit.org/show_bug.cgi?id=134781
1876 Reviewed by Tim Horton and Myles C. Maxfield.
1878 While zooming a page, text quantization causes glyphs to "move" in order to get to the closest
1879 boundary for the current scale factor.
1881 We do not want this to happen while dynamically changing the scale factor because the effect
1882 is visible. To avoid this, we disable text quantization if the page's scale factor changes
1883 in response to a non-stable contentRect update.
1885 * WebProcess/WebCoreSupport/WebChromeClient.h:
1886 * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1887 (WebKit::WebChromeClient::hasStablePageScaleFactor):
1888 * WebProcess/WebPage/WebPage.cpp:
1889 (WebKit::WebPage::WebPage):
1890 * WebProcess/WebPage/WebPage.h:
1891 (WebKit::WebPage::hasStablePageScaleFactor):
1892 * WebProcess/WebPage/ios/WebPageIOS.mm:
1893 (WebKit::WebPage::updateVisibleContentRects):
1895 2014-07-09 Joseph Pecoraro <pecoraro@apple.com>
1897 [iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI
1898 https://bugs.webkit.org/show_bug.cgi?id=134777
1900 Reviewed by Sam Weinig.
1902 * UIProcess/ios/forms/WKFileUploadPanel.mm:
1903 (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
1905 2014-07-09 Shivakumar JM <shiva.jm@samsung.com>
1907 [EFL][WK2] Add new Public API in ewk_download_job.h to get size of the data already downloaded.
1908 https://bugs.webkit.org/show_bug.cgi?id=134759
1910 Reviewed by Gyuyoung Kim.
1912 Add new API in ewk_download_job.h to get size of the data already downloaded.
1914 * UIProcess/API/efl/ewk_download_job.cpp:
1915 (ewk_download_job_received_data_length_get):
1916 (EwkDownloadJob::receivedData):
1917 * UIProcess/API/efl/ewk_download_job.h:
1918 * UIProcess/API/efl/ewk_download_job_private.h:
1919 * UIProcess/API/efl/tests/test_ewk2_download_job.cpp:
1920 (EWK2DownloadJobTest::on_download_requested):
1921 (EWK2DownloadJobTest::on_download_finished):
1923 2014-07-09 Enrica Casucci <enrica@apple.com>
1925 REGRESSION(r170858): Safari freezes upon making a search on a website (yelp.com).
1926 https://bugs.webkit.org/show_bug.cgi?id=134791
1927 <rdar://problem/17616971>
1929 Reviewed by Benjamin Poulain.
1931 After r170858 we notify the keyboard too often about
1932 the changed selection. This patch removes the notification
1933 until we find a better way to do it that doesn't cause
1936 * UIProcess/ios/WKContentViewInteraction.mm:
1937 (-[WKContentView _selectionWillChange]):
1938 (-[WKContentView _selectionChanged]):
1940 2014-07-09 Anders Carlsson <andersca@apple.com>
1942 Safari showing blank pages
1943 https://bugs.webkit.org/show_bug.cgi?id=134790
1944 <rdar://problem/17617166>
1946 Reviewed by Simon Fraser.
1948 * UIProcess/API/Cocoa/WKWebView.mm:
1949 (-[WKWebView initWithFrame:configuration:]):
1950 Make sure to add the content view to the scroll view.
1952 2014-07-09 Anders Carlsson <andersca@apple.com>
1954 Closed web views should never create new web processes
1955 https://bugs.webkit.org/show_bug.cgi?id=134787
1956 <rdar://problem/16892526>
1958 Reviewed by Simon Fraser.
1960 * UIProcess/API/Cocoa/WKWebView.mm:
1961 (-[WKWebView loadHTMLString:baseURL:]):
1962 (-[WKWebView reload]):
1963 (-[WKWebView reloadFromOrigin]):
1964 Return nil if the returned navigation ID is 0.
1966 * UIProcess/WebPageProxy.cpp:
1967 (WebKit::WebPageProxy::reattachToWebProcess):
1968 Assert that the page is not closed.
1970 (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1971 (WebKit::WebPageProxy::loadRequest):
1972 (WebKit::WebPageProxy::loadFile):
1973 (WebKit::WebPageProxy::loadData):
1974 (WebKit::WebPageProxy::loadHTMLString):
1975 (WebKit::WebPageProxy::loadAlternateHTMLString):
1976 (WebKit::WebPageProxy::loadPlainTextString):
1977 (WebKit::WebPageProxy::loadWebArchiveData):
1978 Add early returns if the page is closed.
1980 * UIProcess/WebPageProxy.h:
1982 2014-07-09 Anders Carlsson <andersca@apple.com>
1984 Support transparent WKWebViews
1985 https://bugs.webkit.org/show_bug.cgi?id=134779
1986 <rdar://problem/17351058>
1988 Reviewed by Tim Horton.
1990 * UIProcess/API/Cocoa/WKWebView.mm:
1991 (-[WKWebView initWithFrame:configuration:]):
1992 Call _updateScrollViewBackground instead of setting the background color.
1997 (scrollViewBackgroundColor):
1998 Helper function that returns the scroll view background color.
1999 If the web view isn't opaque, we want the scroll view to be transparent.
2001 (-[WKWebView _updateScrollViewBackground]):
2002 Call scrollViewBackgroundColor.
2004 (-[WKWebView setOpaque:]):
2005 Call WebPageProxy::setDrawsBackground and update the scroll view background.
2007 (-[WKWebView setBackgroundColor:]):
2008 Call setBackgroundColor on the content view.
2010 2014-07-09 Andy Estes <aestes@apple.com>
2012 [iOS] WebKit can crash under QuickLookDocumentData::encode() when viewing a QuickLook preview
2013 https://bugs.webkit.org/show_bug.cgi?id=134780
2015 Reviewed by Tim Horton.
2017 Don't use CFDataCreateWithBytesNoCopy() when we can't guarantee the lifetime of the copied-from DataReference
2018 will match or exceed that of the CFDataRef. Copy the data instead.
2020 * WebProcess/Network/WebResourceLoader.cpp:
2021 (WebKit::WebResourceLoader::didReceiveData):
2023 2014-07-09 Pratik Solanki <psolanki@apple.com>
2025 Move resource buffering from SynchronousNetworkLoaderClient to NetworkResourceLoader
2026 https://bugs.webkit.org/show_bug.cgi?id=134732
2028 Reviewed by Darin Adler.
2030 Buffer the resource in NetworkResourceLoader instead of SynchronousNetworkLoaderClient. This
2031 is in preparation for bug 134560 where we will be supporting JS and CSS resource buffering
2032 that uses AsynchronousNetworkLoaderClient.
2034 * NetworkProcess/NetworkResourceLoader.cpp:
2035 (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2036 (WebKit::NetworkResourceLoader::didReceiveBuffer):
2037 (WebKit::NetworkResourceLoader::didFinishLoading):
2038 * NetworkProcess/NetworkResourceLoader.h:
2039 (WebKit::NetworkResourceLoader::bufferedData):
2040 * NetworkProcess/SynchronousNetworkLoaderClient.cpp:
2041 (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer):
2042 (WebKit::SynchronousNetworkLoaderClient::didFinishLoading):
2043 (WebKit::SynchronousNetworkLoaderClient::didFail):
2044 (WebKit::SynchronousNetworkLoaderClient::sendDelayedReply):
2045 * NetworkProcess/SynchronousNetworkLoaderClient.h:
2047 2014-07-09 Benjamin Poulain <bpoulain@apple.com>
2049 [iOS][WK2] subviews of the unscaled view drift out during CA animations
2050 https://bugs.webkit.org/show_bug.cgi?id=134751
2052 Reviewed by Enrica Casucci.
2054 It is not possible to animate the WKContentView and the inverse view in such a way
2055 that the combined matrix remain the identity for every frame of the animation.
2057 This patch solves the issue by moving the unscaled view as a sibling of WKContentView
2058 instead of a child so that we do not need to update two scales simultaneously.
2060 * UIProcess/API/Cocoa/WKWebView.mm:
2061 (-[WKWebView initWithFrame:configuration:]):
2062 (-[WKWebView _processDidExit]):
2063 (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
2064 Set the z scale to 1 or no coordinate transform will work with this view.
2066 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2067 (-[WKWebView _endAnimatedResize]):
2068 * UIProcess/ios/WKContentView.mm:
2069 (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
2070 * UIProcess/ios/WKContentViewInteraction.h:
2071 * UIProcess/ios/WKContentViewInteraction.mm:
2072 (-[WKContentView setupInteraction]):
2073 Since we need to observe changes inside the animation block, the code now use KVO to observe changes of scale.
2075 (-[WKContentView cleanupInteraction]):
2076 (-[WKContentView unscaledView]):
2077 (-[WKContentView inverseScale]):
2078 (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
2079 We update the utility views as usual. The extra bits here are to deal with views coming in during an animation.
2081 If a new utility view comes in during a scaling animation, we do not want to start a new animation with the same curve
2082 to end up at the right place. To avoid any issue, we just hide the view until the animation is finished.
2084 (-[WKContentView hitTest:withEvent:]):
2085 (-[WKContentView _showTapHighlight]):
2086 (-[WKContentView _updateUnscaledView]): Deleted.
2088 2014-07-09 Tim Horton <timothy_horton@apple.com>
2090 Use IOSurface ViewSnapshots everywhere on Mac, remove JPEG encoding path
2091 https://bugs.webkit.org/show_bug.cgi?id=134773
2093 Reviewed by Anders Carlsson.
2095 * UIProcess/API/mac/WKView.mm:
2096 (-[WKView _takeViewSnapshot]):
2097 * UIProcess/mac/ViewSnapshotStore.h:
2098 * UIProcess/mac/ViewSnapshotStore.mm:
2099 (WebKit::ViewSnapshotStore::ViewSnapshotStore):
2100 (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
2101 (WebKit::ViewSnapshotStore::recordSnapshot):
2102 (WebKit::ViewSnapshot::clearImage):
2103 (WebKit::ViewSnapshot::asLayerContents):
2104 (WebKit::createIOSurfaceFromImage): Deleted.
2105 (WebKit::compressImageAsJPEG): Deleted.
2106 (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost): Deleted.
2107 (WebKit::ViewSnapshotStore::didCompressSnapshot): Deleted.
2108 Remove all ViewSnapshot(Store) code related to JPEG-encoded snapshots.
2109 Remove the "image" member on ViewSnapshot; Mac will always start out with an IOSurface instead.
2110 Adopt WebCore::IOSurface::createFromImage to make that happen.
2111 Add a comment noting that if a snapshot comes back empty, we should throw it away completely.
2113 2014-07-09 Anders Carlsson <andersca@apple.com>
2115 RemoteLayerBackingStore::ensureBackingStore should ensure that the entire backing store gets redrawn
2116 https://bugs.webkit.org/show_bug.cgi?id=134772
2118 Reviewed by Tim Horton.
2120 * Shared/mac/RemoteLayerBackingStore.h:
2121 (WebKit::RemoteLayerBackingStore::Buffer::operator bool):
2122 * Shared/mac/RemoteLayerBackingStore.mm:
2123 (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2125 2014-07-09 KwangHyuk Kim <hyuki.kim@samsung.com>
2127 [EFL] Fix crash caused by invalid cursor image.
2128 https://bugs.webkit.org/show_bug.cgi?id=134663
2130 Reviewed by Gyuyoung Kim.
2132 Remove calling of updateCursor since the custom cursor image is invalid once a mouse is out of the webview.
2134 * UIProcess/API/efl/EwkView.cpp:
2135 (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
2137 2014-07-08 Tim Horton <timothy_horton@apple.com>
2139 Remove WebBackForwardListItems when their owning page goes away
2140 https://bugs.webkit.org/show_bug.cgi?id=134709
2141 <rdar://problem/17584645>
2143 Reviewed by Dan Bernstein.
2145 * Shared/WebBackForwardListItem.cpp:
2146 (WebKit::WebBackForwardListItem::create):
2147 (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2148 * Shared/WebBackForwardListItem.h:
2149 (WebKit::WebBackForwardListItem::pageID):
2150 Add the associated PageID to the WebBackForwardListItem.
2152 * UIProcess/WebBackForwardList.cpp:
2153 (WebKit::WebBackForwardList::restoreFromState):
2154 Push the current PageID onto the WebBackForwardListItem.
2156 * UIProcess/WebProcessProxy.cpp:
2157 (WebKit::WebProcessProxy::removeWebPage):
2158 Remove all of the WebBackForwardListItems from m_backForwardListItemMap when
2159 the page they are associated with is removed.
2161 (WebKit::WebProcessProxy::addBackForwardItem):
2162 Push the PageID from the WebProcess onto the WebBackForwardListItem.
2164 * UIProcess/WebProcessProxy.h:
2165 * UIProcess/WebProcessProxy.messages.in:
2166 * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2167 (WebKit::idToHistoryItemMap):
2168 (WebKit::historyItemToIDMap):
2169 (WebKit::updateBackForwardItem):
2170 (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
2171 (WebKit::WK2NotifyHistoryItemChanged):
2172 (WebKit::WebBackForwardListProxy::idForItem):
2173 (WebKit::WebBackForwardListProxy::addItem):
2174 (WebKit::WebBackForwardListProxy::goToItem):
2175 (WebKit::WebBackForwardListProxy::close):
2176 * WebProcess/WebPage/WebBackForwardListProxy.h:
2177 * WebProcess/WebPage/WebPage.cpp:
2178 (WebKit::WebPage::restoreSession):
2179 Keep track of the PageID that back-forward items were created by.
2180 Pass the PageID along when registering WebBackForwardListItems.
2182 2014-07-08 Tim Horton <timothy_horton@apple.com>
2184 [WK2] Expose a few drawing/compositing settings on WKPreferences(Private)
2185 https://bugs.webkit.org/show_bug.cgi?id=134645
2187 Reviewed by Dan Bernstein.
2189 * UIProcess/API/Cocoa/WKPreferences.mm:
2190 (-[WKPreferences _compositingBordersVisible]):
2191 (-[WKPreferences _setCompositingBordersVisible:]):
2192 (-[WKPreferences _compositingRepaintCountersVisible]):
2193 (-[WKPreferences _setCompositingRepaintCountersVisible:]):
2194 (-[WKPreferences _tiledScrollingIndicatorVisible]):
2195 (-[WKPreferences _setTiledScrollingIndicatorVisible:]):
2196 * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2197 Expose layer borders, repaint counters, and the tiled scrolling indicator on WKPreferences, as SPI.
2199 2014-07-08 Tim Horton <timothy_horton@apple.com>
2201 WKProcessPoolConfigurationPrivate's maximumProcessCount property has no effect
2202 https://bugs.webkit.org/show_bug.cgi?id=134711
2204 Reviewed by Dan Bernstein.
2206 * UIProcess/API/Cocoa/WKProcessPool.mm:
2207 (-[WKProcessPool _initWithConfiguration:]):
2208 Respect the maximumProcessCount.
2209 Currently the default limit is UINT_MAX; if maximumProcessCount = 0 (the default), we'll use that limit.
2211 2014-07-08 Adrian Perez de Castro <aperez@igalia.com>
2213 [GTK] Move user style sheet API out of WebKitWebViewGroup
2214 https://bugs.webkit.org/show_bug.cgi?id=134551
2216 Reviewed by Carlos Garcia Campos.
2218 * PlatformGTK.cmake: Include the new source files in the build.
2219 * UIProcess/API/C/gtk/WKView.cpp:
2221 Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
2222 * UIProcess/API/gtk/WebKitUserContent.cpp: Added.
2223 (toUserContentInjectedFrames):
2226 (_WebKitUserStyleSheet::_WebKitUserStyleSheet):
2227 (webkit_user_style_sheet_ref):
2228 (webkit_user_style_sheet_unref):
2229 (webkit_user_style_sheet_new):
2230 (webkitWebKitUserStyleSheetToUserStyleSheet):
2231 * UIProcess/API/gtk/WebKitUserContent.h: Added.
2232 * UIProcess/API/gtk/WebKitUserContentManager.cpp: Added.
2233 (_WebKitUserContentManagerPrivate::_WebKitUserContentManagerPrivate):
2234 (webkit_user_content_manager_class_init):
2235 (webkit_user_content_manager_new):
2236 (webkit_user_content_manager_add_style_sheet):
2237 (webkit_user_content_manager_remove_all_style_sheets):
2238 (webkitUserContentManagerGetUserContentControllerProxy):
2239 * UIProcess/API/gtk/WebKitUserContentManager.h: Added.
2240 * UIProcess/API/gtk/WebKitUserContentManagerPrivate.h: Added.
2241 * UIProcess/API/gtk/WebKitUserContentPrivate.h: Added.
2242 * UIProcess/API/gtk/WebKitWebContext.cpp:
2243 (webkitWebContextCreatePageForWebView): Add a new parameter to allow
2244 passing the WebKitUserContentManager that the web view will use.
2245 * UIProcess/API/gtk/WebKitWebContextPrivate.h: Ditto.
2246 * UIProcess/API/gtk/WebKitWebView.cpp:
2247 (webkitWebViewConstructed): Added handling of the
2248 "user-content-manager" property on construction.
2249 (webkitWebViewSetProperty): Added support for the
2250 "user-content-manager" property.
2251 (webkitWebViewGetProperty): Added support for the
2252 "user-content-manager" property.
2253 (webkit_web_view_class_init): Added the "user-content-manager"
2254 property definition to the WebKitWebView class.
2255 (webkit_web_view_new_with_related_view): Made related views share
2256 the same WebKitUserContentManager used by the view they are
2258 (webkit_web_view_new_with_user_content_manager): Added.
2259 (webkit_web_view_get_user_content_manager): Added.
2260 * UIProcess/API/gtk/WebKitWebView.h: Add new API methods.
2261 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2262 (webkitWebViewBaseCreate): Added a parameter to pass the user
2264 (webkitWebViewBaseCreateWebPage): Added a parameter to pass the user
2266 * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Ditto.
2267 * UIProcess/API/gtk/WebKitWebViewGroup.cpp: Removed the bits related
2268 to user style sheet support from WebKitWebViewGroup.
2269 (webkit_web_view_group_set_settings):
2270 (toAPIArray): Deleted.
2271 (webkit_web_view_group_add_user_style_sheet): Deleted.
2272 (webkit_web_view_group_remove_all_user_style_sheets): Deleted.
2273 * UIProcess/API/gtk/WebKitWebViewGroup.h: Deleted the API methods
2274 for user style sheet handling.
2275 * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added the new API
2276 functions and types, and removed the methods which are no longer
2277 available in WebKitWebViewGroup.
2278 * UIProcess/API/gtk/webkit2.h: Add the new headers.
2279 * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added
2280 methods to add and remove user style sheets, alike those used for
2282 (WebKit::WebUserContentControllerProxy::addProcess):
2283 (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2284 (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
2285 * UIProcess/UserContent/WebUserContentControllerProxy.h: Ditto.
2286 * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2287 (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2288 Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
2289 * WebProcess/UserContent/WebUserContentController.cpp: Added methods
2290 to add and remove user style sheets, alike those used for user scripts.
2291 (WebKit::WebUserContentController::addUserStyleSheets):
2292 (WebKit::WebUserContentController::removeAllUserStyleSheets):
2293 * WebProcess/UserContent/WebUserContentController.h: Ditto.
2294 * WebProcess/UserContent/WebUserContentController.messages.in:
2297 2014-07-08 Zan Dobersek <zdobersek@igalia.com>
2299 [GTK] Guard uses of RedirectedXCompositeWindow in WebKitWebViewBase with PLATFORM(X11)
2300 https://bugs.webkit.org/show_bug.cgi?id=133871
2302 Reviewed by Martin Robinson.
2304 Guard uses of the RedirectedXCompositeWindow object in WebKitWebViewBase with the
2305 PLATFORM(X11) build guard. This is required to properly support building the GTK
2306 port only for the Wayland target.
2308 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2309 (webkitWebViewBaseConstructed):
2310 (webkitWebViewRenderAcceleratedCompositingResults):
2311 (resizeWebKitWebViewBaseFromAllocation):
2312 (webkitWebViewBaseUpdatePreferences):
2313 (webkitWebViewBaseCreateWebPage):
2315 2014-07-07 Tim Horton <timothy_horton@apple.com>
2317 Turn on accelerated drawing for WebKit2 by default
2318 https://bugs.webkit.org/show_bug.cgi?id=134708
2319 <rdar://problem/17584642>
2321 Reviewed by Simon Fraser.
2323 * Shared/WebPreferencesDefinitions.h:
2324 Make Mac match iOS, in that accelerated drawing is on by default.
2326 2014-07-07 Timothy Horton <timothy_horton@apple.com>
2328 Don't leak _WKRemoteObjectRegistry in WKBrowsingContextController
2329 https://bugs.webkit.org/show_bug.cgi?id=134703
2331 Reviewed by Simon Fraser.
2333 * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2334 (-[WKBrowsingContextController _remoteObjectRegistry]):
2335 Adoption is important!!
2337 2014-07-07 Simon Fraser <simon.fraser@apple.com>
2339 [UI-side compositing] Support reflections on custom layers like video
2340 https://bugs.webkit.org/show_bug.cgi?id=134701
2342 Reviewed by Tim Horton.
2344 For video reflections, we have to support cloning of PlatformCALayerRemoteCustom
2345 in the web process. Do so by implementing PlatformCALayerRemoteCustom::clone(),
2346 which does the right gyrations to get AVPlayerLayers cloned, then makes a
2347 new PlatformCALayerRemoteCustom to wrap the new layer. This ends up getting
2348 its own context hosting ID, allowing the clone to show in the UI process.
2350 Attempt to do the same for WebGL, but turn it off because it breaks.
2352 * Shared/mac/RemoteLayerBackingStore.mm:
2353 (WebKit::RemoteLayerBackingStore::drawInContext):
2354 * Shared/mac/RemoteLayerTreeTransaction.mm:
2355 (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode): Unconditionally encode/decode
2356 the hostingContextID. It will be 0 for most layers.
2357 (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
2358 (WebKit::RemoteLayerTreeTransaction::description):
2359 * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
2360 (WebKit::RemoteLayerTreeHost::createLayer):
2361 * UIProcess/mac/RemoteLayerTreeHost.mm:
2362 (WebKit::RemoteLayerTreeHost::createLayer):
2363 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2364 (WebKit::PlatformCALayerRemote::create): Creation with a custom PlatformLayer* always
2365 creates a PlatformCALayerRemoteCustom.
2366 (WebKit::PlatformCALayerRemote::clone): Factor some code.
2367 (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
2368 (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2369 * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2370 * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
2371 * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
2372 (WebKit::PlatformCALayerRemoteCustom::create):
2373 (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
2374 (WebKit::PlatformCALayerRemoteCustom::clone): Clone by making an instance of the
2375 correct type of platform layer when possible, then wrapping a PlatformCALayerRemoteCustom
2377 (WebKit::PlatformCALayerRemoteCustom::contents):
2378 (WebKit::PlatformCALayerRemoteCustom::setContents):
2379 * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2380 (WebKit::RemoteLayerTreeContext::layerWasCreated):
2381 (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
2383 2014-07-07 Simon Fraser <simon.fraser@apple.com>
2385 [UI-side compositing] Crash when starting a filter transition on a reflected layer
2386 https://bugs.webkit.org/show_bug.cgi?id=134694
2388 Reviewed by Tim Horton.
2390 When cloned layers had animations, we would fire two animationDidStart callbacks,
2391 but the second would pass an empty animationKey string to the web process, resulting
2394 Fix by not blindly copying all layer properties when cloning PlatformCALayerRemotes,
2395 since the clone would include addedAnimations, and then get the same animations
2396 added on top by the caller.
2398 Also protect against an empty animation key in the animationDidStart callback.
2400 * UIProcess/mac/RemoteLayerTreeHost.mm:
2401 (WebKit::RemoteLayerTreeHost::animationDidStart):
2402 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2403 (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
2404 (WebKit::PlatformCALayerRemote::clone): Don't copy all the properties; copy
2405 them manually as PlatformCALayerMac does. Only copy the big things if they don't
2406 have their default values.
2407 (WebKit::PlatformCALayerRemote::copyFiltersFrom): Need an implementation of this
2408 for clone() to call.
2410 2014-07-07 Tim Horton <timothy_horton@apple.com>
2412 Nearly everything in the UIProcess "leaks" when WKWebView is torn down
2413 https://bugs.webkit.org/show_bug.cgi?id=134699
2414 <rdar://problem/17581777>
2416 Reviewed by Simon Fraser.
2418 * UIProcess/API/Cocoa/WKWebView.mm:
2419 (-[WKWebView initWithFrame:configuration:]):
2420 Adoption is important!
2422 2014-07-07 Enrica Casucci <enrica@apple.com>
2424 REGRESSION(iOS WK2): arrow keys movements don't work.
2425 https://bugs.webkit.org/show_bug.cgi?id=134561
2426 <rdar://problem/16827629>
2428 Reviewed by Benjamin Poulain.
2430 This change add the implementations for cursor movement selectors.
2431 It also provides a mechanism to ensure that every selection
2432 change in WebKit is reflected in UIKit so that it can update the
2433 autocorrection data. This way we ensure that the autocorraction state
2434 is consistent even when selection changes are originated by JavaScript.
2435 WebPageProxy::editorStateChanged now notifies the page client when the
2436 selection is about to change as well as when it actually changed.
2438 * UIProcess/PageClient.h:
2439 * UIProcess/WebPageProxy.cpp:
2440 (WebKit::WebPageProxy::editorStateChanged):
2441 * UIProcess/WebPageProxy.h:
2442 * UIProcess/ios/PageClientImplIOS.h:
2443 * UIProcess/ios/PageClientImplIOS.mm:
2444 (WebKit::PageClientImpl::selectionWillChange):
2445 * UIProcess/ios/WKContentViewInteraction.h:
2446 * UIProcess/ios/WKContentViewInteraction.mm:
2447 (-[WKContentView cut:]): Removed incorrect calls to textWillChange and
2449 (-[WKContentView paste:]):
2450 (-[WKContentView _moveUp:withHistory:]):
2451 (-[WKContentView _moveDown:withHistory:]):
2452 (-[WKContentView _moveLeft:withHistory:]):
2453 (-[WKContentView _moveRight:withHistory:]):
2454 (-[WKContentView _moveToStartOfWord:withHistory:]):
2455 (-[WKContentView _moveToStartOfParagraph:withHistory:]):
2456 (-[WKContentView _moveToStartOfLine:withHistory:]):
2457 (-[WKContentView _moveToStartOfDocument:withHistory:]):
2458 (-[WKContentView _moveToEndOfWord:withHistory:]):
2459 (-[WKContentView _moveToEndOfParagraph:withHistory:]):
2460 (-[WKContentView _moveToEndOfLine:withHistory:]):
2461 (-[WKContentView _moveToEndOfDocument:withHistory:]):
2462 (-[WKContentView _selectionWillChange]):
2463 (-[WKContentView _selectionChanged]):
2464 * UIProcess/ios/WebPageProxyIOS.mm:
2465 (WebKit::WebPageProxy::notifySelectionWillChange):
2467 2014-07-07 Anders Carlsson <andersca@apple.com>
2469 Add SPI for saving and restoring a WKWebView's _WKSessionState
2470 https://bugs.webkit.org/show_bug.cgi?id=134693
2472 Reviewed by Dan Bernstein.
2474 * UIProcess/API/C/WKPage.cpp:
2475 (WKPageRestoreFromSessionState):
2476 * UIProcess/API/Cocoa/WKWebView.mm:
2477 (-[WKWebView _sessionState]):
2478 (-[WKWebView _restoreFromSessionStateData:]):
2479 (-[WKWebView _restoreFromSessionState:]):
2480 (-[WKWebView _restoreSessionState:andNavigate:]):
2481 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2482 * UIProcess/API/Cocoa/_WKSessionState.mm:
2483 (-[_WKSessionState _initWithSessionState:]):
2484 * UIProcess/API/Cocoa/_WKSessionStateInternal.h:
2485 * UIProcess/WebPageProxy.cpp:
2486 (WebKit::WebPageProxy::restoreFromSessionState):
2487 * UIProcess/WebPageProxy.h:
2489 2014-07-07 Anders Carlsson <andersca@apple.com>
2491 Add a stubbed out _WKSessionState class
2492 https://bugs.webkit.org/show_bug.cgi?id=134690
2494 Reviewed by Geoffrey Garen.
2496 * UIProcess/API/Cocoa/_WKSessionState.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2497 * UIProcess/API/Cocoa/_WKSessionState.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2498 (-[_WKSessionState initWithData:]):
2499 (-[_WKSessionState data]):
2500 * UIProcess/API/Cocoa/_WKSessionStateInternal.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2501 * UIProcess/Cocoa/SessionStateCoding.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2502 * UIProcess/Cocoa/SessionStateCoding.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2503 (WebKit::encodeSessionState):
2504 (WebKit::decodeSessionState):
2505 * UIProcess/LegacySessionStateCoding.h:
2506 * WebKit2.xcodeproj/project.pbxproj:
2508 2014-07-07 Anders Carlsson <andersca@apple.com>
2510 Some of the WKPreferences (API) property getters read like questions
2511 https://bugs.webkit.org/show_bug.cgi?id=134678
2512 <rdar://problem/17576847>
2514 Reviewed by Dan Bernstein.
2516 * UIProcess/API/Cocoa/WKPreferences.h:
2517 * UIProcess/API/Cocoa/WKPreferences.mm:
2518 (-[WKPreferences javaScriptIsEnabled]):
2519 (-[WKPreferences javaIsEnabled]):
2520 (-[WKPreferences plugInsAreEnabled]):
2521 (-[WKPreferences isJavaScriptEnabled]): Deleted.
2522 (-[WKPreferences isJavaEnabled]): Deleted.
2523 (-[WKPreferences arePlugInsEnabled]): Deleted.
2525 2014-07-07 Brady Eidson <beidson@apple.com>
2527 ServicesOverlayController menus show up in the wrong place.
2528 <rdar://problem/17130576> and https://bugs.webkit.org/show_bug.cgi?id=134684
2530 Reviewed by Tim Horton.
2532 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2533 (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Handle cases where
2534 the telephone number is in a subframe.
2535 (WebKit::ServicesOverlayController::handleClick): The click point is always in main frame document
2536 coordinates, so convert it to window coordinates using the main frame’s FrameView.
2538 2014-07-07 Dan Bernstein <mitz@apple.com>
2540 [Cocoa] Assertion failure in NavigationState::LoaderClient::didStartProvisionalLoadForFrame (navigationID) when navigating through the page cache
2541 https://bugs.webkit.org/show_bug.cgi?id=134682
2543 Reviewed by Tim Horton.
2545 * UIProcess/Cocoa/NavigationState.mm:
2546 (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Replaced the
2547 assertion with a FIXME.
2548 (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
2550 (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
2551 (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
2552 (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
2553 (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
2554 (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
2556 2014-07-07 KwangHyuk Kim <hyuki.kim@samsung.com>
2558 [EFL] Fix cursor artifacts on naver map site.
2559 https://bugs.webkit.org/show_bug.cgi?id=134649
2561 Reviewed by Gyuyoung Kim.
2563 Old evas cursor and ecore x cursor are reset before new cursor is applied.
2565 * UIProcess/API/efl/EwkView.cpp:
2566 (EwkView::updateCursor):
2568 2014-07-06 Benjamin Poulain <bpoulain@apple.com>
2570 [iOS][WK2] The tap highlight ID is not invalidated when a long press ends
2571 https://bugs.webkit.org/show_bug.cgi?id=134660
2573 Reviewed by Darin Adler.
2575 * UIProcess/ios/WKContentViewInteraction.mm:
2576 (-[WKContentView _cancelInteraction]):
2577 (-[WKContentView _finishInteraction]):
2578 (cancelPotentialTapIfNecessary):
2579 I messed that up in r170600. I only accounted for the web process being too fast.
2581 If the web process is too slow, _cancelInteraction or _finishInteraction happen before
2582 _didGetTapHighlightForRequest:, and we also need to nuke the tap highlight.
2584 2014-07-06 Tim Horton <timothy_horton@apple.com>
2586 [WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
2587 https://bugs.webkit.org/show_bug.cgi?id=134644
2589 Reviewed by Darin Adler.
2591 * UIProcess/DrawingAreaProxy.h:
2592 (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
2593 * UIProcess/WebPageProxy.cpp:
2594 (WebKit::WebPageProxy::preferencesDidChange):
2595 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2596 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2597 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2598 (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
2599 (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
2600 The indicator depends on the live layer tree commits coming in, including layer creation,
2601 so it can't be turned on after the root layer is created. Even a refresh is insufficient
2602 to get it working; the debug indicator really needs to exist from the first commit.
2603 So, don't even attempt to dynamically enable the indicator; create it at
2604 RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled.
2606 2014-07-06 Yoav Weiss <yoav@yoav.ws>
2608 Turn on img@sizes compile flag
2609 https://bugs.webkit.org/show_bug.cgi?id=134634
2611 Reviewed by Benjamin Poulain.
2613 * Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.
2615 2014-07-06 Brady Eidson <beidson@apple.com>
2617 Speculative fix for: NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
2618 https://bugs.webkit.org/show_bug.cgi?id=134666
2620 Reviewed by Tim Horton.
2622 * Shared/mac/SecItemRequestData.cpp:
2623 (WebKit::SecItemRequestData::encode): Encode whether or not the query dictionary exists.
2624 (WebKit::SecItemRequestData::decode): Only fail when query dictionary fails to decode if we expect one.
2626 * UIProcess/mac/SecItemShimProxy.cpp:
2627 (WebKit::SecItemShimProxy::secItemRequest): If the request is of type Invalid, log an error message asking
2628 for a bug, and respond with an "invalid parameter" error.
2630 2014-07-06 Antti Koivisto <antti@apple.com>
2632 Don't throttle layer flushes when the main resource is a GIF
2633 https://bugs.webkit.org/show_bug.cgi?id=134650
2635 Reviewed by Simon Fraser.
2637 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2638 (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
2640 2014-07-04 Rohit Kumar <kumar.rohit@samsung.com>
2642 [EFL][WK2]Fix build break in EFL WK2
2643 https://bugs.webkit.org/show_bug.cgi?id=134629
2645 Unreviewed build fix.
2647 * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
2648 (WebKit::CoordinatedDrawingArea::scheduleCompositingLayerFlushImmediately):
2649 * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
2651 2014-07-04 Dan Bernstein <mitz@apple.com>
2653 [Cocoa] -[WKWebView _reload] is unused
2654 https://bugs.webkit.org/show_bug.cgi?id=134638
2656 Reviewed by Sam Weinig.
2658 * UIProcess/API/Cocoa/WKWebView.mm:
2659 (-[WKWebView _reload]): Deleted.
2660 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2662 2014-07-04 Tim Horton <timothy_horton@apple.com>
2664 [WK2] Take TopContentInset into account when sending dictionary lookup point to PluginView
2665 https://bugs.webkit.org/show_bug.cgi?id=134624
2666 <rdar://problem/17222041>
2668 Reviewed by Sam Weinig.
2670 * WebProcess/Plugins/PDF/PDFPlugin.mm:
2671 (WebKit::PDFPlugin::performDictionaryLookupAtLocation):
2672 Perform the same coordinate conversion we use for mouse events, which happens
2673 to take the top content inset into account.
2675 2014-07-04 Philippe Normand <pnormand@igalia.com>
2677 Unreviewed, GTK WK2 build fix after r170787.
2679 * WebProcess/WebPage/DrawingAreaImpl.cpp:
2680 (WebKit::DrawingAreaImpl::scheduleCompositingLayerFlushImmediately):
2681 * WebProcess/WebPage/DrawingAreaImpl.h:
2683 2014-07-04 Zan Dobersek <zdobersek@igalia.com>
2685 Unreviewed. Reverting the bad changes introduced in r170795.
2687 * Platform/IPC/ArgumentDecoder.cpp:
2688 (IPC::ArgumentDecoder::decode): Deleted.
2689 * Platform/IPC/ArgumentDecoder.h:
2690 * Platform/IPC/ArgumentEncoder.cpp:
2691 (IPC::ArgumentEncoder::encode): Deleted.
2692 * Platform/IPC/ArgumentEncoder.h:
2694 2014-07-04 Zan Dobersek <zdobersek@igalia.com>
2696 Unreviewed. Fixing the build for ports on 64-bit Linux.
2698 Add IPC encoding and decoding overloads for the long long type, needed
2699 after r170755 started encoding and decoding long long variables in
2702 * Platform/IPC/ArgumentDecoder.cpp:
2703 (IPC::ArgumentDecoder::decode):
2704 * Platform/IPC/ArgumentDecoder.h:
2705 * Platform/IPC/ArgumentEncoder.cpp:
2706 (IPC::ArgumentEncoder::encode):
2707 * Platform/IPC/ArgumentEncoder.h:
2709 2014-07-04 Timothy Horton <timothy_horton@apple.com>
2711 [iOS][WK2] Black web view after un-suspending process
2712 https://bugs.webkit.org/show_bug.cgi?id=134623
2713 <rdar://problem/17513223>
2715 Reviewed by Simon Fraser.
2717 * UIProcess/WebPageProxy.cpp:
2718 (WebKit::WebPageProxy::viewStateDidChange):
2719 Add an argument to viewStateDidChange that allows callers (-[WKContentView _applicationWillEnterForeground:])
2720 to force us to wait for a synchronous reply from the Web process after performing a view state change.
2722 (WebKit::WebPageProxy::dispatchViewStateChange):
2723 Move the has-been-in-window-and-now-is-newly-in-window check into dispatchViewStateChange.
2724 Adjust the logic surrounding going into/out of window by factoring out the IsInWindow-did-change check, for clarity.
2726 * UIProcess/WebPageProxy.h:
2727 * UIProcess/ios/WKContentView.mm:
2728 (-[WKContentView _applicationWillEnterForeground:]):
2729 As previously mentioned, wait for a reply when foregrounding.
2731 * WebProcess/WebPage/DrawingArea.h:
2732 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2733 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2734 (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
2735 (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
2736 (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
2737 Make sure to schedule a commit immediately if the UI process is waiting for a reply.
2738 Previously we assumed that a commit would be scheduled anyway because we would have to reparent the
2739 layer tree, but that doesn't happen in the suspension-without-unparenting case. Also, we want to skip
2740 all throttling in this case.
2742 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2743 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2744 (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):
2746 2014-07-03 Gavin Barraclough <baraclough@apple.com>
2748 Should not take background task assertion for NetworkProcess
2749 https://bugs.webkit.org/show_bug.cgi?id=134622
2751 Reviewed by Tim Horton.
2753 When the WebContent wants to complete a task in the background we take a process assertion on the child process, and also need to prevent the UI process from suspending.
2754 However for the NetworkProcess we always just hold a process assertion, and don't want this to interfere with UIApp suspension.
2756 * Platform/IPC/mac/ConnectionMac.mm:
2757 (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
2758 - ProcessAssertion -> ProcessAndUIAssertion
2759 * UIProcess/ProcessAssertion.cpp:
2760 (WebKit::ProcessAssertion::ProcessAssertion):
2761 - assignment -> initializer list.
2762 (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
2763 (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
2764 (WebKit::ProcessAndUIAssertion::setState):
2765 - added no-op implementation.
2766 (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
2767 * UIProcess/ProcessAssertion.h:
2768 - removed ~ProcessAssertion, added ProcessAndUIAssertion class.
2769 * UIProcess/ProcessThrottler.cpp:
2770 (WebKit::ProcessThrottler::didConnnectToProcess):
2771 - ProcessAssertion -> ProcessAndUIAssertion
2772 * UIProcess/ProcessThrottler.h:
2773 - ProcessAssertion -> ProcessAndUIAssertion
2774 * UIProcess/ios/ProcessAssertionIOS.mm:
2775 (WebKit::ProcessAssertion::ProcessAssertion):
2776 - assignment -> initializer list.
2777 - moved code to manage WKProcessAssertionBackgroundTaskManager
2778 (WebKit::ProcessAssertion::setState):
2779 - moved code to manage WKProcessAssertionBackgroundTaskManager
2780 (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
2781 (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
2782 (WebKit::ProcessAndUIAssertion::setState):
2783 - moved code to manage WKProcessAssertionBackgroundTaskManager from ProcessAssertion.
2784 (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
2785 - delete - moved code to manage WKProcessAssertionBackgroundTaskManager
2787 2014-07-03 Simon Fraser <simon.fraser@apple.com>
2789 Clean up Brady's mess on iOS.
2791 * Platform/mac/StringUtilities.h:
2792 * Platform/mac/StringUtilities.mm:
2794 2014-07-03 Simon Fraser <simon.fraser@apple.com>
2796 [iOS WK2] Compositing layers draw outside page bounds
2797 https://bugs.webkit.org/show_bug.cgi?id=134619
2798 <rdar://problem/16953222>
2800 Reviewed by Benjamin Poulain.
2802 With the new rubber-banding behavior, we no longer have the root content layer clipping all
2803 the web layers, but this resulted in web layers which were moved outside the viewport by CSS
2804 transforms not being clipped.
2806 Fix by adding a clipping layer inside the scroll view, above _rootContentView. This layer
2807 normally has the same bounds as the content, but when rubber-banding or pinching,
2808 it takes the union of the content bounds and the rect used for fixed positioning.
2809 To make scrolling work as expected in this scenario, when it has non-zero offset, it
2810 has to compensate by setting its bounds origin.
2812 The bounds of the clipping layer are updated on scrolling/zooming, and when the
2813 layer commit tells us that the content size changed.
2815 * UIProcess/API/Cocoa/WKWebView.mm:
2816 (-[WKWebView _updateScrollViewBackground]):
2817 * UIProcess/ios/WKContentView.mm:
2818 (-[WKContentView initWithFrame:context:configuration:webView:]):
2819 (-[WKContentView updateFixedClippingView:]):
2820 (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
2821 (-[WKContentView _didCommitLayerTree:]):
2823 2014-07-03 Brady Eidson <beidson@apple.com>
2825 When showing the selection menu, include menu options for all selected phone numbers.
2826 <rdar://problem/16983434>, <rdar://problem/16874568>, and https://bugs.webkit.org/show_bug.cgi?id=134613
2828 Reviewed by Tim Horton.
2830 Move some telephone number menu logic from WebKitSystemInterface here.
2831 Also provide utility to get just the one menu item relevant to a telephone number.
2832 * Platform/mac/MenuUtilities.h:
2833 * Platform/mac/MenuUtilities.mm: Added.
2834 (WebKit::menuItemForTelephoneNumber):
2835 (WebKit::menuItemsForTelephoneNumber):
2837 * Platform/mac/StringUtilities.h:
2838 * Platform/mac/StringUtilities.mm:
2839 (WebKit::formattedPhoneNumberString): Return a localized formatted phone number.
2841 Add a member to track the selected phone numbers:
2842 * Shared/ContextMenuContextData.h:
2843 (WebKit::ContextMenuContextData::ContextMenuContextData):
2844 (WebKit::ContextMenuContextData::selectedTelephoneNumbers):
2846 * UIProcess/WebPageProxy.h:
2847 * UIProcess/WebPageProxy.messages.in:
2849 * UIProcess/mac/WebContextMenuProxyMac.mm:
2850 (WebKit::WebContextMenuProxyMac::setupServicesMenu): Also add menu items for each phone number that is
2853 Switch away from a WKSI method, and remove a lot of unneeded forward declarations and soft linking:
2854 * UIProcess/mac/WebPageProxyMac.mm:
2855 (WebKit::WebPageProxy::showTelephoneNumberMenu):
2856 (WebKit::WebPageProxy::showSelectionServiceMenu):
2858 * WebKit2.xcodeproj/project.pbxproj:
2860 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2861 (WebKit::ServicesOverlayController::drawSelectionHighlight):
2862 (WebKit::ServicesOverlayController::handleClick): Pass the phone numbers along.
2864 * WebProcess/WebPage/WebPage.h:
2865 * WebProcess/WebPage/mac/WebPageMac.mm:
2866 (WebKit::WebPage::handleSelectionServiceClick): Pass the phone numbers along.
2868 2014-07-03 Gavin Barraclough <baraclough@apple.com>
2870 WKProcessAssertionBackgroundTaskManager should clear member if task expires
2871 https://bugs.webkit.org/show_bug.cgi?id=134618
2873 Reviewed by Anders Carlson.
2875 Failure to do so results in a warning, and could result in us erroneously completing a background task too soon.
2877 * UIProcess/ios/ProcessAssertionIOS.mm:
2878 (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
2879 - remove local variable, _backgroundTask = UIBackgroundTaskInvalid;
2881 2014-07-03 Joseph Pecoraro <pecoraro@apple.com>
2883 Unreviewed iOS build fix for r170774.
2885 Remove some unnecessary WTF::moves on iOS:
2886 error: static_assert failed "T is not an lvalue reference; move() is unnecessary."
2888 * WebProcess/WebPage/EventDispatcher.cpp:
2889 (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
2890 (WebKit::EventDispatcher::touchEvent):
2892 2014-07-03 Anders Carlsson <andersca@apple.com>
2894 Try to fix the iOS build.
2896 Add WebPageProxyCocoa.mm for code shared between iOS and OS X. Put the recent searches save/restore code there.
2898 * UIProcess/Cocoa/WebPageProxyCocoa.mm: Added.
2899 (WebKit::autosaveKey):
2900 (WebKit::WebPageProxy::saveRecentSearches):
2901 (WebKit::WebPageProxy::loadRecentSearches):
2902 * UIProcess/mac/WebPageProxyMac.mm:
2903 * WebKit2.xcodeproj/project.pbxproj:
2905 2014-07-03 Dan Bernstein <mitz@apple.com>
2907 <rdar://problem/16337741> The UI process needs to track the number of HTTP subresource loads in progress (or at least whether there are any)
2908 https://bugs.webkit.org/show_bug.cgi?id=134615
2910 Reviewed by Anders Carlsson.
2912 Added a _networkRequestsInProgress boolean property to WKWebView.
2914 * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
2915 PageLoadStateObserver member functions.
2917 * UIProcess/API/Cocoa/WKWebView.mm:
2918 (-[WKWebView _networkRequestsInProgress]): New getter that gets this state from the
2920 * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property.
2922 * UIProcess/Cocoa/NavigationState.h:
2923 * UIProcess/Cocoa/NavigationState.mm:
2924 (WebKit::NavigationState::willChangeNetworkRequestsInProgress):: Override this new
2925 PageLoadState::Observer member function by sending the appropriate KVO change message to the
2927 (WebKit::NavigationState::didChangeNetworkRequestsInProgress): Ditto.
2929 * UIProcess/PageLoadState.cpp:
2930 (WebKit::PageLoadState::commitChanges): Check for changes to networkRequestsInProgress
2931 and call the observers if needed.
2932 (WebKit::PageLoadState::reset): Reset networkRequestsInProgress in the uncommitted state.
2933 (WebKit::PageLoadState::setNetworkRequestsInProgress): Set networkRequestsInProgress in the
2935 * UIProcess/PageLoadState.h:
2936 (WebKit::PageLoadState::networkRequestsInProgress): Added this getter.
2937 (WebKit::PageLoadState::Data::Data): Initialize new networkRequestsInProgress member.
2939 * UIProcess/WebPageProxy.cpp:
2940 (WebKit::WebPageProxy::setNetworkRequestsInProgress): Added. Updates the PageLoadState.
2941 * UIProcess/WebPageProxy.h:
2942 * UIProcess/WebPageProxy.messages.in: Added SetNetworkRequestsInProgress message.
2944 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2945 (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Call
2946 WebPage::addResourceRequest.
2947 (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): Call
2948 WebPage::removeResourceRequest.
2949 (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): Ditto.
2951 * WebProcess/WebPage/WebPage.cpp:
2952 (WebKit::WebPage::addResourceRequest): Added. If the new request is for an HTTP-family URL,
2953 add its identifier to the set of network resourece request identifiers. If the set was
2954 previously empty, send the WebPageProxy a message.
2955 (WebKit::WebPage::removeResourceRequest): Added. Remove the identifier from the set. If it
2956 becomes empty, send the WebPageProxy a message.
2957 * WebProcess/WebPage/WebPage.h:
2959 2014-07-03 Anders Carlsson <andersca@apple.com>
2961 Remove two unused functions
2962 https://bugs.webkit.org/show_bug.cgi?id=134614
2964 Reviewed by Andreas Kling.
2966 * UIProcess/LegacySessionStateCoding.h:
2967 * UIProcess/mac/LegacySessionStateCoding.cpp:
2968 (WebKit::encodeLegacySessionHistoryEntryData): Deleted.
2969 (WebKit::decodeLegacySessionHistoryEntryData): Deleted.
2971 2014-07-03 Daniel Bates <dabates@apple.com>
2974 https://bugs.webkit.org/show_bug.cgi?id=134500
2976 Rubber-stamped by Anders Carlsson.
2978 Substitute WTF::move() for std::move().
2980 * DatabaseProcess/DatabaseProcess.cpp:
2981 * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2982 * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
2983 * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2984 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2985 * Platform/IPC/ArgumentCoders.h:
2986 * Platform/IPC/ArgumentDecoder.cpp:
2987 * Platform/IPC/Connection.cpp:
2988 * Platform/IPC/Connection.h:
2991 2014-07-03 Benjamin Poulain <bpoulain@apple.com>
2993 [iOS][WK2] Fix small bugs of dynamicViewportSizeUpdate that were causing inaccuracies in the computed target
2994 https://bugs.webkit.org/show_bug.cgi?id=134582
2996 Reviewed by Tim Horton.
2998 This patch fixes two small bugs that were causing "jumpiness" on animated resize:
2999 1) The new scale was less accurate than the target scale, making the WebProcess force a worse scale on the content.
3000 2) The code putting back the rects in view was ignoring the obscured insets, constraining the scroll position more
3003 The first problem was cause by a series of rounding issues accumulating to the fact that "scale != targetScale"
3004 was almost never true.
3006 The first issue is that the unobscured content size was stored in integer coordinates. Because of that, it was
3007 impossible to determine accurately how much content is in the view.
3008 The outcome was that visibleHorizontalFraction was very inaccurate compared to what the UIProcess computed.
3010 Another issue affecting the scale is that scaleAfterViewportWidthChange was computing the widthToKeepInView
3011 on floating point. Since ARM64 does all those computations on doubles in the UIProcess, the value would be quite
3012 different from the received targetScale.
3014 Finally, the code uses withinEpsilon() instead of a strict equality to reduce the effect of rounding errors.
3016 For the second issue, the problem was that I was bounding the exposed rect to the page bounds. It is completely
3017 valid to have an exposed rect outside the page bounds, that area is just under the obscured insets.
3019 On the other hand, the unobscured rect needs to be within the bounds as we do not want to rotate to a rubberbanding
3020 position. The fix is simply to put the right rect into bounds, and the horizontal/vertical adjustement applies on
3023 * WebProcess/WebPage/ios/WebPageIOS.mm:
3024 (WebKit::scaleAfterViewportWidthChange):
3025 (WebKit::WebPage::dynamicViewportSizeUpdate):
3026 (WebKit::WebPage::updateVisibleContentRects):
3028 2014-07-03 Anders Carlsson <andersca@apple.com>
3032 * UIProcess/mac/WebPageProxyMac.mm:
3034 2014-07-03 Anders Carlsson <andersca@apple.com>
3036 Get rid of WebPageProxyCF.cpp
3037 https://bugs.webkit.org/show_bug.cgi?id=134609
3039 Reviewed by Dan Bernstein.
3041 * UIProcess/cf/WebPageProxyCF.cpp: Removed.
3042 * UIProcess/mac/WebPageProxyMac.mm:
3043 (WebKit::autosaveKey):
3044 (WebKit::WebPageProxy::saveRecentSearches):
3045 (WebKit::WebPageProxy::loadRecentSearches):
3046 * WebKit2.xcodeproj/project.pbxproj:
3048 2014-07-03 Tim Horton <timothy_horton@apple.com>
3050 [WK2] Revise the flat find indicator secondary highlight shadows
3051 https://bugs.webkit.org/show_bug.cgi?id=134607
3052 <rdar://problem/17554828>
3054 Reviewed by Brady Eidson.
3056 * WebProcess/WebPage/FindController.cpp:
3057 (WebKit::FindController::drawRect):
3058 Bring back the secondary highlight shadow, with new constants.
3060 2014-07-03 Tim Horton <timothy_horton@apple.com>
3062 [iOS][WK2] Sometimes the swipe snapshot stays up too long
3063 https://bugs.webkit.org/show_bug.cgi?id=134506
3064 <rdar://problem/17496803>
3066 Reviewed by Simon Fraser.
3068 Implement a transaction callback mechanism.
3069 The UI process can register a callback at any point, generally immediately after sending a message to the Web process.
3070 It will then send another message (in-order) with the callback ID to the Web process, which will put it into the next transaction
3071 (scheduling a new one if needed). When the transaction comes back to the UI process, the callbacks are performed.
3072 This ensures that the callback fires alongside a commit that includes the results of whatever messages were sent before it was registered.
3073 For now, all callbacks are fired just before committing layer changes, but it's possible future patches will want post-commit callbacks.
3075 Make use of this to remove the ViewGestureControllerIOS snapshots at the right time.
3077 * Shared/mac/RemoteLayerTreeTransaction.h:
3078 (WebKit::RemoteLayerTreeTransaction::callbackIDs):
3079 (WebKit::RemoteLayerTreeTransaction::setCallbackIDs):
3080 * Shared/mac/RemoteLayerTreeTransaction.mm:
3081 (WebKit::RemoteLayerTreeTransaction::encode):
3082 (WebKit::RemoteLayerTreeTransaction::decode):
3083 Add a vector of callback IDs to the transaction; encode and decode as appropriate.
3085 * UIProcess/DrawingAreaProxy.h:
3086 (WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing):
3087 (WebKit::DrawingAreaProxy::lastVisibleTransactionID): Deleted.
3088 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3089 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3090 (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
3091 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3092 (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3093 Add dispatchAfterEnsuringDrawing, which takes a function.
3094 When a callback is added, we send the callback ID to the Web process via the AddTransactionCallbackID message.
3095 Perform callbacks listed in the incoming transaction's vector of callback IDs.
3097 * WebProcess/WebPage/DrawingArea.h:
3098 (WebKit::DrawingArea::addTransactionCallbackID):
3099 * WebProcess/WebPage/DrawingArea.messages.in:
3100 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3101 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3102 (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3103 (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
3104 Keep track of the pending callback IDs on the drawing area, and move them into the transaction.
3105 We schedule a flush when installing a transaction callback on the premise that
3106 sometimes the action (goToBackForwardListItem in the swipe case) might have already occurred
3107 and been committed by the time the Web process receives AddTransactionCallbackID, so we need
3108 to cause another commit to send the callbacks across. If said commit is still pending, this is a no-op.
3110 * UIProcess/ios/ViewGestureControllerIOS.mm:
3111 (allViewGestureControllers):
3112 (WebKit::ViewGestureController::ViewGestureController):
3113 (WebKit::ViewGestureController::~ViewGestureController):
3114 (WebKit::ViewGestureController::endSwipeGesture):
3115 (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
3116 (WebKit::ViewGestureController::setRenderTreeSize):
3117 * UIProcess/mac/ViewGestureController.h:
3118 Keep a side-map of page IDs to ViewGestureControllers, so that we can safely get back to
3119 our ViewGestureController from the callback.
3121 When the callback fires, if it succeeded, set m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit,
3122 so that the commit (which is about to occur immediately after the callback returns) which calls
3123 setRenderTreeSize will (perhaps) remove the snapshot.
3125 If it failed, we remove the snapshot immediately, as this usually happens if the Web process crashed.
3127 2014-07-03 Brady Eidson <beidson@apple.com>
3129 Followup to "rects sent to ServicesOverlayController are wrong"
3130 https://bugs.webkit.org/show_bug.cgi?id=134568
3132 Rubberstamped by Tim Horton.
3134 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
3135 (WebKit::ServicesOverlayController::drawSelectionHighlight): Don’t check to see if the
3136 proposed rect intersects the dirty rect. We always need to include all rects that form
3137 the selection when creating the DDHighlight.
3139 2014-07-03 Tim Horton <timothy_horton@apple.com>
3141 [WK2] RemoteLayerTreeDrawingAreaProxy re-checks a preference every commit for no reason
3142 https://bugs.webkit.org/show_bug.cgi?id=134586
3144 Reviewed by Benjamin Poulain.
3146 * UIProcess/DrawingAreaProxy.h:
3147 (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator):
3148 (WebKit::DrawingAreaProxy::showDebugIndicator): Deleted.
3149 (WebKit::DrawingAreaProxy::isShowingDebugIndicator): Remove this, nobody is using it.
3150 * UIProcess/WebPageProxy.cpp:
3151 (WebKit::WebPageProxy::preferencesDidChange):
3152 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3153 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3154 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
3155 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3156 (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator):
3157 (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): Deleted.
3158 Check the debug indicator pref at construction time, and update the state when it changes.
3159 Checking it every commit was surprisingly expensive.
3161 2014-07-03 Antti Koivisto <antti@apple.com>
3163 Ensure frame creation messages get through to UI process
3164 https://bugs.webkit.org/show_bug.cgi?id=134591
3165 <rdar://problem/16918218>
3167 Reviewed by Anders Carlsson.
3169 If we are middle of handling a synchronous message from UI process a frame creation message back gets delayed.
3170 The subsequent synchronous DecidePolicyForNavigationAction message expects that the frame creation
3171 message has arrived first and fails.
3173 * WebProcess/WebPage/WebFrame.cpp:
3174 (WebKit::WebFrame::createWithCoreMainFrame):
3175 (WebKit::WebFrame::createSubframe):
3177 Send messages with DispatchMessageEvenWhenWaitingForSyncReply so they always go through in order.
3179 2014-07-03 Anders Carlsson <andersca@apple.com>
3181 Get rid of DecoderAdapter and EncoderAdapter
3182 https://bugs.webkit.org/show_bug.cgi?id=134598
3184 Reviewed by Andreas Kling.
3187 * WebKit2.xcodeproj/project.pbxproj:
3188 * WebProcess/WebPage/DecoderAdapter.cpp: Removed.
3189 * WebProcess/WebPage/DecoderAdapter.h: Removed.
3190 * WebProcess/WebPage/EncoderAdapter.cpp: Removed.
3191 * WebProcess/WebPage/EncoderAdapter.h: Removed.
3192 * WebProcess/WebPage/WebPage.cpp:
3194 2014-07-02 Anders Carlsson <andersca@apple.com>
3196 Stop using EncoderAdapter/DecoderAdapter for FormData
3197 https://bugs.webkit.org/show_bug.cgi?id=134571
3199 Reviewed by Andreas Kling.
3201 * Shared/Network/NetworkResourceLoadParameters.cpp:
3202 (WebKit::NetworkResourceLoadParameters::encode):
3203 (WebKit::NetworkResourceLoadParameters::decode):
3205 2014-07-03 Brady Eidson <beidson@apple.com>
3207 Selection rects sent to ServicesOverlayController are wrong.
3208 <rdar://problem/16727796> and https://bugs.webkit.org/show_bug.cgi?id=134568
3210 Reviewed by Darin Adler (and Tim Horton and Ryosuke Niwa).
3212 * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3213 (WebKit::WebEditorClient::selectionRectsDidChange): Also pass the GapRects to the ServicesOverlayController.
3214 * WebProcess/WebCoreSupport/WebEditorClient.h:
3216 * WebProcess/WebPage/ServicesOverlayController.h:
3217 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
3218 (WebKit::expandForGap):
3219 (WebKit::compactRectsWithGapRects): Combine 3+ rects down to exactly 3 rects, then expand them based on GapRects.
3220 (WebKit::ServicesOverlayController::selectionRectsDidChange): Call compactRectsWithGapRects, then reverse the list.
3221 (WebKit::ServicesOverlayController::drawSelectionHighlight): Tell data detectors to flip this.
3222 (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Tell data detectors to flip this.
3223 (WebKit::ServicesOverlayController::drawCurrentHighlight): No need to flip this anymore.
3225 2014-07-03 Brady Eidson <beidson@apple.com>
3227 Possible crash in IconDatabase in WebCore::IconDatabase::dispatchDidRemoveAllIconsOnMainThread
3228 <rdar://problem/17437687> and https://bugs.webkit.org/show_bug.cgi?id=134517
3230 Reviewed by Eric Carlson.
3232 * UIProcess/WebContext.cpp:
3233 (WebKit::WebContext::~WebContext): Instead of directly deref’ing the WebIconDatabase, ask it to
3234 deref itself when appropriate.
3236 * UIProcess/WebIconDatabase.cpp:
3237 (WebKit::WebIconDatabase::WebIconDatabase):
3238 (WebKit::WebIconDatabase::didClose): If this WebIconDatabase is supposed to deref itself when
3239 appropriate, do so now.
3240 (WebKit::WebIconDatabase::derefWhenAppropriate): If the WebCore::IconDatabase is still open then
3242 * UIProcess/WebIconDatabase.h:
3244 2014-07-03 Carlos Garcia Campos <cgarcia@igalia.com>
3246 REGRESSION(r170676): [GTK] UI process crashes when the Web Process crashes
3247 https://bugs.webkit.org/show_bug.cgi?id=134541
3249 Reviewed by Gyuyoung Kim.
3251 It happens when attaching a new web process, because it tries to
3252 encode a null SessionState.
3254 * UIProcess/LegacySessionStateCodingNone.cpp:
3255 (WebKit::encodeLegacySessionState): Return an empty API::Data
3256 object instead of nullptr.
3257 (WebKit::encodeLegacySessionHistoryEntryData): Ditto.
3259 2014-07-03 Carlos Garcia Campos <cgarcia@igalia.com>
3261 REGRESSION(r170743): [GTK] [EFL] Build broken.
3262 https://bugs.webkit.org/show_bug.cgi?id=134585
3264 Reviewed by Philippe Normand.
3266 Add ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC) guards where needed.
3268 * WebProcess/Plugins/PluginView.cpp:
3269 (WebKit::PluginView::initializePlugin):
3270 * WebProcess/WebPage/WebPage.cpp:
3271 (WebKit::WebPage::createPlugin):
3273 2014-07-02 Benjamin Poulain <benjamin@webkit.org>
3275 [iOS][WK2] Make is safe/fast to use the animated resize API without resizing anything
3276 https://bugs.webkit.org/show_bug.cgi?id=134570
3278 Reviewed by Enrica Casucci.
3280 Today, if someone calls _beginAnimatedResizeWithUpdates-_endAnimatedResize, it is always a very heavy process
3281 forcing a relayout and can cause synchronous operations.
3283 We should not force the caller of the API to maintain their own state tracking, we should do that for them.
3285 With this patch, we track everything we need for a resize and only do the heavy lifting if anything has actually changed.
3287 * UIProcess/API/Cocoa/WKWebView.mm:
3288 (activeMinimumLayoutSize):
3289 (activeMinimumLayoutSizeForMinimalUI):
3290 (activeMaximumUnobscuredSize):
3291 (activeOrientation):
3292 This code is used in both _didRelaunchProcess and _beginAnimatedResizeWithUpdates. It is moved to static functions
3293 to avoid having it in two places.
3295 (-[WKWebView _didRelaunchProcess]):
3297 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3298 The updates now goes like this:
3299 1) Set _isAnimatingResize to prevent the undesired side effects updateBlock() if we really need to resize.
3300 2) Get all the original values before calling the update block.
3301 3) Call the update block.
3302 4a) If nothing useful for resize has changed, reset _isAnimatingResize to false.
3303 We also need to update the visible content rect because the update block may have changed something unrelated
3304 to the view size (scale, scroll position, etc).
3305 4b) If we really need to resize, proceed as usual.
3307 (-[WKWebView _endAnimatedResize]):
3308 With the changes in _beginAnimatedResizeWithUpdates:, _isAnimatingResize is only set for real cases of animated resize,
3309 bail out early if that flag isn't set.
3311 The remaining code is unchanged, it is just not indented due to the removal of the if() branch.
3313 2014-07-02 Roger Fong <roger_fong@apple.com>
3315 Improve handling of primary offscreen plugins.
3316 https://bugs.webkit.org/show_bug.cgi?id=134528.
3317 <rdar://problem/17471864>
3319 Reviewed by Dean Jackson.
3321 * WebProcess/Plugins/PluginView.cpp:
3322 Determine whether or not the plugin starts offscreen when the plugin is initialized.
3323 (WebKit::PluginView::initializePlugin):
3324 (WebKit::PluginView::pluginSnapshotTimerFired):
3325 * WebProcess/WebPage/WebPage.cpp:
3326 (WebKit::WebPage::createPlugin):
3327 Use the PluginProcessTypeNormal for offscreen plugins that are potentially primary plugins.
3329 2014-07-02 Enrica Casucci <enrica@apple.com>
3331 REGRESSION(WK2): Undo does not work in text fields in Safari.
3332 https://bugs.webkit.org/show_bug.cgi?id=134572
3333 <rdar://problem/17542238>
3335 Reviewed by Benjamin Poulain.
3337 This patch adds for iOS the same implementation we have already for OS X.
3339 * UIProcess/ios/PageClientImplIOS.h:
3340 * UIProcess/ios/PageClientImplIOS.mm:
3341 (-[WKEditCommandObjC initWithWebEditCommandProxy:]):
3342 (-[WKEditCommandObjC command]):
3343 (-[WKEditorUndoTargetObjC undoEditing:]):
3344 (-[WKEditorUndoTargetObjC redoEditing:]):
3345 (WebKit::PageClientImpl::PageClientImpl):
3346 (WebKit::PageClientImpl::registerEditCommand):
3347 (WebKit::PageClientImpl::clearAllEditCommands):
3348 (WebKit::PageClientImpl::canUndoRedo):
3349 (WebKit::PageClientImpl::executeUndoRedo):
3351 2014-07-02 Gavin Barraclough <baraclough@apple.com>
3353 ProcessAssertion should also prevent UIApp suspension
3354 https://bugs.webkit.org/show_bug.cgi?id=134563
3356 Reviewed by Dan Bernstein.
3358 If the application suspends then the child processes will, too.
3359 Use beginBackgroundTaskWithName:expirationHandler: to request that the application remain runnable
3360 while waiting for background tasks to complete.
3362 * UIProcess/ProcessAssertion.cpp:
3363 (WebKit::ProcessAssertion::~ProcessAssertion):
3365 * UIProcess/ProcessAssertion.h:
3367 * UIProcess/ios/ProcessAssertionIOS.mm:
3368 (+[WKProcessAssertionBackgroundTaskManager shared]):
3369 - singleton WKProcessAssertionBackgroundTaskManager.
3370 (-[WKProcessAssertionBackgroundTaskManager init]):
3371 (-[WKProcessAssertionBackgroundTaskManager dealloc]):
3372 - register/remove notification handlers.
3373 (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
3374 - if we need to be runnable make sure we're holding a BackgroundTask, if not release it.
3375 (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackgroundOrWillEnterForeground:]):
3376 - detect when the app enters/leaves foreground; calls to _updateBackgroundTask.
3377 (-[WKProcessAssertionBackgroundTaskManager incrementNeedsToRunInBackgroundCount]):
3378 (-[WKProcessAssertionBackgroundTaskManager decrementNeedsToRunInBackgroundCount]):
3379 - interface to update the count; calls to _updateBackgroundTask.
3380 (WebKit::ProcessAssertion::ProcessAssertion):
3381 (WebKit::ProcessAssertion::~ProcessAssertion):
3382 - count ProcessAssertions in and out of existance.
3383 (WebKit::ProcessAssertion::setState):
3384 - count when the state changes.
3386 2014-07-01 Mark Rowe <mrowe@apple.com>
3388 <https://webkit.org/b/134522> Remove duplication in code that prepares the user agent string on Mac and iOS
3390 Reviewed by Simon Fraser.
3392 * UIProcess/ios/WebPageProxyIOS.mm:
3393 (WebKit::webKitBundleVersionString): Return the entire CFBundleVersion now that WebCore handles formatting it.
3394 (WebKit::WebPageProxy::standardUserAgent):
3395 * UIProcess/mac/WebPageProxyMac.mm:
3396 (WebKit::webKitBundleVersionString): Ditto.
3397 (WebKit::WebPageProxy::standardUserAgent):
3399 2014-06-28 Oliver Hunt <oliver@apple.com>
3401 Restrict network process sandbox
3402 https://bugs.webkit.org/show_bug.cgi?id=134360
3404 Reviewed by Sam Weinig.
3406 Add more restrictions to the network process sandbox.
3408 * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3409 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3410 Always use the cache directory provided in the initialization parameters,
3411 and make sure we consume the cookie directory extension.
3412 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3413 Make the sandbox profile much more restrictive.
3414 * Shared/Network/NetworkProcessCreationParameters.cpp:
3415 (WebKit::NetworkProcessCreationParameters::encode):
3416 (WebKit::NetworkProcessCreationParameters::decode):
3417 * Shared/Network/NetworkProcessCreationParameters.h:
3418 The network process now requires an extension to access
3420 * Shared/mac/SandboxUtilities.cpp:
3421 (WebKit::pathForProcessContainer):
3422 * Shared/mac/SandboxUtilities.h:
3423 We need to be able to get hold of our container so
3424 that we can get the correct cookie storage directory.
3425 * UIProcess/WebContext.cpp:
3426 (WebKit::WebContext::ensureNetworkProcess):
3427 We have to pass in the an extension for the cookie storage directory when
3428 initalising the network process
3429 * UIProcess/mac/WebContextMac.mm:
3430 (WebKit::WebContext::platformDefaultCookieStorageDirectory):
3431 Make sure we provide the correct location on IOS
3432 * WebProcess/cocoa/WebProcessCocoa.mm:
3433 (WebKit::WebProcess::platformInitializeWebProcess):
3434 Consume the cookie storage extension
3436 2014-07-02 Csaba Osztrogonác <ossy@webkit.org>
3438 URTBF after r170725.
3440 * CMakeLists.txt: Removed Shared/LegacySessionState.cpp.
3442 2014-07-02 Csaba Osztrogonác <ossy@webkit.org>