tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

border-image-slice-fill-002.html (5792B)


      1 <!DOCTYPE html>
      2 
      3  <meta charset="UTF-8">
      4 
      5  <title>CSS Backgrounds Test: border-image-slice with 'fill' keyword and with no slicing (edge case)</title>
      6 
      7  <!--
      8 
      9  Created: February 24th 2023
     10 
     11  Last modified: February 28th 2023
     12 
     13  -->
     14 
     15  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
     16  <link rel="help" href="http://www.w3.org/TR/css3-background/#border-image-slice">
     17  <link rel="match" href="reference/border-image-slice-fill-002-ref.html">
     18 
     19  <meta content="" name="flags">
     20  <meta content="This test checks the rendering process of selecting the middle part of the border-image to be preserved. Since 'border-image-slice' is '0', then the whole border-image is its own middle part. In which case, the horizontal center and the vertical center of the border-image must fill the middle area. The 8 other areas of the border belt in this test are not painted and must become transparent." name="assert">
     21  <meta name="fuzzy" content="maxDifference=0-112; totalPixels=0-199" />
     22 
     23  <style>
     24  div#test
     25    {
     26      border: red solid 50px;
     27      border-image-repeat: repeat;
     28      border-image-slice: 0 fill;
     29      border-image-source: url("support/500x500-red-with-green-center.png");
     30      height: 100px;
     31      width: 100px;
     32   }
     33 
     34   /*
     35 
     36   This is how the border-image 500x500-red-with-green-center.png is painted:
     37 
     38 
     39   (0, 500) (50, 500)                 (200, 500)  (300, 500)                  (450, 500) (500, 500)
     40   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
     41   |                                          ^                                          |
     42   |         White area                      50                    White area            |
     43   |                                          v                                          |
     44   |        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -        | (500, 450)
     45   |       | FAIL                             ^                                  |       |
     46   |       |                                  .                                  |       |
     47   |<-50-> |                                                                     |<-50-> |
     48   |       |                                  1                                  |       |
     49   |  W    |       Red area                                   Red area           |  W    |
     50   |  h    |                                  5                                  |  h    |
     51   |  i    |                                                                     |  i    |
     52   |  t    |                                  0                                  |  t    |
     53   |  e    |                                                                     |  e    |
     54   |       |                                  .                                  |       |
     55   |  a    |                                  v                                  |  a    |
     56   |  r    |                            ------------                             |  r    | (500, 300)
     57   |  e    |                           |            |                            |  e    |
     58   |  a    |       Red area            |    Green   |         Red area           |  a    |
     59   |       |                           |            |                            |       |
     60   |       |  <!- . . . 150 . . .  ->  |    area    |  <!- . . .  150  . . . ->  |       |
     61   |       |                           |            |                            |       |
     62   |       |                            ------------                             |       | (500, 200)
     63   |       |                                  ^                                  |       |
     64   |       |                                  .                                  |       |
     65   |       |                                                                     |       |
     66   |       |       Red area                   1               Red area           |       |
     67   |       |                                                                     |       |
     68   |       |                                  5                                  |       |
     69   |       |                                                                     |       |
     70   |       |                                  0                                  |       |
     71   |       |                                                                     |       |
     72   |       |                                  .                                  |       |
     73   |       |                                  v                                  |       |
     74   |        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -        | (500, 50)
     75   |                                          ^                                          |
     76   |         White area                      50                    White area            |
     77   |                                          v                                          |
     78   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
     79   (0, 0) (50, 0)                     (200, 0)  (300, 0)                        (450, 0) (500, 0)
     80 
     81   */
     82 
     83  div#yellow-under-test
     84    {
     85      background-color: yellow;
     86      bottom: 200px;
     87      height: 200px;
     88      position: relative;
     89      width: 200px;
     90      z-index: -1;
     91    }
     92 
     93  /*
     94     The purpose of this div#yellow-under-test in
     95     here is to verify and to make sure that the
     96     border belt is indeed painted with the 8
     97     transparent areas and not with the white
     98     colored areas of the border-image.
     99  */
    100  </style>
    101 
    102  <p>Test passes if there is a filled green square surrounded by a yellow square and if there is <strong>no red</strong>.
    103 
    104  <div id="test"></div>
    105 
    106  <div id="yellow-under-test"></div>