Changeset 150695 in webkit
- Timestamp:
- May 25, 2013 4:56:01 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r150694 r150695 1 2013-05-25 Simon Fraser <simon.fraser@apple.com> 2 3 Unprefix Page Visibility API 4 https://bugs.webkit.org/show_bug.cgi?id=102340 5 6 Reviewed by Tim Horton. 7 8 Remove prefixes, adjust to state name changes. 9 10 * fast/events/page-visibility-iframe-delete-test.html: 11 * fast/events/page-visibility-iframe-move-test-expected.txt: 12 * fast/events/page-visibility-iframe-move-test.html: 13 * fast/events/page-visibility-iframe-propagation-test-expected.txt: 14 * fast/events/page-visibility-iframe-propagation-test.html: 15 * fast/events/page-visibility-null-view-expected.txt: 16 * fast/events/page-visibility-null-view.html: 17 * fast/events/page-visibility-transition-test-expected.txt: 18 * fast/events/page-visibility-transition-test.html: 19 1 20 2013-05-25 Filip Pizlo <fpizlo@apple.com> 2 21 -
trunk/LayoutTests/fast/events/page-visibility-iframe-delete-test.html
r140469 r150695 33 33 34 34 document.addEventListener( 35 " webkitvisibilitychange", onMainPageVisibilityChange, false);35 "visibilitychange", onMainPageVisibilityChange, false); 36 36 frame2.contentDocument.addEventListener( 37 " webkitvisibilitychange", onFrame2VisibilityChange, false);37 "visibilitychange", onFrame2VisibilityChange, false); 38 38 // Change the visibility of the current page to invisible. 39 39 if (window.testRunner) { -
trunk/LayoutTests/fast/events/page-visibility-iframe-move-test-expected.txt
r87802 r150695 6 6 Window 1 Loaded 7 7 Window 2 Loaded 8 PASS window.document. webkitHidden is false9 PASS window2.document. webkitHidden is false10 PASS iframe.contentDocument. webkitHidden is false11 PASS window.document. webkitHidden is true12 PASS window2.document. webkitHidden is false13 PASS iframe.contentDocument. webkitHidden is false8 PASS window.document.hidden is false 9 PASS window2.document.hidden is false 10 PASS iframe.contentDocument.hidden is false 11 PASS window.document.hidden is true 12 PASS window2.document.hidden is false 13 PASS iframe.contentDocument.hidden is false 14 14 Adopted iframe to Window 1 15 PASS window.document. webkitHidden is true16 PASS window2.document. webkitHidden is false17 PASS iframe.contentDocument. webkitHidden is true15 PASS window.document.hidden is true 16 PASS window2.document.hidden is false 17 PASS iframe.contentDocument.hidden is true 18 18 PASS successfullyParsed is true 19 19 -
trunk/LayoutTests/fast/events/page-visibility-iframe-move-test.html
r120792 r150695 18 18 iframe = window2.document.getElementById("iframe"); 19 19 20 shouldBeFalse("window.document. webkitHidden");21 shouldBeFalse("window2.document. webkitHidden");22 shouldBeFalse("iframe.contentDocument. webkitHidden");20 shouldBeFalse("window.document.hidden"); 21 shouldBeFalse("window2.document.hidden"); 22 shouldBeFalse("iframe.contentDocument.hidden"); 23 23 24 24 // Change the visibility of the current page to invisible. … … 30 30 31 31 function onVisibilityChange() { 32 shouldBeTrue("window.document. webkitHidden");33 shouldBeFalse("window2.document. webkitHidden");34 shouldBeFalse("iframe.contentDocument. webkitHidden");32 shouldBeTrue("window.document.hidden"); 33 shouldBeFalse("window2.document.hidden"); 34 shouldBeFalse("iframe.contentDocument.hidden"); 35 35 36 36 window.document.adoptNode(iframe); … … 38 38 debug("Adopted iframe to Window 1"); 39 39 40 shouldBeTrue("window.document. webkitHidden");41 shouldBeFalse("window2.document. webkitHidden");42 shouldBeTrue("iframe.contentDocument. webkitHidden");40 shouldBeTrue("window.document.hidden"); 41 shouldBeFalse("window2.document.hidden"); 42 shouldBeTrue("iframe.contentDocument.hidden"); 43 43 44 44 window2.close(); … … 54 54 55 55 debug("Window 1 Loaded"); 56 document.addEventListener(" webkitvisibilitychange",56 document.addEventListener("visibilitychange", 57 57 onVisibilityChange, false); 58 58 -
trunk/LayoutTests/fast/events/page-visibility-iframe-propagation-test-expected.txt
r87802 r150695 5 5 6 6 Main Page: 7 PASS document. webkitVisibilityState is "visible"8 PASS document. webkitHidden is false7 PASS document.visibilityState is "visible" 8 PASS document.hidden is false 9 9 Child Frame: 10 PASS childFrame.contentDocument. webkitVisibilityState is "visible"11 PASS childFrame.contentDocument. webkitHidden is false10 PASS childFrame.contentDocument.visibilityState is "visible" 11 PASS childFrame.contentDocument.hidden is false 12 12 Main Page: 13 PASS document. webkitVisibilityState is "hidden"14 PASS document. webkitHidden is true13 PASS document.visibilityState is "hidden" 14 PASS document.hidden is true 15 15 Child Frame: 16 PASS childFrame.contentDocument. webkitVisibilityState is "hidden"17 PASS childFrame.contentDocument. webkitHidden is true16 PASS childFrame.contentDocument.visibilityState is "hidden" 17 PASS childFrame.contentDocument.hidden is true 18 18 Main Page: 19 PASS document. webkitVisibilityState is "visible"20 PASS document. webkitHidden is false19 PASS document.visibilityState is "visible" 20 PASS document.hidden is false 21 21 Child Frame: 22 PASS childFrame.contentDocument. webkitVisibilityState is "visible"23 PASS childFrame.contentDocument. webkitHidden is false22 PASS childFrame.contentDocument.visibilityState is "visible" 23 PASS childFrame.contentDocument.hidden is false 24 24 PASS successfullyParsed is true 25 25 -
trunk/LayoutTests/fast/events/page-visibility-iframe-propagation-test.html
r120792 r150695 22 22 function checkIsPageVisible() { 23 23 debug("Main Page:"); 24 shouldBeEqualToString("document. webkitVisibilityState", "visible");25 shouldBeFalse("document. webkitHidden");24 shouldBeEqualToString("document.visibilityState", "visible"); 25 shouldBeFalse("document.hidden"); 26 26 } 27 27 28 28 function checkIsPageHidden() { 29 29 debug("Main Page:"); 30 shouldBeEqualToString("document. webkitVisibilityState", "hidden");31 shouldBeTrue("document. webkitHidden");30 shouldBeEqualToString("document.visibilityState", "hidden"); 31 shouldBeTrue("document.hidden"); 32 32 } 33 33 34 34 function checkIsChildFrameVisible() { 35 35 debug("Child Frame:"); 36 shouldBeEqualToString("childFrame.contentDocument. webkitVisibilityState",36 shouldBeEqualToString("childFrame.contentDocument.visibilityState", 37 37 "visible"); 38 shouldBeFalse("childFrame.contentDocument. webkitHidden");38 shouldBeFalse("childFrame.contentDocument.hidden"); 39 39 } 40 40 41 41 function checkIsChildFrameHidden() { 42 42 debug("Child Frame:"); 43 shouldBeEqualToString("childFrame.contentDocument. webkitVisibilityState",43 shouldBeEqualToString("childFrame.contentDocument.visibilityState", 44 44 "hidden"); 45 shouldBeTrue("childFrame.contentDocument. webkitHidden");45 shouldBeTrue("childFrame.contentDocument.hidden"); 46 46 } 47 47 … … 57 57 childFrame = document.getElementById("childFrame"); 58 58 childFrame.contentDocument.addEventListener( 59 " webkitvisibilitychange", onChildFrameVisibilityChange, false);60 document.addEventListener(" webkitvisibilitychange",59 "visibilitychange", onChildFrameVisibilityChange, false); 60 document.addEventListener("visibilitychange", 61 61 onVisibilityChange, false); 62 62 -
trunk/LayoutTests/fast/events/page-visibility-null-view-expected.txt
r131530 r150695 5 5 6 6 PASS subdocument.defaultView == null is true 7 PASS subdocument. webkitVisibilityState is "hidden"8 PASS subdocument. webkitHidden is true7 PASS subdocument.visibilityState is "hidden" 8 PASS subdocument.hidden is true 9 9 PASS successfullyParsed is true 10 10 -
trunk/LayoutTests/fast/events/page-visibility-null-view.html
r131530 r150695 10 10 11 11 shouldBeTrue("subdocument.defaultView == null"); 12 shouldBeEqualToString("subdocument. webkitVisibilityState", "hidden");13 shouldBeTrue("subdocument. webkitHidden");12 shouldBeEqualToString("subdocument.visibilityState", "hidden"); 13 shouldBeTrue("subdocument.hidden"); 14 14 15 15 </script> -
trunk/LayoutTests/fast/events/page-visibility-transition-test-expected.txt
r112664 r150695 4 4 5 5 6 PASS document. webkitVisibilityState is "visible"7 PASS document. webkitHidden is false8 PASS document. webkitVisibilityState is "hidden"9 PASS document. webkitHidden is true10 PASS document. webkitVisibilityState is "hidden"11 PASS document. webkitHidden is true12 PASS document. webkitVisibilityState is "prerender"13 PASS document. webkitHidden is true14 PASS document. webkitVisibilityState is "visible"15 PASS document. webkitHidden is false16 PASS document. webkitVisibilityState is "preview"17 PASS document. webkitHidden is true18 PASS document. webkitVisibilityState is "visible"19 PASS document. webkitHidden is false6 PASS document.visibilityState is "visible" 7 PASS document.hidden is false 8 PASS document.visibilityState is "hidden" 9 PASS document.hidden is true 10 PASS document.visibilityState is "hidden" 11 PASS document.hidden is true 12 PASS document.visibilityState is "prerender" 13 PASS document.hidden is true 14 PASS document.visibilityState is "visible" 15 PASS document.hidden is false 16 PASS document.visibilityState is "unloaded" 17 PASS document.hidden is true 18 PASS document.visibilityState is "visible" 19 PASS document.hidden is false 20 20 PASS successfullyParsed is true 21 21 -
trunk/LayoutTests/fast/events/page-visibility-transition-test.html
r120792 r150695 25 25 } 26 26 27 function makePage Preview() {27 function makePageUnloaded() { 28 28 if (window.testRunner) 29 testRunner.setPageVisibility(" preview");29 testRunner.setPageVisibility("unloaded"); 30 30 } 31 31 32 32 function checkIsPageVisible() { 33 shouldBeEqualToString("document. webkitVisibilityState", "visible");34 shouldBeFalse("document. webkitHidden");33 shouldBeEqualToString("document.visibilityState", "visible"); 34 shouldBeFalse("document.hidden"); 35 35 } 36 36 37 37 function checkIsPageHidden() { 38 shouldBeEqualToString("document. webkitVisibilityState", "hidden");39 shouldBeTrue("document. webkitHidden");38 shouldBeEqualToString("document.visibilityState", "hidden"); 39 shouldBeTrue("document.hidden"); 40 40 } 41 41 42 42 function checkIsPagePrerendering() { 43 shouldBeEqualToString("document. webkitVisibilityState", "prerender");44 shouldBeTrue("document. webkitHidden");43 shouldBeEqualToString("document.visibilityState", "prerender"); 44 shouldBeTrue("document.hidden"); 45 45 } 46 46 47 function checkIsPageIn Preview() {48 shouldBeEqualToString("document. webkitVisibilityState", "preview");49 shouldBeTrue("document. webkitHidden");47 function checkIsPageInUnloaded() { 48 shouldBeEqualToString("document.visibilityState", "unloaded"); 49 shouldBeTrue("document.hidden"); 50 50 } 51 51 … … 56 56 // 3 - prerender (should fire event). 57 57 // 4 - visible (should fire event). 58 // 5 - preview(should fire event).58 // 5 - unloaded (should fire event). 59 59 // 6 - visible (should fire event). 60 60 var numVisibilityChanges = 0; … … 62 62 function startTest() { 63 63 document.addEventListener( 64 " webkitvisibilitychange", onVisibilityChange, false);64 "visibilitychange", onVisibilityChange, false); 65 65 checkIsPageVisible(); 66 66 numVisibilityChanges++; … … 96 96 checkIsPageVisible(); 97 97 numVisibilityChanges++; 98 makePage Preview();98 makePageUnloaded(); 99 99 return; 100 100 } else if (numVisibilityChanges == 5) { 101 checkIsPageIn Preview();101 checkIsPageInUnloaded(); 102 102 numVisibilityChanges++; 103 103 makePageVisible(); -
trunk/Source/WebCore/ChangeLog
r150692 r150695 1 2013-05-25 Simon Fraser <simon.fraser@apple.com> 2 3 Unprefix Page Visibility API 4 https://bugs.webkit.org/show_bug.cgi?id=102340 5 6 Reviewed by Tim Horton. 7 8 Remove prefixes from the document properties, and the visibilitychanged event. 9 10 Rename the "preview" state to "unloaded". The "unloaded" state is never 11 reached yet (see https://bugs.webkit.org/show_bug.cgi?id=116769). 12 13 Add some comments to places where we should update the visibility state 14 when going in and out of the page cache, but cannot safely do so yet. 15 16 Tested by existing Page Visibility tests. 17 18 * dom/Document.cpp: 19 (WebCore::Document::pageVisibilityState): 20 (WebCore::Document::visibilityState): 21 (WebCore::Document::hidden): 22 (WebCore::Document::dispatchVisibilityStateChangeEvent): 23 * dom/Document.h: 24 * dom/Document.idl: 25 * dom/EventNames.h: 26 * history/CachedFrame.cpp: 27 (WebCore::CachedFrameBase::restore): 28 * loader/FrameLoader.cpp: 29 (WebCore::FrameLoader::stopLoading): 30 * page/Page.cpp: 31 (WebCore::Page::setVisibilityState): 32 * page/PageVisibilityState.cpp: 33 (WebCore::pageVisibilityStateString): 34 * page/PageVisibilityState.h: 35 1 36 2013-05-25 Andreas Kling <akling@apple.com> 2 37 -
trunk/Source/WebCore/dom/Document.cpp
r150686 r150695 1599 1599 1600 1600 #if ENABLE(PAGE_VISIBILITY_API) 1601 PageVisibilityState Document:: visibilityState() const1601 PageVisibilityState Document::pageVisibilityState() const 1602 1602 { 1603 1603 // The visibility of the document is inherited from the visibility of the … … 1610 1610 } 1611 1611 1612 String Document:: webkitVisibilityState() const1613 { 1614 return pageVisibilityStateString( visibilityState());1615 } 1616 1617 bool Document:: webkitHidden() const1618 { 1619 return visibilityState() != PageVisibilityStateVisible;1612 String Document::visibilityState() const 1613 { 1614 return pageVisibilityStateString(pageVisibilityState()); 1615 } 1616 1617 bool Document::hidden() const 1618 { 1619 return pageVisibilityState() != PageVisibilityStateVisible; 1620 1620 } 1621 1621 1622 1622 void Document::dispatchVisibilityStateChangeEvent() 1623 1623 { 1624 dispatchEvent(Event::create(eventNames(). webkitvisibilitychangeEvent, false, false));1624 dispatchEvent(Event::create(eventNames().visibilitychangeEvent, false, false)); 1625 1625 } 1626 1626 #endif -
trunk/Source/WebCore/dom/Document.h
r150683 r150695 318 318 #endif 319 319 #if ENABLE(PAGE_VISIBILITY_API) 320 DEFINE_ATTRIBUTE_EVENT_LISTENER( webkitvisibilitychange);320 DEFINE_ATTRIBUTE_EVENT_LISTENER(visibilitychange); 321 321 #endif 322 322 #if ENABLE(CSP_NEXT) … … 411 411 412 412 #if ENABLE(PAGE_VISIBILITY_API) 413 String webkitVisibilityState() const;414 bool webkitHidden() const;413 String visibilityState() const; 414 bool hidden() const; 415 415 void dispatchVisibilityStateChangeEvent(); 416 416 #endif … … 1269 1269 1270 1270 #if ENABLE(PAGE_VISIBILITY_API) 1271 PageVisibilityState visibilityState() const;1271 PageVisibilityState pageVisibilityState() const; 1272 1272 #endif 1273 1273 -
trunk/Source/WebCore/dom/Document.idl
r149368 r150695 380 380 381 381 // Page visibility API. 382 [Conditional=PAGE_VISIBILITY_API] readonly attribute DOMString webkitVisibilityState;383 [Conditional=PAGE_VISIBILITY_API] readonly attribute boolean webkitHidden;382 [Conditional=PAGE_VISIBILITY_API] readonly attribute DOMString visibilityState; 383 [Conditional=PAGE_VISIBILITY_API] readonly attribute boolean hidden; 384 384 385 385 // Security Policy API: http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#script-interfaces -
trunk/Source/WebCore/dom/EventNames.h
r150356 r150695 122 122 macro(upgradeneeded) \ 123 123 macro(versionchange) \ 124 macro( webkitvisibilitychange) \124 macro(visibilitychange) \ 125 125 macro(write) \ 126 126 macro(writeend) \ -
trunk/Source/WebCore/history/CachedFrame.cpp
r150560 r150695 134 134 m_childFrames[i]->open(); 135 135 136 // FIXME: update Page Visibility state here. 137 // https://bugs.webkit.org/show_bug.cgi?id=116770 138 136 139 m_document->enqueuePageshowEvent(PageshowEventPersisted); 137 140 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r150293 r150695 403 403 m_frame->document()->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, m_frame->document()->inPageCache()), m_frame->document()); 404 404 } 405 406 // FIXME: update Page Visibility state here. 407 // https://bugs.webkit.org/show_bug.cgi?id=116770 408 405 409 if (!m_frame->document()->inPageCache()) { 406 410 RefPtr<Event> unloadEvent(Event::create(eventNames().unloadEvent, false, false)); -
trunk/Source/WebCore/page/Page.cpp
r150633 r150695 1253 1253 void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitialState) 1254 1254 { 1255 // FIXME: the visibility state needs to be stored on the top-level document 1256 // https://bugs.webkit.org/show_bug.cgi?id=116769 1255 1257 #if ENABLE(PAGE_VISIBILITY_API) 1256 1258 if (m_visibilityState == visibilityState) -
trunk/Source/WebCore/page/PageVisibilityState.cpp
r127062 r150695 41 41 DEFINE_STATIC_LOCAL(const String, hidden, (ASCIILiteral("hidden"))); 42 42 DEFINE_STATIC_LOCAL(const String, prerender, (ASCIILiteral("prerender"))); 43 DEFINE_STATIC_LOCAL(const String, preview, (ASCIILiteral("preview")));43 DEFINE_STATIC_LOCAL(const String, unloaded, (ASCIILiteral("unloaded"))); 44 44 45 45 switch (state) { … … 50 50 case PageVisibilityStatePrerender: 51 51 return prerender; 52 case PageVisibilityState Preview:53 return preview;52 case PageVisibilityStateUnloaded: 53 return unloaded; 54 54 } 55 55 -
trunk/Source/WebCore/page/PageVisibilityState.h
r112664 r150695 42 42 PageVisibilityStateHidden, 43 43 PageVisibilityStatePrerender, 44 PageVisibilityState Preview44 PageVisibilityStateUnloaded 45 45 }; 46 46 -
trunk/Source/WebKit/efl/ChangeLog
r150680 r150695 1 2013-05-25 Simon Fraser <simon.fraser@apple.com> 2 3 Unprefix Page Visibility API 4 https://bugs.webkit.org/show_bug.cgi?id=102340 5 6 Reviewed by Tim Horton. 7 8 Rename "preview" state to "unloaded" state. 9 10 * WebCoreSupport/AssertMatchingEnums.cpp: 11 * ewk/ewk_view.h: 12 1 13 2013-05-24 Seokju Kwon <seokju.kwon@gmail.com> 2 14 -
trunk/Source/WebKit/efl/WebCoreSupport/AssertMatchingEnums.cpp
r148355 r150695 53 53 COMPILE_ASSERT_MATCHING_ENUM(EWK_PAGE_VISIBILITY_STATE_HIDDEN, PageVisibilityStateHidden); 54 54 COMPILE_ASSERT_MATCHING_ENUM(EWK_PAGE_VISIBILITY_STATE_PRERENDER, PageVisibilityStatePrerender); 55 COMPILE_ASSERT_MATCHING_ENUM(EWK_PAGE_VISIBILITY_STATE_ PREVIEW, PageVisibilityStatePreview);55 COMPILE_ASSERT_MATCHING_ENUM(EWK_PAGE_VISIBILITY_STATE_UNLOADED, PageVisibilityStateUnloaded); 56 56 #endif 57 57 -
trunk/Source/WebKit/efl/ewk/ewk_view.h
r150663 r150695 2488 2488 EWK_PAGE_VISIBILITY_STATE_HIDDEN, 2489 2489 EWK_PAGE_VISIBILITY_STATE_PRERENDER, 2490 EWK_PAGE_VISIBILITY_STATE_ PREVIEW2490 EWK_PAGE_VISIBILITY_STATE_UNLOADED 2491 2491 }; 2492 2492 /// Creates a type name for @a _Ewk_Page_Visibility_State. -
trunk/Source/WebKit/mac/ChangeLog
r150688 r150695 1 2013-05-25 Simon Fraser <simon.fraser@apple.com> 2 3 Unprefix Page Visibility API 4 https://bugs.webkit.org/show_bug.cgi?id=102340 5 6 Reviewed by Tim Horton. 7 8 Renaming of the "preview" state to "unloaded". 9 10 * WebView/WebView.mm: 11 * WebView/WebViewPrivate.h: 12 1 13 2013-05-25 Dan Bernstein <mitz@apple.com> 2 14 -
trunk/Source/WebKit/mac/WebView/WebView.mm
r150663 r150695 422 422 case WebPageVisibilityStatePrerender: 423 423 return PageVisibilityStatePrerender; 424 case WebPageVisibilityState Preview:425 return PageVisibilityState Preview;424 case WebPageVisibilityStateUnloaded: 425 return PageVisibilityStateUnloaded; 426 426 } 427 427 -
trunk/Source/WebKit/mac/WebView/WebViewPrivate.h
r147447 r150695 120 120 WebPageVisibilityStateHidden, 121 121 WebPageVisibilityStatePrerender, 122 WebPageVisibilityState Preview122 WebPageVisibilityStateUnloaded 123 123 } WebPageVisibilityState; 124 124 -
trunk/Source/WebKit2/ChangeLog
r150692 r150695 1 2013-05-25 Simon Fraser <simon.fraser@apple.com> 2 3 Unprefix Page Visibility API 4 https://bugs.webkit.org/show_bug.cgi?id=102340 5 6 Reviewed by Tim Horton. 7 8 Renaming of the "preview" state to "unloaded". 9 10 * Shared/API/c/WKPageVisibilityTypes.h: 11 * Shared/API/c/WKSharedAPICast.h: 12 (WebKit::toPageVisibilityState): 13 1 14 2013-05-25 Andreas Kling <akling@apple.com> 2 15 -
trunk/Source/WebKit2/Shared/API/c/WKPageVisibilityTypes.h
r141010 r150695 35 35 kWKPageVisibilityStateHidden, 36 36 kWKPageVisibilityStatePrerender, 37 kWKPageVisibilityState Preview37 kWKPageVisibilityStateUnloaded 38 38 }; 39 39 typedef uint32_t WKPageVisibilityState; -
trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h
r150277 r150695 842 842 case kWKPageVisibilityStatePrerender: 843 843 return WebCore::PageVisibilityStatePrerender; 844 case kWKPageVisibilityState Preview:845 return WebCore::PageVisibilityState Preview;844 case kWKPageVisibilityStateUnloaded: 845 return WebCore::PageVisibilityStateUnloaded; 846 846 } 847 847 -
trunk/Tools/ChangeLog
r150677 r150695 1 2013-05-25 Simon Fraser <simon.fraser@apple.com> 2 3 Unprefix Page Visibility API 4 https://bugs.webkit.org/show_bug.cgi?id=102340 5 6 Reviewed by Tim Horton. 7 8 Rename "preview" state to "unloaded" state, and adjust the tests 9 to test for it. 10 11 * DumpRenderTree/mac/TestRunnerMac.mm: 12 (TestRunner::setPageVisibility): 13 * TestWebKitAPI/Tests/WebKit2/PageVisibilityState.cpp: 14 (TestWebKitAPI::setPageVisibilityStateWithEvalContinuation): 15 (TestWebKitAPI::didRunStep2StateChangeHiddenToPrerender): 16 (TestWebKitAPI::didRunStep3StateChangePrerenderToUnloaded): 17 (TestWebKitAPI::didRunStep4InStateUnloaded): 18 * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.html: 19 * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm: 20 (TestWebKitAPI::PageVisibilityStateWithWindowChanges::runTest): 21 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 22 (WTR::TestRunner::setPageVisibility): 23 1 24 2013-05-24 Brent Fulgham <bfulgham@apple.com> 2 25 -
trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm
r149922 r150695 1075 1075 else if (!strcmp(newVisibility, "prerender")) 1076 1076 [webView _setVisibilityState:WebPageVisibilityStatePrerender isInitialState:NO]; 1077 else if (!strcmp(newVisibility, " preview"))1078 [webView _setVisibilityState:WebPageVisibilityState PreviewisInitialState:NO];1077 else if (!strcmp(newVisibility, "unloaded")) 1078 [webView _setVisibilityState:WebPageVisibilityStateUnloaded isInitialState:NO]; 1079 1079 } 1080 1080 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageVisibilityState.cpp
r141011 r150695 38 38 static void didRunStep1StateChangeVisibleToHidden(WKSerializedScriptValueRef, WKErrorRef, void*); 39 39 static void didRunStep2StateChangeHiddenToPrerender(WKSerializedScriptValueRef, WKErrorRef, void*); 40 static void didRunStep3StateChangePrerenderTo Preview(WKSerializedScriptValueRef, WKErrorRef, void*);41 static void didRunStep4InState Preview(WKSerializedScriptValueRef, WKErrorRef, void*);40 static void didRunStep3StateChangePrerenderToUnloaded(WKSerializedScriptValueRef, WKErrorRef, void*); 41 static void didRunStep4InStateUnloaded(WKSerializedScriptValueRef, WKErrorRef, void*); 42 42 43 43 static void setPageVisibilityStateWithEvalContinuation(PlatformWebView* webView, WKPageVisibilityState visibilityState, WKPageRunJavaScriptFunction callback) 44 44 { 45 45 WKPageSetVisibilityState(webView->page(), visibilityState, false); 46 WKRetainPtr<WKStringRef> javaScriptString(AdoptWK, WKStringCreateWithUTF8CString("document. webkitVisibilityState"));46 WKRetainPtr<WKStringRef> javaScriptString(AdoptWK, WKStringCreateWithUTF8CString("document.visibilityState")); 47 47 WKPageRunJavaScriptInMainFrame(webView->page(), javaScriptString.get(), static_cast<void*>(webView), callback); 48 48 } … … 81 81 { 82 82 assertSerializedScriptValueIsStringValue(resultSerializedScriptValue, error, "hidden"); 83 setPageVisibilityStateWithEvalContinuation(static_cast<PlatformWebView*>(context), kWKPageVisibilityStatePrerender, didRunStep3StateChangePrerenderTo Preview);83 setPageVisibilityStateWithEvalContinuation(static_cast<PlatformWebView*>(context), kWKPageVisibilityStatePrerender, didRunStep3StateChangePrerenderToUnloaded); 84 84 } 85 85 86 static void didRunStep3StateChangePrerenderTo Preview(WKSerializedScriptValueRef resultSerializedScriptValue, WKErrorRef error, void* context)86 static void didRunStep3StateChangePrerenderToUnloaded(WKSerializedScriptValueRef resultSerializedScriptValue, WKErrorRef error, void* context) 87 87 { 88 88 assertSerializedScriptValueIsStringValue(resultSerializedScriptValue, error, "prerender"); 89 setPageVisibilityStateWithEvalContinuation(static_cast<PlatformWebView*>(context), kWKPageVisibilityState Preview, didRunStep4InStatePreview);89 setPageVisibilityStateWithEvalContinuation(static_cast<PlatformWebView*>(context), kWKPageVisibilityStateUnloaded, didRunStep4InStateUnloaded); 90 90 } 91 91 92 static void didRunStep4InState Preview(WKSerializedScriptValueRef resultSerializedScriptValue, WKErrorRef error, void* context)92 static void didRunStep4InStateUnloaded(WKSerializedScriptValueRef resultSerializedScriptValue, WKErrorRef error, void* context) 93 93 { 94 assertSerializedScriptValueIsStringValue(resultSerializedScriptValue, error, " preview");94 assertSerializedScriptValueIsStringValue(resultSerializedScriptValue, error, "unloaded"); 95 95 testDone = true; 96 96 } -
trunk/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.html
r141011 r150695 1 1 <script> 2 document.addEventListener(" webkitvisibilitychange", function(event) {2 document.addEventListener("visibilitychange", function(event) { 3 3 // Send a signal to the test controller via alert. 4 alert(' webkitvisibilitychange');4 alert('visibilitychange'); 5 5 }); 6 6 </script> -
trunk/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm
r149716 r150695 109 109 EXPECT_NULL([view window]); 110 110 EXPECT_NULL([view superview]); 111 EXPECT_JS_EQ(view, "document. webkitVisibilityState", "hidden");111 EXPECT_JS_EQ(view, "document.visibilityState", "hidden"); 112 112 113 113 // Add it to a non-visible window. PageVisibility should still be "hidden". … … 117 117 EXPECT_NOT_NULL([view superview]); 118 118 EXPECT_FALSE([window.get() isVisible]); 119 EXPECT_JS_EQ(view, "document. webkitVisibilityState", "hidden");119 EXPECT_JS_EQ(view, "document.visibilityState", "hidden"); 120 120 121 121 // Make the window visible. PageVisibility should become "visible". … … 124 124 EXPECT_TRUE([window.get() isVisible]); 125 125 Util::run(&didGetPageSignalToContinue); 126 EXPECT_JS_EQ(view, "document. webkitVisibilityState", "visible");126 EXPECT_JS_EQ(view, "document.visibilityState", "visible"); 127 127 128 128 // Minimize the window. PageVisibility should become "hidden". … … 130 130 [window.get() miniaturize:nil]; 131 131 Util::run(&didGetPageSignalToContinue); 132 EXPECT_JS_EQ(view, "document. webkitVisibilityState", "hidden");132 EXPECT_JS_EQ(view, "document.visibilityState", "hidden"); 133 133 134 134 // Deminimize the window. PageVisibility should become "visible". … … 136 136 [window.get() deminiaturize:nil]; 137 137 Util::run(&didGetPageSignalToContinue); 138 EXPECT_JS_EQ(view, "document. webkitVisibilityState", "visible");138 EXPECT_JS_EQ(view, "document.visibilityState", "visible"); 139 139 140 140 // Remove the WebView from its superview. PageVisibility should become "hidden". … … 145 145 EXPECT_TRUE([window.get() isVisible]); 146 146 Util::run(&didGetPageSignalToContinue); 147 EXPECT_JS_EQ(view, "document. webkitVisibilityState", "hidden");147 EXPECT_JS_EQ(view, "document.visibilityState", "hidden"); 148 148 } 149 149 -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r150090 r150695 495 495 else if (JSStringIsEqualToUTF8CString(state, "prerender")) 496 496 visibilityState = kWKPageVisibilityStatePrerender; 497 else if (JSStringIsEqualToUTF8CString(state, " preview"))498 visibilityState = kWKPageVisibilityState Preview;497 else if (JSStringIsEqualToUTF8CString(state, "unloaded")) 498 visibilityState = kWKPageVisibilityStateUnloaded; 499 499 500 500 InjectedBundle::shared().setVisibilityState(visibilityState, false);
Note: See TracChangeset
for help on using the changeset viewer.