Index: src/wp-admin/includes/post.php
===================================================================
--- src/wp-admin/includes/post.php	(revision 31141)
+++ src/wp-admin/includes/post.php	(working copy)
@@ -1574,13 +1574,13 @@
 		}
 
 		/**
-		 * Fires before an autosave is stored.
+		 * Fires before an autosave is updated.
 		 *
 		 * @since 4.1.0
 		 *
 		 * @param array $new_autosave Post array - the autosave that is about to be saved.
 		 */
-		do_action( 'wp_creating_autosave', $new_autosave );
+		do_action( 'wp_updating_autosave', $new_autosave );
 
 		return wp_update_post( $new_autosave );
 	}
@@ -1588,6 +1588,15 @@
 	// _wp_put_post_revision() expects unescaped.
 	$post_data = wp_unslash( $post_data );
 
+	/**
+	 * Fires before an autosave is created.
+	 *
+	 * @since 4.2.0
+	 *
+	 * @param array $new_autosave Post array - the autosave that is about to be saved.
+	 */
+	do_action( 'wp_creating_autosave', $post_data );
+
 	// Otherwise create the new autosave as a special post revision
 	return _wp_put_post_revision( $post_data, true );
 }
Index: src/wp-admin/post.php
===================================================================
--- src/wp-admin/post.php	(revision 31141)
+++ src/wp-admin/post.php	(working copy)
@@ -84,8 +84,15 @@
 
 if ( isset( $_POST['deletepost'] ) )
 	$action = 'delete';
-elseif ( isset($_POST['wp-preview']) && 'dopreview' == $_POST['wp-preview'] )
+elseif ( isset( $_POST['wp-preview'] ) && 'dopreview' == $_POST['wp-preview'] ) {
 	$action = 'preview';
+	/**
+	 * Set DOING_PREVIEW during previews.
+	 */
+	if ( ! defined( 'DOING_PREVIEW' ) ) {
+		define( 'DOING_PREVIEW', true );
+	}
+}
 
 $sendback = wp_get_referer();
 if ( ! $sendback ||
Index: src/wp-includes/js/autosave.js
===================================================================
--- src/wp-includes/js/autosave.js	(revision 31141)
+++ src/wp-includes/js/autosave.js	(working copy)
@@ -37,6 +37,17 @@
 				excerpt: $( '#excerpt' ).val() || ''
 			};
 
+			/**
+			 * Attach revisioned meta field values to the autosave data.
+			 *
+			 * Iterates thru the revisioned meta fields, searhing the DOM for elements
+			 * with matching ID, then storing the value as data[ID]. Enables inclusion
+			 * of the revisioned post meta data as part of the autosave.
+			 */
+			$( autosaveL10n.revisionedMetas ).each( function( index, meta ) {
+				data[meta] = $( document.getElementById( meta ) ).val() || '';
+			} );
+
 			if ( type === 'local' ) {
 				return data;
 			}
Index: src/wp-includes/revision.php
===================================================================
--- src/wp-includes/revision.php	(revision 31141)
+++ src/wp-includes/revision.php	(working copy)
@@ -505,6 +505,10 @@
 	$post->post_excerpt = $preview->post_excerpt;
 
 	add_filter( 'get_the_terms', '_wp_preview_terms_filter', 10, 3 );
+	/**
+	 * When doing a preview, use the autosaved revisioned post meta.
+	 */
+	add_filter( 'get_post_metadata', array( WP_Post_Meta_Revisioning, '_wp_preview_meta_filter' ), 10, 4 );
 
 	return $post;
 }
Index: src/wp-includes/script-loader.php
===================================================================
--- src/wp-includes/script-loader.php	(revision 31141)
+++ src/wp-includes/script-loader.php	(working copy)
@@ -702,9 +702,16 @@
  */
 function wp_just_in_time_script_localization() {
 
+	/**
+	 * Pass some data to the autosave JavaScript:
+	 * 	int   autosaveL10n.autosaveInterval How frequently to autosave.
+	 * 	int   autosaveL10n.blog_id          The current blog ID.
+	 * 	array autosaveL10n.revisionedMetas  The revisioned meta keys.
+	 */
 	wp_localize_script( 'autosave', 'autosaveL10n', array(
 		'autosaveInterval' => AUTOSAVE_INTERVAL,
 		'blog_id' => get_current_blog_id(),
+		'revisionedMetas' => WP_Post_Meta_Revisioning::_wp_post_revision_meta_keys(),
 	) );
 
 }
Index: tests/phpunit/tests/post/revisions.php
===================================================================
--- tests/phpunit/tests/post/revisions.php	(revision 31141)
+++ tests/phpunit/tests/post/revisions.php	(working copy)
@@ -1,5 +1,6 @@
 <?php
 
+require( 'src/wp-content/plugins/wp-post-meta-revisions/wp-post-meta-revisions.php' );
 /**
  * @group post
  * @group revision
@@ -399,4 +400,69 @@
 
 		$this->assertEquals( $revision_ids, array_values( wp_list_pluck( $revisions, 'ID' ) ) );
 	}
+
+	/**
+	 * Preview changes on a published post makes all post meta "live"
+	 * @ticket 20299
+	 */
+	function test_meta_stored_to_preview_autosave(){
+
+		/**
+		 * Set up a user for autosaves.
+		 */
+		$editor_user_id = $this->factory->user->create( array( 'role' => 'editor' ) );
+		$user = new WP_User( $editor_user_id );
+		wp_set_current_user( $editor_user_id );
+		$postd = array(
+			'post_author'  => $editor_user_id,
+			'post_content' => 'the content',
+			'post_title'   => 'the title',
+			'post_status'  => 'publish',
+		);
+		/**
+		 * Insert a test post.
+		 */
+		$post_id = wp_insert_post( $postd );
+
+		/**
+		 * Add some post meta.
+		 */
+		update_post_meta( $post_id, 'publish_meta_test', 'original' );
+
+		/**
+		 * Revision the 'publish_meta_test' meta.
+		 */
+		add_filter( 'wp_post_revision_meta_keys', function( $keys ) {
+			$keys[] = 'publish_meta_test';
+			return $keys;
+		} );
+
+		/**
+		 * Set up $_POST for autosave.
+		 */
+		$_POST['post_ID']           = $post_id;
+		$_POST['post_type']         = 'post';
+		$_POST['post_title']        = 'new title';
+		$_POST['publish_meta_test'] = 'new_value';
+
+		/**
+		 * Create an autosave
+		 */
+		$id = wp_create_post_autosave( $post_id );
+
+		/**
+		 * Verify the new meta value was autosaved.
+		 */
+		$revisioned_meta = get_post_meta( $id, 'publish_meta_test', true );
+		$this->assertEquals( $revisioned_meta[0], 'new_value' );
+
+		/**
+		 * Clean up.
+		 */
+		wp_delete_post( $post_id );
+		wp_delete_post( $id );
+		wp_delete_post( $post_id );
+	}
+
+
 }
