diff options
Diffstat (limited to 'testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-generated-content.html')
-rw-r--r-- | testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-generated-content.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-generated-content.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-generated-content.html new file mode 100644 index 0000000000..25a36bc42c --- /dev/null +++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-generated-content.html @@ -0,0 +1,30 @@ +<!doctype html> +<title>fieldset generated content</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<link rel="stylesheet" href="/fonts/ahem.css"> +<style> +body { + /* Use Ahem to avoid fractional letter widths. */ + font: 20px/1 Ahem; +} + +fieldset { + display: inline-block; + /* Paddings might have fractional values by default, and they can cause + rounding differences between the test element and the reference element. */ + padding: 0; +} + +#test::before, #test::after { content:"X"; } +</style> +<fieldset id=test><legend>A</legend>Y</fieldset> +<fieldset id=ref><legend>A</legend>XYX</fieldset> +<script> +test(() => { + const testElm = document.querySelector('#test'); + const refElm = document.querySelector('#ref'); + assert_equals(testElm.clientWidth, refElm.clientWidth, 'clientWidth'); + assert_equals(testElm.clientHeight, refElm.clientHeight, 'clientHeight'); +}); +</script> |