From b46bd0646cf6f5d8da077760131418d2ff2fd4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Reinmar=20Koszuli=C5=84ski?= Date: Fri, 5 Sep 2014 15:28:11 +0200 Subject: [PATCH] Workaround regressions in Chrome and Safari (#12221 and #11111). --- bender.js | 3 --- core/dom/range.js | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bender.js b/bender.js index 197a5519e79..7c78bec13f9 100644 --- a/bender.js +++ b/bender.js @@ -45,9 +45,6 @@ var config = { // IE8 (fails only in testing env - window.window === window gives false) 'tests/core/tools#test_clone_Window': 'env.ie && env.version == 8', - // Safari (#11111) - 'tests/core/dom/range/enlarge#test_enlarge_element12': 'env.safari', - // Safari (#11980) 'tests/core/editable/keystrokes/delbackspacequirks/collapsed#test backspace #2': 'env.safari', 'tests/core/editable/keystrokes/delbackspacequirks/collapsed#test backspace #3': 'env.safari', diff --git a/core/dom/range.js b/core/dom/range.js index d294f79e06a..4f343df36c0 100644 --- a/core/dom/range.js +++ b/core/dom/range.js @@ -1069,11 +1069,14 @@ CKEDITOR.dom.range = function( root ) { isWhiteSpace = /[\s\ufeff]$/.test( siblingText ); } else { + // #12221 (Chrome) plus #11111 (Safari). + var offsetWidth0 = CKEDITOR.env.webkit ? 1 : 0; + // If this is a visible element. // We need to check for the bookmark attribute because IE insists on // rendering the display:none nodes we use for bookmarks. (#3363) // Line-breaks (br) are rendered with zero width, which we don't want to include. (#7041) - if ( ( sibling.$.offsetWidth > 0 || excludeBrs && sibling.is( 'br' ) ) && !sibling.data( 'cke-bookmark' ) ) { + if ( ( sibling.$.offsetWidth > offsetWidth0 || excludeBrs && sibling.is( 'br' ) ) && !sibling.data( 'cke-bookmark' ) ) { // We'll accept it only if we need // whitespace, and this is an inline // element with whitespace only.