Index: src/wp-admin/css/edit.css
===================================================================
--- src/wp-admin/css/edit.css	(revision 28955)
+++ src/wp-admin/css/edit.css	(working copy)
@@ -37,7 +37,6 @@
 
 #titlediv {
 	position: relative;
-	margin-bottom: 10px;
 }
 
 #titlediv label {
@@ -337,7 +336,7 @@
 	background-color: #f7f7f7;
 	-webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04);
 	box-shadow: 0 1px 1px rgba(0,0,0,0.04);
-	cursor: row-resize;
+	z-index: 999;
 }
 
 #post-status-info td {
@@ -345,7 +344,7 @@
 }
 
 .autosave-info {
-	padding: 2px;
+	padding: 2px 10px;
 	text-align: right;
 }
 
@@ -353,18 +352,25 @@
 	border: none;
 }
 
-#content-resize-handle {
-	background: transparent url(../images/resize.gif) no-repeat scroll right bottom;
-	width: 12px;
+#wp-word-count {
+	display: block;
+	padding: 2px 10px;
 }
 
-.rtl #content-resize-handle {
-	background: transparent url(../images/resize-rtl.gif) no-repeat scroll left bottom;
+#wp-content-editor-container {
+	position: relative;
 }
 
-#wp-word-count {
-	display: block;
-	padding: 2px 10px;
+#content {
+	resize: none;
+}
+
+#content-clone {
+	z-index: -1;
+	position: absolute;
+	top: 0;
+	visibility: hidden;
+	overflow: hidden;
 }
 
 #timestampdiv select {
@@ -1141,26 +1147,6 @@
 /* =Media Queries
 -------------------------------------------------------------- */
 
-/**
- * HiDPI Displays
- */
-@media print,
-  (-o-min-device-pixel-ratio: 5/4),
-  (-webkit-min-device-pixel-ratio: 1.25),
-  (min-resolution: 120dpi) {
-	#content-resize-handle,
-	#post-body .wp_themeSkin .mceStatusbar a.mceResize {
-		background: transparent url(../images/resize-2x.gif) no-repeat scroll right bottom;
-		-webkit-background-size: 11px 11px;
-		background-size: 11px 11px;
-	}
-
-	.rtl #content-resize-handle,
-	.rtl #post-body .wp_themeSkin .mceStatusbar a.mceResize {
-		background: transparent url(../images/resize-rtl-2x.gif) no-repeat scroll right bottom;
-	}
-}
-
 /* one column on the post write/edit screen */
 @media only screen and (max-width: 850px) {
 	#poststuff {
Index: src/wp-admin/css/press-this.css
===================================================================
--- src/wp-admin/css/press-this.css	(revision 28955)
+++ src/wp-admin/css/press-this.css	(working copy)
@@ -15,10 +15,6 @@
 	color: #333;
 }
 
-.press-this #content-resize-handle {
-	bottom: 2px;
-}
-
 body.press-this {
 	color: #333;
 	margin: 0;
Index: src/wp-admin/edit-form-advanced.php
===================================================================
--- src/wp-admin/edit-form-advanced.php	(revision 28955)
+++ src/wp-admin/edit-form-advanced.php	(working copy)
@@ -489,7 +489,6 @@
 	'dfw' => true,
 	'drag_drop_upload' => true,
 	'tabfocus_elements' => 'insert-media-button-1,save-post',
-	'editor_height' => 360,
 	'tinymce' => array(
 		'resize' => false,
 		'add_unload_trigger' => false,
@@ -510,7 +509,6 @@
 		echo '</span>';
 	} ?>
 	</td>
-	<td id="content-resize-handle" class="hide-if-no-js"><br /></td>
 </tr></tbody></table>
 
 </div>
Index: src/wp-admin/js/common.js
===================================================================
--- src/wp-admin/js/common.js	(revision 28955)
+++ src/wp-admin/js/common.js	(working copy)
@@ -210,6 +210,8 @@
 				setUserSetting('mfold', 'f');
 			}
 		}
+
+		$( wp ).trigger( 'menu:collapse' );
 	});
 
 	if ( 'ontouchstart' in window || /IEMobile\/[1-9]/.test(navigator.userAgent) ) { // touch screen device
@@ -721,7 +723,7 @@
 	window.wpResponsive.init();
 });
 
