mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1258308 - Lookup the frame (continuation) associated with aParentNode/aOffset instead of assuming it's always the primary frame (follow-up from bug 1237236). r=ehsan
This commit is contained in:
parent
100dda0d7d
commit
c42a275582
@ -4939,6 +4939,11 @@ Selection::Collapse(nsINode& aParentNode, uint32_t aOffset, ErrorResult& aRv)
|
||||
// Hack to display the caret on the right line (bug 1237236).
|
||||
if (aParentNode.IsContent()) {
|
||||
nsTextFrame* f = do_QueryFrame(aParentNode.AsContent()->GetPrimaryFrame());
|
||||
if (f) {
|
||||
int32_t frameOffset;
|
||||
f = do_QueryFrame(nsCaret::GetFrameAndOffset(this, &aParentNode,
|
||||
aOffset, &frameOffset));
|
||||
}
|
||||
if (f && f->IsAtEndOfLine() && f->HasSignificantTerminalNewline()) {
|
||||
if (f->GetContentEnd() == int32_t(aOffset)) {
|
||||
mFrameSelection->SetHint(CARET_ASSOCIATE_AFTER);
|
||||
|
Loading…
Reference in New Issue
Block a user