Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (267592 => 267593)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-09-25 21:26:29 UTC (rev 267592)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2020-09-25 21:29:46 UTC (rev 267593)
@@ -1,5 +1,18 @@
2020-09-25 Chris Dumez <[email protected]>
+ Unreviewed, reverting r267589.
+
+ Broke document.visibilityState when coming out of back/forward
+ cache
+
+ Reverted changeset:
+
+ "visibilitychange:hidden doesn't fire during page navigations"
+ https://bugs.webkit.org/show_bug.cgi?id=151234
+ https://trac.webkit.org/changeset/267589
+
+2020-09-25 Chris Dumez <[email protected]>
+
visibilitychange:hidden doesn't fire during page navigations
https://bugs.webkit.org/show_bug.cgi?id=151234
<rdar://problem/23688763>
Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (267592 => 267593)
--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json 2020-09-25 21:26:29 UTC (rev 267592)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json 2020-09-25 21:29:46 UTC (rev 267593)
@@ -336,7 +336,7 @@
"web-platform-tests/old-tests": "skip",
"web-platform-tests/orientation-event": "skip",
"web-platform-tests/orientation-sensor": "skip",
- "web-platform-tests/page-visibility": "import",
+ "web-platform-tests/page-visibility": "skip",
"web-platform-tests/paint-timing": "skip",
"web-platform-tests/payment-handler": "skip",
"web-platform-tests/payment-method-basic-card": "skip",
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/no_window_open_when_term_nesting_level_nonzero.window-expected.txt (267592 => 267593)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/no_window_open_when_term_nesting_level_nonzero.window-expected.txt 2020-09-25 21:26:29 UTC (rev 267592)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/no_window_open_when_term_nesting_level_nonzero.window-expected.txt 2020-09-25 21:29:46 UTC (rev 267593)
@@ -1,4 +1,3 @@
-CONSOLE MESSAGE: Error: assert_equals: expected no popup during visibilitychange expected null but got object "[object Window]"
CONSOLE MESSAGE: Error: assert_equals: expected no popup during pagehide expected null but got object "[object Window]"
CONSOLE MESSAGE: Error: assert_equals: expected no popup during unload expected null but got object "[object Window]"
Modified: trunk/Source/WebCore/ChangeLog (267592 => 267593)
--- trunk/Source/WebCore/ChangeLog 2020-09-25 21:26:29 UTC (rev 267592)
+++ trunk/Source/WebCore/ChangeLog 2020-09-25 21:29:46 UTC (rev 267593)
@@ -1,3 +1,16 @@
+2020-09-25 Chris Dumez <[email protected]>
+
+ Unreviewed, reverting r267589.
+
+ Broke document.visibilityState when coming out of back/forward
+ cache
+
+ Reverted changeset:
+
+ "visibilitychange:hidden doesn't fire during page navigations"
+ https://bugs.webkit.org/show_bug.cgi?id=151234
+ https://trac.webkit.org/changeset/267589
+
2020-09-25 Antoine Quint <[email protected]>
Add an experimental feature flag for CSS individual transform properties
Modified: trunk/Source/WebCore/dom/Document.cpp (267592 => 267593)
--- trunk/Source/WebCore/dom/Document.cpp 2020-09-25 21:26:29 UTC (rev 267592)
+++ trunk/Source/WebCore/dom/Document.cpp 2020-09-25 21:29:46 UTC (rev 267593)
@@ -1772,7 +1772,7 @@
// page. If there is no page associated with the document, we will assume
// that the page is hidden, as specified by the spec:
// https://w3c.github.io/page-visibility/#visibilitystate-attribute
- if (!m_frame || !m_frame->page() || m_isUnloadingOrUnloaded)
+ if (!m_frame || !m_frame->page())
return VisibilityState::Hidden;
return m_frame->page()->visibilityState();
}
Modified: trunk/Source/WebCore/dom/Document.h (267592 => 267593)
--- trunk/Source/WebCore/dom/Document.h 2020-09-25 21:26:29 UTC (rev 267592)
+++ trunk/Source/WebCore/dom/Document.h 2020-09-25 21:29:46 UTC (rev 267593)
@@ -491,8 +491,6 @@
void setTimerThrottlingEnabled(bool);
bool isTimerThrottlingEnabled() const { return m_isTimerThrottlingEnabled; }
- void markAsUnloadingOrUnloaded() { m_isUnloadingOrUnloaded = true; }
-
WEBCORE_EXPORT ExceptionOr<Ref<Node>> adoptNode(Node& source);
WEBCORE_EXPORT Ref<HTMLCollection> images();
@@ -2129,7 +2127,6 @@
bool m_hasStartedApplePaySession { false };
#endif
bool m_hasVisuallyNonEmptyCustomContent { false };
- bool m_isUnloadingOrUnloaded { false };
Ref<UndoManager> m_undoManager;
#if PLATFORM(IOS_FAMILY)
Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (267592 => 267593)
--- trunk/Source/WebCore/loader/FrameLoader.cpp 2020-09-25 21:26:29 UTC (rev 267592)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp 2020-09-25 21:29:46 UTC (rev 267593)
@@ -3275,15 +3275,14 @@
if (is<HTMLInputElement>(currentFocusedElement))
downcast<HTMLInputElement>(*currentFocusedElement).endEditing();
if (m_pageDismissalEventBeingDispatched == PageDismissalType::None) {
- m_frame.document()->markAsUnloadingOrUnloaded();
-
- m_frame.document()->dispatchEvent(Event::create(eventNames().visibilitychangeEvent, Event::CanBubble::Yes, Event::IsCancelable::No));
-
if (unloadEventPolicy == UnloadEventPolicyUnloadAndPageHide) {
m_pageDismissalEventBeingDispatched = PageDismissalType::PageHide;
m_frame.document()->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, m_frame.document()->backForwardCacheState() == Document::AboutToEnterBackForwardCache), m_frame.document());
}
+ // FIXME: update Page Visibility state here.
+ // https://bugs.webkit.org/show_bug.cgi?id=116770
+
if (m_frame.document()->backForwardCacheState() == Document::NotInBackForwardCache) {
Ref<Event> unloadEvent(Event::create(eventNames().unloadEvent, Event::CanBubble::No, Event::IsCancelable::No));
// The DocumentLoader (and thus its LoadTiming) might get destroyed