summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-backgrounds/border-image-repeat-stretch-round-001.html
blob: 8c2963a5aec867d90b20692ce0c0dfbdc41cac56 (plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>

  <meta charset="UTF-8">

  <title>CSS Backgrounds Test: border-image-repeat: stretch round</title>

  <!--

  Created: June 23rd 2023

  Last modified: August 23rd 2023

  -->

  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
  <link rel="help" href="https://www.w3.org/TR/css-backgrounds-3/#border-image-repeat">
  <link rel="help" href="https://www.w3.org/TR/css-backgrounds-3/#border-image-process">
  <link rel="match" href="reference/border-image-repeat-stretch-round-001-ref.html">

  <meta content="" name="flags">
  <meta content="This test checks that the process of repeating the tile when 'border-image-repeat' is 'stretch round'. Thanks to a specially crafted rectangular border-image, we check how the sliced border-image is, in the first-subtest, rescaled down vertically (left and right sides), and is, in the second-subtest, rescaled up vertically (left and right sides). In both subtests, the border-image in the horizontal axis (top and bottom sides) are stretched." name="assert">

  <!--

  'stretch'
  The image is stretched to fill the area.

  https://www.w3.org/TR/css-backgrounds-3/#valdef-border-image-repeat-stretch


  'round'
  The image is tiled (repeated) to fill the area. If it does not
  fill the area with a whole number of tiles, the image is rescaled
  so that it does.

  https://www.w3.org/TR/css-backgrounds-3/#valdef-border-image-repeat-round

  -->

  <style>
  div
    {
      border: red solid 64px;
      border-image-repeat: stretch round;
      /*
      "
      The first keyword applies to the horizontal scaling and
      tiling of the top, middle and bottom parts, the second to
      the vertical scaling and tiling of the left, middle and right parts
      "
      https://www.w3.org/TR/css-backgrounds-3/#border-image-repeat
      */
      border-image-slice: 64 fill; /* the center will be black */
      border-image-source: url("support/4bicolor-squares.png");
      display: inline-block;
      image-rendering: pixelated; /* attempt to overcome antialias fuzziness */
      margin-right: 1em;
   }

  div#first-subtest
    {
      height: 96px;
      width: 192px;
      /*
      96px divided by 64px == 1.5 which is rounded up to 2.
      So, the image should be 96px divided by 2 == 48px
      wide. That means that the left and right
      bicolor (orange and blue) images should be 48px tall,
      therefore rescaled down, from sliced 64px to 48px.

      The top and bottom sides should be stretched from
      sliced 64px to 192px (3 times).
      */
    }

  div#second-subtest
    {
      height: 80px;
      width: 128px;
      /*
      80px divided by 64px == 1.25 which is rounded down to 1.
      So, each image should be 80px divided by 1 == 80px
      tall. That means that the left and right bicolor
      (orange and blue) images should be 80px tall
      therefore rescaled up, from sliced 64px to 80px.

      The top and bottom sides should be stretched from
      sliced 64px to 128px (2 times).
      */
    }
  </style>

  <div id="first-subtest"></div>

  <div id="second-subtest"></div>