File: flexbox-table-fixup-1b.xhtml

package info (click to toggle)
iceweasel 31.8.0esr-1~deb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,373,164 kB
  • sloc: cpp: 3,717,015; ansic: 1,797,386; python: 206,412; java: 180,622; asm: 133,557; xml: 89,501; sh: 72,014; perl: 22,087; makefile: 21,970; objc: 4,014; yacc: 1,995; pascal: 1,292; lex: 950; exp: 449; lisp: 228; awk: 211; php: 113; sed: 43; csh: 31; ada: 16; ruby: 3
file content (74 lines) | stat: -rw-r--r-- 2,739 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0" encoding="UTF-8"?>
<!--
     Any copyright is dedicated to the Public Domain.
     http://creativecommons.org/publicdomain/zero/1.0/
-->
<!--
     Testcase with table parts inside of a flex container, triggering
     table-fixup.  We use justify-content:space-between to stick packing
     space between flex items, so that we can verify that e.g. a contiguous
     run of <td>s will end up in the same flex item (wrapped in a table).

     In this variant of the test, we also assign 'flex' values to the
     table parts - these values should have no effect, since these children
     don't themselves form flex items.  The flex property _is_ honored on
     the <div class="c">, though, because _its_ box _is_ a direct child of a
     flexbox, so it _is_ a flex item.
-->
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>CSS Test: Testing that the 'flex' shorthand has no effect on table cells in a flex container, since they aren't flex items</title>
    <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/>
    <link rel="help" href="http://www.w3.org/TR/css3-flexbox/#flex-items"/>
    <link rel="match" href="flexbox-table-fixup-1-ref.xhtml"/>
    <style>
      div.flexbox {
        border: 1px dashed blue;
        width: 200px;
        display: flex;
        justify-content: space-around;
      }

      <!-- NOTE: table-fixup pads each td element by 1px on each side. We
           override that for top & bottom, for simplicity. So the td makes us
           generate a box that's 2px wider than its contents. -->
      td {
        padding-top: 0px;
        padding-bottom: 0px;
      }

      .a {
        background: lightgreen;
        width: 48px;
        flex: 5 3 100px;
      }

      .b {
        background: yellow;
        width: 48px;
        flex: 1 2 3px;
      }

      .c {
        background: pink;
        flex: 0 0 48px;
      }
    </style>
  </head>
  <body>
    <!-- Just 2 adjacent table cells (they end up in the same table) -->
    <div class="flexbox"
         ><td class="a">cell1</td><td class="b">cell2</td></div>

    <!-- Table cell followed by tbody (they end up in the same table) -->
    <div class="flexbox"
         ><td class="a">cell1</td><tbody class="b">t</tbody></div>

    <!-- Empty table cell (ends up occupying 2px of width), followed by div,
         followed by nonempty table cell. (3 flex items). -->
    <!-- Note: We use "space-between" (instead of "space-around") here because
         it makes the math cleaner. (100px split 2 ways instead of 3 ways.) -->
    <div class="flexbox" style="justify-content: space-between"
         ><td></td><div class="c">div</div><td class="b">cell1</td></div>
  </body>
</html>