Index: src/wp-includes/kses.php
===================================================================
--- src/wp-includes/kses.php	(revision 40901)
+++ src/wp-includes/kses.php	(working copy)
@@ -239,6 +239,7 @@
 			'longdesc' => true,
 			'vspace' => true,
 			'src' => true,
+			'srcset' => true,
 			'usemap' => true,
 			'width' => true,
 		),
@@ -276,6 +277,7 @@
 			'lang' => true,
 			'xml:lang' => true,
 		),
+		'picture' => array(),
 		'pre' => array(
 			'width' => true,
 		),
@@ -297,6 +299,12 @@
 			'xml:lang' => true,
 		),
 		'small' => array(),
+		'source' => array(
+			'srcset' => true,
+			'type' => true,
+			'media' => true,
+			'sizes' => true,
+		),
 		'strike' => array(),
 		'strong' => array(),
 		'sub' => array(),
@@ -918,7 +926,7 @@
 	$attrarr = array();
 	$mode = 0;
 	$attrname = '';
-	$uris = array('xmlns', 'profile', 'href', 'src', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action');
+	$uris = array('xmlns', 'profile', 'href', 'src', 'srcset', 'sizes', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action');
 
 	// Loop through the whole attribute list
 
Index: tests/phpunit/tests/kses.php
===================================================================
--- tests/phpunit/tests/kses.php	(revision 40901)
+++ tests/phpunit/tests/kses.php	(working copy)
@@ -75,9 +75,62 @@
 		}
 	}
 
-	function test_feed_links() {
+	/**
+	 * @ticket 29807
+	 */
+	function test_wp_filter_post_kses_img() {
+		global $allowedposttags;
+
+		$attributes = array(
+			'class' => 'classname',
+			'id' => 'idattr',
+			'style' => 'color: red;',
+			'alt' => 'alt',
+			'src' => '/test.png',
+			'srcset' => '/test.png 2x',
+			'width' => '100',
+			'height' => '100',
+			'usemap' => '#hash',
+			'vspace' => '20',
+			'hspace' => '20',
+			'longdesc' => 'this is the longdesc',
+			'align' => 'middle',
+			'border' => '5',
+		);
+
+		foreach ( $attributes as $name => $value ) {
+			if ( $name === $value ) {
+				$string = "<img $value />";
+				$expect_string = "<img " . trim( $value, ';' ) . " />";
+			} else {
+				$string = "<img $name='$value' />";
+				$expect_string = "<img $name='" . trim( $value, ';' ) . "' />";
+			}
+
+			$this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) );
+		}
+	}
+
+	/**
+	 * @ticket 29807
+	 */
+	function test_wp_filter_post_kses_picture() {
 		global $allowedposttags;
 
+		$html = '<picture><source srcset="pear-mobile.jpeg" media="(max-width: 720px)" type="image/png"><source srcset="pear-tablet.jpeg" media="(max-width: 1280px)" type="image/png"><img src="pear-desktop.jpeg" alt="The pear is juicy."></picture>';
+		$this->assertEquals( $html, wp_kses( $html, $allowedposttags ) );
+
+		$html = '<picture><source srcset="https://wordpress.org/pear-mobile.jpeg" media="(max-width: 720px)" type="image/png"><source srcset="https://wordpress.org/pear-tablet.jpeg 500w, https://wordpress.org/pear-tablet.jpeg" media="(max-width: 1280px)" type="image/png"><img src="pear-desktop.jpeg" alt="The pear is juicy."></picture>';
+		$this->assertEquals( $html, wp_kses( $html, $allowedposttags ) );
+
+		// Test bad protocol in srcset
+		$original = '<picture><source srcset="bad://pear-mobile.jpeg" media="(max-width: 720px)" type="image/png"><source srcset="pear-tablet.jpeg" media="(max-width: 1280px)" type="image/png"><img src="pear-desktop.jpeg" alt="The pear is juicy."></picture>';
+		$expected = '<picture><source srcset="//pear-mobile.jpeg" media="(max-width: 720px)" type="image/png"><source srcset="pear-tablet.jpeg" media="(max-width: 1280px)" type="image/png"><img src="pear-desktop.jpeg" alt="The pear is juicy."></picture>';
+		$this->assertEquals( $expected, wp_kses( $original, $allowedposttags ) );
+	}
+
+	function test_feed_links() {
+		global $allowedposttags;
 		$content = <<<EOF
 <a href="feed:javascript:alert(1)">CLICK ME</a>
 <a href="feed:javascript:feed:alert(1)">CLICK ME</a>
