Opened 13 years ago
Last modified 12 years ago
#8967 assigned Bug
obvious bug in getEnclosedNode
| Reported by: | yiminghe | Owned by: | Jakub Ś |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | Core : Selection | Version: | 3.1.1 |
| Keywords: | HasPatch | Cc: |
Description
For example:
<div> ^ <bookmark/> <span id='x'/> <bookmark/> ^
getEnclosedNode should return span whose id is "x".
for detail see patch in attachement.
Attachments (2)
Change History (7)
Changed 13 years ago by
| Attachment: | getEnclosedNode.patch added |
|---|
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
sorry, i thought garry will handle this bug. there is the test code.
steps:
- open the following page
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>ckeditor source test</title>
</head>
<body>
<div id='outer'>
<span data-cke-bookmark='1'></span>
<span id='x'></span>
<span data-cke-bookmark='1'></span>
</div>
<script src="ckeditor_source.js">
</script>
<script type="text/javascript">
var range=new CKEDITOR.dom.range(document);
var outer=CKEDITOR.dom.element.get(document.getElementById("outer"));
range.setStart(outer,0);
range.setEnd(outer,document.getElementById("outer").childNodes.length);
var node=range.getEnclosedNode();
alert(node&&node.$.id);
</script>
</body>
</html>
expected result:
alert x
actual result:
alert null
Changed 13 years ago by
| Attachment: | replacebycode2.html added |
|---|
comment:3 Changed 13 years ago by
| Keywords: | HasPatch added |
|---|---|
| Status: | new → confirmed |
| Version: | 3.6.4 (SVN - trunk) → 3.1.1 |
sorry, i thought garry will handle this bug
Most likely he will :) I've had in mind other users who will be having the same problem :)
Issue has been reproducible from CKEditor 3.1.1. I have attached sample to this ticket.
This patch seems to fix this particular issue. I'm not sure if it doesn't break code elsewhere. I will put it on review.
comment:4 Changed 13 years ago by
| Owner: | set to Jakub Ś |
|---|---|
| Status: | confirmed → review |
comment:5 Changed 12 years ago by
| Status: | review → assigned |
|---|
This patch needs to be transformed into a ticket branch on GitHub.

Could you also provide a sample page which ilustrates this problem in code?
Is actually no information. You haven't described the situation/steps to reproduce nor provided any sample page that would demonstrate the problem.
Problem may be obvious to you but not to other people reading it. Please bear this in mind when reporting tickets in the future.
Could you please provide an update.