clip-inherit-001

clip: Inheriting 'auto' arguments of rect()

WeasyPrint

This browser

Assertion
The 'auto' keywords in rect() resolve to a used (not computed) value that aligns them with the border edges.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Test: clip: Inheriting 'auto' arguments of rect()</title>
 5   <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu">
 6   <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/visufx.html#clipping">
 8   <meta name="assert" content="The 'auto' keywords in rect() resolve to a         used (not computed) value that aligns them with the border edges.">
 9   <style type="text/css">
10      .container {
11         position: relative;
12         width: 100px; height: 100px;
13         background: red; }
14      #outer {
15         position: absolute;
16         top: 50px; left: 50px;
17         clip: rect(-50px, auto, auto, -50px);
18         height: 40px; width: 40px;
19         border: solid 5px transparent; }
20      #inner {
21         position: absolute;
22         top: -55px; left: -55px;
23         width: 60px; height: 60px;
24         border: solid 20px green;
25         background: green; clip: inherit; }
26   </style>
27 
28  </head>
29  <body>
30     <p>There must be a green box below and no red.</p>
31     <div class="container">
32       <div id="outer">
33         <div id="inner"></div>
34       </div>
35     </div>
36  </body>
37 </html>