static bool FindCommonGround(CssBoxHitChain startChain, CssBoxHitChain endChain, out int breakAtLevel)
{
//find common ground of startChain and endChain
int startChainCount = startChain.Count;
int endChainCount = endChain.Count;
int lim = Math.Min(startChainCount, endChainCount);
//from root to leave
breakAtLevel = 0;
for (int i = 0; i < lim; ++i)
{
var startHitInfo = startChain.GetHitInfo(i);
var endHitInfo = endChain.GetHitInfo(i);
if (startHitInfo.hitObject != endHitInfo.hitObject)
{
//found diff here
breakAtLevel = i;
break;
}
}
//----------------------------
//check
//return isDeepDown = endChainCount > startChainCount && (breakAtLevel == startChainCount - 1);
return endChainCount > startChainCount && (breakAtLevel == startChainCount - 1);
}