1 2014-07-14 Tim Horton <timothy_horton@apple.com>
3 [iOS] Throttle painting using a UI-process-side CADisplayLink
4 https://bugs.webkit.org/show_bug.cgi?id=134879
5 <rdar://problem/17641699>
7 Reviewed by Simon Fraser.
9 Just waiting for CA to commit is insufficient to actually throttle to 60fps,
10 because nothing will block the main runloop from spinning.
12 Instead, listen to a CADisplayLink, and send didUpdate to the WebProcess
13 the first time it fires after we commit. This is not a guarantee that
14 our content is on the screen, but we don't have any way to make that guarantee yet.
16 This will throttle painting, rAF, etc. to the display refresh rate.
18 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
19 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
20 (-[OneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
21 (-[OneShotDisplayLinkHandler dealloc]):
22 (-[OneShotDisplayLinkHandler displayLinkFired:]):
23 (-[OneShotDisplayLinkHandler invalidate]):
24 (-[OneShotDisplayLinkHandler schedule]):
25 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
26 (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
27 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
28 (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
29 (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): Deleted.
31 2014-07-14 Dan Bernstein <mitz@apple.com>
33 <rdar://problem/17657391> [iOS] Networking process writes persistent credentials to the keychain
34 https://bugs.webkit.org/show_bug.cgi?id=134878
36 Reviewed by Sam Weinig.
38 Route CFNetwork’s calls to Security API through to the UI process.
40 * NetworkProcess/ios/NetworkProcessIOS.mm:
41 (WebKit::NetworkProcess::platformInitializeNetworkProcess): Initialize SecItemShim.
43 * Shared/mac/SecItemShim.cpp:
44 (WebKit::SecItemShim::initialize): On iOS, rather than using a shim library, supply
45 CFNetwork with alternate functions to call.
47 * Shared/mac/SecItemShim.messages.in: Removed #if !PLATFORM(IOS).
48 * UIProcess/mac/SecItemShimProxy.messages.in: Ditto.
50 * config.h: Define ENABLE_SEC_ITEM_SHIM to 1 on iOS as well.
52 2014-07-14 Dan Bernstein <mitz@apple.com>
54 <rdar://problem/17398060> NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
55 https://bugs.webkit.org/show_bug.cgi?id=134666
57 Reviewed by Tim Horton.
59 A SecItem may have an attribute whose value is a SecAccessControlRef, which is not supported
60 by ArgumentCodersCF. In debug builds, trying to encode a CFDictionary containing a value of
61 unsupprted type causes an assertion to fail, but in release builds encoding succeeds, and
62 only decoding fails, in this case silently, simply not delivering the
63 SecItemShim::secItemResponse message.
65 The fix is to teach ArgumentCodersCF about SecAccessControlRef.
67 * Shared/cf/ArgumentCodersCF.cpp:
68 (IPC::typeFromCFTypeRef): Check for the SecAccessControlRef type.
69 (IPC::encode): Encode the SecAccessControl serialized into CFData.
70 (IPC::decode): Deserialize a SecAccessControl from the decoded CFData.
71 * Shared/cf/ArgumentCodersCF.h:
72 * config.h: Defined HAVE_SEC_ACCESS_CONTROL.
74 2014-07-13 Dan Bernstein <mitz@apple.com>
76 <rdar://problem/17295636> [Cocoa] Include element snapshot in _WKActivatedElementInfo
77 https://bugs.webkit.org/show_bug.cgi?id=134872
79 Reviewed by Sam Weinig.
81 * Shared/InteractionInformationAtPosition.cpp:
82 (WebKit::InteractionInformationAtPosition::encode): Encode the image if there is one.
83 (WebKit::InteractionInformationAtPosition::decode): Decode the image if there is one.
84 * Shared/InteractionInformationAtPosition.h: Added an image member to the struct.
86 * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: Exposed the boundingRect property and added
88 * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
89 (-[_WKActivatedElementInfo _initWithType:URL:location:title:rect:image:]): Added an image
90 parameter, which is stored in a new ivar.
91 (-[_WKActivatedElementInfo image]): Added this getter, which converts the ShareableBitmap
92 into a cached Cocoa image and returns it.
93 * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: Added image parameter to the
94 initializer, removed _boundingRect property declaration from here.
96 * UIProcess/ios/WKActionSheetAssistant.mm:
97 (-[WKActionSheetAssistant showImageSheet]): Pass the image from the position information
98 into the _WKActivatedElementInfo initializer.
99 (-[WKActionSheetAssistant showLinkSheet]): Ditto.
101 * WebProcess/WebPage/WebPage.cpp:
102 (WebKit::WebPage::snapshotNode): Added.
103 * WebProcess/WebPage/WebPage.h:
105 * WebProcess/WebPage/ios/WebPageIOS.mm:
106 (WebKit::WebPage::getPositionInformation): If the element is a link or an image, store a
107 snapshot of it in the image member of the InteractionInformationAtPosition.
109 2014-07-13 Dan Bernstein <mitz@apple.com>
111 [Cocoa] Clean up session state API a little
112 https://bugs.webkit.org/show_bug.cgi?id=134871
114 Reviewed by Darin Adler.
116 * UIProcess/API/Cocoa/WKWebView.mm:
117 (-[WKWebView _sessionState]):
118 (-[WKWebView _restoreFromSessionState:]): Deleted.
119 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
121 2014-07-13 Javier Fernandez <jfernandez@igalia.com>
123 REGRESSION(r171045) [GTK] Build broken.
124 https://bugs.webkit.org/show_bug.cgi?id=134867
126 Unreviewed GTK build fix after r171045.
128 * UIProcess/API/gtk/PageClientImpl.cpp:
129 (WebKit::PageClientImpl::willRecordNavigationSnapshot):
130 * UIProcess/API/gtk/PageClientImpl.h:
132 2014-07-13 Gyuyoung Kim <gyuyoung.kim@samsung.com>
134 Unreviewed, EFL build fix since r171045.
136 * UIProcess/CoordinatedGraphics/WebView.h:
138 2014-07-12 Dan Bernstein <mitz@apple.com>
140 [Cocoa] Notify the client when a navigation snapshot is taken
141 https://bugs.webkit.org/show_bug.cgi?id=134865
143 Reviewed by Sam Weinig.
145 * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
147 * UIProcess/Cocoa/NavigationState.h:
148 * UIProcess/Cocoa/NavigationState.mm:
149 (WebKit::NavigationState::setNavigationDelegate): Initialize new flag in
150 m_navigationDelegateMethods.
151 (WebKit::NavigationState::willRecordNavigationSnapshot): Added. Calls the new
152 WKNavigationDelegate method.
154 * UIProcess/PageClient.h: Declared new client function.
156 * UIProcess/WebPageProxy.cpp:
157 (WebKit::WebPageProxy::willRecordNavigationSnapshot): Added. Calls the new client function.
158 * UIProcess/WebPageProxy.h:
160 * UIProcess/ios/PageClientImplIOS.h:
161 * UIProcess/ios/PageClientImplIOS.mm:
162 (WebKit::PageClientImpl::willRecordNavigationSnapshot): Override that calls
163 NavigationState::willRecordNavigationSnapshot.
165 * UIProcess/mac/PageClientImpl.h:
166 * UIProcess/mac/PageClientImpl.mm:
167 (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
169 * UIProcess/mac/ViewSnapshotStore.mm:
170 (WebKit::ViewSnapshotStore::recordSnapshot): Added a call to
171 WebPageProxy::willRecordNavigationSnapshot.
173 2014-07-12 Gyuyoung Kim <gyuyoung.kim@samsung.com>
175 Unreviewed, fix EFL build break since r171034.
177 * UIProcess/CoordinatedGraphics/WebView.h:
178 * UIProcess/efl/WebContextEfl.cpp:
179 (WebKit::WebContext::platformMediaCacheDirectory):
181 2014-07-12 Darin Adler <darin@apple.com>
183 Try to fix 32-bit Mac build.
185 * UIProcess/mac/PageClientImpl.mm:
186 (WebKit::PageClientImpl::navigationGestureDidBegin): Added WK_API_ENABLED conditional.
187 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
188 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
190 2014-07-12 Javier Fernandez <jfernandez@igalia.com>
192 REGRESSION(r171034) [GTK] Build broken.
193 https://bugs.webkit.org/show_bug.cgi?id=134861
195 Unreviewed GTK build fix.
197 * UIProcess/API/gtk/PageClientImpl.cpp:
198 (WebKit::PageClientImpl::navigationGestureDidBegin):
199 (WebKit::PageClientImpl::navigationGestureWillEnd):
200 (WebKit::PageClientImpl::navigationGestureDidEnd):
201 * UIProcess/API/gtk/PageClientImpl.h:
203 2014-07-12 Javier Fernandez <jfernandez@igalia.com>
205 REGRESSION(r171024) [GTK] Build broken.
206 https://bugs.webkit.org/show_bug.cgi?id=134859
208 Unreviewed GTK build fix.
210 * UIProcess/gtk/WebContextGtk.cpp:
211 (WebKit::WebContext::platformMediaCacheDirectory):
213 2014-07-12 Dan Bernstein <mitz@apple.com>
215 <rdar://problem/16020380> [Cocoa] Inform the client when back-forward navigation gestures begin and end
216 https://bugs.webkit.org/show_bug.cgi?id=134853
218 Reviewed by Sam Weinig.
220 * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new WKNavigationDelegate
223 * UIProcess/API/Cocoa/WKWebView.mm:
224 (-[WKWebView _isShowingNavigationGestureSnapshot]): Added this getter.
226 * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property
227 _isShowingNavigationGestureSnapshot.
229 * UIProcess/Cocoa/NavigationState.h:
230 * UIProcess/Cocoa/NavigationState.mm:
231 (WebKit::NavigationState::setNavigationDelegate): Initialize new flags in
232 m_navigationDelegateMethods.
233 (WebKit::NavigationState::navigationGestureDidBegin): Added. Calls the new
234 WKNavigationDelegate method.
235 (WebKit::NavigationState::navigationGestureWillEnd): Ditto.
236 (WebKit::NavigationState::navigationGestureDidEnd): Ditto.
238 * UIProcess/PageClient.h: Declared new client functions.
240 * UIProcess/WebPageProxy.cpp:
241 (WebKit::WebPageProxy::WebPageProxy): Initialize new member variable.
242 (WebKit::WebPageProxy::navigationGestureDidBegin): Set m_isShowingNavigationGestureSnapshot
243 and call the new client function.
244 (WebKit::WebPageProxy::navigationGestureWillEnd): Call the new client function.
245 (WebKit::WebPageProxy::navigationGestureDidEnd): Ditto.
246 (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved): Clear
247 m_isShowingNavigationGestureSnapshot.
248 * UIProcess/WebPageProxy.h:
249 (WebKit::WebPageProxy::isShowingNavigationGestureSnapshot): Added this getter.
251 * UIProcess/ios/PageClientImplIOS.h: Declared overrides of new client functions.
252 * UIProcess/ios/PageClientImplIOS.mm:
253 (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
254 NavigationState function.
255 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
256 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
258 * UIProcess/ios/ViewGestureControllerIOS.mm:
259 (WebKit::ViewGestureController::beginSwipeGesture): Added calls to
260 WebPageProxy::navigationGestureDidBegin and WebPageProxy::navigationGestureWillEnd.
261 (WebKit::ViewGestureController::endSwipeGesture): Added calls to
262 WebPageProxy::navigationGestureDidEnd.
263 (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
264 WebPageProxy::navigationGestureSnapshotWasRemoved.
266 * UIProcess/mac/PageClientImpl.h: Declared overrides of new client functions.
267 * UIProcess/mac/PageClientImpl.mm:
268 (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
269 NavigationState function.
270 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
271 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
273 * UIProcess/mac/ViewGestureControllerMac.mm:
274 (WebKit::ViewGestureController::beginSwipeGesture): Added call to
275 WebPageProxy::navigationGestureDidBegin.
276 (WebKit::ViewGestureController::endSwipeGesture): Added calls to
277 WebPageProxy::navigationGestureDidEnd.
278 (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
279 WebPageProxy::navigationGestureSnapshotWasRemoved.
281 2014-07-12 Oliver Hunt <oliver@apple.com>
283 Fix typo in prior patch
284 https://bugs.webkit.org/show_bug.cgi?id=134858
286 Reviewed by Sam Weinig.
290 * UIProcess/mac/WebContextMac.mm:
291 (WebKit::WebContext::platformDefaultCookieStorageDirectory):
293 2014-07-12 Dan Bernstein <mitz@apple.com>
295 [Cocoa] Client is not notified of same-document navigations
296 https://bugs.webkit.org/show_bug.cgi?id=134855
298 Reviewed by Sam Weinig.
300 * UIProcess/API/APILoaderClient.h:
301 (API::LoaderClient::didSameDocumentNavigationForFrame): Added navigationID parameter.
303 * UIProcess/API/C/WKPage.cpp:
304 (WKPageSetPageLoaderClient): Ditto.
306 * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Added new enum and delegate method.
308 * UIProcess/Cocoa/NavigationState.h: Declare override of
309 API::LoaderClient::didSameDocumentNavigationForFrame. Added flag in
310 m_navigationDelegateMethods struct.
311 * UIProcess/Cocoa/NavigationState.mm:
312 (WebKit::NavigationState::setNavigationDelegate): Initialize new m_navigationDelegateMethods
314 (WebKit::toWKSameDocumentNavigationType): Added this helper to convert from internal to API
316 (WebKit::NavigationState::LoaderClient::didSameDocumentNavigationForFrame): Override to call
317 the delegate method, if implemented.
319 * UIProcess/WebPageProxy.cpp:
320 (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Added navigationID parameter,
321 which is forwarded to the client.
322 * UIProcess/WebPageProxy.h: Added navigationID parameter.
323 * UIProcess/WebPageProxy.messages.in: Ditto.
325 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
326 (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): Send the navigation ID.
327 (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): Ditto.
328 (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): Ditto.
329 (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): Ditto.
331 2014-07-12 Oliver Hunt <oliver@apple.com>
333 Extend WebContent sandbox to allow some extra access for frameworks
334 https://bugs.webkit.org/show_bug.cgi?id=134844
336 Reviewed by Sam Weinig.
338 Open up the webcontent sandbox a bit so that some external frameworks
341 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
342 * Shared/WebProcessCreationParameters.cpp:
343 (WebKit::WebProcessCreationParameters::encode):
344 (WebKit::WebProcessCreationParameters::decode):
345 * Shared/WebProcessCreationParameters.h:
346 * UIProcess/WebContext.cpp:
347 (WebKit::WebContext::createNewWebProcess):
348 (WebKit::WebContext::mediaCacheDirectory):
349 * UIProcess/WebContext.h:
350 * UIProcess/mac/WebContextMac.mm:
351 (WebKit::WebContext::platformMediaCacheDirectory):
352 * WebProcess/cocoa/WebProcessCocoa.mm:
353 (WebKit::WebProcess::platformInitializeWebProcess):
355 2014-07-12 Oliver Hunt <oliver@apple.com>
357 Temporary work around for <rdar://<rdar://problem/17513375>
358 https://bugs.webkit.org/show_bug.cgi?id=134848
360 Reviewed by Sam Weinig.
362 Temporarily work around <rdar://<rdar://problem/17513375> by
363 dropping the explicit cookie storage if it points out of the
366 * UIProcess/mac/WebContextMac.mm:
367 (WebKit::WebContext::platformDefaultCookieStorageDirectory):
369 2014-07-11 Enrica Casucci <enrica@apple.com>
371 Implement textStylingAtPosition in WK2.
372 https://bugs.webkit.org/show_bug.cgi?id=134843
373 <rdar://problem/17614981>
375 Reviewed by Benjamin Poulain.
377 Adding information about typing attributes to EditorState so
378 that we can implement textStylingAtPosition.
380 * Shared/EditorState.cpp:
381 (WebKit::EditorState::encode):
382 (WebKit::EditorState::decode):
383 * Shared/EditorState.h:
384 (WebKit::EditorState::EditorState):
385 * UIProcess/ios/WKContentViewInteraction.mm:
386 (-[WKContentView textStylingAtPosition:inDirection:]):
387 (-[WKContentView canPerformAction:withSender:]):
388 (-[WKContentView toggleBoldface:]):
389 (-[WKContentView toggleItalics:]):
390 (-[WKContentView toggleUnderline:]):
391 * WebProcess/WebPage/WebPage.cpp:
392 (WebKit::WebPage::editorState):
394 2014-07-11 Oliver Hunt <oliver@apple.com>
396 Tighten WebContent sandbox
397 https://bugs.webkit.org/show_bug.cgi?id=134834
399 Reviewed by Sam Weinig.
401 Define a much tighter sandbox profile for the WebContent process
403 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
405 2014-07-11 Antti Koivisto <antti@apple.com>
407 REGRESSION (r170163?): Web content shifts revealing space equivalent to the find bar when clicking a link while a phrase is targeted via Cmd+F
408 https://bugs.webkit.org/show_bug.cgi?id=134833
409 <rdar://problem/17580021>
411 Reviewed by Zalan Bujtas.
413 Some versions of OS X Safari can't handle the new unfreeze timing. Revert back to DidFirstLayout on Mac.
415 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
416 (WebKit::WebFrameLoaderClient::dispatchDidLayout):
418 2014-07-11 Zalan Bujtas <zalan@apple.com>
420 Subpixel layout: return integral results for offset*, client*, scroll* by default.
421 https://bugs.webkit.org/show_bug.cgi?id=134651
423 Reviewed by Simon Fraser.
425 Revert to returning integral values for Element.offset* client* scroll* by default.
426 Fractional values break number of sites(tight design) and JS frameworks(fail to handle fractional values).
428 Since snapped dimension depends on both the original point and the width/height of the box,
429 we need to call RenderBoxModelObject::pixelSnapped*() helpers, instead of round().
431 Covered by existing tests
433 * Shared/WebPreferencesDefinitions.h:
434 * UIProcess/API/C/WKPreferencesRefPrivate.h:
436 2014-07-10 Jinwoo Song <jinwoo7.song@samsung.com>
438 Unreviewed EFL build fix after r170970.
440 * UIProcess/efl/WebContextEfl.cpp:
441 (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
443 2014-07-10 Carlos Alberto Lopez Perez <clopez@igalia.com>
445 REGRESSION(r170970) REGRESSION(r170974): [GTK] Build broken.
446 https://bugs.webkit.org/show_bug.cgi?id=134825
448 Unreviewed GTK build fix.
450 * Shared/SessionState.h: Put ifdefs for ViewSnapshot on Mac port.
451 * Shared/WebBackForwardListItem.h: Idem.
452 * UIProcess/gtk/WebContextGtk.cpp:
453 (WebKit::WebContext::platformDefaultOpenGLCacheDirectory): Implement skeleton.
455 2014-07-10 Benjamin Poulain <bpoulain@apple.com>
457 [iOS][WK2] It should be safe to call WKContentViewInteraction's cleanupInteraction multiple times
458 https://bugs.webkit.org/show_bug.cgi?id=134820
460 Reviewed by Andreas Kling.
462 If a view is destroyed just after a crash, "cleanupInteraction" is called twice: once on crash,
465 The code handling _interactionViewsContainerView is using KVO to monitor transform changes. It is not safe
466 to remove the observer if we are not already observing on that view.
468 To solve the problem, this patch makes the cleanup actually remove the view so that setup and cleanup
469 are completely symmetrical. If cleanup is called twice, the second time would not enter the branch because
470 the view is already nil.
472 * UIProcess/ios/WKContentViewInteraction.mm:
473 (-[WKContentView setupInteraction]):
474 (-[WKContentView cleanupInteraction]):
476 2014-07-10 Simon Fraser <simon.fraser@apple.com>
478 [iOS WK2] Move WKInspectorHighlightView to its own file
479 https://bugs.webkit.org/show_bug.cgi?id=134819
481 Reviewed by Joseph Pecoraro.
483 WKInspectorHighlightView brought a lot of path/quad-related code into WKContentView.mm,
484 so move it into its own file.
486 * UIProcess/WKInspectorHighlightView.h: Added.
487 * UIProcess/WKInspectorHighlightView.mm: Added.
488 (-[WKInspectorHighlightView dealloc]):
489 (-[WKInspectorHighlightView _removeAllLayers]):
490 (-[WKInspectorHighlightView _createLayers:]):
491 (findIntersectionOnLineBetweenPoints):
495 (-[WKInspectorHighlightView _layoutForNodeHighlight:]):
496 (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
497 (-[WKInspectorHighlightView update:]):
498 * UIProcess/ios/WKContentView.mm:
499 (-[WKInspectorHighlightView initWithFrame:]): Deleted.
500 (-[WKInspectorHighlightView dealloc]): Deleted.
501 (-[WKInspectorHighlightView _removeAllLayers]): Deleted.
502 (-[WKInspectorHighlightView _createLayers:]): Deleted.
503 (findIntersectionOnLineBetweenPoints): Deleted.
504 (quadIntersection): Deleted.
505 (layerPathWithHole): Deleted.
506 (layerPath): Deleted.
507 (-[WKInspectorHighlightView _layoutForNodeHighlight:]): Deleted.
508 (-[WKInspectorHighlightView _layoutForRectsHighlight:]): Deleted.
509 (-[WKInspectorHighlightView update:]): Deleted.
510 * WebKit2.xcodeproj/project.pbxproj:
512 2014-07-10 Tim Horton <timothy_horton@apple.com>
514 REGRESSION (r170935): WKWebView is always transparent until the first layer tree commit
515 https://bugs.webkit.org/show_bug.cgi?id=134818
516 <rdar://problem/17632468>
518 Reviewed by Anders Carlsson.
520 * UIProcess/API/Cocoa/WKWebView.mm:
521 (scrollViewBackgroundColor):
522 r170935 made it so that we would initialize the scroll view background color to an
523 invalid color until the first layer tree commit. We should go with white instead.
525 2014-07-10 Enrica Casucci <enrica@apple.com>
527 Add a mechanism to notify the UIProcess when an editing command is done executing.
528 https://bugs.webkit.org/show_bug.cgi?id=134807
530 Reviewed by Tim Horton.
532 Some editing commands have an effect on some parts of the system that
533 run inside the UIProcess. A good example are the cursor movement commands
534 that require an update of the autocorrection/autosuggestion machinery.
535 This patch adds a way to reliably know when the command has been executed
536 in the WebProcess. A previous attempt at solving this problem was added in
537 r170858 and was partially reverted in r170948.
538 The change also removes the selectionWillChange notification added in r170858.
540 * UIProcess/PageClient.h:
541 * UIProcess/WebPageProxy.cpp:
542 (WebKit::WebPageProxy::editorStateChanged):
543 * UIProcess/WebPageProxy.h:
544 * UIProcess/ios/PageClientImplIOS.h:
545 * UIProcess/ios/PageClientImplIOS.mm:
546 (WebKit::PageClientImpl::selectionWillChange): Deleted.
547 * UIProcess/ios/WKContentViewInteraction.h:
548 * UIProcess/ios/WKContentViewInteraction.mm:
549 (-[WKContentView executeEditCommandWithCallback:]):
550 (-[WKContentView _moveUp:withHistory:]):
551 (-[WKContentView _moveDown:withHistory:]):
552 (-[WKContentView _moveLeft:withHistory:]):
553 (-[WKContentView _moveRight:withHistory:]):
554 (-[WKContentView _moveToStartOfWord:withHistory:]):
555 (-[WKContentView _moveToStartOfParagraph:withHistory:]):
556 (-[WKContentView _moveToStartOfLine:withHistory:]):
557 (-[WKContentView _moveToStartOfDocument:withHistory:]):
558 (-[WKContentView _moveToEndOfWord:withHistory:]):
559 (-[WKContentView _moveToEndOfParagraph:withHistory:]):
560 (-[WKContentView _moveToEndOfLine:withHistory:]):
561 (-[WKContentView _moveToEndOfDocument:withHistory:]):
562 (-[WKContentView _selectionWillChange]): Deleted.
563 * UIProcess/ios/WebPageProxyIOS.mm:
564 (WebKit::WebPageProxy::executeEditCommand):
565 (WebKit::WebPageProxy::notifySelectionWillChange): Deleted.
566 * WebProcess/WebPage/WebPage.h:
567 * WebProcess/WebPage/WebPage.messages.in:
568 * WebProcess/WebPage/ios/WebPageIOS.mm:
569 (WebKit::WebPage::executeEditCommandWithCallback):
571 2014-07-10 Joseph Pecoraro <pecoraro@apple.com>
573 [Mac] NSWindow warning: adding an unknown subview opening detached Inspector
574 https://bugs.webkit.org/show_bug.cgi?id=134813
576 Reviewed by Timothy Hatcher.
578 * UIProcess/mac/WebInspectorProxyMac.mm:
579 (WebKit::WebInspectorProxy::createInspectorWindow):
580 Use a selector that will avoid the warning message.
582 2014-07-10 Oliver Hunt <oliver@apple.com>
584 Remove use of container relative restrictions in the network process sandbox
585 https://bugs.webkit.org/show_bug.cgi?id=134816
587 Reviewed by Anders Carlsson.
589 As i'm tidying up the various sandboxes and that's meaning we
590 need to reduce some file restrictions in the network process.
592 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
594 2014-07-10 Pratik Solanki <psolanki@apple.com>
596 Unreviewed iOS build fix after r170974. Define id if building a non ObjC file.
598 * UIProcess/mac/ViewSnapshotStore.h:
600 2014-07-10 Tim Horton <timothy_horton@apple.com>
602 Store ViewSnapshots directly on the WebBackForwardListItem
603 https://bugs.webkit.org/show_bug.cgi?id=134667
604 <rdar://problem/17082639>
606 Reviewed by Dan Bernstein.
608 Make ViewSnapshot a refcounted class. Store it directly on the back-forward item
609 instead of in a side map referenced by UUID. Switch to a very simple LRU eviction model for now.
610 This fixes a ton of snapshot management bugs; for example, we would start throwing out snapshots
611 in the page that was actively being interacted with *first* when evicting snapshots, instead of
612 preferring older snapshots. Additionally, we would not throw away snapshots when back forward items
615 There is definitely room for improvement of the eviction mechanism, but this is closer to a time-tested implementation.
617 * Shared/SessionState.h:
618 Keep a ViewSnapshot instead of a UUID on the BackForwardListItemState.
620 * Shared/WebBackForwardListItem.h:
621 Fix some indented namespace contents.
623 (WebKit::WebBackForwardListItem::snapshot):
624 (WebKit::WebBackForwardListItem::setSnapshot):
625 (WebKit::WebBackForwardListItem::setSnapshotUUID): Deleted.
626 (WebKit::WebBackForwardListItem::snapshotUUID): Deleted.
627 Switch the snapshot getter/setter to operate on ViewSnapshots instead of UUIDs.
629 * UIProcess/API/Cocoa/WKWebView.mm:
630 (-[WKWebView _takeViewSnapshot]):
631 * UIProcess/API/Cocoa/WKWebViewInternal.h:
632 * UIProcess/API/mac/WKView.mm:
633 (-[WKView _takeViewSnapshot]):
634 * UIProcess/API/mac/WKViewInternal.h:
635 * UIProcess/PageClient.h:
636 * UIProcess/WebPageProxy.cpp:
637 (WebKit::WebPageProxy::takeViewSnapshot):
638 * UIProcess/WebPageProxy.h:
639 * UIProcess/ios/PageClientImplIOS.h:
640 * UIProcess/ios/PageClientImplIOS.mm:
641 (WebKit::PageClientImpl::takeViewSnapshot):
642 * UIProcess/mac/PageClientImpl.h:
643 * UIProcess/mac/PageClientImpl.mm:
644 (WebKit::PageClientImpl::takeViewSnapshot):
645 Adopt ViewSnapshot::create, return a PassRefPtr, and class-ify ViewSnapshot.
647 * UIProcess/ios/ViewGestureControllerIOS.mm:
648 (WebKit::ViewGestureController::beginSwipeGesture):
649 (WebKit::ViewGestureController::endSwipeGesture):
650 * UIProcess/mac/ViewGestureController.h:
651 * UIProcess/mac/ViewGestureControllerMac.mm:
652 (WebKit::ViewGestureController::shouldUseSnapshotForSize):
653 (WebKit::ViewGestureController::beginSwipeGesture):
654 (WebKit::ViewGestureController::endSwipeGesture):
655 Grab the ViewSnapshot directly from the WebBackForwardListItem, and adopt the new functions.
657 * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
658 (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
659 Rename discardSnapshots to discardSnapshotImages, because we're really only discarding
660 the images; the render tree size/background color "snapshot" remains and is useful.
662 * UIProcess/mac/ViewSnapshotStore.h:
663 (WebKit::ViewSnapshot::setRenderTreeSize):
664 (WebKit::ViewSnapshot::renderTreeSize):
665 (WebKit::ViewSnapshot::setBackgroundColor):
666 (WebKit::ViewSnapshot::backgroundColor):
667 (WebKit::ViewSnapshot::setDeviceScaleFactor):
668 (WebKit::ViewSnapshot::deviceScaleFactor):
669 (WebKit::ViewSnapshot::imageSizeInBytes):
670 (WebKit::ViewSnapshot::surface):
671 (WebKit::ViewSnapshot::size):
672 (WebKit::ViewSnapshot::creationTime):
673 Make ViewSnapshot a refcounted class.
674 Add create functions which take an image (or slot ID), and relevant sizes.
675 It is expected that a ViewSnapshot is created with an image, and it is only possible
676 to remove that image, never to replace it. A new ViewSnapshot is required in that case.
677 Add setters for things that ViewSnapshotStore sets on the snapshot after the PageClient
678 retrieves it from the view. Add getters for things that the ViewGestureControllers need.
680 Remove removeSnapshotImage, getSnapshot, and the snapshot map.
682 * UIProcess/mac/ViewSnapshotStore.mm:
683 (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
684 (WebKit::ViewSnapshotStore::didAddImageToSnapshot):
685 (WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
686 Manage m_snapshotCacheSize and m_snapshotsWithImages via didAddImageToSnapshot and willRemoveImageFromSnapshot.
687 willRemoveImageFromSnapshot will -always- be called before the ViewSnapshot is destroyed.
689 (WebKit::ViewSnapshotStore::pruneSnapshots):
690 Switch to a simple LRU eviction model. As previously mentioned, it's possible to do better, but
691 this is much less broken than the previous implementation.
693 (WebKit::ViewSnapshotStore::recordSnapshot):
694 (WebKit::ViewSnapshotStore::discardSnapshotImages):
695 (WebKit::ViewSnapshot::create):
696 (WebKit::ViewSnapshot::ViewSnapshot):
697 (WebKit::ViewSnapshot::~ViewSnapshot):
698 (WebKit::ViewSnapshot::hasImage):
699 (WebKit::ViewSnapshot::clearImage):
700 (WebKit::ViewSnapshot::asLayerContents):
701 If a surface is Empty when it comes back from being volatile, throw away the surface
702 and notify the Store to remove it from m_snapshotCacheSize (via clearImage()).
704 (WebKit::ViewSnapshotStore::removeSnapshotImage): Deleted.
705 (WebKit::ViewSnapshotStore::getSnapshot): Deleted.
706 (WebKit::ViewSnapshotStore::discardSnapshots): Deleted.
708 2014-07-10 Beth Dakin <bdakin@apple.com>
710 Need Setting/WKPreference that allows clients to prevent scrollbars from drawing
711 on a secondary thread
712 https://bugs.webkit.org/show_bug.cgi?id=134778
714 <rdar://problem/17595333>
716 Reviewed by Tim Horton.
718 This is a requirement for some types of performance tests.
721 * Shared/WebPreferencesDefinitions.h:
723 PDFPlugin has to implement this new ScrollableArea virtual function to indicate
725 * WebProcess/Plugins/PDF/PDFPlugin.h:
726 * WebProcess/Plugins/PDF/PDFPlugin.mm:
727 (WebKit::PDFPlugin::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
730 * WebProcess/WebPage/WebPage.cpp:
731 (WebKit::WebPage::updatePreferences):
733 2014-07-10 Tim Horton <timothy_horton@apple.com>
735 [iOS] Frequent assertion failures when swiping back
737 Reviewed by Dan Bernstein.
739 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
740 (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
741 Don't create an unused VoidCallback. It will assert when destroyed without being called.
743 2014-07-10 Oliver Hunt <oliver@apple.com>
745 Pass sandbox extension for GL cache over to webprocess
746 https://bugs.webkit.org/show_bug.cgi?id=134806
748 Reviewed by Anders Carlsson.
750 Add additional WebProcess parameters to pass an extension
751 that allows access to the opengl cache directory in the
752 host application's container.
754 * Shared/WebProcessCreationParameters.cpp:
755 (WebKit::WebProcessCreationParameters::encode):
756 (WebKit::WebProcessCreationParameters::decode):
757 * Shared/WebProcessCreationParameters.h:
758 * UIProcess/WebContext.cpp:
759 (WebKit::WebContext::createNewWebProcess):
760 (WebKit::WebContext::openGLCacheDirectory):
761 * UIProcess/WebContext.h:
762 * UIProcess/mac/WebContextMac.mm:
763 (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
764 * WebProcess/cocoa/WebProcessCocoa.mm:
765 (WebKit::WebProcess::platformInitializeWebProcess):
767 2014-07-10 Dan Bernstein <mitz@apple.com>
771 * WebProcess/WebPage/ServicesOverlayController.h:
773 2014-07-09 Brady Eidson <beidson@apple.com>
775 Phone number highlights should always be visible if the mouse hovers over.
776 <rdar://problem/17527476> and https://bugs.webkit.org/show_bug.cgi?id=134784
778 Reviewed by Tim Horton.
780 This is a fairly extensive rewrite of ServicesOverlayController.
781 It allows one selection highlight for the entire selection, and as many telephone number highlights as there are numbers.
782 If a telephone number highlight is hovered over, it wins and is painted.
783 If no telephone number highlight is hovered but the selection highlight is, then it is painted.
785 The purposes of each method are self evident by their name, and the concepts are mostly the same as they used to be.
787 The exception is establishHoveredTelephoneHighlight which gets a more detailed explanation below.
789 * Platform/Logging.h: Add a Services logging channel.
791 * WebProcess/WebPage/ServicesOverlayController.h:
792 (WebKit::TelephoneNumberData::TelephoneNumberData):
794 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
795 (WebKit::ServicesOverlayController::ServicesOverlayController):
796 (WebKit::ServicesOverlayController::selectionRectsDidChange):
797 (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
798 (WebKit::ServicesOverlayController::clearHighlightState):
799 (WebKit::ServicesOverlayController::drawRect):
800 (WebKit::ServicesOverlayController::drawSelectionHighlight):
801 (WebKit::ServicesOverlayController::maybeDrawTelephoneNumberHighlight):
802 (WebKit::ServicesOverlayController::drawHighlight):
803 (WebKit::ServicesOverlayController::clearSelectionHighlight):
804 (WebKit::ServicesOverlayController::clearHoveredTelephoneNumberHighlight):
805 (WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight): Starts walking the telephone number ranges and
806 creating a highlight for each one that doesn’t already have a highlight. If that highlight is also being hovered by
807 the mouse, then it is set as the hovered telephone number highlight and the method stops creating new highlights.
808 (WebKit::ServicesOverlayController::maybeCreateSelectionHighlight):
809 (WebKit::ServicesOverlayController::mouseEvent):
810 (WebKit::ServicesOverlayController::handleClick):
811 (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Deleted.
812 (WebKit::ServicesOverlayController::drawCurrentHighlight): Deleted.
814 2014-07-10 Timothy Horton <timothy_horton@apple.com>
816 Assertions or crashes under _takeViewSnapshot when restoring windows
817 https://bugs.webkit.org/show_bug.cgi?id=134792
819 Reviewed by Simon Fraser.
821 * UIProcess/API/mac/WKView.mm:
822 (-[WKView _takeViewSnapshot]):
823 Taking a window-server snapshot of a non-visible window tends to not succeed.
825 2014-07-09 Pratik Solanki <psolanki@apple.com>
827 Buffer CSS and JS resources in network process before sending over to web process
828 https://bugs.webkit.org/show_bug.cgi?id=134560
829 <rdar://problem/16737186>
831 Reviewed by Antti Koivisto.
833 For CSS and JS resources, ask the network process to buffer the entire resource instead of
834 sending it to web process in chunks since the web process can't do anything with a partial
837 * NetworkProcess/NetworkResourceLoader.cpp:
838 (WebKit::NetworkResourceLoader::NetworkResourceLoader):
839 * Shared/Network/NetworkResourceLoadParameters.cpp:
840 (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
841 (WebKit::NetworkResourceLoadParameters::encode):
842 (WebKit::NetworkResourceLoadParameters::decode):
843 * Shared/Network/NetworkResourceLoadParameters.h:
844 * WebProcess/Network/WebResourceLoadScheduler.cpp:
845 (WebKit::WebResourceLoadScheduler::scheduleLoad):
847 2014-07-09 Benjamin Poulain <bpoulain@apple.com>
849 [iOS][WK2] Disable text quantization while actively changing the page's scale factor
850 https://bugs.webkit.org/show_bug.cgi?id=134781
852 Reviewed by Tim Horton and Myles C. Maxfield.
854 While zooming a page, text quantization causes glyphs to "move" in order to get to the closest
855 boundary for the current scale factor.
857 We do not want this to happen while dynamically changing the scale factor because the effect
858 is visible. To avoid this, we disable text quantization if the page's scale factor changes
859 in response to a non-stable contentRect update.
861 * WebProcess/WebCoreSupport/WebChromeClient.h:
862 * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
863 (WebKit::WebChromeClient::hasStablePageScaleFactor):
864 * WebProcess/WebPage/WebPage.cpp:
865 (WebKit::WebPage::WebPage):
866 * WebProcess/WebPage/WebPage.h:
867 (WebKit::WebPage::hasStablePageScaleFactor):
868 * WebProcess/WebPage/ios/WebPageIOS.mm:
869 (WebKit::WebPage::updateVisibleContentRects):
871 2014-07-09 Joseph Pecoraro <pecoraro@apple.com>
873 [iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI
874 https://bugs.webkit.org/show_bug.cgi?id=134777
876 Reviewed by Sam Weinig.
878 * UIProcess/ios/forms/WKFileUploadPanel.mm:
879 (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
881 2014-07-09 Shivakumar JM <shiva.jm@samsung.com>
883 [EFL][WK2] Add new Public API in ewk_download_job.h to get size of the data already downloaded.
884 https://bugs.webkit.org/show_bug.cgi?id=134759
886 Reviewed by Gyuyoung Kim.
888 Add new API in ewk_download_job.h to get size of the data already downloaded.
890 * UIProcess/API/efl/ewk_download_job.cpp:
891 (ewk_download_job_received_data_length_get):
892 (EwkDownloadJob::receivedData):
893 * UIProcess/API/efl/ewk_download_job.h:
894 * UIProcess/API/efl/ewk_download_job_private.h:
895 * UIProcess/API/efl/tests/test_ewk2_download_job.cpp:
896 (EWK2DownloadJobTest::on_download_requested):
897 (EWK2DownloadJobTest::on_download_finished):
899 2014-07-09 Enrica Casucci <enrica@apple.com>
901 REGRESSION(r170858): Safari freezes upon making a search on a website (yelp.com).
902 https://bugs.webkit.org/show_bug.cgi?id=134791
903 <rdar://problem/17616971>
905 Reviewed by Benjamin Poulain.
907 After r170858 we notify the keyboard too often about
908 the changed selection. This patch removes the notification
909 until we find a better way to do it that doesn't cause
912 * UIProcess/ios/WKContentViewInteraction.mm:
913 (-[WKContentView _selectionWillChange]):
914 (-[WKContentView _selectionChanged]):
916 2014-07-09 Anders Carlsson <andersca@apple.com>
918 Safari showing blank pages
919 https://bugs.webkit.org/show_bug.cgi?id=134790
920 <rdar://problem/17617166>
922 Reviewed by Simon Fraser.
924 * UIProcess/API/Cocoa/WKWebView.mm:
925 (-[WKWebView initWithFrame:configuration:]):
926 Make sure to add the content view to the scroll view.
928 2014-07-09 Anders Carlsson <andersca@apple.com>
930 Closed web views should never create new web processes
931 https://bugs.webkit.org/show_bug.cgi?id=134787
932 <rdar://problem/16892526>
934 Reviewed by Simon Fraser.
936 * UIProcess/API/Cocoa/WKWebView.mm:
937 (-[WKWebView loadHTMLString:baseURL:]):
938 (-[WKWebView reload]):
939 (-[WKWebView reloadFromOrigin]):
940 Return nil if the returned navigation ID is 0.
942 * UIProcess/WebPageProxy.cpp:
943 (WebKit::WebPageProxy::reattachToWebProcess):
944 Assert that the page is not closed.
946 (WebKit::WebPageProxy::reattachToWebProcessWithItem):
947 (WebKit::WebPageProxy::loadRequest):
948 (WebKit::WebPageProxy::loadFile):
949 (WebKit::WebPageProxy::loadData):
950 (WebKit::WebPageProxy::loadHTMLString):
951 (WebKit::WebPageProxy::loadAlternateHTMLString):
952 (WebKit::WebPageProxy::loadPlainTextString):
953 (WebKit::WebPageProxy::loadWebArchiveData):
954 Add early returns if the page is closed.
956 * UIProcess/WebPageProxy.h:
958 2014-07-09 Anders Carlsson <andersca@apple.com>
960 Support transparent WKWebViews
961 https://bugs.webkit.org/show_bug.cgi?id=134779
962 <rdar://problem/17351058>
964 Reviewed by Tim Horton.
966 * UIProcess/API/Cocoa/WKWebView.mm:
967 (-[WKWebView initWithFrame:configuration:]):
968 Call _updateScrollViewBackground instead of setting the background color.
973 (scrollViewBackgroundColor):
974 Helper function that returns the scroll view background color.
975 If the web view isn't opaque, we want the scroll view to be transparent.
977 (-[WKWebView _updateScrollViewBackground]):
978 Call scrollViewBackgroundColor.
980 (-[WKWebView setOpaque:]):
981 Call WebPageProxy::setDrawsBackground and update the scroll view background.
983 (-[WKWebView setBackgroundColor:]):
984 Call setBackgroundColor on the content view.
986 2014-07-09 Andy Estes <aestes@apple.com>
988 [iOS] WebKit can crash under QuickLookDocumentData::encode() when viewing a QuickLook preview
989 https://bugs.webkit.org/show_bug.cgi?id=134780
991 Reviewed by Tim Horton.
993 Don't use CFDataCreateWithBytesNoCopy() when we can't guarantee the lifetime of the copied-from DataReference
994 will match or exceed that of the CFDataRef. Copy the data instead.
996 * WebProcess/Network/WebResourceLoader.cpp:
997 (WebKit::WebResourceLoader::didReceiveData):
999 2014-07-09 Pratik Solanki <psolanki@apple.com>
1001 Move resource buffering from SynchronousNetworkLoaderClient to NetworkResourceLoader
1002 https://bugs.webkit.org/show_bug.cgi?id=134732
1004 Reviewed by Darin Adler.
1006 Buffer the resource in NetworkResourceLoader instead of SynchronousNetworkLoaderClient. This
1007 is in preparation for bug 134560 where we will be supporting JS and CSS resource buffering
1008 that uses AsynchronousNetworkLoaderClient.
1010 * NetworkProcess/NetworkResourceLoader.cpp:
1011 (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1012 (WebKit::NetworkResourceLoader::didReceiveBuffer):
1013 (WebKit::NetworkResourceLoader::didFinishLoading):
1014 * NetworkProcess/NetworkResourceLoader.h:
1015 (WebKit::NetworkResourceLoader::bufferedData):
1016 * NetworkProcess/SynchronousNetworkLoaderClient.cpp:
1017 (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer):
1018 (WebKit::SynchronousNetworkLoaderClient::didFinishLoading):
1019 (WebKit::SynchronousNetworkLoaderClient::didFail):
1020 (WebKit::SynchronousNetworkLoaderClient::sendDelayedReply):
1021 * NetworkProcess/SynchronousNetworkLoaderClient.h:
1023 2014-07-09 Benjamin Poulain <bpoulain@apple.com>
1025 [iOS][WK2] subviews of the unscaled view drift out during CA animations
1026 https://bugs.webkit.org/show_bug.cgi?id=134751
1028 Reviewed by Enrica Casucci.
1030 It is not possible to animate the WKContentView and the inverse view in such a way
1031 that the combined matrix remain the identity for every frame of the animation.
1033 This patch solves the issue by moving the unscaled view as a sibling of WKContentView
1034 instead of a child so that we do not need to update two scales simultaneously.
1036 * UIProcess/API/Cocoa/WKWebView.mm:
1037 (-[WKWebView initWithFrame:configuration:]):
1038 (-[WKWebView _processDidExit]):
1039 (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
1040 Set the z scale to 1 or no coordinate transform will work with this view.
1042 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1043 (-[WKWebView _endAnimatedResize]):
1044 * UIProcess/ios/WKContentView.mm:
1045 (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1046 * UIProcess/ios/WKContentViewInteraction.h:
1047 * UIProcess/ios/WKContentViewInteraction.mm:
1048 (-[WKContentView setupInteraction]):
1049 Since we need to observe changes inside the animation block, the code now use KVO to observe changes of scale.
1051 (-[WKContentView cleanupInteraction]):
1052 (-[WKContentView unscaledView]):
1053 (-[WKContentView inverseScale]):
1054 (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
1055 We update the utility views as usual. The extra bits here are to deal with views coming in during an animation.
1057 If a new utility view comes in during a scaling animation, we do not want to start a new animation with the same curve
1058 to end up at the right place. To avoid any issue, we just hide the view until the animation is finished.
1060 (-[WKContentView hitTest:withEvent:]):
1061 (-[WKContentView _showTapHighlight]):
1062 (-[WKContentView _updateUnscaledView]): Deleted.
1064 2014-07-09 Tim Horton <timothy_horton@apple.com>
1066 Use IOSurface ViewSnapshots everywhere on Mac, remove JPEG encoding path
1067 https://bugs.webkit.org/show_bug.cgi?id=134773
1069 Reviewed by Anders Carlsson.
1071 * UIProcess/API/mac/WKView.mm:
1072 (-[WKView _takeViewSnapshot]):
1073 * UIProcess/mac/ViewSnapshotStore.h:
1074 * UIProcess/mac/ViewSnapshotStore.mm:
1075 (WebKit::ViewSnapshotStore::ViewSnapshotStore):
1076 (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
1077 (WebKit::ViewSnapshotStore::recordSnapshot):
1078 (WebKit::ViewSnapshot::clearImage):
1079 (WebKit::ViewSnapshot::asLayerContents):
1080 (WebKit::createIOSurfaceFromImage): Deleted.
1081 (WebKit::compressImageAsJPEG): Deleted.
1082 (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost): Deleted.
1083 (WebKit::ViewSnapshotStore::didCompressSnapshot): Deleted.
1084 Remove all ViewSnapshot(Store) code related to JPEG-encoded snapshots.
1085 Remove the "image" member on ViewSnapshot; Mac will always start out with an IOSurface instead.
1086 Adopt WebCore::IOSurface::createFromImage to make that happen.
1087 Add a comment noting that if a snapshot comes back empty, we should throw it away completely.
1089 2014-07-09 Anders Carlsson <andersca@apple.com>
1091 RemoteLayerBackingStore::ensureBackingStore should ensure that the entire backing store gets redrawn
1092 https://bugs.webkit.org/show_bug.cgi?id=134772
1094 Reviewed by Tim Horton.
1096 * Shared/mac/RemoteLayerBackingStore.h:
1097 (WebKit::RemoteLayerBackingStore::Buffer::operator bool):
1098 * Shared/mac/RemoteLayerBackingStore.mm:
1099 (WebKit::RemoteLayerBackingStore::ensureBackingStore):
1101 2014-07-09 KwangHyuk Kim <hyuki.kim@samsung.com>
1103 [EFL] Fix crash caused by invalid cursor image.
1104 https://bugs.webkit.org/show_bug.cgi?id=134663
1106 Reviewed by Gyuyoung Kim.
1108 Remove calling of updateCursor since the custom cursor image is invalid once a mouse is out of the webview.
1110 * UIProcess/API/efl/EwkView.cpp:
1111 (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
1113 2014-07-08 Tim Horton <timothy_horton@apple.com>
1115 Remove WebBackForwardListItems when their owning page goes away
1116 https://bugs.webkit.org/show_bug.cgi?id=134709
1117 <rdar://problem/17584645>
1119 Reviewed by Dan Bernstein.
1121 * Shared/WebBackForwardListItem.cpp:
1122 (WebKit::WebBackForwardListItem::create):
1123 (WebKit::WebBackForwardListItem::WebBackForwardListItem):
1124 * Shared/WebBackForwardListItem.h:
1125 (WebKit::WebBackForwardListItem::pageID):
1126 Add the associated PageID to the WebBackForwardListItem.
1128 * UIProcess/WebBackForwardList.cpp:
1129 (WebKit::WebBackForwardList::restoreFromState):
1130 Push the current PageID onto the WebBackForwardListItem.
1132 * UIProcess/WebProcessProxy.cpp:
1133 (WebKit::WebProcessProxy::removeWebPage):
1134 Remove all of the WebBackForwardListItems from m_backForwardListItemMap when
1135 the page they are associated with is removed.
1137 (WebKit::WebProcessProxy::addBackForwardItem):
1138 Push the PageID from the WebProcess onto the WebBackForwardListItem.
1140 * UIProcess/WebProcessProxy.h:
1141 * UIProcess/WebProcessProxy.messages.in:
1142 * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1143 (WebKit::idToHistoryItemMap):
1144 (WebKit::historyItemToIDMap):
1145 (WebKit::updateBackForwardItem):
1146 (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
1147 (WebKit::WK2NotifyHistoryItemChanged):
1148 (WebKit::WebBackForwardListProxy::idForItem):
1149 (WebKit::WebBackForwardListProxy::addItem):
1150 (WebKit::WebBackForwardListProxy::goToItem):
1151 (WebKit::WebBackForwardListProxy::close):
1152 * WebProcess/WebPage/WebBackForwardListProxy.h:
1153 * WebProcess/WebPage/WebPage.cpp:
1154 (WebKit::WebPage::restoreSession):
1155 Keep track of the PageID that back-forward items were created by.
1156 Pass the PageID along when registering WebBackForwardListItems.
1158 2014-07-08 Tim Horton <timothy_horton@apple.com>
1160 [WK2] Expose a few drawing/compositing settings on WKPreferences(Private)
1161 https://bugs.webkit.org/show_bug.cgi?id=134645
1163 Reviewed by Dan Bernstein.
1165 * UIProcess/API/Cocoa/WKPreferences.mm:
1166 (-[WKPreferences _compositingBordersVisible]):
1167 (-[WKPreferences _setCompositingBordersVisible:]):
1168 (-[WKPreferences _compositingRepaintCountersVisible]):
1169 (-[WKPreferences _setCompositingRepaintCountersVisible:]):
1170 (-[WKPreferences _tiledScrollingIndicatorVisible]):
1171 (-[WKPreferences _setTiledScrollingIndicatorVisible:]):
1172 * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1173 Expose layer borders, repaint counters, and the tiled scrolling indicator on WKPreferences, as SPI.
1175 2014-07-08 Tim Horton <timothy_horton@apple.com>
1177 WKProcessPoolConfigurationPrivate's maximumProcessCount property has no effect
1178 https://bugs.webkit.org/show_bug.cgi?id=134711
1180 Reviewed by Dan Bernstein.
1182 * UIProcess/API/Cocoa/WKProcessPool.mm:
1183 (-[WKProcessPool _initWithConfiguration:]):
1184 Respect the maximumProcessCount.
1185 Currently the default limit is UINT_MAX; if maximumProcessCount = 0 (the default), we'll use that limit.
1187 2014-07-08 Adrian Perez de Castro <aperez@igalia.com>
1189 [GTK] Move user style sheet API out of WebKitWebViewGroup
1190 https://bugs.webkit.org/show_bug.cgi?id=134551
1192 Reviewed by Carlos Garcia Campos.
1194 * PlatformGTK.cmake: Include the new source files in the build.
1195 * UIProcess/API/C/gtk/WKView.cpp:
1197 Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
1198 * UIProcess/API/gtk/WebKitUserContent.cpp: Added.
1199 (toUserContentInjectedFrames):
1202 (_WebKitUserStyleSheet::_WebKitUserStyleSheet):
1203 (webkit_user_style_sheet_ref):
1204 (webkit_user_style_sheet_unref):
1205 (webkit_user_style_sheet_new):
1206 (webkitWebKitUserStyleSheetToUserStyleSheet):
1207 * UIProcess/API/gtk/WebKitUserContent.h: Added.
1208 * UIProcess/API/gtk/WebKitUserContentManager.cpp: Added.
1209 (_WebKitUserContentManagerPrivate::_WebKitUserContentManagerPrivate):
1210 (webkit_user_content_manager_class_init):
1211 (webkit_user_content_manager_new):
1212 (webkit_user_content_manager_add_style_sheet):
1213 (webkit_user_content_manager_remove_all_style_sheets):
1214 (webkitUserContentManagerGetUserContentControllerProxy):
1215 * UIProcess/API/gtk/WebKitUserContentManager.h: Added.
1216 * UIProcess/API/gtk/WebKitUserContentManagerPrivate.h: Added.
1217 * UIProcess/API/gtk/WebKitUserContentPrivate.h: Added.
1218 * UIProcess/API/gtk/WebKitWebContext.cpp:
1219 (webkitWebContextCreatePageForWebView): Add a new parameter to allow
1220 passing the WebKitUserContentManager that the web view will use.
1221 * UIProcess/API/gtk/WebKitWebContextPrivate.h: Ditto.
1222 * UIProcess/API/gtk/WebKitWebView.cpp:
1223 (webkitWebViewConstructed): Added handling of the
1224 "user-content-manager" property on construction.
1225 (webkitWebViewSetProperty): Added support for the
1226 "user-content-manager" property.
1227 (webkitWebViewGetProperty): Added support for the
1228 "user-content-manager" property.
1229 (webkit_web_view_class_init): Added the "user-content-manager"
1230 property definition to the WebKitWebView class.
1231 (webkit_web_view_new_with_related_view): Made related views share
1232 the same WebKitUserContentManager used by the view they are
1234 (webkit_web_view_new_with_user_content_manager): Added.
1235 (webkit_web_view_get_user_content_manager): Added.
1236 * UIProcess/API/gtk/WebKitWebView.h: Add new API methods.
1237 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1238 (webkitWebViewBaseCreate): Added a parameter to pass the user
1240 (webkitWebViewBaseCreateWebPage): Added a parameter to pass the user
1242 * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Ditto.
1243 * UIProcess/API/gtk/WebKitWebViewGroup.cpp: Removed the bits related
1244 to user style sheet support from WebKitWebViewGroup.
1245 (webkit_web_view_group_set_settings):
1246 (toAPIArray): Deleted.
1247 (webkit_web_view_group_add_user_style_sheet): Deleted.
1248 (webkit_web_view_group_remove_all_user_style_sheets): Deleted.
1249 * UIProcess/API/gtk/WebKitWebViewGroup.h: Deleted the API methods
1250 for user style sheet handling.
1251 * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added the new API
1252 functions and types, and removed the methods which are no longer
1253 available in WebKitWebViewGroup.
1254 * UIProcess/API/gtk/webkit2.h: Add the new headers.
1255 * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added
1256 methods to add and remove user style sheets, alike those used for
1258 (WebKit::WebUserContentControllerProxy::addProcess):
1259 (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
1260 (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
1261 * UIProcess/UserContent/WebUserContentControllerProxy.h: Ditto.
1262 * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1263 (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1264 Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
1265 * WebProcess/UserContent/WebUserContentController.cpp: Added methods
1266 to add and remove user style sheets, alike those used for user scripts.
1267 (WebKit::WebUserContentController::addUserStyleSheets):
1268 (WebKit::WebUserContentController::removeAllUserStyleSheets):
1269 * WebProcess/UserContent/WebUserContentController.h: Ditto.
1270 * WebProcess/UserContent/WebUserContentController.messages.in:
1273 2014-07-08 Zan Dobersek <zdobersek@igalia.com>
1275 [GTK] Guard uses of RedirectedXCompositeWindow in WebKitWebViewBase with PLATFORM(X11)
1276 https://bugs.webkit.org/show_bug.cgi?id=133871
1278 Reviewed by Martin Robinson.
1280 Guard uses of the RedirectedXCompositeWindow object in WebKitWebViewBase with the
1281 PLATFORM(X11) build guard. This is required to properly support building the GTK
1282 port only for the Wayland target.
1284 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1285 (webkitWebViewBaseConstructed):
1286 (webkitWebViewRenderAcceleratedCompositingResults):
1287 (resizeWebKitWebViewBaseFromAllocation):
1288 (webkitWebViewBaseUpdatePreferences):
1289 (webkitWebViewBaseCreateWebPage):
1291 2014-07-07 Tim Horton <timothy_horton@apple.com>
1293 Turn on accelerated drawing for WebKit2 by default
1294 https://bugs.webkit.org/show_bug.cgi?id=134708
1295 <rdar://problem/17584642>
1297 Reviewed by Simon Fraser.
1299 * Shared/WebPreferencesDefinitions.h:
1300 Make Mac match iOS, in that accelerated drawing is on by default.
1302 2014-07-07 Timothy Horton <timothy_horton@apple.com>
1304 Don't leak _WKRemoteObjectRegistry in WKBrowsingContextController
1305 https://bugs.webkit.org/show_bug.cgi?id=134703
1307 Reviewed by Simon Fraser.
1309 * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1310 (-[WKBrowsingContextController _remoteObjectRegistry]):
1311 Adoption is important!!
1313 2014-07-07 Simon Fraser <simon.fraser@apple.com>
1315 [UI-side compositing] Support reflections on custom layers like video
1316 https://bugs.webkit.org/show_bug.cgi?id=134701
1318 Reviewed by Tim Horton.
1320 For video reflections, we have to support cloning of PlatformCALayerRemoteCustom
1321 in the web process. Do so by implementing PlatformCALayerRemoteCustom::clone(),
1322 which does the right gyrations to get AVPlayerLayers cloned, then makes a
1323 new PlatformCALayerRemoteCustom to wrap the new layer. This ends up getting
1324 its own context hosting ID, allowing the clone to show in the UI process.
1326 Attempt to do the same for WebGL, but turn it off because it breaks.
1328 * Shared/mac/RemoteLayerBackingStore.mm:
1329 (WebKit::RemoteLayerBackingStore::drawInContext):
1330 * Shared/mac/RemoteLayerTreeTransaction.mm:
1331 (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode): Unconditionally encode/decode
1332 the hostingContextID. It will be 0 for most layers.
1333 (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
1334 (WebKit::RemoteLayerTreeTransaction::description):
1335 * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
1336 (WebKit::RemoteLayerTreeHost::createLayer):
1337 * UIProcess/mac/RemoteLayerTreeHost.mm:
1338 (WebKit::RemoteLayerTreeHost::createLayer):
1339 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1340 (WebKit::PlatformCALayerRemote::create): Creation with a custom PlatformLayer* always
1341 creates a PlatformCALayerRemoteCustom.
1342 (WebKit::PlatformCALayerRemote::clone): Factor some code.
1343 (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
1344 (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1345 * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1346 * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
1347 * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
1348 (WebKit::PlatformCALayerRemoteCustom::create):
1349 (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
1350 (WebKit::PlatformCALayerRemoteCustom::clone): Clone by making an instance of the
1351 correct type of platform layer when possible, then wrapping a PlatformCALayerRemoteCustom
1353 (WebKit::PlatformCALayerRemoteCustom::contents):
1354 (WebKit::PlatformCALayerRemoteCustom::setContents):
1355 * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1356 (WebKit::RemoteLayerTreeContext::layerWasCreated):
1357 (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
1359 2014-07-07 Simon Fraser <simon.fraser@apple.com>
1361 [UI-side compositing] Crash when starting a filter transition on a reflected layer
1362 https://bugs.webkit.org/show_bug.cgi?id=134694
1364 Reviewed by Tim Horton.
1366 When cloned layers had animations, we would fire two animationDidStart callbacks,
1367 but the second would pass an empty animationKey string to the web process, resulting
1370 Fix by not blindly copying all layer properties when cloning PlatformCALayerRemotes,
1371 since the clone would include addedAnimations, and then get the same animations
1372 added on top by the caller.
1374 Also protect against an empty animation key in the animationDidStart callback.
1376 * UIProcess/mac/RemoteLayerTreeHost.mm:
1377 (WebKit::RemoteLayerTreeHost::animationDidStart):
1378 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1379 (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
1380 (WebKit::PlatformCALayerRemote::clone): Don't copy all the properties; copy
1381 them manually as PlatformCALayerMac does. Only copy the big things if they don't
1382 have their default values.
1383 (WebKit::PlatformCALayerRemote::copyFiltersFrom): Need an implementation of this
1384 for clone() to call.
1386 2014-07-07 Tim Horton <timothy_horton@apple.com>
1388 Nearly everything in the UIProcess "leaks" when WKWebView is torn down
1389 https://bugs.webkit.org/show_bug.cgi?id=134699
1390 <rdar://problem/17581777>
1392 Reviewed by Simon Fraser.
1394 * UIProcess/API/Cocoa/WKWebView.mm:
1395 (-[WKWebView initWithFrame:configuration:]):
1396 Adoption is important!
1398 2014-07-07 Enrica Casucci <enrica@apple.com>
1400 REGRESSION(iOS WK2): arrow keys movements don't work.
1401 https://bugs.webkit.org/show_bug.cgi?id=134561
1402 <rdar://problem/16827629>
1404 Reviewed by Benjamin Poulain.
1406 This change add the implementations for cursor movement selectors.
1407 It also provides a mechanism to ensure that every selection
1408 change in WebKit is reflected in UIKit so that it can update the
1409 autocorrection data. This way we ensure that the autocorraction state
1410 is consistent even when selection changes are originated by JavaScript.
1411 WebPageProxy::editorStateChanged now notifies the page client when the
1412 selection is about to change as well as when it actually changed.
1414 * UIProcess/PageClient.h:
1415 * UIProcess/WebPageProxy.cpp:
1416 (WebKit::WebPageProxy::editorStateChanged):
1417 * UIProcess/WebPageProxy.h:
1418 * UIProcess/ios/PageClientImplIOS.h:
1419 * UIProcess/ios/PageClientImplIOS.mm:
1420 (WebKit::PageClientImpl::selectionWillChange):
1421 * UIProcess/ios/WKContentViewInteraction.h:
1422 * UIProcess/ios/WKContentViewInteraction.mm:
1423 (-[WKContentView cut:]): Removed incorrect calls to textWillChange and
1425 (-[WKContentView paste:]):
1426 (-[WKContentView _moveUp:withHistory:]):
1427 (-[WKContentView _moveDown:withHistory:]):
1428 (-[WKContentView _moveLeft:withHistory:]):
1429 (-[WKContentView _moveRight:withHistory:]):
1430 (-[WKContentView _moveToStartOfWord:withHistory:]):
1431 (-[WKContentView _moveToStartOfParagraph:withHistory:]):
1432 (-[WKContentView _moveToStartOfLine:withHistory:]):
1433 (-[WKContentView _moveToStartOfDocument:withHistory:]):
1434 (-[WKContentView _moveToEndOfWord:withHistory:]):
1435 (-[WKContentView _moveToEndOfParagraph:withHistory:]):
1436 (-[WKContentView _moveToEndOfLine:withHistory:]):
1437 (-[WKContentView _moveToEndOfDocument:withHistory:]):
1438 (-[WKContentView _selectionWillChange]):
1439 (-[WKContentView _selectionChanged]):
1440 * UIProcess/ios/WebPageProxyIOS.mm:
1441 (WebKit::WebPageProxy::notifySelectionWillChange):
1443 2014-07-07 Anders Carlsson <andersca@apple.com>
1445 Add SPI for saving and restoring a WKWebView's _WKSessionState
1446 https://bugs.webkit.org/show_bug.cgi?id=134693
1448 Reviewed by Dan Bernstein.
1450 * UIProcess/API/C/WKPage.cpp:
1451 (WKPageRestoreFromSessionState):
1452 * UIProcess/API/Cocoa/WKWebView.mm:
1453 (-[WKWebView _sessionState]):
1454 (-[WKWebView _restoreFromSessionStateData:]):
1455 (-[WKWebView _restoreFromSessionState:]):
1456 (-[WKWebView _restoreSessionState:andNavigate:]):
1457 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1458 * UIProcess/API/Cocoa/_WKSessionState.mm:
1459 (-[_WKSessionState _initWithSessionState:]):
1460 * UIProcess/API/Cocoa/_WKSessionStateInternal.h:
1461 * UIProcess/WebPageProxy.cpp:
1462 (WebKit::WebPageProxy::restoreFromSessionState):
1463 * UIProcess/WebPageProxy.h:
1465 2014-07-07 Anders Carlsson <andersca@apple.com>
1467 Add a stubbed out _WKSessionState class
1468 https://bugs.webkit.org/show_bug.cgi?id=134690
1470 Reviewed by Geoffrey Garen.
1472 * UIProcess/API/Cocoa/_WKSessionState.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
1473 * UIProcess/API/Cocoa/_WKSessionState.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
1474 (-[_WKSessionState initWithData:]):
1475 (-[_WKSessionState data]):
1476 * UIProcess/API/Cocoa/_WKSessionStateInternal.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
1477 * UIProcess/Cocoa/SessionStateCoding.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
1478 * UIProcess/Cocoa/SessionStateCoding.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
1479 (WebKit::encodeSessionState):
1480 (WebKit::decodeSessionState):
1481 * UIProcess/LegacySessionStateCoding.h:
1482 * WebKit2.xcodeproj/project.pbxproj:
1484 2014-07-07 Anders Carlsson <andersca@apple.com>
1486 Some of the WKPreferences (API) property getters read like questions
1487 https://bugs.webkit.org/show_bug.cgi?id=134678
1488 <rdar://problem/17576847>
1490 Reviewed by Dan Bernstein.
1492 * UIProcess/API/Cocoa/WKPreferences.h:
1493 * UIProcess/API/Cocoa/WKPreferences.mm:
1494 (-[WKPreferences javaScriptIsEnabled]):
1495 (-[WKPreferences javaIsEnabled]):
1496 (-[WKPreferences plugInsAreEnabled]):
1497 (-[WKPreferences isJavaScriptEnabled]): Deleted.
1498 (-[WKPreferences isJavaEnabled]): Deleted.
1499 (-[WKPreferences arePlugInsEnabled]): Deleted.
1501 2014-07-07 Brady Eidson <beidson@apple.com>
1503 ServicesOverlayController menus show up in the wrong place.
1504 <rdar://problem/17130576> and https://bugs.webkit.org/show_bug.cgi?id=134684
1506 Reviewed by Tim Horton.
1508 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1509 (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Handle cases where
1510 the telephone number is in a subframe.
1511 (WebKit::ServicesOverlayController::handleClick): The click point is always in main frame document
1512 coordinates, so convert it to window coordinates using the main frame’s FrameView.
1514 2014-07-07 Dan Bernstein <mitz@apple.com>
1516 [Cocoa] Assertion failure in NavigationState::LoaderClient::didStartProvisionalLoadForFrame (navigationID) when navigating through the page cache
1517 https://bugs.webkit.org/show_bug.cgi?id=134682
1519 Reviewed by Tim Horton.
1521 * UIProcess/Cocoa/NavigationState.mm:
1522 (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Replaced the
1523 assertion with a FIXME.
1524 (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
1526 (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
1527 (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
1528 (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
1529 (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
1530 (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
1532 2014-07-07 KwangHyuk Kim <hyuki.kim@samsung.com>
1534 [EFL] Fix cursor artifacts on naver map site.
1535 https://bugs.webkit.org/show_bug.cgi?id=134649
1537 Reviewed by Gyuyoung Kim.
1539 Old evas cursor and ecore x cursor are reset before new cursor is applied.
1541 * UIProcess/API/efl/EwkView.cpp:
1542 (EwkView::updateCursor):
1544 2014-07-06 Benjamin Poulain <bpoulain@apple.com>
1546 [iOS][WK2] The tap highlight ID is not invalidated when a long press ends
1547 https://bugs.webkit.org/show_bug.cgi?id=134660
1549 Reviewed by Darin Adler.
1551 * UIProcess/ios/WKContentViewInteraction.mm:
1552 (-[WKContentView _cancelInteraction]):
1553 (-[WKContentView _finishInteraction]):
1554 (cancelPotentialTapIfNecessary):
1555 I messed that up in r170600. I only accounted for the web process being too fast.
1557 If the web process is too slow, _cancelInteraction or _finishInteraction happen before
1558 _didGetTapHighlightForRequest:, and we also need to nuke the tap highlight.
1560 2014-07-06 Tim Horton <timothy_horton@apple.com>
1562 [WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
1563 https://bugs.webkit.org/show_bug.cgi?id=134644
1565 Reviewed by Darin Adler.
1567 * UIProcess/DrawingAreaProxy.h:
1568 (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
1569 * UIProcess/WebPageProxy.cpp:
1570 (WebKit::WebPageProxy::preferencesDidChange):
1571 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1572 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1573 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
1574 (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
1575 (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
1576 The indicator depends on the live layer tree commits coming in, including layer creation,
1577 so it can't be turned on after the root layer is created. Even a refresh is insufficient
1578 to get it working; the debug indicator really needs to exist from the first commit.
1579 So, don't even attempt to dynamically enable the indicator; create it at
1580 RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled.
1582 2014-07-06 Yoav Weiss <yoav@yoav.ws>
1584 Turn on img@sizes compile flag
1585 https://bugs.webkit.org/show_bug.cgi?id=134634
1587 Reviewed by Benjamin Poulain.
1589 * Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.
1591 2014-07-06 Brady Eidson <beidson@apple.com>
1593 Speculative fix for: NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
1594 https://bugs.webkit.org/show_bug.cgi?id=134666
1596 Reviewed by Tim Horton.
1598 * Shared/mac/SecItemRequestData.cpp:
1599 (WebKit::SecItemRequestData::encode): Encode whether or not the query dictionary exists.
1600 (WebKit::SecItemRequestData::decode): Only fail when query dictionary fails to decode if we expect one.
1602 * UIProcess/mac/SecItemShimProxy.cpp:
1603 (WebKit::SecItemShimProxy::secItemRequest): If the request is of type Invalid, log an error message asking
1604 for a bug, and respond with an "invalid parameter" error.
1606 2014-07-06 Antti Koivisto <antti@apple.com>
1608 Don't throttle layer flushes when the main resource is a GIF
1609 https://bugs.webkit.org/show_bug.cgi?id=134650
1611 Reviewed by Simon Fraser.
1613 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1614 (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
1616 2014-07-04 Rohit Kumar <kumar.rohit@samsung.com>
1618 [EFL][WK2]Fix build break in EFL WK2
1619 https://bugs.webkit.org/show_bug.cgi?id=134629
1621 Unreviewed build fix.
1623 * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
1624 (WebKit::CoordinatedDrawingArea::scheduleCompositingLayerFlushImmediately):
1625 * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
1627 2014-07-04 Dan Bernstein <mitz@apple.com>
1629 [Cocoa] -[WKWebView _reload] is unused
1630 https://bugs.webkit.org/show_bug.cgi?id=134638
1632 Reviewed by Sam Weinig.
1634 * UIProcess/API/Cocoa/WKWebView.mm:
1635 (-[WKWebView _reload]): Deleted.
1636 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1638 2014-07-04 Tim Horton <timothy_horton@apple.com>
1640 [WK2] Take TopContentInset into account when sending dictionary lookup point to PluginView
1641 https://bugs.webkit.org/show_bug.cgi?id=134624
1642 <rdar://problem/17222041>
1644 Reviewed by Sam Weinig.
1646 * WebProcess/Plugins/PDF/PDFPlugin.mm:
1647 (WebKit::PDFPlugin::performDictionaryLookupAtLocation):
1648 Perform the same coordinate conversion we use for mouse events, which happens
1649 to take the top content inset into account.
1651 2014-07-04 Philippe Normand <pnormand@igalia.com>
1653 Unreviewed, GTK WK2 build fix after r170787.
1655 * WebProcess/WebPage/DrawingAreaImpl.cpp:
1656 (WebKit::DrawingAreaImpl::scheduleCompositingLayerFlushImmediately):
1657 * WebProcess/WebPage/DrawingAreaImpl.h:
1659 2014-07-04 Zan Dobersek <zdobersek@igalia.com>
1661 Unreviewed. Reverting the bad changes introduced in r170795.
1663 * Platform/IPC/ArgumentDecoder.cpp:
1664 (IPC::ArgumentDecoder::decode): Deleted.
1665 * Platform/IPC/ArgumentDecoder.h:
1666 * Platform/IPC/ArgumentEncoder.cpp:
1667 (IPC::ArgumentEncoder::encode): Deleted.
1668 * Platform/IPC/ArgumentEncoder.h:
1670 2014-07-04 Zan Dobersek <zdobersek@igalia.com>
1672 Unreviewed. Fixing the build for ports on 64-bit Linux.
1674 Add IPC encoding and decoding overloads for the long long type, needed
1675 after r170755 started encoding and decoding long long variables in
1678 * Platform/IPC/ArgumentDecoder.cpp:
1679 (IPC::ArgumentDecoder::decode):
1680 * Platform/IPC/ArgumentDecoder.h:
1681 * Platform/IPC/ArgumentEncoder.cpp:
1682 (IPC::ArgumentEncoder::encode):
1683 * Platform/IPC/ArgumentEncoder.h:
1685 2014-07-04 Timothy Horton <timothy_horton@apple.com>
1687 [iOS][WK2] Black web view after un-suspending process
1688 https://bugs.webkit.org/show_bug.cgi?id=134623
1689 <rdar://problem/17513223>
1691 Reviewed by Simon Fraser.
1693 * UIProcess/WebPageProxy.cpp:
1694 (WebKit::WebPageProxy::viewStateDidChange):
1695 Add an argument to viewStateDidChange that allows callers (-[WKContentView _applicationWillEnterForeground:])
1696 to force us to wait for a synchronous reply from the Web process after performing a view state change.
1698 (WebKit::WebPageProxy::dispatchViewStateChange):
1699 Move the has-been-in-window-and-now-is-newly-in-window check into dispatchViewStateChange.
1700 Adjust the logic surrounding going into/out of window by factoring out the IsInWindow-did-change check, for clarity.
1702 * UIProcess/WebPageProxy.h:
1703 * UIProcess/ios/WKContentView.mm:
1704 (-[WKContentView _applicationWillEnterForeground:]):
1705 As previously mentioned, wait for a reply when foregrounding.
1707 * WebProcess/WebPage/DrawingArea.h:
1708 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1709 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1710 (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
1711 (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
1712 (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
1713 Make sure to schedule a commit immediately if the UI process is waiting for a reply.
1714 Previously we assumed that a commit would be scheduled anyway because we would have to reparent the
1715 layer tree, but that doesn't happen in the suspension-without-unparenting case. Also, we want to skip
1716 all throttling in this case.
1718 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1719 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1720 (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):
1722 2014-07-03 Gavin Barraclough <baraclough@apple.com>
1724 Should not take background task assertion for NetworkProcess
1725 https://bugs.webkit.org/show_bug.cgi?id=134622
1727 Reviewed by Tim Horton.
1729 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.
1730 However for the NetworkProcess we always just hold a process assertion, and don't want this to interfere with UIApp suspension.
1732 * Platform/IPC/mac/ConnectionMac.mm:
1733 (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
1734 - ProcessAssertion -> ProcessAndUIAssertion
1735 * UIProcess/ProcessAssertion.cpp:
1736 (WebKit::ProcessAssertion::ProcessAssertion):
1737 - assignment -> initializer list.
1738 (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
1739 (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
1740 (WebKit::ProcessAndUIAssertion::setState):
1741 - added no-op implementation.
1742 (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
1743 * UIProcess/ProcessAssertion.h:
1744 - removed ~ProcessAssertion, added ProcessAndUIAssertion class.
1745 * UIProcess/ProcessThrottler.cpp:
1746 (WebKit::ProcessThrottler::didConnnectToProcess):
1747 - ProcessAssertion -> ProcessAndUIAssertion
1748 * UIProcess/ProcessThrottler.h:
1749 - ProcessAssertion -> ProcessAndUIAssertion
1750 * UIProcess/ios/ProcessAssertionIOS.mm:
1751 (WebKit::ProcessAssertion::ProcessAssertion):
1752 - assignment -> initializer list.
1753 - moved code to manage WKProcessAssertionBackgroundTaskManager
1754 (WebKit::ProcessAssertion::setState):
1755 - moved code to manage WKProcessAssertionBackgroundTaskManager
1756 (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
1757 (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
1758 (WebKit::ProcessAndUIAssertion::setState):
1759 - moved code to manage WKProcessAssertionBackgroundTaskManager from ProcessAssertion.
1760 (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
1761 - delete - moved code to manage WKProcessAssertionBackgroundTaskManager
1763 2014-07-03 Simon Fraser <simon.fraser@apple.com>
1765 Clean up Brady's mess on iOS.
1767 * Platform/mac/StringUtilities.h:
1768 * Platform/mac/StringUtilities.mm:
1770 2014-07-03 Simon Fraser <simon.fraser@apple.com>
1772 [iOS WK2] Compositing layers draw outside page bounds
1773 https://bugs.webkit.org/show_bug.cgi?id=134619
1774 <rdar://problem/16953222>
1776 Reviewed by Benjamin Poulain.
1778 With the new rubber-banding behavior, we no longer have the root content layer clipping all
1779 the web layers, but this resulted in web layers which were moved outside the viewport by CSS
1780 transforms not being clipped.
1782 Fix by adding a clipping layer inside the scroll view, above _rootContentView. This layer
1783 normally has the same bounds as the content, but when rubber-banding or pinching,
1784 it takes the union of the content bounds and the rect used for fixed positioning.
1785 To make scrolling work as expected in this scenario, when it has non-zero offset, it
1786 has to compensate by setting its bounds origin.
1788 The bounds of the clipping layer are updated on scrolling/zooming, and when the
1789 layer commit tells us that the content size changed.
1791 * UIProcess/API/Cocoa/WKWebView.mm:
1792 (-[WKWebView _updateScrollViewBackground]):
1793 * UIProcess/ios/WKContentView.mm:
1794 (-[WKContentView initWithFrame:context:configuration:webView:]):
1795 (-[WKContentView updateFixedClippingView:]):
1796 (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1797 (-[WKContentView _didCommitLayerTree:]):
1799 2014-07-03 Brady Eidson <beidson@apple.com>
1801 When showing the selection menu, include menu options for all selected phone numbers.
1802 <rdar://problem/16983434>, <rdar://problem/16874568>, and https://bugs.webkit.org/show_bug.cgi?id=134613
1804 Reviewed by Tim Horton.
1806 Move some telephone number menu logic from WebKitSystemInterface here.
1807 Also provide utility to get just the one menu item relevant to a telephone number.
1808 * Platform/mac/MenuUtilities.h:
1809 * Platform/mac/MenuUtilities.mm: Added.
1810 (WebKit::menuItemForTelephoneNumber):
1811 (WebKit::menuItemsForTelephoneNumber):
1813 * Platform/mac/StringUtilities.h:
1814 * Platform/mac/StringUtilities.mm:
1815 (WebKit::formattedPhoneNumberString): Return a localized formatted phone number.
1817 Add a member to track the selected phone numbers:
1818 * Shared/ContextMenuContextData.h:
1819 (WebKit::ContextMenuContextData::ContextMenuContextData):
1820 (WebKit::ContextMenuContextData::selectedTelephoneNumbers):
1822 * UIProcess/WebPageProxy.h:
1823 * UIProcess/WebPageProxy.messages.in:
1825 * UIProcess/mac/WebContextMenuProxyMac.mm:
1826 (WebKit::WebContextMenuProxyMac::setupServicesMenu): Also add menu items for each phone number that is
1829 Switch away from a WKSI method, and remove a lot of unneeded forward declarations and soft linking:
1830 * UIProcess/mac/WebPageProxyMac.mm:
1831 (WebKit::WebPageProxy::showTelephoneNumberMenu):
1832 (WebKit::WebPageProxy::showSelectionServiceMenu):
1834 * WebKit2.xcodeproj/project.pbxproj:
1836 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1837 (WebKit::ServicesOverlayController::drawSelectionHighlight):
1838 (WebKit::ServicesOverlayController::handleClick): Pass the phone numbers along.
1840 * WebProcess/WebPage/WebPage.h:
1841 * WebProcess/WebPage/mac/WebPageMac.mm:
1842 (WebKit::WebPage::handleSelectionServiceClick): Pass the phone numbers along.
1844 2014-07-03 Gavin Barraclough <baraclough@apple.com>
1846 WKProcessAssertionBackgroundTaskManager should clear member if task expires
1847 https://bugs.webkit.org/show_bug.cgi?id=134618
1849 Reviewed by Anders Carlson.
1851 Failure to do so results in a warning, and could result in us erroneously completing a background task too soon.
1853 * UIProcess/ios/ProcessAssertionIOS.mm:
1854 (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
1855 - remove local variable, _backgroundTask = UIBackgroundTaskInvalid;
1857 2014-07-03 Joseph Pecoraro <pecoraro@apple.com>
1859 Unreviewed iOS build fix for r170774.
1861 Remove some unnecessary WTF::moves on iOS:
1862 error: static_assert failed "T is not an lvalue reference; move() is unnecessary."
1864 * WebProcess/WebPage/EventDispatcher.cpp:
1865 (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
1866 (WebKit::EventDispatcher::touchEvent):
1868 2014-07-03 Anders Carlsson <andersca@apple.com>
1870 Try to fix the iOS build.
1872 Add WebPageProxyCocoa.mm for code shared between iOS and OS X. Put the recent searches save/restore code there.
1874 * UIProcess/Cocoa/WebPageProxyCocoa.mm: Added.
1875 (WebKit::autosaveKey):
1876 (WebKit::WebPageProxy::saveRecentSearches):
1877 (WebKit::WebPageProxy::loadRecentSearches):
1878 * UIProcess/mac/WebPageProxyMac.mm:
1879 * WebKit2.xcodeproj/project.pbxproj:
1881 2014-07-03 Dan Bernstein <mitz@apple.com>
1883 <rdar://problem/16337741> The UI process needs to track the number of HTTP subresource loads in progress (or at least whether there are any)
1884 https://bugs.webkit.org/show_bug.cgi?id=134615
1886 Reviewed by Anders Carlsson.
1888 Added a _networkRequestsInProgress boolean property to WKWebView.
1890 * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
1891 PageLoadStateObserver member functions.
1893 * UIProcess/API/Cocoa/WKWebView.mm:
1894 (-[WKWebView _networkRequestsInProgress]): New getter that gets this state from the
1896 * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property.
1898 * UIProcess/Cocoa/NavigationState.h:
1899 * UIProcess/Cocoa/NavigationState.mm:
1900 (WebKit::NavigationState::willChangeNetworkRequestsInProgress):: Override this new
1901 PageLoadState::Observer member function by sending the appropriate KVO change message to the
1903 (WebKit::NavigationState::didChangeNetworkRequestsInProgress): Ditto.
1905 * UIProcess/PageLoadState.cpp:
1906 (WebKit::PageLoadState::commitChanges): Check for changes to networkRequestsInProgress
1907 and call the observers if needed.
1908 (WebKit::PageLoadState::reset): Reset networkRequestsInProgress in the uncommitted state.
1909 (WebKit::PageLoadState::setNetworkRequestsInProgress): Set networkRequestsInProgress in the
1911 * UIProcess/PageLoadState.h:
1912 (WebKit::PageLoadState::networkRequestsInProgress): Added this getter.
1913 (WebKit::PageLoadState::Data::Data): Initialize new networkRequestsInProgress member.
1915 * UIProcess/WebPageProxy.cpp:
1916 (WebKit::WebPageProxy::setNetworkRequestsInProgress): Added. Updates the PageLoadState.
1917 * UIProcess/WebPageProxy.h:
1918 * UIProcess/WebPageProxy.messages.in: Added SetNetworkRequestsInProgress message.
1920 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1921 (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Call
1922 WebPage::addResourceRequest.
1923 (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): Call
1924 WebPage::removeResourceRequest.
1925 (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): Ditto.
1927 * WebProcess/WebPage/WebPage.cpp:
1928 (WebKit::WebPage::addResourceRequest): Added. If the new request is for an HTTP-family URL,
1929 add its identifier to the set of network resourece request identifiers. If the set was
1930 previously empty, send the WebPageProxy a message.
1931 (WebKit::WebPage::removeResourceRequest): Added. Remove the identifier from the set. If it
1932 becomes empty, send the WebPageProxy a message.
1933 * WebProcess/WebPage/WebPage.h:
1935 2014-07-03 Anders Carlsson <andersca@apple.com>
1937 Remove two unused functions
1938 https://bugs.webkit.org/show_bug.cgi?id=134614
1940 Reviewed by Andreas Kling.
1942 * UIProcess/LegacySessionStateCoding.h:
1943 * UIProcess/mac/LegacySessionStateCoding.cpp:
1944 (WebKit::encodeLegacySessionHistoryEntryData): Deleted.
1945 (WebKit::decodeLegacySessionHistoryEntryData): Deleted.
1947 2014-07-03 Daniel Bates <dabates@apple.com>
1950 https://bugs.webkit.org/show_bug.cgi?id=134500
1952 Rubber-stamped by Anders Carlsson.
1954 Substitute WTF::move() for std::move().
1956 * DatabaseProcess/DatabaseProcess.cpp:
1957 * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1958 * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
1959 * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1960 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1961 * Platform/IPC/ArgumentCoders.h:
1962 * Platform/IPC/ArgumentDecoder.cpp:
1963 * Platform/IPC/Connection.cpp:
1964 * Platform/IPC/Connection.h:
1967 2014-07-03 Benjamin Poulain <bpoulain@apple.com>
1969 [iOS][WK2] Fix small bugs of dynamicViewportSizeUpdate that were causing inaccuracies in the computed target
1970 https://bugs.webkit.org/show_bug.cgi?id=134582
1972 Reviewed by Tim Horton.
1974 This patch fixes two small bugs that were causing "jumpiness" on animated resize:
1975 1) The new scale was less accurate than the target scale, making the WebProcess force a worse scale on the content.
1976 2) The code putting back the rects in view was ignoring the obscured insets, constraining the scroll position more
1979 The first problem was cause by a series of rounding issues accumulating to the fact that "scale != targetScale"
1980 was almost never true.
1982 The first issue is that the unobscured content size was stored in integer coordinates. Because of that, it was
1983 impossible to determine accurately how much content is in the view.
1984 The outcome was that visibleHorizontalFraction was very inaccurate compared to what the UIProcess computed.
1986 Another issue affecting the scale is that scaleAfterViewportWidthChange was computing the widthToKeepInView
1987 on floating point. Since ARM64 does all those computations on doubles in the UIProcess, the value would be quite
1988 different from the received targetScale.
1990 Finally, the code uses withinEpsilon() instead of a strict equality to reduce the effect of rounding errors.
1992 For the second issue, the problem was that I was bounding the exposed rect to the page bounds. It is completely
1993 valid to have an exposed rect outside the page bounds, that area is just under the obscured insets.
1995 On the other hand, the unobscured rect needs to be within the bounds as we do not want to rotate to a rubberbanding
1996 position. The fix is simply to put the right rect into bounds, and the horizontal/vertical adjustement applies on
1999 * WebProcess/WebPage/ios/WebPageIOS.mm:
2000 (WebKit::scaleAfterViewportWidthChange):
2001 (WebKit::WebPage::dynamicViewportSizeUpdate):
2002 (WebKit::WebPage::updateVisibleContentRects):
2004 2014-07-03 Anders Carlsson <andersca@apple.com>
2008 * UIProcess/mac/WebPageProxyMac.mm:
2010 2014-07-03 Anders Carlsson <andersca@apple.com>
2012 Get rid of WebPageProxyCF.cpp
2013 https://bugs.webkit.org/show_bug.cgi?id=134609
2015 Reviewed by Dan Bernstein.
2017 * UIProcess/cf/WebPageProxyCF.cpp: Removed.
2018 * UIProcess/mac/WebPageProxyMac.mm:
2019 (WebKit::autosaveKey):
2020 (WebKit::WebPageProxy::saveRecentSearches):
2021 (WebKit::WebPageProxy::loadRecentSearches):
2022 * WebKit2.xcodeproj/project.pbxproj:
2024 2014-07-03 Tim Horton <timothy_horton@apple.com>
2026 [WK2] Revise the flat find indicator secondary highlight shadows
2027 https://bugs.webkit.org/show_bug.cgi?id=134607
2028 <rdar://problem/17554828>
2030 Reviewed by Brady Eidson.
2032 * WebProcess/WebPage/FindController.cpp:
2033 (WebKit::FindController::drawRect):
2034 Bring back the secondary highlight shadow, with new constants.
2036 2014-07-03 Tim Horton <timothy_horton@apple.com>
2038 [iOS][WK2] Sometimes the swipe snapshot stays up too long
2039 https://bugs.webkit.org/show_bug.cgi?id=134506
2040 <rdar://problem/17496803>
2042 Reviewed by Simon Fraser.
2044 Implement a transaction callback mechanism.
2045 The UI process can register a callback at any point, generally immediately after sending a message to the Web process.
2046 It will then send another message (in-order) with the callback ID to the Web process, which will put it into the next transaction
2047 (scheduling a new one if needed). When the transaction comes back to the UI process, the callbacks are performed.
2048 This ensures that the callback fires alongside a commit that includes the results of whatever messages were sent before it was registered.
2049 For now, all callbacks are fired just before committing layer changes, but it's possible future patches will want post-commit callbacks.
2051 Make use of this to remove the ViewGestureControllerIOS snapshots at the right time.
2053 * Shared/mac/RemoteLayerTreeTransaction.h:
2054 (WebKit::RemoteLayerTreeTransaction::callbackIDs):
2055 (WebKit::RemoteLayerTreeTransaction::setCallbackIDs):
2056 * Shared/mac/RemoteLayerTreeTransaction.mm:
2057 (WebKit::RemoteLayerTreeTransaction::encode):
2058 (WebKit::RemoteLayerTreeTransaction::decode):
2059 Add a vector of callback IDs to the transaction; encode and decode as appropriate.
2061 * UIProcess/DrawingAreaProxy.h:
2062 (WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing):
2063 (WebKit::DrawingAreaProxy::lastVisibleTransactionID): Deleted.
2064 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2065 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2066 (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
2067 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2068 (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2069 Add dispatchAfterEnsuringDrawing, which takes a function.
2070 When a callback is added, we send the callback ID to the Web process via the AddTransactionCallbackID message.
2071 Perform callbacks listed in the incoming transaction's vector of callback IDs.
2073 * WebProcess/WebPage/DrawingArea.h:
2074 (WebKit::DrawingArea::addTransactionCallbackID):
2075 * WebProcess/WebPage/DrawingArea.messages.in:
2076 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2077 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2078 (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2079 (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
2080 Keep track of the pending callback IDs on the drawing area, and move them into the transaction.
2081 We schedule a flush when installing a transaction callback on the premise that
2082 sometimes the action (goToBackForwardListItem in the swipe case) might have already occurred
2083 and been committed by the time the Web process receives AddTransactionCallbackID, so we need
2084 to cause another commit to send the callbacks across. If said commit is still pending, this is a no-op.
2086 * UIProcess/ios/ViewGestureControllerIOS.mm:
2087 (allViewGestureControllers):
2088 (WebKit::ViewGestureController::ViewGestureController):
2089 (WebKit::ViewGestureController::~ViewGestureController):
2090 (WebKit::ViewGestureController::endSwipeGesture):
2091 (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
2092 (WebKit::ViewGestureController::setRenderTreeSize):
2093 * UIProcess/mac/ViewGestureController.h:
2094 Keep a side-map of page IDs to ViewGestureControllers, so that we can safely get back to
2095 our ViewGestureController from the callback.
2097 When the callback fires, if it succeeded, set m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit,
2098 so that the commit (which is about to occur immediately after the callback returns) which calls
2099 setRenderTreeSize will (perhaps) remove the snapshot.
2101 If it failed, we remove the snapshot immediately, as this usually happens if the Web process crashed.
2103 2014-07-03 Brady Eidson <beidson@apple.com>
2105 Followup to "rects sent to ServicesOverlayController are wrong"
2106 https://bugs.webkit.org/show_bug.cgi?id=134568
2108 Rubberstamped by Tim Horton.
2110 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2111 (WebKit::ServicesOverlayController::drawSelectionHighlight): Don’t check to see if the
2112 proposed rect intersects the dirty rect. We always need to include all rects that form
2113 the selection when creating the DDHighlight.
2115 2014-07-03 Tim Horton <timothy_horton@apple.com>
2117 [WK2] RemoteLayerTreeDrawingAreaProxy re-checks a preference every commit for no reason
2118 https://bugs.webkit.org/show_bug.cgi?id=134586
2120 Reviewed by Benjamin Poulain.
2122 * UIProcess/DrawingAreaProxy.h:
2123 (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator):
2124 (WebKit::DrawingAreaProxy::showDebugIndicator): Deleted.
2125 (WebKit::DrawingAreaProxy::isShowingDebugIndicator): Remove this, nobody is using it.
2126 * UIProcess/WebPageProxy.cpp:
2127 (WebKit::WebPageProxy::preferencesDidChange):
2128 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2129 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2130 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2131 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2132 (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator):
2133 (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): Deleted.
2134 Check the debug indicator pref at construction time, and update the state when it changes.
2135 Checking it every commit was surprisingly expensive.
2137 2014-07-03 Antti Koivisto <antti@apple.com>
2139 Ensure frame creation messages get through to UI process
2140 https://bugs.webkit.org/show_bug.cgi?id=134591
2141 <rdar://problem/16918218>
2143 Reviewed by Anders Carlsson.
2145 If we are middle of handling a synchronous message from UI process a frame creation message back gets delayed.
2146 The subsequent synchronous DecidePolicyForNavigationAction message expects that the frame creation
2147 message has arrived first and fails.
2149 * WebProcess/WebPage/WebFrame.cpp:
2150 (WebKit::WebFrame::createWithCoreMainFrame):
2151 (WebKit::WebFrame::createSubframe):
2153 Send messages with DispatchMessageEvenWhenWaitingForSyncReply so they always go through in order.
2155 2014-07-03 Anders Carlsson <andersca@apple.com>
2157 Get rid of DecoderAdapter and EncoderAdapter
2158 https://bugs.webkit.org/show_bug.cgi?id=134598
2160 Reviewed by Andreas Kling.
2163 * WebKit2.xcodeproj/project.pbxproj:
2164 * WebProcess/WebPage/DecoderAdapter.cpp: Removed.
2165 * WebProcess/WebPage/DecoderAdapter.h: Removed.
2166 * WebProcess/WebPage/EncoderAdapter.cpp: Removed.
2167 * WebProcess/WebPage/EncoderAdapter.h: Removed.
2168 * WebProcess/WebPage/WebPage.cpp:
2170 2014-07-02 Anders Carlsson <andersca@apple.com>
2172 Stop using EncoderAdapter/DecoderAdapter for FormData
2173 https://bugs.webkit.org/show_bug.cgi?id=134571
2175 Reviewed by Andreas Kling.
2177 * Shared/Network/NetworkResourceLoadParameters.cpp:
2178 (WebKit::NetworkResourceLoadParameters::encode):
2179 (WebKit::NetworkResourceLoadParameters::decode):
2181 2014-07-03 Brady Eidson <beidson@apple.com>
2183 Selection rects sent to ServicesOverlayController are wrong.
2184 <rdar://problem/16727796> and https://bugs.webkit.org/show_bug.cgi?id=134568
2186 Reviewed by Darin Adler (and Tim Horton and Ryosuke Niwa).
2188 * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2189 (WebKit::WebEditorClient::selectionRectsDidChange): Also pass the GapRects to the ServicesOverlayController.
2190 * WebProcess/WebCoreSupport/WebEditorClient.h:
2192 * WebProcess/WebPage/ServicesOverlayController.h:
2193 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2194 (WebKit::expandForGap):
2195 (WebKit::compactRectsWithGapRects): Combine 3+ rects down to exactly 3 rects, then expand them based on GapRects.
2196 (WebKit::ServicesOverlayController::selectionRectsDidChange): Call compactRectsWithGapRects, then reverse the list.
2197 (WebKit::ServicesOverlayController::drawSelectionHighlight): Tell data detectors to flip this.
2198 (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Tell data detectors to flip this.
2199 (WebKit::ServicesOverlayController::drawCurrentHighlight): No need to flip this anymore.
2201 2014-07-03 Brady Eidson <beidson@apple.com>
2203 Possible crash in IconDatabase in WebCore::IconDatabase::dispatchDidRemoveAllIconsOnMainThread
2204 <rdar://problem/17437687> and https://bugs.webkit.org/show_bug.cgi?id=134517
2206 Reviewed by Eric Carlson.
2208 * UIProcess/WebContext.cpp:
2209 (WebKit::WebContext::~WebContext): Instead of directly deref’ing the WebIconDatabase, ask it to
2210 deref itself when appropriate.
2212 * UIProcess/WebIconDatabase.cpp:
2213 (WebKit::WebIconDatabase::WebIconDatabase):
2214 (WebKit::WebIconDatabase::didClose): If this WebIconDatabase is supposed to deref itself when
2215 appropriate, do so now.
2216 (WebKit::WebIconDatabase::derefWhenAppropriate): If the WebCore::IconDatabase is still open then
2218 * UIProcess/WebIconDatabase.h:
2220 2014-07-03 Carlos Garcia Campos <cgarcia@igalia.com>
2222 REGRESSION(r170676): [GTK] UI process crashes when the Web Process crashes
2223 https://bugs.webkit.org/show_bug.cgi?id=134541
2225 Reviewed by Gyuyoung Kim.
2227 It happens when attaching a new web process, because it tries to
2228 encode a null SessionState.
2230 * UIProcess/LegacySessionStateCodingNone.cpp:
2231 (WebKit::encodeLegacySessionState): Return an empty API::Data
2232 object instead of nullptr.
2233 (WebKit::encodeLegacySessionHistoryEntryData): Ditto.
2235 2014-07-03 Carlos Garcia Campos <cgarcia@igalia.com>
2237 REGRESSION(r170743): [GTK] [EFL] Build broken.
2238 https://bugs.webkit.org/show_bug.cgi?id=134585
2240 Reviewed by Philippe Normand.
2242 Add ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC) guards where needed.
2244 * WebProcess/Plugins/PluginView.cpp:
2245 (WebKit::PluginView::initializePlugin):
2246 * WebProcess/WebPage/WebPage.cpp:
2247 (WebKit::WebPage::createPlugin):
2249 2014-07-02 Benjamin Poulain <benjamin@webkit.org>
2251 [iOS][WK2] Make is safe/fast to use the animated resize API without resizing anything
2252 https://bugs.webkit.org/show_bug.cgi?id=134570
2254 Reviewed by Enrica Casucci.
2256 Today, if someone calls _beginAnimatedResizeWithUpdates-_endAnimatedResize, it is always a very heavy process
2257 forcing a relayout and can cause synchronous operations.
2259 We should not force the caller of the API to maintain their own state tracking, we should do that for them.
2261 With this patch, we track everything we need for a resize and only do the heavy lifting if anything has actually changed.
2263 * UIProcess/API/Cocoa/WKWebView.mm:
2264 (activeMinimumLayoutSize):
2265 (activeMinimumLayoutSizeForMinimalUI):
2266 (activeMaximumUnobscuredSize):
2267 (activeOrientation):
2268 This code is used in both _didRelaunchProcess and _beginAnimatedResizeWithUpdates. It is moved to static functions
2269 to avoid having it in two places.
2271 (-[WKWebView _didRelaunchProcess]):
2273 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2274 The updates now goes like this:
2275 1) Set _isAnimatingResize to prevent the undesired side effects updateBlock() if we really need to resize.
2276 2) Get all the original values before calling the update block.
2277 3) Call the update block.
2278 4a) If nothing useful for resize has changed, reset _isAnimatingResize to false.
2279 We also need to update the visible content rect because the update block may have changed something unrelated
2280 to the view size (scale, scroll position, etc).
2281 4b) If we really need to resize, proceed as usual.
2283 (-[WKWebView _endAnimatedResize]):
2284 With the changes in _beginAnimatedResizeWithUpdates:, _isAnimatingResize is only set for real cases of animated resize,
2285 bail out early if that flag isn't set.
2287 The remaining code is unchanged, it is just not indented due to the removal of the if() branch.
2289 2014-07-02 Roger Fong <roger_fong@apple.com>
2291 Improve handling of primary offscreen plugins.
2292 https://bugs.webkit.org/show_bug.cgi?id=134528.
2293 <rdar://problem/17471864>
2295 Reviewed by Dean Jackson.
2297 * WebProcess/Plugins/PluginView.cpp:
2298 Determine whether or not the plugin starts offscreen when the plugin is initialized.
2299 (WebKit::PluginView::initializePlugin):
2300 (WebKit::PluginView::pluginSnapshotTimerFired):
2301 * WebProcess/WebPage/WebPage.cpp:
2302 (WebKit::WebPage::createPlugin):
2303 Use the PluginProcessTypeNormal for offscreen plugins that are potentially primary plugins.
2305 2014-07-02 Enrica Casucci <enrica@apple.com>
2307 REGRESSION(WK2): Undo does not work in text fields in Safari.
2308 https://bugs.webkit.org/show_bug.cgi?id=134572
2309 <rdar://problem/17542238>
2311 Reviewed by Benjamin Poulain.
2313 This patch adds for iOS the same implementation we have already for OS X.
2315 * UIProcess/ios/PageClientImplIOS.h:
2316 * UIProcess/ios/PageClientImplIOS.mm:
2317 (-[WKEditCommandObjC initWithWebEditCommandProxy:]):
2318 (-[WKEditCommandObjC command]):
2319 (-[WKEditorUndoTargetObjC undoEditing:]):
2320 (-[WKEditorUndoTargetObjC redoEditing:]):
2321 (WebKit::PageClientImpl::PageClientImpl):
2322 (WebKit::PageClientImpl::registerEditCommand):
2323 (WebKit::PageClientImpl::clearAllEditCommands):
2324 (WebKit::PageClientImpl::canUndoRedo):
2325 (WebKit::PageClientImpl::executeUndoRedo):
2327 2014-07-02 Gavin Barraclough <baraclough@apple.com>
2329 ProcessAssertion should also prevent UIApp suspension
2330 https://bugs.webkit.org/show_bug.cgi?id=134563
2332 Reviewed by Dan Bernstein.
2334 If the application suspends then the child processes will, too.
2335 Use beginBackgroundTaskWithName:expirationHandler: to request that the application remain runnable
2336 while waiting for background tasks to complete.
2338 * UIProcess/ProcessAssertion.cpp:
2339 (WebKit::ProcessAssertion::~ProcessAssertion):
2341 * UIProcess/ProcessAssertion.h:
2343 * UIProcess/ios/ProcessAssertionIOS.mm:
2344 (+[WKProcessAssertionBackgroundTaskManager shared]):
2345 - singleton WKProcessAssertionBackgroundTaskManager.
2346 (-[WKProcessAssertionBackgroundTaskManager init]):
2347 (-[WKProcessAssertionBackgroundTaskManager dealloc]):
2348 - register/remove notification handlers.
2349 (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
2350 - if we need to be runnable make sure we're holding a BackgroundTask, if not release it.
2351 (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackgroundOrWillEnterForeground:]):
2352 - detect when the app enters/leaves foreground; calls to _updateBackgroundTask.
2353 (-[WKProcessAssertionBackgroundTaskManager incrementNeedsToRunInBackgroundCount]):
2354 (-[WKProcessAssertionBackgroundTaskManager decrementNeedsToRunInBackgroundCount]):
2355 - interface to update the count; calls to _updateBackgroundTask.
2356 (WebKit::ProcessAssertion::ProcessAssertion):
2357 (WebKit::ProcessAssertion::~ProcessAssertion):
2358 - count ProcessAssertions in and out of existance.
2359 (WebKit::ProcessAssertion::setState):
2360 - count when the state changes.
2362 2014-07-01 Mark Rowe <mrowe@apple.com>
2364 <https://webkit.org/b/134522> Remove duplication in code that prepares the user agent string on Mac and iOS
2366 Reviewed by Simon Fraser.
2368 * UIProcess/ios/WebPageProxyIOS.mm:
2369 (WebKit::webKitBundleVersionString): Return the entire CFBundleVersion now that WebCore handles formatting it.
2370 (WebKit::WebPageProxy::standardUserAgent):
2371 * UIProcess/mac/WebPageProxyMac.mm:
2372 (WebKit::webKitBundleVersionString): Ditto.
2373 (WebKit::WebPageProxy::standardUserAgent):
2375 2014-06-28 Oliver Hunt <oliver@apple.com>
2377 Restrict network process sandbox
2378 https://bugs.webkit.org/show_bug.cgi?id=134360
2380 Reviewed by Sam Weinig.
2382 Add more restrictions to the network process sandbox.
2384 * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2385 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2386 Always use the cache directory provided in the initialization parameters,
2387 and make sure we consume the cookie directory extension.
2388 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2389 Make the sandbox profile much more restrictive.
2390 * Shared/Network/NetworkProcessCreationParameters.cpp:
2391 (WebKit::NetworkProcessCreationParameters::encode):
2392 (WebKit::NetworkProcessCreationParameters::decode):
2393 * Shared/Network/NetworkProcessCreationParameters.h:
2394 The network process now requires an extension to access
2396 * Shared/mac/SandboxUtilities.cpp:
2397 (WebKit::pathForProcessContainer):
2398 * Shared/mac/SandboxUtilities.h:
2399 We need to be able to get hold of our container so
2400 that we can get the correct cookie storage directory.
2401 * UIProcess/WebContext.cpp:
2402 (WebKit::WebContext::ensureNetworkProcess):
2403 We have to pass in the an extension for the cookie storage directory when
2404 initalising the network process
2405 * UIProcess/mac/WebContextMac.mm:
2406 (WebKit::WebContext::platformDefaultCookieStorageDirectory):
2407 Make sure we provide the correct location on IOS
2408 * WebProcess/cocoa/WebProcessCocoa.mm:
2409 (WebKit::WebProcess::platformInitializeWebProcess):
2410 Consume the cookie storage extension
2412 2014-07-02 Csaba Osztrogonác <ossy@webkit.org>
2414 URTBF after r170725.
2416 * CMakeLists.txt: Removed Shared/LegacySessionState.cpp.
2418 2014-07-02 Csaba Osztrogonác <ossy@webkit.org>
2420 URTBF after r170719 for !CF platforms.
2422 * UIProcess/WebPageProxy.cpp:
2423 (WebKit::WebPageProxy::sessionStateData): Deleted.
2424 (WebKit::WebPageProxy::restoreFromSessionStateData): Deleted.
2426 2014-07-02 Mark Rowe <mrowe@apple.com>
2428 <https://webkit.org/b/134521> iOS should use shared code to determine the system marketing version
2430 Reviewed by Simon Fraser.
2432 * Shared/ios/ChildProcessIOS.mm: Update #import.
2433 * Shared/mac/ChildProcessMac.mm: Ditto.
2435 2014-07-02 Anders Carlsson <andersca@apple.com>
2437 Rip out more dead code
2438 https://bugs.webkit.org/show_bug.cgi?id=134562
2440 Reviewed by Andreas Kling.
2442 * Shared/LegacySessionState.cpp: Removed.
2443 * Shared/LegacySessionState.h: Removed.
2444 * Shared/WebBackForwardListItem.cpp:
2445 (WebKit::WebBackForwardListItem::WebBackForwardListItem): Deleted.
2446 (WebKit::WebBackForwardListItem::backForwardData): Deleted.
2447 (WebKit::WebBackForwardListItem::setBackForwardData): Deleted.
2448 (WebKit::WebBackForwardListItem::encode): Deleted.
2449 (WebKit::WebBackForwardListItem::decode): Deleted.
2450 * Shared/WebBackForwardListItem.h:
2451 (WebKit::WebBackForwardListItem::create): Deleted.
2452 (WebKit::WebBackForwardListItem::setOriginalURL): Deleted.
2453 (WebKit::WebBackForwardListItem::setURL): Deleted.
2454 (WebKit::WebBackForwardListItem::setTitle): Deleted.
2455 * UIProcess/WebPageProxy.cpp:
2456 * WebKit2.xcodeproj/project.pbxproj:
2457 * WebProcess/WebPage/WebPage.cpp:
2459 2014-07-02 Anders Carlsson <andersca@apple.com>
2461 RestoreSession should take a vector of BackForwardListItemStates
2462 https://bugs.webkit.org/show_bug.cgi?id=134558
2464 Reviewed by Tim Horton.
2466 * Scripts/webkit2/messages.py:
2469 * Shared/WebPageCreationParameters.cpp:
2470 (WebKit::WebPageCreationParameters::encode):
2471 (WebKit::WebPageCreationParameters::decode):
2472 * Shared/WebPageCreationParameters.h:
2473 * UIProcess/WebBackForwardList.cpp:
2474 (WebKit::WebBackForwardList::itemStates):
2475 * UIProcess/WebBackForwardList.h:
2476 * UIProcess/WebPageProxy.cpp:
2477 (WebKit::WebPageProxy::restoreFromSessionState):
2478 (WebKit::WebPageProxy::creationParameters):
2479 * WebProcess/WebPage/WebPage.cpp:
2480 (WebKit::WebPage::WebPage):
2481 (WebKit::WebPage::restoreSession):
2482 (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem): Deleted.
2483 * WebProcess/WebPage/WebPage.h:
2484 * WebProcess/WebPage/WebPage.messages.in:
2486 2014-07-02 Anders Carlsson <andersca@apple.com>
2488 Store the back forward list item id inside BackForwardListItemState
2489 https://bugs.webkit.org/show_bug.cgi?id=134557
2491 Reviewed by Tim Horton.
2493 * Shared/SessionState.cpp:
2494 (WebKit::BackForwardListItemState::encode):
2495 (WebKit::BackForwardListItemState::decode):
2496 * Shared/SessionState.h:
2497 * Shared/WebBackForwardListItem.cpp:
2498 (WebKit::WebBackForwardListItem::create):
2499 (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2500 (WebKit::WebBackForwardListItem::encode):
2501 * Shared/WebBackForwardListItem.h:
2502 (WebKit::WebBackForwardListItem::itemID):
2503 * UIProcess/WebBackForwardList.cpp:
2504 (WebKit::WebBackForwardList::restoreFromState):
2505 * UIProcess/WebProcessProxy.cpp:
2506 (WebKit::WebProcessProxy::addBackForwardItem):
2508 2014-07-02 Manuel Rego Casasnovas <rego@igalia.com>
2510 Unreviewed. EFL and GTK build fix after r170716.
2512 * UIProcess/LegacySessionStateCodingNone.cpp:
2513 (WebKit::decodeLegacySessionState): Update method signature.
2515 2014-07-02 Anders Carlsson <andersca@apple.com>
2517 Begin ripping out the old session state code
2518 https://bugs.webkit.org/show_bug.cgi?id=134556
2520 Reviewed by Andreas Kling.
2522 * UIProcess/WebBackForwardList.h:
2523 * UIProcess/WebPageProxy.h:
2524 * UIProcess/cf/WebBackForwardListCF.cpp: Removed.
2525 * UIProcess/cf/WebPageProxyCF.cpp:
2526 (WebKit::WebPageProxy::sessionStateData): Deleted.
2527 (WebKit::WebPageProxy::restoreFromSessionStateData): Deleted.
2528 * WebKit2.xcodeproj/project.pbxproj:
2530 2014-07-02 Anders Carlsson <andersca@apple.com>
2532 Use legacy state coding directly in WKWebView
2533 https://bugs.webkit.org/show_bug.cgi?id=134553
2535 Reviewed by Dan Bernstein.
2537 * UIProcess/API/C/WKPage.cpp:
2538 (WKPageRestoreFromSessionState):
2539 * UIProcess/API/C/WKSessionStateRef.cpp:
2540 (WKSessionStateCreateFromData):
2541 * UIProcess/API/Cocoa/WKWebView.mm:
2542 (-[WKWebView _sessionStateData]):
2543 (-[WKWebView _sessionState]):
2544 (-[WKWebView _restoreFromSessionStateData:]):
2545 (-[WKWebView _restoreFromSessionState:]):
2546 (releaseNSData): Deleted.
2547 * UIProcess/LegacySessionStateCoding.h:
2548 * UIProcess/WebPageProxy.cpp:
2549 (WebKit::WebPageProxy::restoreFromSessionState):
2550 (WebKit::WebPageProxy::restoreFromState): Deleted.
2551 * UIProcess/WebPageProxy.h:
2552 * UIProcess/mac/LegacySessionStateCoding.cpp:
2553 (WebKit::decodeLegacySessionState):
2555 2014-07-02 Anders Carlsson <andersca@apple.com>
2557 Add -[WKWebView _sessionStateData] and -[WKWebView _restoreFromSessionStateData:]
2558 https://bugs.webkit.org/show_bug.cgi?id=134549
2560 Reviewed by Dan Bernstein.
2562 * UIProcess/API/Cocoa/WKWebView.mm:
2563 (-[WKWebView _sessionState]):
2564 (-[WKWebView _sessionStateData]):
2565 (-[WKWebView _restoreFromSessionState:]):
2566 (-[WKWebView _restoreFromSessionStateData:]):
2567 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2569 2014-07-02 Carlos Garcia Campos <cgarcia@igalia.com>
2571 [GTK] WebKitVersion.h should be shared between UI and Web Process APIs
2572 https://bugs.webkit.org/show_bug.cgi?id=134538
2574 Reviewed by Martin Robinson.
2576 To be able to check current version from web extensions too.
2578 * UIProcess/API/gtk/WebKitVersion.h.in: Allow to include WebKitVersion.h also from webkit-web-extension.h.
2579 * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h: Include WebKitVersion.h.
2581 2014-07-02 Carlos Garcia Campos <cgarcia@igalia.com>
2583 [GTK] WebKitWebView::create should receive information about the navigation action
2584 https://bugs.webkit.org/show_bug.cgi?id=133680
2586 Reviewed by Martin Robinson.
2588 Add WebKitNavigationAction boxed type representing a navigation
2589 action to be passed as parameter of WebKitWebView::create
2590 signal. In the future it could be also for the
2591 WebKitNavigationPolicyDecision class. The class contains
2592 information about a navigation action like the navigation type,
2593 the request, the mouse button and key modifiers and whether it was
2594 started by a user gesture. This information is needed to be able
2595 to implement a proper popup blocker. Since all that information is
2596 not provided by the C API, we have switched the UI client to use a
2597 custom client derived from API::UIClient. This also avoids a lot
2598 of toAPI -> toImpl unneeded conversions.
2600 * PlatformGTK.cmake: Add new files to compilation.
2601 * UIProcess/API/gtk/WebKitHitTestResult.cpp:
2602 (webkitHitTestResultCreate): Use a WebHitTestResult::Data const
2603 reference instead of a pointer to a WebHitTestResult.
2604 (webkitHitTestResultCompare): Ditto.
2605 * UIProcess/API/gtk/WebKitHitTestResultPrivate.h:
2606 * UIProcess/API/gtk/WebKitNavigationAction.cpp: Added.
2607 (webkitNavigationActionCreate): Create a WebKitNavigationAction
2608 for the given ResourceRequest and NavigationActionData.
2609 (webkit_navigation_action_copy):
2610 (webkit_navigation_action_free):
2611 (webkit_navigation_action_get_navigation_type):
2612 (webkit_navigation_action_get_mouse_button):
2613 (webkit_navigation_action_get_modifiers):
2614 (webkit_navigation_action_get_request):
2615 (webkit_navigation_action_is_user_gesture):
2616 * UIProcess/API/gtk/WebKitNavigationAction.h: Added.
2617 * UIProcess/API/gtk/WebKitNavigationActionPrivate.h: Added.
2618 * UIProcess/API/gtk/WebKitNavigationPolicyDecision.h:
2619 * UIProcess/API/gtk/WebKitPrivate.cpp:
2621 (toWebKitNavigationType):
2622 (toWebKitMouseButton):
2623 * UIProcess/API/gtk/WebKitPrivate.h:
2624 * UIProcess/API/gtk/WebKitUIClient.cpp:
2625 (UIClient::UIClient): Implement the UIClient using a custom class.
2626 (attachUIClientToView): Set the UIClient directly to the WebPageProxy.
2627 (createNewPage): Deleted.
2628 (showPage): Deleted.
2629 (closePage): Deleted.
2630 (runJavaScriptAlert): Deleted.
2631 (runJavaScriptConfirm): Deleted.
2632 (runJavaScriptPrompt): Deleted.
2633 (toolbarsAreVisible): Deleted.
2634 (setToolbarsAreVisible): Deleted.
2635 (menuBarIsVisible): Deleted.
2636 (setMenuBarIsVisible): Deleted.
2637 (statusBarIsVisible): Deleted.
2638 (setStatusBarIsVisible): Deleted.
2639 (isResizable): Deleted.
2640 (setIsResizable): Deleted.
2641 (getWindowFrame): Deleted.
2642 (setWindowFrame): Deleted.
2643 (mouseDidMoveOverElement): Deleted.
2644 (printFrame): Deleted.
2645 (runOpenPanel): Deleted.
2646 (decidePolicyForGeolocationPermissionRequest): Deleted.
2647 (runModal): Deleted.
2648 * UIProcess/API/gtk/WebKitWebView.cpp:
2649 (webkitWebViewCreate): Add WebKitNavigationAction parameter.
2650 (webkit_web_view_class_init): Add WebKitNavigationAction paramter
2652 (webkitWebViewCreateNewPage): Add WebKitNavigationAction parameter
2653 and pass it to the signal callbacks.
2654 (webkitWebViewMouseTargetChanged): Use a WebHitTestResult::Data
2656 (webkitWebViewPopulateContextMenu): Ditto.
2657 * UIProcess/API/gtk/WebKitWebView.h:
2658 * UIProcess/API/gtk/WebKitWebViewPrivate.h:
2659 * UIProcess/API/gtk/WebKitWindowProperties.cpp:
2660 (webkitWindowPropertiesUpdateFromWebWindowFeatures): Use a
2661 WebCore::WindowFeatures const reference.
2662 * UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h:
2663 * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section.
2664 * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
2665 * UIProcess/API/gtk/webkit2.h: Include WebKitNavigationAction.h.
2667 2014-07-01 KwangHyuk Kim <hyuki.kim@samsung.com>
2669 [EFL] Fix occurrence of two cursors on WK2 EFL.
2670 https://bugs.webkit.org/show_bug.cgi?id=134436
2672 Reviewed by Anders Carlsson.
2674 ecore_x_window_cursor is released when ecore_evas_object_cursor should be shown in order to avoid occurrence of two cursors.
2676 * UIProcess/API/efl/EwkView.cpp:
2677 (EwkView::updateCursor):
2679 2014-07-01 Gyuyoung Kim <gyuyoung.kim@samsung.com>
2681 Fix build break on EFL and GTK ports since r170683
2682 https://bugs.webkit.org/show_bug.cgi?id=134536
2684 Unreviewed, build fix.
2688 2014-07-01 Dean Jackson <dino@apple.com>
2690 Make LogsPageMessagesToSystemConsoleEnabled a global debug preference
2691 https://bugs.webkit.org/show_bug.cgi?id=134534
2693 Reviewed by Joseph Pecoraro.
2695 * Shared/WebPreferencesDefinitions.h:
2697 2014-07-01 Tim Horton <timothy_horton@apple.com>
2699 Handle invalid data more gracefully.
2701 Reviewed by Anders Carlsson.
2703 * UIProcess/mac/LegacySessionStateCoding.cpp:
2704 (WebKit::decodeFormData):
2705 (WebKit::decodeBackForwardTreeNode):
2707 2014-07-01 Mark Rowe <mrowe@apple.com>
2709 Add a missing return statement in WKPageCopySessionState.
2711 Reviewed by Anders Carlsson.
2713 * UIProcess/API/C/WKPage.cpp:
2714 (WKPageCopySessionState):
2716 2014-07-01 Anders Carlsson <andersca@apple.com>
2718 Don't encode/decode the snapshot UUID
2719 https://bugs.webkit.org/show_bug.cgi?id=134532
2721 Reviewed by Sam Weinig.
2723 * UIProcess/mac/LegacySessionStateCoding.cpp:
2724 (WebKit::encodeSessionHistory):
2725 (WebKit::decodeSessionHistoryEntry):
2727 2014-07-01 Commit Queue <commit-queue@webkit.org>
2729 Unreviewed, rolling out r170608.
2730 https://bugs.webkit.org/show_bug.cgi?id=134533
2732 Safari keeps crashing on device due to sandbox violation.
2733 (Requested by enrica on #webkit).
2737 "Restrict network process sandbox"
2738 https://bugs.webkit.org/show_bug.cgi?id=134360
2739 http://trac.webkit.org/changeset/170608
2741 2014-07-01 Pratik Solanki <psolanki@apple.com>
2743 Encode/decode CFURLRequestRefs when USE(CFNETWORK) is enabled
2744 https://bugs.webkit.org/show_bug.cgi?id=134454
2745 <rdar://problem/17510980>
2747 Reviewed by Andreas Kling.
2749 Use new helper methods to serialize/deserialize CFURLRequestRef directly so we can avoid
2750 creating NSURLRequest.
2752 * Shared/mac/WebCoreArgumentCodersMac.mm:
2753 (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2754 (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2756 2014-07-01 Benjamin Poulain <benjamin@webkit.org>
2758 [iOS][WK2] Fix a race between the short tap and long tap highlight
2759 https://bugs.webkit.org/show_bug.cgi?id=134530
2761 Reviewed by Enrica Casucci.
2763 There was a potential race of event that can theoretically cause WKContentViewInteraction
2764 to call [WKContentView _showTapHighlight] after all interactions have been cancelled.
2766 The race would be like this:
2767 1) On a short tap, _singleTapRecognized: is called, a tap highlight ID is defined and
2768 _potentialTapInProgress is set to YES.
2769 2) For some reason, the gesture is cancelled. The method _singleTapDidReset is called,
2770 setting _potentialTapInProgress but leaving the tap highlight ID as valid.
2771 3) The UIProcess receives the tap highlight information from the WebProcess, _didGetTapHighlightForRequest:
2772 has a valid ID, _potentialTapInProgress is false -> the highlight is shown right away as if a long tap
2775 The missing piece that causes this is _singleTapDidReset: must also invalidate the tap highlight ID. This is done
2776 in the new static function cancelPotentialTapIfNecessary().
2778 Just invalidating the ID would create another race:
2779 1) Short tap gesture recognizer starts.
2780 2) The long press recognizer starts before (1) is commited.
2781 3) The long press recognizers sets up its own tap highlight ID.
2782 4) The short tap gesture recognizer resets, erasing the tap highlight ID defined in (3).
2784 To avoid this, the long press gesture recognizers immediately cancels any potential tap in progress.
2785 If _singleTapDidReset: is called before (3), this does nothing. If the reset is called after (3),
2786 _singleTapDidReset does nothing.
2788 * UIProcess/ios/WKContentViewInteraction.mm:
2789 (-[WKContentView _highlightLongPressRecognized:]):
2790 (cancelPotentialTapIfNecessary):
2791 (-[WKContentView _singleTapDidReset:]):
2793 2014-07-01 Anders Carlsson <andersca@apple.com>
2795 Add ABI hacks to allow WKPageRef to use WKSessionStateRef
2796 https://bugs.webkit.org/show_bug.cgi?id=134529
2798 Reviewed by Sam Weinig.
2800 * UIProcess/API/APISessionState.h:
2801 Add a sessionState() getter.
2803 * UIProcess/API/C/WKPage.cpp:
2804 (WKPageCopySessionState):
2805 Add a hack where we return a WKSessionStateRef if the least significant bit of the context pointer
2806 is 1, and a WKDataRef otherwise.
2808 (WKPageRestoreFromSessionState):
2809 Handle both WKDataRef and WKSessionStateref.
2811 * UIProcess/API/C/WKPage.h:
2812 Use WKTypeRefs for state saving and restoration.
2814 * UIProcess/API/C/WKSessionStateRef.cpp:
2815 (WKSessionStateCopyData):
2816 Add helper function.
2818 2014-07-01 Anders Carlsson <andersca@apple.com>
2820 WKPageRestoreFromSessionState should use the new session state restore code path
2821 https://bugs.webkit.org/show_bug.cgi?id=134526
2823 Reviewed by Tim Horton.
2825 * UIProcess/API/C/WKPage.cpp:
2826 (WKPageRestoreFromSessionState):
2827 Use the new code path.
2829 * UIProcess/WebPageProxy.cpp:
2830 (WebKit::WebPageProxy::restoreFromState):
2831 Only restore the back-forward state if we have a back-forward list.
2833 * UIProcess/mac/LegacySessionStateCoding.cpp:
2834 (WebKit::encodeSessionHistory):
2835 Save the original URL string as well.
2837 (WebKit::decodeV1SessionHistory):
2838 If we don't have a current index, set it to Nullopt instead of 0.
2840 2014-07-01 Gyuyoung Kim <gyuyoung.kim@samsung.com>
2842 Unreviewed. EFL and GTK build fix since r170654.
2844 * UIProcess/LegacySessionStateCodingNone.cpp: Add a dummy encodeLegacySessionState(const SessionState&).
2845 (WebKit::encodeLegacySessionState):
2847 2014-07-01 Dan Bernstein <mitz@apple.com>
2849 Crash in WebDocumentLoader::setNavigationID
2850 https://bugs.webkit.org/show_bug.cgi?id=134520
2852 Reviewed by Anders Carlsson.
2854 * WebProcess/WebPage/WebFrame.cpp:
2855 (WebKit::WebFrame::didReceivePolicyDecision): Null-check the policy document loader.
2857 2014-07-01 Dan Bernstein <mitz@apple.com>
2861 * UIProcess/API/APILoaderClient.h:
2862 (API::LoaderClient::didDestroyNavigation):
2864 2014-07-01 Anders Carlsson <andersca@apple.com>
2866 Use the new legacy session state coding in WKPageCopySessionState
2867 https://bugs.webkit.org/show_bug.cgi?id=134516
2869 Reviewed by Tim Horton.
2871 * UIProcess/API/C/WKPage.cpp:
2872 (WKPageCopySessionState):
2873 Call encodeLegacySessionState.
2875 * UIProcess/mac/LegacySessionStateCoding.cpp:
2876 (WebKit::encodeSessionHistoryEntryData):
2877 Use leakPtr() so we won't attempt to double-free the buffer.
2879 (WebKit::createDictionary):
2882 (WebKit::encodeLegacySessionState):
2883 Don't encode the provisional URL if it's empty.
2885 2014-07-01 Chris Fleizach <cfleizach@apple.com>
2887 AX: [iOS WebKit2] Support for Speak selection
2888 https://bugs.webkit.org/show_bug.cgi?id=134512
2890 Reviewed by Darin Adler.
2892 Implement a method that Speak Selection can use to retrieve the selected content.
2894 * UIProcess/ios/WKContentViewInteraction.mm:
2895 (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
2897 2014-07-01 Anders Carlsson <andersca@apple.com>
2899 Update the highest back-forward list item ID in the other WebBackForwardListItem constructor
2900 https://bugs.webkit.org/show_bug.cgi?id=134515
2902 Reviewed by Tim Horton.
2904 * Shared/WebBackForwardListItem.cpp:
2905 (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2907 2014-07-01 Brady Eidson <beidson@apple.com>
2909 Fix ServicesOverlayController teardown
2910 <rdar://problem/17523998> and https://bugs.webkit.org/show_bug.cgi?id=134510
2912 Reviewed by Mark Rowe.
2914 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2915 (WebKit::ServicesOverlayController::~ServicesOverlayController): Flipped logic on null-checking the overlay.
2917 2014-07-01 Sam Weinig <sam@webkit.org>
2919 [Cocoa][Mac] WKWebView should automatically set topContentInset when beneath a toolbar
2920 <rdar://problem/17523159>
2921 https://bugs.webkit.org/show_bug.cgi?id=134496
2923 Reviewed by Beth Dakin.
2925 - Adds _automaticallyAdjustsContentInsets SPI to both WKView and WKWebView.
2926 - Defaults _automaticallyAdjustsContentInsets to NO for WKView to keep legacy clients working.
2927 - Defaults _automaticallyAdjustsContentInsets to YES for WKWebView.
2929 * UIProcess/API/Cocoa/WKViewPrivate.h:
2930 Add _automaticallyAdjustsContentInsets SPI.
2932 * UIProcess/API/Cocoa/WKWebView.mm:
2933 (-[WKWebView initWithFrame:configuration:]):
2934 Default _automaticallyAdjustsContentInsets to YES for WKWebView.
2936 (-[WKWebView _setTopContentInset:]):
2937 (-[WKWebView _topContentInset]):
2938 Change to forward to the WKView, since we now do coalescing and caching there.
2940 (-[WKWebView _setAutomaticallyAdjustsContentInsets:]):
2941 (-[WKWebView _automaticallyAdjustsContentInsets]):
2942 Forward to the WKView.
2944 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2945 Add _automaticallyAdjustsContentInsets SPI.
2947 * UIProcess/API/mac/WKView.mm:
2948 (-[WKView renewGState]):
2949 Ensure the contentInset is updated when the view changes, as its relative location to the toolbar may have changed.
2951 (-[WKView addWindowObserversForWindow:]):
2952 (-[WKView removeWindowObservers]):
2953 (-[WKView observeValueForKeyPath:ofObject:change:context:]):
2954 Add observers for the contentLayoutRect and titlebarAppearsTransparent properties on the window. If either of them
2955 change, we need to recalculate the content inset.
2957 (-[WKView _updateContentInsetsIfAutomatic]):
2958 If _automaticallyAdjustsContentInsets is YES, follow the same rules as AppKit in setting the top content inset. Like
2959 AppKit this is only done when:
2960 - The window's style mask has the NSFullSizeContentViewWindowMask bit.
2961 - The window does not have titlebarAppearsTransparent set.
2962 - And we are not in an enclosing NSScrollView.
2964 (-[WKView _setTopContentInset:]):
2965 (-[WKView _topContentInset]):
2966 Coalesce setting the topContentInset to avoid a visual lag when resizing the window that was caused by us sending
2967 multiple topContentInsets to the WebContentProcess per runloop cycle. The reason for the lag was that at the time
2968 we observe the contentLayoutRect changing, our view may not yet be in its final position yet, so the inset will be
2969 temporarily wrong. When the view is finally positioned correctly, we will get a renewGState, at which point we will
2970 again calculate the inset, which now will be correct. Since these both happen in the same runloop iteration, we can
2971 just defer sending the inset to the WebContentProcess.
2973 (-[WKView _setAutomaticallyAdjustsContentInsets:]):
2974 (-[WKView _automaticallyAdjustsContentInsets]):
2977 2014-07-01 Anders Carlsson <andersca@apple.com>
2979 Add a function for restoring page state given a SessionState object
2980 https://bugs.webkit.org/show_bug.cgi?id=134509
2982 Reviewed by Tim Horton.
2984 * Shared/WebBackForwardListItem.h:
2985 (WebKit::WebBackForwardListItem::itemState):
2986 * UIProcess/WebBackForwardList.cpp:
2987 (WebKit::WebBackForwardList::saveState):
2988 * UIProcess/WebBackForwardList.h:
2989 * UIProcess/WebPageProxy.cpp:
2990 (WebKit::WebPageProxy::saveState):
2991 * UIProcess/WebPageProxy.h:
2993 2014-07-01 Dan Bernstein <mitz@apple.com>
2995 [Cocoa] Navigation parameter in navigation delegate messages is nil for navigations started by the Web Content process
2996 https://bugs.webkit.org/show_bug.cgi?id=134482
2998 Reviewed by Tim Horton.
3000 * UIProcess/API/APILoaderClient.h:
3001 (API::LoaderClient::didDestroyNavigation): New client function, called when a navigation ID
3002 is not going to be used anymore.
3004 * UIProcess/API/Cocoa/WKWebView.mm:
3005 (-[WKWebView _restoreFromSessionState:]): If restoring triggered a navigation, create a
3006 WKNavigation for its ID.
3008 * UIProcess/Cocoa/NavigationState.h:
3009 * UIProcess/Cocoa/NavigationState.mm:
3010 (WebKit::NavigationState::createLoadRequestNavigation): Removed FIXME, because we now remove
3011 navigations from the map in LoaderClient::didDestroyNavigation.
3012 (WebKit::NavigationState::createBackForwardNavigation): Ditto.
3013 (WebKit::NavigationState::createReloadNavigation): Ditto.
3014 (WebKit::NavigationState::createLoadDataNavigation): Ditto.
3015 (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): If we are only
3016 getting a navigation ID now, create a WKNavigation for it. Also changed to create the
3017 NSURLRequest lazily.
3018 (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Assert that
3019 navigationID is not zero and that it maps to an existing WKNavigation.
3020 (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
3022 (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
3023 (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
3024 (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
3025 (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
3026 (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
3027 (WebKit::NavigationState::LoaderClient::didDestroyNavigation): Override the new client
3028 function to remove the navigation from the map.
3029 (WebKit::NavigationState::LoaderClient::processDidCrash): Clear the navigations map.
3031 * UIProcess/WebFrameListenerProxy.cpp:
3032 (WebKit::WebFrameListenerProxy::WebFrameListenerProxy): Initialize new m_navigationID
3034 (WebKit::WebFrameListenerProxy::receivedPolicyDecision): Pass the navigation ID to
3035 WebFrame::receivedPolicyDecision.
3036 * UIProcess/WebFrameListenerProxy.h:
3037 (WebKit::WebFrameListenerProxy::navigationID): Added this accessor.
3038 (WebKit::WebFrameListenerProxy::setNavigationID): Ditto.
3040 * UIProcess/WebFrameProxy.cpp:
3041 (WebKit::WebFrameProxy::receivedPolicyDecision): Added navigationID parameter, which is
3042 passed along to the WebPageProxy.
3043 * UIProcess/WebFrameProxy.h:
3045 * UIProcess/WebPageProxy.cpp:
3046 (WebKit::WebPageProxy::receivedPolicyDecision): Added navigationID parameter, which is
3047 passed along in the message to the Web Content process.
3048 (WebKit::WebPageProxy::restoreFromSessionStateData): Changed to return a navigation ID of 0.
3049 (WebKit::WebPageProxy::restoreFromState): Changed to return a navigation ID if one was
3051 (WebKit::WebPageProxy::didDestroyNavigation): Added. Calls the new client function.
3052 (WebKit::WebPageProxy::decidePolicyForNavigationAction): Added navigationID and
3053 newNavigationID parameters. If a main-frame navigation doesn’t already have an ID, assign it
3054 a new ID and return it in the newNavigationID parmeter as well as setting it on the listener
3055 for the asynchronous case.
3056 * UIProcess/WebPageProxy.h:
3058 * UIProcess/WebPageProxy.messages.in: Added navigationID and newNavigationID parameters.
3060 * UIProcess/cf/WebPageProxyCF.cpp:
3061 (WebKit::WebPageProxy::restoreFromSessionStateData): Changed to return a navigation ID if
3064 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3065 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): Updated for additional
3067 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Send the navigation
3068 ID to the UI process, get the new navigation ID from the reply, and set it on the document
3071 * WebProcess/WebPage/WebDocumentLoader.cpp:
3072 (WebKit::WebDocumentLoader::detachFromFrame): Override to let the UI process know that the
3073 navigation ID will not be used anymore.
3074 * WebProcess/WebPage/WebDocumentLoader.h:
3076 * WebProcess/WebPage/WebFrame.cpp:
3077 (WebKit::WebFrame::didReceivePolicyDecision): Added navigationID parameter, set it on the
3079 (WebKit::WebFrame::documentLoaderDetached): Pass the message along to the UI process.
3080 * WebProcess/WebPage/WebFrame.h:
3082 * WebProcess/WebPage/WebPage.cpp:
3083 (WebKit::WebPage::didReceivePolicyDecision): Pass new navigationID parameter along.
3084 * WebProcess/WebPage/WebPage.h:
3086 * WebProcess/WebPage/WebPage.messages.in: Added navigationID parameter.
3088 2014-07-01 Anders Carlsson <andersca@apple.com>
3092 * WebKit2.xcodeproj/project.pbxproj:
3094 2014-07-01 Anders Carlsson <andersca@apple.com>
3096 Temporarily encode and decode the snapshot UUID
3097 https://bugs.webkit.org/show_bug.cgi?id=134507
3099 Reviewed by Tim Horton.
3101 * UIProcess/mac/LegacySessionStateCoding.cpp:
3102 (WebKit::encodeSessionHistory):
3103 (WebKit::decodeSessionHistoryEntry):
3104 (WebKit::decodeSessionHistoryEntries):
3106 2014-07-01 Anders Carlsson <andersca@apple.com>
3108 Implement encodeSessionHistoryEntryData
3109 https://bugs.webkit.org/show_bug.cgi?id=134505
3111 Reviewed by Tim Horton.
3113 * UIProcess/API/C/WKPage.cpp:
3114 (WKPageCopySessionState):
3115 Add back a missing null check for the filter pointer.
3117 * UIProcess/mac/LegacySessionStateCoding.cpp:
3118 (WebKit::encodeSessionHistoryEntryData):
3120 2014-07-01 Simon Fraser <simon.fraser@apple.com>
3122 [UI-side compositing] Bad spinner on news.google.com: animations need to be ordered
3123 https://bugs.webkit.org/show_bug.cgi?id=134504
3124 <rdar://problem/17507892>
3126 Reviewed by Tim Horton.
3128 The layer's addedAnimations property needs to maintain order, since the order
3129 in which transforms are applied is important.
3131 * Shared/mac/RemoteLayerTreeTransaction.h: Use a Vector<pair<>> for addedAnimations.
3132 * Shared/mac/RemoteLayerTreeTransaction.mm:
3133 (WebKit::dumpChangedLayers):
3134 * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
3135 * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3136 (WebKit::PlatformCAAnimationRemote::updateLayerAnimations):
3137 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3138 (WebKit::PlatformCALayerRemote::addAnimationForKey): If this is a new entry, we
3139 can just append to addedAnimations, otherwise we have to find the existing one
3140 and update its properties.
3141 (WebKit::PlatformCALayerRemote::removeAnimationForKey): Do linear search to
3142 find the animation to remove (this list will normally be short).
3144 2014-07-01 Anders Carlsson <andersca@apple.com>
3146 Add a encodeLegacySessionState function
3147 https://bugs.webkit.org/show_bug.cgi?id=134502
3149 Reviewed by Tim Horton.
3151 * UIProcess/LegacySessionStateCoding.h:
3152 * UIProcess/mac/LegacySessionStateCoding.cpp:
3153 (WebKit::encodeSessionHistoryEntryData):
3154 (WebKit::encodeLegacySessionHistoryEntryData):
3155 (WebKit::createDictionary):
3156 (WebKit::encodeSessionHistory):
3157 (WebKit::encodeLegacySessionState):
3159 2014-07-01 Alexey Proskuryakov <ap@apple.com>
3161 [Cocoa] WebProcess doesn't follow localization of UI process when run as a service
3162 https://bugs.webkit.org/show_bug.cgi?id=133126
3163 <rdar://problem/13396515>
3165 Patch by Alexey Proskuryakov.
3166 Reviewed by Tim Horton.
3168 * Configurations/WebContentService.Development.xcconfig:
3169 * Configurations/WebContentService.xcconfig:
3170 Figure out which of the two keys to use. CFBundleAllowMixedLocalizations was
3171 a workaround before we got CFBundleFollowParentLocalization, and these cannot be
3174 * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): Set up
3175 XPC bootstrap for CFBundle to use.
3177 * WebKit2.xcodeproj/project.pbxproj: Added a script that applies the key to Info.plist.
3179 * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-OSX.plist:
3180 * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist:
3181 * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
3182 * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
3183 Removed CFBundleAllowMixedLocalizations, we now add it programmatically.
3185 2014-07-01 Alex Christensen <achristensen@webkit.org>
3187 [iOS] Unreviewed build fix after r170640.
3189 * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3190 (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged):
3191 (WebKit::WebEditorClient::selectionRectsDidChange):
3192 * WebProcess/WebCoreSupport/WebEditorClient.h:
3193 * WebProcess/WebPage/WebPage.h:
3194 Add ifdefs to make everything compile and link.
3196 2014-07-01 Anders Carlsson <andersca@apple.com>
3198 Add WKSessionStateGetTypeID
3199 https://bugs.webkit.org/show_bug.cgi?id=134499
3201 Reviewed by Tim Horton.
3203 * UIProcess/API/C/WKSessionStateRef.cpp:
3204 (WKSessionStateGetTypeID):
3205 * UIProcess/API/C/WKSessionStateRef.h:
3207 2014-07-01 Daniel Bates <dabates@apple.com>
3209 Remove unnecessary calls to std::move()
3210 https://bugs.webkit.org/show_bug.cgi?id=134493
3212 Reviewed by Anders Carlsson.
3214 * Shared/ShareableResource.cpp:
3215 (WebKit::ShareableResource::Handle::tryWrapInCFData):
3216 * WebProcess/WebPage/WebFrame.cpp:
3217 (WebKit::WebFrame::certificateInfo): Return a WebCore::CertificateInfo instead
3218 of const WebCore::CertificateInfo& to avoid returning a dangling reference to
3219 a local variable. Also, remove the unnecessary calls to std::move() as the compiler
3220 will invoke the move constructor for WebCore::CertificateInfo on return from the
3222 * WebProcess/WebPage/WebFrame.h:
3224 2014-07-01 Anders Carlsson <andersca@apple.com>
3226 Add a BackForwardListItemState struct and put the snapshot UUID there
3227 https://bugs.webkit.org/show_bug.cgi?id=134497
3229 Reviewed by Sam Weinig.
3231 * Shared/SessionState.cpp:
3232 (WebKit::PageState::encode):
3233 (WebKit::PageState::decode):
3234 (WebKit::BackForwardListItemState::encode):
3235 (WebKit::BackForwardListItemState::decode):
3236 * Shared/SessionState.h:
3237 * Shared/WebBackForwardListItem.cpp:
3238 (WebKit::WebBackForwardListItem::create):
3239 (WebKit::WebBackForwardListItem::WebBackForwardListItem):
3240 (WebKit::WebBackForwardListItem::backForwardData):
3241 (WebKit::WebBackForwardListItem::setBackForwardData):
3242 (WebKit::WebBackForwardListItem::encode):
3243 * Shared/WebBackForwardListItem.h:
3244 (WebKit::WebBackForwardListItem::setPageState):
3245 (WebKit::WebBackForwardListItem::setOriginalURL):
3246 (WebKit::WebBackForwardListItem::originalURL):
3247 (WebKit::WebBackForwardListItem::setURL):
3248 (WebKit::WebBackForwardListItem::url):
3249 (WebKit::WebBackForwardListItem::setTitle):
3250 (WebKit::WebBackForwardListItem::title):
3251 (WebKit::WebBackForwardListItem::setSnapshotUUID):
3252 (WebKit::WebBackForwardListItem::snapshotUUID):
3253 * UIProcess/WebBackForwardList.cpp:
3254 (WebKit::WebBackForwardList::restoreFromState):
3255 * UIProcess/WebProcessProxy.cpp:
3256 (WebKit::WebProcessProxy::addBackForwardItem):
3257 * UIProcess/mac/LegacySessionStateCoding.cpp:
3258 (WebKit::decodeSessionHistoryEntries):
3260 2014-07-01 Yongjun Zhang <yongjun_zhang@apple.com>
3262 Add encodeInteger and decodeInteger for remote object encoder and decoder.
3263 https://bugs.webkit.org/show_bug.cgi?id=134453
3265 In 64bit system, encodeInteger/decodeInteger is by default mapped into encodeInt64/decodeInt64. For
3266 32bit system, they are mapped to encodeInt32/decodeInt32. However, since we don't have encodeInt32/decodeInt32
3267 implementation in WKRemoteObjectCoder, we could hit crash in 32bit systems.
3269 Reviewed by Sam Weinig.
3271 * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
3272 (-[WKRemoteObjectEncoder encodeInteger:forKey:]): Instead of creating a new number type UInt32, use encodeInt64 for
3274 (-[WKRemoteObjectDecoder decodeIntegerForKey:]):
3276 2014-06-30 Anders Carlsson <andersca@apple.com>
3278 Use an std::function for filtering session state data
3279 https://bugs.webkit.org/show_bug.cgi?id=134481
3281 Reviewed by Sam Weinig.
3283 * UIProcess/API/C/WKPage.cpp:
3284 (WKPageCopySessionState):
3285 * UIProcess/API/Cocoa/WKWebView.mm:
3286 (-[WKWebView _sessionState]):
3287 * UIProcess/WebBackForwardList.h:
3288 * UIProcess/WebPageProxy.cpp:
3289 (WebKit::WebPageProxy::sessionStateData):
3290 * UIProcess/WebPageProxy.h:
3291 * UIProcess/cf/WebBackForwardListCF.cpp:
3292 (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
3293 * UIProcess/cf/WebPageProxyCF.cpp:
3294 (WebKit::WebPageProxy::sessionStateData):
3296 2014-07-01 Rohit Kumar <kumar.rohit@samsung.com>
3298 Clean up the WebKit build from unused parameter warning in Webkit2/UIProcess module
3299 https://bugs.webkit.org/show_bug.cgi?id=134294
3301 Reviewed by Darin Adler.
3303 * UIProcess/API/APIUIClient.h:
3304 (API::UIClient::reachedApplicationCacheOriginQuota):
3306 2014-07-01 Brady Eidson <beidson@apple.com>
3308 Followup for: Combine the Telephone and Selection overlay controllers, updating UI behavior.
3309 https://bugs.webkit.org/show_bug.cgi?id=134461
3311 Rubberstamped by Tim Horton.
3313 * WebProcess/WebPage/mac/ServicesOverlayController.mm: Include the correct constant.
3315 2014-07-01 Brady Eidson <beidson@apple.com>
3319 Forgot to commit locally before pushing.
3321 * WebProcess/WebPage/WebPage.cpp:
3322 (WebKit::WebPage::servicesOverlayController): s/this/*this/
3324 2014-07-01 Brady Eidson <beidson@apple.com>
3326 Combine the Telephone and Selection overlay controllers, updating UI behavior.
3327 https://bugs.webkit.org/show_bug.cgi?id=134461
3329 Reviewed by Tim Horton.
3331 * WebKit2.xcodeproj/project.pbxproj:
3333 * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3334 (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged):
3335 (WebKit::WebEditorClient::selectionRectsDidChange):
3337 Remove the separate Selection overlay controller:
3338 * WebProcess/WebPage/SelectionOverlayController.cpp: Removed.
3339 * WebProcess/WebPage/ServicesOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/SelectionOverlayController.h.
3340 (WebKit::ServicesOverlayController::create):
3341 * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: Removed.
3343 Remove the separate TelephoneNumber overlay controller:
3344 * WebProcess/WebPage/TelephoneNumberOverlayController.cpp: Removed.
3345 * WebProcess/WebPage/TelephoneNumberOverlayController.h: Removed.
3346 * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: Removed.
3348 * WebProcess/WebPage/WebPage.cpp:
3349 (WebKit::WebPage::servicesOverlayController):
3350 (WebKit::WebPage::telephoneNumberOverlayController): Deleted.
3351 (WebKit::WebPage::selectionOverlayController): Deleted.
3352 (WebKit::WebPage::didChangeScrollOffsetForFrame): Deleted.
3353 * WebProcess/WebPage/WebPage.h:
3354 (WebKit::WebPage::serviceControlsEnabled): Deleted.
3356 ServicesOverlayController is a combination of the old TelephoneNumber and Selection overlay controllers.
3357 A lot of code duplication is resolved, and things are generally easier to follow.
3358 It enforces displaying a telephone number highlight if precisely one telephone number is selected, or
3359 the selection highlight if the selection contains more than a single phone number
3360 * WebProcess/WebPage/mac/ServicesOverlayController.mm: Added.
3361 (WebKit::textQuadsToBoundingRectForRange):
3362 (WebKit::ServicesOverlayController::ServicesOverlayController):
3363 (WebKit::ServicesOverlayController::destroyOverlay):
3364 (WebKit::ServicesOverlayController::pageOverlayDestroyed):
3365 (WebKit::ServicesOverlayController::willMoveToWebPage):
3366 (WebKit::ServicesOverlayController::didMoveToWebPage):
3367 (WebKit::ServicesOverlayController::createOverlayIfNeeded):
3368 (WebKit::ServicesOverlayController::selectionRectsDidChange):
3369 (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
3370 (WebKit::ServicesOverlayController::clearHighlightState):
3371 (WebKit::ServicesOverlayController::drawRect):
3372 (WebKit::ServicesOverlayController::drawSelectionHighlight):
3373 (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight):
3374 (WebKit::ServicesOverlayController::drawCurrentHighlight):
3375 (WebKit::ServicesOverlayController::mouseEvent):
3376 (WebKit::ServicesOverlayController::handleClick):
3378 2014-07-01 Zan Dobersek <zdobersek@igalia.com>
3380 [WK2] IPC messages' arguments() method returns const std::tuple<> copies
3381 https://bugs.webkit.org/show_bug.cgi?id=131975
3383 Reviewed by Darin Adler.
3385 The arguments() method of the different IPC message objects should return a const reference
3386 to the std::tuple<> containing the arguments, instead of a const value. This avoids copying
3387 the std::tuple<> every time the arguments are encoded, and works best with the
3388 ArgumentEncoder::encode<std::tuple<...>>(const std::tuple<...>&) template instantiation.
3390 The unit test baselines are updated accordingly.
3392 * Scripts/webkit2/LegacyMessages-expected.h:
3393 (Messages::WebPage::LoadURL::arguments):
3394 (Messages::WebPage::LoadSomething::arguments):
3395 (Messages::WebPage::TouchEvent::arguments):
3396 (Messages::WebPage::AddEvent::arguments):
3397 (Messages::WebPage::LoadSomethingElse::arguments):
3398 (Messages::WebPage::DidReceivePolicyDecision::arguments):
3399 (Messages::WebPage::Close::arguments):
3400 (Messages::WebPage::PreferencesDidChange::arguments):
3401 (Messages::WebPage::SendDoubleAndFloat::arguments):
3402 (Messages::WebPage::SendInts::arguments):
3403 (Messages::WebPage::CreatePlugin::arguments):
3404 (Messages::WebPage::RunJavaScriptAlert::arguments):
3405 (Messages::WebPage::GetPlugins::arguments):
3406 (Messages::WebPage::GetPluginProcessConnection::arguments):
3407 (Messages::WebPage::TestMultipleAttributes::arguments):
3408 (Messages::WebPage::TestParameterAttributes::arguments):
3409 (Messages::WebPage::TemplateTest::arguments):
3410 (Messages::WebPage::SetVideoLayerID::arguments):
3411 (Messages::WebPage::DidCreateWebProcessConnection::arguments):
3412 (Messages::WebPage::InterpretKeyEvent::arguments):
3413 (Messages::WebPage::DeprecatedOperation::arguments):
3414 (Messages::WebPage::ExperimentalOperation::arguments):
3415 * Scripts/webkit2/Messages-expected.h:
3416 (Messages::WebPage::LoadURL::arguments):
3417 (Messages::WebPage::LoadSomething::arguments):
3418 (Messages::WebPage::TouchEvent::arguments):
3419 (Messages::WebPage::AddEvent::arguments):
3420 (Messages::WebPage::LoadSomethingElse::arguments):
3421 (Messages::WebPage::DidReceivePolicyDecision::arguments):
3422 (Messages::WebPage::Close::arguments):
3423 (Messages::WebPage::PreferencesDidChange::arguments):
3424 (Messages::WebPage::SendDoubleAndFloat::arguments):
3425 (Messages::WebPage::SendInts::arguments):
3426 (Messages::WebPage::CreatePlugin::arguments):
3427 (Messages::WebPage::RunJavaScriptAlert::arguments):
3428 (Messages::WebPage::GetPlugins::arguments):
3429 (Messages::WebPage::GetPluginProcessConnection::arguments):
3430 (Messages::WebPage::TestMultipleAttributes::arguments):
3431 (Messages::WebPage::TestParameterAttributes::arguments):
3432 (Messages::WebPage::TemplateTest::arguments):
3433 (Messages::WebPage::SetVideoLayerID::arguments):
3434 (Messages::WebPage::DidCreateWebProcessConnection::arguments):
3435 (Messages::WebPage::InterpretKeyEvent::arguments):
3436 (Messages::WebPage::DeprecatedOperation::arguments):
3437 (Messages::WebPage::ExperimentalOperation::arguments):
3438 * Scripts/webkit2/MessagesSuperclass-expected.h:
3439 (Messages::WebPage::LoadURL::arguments):
3440 * Scripts/webkit2/messages.py:
3441 (message_to_struct_declaration):
3443 2014-07-01 Evan Nemerson <evan@nemerson.com>
3445 [GTK] Annotations for WebResource.get_data produce wrong signature in Vala binding
3446 https://bugs.webkit.org/show_bug.cgi?id=134476
3448 Reviewed by Carlos Garcia Campos.
3450 * UIProcess/API/gtk/WebKitWebResource.cpp: Add array length and
3451 element-type annotations to return value of webkit_w