Closed Bug 1599971 Opened 5 years ago Closed 5 years ago

Mark each method of `TextControlState` as `MOZ_CAN_RUN_SCRIPT` if necessary

Categories

(Core :: DOM: Editor, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox73 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(5 files)

No description provided.
Summary: Mark each method of `TextControlState` method as `MOZ_CAN_RUN_SCRIPT` if necessary → Mark each method of `TextControlState` as `MOZ_CAN_RUN_SCRIPT` if necessary

The destructor of AutoTextControlHandlingStateis marked as
MOZ_CAN_RUN_SCRIPT, but it's not checked at build time. And this does not
need to be created when the method does not run script. Therefore, we should
mark its constructor as MOZ_CAN_RUN_SCRIPT instead since it's stack only
class so that its constructor and destructor are always called from same
method.

They are really complicated and can run script while the instance is being
destroyed. Therefore, they should have their own AutoTextControlHandlingState
as "kungFuDeathGrip".

Depends on D55772

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

Depends on D55773

If PreareEditor() returns NS_OK, but if the instance is deleted at returning
from it, GetTextEditor() will access mTextEditor. Therefore, this patch
makes PrepareEditor() return error if the instance is destroyed at its end.

Depends on D55774

Attachment #9113406 - Attachment description: Bug 1599971 - part 5: Mark `TextControlState::BindToFrame()` and `TextControlState::UnbindFromFrame()` as `MOZ_CAN_RUN_SCRIPT` r=m_kato! → Bug 1599971 - part 5: Mark `TextControlState::UnbindFromFrame()` as `MOZ_CAN_RUN_SCRIPT` r=m_kato!
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/00fbfc983413 part 1: Mark constructors of `AutoTextControlHandlingState` as `MOZ_CAN_RUN_SCRIPT` r=m_kato https://hg.mozilla.org/integration/autoland/rev/5ac500c686d5 part 2: Mark `TextControlState::DeleteOrCacheForReuse()` and `TextControlState::Reuse()` as `MOZ_CAN_RUN_SCRIPT` r=m_kato https://hg.mozilla.org/integration/autoland/rev/263be8792c1d part 3: Mark `nsITextControlFrame::SetSelectionRange()` as `MOZ_CAN_RUN_SCRIPT` r=m_kato https://hg.mozilla.org/integration/autoland/rev/5814ca6a68ae part 4: Mark `TextControlState::GetTextEditor()` as `MOZ_CAN_RUN_SCRIPT` r=m_kato https://hg.mozilla.org/integration/autoland/rev/13bec3d1eba3 part 5: Mark `TextControlState::UnbindFromFrame()` as `MOZ_CAN_RUN_SCRIPT` r=m_kato,emilio

These patches might cause performance regression due to new kungFuDeathGrip creation cost. If it'd occur, we would need to try to redesign of the hot path.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: