﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1384	PATCH: FCKDomRange CheckStartOfBlock()	Scott McNaught		"I was playing around with FCKDomRange today and I have found some problems with it.  I have altered it to work as expected and attached a patch. There are 4 things that this patch changes in FCKDomRange.

1) The CheckStartOfBlock() method does not factor in opening inline tags when the cursor is at the start. Eg:


{{{
<p><strong>Some text</strong></p>
          ^
}}}

oRange.CheckStartOfBlock() returns FALSE.  This is incorrect behaviour when CheckEndofBlock() does check for empty inline tags.

2) Because the two methods use the same code to determine whether the selection has contents, I have moved the checking code into CheckIsEmpty().  I have added a parameter to this function: bCheckEmptyInline.

When this parameter is set to true, it will check for empty inline elements such as <strong></strong>

This also has the added benefit of providing the additional functionality to the CheckIsEmpty() function.

3) The existing code for checking to see whether the selection contents was buggy.
The code does not detect a series of sibling empty inline elements such as: <strong></strong><u><strong></strong></u>

I have created an inline recursive function which will check to see if all the children of an element are inline. This function is called: AreAllChildrenInline

4) I have made CheckStartOfBlock and CheckEndOfBlock have the same method signatures, and execute the same code (except reversing the selection direction).


----


This patch will potentially impact: Anything that calls ""CheckStartOfBlock"", and potentially some things which rely on the existing detection of inline elements.

If anything though, I think that this patch will only make the code more stable, and fix some edge cases where there is messed up HTML with wierd formatting elements at the start and ends of blocks.

Please consider applying this patch.

Thanks,

Scott McNaught
Synergy 8"	Bug	closed	Normal		General	SVN (FCKeditor) - Retired	fixed		
