Convert fast/css/positioned-overflow-scroll.html to a check-layout.js test
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2013 19:22:49 +0000 (19:22 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2013 19:22:49 +0000 (19:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=106585

Reviewed by Tony Chang.

This is in preparation for adding more cases to this test.

* fast/css/positioned-overflow-scroll-expected.txt: Added.
* fast/css/positioned-overflow-scroll.html:
* platform/chromium-android/fast/css/positioned-overflow-scroll-expected.png: Removed.
* platform/chromium-android/fast/css/positioned-overflow-scroll-expected.txt: Removed.
* platform/chromium-linux/fast/css/positioned-overflow-scroll-expected.png: Removed.
* platform/chromium-mac-lion/fast/css/positioned-overflow-scroll-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/css/positioned-overflow-scroll-expected.png: Removed.
* platform/chromium-mac/fast/css/positioned-overflow-scroll-expected.png: Removed.
* platform/chromium-win/fast/css/positioned-overflow-scroll-expected.png: Removed.
* platform/chromium/fast/css/positioned-overflow-scroll-expected.txt: Removed.
* platform/efl/fast/css/positioned-overflow-scroll-expected.png: Removed.
* platform/efl/fast/css/positioned-overflow-scroll-expected.txt: Removed.
* platform/gtk/fast/css/positioned-overflow-scroll-expected.png: Removed.
* platform/gtk/fast/css/positioned-overflow-scroll-expected.txt: Removed.
* platform/mac/fast/css/positioned-overflow-scroll-expected.png: Removed.
* platform/mac/fast/css/positioned-overflow-scroll-expected.txt: Removed.
* platform/qt/fast/css/positioned-overflow-scroll-expected.png: Removed.
* platform/qt/fast/css/positioned-overflow-scroll-expected.txt: Removed.
* resources/check-layout.js:

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

20 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/positioned-overflow-scroll-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/positioned-overflow-scroll.html
LayoutTests/platform/chromium-android/fast/css/positioned-overflow-scroll-expected.png [deleted file]
LayoutTests/platform/chromium-android/fast/css/positioned-overflow-scroll-expected.txt [deleted file]
LayoutTests/platform/chromium-linux/fast/css/positioned-overflow-scroll-expected.png [deleted file]
LayoutTests/platform/chromium-mac-lion/fast/css/positioned-overflow-scroll-expected.png [deleted file]
LayoutTests/platform/chromium-mac-snowleopard/fast/css/positioned-overflow-scroll-expected.png [deleted file]
LayoutTests/platform/chromium-mac/fast/css/positioned-overflow-scroll-expected.png [deleted file]
LayoutTests/platform/chromium-win/fast/css/positioned-overflow-scroll-expected.png [deleted file]
LayoutTests/platform/chromium/fast/css/positioned-overflow-scroll-expected.txt [deleted file]
LayoutTests/platform/efl/fast/css/positioned-overflow-scroll-expected.png [deleted file]
LayoutTests/platform/efl/fast/css/positioned-overflow-scroll-expected.txt [deleted file]
LayoutTests/platform/gtk/fast/css/positioned-overflow-scroll-expected.png [deleted file]
LayoutTests/platform/gtk/fast/css/positioned-overflow-scroll-expected.txt [deleted file]
LayoutTests/platform/mac/fast/css/positioned-overflow-scroll-expected.png [deleted file]
LayoutTests/platform/mac/fast/css/positioned-overflow-scroll-expected.txt [deleted file]
LayoutTests/platform/qt/fast/css/positioned-overflow-scroll-expected.png [deleted file]
LayoutTests/platform/qt/fast/css/positioned-overflow-scroll-expected.txt [deleted file]
LayoutTests/resources/check-layout.js

index d891514..f595b4d 100644 (file)
@@ -1,3 +1,32 @@
+2013-01-10  Ojan Vafai  <ojan@chromium.org>
+
+        Convert fast/css/positioned-overflow-scroll.html to a check-layout.js test
+        https://bugs.webkit.org/show_bug.cgi?id=106585
+
+        Reviewed by Tony Chang.
+
+        This is in preparation for adding more cases to this test.
+
+        * fast/css/positioned-overflow-scroll-expected.txt: Added.
+        * fast/css/positioned-overflow-scroll.html:
+        * platform/chromium-android/fast/css/positioned-overflow-scroll-expected.png: Removed.
+        * platform/chromium-android/fast/css/positioned-overflow-scroll-expected.txt: Removed.
+        * platform/chromium-linux/fast/css/positioned-overflow-scroll-expected.png: Removed.
+        * platform/chromium-mac-lion/fast/css/positioned-overflow-scroll-expected.png: Removed.
+        * platform/chromium-mac-snowleopard/fast/css/positioned-overflow-scroll-expected.png: Removed.
+        * platform/chromium-mac/fast/css/positioned-overflow-scroll-expected.png: Removed.
+        * platform/chromium-win/fast/css/positioned-overflow-scroll-expected.png: Removed.
+        * platform/chromium/fast/css/positioned-overflow-scroll-expected.txt: Removed.
+        * platform/efl/fast/css/positioned-overflow-scroll-expected.png: Removed.
+        * platform/efl/fast/css/positioned-overflow-scroll-expected.txt: Removed.
+        * platform/gtk/fast/css/positioned-overflow-scroll-expected.png: Removed.
+        * platform/gtk/fast/css/positioned-overflow-scroll-expected.txt: Removed.
+        * platform/mac/fast/css/positioned-overflow-scroll-expected.png: Removed.
+        * platform/mac/fast/css/positioned-overflow-scroll-expected.txt: Removed.
+        * platform/qt/fast/css/positioned-overflow-scroll-expected.png: Removed.
+        * platform/qt/fast/css/positioned-overflow-scroll-expected.txt: Removed.
+        * resources/check-layout.js:
+
 2013-01-10  Robert Kroeger  <rjkroege@chromium.org>
 
         Manually revert http://trac.webkit.org/changeset/136012
diff --git a/LayoutTests/fast/css/positioned-overflow-scroll-expected.txt b/LayoutTests/fast/css/positioned-overflow-scroll-expected.txt
new file mode 100644 (file)
index 0000000..2836eda
--- /dev/null
@@ -0,0 +1,3 @@
+Test that scrollbar width is added to the intrinsic width of different display types.
+ PASS
+
index 8758f4c..928dcba 100644 (file)
@@ -1,5 +1,3 @@
-<html>
-<head>
 <style>
 div {
   overflow:scroll;
@@ -13,8 +11,24 @@ div {
   height:100px;
 }
 </style>
-</head>
+
 <body>
-<div style="left:20px"><span class="box"></span></div>
-<div style="display: -webkit-box; left:140px"><span class="box"></span></div>
+Test that scrollbar width is added to the intrinsic width of different display types.
+<div style="top: 100px" data-expected-width=100 data-expected-height=100><span class="box"></span></div>
+<div style="display: -webkit-box; top:100px; left: 150px;" data-expected-width=100 data-expected-height=100><span class="box"></span></div>
+
+<script src="../../resources/check-layout.js"></script>
+<script>
+var dummy = document.createElement('h1');
+dummy.style.overflow = 'scroll';
+document.body.appendChild(dummy);
+var scrollbarWidth = dummy.offsetWidth - dummy.clientWidth;
+document.body.removeChild(dummy);
 
+Array.prototype.forEach.call(document.querySelectorAll('div'), function(node) {
+    node.setAttribute('data-expected-width', 100 + scrollbarWidth);
+    node.setAttribute('data-expected-height', 100 + scrollbarWidth);
+});
+checkLayout('body');
+</script>
+</body>
diff --git a/LayoutTests/platform/chromium-android/fast/css/positioned-overflow-scroll-expected.png b/LayoutTests/platform/chromium-android/fast/css/positioned-overflow-scroll-expected.png
deleted file mode 100644 (file)
index d848784..0000000
Binary files a/LayoutTests/platform/chromium-android/fast/css/positioned-overflow-scroll-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-android/fast/css/positioned-overflow-scroll-expected.txt b/LayoutTests/platform/chromium-android/fast/css/positioned-overflow-scroll-expected.txt
deleted file mode 100644 (file)
index eae225f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-layer at (20,8) size 100x100
-  RenderBlock (positioned) {DIV} at (20,8) size 100x100
-    RenderBlock {SPAN} at (0,0) size 100x100 [bgcolor=#008000]
-layer at (140,8) size 100x100
-  RenderDeprecatedFlexibleBox (positioned) {DIV} at (140,8) size 100x100
-    RenderBlock {SPAN} at (0,0) size 100x100 [bgcolor=#008000]
diff --git a/LayoutTests/platform/chromium-linux/fast/css/positioned-overflow-scroll-expected.png b/LayoutTests/platform/chromium-linux/fast/css/positioned-overflow-scroll-expected.png
deleted file mode 100644 (file)
index 8803c2d..0000000
Binary files a/LayoutTests/platform/chromium-linux/fast/css/positioned-overflow-scroll-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac-lion/fast/css/positioned-overflow-scroll-expected.png b/LayoutTests/platform/chromium-mac-lion/fast/css/positioned-overflow-scroll-expected.png
deleted file mode 100644 (file)
index b756085..0000000
Binary files a/LayoutTests/platform/chromium-mac-lion/fast/css/positioned-overflow-scroll-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac-snowleopard/fast/css/positioned-overflow-scroll-expected.png b/LayoutTests/platform/chromium-mac-snowleopard/fast/css/positioned-overflow-scroll-expected.png
deleted file mode 100644 (file)
index 73a0a35..0000000
Binary files a/LayoutTests/platform/chromium-mac-snowleopard/fast/css/positioned-overflow-scroll-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-mac/fast/css/positioned-overflow-scroll-expected.png b/LayoutTests/platform/chromium-mac/fast/css/positioned-overflow-scroll-expected.png
deleted file mode 100644 (file)
index 4a9fb2f..0000000
Binary files a/LayoutTests/platform/chromium-mac/fast/css/positioned-overflow-scroll-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium-win/fast/css/positioned-overflow-scroll-expected.png b/LayoutTests/platform/chromium-win/fast/css/positioned-overflow-scroll-expected.png
deleted file mode 100644 (file)
index 7b6d19b..0000000
Binary files a/LayoutTests/platform/chromium-win/fast/css/positioned-overflow-scroll-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/chromium/fast/css/positioned-overflow-scroll-expected.txt b/LayoutTests/platform/chromium/fast/css/positioned-overflow-scroll-expected.txt
deleted file mode 100644 (file)
index 8a6abdb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-layer at (20,8) size 115x115 clip at (20,8) size 100x100
-  RenderBlock (positioned) {DIV} at (20,8) size 115x115
-    RenderBlock {SPAN} at (0,0) size 100x100 [bgcolor=#008000]
-layer at (140,8) size 115x115 clip at (140,8) size 100x100
-  RenderDeprecatedFlexibleBox (positioned) {DIV} at (140,8) size 115x115
-    RenderBlock {SPAN} at (0,0) size 100x100 [bgcolor=#008000]
diff --git a/LayoutTests/platform/efl/fast/css/positioned-overflow-scroll-expected.png b/LayoutTests/platform/efl/fast/css/positioned-overflow-scroll-expected.png
deleted file mode 100644 (file)
index 54c5b1c..0000000
Binary files a/LayoutTests/platform/efl/fast/css/positioned-overflow-scroll-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/efl/fast/css/positioned-overflow-scroll-expected.txt b/LayoutTests/platform/efl/fast/css/positioned-overflow-scroll-expected.txt
deleted file mode 100644 (file)
index 8a6abdb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-layer at (20,8) size 115x115 clip at (20,8) size 100x100
-  RenderBlock (positioned) {DIV} at (20,8) size 115x115
-    RenderBlock {SPAN} at (0,0) size 100x100 [bgcolor=#008000]
-layer at (140,8) size 115x115 clip at (140,8) size 100x100
-  RenderDeprecatedFlexibleBox (positioned) {DIV} at (140,8) size 115x115
-    RenderBlock {SPAN} at (0,0) size 100x100 [bgcolor=#008000]
diff --git a/LayoutTests/platform/gtk/fast/css/positioned-overflow-scroll-expected.png b/LayoutTests/platform/gtk/fast/css/positioned-overflow-scroll-expected.png
deleted file mode 100644 (file)
index be872d0..0000000
Binary files a/LayoutTests/platform/gtk/fast/css/positioned-overflow-scroll-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/gtk/fast/css/positioned-overflow-scroll-expected.txt b/LayoutTests/platform/gtk/fast/css/positioned-overflow-scroll-expected.txt
deleted file mode 100644 (file)
index 8a6abdb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-layer at (20,8) size 115x115 clip at (20,8) size 100x100
-  RenderBlock (positioned) {DIV} at (20,8) size 115x115
-    RenderBlock {SPAN} at (0,0) size 100x100 [bgcolor=#008000]
-layer at (140,8) size 115x115 clip at (140,8) size 100x100
-  RenderDeprecatedFlexibleBox (positioned) {DIV} at (140,8) size 115x115
-    RenderBlock {SPAN} at (0,0) size 100x100 [bgcolor=#008000]
diff --git a/LayoutTests/platform/mac/fast/css/positioned-overflow-scroll-expected.png b/LayoutTests/platform/mac/fast/css/positioned-overflow-scroll-expected.png
deleted file mode 100644 (file)
index 1400e33..0000000
Binary files a/LayoutTests/platform/mac/fast/css/positioned-overflow-scroll-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac/fast/css/positioned-overflow-scroll-expected.txt b/LayoutTests/platform/mac/fast/css/positioned-overflow-scroll-expected.txt
deleted file mode 100644 (file)
index 8a6abdb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-layer at (20,8) size 115x115 clip at (20,8) size 100x100
-  RenderBlock (positioned) {DIV} at (20,8) size 115x115
-    RenderBlock {SPAN} at (0,0) size 100x100 [bgcolor=#008000]
-layer at (140,8) size 115x115 clip at (140,8) size 100x100
-  RenderDeprecatedFlexibleBox (positioned) {DIV} at (140,8) size 115x115
-    RenderBlock {SPAN} at (0,0) size 100x100 [bgcolor=#008000]
diff --git a/LayoutTests/platform/qt/fast/css/positioned-overflow-scroll-expected.png b/LayoutTests/platform/qt/fast/css/positioned-overflow-scroll-expected.png
deleted file mode 100644 (file)
index 0e3422c..0000000
Binary files a/LayoutTests/platform/qt/fast/css/positioned-overflow-scroll-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/qt/fast/css/positioned-overflow-scroll-expected.txt b/LayoutTests/platform/qt/fast/css/positioned-overflow-scroll-expected.txt
deleted file mode 100644 (file)
index 8a6abdb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-layer at (20,8) size 115x115 clip at (20,8) size 100x100
-  RenderBlock (positioned) {DIV} at (20,8) size 115x115
-    RenderBlock {SPAN} at (0,0) size 100x100 [bgcolor=#008000]
-layer at (140,8) size 115x115 clip at (140,8) size 100x100
-  RenderDeprecatedFlexibleBox (positioned) {DIV} at (140,8) size 115x115
-    RenderBlock {SPAN} at (0,0) size 100x100 [bgcolor=#008000]
index 2b1f540..f299a23 100644 (file)
@@ -5,6 +5,11 @@ if (window.testRunner)
 
 function insertAfter(nodeToAdd, referenceNode)
 {
+    if (referenceNode == document.body) {
+        document.body.appendChild(nodeToAdd);
+        return;
+    }
+
     if (referenceNode.nextSibling)
         referenceNode.parentNode.insertBefore(nodeToAdd, referenceNode.nextSibling);
     else