X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fcore%2Fdom%2Fwalker.js;h=569ac5719040e21fda2b857758baf4df138305f9;hb=3fe9cac293e090ea459a3ee10d78cbe9e1dd0e03;hp=a9c4ebacb5b4cb0beacff21d490918e7fda39628;hpb=6e682412d5cc0dfaedb376482e585bf2989c6863;p=ckeditor.git
diff --git a/_source/core/dom/walker.js b/_source/core/dom/walker.js
index a9c4eba..569ac57 100644
--- a/_source/core/dom/walker.js
+++ b/_source/core/dom/walker.js
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
@@ -413,8 +413,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
{
return function( node )
{
- var isWhitespace = node && ( node.type == CKEDITOR.NODE_TEXT )
- && !CKEDITOR.tools.trim( node.getText() );
+ var isWhitespace;
+ if ( node && node.type == CKEDITOR.NODE_TEXT )
+ {
+ // whitespace, as well as the text cursor filler node we used in Webkit. (#9384)
+ isWhitespace = !CKEDITOR.tools.trim( node.getText() ) ||
+ CKEDITOR.env.webkit && node.getText() == '\u200b';
+ }
+
return !! ( isReject ^ isWhitespace );
};
};
@@ -428,13 +434,25 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
var whitespace = CKEDITOR.dom.walker.whitespaces();
return function( node )
{
- // Nodes that take no spaces in wysiwyg:
- // 1. White-spaces but not including NBSP;
- // 2. Empty inline elements, e.g. we're checking here
- // 'offsetHeight' instead of 'offsetWidth' for properly excluding
- // all sorts of empty paragraph, e.g.
.
- var isInvisible = whitespace( node ) || node.is && !node.$.offsetHeight;
- return !! ( isReject ^ isInvisible );
+ var invisible;
+
+ if ( whitespace( node ) )
+ invisible = 1;
+ else
+ {
+ // Visibility should be checked on element.
+ if ( node.type == CKEDITOR.NODE_TEXT )
+ node = node.getParent();
+
+ // Nodes that take no spaces in wysiwyg:
+ // 1. White-spaces but not including NBSP;
+ // 2. Empty inline elements, e.g. we're checking here
+ // 'offsetHeight' instead of 'offsetWidth' for properly excluding
+ // all sorts of empty paragraph, e.g.
.
+ invisible = !node.$.offsetHeight;
+ }
+
+ return !! ( isReject ^ invisible );
};
};