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:
parent
056d4fa9d3
commit
a5d6b75cc8
@ -1764,11 +1764,17 @@ static ContentOffsets GetOffsetsOfFrame(nsIFrame* aFrame) {
|
|||||||
nsCOMPtr<nsIContent> content, parent;
|
nsCOMPtr<nsIContent> content, parent;
|
||||||
NS_ASSERTION(aFrame->GetContent(), "No content?!");
|
NS_ASSERTION(aFrame->GetContent(), "No content?!");
|
||||||
content = aFrame->GetContent();
|
content = aFrame->GetContent();
|
||||||
if (aFrame->GetType() == nsLayoutAtoms::textFrame) {
|
nsIAtom* type = aFrame->GetType();
|
||||||
|
if (type == nsLayoutAtoms::textFrame) {
|
||||||
PRInt32 offset, offsetEnd;
|
PRInt32 offset, offsetEnd;
|
||||||
aFrame->GetOffsets(offset, offsetEnd);
|
aFrame->GetOffsets(offset, offsetEnd);
|
||||||
return ContentOffsets(content, 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
|
// Loop to deal with anonymous content, which has no index; this loop
|
||||||
// probably won't run more than twice under normal conditions
|
// probably won't run more than twice under normal conditions
|
||||||
do {
|
do {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user