Fix insertion at end of textarea creating an extra pseudo-linebreak. b=319664 Patch by Eli Friedman <sharparrow1@yahoo.com>. r+sr=roc

This commit is contained in:
dbaron%dbaron.org 2005-12-20 09:13:47 +00:00
Родитель 1a5a5e3e34
Коммит 05796cb2e6
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -1764,11 +1764,17 @@ static ContentOffsets GetOffsetsOfFrame(nsIFrame* aFrame) {
nsCOMPtr<nsIContent> content, parent;
NS_ASSERTION(aFrame->GetContent(), "No content?!");
content = aFrame->GetContent();
if (aFrame->GetType() == nsLayoutAtoms::textFrame) {
nsIAtom* type = aFrame->GetType();
if (type == nsLayoutAtoms::textFrame) {
PRInt32 offset, offsetEnd;
aFrame->GetOffsets(offset, offsetEnd);
return ContentOffsets(content, offset, offsetEnd);
}
if (type == nsLayoutAtoms::brFrame) {
parent = content->GetParent();
PRInt32 beginOffset = parent->IndexOf(content);
return ContentOffsets(parent, beginOffset, beginOffset);
}
// Loop to deal with anonymous content, which has no index; this loop
// probably won't run more than twice under normal conditions
do {