1 2014-07-17 David Kilzer <ddkilzer@apple.com>
3 SECTORDER_FLAGS should be defined in target's xcconfig file, not Base.xcconfig
4 <http://webkit.org/b/135006>
6 Reviewed by Darin Adler.
8 * Configurations/Base.xcconfig: Move SECTORDER_FLAGS to
10 * Configurations/DebugRelease.xcconfig: Remove empty
11 SECTORDER_FLAGS definition.
12 * Configurations/WebKit.xcconfig: Use $(CONFIGURATION) so
13 SECTORDER_FLAGS is only set on Production builds.
15 2014-07-17 Alexey Proskuryakov <ap@apple.com>
17 REGRESSION (r171167): LoaderClient processDidCrash call is made after load state changes
18 https://bugs.webkit.org/show_bug.cgi?id=135032
19 <rdar://problem/17716602>
21 Reviewed by Dan Bernstein.
23 * UIProcess/WebPageProxy.cpp:
24 (WebKit::WebPageProxy::processDidCrash): Create a transaction, so that the nested
25 transaction in resetStateAfterProcessExited() wouldn't be committed.
26 (WebKit::WebPageProxy::resetStateAfterProcessExited): Don't use auto - it was hiding
27 the most important fact that this is a stack object that can't be simply moved to
30 2014-07-17 Benjamin Poulain <bpoulain@apple.com>
32 [iOS][WK2] Fix the updateVisibleContentRects synchronization for load after r171154
33 https://bugs.webkit.org/show_bug.cgi?id=135036
35 Reviewed by Dan Bernstein.
37 * WebProcess/WebPage/ios/WebPageIOS.mm:
38 (WebKit::WebPage::updateVisibleContentRects):
39 I forgot to update one of the condition after changing from lastTransaction to next transaction
42 2014-07-17 Enrica Casucci <enrica@apple.com>
44 [REGRESSION WK2]The menu bar does not show up when tapping on the caret.
45 https://bugs.webkit.org/show_bug.cgi?id=135023
46 <rdar://problem/17617282>
48 Reviewed by Benjamin Poulain and Ryosuke Niwa.
50 WKContentView needs to implement hasContent to correctly show
51 the appropriate menu bar content. The patch adds this information
54 * Shared/EditorState.cpp:
55 (WebKit::EditorState::encode):
56 (WebKit::EditorState::decode):
57 * Shared/EditorState.h:
58 (WebKit::EditorState::EditorState):
59 * UIProcess/ios/WKContentViewInteraction.mm:
60 (-[WKContentView hasContent]):
61 * WebProcess/WebPage/WebPage.cpp:
62 (WebKit::WebPage::editorState):
64 2014-07-17 Benjamin Poulain <benjamin@webkit.org>
66 [iOS][WK2] Add SPI to do a dynamic viewport update without showing any content
67 https://bugs.webkit.org/show_bug.cgi?id=135010
69 Reviewed by Darin Adler.
71 This patch add a new SPI, [WKWebView _resizeWhileHidingContentWithUpdates:] to perform all the work
72 of a dynamic viewport size update, but instead of animating the old content, it is hidden.
74 The patch is built on top of the animated resize mechanism. Instead of having an animation driving
75 the beginning and end, we let the content do that. The dynamic resize begins, it runs for as long as
76 the WebProcess needs, and it ends when first layer tree commit with the new content is processed.
78 The attribute "_isAnimatingResize" is generalized to support two modes of resizing: animated and
81 The attribute "_hasCommittedLoadForMainFrame" is rather silly. It is only needed because
82 [WKWebView _resizeWhileHidingContentWithUpdates:] is intended to be called a lot before the page
83 is initialized, and doing an animated resize would trash the WebProcess state.
84 I wish I had a better solution, this is not great.
86 * UIProcess/API/Cocoa/WKWebView.mm:
87 (-[WKWebView _processDidExit]):
88 (-[WKWebView _didCommitLoadForMainFrame]):
89 (-[WKWebView _didCommitLayerTree:]):
90 This is the key to make this work properly. We want _resizeWhileHidingContentWithUpdates: to behave
91 exactly like an animated resize to avoid bugs. So we went to the whole update mechanism using
92 _resizeAnimationTransformAdjustments to accumulate the adjustments, now we need to restore a correct
95 Calling [WKWebView _endAnimatedResize] will do exactly that, but we need to make sure we do not hit
96 the synchronization path or we would be blocked there for a while, which is what we are trying to avoid.
98 After r171154, WebPageProxy keeps track of what stage of dynamic viewport update we are in. Since we are
99 executing the layer tree update stage, with the right transaction ID, WebPageProxy already knows we have
100 everything we need and does not use any synchronous messages.
102 (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
103 (-[WKWebView _restorePageStateToExposedRect:scale:]):
104 (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
105 (-[WKWebView _scrollToContentOffset:]):
106 (-[WKWebView _frameOrBoundsChanged]):
107 (-[WKWebView _updateVisibleContentRects]):
108 (-[WKWebView _setMinimumLayoutSizeOverride:]):
109 (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
110 (-[WKWebView _setInterfaceOrientationOverride:]):
111 (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
112 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
113 (-[WKWebView _endAnimatedResize]):
114 (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
115 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
117 2014-07-17 Brent Fulgham <bfulgham@apple.com>
119 [Mac] Full screen video not always animating in the correct Space
120 https://bugs.webkit.org/show_bug.cgi?id=135020
121 <rdar://problem/17542310>
123 Reviewed by Dean Jackson.
125 The fullscreen window can "remember" the Space it was part of the first time you enter fullscreen
126 mode. Subsequent fullscreen transitions will always start from this Space, even if you move
127 the WebKit-hosted application to a different Space.
129 We can help the display system know when we've moved to a new Space by calling NSWindow's
130 'orderBack' method on the fullscreen window prior to starting the transition to fullscreen mode.
131 This method call hooks the window into the current Space so everything works properly.
133 * UIProcess/mac/WKFullScreenWindowController.mm:
134 (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): Add the
135 new fullscreen window to the current Space before starting transition to fullscreen.
137 2014-07-17 Timothy Hatcher <timothy@apple.com>
139 Make console.profile record to the Timeline.
141 https://bugs.webkit.org/show_bug.cgi?id=134643
143 Reviewed by Joseph Pecoraro.
145 * WebProcess/WebPage/WebInspector.cpp:
146 (WebKit::WebInspector::setJavaScriptProfilingEnabled):
147 (WebKit::WebInspector::startJavaScriptProfiling):
148 (WebKit::WebInspector::stopJavaScriptProfiling):
150 2014-07-17 Brady Eidson <beidson@apple.com>
152 Crash in ServicesOverlayController::~ServicesOverlayController.
153 <rdar://problem/17622172> and https://bugs.webkit.org/show_bug.cgi?id=135022
155 Reviewed by Tim Horton.
157 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
158 (WebKit::ServicesOverlayController::~ServicesOverlayController): Don’t need to uninstall the
159 PageOverlay as it has already been destroyed by this point in WebPage::~WebPage.
161 2014-07-17 Tim Horton <timothy_horton@apple.com>
163 Sometimes purgeable (or empty!) tiles are shown on screen when resuming the app
164 https://bugs.webkit.org/show_bug.cgi?id=135018
165 <rdar://problem/17615038>
167 Reviewed by Simon Fraser.
169 * UIProcess/DrawingAreaProxy.h:
170 (WebKit::DrawingAreaProxy::hideContentUntilNextUpdate):
171 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
172 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
173 (WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilNextUpdate):
174 * UIProcess/mac/RemoteLayerTreeHost.h:
175 * UIProcess/mac/RemoteLayerTreeHost.mm:
176 (WebKit::RemoteLayerTreeHost::detachRootLayer):
177 Add a mechanism to "hide" drawing area content until the next commit,
178 by detaching the root layer. RemoteLayerTreeHost will automatically reattach
179 it at the next commit.
181 * UIProcess/WebPageProxy.cpp:
182 (WebKit::WebPageProxy::viewStateDidChange):
183 * UIProcess/WebPageProxy.h:
184 Add a parameter to viewStateDidChange specifying whether dispatching the change
185 to the Web process is deferrable or not. We will also automatically use "Immediate" if
186 the view is coming in-window, like we did before.
188 * UIProcess/ios/WKContentView.mm:
189 (-[WKContentView _applicationWillEnterForeground:]):
190 Make use of the aforementioned new mechanisms to ensure that we immediately dispatch
191 view state changes when coming into the foreground, and will have removed the root layer
192 if a commit didn't come in while waitForDidUpdateViewState blocks.
194 2014-07-17 Sanghyup Lee <sh53.lee@samsung.com>
196 [EFL][WK2] Add a "focus,notfound" signal.
197 https://bugs.webkit.org/show_bug.cgi?id=134674
199 Reviewed by Gyuyoung Kim.
201 Add a "focus,notfound" signal to handover focus control to application
202 because there are no elements of webview to focus on the given direction.
204 Application can decide to move the focus to next widget of ewk_view or something else
205 by using this signal.
207 * UIProcess/API/efl/EwkViewCallbacks.h:
208 * UIProcess/API/efl/ewk_view.h:
209 * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp: Added keyDown and keyUp function.
210 (EWK2UnitTest::EWK2UnitTestBase::waitUntilDirectionChanged):
211 (EWK2UnitTest::EWK2UnitTestBase::keyDown):
212 (EWK2UnitTest::EWK2UnitTestBase::keyUp):
213 * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
214 * UIProcess/API/efl/tests/test_ewk2_view.cpp:
215 (EWK2ViewTest::FocusNotFoundCallback):
217 * UIProcess/efl/PageUIClientEfl.cpp: Removed unnecessary calls to evas_object_focus_set().
218 (WebKit::PageUIClientEfl::takeFocus):
220 2014-07-16 Brady Eidson <beidson@apple.com>
222 Reintroduce the SPI _websiteDataURLForContainerWithURL: that was removed in r171160
223 https://bugs.webkit.org/show_bug.cgi?id=134984
225 Reviewed by David Kilzer.
227 * UIProcess/API/Cocoa/WKProcessPool.mm:
228 (+[WKProcessPool _websiteDataURLForContainerWithURL:]):
229 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
231 2014-07-16 Alexey Proskuryakov <ap@apple.com>
233 A test that hangs at cleanup stage confuses webkitpy hugely
234 https://bugs.webkit.org/show_bug.cgi?id=122475
235 <rdar://problem/17184354>
237 Reviewed by Anders Carlsson.
239 Reset m_pageLoadState when the process exits cleanly - otherwise messages from a
240 new process for the same WebPageProxy would hit assertions.
242 * UIProcess/WebPageProxy.cpp:
243 (WebKit::WebPageProxy::processDidCrash):
244 (WebKit::WebPageProxy::resetStateAfterProcessExited):
246 2014-07-16 David Kilzer <ddkilzer@apple.com>
248 [iOS] Update order file paths for WebKit and WebKit2
249 <http://webkit.org/b/134993>
250 <rdar://problem/17557776>
252 Reviewed by Darin Adler.
254 * Configurations/Base.xcconfig: Add order file for iOS
257 2014-07-16 Brady Eidson <beidson@apple.com>
259 Add WebSecurityOrigin "webSecurityOriginFromDatabaseIdentifier" SPI and change _websiteDataURLForContainerWithURL: SPI
260 <rdar://problem/17454712> and https://bugs.webkit.org/show_bug.cgi?id=134984
262 Reviewed by Dan Bernstein.
264 Change _websiteDataURLForContainerWithURL: SPI to include an optional bundle identifier argument:
265 * UIProcess/API/Cocoa/WKProcessPool.mm:
266 (+[WKProcessPool _websiteDataURLForContainerWithURL:bundleIdentifierIfNotInContainer:]):
267 (+[WKProcessPool _websiteDataURLForContainerWithURL:]): Deleted.
268 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
270 Add a big shiny comment in a few key places:
271 * DatabaseProcess/DatabaseProcess.cpp:
272 (WebKit::DatabaseProcess::initializeDatabaseProcess):
273 * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
274 (WebKit::UniqueIDBDatabase::UniqueIDBDatabase):
275 * UIProcess/WebContext.cpp:
276 (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
277 (WebKit::WebContext::ensureDatabaseProcess):
279 2014-07-16 Enrica Casucci <enrica@apple.com>
281 REGRESSION (iOS WebKit2): Cannot scroll while dragging a selection.
282 https://bugs.webkit.org/show_bug.cgi?id=134992
283 <rdar://problem/17528020>
285 Reviewed by Benjamin Poulain.
287 This patch exposes the scroller and the visible content rect so that
288 UIKit can implement autoscroll when dragging the selections.
289 It also changes that way we do hit testing to allow hit test outside
290 the clipping region and fixes the way we compute the selection rectangle
291 for the block selection, ensuring that we consider also non text elements
294 * UIProcess/ios/WKContentViewInteraction.mm:
295 (-[WKContentView scroller]):
296 (-[WKContentView visibleRect]):
297 * WebProcess/WebPage/ios/WebPageIOS.mm:
298 (WebKit::selectionBoxForRange):
299 (WebKit::WebPage::rangeForWebSelectionAtPosition):
300 (WebKit::WebPage::rangeForBlockAtPoint):
301 (WebKit::WebPage::expandedRangeFromHandle):
302 (WebKit::WebPage::contractedRangeFromHandle):
303 (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
304 (WebKit::WebPage::changeBlockSelection):
306 2014-07-16 Alexey Proskuryakov <ap@apple.com>
308 <rdar://problem/17669097> REGRESSION (r170155): Sandbox violations using a wrong
309 CFNetwork cache path in WebContent process
311 Rubber-stamped by Sam Weinig.
313 Before r170155, we incorrectly checked usesNetworkProcess(), which always returns
314 false at this point in initialization sequence. But we did the right thing, as we
315 always need to set the cache path, even when network process is used for most loading.
317 * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess):
319 2014-07-16 Timothy Horton <timothy_horton@apple.com>
321 Dispatch top content inset changes immediately if synchronously waiting for view state changes
322 ​https://bugs.webkit.org/show_bug.cgi?id=134942
323 <rdar://problem/17666800>
325 Reviewed by Simon Fraser.
327 * UIProcess/API/mac/WKView.mm:
328 (-[WKView _dispatchSetTopContentInset]):
329 (-[WKView _setTopContentInset:]):
330 Move the check from _setTopContentInset: to _dispatchSetTopContentInset
331 that ensures that we only send the message if the top content inset changed.
333 2014-07-16 Benjamin Poulain <bpoulain@apple.com>
335 [iOS][WK2] Synchronize the dynamic viewport updates with their layer tree commit
336 https://bugs.webkit.org/show_bug.cgi?id=134965
337 Related to <rdar://problem/17082607>
339 Reviewed by Tim Horton.
341 Dynamic viewport update relies on the _resizeAnimationTransformAdjustments being applied
342 to the page at the new size during the transition.
344 Because of the races between the LayerTree Commit and DynamicViewportSizeUpdate, the transform
345 can be applied to the wrong set of tiles.
346 This is mostly a problem for unresponsive WebProcess or when the synchronization is done
349 There is at least one more case that is not handled: if synchronizeDynamicViewportUpdate()
350 completely fails to get the new page, the UIProcess is in a somewhat messy state.
351 I will look into that separately than the layer tree synchronization.
353 * UIProcess/API/Cocoa/WKWebView.mm:
354 (-[WKWebView _didCommitLayerTree:]):
355 (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
356 (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]): Deleted.
357 * UIProcess/API/Cocoa/WKWebViewInternal.h:
358 * UIProcess/PageClient.h:
359 * UIProcess/WebPageProxy.cpp:
360 (WebKit::WebPageProxy::WebPageProxy):
361 (WebKit::WebPageProxy::resetState):
362 * UIProcess/WebPageProxy.h:
363 * UIProcess/ios/PageClientImplIOS.h:
364 * UIProcess/ios/PageClientImplIOS.mm:
365 (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget):
366 * UIProcess/ios/WebPageProxyIOS.mm:
367 (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
368 (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
369 (WebKit::WebPageProxy::didCommitLayerTree):
370 (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
371 * WebProcess/WebPage/WebPage.cpp:
372 (WebKit::WebPage::WebPage):
373 (WebKit::WebPage::didCommitLoad):
374 * WebProcess/WebPage/WebPage.h:
375 * WebProcess/WebPage/WebPage.messages.in:
376 * WebProcess/WebPage/ios/WebPageIOS.mm:
377 (WebKit::WebPage::synchronizeDynamicViewportUpdate):
378 (WebKit::WebPage::updateVisibleContentRects):
379 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
380 (WebKit::RemoteLayerTreeDrawingArea::nextTransactionID):
381 (WebKit::RemoteLayerTreeDrawingArea::currentTransactionID): Deleted.
383 2014-07-16 Dan Bernstein <mitz@apple.com>
385 REGRESSION (r170653): Web Content service’s Info.plist has wrong format
386 https://bugs.webkit.org/show_bug.cgi?id=134973
388 Reviewed by Alexey Proskuryakov.
390 * WebKit2.xcodeproj/project.pbxproj: Updated the Add CFBundle Localization Info.plist Key
391 script build phases to convert Info.plist back to binary format if the
392 PLIST_FILE_OUTPUT_FORMAT build setting requires it.
394 2014-07-15 Benjamin Poulain <bpoulain@apple.com>
398 * UIProcess/API/Cocoa/WKWebView.mm:
399 (-[WKWebView _scrollToContentOffset:]):
400 On landing, I changed the min/max branches to shrunkTo/expandedTo, but the return value
401 of those was ignored.
403 2014-07-15 Dan Bernstein <mitz@apple.com>
405 WKWebView’s FormClient::willSubmitForm should use CompletionHandlerCallChecker
406 https://bugs.webkit.org/show_bug.cgi?id=134951
408 Reviewed by Tim Horton.
410 * UIProcess/API/Cocoa/WKWebView.mm:
411 (-[WKWebView _setFormDelegate:]):
413 2014-07-15 Benjamin Poulain <benjamin@webkit.org>
415 [iOS][WK2] Scrolling request from the scrolling tree must be limited to offsets in the document
416 https://bugs.webkit.org/show_bug.cgi?id=134952
417 <rdar://problem/17647116>
419 Reviewed by Enrica Casucci.
421 When we received a scroll request, we were taking that offset directly to set the UIScrollView
422 scroll position. This is a problem if a page request scrolling to an invalid position, we were
425 This patch limits the position to be inside the document.
427 -- Why not limit the scroll offset in the WebProcess when we receive the scroll request? --
429 Some pages rely on the page scale factor changing instantly, because that is how it worked
432 On WebKit2, the WebProcess cannot know the valid range because the obscured insets are changing
433 dynamically, and the page scale factor can change in response to WebProcess events (the focus
434 changing for example). To make the page works, the WebProcess does not restrict the scroll position.
436 In that architecture, the UIProcess has to sanitize the input, which was not done before this patch.
438 -- Why not use changeContentOffsetBoundedInValidRange()?
440 The scroll offset as seen by the page is relative to the unobscured rect. While the position used
441 for history item is a visual position. All we need in this case is a position in the view.
443 * UIProcess/API/Cocoa/WKWebView.mm:
444 (-[WKWebView _scrollToContentOffset:]):
445 * UIProcess/WebPageProxy.h:
446 * UIProcess/ios/WebPageProxyIOS.mm:
447 (WebKit::WebPageProxy::resendLastVisibleContentRects):
449 2014-07-15 Timothy Horton <timothy_horton@apple.com>
451 Dispatch top content inset changes immediately if synchronously waiting for view state changes
452 https://bugs.webkit.org/show_bug.cgi?id=134942
453 <rdar://problem/17666800>
455 Reviewed by Simon Fraser.
457 * UIProcess/API/mac/WKView.mm:
458 (-[WKView endDeferringViewInWindowChanges]):
459 (-[WKView endDeferringViewInWindowChangesSync]):
460 (-[WKView _dispatchSetTopContentInset]):
461 (-[WKView _setTopContentInset:]):
462 Send top content inset changes immediately before sync-waiting for new tiles from the Web Process.
463 This will ensure that the incoming contents have the right top content inset, and we don't
464 flash between the wrong inset and the right one.
466 2014-07-15 Enrica Casucci <enrica@apple.com>
468 REGRESSION(WK2 iOS): Safari hangs when switching focus from a field using the Tab key.
469 https://bugs.webkit.org/show_bug.cgi?id=134934
470 <rdar://problem/17224638>
472 Reviewed by Tim Horton.
474 * UIProcess/ios/WKContentViewInteraction.mm:
476 Tab and back tab should be handled as special keys that have
477 a command associated. The command specifies for each key the relevant
478 action. This patch implements the commands property to create the association
479 between key and command and the relevant actions that will execute the same
480 code executed when the used taps on the < > buttons in the accessory bar.
482 (-[WKContentView keyCommands]):
483 (-[WKContentView _nextAccessoryTab:]):
484 (-[WKContentView _prevAccessoryTab:]):
486 2014-07-15 Oliver Hunt <oliver@apple.com>
488 More tidying of the webcontent sandbox profile
489 https://bugs.webkit.org/show_bug.cgi?id=134938
491 Reviewed by Alexey Proskuryakov.
493 Remove some excessive abilities from the profile and make
494 the required ones explicit.
496 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
498 2014-07-14 Andreas Kling <akling@apple.com>
500 [iOS] Don't progressively re-render tiles while pinch-zooming under memory pressure.
501 <https://webkit.org/b/134915>
503 When we're under memory pressure, the last thing we want to be doing is
504 creating gratuitous new IOSurfaces. Just wait for the gesture to end before
505 rendering at the new scale.
507 Reviewed by Tim Horton.
509 * WebProcess/WebPage/ios/WebPageIOS.mm:
510 (WebKit::WebPage::updateVisibleContentRects):
512 2014-07-14 Joseph Pecoraro <pecoraro@apple.com>
514 [Cocoa] _WKRemoteObjectInterface leaks NSString ivar
515 https://bugs.webkit.org/show_bug.cgi?id=134914
517 Reviewed by Simon Fraser.
519 Release our copied NSString in dealloc.
521 * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
522 (-[_WKRemoteObjectInterface dealloc]):
524 2014-07-14 Dean Jackson <dino@apple.com>
526 [PlugIns] Check for a non-null snapshot image before trying to decode it
527 https://bugs.webkit.org/show_bug.cgi?id=134913
528 <rdar://problem/17606033>
530 Reviewed by Tim Horton.
532 Changeset r169820 introduced a bug where we could examine the pixels of
533 an image (looking for solid colors) before checking if the image actually
536 I added a null check, and moved the code around a bit to avoid checking
537 for existence three times.
539 * WebProcess/Plugins/PluginView.cpp:
540 (WebKit::PluginView::pluginSnapshotTimerFired): Check that snapshotImage exists
541 before trying to look at it.
543 2014-07-14 Anders Carlsson <andersca@apple.com>
547 * UIProcess/Cocoa/SessionStateCoding.mm:
548 (WebKit::encodeSessionState):
550 2014-07-14 Anders Carlsson <andersca@apple.com>
552 Use the legacy session coder for encoding/decoding session state
553 https://bugs.webkit.org/show_bug.cgi?id=134910
555 Reviewed by Beth Dakin.
557 * UIProcess/Cocoa/SessionStateCoding.mm:
558 (WebKit::encodeSessionState):
559 (WebKit::decodeSessionState):
561 2014-07-14 Oliver Hunt <oliver@apple.com>
563 Restrict network process to remote connections
564 https://bugs.webkit.org/show_bug.cgi?id=134908
566 Reviewed by Geoffrey Garen.
568 Further restrict network client
570 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
572 2014-07-14 Tim Horton <timothy_horton@apple.com>
574 ASSERT(isMainThread()) under OneShotDisplayLinkHandler
575 https://bugs.webkit.org/show_bug.cgi?id=134900
577 Reviewed by Simon Fraser.
579 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
580 (-[OneShotDisplayLinkHandler displayLinkFired:]):
581 isMainThread means the Web thread sometimes.
583 2014-07-14 Tim Horton <timothy_horton@apple.com>
587 * UIProcess/API/Cocoa/WKWebView.mm:
588 (-[WKWebView _frameOrBoundsChanged]):
589 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
590 * UIProcess/API/ios/WKViewIOS.mm:
591 (-[WKView _frameOrBoundsChanged]):
593 2014-07-14 Carlos Alberto Lopez Perez <clopez@igalia.com>
595 [UNIX] Log error description when failing to create shared memory file.
596 https://bugs.webkit.org/show_bug.cgi?id=134892
598 Reviewed by Darin Adler.
600 * Platform/unix/SharedMemoryUnix.cpp:
601 (WebKit::SharedMemory::create): Print the string describing the error number (errno).
603 2014-07-14 Benjamin Poulain <benjamin@webkit.org>
605 [iOS][WK2] On rotation, RemoteLayerTreeDrawingArea renders one extra frame at the wrong orientation
606 https://bugs.webkit.org/show_bug.cgi?id=134875
608 Reviewed by Tim Horton.
610 On animated resize, the size of the DrawingAreaProxy was changed before the layout parameters were
611 changed. This in turn caused the WebProcess's DrawingArea to flush the layer tree while still
612 at the wrong orientation.
614 This patch fixes the issue by making a special case for animated resize:
615 -While starting animated resize, _frameOrBoundsChanged can be called several times in response to
616 the API's client changing the WKWebView. In that case, we do not update the drawing area.
617 -After the "updateBlock" is executed and the size have been changed, the dynamic viewport update
618 is computed, the dynamicViewportSizeUpdate is sent to the WebProcess, followed by the message
619 DrawingArea::updateGeometry(). Since both messages are asynchronous, they are received in that
620 order, and the updateGeometry() is always done after the viewport configuration has been updated.
622 * UIProcess/API/Cocoa/WKWebView.mm:
623 (-[WKWebView _frameOrBoundsChanged]):
624 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
625 * UIProcess/ios/WKContentView.h:
626 * UIProcess/ios/WKContentView.mm:
627 (-[WKContentView setMinimumSize:]): Deleted.
629 2014-07-14 Benjamin Poulain <bpoulain@apple.com>
631 [iOS][WK2] Fix withinEpsilon()
632 https://bugs.webkit.org/show_bug.cgi?id=134798
634 Reviewed by Darin Adler.
636 Move the function back to WKWebView, it is no longer needed in WKContentView.
638 Use the real types as input to properly verify that the two inputs are within
639 a small value of the 32bit floating point.
641 The epsilon we use is always on 32 bits float because we want to avoid doing work for changes
642 that would not make any difference on float.
644 The source of those small changes comes from the fact UIProcess does a lot of processing
645 on CGFloat, which are double on 64bits architecture, while the WebProcess use 32bits floating point
646 for scale. When we are getting updates from the WebProcess, we should ignore any small differences
647 caused by the computations done with less precision.
649 * UIProcess/API/Cocoa/WKWebView.mm:
651 * UIProcess/ios/WKContentViewInteraction.h:
652 (withinEpsilon): Deleted.
654 2014-07-14 Bear Travis <betravis@adobe.com>
656 [Feature Queries] Enable Feature Queries on Mac
657 https://bugs.webkit.org/show_bug.cgi?id=134404
659 Reviewed by Antti Koivisto.
661 Enable Feature Queries on Mac and resume running the
664 * Configurations/FeatureDefines.xcconfig: Turn on
665 ENABLE_CSS3_CONDITIONAL_RULES.
667 2014-07-14 Anders Carlsson <andersca@apple.com>
669 Make shouldKeepCurrentBackForwardListItemInList part of WKPageLoaderClientV5 to avoid breaking ABI
670 https://bugs.webkit.org/show_bug.cgi?id=134889
672 Reviewed by Beth Dakin.
674 * UIProcess/API/C/WKPage.cpp:
675 * UIProcess/API/C/WKPageLoaderClient.h:
677 2014-07-14 Dan Bernstein <mitz@apple.com>
679 REGRESSION (r171045): Reproducible crash on navigation in PageClientImpl::willRecordNavigationSnapshot
680 https://bugs.webkit.org/show_bug.cgi?id=134887
682 Reviewed by Tim Horton.
684 * UIProcess/mac/PageClientImpl.mm:
685 (WebKit::PageClientImpl::navigationGestureDidBegin): nil-check m_webView. It can be nil when
686 the client is using WKView directly.
687 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
688 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
689 (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
691 2014-07-14 Eric Carlson <eric.carlson@apple.com>
693 [Mac] don't enable low power audio mode on external output devices
694 https://bugs.webkit.org/show_bug.cgi?id=134877
696 Reviewed by Sam Weinig.
698 * PluginProcess/PluginProcess.h: Add an empty implementation of
699 AudioHardwareListener::audioOutputDeviceChanged.
701 2014-07-14 Tim Horton <timothy_horton@apple.com>
703 [iOS] Throttle painting using a UI-process-side CADisplayLink
704 https://bugs.webkit.org/show_bug.cgi?id=134879
705 <rdar://problem/17641699>
707 Reviewed by Simon Fraser.
709 Just waiting for CA to commit is insufficient to actually throttle to 60fps,
710 because nothing will block the main runloop from spinning.
712 Instead, listen to a CADisplayLink, and send didUpdate to the WebProcess
713 the first time it fires after we commit. This is not a guarantee that
714 our content is on the screen, but we don't have any way to make that guarantee yet.
716 This will throttle painting, rAF, etc. to the display refresh rate.
718 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
719 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
720 (-[OneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
721 (-[OneShotDisplayLinkHandler dealloc]):
722 (-[OneShotDisplayLinkHandler displayLinkFired:]):
723 (-[OneShotDisplayLinkHandler invalidate]):
724 (-[OneShotDisplayLinkHandler schedule]):
725 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
726 (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
727 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
728 (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
729 (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): Deleted.
731 2014-07-14 Dan Bernstein <mitz@apple.com>
733 <rdar://problem/17657391> [iOS] Networking process writes persistent credentials to the keychain
734 https://bugs.webkit.org/show_bug.cgi?id=134878
736 Reviewed by Sam Weinig.
738 Route CFNetwork’s calls to Security API through to the UI process.
740 * NetworkProcess/ios/NetworkProcessIOS.mm:
741 (WebKit::NetworkProcess::platformInitializeNetworkProcess): Initialize SecItemShim.
743 * Shared/mac/SecItemShim.cpp:
744 (WebKit::SecItemShim::initialize): On iOS, rather than using a shim library, supply
745 CFNetwork with alternate functions to call.
747 * Shared/mac/SecItemShim.messages.in: Removed #if !PLATFORM(IOS).
748 * UIProcess/mac/SecItemShimProxy.messages.in: Ditto.
750 * config.h: Define ENABLE_SEC_ITEM_SHIM to 1 on iOS as well.
752 2014-07-14 Dan Bernstein <mitz@apple.com>
754 <rdar://problem/17398060> NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
755 https://bugs.webkit.org/show_bug.cgi?id=134666
757 Reviewed by Tim Horton.
759 A SecItem may have an attribute whose value is a SecAccessControlRef, which is not supported
760 by ArgumentCodersCF. In debug builds, trying to encode a CFDictionary containing a value of
761 unsupprted type causes an assertion to fail, but in release builds encoding succeeds, and
762 only decoding fails, in this case silently, simply not delivering the
763 SecItemShim::secItemResponse message.
765 The fix is to teach ArgumentCodersCF about SecAccessControlRef.
767 * Shared/cf/ArgumentCodersCF.cpp:
768 (IPC::typeFromCFTypeRef): Check for the SecAccessControlRef type.
769 (IPC::encode): Encode the SecAccessControl serialized into CFData.
770 (IPC::decode): Deserialize a SecAccessControl from the decoded CFData.
771 * Shared/cf/ArgumentCodersCF.h:
772 * config.h: Defined HAVE_SEC_ACCESS_CONTROL.
774 2014-07-13 Dan Bernstein <mitz@apple.com>
776 <rdar://problem/17295636> [Cocoa] Include element snapshot in _WKActivatedElementInfo
777 https://bugs.webkit.org/show_bug.cgi?id=134872
779 Reviewed by Sam Weinig.
781 * Shared/InteractionInformationAtPosition.cpp:
782 (WebKit::InteractionInformationAtPosition::encode): Encode the image if there is one.
783 (WebKit::InteractionInformationAtPosition::decode): Decode the image if there is one.
784 * Shared/InteractionInformationAtPosition.h: Added an image member to the struct.
786 * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: Exposed the boundingRect property and added
788 * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
789 (-[_WKActivatedElementInfo _initWithType:URL:location:title:rect:image:]): Added an image
790 parameter, which is stored in a new ivar.
791 (-[_WKActivatedElementInfo image]): Added this getter, which converts the ShareableBitmap
792 into a cached Cocoa image and returns it.
793 * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: Added image parameter to the
794 initializer, removed _boundingRect property declaration from here.
796 * UIProcess/ios/WKActionSheetAssistant.mm:
797 (-[WKActionSheetAssistant showImageSheet]): Pass the image from the position information
798 into the _WKActivatedElementInfo initializer.
799 (-[WKActionSheetAssistant showLinkSheet]): Ditto.
801 * WebProcess/WebPage/WebPage.cpp:
802 (WebKit::WebPage::snapshotNode): Added.
803 * WebProcess/WebPage/WebPage.h:
805 * WebProcess/WebPage/ios/WebPageIOS.mm:
806 (WebKit::WebPage::getPositionInformation): If the element is a link or an image, store a
807 snapshot of it in the image member of the InteractionInformationAtPosition.
809 2014-07-13 Dan Bernstein <mitz@apple.com>
811 [Cocoa] Clean up session state API a little
812 https://bugs.webkit.org/show_bug.cgi?id=134871
814 Reviewed by Darin Adler.
816 * UIProcess/API/Cocoa/WKWebView.mm:
817 (-[WKWebView _sessionState]):
818 (-[WKWebView _restoreFromSessionState:]): Deleted.
819 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
821 2014-07-13 Javier Fernandez <jfernandez@igalia.com>
823 REGRESSION(r171045) [GTK] Build broken.
824 https://bugs.webkit.org/show_bug.cgi?id=134867
826 Unreviewed GTK build fix after r171045.
828 * UIProcess/API/gtk/PageClientImpl.cpp:
829 (WebKit::PageClientImpl::willRecordNavigationSnapshot):
830 * UIProcess/API/gtk/PageClientImpl.h:
832 2014-07-13 Gyuyoung Kim <gyuyoung.kim@samsung.com>
834 Unreviewed, EFL build fix since r171045.
836 * UIProcess/CoordinatedGraphics/WebView.h:
838 2014-07-12 Dan Bernstein <mitz@apple.com>
840 [Cocoa] Notify the client when a navigation snapshot is taken
841 https://bugs.webkit.org/show_bug.cgi?id=134865
843 Reviewed by Sam Weinig.
845 * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
847 * UIProcess/Cocoa/NavigationState.h:
848 * UIProcess/Cocoa/NavigationState.mm:
849 (WebKit::NavigationState::setNavigationDelegate): Initialize new flag in
850 m_navigationDelegateMethods.
851 (WebKit::NavigationState::willRecordNavigationSnapshot): Added. Calls the new
852 WKNavigationDelegate method.
854 * UIProcess/PageClient.h: Declared new client function.
856 * UIProcess/WebPageProxy.cpp:
857 (WebKit::WebPageProxy::willRecordNavigationSnapshot): Added. Calls the new client function.
858 * UIProcess/WebPageProxy.h:
860 * UIProcess/ios/PageClientImplIOS.h:
861 * UIProcess/ios/PageClientImplIOS.mm:
862 (WebKit::PageClientImpl::willRecordNavigationSnapshot): Override that calls
863 NavigationState::willRecordNavigationSnapshot.
865 * UIProcess/mac/PageClientImpl.h:
866 * UIProcess/mac/PageClientImpl.mm:
867 (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
869 * UIProcess/mac/ViewSnapshotStore.mm:
870 (WebKit::ViewSnapshotStore::recordSnapshot): Added a call to
871 WebPageProxy::willRecordNavigationSnapshot.
873 2014-07-12 Gyuyoung Kim <gyuyoung.kim@samsung.com>
875 Unreviewed, fix EFL build break since r171034.
877 * UIProcess/CoordinatedGraphics/WebView.h:
878 * UIProcess/efl/WebContextEfl.cpp:
879 (WebKit::WebContext::platformMediaCacheDirectory):
881 2014-07-12 Darin Adler <darin@apple.com>
883 Try to fix 32-bit Mac build.
885 * UIProcess/mac/PageClientImpl.mm:
886 (WebKit::PageClientImpl::navigationGestureDidBegin): Added WK_API_ENABLED conditional.
887 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
888 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
890 2014-07-12 Javier Fernandez <jfernandez@igalia.com>
892 REGRESSION(r171034) [GTK] Build broken.
893 https://bugs.webkit.org/show_bug.cgi?id=134861
895 Unreviewed GTK build fix.
897 * UIProcess/API/gtk/PageClientImpl.cpp:
898 (WebKit::PageClientImpl::navigationGestureDidBegin):
899 (WebKit::PageClientImpl::navigationGestureWillEnd):
900 (WebKit::PageClientImpl::navigationGestureDidEnd):
901 * UIProcess/API/gtk/PageClientImpl.h:
903 2014-07-12 Javier Fernandez <jfernandez@igalia.com>
905 REGRESSION(r171024) [GTK] Build broken.
906 https://bugs.webkit.org/show_bug.cgi?id=134859
908 Unreviewed GTK build fix.
910 * UIProcess/gtk/WebContextGtk.cpp:
911 (WebKit::WebContext::platformMediaCacheDirectory):
913 2014-07-12 Dan Bernstein <mitz@apple.com>
915 <rdar://problem/16020380> [Cocoa] Inform the client when back-forward navigation gestures begin and end
916 https://bugs.webkit.org/show_bug.cgi?id=134853
918 Reviewed by Sam Weinig.
920 * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new WKNavigationDelegate
923 * UIProcess/API/Cocoa/WKWebView.mm:
924 (-[WKWebView _isShowingNavigationGestureSnapshot]): Added this getter.
926 * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property
927 _isShowingNavigationGestureSnapshot.
929 * UIProcess/Cocoa/NavigationState.h:
930 * UIProcess/Cocoa/NavigationState.mm:
931 (WebKit::NavigationState::setNavigationDelegate): Initialize new flags in
932 m_navigationDelegateMethods.
933 (WebKit::NavigationState::navigationGestureDidBegin): Added. Calls the new
934 WKNavigationDelegate method.
935 (WebKit::NavigationState::navigationGestureWillEnd): Ditto.
936 (WebKit::NavigationState::navigationGestureDidEnd): Ditto.
938 * UIProcess/PageClient.h: Declared new client functions.
940 * UIProcess/WebPageProxy.cpp:
941 (WebKit::WebPageProxy::WebPageProxy): Initialize new member variable.
942 (WebKit::WebPageProxy::navigationGestureDidBegin): Set m_isShowingNavigationGestureSnapshot
943 and call the new client function.
944 (WebKit::WebPageProxy::navigationGestureWillEnd): Call the new client function.
945 (WebKit::WebPageProxy::navigationGestureDidEnd): Ditto.
946 (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved): Clear
947 m_isShowingNavigationGestureSnapshot.
948 * UIProcess/WebPageProxy.h:
949 (WebKit::WebPageProxy::isShowingNavigationGestureSnapshot): Added this getter.
951 * UIProcess/ios/PageClientImplIOS.h: Declared overrides of new client functions.
952 * UIProcess/ios/PageClientImplIOS.mm:
953 (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
954 NavigationState function.
955 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
956 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
958 * UIProcess/ios/ViewGestureControllerIOS.mm:
959 (WebKit::ViewGestureController::beginSwipeGesture): Added calls to
960 WebPageProxy::navigationGestureDidBegin and WebPageProxy::navigationGestureWillEnd.
961 (WebKit::ViewGestureController::endSwipeGesture): Added calls to
962 WebPageProxy::navigationGestureDidEnd.
963 (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
964 WebPageProxy::navigationGestureSnapshotWasRemoved.
966 * UIProcess/mac/PageClientImpl.h: Declared overrides of new client functions.
967 * UIProcess/mac/PageClientImpl.mm:
968 (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
969 NavigationState function.
970 (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
971 (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
973 * UIProcess/mac/ViewGestureControllerMac.mm:
974 (WebKit::ViewGestureController::beginSwipeGesture): Added call to
975 WebPageProxy::navigationGestureDidBegin.
976 (WebKit::ViewGestureController::endSwipeGesture): Added calls to
977 WebPageProxy::navigationGestureDidEnd.
978 (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
979 WebPageProxy::navigationGestureSnapshotWasRemoved.
981 2014-07-12 Oliver Hunt <oliver@apple.com>
983 Fix typo in prior patch
984 https://bugs.webkit.org/show_bug.cgi?id=134858
986 Reviewed by Sam Weinig.
990 * UIProcess/mac/WebContextMac.mm:
991 (WebKit::WebContext::platformDefaultCookieStorageDirectory):
993 2014-07-12 Dan Bernstein <mitz@apple.com>
995 [Cocoa] Client is not notified of same-document navigations
996 https://bugs.webkit.org/show_bug.cgi?id=134855
998 Reviewed by Sam Weinig.
1000 * UIProcess/API/APILoaderClient.h:
1001 (API::LoaderClient::didSameDocumentNavigationForFrame): Added navigationID parameter.
1003 * UIProcess/API/C/WKPage.cpp:
1004 (WKPageSetPageLoaderClient): Ditto.
1006 * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Added new enum and delegate method.
1008 * UIProcess/Cocoa/NavigationState.h: Declare override of
1009 API::LoaderClient::didSameDocumentNavigationForFrame. Added flag in
1010 m_navigationDelegateMethods struct.
1011 * UIProcess/Cocoa/NavigationState.mm:
1012 (WebKit::NavigationState::setNavigationDelegate): Initialize new m_navigationDelegateMethods
1014 (WebKit::toWKSameDocumentNavigationType): Added this helper to convert from internal to API
1016 (WebKit::NavigationState::LoaderClient::didSameDocumentNavigationForFrame): Override to call
1017 the delegate method, if implemented.
1019 * UIProcess/WebPageProxy.cpp:
1020 (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Added navigationID parameter,
1021 which is forwarded to the client.
1022 * UIProcess/WebPageProxy.h: Added navigationID parameter.
1023 * UIProcess/WebPageProxy.messages.in: Ditto.
1025 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1026 (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): Send the navigation ID.
1027 (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): Ditto.
1028 (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): Ditto.
1029 (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): Ditto.
1031 2014-07-12 Oliver Hunt <oliver@apple.com>
1033 Extend WebContent sandbox to allow some extra access for frameworks
1034 https://bugs.webkit.org/show_bug.cgi?id=134844
1036 Reviewed by Sam Weinig.
1038 Open up the webcontent sandbox a bit so that some external frameworks
1041 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1042 * Shared/WebProcessCreationParameters.cpp:
1043 (WebKit::WebProcessCreationParameters::encode):
1044 (WebKit::WebProcessCreationParameters::decode):
1045 * Shared/WebProcessCreationParameters.h:
1046 * UIProcess/WebContext.cpp:
1047 (WebKit::WebContext::createNewWebProcess):
1048 (WebKit::WebContext::mediaCacheDirectory):
1049 * UIProcess/WebContext.h:
1050 * UIProcess/mac/WebContextMac.mm:
1051 (WebKit::WebContext::platformMediaCacheDirectory):
1052 * WebProcess/cocoa/WebProcessCocoa.mm:
1053 (WebKit::WebProcess::platformInitializeWebProcess):
1055 2014-07-12 Oliver Hunt <oliver@apple.com>
1057 Temporary work around for <rdar://<rdar://problem/17513375>
1058 https://bugs.webkit.org/show_bug.cgi?id=134848
1060 Reviewed by Sam Weinig.
1062 Temporarily work around <rdar://<rdar://problem/17513375> by
1063 dropping the explicit cookie storage if it points out of the
1066 * UIProcess/mac/WebContextMac.mm:
1067 (WebKit::WebContext::platformDefaultCookieStorageDirectory):
1069 2014-07-11 Enrica Casucci <enrica@apple.com>
1071 Implement textStylingAtPosition in WK2.
1072 https://bugs.webkit.org/show_bug.cgi?id=134843
1073 <rdar://problem/17614981>
1075 Reviewed by Benjamin Poulain.
1077 Adding information about typing attributes to EditorState so
1078 that we can implement textStylingAtPosition.
1080 * Shared/EditorState.cpp:
1081 (WebKit::EditorState::encode):
1082 (WebKit::EditorState::decode):
1083 * Shared/EditorState.h:
1084 (WebKit::EditorState::EditorState):
1085 * UIProcess/ios/WKContentViewInteraction.mm:
1086 (-[WKContentView textStylingAtPosition:inDirection:]):
1087 (-[WKContentView canPerformAction:withSender:]):
1088 (-[WKContentView toggleBoldface:]):
1089 (-[WKContentView toggleItalics:]):
1090 (-[WKContentView toggleUnderline:]):
1091 * WebProcess/WebPage/WebPage.cpp:
1092 (WebKit::WebPage::editorState):
1094 2014-07-11 Oliver Hunt <oliver@apple.com>
1096 Tighten WebContent sandbox
1097 https://bugs.webkit.org/show_bug.cgi?id=134834
1099 Reviewed by Sam Weinig.
1101 Define a much tighter sandbox profile for the WebContent process
1103 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1105 2014-07-11 Antti Koivisto <antti@apple.com>
1107 REGRESSION (r170163?): Web content shifts revealing space equivalent to the find bar when clicking a link while a phrase is targeted via Cmd+F
1108 https://bugs.webkit.org/show_bug.cgi?id=134833
1109 <rdar://problem/17580021>
1111 Reviewed by Zalan Bujtas.
1113 Some versions of OS X Safari can't handle the new unfreeze timing. Revert back to DidFirstLayout on Mac.
1115 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1116 (WebKit::WebFrameLoaderClient::dispatchDidLayout):
1118 2014-07-11 Zalan Bujtas <zalan@apple.com>
1120 Subpixel layout: return integral results for offset*, client*, scroll* by default.
1121 https://bugs.webkit.org/show_bug.cgi?id=134651
1123 Reviewed by Simon Fraser.
1125 Revert to returning integral values for Element.offset* client* scroll* by default.
1126 Fractional values break number of sites(tight design) and JS frameworks(fail to handle fractional values).
1128 Since snapped dimension depends on both the original point and the width/height of the box,
1129 we need to call RenderBoxModelObject::pixelSnapped*() helpers, instead of round().
1131 Covered by existing tests
1133 * Shared/WebPreferencesDefinitions.h:
1134 * UIProcess/API/C/WKPreferencesRefPrivate.h:
1136 2014-07-10 Jinwoo Song <jinwoo7.song@samsung.com>
1138 Unreviewed EFL build fix after r170970.
1140 * UIProcess/efl/WebContextEfl.cpp:
1141 (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
1143 2014-07-10 Carlos Alberto Lopez Perez <clopez@igalia.com>
1145 REGRESSION(r170970) REGRESSION(r170974): [GTK] Build broken.
1146 https://bugs.webkit.org/show_bug.cgi?id=134825
1148 Unreviewed GTK build fix.
1150 * Shared/SessionState.h: Put ifdefs for ViewSnapshot on Mac port.
1151 * Shared/WebBackForwardListItem.h: Idem.
1152 * UIProcess/gtk/WebContextGtk.cpp:
1153 (WebKit::WebContext::platformDefaultOpenGLCacheDirectory): Implement skeleton.
1155 2014-07-10 Benjamin Poulain <bpoulain@apple.com>
1157 [iOS][WK2] It should be safe to call WKContentViewInteraction's cleanupInteraction multiple times
1158 https://bugs.webkit.org/show_bug.cgi?id=134820
1160 Reviewed by Andreas Kling.
1162 If a view is destroyed just after a crash, "cleanupInteraction" is called twice: once on crash,
1165 The code handling _interactionViewsContainerView is using KVO to monitor transform changes. It is not safe
1166 to remove the observer if we are not already observing on that view.
1168 To solve the problem, this patch makes the cleanup actually remove the view so that setup and cleanup
1169 are completely symmetrical. If cleanup is called twice, the second time would not enter the branch because
1170 the view is already nil.
1172 * UIProcess/ios/WKContentViewInteraction.mm:
1173 (-[WKContentView setupInteraction]):
1174 (-[WKContentView cleanupInteraction]):
1176 2014-07-10 Simon Fraser <simon.fraser@apple.com>
1178 [iOS WK2] Move WKInspectorHighlightView to its own file
1179 https://bugs.webkit.org/show_bug.cgi?id=134819
1181 Reviewed by Joseph Pecoraro.
1183 WKInspectorHighlightView brought a lot of path/quad-related code into WKContentView.mm,
1184 so move it into its own file.
1186 * UIProcess/WKInspectorHighlightView.h: Added.
1187 * UIProcess/WKInspectorHighlightView.mm: Added.
1188 (-[WKInspectorHighlightView dealloc]):
1189 (-[WKInspectorHighlightView _removeAllLayers]):
1190 (-[WKInspectorHighlightView _createLayers:]):
1191 (findIntersectionOnLineBetweenPoints):
1193 (layerPathWithHole):
1195 (-[WKInspectorHighlightView _layoutForNodeHighlight:]):
1196 (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
1197 (-[WKInspectorHighlightView update:]):
1198 * UIProcess/ios/WKContentView.mm:
1199 (-[WKInspectorHighlightView initWithFrame:]): Deleted.
1200 (-[WKInspectorHighlightView dealloc]): Deleted.
1201 (-[WKInspectorHighlightView _removeAllLayers]): Deleted.
1202 (-[WKInspectorHighlightView _createLayers:]): Deleted.
1203 (findIntersectionOnLineBetweenPoints): Deleted.
1204 (quadIntersection): Deleted.
1205 (layerPathWithHole): Deleted.
1206 (layerPath): Deleted.
1207 (-[WKInspectorHighlightView _layoutForNodeHighlight:]): Deleted.
1208 (-[WKInspectorHighlightView _layoutForRectsHighlight:]): Deleted.
1209 (-[WKInspectorHighlightView update:]): Deleted.
1210 * WebKit2.xcodeproj/project.pbxproj:
1212 2014-07-10 Tim Horton <timothy_horton@apple.com>
1214 REGRESSION (r170935): WKWebView is always transparent until the first layer tree commit
1215 https://bugs.webkit.org/show_bug.cgi?id=134818
1216 <rdar://problem/17632468>
1218 Reviewed by Anders Carlsson.
1220 * UIProcess/API/Cocoa/WKWebView.mm:
1221 (scrollViewBackgroundColor):
1222 r170935 made it so that we would initialize the scroll view background color to an
1223 invalid color until the first layer tree commit. We should go with white instead.
1225 2014-07-10 Enrica Casucci <enrica@apple.com>
1227 Add a mechanism to notify the UIProcess when an editing command is done executing.
1228 https://bugs.webkit.org/show_bug.cgi?id=134807
1230 Reviewed by Tim Horton.
1232 Some editing commands have an effect on some parts of the system that
1233 run inside the UIProcess. A good example are the cursor movement commands
1234 that require an update of the autocorrection/autosuggestion machinery.
1235 This patch adds a way to reliably know when the command has been executed
1236 in the WebProcess. A previous attempt at solving this problem was added in
1237 r170858 and was partially reverted in r170948.
1238 The change also removes the selectionWillChange notification added in r170858.
1240 * UIProcess/PageClient.h:
1241 * UIProcess/WebPageProxy.cpp:
1242 (WebKit::WebPageProxy::editorStateChanged):
1243 * UIProcess/WebPageProxy.h:
1244 * UIProcess/ios/PageClientImplIOS.h:
1245 * UIProcess/ios/PageClientImplIOS.mm:
1246 (WebKit::PageClientImpl::selectionWillChange): Deleted.
1247 * UIProcess/ios/WKContentViewInteraction.h:
1248 * UIProcess/ios/WKContentViewInteraction.mm:
1249 (-[WKContentView executeEditCommandWithCallback:]):
1250 (-[WKContentView _moveUp:withHistory:]):
1251 (-[WKContentView _moveDown:withHistory:]):
1252 (-[WKContentView _moveLeft:withHistory:]):
1253 (-[WKContentView _moveRight:withHistory:]):
1254 (-[WKContentView _moveToStartOfWord:withHistory:]):
1255 (-[WKContentView _moveToStartOfParagraph:withHistory:]):
1256 (-[WKContentView _moveToStartOfLine:withHistory:]):
1257 (-[WKContentView _moveToStartOfDocument:withHistory:]):
1258 (-[WKContentView _moveToEndOfWord:withHistory:]):
1259 (-[WKContentView _moveToEndOfParagraph:withHistory:]):
1260 (-[WKContentView _moveToEndOfLine:withHistory:]):
1261 (-[WKContentView _moveToEndOfDocument:withHistory:]):
1262 (-[WKContentView _selectionWillChange]): Deleted.
1263 * UIProcess/ios/WebPageProxyIOS.mm:
1264 (WebKit::WebPageProxy::executeEditCommand):
1265 (WebKit::WebPageProxy::notifySelectionWillChange): Deleted.
1266 * WebProcess/WebPage/WebPage.h:
1267 * WebProcess/WebPage/WebPage.messages.in:
1268 * WebProcess/WebPage/ios/WebPageIOS.mm:
1269 (WebKit::WebPage::executeEditCommandWithCallback):
1271 2014-07-10 Joseph Pecoraro <pecoraro@apple.com>
1273 [Mac] NSWindow warning: adding an unknown subview opening detached Inspector
1274 https://bugs.webkit.org/show_bug.cgi?id=134813
1276 Reviewed by Timothy Hatcher.
1278 * UIProcess/mac/WebInspectorProxyMac.mm:
1279 (WebKit::WebInspectorProxy::createInspectorWindow):
1280 Use a selector that will avoid the warning message.
1282 2014-07-10 Oliver Hunt <oliver@apple.com>
1284 Remove use of container relative restrictions in the network process sandbox
1285 https://bugs.webkit.org/show_bug.cgi?id=134816
1287 Reviewed by Anders Carlsson.
1289 As i'm tidying up the various sandboxes and that's meaning we
1290 need to reduce some file restrictions in the network process.
1292 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1294 2014-07-10 Pratik Solanki <psolanki@apple.com>
1296 Unreviewed iOS build fix after r170974. Define id if building a non ObjC file.
1298 * UIProcess/mac/ViewSnapshotStore.h:
1300 2014-07-10 Tim Horton <timothy_horton@apple.com>
1302 Store ViewSnapshots directly on the WebBackForwardListItem
1303 https://bugs.webkit.org/show_bug.cgi?id=134667
1304 <rdar://problem/17082639>
1306 Reviewed by Dan Bernstein.
1308 Make ViewSnapshot a refcounted class. Store it directly on the back-forward item
1309 instead of in a side map referenced by UUID. Switch to a very simple LRU eviction model for now.
1310 This fixes a ton of snapshot management bugs; for example, we would start throwing out snapshots
1311 in the page that was actively being interacted with *first* when evicting snapshots, instead of
1312 preferring older snapshots. Additionally, we would not throw away snapshots when back forward items
1315 There is definitely room for improvement of the eviction mechanism, but this is closer to a time-tested implementation.
1317 * Shared/SessionState.h:
1318 Keep a ViewSnapshot instead of a UUID on the BackForwardListItemState.
1320 * Shared/WebBackForwardListItem.h:
1321 Fix some indented namespace contents.
1323 (WebKit::WebBackForwardListItem::snapshot):
1324 (WebKit::WebBackForwardListItem::setSnapshot):
1325 (WebKit::WebBackForwardListItem::setSnapshotUUID): Deleted.
1326 (WebKit::WebBackForwardListItem::snapshotUUID): Deleted.
1327 Switch the snapshot getter/setter to operate on ViewSnapshots instead of UUIDs.
1329 * UIProcess/API/Cocoa/WKWebView.mm:
1330 (-[WKWebView _takeViewSnapshot]):
1331 * UIProcess/API/Cocoa/WKWebViewInternal.h:
1332 * UIProcess/API/mac/WKView.mm:
1333 (-[WKView _takeViewSnapshot]):
1334 * UIProcess/API/mac/WKViewInternal.h:
1335 * UIProcess/PageClient.h:
1336 * UIProcess/WebPageProxy.cpp:
1337 (WebKit::WebPageProxy::takeViewSnapshot):
1338 * UIProcess/WebPageProxy.h:
1339 * UIProcess/ios/PageClientImplIOS.h:
1340 * UIProcess/ios/PageClientImplIOS.mm:
1341 (WebKit::PageClientImpl::takeViewSnapshot):
1342 * UIProcess/mac/PageClientImpl.h:
1343 * UIProcess/mac/PageClientImpl.mm:
1344 (WebKit::PageClientImpl::takeViewSnapshot):
1345 Adopt ViewSnapshot::create, return a PassRefPtr, and class-ify ViewSnapshot.
1347 * UIProcess/ios/ViewGestureControllerIOS.mm:
1348 (WebKit::ViewGestureController::beginSwipeGesture):
1349 (WebKit::ViewGestureController::endSwipeGesture):
1350 * UIProcess/mac/ViewGestureController.h:
1351 * UIProcess/mac/ViewGestureControllerMac.mm:
1352 (WebKit::ViewGestureController::shouldUseSnapshotForSize):
1353 (WebKit::ViewGestureController::beginSwipeGesture):
1354 (WebKit::ViewGestureController::endSwipeGesture):
1355 Grab the ViewSnapshot directly from the WebBackForwardListItem, and adopt the new functions.
1357 * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
1358 (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
1359 Rename discardSnapshots to discardSnapshotImages, because we're really only discarding
1360 the images; the render tree size/background color "snapshot" remains and is useful.
1362 * UIProcess/mac/ViewSnapshotStore.h:
1363 (WebKit::ViewSnapshot::setRenderTreeSize):
1364 (WebKit::ViewSnapshot::renderTreeSize):
1365 (WebKit::ViewSnapshot::setBackgroundColor):
1366 (WebKit::ViewSnapshot::backgroundColor):
1367 (WebKit::ViewSnapshot::setDeviceScaleFactor):
1368 (WebKit::ViewSnapshot::deviceScaleFactor):
1369 (WebKit::ViewSnapshot::imageSizeInBytes):
1370 (WebKit::ViewSnapshot::surface):
1371 (WebKit::ViewSnapshot::size):
1372 (WebKit::ViewSnapshot::creationTime):
1373 Make ViewSnapshot a refcounted class.
1374 Add create functions which take an image (or slot ID), and relevant sizes.
1375 It is expected that a ViewSnapshot is created with an image, and it is only possible
1376 to remove that image, never to replace it. A new ViewSnapshot is required in that case.
1377 Add setters for things that ViewSnapshotStore sets on the snapshot after the PageClient
1378 retrieves it from the view. Add getters for things that the ViewGestureControllers need.
1380 Remove removeSnapshotImage, getSnapshot, and the snapshot map.
1382 * UIProcess/mac/ViewSnapshotStore.mm:
1383 (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
1384 (WebKit::ViewSnapshotStore::didAddImageToSnapshot):
1385 (WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
1386 Manage m_snapshotCacheSize and m_snapshotsWithImages via didAddImageToSnapshot and willRemoveImageFromSnapshot.
1387 willRemoveImageFromSnapshot will -always- be called before the ViewSnapshot is destroyed.
1389 (WebKit::ViewSnapshotStore::pruneSnapshots):
1390 Switch to a simple LRU eviction model. As previously mentioned, it's possible to do better, but
1391 this is much less broken than the previous implementation.
1393 (WebKit::ViewSnapshotStore::recordSnapshot):
1394 (WebKit::ViewSnapshotStore::discardSnapshotImages):
1395 (WebKit::ViewSnapshot::create):
1396 (WebKit::ViewSnapshot::ViewSnapshot):
1397 (WebKit::ViewSnapshot::~ViewSnapshot):
1398 (WebKit::ViewSnapshot::hasImage):
1399 (WebKit::ViewSnapshot::clearImage):
1400 (WebKit::ViewSnapshot::asLayerContents):
1401 If a surface is Empty when it comes back from being volatile, throw away the surface
1402 and notify the Store to remove it from m_snapshotCacheSize (via clearImage()).
1404 (WebKit::ViewSnapshotStore::removeSnapshotImage): Deleted.
1405 (WebKit::ViewSnapshotStore::getSnapshot): Deleted.
1406 (WebKit::ViewSnapshotStore::discardSnapshots): Deleted.
1408 2014-07-10 Beth Dakin <bdakin@apple.com>
1410 Need Setting/WKPreference that allows clients to prevent scrollbars from drawing
1411 on a secondary thread
1412 https://bugs.webkit.org/show_bug.cgi?id=134778
1414 <rdar://problem/17595333>
1416 Reviewed by Tim Horton.
1418 This is a requirement for some types of performance tests.
1421 * Shared/WebPreferencesDefinitions.h:
1423 PDFPlugin has to implement this new ScrollableArea virtual function to indicate
1424 the Setting’s value.
1425 * WebProcess/Plugins/PDF/PDFPlugin.h:
1426 * WebProcess/Plugins/PDF/PDFPlugin.mm:
1427 (WebKit::PDFPlugin::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
1430 * WebProcess/WebPage/WebPage.cpp:
1431 (WebKit::WebPage::updatePreferences):
1433 2014-07-10 Tim Horton <timothy_horton@apple.com>
1435 [iOS] Frequent assertion failures when swiping back
1437 Reviewed by Dan Bernstein.
1439 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1440 (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
1441 Don't create an unused VoidCallback. It will assert when destroyed without being called.
1443 2014-07-10 Oliver Hunt <oliver@apple.com>
1445 Pass sandbox extension for GL cache over to webprocess
1446 https://bugs.webkit.org/show_bug.cgi?id=134806
1448 Reviewed by Anders Carlsson.
1450 Add additional WebProcess parameters to pass an extension
1451 that allows access to the opengl cache directory in the
1452 host application's container.
1454 * Shared/WebProcessCreationParameters.cpp:
1455 (WebKit::WebProcessCreationParameters::encode):
1456 (WebKit::WebProcessCreationParameters::decode):
1457 * Shared/WebProcessCreationParameters.h:
1458 * UIProcess/WebContext.cpp:
1459 (WebKit::WebContext::createNewWebProcess):
1460 (WebKit::WebContext::openGLCacheDirectory):
1461 * UIProcess/WebContext.h:
1462 * UIProcess/mac/WebContextMac.mm:
1463 (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
1464 * WebProcess/cocoa/WebProcessCocoa.mm:
1465 (WebKit::WebProcess::platformInitializeWebProcess):
1467 2014-07-10 Dan Bernstein <mitz@apple.com>
1471 * WebProcess/WebPage/ServicesOverlayController.h:
1473 2014-07-09 Brady Eidson <beidson@apple.com>
1475 Phone number highlights should always be visible if the mouse hovers over.
1476 <rdar://problem/17527476> and https://bugs.webkit.org/show_bug.cgi?id=134784
1478 Reviewed by Tim Horton.
1480 This is a fairly extensive rewrite of ServicesOverlayController.
1481 It allows one selection highlight for the entire selection, and as many telephone number highlights as there are numbers.
1482 If a telephone number highlight is hovered over, it wins and is painted.
1483 If no telephone number highlight is hovered but the selection highlight is, then it is painted.
1485 The purposes of each method are self evident by their name, and the concepts are mostly the same as they used to be.
1487 The exception is establishHoveredTelephoneHighlight which gets a more detailed explanation below.
1489 * Platform/Logging.h: Add a Services logging channel.
1491 * WebProcess/WebPage/ServicesOverlayController.h:
1492 (WebKit::TelephoneNumberData::TelephoneNumberData):
1494 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
1495 (WebKit::ServicesOverlayController::ServicesOverlayController):
1496 (WebKit::ServicesOverlayController::selectionRectsDidChange):
1497 (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
1498 (WebKit::ServicesOverlayController::clearHighlightState):
1499 (WebKit::ServicesOverlayController::drawRect):
1500 (WebKit::ServicesOverlayController::drawSelectionHighlight):
1501 (WebKit::ServicesOverlayController::maybeDrawTelephoneNumberHighlight):
1502 (WebKit::ServicesOverlayController::drawHighlight):
1503 (WebKit::ServicesOverlayController::clearSelectionHighlight):
1504 (WebKit::ServicesOverlayController::clearHoveredTelephoneNumberHighlight):
1505 (WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight): Starts walking the telephone number ranges and
1506 creating a highlight for each one that doesn’t already have a highlight. If that highlight is also being hovered by
1507 the mouse, then it is set as the hovered telephone number highlight and the method stops creating new highlights.
1508 (WebKit::ServicesOverlayController::maybeCreateSelectionHighlight):
1509 (WebKit::ServicesOverlayController::mouseEvent):
1510 (WebKit::ServicesOverlayController::handleClick):
1511 (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Deleted.
1512 (WebKit::ServicesOverlayController::drawCurrentHighlight): Deleted.
1514 2014-07-10 Timothy Horton <timothy_horton@apple.com>
1516 Assertions or crashes under _takeViewSnapshot when restoring windows
1517 https://bugs.webkit.org/show_bug.cgi?id=134792
1519 Reviewed by Simon Fraser.
1521 * UIProcess/API/mac/WKView.mm:
1522 (-[WKView _takeViewSnapshot]):
1523 Taking a window-server snapshot of a non-visible window tends to not succeed.
1525 2014-07-09 Pratik Solanki <psolanki@apple.com>
1527 Buffer CSS and JS resources in network process before sending over to web process
1528 https://bugs.webkit.org/show_bug.cgi?id=134560
1529 <rdar://problem/16737186>
1531 Reviewed by Antti Koivisto.
1533 For CSS and JS resources, ask the network process to buffer the entire resource instead of
1534 sending it to web process in chunks since the web process can't do anything with a partial
1537 * NetworkProcess/NetworkResourceLoader.cpp:
1538 (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1539 * Shared/Network/NetworkResourceLoadParameters.cpp:
1540 (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
1541 (WebKit::NetworkResourceLoadParameters::encode):
1542 (WebKit::NetworkResourceLoadParameters::decode):
1543 * Shared/Network/NetworkResourceLoadParameters.h:
1544 * WebProcess/Network/WebResourceLoadScheduler.cpp:
1545 (WebKit::WebResourceLoadScheduler::scheduleLoad):
1547 2014-07-09 Benjamin Poulain <bpoulain@apple.com>
1549 [iOS][WK2] Disable text quantization while actively changing the page's scale factor
1550 https://bugs.webkit.org/show_bug.cgi?id=134781
1552 Reviewed by Tim Horton and Myles C. Maxfield.
1554 While zooming a page, text quantization causes glyphs to "move" in order to get to the closest
1555 boundary for the current scale factor.
1557 We do not want this to happen while dynamically changing the scale factor because the effect
1558 is visible. To avoid this, we disable text quantization if the page's scale factor changes
1559 in response to a non-stable contentRect update.
1561 * WebProcess/WebCoreSupport/WebChromeClient.h:
1562 * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1563 (WebKit::WebChromeClient::hasStablePageScaleFactor):
1564 * WebProcess/WebPage/WebPage.cpp:
1565 (WebKit::WebPage::WebPage):
1566 * WebProcess/WebPage/WebPage.h:
1567 (WebKit::WebPage::hasStablePageScaleFactor):
1568 * WebProcess/WebPage/ios/WebPageIOS.mm:
1569 (WebKit::WebPage::updateVisibleContentRects):
1571 2014-07-09 Joseph Pecoraro <pecoraro@apple.com>
1573 [iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI
1574 https://bugs.webkit.org/show_bug.cgi?id=134777
1576 Reviewed by Sam Weinig.
1578 * UIProcess/ios/forms/WKFileUploadPanel.mm:
1579 (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
1581 2014-07-09 Shivakumar JM <shiva.jm@samsung.com>
1583 [EFL][WK2] Add new Public API in ewk_download_job.h to get size of the data already downloaded.
1584 https://bugs.webkit.org/show_bug.cgi?id=134759
1586 Reviewed by Gyuyoung Kim.
1588 Add new API in ewk_download_job.h to get size of the data already downloaded.
1590 * UIProcess/API/efl/ewk_download_job.cpp:
1591 (ewk_download_job_received_data_length_get):
1592 (EwkDownloadJob::receivedData):
1593 * UIProcess/API/efl/ewk_download_job.h:
1594 * UIProcess/API/efl/ewk_download_job_private.h:
1595 * UIProcess/API/efl/tests/test_ewk2_download_job.cpp:
1596 (EWK2DownloadJobTest::on_download_requested):
1597 (EWK2DownloadJobTest::on_download_finished):
1599 2014-07-09 Enrica Casucci <enrica@apple.com>
1601 REGRESSION(r170858): Safari freezes upon making a search on a website (yelp.com).
1602 https://bugs.webkit.org/show_bug.cgi?id=134791
1603 <rdar://problem/17616971>
1605 Reviewed by Benjamin Poulain.
1607 After r170858 we notify the keyboard too often about
1608 the changed selection. This patch removes the notification
1609 until we find a better way to do it that doesn't cause
1612 * UIProcess/ios/WKContentViewInteraction.mm:
1613 (-[WKContentView _selectionWillChange]):
1614 (-[WKContentView _selectionChanged]):
1616 2014-07-09 Anders Carlsson <andersca@apple.com>
1618 Safari showing blank pages
1619 https://bugs.webkit.org/show_bug.cgi?id=134790
1620 <rdar://problem/17617166>
1622 Reviewed by Simon Fraser.
1624 * UIProcess/API/Cocoa/WKWebView.mm:
1625 (-[WKWebView initWithFrame:configuration:]):
1626 Make sure to add the content view to the scroll view.
1628 2014-07-09 Anders Carlsson <andersca@apple.com>
1630 Closed web views should never create new web processes
1631 https://bugs.webkit.org/show_bug.cgi?id=134787
1632 <rdar://problem/16892526>
1634 Reviewed by Simon Fraser.
1636 * UIProcess/API/Cocoa/WKWebView.mm:
1637 (-[WKWebView loadHTMLString:baseURL:]):
1638 (-[WKWebView reload]):
1639 (-[WKWebView reloadFromOrigin]):
1640 Return nil if the returned navigation ID is 0.
1642 * UIProcess/WebPageProxy.cpp:
1643 (WebKit::WebPageProxy::reattachToWebProcess):
1644 Assert that the page is not closed.
1646 (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1647 (WebKit::WebPageProxy::loadRequest):
1648 (WebKit::WebPageProxy::loadFile):
1649 (WebKit::WebPageProxy::loadData):
1650 (WebKit::WebPageProxy::loadHTMLString):
1651 (WebKit::WebPageProxy::loadAlternateHTMLString):
1652 (WebKit::WebPageProxy::loadPlainTextString):
1653 (WebKit::WebPageProxy::loadWebArchiveData):
1654 Add early returns if the page is closed.
1656 * UIProcess/WebPageProxy.h:
1658 2014-07-09 Anders Carlsson <andersca@apple.com>
1660 Support transparent WKWebViews
1661 https://bugs.webkit.org/show_bug.cgi?id=134779
1662 <rdar://problem/17351058>
1664 Reviewed by Tim Horton.
1666 * UIProcess/API/Cocoa/WKWebView.mm:
1667 (-[WKWebView initWithFrame:configuration:]):
1668 Call _updateScrollViewBackground instead of setting the background color.
1673 (scrollViewBackgroundColor):
1674 Helper function that returns the scroll view background color.
1675 If the web view isn't opaque, we want the scroll view to be transparent.
1677 (-[WKWebView _updateScrollViewBackground]):
1678 Call scrollViewBackgroundColor.
1680 (-[WKWebView setOpaque:]):
1681 Call WebPageProxy::setDrawsBackground and update the scroll view background.
1683 (-[WKWebView setBackgroundColor:]):
1684 Call setBackgroundColor on the content view.
1686 2014-07-09 Andy Estes <aestes@apple.com>
1688 [iOS] WebKit can crash under QuickLookDocumentData::encode() when viewing a QuickLook preview
1689 https://bugs.webkit.org/show_bug.cgi?id=134780
1691 Reviewed by Tim Horton.
1693 Don't use CFDataCreateWithBytesNoCopy() when we can't guarantee the lifetime of the copied-from DataReference
1694 will match or exceed that of the CFDataRef. Copy the data instead.
1696 * WebProcess/Network/WebResourceLoader.cpp:
1697 (WebKit::WebResourceLoader::didReceiveData):
1699 2014-07-09 Pratik Solanki <psolanki@apple.com>
1701 Move resource buffering from SynchronousNetworkLoaderClient to NetworkResourceLoader
1702 https://bugs.webkit.org/show_bug.cgi?id=134732
1704 Reviewed by Darin Adler.
1706 Buffer the resource in NetworkResourceLoader instead of SynchronousNetworkLoaderClient. This
1707 is in preparation for bug 134560 where we will be supporting JS and CSS resource buffering
1708 that uses AsynchronousNetworkLoaderClient.
1710 * NetworkProcess/NetworkResourceLoader.cpp:
1711 (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1712 (WebKit::NetworkResourceLoader::didReceiveBuffer):
1713 (WebKit::NetworkResourceLoader::didFinishLoading):
1714 * NetworkProcess/NetworkResourceLoader.h:
1715 (WebKit::NetworkResourceLoader::bufferedData):
1716 * NetworkProcess/SynchronousNetworkLoaderClient.cpp:
1717 (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer):
1718 (WebKit::SynchronousNetworkLoaderClient::didFinishLoading):
1719 (WebKit::SynchronousNetworkLoaderClient::didFail):
1720 (WebKit::SynchronousNetworkLoaderClient::sendDelayedReply):
1721 * NetworkProcess/SynchronousNetworkLoaderClient.h:
1723 2014-07-09 Benjamin Poulain <bpoulain@apple.com>
1725 [iOS][WK2] subviews of the unscaled view drift out during CA animations
1726 https://bugs.webkit.org/show_bug.cgi?id=134751
1728 Reviewed by Enrica Casucci.
1730 It is not possible to animate the WKContentView and the inverse view in such a way
1731 that the combined matrix remain the identity for every frame of the animation.
1733 This patch solves the issue by moving the unscaled view as a sibling of WKContentView
1734 instead of a child so that we do not need to update two scales simultaneously.
1736 * UIProcess/API/Cocoa/WKWebView.mm:
1737 (-[WKWebView initWithFrame:configuration:]):
1738 (-[WKWebView _processDidExit]):
1739 (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
1740 Set the z scale to 1 or no coordinate transform will work with this view.
1742 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1743 (-[WKWebView _endAnimatedResize]):
1744 * UIProcess/ios/WKContentView.mm:
1745 (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1746 * UIProcess/ios/WKContentViewInteraction.h:
1747 * UIProcess/ios/WKContentViewInteraction.mm:
1748 (-[WKContentView setupInteraction]):
1749 Since we need to observe changes inside the animation block, the code now use KVO to observe changes of scale.
1751 (-[WKContentView cleanupInteraction]):
1752 (-[WKContentView unscaledView]):
1753 (-[WKContentView inverseScale]):
1754 (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
1755 We update the utility views as usual. The extra bits here are to deal with views coming in during an animation.
1757 If a new utility view comes in during a scaling animation, we do not want to start a new animation with the same curve
1758 to end up at the right place. To avoid any issue, we just hide the view until the animation is finished.
1760 (-[WKContentView hitTest:withEvent:]):
1761 (-[WKContentView _showTapHighlight]):
1762 (-[WKContentView _updateUnscaledView]): Deleted.
1764 2014-07-09 Tim Horton <timothy_horton@apple.com>
1766 Use IOSurface ViewSnapshots everywhere on Mac, remove JPEG encoding path
1767 https://bugs.webkit.org/show_bug.cgi?id=134773
1769 Reviewed by Anders Carlsson.
1771 * UIProcess/API/mac/WKView.mm:
1772 (-[WKView _takeViewSnapshot]):
1773 * UIProcess/mac/ViewSnapshotStore.h:
1774 * UIProcess/mac/ViewSnapshotStore.mm:
1775 (WebKit::ViewSnapshotStore::ViewSnapshotStore):
1776 (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
1777 (WebKit::ViewSnapshotStore::recordSnapshot):
1778 (WebKit::ViewSnapshot::clearImage):
1779 (WebKit::ViewSnapshot::asLayerContents):
1780 (WebKit::createIOSurfaceFromImage): Deleted.
1781 (WebKit::compressImageAsJPEG): Deleted.
1782 (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost): Deleted.
1783 (WebKit::ViewSnapshotStore::didCompressSnapshot): Deleted.
1784 Remove all ViewSnapshot(Store) code related to JPEG-encoded snapshots.
1785 Remove the "image" member on ViewSnapshot; Mac will always start out with an IOSurface instead.
1786 Adopt WebCore::IOSurface::createFromImage to make that happen.
1787 Add a comment noting that if a snapshot comes back empty, we should throw it away completely.
1789 2014-07-09 Anders Carlsson <andersca@apple.com>
1791 RemoteLayerBackingStore::ensureBackingStore should ensure that the entire backing store gets redrawn
1792 https://bugs.webkit.org/show_bug.cgi?id=134772
1794 Reviewed by Tim Horton.
1796 * Shared/mac/RemoteLayerBackingStore.h:
1797 (WebKit::RemoteLayerBackingStore::Buffer::operator bool):
1798 * Shared/mac/RemoteLayerBackingStore.mm:
1799 (WebKit::RemoteLayerBackingStore::ensureBackingStore):
1801 2014-07-09 KwangHyuk Kim <hyuki.kim@samsung.com>
1803 [EFL] Fix crash caused by invalid cursor image.
1804 https://bugs.webkit.org/show_bug.cgi?id=134663
1806 Reviewed by Gyuyoung Kim.
1808 Remove calling of updateCursor since the custom cursor image is invalid once a mouse is out of the webview.
1810 * UIProcess/API/efl/EwkView.cpp:
1811 (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
1813 2014-07-08 Tim Horton <timothy_horton@apple.com>
1815 Remove WebBackForwardListItems when their owning page goes away
1816 https://bugs.webkit.org/show_bug.cgi?id=134709
1817 <rdar://problem/17584645>
1819 Reviewed by Dan Bernstein.
1821 * Shared/WebBackForwardListItem.cpp:
1822 (WebKit::WebBackForwardListItem::create):
1823 (WebKit::WebBackForwardListItem::WebBackForwardListItem):
1824 * Shared/WebBackForwardListItem.h:
1825 (WebKit::WebBackForwardListItem::pageID):
1826 Add the associated PageID to the WebBackForwardListItem.
1828 * UIProcess/WebBackForwardList.cpp:
1829 (WebKit::WebBackForwardList::restoreFromState):
1830 Push the current PageID onto the WebBackForwardListItem.
1832 * UIProcess/WebProcessProxy.cpp:
1833 (WebKit::WebProcessProxy::removeWebPage):
1834 Remove all of the WebBackForwardListItems from m_backForwardListItemMap when
1835 the page they are associated with is removed.
1837 (WebKit::WebProcessProxy::addBackForwardItem):
1838 Push the PageID from the WebProcess onto the WebBackForwardListItem.
1840 * UIProcess/WebProcessProxy.h:
1841 * UIProcess/WebProcessProxy.messages.in:
1842 * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1843 (WebKit::idToHistoryItemMap):
1844 (WebKit::historyItemToIDMap):
1845 (WebKit::updateBackForwardItem):
1846 (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
1847 (WebKit::WK2NotifyHistoryItemChanged):
1848 (WebKit::WebBackForwardListProxy::idForItem):
1849 (WebKit::WebBackForwardListProxy::addItem):
1850 (WebKit::WebBackForwardListProxy::goToItem):
1851 (WebKit::WebBackForwardListProxy::close):
1852 * WebProcess/WebPage/WebBackForwardListProxy.h:
1853 * WebProcess/WebPage/WebPage.cpp:
1854 (WebKit::WebPage::restoreSession):
1855 Keep track of the PageID that back-forward items were created by.
1856 Pass the PageID along when registering WebBackForwardListItems.
1858 2014-07-08 Tim Horton <timothy_horton@apple.com>
1860 [WK2] Expose a few drawing/compositing settings on WKPreferences(Private)
1861 https://bugs.webkit.org/show_bug.cgi?id=134645
1863 Reviewed by Dan Bernstein.
1865 * UIProcess/API/Cocoa/WKPreferences.mm:
1866 (-[WKPreferences _compositingBordersVisible]):
1867 (-[WKPreferences _setCompositingBordersVisible:]):
1868 (-[WKPreferences _compositingRepaintCountersVisible]):
1869 (-[WKPreferences _setCompositingRepaintCountersVisible:]):
1870 (-[WKPreferences _tiledScrollingIndicatorVisible]):
1871 (-[WKPreferences _setTiledScrollingIndicatorVisible:]):
1872 * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1873 Expose layer borders, repaint counters, and the tiled scrolling indicator on WKPreferences, as SPI.
1875 2014-07-08 Tim Horton <timothy_horton@apple.com>
1877 WKProcessPoolConfigurationPrivate's maximumProcessCount property has no effect
1878 https://bugs.webkit.org/show_bug.cgi?id=134711
1880 Reviewed by Dan Bernstein.
1882 * UIProcess/API/Cocoa/WKProcessPool.mm:
1883 (-[WKProcessPool _initWithConfiguration:]):
1884 Respect the maximumProcessCount.
1885 Currently the default limit is UINT_MAX; if maximumProcessCount = 0 (the default), we'll use that limit.
1887 2014-07-08 Adrian Perez de Castro <aperez@igalia.com>
1889 [GTK] Move user style sheet API out of WebKitWebViewGroup
1890 https://bugs.webkit.org/show_bug.cgi?id=134551
1892 Reviewed by Carlos Garcia Campos.
1894 * PlatformGTK.cmake: Include the new source files in the build.
1895 * UIProcess/API/C/gtk/WKView.cpp:
1897 Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
1898 * UIProcess/API/gtk/WebKitUserContent.cpp: Added.
1899 (toUserContentInjectedFrames):
1902 (_WebKitUserStyleSheet::_WebKitUserStyleSheet):
1903 (webkit_user_style_sheet_ref):
1904 (webkit_user_style_sheet_unref):
1905 (webkit_user_style_sheet_new):
1906 (webkitWebKitUserStyleSheetToUserStyleSheet):
1907 * UIProcess/API/gtk/WebKitUserContent.h: Added.
1908 * UIProcess/API/gtk/WebKitUserContentManager.cpp: Added.
1909 (_WebKitUserContentManagerPrivate::_WebKitUserContentManagerPrivate):
1910 (webkit_user_content_manager_class_init):
1911 (webkit_user_content_manager_new):
1912 (webkit_user_content_manager_add_style_sheet):
1913 (webkit_user_content_manager_remove_all_style_sheets):
1914 (webkitUserContentManagerGetUserContentControllerProxy):
1915 * UIProcess/API/gtk/WebKitUserContentManager.h: Added.
1916 * UIProcess/API/gtk/WebKitUserContentManagerPrivate.h: Added.
1917 * UIProcess/API/gtk/WebKitUserContentPrivate.h: Added.
1918 * UIProcess/API/gtk/WebKitWebContext.cpp:
1919 (webkitWebContextCreatePageForWebView): Add a new parameter to allow
1920 passing the WebKitUserContentManager that the web view will use.
1921 * UIProcess/API/gtk/WebKitWebContextPrivate.h: Ditto.
1922 * UIProcess/API/gtk/WebKitWebView.cpp:
1923 (webkitWebViewConstructed): Added handling of the
1924 "user-content-manager" property on construction.
1925 (webkitWebViewSetProperty): Added support for the
1926 "user-content-manager" property.
1927 (webkitWebViewGetProperty): Added support for the
1928 "user-content-manager" property.
1929 (webkit_web_view_class_init): Added the "user-content-manager"
1930 property definition to the WebKitWebView class.
1931 (webkit_web_view_new_with_related_view): Made related views share
1932 the same WebKitUserContentManager used by the view they are
1934 (webkit_web_view_new_with_user_content_manager): Added.
1935 (webkit_web_view_get_user_content_manager): Added.
1936 * UIProcess/API/gtk/WebKitWebView.h: Add new API methods.
1937 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1938 (webkitWebViewBaseCreate): Added a parameter to pass the user
1940 (webkitWebViewBaseCreateWebPage): Added a parameter to pass the user
1942 * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Ditto.
1943 * UIProcess/API/gtk/WebKitWebViewGroup.cpp: Removed the bits related
1944 to user style sheet support from WebKitWebViewGroup.
1945 (webkit_web_view_group_set_settings):
1946 (toAPIArray): Deleted.
1947 (webkit_web_view_group_add_user_style_sheet): Deleted.
1948 (webkit_web_view_group_remove_all_user_style_sheets): Deleted.
1949 * UIProcess/API/gtk/WebKitWebViewGroup.h: Deleted the API methods
1950 for user style sheet handling.
1951 * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added the new API
1952 functions and types, and removed the methods which are no longer
1953 available in WebKitWebViewGroup.
1954 * UIProcess/API/gtk/webkit2.h: Add the new headers.
1955 * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added
1956 methods to add and remove user style sheets, alike those used for
1958 (WebKit::WebUserContentControllerProxy::addProcess):
1959 (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
1960 (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
1961 * UIProcess/UserContent/WebUserContentControllerProxy.h: Ditto.
1962 * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1963 (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1964 Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
1965 * WebProcess/UserContent/WebUserContentController.cpp: Added methods
1966 to add and remove user style sheets, alike those used for user scripts.
1967 (WebKit::WebUserContentController::addUserStyleSheets):
1968 (WebKit::WebUserContentController::removeAllUserStyleSheets):
1969 * WebProcess/UserContent/WebUserContentController.h: Ditto.
1970 * WebProcess/UserContent/WebUserContentController.messages.in:
1973 2014-07-08 Zan Dobersek <zdobersek@igalia.com>
1975 [GTK] Guard uses of RedirectedXCompositeWindow in WebKitWebViewBase with PLATFORM(X11)
1976 https://bugs.webkit.org/show_bug.cgi?id=133871
1978 Reviewed by Martin Robinson.
1980 Guard uses of the RedirectedXCompositeWindow object in WebKitWebViewBase with the
1981 PLATFORM(X11) build guard. This is required to properly support building the GTK
1982 port only for the Wayland target.
1984 * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1985 (webkitWebViewBaseConstructed):
1986 (webkitWebViewRenderAcceleratedCompositingResults):
1987 (resizeWebKitWebViewBaseFromAllocation):
1988 (webkitWebViewBaseUpdatePreferences):
1989 (webkitWebViewBaseCreateWebPage):
1991 2014-07-07 Tim Horton <timothy_horton@apple.com>
1993 Turn on accelerated drawing for WebKit2 by default
1994 https://bugs.webkit.org/show_bug.cgi?id=134708
1995 <rdar://problem/17584642>
1997 Reviewed by Simon Fraser.
1999 * Shared/WebPreferencesDefinitions.h:
2000 Make Mac match iOS, in that accelerated drawing is on by default.
2002 2014-07-07 Timothy Horton <timothy_horton@apple.com>
2004 Don't leak _WKRemoteObjectRegistry in WKBrowsingContextController
2005 https://bugs.webkit.org/show_bug.cgi?id=134703
2007 Reviewed by Simon Fraser.
2009 * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2010 (-[WKBrowsingContextController _remoteObjectRegistry]):
2011 Adoption is important!!
2013 2014-07-07 Simon Fraser <simon.fraser@apple.com>
2015 [UI-side compositing] Support reflections on custom layers like video
2016 https://bugs.webkit.org/show_bug.cgi?id=134701
2018 Reviewed by Tim Horton.
2020 For video reflections, we have to support cloning of PlatformCALayerRemoteCustom
2021 in the web process. Do so by implementing PlatformCALayerRemoteCustom::clone(),
2022 which does the right gyrations to get AVPlayerLayers cloned, then makes a
2023 new PlatformCALayerRemoteCustom to wrap the new layer. This ends up getting
2024 its own context hosting ID, allowing the clone to show in the UI process.
2026 Attempt to do the same for WebGL, but turn it off because it breaks.
2028 * Shared/mac/RemoteLayerBackingStore.mm:
2029 (WebKit::RemoteLayerBackingStore::drawInContext):
2030 * Shared/mac/RemoteLayerTreeTransaction.mm:
2031 (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode): Unconditionally encode/decode
2032 the hostingContextID. It will be 0 for most layers.
2033 (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
2034 (WebKit::RemoteLayerTreeTransaction::description):
2035 * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
2036 (WebKit::RemoteLayerTreeHost::createLayer):
2037 * UIProcess/mac/RemoteLayerTreeHost.mm:
2038 (WebKit::RemoteLayerTreeHost::createLayer):
2039 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2040 (WebKit::PlatformCALayerRemote::create): Creation with a custom PlatformLayer* always
2041 creates a PlatformCALayerRemoteCustom.
2042 (WebKit::PlatformCALayerRemote::clone): Factor some code.
2043 (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
2044 (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2045 * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2046 * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
2047 * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
2048 (WebKit::PlatformCALayerRemoteCustom::create):
2049 (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
2050 (WebKit::PlatformCALayerRemoteCustom::clone): Clone by making an instance of the
2051 correct type of platform layer when possible, then wrapping a PlatformCALayerRemoteCustom
2053 (WebKit::PlatformCALayerRemoteCustom::contents):
2054 (WebKit::PlatformCALayerRemoteCustom::setContents):
2055 * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2056 (WebKit::RemoteLayerTreeContext::layerWasCreated):
2057 (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
2059 2014-07-07 Simon Fraser <simon.fraser@apple.com>
2061 [UI-side compositing] Crash when starting a filter transition on a reflected layer
2062 https://bugs.webkit.org/show_bug.cgi?id=134694
2064 Reviewed by Tim Horton.
2066 When cloned layers had animations, we would fire two animationDidStart callbacks,
2067 but the second would pass an empty animationKey string to the web process, resulting
2070 Fix by not blindly copying all layer properties when cloning PlatformCALayerRemotes,
2071 since the clone would include addedAnimations, and then get the same animations
2072 added on top by the caller.
2074 Also protect against an empty animation key in the animationDidStart callback.
2076 * UIProcess/mac/RemoteLayerTreeHost.mm:
2077 (WebKit::RemoteLayerTreeHost::animationDidStart):
2078 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2079 (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
2080 (WebKit::PlatformCALayerRemote::clone): Don't copy all the properties; copy
2081 them manually as PlatformCALayerMac does. Only copy the big things if they don't
2082 have their default values.
2083 (WebKit::PlatformCALayerRemote::copyFiltersFrom): Need an implementation of this
2084 for clone() to call.
2086 2014-07-07 Tim Horton <timothy_horton@apple.com>
2088 Nearly everything in the UIProcess "leaks" when WKWebView is torn down
2089 https://bugs.webkit.org/show_bug.cgi?id=134699
2090 <rdar://problem/17581777>
2092 Reviewed by Simon Fraser.
2094 * UIProcess/API/Cocoa/WKWebView.mm:
2095 (-[WKWebView initWithFrame:configuration:]):
2096 Adoption is important!
2098 2014-07-07 Enrica Casucci <enrica@apple.com>
2100 REGRESSION(iOS WK2): arrow keys movements don't work.
2101 https://bugs.webkit.org/show_bug.cgi?id=134561
2102 <rdar://problem/16827629>
2104 Reviewed by Benjamin Poulain.
2106 This change add the implementations for cursor movement selectors.
2107 It also provides a mechanism to ensure that every selection
2108 change in WebKit is reflected in UIKit so that it can update the
2109 autocorrection data. This way we ensure that the autocorraction state
2110 is consistent even when selection changes are originated by JavaScript.
2111 WebPageProxy::editorStateChanged now notifies the page client when the
2112 selection is about to change as well as when it actually changed.
2114 * UIProcess/PageClient.h:
2115 * UIProcess/WebPageProxy.cpp:
2116 (WebKit::WebPageProxy::editorStateChanged):
2117 * UIProcess/WebPageProxy.h:
2118 * UIProcess/ios/PageClientImplIOS.h:
2119 * UIProcess/ios/PageClientImplIOS.mm:
2120 (WebKit::PageClientImpl::selectionWillChange):
2121 * UIProcess/ios/WKContentViewInteraction.h:
2122 * UIProcess/ios/WKContentViewInteraction.mm:
2123 (-[WKContentView cut:]): Removed incorrect calls to textWillChange and
2125 (-[WKContentView paste:]):
2126 (-[WKContentView _moveUp:withHistory:]):
2127 (-[WKContentView _moveDown:withHistory:]):
2128 (-[WKContentView _moveLeft:withHistory:]):
2129 (-[WKContentView _moveRight:withHistory:]):
2130 (-[WKContentView _moveToStartOfWord:withHistory:]):
2131 (-[WKContentView _moveToStartOfParagraph:withHistory:]):
2132 (-[WKContentView _moveToStartOfLine:withHistory:]):
2133 (-[WKContentView _moveToStartOfDocument:withHistory:]):
2134 (-[WKContentView _moveToEndOfWord:withHistory:]):
2135 (-[WKContentView _moveToEndOfParagraph:withHistory:]):
2136 (-[WKContentView _moveToEndOfLine:withHistory:]):
2137 (-[WKContentView _moveToEndOfDocument:withHistory:]):
2138 (-[WKContentView _selectionWillChange]):
2139 (-[WKContentView _selectionChanged]):
2140 * UIProcess/ios/WebPageProxyIOS.mm:
2141 (WebKit::WebPageProxy::notifySelectionWillChange):
2143 2014-07-07 Anders Carlsson <andersca@apple.com>
2145 Add SPI for saving and restoring a WKWebView's _WKSessionState
2146 https://bugs.webkit.org/show_bug.cgi?id=134693
2148 Reviewed by Dan Bernstein.
2150 * UIProcess/API/C/WKPage.cpp:
2151 (WKPageRestoreFromSessionState):
2152 * UIProcess/API/Cocoa/WKWebView.mm:
2153 (-[WKWebView _sessionState]):
2154 (-[WKWebView _restoreFromSessionStateData:]):
2155 (-[WKWebView _restoreFromSessionState:]):
2156 (-[WKWebView _restoreSessionState:andNavigate:]):
2157 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2158 * UIProcess/API/Cocoa/_WKSessionState.mm:
2159 (-[_WKSessionState _initWithSessionState:]):
2160 * UIProcess/API/Cocoa/_WKSessionStateInternal.h:
2161 * UIProcess/WebPageProxy.cpp:
2162 (WebKit::WebPageProxy::restoreFromSessionState):
2163 * UIProcess/WebPageProxy.h:
2165 2014-07-07 Anders Carlsson <andersca@apple.com>
2167 Add a stubbed out _WKSessionState class
2168 https://bugs.webkit.org/show_bug.cgi?id=134690
2170 Reviewed by Geoffrey Garen.
2172 * UIProcess/API/Cocoa/_WKSessionState.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2173 * UIProcess/API/Cocoa/_WKSessionState.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2174 (-[_WKSessionState initWithData:]):
2175 (-[_WKSessionState data]):
2176 * UIProcess/API/Cocoa/_WKSessionStateInternal.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2177 * UIProcess/Cocoa/SessionStateCoding.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2178 * UIProcess/Cocoa/SessionStateCoding.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2179 (WebKit::encodeSessionState):
2180 (WebKit::decodeSessionState):
2181 * UIProcess/LegacySessionStateCoding.h:
2182 * WebKit2.xcodeproj/project.pbxproj:
2184 2014-07-07 Anders Carlsson <andersca@apple.com>
2186 Some of the WKPreferences (API) property getters read like questions
2187 https://bugs.webkit.org/show_bug.cgi?id=134678
2188 <rdar://problem/17576847>
2190 Reviewed by Dan Bernstein.
2192 * UIProcess/API/Cocoa/WKPreferences.h:
2193 * UIProcess/API/Cocoa/WKPreferences.mm:
2194 (-[WKPreferences javaScriptIsEnabled]):
2195 (-[WKPreferences javaIsEnabled]):
2196 (-[WKPreferences plugInsAreEnabled]):
2197 (-[WKPreferences isJavaScriptEnabled]): Deleted.
2198 (-[WKPreferences isJavaEnabled]): Deleted.
2199 (-[WKPreferences arePlugInsEnabled]): Deleted.
2201 2014-07-07 Brady Eidson <beidson@apple.com>
2203 ServicesOverlayController menus show up in the wrong place.
2204 <rdar://problem/17130576> and https://bugs.webkit.org/show_bug.cgi?id=134684
2206 Reviewed by Tim Horton.
2208 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2209 (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Handle cases where
2210 the telephone number is in a subframe.
2211 (WebKit::ServicesOverlayController::handleClick): The click point is always in main frame document
2212 coordinates, so convert it to window coordinates using the main frame’s FrameView.
2214 2014-07-07 Dan Bernstein <mitz@apple.com>
2216 [Cocoa] Assertion failure in NavigationState::LoaderClient::didStartProvisionalLoadForFrame (navigationID) when navigating through the page cache
2217 https://bugs.webkit.org/show_bug.cgi?id=134682
2219 Reviewed by Tim Horton.
2221 * UIProcess/Cocoa/NavigationState.mm:
2222 (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Replaced the
2223 assertion with a FIXME.
2224 (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
2226 (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
2227 (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
2228 (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
2229 (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
2230 (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
2232 2014-07-07 KwangHyuk Kim <hyuki.kim@samsung.com>
2234 [EFL] Fix cursor artifacts on naver map site.
2235 https://bugs.webkit.org/show_bug.cgi?id=134649
2237 Reviewed by Gyuyoung Kim.
2239 Old evas cursor and ecore x cursor are reset before new cursor is applied.
2241 * UIProcess/API/efl/EwkView.cpp:
2242 (EwkView::updateCursor):
2244 2014-07-06 Benjamin Poulain <bpoulain@apple.com>
2246 [iOS][WK2] The tap highlight ID is not invalidated when a long press ends
2247 https://bugs.webkit.org/show_bug.cgi?id=134660
2249 Reviewed by Darin Adler.
2251 * UIProcess/ios/WKContentViewInteraction.mm:
2252 (-[WKContentView _cancelInteraction]):
2253 (-[WKContentView _finishInteraction]):
2254 (cancelPotentialTapIfNecessary):
2255 I messed that up in r170600. I only accounted for the web process being too fast.
2257 If the web process is too slow, _cancelInteraction or _finishInteraction happen before
2258 _didGetTapHighlightForRequest:, and we also need to nuke the tap highlight.
2260 2014-07-06 Tim Horton <timothy_horton@apple.com>
2262 [WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
2263 https://bugs.webkit.org/show_bug.cgi?id=134644
2265 Reviewed by Darin Adler.
2267 * UIProcess/DrawingAreaProxy.h:
2268 (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
2269 * UIProcess/WebPageProxy.cpp:
2270 (WebKit::WebPageProxy::preferencesDidChange):
2271 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2272 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2273 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2274 (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
2275 (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
2276 The indicator depends on the live layer tree commits coming in, including layer creation,
2277 so it can't be turned on after the root layer is created. Even a refresh is insufficient
2278 to get it working; the debug indicator really needs to exist from the first commit.
2279 So, don't even attempt to dynamically enable the indicator; create it at
2280 RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled.
2282 2014-07-06 Yoav Weiss <yoav@yoav.ws>
2284 Turn on img@sizes compile flag
2285 https://bugs.webkit.org/show_bug.cgi?id=134634
2287 Reviewed by Benjamin Poulain.
2289 * Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.
2291 2014-07-06 Brady Eidson <beidson@apple.com>
2293 Speculative fix for: NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
2294 https://bugs.webkit.org/show_bug.cgi?id=134666
2296 Reviewed by Tim Horton.
2298 * Shared/mac/SecItemRequestData.cpp:
2299 (WebKit::SecItemRequestData::encode): Encode whether or not the query dictionary exists.
2300 (WebKit::SecItemRequestData::decode): Only fail when query dictionary fails to decode if we expect one.
2302 * UIProcess/mac/SecItemShimProxy.cpp:
2303 (WebKit::SecItemShimProxy::secItemRequest): If the request is of type Invalid, log an error message asking
2304 for a bug, and respond with an "invalid parameter" error.
2306 2014-07-06 Antti Koivisto <antti@apple.com>
2308 Don't throttle layer flushes when the main resource is a GIF
2309 https://bugs.webkit.org/show_bug.cgi?id=134650
2311 Reviewed by Simon Fraser.
2313 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2314 (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
2316 2014-07-04 Rohit Kumar <kumar.rohit@samsung.com>
2318 [EFL][WK2]Fix build break in EFL WK2
2319 https://bugs.webkit.org/show_bug.cgi?id=134629
2321 Unreviewed build fix.
2323 * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
2324 (WebKit::CoordinatedDrawingArea::scheduleCompositingLayerFlushImmediately):
2325 * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
2327 2014-07-04 Dan Bernstein <mitz@apple.com>
2329 [Cocoa] -[WKWebView _reload] is unused
2330 https://bugs.webkit.org/show_bug.cgi?id=134638
2332 Reviewed by Sam Weinig.
2334 * UIProcess/API/Cocoa/WKWebView.mm:
2335 (-[WKWebView _reload]): Deleted.
2336 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2338 2014-07-04 Tim Horton <timothy_horton@apple.com>
2340 [WK2] Take TopContentInset into account when sending dictionary lookup point to PluginView
2341 https://bugs.webkit.org/show_bug.cgi?id=134624
2342 <rdar://problem/17222041>
2344 Reviewed by Sam Weinig.
2346 * WebProcess/Plugins/PDF/PDFPlugin.mm:
2347 (WebKit::PDFPlugin::performDictionaryLookupAtLocation):
2348 Perform the same coordinate conversion we use for mouse events, which happens
2349 to take the top content inset into account.
2351 2014-07-04 Philippe Normand <pnormand@igalia.com>
2353 Unreviewed, GTK WK2 build fix after r170787.
2355 * WebProcess/WebPage/DrawingAreaImpl.cpp:
2356 (WebKit::DrawingAreaImpl::scheduleCompositingLayerFlushImmediately):
2357 * WebProcess/WebPage/DrawingAreaImpl.h:
2359 2014-07-04 Zan Dobersek <zdobersek@igalia.com>
2361 Unreviewed. Reverting the bad changes introduced in r170795.
2363 * Platform/IPC/ArgumentDecoder.cpp:
2364 (IPC::ArgumentDecoder::decode): Deleted.
2365 * Platform/IPC/ArgumentDecoder.h:
2366 * Platform/IPC/ArgumentEncoder.cpp:
2367 (IPC::ArgumentEncoder::encode): Deleted.
2368 * Platform/IPC/ArgumentEncoder.h:
2370 2014-07-04 Zan Dobersek <zdobersek@igalia.com>
2372 Unreviewed. Fixing the build for ports on 64-bit Linux.
2374 Add IPC encoding and decoding overloads for the long long type, needed
2375 after r170755 started encoding and decoding long long variables in
2378 * Platform/IPC/ArgumentDecoder.cpp:
2379 (IPC::ArgumentDecoder::decode):
2380 * Platform/IPC/ArgumentDecoder.h:
2381 * Platform/IPC/ArgumentEncoder.cpp:
2382 (IPC::ArgumentEncoder::encode):
2383 * Platform/IPC/ArgumentEncoder.h:
2385 2014-07-04 Timothy Horton <timothy_horton@apple.com>
2387 [iOS][WK2] Black web view after un-suspending process
2388 https://bugs.webkit.org/show_bug.cgi?id=134623
2389 <rdar://problem/17513223>
2391 Reviewed by Simon Fraser.
2393 * UIProcess/WebPageProxy.cpp:
2394 (WebKit::WebPageProxy::viewStateDidChange):
2395 Add an argument to viewStateDidChange that allows callers (-[WKContentView _applicationWillEnterForeground:])
2396 to force us to wait for a synchronous reply from the Web process after performing a view state change.
2398 (WebKit::WebPageProxy::dispatchViewStateChange):
2399 Move the has-been-in-window-and-now-is-newly-in-window check into dispatchViewStateChange.
2400 Adjust the logic surrounding going into/out of window by factoring out the IsInWindow-did-change check, for clarity.
2402 * UIProcess/WebPageProxy.h:
2403 * UIProcess/ios/WKContentView.mm:
2404 (-[WKContentView _applicationWillEnterForeground:]):
2405 As previously mentioned, wait for a reply when foregrounding.
2407 * WebProcess/WebPage/DrawingArea.h:
2408 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2409 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2410 (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
2411 (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
2412 (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
2413 Make sure to schedule a commit immediately if the UI process is waiting for a reply.
2414 Previously we assumed that a commit would be scheduled anyway because we would have to reparent the
2415 layer tree, but that doesn't happen in the suspension-without-unparenting case. Also, we want to skip
2416 all throttling in this case.
2418 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2419 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2420 (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):
2422 2014-07-03 Gavin Barraclough <baraclough@apple.com>
2424 Should not take background task assertion for NetworkProcess
2425 https://bugs.webkit.org/show_bug.cgi?id=134622
2427 Reviewed by Tim Horton.
2429 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.
2430 However for the NetworkProcess we always just hold a process assertion, and don't want this to interfere with UIApp suspension.
2432 * Platform/IPC/mac/ConnectionMac.mm:
2433 (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
2434 - ProcessAssertion -> ProcessAndUIAssertion
2435 * UIProcess/ProcessAssertion.cpp:
2436 (WebKit::ProcessAssertion::ProcessAssertion):
2437 - assignment -> initializer list.
2438 (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
2439 (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
2440 (WebKit::ProcessAndUIAssertion::setState):
2441 - added no-op implementation.
2442 (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
2443 * UIProcess/ProcessAssertion.h:
2444 - removed ~ProcessAssertion, added ProcessAndUIAssertion class.
2445 * UIProcess/ProcessThrottler.cpp:
2446 (WebKit::ProcessThrottler::didConnnectToProcess):
2447 - ProcessAssertion -> ProcessAndUIAssertion
2448 * UIProcess/ProcessThrottler.h:
2449 - ProcessAssertion -> ProcessAndUIAssertion
2450 * UIProcess/ios/ProcessAssertionIOS.mm:
2451 (WebKit::ProcessAssertion::ProcessAssertion):
2452 - assignment -> initializer list.
2453 - moved code to manage WKProcessAssertionBackgroundTaskManager
2454 (WebKit::ProcessAssertion::setState):
2455 - moved code to manage WKProcessAssertionBackgroundTaskManager
2456 (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
2457 (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
2458 (WebKit::ProcessAndUIAssertion::setState):
2459 - moved code to manage WKProcessAssertionBackgroundTaskManager from ProcessAssertion.
2460 (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
2461 - delete - moved code to manage WKProcessAssertionBackgroundTaskManager
2463 2014-07-03 Simon Fraser <simon.fraser@apple.com>
2465 Clean up Brady's mess on iOS.
2467 * Platform/mac/StringUtilities.h:
2468 * Platform/mac/StringUtilities.mm:
2470 2014-07-03 Simon Fraser <simon.fraser@apple.com>
2472 [iOS WK2] Compositing layers draw outside page bounds
2473 https://bugs.webkit.org/show_bug.cgi?id=134619
2474 <rdar://problem/16953222>
2476 Reviewed by Benjamin Poulain.
2478 With the new rubber-banding behavior, we no longer have the root content layer clipping all
2479 the web layers, but this resulted in web layers which were moved outside the viewport by CSS
2480 transforms not being clipped.
2482 Fix by adding a clipping layer inside the scroll view, above _rootContentView. This layer
2483 normally has the same bounds as the content, but when rubber-banding or pinching,
2484 it takes the union of the content bounds and the rect used for fixed positioning.
2485 To make scrolling work as expected in this scenario, when it has non-zero offset, it
2486 has to compensate by setting its bounds origin.
2488 The bounds of the clipping layer are updated on scrolling/zooming, and when the
2489 layer commit tells us that the content size changed.
2491 * UIProcess/API/Cocoa/WKWebView.mm:
2492 (-[WKWebView _updateScrollViewBackground]):
2493 * UIProcess/ios/WKContentView.mm:
2494 (-[WKContentView initWithFrame:context:configuration:webView:]):
2495 (-[WKContentView updateFixedClippingView:]):
2496 (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
2497 (-[WKContentView _didCommitLayerTree:]):
2499 2014-07-03 Brady Eidson <beidson@apple.com>
2501 When showing the selection menu, include menu options for all selected phone numbers.
2502 <rdar://problem/16983434>, <rdar://problem/16874568>, and https://bugs.webkit.org/show_bug.cgi?id=134613
2504 Reviewed by Tim Horton.
2506 Move some telephone number menu logic from WebKitSystemInterface here.
2507 Also provide utility to get just the one menu item relevant to a telephone number.
2508 * Platform/mac/MenuUtilities.h:
2509 * Platform/mac/MenuUtilities.mm: Added.
2510 (WebKit::menuItemForTelephoneNumber):
2511 (WebKit::menuItemsForTelephoneNumber):
2513 * Platform/mac/StringUtilities.h:
2514 * Platform/mac/StringUtilities.mm:
2515 (WebKit::formattedPhoneNumberString): Return a localized formatted phone number.
2517 Add a member to track the selected phone numbers:
2518 * Shared/ContextMenuContextData.h:
2519 (WebKit::ContextMenuContextData::ContextMenuContextData):
2520 (WebKit::ContextMenuContextData::selectedTelephoneNumbers):
2522 * UIProcess/WebPageProxy.h:
2523 * UIProcess/WebPageProxy.messages.in:
2525 * UIProcess/mac/WebContextMenuProxyMac.mm:
2526 (WebKit::WebContextMenuProxyMac::setupServicesMenu): Also add menu items for each phone number that is
2529 Switch away from a WKSI method, and remove a lot of unneeded forward declarations and soft linking:
2530 * UIProcess/mac/WebPageProxyMac.mm:
2531 (WebKit::WebPageProxy::showTelephoneNumberMenu):
2532 (WebKit::WebPageProxy::showSelectionServiceMenu):
2534 * WebKit2.xcodeproj/project.pbxproj:
2536 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2537 (WebKit::ServicesOverlayController::drawSelectionHighlight):
2538 (WebKit::ServicesOverlayController::handleClick): Pass the phone numbers along.
2540 * WebProcess/WebPage/WebPage.h:
2541 * WebProcess/WebPage/mac/WebPageMac.mm:
2542 (WebKit::WebPage::handleSelectionServiceClick): Pass the phone numbers along.
2544 2014-07-03 Gavin Barraclough <baraclough@apple.com>
2546 WKProcessAssertionBackgroundTaskManager should clear member if task expires
2547 https://bugs.webkit.org/show_bug.cgi?id=134618
2549 Reviewed by Anders Carlson.
2551 Failure to do so results in a warning, and could result in us erroneously completing a background task too soon.
2553 * UIProcess/ios/ProcessAssertionIOS.mm:
2554 (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
2555 - remove local variable, _backgroundTask = UIBackgroundTaskInvalid;
2557 2014-07-03 Joseph Pecoraro <pecoraro@apple.com>
2559 Unreviewed iOS build fix for r170774.
2561 Remove some unnecessary WTF::moves on iOS:
2562 error: static_assert failed "T is not an lvalue reference; move() is unnecessary."
2564 * WebProcess/WebPage/EventDispatcher.cpp:
2565 (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
2566 (WebKit::EventDispatcher::touchEvent):
2568 2014-07-03 Anders Carlsson <andersca@apple.com>
2570 Try to fix the iOS build.
2572 Add WebPageProxyCocoa.mm for code shared between iOS and OS X. Put the recent searches save/restore code there.
2574 * UIProcess/Cocoa/WebPageProxyCocoa.mm: Added.
2575 (WebKit::autosaveKey):
2576 (WebKit::WebPageProxy::saveRecentSearches):
2577 (WebKit::WebPageProxy::loadRecentSearches):
2578 * UIProcess/mac/WebPageProxyMac.mm:
2579 * WebKit2.xcodeproj/project.pbxproj:
2581 2014-07-03 Dan Bernstein <mitz@apple.com>
2583 <rdar://problem/16337741> The UI process needs to track the number of HTTP subresource loads in progress (or at least whether there are any)
2584 https://bugs.webkit.org/show_bug.cgi?id=134615
2586 Reviewed by Anders Carlsson.
2588 Added a _networkRequestsInProgress boolean property to WKWebView.
2590 * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
2591 PageLoadStateObserver member functions.
2593 * UIProcess/API/Cocoa/WKWebView.mm:
2594 (-[WKWebView _networkRequestsInProgress]): New getter that gets this state from the
2596 * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property.
2598 * UIProcess/Cocoa/NavigationState.h:
2599 * UIProcess/Cocoa/NavigationState.mm:
2600 (WebKit::NavigationState::willChangeNetworkRequestsInProgress):: Override this new
2601 PageLoadState::Observer member function by sending the appropriate KVO change message to the
2603 (WebKit::NavigationState::didChangeNetworkRequestsInProgress): Ditto.
2605 * UIProcess/PageLoadState.cpp:
2606 (WebKit::PageLoadState::commitChanges): Check for changes to networkRequestsInProgress
2607 and call the observers if needed.
2608 (WebKit::PageLoadState::reset): Reset networkRequestsInProgress in the uncommitted state.
2609 (WebKit::PageLoadState::setNetworkRequestsInProgress): Set networkRequestsInProgress in the
2611 * UIProcess/PageLoadState.h:
2612 (WebKit::PageLoadState::networkRequestsInProgress): Added this getter.
2613 (WebKit::PageLoadState::Data::Data): Initialize new networkRequestsInProgress member.
2615 * UIProcess/WebPageProxy.cpp:
2616 (WebKit::WebPageProxy::setNetworkRequestsInProgress): Added. Updates the PageLoadState.
2617 * UIProcess/WebPageProxy.h:
2618 * UIProcess/WebPageProxy.messages.in: Added SetNetworkRequestsInProgress message.
2620 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2621 (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Call
2622 WebPage::addResourceRequest.
2623 (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): Call
2624 WebPage::removeResourceRequest.
2625 (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): Ditto.
2627 * WebProcess/WebPage/WebPage.cpp:
2628 (WebKit::WebPage::addResourceRequest): Added. If the new request is for an HTTP-family URL,
2629 add its identifier to the set of network resourece request identifiers. If the set was
2630 previously empty, send the WebPageProxy a message.
2631 (WebKit::WebPage::removeResourceRequest): Added. Remove the identifier from the set. If it
2632 becomes empty, send the WebPageProxy a message.
2633 * WebProcess/WebPage/WebPage.h:
2635 2014-07-03 Anders Carlsson <andersca@apple.com>
2637 Remove two unused functions
2638 https://bugs.webkit.org/show_bug.cgi?id=134614
2640 Reviewed by Andreas Kling.
2642 * UIProcess/LegacySessionStateCoding.h:
2643 * UIProcess/mac/LegacySessionStateCoding.cpp:
2644 (WebKit::encodeLegacySessionHistoryEntryData): Deleted.
2645 (WebKit::decodeLegacySessionHistoryEntryData): Deleted.
2647 2014-07-03 Daniel Bates <dabates@apple.com>
2650 https://bugs.webkit.org/show_bug.cgi?id=134500
2652 Rubber-stamped by Anders Carlsson.
2654 Substitute WTF::move() for std::move().
2656 * DatabaseProcess/DatabaseProcess.cpp:
2657 * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2658 * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
2659 * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2660 * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2661 * Platform/IPC/ArgumentCoders.h:
2662 * Platform/IPC/ArgumentDecoder.cpp:
2663 * Platform/IPC/Connection.cpp:
2664 * Platform/IPC/Connection.h:
2667 2014-07-03 Benjamin Poulain <bpoulain@apple.com>
2669 [iOS][WK2] Fix small bugs of dynamicViewportSizeUpdate that were causing inaccuracies in the computed target
2670 https://bugs.webkit.org/show_bug.cgi?id=134582
2672 Reviewed by Tim Horton.
2674 This patch fixes two small bugs that were causing "jumpiness" on animated resize:
2675 1) The new scale was less accurate than the target scale, making the WebProcess force a worse scale on the content.
2676 2) The code putting back the rects in view was ignoring the obscured insets, constraining the scroll position more
2679 The first problem was cause by a series of rounding issues accumulating to the fact that "scale != targetScale"
2680 was almost never true.
2682 The first issue is that the unobscured content size was stored in integer coordinates. Because of that, it was
2683 impossible to determine accurately how much content is in the view.
2684 The outcome was that visibleHorizontalFraction was very inaccurate compared to what the UIProcess computed.
2686 Another issue affecting the scale is that scaleAfterViewportWidthChange was computing the widthToKeepInView
2687 on floating point. Since ARM64 does all those computations on doubles in the UIProcess, the value would be quite
2688 different from the received targetScale.
2690 Finally, the code uses withinEpsilon() instead of a strict equality to reduce the effect of rounding errors.
2692 For the second issue, the problem was that I was bounding the exposed rect to the page bounds. It is completely
2693 valid to have an exposed rect outside the page bounds, that area is just under the obscured insets.
2695 On the other hand, the unobscured rect needs to be within the bounds as we do not want to rotate to a rubberbanding
2696 position. The fix is simply to put the right rect into bounds, and the horizontal/vertical adjustement applies on
2699 * WebProcess/WebPage/ios/WebPageIOS.mm:
2700 (WebKit::scaleAfterViewportWidthChange):
2701 (WebKit::WebPage::dynamicViewportSizeUpdate):
2702 (WebKit::WebPage::updateVisibleContentRects):
2704 2014-07-03 Anders Carlsson <andersca@apple.com>
2708 * UIProcess/mac/WebPageProxyMac.mm:
2710 2014-07-03 Anders Carlsson <andersca@apple.com>
2712 Get rid of WebPageProxyCF.cpp
2713 https://bugs.webkit.org/show_bug.cgi?id=134609
2715 Reviewed by Dan Bernstein.
2717 * UIProcess/cf/WebPageProxyCF.cpp: Removed.
2718 * UIProcess/mac/WebPageProxyMac.mm:
2719 (WebKit::autosaveKey):
2720 (WebKit::WebPageProxy::saveRecentSearches):
2721 (WebKit::WebPageProxy::loadRecentSearches):
2722 * WebKit2.xcodeproj/project.pbxproj:
2724 2014-07-03 Tim Horton <timothy_horton@apple.com>
2726 [WK2] Revise the flat find indicator secondary highlight shadows
2727 https://bugs.webkit.org/show_bug.cgi?id=134607
2728 <rdar://problem/17554828>
2730 Reviewed by Brady Eidson.
2732 * WebProcess/WebPage/FindController.cpp:
2733 (WebKit::FindController::drawRect):
2734 Bring back the secondary highlight shadow, with new constants.
2736 2014-07-03 Tim Horton <timothy_horton@apple.com>
2738 [iOS][WK2] Sometimes the swipe snapshot stays up too long
2739 https://bugs.webkit.org/show_bug.cgi?id=134506
2740 <rdar://problem/17496803>
2742 Reviewed by Simon Fraser.
2744 Implement a transaction callback mechanism.
2745 The UI process can register a callback at any point, generally immediately after sending a message to the Web process.
2746 It will then send another message (in-order) with the callback ID to the Web process, which will put it into the next transaction
2747 (scheduling a new one if needed). When the transaction comes back to the UI process, the callbacks are performed.
2748 This ensures that the callback fires alongside a commit that includes the results of whatever messages were sent before it was registered.
2749 For now, all callbacks are fired just before committing layer changes, but it's possible future patches will want post-commit callbacks.
2751 Make use of this to remove the ViewGestureControllerIOS snapshots at the right time.
2753 * Shared/mac/RemoteLayerTreeTransaction.h:
2754 (WebKit::RemoteLayerTreeTransaction::callbackIDs):
2755 (WebKit::RemoteLayerTreeTransaction::setCallbackIDs):
2756 * Shared/mac/RemoteLayerTreeTransaction.mm:
2757 (WebKit::RemoteLayerTreeTransaction::encode):
2758 (WebKit::RemoteLayerTreeTransaction::decode):
2759 Add a vector of callback IDs to the transaction; encode and decode as appropriate.
2761 * UIProcess/DrawingAreaProxy.h:
2762 (WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing):
2763 (WebKit::DrawingAreaProxy::lastVisibleTransactionID): Deleted.
2764 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2765 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2766 (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
2767 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2768 (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2769 Add dispatchAfterEnsuringDrawing, which takes a function.
2770 When a callback is added, we send the callback ID to the Web process via the AddTransactionCallbackID message.
2771 Perform callbacks listed in the incoming transaction's vector of callback IDs.
2773 * WebProcess/WebPage/DrawingArea.h:
2774 (WebKit::DrawingArea::addTransactionCallbackID):
2775 * WebProcess/WebPage/DrawingArea.messages.in:
2776 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2777 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2778 (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2779 (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
2780 Keep track of the pending callback IDs on the drawing area, and move them into the transaction.
2781 We schedule a flush when installing a transaction callback on the premise that
2782 sometimes the action (goToBackForwardListItem in the swipe case) might have already occurred
2783 and been committed by the time the Web process receives AddTransactionCallbackID, so we need
2784 to cause another commit to send the callbacks across. If said commit is still pending, this is a no-op.
2786 * UIProcess/ios/ViewGestureControllerIOS.mm:
2787 (allViewGestureControllers):
2788 (WebKit::ViewGestureController::ViewGestureController):
2789 (WebKit::ViewGestureController::~ViewGestureController):
2790 (WebKit::ViewGestureController::endSwipeGesture):
2791 (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
2792 (WebKit::ViewGestureController::setRenderTreeSize):
2793 * UIProcess/mac/ViewGestureController.h:
2794 Keep a side-map of page IDs to ViewGestureControllers, so that we can safely get back to
2795 our ViewGestureController from the callback.
2797 When the callback fires, if it succeeded, set m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit,
2798 so that the commit (which is about to occur immediately after the callback returns) which calls
2799 setRenderTreeSize will (perhaps) remove the snapshot.
2801 If it failed, we remove the snapshot immediately, as this usually happens if the Web process crashed.
2803 2014-07-03 Brady Eidson <beidson@apple.com>
2805 Followup to "rects sent to ServicesOverlayController are wrong"
2806 https://bugs.webkit.org/show_bug.cgi?id=134568
2808 Rubberstamped by Tim Horton.
2810 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2811 (WebKit::ServicesOverlayController::drawSelectionHighlight): Don’t check to see if the
2812 proposed rect intersects the dirty rect. We always need to include all rects that form
2813 the selection when creating the DDHighlight.
2815 2014-07-03 Tim Horton <timothy_horton@apple.com>
2817 [WK2] RemoteLayerTreeDrawingAreaProxy re-checks a preference every commit for no reason
2818 https://bugs.webkit.org/show_bug.cgi?id=134586
2820 Reviewed by Benjamin Poulain.
2822 * UIProcess/DrawingAreaProxy.h:
2823 (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator):
2824 (WebKit::DrawingAreaProxy::showDebugIndicator): Deleted.
2825 (WebKit::DrawingAreaProxy::isShowingDebugIndicator): Remove this, nobody is using it.
2826 * UIProcess/WebPageProxy.cpp:
2827 (WebKit::WebPageProxy::preferencesDidChange):
2828 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2829 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2830 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2831 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2832 (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator):
2833 (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): Deleted.
2834 Check the debug indicator pref at construction time, and update the state when it changes.
2835 Checking it every commit was surprisingly expensive.
2837 2014-07-03 Antti Koivisto <antti@apple.com>
2839 Ensure frame creation messages get through to UI process
2840 https://bugs.webkit.org/show_bug.cgi?id=134591
2841 <rdar://problem/16918218>
2843 Reviewed by Anders Carlsson.
2845 If we are middle of handling a synchronous message from UI process a frame creation message back gets delayed.
2846 The subsequent synchronous DecidePolicyForNavigationAction message expects that the frame creation
2847 message has arrived first and fails.
2849 * WebProcess/WebPage/WebFrame.cpp:
2850 (WebKit::WebFrame::createWithCoreMainFrame):
2851 (WebKit::WebFrame::createSubframe):
2853 Send messages with DispatchMessageEvenWhenWaitingForSyncReply so they always go through in order.
2855 2014-07-03 Anders Carlsson <andersca@apple.com>
2857 Get rid of DecoderAdapter and EncoderAdapter
2858 https://bugs.webkit.org/show_bug.cgi?id=134598
2860 Reviewed by Andreas Kling.
2863 * WebKit2.xcodeproj/project.pbxproj:
2864 * WebProcess/WebPage/DecoderAdapter.cpp: Removed.
2865 * WebProcess/WebPage/DecoderAdapter.h: Removed.
2866 * WebProcess/WebPage/EncoderAdapter.cpp: Removed.
2867 * WebProcess/WebPage/EncoderAdapter.h: Removed.
2868 * WebProcess/WebPage/WebPage.cpp:
2870 2014-07-02 Anders Carlsson <andersca@apple.com>
2872 Stop using EncoderAdapter/DecoderAdapter for FormData
2873 https://bugs.webkit.org/show_bug.cgi?id=134571
2875 Reviewed by Andreas Kling.
2877 * Shared/Network/NetworkResourceLoadParameters.cpp:
2878 (WebKit::NetworkResourceLoadParameters::encode):
2879 (WebKit::NetworkResourceLoadParameters::decode):
2881 2014-07-03 Brady Eidson <beidson@apple.com>
2883 Selection rects sent to ServicesOverlayController are wrong.
2884 <rdar://problem/16727796> and https://bugs.webkit.org/show_bug.cgi?id=134568
2886 Reviewed by Darin Adler (and Tim Horton and Ryosuke Niwa).
2888 * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2889 (WebKit::WebEditorClient::selectionRectsDidChange): Also pass the GapRects to the ServicesOverlayController.
2890 * WebProcess/WebCoreSupport/WebEditorClient.h:
2892 * WebProcess/WebPage/ServicesOverlayController.h:
2893 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2894 (WebKit::expandForGap):
2895 (WebKit::compactRectsWithGapRects): Combine 3+ rects down to exactly 3 rects, then expand them based on GapRects.
2896 (WebKit::ServicesOverlayController::selectionRectsDidChange): Call compactRectsWithGapRects, then reverse the list.
2897 (WebKit::ServicesOverlayController::drawSelectionHighlight): Tell data detectors to flip this.
2898 (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Tell data detectors to flip this.
2899 (WebKit::ServicesOverlayController::drawCurrentHighlight): No need to flip this anymore.
2901 2014-07-03 Brady Eidson <beidson@apple.com>
2903 Possible crash in IconDatabase in WebCore::IconDatabase::dispatchDidRemoveAllIconsOnMainThread
2904 <rdar://problem/17437687> and https://bugs.webkit.org/show_bug.cgi?id=134517
2906 Reviewed by Eric Carlson.
2908 * UIProcess/WebContext.cpp:
2909 (WebKit::WebContext::~WebContext): Instead of directly deref’ing the WebIconDatabase, ask it to
2910 deref itself when appropriate.
2912 * UIProcess/WebIconDatabase.cpp:
2913 (WebKit::WebIconDatabase::WebIconDatabase):
2914 (WebKit::WebIconDatabase::didClose): If this WebIconDatabase is supposed to deref itself when
2915 appropriate, do so now.
2916 (WebKit::WebIconDatabase::derefWhenAppropriate): If the WebCore::IconDatabase is still open then
2918 * UIProcess/WebIconDatabase.h:
2920 2014-07-03 Carlos Garcia Campos <cgarcia@igalia.com>
2922 REGRESSION(r170676): [GTK] UI process crashes when the Web Process crashes
2923 https://bugs.webkit.org/show_bug.cgi?id=134541
2925 Reviewed by Gyuyoung Kim.
2927 It happens when attaching a new web process, because it tries to
2928 encode a null SessionState.
2930 * UIProcess/LegacySessionStateCodingNone.cpp:
2931 (WebKit::encodeLegacySessionState): Return an empty API::Data
2932 object instead of nullptr.
2933 (WebKit::encodeLegacySessionHistoryEntryData): Ditto.
2935 2014-07-03 Carlos Garcia Campos <cgarcia@igalia.com>
2937 REGRESSION(r170743): [GTK] [EFL] Build broken.
2938 https://bugs.webkit.org/show_bug.cgi?id=134585
2940 Reviewed by Philippe Normand.
2942 Add ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC) guards where needed.
2944 * WebProcess/Plugins/PluginView.cpp:
2945 (WebKit::PluginView::initializePlugin):
2946 * WebProcess/WebPage/WebPage.cpp:
2947 (WebKit::WebPage::createPlugin):
2949 2014-07-02 Benjamin Poulain <benjamin@webkit.org>
2951 [iOS][WK2] Make is safe/fast to use the animated resize API without resizing anything
2952 https://bugs.webkit.org/show_bug.cgi?id=134570
2954 Reviewed by Enrica Casucci.
2956 Today, if someone calls _beginAnimatedResizeWithUpdates-_endAnimatedResize, it is always a very heavy process
2957 forcing a relayout and can cause synchronous operations.
2959 We should not force the caller of the API to maintain their own state tracking, we should do that for them.
2961 With this patch, we track everything we need for a resize and only do the heavy lifting if anything has actually changed.
2963 * UIProcess/API/Cocoa/WKWebView.mm:
2964 (activeMinimumLayoutSize):
2965 (activeMinimumLayoutSizeForMinimalUI):
2966 (activeMaximumUnobscuredSize):
2967 (activeOrientation):
2968 This code is used in both _didRelaunchProcess and _beginAnimatedResizeWithUpdates. It is moved to static functions
2969 to avoid having it in two places.
2971 (-[WKWebView _didRelaunchProcess]):
2973 (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2974 The updates now goes like this:
2975 1) Set _isAnimatingResize to prevent the undesired side effects updateBlock() if we really need to resize.
2976 2) Get all the original values before calling the update block.
2977 3) Call the update block.
2978 4a) If nothing useful for resize has changed, reset _isAnimatingResize to false.
2979 We also need to update the visible content rect because the update block may have changed something unrelated
2980 to the view size (scale, scroll position, etc).
2981 4b) If we really need to resize, proceed as usual.
2983 (-[WKWebView _endAnimatedResize]):
2984 With the changes in _beginAnimatedResizeWithUpdates:, _isAnimatingResize is only set for real cases of animated resize,
2985 bail out early if that flag isn't set.
2987 The remaining code is unchanged, it is just not indented due to the removal of the if() branch.
2989 2014-07-02 Roger Fong <roger_fong@apple.com>
2991 Improve handling of primary offscreen plugins.
2992 https://bugs.webkit.org/show_bug.cgi?id=134528.
2993 <rdar://problem/17471864>
2995 Reviewed by Dean Jackson.
2997 * WebProcess/Plugins/PluginView.cpp:
2998 Determine whether or not the plugin starts offscreen when the plugin is initialized.
2999 (WebKit::PluginView::initializePlugin):
3000 (WebKit::PluginView::pluginSnapshotTimerFired):
3001 * WebProcess/WebPage/WebPage.cpp:
3002 (WebKit::WebPage::createPlugin):
3003 Use the PluginProcessTypeNormal for offscreen plugins that are potentially primary plugins.
3005 2014-07-02 Enrica Casucci <enrica@apple.com>
3007 REGRESSION(WK2): Undo does not work in text fields in Safari.
3008 https://bugs.webkit.org/show_bug.cgi?id=134572
3009 <rdar://problem/17542238>
3011 Reviewed by Benjamin Poulain.
3013 This patch adds for iOS the same implementation we have already for OS X.
3015 * UIProcess/ios/PageClientImplIOS.h:
3016 * UIProcess/ios/PageClientImplIOS.mm:
3017 (-[WKEditCommandObjC initWithWebEditCommandProxy:]):
3018 (-[WKEditCommandObjC command]):
3019 (-[WKEditorUndoTargetObjC undoEditing:]):
3020 (-[WKEditorUndoTargetObjC redoEditing:]):
3021 (WebKit::PageClientImpl::PageClientImpl):
3022 (WebKit::PageClientImpl::registerEditCommand):
3023 (WebKit::PageClientImpl::clearAllEditCommands):
3024 (WebKit::PageClientImpl::canUndoRedo):
3025 (WebKit::PageClientImpl::executeUndoRedo):
3027 2014-07-02 Gavin Barraclough <baraclough@apple.com>
3029 ProcessAssertion should also prevent UIApp suspension
3030 https://bugs.webkit.org/show_bug.cgi?id=134563
3032 Reviewed by Dan Bernstein.
3034 If the application suspends then the child processes will, too.
3035 Use beginBackgroundTaskWithName:expirationHandler: to request that the application remain runnable
3036 while waiting for background tasks to complete.
3038 * UIProcess/ProcessAssertion.cpp:
3039 (WebKit::ProcessAssertion::~ProcessAssertion):
3041 * UIProcess/ProcessAssertion.h:
3043 * UIProcess/ios/ProcessAssertionIOS.mm:
3044 (+[WKProcessAssertionBackgroundTaskManager shared]):
3045 - singleton WKProcessAssertionBackgroundTaskManager.
3046 (-[WKProcessAssertionBackgroundTaskManager init]):
3047 (-[WKProcessAssertionBackgroundTaskManager dealloc]):
3048 - register/remove notification handlers.
3049 (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
3050 - if we need to be runnable make sure we're holding a BackgroundTask, if not release it.
3051 (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackgroundOrWillEnterForeground:]):
3052 - detect when the app enters/leaves foreground; calls to _updateBackgroundTask.
3053 (-[WKProcessAssertionBackgroundTaskManager incrementNeedsToRunInBackgroundCount]):
3054 (-[WKProcessAssertionBackgroundTaskManager decrementNeedsToRunInBackgroundCount]):
3055 - interface to update the count; calls to _updateBackgroundTask.
3056 (WebKit::ProcessAssertion::ProcessAssertion):
3057 (WebKit::ProcessAssertion::~ProcessAssertion):
3058 - count ProcessAssertions in and out of existance.
3059 (WebKit::ProcessAssertion::setState):
3060 - count when the state changes.
3062 2014-07-01 Mark Rowe <mrowe@apple.com>
3064 <https://webkit.org/b/134522> Remove duplication in code that prepares the user agent string on Mac and iOS
3066 Reviewed by Simon Fraser.
3068 * UIProcess/ios/WebPageProxyIOS.mm:
3069 (WebKit::webKitBundleVersionString): Return the entire CFBundleVersion now that WebCore handles formatting it.
3070 (WebKit::WebPageProxy::standardUserAgent):
3071 * UIProcess/mac/WebPageProxyMac.mm:
3072 (WebKit::webKitBundleVersionString): Ditto.
3073 (WebKit::WebPageProxy::standardUserAgent):
3075 2014-06-28 Oliver Hunt <oliver@apple.com>
3077 Restrict network process sandbox
3078 https://bugs.webkit.org/show_bug.cgi?id=134360
3080 Reviewed by Sam Weinig.
3082 Add more restrictions to the network process sandbox.
3084 * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3085 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3086 Always use the cache directory provided in the initialization parameters,
3087 and make sure we consume the cookie directory extension.
3088 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3089 Make the sandbox profile much more restrictive.
3090 * Shared/Network/NetworkProcessCreationParameters.cpp:
3091 (WebKit::NetworkProcessCreationParameters::encode):
3092 (WebKit::NetworkProcessCreationParameters::decode):
3093 * Shared/Network/NetworkProcessCreationParameters.h:
3094 The network process now requires an extension to access
3096 * Shared/mac/SandboxUtilities.cpp:
3097 (WebKit::pathForProcessContainer):
3098 * Shared/mac/SandboxUtilities.h:
3099 We need to be able to get hold of our container so
3100 that we can get the correct cookie storage directory.
3101 * UIProcess/WebContext.cpp:
3102 (WebKit::WebContext::ensureNetworkProcess):
3103 We have to pass in the an extension for the cookie storage directory when
3104 initalising the network process
3105 * UIProcess/mac/WebContextMac.mm:
3106 (WebKit::WebContext::platformDefaultCookieStorageDirectory):
3107 Make sure we provide the correct location on IOS
3108 * WebProcess/cocoa/WebProcessCocoa.mm:
3109 (WebKit::WebProcess::platformInitializeWebProcess):
3110 Consume the cookie storage extension
3112 2014-07-02 Csaba Osztrogonác <ossy@webkit.org>
3114 URTBF after r170725.
3116 * CMakeLists.txt: Removed Shared/LegacySessionState.cpp.
3118 2014-07-02 Csaba Osztrogonác <ossy@webkit.org>
3120 URTBF after r170719 for !CF platforms.
3122 * UIProcess/WebPageProxy.cpp:
3123 (WebKit::WebPageProxy::sessionStateData): Deleted.
3124 (WebKit::WebPageProxy::restoreFromSessionStateData): Deleted.
3126 2014-07-02 Mark Rowe <mrowe@apple.com>
3128 <https://webkit.org/b/134521> iOS should use shared code to determine the system marketing version
3130 Reviewed by Simon Fraser.
3132 * Shared/ios/ChildProcessIOS.mm: Update #import.
3133 * Shared/mac/ChildProcessMac.mm: Ditto.
3135 2014-07-02 Anders Carlsson <andersca@apple.com>
3137 Rip out more dead code
3138 https://bugs.webkit.org/show_bug.cgi?id=134562
3140 Reviewed by Andreas Kling.
3142 * Shared/LegacySessionState.cpp: Removed.
3143 * Shared/LegacySessionState.h: Removed.
3144 * Shared/WebBackForwardListItem.cpp:
3145 (WebKit::WebBackForwardListItem::WebBackForwardListItem): Deleted.
3146 (WebKit::WebBackForwardListItem::backForwardData): Deleted.
3147 (WebKit::WebBackForwardListItem::setBackForwardData): Deleted.
3148 (WebKit::WebBackForwardListItem::encode): Deleted.
3149 (WebKit::WebBackForwardListItem::decode): Deleted.
3150 * Shared/WebBackForwardListItem.h:
3151 (WebKit::WebBackForwardListItem::create): Deleted.
3152 (WebKit::WebBackForwardListItem::setOriginalURL): Deleted.
3153 (WebKit::WebBackForwardListItem::setURL): Deleted.
3154 (WebKit::WebBackForwardListItem::setTitle): Deleted.
3155 * UIProcess/WebPageProxy.cpp:
3156 * WebKit2.xcodeproj/project.pbxproj:
3157 * WebProcess/WebPage/WebPage.cpp:
3159 2014-07-02 Anders Carlsson <andersca@apple.com>
3161 RestoreSession should take a vector of BackForwardListItemStates
3162 https://bugs.webkit.org/show_bug.cgi?id=134558
3164 Reviewed by Tim Horton.
3166 * Scripts/webkit2/messages.py:
3169 * Shared/WebPageCreationParameters.cpp:
3170 (WebKit::WebPageCreationParameters::encode):
3171 (WebKit::WebPageCreationParameters::decode):
3172 * Shared/WebPageCreationParameters.h:
3173 * UIProcess/WebBackForwardList.cpp:
3174 (WebKit::WebBackForwardList::itemStates):
3175 * UIProcess/WebBackForwardList.h:
3176 * UIProcess/WebPageProxy.cpp:
3177 (WebKit::WebPageProxy::restoreFromSessionState):
3178 (WebKit::WebPageProxy::creationParameters):
3179 * WebProcess/WebPage/WebPage.cpp:
3180 (WebKit::WebPage::WebPage):
3181 (WebKit::WebPage::restoreSession):
3182 (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem): Deleted.
3183 * WebProcess/WebPage/WebPage.h:
3184 * WebProcess/WebPage/WebPage.messages.in:
3186 2014-07-02 Anders Carlsson <andersca@apple.com>
3188 Store the back forward list item id inside BackForwardListItemState
3189 https://bugs.webkit.org/show_bug.cgi?id=134557
3191 Reviewed by Tim Horton.
3193 * Shared/SessionState.cpp:
3194 (WebKit::BackForwardListItemState::encode):
3195 (WebKit::BackForwardListItemState::decode):
3196 * Shared/SessionState.h:
3197 * Shared/WebBackForwardListItem.cpp:
3198 (WebKit::WebBackForwardListItem::create):
3199 (WebKit::WebBackForwardListItem::WebBackForwardListItem):
3200 (WebKit::WebBackForwardListItem::encode):
3201 * Shared/WebBackForwardListItem.h:
3202 (WebKit::WebBackForwardListItem::itemID):
3203 * UIProcess/WebBackForwardList.cpp:
3204 (WebKit::WebBackForwardList::restoreFromState):
3205 * UIProcess/WebProcessProxy.cpp:
3206 (WebKit::WebProcessProxy::addBackForwardItem):
3208 2014-07-02 Manuel Rego Casasnovas <rego@igalia.com>
3210 Unreviewed. EFL and GTK build fix after r170716.
3212 * UIProcess/LegacySessionStateCodingNone.cpp:
3213 (WebKit::decodeLegacySessionState): Update method signature.
3215 2014-07-02 Anders Carlsson <andersca@apple.com>
3217 Begin ripping out the old session state code
3218 https://bugs.webkit.org/show_bug.cgi?id=134556
3220 Reviewed by Andreas Kling.
3222 * UIProcess/WebBackForwardList.h:
3223 * UIProcess/WebPageProxy.h:
3224 * UIProcess/cf/WebBackForwardListCF.cpp: Removed.
3225 * UIProcess/cf/WebPageProxyCF.cpp:
3226 (WebKit::WebPageProxy::sessionStateData): Deleted.
3227 (WebKit::WebPageProxy::restoreFromSessionStateData): Deleted.
3228 * WebKit2.xcodeproj/project.pbxproj:
3230 2014-07-02 Anders Carlsson <andersca@apple.com>
3232 Use legacy state coding directly in WKWebView
3233 https://bugs.webkit.org/show_bug.cgi?id=134553
3235 Reviewed by Dan Bernstein.
3237 * UIProcess/API/C/WKPage.cpp:
3238 (WKPageRestoreFromSessionState):
3239 * UIProcess/API/C/WKSessionStateRef.cpp:
3240 (WKSessionStateCreateFromData):
3241 * UIProcess/API/Cocoa/WKWebView.mm:
3242 (-[WKWebView _sessionStateData]):
3243 (-[WKWebView _sessionState]):
3244 (-[WKWebView _restoreFromSessionStateData:]):
3245 (-[WKWebView _restoreFromSessionState:]):
3246 (releaseNSData): Deleted.
3247 * UIProcess/LegacySessionStateCoding.h:
3248 * UIProcess/WebPageProxy.cpp:
3249 (WebKit::WebPageProxy::restoreFromSessionState):
3250 (WebKit::WebPageProxy::restoreFromState): Deleted.
3251 * UIProcess/WebPageProxy.h:
3252 * UIProcess/mac/LegacySessionStateCoding.cpp:
3253 (WebKit::decodeLegacySessionState):
3255 2014-07-02 Anders Carlsson <andersca@apple.com>
3257 Add -[WKWebView _sessionStateData] and -[WKWebView _restoreFromSessionStateData:]
3258 https://bugs.webkit.org/show_bug.cgi?id=134549
3260 Reviewed by Dan Bernstein.
3262 * UIProcess/API/Cocoa/WKWebView.mm:
3263 (-[WKWebView _sessionState]):
3264 (-[WKWebView _sessionStateData]):
3265 (-[WKWebView _restoreFromSessionState:]):
3266 (-[WKWebView _restoreFromSessionStateData:]):
3267 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3269 2014-07-02 Carlos Garcia Campos <cgarcia@igalia.com>
3271 [GTK] WebKitVersion.h should be shared between UI and Web Process APIs
3272 https://bugs.webkit.org/show_bug.cgi?id=134538
3274 Reviewed by Martin Robinson.
3276 To be able to check current version from web extensions too.
3278 * UIProcess/API/gtk/WebKitVersion.h.in: Allow to include WebKitVersion.h also from webkit-web-extension.h.
3279 * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h: Include WebKitVersion.h.
3281 2014-07-02 Carlos Garcia Campos <cgarcia@igalia.com>
3283 [GTK] WebKitWebView::create should receive information about the navigation action
3284 https://bugs.webkit.org/show_bug.cgi?id=133680
3286 Reviewed by Martin Robinson.
3288 Add WebKitNavigationAction boxed type representing a navigation
3289 action to be passed as parameter of WebKitWebView::create
3290 signal. In the future it could be also for the
3291 WebKitNavigationPolicyDecision class. The class contains
3292 information about a navigation action like the navigation type,
3293 the request, the mouse button and key modifiers and whether it was
3294 started by a user gesture. This information is needed to be able
3295 to implement a proper popup blocker. Since all that information is
3296 not provided by the C API, we have switched the UI client to use a
3297 custom client derived from API::UIClient. This also avoids a lot
3298 of toAPI -> toImpl unneeded conversions.
3300 * PlatformGTK.cmake: Add new files to compilation.
3301 * UIProcess/API/gtk/WebKitHitTestResult.cpp:
3302 (webkitHitTestResultCreate): Use a WebHitTestResult::Data const
3303 reference instead of a pointer to a WebHitTestResult.
3304 (webkitHitTestResultCompare): Ditto.
3305 * UIProcess/API/gtk/WebKitHitTestResultPrivate.h:
3306 * UIProcess/API/gtk/WebKitNavigationAction.cpp: Added.
3307 (webkitNavigationActionCreate): Create a WebKitNavigationAction
3308 for the given ResourceRequest and NavigationActionData.
3309 (webkit_navigation_action_copy):
3310 (webkit_navigation_action_free):
3311 (webkit_navigation_action_get_navigation_type):
3312 (webkit_navigation_action_get_mouse_button):
3313 (webkit_navigation_action_get_modifiers):
3314 (webkit_navigation_action_get_request):
3315 (webkit_navigation_action_is_user_gesture):
3316 * UIProcess/API/gtk/WebKitNavigationAction.h: Added.
3317 * UIProcess/API/gtk/WebKitNavigationActionPrivate.h: Added.
3318 * UIProcess/API/gtk/WebKitNavigationPolicyDecision.h:
3319 * UIProcess/API/gtk/WebKitPrivate.cpp:
3321 (toWebKitNavigationType):
3322 (toWebKitMouseButton):
3323 * UIProcess/API/gtk/WebKitPrivate.h:
3324 * UIProcess/API/gtk/WebKitUIClient.cpp:
3325 (UIClient::UIClient): Implement the UIClient using a custom class.
3326 (attachUIClientToView): Set the UIClient directly to the WebPageProxy.
3327 (createNewPage): Deleted.
3328 (showPage): Deleted.
3329 (closePage): Deleted.
3330 (runJavaScriptAlert): Deleted.
3331 (runJavaScriptConfirm): Deleted.
3332 (runJavaScriptPrompt): Deleted.
3333 (toolbarsAreVisible): Deleted.
3334 (setToolbarsAreVisible): Deleted.
3335 (menuBarIsVisible): Deleted.
3336 (setMenuBarIsVisible): Deleted.
3337 (statusBarIsVisible): Deleted.
3338 (setStatusBarIsVisible): Deleted.
3339 (isResizable): Deleted.
3340 (setIsResizable): Deleted.
3341 (getWindowFrame): Deleted.
3342 (setWindowFrame): Deleted.
3343 (mouseDidMoveOverElement): Deleted.
3344 (printFrame): Deleted.
3345 (runOpenPanel): Deleted.
3346 (decidePolicyForGeolocationPermissionRequest): Deleted.
3347 (runModal): Deleted.
3348 * UIProcess/API/gtk/WebKitWebView.cpp:
3349 (webkitWebViewCreate): Add WebKitNavigationAction parameter.
3350 (webkit_web_view_class_init): Add WebKitNavigationAction paramter
3352 (webkitWebViewCreateNewPage): Add WebKitNavigationAction parameter
3353 and pass it to the signal callbacks.
3354 (webkitWebViewMouseTargetChanged): Use a WebHitTestResult::Data
3356 (webkitWebViewPopulateContextMenu): Ditto.
3357 * UIProcess/API/gtk/WebKitWebView.h:
3358 * UIProcess/API/gtk/WebKitWebViewPrivate.h:
3359 * UIProcess/API/gtk/WebKitWindowProperties.cpp:
3360 (webkitWindowPropertiesUpdateFromWebWindowFeatures): Use a
3361 WebCore::WindowFeatures const reference.
3362 * UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h:
3363 * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section.
3364 * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
3365 * UIProcess/API/gtk/webkit2.h: Include WebKitNavigationAction.h.
3367 2014-07-01 KwangHyuk Kim <hyuki.kim@samsung.com>
3369 [EFL] Fix occurrence of two cursors on WK2 EFL.
3370 https://bugs.webkit.org/show_bug.cgi?id=134436
3372 Reviewed by Anders Carlsson.
3374 ecore_x_window_cursor is released when ecore_evas_object_cursor should be shown in order to avoid occurrence of two cursors.
3376 * UIProcess/API/efl/EwkView.cpp:
3377 (EwkView::updateCursor):
3379 2014-07-01 Gyuyoung Kim <gyuyoung.kim@samsung.com>
3381 Fix build break on EFL and GTK ports since r170683
3382 https://bugs.webkit.org/show_bug.cgi?id=134536
3384 Unreviewed, build fix.
3388 2014-07-01 Dean Jackson <dino@apple.com>
3390 Make LogsPageMessagesToSystemConsoleEnabled a global debug preference
3391 https://bugs.webkit.org/show_bug.cgi?id=134534
3393 Reviewed by Joseph Pecoraro.
3395 * Shared/WebPreferencesDefinitions.h:
3397 2014-07-01 Tim Horton <timothy_horton@apple.com>
3399 Handle invalid data more gracefully.
3401 Reviewed by Anders Carlsson.
3403 * UIProcess/mac/LegacySessionStateCoding.cpp:
3404 (WebKit::decodeFormData):
3405 (WebKit::decodeBackForwardTreeNode):
3407 2014-07-01 Mark Rowe <mrowe@apple.com>
3409 Add a missing return statement in WKPageCopySessionState.
3411 Reviewed by Anders Carlsson.
3413 * UIProcess/API/C/WKPage.cpp:
3414 (WKPageCopySessionState):
3416 2014-07-01 Anders Carlsson <andersca@apple.com>
3418 Don't encode/decode the snapshot UUID
3419 https://bugs.webkit.org/show_bug.cgi?id=134532
3421 Reviewed by Sam Weinig.
3423 * UIProcess/mac/LegacySessionStateCoding.cpp:
3424 (WebKit::encodeSessionHistory):
3425 (WebKit::decodeSessionHistoryEntry):
3427 2014-07-01 Commit Queue <commit-queue@webkit.org>
3429 Unreviewed, rolling out r170608.
3430 https://bugs.webkit.org/show_bug.cgi?id=134533
3432 Safari keeps crashing on device due to sandbox violation.
3433 (Requested by enrica on #webkit).
3437 "Restrict network process sandbox"
3438 https://bugs.webkit.org/show_bug.cgi?id=134360
3439 http://trac.webkit.org/changeset/170608
3441 2014-07-01 Pratik Solanki <psolanki@apple.com>
3443 Encode/decode CFURLRequestRefs when USE(CFNETWORK) is enabled
3444 https://bugs.webkit.org/show_bug.cgi?id=134454
3445 <rdar://problem/17510980>
3447 Reviewed by Andreas Kling.
3449 Use new helper methods to serialize/deserialize CFURLRequestRef directly so we can avoid
3450 creating NSURLRequest.
3452 * Shared/mac/WebCoreArgumentCodersMac.mm:
3453 (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3454 (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3456 2014-07-01 Benjamin Poulain <benjamin@webkit.org>
3458 [iOS][WK2] Fix a race between the short tap and long tap highlight
3459 https://bugs.webkit.org/show_bug.cgi?id=134530
3461 Reviewed by Enrica Casucci.
3463 There was a potential race of event that can theoretically cause WKContentViewInteraction
3464 to call [WKContentView _showTapHighlight] after all interactions have been cancelled.
3466 The race would be like this:
3467 1) On a short tap, _singleTapRecognized: is called, a tap highlight ID is defined and
3468 _potentialTapInProgress is set to YES.
3469 2) For some reason, the gesture is cancelled. The method _singleTapDidReset is called,
3470 setting _potentialTapInProgress but leaving the tap highlight ID as valid.
3471 3) The UIProcess receives the tap highlight information from the WebProcess, _didGetTapHighlightForRequest:
3472 has a valid ID, _potentialTapInProgress is false -> the highlight is shown right away as if a long tap
3475 The missing piece that causes this is _singleTapDidReset: must also invalidate the tap highlight ID. This is done
3476 in the new static function cancelPotentialTapIfNecessary().
3478 Just invalidating the ID would create another race:
3479 1) Short tap gesture recognizer starts.
3480 2) The long press recognizer starts before (1) is commited.
3481 3) The long press recognizers sets up its own tap highlight ID.
3482 4) The short tap gesture recognizer resets, erasing the tap highlight ID defined in (3).
3484 To avoid this, the long press gesture recognizers immediately cancels any potential tap in progress.
3485 If _singleTapDidReset: is called before (3), this does nothing. If the reset is called after (3),
3486 _singleTapDidReset does nothing.
3488 * UIProcess/ios/WKContentViewInteraction.mm:
3489 (-[WKContentView _highlightLongPressRecognized:]):
3490 (cancelPotentialTapIfNecessary):
3491 (-[WKContentView _singleTapDidReset:]):
3493 2014-07-01 Anders Carlsson <andersca@apple.com>
3495 Add ABI hacks to allow WKPageRef to use WKSessionStateRef
3496 https://bugs.webkit.org/show_bug.cgi?id=134529
3498 Reviewed by Sam Weinig.
3500 * UIProcess/API/APISessionState.h:
3501 Add a sessionState() getter.
3503 * UIProcess/API/C/WKPage.cpp:
3504 (WKPageCopySessionState):
3505 Add a hack where we return a WKSessionStateRef if the least significant bit of the context pointer
3506 is 1, and a WKDataRef otherwise.
3508 (WKPageRestoreFromSessionState):
3509 Handle both WKDataRef and WKSessionStateref.
3511 * UIProcess/API/C/WKPage.h:
3512 Use WKTypeRefs for state saving and restoration.
3514 * UIProcess/API/C/WKSessionStateRef.cpp:
3515 (WKSessionStateCopyData):
3516 Add helper function.
3518 2014-07-01 Anders Carlsson <andersca@apple.com>
3520 WKPageRestoreFromSessionState should use the new session state restore code path
3521 https://bugs.webkit.org/show_bug.cgi?id=134526
3523 Reviewed by Tim Horton.
3525 * UIProcess/API/C/WKPage.cpp:
3526 (WKPageRestoreFromSessionState):
3527 Use the new code path.
3529 * UIProcess/WebPageProxy.cpp:
3530 (WebKit::WebPageProxy::restoreFromState):
3531 Only restore the back-forward state if we have a back-forward list.
3533 * UIProcess/mac/LegacySessionStateCoding.cpp:
3534 (WebKit::encodeSessionHistory):
3535 Save the original URL string as well.
3537 (WebKit::decodeV1SessionHistory):
3538 If we don't have a current index, set it to Nullopt instead of 0.
3540 2014-07-01 Gyuyoung Kim <gyuyoung.kim@samsung.com>
3542 Unreviewed. EFL and GTK build fix since r170654.
3544 * UIProcess/LegacySessionStateCodingNone.cpp: Add a dummy encodeLegacySessionState(const SessionState&).
3545 (WebKit::encodeLegacySessionState):
3547 2014-07-01 Dan Bernstein <mitz@apple.com>
3549 Crash in WebDocumentLoader::setNavigationID
3550 https://bugs.webkit.org/show_bug.cgi?id=134520
3552 Reviewed by Anders Carlsson.
3554 * WebProcess/WebPage/WebFrame.cpp:
3555 (WebKit::WebFrame::didReceivePolicyDecision): Null-check the policy document loader.
3557 2014-07-01 Dan Bernstein <mitz@apple.com>
3561 * UIProcess/API/APILoaderClient.h:
3562 (API::LoaderClient::didDestroyNavigation):
3564 2014-07-01 Anders Carlsson <andersca@apple.com>
3566 Use the new legacy session state coding in WKPageCopySessionState
3567 https://bugs.webkit.org/show_bug.cgi?id=134516
3569 Reviewed by Tim Horton.
3571 * UIProcess/API/C/WKPage.cpp:
3572 (WKPageCopySessionState):
3573 Call encodeLegacySessionState.
3575 * UIProcess/mac/LegacySessionStateCoding.cpp:
3576 (WebKit::encodeSessionHistoryEntryData):
3577 Use leakPtr() so we won't attempt to double-free the buffer.
3579 (WebKit::createDictionary):
3582 (WebKit::encodeLegacySessionState):
3583 Don't encode the provisional URL if it's empty.
3585 2014-07-01 Chris Fleizach <cfleizach@apple.com>
3587 AX: [iOS WebKit2] Support for Speak selection
3588 https://bugs.webkit.org/show_bug.cgi?id=134512
3590 Reviewed by Darin Adler.
3592 Implement a method that Speak Selection can use to retrieve the selected content.
3594 * UIProcess/ios/WKContentViewInteraction.mm:
3595 (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
3597 2014-07-01 Anders Carlsson <andersca@apple.com>
3599 Update the highest back-forward list item ID in the other WebBackForwardListItem constructor
3600 https://bugs.webkit.org/show_bug.cgi?id=134515
3602 Reviewed by Tim Horton.
3604 * Shared/WebBackForwardListItem.cpp:
3605 (WebKit::WebBackForwardListItem::WebBackForwardListItem):
3607 2014-07-01 Brady Eidson <beidson@apple.com>
3609 Fix ServicesOverlayController teardown
3610 <rdar://problem/17523998> and https://bugs.webkit.org/show_bug.cgi?id=134510
3612 Reviewed by Mark Rowe.
3614 * WebProcess/WebPage/mac/ServicesOverlayController.mm:
3615 (WebKit::ServicesOverlayController::~ServicesOverlayController): Flipped logic on null-checking the overlay.
3617 2014-07-01 Sam Weinig <sam@webkit.org>
3619 [Cocoa][Mac] WKWebView should automatically set topContentInset when beneath a toolbar
3620 <rdar://problem/17523159>
3621 https://bugs.webkit.org/show_bug.cgi?id=134496
3623 Reviewed by Beth Dakin.
3625 - Adds _automaticallyAdjustsContentInsets SPI to both WKView and WKWebView.
3626 - Defaults _automaticallyAdjustsContentInsets to NO for WKView to keep legacy clients working.
3627 - Defaults _automaticallyAdjustsContentInsets to YES for WKWebView.
3629 * UIProcess/API/Cocoa/WKViewPrivate.h:
3630 Add _automaticallyAdjustsContentInsets SPI.
3632 * UIProcess/API/Cocoa/WKWebView.mm:
3633 (-[WKWebView initWithFrame:configuration:]):
3634 Default _automaticallyAdjustsContentInsets to YES for WKWebView.
3636 (-[WKWebView _setTopContentInset:]):
3637 (-[WKWebView _topContentInset]):
3638 Change to forward to the WKView, since we now do coalescing and caching there.
3640 (-[WKWebView _setAutomaticallyAdjustsContentInsets:]):
3641 (-[WKWebView _automaticallyAdjustsContentInsets]):
3642 Forward to the WKView.
3644 * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3645 Add _automaticallyAdjustsContentInsets SPI.
3647 * UIProcess/API/mac/WKView.mm:
3648 (-[WKView renewGState]):
3649 Ensure the contentInset is updated when the view changes, as its relative location to the toolbar may have changed.
3651 (-[WKView addWindowObserversForWindow:]):
3652 (-[WKView removeWindowObservers]):
3653 (-[WKView observeValueForKeyPath:ofObject:change:context:]):
3654 Add observers for the contentLayoutRect and titlebarAppearsTransparent properties on the window. If either of them
3655 change, we need to recalculate the content inset.
3657 (-[WKView _updateContentInsetsIfAutomatic]):
3658 If _automaticallyAdjustsContentInsets is YES, follow the same rules as AppKit in setting the top content inset. Like
3659 AppKit this is only done when:
3660 - The window's style mask has the NSFullSizeContentViewWindowMask bit.
3661 - The window does not have titlebarAppearsTransparent set.
3662 - And we are not in an enclosing NSScrollView.
3664 (-[WKView _setTopContentInset:]):
3665 (-[WKView _topContentInset]):
3666 Coalesce setting the topContentInset to avoid a visual lag when resizing the window that was caused by us sending
3667 multiple topContentInsets to the WebContentProcess per runloop cycle. The reason for the lag was that at the time
3668 we observe the contentLayoutRect changing, our view may not yet be in its final position yet, so the inset will be
3669 temporarily wrong. When the view is finally positioned correctly, we will get a renewGState, at which point we will
3670 again calculate the inset, which now will be correct. Since these both happen in the same runloop iteration, we can
3671 just defer sending the inset to the WebContentProcess.
3673 (-[WKView _setAutomaticallyAdjustsContentInsets:]):
3674 (-[WKView _automaticallyAdjustsContentInsets]):
3677 2014-07-01 Anders Carlsson <andersca@apple.com>
3679 Add a function for restoring page state given a SessionState object
3680 https://bugs.webkit.org/show_bug.cgi?id=134509
3682 Reviewed by Tim Horton.
3684 * Shared/WebBackForwardListItem.h:
3685 (WebKit::WebBackForwardListItem::itemState):
3686 * UIProcess/WebBackForwardList.cpp:
3687 (WebKit::WebBackForwardList::saveState):
3688 * UIProcess/WebBackForwardList.h:
3689 * UIProcess/WebPageProxy.cpp:
3690 (WebKit::WebPageProxy::saveState):
3691 * UIProcess/WebPageProxy.h:
3693 2014-07-01 Dan Bernstein <mitz@apple.com>
3695 [Cocoa] Navigation parameter in navigation delegate messages is nil for navigations started by the Web Content process
3696 https://bugs.webkit.org/show_bug.cgi?id=134482
3698 Reviewed by Tim Horton.
3700 * UIProcess/API/APILoaderClient.h:
3701 (API::LoaderClient::didDestroyNavigation): New client function, called when a navigation ID
3702 is not going to be used anymore.
3704 * UIProcess/API/Cocoa/WKWebView.mm:
3705 (-[WKWebView _restoreFromSessionState:]): If restoring triggered a navigation, create a
3706 WKNavigation for its ID.
3708 * UIProcess/Cocoa/NavigationState.h:
3709 * UIProcess/Cocoa/NavigationState.mm:
3710 (WebKit::NavigationState::createLoadRequestNavigation): Removed FIXME, because we now remove
3711 navigations from the map in LoaderClient::didDestroyNavigation.
3712 (WebKit::NavigationState::createBackForwardNavigation): Ditto.
3713 (WebKit::NavigationState::createReloadNavigation): Ditto.
3714 (WebKit::NavigationState::createLoadDataNavigation): Ditto.
3715 (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): If we are only
3716 getting a navigation ID now, create a WKNavigation for it. Also changed to create the
3717 NSURLRequest lazily.
3718 (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Assert that
3719 navigationID is not zero and that it maps to an existing WKNavigation.
3720 (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
3722 (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
3723 (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
3724 (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
3725 (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
3726 (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
3727 (WebKit::NavigationState::LoaderClient::didDestroyNavigation): Override the new client
3728 function to remove the navigation from the map.
3729 (WebKit::NavigationState::LoaderClient::processDidCrash): Clear the navigations map.
3731 * UIProcess/WebFrameListenerProxy.cpp:
3732 (WebKit::WebFrameListenerProxy::WebFrameListenerProxy): Initialize new m_navigationID
3734 (WebKit::WebFrameListenerProxy::receivedPolicyDecision): Pass the navigation ID to
3735 WebFrame::receivedPolicyDecision.
3736 * UIProcess/WebFrameListenerProxy.h:
3737 (WebKit::WebFrameListenerProxy::navigationID): Added this accessor.
3738 (WebKit::WebFrameListenerProxy::setNavigationID): Ditto.
3740 * UIProcess/WebFrameProxy.cpp:
3741 (WebKit::WebFrameProxy::receivedPolicyDecision): Added navigationID parameter, which is
3742 passed along to the WebPageProxy.
3743 * UIProcess/WebFrameProxy.h:
3745 * UIProcess/WebPageProxy.cpp:
3746 (WebKit::WebPageProxy::receivedPolicyDecision): Added navigationID parameter, which is
3747 passed along in the message to the Web Content process.
3748 (WebKit::WebPageProxy::restoreFromSessionStateData): Changed to return a navigation ID of 0.
3749 (WebKit::WebPageProxy::restoreFromState): Changed to return a navigation ID if one was
3751 (WebKit::WebPageProxy::didDestroyNavigation): Added. Calls the new client function.
3752 (WebKit::WebPageProxy::decidePolicyForNavigationAction): Added navigationID and
3753 newNavigationID parameters. If a main-frame navigation doesn’t already have an ID, assign it
3754 a new ID and return it in the newNavigationID parmeter as well as setting it on the listener
3755 for the asynchronous case.
3756 * UIProcess/WebPageProxy.h:
3758 * UIProcess/WebPageProxy.messages.in: Added navigationID and newNavigationID parameters.
3760 * UIProcess/cf/WebPageProxyCF.cpp:
3761 (WebKit::WebPageProxy::restoreFromSessionStateData): Changed to return a navigation ID if
3764 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3765 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): Updated for additional
3767 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Send the navigation
3768 ID to the UI process, get the new navigation ID from the reply, and set it on the document
3771 * WebProcess/WebPage/WebDocumentLoader.cpp:
3772 (WebKit::WebDocumentLoader::detachFromFrame): Override to let the UI process know that the
3773 navigation ID will not be used anymore.
3774 * WebProcess/WebPage/WebDocumentLoader.h:
3776 * WebProcess/WebPage/WebFrame.cpp:
3777 (WebKit::WebFrame::didReceivePolicyDecision): Added navigationID parameter, set it on the
3779 (WebKit::WebFrame::documentLoaderDetached): Pass the message along to the UI process.
3780 * WebProcess/WebPage/WebFrame.h:
3782 * WebProcess/WebPage/WebPage.cpp:
3783 (WebKit::WebPage::didReceivePolicyDecision): Pass new navigationID parameter along.
3784 * WebProcess/WebPage/WebPage.h:
3786 * WebProcess/WebPage/WebPage.messages.in: Added navigationID parameter.
3788 2014-07-01 Anders Carlsson <andersca@apple.com>
3792 * WebKit2.xcodeproj/project.pbxproj:
3794 2014-07-01 Anders Carlsson <andersca@apple.com>
3796 Temporarily encode and decode the snapshot UUID
3797 https://bugs.webkit.org/show_bug.cgi?id=134507
3799 Reviewed by Tim Horton.
3801 * UIProcess/mac/LegacySessionStateCoding.cpp:
3802 (WebKit::encodeSessionHistory):
3803 (WebKit::decodeSessionHistoryEntry):
3804 (WebKit::decodeSessionHistoryEntries):
3806 2014-07-01 Anders Carlsson <andersca@apple.com>
3808 Implement encodeSessionHistoryEntryData
3809 https://bugs.webkit.org/show_bug.cgi?id=134505
3811 Reviewed by Tim Horton.
3813 * UIProcess/API/C/WKPage.cpp:
3814 (WKPageCopySessionState):
3815 Add back a missing null check for the filter pointer.
3817 * UIProcess/mac/LegacySessionStateCoding.cpp:
3818 (WebKit::encodeSessionHistoryEntryData):
3820 2014-07-01 Simon Fraser <simon.fraser@apple.com>
3822 [UI-side compositing] Bad spinner on news.google.com: animations need to be ordered
3823 https://bugs.webkit.org/show_bug.cgi?id=134504
3824 <rdar://problem/17507892>
3826 Reviewed by Tim Horton.
3828 The layer's addedAnimations property needs to maintain order, since the order
3829 in which transforms are applied is important.
3831 * Shared/mac/RemoteLayerTreeTransaction.h: Use a Vector<pair<>> for addedAnimations.
3832 * Shared/mac/RemoteLayerTreeTransaction.mm:
3833 (WebKit::dumpChangedLayers):
3834 * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
3835 * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3836 (WebKit::PlatformCAAnimationRemote::updateLayerAnimations):
3837 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3838 (WebKit::PlatformCALayerRemote::addAnimationForKey): If this is a new entry, we
3839 can just append to addedAnimations, otherwise we have to find the existing one
3840 and update its properties.
3841 (WebKit::PlatformCALayerRemote::removeAnimationForKey): Do linear search to
3842 find the animation to remove (this list will normally be short).
3844 2014-07-01 Anders Carlsson <andersca@apple.com>
3846 Add a encodeLegacySessionState function
3847 https://bugs.webkit.org/show_bug.cgi?id=134502
3849 Reviewed by Tim Horton.
3851 * UIProcess/LegacySessionStateCoding.h:
3852 * UIProcess/mac/LegacySessionStateCoding.cpp:
3853 (WebKit::encodeSessionHistoryEntryData):
3854 (WebKit::encodeLegacySessionHistoryEntryData):
3855 (WebKit::createDictionary):
3856 (WebKit::encodeSessionHistory):
3857 (WebKit::encodeLegacySessionState):
3859 2014-07-01 Alexey Proskuryakov <ap@apple.com>
3861 [Cocoa] WebProcess doesn't follow localization of UI process when run as a service
3862 https://bugs.webkit.org/show_bug.cgi?id=133126
3863 <rdar://problem/13396515>
3865 Patch by Alexey Proskuryakov.
3866 Reviewed by Tim Horton.
3868 * Configurations/WebContentService.Development.xcconfig:
3869 * Configurations/WebContentService.xcconfig:
3870 Figure out which of the two keys to use. CFBundleAllowMixedLocalizations was
3871 a workaround before we got CFBundleFollowParentLocalization, and these cannot be
3874 * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): Set up
3875 XPC bootstrap for CFBundle to use.
3877 * WebKit2.xcodeproj/project.pbxproj: Added a script that applies the key to Info.plist.
3879 * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-OSX.plist:
3880 * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist:
3881 * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
3882 * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
3883 Removed CFBundleAllowMixedLocalizations, we now add it programmatically.
3885 2014-07-01 Alex Christensen <achristensen@webkit.org>
3887 [iOS] Unreviewed build fix after r170640.
3889 * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3890 (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged):
3891 (WebKit::WebEditorClient::selectionRectsDidChange):
3892 * WebProcess/WebCoreSupport/WebEditorClient.h:
3893 * WebProcess/WebPage/WebPage.h:
3894 Add ifdefs to make everything compile and link.
3896 2014-07-01 Anders Carlsson <andersca@apple.com>
3898 Add WKSessionStateGetTypeID
3899 https://bugs.webkit.org/show_bug.cgi?id=134499
3901 Reviewed by Tim Horton.
3903 * UIProcess/API/C/WKSessionStateRef.cpp:
3904 (WKSessionStateGetTypeID):
3905 * UIProcess/API/C/WKSessionStateRef.h:
3907 2014-07-01 Daniel Bates <dabates@apple.com>
3909 Remove unnecessary calls to std::move()
3910 https://bugs.webkit.org/show_bug.cgi?id=134493
3912 Reviewed by Anders Carlsson.
3914 * Shared/ShareableResource.cpp:
3915 (WebKit::ShareableResource::Handle::tryWrapInCFData):
3916 * WebProcess/WebPage/WebFrame.cpp:
3917 (WebKit::WebFrame::certificateInfo): Return a WebCore::CertificateInfo instead
3918 of const WebCore::CertificateInfo& to avoid returning a dangling reference to
3919 a local variable. Also, remove the unnecessary calls to std::move() as the compiler
3920 will invoke the move constructor for WebCore::CertificateInfo on return from the
3922 * WebProcess/WebPage/WebFrame.h:
3924 2014-07-01 Anders Carlsson <andersca@apple.com>
3926 Add a BackForwardListItemState struct and put the snapshot UUID there
3927 https://bugs.webkit.org/show_bug.cgi?id=134497
3929 Reviewed by Sam Weinig.
3931 * Shared/SessionState.cpp:
3932 (WebKit::PageState::encode):
3933 (WebKit::PageState::decode):
3934 (WebKit::BackForwardListItemState::encode):
3935 (WebKit::BackForwardListItemState::decode):
3936 * Shared/SessionState.h:
3937 * Shared/WebBackForwardListItem.cpp:
3938 (WebKit::WebBackForwardListItem::create):
3939 (WebKit::WebBackForwardListItem::WebBackForwardListItem):
3940 (WebKit::WebBackForwardListItem::backForwardData):
3941 (WebKit::WebBackForwardListItem::setBackForwardData):
3942 (WebKit::WebBackForwardListItem::encode):
3943 * Shared/WebBackForwardListItem.h:
3944 (WebKit::WebBackForwardListItem::setPageState):
3945 (WebKit::WebBackForwardListItem::setOriginalURL):
3946 (WebKit::WebBackForwardListItem::originalURL):
3947 (WebKit::WebBackForwardListItem::setURL):
3948 (WebKit::WebBackForwardListItem::url):
3949 (WebKit::WebBackForwardListItem::setTitle):
3950 (WebKit::WebBackForwardListItem::title):
3951 (WebKit::WebBackForwardListItem::setSnapshotUUID):
3952 (WebKit::WebBackForwardListItem::snapshotUUID):
3953 * UIProcess/WebBackForwardList.cpp:
3954 (WebKit::WebBackForwardList::restoreFromState):
3955 * UIProcess/WebProcessProxy.cpp:
3956 (WebKit::WebProcessProxy::addBackForwardItem):
3957 * UIProcess/mac/LegacySessionStateCoding.cpp:
3958 (WebKit::decodeSessionHistoryEntries):
3960 2014-07-01 Yongjun Zhang <yongjun_zhang@apple.com>
3962 Add encodeInteger and decodeInteger for remote object encoder and decoder.
3963 https://bugs.webkit.org/show_bug.cgi?id=134453
3965 In 64bit system, encodeInteger/decodeInteger is by default mapped into encodeInt64/decodeInt64. For
3966 32bit system, they are mapped to encodeInt32/decodeInt32. However, since we don't have encodeInt32/decodeInt32
3967 implementation in WKRemoteObjectCoder, we could hit crash in 32bit systems.
3969 Reviewed by Sam Weinig.
3971 * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
3972 (-[WKRemoteObjectEncoder encodeInteger:forKey:]): Instead of creating a new number type UInt32, use encodeInt64 for
3974 (-[WKRemoteObjectDecoder decodeIntegerForKey:]):
3976 2014-06-30 Anders Carlsson <andersca@apple.com>
3978 Use an std::function for filtering session state data
3979 https://bugs.webkit.org/show_bug.cgi?id=134481
3981 Reviewed by Sam Weinig.
3983 * UIProcess/API/C/WKPage.cpp:
3984 (WKPageCopySessionState):
3985 * UIProcess/API/Cocoa/WKWebView.mm:
3986 (-[WKWebView _sessionState]):
3987 * UIProcess/WebBackForwardList.h:
3988 * UIProcess/WebPageProxy.cpp:
3989 (WebKit::WebPageProxy::sessionStateData):
3990 * UIProcess/WebPageProxy.h:
3991 * UIProcess/cf/WebBackForwardListCF.cpp:
3992 (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
3993 * UIProcess/cf/WebPageProxyCF.cpp:
3994 (WebKit::WebPageProxy::sessionStateData):
3996 2014-07-01 Rohit Kumar <kumar.rohit@samsung.com>
3998 Clean up the WebKit build from unused parameter warning in Webkit2/UIProcess module
3999 https://bugs.webkit.org/show_bug.cgi?id=134294
4001 Reviewed by Darin Adler.
4003 * UIProcess/API/APIUIClient.h:
4004 (API::UIClient::reachedApplicationCacheOriginQuota):
4006 2014-07-01 Brady Eidson <beidson@apple.com>
4008 Followup for: Combine the Telephone and Selection overlay controllers, updating UI behavior.
4009 https://bugs.webkit.org/show_bug.cgi?id=134461
4011 Rubberstamped by Tim Horton.
4013 * WebProcess/WebPage/mac/ServicesOverlayController.mm: Include the correct constant.
4015 2014-07-01 Brady Eidson <beidson@apple.com>
4019 Forgot to commit locally before pushing.
4021 * WebProcess/WebPage/WebPage.cpp:
4022 (WebKit::WebPage::servicesOverlayController): s/this/*this/
4024 2014-07-01 Brady Eidson <beidson@apple.com>
4026 Combine the Telephone and Selection overlay controllers, updating UI behavior.
4027 https://bugs.webkit.org/show_bug.cgi?id=134461
4029 Reviewed by Tim Horton.
4031 * WebKit2.xcodeproj/project.pbxproj:
4033 * WebProcess/WebCoreSupport/WebEditorClient.cpp:
4034 (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged):
4035 (WebKit::WebEditorClient::selectionRectsDidChange):
4037 Remove the separate Selection overlay controller:
4038 * WebProcess/WebPage/SelectionOverlayController.cpp: Removed.
4039 * WebProcess/WebPage/ServicesOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/SelectionOverlayController.h.
4040 (WebKit::ServicesOverlayController::create):
4041 * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: Removed.
4043 Remove the separate TelephoneNumber overlay controller:
4044 * WebProcess/WebPage/TelephoneNumberOverlayController.cpp: Removed.
4045 * WebProcess/WebPage/TelephoneNumberOverlayController.h: Removed.
4046 * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: Removed.