jquery/jquery — pull request #987 by saiwong (2012-10-16 17:57:28+00:00)
Title: Refactored `before`/`after`/`replaceWith` to not pushStack #12664

Fixed inconsistent and poorly defined functionality for the `before`/`after`/`replaceWith` methods.

- Removed `pushStack` call to those methods to mantain consistency resulting in those methods being purely DOM manipulation
- Made operations on disconnected elements for `before` and `after` to be a no-op since there is no point of reference to insert content before or after an element with no parent!
- Made operations on disconnected elements for `replaceWith` to be an insitu replacement of the element in the set.

Related to #12120, #12503, #11226, #12664