Source/WebCore/ChangeLog

 12012-04-04 Jer Noble <jer.noble@apple.com>
 2
 3 apple.com top navigation bar appears inside video during full screen exit animation
 4 https://bugs.webkit.org/show_bug.cgi?id=83095
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Test: fullscreen/full-screen-exit-animation-stacking-context.html
 9
 10 Only tell ancestors of the full screen element that they are no longer ancestors once
 11 the full screen animation is complete:
 12 * dom/Document.cpp:
 13 (WebCore::Document::webkitWillExitFullScreenForElement):
 14 (WebCore::Document::webkitDidExitFullScreenForElement):
 15
 16 To facilitate writing reproducible LayoutTests, expose webkitWill/Did/Enter/ExitFullScreen
 17 from the Internals object, so scripts can call them explicitly:
 18 * testing/Internals.cpp:
 19 (WebCore::Internals::webkitWillEnterFullScreenForElement):
 20 (WebCore::Internals::webkitDidEnterFullScreenForElement):
 21 (WebCore::Internals::webkitWillExitFullScreenForElement):
 22 (WebCore::Internals::webkitDidExitFullScreenForElement):
 23 * testing/Internals.h:
 24 * testing/Internals.idl:
 25
1262012-04-03 Jer Noble <jer.noble@apple.com>
227
328 Foreground of apple.com/iphone video page visible during full screen animation.

Source/WebKit2/ChangeLog

112012-04-06 Jer Noble <jer.noble@apple.com>
22
 3 apple.com top navigation bar appears inside video during full screen exit animation
 4 https://bugs.webkit.org/show_bug.cgi?id=83095
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Add new WebCore symbols needed by DumpRenderTree to exported symbol list.
 9
 10 * win/WebKit2.def:
 11 * win/WebKit2CFLite.def:
 12
 132012-04-06 Jer Noble <jer.noble@apple.com>
 14
315 WebFullScreenManagerProxy::isFullScreen() will create an empty full screen window; steal focus.
416 https://bugs.webkit.org/show_bug.cgi?id=83388
517

Source/WebCore/dom/Document.cpp

@@void Document::webkitWillExitFullScreenForElement(Element*)
54355435 if (!m_fullScreenElement)
54365436 return;
54375437
5438  if (!attached() || inPageCache())
5439  return;
5440 
5441  m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
5442 
54435438 m_fullScreenElement->willStopBeingFullscreenElement();
54445439}
54455440
54465441void Document::webkitDidExitFullScreenForElement(Element*)
54475442{
5448  if (!attached() || inPageCache())
 5443 if (!m_fullScreenElement)
54495444 return;
54505445
 5446 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
 5447
54515448 m_areKeysEnabledInFullScreen = false;
54525449
54535450 if (m_fullScreenRenderer)

Source/WebCore/testing/Internals.cpp

@@bool Internals::hasGrammarMarker(Document* document, int from, int length, Excep
896896 return document->frame()->editor()->selectionStartHasMarkerFor(DocumentMarker::Grammar, from, length);
897897}
898898
 899#if ENABLE(FULLSCREEN_API)
 900void Internals::webkitWillEnterFullScreenForElement(Document* document, Element* element)
 901{
 902 if (!document)
 903 return;
 904 document->webkitWillEnterFullScreenForElement(element);
 905}
 906
 907void Internals::webkitDidEnterFullScreenForElement(Document* document, Element* element)
 908{
 909 if (!document)
 910 return;
 911 document->webkitDidEnterFullScreenForElement(element);
 912}
 913
 914void Internals::webkitWillExitFullScreenForElement(Document* document, Element* element)
 915{
 916 if (!document)
 917 return;
 918 document->webkitWillExitFullScreenForElement(element);
 919}
 920
 921void Internals::webkitDidExitFullScreenForElement(Document* document, Element* element)
 922{
 923 if (!document)
 924 return;
 925 document->webkitDidExitFullScreenForElement(element);
 926}
 927#endif
899928}

