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

git-svn-id: svn://10.0.0.236/trunk@186311 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org 2005-12-20 09:13:47 +00:00
parent 056d4fa9d3
commit a5d6b75cc8

View File

@ -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 {