1 2014-07-21 Timothy Horton <timothy_horton@apple.com>
3 Random crashes on the Web Thread due to Timers firing on the wrong thread in the UI process
4 https://bugs.webkit.org/show_bug.cgi?id=135132
5 <rdar://problem/17719832>
7 Reviewed by Simon Fraser.
9 * UIProcess/ProcessThrottler.cpp:
10 (WebKit::ProcessThrottler::ProcessThrottler):
11 (WebKit::ProcessThrottler::suspendTimerFired):
12 * UIProcess/ProcessThrottler.h:
13 * UIProcess/ios/ViewGestureControllerIOS.mm:
14 (WebKit::ViewGestureController::ViewGestureController):
15 (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired):
16 * UIProcess/mac/ViewGestureController.h:
17 * UIProcess/mac/ViewGestureControllerMac.mm:
18 (WebKit::ViewGestureController::ViewGestureController):
19 (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired):
20 We can't use WebCore timers in the UI process because of coexistence concerns
21 (they fire on the Web Thread if there is one!), so use RunLoop::Timer instead.
23 2014-07-21 Andy Estes <aestes@apple.com>
25 [iOS] Handle QuickLook ResourceLoaders in the web process
26 https://bugs.webkit.org/show_bug.cgi?id=135113
28 Reviewed by David Kilzer.
30 The QuickLook framework registers a NSURLProtocol to handle loading subresources of the HTML documents it
31 generates. In order for these loads to succeed, we need to start them in the same process in which QuickLook
32 generated the main resource.
34 * WebProcess/Network/WebResourceLoadScheduler.cpp:
35 (WebKit::WebResourceLoadScheduler::scheduleLoad):
37 2014-07-21 Brady Eidson <beidson@apple.com>
39 DatabaseProcess doesn't relaunch after crashing.
40 <rdar://problem/17717343> and https://bugs.webkit.org/show_bug.cgi?id=135117
42 Reviewed by Alexey Proskuryakov.
44 * UIProcess/Databases/DatabaseProcessProxy.cpp:
45 (WebKit::DatabaseProcessProxy::didClose): Tell the WebContext.
47 * UIProcess/WebContext.cpp:
48 (WebKit::WebContext::databaseProcessCrashed): Notify supplements, then clear the DatabaseProcessProxy pointer.
49 * UIProcess/WebContext.h:
51 * UIProcess/WebContextSupplement.h:
52 (WebKit::WebContextSupplement::processDidClose): Added. No users right now, but the patch in bug 135035 will need this.
54 2014-07-20 KwangHyuk Kim <hyuki.kim@samsung.com>
56 Fix warnings caused by unused parameter.
57 https://bugs.webkit.org/show_bug.cgi?id=134975
59 Reviewed by Gyuyoung Kim.
61 Fix warnings on EwkView.cpp and LegacySessionStateCodingNone.cpp that are caused by unused parameter data.
63 * UIProcess/API/efl/EwkView.cpp:
64 (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
65 * UIProcess/LegacySessionStateCodingNone.cpp:
66 (WebKit::decodeLegacySessionState):
68 2014-07-20 Jeremy Jones <jeremyj@apple.com>
70 Disable ff/rw based on canPlayFastForward and canPlayFastRewind.
71 https://bugs.webkit.org/show_bug.cgi?id=134894
73 Reviewed by Darin Adler.
75 Add setCanPlayFastReverse
77 * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: ditto
78 * WebProcess/ios/WebVideoFullscreenManager.h: ditto
79 * WebProcess/ios/WebVideoFullscreenManager.mm: ditto
80 (WebKit::WebVideoFullscreenManager::setCanPlayFastReverse): ditto
82 2014-07-20 Jeremy Jones <jeremyj@apple.com>
84 Decrease flicker when enter and exit fullscreen.
85 https://bugs.webkit.org/show_bug.cgi?id=134919
87 Reviewed by Simon Fraser.
89 Change the sequence of tear down and use transparency to prevent flicker when entering and exiting fullscreen.
91 * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: wait to remove layerHost until didCleanupFullscreen
92 (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): removed from here
93 (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): added here
94 * WebProcess/ios/WebVideoFullscreenManager.mm:
95 (WebKit::WebVideoFullscreenManager::didSetupFullscreen): use transparent background during transition
97 2014-07-20 Dan Bernstein <mitz@apple.com>
99 <rdar://problem/17739526> REGRESSION (r171057): Crash in WebPage::getPositionInformation()
100 https://bugs.webkit.org/show_bug.cgi?id=135099
102 Reviewed by David Kilzer.
104 * WebProcess/WebPage/ios/WebPageIOS.mm:
105 (WebKit::WebPage::getPositionInformation): Added a null check.
107 2014-07-19 Zan Dobersek <zdobersek@igalia.com>
109 Consistently use uint64_t as the handle parameter type for the SetAcceleratedCompositingWindowId message
110 https://bugs.webkit.org/show_bug.cgi?id=135047
112 Reviewed by Darin Adler.
114 UIProcess' WebPageProxy is handling this parameter as an uint64_t, it should be handled as such
115 in WebProcess as well.
117 * WebProcess/WebPage/WebPage.h:
118 * WebProcess/WebPage/WebPage.messages.in: Also changed the parameter name to match other places.
119 * WebProcess/WebPage/gtk/WebPageGtk.cpp:
120 (WebKit::WebPage::setAcceleratedCompositingWindowId):
122 2014-07-18 Oliver Hunt <oliver@apple.com>
124 We don't provide an extension to the temp file used for uploads
125 https://bugs.webkit.org/show_bug.cgi?id=135079
127 Reviewed by Sam Weinig.
129 Make sure didChooseFilesForOpenPanelWithDisplayStringAndIcon vends
130 extensions for the files passed to the content process.
132 * UIProcess/WebPageProxy.cpp:
133 (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
135 2014-07-18 Tim Horton <timothy_horton@apple.com>
137 ASSERTion failures in ViewGestureController indicating that we're copying WebBackForwardList
138 https://bugs.webkit.org/show_bug.cgi?id=135080
139 <rdar://problem/17734714>
141 Reviewed by Sam Weinig.
143 * UIProcess/ios/ViewGestureControllerIOS.mm:
144 (WebKit::ViewGestureController::beginSwipeGesture):
145 (WebKit::ViewGestureController::canSwipeInDirection):
147 2014-07-18 Yongjun Zhang <yongjun_zhang@apple.com>
149 _WKActivatedElementInfo.title should fallback to innerText if the link doesn't have title attribute.
150 https://bugs.webkit.org/show_bug.cgi?id=135077
152 When populate InteractionInformationAtPosition's title value, use a link element's innerText if it
153 doesn't have title attribute.
155 Reviewed by Dan Bernstein.
157 * WebProcess/WebPage/ios/WebPageIOS.mm:
158 (WebKit::WebPage::getPositionInformation):
160 2014-07-18 Andy Estes <aestes@apple.com>
162 [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad
163 https://bugs.webkit.org/show_bug.cgi?id=135072
164 <rdar://problem/17528188>
166 Reviewed by David Kilzer.
168 * Shared/WebCoreArgumentCoders.h: Declared an ArgumentCoder for WebCore::ContentFilter.
169 * Shared/mac/WebCoreArgumentCodersMac.mm:
170 (IPC::ArgumentCoder<ContentFilter>::encode): Encoded the ContentFilter using a NSKeyedArchiver.
171 (IPC::ArgumentCoder<ContentFilter>::decode): Decoded the ContentFilter using a NSKeyedUnarchiver.
172 * UIProcess/Cocoa/WebPageProxyCocoa.mm:
173 (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::setContentFilterForBlockedLoad().
174 * UIProcess/WebFrameProxy.cpp:
175 (WebKit::WebFrameProxy::didStartProvisionalLoad): Reset m_contentFilterForBlockedLoad to nullptr.
176 (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Called ContentFilter::handleUnblockRequestAndDispatchIfSuccessful().
177 If the unblock is successful, reload the WebPageProxy.
178 * UIProcess/WebFrameProxy.h:
179 (WebKit::WebFrameProxy::setContentFilterForBlockedLoad):
180 * UIProcess/WebPageProxy.cpp:
181 (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check if this is navigation represents an unblock
182 request and ignore if so.
183 * UIProcess/WebPageProxy.h:
184 * UIProcess/WebPageProxy.messages.in: Defined ContentFilterDidBlockLoadForFrame.
185 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
186 (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): Sent ContentFilterDidBlockLoadForFrame to the WebPageProxy.
187 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
189 2014-07-18 Simon Fraser <simon.fraser@apple.com>
191 [iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place
192 https://bugs.webkit.org/show_bug.cgi?id=135078
193 <rdar://problem/17401823>
195 Reviewed by Tim Horton.
197 Fix the logging of requested scroll position and frame scale factor.
199 * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
200 (WebKit::RemoteScrollingTreeTextStream::dump):
202 2014-07-18 Joseph Pecoraro <pecoraro@apple.com>
204 [Cocoa] Use RetainPtr in _WKRemoteObjectInterface
205 https://bugs.webkit.org/show_bug.cgi?id=135062
207 Reviewed by Anders Carlsson.
209 Switch to RetainPtr instead of manual memory management of ivars.
211 * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
212 * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
213 (-[_WKRemoteObjectInterface initWithProtocol:identifier:]):
214 (-[_WKRemoteObjectInterface identifier]):
215 (-[_WKRemoteObjectInterface description]):
216 (-[_WKRemoteObjectInterface dealloc]): Deleted.
218 2014-07-18 Tim Horton <timothy_horton@apple.com>
220 Take navigation snapshots whenever the current back-forward item is going to change
221 https://bugs.webkit.org/show_bug.cgi?id=135058
222 <rdar://problem/17464515>
224 Reviewed by Dan Bernstein.
226 Instead of trying to have the UI process figure out when to take navigation snapshots by itself,
227 snapshot whenever the Web process says that the current back-forward item is going to change.
228 This fixes snapshotting timing with pushState, and lets us bottleneck snapshotting down to
229 just two places instead of 5.
231 * UIProcess/WebPageProxy.cpp:
232 (WebKit::WebPageProxy::goForward):
233 (WebKit::WebPageProxy::goBack):
234 (WebKit::WebPageProxy::goToBackForwardItem):
235 (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
236 We no longer need to special-case taking navigation snapshots
237 when the UI process changes the back forward item or upon
238 didStartProvisionalLoadForFrame, because we'll always snapshot
239 in willChangeCurrentHistoryItem in all of these cases.
241 * UIProcess/WebPageProxy.cpp:
242 (WebKit::WebPageProxy::willChangeCurrentHistoryItem):
243 * UIProcess/WebPageProxy.h:
244 * UIProcess/WebPageProxy.messages.in:
245 Add willChangeCurrentHistoryItem message, which comes from the Web process.
246 When it arrives, take a navigation snapshot.
248 * UIProcess/ios/ViewGestureControllerIOS.mm:
249 (WebKit::ViewGestureController::beginSwipeGesture):
250 Take the pre-swipe navigation snapshot before telling WebPageProxy that we're doing a swipe,
251 so that it doesn't bail from taking the snapshot because we have a snapshot up.
253 (WebKit::ViewGestureController::endSwipeGesture):
254 We no longer need to explicitly disable snapshotting while navigating, because
255 we will avoid taking the snapshot if there's a snapshot being displayed.
257 * UIProcess/mac/ViewGestureControllerMac.mm:
258 (WebKit::ViewGestureController::~ViewGestureController):
259 Remove the snapshot if it's still up when ViewGestureController is destroyed.
260 The Mac version of ViewGestureController is destroyed on Web process crashes
261 because it is a message receiver, so it is not guaranteed to have the same
262 lifetime as the WebPageProxy and friends.
264 (WebKit::ViewGestureController::trackSwipeGesture):
265 Make use of recordNavigationSnapshot.
267 (WebKit::ViewGestureController::endSwipeGesture):
268 Ditto from the Mac version.
270 * UIProcess/mac/ViewSnapshotStore.h:
271 (WebKit::ViewSnapshotStore::disableSnapshotting): Deleted.
272 (WebKit::ViewSnapshotStore::enableSnapshotting): Deleted.
273 * UIProcess/mac/ViewSnapshotStore.mm:
274 (WebKit::ViewSnapshotStore::ViewSnapshotStore):
275 (WebKit::ViewSnapshotStore::recordSnapshot):
276 Remove the snapshot disabling mechanism and bail from snapshotting if we're
277 showing a snapshot, as mentioned above.
279 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
280 (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem):
281 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
282 * WebProcess/WebPage/WebPage.cpp:
283 (WebKit::WebPage::willChangeCurrentHistoryItem):
284 * WebProcess/WebPage/WebPage.h:
285 Proxy willChangeCurrentHistoryItem from HistoryController to the UI process.
287 2014-07-18 Jon Honeycutt <jhoneycutt@apple.com>
289 REGRESSION: Crash when typing into text field that clears itself on iOS
291 <https://bugs.webkit.org/show_bug.cgi?id=135044>
292 <rdar://problem/17640443>
294 Reviewed by Darin Adler.
296 * WebProcess/WebPage/ios/WebPageIOS.mm:
297 (WebKit::WebPage::requestAutocorrectionData):
298 wordRangeFromPosition() returns null in some cases; null check range
299 before dereferencing it. Moved some variable declarations around to
300 better match our style.
302 2014-07-18 Tim Horton <timothy_horton@apple.com>
304 [WK2] Provide a mechanism to grab the back-forward list for gesture navigation purposes from another WKWebView
305 https://bugs.webkit.org/show_bug.cgi?id=134999
306 <rdar://problem/17238025>
308 Reviewed by Sam Weinig.
310 In some cases, clients may need to throw a WKWebView with no back-forward list over
311 another WKWebView, and want to participate in gesture swipe as if they were actually
312 the page being overlaid.
314 * UIProcess/API/Cocoa/WKWebView.mm:
315 (-[WKWebView setAllowsBackForwardNavigationGestures:]):
316 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
317 (-[WKWebViewConfiguration copyWithZone:]):
318 (-[WKWebViewConfiguration _alternateWebViewForNavigationGestures]):
319 (-[WKWebViewConfiguration _setAlternateWebViewForNavigationGestures:]):
320 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
321 Keep an "alternate" WKWebView "for navigation gestures", which ViewGestureController
322 will use as the real source of back-forward items, and the destination of the swipe navigation.
323 All swipe delegate callbacks will also fire from the alternate view, because it owns the items
324 and will be doing the navigation.
326 * UIProcess/ios/ViewGestureControllerIOS.mm:
327 (WebKit::ViewGestureController::setAlternateBackForwardListSourceView):
328 (WebKit::ViewGestureController::beginSwipeGesture):
329 Send navigationGestureDidBegin via the alternate view's WebPageProxy if it exists.
330 Record a new snapshot on the current page, but copy it to the alternate view if necessary,
331 so that when swiping forward from the alternate view, it will have the "right" snapshot.
332 Get the target back forward item from the alternate view.
333 Send navigationGestureWillEnd via the alternate view's WebPageProxy if it exists.
335 (WebKit::ViewGestureController::canSwipeInDirection):
336 Determine if we can swipe in a direction by looking at the alternate view's back-forward list if necessary.
338 (WebKit::ViewGestureController::endSwipeGesture):
339 Send navigationGestureDidEnd via the alternate view's WebPageProxy if it exists.
340 Perform the navigation on the alternate view if necessary.
342 (WebKit::ViewGestureController::removeSwipeSnapshot):
343 Send navigationGestureSnapshotWasRemoved via the alternate view's WebPageProxy if it exists.
345 * UIProcess/mac/ViewGestureController.h:
347 2014-07-17 David Kilzer <ddkilzer@apple.com>
349 SECTORDER_FLAGS should be defined in target's xcconfig file, not Base.xcconfig
350 <http://webkit.org/b/135006>
352 Reviewed by Darin Adler.
354 * Configurations/Base.xcconfig: Move SECTORDER_FLAGS to
356 * Configurations/DebugRelease.xcconfig: Remove empty
357 SECTORDER_FLAGS definition.
358 * Configurations/WebKit.xcconfig: Use $(CONFIGURATION) so
359 SECTORDER_FLAGS is only set on Production builds.
361 2014-07-17 Alexey Proskuryakov <ap@apple.com>
363 REGRESSION (r171167): LoaderClient processDidCrash call is made after load state changes
364 https://bugs.webkit.org/show_bug.cgi?id=135032
365 <rdar://problem/17716602>
367 Reviewed by Dan Bernstein.
369 * UIProcess/WebPageProxy.cpp:
370 (WebKit::WebPageProxy::processDidCrash): Create a transaction, so that the nested
371 transaction in resetStateAfterProcessExited() wouldn't be committed.
372 (WebKit::WebPageProxy::resetStateAfterProcessExited): Don't use auto - it was hiding
373 the most important fact that this is a stack object that can't be simply moved to
374 a different function.
376 2014-07-17 Benjamin Poulain <bpoulain@apple.com>
378 [iOS][WK2] Fix the updateVisibleContentRects synchronization for load after r171154
379 https://bugs.webkit.org/show_bug.cgi?id=135036
381 Reviewed by Dan Bernstein.
383 * WebProcess/WebPage/ios/WebPageIOS.mm:
384 (WebKit::WebPage::updateVisibleContentRects):
385 I forgot to update one of the condition after changing from lastTransaction to next transaction
388 2014-07-17 Enrica Casucci <enrica@apple.com>
390 [REGRESSION WK2]The menu bar does not show up when tapping on the caret.
391 https://bugs.webkit.org/show_bug.cgi?id=135023
392 <rdar://problem/17617282>
394 Reviewed by Benjamin Poulain and Ryosuke Niwa.
396 WKContentView needs to implement hasContent to correctly show
397 the appropriate menu bar content. The patch adds this information
400 * Shared/EditorState.cpp:
401 (WebKit::EditorState::encode):
402 (WebKit::EditorState::decode):
403 * Shared/EditorState.h:
404 (WebKit::EditorState::EditorState):
405 * UIProcess/ios/WKContentViewInteraction.mm:
406 (-[WKContentView hasContent]):
407 * WebProcess/WebPage/WebPage.cpp:
408 (WebKit::WebPage::editorState):
410 2014-07-17 Benjamin Poulain <benjamin@webkit.org>
412 [iOS][WK2] Add SPI to do a dynamic viewport update without showing any content
413 https://bugs.webkit.org/show_bug.cgi?id=135010
415 Reviewed by Darin Adler.
417 This patch add a new SPI, [WKWebView _resizeWhileHidingContentWithUpdates:] to perform all the work
418 of a dynamic viewport size update, but instead of animating the old content, it is hidden.
420 The patch is built on top of the animated resize mechanism. Instead of having an animation driving
421 the beginning and end, we let the content do that. The dynamic resize begins, it runs for as long as
422 the WebProcess needs, and it ends when first layer tree commit with the new content is processed.
424 The attribute "_isAnimatingResize" is generalized to support two modes of resizing: animated and
427 The attribute "_hasCommittedLoadForMainFrame" is rather silly. It is only needed because
428 [WKWebView _resizeWhileHidingContentWithUpdates:] is intended to be called a lot before the page
429 is initialized, and doing an animated resize would trash the WebProcess state.
430 I wish I had a better solution, this is not great.
432 * UIProcess/API/Cocoa/WKWebView.mm:
433 (-[WKWebView _processDidExit]):
434 (-[WKWebView _didCommitLoadForMainFrame]):
435 (-[WKWebView _didCommitLayerTree:]):
436 This is the key to make this work properly. We want _resizeWhileHidingContentWithUpdates: to behave
437 exactly like an animated resize to avoid bugs. So we went to the whole update mechanism using
438 _resizeAnimationTransformAdjustments to accumulate the adjustments, now we need to restore a correct
441 Calling [WKWebView _endAnimatedResize] will do exactly that, but we need to make sure we do not hit
442 the synchronization path or we would be blocked there for a while, which is what we are trying to avoid.
444 After r171154, WebPageProxy keeps track of what stage of dynamic viewport update we are in. Since we are
445 executing the layer tree update stage, with the right transaction ID, WebPageProxy already knows we have
446 everything we need and does not use any synchronous messages.
448 (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
449 (-[WKWebView _restorePageStateToExposedRect:scale:]):
450 (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
451 (-[WKWebView _scrollToContentOffset:]):
452 (-[WKWebView _frameOrBoundsChanged]):
453 (-[WKWebView _updateVisibleContentRects]):
454 (-[WKWebView _setMinimumLayoutSizeOverride:]):
455 (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
456 (-[WKWebView _setInterfaceOrientationOverride:]):
457 (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
458 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
459 (-[WKWebView _endAnimatedResize]):
460 (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
461 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
463 2014-07-17 Brent Fulgham <bfulgham@apple.com>
465 [Mac] Full screen video not always animating in the correct Space
466 https://bugs.webkit.org/show_bug.cgi?id=135020
467 <rdar://problem/17542310>
469 Reviewed by Dean Jackson.
471 The fullscreen window can "remember" the Space it was part of the first time you enter fullscreen
472 mode. Subsequent fullscreen transitions will always start from this Space, even if you move
473 the WebKit-hosted application to a different Space.
475 We can help the display system know when we've moved to a new Space by calling NSWindow's
476 'orderBack' method on the fullscreen window prior to starting the transition to fullscreen mode.
477 This method call hooks the window into the current Space so everything works properly.
479 * UIProcess/mac/WKFullScreenWindowController.mm:
480 (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): Add the
481 new fullscreen window to the current Space before starting transition to fullscreen.
483 2014-07-17 Timothy Hatcher <timothy@apple.com>
485 Make console.profile record to the Timeline.
487 https://bugs.webkit.org/show_bug.cgi?id=134643
489 Reviewed by Joseph Pecoraro.
491 * WebProcess/WebPage/WebInspector.cpp:
492 (WebKit::WebInspector::setJavaScriptProfilingEnabled):
493 (WebKit::WebInspector::startJavaScriptProfiling):
494 (WebKit::WebInspector::stopJavaScriptProfiling):
496 2014-07-17 Brady Eidson <beidson@apple.com>
498 Crash in ServicesOverlayController::~ServicesOverlayController.
499 <rdar://problem/17622172> and https://bugs.webkit.org/show_bug.cgi?id=135022
501 Reviewed by Tim Horton.
503 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
504 (WebKit::ServicesOverlayController::~ServicesOverlayController): Don’t need to uninstall the
505 PageOverlay as it has already been destroyed by this point in WebPage::~WebPage.
507 2014-07-17 Tim Horton <timothy_horton@apple.com>
509 Sometimes purgeable (or empty!) tiles are shown on screen when resuming the app
510 https://bugs.webkit.org/show_bug.cgi?id=135018
511 <rdar://problem/17615038>
513 Reviewed by Simon Fraser.
515 * UIProcess/DrawingAreaProxy.h:
516 (WebKit::DrawingAreaProxy::hideContentUntilNextUpdate):
517 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
518 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
519 (WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilNextUpdate):
520 * UIProcess/mac/RemoteLayerTreeHost.h:
521 * UIProcess/mac/RemoteLayerTreeHost.mm:
522 (WebKit::RemoteLayerTreeHost::detachRootLayer):
523 Add a mechanism to "hide" drawing area content until the next commit,
524 by detaching the root layer. RemoteLayerTreeHost will automatically reattach
525 it at the next commit.
527 * UIProcess/WebPageProxy.cpp:
528 (WebKit::WebPageProxy::viewStateDidChange):
529 * UIProcess/WebPageProxy.h:
530 Add a parameter to viewStateDidChange specifying whether dispatching the change
531 to the Web process is deferrable or not. We will also automatically use "Immediate" if
532 the view is coming in-window, like we did before.
534 * UIProcess/ios/WKContentView.mm:
535 (-[WKContentView _applicationWillEnterForeground:]):
536 Make use of the aforementioned new mechanisms to ensure that we immediately dispatch
537 view state changes when coming into the foreground, and will have removed the root layer
538 if a commit didn't come in while waitForDidUpdateViewState blocks.
540 2014-07-17 Sanghyup Lee <sh53.lee@samsung.com>
542 [EFL][WK2] Add a "focus,notfound" signal.
543 https://bugs.webkit.org/show_bug.cgi?id=134674
545 Reviewed by Gyuyoung Kim.
547 Add a "focus,notfound" signal to handover focus control to application
548 because there are no elements of webview to focus on the given direction.
550 Application can decide to move the focus to next widget of ewk_view or something else
551 by using this signal.
553 * UIProcess/API/efl/EwkViewCallbacks.h:
554 * UIProcess/API/efl/ewk_view.h:
555 * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp: Added keyDown and keyUp function.
556 (EWK2UnitTest::EWK2UnitTestBase::waitUntilDirectionChanged):
557 (EWK2UnitTest::EWK2UnitTestBase::keyDown):
558 (EWK2UnitTest::EWK2UnitTestBase::keyUp):
559 * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
560 * UIProcess/API/efl/tests/test_ewk2_view.cpp:
561 (EWK2ViewTest::FocusNotFoundCallback):
563 * UIProcess/efl/PageUIClientEfl.cpp: Removed unnecessary calls to evas_object_focus_set().
564 (WebKit::PageUIClientEfl::takeFocus):
566 2014-07-16 Brady Eidson <beidson@apple.com>
568 Reintroduce the SPI _websiteDataURLForContainerWithURL: that was removed in r171160
569 https://bugs.webkit.org/show_bug.cgi?id=134984
571 Reviewed by David Kilzer.
573 * UIProcess/API/Cocoa/WKProcessPool.mm:
574 (+[WKProcessPool _websiteDataURLForContainerWithURL:]):
575 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
577 2014-07-16 Alexey Proskuryakov <ap@apple.com>
579 A test that hangs at cleanup stage confuses webkitpy hugely
580 https://bugs.webkit.org/show_bug.cgi?id=122475
581 <rdar://problem/17184354>
583 Reviewed by Anders Carlsson.
585 Reset m_pageLoadState when the process exits cleanly - otherwise messages from a
586 new process for the same WebPageProxy would hit assertions.
588 * UIProcess/WebPageProxy.cpp:
589 (WebKit::WebPageProxy::processDidCrash):
590 (WebKit::WebPageProxy::resetStateAfterProcessExited):
592 2014-07-16 David Kilzer <ddkilzer@apple.com>
594 [iOS] Update order file paths for WebKit and WebKit2
595 <http://webkit.org/b/134993>
596 <rdar://problem/17557776>
598 Reviewed by Darin Adler.
600 * Configurations/Base.xcconfig: Add order file for iOS
603 2014-07-16 Brady Eidson <beidson@apple.com>
605 Add WebSecurityOrigin "webSecurityOriginFromDatabaseIdentifier" SPI and change _websiteDataURLForContainerWithURL: SPI
606 <rdar://problem/17454712> and https://bugs.webkit.org/show_bug.cgi?id=134984
608 Reviewed by Dan Bernstein.
610 Change _websiteDataURLForContainerWithURL: SPI to include an optional bundle identifier argument:
611 * UIProcess/API/Cocoa/WKProcessPool.mm:
612 (+[WKProcessPool _websiteDataURLForContainerWithURL:bundleIdentifierIfNotInContainer:]):
613 (+[WKProcessPool _websiteDataURLForContainerWithURL:]): Deleted.
614 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
616 Add a big shiny comment in a few key places:
617 * DatabaseProcess/DatabaseProcess.cpp:
618 (WebKit::DatabaseProcess::initializeDatabaseProcess):
619 * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
620 (WebKit::UniqueIDBDatabase::UniqueIDBDatabase):
621 * UIProcess/WebContext.cpp:
622 (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
623 (WebKit::WebContext::ensureDatabaseProcess):
625 2014-07-16 Enrica Casucci <enrica@apple.com>
627 REGRESSION (iOS WebKit2): Cannot scroll while dragging a selection.
628 https://bugs.webkit.org/show_bug.cgi?id=134992
629 <rdar://problem/17528020>
631 Reviewed by Benjamin Poulain.
633 This patch exposes the scroller and the visible content rect so that
634 UIKit can implement autoscroll when dragging the selections.
635 It also changes that way we do hit testing to allow hit test outside
636 the clipping region and fixes the way we compute the selection rectangle
637 for the block selection, ensuring that we consider also non text elements
640 * UIProcess/ios/WKContentViewInteraction.mm:
641 (-[WKContentView scroller]):
642 (-[WKContentView visibleRect]):
643 * WebProcess/WebPage/ios/WebPageIOS.mm:
644 (WebKit::selectionBoxForRange):
645 (WebKit::WebPage::rangeForWebSelectionAtPosition):
646 (WebKit::WebPage::rangeForBlockAtPoint):
647 (WebKit::WebPage::expandedRangeFromHandle):
648 (WebKit::WebPage::contractedRangeFromHandle):
649 (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
650 (WebKit::WebPage::changeBlockSelection):
652 2014-07-16 Alexey Proskuryakov <ap@apple.com>
654 <rdar://problem/17669097> REGRESSION (r170155): Sandbox violations using a wrong
655 CFNetwork cache path in WebContent process
657 Rubber-stamped by Sam Weinig.
659 Before r170155, we incorrectly checked usesNetworkProcess(), which always returns
660 false at this point in initialization sequence. But we did the right thing, as we
661 always need to set the cache path, even when network process is used for most loading.
663 * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess):
665 2014-07-16 Timothy Horton <timothy_horton@apple.com>
667 Dispatch top content inset changes immediately if synchronously waiting for view state changes
668 ​https://bugs.webkit.org/show_bug.cgi?id=134942
669 <rdar://problem/17666800>
671 Reviewed by Simon Fraser.
673 * UIProcess/API/mac/WKView.mm:
674 (-[WKView _dispatchSetTopContentInset]):
675 (-[WKView _setTopContentInset:]):
676 Move the check from _setTopContentInset: to _dispatchSetTopContentInset
677 that ensures that we only send the message if the top content inset changed.
679 2014-07-16 Benjamin Poulain <bpoulain@apple.com>
681 [iOS][WK2] Synchronize the dynamic viewport updates with their layer tree commit
682 https://bugs.webkit.org/show_bug.cgi?id=134965
683 Related to <rdar://problem/17082607>
685 Reviewed by Tim Horton.
687 Dynamic viewport update relies on the _resizeAnimationTransformAdjustments being applied
688 to the page at the new size during the transition.
690 Because of the races between the LayerTree Commit and DynamicViewportSizeUpdate, the transform
691 can be applied to the wrong set of tiles.
692 This is mostly a problem for unresponsive WebProcess or when the synchronization is done
695 There is at least one more case that is not handled: if synchronizeDynamicViewportUpdate()
696 completely fails to get the new page, the UIProcess is in a somewhat messy state.
697 I will look into that separately than the layer tree synchronization.
699 * UIProcess/API/Cocoa/WKWebView.mm:
700 (-[WKWebView _didCommitLayerTree:]):
701 (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
702 (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]): Deleted.
703 * UIProcess/API/Cocoa/WKWebViewInternal.h:
704 * UIProcess/PageClient.h:
705 * UIProcess/WebPageProxy.cpp:
706 (WebKit::WebPageProxy::WebPageProxy):
707 (WebKit::WebPageProxy::resetState):
708 * UIProcess/WebPageProxy.h:
709 * UIProcess/ios/PageClientImplIOS.h:
710 * UIProcess/ios/PageClientImplIOS.mm:
711 (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget):
712 * UIProcess/ios/WebPageProxyIOS.mm:
713 (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
714 (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
715 (WebKit::WebPageProxy::didCommitLayerTree):
716 (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
717 * WebProcess/WebPage/WebPage.cpp:
718 (WebKit::WebPage::WebPage):
719 (WebKit::WebPage::didCommitLoad):
720 * WebProcess/WebPage/WebPage.h:
721 * WebProcess/WebPage/WebPage.messages.in:
722 * WebProcess/WebPage/ios/WebPageIOS.mm:
723 (WebKit::WebPage::synchronizeDynamicViewportUpdate):
724 (WebKit::WebPage::updateVisibleContentRects):
725 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
726 (WebKit::RemoteLayerTreeDrawingArea::nextTransactionID):
727 (WebKit::RemoteLayerTreeDrawingArea::currentTransactionID): Deleted.
729 2014-07-16 Dan Bernstein <mitz@apple.com>
731 REGRESSION (r170653): Web Content service’s Info.plist has wrong format
732 https://bugs.webkit.org/show_bug.cgi?id=134973
734 Reviewed by Alexey Proskuryakov.
736 * WebKit2.xcodeproj/project.pbxproj: Updated the Add CFBundle Localization Info.plist Key
737 script build phases to convert Info.plist back to binary format if the
738 PLIST_FILE_OUTPUT_FORMAT build setting requires it.
740 2014-07-15 Benjamin Poulain <bpoulain@apple.com>
744 * UIProcess/API/Cocoa/WKWebView.mm:
745 (-[WKWebView _scrollToContentOffset:]):
746 On landing, I changed the min/max branches to shrunkTo/expandedTo, but the return value
747 of those was ignored.
749 2014-07-15 Dan Bernstein <mitz@apple.com>
751 WKWebView’s FormClient::willSubmitForm should use CompletionHandlerCallChecker
752 https://bugs.webkit.org/show_bug.cgi?id=134951
754 Reviewed by Tim Horton.
756 * UIProcess/API/Cocoa/WKWebView.mm:
757 (-[WKWebView _setFormDelegate:]):
759 2014-07-15 Benjamin Poulain <benjamin@webkit.org>
761 [iOS][WK2] Scrolling request from the scrolling tree must be limited to offsets in the document
762 https://bugs.webkit.org/show_bug.cgi?id=134952
763 <rdar://problem/17647116>
765 Reviewed by Enrica Casucci.
767 When we received a scroll request, we were taking that offset directly to set the UIScrollView
768 scroll position. This is a problem if a page request scrolling to an invalid position, we were
771 This patch limits the position to be inside the document.
773 -- Why not limit the scroll offset in the WebProcess when we receive the scroll request? --
775 Some pages rely on the page scale factor changing instantly, because that is how it worked
778 On WebKit2, the WebProcess cannot know the valid range because the obscured insets are changing
779 dynamically, and the page scale factor can change in response to WebProcess events (the focus
780 changing for example). To make the page works, the WebProcess does not restrict the scroll position.
782 In that architecture, the UIProcess has to sanitize the input, which was not done before this patch.
784 -- Why not use changeContentOffsetBoundedInValidRange()?
786 The scroll offset as seen by the page is relative to the unobscured rect. While the position used
787 for history item is a visual position. All we need in this case is a position in the view.
789 * UIProcess/API/Cocoa/WKWebView.mm:
790 (-[WKWebView _scrollToContentOffset:]):
791 * UIProcess/WebPageProxy.h:
792 * UIProcess/ios/WebPageProxyIOS.mm:
793 (WebKit::WebPageProxy::resendLastVisibleContentRects):
795 2014-07-15 Timothy Horton <timothy_horton@apple.com>
797 Dispatch top content inset changes immediately if synchronously waiting for view state changes
798 https://bugs.webkit.org/show_bug.cgi?id=134942
799 <rdar://problem/17666800>
801 Reviewed by Simon Fraser.
803 * UIProcess/API/mac/WKView.mm:
804 (-[WKView endDeferringViewInWindowChanges]):
805 (-[WKView endDeferringViewInWindowChangesSync]):
806 (-[WKView _dispatchSetTopContentInset]):
807 (-[WKView _setTopContentInset:]):
808 Send top content inset changes immediately before sync-waiting for new tiles from the Web Process.
809 This will ensure that the incoming contents have the right top content inset, and we don't
810 flash between the wrong inset and the right one.
812 2014-07-15 Enrica Casucci <enrica@apple.com>
814 REGRESSION(WK2 iOS): Safari hangs when switching focus from a field using the Tab key.
815 https://bugs.webkit.org/show_bug.cgi?id=134934
816 <rdar://problem/17224638>
818 Reviewed by Tim Horton.
820 * UIProcess/ios/WKContentViewInteraction.mm:
822 Tab and back tab should be handled as special keys that have
823 a command associated. The command specifies for each key the relevant
824 action. This patch implements the commands property to create the association
825 between key and command and the relevant actions that will execute the same
826 code executed when the used taps on the < > buttons in the accessory bar.
828 (-[WKContentView keyCommands]):
829 (-[WKContentView _nextAccessoryTab:]):
830 (-[WKContentView _prevAccessoryTab:]):
832 2014-07-15 Oliver Hunt <oliver@apple.com>
834 More tidying of the webcontent sandbox profile
835 https://bugs.webkit.org/show_bug.cgi?id=134938
837 Reviewed by Alexey Proskuryakov.
839 Remove some excessive abilities from the profile and make
840 the required ones explicit.
842 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
844 2014-07-14 Andreas Kling <akling@apple.com>
846 [iOS] Don't progressively re-render tiles while pinch-zooming under memory pressure.
847 <https://webkit.org/b/134915>
849 When we're under memory pressure, the last thing we want to be doing is
850 creating gratuitous new IOSurfaces. Just wait for the gesture to end before
851 rendering at the new scale.
853 Reviewed by Tim Horton.
855 * WebProcess/WebPage/ios/WebPageIOS.mm:
856 (WebKit::WebPage::updateVisibleContentRects):
858 2014-07-14 Joseph Pecoraro <pecoraro@apple.com>
860 [Cocoa] _WKRemoteObjectInterface leaks NSString ivar
861 https://bugs.webkit.org/show_bug.cgi?id=134914
863 Reviewed by Simon Fraser.
865 Release our copied NSString in dealloc.
867 * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
868 (-[_WKRemoteObjectInterface dealloc]):
870 2014-07-14 Dean Jackson <dino@apple.com>
872 [PlugIns] Check for a non-null snapshot image before trying to decode it
873 https://bugs.webkit.org/show_bug.cgi?id=134913
874 <rdar://problem/17606033>
876 Reviewed by Tim Horton.
878 Changeset r169820 introduced a bug where we could examine the pixels of
879 an image (looking for solid colors) before checking if the image actually
882 I added a null check, and moved the code around a bit to avoid checking
883 for existence three times.
885 * WebProcess/Plugins/PluginView.cpp:
886 (WebKit::PluginView::pluginSnapshotTimerFired): Check that snapshotImage exists
887 before trying to look at it.
889 2014-07-14 Anders Carlsson <andersca@apple.com>
893 * UIProcess/Cocoa/SessionStateCoding.mm:
894 (WebKit::encodeSessionState):
896 2014-07-14 Anders Carlsson <andersca@apple.com>
898 Use the legacy session coder for encoding/decoding session state
899 https://bugs.webkit.org/show_bug.cgi?id=134910
901 Reviewed by Beth Dakin.
903 * UIProcess/Cocoa/SessionStateCoding.mm:
904 (WebKit::encodeSessionState):
905 (WebKit::decodeSessionState):
907 2014-07-14 Oliver Hunt <oliver@apple.com>
909 Restrict network process to remote connections
910 https://bugs.webkit.org/show_bug.cgi?id=134908
912 Reviewed by Geoffrey Garen.
914 Further restrict network client
916 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
918 2014-07-14 Tim Horton <timothy_horton@apple.com>
920 ASSERT(isMainThread()) under OneShotDisplayLinkHandler
921 https://bugs.webkit.org/show_bug.cgi?id=134900
923 Reviewed by Simon Fraser.
925 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
926 (-[OneShotDisplayLinkHandler displayLinkFired:]):
927 isMainThread means the Web thread sometimes.
929 2014-07-14 Tim Horton <timothy_horton@apple.com>
933 * UIProcess/API/Cocoa/WKWebView.mm:
934 (-[WKWebView _frameOrBoundsChanged]):
935 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
936 * UIProcess/API/ios/WKViewIOS.mm:
937 (-[WKView _frameOrBoundsChanged]):
939 2014-07-14 Carlos Alberto Lopez Perez <clopez@igalia.com>
941 [UNIX] Log error description when failing to create shared memory file.
942 https://bugs.webkit.org/show_bug.cgi?id=134892
944 Reviewed by Darin Adler.
946 * Platform/unix/SharedMemoryUnix.cpp:
947 (WebKit::SharedMemory::create): Print the string describing the error number (errno).
949 2014-07-14 Benjamin Poulain <benjamin@webkit.org>
951 [iOS][WK2] On rotation, RemoteLayerTreeDrawingArea renders one extra frame at the wrong orientation
952 https://bugs.webkit.org/show_bug.cgi?id=134875
954 Reviewed by Tim Horton.
956 On animated resize, the size of the DrawingAreaProxy was changed before the layout parameters were
957 changed. This in turn caused the WebProcess's DrawingArea to flush the layer tree while still
958 at the wrong orientation.
960 This patch fixes the issue by making a special case for animated resize:
961 -While starting animated resize, _frameOrBoundsChanged can be called several times in response to
962 the API's client changing the WKWebView. In that case, we do not update the drawing area.
963 -After the "updateBlock" is executed and the size have been changed, the dynamic viewport update
964 is computed, the dynamicViewportSizeUpdate is sent to the WebProcess, followed by the message
965 DrawingArea::updateGeometry(). Since both messages are asynchronous, they are received in that
966 order, and the updateGeometry() is always done after the viewport configuration has been updated.
968 * UIProcess/API/Cocoa/WKWebView.mm:
969 (-[WKWebView _frameOrBoundsChanged]):
970 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
971 * UIProcess/ios/WKContentView.h:
972 * UIProcess/ios/WKContentView.mm:
973 (-[WKContentView setMinimumSize:]): Deleted.
975 2014-07-14 Benjamin Poulain <bpoulain@apple.com>
977 [iOS][WK2] Fix withinEpsilon()
978 https://bugs.webkit.org/show_bug.cgi?id=134798
980 Reviewed by Darin Adler.
982 Move the function back to WKWebView, it is no longer needed in WKContentView.
984 Use the real types as input to properly verify that the two inputs are within
985 a small value of the 32bit floating point.
987 The epsilon we use is always on 32 bits float because we want to avoid doing work for changes
988 that would not make any difference on float.
990 The source of those small changes comes from the fact UIProcess does a lot of processing
991 on CGFloat, which are double on 64bits architecture, while the WebProcess use 32bits floating point
992 for scale. When we are getting updates from the WebProcess, we should ignore any small differences
993 caused by the computations done with less precision.
995 * UIProcess/API/Cocoa/WKWebView.mm:
997 * UIProcess/ios/WKContentViewInteraction.h:
998 (withinEpsilon): Deleted.
1000 2014-07-14 Bear Travis <betravis@adobe.com>
1002 [Feature Queries] Enable Feature Queries on Mac
1003 https://bugs.webkit.org/show_bug.cgi?id=134404
1005 Reviewed by Antti Koivisto.
1007 Enable Feature Queries on Mac and resume running the
1010 * Configurations/FeatureDefines.xcconfig: Turn on
1011 ENABLE_CSS3_CONDITIONAL_RULES.
1013 2014-07-14 Anders Carlsson <andersca@apple.com>
1015 Make shouldKeepCurrentBackForwardListItemInList part of WKPageLoaderClientV5 to avoid breaking ABI
1016 https://bugs.webkit.org/show_bug.cgi?id=134889
1018 Reviewed by Beth Dakin.
1020 * UIProcess/API/C/WKPage.cpp:
1021 * UIProcess/API/C/WKPageLoaderClient.h:
1023 2014-07-14 Dan Bernstein <mitz@apple.com>
1025 REGRESSION (r171045): Reproducible crash on navigation in PageClientImpl::willRecordNavigationSnapshot
1026 https://bugs.webkit.org/show_bug.cgi?id=134887
1028 Reviewed by Tim Horton.
1030 * UIProcess/mac/PageClientImpl.mm:
1031 (WebKit::PageClientImpl::navigationGestureDidBegin): nil-check m_webView. It can be nil when
1032 the client is using WKView directly.
1033 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1034 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1035 (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
1037 2014-07-14 Eric Carlson <eric.carlson@apple.com>
1039 [Mac] don't enable low power audio mode on external output devices
1040 https://bugs.webkit.org/show_bug.cgi?id=134877
1042 Reviewed by Sam Weinig.
1044 * PluginProcess/PluginProcess.h: Add an empty implementation of
1045 AudioHardwareListener::audioOutputDeviceChanged.
1047 2014-07-14 Tim Horton <timothy_horton@apple.com>
1049 [iOS] Throttle painting using a UI-process-side CADisplayLink
1050 https://bugs.webkit.org/show_bug.cgi?id=134879
1051 <rdar://problem/17641699>
1053 Reviewed by Simon Fraser.
1055 Just waiting for CA to commit is insufficient to actually throttle to 60fps,
1056 because nothing will block the main runloop from spinning.
1058 Instead, listen to a CADisplayLink, and send didUpdate to the WebProcess
1059 the first time it fires after we commit. This is not a guarantee that
1060 our content is on the screen, but we don't have any way to make that guarantee yet.
1062 This will throttle painting, rAF, etc. to the display refresh rate.
1064 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1065 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1066 (-[OneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
1067 (-[OneShotDisplayLinkHandler dealloc]):
1068 (-[OneShotDisplayLinkHandler displayLinkFired:]):
1069 (-[OneShotDisplayLinkHandler invalidate]):
1070 (-[OneShotDisplayLinkHandler schedule]):
1071 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
1072 (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
1073 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1074 (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
1075 (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): Deleted.
1077 2014-07-14 Dan Bernstein <mitz@apple.com>
1079 <rdar://problem/17657391> [iOS] Networking process writes persistent credentials to the keychain
1080 https://bugs.webkit.org/show_bug.cgi?id=134878
1082 Reviewed by Sam Weinig.
1084 Route CFNetwork’s calls to Security API through to the UI process.
1086 * NetworkProcess/ios/NetworkProcessIOS.mm:
1087 (WebKit::NetworkProcess::platformInitializeNetworkProcess): Initialize SecItemShim.
1089 * Shared/mac/SecItemShim.cpp:
1090 (WebKit::SecItemShim::initialize): On iOS, rather than using a shim library, supply
1091 CFNetwork with alternate functions to call.
1093 * Shared/mac/SecItemShim.messages.in: Removed #if !PLATFORM(IOS).
1094 * UIProcess/mac/SecItemShimProxy.messages.in: Ditto.
1096 * config.h: Define ENABLE_SEC_ITEM_SHIM to 1 on iOS as well.
1098 2014-07-14 Dan Bernstein <mitz@apple.com>
1100 <rdar://problem/17398060> NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
1101 https://bugs.webkit.org/show_bug.cgi?id=134666
1103 Reviewed by Tim Horton.
1105 A SecItem may have an attribute whose value is a SecAccessControlRef, which is not supported
1106 by ArgumentCodersCF. In debug builds, trying to encode a CFDictionary containing a value of
1107 unsupprted type causes an assertion to fail, but in release builds encoding succeeds, and
1108 only decoding fails, in this case silently, simply not delivering the
1109 SecItemShim::secItemResponse message.
1111 The fix is to teach ArgumentCodersCF about SecAccessControlRef.
1113 * Shared/cf/ArgumentCodersCF.cpp:
1114 (IPC::typeFromCFTypeRef): Check for the SecAccessControlRef type.
1115 (IPC::encode): Encode the SecAccessControl serialized into CFData.
1116 (IPC::decode): Deserialize a SecAccessControl from the decoded CFData.
1117 * Shared/cf/ArgumentCodersCF.h:
1118 * config.h: Defined HAVE_SEC_ACCESS_CONTROL.
1120 2014-07-13 Dan Bernstein <mitz@apple.com>
1122 <rdar://problem/17295636> [Cocoa] Include element snapshot in _WKActivatedElementInfo
1123 https://bugs.webkit.org/show_bug.cgi?id=134872
1125 Reviewed by Sam Weinig.
1127 * Shared/InteractionInformationAtPosition.cpp:
1128 (WebKit::InteractionInformationAtPosition::encode): Encode the image if there is one.
1129 (WebKit::InteractionInformationAtPosition::decode): Decode the image if there is one.
1130 * Shared/InteractionInformationAtPosition.h: Added an image member to the struct.
1132 * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: Exposed the boundingRect property and added
1134 * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
1135 (-[_WKActivatedElementInfo _initWithType:URL:location:title:rect:image:]): Added an image
1136 parameter, which is stored in a new ivar.
1137 (-[_WKActivatedElementInfo image]): Added this getter, which converts the ShareableBitmap
1138 into a cached Cocoa image and returns it.
1139 * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: Added image parameter to the
1140 initializer, removed _boundingRect property declaration from here.
1142 * UIProcess/ios/WKActionSheetAssistant.mm:
1143 (-[WKActionSheetAssistant showImageSheet]): Pass the image from the position information
1144 into the _WKActivatedElementInfo initializer.
1145 (-[WKActionSheetAssistant showLinkSheet]): Ditto.
1147 * WebProcess/WebPage/WebPage.cpp:
1148 (WebKit::WebPage::snapshotNode): Added.
1149 * WebProcess/WebPage/WebPage.h:
1151 * WebProcess/WebPage/ios/WebPageIOS.mm:
1152 (WebKit::WebPage::getPositionInformation): If the element is a link or an image, store a
1153 snapshot of it in the image member of the InteractionInformationAtPosition.
1155 2014-07-13 Dan Bernstein <mitz@apple.com>
1157 [Cocoa] Clean up session state API a little
1158 https://bugs.webkit.org/show_bug.cgi?id=134871
1160 Reviewed by Darin Adler.
1162 * UIProcess/API/Cocoa/WKWebView.mm:
1163 (-[WKWebView _sessionState]):
1164 (-[WKWebView _restoreFromSessionState:]): Deleted.
1165 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1167 2014-07-13 Javier Fernandez <jfernandez@igalia.com>
1169 REGRESSION(r171045) [GTK] Build broken.
1170 https://bugs.webkit.org/show_bug.cgi?id=134867
1172 Unreviewed GTK build fix after r171045.
1174 * UIProcess/API/gtk/PageClientImpl.cpp:
1175 (WebKit::PageClientImpl::willRecordNavigationSnapshot):
1176 * UIProcess/API/gtk/PageClientImpl.h:
1178 2014-07-13 Gyuyoung Kim <gyuyoung.kim@samsung.com>
1180 Unreviewed, EFL build fix since r171045.
1182 * UIProcess/CoordinatedGraphics/WebView.h:
1184 2014-07-12 Dan Bernstein <mitz@apple.com>
1186 [Cocoa] Notify the client when a navigation snapshot is taken
1187 https://bugs.webkit.org/show_bug.cgi?id=134865
1189 Reviewed by Sam Weinig.
1191 * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
1193 * UIProcess/Cocoa/NavigationState.h:
1194 * UIProcess/Cocoa/NavigationState.mm:
1195 (WebKit::NavigationState::setNavigationDelegate): Initialize new flag in
1196 m_navigationDelegateMethods.
1197 (WebKit::NavigationState::willRecordNavigationSnapshot): Added. Calls the new
1198 WKNavigationDelegate method.
1200 * UIProcess/PageClient.h: Declared new client function.
1202 * UIProcess/WebPageProxy.cpp:
1203 (WebKit::WebPageProxy::willRecordNavigationSnapshot): Added. Calls the new client function.
1204 * UIProcess/WebPageProxy.h:
1206 * UIProcess/ios/PageClientImplIOS.h:
1207 * UIProcess/ios/PageClientImplIOS.mm:
1208 (WebKit::PageClientImpl::willRecordNavigationSnapshot): Override that calls
1209 NavigationState::willRecordNavigationSnapshot.
1211 * UIProcess/mac/PageClientImpl.h:
1212 * UIProcess/mac/PageClientImpl.mm:
1213 (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
1215 * UIProcess/mac/ViewSnapshotStore.mm:
1216 (WebKit::ViewSnapshotStore::recordSnapshot): Added a call to
1217 WebPageProxy::willRecordNavigationSnapshot.
1219 2014-07-12 Gyuyoung Kim <gyuyoung.kim@samsung.com>
1221 Unreviewed, fix EFL build break since r171034.
1223 * UIProcess/CoordinatedGraphics/WebView.h:
1224 * UIProcess/efl/WebContextEfl.cpp:
1225 (WebKit::WebContext::platformMediaCacheDirectory):
1227 2014-07-12 Darin Adler <darin@apple.com>
1229 Try to fix 32-bit Mac build.
1231 * UIProcess/mac/PageClientImpl.mm:
1232 (WebKit::PageClientImpl::navigationGestureDidBegin): Added WK_API_ENABLED conditional.
1233 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1234 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1236 2014-07-12 Javier Fernandez <jfernandez@igalia.com>
1238 REGRESSION(r171034) [GTK] Build broken.
1239 https://bugs.webkit.org/show_bug.cgi?id=134861
1241 Unreviewed GTK build fix.
1243 * UIProcess/API/gtk/PageClientImpl.cpp:
1244 (WebKit::PageClientImpl::navigationGestureDidBegin):
1245 (WebKit::PageClientImpl::navigationGestureWillEnd):
1246 (WebKit::PageClientImpl::navigationGestureDidEnd):
1247 * UIProcess/API/gtk/PageClientImpl.h:
1249 2014-07-12 Javier Fernandez <jfernandez@igalia.com>
1251 REGRESSION(r171024) [GTK] Build broken.
1252 https://bugs.webkit.org/show_bug.cgi?id=134859
1254 Unreviewed GTK build fix.
1256 * UIProcess/gtk/WebContextGtk.cpp:
1257 (WebKit::WebContext::platformMediaCacheDirectory):
1259 2014-07-12 Dan Bernstein <mitz@apple.com>
1261 <rdar://problem/16020380> [Cocoa] Inform the client when back-forward navigation gestures begin and end
1262 https://bugs.webkit.org/show_bug.cgi?id=134853
1264 Reviewed by Sam Weinig.
1266 * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new WKNavigationDelegate
1269 * UIProcess/API/Cocoa/WKWebView.mm:
1270 (-[WKWebView _isShowingNavigationGestureSnapshot]): Added this getter.
1272 * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property
1273 _isShowingNavigationGestureSnapshot.
1275 * UIProcess/Cocoa/NavigationState.h:
1276 * UIProcess/Cocoa/NavigationState.mm:
1277 (WebKit::NavigationState::setNavigationDelegate): Initialize new flags in
1278 m_navigationDelegateMethods.
1279 (WebKit::NavigationState::navigationGestureDidBegin): Added. Calls the new
1280 WKNavigationDelegate method.
1281 (WebKit::NavigationState::navigationGestureWillEnd): Ditto.
1282 (WebKit::NavigationState::navigationGestureDidEnd): Ditto.
1284 * UIProcess/PageClient.h: Declared new client functions.
1286 * UIProcess/WebPageProxy.cpp:
1287 (WebKit::WebPageProxy::WebPageProxy): Initialize new member variable.
1288 (WebKit::WebPageProxy::navigationGestureDidBegin): Set m_isShowingNavigationGestureSnapshot
1289 and call the new client function.
1290 (WebKit::WebPageProxy::navigationGestureWillEnd): Call the new client function.
1291 (WebKit::WebPageProxy::navigationGestureDidEnd): Ditto.
1292 (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved): Clear
1293 m_isShowingNavigationGestureSnapshot.
1294 * UIProcess/WebPageProxy.h:
1295 (WebKit::WebPageProxy::isShowingNavigationGestureSnapshot): Added this getter.
1297 * UIProcess/ios/PageClientImplIOS.h: Declared overrides of new client functions.
1298 * UIProcess/ios/PageClientImplIOS.mm:
1299 (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
1300 NavigationState function.
1301 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1302 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1304 * UIProcess/ios/ViewGestureControllerIOS.mm:
1305 (WebKit::ViewGestureController::beginSwipeGesture): Added calls to
1306 WebPageProxy::navigationGestureDidBegin and WebPageProxy::navigationGestureWillEnd.
1307 (WebKit::ViewGestureController::endSwipeGesture): Added calls to
1308 WebPageProxy::navigationGestureDidEnd.
1309 (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
1310 WebPageProxy::navigationGestureSnapshotWasRemoved.
1312 * UIProcess/mac/PageClientImpl.h: Declared overrides of new client functions.
1313 * UIProcess/mac/PageClientImpl.mm:
1314 (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
1315 NavigationState function.
1316 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1317 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1319 * UIProcess/mac/ViewGestureControllerMac.mm:
1320 (WebKit::ViewGestureController::beginSwipeGesture): Added call to
1321 WebPageProxy::navigationGestureDidBegin.
1322 (WebKit::ViewGestureController::endSwipeGesture): Added calls to
1323 WebPageProxy::navigationGestureDidEnd.
1324 (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
1325 WebPageProxy::navigationGestureSnapshotWasRemoved.
1327 2014-07-12 Oliver Hunt <oliver@apple.com>
1329 Fix typo in prior patch
1330 https://bugs.webkit.org/show_bug.cgi?id=134858
1332 Reviewed by Sam Weinig.
1336 * UIProcess/mac/WebContextMac.mm:
1337 (WebKit::WebContext::platformDefaultCookieStorageDirectory):
1339 2014-07-12 Dan Bernstein <mitz@apple.com>
1341 [Cocoa] Client is not notified of same-document navigations
1342 https://bugs.webkit.org/show_bug.cgi?id=134855
1344 Reviewed by Sam Weinig.
1346 * UIProcess/API/APILoaderClient.h:
1347 (API::LoaderClient::didSameDocumentNavigationForFrame): Added navigationID parameter.
1349 * UIProcess/API/C/WKPage.cpp:
1350 (WKPageSetPageLoaderClient): Ditto.
1352 * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Added new enum and delegate method.
1354 * UIProcess/Cocoa/NavigationState.h: Declare override of
1355 API::LoaderClient::didSameDocumentNavigationForFrame. Added flag in
1356 m_navigationDelegateMethods struct.
1357 * UIProcess/Cocoa/NavigationState.mm:
1358 (WebKit::NavigationState::setNavigationDelegate): Initialize new m_navigationDelegateMethods
1360 (WebKit::toWKSameDocumentNavigationType): Added this helper to convert from internal to API
1362 (WebKit::NavigationState::LoaderClient::didSameDocumentNavigationForFrame): Override to call
1363 the delegate method, if implemented.
1365 * UIProcess/WebPageProxy.cpp:
1366 (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Added navigationID parameter,
1367 which is forwarded to the client.
1368 * UIProcess/WebPageProxy.h: Added navigationID parameter.
1369 * UIProcess/WebPageProxy.messages.in: Ditto.
1371 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1372 (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): Send the navigation ID.
1373 (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): Ditto.
1374 (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): Ditto.
1375 (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): Ditto.
1377 2014-07-12 Oliver Hunt <oliver@apple.com>
1379 Extend WebContent sandbox to allow some extra access for frameworks
1380 https://bugs.webkit.org/show_bug.cgi?id=134844
1382 Reviewed by Sam Weinig.
1384 Open up the webcontent sandbox a bit so that some external frameworks
1387 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1388 * Shared/WebProcessCreationParameters.cpp:
1389 (WebKit::WebProcessCreationParameters::encode):
1390 (WebKit::WebProcessCreationParameters::decode):
1391 * Shared/WebProcessCreationParameters.h:
1392 * UIProcess/WebContext.cpp:
1393 (WebKit::WebContext::createNewWebProcess):
1394 (WebKit::WebContext::mediaCacheDirectory):
1395 * UIProcess/WebContext.h:
1396 * UIProcess/mac/WebContextMac.mm:
1397 (WebKit::WebContext::platformMediaCacheDirectory):
1398 * WebProcess/cocoa/WebProcessCocoa.mm:
1399 (WebKit::WebProcess::platformInitializeWebProcess):
1401 2014-07-12 Oliver Hunt <oliver@apple.com>
1403 Temporary work around for <rdar://<rdar://problem/17513375>
1404 https://bugs.webkit.org/show_bug.cgi?id=134848
1406 Reviewed by Sam Weinig.
1408 Temporarily work around <rdar://<rdar://problem/17513375> by
1409 dropping the explicit cookie storage if it points out of the
1412 * UIProcess/mac/WebContextMac.mm:
1413 (WebKit::WebContext::platformDefaultCookieStorageDirectory):
1415 2014-07-11 Enrica Casucci <enrica@apple.com>
1417 Implement textStylingAtPosition in WK2.
1418 https://bugs.webkit.org/show_bug.cgi?id=134843
1419 <rdar://problem/17614981>
1421 Reviewed by Benjamin Poulain.
1423 Adding information about typing attributes to EditorState so
1424 that we can implement textStylingAtPosition.
1426 * Shared/EditorState.cpp:
1427 (WebKit::EditorState::encode):
1428 (WebKit::EditorState::decode):
1429 * Shared/EditorState.h:
1430 (WebKit::EditorState::EditorState):
1431 * UIProcess/ios/WKContentViewInteraction.mm:
1432 (-[WKContentView textStylingAtPosition:inDirection:]):
1433 (-[WKContentView canPerformAction:withSender:]):
1434 (-[WKContentView toggleBoldface:]):
1435 (-[WKContentView toggleItalics:]):
1436 (-[WKContentView toggleUnderline:]):
1437 * WebProcess/WebPage/WebPage.cpp:
1438 (WebKit::WebPage::editorState):
1440 2014-07-11 Oliver Hunt <oliver@apple.com>
1442 Tighten WebContent sandbox
1443 https://bugs.webkit.org/show_bug.cgi?id=134834
1445 Reviewed by Sam Weinig.
1447 Define a much tighter sandbox profile for the WebContent process
1449 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1451 2014-07-11 Antti Koivisto <antti@apple.com>
1453 REGRESSION (r170163?): Web content shifts revealing space equivalent to the find bar when clicking a link while a phrase is targeted via Cmd+F
1454 https://bugs.webkit.org/show_bug.cgi?id=134833
1455 <rdar://problem/17580021>
1457 Reviewed by Zalan Bujtas.
1459 Some versions of OS X Safari can't handle the new unfreeze timing. Revert back to DidFirstLayout on Mac.
1461 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1462 (WebKit::WebFrameLoaderClient::dispatchDidLayout):
1464 2014-07-11 Zalan Bujtas <zalan@apple.com>
1466 Subpixel layout: return integral results for offset*, client*, scroll* by default.
1467 https://bugs.webkit.org/show_bug.cgi?id=134651
1469 Reviewed by Simon Fraser.
1471 Revert to returning integral values for Element.offset* client* scroll* by default.
1472 Fractional values break number of sites(tight design) and JS frameworks(fail to handle fractional values).
1474 Since snapped dimension depends on both the original point and the width/height of the box,
1475 we need to call RenderBoxModelObject::pixelSnapped*() helpers, instead of round().
1477 Covered by existing tests
1479 * Shared/WebPreferencesDefinitions.h:
1480 * UIProcess/API/C/WKPreferencesRefPrivate.h:
1482 2014-07-10 Jinwoo Song <jinwoo7.song@samsung.com>
1484 Unreviewed EFL build fix after r170970.
1486 * UIProcess/efl/WebContextEfl.cpp:
1487 (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
1489 2014-07-10 Carlos Alberto Lopez Perez <clopez@igalia.com>
1491 REGRESSION(r170970) REGRESSION(r170974): [GTK] Build broken.
1492 https://bugs.webkit.org/show_bug.cgi?id=134825
1494 Unreviewed GTK build fix.
1496 * Shared/SessionState.h: Put ifdefs for ViewSnapshot on Mac port.
1497 * Shared/WebBackForwardListItem.h: Idem.
1498 * UIProcess/gtk/WebContextGtk.cpp:
1499 (WebKit::WebContext::platformDefaultOpenGLCacheDirectory): Implement skeleton.
1501 2014-07-10 Benjamin Poulain <bpoulain@apple.com>
1503 [iOS][WK2] It should be safe to call WKContentViewInteraction's cleanupInteraction multiple times
1504 https://bugs.webkit.org/show_bug.cgi?id=134820
1506 Reviewed by Andreas Kling.
1508 If a view is destroyed just after a crash, "cleanupInteraction" is called twice: once on crash,
1511 The code handling _interactionViewsContainerView is using KVO to monitor transform changes. It is not safe
1512 to remove the observer if we are not already observing on that view.
1514 To solve the problem, this patch makes the cleanup actually remove the view so that setup and cleanup
1515 are completely symmetrical. If cleanup is called twice, the second time would not enter the branch because
1516 the view is already nil.
1518 * UIProcess/ios/WKContentViewInteraction.mm:
1519 (-[WKContentView setupInteraction]):
1520 (-[WKContentView cleanupInteraction]):
1522 2014-07-10 Simon Fraser <simon.fraser@apple.com>
1524 [iOS WK2] Move WKInspectorHighlightView to its own file
1525 https://bugs.webkit.org/show_bug.cgi?id=134819
1527 Reviewed by Joseph Pecoraro.
1529 WKInspectorHighlightView brought a lot of path/quad-related code into WKContentView.mm,
1530 so move it into its own file.
1532 * UIProcess/WKInspectorHighlightView.h: Added.
1533 * UIProcess/WKInspectorHighlightView.mm: Added.
1534 (-[WKInspectorHighlightView dealloc]):
1535 (-[WKInspectorHighlightView _removeAllLayers]):
1536 (-[WKInspectorHighlightView _createLayers:]):
1537 (findIntersectionOnLineBetweenPoints):
1539 (layerPathWithHole):
1541 (-[WKInspectorHighlightView _layoutForNodeHighlight:]):
1542 (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
1543 (-[WKInspectorHighlightView update:]):
1544 * UIProcess/ios/WKContentView.mm:
1545 (-[WKInspectorHighlightView initWithFrame:]): Deleted.
1546 (-[WKInspectorHighlightView dealloc]): Deleted.
1547 (-[WKInspectorHighlightView _removeAllLayers]): Deleted.
1548 (-[WKInspectorHighlightView _createLayers:]): Deleted.
1549 (findIntersectionOnLineBetweenPoints): Deleted.
1550 (quadIntersection): Deleted.
1551 (layerPathWithHole): Deleted.
1552 (layerPath): Deleted.
1553 (-[WKInspectorHighlightView _layoutForNodeHighlight:]): Deleted.
1554 (-[WKInspectorHighlightView _layoutForRectsHighlight:]): Deleted.
1555 (-[WKInspectorHighlightView update:]): Deleted.
1556 * WebKit2.xcodeproj/project.pbxproj:
1558 2014-07-10 Tim Horton <timothy_horton@apple.com>
1560 REGRESSION (r170935): WKWebView is always transparent until the first layer tree commit
1561 https://bugs.webkit.org/show_bug.cgi?id=134818
1562 <rdar://problem/17632468>
1564 Reviewed by Anders Carlsson.
1566 * UIProcess/API/Cocoa/WKWebView.mm:
1567 (scrollViewBackgroundColor):
1568 r170935 made it so that we would initialize the scroll view background color to an
1569 invalid color until the first layer tree commit. We should go with white instead.
1571 2014-07-10 Enrica Casucci <enrica@apple.com>
1573 Add a mechanism to notify the UIProcess when an editing command is done executing.
1574 https://bugs.webkit.org/show_bug.cgi?id=134807
1576 Reviewed by Tim Horton.
1578 Some editing commands have an effect on some parts of the system that
1579 run inside the UIProcess. A good example are the cursor movement commands
1580 that require an update of the autocorrection/autosuggestion machinery.
1581 This patch adds a way to reliably know when the command has been executed
1582 in the WebProcess. A previous attempt at solving this problem was added in
1583 r170858 and was partially reverted in r170948.
1584 The change also removes the selectionWillChange notification added in r170858.
1586 * UIProcess/PageClient.h:
1587 * UIProcess/WebPageProxy.cpp:
1588 (WebKit::WebPageProxy::editorStateChanged):
1589 * UIProcess/WebPageProxy.h:
1590 * UIProcess/ios/PageClientImplIOS.h:
1591 * UIProcess/ios/PageClientImplIOS.mm:
1592 (WebKit::PageClientImpl::selectionWillChange): Deleted.
1593 * UIProcess/ios/WKContentViewInteraction.h:
1594 * UIProcess/ios/WKContentViewInteraction.mm:
1595 (-[WKContentView executeEditCommandWithCallback:]):
1596 (-[WKContentView _moveUp:withHistory:]):
1597 (-[WKContentView _moveDown:withHistory:]):
1598 (-[WKContentView _moveLeft:withHistory:]):
1599 (-[WKContentView _moveRight:withHistory:]):
1600 (-[WKContentView _moveToStartOfWord:withHistory:]):
1601 (-[WKContentView _moveToStartOfParagraph:withHistory:]):
1602 (-[WKContentView _moveToStartOfLine:withHistory:]):
1603 (-[WKContentView _moveToStartOfDocument:withHistory:]):
1604 (-[WKContentView _moveToEndOfWord:withHistory:]):
1605 (-[WKContentView _moveToEndOfParagraph:withHistory:]):
1606 (-[WKContentView _moveToEndOfLine:withHistory:]):
1607 (-[WKContentView _moveToEndOfDocument:withHistory:]):
1608 (-[WKContentView _selectionWillChange]): Deleted.
1609 * UIProcess/ios/WebPageProxyIOS.mm:
1610 (WebKit::WebPageProxy::executeEditCommand):
1611 (WebKit::WebPageProxy::notifySelectionWillChange): Deleted.
1612 * WebProcess/WebPage/WebPage.h:
1613 * WebProcess/WebPage/WebPage.messages.in:
1614 * WebProcess/WebPage/ios/WebPageIOS.mm:
1615 (WebKit::WebPage::executeEditCommandWithCallback):
1617 2014-07-10 Joseph Pecoraro <pecoraro@apple.com>
1619 [Mac] NSWindow warning: adding an unknown subview opening detached Inspector
1620 https://bugs.webkit.org/show_bug.cgi?id=134813
1622 Reviewed by Timothy Hatcher.
1624 * UIProcess/mac/WebInspectorProxyMac.mm:
1625 (WebKit::WebInspectorProxy::createInspectorWindow):
1626 Use a selector that will avoid the warning message.
1628 2014-07-10 Oliver Hunt <oliver@apple.com>
1630 Remove use of container relative restrictions in the network process sandbox
1631 https://bugs.webkit.org/show_bug.cgi?id=134816
1633 Reviewed by Anders Carlsson.
1635 As i'm tidying up the various sandboxes and that's meaning we
1636 need to reduce some file restrictions in the network process.
1638 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1640 2014-07-10 Pratik Solanki <psolanki@apple.com>
1642 Unreviewed iOS build fix after r170974. Define id if building a non ObjC file.
1644 * UIProcess/mac/ViewSnapshotStore.h:
1646 2014-07-10 Tim Horton <timothy_horton@apple.com>
1648 Store ViewSnapshots directly on the WebBackForwardListItem
1649 https://bugs.webkit.org/show_bug.cgi?id=134667
1650 <rdar://problem/17082639>
1652 Reviewed by Dan Bernstein.
1654 Make ViewSnapshot a refcounted class. Store it directly on the back-forward item
1655 instead of in a side map referenced by UUID. Switch to a very simple LRU eviction model for now.
1656 This fixes a ton of snapshot management bugs; for example, we would start throwing out snapshots
1657 in the page that was actively being interacted with *first* when evicting snapshots, instead of
1658 preferring older snapshots. Additionally, we would not throw away snapshots when back forward items
1661 There is definitely room for improvement of the eviction mechanism, but this is closer to a time-tested implementation.
1663 * Shared/SessionState.h:
1664 Keep a ViewSnapshot instead of a UUID on the BackForwardListItemState.
1666 * Shared/WebBackForwardListItem.h:
1667 Fix some indented namespace contents.
1669 (WebKit::WebBackForwardListItem::snapshot):
1670 (WebKit::WebBackForwardListItem::setSnapshot):
1671 (WebKit::WebBackForwardListItem::setSnapshotUUID): Deleted.
1672 (WebKit::WebBackForwardListItem::snapshotUUID): Deleted.
1673 Switch the snapshot getter/setter to operate on ViewSnapshots instead of UUIDs.
1675 * UIProcess/API/Cocoa/WKWebView.mm:
1676 (-[WKWebView _takeViewSnapshot]):
1677 * UIProcess/API/Cocoa/WKWebViewInternal.h:
1678 * UIProcess/API/mac/WKView.mm:
1679 (-[WKView _takeViewSnapshot]):
1680 * UIProcess/API/mac/WKViewInternal.h:
1681 * UIProcess/PageClient.h:
1682 * UIProcess/WebPageProxy.cpp:
1683 (WebKit::WebPageProxy::takeViewSnapshot):
1684 * UIProcess/WebPageProxy.h:
1685 * UIProcess/ios/PageClientImplIOS.h:
1686 * UIProcess/ios/PageClientImplIOS.mm:
1687 (WebKit::PageClientImpl::takeViewSnapshot):
1688 * UIProcess/mac/PageClientImpl.h:
1689 * UIProcess/mac/PageClientImpl.mm:
1690 (WebKit::PageClientImpl::takeViewSnapshot):
1691 Adopt ViewSnapshot::create, return a PassRefPtr, and class-ify ViewSnapshot.
1693 * UIProcess/ios/ViewGestureControllerIOS.mm:
1694 (WebKit::ViewGestureController::beginSwipeGesture):
1695 (WebKit::ViewGestureController::endSwipeGesture):
1696 * UIProcess/mac/ViewGestureController.h:
1697 * UIProcess/mac/ViewGestureControllerMac.mm:
1698 (WebKit::ViewGestureController::shouldUseSnapshotForSize):
1699 (WebKit::ViewGestureController::beginSwipeGesture):
1700 (WebKit::ViewGestureController::endSwipeGesture):
1701 Grab the ViewSnapshot directly from the WebBackForwardListItem, and adopt the new functions.
1703 * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
1704 (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
1705 Rename discardSnapshots to discardSnapshotImages, because we're really only discarding
1706 the images; the render tree size/background color "snapshot" remains and is useful.
1708 * UIProcess/mac/ViewSnapshotStore.h:
1709 (WebKit::ViewSnapshot::setRenderTreeSize):
1710 (WebKit::ViewSnapshot::renderTreeSize):
1711 (WebKit::ViewSnapshot::setBackgroundColor):
1712 (WebKit::ViewSnapshot::backgroundColor):
1713 (WebKit::ViewSnapshot::setDeviceScaleFactor):
1714 (WebKit::ViewSnapshot::deviceScaleFactor):
1715 (WebKit::ViewSnapshot::imageSizeInBytes):
1716 (WebKit::ViewSnapshot::surface):
1717 (WebKit::ViewSnapshot::size):
1718 (WebKit::ViewSnapshot::creationTime):
1719 Make ViewSnapshot a refcounted class.
1720 Add create functions which take an image (or slot ID), and relevant sizes.
1721 It is expected that a ViewSnapshot is created with an image, and it is only possible
1722 to remove that image, never to replace it. A new ViewSnapshot is required in that case.
1723 Add setters for things that ViewSnapshotStore sets on the snapshot after the PageClient
1724 retrieves it from the view. Add getters for things that the ViewGestureControllers need.
1726 Remove removeSnapshotImage, getSnapshot, and the snapshot map.
1728 * UIProcess/mac/ViewSnapshotStore.mm:
1729 (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
1730 (WebKit::ViewSnapshotStore::didAddImageToSnapshot):
1731 (WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
1732 Manage m_snapshotCacheSize and m_snapshotsWithImages via didAddImageToSnapshot and willRemoveImageFromSnapshot.
1733 willRemoveImageFromSnapshot will -always- be called before the ViewSnapshot is destroyed.
1735 (WebKit::ViewSnapshotStore::pruneSnapshots):
1736 Switch to a simple LRU eviction model. As previously mentioned, it's possible to do better, but
1737 this is much less broken than the previous implementation.
1739 (WebKit::ViewSnapshotStore::recordSnapshot):
1740 (WebKit::ViewSnapshotStore::discardSnapshotImages):
1741 (WebKit::ViewSnapshot::create):
1742 (WebKit::ViewSnapshot::ViewSnapshot):
1743 (WebKit::ViewSnapshot::~ViewSnapshot):
1744 (WebKit::ViewSnapshot::hasImage):
1745 (WebKit::ViewSnapshot::clearImage):
1746 (WebKit::ViewSnapshot::asLayerContents):
1747 If a surface is Empty when it comes back from being volatile, throw away the surface
1748 and notify the Store to remove it from m_snapshotCacheSize (via clearImage()).
1750 (WebKit::ViewSnapshotStore::removeSnapshotImage): Deleted.
1751 (WebKit::ViewSnapshotStore::getSnapshot): Deleted.
1752 (WebKit::ViewSnapshotStore::discardSnapshots): Deleted.
1754 2014-07-10 Beth Dakin <bdakin@apple.com>
1756 Need Setting/WKPreference that allows clients to prevent scrollbars from drawing
1757 on a secondary thread
1758 https://bugs.webkit.org/show_bug.cgi?id=134778
1760 <rdar://problem/17595333>
1762 Reviewed by Tim Horton.
1764 This is a requirement for some types of performance tests.
1767 * Shared/WebPreferencesDefinitions.h:
1769 PDFPlugin has to implement this new ScrollableArea virtual function to indicate
1770 the Setting’s value.
1771 * WebProcess/Plugins/PDF/PDFPlugin.h:
1772 * WebProcess/Plugins/PDF/PDFPlugin.mm:
1773 (WebKit::PDFPlugin::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
1776 * WebProcess/WebPage/WebPage.cpp:
1777 (WebKit::WebPage::updatePreferences):
1779 2014-07-10 Tim Horton <timothy_horton@apple.com>
1781 [iOS] Frequent assertion failures when swiping back
1783 Reviewed by Dan Bernstein.
1785 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1786 (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
1787 Don't create an unused VoidCallback. It will assert when destroyed without being called.
1789 2014-07-10 Oliver Hunt <oliver@apple.com>
1791 Pass sandbox extension for GL cache over to webprocess
1792 https://bugs.webkit.org/show_bug.cgi?id=134806
1794 Reviewed by Anders Carlsson.
1796 Add additional WebProcess parameters to pass an extension
1797 that allows access to the opengl cache directory in the
1798 host application's container.
1800 * Shared/WebProcessCreationParameters.cpp:
1801 (WebKit::WebProcessCreationParameters::encode):
1802 (WebKit::WebProcessCreationParameters::decode):
1803 * Shared/WebProcessCreationParameters.h:
1804 * UIProcess/WebContext.cpp:
1805 (WebKit::WebContext::createNewWebProcess):
1806 (WebKit::WebContext::openGLCacheDirectory):
1807 * UIProcess/WebContext.h:
1808 * UIProcess/mac/WebContextMac.mm:
1809 (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
1810 * WebProcess/cocoa/WebProcessCocoa.mm:
1811 (WebKit::WebProcess::platformInitializeWebProcess):
1813 2014-07-10 Dan Bernstein <mitz@apple.com>
1817 * WebProcess/WebPage/ServicesOverlayController.h:
1819 2014-07-09 Brady Eidson <beidson@apple.com>
1821 Phone number highlights should always be visible if the mouse hovers over.
1822 <rdar://problem/17527476> and https://bugs.webkit.org/show_bug.cgi?id=134784
1824 Reviewed by Tim Horton.
1826 This is a fairly extensive rewrite of ServicesOverlayController.
1827 It allows one selection highlight for the entire selection, and as many telephone number highlights as there are numbers.
1828 If a telephone number highlight is hovered over, it wins and is painted.
1829 If no telephone number highlight is hovered but the selection highlight is, then it is painted.
1831 The purposes of each method are self evident by their name, and the concepts are mostly the same as they used to be.
1833 The exception is establishHoveredTelephoneHighlight which gets a more detailed explanation below.
1835 * Platform/Logging.h: Add a Services logging channel.
1837 * WebProcess/WebPage/ServicesOverlayController.h:
1838 (WebKit::TelephoneNumberData::TelephoneNumberData):
1840 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1841 (WebKit::ServicesOverlayController::ServicesOverlayController):
1842 (WebKit::ServicesOverlayController::selectionRectsDidChange):
1843 (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
1844 (WebKit::ServicesOverlayController::clearHighlightState):
1845 (WebKit::ServicesOverlayController::drawRect):
1846 (WebKit::ServicesOverlayController::drawSelectionHighlight):
1847 (WebKit::ServicesOverlayController::maybeDrawTelephoneNumberHighlight):
1848 (WebKit::ServicesOverlayController::drawHighlight):
1849 (WebKit::ServicesOverlayController::clearSelectionHighlight):
1850 (WebKit::ServicesOverlayController::clearHoveredTelephoneNumberHighlight):
1851 (WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight): Starts walking the telephone number ranges and
1852 creating a highlight for each one that doesn’t already have a highlight. If that highlight is also being hovered by
1853 the mouse, then it is set as the hovered telephone number highlight and the method stops creating new highlights.
1854 (WebKit::ServicesOverlayController::maybeCreateSelectionHighlight):
1855 (WebKit::ServicesOverlayController::mouseEvent):
1856 (WebKit::ServicesOverlayController::handleClick):
1857 (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Deleted.
1858 (WebKit::ServicesOverlayController::drawCurrentHighlight): Deleted.
1860 2014-07-10 Timothy Horton <timothy_horton@apple.com>
1862 Assertions or crashes under _takeViewSnapshot when restoring windows
1863 https://bugs.webkit.org/show_bug.cgi?id=134792
1865 Reviewed by Simon Fraser.
1867 * UIProcess/API/mac/WKView.mm:
1868 (-[WKView _takeViewSnapshot]):
1869 Taking a window-server snapshot of a non-visible window tends to not succeed.
1871 2014-07-09 Pratik Solanki <psolanki@apple.com>
1873 Buffer CSS and JS resources in network process before sending over to web process
1874 https://bugs.webkit.org/show_bug.cgi?id=134560
1875 <rdar://problem/16737186>
1877 Reviewed by Antti Koivisto.
1879 For CSS and JS resources, ask the network process to buffer the entire resource instead of
1880 sending it to web process in chunks since the web process can't do anything with a partial
1883 * NetworkProcess/NetworkResourceLoader.cpp:
1884 (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1885 * Shared/Network/NetworkResourceLoadParameters.cpp:
1886 (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
1887 (WebKit::NetworkResourceLoadParameters::encode):
1888 (WebKit::NetworkResourceLoadParameters::decode):
1889 * Shared/Network/NetworkResourceLoadParameters.h:
1890 * WebProcess/Network/WebResourceLoadScheduler.cpp:
1891 (WebKit::WebResourceLoadScheduler::scheduleLoad):
1893 2014-07-09 Benjamin Poulain <bpoulain@apple.com>
1895 [iOS][WK2] Disable text quantization while actively changing the page's scale factor
1896 https://bugs.webkit.org/show_bug.cgi?id=134781
1898 Reviewed by Tim Horton and Myles C. Maxfield.
1900 While zooming a page, text quantization causes glyphs to "move" in order to get to the closest
1901 boundary for the current scale factor.
1903 We do not want this to happen while dynamically changing the scale factor because the effect
1904 is visible. To avoid this, we disable text quantization if the page's scale factor changes
1905 in response to a non-stable contentRect update.
1907 * WebProcess/WebCoreSupport/WebChromeClient.h:
1908 * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1909 (WebKit::WebChromeClient::hasStablePageScaleFactor):
1910 * WebProcess/WebPage/WebPage.cpp:
1911 (WebKit::WebPage::WebPage):
1912 * WebProcess/WebPage/WebPage.h:
1913 (WebKit::WebPage::hasStablePageScaleFactor):
1914 * WebProcess/WebPage/ios/WebPageIOS.mm:
1915 (WebKit::WebPage::updateVisibleContentRects):
1917 2014-07-09 Joseph Pecoraro <pecoraro@apple.com>
1919 [iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI
1920 https://bugs.webkit.org/show_bug.cgi?id=134777
1922 Reviewed by Sam Weinig.
1924 * UIProcess/ios/forms/WKFileUploadPanel.mm:
1925 (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
1927 2014-07-09 Shivakumar JM <shiva.jm@samsung.com>
1929 [EFL][WK2] Add new Public API in ewk_download_job.h to get size of the data already downloaded.
1930 https://bugs.webkit.org/show_bug.cgi?id=134759
1932 Reviewed by Gyuyoung Kim.
1934 Add new API in ewk_download_job.h to get size of the data already downloaded.
1936 * UIProcess/API/efl/ewk_download_job.cpp:
1937 (ewk_download_job_received_data_length_get):
1938 (EwkDownloadJob::receivedData):
1939 * UIProcess/API/efl/ewk_download_job.h:
1940 * UIProcess/API/efl/ewk_download_job_private.h:
1941 * UIProcess/API/efl/tests/test_ewk2_download_job.cpp:
1942 (EWK2DownloadJobTest::on_download_requested):
1943 (EWK2DownloadJobTest::on_download_finished):
1945 2014-07-09 Enrica Casucci <enrica@apple.com>
1947 REGRESSION(r170858): Safari freezes upon making a search on a website (yelp.com).
1948 https://bugs.webkit.org/show_bug.cgi?id=134791
1949 <rdar://problem/17616971>
1951 Reviewed by Benjamin Poulain.
1953 After r170858 we notify the keyboard too often about
1954 the changed selection. This patch removes the notification
1955 until we find a better way to do it that doesn't cause
1958 * UIProcess/ios/WKContentViewInteraction.mm:
1959 (-[WKContentView _selectionWillChange]):
1960 (-[WKContentView _selectionChanged]):
1962 2014-07-09 Anders Carlsson <andersca@apple.com>
1964 Safari showing blank pages
1965 https://bugs.webkit.org/show_bug.cgi?id=134790
1966 <rdar://problem/17617166>
1968 Reviewed by Simon Fraser.
1970 * UIProcess/API/Cocoa/WKWebView.mm:
1971 (-[WKWebView initWithFrame:configuration:]):
1972 Make sure to add the content view to the scroll view.
1974 2014-07-09 Anders Carlsson <andersca@apple.com>
1976 Closed web views should never create new web processes
1977 https://bugs.webkit.org/show_bug.cgi?id=134787
1978 <rdar://problem/16892526>
1980 Reviewed by Simon Fraser.
1982 * UIProcess/API/Cocoa/WKWebView.mm:
1983 (-[WKWebView loadHTMLString:baseURL:]):
1984 (-[WKWebView reload]):
1985 (-[WKWebView reloadFromOrigin]):
1986 Return nil if the returned navigation ID is 0.
1988 * UIProcess/WebPageProxy.cpp:
1989 (WebKit::WebPageProxy::reattachToWebProcess):
1990 Assert that the page is not closed.
1992 (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1993 (WebKit::WebPageProxy::loadRequest):
1994 (WebKit::WebPageProxy::loadFile):
1995 (WebKit::WebPageProxy::loadData):
1996 (WebKit::WebPageProxy::loadHTMLString):
1997 (WebKit::WebPageProxy::loadAlternateHTMLString):
1998 (WebKit::WebPageProxy::loadPlainTextString):
1999 (WebKit::WebPageProxy::loadWebArchiveData):
2000 Add early returns if the page is closed.
2002 * UIProcess/WebPageProxy.h:
2004 2014-07-09 Anders Carlsson <andersca@apple.com>
2006 Support transparent WKWebViews
2007 https://bugs.webkit.org/show_bug.cgi?id=134779
2008 <rdar://problem/17351058>
2010 Reviewed by Tim Horton.
2012 * UIProcess/API/Cocoa/WKWebView.mm:
2013 (-[WKWebView initWithFrame:configuration:]):
2014 Call _updateScrollViewBackground instead of setting the background color.
2019 (scrollViewBackgroundColor):
2020 Helper function that returns the scroll view background color.
2021 If the web view isn't opaque, we want the scroll view to be transparent.
2023 (-[WKWebView _updateScrollViewBackground]):
2024 Call scrollViewBackgroundColor.
2026 (-[WKWebView setOpaque:]):
2027 Call WebPageProxy::setDrawsBackground and update the scroll view background.
2029 (-[WKWebView setBackgroundColor:]):
2030 Call setBackgroundColor on the content view.
2032 2014-07-09 Andy Estes <aestes@apple.com>
2034 [iOS] WebKit can crash under QuickLookDocumentData::encode() when viewing a QuickLook preview
2035 https://bugs.webkit.org/show_bug.cgi?id=134780
2037 Reviewed by Tim Horton.
2039 Don't use CFDataCreateWithBytesNoCopy() when we can't guarantee the lifetime of the copied-from DataReference
2040 will match or exceed that of the CFDataRef. Copy the data instead.
2042 * WebProcess/Network/WebResourceLoader.cpp:
2043 (WebKit::WebResourceLoader::didReceiveData):
2045 2014-07-09 Pratik Solanki <psolanki@apple.com>
2047 Move resource buffering from SynchronousNetworkLoaderClient to NetworkResourceLoader
2048 https://bugs.webkit.org/show_bug.cgi?id=134732
2050 Reviewed by Darin Adler.
2052 Buffer the resource in NetworkResourceLoader instead of SynchronousNetworkLoaderClient. This
2053 is in preparation for bug 134560 where we will be supporting JS and CSS resource buffering
2054 that uses AsynchronousNetworkLoaderClient.
2056 * NetworkProcess/NetworkResourceLoader.cpp:
2057 (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2058 (WebKit::NetworkResourceLoader::didReceiveBuffer):
2059 (WebKit::NetworkResourceLoader::didFinishLoading):
2060 * NetworkProcess/NetworkResourceLoader.h:
2061 (WebKit::NetworkResourceLoader::bufferedData):
2062 * NetworkProcess/SynchronousNetworkLoaderClient.cpp:
2063 (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer):
2064 (WebKit::SynchronousNetworkLoaderClient::didFinishLoading):
2065 (WebKit::SynchronousNetworkLoaderClient::didFail):
2066 (WebKit::SynchronousNetworkLoaderClient::sendDelayedReply):
2067 * NetworkProcess/SynchronousNetworkLoaderClient.h:
2069 2014-07-09 Benjamin Poulain <bpoulain@apple.com>
2071 [iOS][WK2] subviews of the unscaled view drift out during CA animations
2072 https://bugs.webkit.org/show_bug.cgi?id=134751
2074 Reviewed by Enrica Casucci.
2076 It is not possible to animate the WKContentView and the inverse view in such a way
2077 that the combined matrix remain the identity for every frame of the animation.
2079 This patch solves the issue by moving the unscaled view as a sibling of WKContentView
2080 instead of a child so that we do not need to update two scales simultaneously.
2082 * UIProcess/API/Cocoa/WKWebView.mm:
2083 (-[WKWebView initWithFrame:configuration:]):
2084 (-[WKWebView _processDidExit]):
2085 (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
2086 Set the z scale to 1 or no coordinate transform will work with this view.
2088 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2089 (-[WKWebView _endAnimatedResize]):
2090 * UIProcess/ios/WKContentView.mm:
2091 (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
2092 * UIProcess/ios/WKContentViewInteraction.h:
2093 * UIProcess/ios/WKContentViewInteraction.mm:
2094 (-[WKContentView setupInteraction]):
2095 Since we need to observe changes inside the animation block, the code now use KVO to observe changes of scale.
2097 (-[WKContentView cleanupInteraction]):
2098 (-[WKContentView unscaledView]):
2099 (-[WKContentView inverseScale]):
2100 (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
2101 We update the utility views as usual. The extra bits here are to deal with views coming in during an animation.
2103 If a new utility view comes in during a scaling animation, we do not want to start a new animation with the same curve
2104 to end up at the right place. To avoid any issue, we just hide the view until the animation is finished.
2106 (-[WKContentView hitTest:withEvent:]):
2107 (-[WKContentView _showTapHighlight]):
2108 (-[WKContentView _updateUnscaledView]): Deleted.
2110 2014-07-09 Tim Horton <timothy_horton@apple.com>
2112 Use IOSurface ViewSnapshots everywhere on Mac, remove JPEG encoding path
2113 https://bugs.webkit.org/show_bug.cgi?id=134773
2115 Reviewed by Anders Carlsson.
2117 * UIProcess/API/mac/WKView.mm:
2118 (-[WKView _takeViewSnapshot]):
2119 * UIProcess/mac/ViewSnapshotStore.h:
2120 * UIProcess/mac/ViewSnapshotStore.mm:
2121 (WebKit::ViewSnapshotStore::ViewSnapshotStore):
2122 (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
2123 (WebKit::ViewSnapshotStore::recordSnapshot):
2124 (WebKit::ViewSnapshot::clearImage):
2125 (WebKit::ViewSnapshot::asLayerContents):
2126 (WebKit::createIOSurfaceFromImage): Deleted.
2127 (WebKit::compressImageAsJPEG): Deleted.
2128 (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost): Deleted.
2129 (WebKit::ViewSnapshotStore::didCompressSnapshot): Deleted.
2130 Remove all ViewSnapshot(Store) code related to JPEG-encoded snapshots.
2131 Remove the "image" member on ViewSnapshot; Mac will always start out with an IOSurface instead.
2132 Adopt WebCore::IOSurface::createFromImage to make that happen.
2133 Add a comment noting that if a snapshot comes back empty, we should throw it away completely.
2135 2014-07-09 Anders Carlsson <andersca@apple.com>
2137 RemoteLayerBackingStore::ensureBackingStore should ensure that the entire backing store gets redrawn
2138 https://bugs.webkit.org/show_bug.cgi?id=134772
2140 Reviewed by Tim Horton.
2142 * Shared/mac/RemoteLayerBackingStore.h:
2143 (WebKit::RemoteLayerBackingStore::Buffer::operator bool):
2144 * Shared/mac/RemoteLayerBackingStore.mm:
2145 (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2147 2014-07-09 KwangHyuk Kim <hyuki.kim@samsung.com>
2149 [EFL] Fix crash caused by invalid cursor image.
2150 https://bugs.webkit.org/show_bug.cgi?id=134663
2152 Reviewed by Gyuyoung Kim.
2154 Remove calling of updateCursor since the custom cursor image is invalid once a mouse is out of the webview.
2156 * UIProcess/API/efl/EwkView.cpp:
2157 (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
2159 2014-07-08 Tim Horton <timothy_horton@apple.com>
2161 Remove WebBackForwardListItems when their owning page goes away
2162 https://bugs.webkit.org/show_bug.cgi?id=134709
2163 <rdar://problem/17584645>
2165 Reviewed by Dan Bernstein.
2167 * Shared/WebBackForwardListItem.cpp:
2168 (WebKit::WebBackForwardListItem::create):
2169 (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2170 * Shared/WebBackForwardListItem.h:
2171 (WebKit::WebBackForwardListItem::pageID):
2172 Add the associated PageID to the WebBackForwardListItem.
2174 * UIProcess/WebBackForwardList.cpp:
2175 (WebKit::WebBackForwardList::restoreFromState):
2176 Push the current PageID onto the WebBackForwardListItem.
2178 * UIProcess/WebProcessProxy.cpp:
2179 (WebKit::WebProcessProxy::removeWebPage):
2180 Remove all of the WebBackForwardListItems from m_backForwardListItemMap when
2181 the page they are associated with is removed.
2183 (WebKit::WebProcessProxy::addBackForwardItem):
2184 Push the PageID from the WebProcess onto the WebBackForwardListItem.
2186 * UIProcess/WebProcessProxy.h:
2187 * UIProcess/WebProcessProxy.messages.in:
2188 * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2189 (WebKit::idToHistoryItemMap):
2190 (WebKit::historyItemToIDMap):
2191 (WebKit::updateBackForwardItem):
2192 (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
2193 (WebKit::WK2NotifyHistoryItemChanged):
2194 (WebKit::WebBackForwardListProxy::idForItem):
2195 (WebKit::WebBackForwardListProxy::addItem):
2196 (WebKit::WebBackForwardListProxy::goToItem):
2197 (WebKit::WebBackForwardListProxy::close):
2198 * WebProcess/WebPage/WebBackForwardListProxy.h:
2199 * WebProcess/WebPage/WebPage.cpp:
2200 (WebKit::WebPage::restoreSession):
2201 Keep track of the PageID that back-forward items were created by.
2202 Pass the PageID along when registering WebBackForwardListItems.
2204 2014-07-08 Tim Horton <timothy_horton@apple.com>
2206 [WK2] Expose a few drawing/compositing settings on WKPreferences(Private)
2207 https://bugs.webkit.org/show_bug.cgi?id=134645
2209 Reviewed by Dan Bernstein.
2211 * UIProcess/API/Cocoa/WKPreferences.mm:
2212 (-[WKPreferences _compositingBordersVisible]):
2213 (-[WKPreferences _setCompositingBordersVisible:]):
2214 (-[WKPreferences _compositingRepaintCountersVisible]):
2215 (-[WKPreferences _setCompositingRepaintCountersVisible:]):
2216 (-[WKPreferences _tiledScrollingIndicatorVisible]):
2217 (-[WKPreferences _setTiledScrollingIndicatorVisible:]):
2218 * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2219 Expose layer borders, repaint counters, and the tiled scrolling indicator on WKPreferences, as SPI.
2221 2014-07-08 Tim Horton <timothy_horton@apple.com>
2223 WKProcessPoolConfigurationPrivate's maximumProcessCount property has no effect
2224 https://bugs.webkit.org/show_bug.cgi?id=134711
2226 Reviewed by Dan Bernstein.
2228 * UIProcess/API/Cocoa/WKProcessPool.mm:
2229 (-[WKProcessPool _initWithConfiguration:]):
2230 Respect the maximumProcessCount.
2231 Currently the default limit is UINT_MAX; if maximumProcessCount = 0 (the default), we'll use that limit.
2233 2014-07-08 Adrian Perez de Castro <aperez@igalia.com>
2235 [GTK] Move user style sheet API out of WebKitWebViewGroup
2236 https://bugs.webkit.org/show_bug.cgi?id=134551
2238 Reviewed by Carlos Garcia Campos.
2240 * PlatformGTK.cmake: Include the new source files in the build.
2241 * UIProcess/API/C/gtk/WKView.cpp:
2243 Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
2244 * UIProcess/API/gtk/WebKitUserContent.cpp: Added.
2245 (toUserContentInjectedFrames):
2248 (_WebKitUserStyleSheet::_WebKitUserStyleSheet):
2249 (webkit_user_style_sheet_ref):
2250 (webkit_user_style_sheet_unref):
2251 (webkit_user_style_sheet_new):
2252 (webkitWebKitUserStyleSheetToUserStyleSheet):
2253 * UIProcess/API/gtk/WebKitUserContent.h: Added.
2254 * UIProcess/API/gtk/WebKitUserContentManager.cpp: Added.
2255 (_WebKitUserContentManagerPrivate::_WebKitUserContentManagerPrivate):
2256 (webkit_user_content_manager_class_init):
2257 (webkit_user_content_manager_new):
2258 (webkit_user_content_manager_add_style_sheet):
2259 (webkit_user_content_manager_remove_all_style_sheets):
2260 (webkitUserContentManagerGetUserContentControllerProxy):
2261 * UIProcess/API/gtk/WebKitUserContentManager.h: Added.
2262 * UIProcess/API/gtk/WebKitUserContentManagerPrivate.h: Added.
2263 * UIProcess/API/gtk/WebKitUserContentPrivate.h: Added.
2264 * UIProcess/API/gtk/WebKitWebContext.cpp:
2265 (webkitWebContextCreatePageForWebView): Add a new parameter to allow
2266 passing the WebKitUserContentManager that the web view will use.
2267 * UIProcess/API/gtk/WebKitWebContextPrivate.h: Ditto.
2268 * UIProcess/API/gtk/WebKitWebView.cpp:
2269 (webkitWebViewConstructed): Added handling of the
2270 "user-content-manager" property on construction.
2271 (webkitWebViewSetProperty): Added support for the
2272 "user-content-manager" property.
2273 (webkitWebViewGetProperty): Added support for the
2274 "user-content-manager" property.
2275 (webkit_web_view_class_init): Added the "user-content-manager"
2276 property definition to the WebKitWebView class.
2277 (webkit_web_view_new_with_related_view): Made related views share
2278 the same WebKitUserContentManager used by the view they are
2280 (webkit_web_view_new_with_user_content_manager): Added.
2281 (webkit_web_view_get_user_content_manager): Added.
2282 * UIProcess/API/gtk/WebKitWebView.h: Add new API methods.
2283 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2284 (webkitWebViewBaseCreate): Added a parameter to pass the user
2286 (webkitWebViewBaseCreateWebPage): Added a parameter to pass the user
2288 * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Ditto.
2289 * UIProcess/API/gtk/WebKitWebViewGroup.cpp: Removed the bits related
2290 to user style sheet support from WebKitWebViewGroup.
2291 (webkit_web_view_group_set_settings):
2292 (toAPIArray): Deleted.
2293 (webkit_web_view_group_add_user_style_sheet): Deleted.
2294 (webkit_web_view_group_remove_all_user_style_sheets): Deleted.
2295 * UIProcess/API/gtk/WebKitWebViewGroup.h: Deleted the API methods
2296 for user style sheet handling.
2297 * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added the new API
2298 functions and types, and removed the methods which are no longer
2299 available in WebKitWebViewGroup.
2300 * UIProcess/API/gtk/webkit2.h: Add the new headers.
2301 * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added
2302 methods to add and remove user style sheets, alike those used for
2304 (WebKit::WebUserContentControllerProxy::addProcess):
2305 (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2306 (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
2307 * UIProcess/UserContent/WebUserContentControllerProxy.h: Ditto.
2308 * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2309 (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2310 Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
2311 * WebProcess/UserContent/WebUserContentController.cpp: Added methods
2312 to add and remove user style sheets, alike those used for user scripts.
2313 (WebKit::WebUserContentController::addUserStyleSheets):
2314 (WebKit::WebUserContentController::removeAllUserStyleSheets):
2315 * WebProcess/UserContent/WebUserContentController.h: Ditto.
2316 * WebProcess/UserContent/WebUserContentController.messages.in:
2319 2014-07-08 Zan Dobersek <zdobersek@igalia.com>
2321 [GTK] Guard uses of RedirectedXCompositeWindow in WebKitWebViewBase with PLATFORM(X11)
2322 https://bugs.webkit.org/show_bug.cgi?id=133871
2324 Reviewed by Martin Robinson.
2326 Guard uses of the RedirectedXCompositeWindow object in WebKitWebViewBase with the
2327 PLATFORM(X11) build guard. This is required to properly support building the GTK
2328 port only for the Wayland target.
2330 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2331 (webkitWebViewBaseConstructed):
2332 (webkitWebViewRenderAcceleratedCompositingResults):
2333 (resizeWebKitWebViewBaseFromAllocation):
2334 (webkitWebViewBaseUpdatePreferences):
2335 (webkitWebViewBaseCreateWebPage):
2337 2014-07-07 Tim Horton <timothy_horton@apple.com>
2339 Turn on accelerated drawing for WebKit2 by default
2340 https://bugs.webkit.org/show_bug.cgi?id=134708
2341 <rdar://problem/17584642>
2343 Reviewed by Simon Fraser.
2345 * Shared/WebPreferencesDefinitions.h:
2346 Make Mac match iOS, in that accelerated drawing is on by default.
2348 2014-07-07 Timothy Horton <timothy_horton@apple.com>
2350 Don't leak _WKRemoteObjectRegistry in WKBrowsingContextController
2351 https://bugs.webkit.org/show_bug.cgi?id=134703
2353 Reviewed by Simon Fraser.
2355 * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2356 (-[WKBrowsingContextController _remoteObjectRegistry]):
2357 Adoption is important!!
2359 2014-07-07 Simon Fraser <simon.fraser@apple.com>
2361 [UI-side compositing] Support reflections on custom layers like video
2362 https://bugs.webkit.org/show_bug.cgi?id=134701
2364 Reviewed by Tim Horton.
2366 For video reflections, we have to support cloning of PlatformCALayerRemoteCustom
2367 in the web process. Do so by implementing PlatformCALayerRemoteCustom::clone(),
2368 which does the right gyrations to get AVPlayerLayers cloned, then makes a
2369 new PlatformCALayerRemoteCustom to wrap the new layer. This ends up getting
2370 its own context hosting ID, allowing the clone to show in the UI process.
2372 Attempt to do the same for WebGL, but turn it off because it breaks.
2374 * Shared/mac/RemoteLayerBackingStore.mm:
2375 (WebKit::RemoteLayerBackingStore::drawInContext):
2376 * Shared/mac/RemoteLayerTreeTransaction.mm:
2377 (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode): Unconditionally encode/decode
2378 the hostingContextID. It will be 0 for most layers.
2379 (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
2380 (WebKit::RemoteLayerTreeTransaction::description):
2381 * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
2382 (WebKit::RemoteLayerTreeHost::createLayer):
2383 * UIProcess/mac/RemoteLayerTreeHost.mm:
2384 (WebKit::RemoteLayerTreeHost::createLayer):
2385 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2386 (WebKit::PlatformCALayerRemote::create): Creation with a custom PlatformLayer* always
2387 creates a PlatformCALayerRemoteCustom.
2388 (WebKit::PlatformCALayerRemote::clone): Factor some code.
2389 (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
2390 (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2391 * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2392 * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
2393 * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
2394 (WebKit::PlatformCALayerRemoteCustom::create):
2395 (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
2396 (WebKit::PlatformCALayerRemoteCustom::clone): Clone by making an instance of the
2397 correct type of platform layer when possible, then wrapping a PlatformCALayerRemoteCustom
2399 (WebKit::PlatformCALayerRemoteCustom::contents):
2400 (WebKit::PlatformCALayerRemoteCustom::setContents):
2401 * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2402 (WebKit::RemoteLayerTreeContext::layerWasCreated):
2403 (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
2405 2014-07-07 Simon Fraser <simon.fraser@apple.com>
2407 [UI-side compositing] Crash when starting a filter transition on a reflected layer
2408 https://bugs.webkit.org/show_bug.cgi?id=134694
2410 Reviewed by Tim Horton.
2412 When cloned layers had animations, we would fire two animationDidStart callbacks,
2413 but the second would pass an empty animationKey string to the web process, resulting
2416 Fix by not blindly copying all layer properties when cloning PlatformCALayerRemotes,
2417 since the clone would include addedAnimations, and then get the same animations
2418 added on top by the caller.
2420 Also protect against an empty animation key in the animationDidStart callback.
2422 * UIProcess/mac/RemoteLayerTreeHost.mm:
2423 (WebKit::RemoteLayerTreeHost::animationDidStart):
2424 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2425 (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
2426 (WebKit::PlatformCALayerRemote::clone): Don't copy all the properties; copy
2427 them manually as PlatformCALayerMac does. Only copy the big things if they don't
2428 have their default values.
2429 (WebKit::PlatformCALayerRemote::copyFiltersFrom): Need an implementation of this
2430 for clone() to call.
2432 2014-07-07 Tim Horton <timothy_horton@apple.com>
2434 Nearly everything in the UIProcess "leaks" when WKWebView is torn down
2435 https://bugs.webkit.org/show_bug.cgi?id=134699
2436 <rdar://problem/17581777>
2438 Reviewed by Simon Fraser.
2440 * UIProcess/API/Cocoa/WKWebView.mm:
2441 (-[WKWebView initWithFrame:configuration:]):
2442 Adoption is important!
2444 2014-07-07 Enrica Casucci <enrica@apple.com>
2446 REGRESSION(iOS WK2): arrow keys movements don't work.
2447 https://bugs.webkit.org/show_bug.cgi?id=134561
2448 <rdar://problem/16827629>
2450 Reviewed by Benjamin Poulain.
2452 This change add the implementations for cursor movement selectors.
2453 It also provides a mechanism to ensure that every selection
2454 change in WebKit is reflected in UIKit so that it can update the
2455 autocorrection data. This way we ensure that the autocorraction state
2456 is consistent even when selection changes are originated by JavaScript.
2457 WebPageProxy::editorStateChanged now notifies the page client when the
2458 selection is about to change as well as when it actually changed.
2460 * UIProcess/PageClient.h:
2461 * UIProcess/WebPageProxy.cpp:
2462 (WebKit::WebPageProxy::editorStateChanged):
2463 * UIProcess/WebPageProxy.h:
2464 * UIProcess/ios/PageClientImplIOS.h:
2465 * UIProcess/ios/PageClientImplIOS.mm:
2466 (WebKit::PageClientImpl::selectionWillChange):
2467 * UIProcess/ios/WKContentViewInteraction.h:
2468 * UIProcess/ios/WKContentViewInteraction.mm:
2469 (-[WKContentView cut:]): Removed incorrect calls to textWillChange and
2471 (-[WKContentView paste:]):
2472 (-[WKContentView _moveUp:withHistory:]):
2473 (-[WKContentView _moveDown:withHistory:]):
2474 (-[WKContentView _moveLeft:withHistory:]):
2475 (-[WKContentView _moveRight:withHistory:]):
2476 (-[WKContentView _moveToStartOfWord:withHistory:]):
2477 (-[WKContentView _moveToStartOfParagraph:withHistory:]):
2478 (-[WKContentView _moveToStartOfLine:withHistory:]):
2479 (-[WKContentView _moveToStartOfDocument:withHistory:]):
2480 (-[WKContentView _moveToEndOfWord:withHistory:]):
2481 (-[WKContentView _moveToEndOfParagraph:withHistory:]):
2482 (-[WKContentView _moveToEndOfLine:withHistory:]):
2483 (-[WKContentView _moveToEndOfDocument:withHistory:]):
2484 (-[WKContentView _selectionWillChange]):
2485 (-[WKContentView _selectionChanged]):
2486 * UIProcess/ios/WebPageProxyIOS.mm:
2487 (WebKit::WebPageProxy::notifySelectionWillChange):
2489 2014-07-07 Anders Carlsson <andersca@apple.com>
2491 Add SPI for saving and restoring a WKWebView's _WKSessionState
2492 https://bugs.webkit.org/show_bug.cgi?id=134693
2494 Reviewed by Dan Bernstein.
2496 * UIProcess/API/C/WKPage.cpp:
2497 (WKPageRestoreFromSessionState):
2498 * UIProcess/API/Cocoa/WKWebView.mm:
2499 (-[WKWebView _sessionState]):
2500 (-[WKWebView _restoreFromSessionStateData:]):
2501 (-[WKWebView _restoreFromSessionState:]):
2502 (-[WKWebView _restoreSessionState:andNavigate:]):
2503 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2504 * UIProcess/API/Cocoa/_WKSessionState.mm:
2505 (-[_WKSessionState _initWithSessionState:]):
2506 * UIProcess/API/Cocoa/_WKSessionStateInternal.h:
2507 * UIProcess/WebPageProxy.cpp:
2508 (WebKit::WebPageProxy::restoreFromSessionState):
2509 * UIProcess/WebPageProxy.h:
2511 2014-07-07 Anders Carlsson <andersca@apple.com>
2513 Add a stubbed out _WKSessionState class
2514 https://bugs.webkit.org/show_bug.cgi?id=134690
2516 Reviewed by Geoffrey Garen.
2518 * UIProcess/API/Cocoa/_WKSessionState.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2519 * UIProcess/API/Cocoa/_WKSessionState.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2520 (-[_WKSessionState initWithData:]):
2521 (-[_WKSessionState data]):
2522 * UIProcess/API/Cocoa/_WKSessionStateInternal.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2523 * UIProcess/Cocoa/SessionStateCoding.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2524 * UIProcess/Cocoa/SessionStateCoding.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2525 (WebKit::encodeSessionState):
2526 (WebKit::decodeSessionState):
2527 * UIProcess/LegacySessionStateCoding.h:
2528 * WebKit2.xcodeproj/project.pbxproj:
2530 2014-07-07 Anders Carlsson <andersca@apple.com>
2532 Some of the WKPreferences (API) property getters read like questions
2533 https://bugs.webkit.org/show_bug.cgi?id=134678
2534 <rdar://problem/17576847>
2536 Reviewed by Dan Bernstein.
2538 * UIProcess/API/Cocoa/WKPreferences.h:
2539 * UIProcess/API/Cocoa/WKPreferences.mm:
2540 (-[WKPreferences javaScriptIsEnabled]):
2541 (-[WKPreferences javaIsEnabled]):
2542 (-[WKPreferences plugInsAreEnabled]):
2543 (-[WKPreferences isJavaScriptEnabled]): Deleted.
2544 (-[WKPreferences isJavaEnabled]): Deleted.
2545 (-[WKPreferences arePlugInsEnabled]): Deleted.
2547 2014-07-07 Brady Eidson <beidson@apple.com>
2549 ServicesOverlayController menus show up in the wrong place.
2550 <rdar://problem/17130576> and https://bugs.webkit.org/show_bug.cgi?id=134684
2552 Reviewed by Tim Horton.
2554 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2555 (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Handle cases where
2556 the telephone number is in a subframe.
2557 (WebKit::ServicesOverlayController::handleClick): The click point is always in main frame document
2558 coordinates, so convert it to window coordinates using the main frame’s FrameView.
2560 2014-07-07 Dan Bernstein <mitz@apple.com>
2562 [Cocoa] Assertion failure in NavigationState::LoaderClient::didStartProvisionalLoadForFrame (navigationID) when navigating through the page cache
2563 https://bugs.webkit.org/show_bug.cgi?id=134682
2565 Reviewed by Tim Horton.
2567 * UIProcess/Cocoa/NavigationState.mm:
2568 (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Replaced the
2569 assertion with a FIXME.
2570 (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
2572 (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
2573 (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
2574 (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
2575 (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
2576 (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
2578 2014-07-07 KwangHyuk Kim <hyuki.kim@samsung.com>
2580 [EFL] Fix cursor artifacts on naver map site.
2581 https://bugs.webkit.org/show_bug.cgi?id=134649
2583 Reviewed by Gyuyoung Kim.
2585 Old evas cursor and ecore x cursor are reset before new cursor is applied.
2587 * UIProcess/API/efl/EwkView.cpp:
2588 (EwkView::updateCursor):
2590 2014-07-06 Benjamin Poulain <bpoulain@apple.com>
2592 [iOS][WK2] The tap highlight ID is not invalidated when a long press ends
2593 https://bugs.webkit.org/show_bug.cgi?id=134660
2595 Reviewed by Darin Adler.
2597 * UIProcess/ios/WKContentViewInteraction.mm:
2598 (-[WKContentView _cancelInteraction]):
2599 (-[WKContentView _finishInteraction]):
2600 (cancelPotentialTapIfNecessary):
2601 I messed that up in r170600. I only accounted for the web process being too fast.
2603 If the web process is too slow, _cancelInteraction or _finishInteraction happen before
2604 _didGetTapHighlightForRequest:, and we also need to nuke the tap highlight.
2606 2014-07-06 Tim Horton <timothy_horton@apple.com>
2608 [WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
2609 https://bugs.webkit.org/show_bug.cgi?id=134644
2611 Reviewed by Darin Adler.
2613 * UIProcess/DrawingAreaProxy.h:
2614 (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
2615 * UIProcess/WebPageProxy.cpp:
2616 (WebKit::WebPageProxy::preferencesDidChange):
2617 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2618 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2619 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2620 (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
2621 (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
2622 The indicator depends on the live layer tree commits coming in, including layer creation,
2623 so it can't be turned on after the root layer is created. Even a refresh is insufficient
2624 to get it working; the debug indicator really needs to exist from the first commit.
2625 So, don't even attempt to dynamically enable the indicator; create it at
2626 RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled.
2628 2014-07-06 Yoav Weiss <yoav@yoav.ws>
2630 Turn on img@sizes compile flag
2631 https://bugs.webkit.org/show_bug.cgi?id=134634
2633 Reviewed by Benjamin Poulain.
2635 * Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.
2637 2014-07-06 Brady Eidson <beidson@apple.com>
2639 Speculative fix for: NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
2640 https://bugs.webkit.org/show_bug.cgi?id=134666
2642 Reviewed by Tim Horton.
2644 * Shared/mac/SecItemRequestData.cpp:
2645 (WebKit::SecItemRequestData::encode): Encode whether or not the query dictionary exists.
2646 (WebKit::SecItemRequestData::decode): Only fail when query dictionary fails to decode if we expect one.
2648 * UIProcess/mac/SecItemShimProxy.cpp:
2649 (WebKit::SecItemShimProxy::secItemRequest): If the request is of type Invalid, log an error message asking
2650 for a bug, and respond with an "invalid parameter" error.
2652 2014-07-06 Antti Koivisto <antti@apple.com>
2654 Don't throttle layer flushes when the main resource is a GIF
2655 https://bugs.webkit.org/show_bug.cgi?id=134650
2657 Reviewed by Simon Fraser.
2659 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2660 (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
2662 2014-07-04 Rohit Kumar <kumar.rohit@samsung.com>
2664 [EFL][WK2]Fix build break in EFL WK2
2665 https://bugs.webkit.org/show_bug.cgi?id=134629
2667 Unreviewed build fix.
2669 * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
2670 (WebKit::CoordinatedDrawingArea::scheduleCompositingLayerFlushImmediately):
2671 * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
2673 2014-07-04 Dan Bernstein <mitz@apple.com>
2675 [Cocoa] -[WKWebView _reload] is unused
2676 https://bugs.webkit.org/show_bug.cgi?id=134638
2678 Reviewed by Sam Weinig.
2680 * UIProcess/API/Cocoa/WKWebView.mm:
2681 (-[WKWebView _reload]): Deleted.
2682 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2684 2014-07-04 Tim Horton <timothy_horton@apple.com>
2686 [WK2] Take TopContentInset into account when sending dictionary lookup point to PluginView
2687 https://bugs.webkit.org/show_bug.cgi?id=134624
2688 <rdar://problem/17222041>
2690 Reviewed by Sam Weinig.
2692 * WebProcess/Plugins/PDF/PDFPlugin.mm:
2693 (WebKit::PDFPlugin::performDictionaryLookupAtLocation):
2694 Perform the same coordinate conversion we use for mouse events, which happens
2695 to take the top content inset into account.
2697 2014-07-04 Philippe Normand <pnormand@igalia.com>
2699 Unreviewed, GTK WK2 build fix after r170787.
2701 * WebProcess/WebPage/DrawingAreaImpl.cpp:
2702 (WebKit::DrawingAreaImpl::scheduleCompositingLayerFlushImmediately):
2703 * WebProcess/WebPage/DrawingAreaImpl.h:
2705 2014-07-04 Zan Dobersek <zdobersek@igalia.com>
2707 Unreviewed. Reverting the bad changes introduced in r170795.
2709 * Platform/IPC/ArgumentDecoder.cpp:
2710 (IPC::ArgumentDecoder::decode): Deleted.
2711 * Platform/IPC/ArgumentDecoder.h:
2712 * Platform/IPC/ArgumentEncoder.cpp:
2713 (IPC::ArgumentEncoder::encode): Deleted.
2714 * Platform/IPC/ArgumentEncoder.h:
2716 2014-07-04 Zan Dobersek <zdobersek@igalia.com>
2718 Unreviewed. Fixing the build for ports on 64-bit Linux.
2720 Add IPC encoding and decoding overloads for the long long type, needed
2721 after r170755 started encoding and decoding long long variables in
2724 * Platform/IPC/ArgumentDecoder.cpp:
2725 (IPC::ArgumentDecoder::decode):
2726 * Platform/IPC/ArgumentDecoder.h:
2727 * Platform/IPC/ArgumentEncoder.cpp:
2728 (IPC::ArgumentEncoder::encode):
2729 * Platform/IPC/ArgumentEncoder.h:
2731 2014-07-04 Timothy Horton <timothy_horton@apple.com>
2733 [iOS][WK2] Black web view after un-suspending process
2734 https://bugs.webkit.org/show_bug.cgi?id=134623
2735 <rdar://problem/17513223>
2737 Reviewed by Simon Fraser.
2739 * UIProcess/WebPageProxy.cpp:
2740 (WebKit::WebPageProxy::viewStateDidChange):
2741 Add an argument to viewStateDidChange that allows callers (-[WKContentView _applicationWillEnterForeground:])
2742 to force us to wait for a synchronous reply from the Web process after performing a view state change.
2744 (WebKit::WebPageProxy::dispatchViewStateChange):
2745 Move the has-been-in-window-and-now-is-newly-in-window check into dispatchViewStateChange.
2746 Adjust the logic surrounding going into/out of window by factoring out the IsInWindow-did-change check, for clarity.
2748 * UIProcess/WebPageProxy.h:
2749 * UIProcess/ios/WKContentView.mm:
2750 (-[WKContentView _applicationWillEnterForeground:]):
2751 As previously mentioned, wait for a reply when foregrounding.
2753 * WebProcess/WebPage/DrawingArea.h:
2754 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2755 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2756 (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
2757 (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
2758 (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
2759 Make sure to schedule a commit immediately if the UI process is waiting for a reply.
2760 Previously we assumed that a commit would be scheduled anyway because we would have to reparent the
2761 layer tree, but that doesn't happen in the suspension-without-unparenting case. Also, we want to skip
2762 all throttling in this case.
2764 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2765 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2766 (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):
2768 2014-07-03 Gavin Barraclough <baraclough@apple.com>
2770 Should not take background task assertion for NetworkProcess
2771 https://bugs.webkit.org/show_bug.cgi?id=134622
2773 Reviewed by Tim Horton.
2775 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.
2776 However for the NetworkProcess we always just hold a process assertion, and don't want this to interfere with UIApp suspension.
2778 * Platform/IPC/mac/ConnectionMac.mm:
2779 (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
2780 - ProcessAssertion -> ProcessAndUIAssertion
2781 * UIProcess/ProcessAssertion.cpp:
2782 (WebKit::ProcessAssertion::ProcessAssertion):
2783 - assignment -> initializer list.
2784 (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
2785 (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
2786 (WebKit::ProcessAndUIAssertion::setState):
2787 - added no-op implementation.
2788 (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
2789 * UIProcess/ProcessAssertion.h:
2790 - removed ~ProcessAssertion, added ProcessAndUIAssertion class.
2791 * UIProcess/ProcessThrottler.cpp:
2792 (WebKit::ProcessThrottler::didConnnectToProcess):
2793 - ProcessAssertion -> ProcessAndUIAssertion
2794 * UIProcess/ProcessThrottler.h:
2795 - ProcessAssertion -> ProcessAndUIAssertion
2796 * UIProcess/ios/ProcessAssertionIOS.mm:
2797 (WebKit::ProcessAssertion::ProcessAssertion):
2798 - assignment -> initializer list.
2799 - moved code to manage WKProcessAssertionBackgroundTaskManager
2800 (WebKit::ProcessAssertion::setState):
2801 - moved code to manage WKProcessAssertionBackgroundTaskManager
2802 (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
2803 (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
2804 (WebKit::ProcessAndUIAssertion::setState):
2805 - moved code to manage WKProcessAssertionBackgroundTaskManager from ProcessAssertion.
2806 (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
2807 - delete - moved code to manage WKProcessAssertionBackgroundTaskManager
2809 2014-07-03 Simon Fraser <simon.fraser@apple.com>
2811 Clean up Brady's mess on iOS.
2813 * Platform/mac/StringUtilities.h:
2814 * Platform/mac/StringUtilities.mm:
2816 2014-07-03 Simon Fraser <simon.fraser@apple.com>
2818 [iOS WK2] Compositing layers draw outside page bounds
2819 https://bugs.webkit.org/show_bug.cgi?id=134619
2820 <rdar://problem/16953222>
2822 Reviewed by Benjamin Poulain.
2824 With the new rubber-banding behavior, we no longer have the root content layer clipping all
2825 the web layers, but this resulted in web layers which were moved outside the viewport by CSS
2826 transforms not being clipped.
2828 Fix by adding a clipping layer inside the scroll view, above _rootContentView. This layer
2829 normally has the same bounds as the content, but when rubber-banding or pinching,
2830 it takes the union of the content bounds and the rect used for fixed positioning.
2831 To make scrolling work as expected in this scenario, when it has non-zero offset, it
2832 has to compensate by setting its bounds origin.
2834 The bounds of the clipping layer are updated on scrolling/zooming, and when the
2835 layer commit tells us that the content size changed.
2837 * UIProcess/API/Cocoa/WKWebView.mm:
2838 (-[WKWebView _updateScrollViewBackground]):
2839 * UIProcess/ios/WKContentView.mm:
2840 (-[WKContentView initWithFrame:context:configuration:webView:]):
2841 (-[WKContentView updateFixedClippingView:]):
2842 (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
2843 (-[WKContentView _didCommitLayerTree:]):
2845 2014-07-03 Brady Eidson <beidson@apple.com>
2847 When showing the selection menu, include menu options for all selected phone numbers.
2848 <rdar://problem/16983434>, <rdar://problem/16874568>, and https://bugs.webkit.org/show_bug.cgi?id=134613
2850 Reviewed by Tim Horton.
2852 Move some telephone number menu logic from WebKitSystemInterface here.
2853 Also provide utility to get just the one menu item relevant to a telephone number.
2854 * Platform/mac/MenuUtilities.h:
2855 * Platform/mac/MenuUtilities.mm: Added.
2856 (WebKit::menuItemForTelephoneNumber):
2857 (WebKit::menuItemsForTelephoneNumber):
2859 * Platform/mac/StringUtilities.h:
2860 * Platform/mac/StringUtilities.mm:
2861 (WebKit::formattedPhoneNumberString): Return a localized formatted phone number.
2863 Add a member to track the selected phone numbers:
2864 * Shared/ContextMenuContextData.h:
2865 (WebKit::ContextMenuContextData::ContextMenuContextData):
2866 (WebKit::ContextMenuContextData::selectedTelephoneNumbers):
2868 * UIProcess/WebPageProxy.h:
2869 * UIProcess/WebPageProxy.messages.in:
2871 * UIProcess/mac/WebContextMenuProxyMac.mm:
2872 (WebKit::WebContextMenuProxyMac::setupServicesMenu): Also add menu items for each phone number that is
2875 Switch away from a WKSI method, and remove a lot of unneeded forward declarations and soft linking:
2876 * UIProcess/mac/WebPageProxyMac.mm:
2877 (WebKit::WebPageProxy::showTelephoneNumberMenu):
2878 (WebKit::WebPageProxy::showSelectionServiceMenu):
2880 * WebKit2.xcodeproj/project.pbxproj:
2882 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2883 (WebKit::ServicesOverlayController::drawSelectionHighlight):
2884 (WebKit::ServicesOverlayController::handleClick): Pass the phone numbers along.
2886 * WebProcess/WebPage/WebPage.h:
2887 * WebProcess/WebPage/mac/WebPageMac.mm:
2888 (WebKit::WebPage::handleSelectionServiceClick): Pass the phone numbers along.
2890 2014-07-03 Gavin Barraclough <baraclough@apple.com>
2892 WKProcessAssertionBackgroundTaskManager should clear member if task expires
2893 https://bugs.webkit.org/show_bug.cgi?id=134618
2895 Reviewed by Anders Carlson.
2897 Failure to do so results in a warning, and could result in us erroneously completing a background task too soon.
2899 * UIProcess/ios/ProcessAssertionIOS.mm:
2900 (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
2901 - remove local variable, _backgroundTask = UIBackgroundTaskInvalid;
2903 2014-07-03 Joseph Pecoraro <pecoraro@apple.com>
2905 Unreviewed iOS build fix for r170774.
2907 Remove some unnecessary WTF::moves on iOS:
2908 error: static_assert failed "T is not an lvalue reference; move() is unnecessary."
2910 * WebProcess/WebPage/EventDispatcher.cpp:
2911 (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
2912 (WebKit::EventDispatcher::touchEvent):
2914 2014-07-03 Anders Carlsson <andersca@apple.com>
2916 Try to fix the iOS build.
2918 Add WebPageProxyCocoa.mm for code shared between iOS and OS X. Put the recent searches save/restore code there.
2920 * UIProcess/Cocoa/WebPageProxyCocoa.mm: Added.
2921 (WebKit::autosaveKey):
2922 (WebKit::WebPageProxy::saveRecentSearches):
2923 (WebKit::WebPageProxy::loadRecentSearches):
2924 * UIProcess/mac/WebPageProxyMac.mm:
2925 * WebKit2.xcodeproj/project.pbxproj:
2927 2014-07-03 Dan Bernstein <mitz@apple.com>
2929 <rdar://problem/16337741> The UI process needs to track the number of HTTP subresource loads in progress (or at least whether there are any)
2930 https://bugs.webkit.org/show_bug.cgi?id=134615
2932 Reviewed by Anders Carlsson.
2934 Added a _networkRequestsInProgress boolean property to WKWebView.
2936 * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
2937 PageLoadStateObserver member functions.
2939 * UIProcess/API/Cocoa/WKWebView.mm:
2940 (-[WKWebView _networkRequestsInProgress]): New getter that gets this state from the
2942 * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property.
2944 * UIProcess/Cocoa/NavigationState.h:
2945 * UIProcess/Cocoa/NavigationState.mm:
2946 (WebKit::NavigationState::willChangeNetworkRequestsInProgress):: Override this new
2947 PageLoadState::Observer member function by sending the appropriate KVO change message to the
2949 (WebKit::NavigationState::didChangeNetworkRequestsInProgress): Ditto.
2951 * UIProcess/PageLoadState.cpp:
2952 (WebKit::PageLoadState::commitChanges): Check for changes to networkRequestsInProgress
2953 and call the observers if needed.
2954 (WebKit::PageLoadState::reset): Reset networkRequestsInProgress in the uncommitted state.
2955 (WebKit::PageLoadState::setNetworkRequestsInProgress): Set networkRequestsInProgress in the
2957 * UIProcess/PageLoadState.h:
2958 (WebKit::PageLoadState::networkRequestsInProgress): Added this getter.
2959 (WebKit::PageLoadState::Data::Data): Initialize new networkRequestsInProgress member.
2961 * UIProcess/WebPageProxy.cpp:
2962 (WebKit::WebPageProxy::setNetworkRequestsInProgress): Added. Updates the PageLoadState.
2963 * UIProcess/WebPageProxy.h:
2964 * UIProcess/WebPageProxy.messages.in: Added SetNetworkRequestsInProgress message.
2966 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2967 (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Call
2968 WebPage::addResourceRequest.
2969 (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): Call
2970 WebPage::removeResourceRequest.
2971 (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): Ditto.
2973 * WebProcess/WebPage/WebPage.cpp:
2974 (WebKit::WebPage::addResourceRequest): Added. If the new request is for an HTTP-family URL,
2975 add its identifier to the set of network resourece request identifiers. If the set was
2976 previously empty, send the WebPageProxy a message.
2977 (WebKit::WebPage::removeResourceRequest): Added. Remove the identifier from the set. If it
2978 becomes empty, send the WebPageProxy a message.
2979 * WebProcess/WebPage/WebPage.h:
2981 2014-07-03 Anders Carlsson <andersca@apple.com>
2983 Remove two unused functions
2984 https://bugs.webkit.org/show_bug.cgi?id=134614
2986 Reviewed by Andreas Kling.
2988 * UIProcess/LegacySessionStateCoding.h:
2989 * UIProcess/mac/LegacySessionStateCoding.cpp:
2990 (WebKit::encodeLegacySessionHistoryEntryData): Deleted.
2991 (WebKit::decodeLegacySessionHistoryEntryData): Deleted.
2993 2014-07-03 Daniel Bates <dabates@apple.com>
2996 https://bugs.webkit.org/show_bug.cgi?id=134500
2998 Rubber-stamped by Anders Carlsson.
3000 Substitute WTF::move() for std::move().
3002 * DatabaseProcess/DatabaseProcess.cpp:
3003 * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
3004 * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
3005 * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3006 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3007 * Platform/IPC/ArgumentCoders.h:
3008 * Platform/IPC/ArgumentDecoder.cpp:
3009 * Platform/IPC/Connection.cpp:
3010 * Platform/IPC/Connection.h:
3013 2014-07-03 Benjamin Poulain <bpoulain@apple.com>
3015 [iOS][WK2] Fix small bugs of dynamicViewportSizeUpdate that were causing inaccuracies in the computed target
3016 https://bugs.webkit.org/show_bug.cgi?id=134582
3018 Reviewed by Tim Horton.
3020 This patch fixes two small bugs that were causing "jumpiness" on animated resize:
3021 1) The new scale was less accurate than the target scale, making the WebProcess force a worse scale on the content.
3022 2) The code putting back the rects in view was ignoring the obscured insets, constraining the scroll position more
3025 The first problem was cause by a series of rounding issues accumulating to the fact that "scale != targetScale"
3026 was almost never true.
3028 The first issue is that the unobscured content size was stored in integer coordinates. Because of that, it was
3029 impossible to determine accurately how much content is in the view.
3030 The outcome was that visibleHorizontalFraction was very inaccurate compared to what the UIProcess computed.
3032 Another issue affecting the scale is that scaleAfterViewportWidthChange was computing the widthToKeepInView
3033 on floating point. Since ARM64 does all those computations on doubles in the UIProcess, the value would be quite
3034 different from the received targetScale.
3036 Finally, the code uses withinEpsilon() instead of a strict equality to reduce the effect of rounding errors.
3038 For the second issue, the problem was that I was bounding the exposed rect to the page bounds. It is completely
3039 valid to have an exposed rect outside the page bounds, that area is just under the obscured insets.
3041 On the other hand, the unobscured rect needs to be within the bounds as we do not want to rotate to a rubberbanding
3042 position. The fix is simply to put the right rect into bounds, and the horizontal/vertical adjustement applies on
3045 * WebProcess/WebPage/ios/WebPageIOS.mm:
3046 (WebKit::scaleAfterViewportWidthChange):
3047 (WebKit::WebPage::dynamicViewportSizeUpdate):
3048 (WebKit::WebPage::updateVisibleContentRects):
3050 2014-07-03 Anders Carlsson <andersca@apple.com>
3054 * UIProcess/mac/WebPageProxyMac.mm:
3056 2014-07-03 Anders Carlsson <andersca@apple.com>
3058 Get rid of WebPageProxyCF.cpp
3059 https://bugs.webkit.org/show_bug.cgi?id=134609
3061 Reviewed by Dan Bernstein.
3063 * UIProcess/cf/WebPageProxyCF.cpp: Removed.
3064 * UIProcess/mac/WebPageProxyMac.mm:
3065 (WebKit::autosaveKey):
3066 (WebKit::WebPageProxy::saveRecentSearches):
3067 (WebKit::WebPageProxy::loadRecentSearches):
3068 * WebKit2.xcodeproj/project.pbxproj:
3070 2014-07-03 Tim Horton <timothy_horton@apple.com>
3072 [WK2] Revise the flat find indicator secondary highlight shadows
3073 https://bugs.webkit.org/show_bug.cgi?id=134607
3074 <rdar://problem/17554828>
3076 Reviewed by Brady Eidson.
3078 * WebProcess/WebPage/FindController.cpp:
3079 (WebKit::FindController::drawRect):
3080 Bring back the secondary highlight shadow, with new constants.
3082 2014-07-03 Tim Horton <timothy_horton@apple.com>
3084 [iOS][WK2] Sometimes the swipe snapshot stays up too long
3085 https://bugs.webkit.org/show_bug.cgi?id=134506
3086 <rdar://problem/17496803>
3088 Reviewed by Simon Fraser.
3090 Implement a transaction callback mechanism.
3091 The UI process can register a callback at any point, generally immediately after sending a message to the Web process.
3092 It will then send another message (in-order) with the callback ID to the Web process, which will put it into the next transaction
3093 (scheduling a new one if needed). When the transaction comes back to the UI process, the callbacks are performed.
3094 This ensures that the callback fires alongside a commit that includes the results of whatever messages were sent before it was registered.
3095 For now, all callbacks are fired just before committing layer changes, but it's possible future patches will want post-commit callbacks.
3097 Make use of this to remove the ViewGestureControllerIOS snapshots at the right time.
3099 * Shared/mac/RemoteLayerTreeTransaction.h:
3100 (WebKit::RemoteLayerTreeTransaction::callbackIDs):
3101 (WebKit::RemoteLayerTreeTransaction::setCallbackIDs):
3102 * Shared/mac/RemoteLayerTreeTransaction.mm:
3103 (WebKit::RemoteLayerTreeTransaction::encode):
3104 (WebKit::RemoteLayerTreeTransaction::decode):
3105 Add a vector of callback IDs to the transaction; encode and decode as appropriate.
3107 * UIProcess/DrawingAreaProxy.h:
3108 (WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing):
3109 (WebKit::DrawingAreaProxy::lastVisibleTransactionID): Deleted.
3110 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3111 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3112 (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
3113 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3114 (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3115 Add dispatchAfterEnsuringDrawing, which takes a function.
3116 When a callback is added, we send the callback ID to the Web process via the AddTransactionCallbackID message.
3117 Perform callbacks listed in the incoming transaction's vector of callback IDs.
3119 * WebProcess/WebPage/DrawingArea.h:
3120 (WebKit::DrawingArea::addTransactionCallbackID):
3121 * WebProcess/WebPage/DrawingArea.messages.in:
3122 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3123 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3124 (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3125 (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
3126 Keep track of the pending callback IDs on the drawing area, and move them into the transaction.
3127 We schedule a flush when installing a transaction callback on the premise that
3128 sometimes the action (goToBackForwardListItem in the swipe case) might have already occurred
3129 and been committed by the time the Web process receives AddTransactionCallbackID, so we need
3130 to cause another commit to send the callbacks across. If said commit is still pending, this is a no-op.
3132 * UIProcess/ios/ViewGestureControllerIOS.mm:
3133 (allViewGestureControllers):
3134 (WebKit::ViewGestureController::ViewGestureController):
3135 (WebKit::ViewGestureController::~ViewGestureController):
3136 (WebKit::ViewGestureController::endSwipeGesture):
3137 (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
3138 (WebKit::ViewGestureController::setRenderTreeSize):
3139 * UIProcess/mac/ViewGestureController.h:
3140 Keep a side-map of page IDs to ViewGestureControllers, so that we can safely get back to
3141 our ViewGestureController from the callback.
3143 When the callback fires, if it succeeded, set m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit,
3144 so that the commit (which is about to occur immediately after the callback returns) which calls
3145 setRenderTreeSize will (perhaps) remove the snapshot.
3147 If it failed, we remove the snapshot immediately, as this usually happens if the Web process crashed.
3149 2014-07-03 Brady Eidson <beidson@apple.com>
3151 Followup to "rects sent to ServicesOverlayController are wrong"
3152 https://bugs.webkit.org/show_bug.cgi?id=134568
3154 Rubberstamped by Tim Horton.
3156 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
3157 (WebKit::ServicesOverlayController::drawSelectionHighlight): Don’t check to see if the
3158 proposed rect intersects the dirty rect. We always need to include all rects that form
3159 the selection when creating the DDHighlight.
3161 2014-07-03 Tim Horton <timothy_horton@apple.com>
3163 [WK2] RemoteLayerTreeDrawingAreaProxy re-checks a preference every commit for no reason
3164 https://bugs.webkit.org/show_bug.cgi?id=134586
3166 Reviewed by Benjamin Poulain.
3168 * UIProcess/DrawingAreaProxy.h:
3169 (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator):
3170 (WebKit::DrawingAreaProxy::showDebugIndicator): Deleted.
3171 (WebKit::DrawingAreaProxy::isShowingDebugIndicator): Remove this, nobody is using it.
3172 * UIProcess/WebPageProxy.cpp:
3173 (WebKit::WebPageProxy::preferencesDidChange):
3174 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3175 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3176 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
3177 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3178 (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator):
3179 (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): Deleted.
3180 Check the debug indicator pref at construction time, and update the state when it changes.
3181 Checking it every commit was surprisingly expensive.
3183 2014-07-03 Antti Koivisto <antti@apple.com>
3185 Ensure frame creation messages get through to UI process
3186 https://bugs.webkit.org/show_bug.cgi?id=134591
3187 <rdar://problem/16918218>
3189 Reviewed by Anders Carlsson.
3191 If we are middle of handling a synchronous message from UI process a frame creation message back gets delayed.
3192 The subsequent synchronous DecidePolicyForNavigationAction message expects that the frame creation
3193 message has arrived first and fails.
3195 * WebProcess/WebPage/WebFrame.cpp:
3196 (WebKit::WebFrame::createWithCoreMainFrame):
3197 (WebKit::WebFrame::createSubframe):
3199 Send messages with DispatchMessageEvenWhenWaitingForSyncReply so they always go through in order.
3201 2014-07-03 Anders Carlsson <andersca@apple.com>
3203 Get rid of DecoderAdapter and EncoderAdapter
3204 https://bugs.webkit.org/show_bug.cgi?id=134598
3206 Reviewed by Andreas Kling.
3209 * WebKit2.xcodeproj/project.pbxproj:
3210 * WebProcess/WebPage/DecoderAdapter.cpp: Removed.
3211 * WebProcess/WebPage/DecoderAdapter.h: Removed.
3212 * WebProcess/WebPage/EncoderAdapter.cpp: Removed.
3213 * WebProcess/WebPage/EncoderAdapter.h: Removed.
3214 * WebProcess/WebPage/WebPage.cpp:
3216 2014-07-02 Anders Carlsson <andersca@apple.com>
3218 Stop using EncoderAdapter/DecoderAdapter for FormData
3219 https://bugs.webkit.org/show_bug.cgi?id=134571
3221 Reviewed by Andreas Kling.
3223 * Shared/Network/NetworkResourceLoadParameters.cpp:
3224 (WebKit::NetworkResourceLoadParameters::encode):
3225 (WebKit::NetworkResourceLoadParameters::decode):
3227 2014-07-03 Brady Eidson <beidson@apple.com>
3229 Selection rects sent to ServicesOverlayController are wrong.
3230 <rdar://problem/16727796> and https://bugs.webkit.org/show_bug.cgi?id=134568
3232 Reviewed by Darin Adler (and Tim Horton and Ryosuke Niwa).
3234 * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3235 (WebKit::WebEditorClient::selectionRectsDidChange): Also pass the GapRects to the ServicesOverlayController.
3236 * WebProcess/WebCoreSupport/WebEditorClient.h:
3238 * WebProcess/WebPage/ServicesOverlayController.h:
3239 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
3240 (WebKit::expandForGap):
3241 (WebKit::compactRectsWithGapRects): Combine 3+ rects down to exactly 3 rects, then expand them based on GapRects.
3242 (WebKit::ServicesOverlayController::selectionRectsDidChange): Call compactRectsWithGapRects, then reverse the list.
3243 (WebKit::ServicesOverlayController::drawSelectionHighlight): Tell data detectors to flip this.
3244 (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Tell data detectors to flip this.
3245 (WebKit::ServicesOverlayController::drawCurrentHighlight): No need to flip this anymore.
3247 2014-07-03 Brady Eidson <beidson@apple.com>
3249 Possible crash in IconDatabase in WebCore::IconDatabase::dispatchDidRemoveAllIconsOnMainThread
3250 <rdar://problem/17437687> and https://bugs.webkit.org/show_bug.cgi?id=134517
3252 Reviewed by Eric Carlson.
3254 * UIProcess/WebContext.cpp:
3255 (WebKit::WebContext::~WebContext): Instead of directly deref’ing the WebIconDatabase, ask it to
3256 deref itself when appropriate.
3258 * UIProcess/WebIconDatabase.cpp:
3259 (WebKit::WebIconDatabase::WebIconDatabase):
3260 (WebKit::WebIconDatabase::didClose): If this WebIconDatabase is supposed to deref itself when
3261 appropriate, do so now.
3262 (WebKit::WebIconDatabase::derefWhenAppropriate): If the WebCore::IconDatabase is still open then
3264 * UIProcess/WebIconDatabase.h:
3266 2014-07-03 Carlos Garcia Campos <cgarcia@igalia.com>
3268 REGRESSION(r170676): [GTK] UI process crashes when the Web Process crashes
3269 https://bugs.webkit.org/show_bug.cgi?id=134541
3271 Reviewed by Gyuyoung Kim.
3273 It happens when attaching a new web process, because it tries to
3274 encode a null SessionState.
3276 * UIProcess/LegacySessionStateCodingNone.cpp:
3277 (WebKit::encodeLegacySessionState): Return an empty API::Data
3278 object instead of nullptr.
3279 (WebKit::encodeLegacySessionHistoryEntryData): Ditto.
3281 2014-07-03 Carlos Garcia Campos <cgarcia@igalia.com>
3283 REGRESSION(r170743): [GTK] [EFL] Build broken.
3284 https://bugs.webkit.org/show_bug.cgi?id=134585
3286 Reviewed by Philippe Normand.
3288 Add ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC) guards where needed.
3290 * WebProcess/Plugins/PluginView.cpp:
3291 (WebKit::PluginView::initializePlugin):
3292 * WebProcess/WebPage/WebPage.cpp:
3293 (WebKit::WebPage::createPlugin):
3295 2014-07-02 Benjamin Poulain <benjamin@webkit.org>
3297 [iOS][WK2] Make is safe/fast to use the animated resize API without resizing anything
3298 https://bugs.webkit.org/show_bug.cgi?id=134570
3300 Reviewed by Enrica Casucci.
3302 Today, if someone calls _beginAnimatedResizeWithUpdates-_endAnimatedResize, it is always a very heavy process
3303 forcing a relayout and can cause synchronous operations.
3305 We should not force the caller of the API to maintain their own state tracking, we should do that for them.
3307 With this patch, we track everything we need for a resize and only do the heavy lifting if anything has actually changed.
3309 * UIProcess/API/Cocoa/WKWebView.mm:
3310 (activeMinimumLayoutSize):
3311 (activeMinimumLayoutSizeForMinimalUI):
3312 (activeMaximumUnobscuredSize):
3313 (activeOrientation):
3314 This code is used in both _didRelaunchProcess and _beginAnimatedResizeWithUpdates. It is moved to static functions
3315 to avoid having it in two places.
3317 (-[WKWebView _didRelaunchProcess]):
3319 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3320 The updates now goes like this:
3321 1) Set _isAnimatingResize to prevent the undesired side effects updateBlock() if we really need to resize.
3322 2) Get all the original values before calling the update block.
3323 3) Call the update block.
3324 4a) If nothing useful for resize has changed, reset _isAnimatingResize to false.
3325 We also need to update the visible content rect because the update block may have changed something unrelated
3326 to the view size (scale, scroll position, etc).
3327 4b) If we really need to resize, proceed as usual.
3329 (-[WKWebView _endAnimatedResize]):
3330 With the changes in _beginAnimatedResizeWithUpdates:, _isAnimatingResize is only set for real cases of animated resize,
3331 bail out early if that flag isn't set.
3333 The remaining code is unchanged, it is just not indented due to the removal of the if() branch.
3335 2014-07-02 Roger Fong <roger_fong@apple.com>
3337 Improve handling of primary offscreen plugins.
3338 https://bugs.webkit.org/show_bug.cgi?id=134528.
3339 <rdar://problem/17471864>
3341 Reviewed by Dean Jackson.
3343 * WebProcess/Plugins/PluginView.cpp:
3344 Determine whether or not the plugin starts offscreen when the plugin is initialized.
3345 (WebKit::PluginView::initializePlugin):
3346 (WebKit::PluginView::pluginSnapshotTimerFired):
3347 * WebProcess/WebPage/WebPage.cpp:
3348 (WebKit::WebPage::createPlugin):
3349 Use the PluginProcessTypeNormal for offscreen plugins that are potentially primary plugins.
3351 2014-07-02 Enrica Casucci <enrica@apple.com>
3353 REGRESSION(WK2): Undo does not work in text fields in Safari.
3354 https://bugs.webkit.org/show_bug.cgi?id=134572
3355 <rdar://problem/17542238>
3357 Reviewed by Benjamin Poulain.
3359 This patch adds for iOS the same implementation we have already for OS X.
3361 * UIProcess/ios/PageClientImplIOS.h:
3362 * UIProcess/ios/PageClientImplIOS.mm:
3363 (-[WKEditCommandObjC initWithWebEditCommandProxy:]):
3364 (-[WKEditCommandObjC command]):
3365 (-[WKEditorUndoTargetObjC undoEditing:]):
3366 (-[WKEditorUndoTargetObjC redoEditing:]):
3367 (WebKit::PageClientImpl::PageClientImpl):
3368 (WebKit::PageClientImpl::registerEditCommand):
3369 (WebKit::PageClientImpl::clearAllEditCommands):
3370 (WebKit::PageClientImpl::canUndoRedo):
3371 (WebKit::PageClientImpl::executeUndoRedo):
3373 2014-07-02 Gavin Barraclough <baraclough@apple.com>
3375 ProcessAssertion should also prevent UIApp suspension
3376 https://bugs.webkit.org/show_bug.cgi?id=134563
3378 Reviewed by Dan Bernstein.
3380 If the application suspends then the child processes will, too.
3381 Use beginBackgroundTaskWithName:expirationHandler: to request that the application remain runnable
3382 while waiting for background tasks to complete.
3384 * UIProcess/ProcessAssertion.cpp:
3385 (WebKit::ProcessAssertion::~ProcessAssertion):
3387 * UIProcess/ProcessAssertion.h:
3389 * UIProcess/ios/ProcessAssertionIOS.mm:
3390 (+[WKProcessAssertionBackgroundTaskManager shared]):
3391 - singleton WKProcessAssertionBackgroundTaskManager.
3392 (-[WKProcessAssertionBackgroundTaskManager init]):
3393 (-[WKProcessAssertionBackgroundTaskManager dealloc]):
3394 - register/remove notification handlers.
3395 (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
3396 - if we need to be runnable make sure we're holding a BackgroundTask, if not release it.
3397 (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackgroundOrWillEnterForeground:]):
3398 - detect when the app enters/leaves foreground; calls to _updateBackgroundTask.
3399 (-[WKProcessAssertionBackgroundTaskManager incrementNeedsToRunInBackgroundCount]):
3400 (-[WKProcessAssertionBackgroundTaskManager decrementNeedsToRunInBackgroundCount]):
3401 - interface to update the count; calls to _updateBackgroundTask.
3402 (WebKit::ProcessAssertion::ProcessAssertion):
3403 (WebKit::ProcessAssertion::~ProcessAssertion):
3404 - count ProcessAssertions in and out of existance.
3405 (WebKit::ProcessAssertion::setState):
3406 - count when the state changes.
3408 2014-07-01 Mark Rowe <mrowe@apple.com>
3410 <https://webkit.org/b/134522> Remove duplication in code that prepares the user agent string on Mac and iOS
3412 Reviewed by Simon Fraser.
3414 * UIProcess/ios/WebPageProxyIOS.mm:
3415 (WebKit::webKitBundleVersionString): Return the entire CFBundleVersion now that WebCore handles formatting it.
3416 (WebKit::WebPageProxy::standardUserAgent):
3417 * UIProcess/mac/WebPageProxyMac.mm:
3418 (WebKit::webKitBundleVersionString): Ditto.
3419 (WebKit::WebPageProxy::standardUserAgent):
3421 2014-06-28 Oliver Hunt <oliver@apple.com>
3423 Restrict network process sandbox
3424 https://bugs.webkit.org/show_bug.cgi?id=134360
3426 Reviewed by Sam Weinig.
3428 Add more restrictions to the network process sandbox.
3430 * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3431 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3432 Always use the cache directory provided in the initialization parameters,
3433 and make sure we consume the cookie directory extension.
3434 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3435 Make the sandbox profile much more restrictive.
3436 * Shared/Network/NetworkProcessCreationParameters.cpp:
3437 (WebKit::NetworkProcessCreationParameters::encode):
3438 (WebKit::NetworkProcessCreationParameters::decode):
3439 * Shared/Network/NetworkProcessCreationParameters.h: