legend-align-text-align.html (1085B)
1 <!doctype html> 2 <title>legend align does not map to text-align</title> 3 <!-- See discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1488228 --> 4 <script src=/resources/testharness.js></script> 5 <script src=/resources/testharnessreport.js></script> 6 <style> 7 legend { width: 13em } 8 </style> 9 <fieldset><legend>foo bar abcdefghijklmnopqrstuvwxyz</legend></fieldset> 10 <fieldset><legend align=left>foo bar abcdefghijklmnopqrstuvwxyz</legend></fieldset> 11 <fieldset><legend align=center>foo bar abcdefghijklmnopqrstuvwxyz</legend></fieldset> 12 <fieldset><legend align=right>foo bar abcdefghijklmnopqrstuvwxyz</legend></fieldset> 13 <fieldset><legend align=justify>foo bar abcdefghijklmnopqrstuvwxyz</legend></fieldset> 14 <script> 15 function test_align(selectorTest, expectedAlign) { 16 const testElm = document.querySelector(selectorTest); 17 test(() => { 18 assert_equals(getComputedStyle(testElm).textAlign, expectedAlign); 19 }, selectorTest); 20 } 21 22 test_align('legend', 'start'); 23 24 for (const val of ['left', 'center', 'right', 'justify']) { 25 test_align(`legend[align=${val}]`, 'start'); 26 } 27 </script>