tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit a81e9ac246f2601a0895e1d0b468a618f06d9131
parent 04189b94ca461bace66d649bff88705afca11cf6
Author: Simon Pieters <zcorpan@gmail.com>
Date:   Tue, 16 Dec 2025 08:38:33 +0000

Bug 2005475 [wpt PR 56676] - HTML: split out ruby tests from fieldset/legend display tests, a=testonly

Automatic update from web-platform-tests
HTML: split out ruby tests from fieldset/legend display tests

See https://github.com/web-platform-tests/interop/issues/1125

--

wpt-commits: 1a9219a0abad4662197d722064d9623ded7ed42c
wpt-pr: 56676

Diffstat:
Atesting/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-display-ruby.html | 38++++++++++++++++++++++++++++++++++++++
Mtesting/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-display.html | 4++--
Atesting/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-display-ruby.html | 38++++++++++++++++++++++++++++++++++++++
Mtesting/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-display.html | 6+-----
Atesting/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-sans-fieldset-display-ruby.html | 27+++++++++++++++++++++++++++
Mtesting/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-sans-fieldset-display.html | 6------
6 files changed, 106 insertions(+), 13 deletions(-)

diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-display-ruby.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-display-ruby.html @@ -0,0 +1,38 @@ +<!doctype html> +<title>fieldset and CSS display (ruby)</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<style> + #inline-ref { display: inline-block; } +</style> +<fieldset id="block-ref">x</fieldset> +<fieldset id="inline-ref">x</fieldset> +<fieldset id="test">x</fieldset> +<script> + const blockWidth = getComputedStyle(document.querySelector('#block-ref')).width; + const inlineWidth = getComputedStyle(document.querySelector('#inline-ref')).width; + const testElm = document.querySelector('#test'); + // Please only add canonical values to these lists: + // (Also, note that we're not testing "display:run-in" here; it's mentioned + // in several CSS specs, but no browser engines appear likely to support it.) + const blocks = ['block ruby']; + const inlines = ['ruby', 'ruby-base', 'ruby-text', 'ruby-base-container', 'ruby-text-container']; + + function test_display(val, expectedWidth) { + test(() => { + testElm.style.removeProperty('display'); + testElm.style.display = val; + const computed = getComputedStyle(testElm); + assert_equals(computed.display, val, `display: ${val} is not supported`); + assert_equals(computed.width, expectedWidth); + }, `fieldset with display: ${val}`); + } + + for (const val of blocks) { + test_display(val, blockWidth); + } + + for (const val of inlines) { + test_display(val, inlineWidth); + } +</script> diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-display.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-display.html @@ -16,8 +16,8 @@ // (Also, note that we're not testing "display:run-in" here; it's mentioned // in several CSS specs, but no browser engines appear likely to support it.) const blocks = ['block', 'table', 'table-row-group', 'table-header-group', 'table-footer-group', 'table-row', 'table-cell', - 'table-column-group', 'table-column', 'table-caption', 'list-item', 'flow-root', 'block ruby']; - const inlines = ['inline', 'inline-block', 'inline-table', 'ruby', 'ruby-base', 'ruby-text', 'ruby-base-container', 'ruby-text-container']; + 'table-column-group', 'table-column', 'table-caption', 'list-item', 'flow-root']; + const inlines = ['inline', 'inline-block', 'inline-table']; function test_display(val, expectedWidth) { test(() => { diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-display-ruby.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-display-ruby.html @@ -0,0 +1,38 @@ +<!doctype html> +<title>rendered legend and CSS display (ruby)</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<style> +legend { width:initial; } +</style> +<fieldset><legend id="ref">x</legend></fieldset> +<fieldset><legend id="test">x</legend></fieldset> +<script> + const refElm = document.querySelector('#ref'); + const refStyle = getComputedStyle(refElm); + const testElm = document.querySelector('#test'); + // Note that we're not testing "display:run-in" here; it's mentioned in + // several CSS specs, but no browser engines appear likely to support it. + const values = ['block ruby', 'ruby', 'ruby-base', 'ruby-text', 'ruby-base-container', 'ruby-text-container']; + const extraStyle = ['', 'overflow:hidden', 'columns:1', 'overflow:hidden;columns:1']; + + for (const style of extraStyle) { + for (const val of values) { + test(() => { + testElm.style.removeProperty('display'); + testElm.style = style; + testElm.style.display = val; + const computed = getComputedStyle(testElm); + // Note that computed value is different from the used value. + // E.g., if ruby is not supported, the following assertion will + // fail as the computed value of display will be block. + // If ruby is supported, computed.display will return "ruby", + // but the used value is supposed to be "block ruby". + let expected = val; + assert_equals(computed.display, expected, `display: ${val} is not supported`); + assert_equals(computed.width, refStyle.width, 'width'); + assert_equals(testElm.offsetLeft, refElm.offsetLeft, 'offsetLeft'); + }, `rendered legend with display: ${val}` + (style == '' ? '' : "; " + style)); + } + } +</script> diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-display.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-display.html @@ -15,7 +15,7 @@ legend { width:initial; } // several CSS specs, but no browser engines appear likely to support it. const values = ['block', 'table', 'table-row-group', 'table-header-group', 'table-footer-group', 'table-row', 'table-cell', 'table-column-group', 'table-column', 'table-caption', 'list-item', 'flow', 'flow-root', 'inline', - 'inline-block', 'inline-table', 'block ruby', 'ruby', 'ruby-base', 'ruby-text', 'ruby-base-container', 'ruby-text-container', + 'inline-block', 'inline-table', 'grid', 'inline-grid', 'flex', 'inline-flex']; const extraStyle = ['', 'overflow:hidden', 'columns:1', 'overflow:hidden;columns:1']; @@ -27,10 +27,6 @@ legend { width:initial; } testElm.style.display = val; const computed = getComputedStyle(testElm); // Note that computed value is different from the used value. - // E.g., if ruby is not supported, the following assertion will - // fail as the computed value of display will be block. - // If ruby is supported, computed.display will return "ruby", - // but the used value is supposed to be "block ruby". // Also, 'flow' is serialized as 'block' for legacy reasons. let expected = val == 'flow' ? 'block' : val; assert_equals(computed.display, expected, `display: ${val} is not supported`); diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-sans-fieldset-display-ruby.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-sans-fieldset-display-ruby.html @@ -0,0 +1,27 @@ +<!doctype html> +<title>legend sans fieldset and CSS display (ruby)</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<style> + * { margin: 0; padding: 0; } + .ruby { display: ruby; } + .rt { display: ruby-text; } + rt { font-size: inherit; } +</style> +<p><legend class=ruby>ruby<legend class=rt>rt</legend></legend> <ruby>ruby<rt>rt</ruby> +<script> + function test_display(testSelector, refSelector) { + test(() => { + const testElm = document.querySelector(testSelector); + const refElm = document.querySelector(refSelector); + const testStyle = getComputedStyle(testElm); + const refStyle = getComputedStyle(refElm); + assert_equals(testStyle.display, refStyle.display, testSelector + ' display'); + assert_equals(testStyle.width, refStyle.width, testSelector + ' width'); + assert_equals(testStyle.height, refStyle.height, testSelector + ' height'); + }, testSelector); + } + + test_display('.ruby', 'ruby'); + test_display('.rt', 'rt'); +</script> diff --git a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-sans-fieldset-display.html b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-sans-fieldset-display.html @@ -14,9 +14,6 @@ .inline { display: inline; } .inline-block { display: inline-block; } .inline-table { display: inline-table; } - .ruby { display: ruby; } - .rt { display: ruby-text; } - rt { font-size: inherit; } </style> <legend class=table> <legend class=caption>caption</legend> @@ -40,7 +37,6 @@ </ul> <p>foo <legend class=inline>inline</legend> <span>inline</span> <p>foo <legend class=inline-block>inline-block</legend> <span class=inline-block>inline-block</span> -<p><legend class=ruby>ruby<legend class=rt>rt</legend></legend> <ruby>ruby<rt>rt</ruby> <script> function test_display(testSelector, refSelector) { test(() => { @@ -63,6 +59,4 @@ test_display('.li', 'li'); test_display('.inline', 'span'); test_display('.inline-block', 'span.inline-block'); - test_display('.ruby', 'ruby'); - test_display('.rt', 'rt'); </script>