Update web-platform-tests to revision 9a5d71b326166e12784bdd9d161772e20f87c1fd

This commit is contained in:
WPT Sync Bot 2018-09-07 21:37:42 -04:00
parent f7630dad87
commit 4ae3d09ff3
86 changed files with 2739 additions and 640 deletions

View file

@ -0,0 +1,27 @@
<!doctype html>
<title>legend align does not map to text-align</title>
<!-- See discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1488228 -->
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<style>
legend { width: 13em }
</style>
<fieldset><legend>foo bar abcdefghijklmnopqrstuvwxyz</legend></fieldset>
<fieldset><legend align=left>foo bar abcdefghijklmnopqrstuvwxyz</legend></fieldset>
<fieldset><legend align=center>foo bar abcdefghijklmnopqrstuvwxyz</legend></fieldset>
<fieldset><legend align=right>foo bar abcdefghijklmnopqrstuvwxyz</legend></fieldset>
<fieldset><legend align=justify>foo bar abcdefghijklmnopqrstuvwxyz</legend></fieldset>
<script>
function test_align(selectorTest, expectedAlign) {
const testElm = document.querySelector(selectorTest);
test(() => {
assert_equals(getComputedStyle(testElm).textAlign, expectedAlign);
}, selectorTest);
}
test_align('legend', 'start');
for (const val of ['left', 'center', 'right', 'justify']) {
test_align(`legend[align=${val}]`, 'start');
}
</script>

View file

@ -5,6 +5,7 @@
<fieldset><legend align=left>x</legend></fieldset>
<fieldset><legend align=center>x</legend></fieldset>
<fieldset><legend align=right>x</legend></fieldset>
<fieldset><legend align=justify>x</legend></fieldset>
<div align=left>
<fieldset><legend>x</legend></fieldset>
</div>
@ -14,6 +15,9 @@
<div align=right>
<fieldset><legend>x</legend></fieldset>
</div>
<div align=justify>
<fieldset><legend>x</legend></fieldset>
</div>
<div style="text-align: center">
<fieldset><legend>x</legend></fieldset>
</div>
@ -33,12 +37,12 @@ function test_align(selectorTest, selectorRef) {
}, selectorTest);
}
for (const val of ['left', 'center', 'right']) {
test_align(`div[align=${val}] legend`, `legend[align=${val}]`);
for (const val of ['left', 'center', 'right', 'justify']) {
test_align(`div[align=${val}] legend`, `legend[align=left]`);
}
test_align(`div[style="text-align: center"] legend`, `legend[align=left]`);
test_align(`div[style="text-align: center"][align=center] legend`, `legend[align=center]`);
test_align(`div[style="text-align: center"][align=center] legend`, `legend[align=left]`);
test_align(`legend[style="margin: 0 auto"]`, `legend[align=center]`);
test_align(`legend[style="margin: 0 0 0 auto"]`, `legend[align=right]`);
test_align(`fieldset[dir=rtl] legend`, `legend[align=right]`);