Changeset 122623 in webkit


Ignore:
Timestamp:
Jul 13, 2012 12:58:47 PM (12 years ago)
Author:
tony@chromium.org
Message:

Move layout checking js script into LayoutTest/resources and generalize
https://bugs.webkit.org/show_bug.cgi?id=91268

Reviewed by Ojan Vafai.

flexbox.js contains helper scripts for verifying the size and position of nodes.
I will be writing similar tests for grid, so move the js file into a location
for sharing and generalize the script.

  • css3/flexbox/align-absolute-child.html: Change include path and call.
  • css3/flexbox/auto-height-dynamic.html:
  • css3/flexbox/columns-auto-size.html:
  • css3/flexbox/flex-algorithm-min-max.html:
  • css3/flexbox/flex-algorithm-with-margins.html:
  • css3/flexbox/flex-algorithm.html:
  • css3/flexbox/flex-align-column.html:
  • css3/flexbox/flex-align-end.html:
  • css3/flexbox/flex-align-max.html:
  • css3/flexbox/flex-align-percent-height.html:
  • css3/flexbox/flex-align-stretch.html:
  • css3/flexbox/flex-align-vertical-writing-mode.html:
  • css3/flexbox/flex-align.html:
  • css3/flexbox/flex-flow-auto-margins.html:
  • css3/flexbox/flex-flow-border.html:
  • css3/flexbox/flex-flow-margins-auto-size.html:
  • css3/flexbox/flex-flow-margins.html:
  • css3/flexbox/flex-flow-orientations.html:
  • css3/flexbox/flex-flow-overflow.html:
  • css3/flexbox/flex-flow-padding.html:
  • css3/flexbox/flex-flow.html:
  • css3/flexbox/flex-item-child-overflow.html:
  • css3/flexbox/flex-item-min-size.html:
  • css3/flexbox/flex-justify-content.html:
  • css3/flexbox/flex-no-flex.html:
  • css3/flexbox/flexitem.html:
  • css3/flexbox/floated-flexbox.html:
  • css3/flexbox/line-wrapping.html:
  • css3/flexbox/multiline-align-content-horizontal-column.html:
  • css3/flexbox/multiline-align-content.html:
  • css3/flexbox/multiline-align-self.html:
  • css3/flexbox/multiline-column-auto.html:
  • css3/flexbox/multiline-justify-content.html:
  • css3/flexbox/multiline-reverse-wrap-overflow.html:
  • css3/flexbox/multiline.html:
  • css3/flexbox/nested-stretch.html:
  • css3/flexbox/orthogonal-flex-directions.html:
  • css3/flexbox/perpendicular-writing-modes-inside-flex-item.html:
  • css3/flexbox/position-absolute-child.html:
  • css3/flexbox/preferred-widths-orthogonal.html:
  • css3/flexbox/preferred-widths.html:
  • css3/flexbox/style-change.html:
  • css3/flexbox/true-centering.html:
  • css3/flexbox/writing-modes.html:
  • resources/check-layout.js: Renamed from LayoutTests/css3/flexbox/resources/flexbox.js.

(.): Rename checkFlexboxen to checkLayout that takes a CSS selector. Hide functions in a closure.

