#2419: MoveToAncestorNode does not return the correct node
------------------------+---------------------------------------------------
Reporter: henrylyne | Owner:
Type: Bug | Status: new
Priority: Normal | Milestone:
Component: General | Version: FCKeditor 2.6.3 Beta
Resolution: | Keywords:
------------------------+---------------------------------------------------
Comment(by martinkou):
I'm not totally sure if this can be fixed. If you check the value returned
by SelectNode() you'll find that it is indeed returning the <div> node.
SelectNode() isn't at fault here as well. IE's selection model does not
allow you to select the <div> node itself - the reason is because it only
uses caret positions to express a text selection. If you've used the
DOMRange::selectNode() and DOMSelection.addRange() in Safari to select the
the <div> node yourself, you'll notice document.execCommand('inserthtml'
...) will give you the same buggy result as us.
So the real culprit here is that the browser doesn't remember the
selection correctly, and the symptom appears in FCK.InsertHtml() because
InsertHtml() depends on the browser's view on where the selection is. If
you happen to be writing a plugin to FCKeditor and want to replace entire
block nodes, I recommend you to take a look at fckdomrange.js and use the
FCKDomRange class in it instead.
--
Ticket URL: <http://dev.fckeditor.net/ticket/2419#comment:3>
FCKeditor <http://www.fckeditor.net/>
The text editor for Internet
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac