Taking a visibility:hidden element full screen causes full screen window to disappear.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 May 2012 21:30:52 +0000 (21:30 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 May 2012 21:30:52 +0000 (21:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=85432

Reviewed by Maciej Stachowiak.

.:

* ManualTests/fullscreen/full-screen-zero-width.html: Added.

Source/WebKit/mac:

When given an initial or final frame with a zero width or height, return a rect representing
the entire screen, rather than a rect with a zero or infinite size. Doing otherwise will
confuse the window server when it's instructed to scale the full screen window to that size.

* WebView/WebFullScreenController.mm:
(windowFrameFromApparentFrames):

Source/WebKit2:

When given an initial or final frame with a zero width or height, return a rect representing
the entire screen, rather than a rect with a zero or infinite size. Doing otherwise will
confuse the window server when it's instructed to scale the full screen window to that size.

* UIProcess/mac/WKFullScreenWindowController.mm:
(windowFrameFromApparentFrames):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@116173 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
ManualTests/fullscreen/full-screen-zero-width.html [new file with mode: 0644]
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFullScreenController.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm

index 4b9a4f42bae8b5ef191949f54f22649d34204caf..7088fa66badd41300e9d2ed389c646ed499a5e7c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-05-04  Jer Noble  <jer.noble@apple.com>
+
+        Taking a visibility:hidden element full screen causes full screen window to disappear.
+        https://bugs.webkit.org/show_bug.cgi?id=85432
+
+        Reviewed by Maciej Stachowiak.
+
+        * ManualTests/fullscreen/full-screen-zero-width.html: Added.
+
 2012-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed, rolling out r116075.
diff --git a/ManualTests/fullscreen/full-screen-zero-width.html b/ManualTests/fullscreen/full-screen-zero-width.html
new file mode 100644 (file)
index 0000000..f436b58
--- /dev/null
@@ -0,0 +1,17 @@
+<style>
+    div { width: 0px; }
+    span { text-decoration: underline; cursor: hand; }
+</style>
+<script>
+function toggleFullScreen() {
+    if (document.webkitIsFullScreen)
+        document.webkitCancelFullScreen();
+    else
+        document.getElementsByTagName('div')[0].webkitRequestFullscreen();
+}
+</script>
+<body>
+    This tests that an element with a 0px width will not cause the window to disappear when entering full screen. <span onclick="toggleFullScreen()">Click to toggle full screen.</span>
+    <div>
+    </div>
+</body>
\ No newline at end of file
index 4b0096902ac23b5d1d5c46a19165e6dedd4d260e..99554f5d9730023170f85d63adedc80bf34039a2 100644 (file)
@@ -1,3 +1,17 @@
+2012-05-02  Jer Noble  <jer.noble@apple.com>
+
+        Taking a visibility:hidden element full screen causes full screen window to disappear.
+        https://bugs.webkit.org/show_bug.cgi?id=85432
+
+        Reviewed by Maciej Stachowiak.
+
+        When given an initial or final frame with a zero width or height, return a rect representing
+        the entire screen, rather than a rect with a zero or infinite size. Doing otherwise will
+        confuse the window server when it's instructed to scale the full screen window to that size.
+
+        * WebView/WebFullScreenController.mm:
+        (windowFrameFromApparentFrames):
+
 2012-05-04  Jer Noble  <jer.noble@apple.com>
 
         Full screen will exit during a provisional load of a non-ancestor iframe.
index ee083ecd27a18dece5e7a370f3a0d8b0fd6ccf03..acd698ab4fd99fc53300eaaea7e4438d2fcd5f46 100644 (file)
@@ -471,6 +471,9 @@ static RetainPtr<NSWindow> createBackgroundFullscreenWindow(NSRect frame)
 static NSRect windowFrameFromApparentFrames(NSRect screenFrame, NSRect initialFrame, NSRect finalFrame)
 {
     NSRect initialWindowFrame;
+    if (!NSWidth(initialFrame) || !NSWidth(finalFrame) || !NSHeight(initialFrame) || !NSHeight(finalFrame))
+        return screenFrame;
+
     CGFloat xScale = NSWidth(screenFrame) / NSWidth(finalFrame);
     CGFloat yScale = NSHeight(screenFrame) / NSHeight(finalFrame);
     CGFloat xTrans = NSMinX(screenFrame) - NSMinX(finalFrame);
index d7555ee5d86636f634f8b6cdcbe045f5528a864e..5328c7d10046224dba623c242a773b2413d67560 100644 (file)
@@ -1,3 +1,17 @@
+2012-05-02  Jer Noble  <jer.noble@apple.com>
+
+        Taking a visibility:hidden element full screen causes full screen window to disappear.
+        https://bugs.webkit.org/show_bug.cgi?id=85432
+
+        Reviewed by Maciej Stachowiak.
+
+        When given an initial or final frame with a zero width or height, return a rect representing
+        the entire screen, rather than a rect with a zero or infinite size. Doing otherwise will
+        confuse the window server when it's instructed to scale the full screen window to that size.
+
+        * UIProcess/mac/WKFullScreenWindowController.mm:
+        (windowFrameFromApparentFrames):
+
 2012-04-30  Jer Noble  <jer.noble@apple.com>
 
         Full screen will exit during a provisional load of a non-ancestor iframe.
index bd2d3c24ecaa67c041abe2d4628b8814ea92accf..c282c9d3b8075a325a5ce363add4c3236721ab6f 100644 (file)
@@ -468,6 +468,9 @@ static RetainPtr<NSWindow> createBackgroundFullscreenWindow(NSRect frame)
 static NSRect windowFrameFromApparentFrames(NSRect screenFrame, NSRect initialFrame, NSRect finalFrame)
 {
     NSRect initialWindowFrame;
+    if (!NSWidth(initialFrame) || !NSWidth(finalFrame) || !NSHeight(initialFrame) || !NSHeight(finalFrame))
+        return screenFrame;
+
     CGFloat xScale = NSWidth(screenFrame) / NSWidth(finalFrame);
     CGFloat yScale = NSHeight(screenFrame) / NSHeight(finalFrame);
     CGFloat xTrans = NSMinX(screenFrame) - NSMinX(finalFrame);