Changeset 267589 in webkit
- Timestamp:
- Sep 25, 2020 1:11:48 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 30 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r267578 r267589 1 2020-09-25 Chris Dumez <cdumez@apple.com> 2 3 visibilitychange:hidden doesn't fire during page navigations 4 https://bugs.webkit.org/show_bug.cgi?id=151234 5 <rdar://problem/23688763> 6 7 Reviewed by Darin Adler and Ryosuke Niwa. 8 9 Import page-visibility WPT tests from upstream. 10 11 * resources/import-expectations.json: 12 * web-platform-tests/page-visibility/*: Added. 13 1 14 2020-09-25 Frederic Wang <fwang@igalia.com> 2 15 -
trunk/LayoutTests/imported/w3c/resources/import-expectations.json
r267531 r267589 337 337 "web-platform-tests/orientation-event": "skip", 338 338 "web-platform-tests/orientation-sensor": "skip", 339 "web-platform-tests/page-visibility": " skip",339 "web-platform-tests/page-visibility": "import", 340 340 "web-platform-tests/paint-timing": "skip", 341 341 "web-platform-tests/payment-handler": "skip", -
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
r259900 r267589 1 CONSOLE MESSAGE: Error: assert_equals: expected no popup during visibilitychange expected null but got object "[object Window]" 1 2 CONSOLE MESSAGE: Error: assert_equals: expected no popup during pagehide expected null but got object "[object Window]" 2 3 CONSOLE MESSAGE: Error: assert_equals: expected no popup during unload expected null but got object "[object Window]" -
trunk/Source/WebCore/ChangeLog
r267588 r267589 1 2020-09-25 Chris Dumez <cdumez@apple.com> 2 3 visibilitychange:hidden doesn't fire during page navigations 4 https://bugs.webkit.org/show_bug.cgi?id=151234 5 <rdar://problem/23688763> 6 7 Reviewed by Darin Adler and Ryosuke Niwa. 8 9 Fire a visibilitychange during document unload, as per the specification: 10 - https://www.w3.org/TR/page-visibility/#reacting-to-visibilitychange-changes 11 - https://html.spec.whatwg.org/multipage/browsing-the-web.html#unloading-document-visibility-change-steps 12 13 Tests: imported/w3c/web-platform-tests/page-visibility/idlharness.window.html 14 imported/w3c/web-platform-tests/page-visibility/iframe-unload.html 15 imported/w3c/web-platform-tests/page-visibility/onvisibilitychange.html 16 imported/w3c/web-platform-tests/page-visibility/test_attributes_exist.html 17 imported/w3c/web-platform-tests/page-visibility/test_child_document.html 18 imported/w3c/web-platform-tests/page-visibility/test_default_view.html 19 imported/w3c/web-platform-tests/page-visibility/test_read_only.html 20 imported/w3c/web-platform-tests/page-visibility/unload-bubbles.html 21 imported/w3c/web-platform-tests/page-visibility/unload.html 22 23 * dom/Document.cpp: 24 (WebCore::Document::visibilityState const): 25 * dom/Document.h: 26 (WebCore::Document::setIsUnloadingOrUnloaded): 27 * loader/FrameLoader.cpp: 28 (WebCore::FrameLoader::dispatchUnloadEvents): 29 1 30 2020-09-25 Fujii Hironori <Hironori.Fujii@sony.com> 2 31 -
trunk/Source/WebCore/dom/Document.cpp
r267550 r267589 1773 1773 // that the page is hidden, as specified by the spec: 1774 1774 // https://w3c.github.io/page-visibility/#visibilitystate-attribute 1775 if (!m_frame || !m_frame->page() )1775 if (!m_frame || !m_frame->page() || m_isUnloadingOrUnloaded) 1776 1776 return VisibilityState::Hidden; 1777 1777 return m_frame->page()->visibilityState(); -
trunk/Source/WebCore/dom/Document.h
r267220 r267589 492 492 bool isTimerThrottlingEnabled() const { return m_isTimerThrottlingEnabled; } 493 493 494 void markAsUnloadingOrUnloaded() { m_isUnloadingOrUnloaded = true; } 495 494 496 WEBCORE_EXPORT ExceptionOr<Ref<Node>> adoptNode(Node& source); 495 497 … … 2128 2130 #endif 2129 2131 bool m_hasVisuallyNonEmptyCustomContent { false }; 2132 bool m_isUnloadingOrUnloaded { false }; 2130 2133 2131 2134 Ref<UndoManager> m_undoManager; -
trunk/Source/WebCore/loader/FrameLoader.cpp
r267449 r267589 3276 3276 downcast<HTMLInputElement>(*currentFocusedElement).endEditing(); 3277 3277 if (m_pageDismissalEventBeingDispatched == PageDismissalType::None) { 3278 m_frame.document()->markAsUnloadingOrUnloaded(); 3279 3280 m_frame.document()->dispatchEvent(Event::create(eventNames().visibilitychangeEvent, Event::CanBubble::Yes, Event::IsCancelable::No)); 3281 3278 3282 if (unloadEventPolicy == UnloadEventPolicyUnloadAndPageHide) { 3279 3283 m_pageDismissalEventBeingDispatched = PageDismissalType::PageHide; 3280 3284 m_frame.document()->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, m_frame.document()->backForwardCacheState() == Document::AboutToEnterBackForwardCache), m_frame.document()); 3281 3285 } 3282 3283 // FIXME: update Page Visibility state here.3284 // https://bugs.webkit.org/show_bug.cgi?id=1167703285 3286 3286 3287 if (m_frame.document()->backForwardCacheState() == Document::NotInBackForwardCache) {
Note: See TracChangeset
for help on using the changeset viewer.