-// make Windows 8 devices playing along nicely
+// Make Windows 8 devices play along nicely.
 (function(){
 	if ( '-ms-user-select' in document.documentElement.style && navigator.userAgent.match(/IEMobile\/10\.0/) ) {
 		var msViewportStyle = document.createElement( 'style' );
Index: src/wp-admin/js/editor.js
===================================================================
--- src/wp-admin/js/editor.js	(revision 28955)
+++ src/wp-admin/js/editor.js	(working copy)
@@ -1,315 +1,683 @@
-/* global tinymce, tinyMCEPreInit, QTags, setUserSetting */
+/* global tinymce, tinyMCEPreInit, QTags, setUserSetting, console */
 
-window.switchEditors = {
-
-	switchto: function( el ) {
-		var aid = el.id,
-			l = aid.length,
-			id = aid.substr( 0, l - 5 ),
-			mode = aid.substr( l - 4 );
-
-		this.go( id, mode );
-	},
-
-	// mode can be 'html', 'tmce', or 'toggle'; 'html' is used for the 'Text' editor tab.
-	go: function( id, mode ) {
-		var t = this, ed, wrap_id, txtarea_el, iframe, editorHeight, toolbarHeight,
-			DOM = tinymce.DOM; //DOMUtils outside the editor iframe
-
-		id = id || 'content';
-		mode = mode || 'toggle';
-
-		ed = tinymce.get( id );
-		wrap_id = 'wp-' + id + '-wrap';
-		txtarea_el = DOM.get( id );
-
-		if ( 'toggle' === mode ) {
-			if ( ed && ! ed.isHidden() ) {
-				mode = 'html';
-			} else {
-				mode = 'tmce';
+( function( $ ) {
+	'use strict';
+	
+	window.wp = wp || {};
+	wp.editor = wp.editor || {};
+
+	wp.editor.mode = {
+		switchto: function( el ) {
+			var aid = el.id,
+				l = aid.length,
+				id = aid.substr( 0, l - 5 ),
+				mode = aid.substr( l - 4 );
+	
+			this.go( id, mode );
+		},
+	
+		// mode can be 'html', 'tmce', or 'toggle'; 'html' is used for the 'Text' editor tab.
+		go: function( id, mode ) {
+			var t = this, ed, wrap_id, txtarea_el, iframe, editorHeight, toolbarHeight,
+				DOM = tinymce.DOM; //DOMUtils outside the editor iframe
+	
+			id = id || 'content';
+			mode = mode || 'toggle';
+	
+			ed = tinymce.get( id );
+			wrap_id = 'wp-' + id + '-wrap';
+			txtarea_el = DOM.get( id );
+	
+			if ( 'toggle' === mode ) {
+				if ( ed && ! ed.isHidden() ) {
+					mode = 'html';
+				} else {
+					mode = 'tmce';
+				}
 			}
-		}
-
-		function getToolbarHeight() {
-			var node = DOM.select( '.mce-toolbar-grp', ed.getContainer() )[0],
-				height = node && node.clientHeight;
-
-			if ( height && height > 10 && height < 200 ) {
-				return parseInt( height, 10 );
+	
+			function getToolbarHeight() {
+				var node = DOM.select( '.mce-toolbar-grp', ed.getContainer() )[0],
+					height = node && node.clientHeight;
+	
+				if ( height && height > 10 && height < 200 ) {
+					return parseInt( height, 10 );
+				}
+	
+				return 30;
 			}
-
-			return 30;
-		}
-
-		if ( 'tmce' === mode || 'tinymce' === mode ) {
-			if ( ed && ! ed.isHidden() ) {
-				return false;
+	
+			if ( 'tmce' === mode || 'tinymce' === mode ) {
+				if ( ed && ! ed.isHidden() ) {
+					return false;
+				}
+	
+				if ( typeof( QTags ) !== 'undefined' ) {
+					QTags.closeAllTags( id );
+				}
+	
+				editorHeight = txtarea_el ? parseInt( txtarea_el.style.height, 10 ) : 0;
+	
+				if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id ].wpautop ) {
+					txtarea_el.value = t.wpautop( txtarea_el.value );
+				}
+	
+				if ( ed ) {
+					ed.show();
+	
+					// No point resizing the iframe in iOS
+					if ( ! tinymce.Env.iOS && editorHeight ) {
+						toolbarHeight = getToolbarHeight();
+						editorHeight = editorHeight - toolbarHeight + 14;
+	
+						// height cannot be under 50 or over 5000
+						if ( editorHeight > 50 && editorHeight < 5000 ) {
+							ed.theme.resizeTo( null, editorHeight );
+						}
+					}
+				} else {
+					tinymce.init( tinyMCEPreInit.mceInit[id] );
+				}
+	
+				DOM.removeClass( wrap_id, 'html-active' );
+				DOM.addClass( wrap_id, 'tmce-active' );
+				setUserSetting( 'editor', 'tinymce' );
+	
+			} else if ( 'html' === mode ) {
+	
+				if ( ed && ed.isHidden() ) {
+					return false;
+				}
+	
+				if ( ed ) {
+					if ( ! tinymce.Env.iOS ) {
+						iframe = DOM.get( id + '_ifr' );
+						editorHeight = iframe ? parseInt( iframe.style.height, 10 ) : 0;
+	
+						if ( editorHeight ) {
+							toolbarHeight = getToolbarHeight();
+							editorHeight = editorHeight + toolbarHeight - 14;
+	
+							// height cannot be under 50 or over 5000
+							if ( editorHeight > 50 && editorHeight < 5000 ) {
+								txtarea_el.style.height = editorHeight + 'px';
+							}
+						}
+					}
+	
+					ed.hide();
+				} else {
+					// The TinyMCE instance doesn't exist, run the content through 'pre_wpautop()' and show the textarea
+					if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id ].wpautop ) {
+						txtarea_el.value = t.pre_wpautop( txtarea_el.value );
+					}
+	
+					DOM.setStyles( txtarea_el, {'display': '', 'visibility': ''} );
+				}
+	
+				DOM.removeClass( wrap_id, 'tmce-active' );
+				DOM.addClass( wrap_id, 'html-active' );
+				setUserSetting( 'editor', 'html' );
 			}
-
-			if ( typeof( QTags ) !== 'undefined' ) {
-				QTags.closeAllTags( id );
+			return false;
+		},
+	
+		_wp_Nop: function( content ) {
+			var blocklist1, blocklist2,
+				preserve_linebreaks = false,
+				preserve_br = false;
+	
+			// Protect pre|script tags
+			if ( content.indexOf( '<pre' ) !== -1 || content.indexOf( '<script' ) !== -1 ) {
+				preserve_linebreaks = true;
+				content = content.replace( /<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function( a ) {
+					a = a.replace( /<br ?\/?>(\r\n|\n)?/g, '<wp-line-break>' );
+					a = a.replace( /<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-line-break>' );
+					return a.replace( /\r?\n/g, '<wp-line-break>' );
+				});
 			}
-
-			editorHeight = txtarea_el ? parseInt( txtarea_el.style.height, 10 ) : 0;
-
-			if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id ].wpautop ) {
-				txtarea_el.value = t.wpautop( txtarea_el.value );
+	
+			// keep <br> tags inside captions and remove line breaks
+			if ( content.indexOf( '[caption' ) !== -1 ) {
+				preserve_br = true;
+				content = content.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) {
+					return a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' ).replace( /[\r\n\t]+/, '' );
+				});
 			}
-
-			if ( ed ) {
-				ed.show();
-
-				// No point resizing the iframe in iOS
-				if ( ! tinymce.Env.iOS && editorHeight ) {
-					toolbarHeight = getToolbarHeight();
-					editorHeight = editorHeight - toolbarHeight + 14;
-
-					// height cannot be under 50 or over 5000
-					if ( editorHeight > 50 && editorHeight < 5000 ) {
-						ed.theme.resizeTo( null, editorHeight );
-					}
+	
+			// Pretty it up for the source editor
+			blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset';
+			content = content.replace( new RegExp( '\\s*</(' + blocklist1 + ')>\\s*', 'g' ), '</$1>\n' );
+			content = content.replace( new RegExp( '\\s*<((?:' + blocklist1 + ')(?: [^>]*)?)>', 'g' ), '\n<$1>' );
+	
+			// Mark </p> if it has any attributes.
+			content = content.replace( /(<p [^>]+>.*?)<\/p>/g, '$1</p#>' );
+	
+			// Separate <div> containing <p>
+			content = content.replace( /<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n' );
+	
+			// Remove <p> and <br />
+			content = content.replace( /\s*<p>/gi, '' );
+			content = content.replace( /\s*<\/p>\s*/gi, '\n\n' );
+			content = content.replace( /\n[\s\u00a0]+\n/g, '\n\n' );
+			content = content.replace( /\s*<br ?\/?>\s*/gi, '\n' );
+	
+			// Fix some block element newline issues
+			content = content.replace( /\s*<div/g, '\n<div' );
+			content = content.replace( /<\/div>\s*/g, '</div>\n' );
+			content = content.replace( /\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n' );
+			content = content.replace( /caption\]\n\n+\[caption/g, 'caption]\n\n[caption' );
+	
+			blocklist2 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset';
+			content = content.replace( new RegExp('\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\s*>', 'g' ), '\n<$1>' );
+			content = content.replace( new RegExp('\\s*</(' + blocklist2 + ')>\\s*', 'g' ), '</$1>\n' );
+			content = content.replace( /<li([^>]*)>/g, '\t<li$1>' );
+	
+			if ( content.indexOf( '<hr' ) !== -1 ) {
+				content = content.replace( /\s*<hr( [^>]*)?>\s*/g, '\n\n<hr$1>\n\n' );
+			}
+	
+			if ( content.indexOf( '<object' ) !== -1 ) {
+				content = content.replace( /<object[\s\S]+?<\/object>/g, function( a ) {
+					return a.replace( /[\r\n]+/g, '' );
+				});
+			}
+	
+			// Unmark special paragraph closing tags
+			content = content.replace( /<\/p#>/g, '</p>\n' );
+			content = content.replace( /\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1' );
+	
+			// Trim whitespace
+			content = content.replace( /^\s+/, '' );
+			content = content.replace( /[\s\u00a0]+$/, '' );
+	
+			// put back the line breaks in pre|script
+			if ( preserve_linebreaks ) {
+				content = content.replace( /<wp-line-break>/g, '\n' );
+			}
+	
+			// and the <br> tags in captions
+			if ( preserve_br ) {
+				content = content.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );
+			}
+	
+			return content;
+		},
+	
+		_wp_Autop: function(pee) {
+			var preserve_linebreaks = false,
+				preserve_br = false,
+				blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre' +
+					'|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section' +
+					'|article|aside|hgroup|header|footer|nav|figure|details|menu|summary';
+	
+			if ( pee.indexOf( '<object' ) !== -1 ) {
+				pee = pee.replace( /<object[\s\S]+?<\/object>/g, function( a ) {
+					return a.replace( /[\r\n]+/g, '' );
+				});
+			}
+	
+			pee = pee.replace( /<[^<>]+>/g, function( a ){
+				return a.replace( /[\r\n]+/g, ' ' );
+			});
+	
+			// Protect pre|script tags
+			if ( pee.indexOf( '<pre' ) !== -1 || pee.indexOf( '<script' ) !== -1 ) {
+				preserve_linebreaks = true;
+				pee = pee.replace( /<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function( a ) {
+					return a.replace( /(\r\n|\n)/g, '<wp-line-break>' );
+				});
+			}
+	
+			// keep <br> tags inside captions and convert line breaks
+			if ( pee.indexOf( '[caption' ) !== -1 ) {
+				preserve_br = true;
+				pee = pee.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) {
+					// keep existing <br>
+					a = a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' );
+					// no line breaks inside HTML tags
+					a = a.replace( /<[a-zA-Z0-9]+( [^<>]+)?>/g, function( b ) {
+						return b.replace( /[\r\n\t]+/, ' ' );
+					});
+					// convert remaining line breaks to <br>
+					return a.replace( /\s*\n\s*/g, '<wp-temp-br />' );
+				});
+			}
+	
+			pee = pee + '\n\n';
+			pee = pee.replace( /<br \/>\s*<br \/>/gi, '\n\n' );
+			pee = pee.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n$1' );
+			pee = pee.replace( new RegExp( '(</(?:' + blocklist + ')>)', 'gi' ), '$1\n\n' );
+			pee = pee.replace( /<hr( [^>]*)?>/gi, '<hr$1>\n\n' ); // hr is self closing block element
+			pee = pee.replace( /\r\n|\r/g, '\n' );
+			pee = pee.replace( /\n\s*\n+/g, '\n\n' );
+			pee = pee.replace( /([\s\S]+?)\n\n/g, '<p>$1</p>\n' );
+			pee = pee.replace( /<p>\s*?<\/p>/gi, '');
+			pee = pee.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), '$1' );
+			pee = pee.replace( /<p>(<li.+?)<\/p>/gi, '$1');
+			pee = pee.replace( /<p>\s*<blockquote([^>]*)>/gi, '<blockquote$1><p>');
+			pee = pee.replace( /<\/blockquote>\s*<\/p>/gi, '</p></blockquote>');
+			pee = pee.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '$1' );
+			pee = pee.replace( new RegExp( '(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), '$1' );
+			pee = pee.replace( /\s*\n/gi, '<br />\n');
+			pee = pee.replace( new RegExp( '(</?(?:' + blocklist + ')[^>]*>)\\s*<br />', 'gi' ), '$1' );
+			pee = pee.replace( /<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi, '$1' );
+			pee = pee.replace( /(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi, '[caption$1[/caption]' );
+	
+			pee = pee.replace( /(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g, function( a, b, c ) {
+				if ( c.match( /<p( [^>]*)?>/ ) ) {
+					return a;
 				}
-			} else {
-				tinymce.init( tinyMCEPreInit.mceInit[id] );
+	
+				return b + '<p>' + c + '</p>';
+			});
+	
+			// put back the line breaks in pre|script
+			if ( preserve_linebreaks ) {
+				pee = pee.replace( /<wp-line-break>/g, '\n' );
 			}
+	
+			if ( preserve_br ) {
+				pee = pee.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );
+			}
+	
+			return pee;
+		},
+	
+		pre_wpautop: function( content ) {
+			var t = this, o = { o: t, data: content, unfiltered: content },
+				q = typeof( jQuery ) !== 'undefined';
+	
+			if ( q ) {
+				jQuery( 'body' ).trigger( 'beforePreWpautop', [ o ] );
+			}
+	
+			o.data = t._wp_Nop( o.data );
+	
+			if ( q ) {
+				jQuery('body').trigger('afterPreWpautop', [ o ] );
+			}
+	
+			return o.data;
+		},
+	
+		wpautop: function( pee ) {
+			var t = this, o = { o: t, data: pee, unfiltered: pee },
+				q = typeof( jQuery ) !== 'undefined';
+	
+			if ( q ) {
+				jQuery( 'body' ).trigger('beforeWpautop', [ o ] );
+			}
+	
+			o.data = t._wp_Autop( o.data );
+	
+			if ( q ) {
+				jQuery( 'body' ).trigger('afterWpautop', [ o ] );
+			}
+	
+			return o.data;
+		}
+	};
+	
+	window.switchEditors = wp.editor.mode;
+
+	$( function() {
+		if ( ! wp.editor.fullscreen ) {
+			return;
+		}
+
+		var $window = $( window ),
+			$document = $( document ),
+			$adminBar = $( '#wpadminbar' ),
+			$tools = $( '#wp-content-editor-tools' ),
+			$visualTop,
+			$visualEditor,
+			$textTop = $( '#ed_toolbar' ),
+			$textEditor = $( '#content' ),
+			$textEditorClone = $( '<div id="content-clone"></div>' ),
+			$bottom = $( '#post-status-info' ),
+			adjust,
+			fullscreen = window.wp.editor.fullscreen,
+			editorInstance,
+			statusBarHeight = 0,
+			fixedTop = false,
+			fixedBottom = false;
+
+		$textEditorClone.insertAfter( $textEditor );
+
+		$textEditorClone.css( {
+			'font-family': $textEditor.css( 'font-family' ),
+			'font-size': $textEditor.css( 'font-size' ),
+			'line-height': $textEditor.css( 'line-height' ),
+			'padding': $textEditor.css( 'padding' ),
+			'padding-top': 37,
+			'white-space': 'pre-wrap',
+			'word-wrap': 'break-word'
+		} );
+
+		$textEditor.on( 'focus input propertychange', function() {
+			textEditorResize();
+		} );
+
+		$textEditor.on( 'keyup', function() {
+			var range = document.createRange(),
+				start = $textEditor[0].selectionStart,
+				end = $textEditor[0].selectionEnd,
+				textNode = $textEditorClone[0].firstChild,
+				windowHeight = $window.height(),
+				offset, cursorTop, cursorBottom, editorTop, editorBottom;
 
-			DOM.removeClass( wrap_id, 'html-active' );
-			DOM.addClass( wrap_id, 'tmce-active' );
-			setUserSetting( 'editor', 'tinymce' );
-
-		} else if ( 'html' === mode ) {
-
-			if ( ed && ed.isHidden() ) {
-				return false;
+			if ( start && end && start !== end ) {
+				return;
 			}
 
-			if ( ed ) {
-				if ( ! tinymce.Env.iOS ) {
-					iframe = DOM.get( id + '_ifr' );
-					editorHeight = iframe ? parseInt( iframe.style.height, 10 ) : 0;
+			range.setStart( textNode, start );
+			range.setEnd( textNode, end + 1 );
 
-					if ( editorHeight ) {
-						toolbarHeight = getToolbarHeight();
-						editorHeight = editorHeight + toolbarHeight - 14;
+			offset = range.getBoundingClientRect();
 
-						// height cannot be under 50 or over 5000
-						if ( editorHeight > 50 && editorHeight < 5000 ) {
-							txtarea_el.style.height = editorHeight + 'px';
-						}
-					}
-				}
+			if ( ! offset.height ) {
+				return;
+			}
 
-				ed.hide();
-			} else {
-				// The TinyMCE instance doesn't exist, run the content through 'pre_wpautop()' and show the textarea
-				if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id ].wpautop ) {
-					txtarea_el.value = t.pre_wpautop( txtarea_el.value );
-				}
+			cursorTop = offset.top;
+			cursorBottom = cursorTop + offset.height;
+			editorTop = $adminBar.outerHeight() + $textTop.outerHeight();
+			editorBottom = windowHeight - $bottom.outerHeight();
 
-				DOM.setStyles( txtarea_el, {'display': '', 'visibility': ''} );
+			if ( cursorTop < editorTop || cursorBottom > editorBottom ) {
+				window.scrollTo( window.pageXOffset, cursorTop + window.pageYOffset - windowHeight / 2 );
 			}
+		} );
 
-			DOM.removeClass( wrap_id, 'tmce-active' );
-			DOM.addClass( wrap_id, 'html-active' );
-			setUserSetting( 'editor', 'html' );
-		}
-		return false;
-	},
+		function textEditorResize() {
+			if ( editorInstance && ! editorInstance.isHidden() ) {
+				return;
+			}
 
-	_wp_Nop: function( content ) {
-		var blocklist1, blocklist2,
-			preserve_linebreaks = false,
-			preserve_br = false;
-
-		// Protect pre|script tags
-		if ( content.indexOf( '<pre' ) !== -1 || content.indexOf( '<script' ) !== -1 ) {
-			preserve_linebreaks = true;
-			content = content.replace( /<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function( a ) {
-				a = a.replace( /<br ?\/?>(\r\n|\n)?/g, '<wp-line-break>' );
-				a = a.replace( /<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-line-break>' );
-				return a.replace( /\r?\n/g, '<wp-line-break>' );
-			});
-		}
+			var hiddenHeight = $textEditorClone.width( $textEditor.width() ).text( $textEditor.val() + '&nbsp;' ).height(),
+				textEditorHeight = $textEditor.height();
 
-		// keep <br> tags inside captions and remove line breaks
-		if ( content.indexOf( '[caption' ) !== -1 ) {
-			preserve_br = true;
-			content = content.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) {
-				return a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' ).replace( /[\r\n\t]+/, '' );
-			});
-		}
+			if ( hiddenHeight === textEditorHeight ) {
+				return;
+			} else if ( hiddenHeight < 300 ) {
+				hiddenHeight = 300;
+			}
 
-		// Pretty it up for the source editor
-		blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset';
-		content = content.replace( new RegExp( '\\s*</(' + blocklist1 + ')>\\s*', 'g' ), '</$1>\n' );
-		content = content.replace( new RegExp( '\\s*<((?:' + blocklist1 + ')(?: [^>]*)?)>', 'g' ), '\n<$1>' );
-
-		// Mark </p> if it has any attributes.
-		content = content.replace( /(<p [^>]+>.*?)<\/p>/g, '$1</p#>' );
-
-		// Separate <div> containing <p>
-		content = content.replace( /<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n' );
-
-		// Remove <p> and <br />
-		content = content.replace( /\s*<p>/gi, '' );
-		content = content.replace( /\s*<\/p>\s*/gi, '\n\n' );
-		content = content.replace( /\n[\s\u00a0]+\n/g, '\n\n' );
-		content = content.replace( /\s*<br ?\/?>\s*/gi, '\n' );
-
-		// Fix some block element newline issues
-		content = content.replace( /\s*<div/g, '\n<div' );
-		content = content.replace( /<\/div>\s*/g, '</div>\n' );
-		content = content.replace( /\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n' );
-		content = content.replace( /caption\]\n\n+\[caption/g, 'caption]\n\n[caption' );
-
-		blocklist2 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset';
-		content = content.replace( new RegExp('\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\s*>', 'g' ), '\n<$1>' );
-		content = content.replace( new RegExp('\\s*</(' + blocklist2 + ')>\\s*', 'g' ), '</$1>\n' );
-		content = content.replace( /<li([^>]*)>/g, '\t<li$1>' );
+			$textEditor.height( hiddenHeight );
 
-		if ( content.indexOf( '<hr' ) !== -1 ) {
-			content = content.replace( /\s*<hr( [^>]*)?>\s*/g, '\n\n<hr$1>\n\n' );
+			adjust( 'resize' );
 		}
 
-		if ( content.indexOf( '<object' ) !== -1 ) {
-			content = content.replace( /<object[\s\S]+?<\/object>/g, function( a ) {
-				return a.replace( /[\r\n]+/g, '' );
-			});
-		}
+		// We need to wait for TinyMCE to initialize.
+		$document.on( 'tinymce-editor-init.editor-scroll', function( event, editor ) {
+			var $contentWrap;
 
-		// Unmark special paragraph closing tags
-		content = content.replace( /<\/p#>/g, '</p>\n' );
-		content = content.replace( /\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1' );
-
-		// Trim whitespace
-		content = content.replace( /^\s+/, '' );
-		content = content.replace( /[\s\u00a0]+$/, '' );
-
-		// put back the line breaks in pre|script
-		if ( preserve_linebreaks ) {
-			content = content.replace( /<wp-line-break>/g, '\n' );
-		}
+			// Make sure it's the main editor.
+			if ( editor.id !== 'content' ) {
+				return;
+			}
 
-		// and the <br> tags in captions
-		if ( preserve_br ) {
-			content = content.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );
-		}
+			// Copy the editor instance.
+			editorInstance = editor;
 
-		return content;
-	},
+			// Resizing will be handled by the autoresize plugin.
+			editor.theme.resizeTo = function() {};
 
-	_wp_Autop: function(pee) {
-		var preserve_linebreaks = false,
-			preserve_br = false,
-			blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre' +
-				'|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section' +
-				'|article|aside|hgroup|header|footer|nav|figure|details|menu|summary';
-
-		if ( pee.indexOf( '<object' ) !== -1 ) {
-			pee = pee.replace( /<object[\s\S]+?<\/object>/g, function( a ) {
-				return a.replace( /[\r\n]+/g, '' );
-			});
-		}
+			// Set the minimum height to the initial viewport height.
+			editor.settings.autoresize_min_height = 300;
 
-		pee = pee.replace( /<[^<>]+>/g, function( a ){
-			return a.replace( /[\r\n]+/g, ' ' );
-		});
-
-		// Protect pre|script tags
-		if ( pee.indexOf( '<pre' ) !== -1 || pee.indexOf( '<script' ) !== -1 ) {
-			preserve_linebreaks = true;
-			pee = pee.replace( /<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function( a ) {
-				return a.replace( /(\r\n|\n)/g, '<wp-line-break>' );
-			});
-		}
+			// Get the necessary UI elements.
+			$contentWrap = $( '#wp-content-wrap' );
+			statusBarHeight = $contentWrap.find( '.mce-statusbar' ).filter( ':visible' ).outerHeight();
+			$visualTop = $contentWrap.find( '.mce-toolbar-grp' );
+			$visualEditor = $contentWrap.find( '.mce-edit-area' );
+
+			// Adjust when switching editor modes.
+			editor.on( 'show', function() {
+				setTimeout( function() {
+					editor.execCommand( 'mceAutoResize' );
+					adjust( 'resize' );
+				}, 200 );
+			} );
+
+			editor.on( 'keyup', function() {
+				var offset = editor.wp.getCursorOffset(),
+					windowHeight = $window.height(),
+					cursorTop, cursorBottom, editorTop, editorBottom;
 
-		// keep <br> tags inside captions and convert line breaks
-		if ( pee.indexOf( '[caption' ) !== -1 ) {
-			preserve_br = true;
-			pee = pee.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) {
-				// keep existing <br>
-				a = a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' );
-				// no line breaks inside HTML tags
-				a = a.replace( /<[a-zA-Z0-9]+( [^<>]+)?>/g, function( b ) {
-					return b.replace( /[\r\n\t]+/, ' ' );
-				});
-				// convert remaining line breaks to <br>
-				return a.replace( /\s*\n\s*/g, '<wp-temp-br />' );
-			});
-		}
+				if ( ! offset ) {
+					return;
+				}
 
-		pee = pee + '\n\n';
-		pee = pee.replace( /<br \/>\s*<br \/>/gi, '\n\n' );
-		pee = pee.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n$1' );
-		pee = pee.replace( new RegExp( '(</(?:' + blocklist + ')>)', 'gi' ), '$1\n\n' );
-		pee = pee.replace( /<hr( [^>]*)?>/gi, '<hr$1>\n\n' ); // hr is self closing block element
-		pee = pee.replace( /\r\n|\r/g, '\n' );
-		pee = pee.replace( /\n\s*\n+/g, '\n\n' );
-		pee = pee.replace( /([\s\S]+?)\n\n/g, '<p>$1</p>\n' );
-		pee = pee.replace( /<p>\s*?<\/p>/gi, '');
-		pee = pee.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), '$1' );
-		pee = pee.replace( /<p>(<li.+?)<\/p>/gi, '$1');
-		pee = pee.replace( /<p>\s*<blockquote([^>]*)>/gi, '<blockquote$1><p>');
-		pee = pee.replace( /<\/blockquote>\s*<\/p>/gi, '</p></blockquote>');
-		pee = pee.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '$1' );
-		pee = pee.replace( new RegExp( '(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), '$1' );
-		pee = pee.replace( /\s*\n/gi, '<br />\n');
-		pee = pee.replace( new RegExp( '(</?(?:' + blocklist + ')[^>]*>)\\s*<br />', 'gi' ), '$1' );
-		pee = pee.replace( /<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi, '$1' );
-		pee = pee.replace( /(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi, '[caption$1[/caption]' );
-
-		pee = pee.replace( /(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g, function( a, b, c ) {
-			if ( c.match( /<p( [^>]*)?>/ ) ) {
-				return a;
-			}
-
-			return b + '<p>' + c + '</p>';
-		});
-
-		// put back the line breaks in pre|script
-		if ( preserve_linebreaks ) {
-			pee = pee.replace( /<wp-line-break>/g, '\n' );
-		}
+				cursorTop = offset.top + editor.getContentAreaContainer().getElementsByTagName( 'iframe' )[0].getBoundingClientRect().top;
+				cursorBottom = cursorTop + offset.height;
+				editorTop = $adminBar.outerHeight() + $tools.outerHeight() + $visualTop.outerHeight();
+				editorBottom = $window.height() - $bottom.outerHeight();
 
-		if ( preserve_br ) {
-			pee = pee.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );
-		}
+				if ( cursorTop < editorTop || cursorBottom > editorBottom ) {
+					window.scrollTo( window.pageXOffset, cursorTop + window.pageYOffset - windowHeight / 2 );
+				}
+			} );
 
-		return pee;
-	},
+			editor.wp = editor.wp || {};
 
-	pre_wpautop: function( content ) {
-		var t = this, o = { o: t, data: content, unfiltered: content },
-			q = typeof( jQuery ) !== 'undefined';
+			editor.wp.getCursorOffset = function() {
+				var selection = editor.selection,
+					node = selection.getNode(),
+					range = selection.getRng(),
+					view, clone, right, offset;
 
-		if ( q ) {
-			jQuery( 'body' ).trigger( 'beforePreWpautop', [ o ] );
-		}
+				if ( tinymce.Env.ie && tinymce.Env.ie < 9 ) {
+					return;
+				}
 
-		o.data = t._wp_Nop( o.data );
+				if ( view = editor.wp.isView( node ) ) {
+					offset = view.getBoundingClientRect();
+				} else if ( selection.isCollapsed() ) {
+					clone = range.cloneRange();
+
+					if ( clone.startContainer.length > 1 ) {
+						if ( clone.startContainer.length > clone.endOffset ) {
+							try {
+								clone.setEnd( clone.startContainer, clone.endOffset + 1 );
+								right = true;
+							} catch ( e ) {
+								console.log( e );
+							}
+						} else {
+							try {
+								clone.setStart( clone.startContainer, clone.endOffset - 1 );
+							} catch ( e ) {
+								console.log( e );
+							}
+						}
 
-		if ( q ) {
-			jQuery('body').trigger('afterPreWpautop', [ o ] );
-		}
+						selection.setRng( clone );
+						offset = selection.getRng().getBoundingClientRect();
+						selection.setRng( range );
+					} else {
+						offset = node.getBoundingClientRect();
+					}
+				} else {
+					offset = range.getBoundingClientRect();
+				}
 
-		return o.data;
-	},
+				if ( ! offset.height ) {
+					return false;
+				}
 
-	wpautop: function( pee ) {
-		var t = this, o = { o: t, data: pee, unfiltered: pee },
-			q = typeof( jQuery ) !== 'undefined';
+				return offset;
+			};
 
-		if ( q ) {
-			jQuery( 'body' ).trigger('beforeWpautop', [ o ] );
-		}
+			editor.wp.isView = function( node ) {
+				return editor.dom.getParent( node, function( node ) {
+					return editor.dom.hasClass( node, 'wpview-wrap' );
+				} );
+			};
+
+			editor.on( 'hide', function() {
+				textEditorResize();
+				adjust( 'resize' );
+			} );
+
+			// Adjust when the editor resizes.
+			editor.on( 'nodechange setcontent keyup FullscreenStateChanged', function() {
+				adjust( 'resize' );
+			} );
+
+			// And adjust "immediately".
+			// Allow some time to load CSS etc.
+			setTimeout( function() {
+				adjust( 'resize' );
+			}, 500 );
+		} );
+
+		// Adjust when the window is scrolled or resized.
+		$window.on( 'scroll resize', function( event ) {
+			adjust( event.type );
+		} );
+
+		// Adjust when exiting fullscreen mode.
+		fullscreen.pubsub.subscribe( 'hidden', function() {
+			adjust( 'resize' );
+		} );
+
+		// Adjust when collapsing the menu.
+		$( wp ).on( 'menu:collapse.editor-scroll', function() {
+			adjust( 'resize' );
+		} )
+
+		// Adjust when changing the columns.
+		.on( 'postboxes:columnchange.editor-scroll', function() {
+			adjust( 'resize' );
+		} )
+
+		// Adjust when changing the body class.
+		.on( 'editor:classchange.editor-scroll', function() {
+			adjust( 'resize' );
+		} );
+
+		// Adjust the toolbars based on the active editor mode.
+		adjust = wp.editor.adjustToolbarPosition = function( eventType ) {
+			// Make sure we're not in fullscreen mode.
+			if ( fullscreen.settings.visible ) {
+				return;
+			}
 
-		o.data = t._wp_Autop( o.data );
+			var adminBarHeight = $adminBar.height(),
+				bottomHeight = $bottom.outerHeight(),
+				windowPos = $window.scrollTop(),
+				windowHeight = $window.height(),
+				windowWidth = $window.width(),
+				$top, $editor, visual,
+				toolsHeight, topPos, topHeight, editorPos, editorHeight, editorWidth;
+
+			// Visual editor.
+			if ( editorInstance && ! editorInstance.isHidden() ) {
+				$top = $visualTop;
+				$editor = $visualEditor;
+				visual = true;
+
+				// Not sure if this is a bit too intensive. Doesn't hide the panel of 'styleselect'.
+				tinymce.each( editorInstance.controlManager.buttons, function( button ) {
+					if ( button._active && ( button.type === 'colorbutton' || button.type === 'panelbutton' || button.type === 'menubutton' ) ) {
+						button.hidePanel();
+					}
+				} );
+			// Text editor.
+			} else {
+				$top = $textTop;
+				$editor = $textEditor;
+			}
 
-		if ( q ) {
-			jQuery( 'body' ).trigger('afterWpautop', [ o ] );
-		}
+			toolsHeight = $tools.outerHeight();
+			topPos = $top.parent().offset().top;
+			topHeight = $top.outerHeight();
+			editorPos = $editor.offset().top;
+			editorHeight = $editor.outerHeight();
+			editorWidth = $editor.outerWidth();
+
+			// Maybe pin the top.
+			if ( ( ! fixedTop || eventType === 'resize' ) &&
+					// Handle scrolling down.
+					( windowPos >= ( topPos - toolsHeight - adminBarHeight ) &&
+					// Handle scrolling up.
+					windowPos <= ( topPos - toolsHeight - adminBarHeight + editorHeight - 100 ) ) ) {
+				fixedTop = true;
+
+				$top.css( {
+					position: 'fixed',
+					top: ( windowWidth > 600 ? adminBarHeight : 0 ) + toolsHeight,
+					width: editorWidth - ( visual ? 0 : 38 ),
+					borderTop: '1px solid #e5e5e5'
+				} );
+
+				$tools.css( {
+					position: 'fixed',
+					top: ( windowWidth > 600 ? adminBarHeight : 0 ),
+					width: editorWidth + 2
+				} );
+
+				if ( visual ) {
+					$editor.css( {
+						paddingTop: topHeight + toolsHeight
+					} );
+				} else {
+					$top.parent().css( {
+						paddingTop: topHeight + toolsHeight
+					} );
+				}
+			// Maybe unpin the top.
+			} else if ( fixedTop &&
+					// Handle scrolling up.
+					( windowPos <= ( topPos - adminBarHeight ) ||
+					// Handle scrolling down.
+					// The topHeight is added to the editorHeight (padding), so we'll have to subtract it again.
+					windowPos >= ( topPos - adminBarHeight + editorHeight - ( visual ? topHeight + toolsHeight : 0 ) - 100 ) ) ) {
+				fixedTop = false;
+
+				$top.add( $tools ).css( {
+					position: 'relative',
+					top: 'auto',
+					width: 'auto',
+					borderTop: 'none'
+				} );
+
+				if ( visual ) {
+					$editor.css( {
+						paddingTop: 0
+					} );
+				} else {
+					$top.parent().css( {
+						paddingTop: 0
+					} );
+				}
+			}
+
+			// Maybe adjust the bottom bar.
+			if ( ( ! fixedBottom || eventType === 'resize' ) &&
+					// + 1 for the border around the .wp-editor-container.
+					( windowPos + windowHeight ) <= ( editorPos + editorHeight + bottomHeight + statusBarHeight + 1 ) ) {
+				fixedBottom = true;
+				$bottom.css( {
+					position: 'fixed',
+					bottom: 0,
+					width: editorWidth + 2,
+					borderTop: '1px solid #dedede'
+				} );
+			} else if ( fixedBottom &&
+					( windowPos + windowHeight ) > ( editorPos + editorHeight + bottomHeight + statusBarHeight - 1 ) ) {
+				fixedBottom = false;
+				$bottom.css( {
+					position: 'relative',
+					bottom: 'auto',
+					width: '100%',
+					borderTop: 'none'
+				} );
+			}
+		};
 
-		return o.data;
-	}
-};
+		textEditorResize();
+	} );
+} )( jQuery );
Index: src/wp-admin/js/post.js
===================================================================
--- src/wp-admin/js/post.js	(revision 28955)
+++ src/wp-admin/js/post.js	(working copy)
@@ -1000,88 +1000,16 @@
 
 	wptitlehint();
 
-	// Resize the visual and text editors
-	( function() {
-		var editor, offset, mce,
-			$textarea = $('textarea#content'),
-			$handle = $('#post-status-info');
-
-		// No point for touch devices
-		if ( ! $textarea.length || 'ontouchstart' in window ) {
-			return;
-		}
-
-		function dragging( event ) {
-			if ( mce ) {
-				editor.theme.resizeTo( null, offset + event.pageY );
-			} else {
-				$textarea.height( Math.max( 50, offset + event.pageY ) );
-			}
-
-			event.preventDefault();
-		}
-
-		function endDrag() {
-			var height, toolbarHeight;
-
-			if ( mce ) {
-				editor.focus();
-				toolbarHeight = parseInt( $( '#wp-content-editor-container .mce-toolbar-grp' ).height(), 10 );
-
-				if ( toolbarHeight < 10 || toolbarHeight > 200 ) {
-					toolbarHeight = 30;
-				}
-
-				height = parseInt( $('#content_ifr').css('height'), 10 ) + toolbarHeight - 28;
-			} else {
-				$textarea.focus();
-				height = parseInt( $textarea.css('height'), 10 );
-			}
-
-			$document.off( '.wp-editor-resize' );
-
-			// sanity check
-			if ( height && height > 50 && height < 5000 ) {
-				setUserSetting( 'ed_size', height );
-			}
-		}
-
-		$textarea.css( 'resize', 'none' );
-
-		$handle.on( 'mousedown.wp-editor-resize', function( event ) {
-			if ( typeof tinymce !== 'undefined' ) {
-				editor = tinymce.get('content');
-			}
-
-			if ( editor && ! editor.isHidden() ) {
-				mce = true;
-				offset = $('#content_ifr').height() - event.pageY;
-			} else {
-				mce = false;
-				offset = $textarea.height() - event.pageY;
-				$textarea.blur();
-			}
-
-			$document.on( 'mousemove.wp-editor-resize', dragging )
-				.on( 'mouseup.wp-editor-resize mouseleave.wp-editor-resize', endDrag );
-
-			event.preventDefault();
-		}).on( 'mouseup.wp-editor-resize', endDrag );
-	})();
-
 	if ( typeof tinymce !== 'undefined' ) {
 		// When changing post formats, change the editor body class
 		$( '#post-formats-select input.post-format' ).on( 'change.set-editor-class', function() {
 			var editor, body, format = this.id;
 
-			if ( format && $( this ).prop('checked') ) {
-				editor = tinymce.get( 'content' );
-
-				if ( editor ) {
-					body = editor.getBody();
-					body.className = body.className.replace( /\bpost-format-[^ ]+/, '' );
-					editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format );
-				}
+			if ( format && $( this ).prop( 'checked' ) && ( editor = tinymce.get( 'content' ) ) ) {
+				body = editor.getBody();
+				body.className = body.className.replace( /\bpost-format-[^ ]+/, '' );
+				editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format );
+				$( wp ).trigger( 'editor:classchange' );
 			}
 		});
 	}
Index: src/wp-admin/js/postbox.js
===================================================================
--- src/wp-admin/js/postbox.js	(revision 28955)
+++ src/wp-admin/js/postbox.js	(working copy)
@@ -1,9 +1,9 @@
 /* global ajaxurl */
 
-var postboxes;
-
 (function($) {
-	postboxes = {
+	window.wp = wp || {};
+
+	wp.postboxes = window.postboxes = {
 		add_postbox_toggles : function(page, args) {
 			var self = this;
 
@@ -21,9 +21,9 @@
 					self.save_state(page);
 
 				if ( id ) {
-					if ( !p.hasClass('closed') && $.isFunction(postboxes.pbshow) )
+					if ( !p.hasClass('closed') && $.isFunction( self.pbshow ) )
 						self.pbshow(id);
-					else if ( p.hasClass('closed') && $.isFunction(postboxes.pbhide) )
+					else if ( p.hasClass('closed') && $.isFunction( self.pbhide ) )
 						self.pbhide(id);
 				}
 			});
@@ -43,11 +43,11 @@
 
 				if ( $(this).prop('checked') ) {
 					$('#' + box).show();
-					if ( $.isFunction( postboxes.pbshow ) )
+					if ( $.isFunction( self.pbshow ) )
 						self.pbshow( box );
 				} else {
 					$('#' + box).hide();
-					if ( $.isFunction( postboxes.pbhide ) )
+					if ( $.isFunction( self.pbhide ) )
 						self.pbhide( box );
 				}
 				self.save_state(page);
@@ -65,7 +65,8 @@
 		},
 
 		init : function(page, args) {
-			var isMobile = $(document.body).hasClass('mobile');
+			var self = this,
+				isMobile = $(document.body).hasClass('mobile');
 
 			$.extend( this, args || {} );
 			$('#wpbody-content').css('overflow','hidden');
@@ -87,18 +88,18 @@
 						return;
 					}
 
-					postboxes.save_order(page);
+					self.save_order(page);
 				},
 				receive: function(e,ui) {
 					if ( 'dashboard_browser_nag' == ui.item[0].id )
 						$(ui.sender).sortable('cancel');
 
-					postboxes._mark_area();
+					self._mark_area();
 				}
 			});
 
 			if ( isMobile ) {
-				$(document.body).bind('orientationchange.postboxes', function(){ postboxes._pb_change(); });
+				$(document.body).bind('orientationchange.postboxes', function(){ self._pb_change(); });
 				this._pb_change();
 			}
 
@@ -159,6 +160,8 @@
 			if ( el ) {
 				el.className = el.className.replace(/columns-\d+/, 'columns-' + n);
 			}
+			
+			$( wp ).trigger( 'postboxes:columnchange' );
 		},
 
 		_pb_change : function() {
Index: src/wp-includes/class-wp-editor.php
===================================================================
--- src/wp-includes/class-wp-editor.php	(revision 28955)
+++ src/wp-includes/class-wp-editor.php	(working copy)
@@ -109,28 +109,6 @@
 		if ( self::$this_quicktags )
 			self::$has_quicktags = true;
 
-		if ( empty( $set['editor_height'] ) )
-			return $set;
-
-		if ( 'content' === $editor_id ) {
-			// A cookie (set when a user resizes the editor) overrides the height.
-			$cookie = (int) get_user_setting( 'ed_size' );
-
-			// Upgrade an old TinyMCE cookie if it is still around, and the new one isn't.
-			if ( ! $cookie && isset( $_COOKIE['TinyMCE_content_size'] ) ) {
-				parse_str( $_COOKIE['TinyMCE_content_size'], $cookie );
- 				$cookie = $cookie['ch'];
-			}
-
-			if ( $cookie )
-				$set['editor_height'] = $cookie;
-		}
-
-		if ( $set['editor_height'] < 50 )
-			$set['editor_height'] = 50;
-		elseif ( $set['editor_height'] > 5000 )
-			$set['editor_height'] = 5000;
-
 		return $set;
 	}
 
@@ -153,11 +131,6 @@
 			self::$drag_drop_upload = true;
 		}
 
-		if ( ! empty( $set['editor_height'] ) )
-			$height = ' style="height: ' . $set['editor_height'] . 'px"';
-		else
-			$height = ' rows="' . $set['textarea_rows'] . '"';
-
 		if ( !current_user_can( 'upload_files' ) )
 			$set['media_buttons'] = false;
 
@@ -231,7 +204,7 @@
 		 * @param string $output Editor's HTML markup.
 		 */
 		$the_editor = apply_filters( 'the_editor', '<div id="wp-' . $editor_id . '-editor-container" class="wp-editor-container">' .
-			'<textarea' . $editor_class . $height . $tabindex . $autocomplete . ' cols="40" name="' . $set['textarea_name'] . '" ' .
+			'<textarea' . $editor_class . $tabindex . $autocomplete . ' cols="40" name="' . $set['textarea_name'] . '" ' .
 			'id="' . $editor_id . '">%s</textarea></div>' );
 
 		/**
@@ -316,7 +289,7 @@
 					 * @param array  $plugins   An array of teenyMCE plugins.
 					 * @param string $editor_id Unique editor identifier, e.g. 'content'.
 					 */
-					self::$plugins = $plugins = apply_filters( 'teeny_mce_plugins', array( 'fullscreen', 'image', 'wordpress', 'wpeditimage', 'wplink' ), $editor_id );
+					self::$plugins = $plugins = apply_filters( 'teeny_mce_plugins', array( 'autoresize', 'fullscreen', 'image', 'wordpress', 'wpeditimage', 'wplink' ), $editor_id );
 				} else {
 
 					/**
@@ -339,6 +312,7 @@
 					$mce_external_plugins = apply_filters( 'mce_external_plugins', array() );
 
 					$plugins = array(
+						'autoresize',
 						'charmap',
 						'hr',
 						'media',
@@ -581,7 +555,7 @@
 				 * @param array  $buttons   First-row list of buttons.
 				 * @param string $editor_id Unique editor identifier, e.g. 'content'.
 				 */
-				$mce_buttons = apply_filters( 'mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id );
+				$mce_buttons = apply_filters( 'mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'wp_medialib', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id );
 
 				/**
 				 * Filter the second-row list of TinyMCE buttons (Visual tab).
Index: src/wp-includes/css/editor.css
===================================================================
--- src/wp-includes/css/editor.css	(revision 28955)
+++ src/wp-includes/css/editor.css	(working copy)
@@ -148,8 +148,13 @@
 div.mce-toolbar-grp {
 	border-bottom: 1px solid #dedede;
 	background: #f5f5f5;
-	padding: 3px;
+	padding: 0;
 	position: relative;
+	z-index: 999;
+}
+
+div.mce-toolbar-grp > div {
+	padding: 3px;
 }
 
 .has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first {
@@ -161,14 +166,26 @@
 }
 
 div.mce-statusbar {
-	border-top: 1px solid #eee;
+	border-top: 1px solid #e5e5e5;
 }
 
 div.mce-path {
-	padding: 0 8px 2px;
+	padding: 2px 10px;
 	margin: 0;
 }
 
+.mce-path, 
+.mce-path-item, 
+.mce-path .mce-divider { 
+	font-size: 12px; 
+	line-height: 18px; 
+} 
+
+.mce-path-item:focus {
+	background: none;
+	color: inherit;
+}
+
 .mce-toolbar .mce-btn,
 .qt-fullscreen {
 	border-color: transparent;
@@ -584,6 +601,7 @@
 i.mce-i-ltr,
 i.mce-i-wp_page,
 i.mce-i-hr,
+i.mce-i-wp_medialib,
 .mce-close {
 	font: normal 20px/1 'dashicons';
 	padding: 0;
@@ -731,7 +749,11 @@
 }
 
 .mce-i-wp_code:before {
-	content: '\e017';
+	content: '\f475';
+}
+
+.mce-i-wp_medialib:before {
+	content: '\f104';
 }
 
 /* Editors */
@@ -740,8 +762,16 @@
 }
 
 .wp-editor-tools {
+	background-color: #f1f1f1;
+	padding-top: 20px;
 	position: relative;
-	z-index: 1;
+	z-index: 1000;
+}
+
+.wp-editor-tools:after {
+	clear: both;
+	content: '';
+	display: table;
 }
 
 .wp-editor-container {
@@ -763,10 +793,6 @@
 	box-sizing: border-box;
 }
 
-.wp-editor-tools {
-	padding: 0;
-}
-
 .wp-editor-container textarea.wp-editor-area {
 	width: 100%;
 	margin: 0;
Index: src/wp-includes/js/tinymce/skins/wordpress/wp-content.css
===================================================================
--- src/wp-includes/js/tinymce/skins/wordpress/wp-content.css	(revision 28955)
+++ src/wp-includes/js/tinymce/skins/wordpress/wp-content.css	(working copy)
@@ -1,5 +1,9 @@
 /* Additional default styles for the editor */
 
+html {
+	margin: 0 40px;
+}
+
 html.ios {
 	height: 100%;
 }
@@ -14,7 +18,14 @@
 	font-size: 13px;
 	line-height: 19px;
 	color: #333;
-	margin: 10px;
+	margin: 9px auto;
+	max-width: 100%;
+	overflow: visible !important;
+	/* The padding ensures margins of the children are contained in the body. */
+	padding-top: 1px !important;
+	padding-bottom: 1px !important;
+	padding-left: 0 !important;
+	padding-right: 0 !important;
 }
 
 /* When font-weight is different than the default browser style,
@@ -100,6 +111,11 @@
 	margin: 8px;
 }
 
+img {
+	height: auto;
+	max-width: 100%;
+}
+
 /* Remove blue highlighting of selected images in WebKit */
 img::selection {
 	background-color: transparent;
