One particular part that might differ a bit than the currently specified definition of "fully active" is the check for whether the page's lifecycle state is "active" or not, as we should also categorize BFCached documents (and maybe prerendered documents as well?) as not "fully active" (see this section <https://w3ctag.github.io/design-principles/#support-non-fully-active> of TAG's design principles guideline). This is important because in Chrome's implementation we just keep a BFCached document as is without resetting the frame/window, so checking only those won't be enough.
(+Domenic Denicola <[email protected]> and others are currently working on updating the spec <https://github.com/whatwg/html/pull/6315#issuecomment-1050329620> to include the "lifecycle state" check too, probably by checking the browsing context status?) On Wed, Feb 23, 2022 at 4:51 AM Daniel Cheng <[email protected]> wrote: > I would be supportive of adding Document::IsFullyActive(), even if the > underlying implementation simply checks if Document::GetFrame() or > Document::domWindow() is null. That makes the intent more explicit rather > than a null test of a random pointer getter/field. > > Daniel > > On Tue, 22 Feb 2022 at 11:35, Stefan Zager <[email protected]> wrote: > >> I *think* (document->domWindow() != nullptr) is the right check for that. >> It's more typical to see (document->GetFrame() != nullptr) in the code, and >> that should also work; they should be interchangeable. >> >> On Tue, Feb 22, 2022 at 4:29 AM Raphael Kubo da Costa < >> [email protected]> wrote: >> >>> Hi Blinkers, >>> >>> https://html.spec.whatwg.org/multipage/browsers.html#fully-active >>> specifies what a fully active document is, and several specs check whether >>> a document is fully active in their algorithms. >>> >>> WebKit has Document::isFullyActive(), which essentially implements >>> HTML's definition: >>> https://github.com/WebKit/WebKit/blob/ee5042294047abd231e9f86f623d48924cbc2309/Source/WebCore/dom/Document.cpp#L2976 >>> >>> We don't seem to have anything similar in Blink though, and as far as I >>> can see different parts of the code implement that check differently. Some >>> examples I've encountered so far: >>> - Check ExecutionContext::IsContextDestroyed() >>> - Check Document::IsActive() >>> - Check Document::IsActive() and Document::GetFrame() >>> - Check ExecutionContextLifecycleObserver::DomWindow() or >>> ExecutionContextClient::DomWindow() (and optionally check >>> DomWindow()->GetFrame too) >>> >>> Is there a recommendation here? >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "blink-dev" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/c8141c56-158e-fe2d-e5b3-a72201e63327%40intel.com >>> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/c8141c56-158e-fe2d-e5b3-a72201e63327%40intel.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "blink-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHOQ7J_xkTqPmHt2zFW3e69nYG_rJvSB90-FYJb3G9wK%2BxnDqw%40mail.gmail.com >> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHOQ7J_xkTqPmHt2zFW3e69nYG_rJvSB90-FYJb3G9wK%2BxnDqw%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "blink-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAF3XrKo0AhjnMzACg9NyJeeE9Y1vTY6trtan%2Bwe36qgwS8gTpg%40mail.gmail.com > <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAF3XrKo0AhjnMzACg9NyJeeE9Y1vTY6trtan%2Bwe36qgwS8gTpg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACPC1r4rGcD8pRu1LPnB31io4wRb7T4vcQsV%2BLck-KCoBx1tFQ%40mail.gmail.com.
