mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
Bug 1347820 - Label ScrollSelectionIntoViewEvent for nsSelection. r=heycam
Since GetParentObject has a chance returning nullptr, we keep the original code path as a fallback. MozReview-Commit-ID: LCJefr1ZH6t --HG-- extra : rebase_source : 16b791d9555e9d3fb6e00233868249cbd08d944f
This commit is contained in:
parent
eec9e38f44
commit
6034613c83
@ -6183,9 +6183,18 @@ Selection::PostScrollSelectionIntoViewEvent(
|
||||
mScrollEvent.Revoke();
|
||||
|
||||
RefPtr<ScrollSelectionIntoViewEvent> ev =
|
||||
new ScrollSelectionIntoViewEvent(this, aRegion, aVertical, aHorizontal,
|
||||
aFlags);
|
||||
nsresult rv = NS_DispatchToCurrentThread(ev);
|
||||
new ScrollSelectionIntoViewEvent(this, aRegion, aVertical, aHorizontal,
|
||||
aFlags);
|
||||
nsresult rv;
|
||||
nsIDocument* doc = GetParentObject();
|
||||
if (doc) {
|
||||
rv = doc->Dispatch("ScrollSelectionIntoViewEvent",
|
||||
TaskCategory::Other,
|
||||
ev.forget());
|
||||
} else {
|
||||
rv = NS_DispatchToCurrentThread(ev);
|
||||
}
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mScrollEvent = ev;
|
||||
|
Loading…
Reference in New Issue
Block a user