mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-19 07:26:26 +00:00
![Masayuki Nakano](/assets/img/avatar_default.png)
It removes a script blocker. Therefore, although it depends on the caller whether it causes running script or not. However, we should mark it as `MOZ_CAN_RUN_SCRIPT` for safer code. It's called only by the destructor of `nsAutoCauseReflowNotifier`. Therefore, this patch also marks its constructor as `MOZ_CAN_RUN_SCRIPT` for making each creator method marked as `MOZ_CAN_RUN_SCRIPT` or `MOZ_CAN_RUN_SCRIPT_BOUNDARY`. Most of the creators is mutation listener methods. However, `PresShell` does nothing after destroying `nsAutoCauseReflowNotifier`. Therefore, this patch does not change the callers in MutationObserver.cpp to use `RefPtr<PresShell>` at calling them because changing it may cause performance regression. Perhaps, we should create another methods of `WillCauseReflow()` and `DidCauseReflow()` to avoid unnecessary `MOZ_CAN_RUN_SCRIPT` marking. However, I'm not sure whether most callers may run script or not because of outside of my knowledge. Differential Revision: https://phabricator.services.mozilla.com/D55805 --HG-- extra : moz-landing-system : lando