Source/WebCore/testing/Internals.h

@@public:
162162 unsigned numberOfLiveDocuments() const;
163163#endif
164164
 165#if ENABLE(FULLSCREEN_API)
 166 void webkitWillEnterFullScreenForElement(Document*, Element*);
 167 void webkitDidEnterFullScreenForElement(Document*, Element*);
 168 void webkitWillExitFullScreenForElement(Document*, Element*);
 169 void webkitDidExitFullScreenForElement(Document*, Element*);
 170#endif
 171
165172private:
166173 explicit Internals(Document*);
167174 DocumentMarker* markerAt(Node*, const String& markerType, unsigned index, ExceptionCode&);

Source/WebCore/testing/Internals.idl

@@module window {
136136
137137 [Conditional=INSPECTOR] unsigned long numberOfLiveNodes();
138138 [Conditional=INSPECTOR] unsigned long numberOfLiveDocuments();
 139
 140#if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API
 141 void webkitWillEnterFullScreenForElement(in Document document, in Element element);
 142 void webkitDidEnterFullScreenForElement(in Document document, in Element element);
 143 void webkitWillExitFullScreenForElement(in Document document, in Element element);
 144 void webkitDidExitFullScreenForElement(in Document document, in Element element);
 145#endif
139146 };
140147}
141148

Source/WebKit2/win/WebKit2.def

@@EXPORTS
241241 ?willDetachPage@FrameDestructionObserver@WebCore@@UAEXXZ
242242 ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N0@Z
243243 ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
 244 ?webkitWillEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
 245 ?webkitDidEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
 246 ?webkitWillExitFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
 247 ?webkitDidExitFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z

Source/WebKit2/win/WebKit2CFLite.def

@@EXPORTS
234234 ?willDetachPage@FrameDestructionObserver@WebCore@@UAEXXZ
235235 ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N@Z
236236 ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
 237 ?webkitWillEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
 238 ?webkitDidEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
 239 ?webkitWillExitFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
 240 ?webkitDidExitFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z

Tools/ChangeLog

 12012-04-04 Jer Noble <jer.noble@apple.com>
 2
 3 apple.com top navigation bar appears inside video during full screen exit animation
 4 https://bugs.webkit.org/show_bug.cgi?id=83095
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Add a new LayoutTestController function, setHasCustomFullScreenBehavior(), which allows scripts to
 9 disable the standard full screen behavior, and replace it with explicit callbacks to the relevant
 10 Document methods from within the script. This allows subtle timing bugs to be consistently reproduced
 11 from within LayoutTests.
 12
 13 Add the new methods, hasCustomFullScreenBehavior() and setHasCustomFullScreenBehavior():
 14 * DumpRenderTree/LayoutTestController.cpp:
 15 (setHasCustomFullScreenBehaviorCallback):
 16 (LayoutTestController::staticFunctions):
 17 * DumpRenderTree/LayoutTestController.h:
 18 (LayoutTestController::setHasCustomFullScreenBehavior):
 19 (LayoutTestController::hasCustomFullScreenBehavior):
 20 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
 21 (WTR::InjectedBundlePage::enterFullScreenForElement):
 22 (WTR::InjectedBundlePage::exitFullScreenForElement):
 23 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
 24 * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
 25 * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
 26 (WTR::LayoutTestController::setHasCustomFullScreenBehavior):
 27 (WTR::LayoutTestController::hasCustomFullScreenBehavior):
 28
 29 Query the new methods before calling will/did/Enter/ExitFullScreen:
 30 * DumpRenderTree/chromium/WebViewHost.cpp:
 31 (WebViewHost::enterFullScreenNow):
 32 (WebViewHost::exitFullScreenNow):
 33 * DumpRenderTree/mac/UIDelegate.mm:
 34 (-[UIDelegate webView:enterFullScreenForElement:listener:]):
 35 (-[UIDelegate webView:exitFullScreenForElement:listener:]):
 36
