From 737183406962e6625c950d2db5a3326793addcbd Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 15 Nov 2017 18:58:26 +0000 Subject: [PATCH] Editor: Disable `wp_keep_scroll_position` in IE11 since buggy; fix `matches` polyfill conflict with ME.js by doing runtime feature detection in context window. Props westonruter, SergeyBiryukov, Clorith for testing. See #41962, #42029. Fixes #42553 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@42191 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/edit-form-advanced.php | 2 +- src/wp-includes/js/tinymce/tinymce.js | 29 ++++----------------------- src/wp-includes/version.php | 2 +- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php index 07c2dfe129..2400521804 100644 --- a/src/wp-admin/edit-form-advanced.php +++ b/src/wp-admin/edit-form-advanced.php @@ -639,7 +639,7 @@ if ( post_type_supports($post_type, 'editor') ) { 'resize' => false, 'wp_autoresize_on' => $_wp_editor_expand, 'add_unload_trigger' => false, - 'wp_keep_scroll_position' => true, + 'wp_keep_scroll_position' => ! $is_IE, ), ) ); ?> diff --git a/src/wp-includes/js/tinymce/tinymce.js b/src/wp-includes/js/tinymce/tinymce.js index c0e57c33dd..0eb9e3e7ae 100644 --- a/src/wp-includes/js/tinymce/tinymce.js +++ b/src/wp-includes/js/tinymce/tinymce.js @@ -16386,27 +16386,6 @@ define( ], function (Arr, Option, Element, NodeTypes, Error, document) { - /* - * There's a lot of code here; the aim is to allow the browser to optimise constant comparisons, - * instead of doing object lookup feature detection on every call - */ - var STANDARD = 0; - var MSSTANDARD = 1; - var WEBKITSTANDARD = 2; - var FIREFOXSTANDARD = 3; - - var selectorType = (function () { - var test = document.createElement('span'); - // As of Chrome 34 / Safari 7.1 / FireFox 34, everyone except IE has the unprefixed function. - // Still check for the others, but do it last. - return test.matches !== undefined ? STANDARD : - test.msMatchesSelector !== undefined ? MSSTANDARD : - test.webkitMatchesSelector !== undefined ? WEBKITSTANDARD : - test.mozMatchesSelector !== undefined ? FIREFOXSTANDARD : - -1; - })(); - - var ELEMENT = NodeTypes.ELEMENT; var DOCUMENT = NodeTypes.DOCUMENT; @@ -16416,10 +16395,10 @@ define( // As of Chrome 34 / Safari 7.1 / FireFox 34, everyone except IE has the unprefixed function. // Still check for the others, but do it last. - else if (selectorType === STANDARD) return elem.matches(selector); - else if (selectorType === MSSTANDARD) return elem.msMatchesSelector(selector); - else if (selectorType === WEBKITSTANDARD) return elem.webkitMatchesSelector(selector); - else if (selectorType === FIREFOXSTANDARD) return elem.mozMatchesSelector(selector); + else if (elem.matches !== undefined) return elem.matches(selector); + else if (elem.msMatchesSelector !== undefined) return elem.msMatchesSelector(selector); + else if (elem.webkitMatchesSelector !== undefined) return elem.webkitMatchesSelector(selector); + else if (elem.mozMatchesSelector !== undefined) return elem.mozMatchesSelector(selector); else throw new Error('Browser lacks native selectors'); // unfortunately we can't throw this on startup :( }; diff --git a/src/wp-includes/version.php b/src/wp-includes/version.php index ddc38104ee..761828d98f 100644 --- a/src/wp-includes/version.php +++ b/src/wp-includes/version.php @@ -18,7 +18,7 @@ $wp_db_version = 38590; * * @global string $tinymce_version */ -$tinymce_version = '4607-20170918'; +$tinymce_version = '4607-20171115'; /** * Holds the required PHP version