Source/WebKit/mac: [WK2] Calling Notification.requestPermission() without a callback crashes
https://bugs.webkit.org/show_bug.cgi?id=118654
<rdar://problem/14293352>

Reviewed by Alexey Proskuryakov.

* WebCoreSupport/WebNotificationClient.mm:
(-[WebNotificationPolicyListener initWithCallback:]): The callback can be NULL, so remove the ASSERT.
(-[WebNotificationPolicyListener allow]): Check for the callback before asking it to handle the event.
(-[WebNotificationPolicyListener deny]): Ditto.

Source/WebKit2: Calling Notification.requestPermission() without a callback crashes
https://bugs.webkit.org/show_bug.cgi?id=118654
<rdar://problem/14293352>

Reviewed by Alexey Proskuryakov.

When requestPermission() is called, we short-circuit if we know the permission was already set.
The callback handler gets invoked. But now that callbacks are optional, we need to check to make
sure a callback was provided.

* WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
(WebKit::NotificationPermissionRequestManager::startRequest): Check for the callback.

LayoutTests: [WK2] Calling Notification.requestPermission() without a callback crashes
https://bugs.webkit.org/show_bug.cgi?id=118654
<rdar://problem/14293352>

Reviewed by Alexey Proskuryakov.

* http/tests/notifications/notification-request-permission-expected.txt:
* http/tests/notifications/notification-request-permission.html: Add additional subtests that check
that the call succeeds even after granting or denying permission.

* http/tests/notifications/notification-request-permission-no-callback-expected.txt: Added.
* http/tests/notifications/notification-request-permission-no-callback.html: Added. Similar test to
notification-request-permission, without the callback function.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CoordinatedGraphics] Crash at CoordinatedGraphicsScene::updateImageBacking
https://bugs.webkit.org/show_bug.cgi?id=118613

The operations of creating/removing/updating/clearing weren't in the
right sequence. Changing the order solves the issue because when an image is
replaced the old one is deleted before the new one is created, and IDs are
not unique in cairo (they're based on the image pointer).

Reviewed by Noam Rosenthal.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
(WebCore::CoordinatedGraphicsScene::syncImageBackings):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Curl] Download does not replace existing file.
https://bugs.webkit.org/show_bug.cgi?id=118356

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-07-15
Reviewed by Brent Fulgham.

If the download target file already exists, it is not replaced after the download has finished.
At this point, the user would have already approved to replace the file, so it should be replaced.

* platform/network/curl/CurlDownload.cpp:
(CurlDownload::moveFileToDestination): Move file and replace it if it already exists.
If the new file is on a different volume, do a copy/delete operation.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152649 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Properly handle style text changes while the color popover is open.

https://bugs.webkit.org/show_bug.cgi?id=118575

Reviewed by Joseph Pecoraro.

* UserInterface/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.prototype._colorSwatchClicked.updateCodeMirror):
The original text marker might have been cleared by a style update, in this case we need to
find the new color text marker so we know the right range for the new style color text.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152651 268f45cc-cd09-0410-ab3c-d52691b4dbfc