border-shorthand.html (2042B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Backgrounds and Borders Module Level 3: border sets longhands</title> 6 <link rel="help" href="https://drafts.csswg.org/css-backgrounds/#border-shorthands"> 7 <meta name="assert" content="border supports the full grammar '<line-width> || <line-style> || <color>'."> 8 <meta name="assert" content="The border shorthand also resets border-image to its initial value."> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 <script src="/css/support/shorthand-testcommon.js"></script> 12 <script src="/css/support/parsing-testcommon.js"></script> 13 </head> 14 <body> 15 <script> 16 17 test_invalid_value('border', '2px solid color-mix(42deg)'); 18 test_invalid_value('border', '2px solid color-contrast(42deg)'); 19 20 test_shorthand_value('border', '5px dotted blue', { 21 'border-top-width': '5px', 22 'border-right-width': '5px', 23 'border-bottom-width': '5px', 24 'border-left-width': '5px', 25 'border-top-style': 'dotted', 26 'border-right-style': 'dotted', 27 'border-bottom-style': 'dotted', 28 'border-left-style': 'dotted', 29 'border-top-color': 'blue', 30 'border-right-color': 'blue', 31 'border-bottom-color': 'blue', 32 'border-left-color': 'blue', 33 34 'border-image-source': 'none', 35 'border-image-slice': '100%', 36 'border-image-width': '1', 37 'border-image-outset': '0', 38 'border-image-repeat': 'stretch' 39 }); 40 41 test_shorthand_value('border-top', 'thin', { 42 'border-top-width': 'thin', 43 'border-top-style': 'none', 44 'border-top-color': 'currentcolor' 45 }); 46 47 test_shorthand_value('border-right', 'double', { 48 'border-right-width': 'medium', 49 'border-right-style': 'double', 50 'border-right-color': 'currentcolor' 51 }); 52 53 test_shorthand_value('border-bottom', 'green', { 54 'border-bottom-width': 'medium', 55 'border-bottom-style': 'none', 56 'border-bottom-color': 'green' 57 }); 58 59 test_shorthand_value('border-left', '1px dotted red', { 60 'border-left-width': '1px', 61 'border-left-style': 'dotted', 62 'border-left-color': 'red' 63 }); 64 </script> 65 </body> 66 </html>