Location:
trunk/LayoutTests
Files:
46 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r122620 r122623  
     12012-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
    1592012-07-13  Zan Dobersek  <zandobersek@gmail.com>
    260
  • trunk/LayoutTests/css3/flexbox/align-absolute-child.html

    r119990 r122623  
    9595
    9696<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>
    9898
    99 <body onload="checkFlexBoxen()">
     99<body onload="checkLayout('.flexbox')">
    100100
    101101<div class='flexbox relative align-center'>
  • trunk/LayoutTests/css3/flexbox/auto-height-dynamic.html

    r119990 r122623  
    1717    testRunner.dumpAsText();
    1818</script>
    19 <script src="resources/flexbox.js"></script>
    20 <body onload="checkFlexBoxen()">
     19<script src="../../resources/check-layout.js"></script>
     20<body onload="checkLayout('.flexbox')">
    2121
    2222<div class="flexbox" data-expected-height=0>
  • trunk/LayoutTests/css3/flexbox/columns-auto-size.html

    r122508 r122623  
    4747    testRunner.dumpAsText();
    4848</script>
    49 <script src="resources/flexbox.js"></script>
    50 <body onload="checkFlexBoxen()">
     49<script src="../../resources/check-layout.js"></script>
     50<body onload="checkLayout('.flexbox')">
    5151<div class="flexbox horizontal">
    5252  <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  
    3030    testRunner.dumpAsText();
    3131</script>
    32 <script src="resources/flexbox.js"></script>
    33 <body onload="checkFlexBoxen()">
     32<script src="../../resources/check-layout.js"></script>
     33<body onload="checkLayout('.flexbox')">
    3434<div class="flexbox">
    3535  <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  
    3030    testRunner.dumpAsText();
    3131</script>
    32 <script src="resources/flexbox.js"></script>
    33 <body onload="checkFlexBoxen()">
     32<script src="../../resources/check-layout.js"></script>
     33<body onload="checkLayout('.flexbox')">
    3434<div class="flexbox">
    3535  <div data-expected-width="200" style="-webkit-flex: 1 0 0;"></div>
  • trunk/LayoutTests/css3/flexbox/flex-algorithm.html

    r120100 r122623  
    2828    testRunner.dumpAsText();
    2929</script>
    30 <script src="resources/flexbox.js"></script>
    31 <body onload="checkFlexBoxen()">
     30<script src="../../resources/check-layout.js"></script>
     31<body onload="checkLayout('.flexbox')">
    3232
    3333<div class="flexbox">
  • trunk/LayoutTests/css3/flexbox/flex-align-column.html

    r119990 r122623  
    4242    testRunner.dumpAsText();
    4343</script>
    44 <script src="resources/flexbox.js"></script>
    45 <body onload="checkFlexBoxen()">
     44<script src="../../resources/check-layout.js"></script>
     45<body onload="checkLayout('.flexbox')">
    4646
    4747<div class="flexbox">
  • trunk/LayoutTests/css3/flexbox/flex-align-end.html

    r119990 r122623  
    5757    testRunner.dumpAsText();
    5858</script>
    59 <script src="resources/flexbox.js"></script>
    60 <body onload="checkFlexBoxen()">
     59<script src="../../resources/check-layout.js"></script>
     60<body onload="checkLayout('.flexbox')">
    6161
    6262<script>
  • trunk/LayoutTests/css3/flexbox/flex-align-max.html

    r119990 r122623  
    3333    testRunner.dumpAsText();
    3434</script>
    35 <script src="resources/flexbox.js"></script>
    36 <body onload="checkFlexBoxen()">
     35<script src="../../resources/check-layout.js"></script>
     36<body onload="checkLayout('.flexbox')">
    3737
    3838<div class="flexbox">
  • trunk/LayoutTests/css3/flexbox/flex-align-percent-height.html

    r119990 r122623  
    3333    testRunner.dumpAsText();
    3434</script>
    35 <script src="resources/flexbox.js"></script>
    36 <body onload="checkFlexBoxen()">
     35<script src="../../resources/check-layout.js"></script>
     36<body onload="checkLayout('.flexbox')">
    3737
    3838<div class="flexbox" style="height: 50%;">
  • trunk/LayoutTests/css3/flexbox/flex-align-stretch.html

    r121611 r122623  
    3535    testRunner.dumpAsText();
    3636</script>
    37 <script src="resources/flexbox.js"></script>
    38 <body onload="checkFlexBoxen()">
     37<script src="../../resources/check-layout.js"></script>
     38<body onload="checkLayout('.flexbox')">
    3939<div class="flexbox" style="width: 600px">
    4040  <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  
    5454    testRunner.dumpAsText();
    5555</script>
    56 <script src="resources/flexbox.js"></script>
    57 <body onload="checkFlexBoxen()">
     56<script src="../../resources/check-layout.js"></script>
     57<body onload="checkLayout('.flexbox')">
    5858
    5959<!-- stretch is the default align-items so these flexitems should all have the same height. -->
  • trunk/LayoutTests/css3/flexbox/flex-align.html

    r119990 r122623  
    5353    testRunner.dumpAsText();
    5454</script>
    55 <script src="resources/flexbox.js"></script>
    56 <body onload="checkFlexBoxen()">
     55<script src="../../resources/check-layout.js"></script>
     56<body onload="checkLayout('.flexbox')">
    5757
    5858<!-- 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  
    8282    testRunner.dumpAsText();
    8383</script>
    84 <script src="resources/flexbox.js"></script>
    85 <body onload="checkFlexBoxen()">
     84<script src="../../resources/check-layout.js"></script>
     85<body onload="checkLayout('.flexbox')">
    8686
    8787<script>
  • trunk/LayoutTests/css3/flexbox/flex-flow-border.html

    r119990 r122623  
    8484    testRunner.dumpAsText();
    8585</script>
    86 <script src="resources/flexbox.js"></script>
    87 <body onload="checkFlexBoxen()">
     86<script src="../../resources/check-layout.js"></script>
     87<body onload="checkLayout('.flexbox')">
    8888
    8989<script>
  • trunk/LayoutTests/css3/flexbox/flex-flow-margins-auto-size.html

    r119990 r122623  
    5555    testRunner.dumpAsText();
    5656</script>
    57 <script src="resources/flexbox.js"></script>
    58 <body onload="checkFlexBoxen()">
     57<script src="../../resources/check-layout.js"></script>
     58<body onload="checkLayout('.flexbox')">
    5959
    6060<script>
  • trunk/LayoutTests/css3/flexbox/flex-flow-margins.html

    r119990 r122623  
    7979    testRunner.dumpAsText();
    8080</script>
    81 <script src="resources/flexbox.js"></script>
    82 <body onload="checkFlexBoxen()">
     81<script src="../../resources/check-layout.js"></script>
     82<body onload="checkLayout('.flexbox')">
    8383
    8484<script>
  • trunk/LayoutTests/css3/flexbox/flex-flow-orientations.html

    r119990 r122623  
    6464    testRunner.dumpAsText();
    6565</script>
    66 <script src="resources/flexbox.js"></script>
    67 <body onload="checkFlexBoxen()">
     66<script src="../../resources/check-layout.js"></script>
     67<body onload="checkLayout('.flexbox')">
    6868
    6969<script>
  • trunk/LayoutTests/css3/flexbox/flex-flow-overflow.html

    r119990 r122623  
    5555    testRunner.dumpAsText();
    5656</script>
    57 <script src="resources/flexbox.js"></script>
    58 <body onload="checkFlexBoxen()">
     57<script src="../../resources/check-layout.js"></script>
     58<body onload="checkLayout('.flexbox')">
    5959
    6060<script>
  • trunk/LayoutTests/css3/flexbox/flex-flow-padding.html

    r119990 r122623  
    7676    testRunner.dumpAsText();
    7777</script>
    78 <script src="resources/flexbox.js"></script>
    79 <body onload="checkFlexBoxen()">
     78<script src="../../resources/check-layout.js"></script>
     79<body onload="checkLayout('.flexbox')">
    8080
    8181<script>
  • trunk/LayoutTests/css3/flexbox/flex-flow.html

    r119990 r122623  
    6767    testRunner.dumpAsText();
    6868</script>
    69 <script src="resources/flexbox.js"></script>
    70 <body onload="checkFlexBoxen()">
     69<script src="../../resources/check-layout.js"></script>
     70<body onload="checkLayout('.flexbox')">
    7171
    7272<div class="flexbox">
  • trunk/LayoutTests/css3/flexbox/flex-item-child-overflow.html

    r119990 r122623  
    2020}
    2121</style>
    22 <script src="resources/flexbox.js"></script>
    23 <body onload="checkFlexBoxen()">
     22<script src="../../resources/check-layout.js"></script>
     23<body onload="checkLayout('.flexbox')">
    2424
    2525<div data-expected-height=0 class="flexbox">
  • trunk/LayoutTests/css3/flexbox/flex-item-min-size.html

    r122508 r122623  
    4545    testRunner.dumpAsText();
    4646</script>
    47 <script src="resources/flexbox.js"></script>
     47<script src="../../resources/check-layout.js"></script>
    4848
    49 <body onload="checkFlexBoxen()">
     49<body onload="checkLayout('.flexbox')">
    5050    <div>Tests that flex items have default min-size to min-content in the main axis direction.</div>
    5151    <div class="flexbox">
  • trunk/LayoutTests/css3/flexbox/flex-justify-content.html

    r119990 r122623  
    3131    testRunner.dumpAsText();
    3232</script>
    33 <script src="resources/flexbox.js"></script>
    34 <body onload="checkFlexBoxen()">
     33<script src="../../resources/check-layout.js"></script>
     34<body onload="checkLayout('.flexbox')">
    3535<div class="flexbox">
    3636  <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  
    5050{
    5151    document.body.className = "noflex";
    52     checkFlexBoxen();
     52    checkLayout('.flexbox');
    5353}
    5454</script>
    55 <script src="resources/flexbox.js"></script>
     55<script src="../../resources/check-layout.js"></script>
    5656<body onload="runTest()">
    5757
  • trunk/LayoutTests/css3/flexbox/flexitem.html

    r122508 r122623  
    2222    layoutTestController.dumpAsText();
    2323</script>
    24 <script src="resources/flexbox.js"></script>
    25 <body onload="checkFlexBoxen()">
     24<script src="../../resources/check-layout.js"></script>
     25<body onload="checkLayout('.flexbox')">
    2626<div class="flexbox">
    2727  <button data-expected-display="block" data-expected-width="100">button</button>
  • trunk/LayoutTests/css3/flexbox/floated-flexbox.html

    r119990 r122623  
    1919    testRunner.dumpAsText();
    2020</script>
    21 <script src="resources/flexbox.js"></script>
    22 <body onload="checkFlexBoxen()">
     21<script src="../../resources/check-layout.js"></script>
     22<body onload="checkLayout('.flexbox')">
    2323
    2424<div data-expected-width=130 data-expected-height=30 class=flexbox>
  • trunk/LayoutTests/css3/flexbox/line-wrapping.html

    r122508 r122623  
    111111    testRunner.dumpAsText();
    112112</script>
    113 <script src="resources/flexbox.js"></script>
    114 <body onload="checkFlexBoxen()">
     113<script src="../../resources/check-layout.js"></script>
     114<body onload="checkLayout('.flexbox')">
    115115
    116116<div class="flexbox fixed row horizontal-tb">
  • trunk/LayoutTests/css3/flexbox/multiline-align-content-horizontal-column.html

    r119990 r122623  
    6565    testRunner.dumpAsText();
    6666</script>
    67 <script src="resources/flexbox.js"></script>
    68 <body onload="checkFlexBoxen()">
     67<script src="../../resources/check-layout.js"></script>
     68<body onload="checkLayout('.flexbox')">
    6969
    7070<script>
  • trunk/LayoutTests/css3/flexbox/multiline-align-content.html

    r119990 r122623  
    6969    testRunner.dumpAsText();
    7070</script>
    71 <script src="resources/flexbox.js"></script>
    72 <body onload="checkFlexBoxen()">
     71<script src="../../resources/check-layout.js"></script>
     72<body onload="checkLayout('.flexbox')">
    7373<p>Test to make sure that align-content works properly.</p>
    7474
  • trunk/LayoutTests/css3/flexbox/multiline-align-self.html

    r119990 r122623  
    9696    testRunner.dumpAsText();
    9797</script>
    98 <script src="resources/flexbox.js"></script>
    99 <body onload="checkFlexBoxen()">
     98<script src="../../resources/check-layout.js"></script>
     99<body onload="checkLayout('.flexbox')">
    100100
    101101<script>
  • trunk/LayoutTests/css3/flexbox/multiline-column-auto.html

    r119990 r122623  
    3232    testRunner.dumpAsText();
    3333</script>
    34 <script src="resources/flexbox.js"></script>
    35 <body onload="checkFlexBoxen()">
     34<script src="../../resources/check-layout.js"></script>
     35<body onload="checkLayout('.flexbox')">
    3636<p>Test to make sure that multiline columns break at the right places when auto sized.</p>
    3737
  • trunk/LayoutTests/css3/flexbox/multiline-justify-content.html

    r119990 r122623  
    8383    testRunner.dumpAsText();
    8484</script>
    85 <script src="resources/flexbox.js"></script>
    86 <body onload="checkFlexBoxen()">
     85<script src="../../resources/check-layout.js"></script>
     86<body onload="checkLayout('.flexbox')">
    8787
    8888<script>
  • trunk/LayoutTests/css3/flexbox/multiline-reverse-wrap-overflow.html

    r119990 r122623  
    3131    testRunner.dumpAsText();
    3232</script>
    33 <script src="resources/flexbox.js"></script>
    34 <body onload="checkFlexBoxen()">
     33<script src="../../resources/check-layout.js"></script>
     34<body onload="checkLayout('.flexbox')">
    3535<p>Test to make sure that wrap-reverse starts at the cross start edge if
    3636sizing is not auto.</p>
  • trunk/LayoutTests/css3/flexbox/multiline.html

    r119990 r122623  
    7171    testRunner.dumpAsText();
    7272</script>
    73 <script src="resources/flexbox.js"></script>
    74 <body onload="checkFlexBoxen()">
     73<script src="../../resources/check-layout.js"></script>
     74<body onload="checkLayout('.flexbox')">
    7575
    7676<script>
  • trunk/LayoutTests/css3/flexbox/nested-stretch.html

    r119990 r122623  
    3131    testRunner.dumpAsText();
    3232</script>
    33 <script src="resources/flexbox.js"></script>
     33<script src="../../resources/check-layout.js"></script>
    3434</head>
    35 <body onload="checkFlexBoxen()">
     35<body onload="checkLayout('.flexbox')">
    3636There should be two boxes of equal height on the left and 3 boxes of equal
    3737height on the right.
  • trunk/LayoutTests/css3/flexbox/orthogonal-flex-directions.html

    r119990 r122623  
    7070    testRunner.dumpAsText();
    7171</script>
    72 <script src="resources/flexbox.js"></script>
    73 <body onload="checkFlexBoxen()">
     72<script src="../../resources/check-layout.js"></script>
     73<body onload="checkLayout('.flexbox')">
    7474
    7575<div class="flexbox">
  • trunk/LayoutTests/css3/flexbox/perpendicular-writing-modes-inside-flex-item.html

    r122508 r122623  
    3333    testRunner.dumpAsText();
    3434</script>
    35 <script src="resources/flexbox.js"></script>
     35<script src="../../resources/check-layout.js"></script>
    3636
    37 <body onload="checkFlexBoxen()">
     37<body onload="checkLayout('.flexbox')">
    3838    <div class="flexbox">
    3939        <div class="flexitem" data-expected-width=200 data-expected-height=300>
  • trunk/LayoutTests/css3/flexbox/position-absolute-child.html

    r119990 r122623  
    6868    testRunner.dumpAsText();
    6969</script>
    70 <script src="resources/flexbox.js"></script>
    71 <body onload="checkFlexBoxen()">
     70<script src="../../resources/check-layout.js"></script>
     71<body onload="checkLayout('.flexbox')">
    7272
    7373<script>
  • trunk/LayoutTests/css3/flexbox/preferred-widths-orthogonal.html

    r119990 r122623  
    6464    testRunner.dumpAsText();
    6565</script>
    66 <script src="resources/flexbox.js"></script>
    67 <body onload="checkFlexBoxen()">
     66<script src="../../resources/check-layout.js"></script>
     67<body onload="checkLayout('.flexbox')">
    6868
    6969<div class="flexbox" data-expected-height=70  data-expect-width=90>
  • trunk/LayoutTests/css3/flexbox/preferred-widths.html

    r119990 r122623  
    5454    testRunner.dumpAsText();
    5555</script>
    56 <script src="resources/flexbox.js"></script>
    57 <body onload="checkFlexBoxen()">
     56<script src="../../resources/check-layout.js"></script>
     57<body onload="checkLayout('.flexbox')">
    5858
    5959<script>
  • trunk/LayoutTests/css3/flexbox/style-change.html

    r119990 r122623  
    2929    testRunner.dumpAsText();
    3030</script>
    31 <script src="resources/flexbox.js"></script>
     31<script src="../../resources/check-layout.js"></script>
    3232<body>
    3333
     
    5050    bDiv.setAttribute("data-offset-x", bXOffset);
    5151    bDiv.setAttribute("data-offset-y", bYOffset);
    52     checkFlexBoxen();
     52    checkLayout('.flexbox');
    5353}
    5454
  • trunk/LayoutTests/css3/flexbox/true-centering.html

    r119990 r122623  
    5656    testRunner.dumpAsText();
    5757</script>
    58 <script src="resources/flexbox.js"></script>
    59 <body onload="checkFlexBoxen()">
     58<script src="../../resources/check-layout.js"></script>
     59<body onload="checkLayout('.flexbox')">
    6060
    6161<div class="flexbox" style="-webkit-align-items: center; -webkit-justify-content: center;">
  • trunk/LayoutTests/css3/flexbox/writing-modes.html

    r119990 r122623  
    5353    testRunner.dumpAsText();
    5454</script>
    55 <script src="resources/flexbox.js"></script>
    56 <body onload="checkFlexBoxen()">
     55<script src="../../resources/check-layout.js"></script>
     56<body onload="checkLayout('.flexbox')">
    5757
    5858<div class="flexbox rtl">
  • trunk/LayoutTests/fast/css/deprecated-flexbox-auto-min-size.html

    r122264 r122623  
    4040    testRunner.dumpAsText();
    4141</script>
    42 <script src="../../css3/flexbox/resources/flexbox.js"></script>
    43 <body onload="checkFlexBoxen()">
     42<script src="../../resources/check-layout.js"></script>
     43<body onload="checkLayout('.flexbox')">
    4444
    4545Tests that deprecated flexboxes treat min-width/min-height:auto as 0px.
  • trunk/LayoutTests/resources/check-layout.js

    r122622 r122623  
     1(function() {
     2
    13function insertAfter(nodeToAdd, referenceNode)
    24{
     
    7577}
    7678
    77 function checkFlexBoxen()
     79window.checkLayout = function(selectorList)
    7880{
    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) {
    8187        var failures = [];
    82         checkExpectedValues(flexbox.parentNode, failures);
    83         checkSubtreeExpectedValues(flexbox, failures);
     88        checkExpectedValues(node.parentNode, failures);
     89        checkSubtreeExpectedValues(node, failures);
    8490
    85         var container = flexbox.parentNode.className == 'container' ? flexbox.parentNode : flexbox;
     91        var container = node.parentNode.className == 'container' ? node.parentNode : node;
    8692
    8793        var pre = document.createElement('pre');
     
    95101        setTimeout(function() { pre.previousSibling.scrollIntoView(); }, 0);
    96102}
     103
     104})();
Note: See TracChangeset for help on using the changeset viewer.