Some badges, such as Deputy, Marshall, and Reviewer (and less directly) Strunk & White and Copy Editor, involve acting on posts that have a potential to be deleted as a result of the actions being taken (vote to close could lead to a post being closed with eventual deletion, flagging can result in closure/deletion/migration). Editing doesn't directly lead to this, but if a post needs to be edited there's a chance it is poor quality anyway and may end up being deleted (I'm not saying this is likely, just possible).
If a post is deleted, are any of these actions lost? I'm pretty sure flags stay (my flag history shows some flags where the post has been deleted), but what about edits? If an answer is edited, then the question is deleted (thereby deleting the answer), does the edit still count toward S&W/Copy Editor/Reviewer? Does a vote on it still count towards Civic Duty and Electorate?
Example:
Here on Meta, there have been a lot of questions lately that should be asked on StackOverflow (not here), being asked by anonymous users. This tend to attract downvotes, flags, and close votes, getting closed almost instantaneously and deleted within a few minutes (here is one example that has not yet been deleted).
Do votes and flags on these posts count towards these badges on meta? What about edits (if someone bothered to actually edit one of these before it got deleted)? I know the votes don't affect reputation once they're gone, but are they still counted towards badges?
However, if the criteria for a badge no longer exist, e.g. the post it was awarded for is deleted, ...