From 4b898888a6b129cf3b4e5327a3af0db7bf9b7580 Mon Sep 17 00:00:00 2001
From: Tammie <karmatosed@git.wordpress.org>
Date: Thu, 10 Mar 2016 21:12:25 +0000
Subject: [PATCH] Twenty Elevent: Captioned image fix for editor Fixes #33153
 Props: @iseulde

git-svn-id: https://develop.svn.wordpress.org/trunk@36957 602fd350-edb4-49c9-b593-d223f7449a82
---
 .../themes/twentyeleven/editor-style.css      | 47 +++++++------------
 src/wp-content/themes/twentyeleven/style.css  |  4 +-
 2 files changed, 21 insertions(+), 30 deletions(-)

diff --git a/src/wp-content/themes/twentyeleven/editor-style.css b/src/wp-content/themes/twentyeleven/editor-style.css
index 234bb9c216..77342bf691 100644
--- a/src/wp-content/themes/twentyeleven/editor-style.css
+++ b/src/wp-content/themes/twentyeleven/editor-style.css
@@ -3,21 +3,12 @@ Theme Name: Twenty Eleven
 Description: Used to style the TinyMCE editor.
 */
 
-html .mceContentBody {
-	max-width: 584px;
-}
-* {
-	color: inherit;
-	font: 15px "Helvetica Neue", Helvetica, Arial, sans-serif;
-	font-style: inherit;
-	font-weight: inherit;
-	line-height: 1.625;
-}
 body {
 	color: #333;
 	font: 15px "Helvetica Neue", Helvetica, Arial, "Nimbus Sans L", sans-serif;
 	font-weight: 300;
 	line-height: 1.625;
+	max-width: 584px;
 }
 
 /* Headings */
@@ -237,10 +228,6 @@ td {
 }
 
 /* Images */
-img[class*="wp-image-"] {
-	height: auto;
-	max-width: 97.5%;
-}
 img.size-full {
 	width: auto; /* Prevent stretching of full-size images in IE8 */
 }
@@ -254,10 +241,12 @@ p img,
 .wp-caption {
 	margin-top: 0.4em;
 }
-img,
-.editor-attachment {
+img {
 	border: 1px solid #ddd;
 	padding: 6px;
+	height: auto;
+	max-width: 97.5%;
+	max-width: calc( 100% - 14px );
 }
 img.alignleft,
 img.alignright,
@@ -269,25 +258,25 @@ img.aligncenter {
 	border: none;
 	margin-bottom: 1.625em;
 	max-width: 96%;
-	padding: 9px;
+	max-width: calc( 100% - 22px );
+	padding: 9px 11px;
 }
 .wp-caption img {
 	display: block;
-	margin: 5px auto 0 !important;
+	margin: 0 -2px;
 	max-width: 98%;
+	max-width: calc( 100% - 10px );
 	border-color: #eee;
 }
-.wp-caption .wp-caption-text,
-.wp-caption-dd {
+.wp-caption .wp-caption-dd {
 	color: #666;
-	font-family: Georgia, serif !important;
+	font-family: Georgia, serif;
 	font-size: 12px;
-	margin: 0 0 0.6em 0 !important;
-	padding: 0 0 5px 40px;
+	margin-bottom: 0.6em;
+	padding: 10px 0 5px 40px;
 	position: relative;
-	text-align: left;
 }
-.wp-caption .wp-caption-text:before {
+.wp-caption .wp-caption-dd:before {
 	color: #666;
 	content: '\2014';
 	font-size: 14px;
@@ -298,9 +287,9 @@ img.aligncenter {
 	left: 10px;
 	top: 7px;
 }
-a:focus img[class*="wp-image-"],
-a:hover img[class*="wp-image-"],
-a:active img[class*="wp-image-"] {
+a:focus img,
+a:hover img,
+a:active img {
 	background: #eee;
 	border-color: #bbb;
 }
@@ -309,4 +298,4 @@ a:active img[class*="wp-image-"] {
 .wp-caption a:hover img {
 	background: #fff;
 	border-color: #ddd;
-}
\ No newline at end of file
+}
diff --git a/src/wp-content/themes/twentyeleven/style.css b/src/wp-content/themes/twentyeleven/style.css
index b205ddd929..bcf0988401 100644
--- a/src/wp-content/themes/twentyeleven/style.css
+++ b/src/wp-content/themes/twentyeleven/style.css
@@ -910,12 +910,13 @@ p img,
 	background: #eee;
 	margin-bottom: 1.625em;
 	max-width: 96%;
+	max-width: calc( 100% - 18px );
 	padding: 9px;
 }
 .wp-caption img {
 	display: block;
-	margin: -2px 0 0 -2px;
 	max-width: 98%;
+	max-width: calc( 100% - 14px );
 }
 .wp-caption .wp-caption-text,
 .gallery-caption {
@@ -965,6 +966,7 @@ img[class*="wp-image-"],
 	border: 1px solid #ddd;
 	padding: 6px;
 	max-width: 97.5%;
+	max-width: calc( 100% - 14px );
 }
 .wp-caption img {
 	border-color: #eee;