From 72478e1bce4e6c25d591d585ebbb218f200dfffc Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 8 May 2013 23:03:44 +0000 Subject: [PATCH] TinyMCE: attempt a workaround for WebKit bug inserting spans with font styles when creating UL or OL. See #17154 git-svn-id: http://core.svn.wordpress.org/trunk@24211 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../tinymce/plugins/wordpress/editor_plugin_src.js | 14 +++++++++++++- .../themes/advanced/skins/wp_theme/content.css | 10 ---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js index bdf8851b76..f55bca67ed 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js @@ -7,7 +7,7 @@ tinymce.create('tinymce.plugins.WordPress', { init : function(ed, url) { - var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick, mod_key; + var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick, mod_key, style; moreHTML = ''; nextpageHTML = ''; @@ -133,6 +133,18 @@ } } } + + if ( tinymce.isWebKit && ( 'InsertUnorderedList' == cmd || 'InsertOrderedList' == cmd ) ) { + if ( !style ) + style = ed.dom.create('style', {'type': 'text/css'}, '#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}'); + + ed.getDoc().head.appendChild( style ); + } + }); + + ed.onExecCommand.add( function( ed, cmd, ui, val ) { + if ( tinymce.isWebKit && style && ( 'InsertUnorderedList' == cmd || 'InsertOrderedList' == cmd ) ) + ed.dom.remove( style ); }); ed.onInit.add(function(ed) { diff --git a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css index 598eadf244..c1e70cab98 100644 --- a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css +++ b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css @@ -45,16 +45,6 @@ body { margin: 10px; } -br[data-mce-bogus] { - line-height: 1em; - margin-top: -1em; -} - -br[data-mce-bogus]:only-child { - line-height: inherit; - margin-top: inherit; -} - .aligncenter, dl.aligncenter { display: block;