Title: [116173] trunk
Revision
116173
Author
[email protected]
Date
2012-05-04 14:30:52 -0700 (Fri, 04 May 2012)

Log Message

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.

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):

Modified Paths

Added Paths

Diff

Modified: trunk/ChangeLog (116172 => 116173)


--- trunk/ChangeLog	2012-05-04 21:23:15 UTC (rev 116172)
+++ trunk/ChangeLog	2012-05-04 21:30:52 UTC (rev 116173)
@@ -1,3 +1,12 @@
+2012-05-04  Jer Noble  <[email protected]>
+
+        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  <[email protected]>
 
         Unreviewed, rolling out r116075.

Added: trunk/ManualTests/fullscreen/full-screen-zero-width.html (0 => 116173)


--- trunk/ManualTests/fullscreen/full-screen-zero-width.html	                        (rev 0)
+++ trunk/ManualTests/fullscreen/full-screen-zero-width.html	2012-05-04 21:30:52 UTC (rev 116173)
@@ -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

Modified: trunk/Source/WebKit/mac/ChangeLog (116172 => 116173)


--- trunk/Source/WebKit/mac/ChangeLog	2012-05-04 21:23:15 UTC (rev 116172)
+++ trunk/Source/WebKit/mac/ChangeLog	2012-05-04 21:30:52 UTC (rev 116173)
@@ -1,3 +1,17 @@
+2012-05-02  Jer Noble  <[email protected]>
+
+        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  <[email protected]>
 
         Full screen will exit during a provisional load of a non-ancestor iframe.

Modified: trunk/Source/WebKit/mac/WebView/WebFullScreenController.mm (116172 => 116173)


--- trunk/Source/WebKit/mac/WebView/WebFullScreenController.mm	2012-05-04 21:23:15 UTC (rev 116172)
+++ trunk/Source/WebKit/mac/WebView/WebFullScreenController.mm	2012-05-04 21:30:52 UTC (rev 116173)
@@ -471,6 +471,9 @@
 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);

Modified: trunk/Source/WebKit2/ChangeLog (116172 => 116173)


--- trunk/Source/WebKit2/ChangeLog	2012-05-04 21:23:15 UTC (rev 116172)
+++ trunk/Source/WebKit2/ChangeLog	2012-05-04 21:30:52 UTC (rev 116173)
@@ -1,3 +1,17 @@
+2012-05-02  Jer Noble  <[email protected]>
+
+        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  <[email protected]>
 
         Full screen will exit during a provisional load of a non-ancestor iframe.

Modified: trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (116172 => 116173)


--- trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2012-05-04 21:23:15 UTC (rev 116172)
+++ trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2012-05-04 21:30:52 UTC (rev 116173)
@@ -468,6 +468,9 @@
 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);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to