Crash during middle mouse click when page is removed
https://bugs.webkit.org/show_bug.cgi?id=111489

Reviewed by Hajime Morrita.

Source/WebCore:

Check for a null page that can happen if we remove the document from the DOM.
The other methods in EventHandler also check for a null page.

Test: editing/pasteboard/selection-paste-crash.html

* page/EventHandler.cpp:
(WebCore::EventHandler::handlePasteGlobalSelection):

LayoutTests:

* editing/pasteboard/resources/selection-paste-crash.html: Added.
* editing/pasteboard/selection-paste-crash-expected.txt: Added.
* editing/pasteboard/selection-paste-crash.html: Added.


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