Bug 1599971 - part 5: Mark TextControlState::UnbindFromFrame() as MOZ_CAN_RUN_SCRIPT r=m_kato,emilio

Note that `TextControlState::BindToFrame()` may also run script if it's
called without script blocker.  However, it shouldn't occur.  Therefore,
we don't need to mark it `MOZ_CAN_RUN_SCRIPT`, but we should check
script blocker existence with `MOZ_ASSERT`.

Differential Revision: https://phabricator.services.mozilla.com/D55776
This commit is contained in:
Masayuki Nakano
2019-12-11 03:04:20 +00:00
parent d217c0e1ac
commit 33564b47db
9 changed files with 28 additions and 9 deletions

View File

@@ -235,6 +235,7 @@ nsFrameSelection* HTMLTextAreaElement::GetConstFrameSelection() {
}
nsresult HTMLTextAreaElement::BindToFrame(nsTextControlFrame* aFrame) {
MOZ_ASSERT(!nsContentUtils::IsSafeToRunScript());
MOZ_ASSERT(mState);
return mState->BindToFrame(aFrame);
}