1372012-04-06 James Robinson <jamesr@chromium.org>
238
339 Enable webkit_unit_tests for commit queue and EWS while tracking failures

Tools/DumpRenderTree/LayoutTestController.cpp

@@LayoutTestController::LayoutTestController(const std::string& testPathOrURL, con
9292 , m_shouldPaintBrokenImage(true)
9393 , m_shouldStayOnPageAfterHandlingBeforeUnload(false)
9494 , m_areDesktopNotificationPermissionRequestsIgnored(false)
 95 , m_customFullScreenBehavior(false)
9596 , m_testPathOrURL(testPathOrURL)
9697 , m_expectedPixelHash(expectedPixelHash)
9798{

@@static JSValueRef setTextDirectionCallback(JSContextRef context, JSObjectRef fun
22422243 }
22432244
22442245 return JSValueMakeUndefined(context);
 2246
 2247}
 2248
 2249static JSValueRef setHasCustomFullScreenBehaviorCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 2250{
 2251 if (argumentCount == 1) {
 2252 bool hasCustomBehavior = JSValueToBoolean(context, arguments[0]);
 2253 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
 2254 controller->setHasCustomFullScreenBehavior(hasCustomBehavior);
 2255 }
 2256
 2257 return JSValueMakeUndefined(context);
22452258}
22462259
22472260static void layoutTestControllerObjectFinalize(JSObjectRef object)

@@JSStaticFunction* LayoutTestController::staticFunctions()
24612474 { "focusWebView", focusWebViewCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
24622475 { "setBackingScaleFactor", setBackingScaleFactorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
24632476 { "preciseTime", preciseTimeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
 2477 { "setHasCustomFullScreenBehavior", setHasCustomFullScreenBehaviorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
24642478 { 0, 0, 0 }
24652479 };
24662480

Tools/DumpRenderTree/LayoutTestController.h

@@public:
361361
362362 void setTextDirection(JSStringRef);
363363
 364 // Custom full screen behavior.
 365 void setHasCustomFullScreenBehavior(bool value) { m_customFullScreenBehavior = value; }
 366 bool hasCustomFullScreenBehavior() const { return m_customFullScreenBehavior; }
 367
364368private:
365369 LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash);
366370

@@private:
413417 bool m_shouldPaintBrokenImage;
414418 bool m_shouldStayOnPageAfterHandlingBeforeUnload;
415419 bool m_areDesktopNotificationPermissionRequestsIgnored;
 420 bool m_customFullScreenBehavior;
416421
417422 std::string m_authenticationUsername;
418423 std::string m_authenticationPassword;

Tools/DumpRenderTree/chromium/WebViewHost.cpp

@@void WebViewHost::setAddressBarURL(const WebURL&)
16621662
16631663void WebViewHost::enterFullScreenNow()
16641664{
 1665 if (layoutTestController()->hasCustomFullScreenBehavior())
 1666 return;
 1667
16651668 webView()->willEnterFullScreen();
16661669 webView()->didEnterFullScreen();
16671670}
16681671
16691672void WebViewHost::exitFullScreenNow()
16701673{
 1674 if (layoutTestController()->hasCustomFullScreenBehavior())
 1675 return;
 1676
16711677 webView()->willExitFullScreen();
16721678 webView()->didExitFullScreen();
16731679}

Tools/DumpRenderTree/mac/UIDelegate.mm

@@DumpRenderTreeDraggingInfo *draggingInfo = nil;
260260
261261- (void)webView:(WebView *)webView enterFullScreenForElement:(DOMElement*)element listener:(NSObject<WebKitFullScreenListener>*)listener
262262{
263  [self performSelector:@selector(enterFullScreenWithListener:) withObject:listener afterDelay:0];
 263 if (!gLayoutTestController->hasCustomFullScreenBehavior())
 264 [self performSelector:@selector(enterFullScreenWithListener:) withObject:listener afterDelay:0];
264265}
265266
266267- (void)exitFullScreenWithListener:(NSObject<WebKitFullScreenListener>*)listener

@@DumpRenderTreeDraggingInfo *draggingInfo = nil;
271272
272273- (void)webView:(WebView *)webView exitFullScreenForElement:(DOMElement*)element listener:(NSObject<WebKitFullScreenListener>*)listener
273274{
274  [self performSelector:@selector(exitFullScreenWithListener:) withObject:listener afterDelay:0];
 275 if (!gLayoutTestController->hasCustomFullScreenBehavior())
 276 [self performSelector:@selector(exitFullScreenWithListener:) withObject:listener afterDelay:0];
275277}
276278
277279- (BOOL)webView:(WebView *)webView didPressMissingPluginButton:(DOMElement *)element

Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl

@@module WTR {
144144 void resetPageVisibility();
145145
146146 readonly attribute DOMString platformName;
 147
 148 // Control full screen behavior.
 149 void setHasCustomFullScreenBehavior(in boolean value);
147150 };
148151
149152}

Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

@@void InjectedBundlePage::enterFullScreenForElement(WKBundlePageRef pageRef, WKBu
12091209{
12101210 if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks())
12111211 InjectedBundle::shared().stringBuilder()->append("enterFullScreenForElement()\n");
1212  WKBundlePageWillEnterFullScreen(pageRef);
1213  WKBundlePageDidEnterFullScreen(pageRef);
 1212
 1213 if (!InjectedBundle::shared().layoutTestController()->hasCustomFullScreenBehavior()) {
 1214 WKBundlePageWillEnterFullScreen(pageRef);
 1215 WKBundlePageDidEnterFullScreen(pageRef);
 1216 }
12141217}
12151218
12161219void InjectedBundlePage::exitFullScreenForElement(WKBundlePageRef pageRef, WKBundleNodeHandleRef elementRef)
12171220{
12181221 if (InjectedBundle::shared().layoutTestController()->shouldDumpFullScreenCallbacks())
12191222 InjectedBundle::shared().stringBuilder()->append("exitFullScreenForElement()\n");
1220  WKBundlePageWillExitFullScreen(pageRef);
1221  WKBundlePageDidExitFullScreen(pageRef);
 1223
 1224 if (!InjectedBundle::shared().layoutTestController()->hasCustomFullScreenBehavior()) {
 1225 WKBundlePageWillExitFullScreen(pageRef);
 1226 WKBundlePageDidExitFullScreen(pageRef);
 1227 }
12221228}
12231229
12241230void InjectedBundlePage::beganEnterFullScreen(WKBundlePageRef, WKRect, WKRect)

Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h

@@private:
121121#if ENABLE(FULLSCREEN_API)
122122 // Full Screen client
123123 static bool supportsFullScreen(WKBundlePageRef, WKFullScreenKeyboardRequestType);
 124 static void setHasCustomFullScreenBehavior(WKBundlePageRef, bool value);
124125 static void enterFullScreenForElement(WKBundlePageRef, WKBundleNodeHandleRef element);
125126 static void exitFullScreenForElement(WKBundlePageRef, WKBundleNodeHandleRef element);
126127 static void beganEnterFullScreen(WKBundlePageRef, WKRect initialFrame, WKRect finalFrame);

Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp

@@LayoutTestController::LayoutTestController()
109109 , m_policyDelegateEnabled(false)
110110 , m_policyDelegatePermissive(false)
111111 , m_globalFlag(false)
 112 , m_customFullScreenBehavior(false)
112113{
113114 platformInitialize();
114115}

Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h

@@public:
196196
197197 void overridePreference(JSStringRef preference, bool value);
198198
 199 // Custom full screen behavior.
 200 void setHasCustomFullScreenBehavior(bool value) { m_customFullScreenBehavior = value; }
 201 bool hasCustomFullScreenBehavior() const { return m_customFullScreenBehavior; }
 202
199203 JSRetainPtr<JSStringRef> platformName();
200204
201205 void setPageVisibility(JSStringRef state);

@@private:
231235 bool m_policyDelegatePermissive;
232236
233237 bool m_globalFlag;
 238 bool m_customFullScreenBehavior;
234239
235240 PlatformTimerRef m_waitToDumpWatchdogTimer;
236241};

LayoutTests/ChangeLog

 12012-04-04 Jer Noble <jer.noble@apple.com>
 2
 3 apple.com top navigation bar appears inside video during full screen exit animation
 4 https://bugs.webkit.org/show_bug.cgi?id=83095
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * fullscreen/full-screen-exit-animation-stacking-context-expected.txt: Added.
 9 * fullscreen/full-screen-exit-animation-stacking-context.html: Added.
 10 * platform/mac/fullscreen/full-screen-exit-animation-stacking-context-expected.png: Added.
 11
1122012-04-06 Tony Chang <tony@chromium.org>
213
314 [chromium] Unreviewed, remove a passing test.

LayoutTests/fullscreen/full-screen-exit-animation-stacking-context-expected.txt

 1This tests that a full screen element in a lower stacking context blocks a sibling in a higher stacking context. After entering full screen mode, only a black box should be visible. Click go full screen to run the test.
 2END OF TEST
 3

LayoutTests/fullscreen/full-screen-exit-animation-stacking-context.html

 1<!DOCTYPE html>
 2<html>
 3 <head>
 4 <script>
 5 var runPixelTests = true;
 6
 7 function init() {
 8 // Bail out early if the full screen API is not enabled or is missing:
 9 if (Element.prototype.webkitRequestFullScreen == undefined) {
 10 logResult(false, "Element.prototype.webkitRequestFullScreen == undefined");
 11 endTest();
 12 } else {
 13 waitForEventAndEnd(document, 'webkitfullscreenchange');
 14 runWithKeyDown(goFullScreen);
 15 }
 16 }
 17
 18 function goFullScreen() {
 19 if (window.layoutTestController)
 20 layoutTestController.setHasCustomFullScreenBehavior(true);
 21 var video = document.getElementById('video');
 22 video.webkitRequestFullScreen();
 23 if (window.internals) {
 24 internals.webkitWillEnterFullScreenForElement(document, video);
 25 internals.webkitDidEnterFullScreenForElement(document, video);
 26 internals.webkitWillExitFullScreenForElement(document, video);
 27 endTest();
 28 }
 29 }
 30 </script>
 31 <script src="full-screen-test.js"></script>
 32 <style>
 33 #one {
 34 width: 100px;
 35 height: 100px;
 36 position: relative;
 37 top: 50px;
 38 left: 50px;
 39 z-index: 1;
 40 background-color: red;
 41 }
 42 #one, #two {
 43 opacity: 0.5;
 44 -webkit-transform: rotate(180);
 45 -webkit-mask: -webkit-linear-gradient(left, alpha 0%, white 100%);
 46 -webkit-filter: contrast(100%);
 47 clip:rect(0px,100px,100px,0px);
 48 }
 49 #zero {
 50 position: relative;
 51 z-index: 0;
 52 }
 53 #video {
 54 width: 200px;
 55 height: 200px;
 56 background-color: black;
 57 }
 58 </style>
 59 </head>
 60 <body onload="init()">
 61 <div>This tests that a full screen element in a lower stacking context blocks a sibling in a higher stacking context.
 62 After entering full screen mode, only a black box should be visible.
 63 Click <button onclick="goFullScreen()">go full screen</button> to run the test.</div>
 64 <div id="one"></div>
 65 <div id="zero">
 66 <video id="video"></video>
 67 </div>
 68 </body>

LayoutTests/platform/mac/fullscreen/full-screen-exit-animation-stacking-context-expected.png


Added

62f13b98779e570df73fe7c89fb56420