Bug 1599971 - part 3: Mark nsITextControlFrame::SetSelectionRange() as MOZ_CAN_RUN_SCRIPT r=m_kato

Similar to the previous patch, it may notify selection listeners of native
anonymous tree in `<input>` and `<textarea>` element.

Differential Revision: https://phabricator.services.mozilla.com/D55774
This commit is contained in:
Masayuki Nakano
2019-12-11 03:02:53 +00:00
parent 137255a638
commit 1104815831
4 changed files with 18 additions and 14 deletions

View File

@@ -153,7 +153,7 @@ class RestoreSelectionState : public Runnable {
mFrame(aFrame),
mTextControlState(aState) {}
NS_IMETHOD Run() override {
MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHOD Run() override {
if (!mTextControlState) {
return NS_OK;
}
@@ -1989,6 +1989,7 @@ void TextControlState::SetSelectionProperties(
if (mBoundFrame) {
mBoundFrame->SetSelectionRange(aProps.GetStart(), aProps.GetEnd(),
aProps.GetDirection());
// The instance may have already been deleted here.
} else {
mSelectionProperties = aProps;
}