Skip to content

Commit b46bd06

Browse files
committed
Workaround regressions in Chrome and Safari (#12221 and #11111).
1 parent 5b1f187 commit b46bd06

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bender.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ var config = {
4545
// IE8 (fails only in testing env - window.window === window gives false)
4646
'tests/core/tools#test_clone_Window': 'env.ie && env.version == 8',
4747

48-
// Safari (#11111)
49-
'tests/core/dom/range/enlarge#test_enlarge_element12': 'env.safari',
50-
5148
// Safari (#11980)
5249
'tests/core/editable/keystrokes/delbackspacequirks/collapsed#test backspace #2': 'env.safari',
5350
'tests/core/editable/keystrokes/delbackspacequirks/collapsed#test backspace #3': 'env.safari',

core/dom/range.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,11 +1069,14 @@ CKEDITOR.dom.range = function( root ) {
10691069

10701070
isWhiteSpace = /[\s\ufeff]$/.test( siblingText );
10711071
} else {
1072+
// #12221 (Chrome) plus #11111 (Safari).
1073+
var offsetWidth0 = CKEDITOR.env.webkit ? 1 : 0;
1074+
10721075
// If this is a visible element.
10731076
// We need to check for the bookmark attribute because IE insists on
10741077
// rendering the display:none nodes we use for bookmarks. (#3363)
10751078
// Line-breaks (br) are rendered with zero width, which we don't want to include. (#7041)
1076-
if ( ( sibling.$.offsetWidth > 0 || excludeBrs && sibling.is( 'br' ) ) && !sibling.data( 'cke-bookmark' ) ) {
1079+
if ( ( sibling.$.offsetWidth > offsetWidth0 || excludeBrs && sibling.is( 'br' ) ) && !sibling.data( 'cke-bookmark' ) ) {
10771080
// We'll accept it only if we need
10781081
// whitespace, and this is an inline
10791082
// element with whitespace only.

0 commit comments

Comments
 (0)