[CSSRegions] Add test cases for auto-size regions and window resize
authormihnea@adobe.com <mihnea@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2013 09:00:59 +0000 (09:00 +0000)
committermihnea@adobe.com <mihnea@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2013 09:00:59 +0000 (09:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=107686

Reviewed by Tony Chang.

The fix for https://bugs.webkit.org/show_bug.cgi?id=102954 also solved
https://bugs.webkit.org/show_bug.cgi?id=102221. This patch adds two tests
for webkit bug 102221.

* fast/regions/autosize-region-container-resize-expected.html: Added.
* fast/regions/autosize-region-container-resize.html: Added.
* fast/regions/autosize-region-window-resize-expected.html: Added.
* fast/regions/autosize-region-window-resize.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/regions/autosize-region-container-resize-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/autosize-region-container-resize.html [new file with mode: 0644]
LayoutTests/fast/regions/autosize-region-window-resize-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/autosize-region-window-resize.html [new file with mode: 0644]

index 4a4d8fd..b725fce 100644 (file)
@@ -1,3 +1,19 @@
+2013-01-24  Mihnea Ovidenie  <mihnea@adobe.com>
+
+        [CSSRegions] Add test cases for auto-size regions and window resize
+        https://bugs.webkit.org/show_bug.cgi?id=107686
+
+        Reviewed by Tony Chang.
+
+        The fix for https://bugs.webkit.org/show_bug.cgi?id=102954 also solved
+        https://bugs.webkit.org/show_bug.cgi?id=102221. This patch adds two tests
+        for webkit bug 102221.
+
+        * fast/regions/autosize-region-container-resize-expected.html: Added.
+        * fast/regions/autosize-region-container-resize.html: Added.
+        * fast/regions/autosize-region-window-resize-expected.html: Added.
+        * fast/regions/autosize-region-window-resize.html: Added.
+
 2013-01-24  Dominic Mazzoni  <dmazzoni@google.com>
 
         AX: should init an AXObject only after AXObjectCache has added it
diff --git a/LayoutTests/fast/regions/autosize-region-container-resize-expected.html b/LayoutTests/fast/regions/autosize-region-container-resize-expected.html
new file mode 100644 (file)
index 0000000..3d39a73
--- /dev/null
@@ -0,0 +1,40 @@
+<!doctype html>
+<html>
+    <head>
+        <style>
+            html {
+                font: 16px/1.25 monospace;
+            }
+
+            #regionContainer {
+                width: 600px;
+            }
+
+            #region {
+                width: auto;
+                height: auto;
+                border: 5px solid green;
+            }
+
+            #region2 {
+                width: 300px;
+                height: 40px;
+                border: 5px solid blue;
+                position: absolute;
+                top: 150px;
+            }
+    </style>
+</head>
+<body>
+    <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=102221">WebKit Bug 102221</a> [CSS Regions] Auto-sized regions don't recompute their dimensions on window resize</p>
+    <p>On success you should not see any text in the blue border region.</p>
+    <div id="regionContainer">
+        <div id="region">Lorem ipsum dolor sin amet Lorem ipsum dolor sin amet</div>
+    </div>
+    <div id="region2"></div>
+    <script>
+        document.body.offsetTop;
+        document.getElementById("regionContainer").style.width = "310px";
+    </script>
+</body>
+</html>
diff --git a/LayoutTests/fast/regions/autosize-region-container-resize.html b/LayoutTests/fast/regions/autosize-region-container-resize.html
new file mode 100644 (file)
index 0000000..a7d7a23
--- /dev/null
@@ -0,0 +1,49 @@
+<!doctype html>
+<html>
+    <head>
+        <style>
+            html {
+                font: 16px/1.25 monospace;
+            }
+
+            #article {
+                -webkit-flow-into: article;
+            }
+
+            #regionContainer {
+                width: 600px;
+            }
+
+            #region {
+                -webkit-flow-from: article;
+                width: auto;
+                height: auto;
+                border: 5px solid green;
+            }
+
+            #region2 {
+                -webkit-flow-from: article;
+                width: 300px;
+                height: 40px;
+                border: 5px solid blue;
+                position: absolute;
+                top: 150px;
+            }
+    </style>
+</head>
+<body>
+    <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=102221">WebKit Bug 102221</a> [CSS Regions] Auto-sized regions don't recompute their dimensions on window resize</p>
+    <p>On success you should not see any text in the blue border region.</p>
+    <div id="article">
+        Lorem ipsum dolor sin amet Lorem ipsum dolor sin amet
+    </div>
+    <div id="regionContainer">
+        <div id="region"></div>
+    </div>
+    <div id="region2"></div>
+    <script>
+        document.body.offsetTop;
+        document.getElementById("regionContainer").style.width = "310px";
+    </script>
+</body>
+</html>
diff --git a/LayoutTests/fast/regions/autosize-region-window-resize-expected.html b/LayoutTests/fast/regions/autosize-region-window-resize-expected.html
new file mode 100644 (file)
index 0000000..7c63f2a
--- /dev/null
@@ -0,0 +1,37 @@
+<!doctype html>
+<html>
+    <head>
+        <style>
+            html {
+                font: 16px/1.25 monospace;
+            }
+
+            body {
+                margin: 0;
+            }
+
+            #region {
+                width: auto;
+                height: auto;
+                border: 5px solid green;
+            }
+
+            #region2 {
+                width: 310px;
+                height: 80px;
+                border: 5px solid blue;
+            }
+    </style>
+    <script>
+        function test() {
+            window.resizeTo(320, 640);
+        }
+    </script>
+</head>
+<body onload="test()">
+    <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=102221">WebKit Bug 102221</a> [CSS Regions] Auto-sized regions don't recompute their dimensions on window resize</p>
+    <p>On success you should not see any text in the blue border region.</p>
+    <div id="region">Lorem ipsum dolor sin amet Lorem ipsum dolor sin amet Lorem ipsum dolor sin amet Lorem ipsum dolor sin amet</div>
+    <div id="region2"></div>
+</body>
+</html>
diff --git a/LayoutTests/fast/regions/autosize-region-window-resize.html b/LayoutTests/fast/regions/autosize-region-window-resize.html
new file mode 100644 (file)
index 0000000..9490677
--- /dev/null
@@ -0,0 +1,45 @@
+<!doctype html>
+<html>
+    <head>
+        <style>
+            html {
+                font: 16px/1.25 monospace;
+            }
+
+            body {
+                margin: 0;
+            }
+
+            #article {
+                -webkit-flow-into: article;
+            }
+
+            #region {
+                -webkit-flow-from: article;
+                width: auto;
+                height: auto;
+                border: 5px solid green;
+            }
+            #region2 {
+                -webkit-flow-from: article;
+                width: 310px;
+                height: 80px;
+                border: 5px solid blue;
+            }
+    </style>
+    <script>
+        function test() {
+            window.resizeTo(320, 640);
+        }
+    </script>
+</head>
+<body onload="test()">
+    <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=102221">WebKit Bug 102221</a> [CSS Regions] Auto-sized regions don't recompute their dimensions on window resize</p>
+    <p>On success you should not see any text in the blue border region.</p>
+    <div id="article">
+        Lorem ipsum dolor sin amet Lorem ipsum dolor sin amet Lorem ipsum dolor sin amet Lorem ipsum dolor sin amet
+    </div>
+    <div id="region"></div>
+    <div id="region2"></div>
+</body>
+</html>