Title: [87853] trunk
Revision
87853
Author
[email protected]
Date
2011-06-01 14:42:43 -0700 (Wed, 01 Jun 2011)

Log Message

2011-06-01  David Carson  <[email protected]>

        Reviewed by Antti Koivisto.

        Don't flatten frames that have a zero size.
        https://bugs.webkit.org/show_bug.cgi?id=61831

        This tests creates an iframe that has a width and height of zero
        and ensures that the iframe is not flattened to the size of the
        containing content.

        * fast/frames/flattening/iframe-flattening-fixed-width-and-height-zero-size.html: Added.
        * fast/frames/flattening/iframe-flattening-fixed-width-and-height-zero-size-expected.txt: Added.
2011-06-01  David Carson  <[email protected]>

        Reviewed by Antti Koivisto.

        https://bugs.webkit.org/show_bug.cgi?id=61831
        If width and height of an iframe is fixed and should not be visible, then
        it shouldn't be flattened.

        Test: fast/frames/flattening/iframe-flattening-fixed-width-and-height-zero-size.html

        * rendering/RenderIFrame.cpp:
        (WebCore::RenderIFrame::flattenFrame): add a check for a zero width or height

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (87852 => 87853)


--- trunk/LayoutTests/ChangeLog	2011-06-01 21:32:31 UTC (rev 87852)
+++ trunk/LayoutTests/ChangeLog	2011-06-01 21:42:43 UTC (rev 87853)
@@ -1,3 +1,17 @@
+2011-06-01  David Carson  <[email protected]>
+
+        Reviewed by Antti Koivisto.
+
+        Don't flatten frames that have a zero size.
+        https://bugs.webkit.org/show_bug.cgi?id=61831
+
+        This tests creates an iframe that has a width and height of zero
+        and ensures that the iframe is not flattened to the size of the
+        containing content.
+
+        * fast/frames/flattening/iframe-flattening-fixed-width-and-height-zero-size.html: Added.
+        * fast/frames/flattening/iframe-flattening-fixed-width-and-height-zero-size-expected.txt: Added.
+
 2011-06-01  Adam Barth  <[email protected]>
 
         Linux image baselines for this new test.  Leviw confirms that this results are correct.

Added: trunk/LayoutTests/fast/frames/flattening/iframe-flattening-fixed-width-and-height-zero-size-expected.txt (0 => 87853)


--- trunk/LayoutTests/fast/frames/flattening/iframe-flattening-fixed-width-and-height-zero-size-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/frames/flattening/iframe-flattening-fixed-width-and-height-zero-size-expected.txt	2011-06-01 21:42:43 UTC (rev 87853)
@@ -0,0 +1,7 @@
+Test for iframe flattening. The flattening only works inside the DRT.
+
+The frame should not be resized to the size of the containing content.
+
+
+
+PASS

Added: trunk/LayoutTests/fast/frames/flattening/iframe-flattening-fixed-width-and-height-zero-size.html (0 => 87853)


--- trunk/LayoutTests/fast/frames/flattening/iframe-flattening-fixed-width-and-height-zero-size.html	                        (rev 0)
+++ trunk/LayoutTests/fast/frames/flattening/iframe-flattening-fixed-width-and-height-zero-size.html	2011-06-01 21:42:43 UTC (rev 87853)
@@ -0,0 +1,39 @@
+<html>
+<head>
+    <script type="text/_javascript_">
+        function test()
+        {
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.waitUntilDone();
+                layoutTestController.setFrameFlatteningEnabled(true);
+            }
+
+            setTimeout(function() {
+                var theframe = document.getElementById("theframe");
+                var width = parseInt(getComputedStyle(theframe).width);
+                var height = parseInt(getComputedStyle(theframe).height);
+                var pass = false;
+                if (width == 0 && height == 0)
+                    pass = true;
+                document.getElementById("console").innerText = pass ? "PASS" : "FAIL";
+                if (window.layoutTestController)
+                    layoutTestController.notifyDone();
+            }, 0);
+        }
+    </script>
+</head>
+<body _onload_="test()">
+    <style>body { background-color: green; }</style>
+    <p>Test for iframe flattening. The flattening only works inside the DRT.
+    <p>The frame should not be resized to the size of the containing content.
+
+    <p><iframe id=theframe width="0" height="0" scrolling=auto src=""
+        <style>body { background-color: red; }</style>
+        <body>
+            <div style='position: absolute; width: 400px; height: 400px; left: 0; top: 0px;'></div>
+        </body>
+        "></iframe>
+<div id=console></div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (87852 => 87853)


--- trunk/Source/WebCore/ChangeLog	2011-06-01 21:32:31 UTC (rev 87852)
+++ trunk/Source/WebCore/ChangeLog	2011-06-01 21:42:43 UTC (rev 87853)
@@ -1,3 +1,16 @@
+2011-06-01  David Carson  <[email protected]>
+
+        Reviewed by Antti Koivisto.
+
+        https://bugs.webkit.org/show_bug.cgi?id=61831
+        If width and height of an iframe is fixed and should not be visible, then
+        it shouldn't be flattened.
+
+        Test: fast/frames/flattening/iframe-flattening-fixed-width-and-height-zero-size.html
+
+        * rendering/RenderIFrame.cpp:
+        (WebCore::RenderIFrame::flattenFrame): add a check for a zero width or height
+
 2011-06-01  Daniel Cheng  <[email protected]>
 
         Reviewed by Tony Chang.

Modified: trunk/Source/WebCore/rendering/RenderIFrame.cpp (87852 => 87853)


--- trunk/Source/WebCore/rendering/RenderIFrame.cpp	2011-06-01 21:32:31 UTC (rev 87852)
+++ trunk/Source/WebCore/rendering/RenderIFrame.cpp	2011-06-01 21:42:43 UTC (rev 87853)
@@ -87,9 +87,12 @@
     HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(node());
     bool isScrollable = element->scrollingMode() != ScrollbarAlwaysOff;
 
-    if (!isScrollable && style()->width().isFixed()
-        && style()->height().isFixed())
-        return false;
+    if (style()->width().isFixed() && style()->height().isFixed()) {
+        if (!isScrollable)
+            return false;
+        if (style()->width().value() <= 0 || style()->height().value() <= 0)
+            return false;
+    }
 
     Frame* frame = element->document()->frame();
     bool enabled = frame && frame->settings()->frameFlatteningEnabled();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to