Opened 8 years ago
Closed 7 years ago
#14603 closed Bug (fixed)
Function "contains " in elementpath don't exclude root element if it is search from top
Reported by: | Ben Ng | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.0 |
Keywords: | Cc: |
Description
Steps to reproduce
- Call the contains function of a elementpath with excludeRoot and fromTop are both TRUE
Expected result
The root element should be excluded.
Actual result
The deepest element is excluded. It is because the elements array is reversed when fromTop is true. The root element is moved to the first element of the array instead of the last one. The for loop exclude the last element if excludeRoot is true.
Change History (3)
comment:1 Changed 8 years ago by
Keywords: | elementpath contains removed |
---|---|
Status: | new → confirmed |
Version: | 4.5.9 (GitHub - master) → 4.0 |
comment:2 Changed 7 years ago by
Faced the same issue, reported in to the GitHub in https://github.com/ckeditor/ckeditor-dev/issues/684 so it can be tracked there.
comment:3 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | confirmed → closed |
Problem can be reproduced at least from CKEditor 4.0.
HTML page: JS Code:
Result: According to documentation root elopement should be excluded and
null
should be logged. Instead body element is found.