зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
1a5a5e3e34
Коммит
05796cb2e6
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче