offset-path-url-010.html (1460B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Motion Path: offset-path:url() with content-box</title> 5 <link rel="help" href="https://drafts.fxtf.org/motion/#valdef-offset-path-url"> 6 <link rel="match" href="offset-path-url-008-ref.html"> 7 <meta name="assert" content="This tests that url() using content-box 8 generates a rotation and translation."> 9 <style> 10 #outer { 11 width: 300px; 12 height: 100px; 13 padding: 50px; 14 border: 50px solid black; 15 } 16 #target { 17 position: relative; 18 /** 19 * offset-path:url() references to the svg element and treats coord-box 20 * as its user coordinate system. And the svg element always gives it 21 * the offset starting position (based on the svg attributes). So the 22 * transformed box should ignore its current position from CSS layout. 23 * Intentionally use left property to make sure we ignore it. 24 */ 25 left: 100px; 26 width: 50px; 27 height: 50px; 28 background-color: green; 29 offset-path: url(#svgRect) content-box; 30 offset-distance: 0%; 31 border-radius: 50% 50% 0 0; 32 } 33 </style> 34 </head> 35 <body> 36 <div id="outer"> 37 <div id="target"></div> 38 </div> 39 <svg width="400" height="200" xmlns="http://www.w3.org/2000/svg"> 40 <defs> 41 <rect id="svgRect" width="100" height="100" x="50" y="0"/> 42 </defs> 43 </svg> 44 </body> 45 </html>