bookmarks with window.getSelection() deselect the text when before the bookmark selection can happen

Number:rdar://15656950 Date Originated:13-Dec-2013 11:22 AM
Status:Open Resolved:
Product:Safari Product Version:iOS 7.0.4 (11B554A)
Classification:UI/Usability Reproducible:Always
This is a duplicate of rdar://15656765

In iOS6 I could select text, and then open a bookmarklet (like this one for example: which grabbed the text using window.getSelection().
However, it seems in iOS7, any action to invoke a bookmarklet deselects the text.
Steps to Reproduce:
1. Have a bookmarklet which uses window.getSelection()
2. Select Text
3. Try to invoke bookmarlet
Expected Results:
Bookmarklet is invoked, with selected text available in window.getSelection() 
Actual Results:
Bookmarklet is invoked, however selection is removed, and no text is available in window.getSelection().
iOS 7.0.4 (11B554A)
iOS 7, iPhone 5


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!