Index: src/wp-includes/class-wp-editor.php
===================================================================
--- src/wp-includes/class-wp-editor.php	(revision 27584)
+++ src/wp-includes/class-wp-editor.php	(working copy)
@@ -333,6 +333,7 @@
 					'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform',
 
 					'wpeditimage_disable_captions' => $no_captions,
+					'wpeditimage_html5_captions' => current_theme_supports( 'html5', 'caption' ),
 					'plugins' => implode( ',', $plugins ),
 				);
 
Index: src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
===================================================================
--- src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js	(revision 27584)
+++ src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js	(working copy)
@@ -2,7 +2,7 @@
 tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
 	function parseShortcode( content ) {
 		return content.replace( /(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g, function( a, b, c ) {
-			var id, cls, w, cap, img, width,
+			var id, cls, w, cap, img, width, style,
 				trim = tinymce.trim;
 
 			id = b.match( /id=['"]([^'"]*)['"] ?/ );
@@ -47,9 +47,14 @@
 				return c;
 			}
 
-			width = parseInt( w, 10 ) + 10;
+			if ( editor.getParam( 'wpeditimage_html5_captions' ) ) {
+				style = '';
+			} else {
+				width = parseInt( w, 10 ) + 10;
+				style = ' style="width: '+ width +'px"';
+			}
 
-			return '<div class="mceTemp"><dl id="'+ id +'" class="wp-caption '+ cls +'" style="width: '+ width +'px">' +
+			return '<div class="mceTemp"><dl id="'+ id +'" class="wp-caption '+ cls +'"'+ style +'>' +
 				'<dt class="wp-caption-dt">'+ img +'</dt><dd class="wp-caption-dd">'+ cap +'</dd></dl></div>';
 		});
 	}
@@ -618,7 +623,6 @@
 
 			// Remove toolbar to avoid an orphaned toolbar when dragging an image to a new location
 			removeToolbar();
-
 		});
 
 		// Prevent IE11 from making dl.wp-caption resizable
Index: src/wp-includes/js/tinymce/skins/wordpress/wp-content.css
===================================================================
--- src/wp-includes/js/tinymce/skins/wordpress/wp-content.css	(revision 27584)
+++ src/wp-includes/js/tinymce/skins/wordpress/wp-content.css	(working copy)
@@ -66,6 +66,17 @@
 	margin: 0;
 }
 
+/* HTML5 captions */
+.wp-caption:not([style]) {
+	padding: 4px;
+}
+.wp-caption.aligncenter:not([style]) {
+	display: table;
+}
+.wp-caption.alignnone:not([style]) {
+	display: inline-block;
+}
+
 pre {
 	font: 12px/18px Consolas, Monaco, monospace;
 }
Index: src/wp-includes/media.php
===================================================================
--- src/wp-includes/media.php	(revision 27584)
+++ src/wp-includes/media.php	(working copy)
@@ -765,6 +765,13 @@
 	if ( ! empty( $atts['id'] ) )
 		$atts['id'] = 'id="' . esc_attr( $atts['id'] ) . '" ';
 
+	$class = trim( 'wp-caption ' . $atts['align'] . ' ' . $atts['class'] );
+
+	if ( current_theme_supports( 'html5', 'caption' ) ) {
+		return '<figure ' . $atts['id'] . 'class="' . esc_attr( $class ) . '">'
+		. do_shortcode( $content ) . '<figcaption class="wp-caption-text">' . $atts['caption'] . '</figcaption></figure>';
+	}
+
 	$caption_width = 10 + $atts['width'];
 
 	/**
@@ -788,8 +795,6 @@
 	if ( $caption_width )
 		$style = 'style="width: ' . (int) $caption_width . 'px" ';
 
-	$class = trim( 'wp-caption ' . $atts['align'] . ' ' . $atts['class'] );
-
 	return '<div ' . $atts['id'] . $style . 'class="' . esc_attr( $class ) . '">'
 	. do_shortcode( $content ) . '<p class="wp-caption-text">' . $atts['caption'] . '</p></div>';
 }
