Changeset 122623 in webkit
- Timestamp:
- Jul 13, 2012 12:58:47 PM (12 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 46 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r122620 r122623 1 2012-07-13 Tony Chang <tony@chromium.org> 2 3 Move layout checking js script into LayoutTest/resources and generalize 4 https://bugs.webkit.org/show_bug.cgi?id=91268 5 6 Reviewed by Ojan Vafai. 7 8 flexbox.js contains helper scripts for verifying the size and position of nodes. 9 I will be writing similar tests for grid, so move the js file into a location 10 for sharing and generalize the script. 11 12 * css3/flexbox/align-absolute-child.html: Change include path and call. 13 * css3/flexbox/auto-height-dynamic.html: 14 * css3/flexbox/columns-auto-size.html: 15 * css3/flexbox/flex-algorithm-min-max.html: 16 * css3/flexbox/flex-algorithm-with-margins.html: 17 * css3/flexbox/flex-algorithm.html: 18 * css3/flexbox/flex-align-column.html: 19 * css3/flexbox/flex-align-end.html: 20 * css3/flexbox/flex-align-max.html: 21 * css3/flexbox/flex-align-percent-height.html: 22 * css3/flexbox/flex-align-stretch.html: 23 * css3/flexbox/flex-align-vertical-writing-mode.html: 24 * css3/flexbox/flex-align.html: 25 * css3/flexbox/flex-flow-auto-margins.html: 26 * css3/flexbox/flex-flow-border.html: 27 * css3/flexbox/flex-flow-margins-auto-size.html: 28 * css3/flexbox/flex-flow-margins.html: 29 * css3/flexbox/flex-flow-orientations.html: 30 * css3/flexbox/flex-flow-overflow.html: 31 * css3/flexbox/flex-flow-padding.html: 32 * css3/flexbox/flex-flow.html: 33 * css3/flexbox/flex-item-child-overflow.html: 34 * css3/flexbox/flex-item-min-size.html: 35 * css3/flexbox/flex-justify-content.html: 36 * css3/flexbox/flex-no-flex.html: 37 * css3/flexbox/flexitem.html: 38 * css3/flexbox/floated-flexbox.html: 39 * css3/flexbox/line-wrapping.html: 40 * css3/flexbox/multiline-align-content-horizontal-column.html: 41 * css3/flexbox/multiline-align-content.html: 42 * css3/flexbox/multiline-align-self.html: 43 * css3/flexbox/multiline-column-auto.html: 44 * css3/flexbox/multiline-justify-content.html: 45 * css3/flexbox/multiline-reverse-wrap-overflow.html: 46 * css3/flexbox/multiline.html: 47 * css3/flexbox/nested-stretch.html: 48 * css3/flexbox/orthogonal-flex-directions.html: 49 * css3/flexbox/perpendicular-writing-modes-inside-flex-item.html: 50 * css3/flexbox/position-absolute-child.html: 51 * css3/flexbox/preferred-widths-orthogonal.html: 52 * css3/flexbox/preferred-widths.html: 53 * css3/flexbox/style-change.html: 54 * css3/flexbox/true-centering.html: 55 * css3/flexbox/writing-modes.html: 56 * resources/check-layout.js: Renamed from LayoutTests/css3/flexbox/resources/flexbox.js. 57 (.): Rename checkFlexboxen to checkLayout that takes a CSS selector. Hide functions in a closure. 58 1 59 2012-07-13 Zan Dobersek <zandobersek@gmail.com> 2 60 -
trunk/LayoutTests/css3/flexbox/align-absolute-child.html
r119990 r122623 95 95 96 96 <script src="../../fast/js/resources/js-test-pre.js"></script> 97 <script src=" resources/flexbox.js"></script>97 <script src="../../resources/check-layout.js"></script> 98 98 99 <body onload="check FlexBoxen()">99 <body onload="checkLayout('.flexbox')"> 100 100 101 101 <div class='flexbox relative align-center'> -
trunk/LayoutTests/css3/flexbox/auto-height-dynamic.html
r119990 r122623 17 17 testRunner.dumpAsText(); 18 18 </script> 19 <script src=" resources/flexbox.js"></script>20 <body onload="check FlexBoxen()">19 <script src="../../resources/check-layout.js"></script> 20 <body onload="checkLayout('.flexbox')"> 21 21 22 22 <div class="flexbox" data-expected-height=0> -
trunk/LayoutTests/css3/flexbox/columns-auto-size.html
r122508 r122623 47 47 testRunner.dumpAsText(); 48 48 </script> 49 <script src=" resources/flexbox.js"></script>50 <body onload="check FlexBoxen()">49 <script src="../../resources/check-layout.js"></script> 50 <body onload="checkLayout('.flexbox')"> 51 51 <div class="flexbox horizontal"> 52 52 <div data-expected-height="10" data-offset-y="0" style="-webkit-flex: 1 0 10px"></div> -
trunk/LayoutTests/css3/flexbox/flex-algorithm-min-max.html
r119990 r122623 30 30 testRunner.dumpAsText(); 31 31 </script> 32 <script src=" resources/flexbox.js"></script>33 <body onload="check FlexBoxen()">32 <script src="../../resources/check-layout.js"></script> 33 <body onload="checkLayout('.flexbox')"> 34 34 <div class="flexbox"> 35 35 <div data-expected-width="100" style="-webkit-flex: 1 0 0; max-width: 100px;"></div> -
trunk/LayoutTests/css3/flexbox/flex-algorithm-with-margins.html
r119990 r122623 30 30 testRunner.dumpAsText(); 31 31 </script> 32 <script src=" resources/flexbox.js"></script>33 <body onload="check FlexBoxen()">32 <script src="../../resources/check-layout.js"></script> 33 <body onload="checkLayout('.flexbox')"> 34 34 <div class="flexbox"> 35 35 <div data-expected-width="200" style="-webkit-flex: 1 0 0;"></div> -
trunk/LayoutTests/css3/flexbox/flex-algorithm.html
r120100 r122623 28 28 testRunner.dumpAsText(); 29 29 </script> 30 <script src=" resources/flexbox.js"></script>31 <body onload="check FlexBoxen()">30 <script src="../../resources/check-layout.js"></script> 31 <body onload="checkLayout('.flexbox')"> 32 32 33 33 <div class="flexbox"> -
trunk/LayoutTests/css3/flexbox/flex-align-column.html
r119990 r122623 42 42 testRunner.dumpAsText(); 43 43 </script> 44 <script src=" resources/flexbox.js"></script>45 <body onload="check FlexBoxen()">44 <script src="../../resources/check-layout.js"></script> 45 <body onload="checkLayout('.flexbox')"> 46 46 47 47 <div class="flexbox"> -
trunk/LayoutTests/css3/flexbox/flex-align-end.html
r119990 r122623 57 57 testRunner.dumpAsText(); 58 58 </script> 59 <script src=" resources/flexbox.js"></script>60 <body onload="check FlexBoxen()">59 <script src="../../resources/check-layout.js"></script> 60 <body onload="checkLayout('.flexbox')"> 61 61 62 62 <script> -
trunk/LayoutTests/css3/flexbox/flex-align-max.html
r119990 r122623 33 33 testRunner.dumpAsText(); 34 34 </script> 35 <script src=" resources/flexbox.js"></script>36 <body onload="check FlexBoxen()">35 <script src="../../resources/check-layout.js"></script> 36 <body onload="checkLayout('.flexbox')"> 37 37 38 38 <div class="flexbox"> -
trunk/LayoutTests/css3/flexbox/flex-align-percent-height.html
r119990 r122623 33 33 testRunner.dumpAsText(); 34 34 </script> 35 <script src=" resources/flexbox.js"></script>36 <body onload="check FlexBoxen()">35 <script src="../../resources/check-layout.js"></script> 36 <body onload="checkLayout('.flexbox')"> 37 37 38 38 <div class="flexbox" style="height: 50%;"> -
trunk/LayoutTests/css3/flexbox/flex-align-stretch.html
r121611 r122623 35 35 testRunner.dumpAsText(); 36 36 </script> 37 <script src=" resources/flexbox.js"></script>38 <body onload="check FlexBoxen()">37 <script src="../../resources/check-layout.js"></script> 38 <body onload="checkLayout('.flexbox')"> 39 39 <div class="flexbox" style="width: 600px"> 40 40 <div data-expected-height="100" style="-webkit-flex: 1 0 0; position: relative"> -
trunk/LayoutTests/css3/flexbox/flex-align-vertical-writing-mode.html
r119990 r122623 54 54 testRunner.dumpAsText(); 55 55 </script> 56 <script src=" resources/flexbox.js"></script>57 <body onload="check FlexBoxen()">56 <script src="../../resources/check-layout.js"></script> 57 <body onload="checkLayout('.flexbox')"> 58 58 59 59 <!-- stretch is the default align-items so these flexitems should all have the same height. --> -
trunk/LayoutTests/css3/flexbox/flex-align.html
r119990 r122623 53 53 testRunner.dumpAsText(); 54 54 </script> 55 <script src=" resources/flexbox.js"></script>56 <body onload="check FlexBoxen()">55 <script src="../../resources/check-layout.js"></script> 56 <body onload="checkLayout('.flexbox')"> 57 57 58 58 <!-- stretch is the default align-items so these flexitems should all have the same height. --> -
trunk/LayoutTests/css3/flexbox/flex-flow-auto-margins.html
r119990 r122623 82 82 testRunner.dumpAsText(); 83 83 </script> 84 <script src=" resources/flexbox.js"></script>85 <body onload="check FlexBoxen()">84 <script src="../../resources/check-layout.js"></script> 85 <body onload="checkLayout('.flexbox')"> 86 86 87 87 <script> -
trunk/LayoutTests/css3/flexbox/flex-flow-border.html
r119990 r122623 84 84 testRunner.dumpAsText(); 85 85 </script> 86 <script src=" resources/flexbox.js"></script>87 <body onload="check FlexBoxen()">86 <script src="../../resources/check-layout.js"></script> 87 <body onload="checkLayout('.flexbox')"> 88 88 89 89 <script> -
trunk/LayoutTests/css3/flexbox/flex-flow-margins-auto-size.html
r119990 r122623 55 55 testRunner.dumpAsText(); 56 56 </script> 57 <script src=" resources/flexbox.js"></script>58 <body onload="check FlexBoxen()">57 <script src="../../resources/check-layout.js"></script> 58 <body onload="checkLayout('.flexbox')"> 59 59 60 60 <script> -
trunk/LayoutTests/css3/flexbox/flex-flow-margins.html
r119990 r122623 79 79 testRunner.dumpAsText(); 80 80 </script> 81 <script src=" resources/flexbox.js"></script>82 <body onload="check FlexBoxen()">81 <script src="../../resources/check-layout.js"></script> 82 <body onload="checkLayout('.flexbox')"> 83 83 84 84 <script> -
trunk/LayoutTests/css3/flexbox/flex-flow-orientations.html
r119990 r122623 64 64 testRunner.dumpAsText(); 65 65 </script> 66 <script src=" resources/flexbox.js"></script>67 <body onload="check FlexBoxen()">66 <script src="../../resources/check-layout.js"></script> 67 <body onload="checkLayout('.flexbox')"> 68 68 69 69 <script> -
trunk/LayoutTests/css3/flexbox/flex-flow-overflow.html
r119990 r122623 55 55 testRunner.dumpAsText(); 56 56 </script> 57 <script src=" resources/flexbox.js"></script>58 <body onload="check FlexBoxen()">57 <script src="../../resources/check-layout.js"></script> 58 <body onload="checkLayout('.flexbox')"> 59 59 60 60 <script> -
trunk/LayoutTests/css3/flexbox/flex-flow-padding.html
r119990 r122623 76 76 testRunner.dumpAsText(); 77 77 </script> 78 <script src=" resources/flexbox.js"></script>79 <body onload="check FlexBoxen()">78 <script src="../../resources/check-layout.js"></script> 79 <body onload="checkLayout('.flexbox')"> 80 80 81 81 <script> -
trunk/LayoutTests/css3/flexbox/flex-flow.html
r119990 r122623 67 67 testRunner.dumpAsText(); 68 68 </script> 69 <script src=" resources/flexbox.js"></script>70 <body onload="check FlexBoxen()">69 <script src="../../resources/check-layout.js"></script> 70 <body onload="checkLayout('.flexbox')"> 71 71 72 72 <div class="flexbox"> -
trunk/LayoutTests/css3/flexbox/flex-item-child-overflow.html
r119990 r122623 20 20 } 21 21 </style> 22 <script src=" resources/flexbox.js"></script>23 <body onload="check FlexBoxen()">22 <script src="../../resources/check-layout.js"></script> 23 <body onload="checkLayout('.flexbox')"> 24 24 25 25 <div data-expected-height=0 class="flexbox"> -
trunk/LayoutTests/css3/flexbox/flex-item-min-size.html
r122508 r122623 45 45 testRunner.dumpAsText(); 46 46 </script> 47 <script src=" resources/flexbox.js"></script>47 <script src="../../resources/check-layout.js"></script> 48 48 49 <body onload="check FlexBoxen()">49 <body onload="checkLayout('.flexbox')"> 50 50 <div>Tests that flex items have default min-size to min-content in the main axis direction.</div> 51 51 <div class="flexbox"> -
trunk/LayoutTests/css3/flexbox/flex-justify-content.html
r119990 r122623 31 31 testRunner.dumpAsText(); 32 32 </script> 33 <script src=" resources/flexbox.js"></script>34 <body onload="check FlexBoxen()">33 <script src="../../resources/check-layout.js"></script> 34 <body onload="checkLayout('.flexbox')"> 35 35 <div class="flexbox"> 36 36 <div data-expected-width="100" data-offset-x="0" style="-webkit-flex: 1 0 0; max-width: 100px;"></div> -
trunk/LayoutTests/css3/flexbox/flex-no-flex.html
r119990 r122623 50 50 { 51 51 document.body.className = "noflex"; 52 check FlexBoxen();52 checkLayout('.flexbox'); 53 53 } 54 54 </script> 55 <script src=" resources/flexbox.js"></script>55 <script src="../../resources/check-layout.js"></script> 56 56 <body onload="runTest()"> 57 57 -
trunk/LayoutTests/css3/flexbox/flexitem.html
r122508 r122623 22 22 layoutTestController.dumpAsText(); 23 23 </script> 24 <script src=" resources/flexbox.js"></script>25 <body onload="check FlexBoxen()">24 <script src="../../resources/check-layout.js"></script> 25 <body onload="checkLayout('.flexbox')"> 26 26 <div class="flexbox"> 27 27 <button data-expected-display="block" data-expected-width="100">button</button> -
trunk/LayoutTests/css3/flexbox/floated-flexbox.html
r119990 r122623 19 19 testRunner.dumpAsText(); 20 20 </script> 21 <script src=" resources/flexbox.js"></script>22 <body onload="check FlexBoxen()">21 <script src="../../resources/check-layout.js"></script> 22 <body onload="checkLayout('.flexbox')"> 23 23 24 24 <div data-expected-width=130 data-expected-height=30 class=flexbox> -
trunk/LayoutTests/css3/flexbox/line-wrapping.html
r122508 r122623 111 111 testRunner.dumpAsText(); 112 112 </script> 113 <script src=" resources/flexbox.js"></script>114 <body onload="check FlexBoxen()">113 <script src="../../resources/check-layout.js"></script> 114 <body onload="checkLayout('.flexbox')"> 115 115 116 116 <div class="flexbox fixed row horizontal-tb"> -
trunk/LayoutTests/css3/flexbox/multiline-align-content-horizontal-column.html
r119990 r122623 65 65 testRunner.dumpAsText(); 66 66 </script> 67 <script src=" resources/flexbox.js"></script>68 <body onload="check FlexBoxen()">67 <script src="../../resources/check-layout.js"></script> 68 <body onload="checkLayout('.flexbox')"> 69 69 70 70 <script> -
trunk/LayoutTests/css3/flexbox/multiline-align-content.html
r119990 r122623 69 69 testRunner.dumpAsText(); 70 70 </script> 71 <script src=" resources/flexbox.js"></script>72 <body onload="check FlexBoxen()">71 <script src="../../resources/check-layout.js"></script> 72 <body onload="checkLayout('.flexbox')"> 73 73 <p>Test to make sure that align-content works properly.</p> 74 74 -
trunk/LayoutTests/css3/flexbox/multiline-align-self.html
r119990 r122623 96 96 testRunner.dumpAsText(); 97 97 </script> 98 <script src=" resources/flexbox.js"></script>99 <body onload="check FlexBoxen()">98 <script src="../../resources/check-layout.js"></script> 99 <body onload="checkLayout('.flexbox')"> 100 100 101 101 <script> -
trunk/LayoutTests/css3/flexbox/multiline-column-auto.html
r119990 r122623 32 32 testRunner.dumpAsText(); 33 33 </script> 34 <script src=" resources/flexbox.js"></script>35 <body onload="check FlexBoxen()">34 <script src="../../resources/check-layout.js"></script> 35 <body onload="checkLayout('.flexbox')"> 36 36 <p>Test to make sure that multiline columns break at the right places when auto sized.</p> 37 37 -
trunk/LayoutTests/css3/flexbox/multiline-justify-content.html
r119990 r122623 83 83 testRunner.dumpAsText(); 84 84 </script> 85 <script src=" resources/flexbox.js"></script>86 <body onload="check FlexBoxen()">85 <script src="../../resources/check-layout.js"></script> 86 <body onload="checkLayout('.flexbox')"> 87 87 88 88 <script> -
trunk/LayoutTests/css3/flexbox/multiline-reverse-wrap-overflow.html
r119990 r122623 31 31 testRunner.dumpAsText(); 32 32 </script> 33 <script src=" resources/flexbox.js"></script>34 <body onload="check FlexBoxen()">33 <script src="../../resources/check-layout.js"></script> 34 <body onload="checkLayout('.flexbox')"> 35 35 <p>Test to make sure that wrap-reverse starts at the cross start edge if 36 36 sizing is not auto.</p> -
trunk/LayoutTests/css3/flexbox/multiline.html
r119990 r122623 71 71 testRunner.dumpAsText(); 72 72 </script> 73 <script src=" resources/flexbox.js"></script>74 <body onload="check FlexBoxen()">73 <script src="../../resources/check-layout.js"></script> 74 <body onload="checkLayout('.flexbox')"> 75 75 76 76 <script> -
trunk/LayoutTests/css3/flexbox/nested-stretch.html
r119990 r122623 31 31 testRunner.dumpAsText(); 32 32 </script> 33 <script src=" resources/flexbox.js"></script>33 <script src="../../resources/check-layout.js"></script> 34 34 </head> 35 <body onload="check FlexBoxen()">35 <body onload="checkLayout('.flexbox')"> 36 36 There should be two boxes of equal height on the left and 3 boxes of equal 37 37 height on the right. -
trunk/LayoutTests/css3/flexbox/orthogonal-flex-directions.html
r119990 r122623 70 70 testRunner.dumpAsText(); 71 71 </script> 72 <script src=" resources/flexbox.js"></script>73 <body onload="check FlexBoxen()">72 <script src="../../resources/check-layout.js"></script> 73 <body onload="checkLayout('.flexbox')"> 74 74 75 75 <div class="flexbox"> -
trunk/LayoutTests/css3/flexbox/perpendicular-writing-modes-inside-flex-item.html
r122508 r122623 33 33 testRunner.dumpAsText(); 34 34 </script> 35 <script src=" resources/flexbox.js"></script>35 <script src="../../resources/check-layout.js"></script> 36 36 37 <body onload="check FlexBoxen()">37 <body onload="checkLayout('.flexbox')"> 38 38 <div class="flexbox"> 39 39 <div class="flexitem" data-expected-width=200 data-expected-height=300> -
trunk/LayoutTests/css3/flexbox/position-absolute-child.html
r119990 r122623 68 68 testRunner.dumpAsText(); 69 69 </script> 70 <script src=" resources/flexbox.js"></script>71 <body onload="check FlexBoxen()">70 <script src="../../resources/check-layout.js"></script> 71 <body onload="checkLayout('.flexbox')"> 72 72 73 73 <script> -
trunk/LayoutTests/css3/flexbox/preferred-widths-orthogonal.html
r119990 r122623 64 64 testRunner.dumpAsText(); 65 65 </script> 66 <script src=" resources/flexbox.js"></script>67 <body onload="check FlexBoxen()">66 <script src="../../resources/check-layout.js"></script> 67 <body onload="checkLayout('.flexbox')"> 68 68 69 69 <div class="flexbox" data-expected-height=70 data-expect-width=90> -
trunk/LayoutTests/css3/flexbox/preferred-widths.html
r119990 r122623 54 54 testRunner.dumpAsText(); 55 55 </script> 56 <script src=" resources/flexbox.js"></script>57 <body onload="check FlexBoxen()">56 <script src="../../resources/check-layout.js"></script> 57 <body onload="checkLayout('.flexbox')"> 58 58 59 59 <script> -
trunk/LayoutTests/css3/flexbox/style-change.html
r119990 r122623 29 29 testRunner.dumpAsText(); 30 30 </script> 31 <script src=" resources/flexbox.js"></script>31 <script src="../../resources/check-layout.js"></script> 32 32 <body> 33 33 … … 50 50 bDiv.setAttribute("data-offset-x", bXOffset); 51 51 bDiv.setAttribute("data-offset-y", bYOffset); 52 check FlexBoxen();52 checkLayout('.flexbox'); 53 53 } 54 54 -
trunk/LayoutTests/css3/flexbox/true-centering.html
r119990 r122623 56 56 testRunner.dumpAsText(); 57 57 </script> 58 <script src=" resources/flexbox.js"></script>59 <body onload="check FlexBoxen()">58 <script src="../../resources/check-layout.js"></script> 59 <body onload="checkLayout('.flexbox')"> 60 60 61 61 <div class="flexbox" style="-webkit-align-items: center; -webkit-justify-content: center;"> -
trunk/LayoutTests/css3/flexbox/writing-modes.html
r119990 r122623 53 53 testRunner.dumpAsText(); 54 54 </script> 55 <script src=" resources/flexbox.js"></script>56 <body onload="check FlexBoxen()">55 <script src="../../resources/check-layout.js"></script> 56 <body onload="checkLayout('.flexbox')"> 57 57 58 58 <div class="flexbox rtl"> -
trunk/LayoutTests/fast/css/deprecated-flexbox-auto-min-size.html
r122264 r122623 40 40 testRunner.dumpAsText(); 41 41 </script> 42 <script src="../../ css3/flexbox/resources/flexbox.js"></script>43 <body onload="check FlexBoxen()">42 <script src="../../resources/check-layout.js"></script> 43 <body onload="checkLayout('.flexbox')"> 44 44 45 45 Tests that deprecated flexboxes treat min-width/min-height:auto as 0px. -
trunk/LayoutTests/resources/check-layout.js
r122622 r122623 1 (function() { 2 1 3 function insertAfter(nodeToAdd, referenceNode) 2 4 { … … 75 77 } 76 78 77 function checkFlexBoxen()79 window.checkLayout = function(selectorList) 78 80 { 79 var flexboxen = document.getElementsByClassName("flexbox"); 80 Array.prototype.forEach.call(flexboxen, function(flexbox) { 81 if (!selectorList) { 82 console.error("You must provide a CSS selector of nodes to check."); 83 return; 84 } 85 var nodes = document.querySelectorAll(selectorList); 86 Array.prototype.forEach.call(nodes, function(node) { 81 87 var failures = []; 82 checkExpectedValues( flexbox.parentNode, failures);83 checkSubtreeExpectedValues( flexbox, failures);88 checkExpectedValues(node.parentNode, failures); 89 checkSubtreeExpectedValues(node, failures); 84 90 85 var container = flexbox.parentNode.className == 'container' ? flexbox.parentNode : flexbox;91 var container = node.parentNode.className == 'container' ? node.parentNode : node; 86 92 87 93 var pre = document.createElement('pre'); … … 95 101 setTimeout(function() { pre.previousSibling.scrollIntoView(); }, 0); 96 102 } 103 104 })();
Note: See TracChangeset
for help on using the changeset viewer.