Fire onfreeze / onresume on Document and add eventlistners |
||||
Issue descriptiononfreeze / onresume should fire on Document rather than Window -- as this is more consistent with page-visibility which will be used tightly with these callbacks. Also support for addeventlistener seems missing.
,
Mar 29 2018
I think for changing from window to document, we need to add reasoning on the final choice. The addEventListener should work, but maybe there is something missing, I will investigate.
,
Mar 29 2018
domenic@ - could you confirm whether document (over window) makes sense to you? My reasoning was based on: 1. consistency with pagevisibility as that API is closely related and will be used tightly together 2. reading https://garykac.github.io/procspec/#global-objects specifically: Document: "Inject into about:blank and then navigate: Objects are not preserved." Window: "Inject into about:blank and then navigate: Objects are preserved."
,
Mar 29 2018
,
Apr 5 2018
,
Apr 7 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9d24fb5a17858ceacf59a2c5075a31876842eab8 commit 9d24fb5a17858ceacf59a2c5075a31876842eab8 Author: Fadi Meawad <fmeawad@chromium.org> Date: Sat Apr 07 01:21:41 2018 [PageLifecycle] window.onfreeze --> document.onfreeze After reconsideration, we decided that onfreeze and onresume should follow pagevisibility. Hence this CL moves the calls from window to document. There is no compatibility risk, since these calls are still behind a runtime flag. For more details on the decision, please check the bug. Bug: chromium:825424 Change-Id: I06af4579c58618f4131489ef62b5c8bc0927f2a3 Reviewed-on: https://chromium-review.googlesource.com/998841 Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Shubhie Panicker <panicker@chromium.org> Commit-Queue: Fadi Meawad <fmeawad@chromium.org> Cr-Commit-Position: refs/heads/master@{#549005} [modify] https://crrev.com/9d24fb5a17858ceacf59a2c5075a31876842eab8/chrome/browser/resource_coordinator/tab_manager_browsertest.cc [modify] https://crrev.com/9d24fb5a17858ceacf59a2c5075a31876842eab8/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt [modify] https://crrev.com/9d24fb5a17858ceacf59a2c5075a31876842eab8/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt [modify] https://crrev.com/9d24fb5a17858ceacf59a2c5075a31876842eab8/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt [modify] https://crrev.com/9d24fb5a17858ceacf59a2c5075a31876842eab8/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt [modify] https://crrev.com/9d24fb5a17858ceacf59a2c5075a31876842eab8/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt [modify] https://crrev.com/9d24fb5a17858ceacf59a2c5075a31876842eab8/third_party/WebKit/Source/core/dom/Document.h [modify] https://crrev.com/9d24fb5a17858ceacf59a2c5075a31876842eab8/third_party/WebKit/Source/core/dom/Document.idl [modify] https://crrev.com/9d24fb5a17858ceacf59a2c5075a31876842eab8/third_party/WebKit/Source/core/frame/DOMWindowEventHandlers.h [modify] https://crrev.com/9d24fb5a17858ceacf59a2c5075a31876842eab8/third_party/WebKit/Source/core/frame/LocalFrame.cpp [modify] https://crrev.com/9d24fb5a17858ceacf59a2c5075a31876842eab8/third_party/WebKit/Source/core/frame/WindowEventHandlers.idl
,
Apr 16 2018
I have moved the callbacks to Document, and tested the using addEventListener and it is working fine. Maybe I fixed something when moving it to Document. Closing this issue, feel free to reopen if addEventListener still does not work. |
||||
►
Sign in to add a comment |
||||
Comment 1 by panicker@chromium.org
, Mar 29 2018Owner: fmea...@chromium.org