Commit c93a3aa7 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

html: Merge two fieldset tests

Having both of fieldset-percent-height.html and
fieldset-percetage-block-size.html is confusing. Merge the new one into
the old one.

Change-Id: Ibcdf17d744c4cd622a8db33f6706cdc9f65ad416
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2491573
Commit-Queue: Koji Ishii <kojii@chromium.org>
Auto-Submit: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819761}
parent 11a48ceb
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<table cellspacing="0" cellpadding="0" style="width:100px; height:60px;">
<tr>
<td>
<fieldset style="border:none; padding:0; height:100%; margin:0; margin-top:13px;">
<div><div id="elm"></div></div>
</fieldset>
</td>
</tr>
</table>
<script>
// crbug.com/1138204. Though the specification doesn't mention this behavior,
// there must be no doubt about the expected behavior.
test(() => {
const fieldset = document.querySelector('fieldset');
const initialHeight = fieldset.offsetHeight;
document.querySelector('#elm').style.display = 'none';
assert_equals(fieldset.offsetHeight, initialHeight);
}, 'Fieldset with a percent height should not increase the height on every reflow.');
</script>
...@@ -32,6 +32,16 @@ ...@@ -32,6 +32,16 @@
</fieldset> </fieldset>
</div> </div>
<table cellspacing="0" cellpadding="0" style="width:100px; height:60px;">
<tr>
<td>
<fieldset style="border:none; padding:0; height:100%; margin:0; margin-top:13px;">
<div><div id="elm"></div></div>
</fieldset>
</td>
</tr>
</table>
<script> <script>
for (const div of document.querySelectorAll('div[style]')) { for (const div of document.querySelectorAll('div[style]')) {
for (const el of div.firstElementChild.children) { for (const el of div.firstElementChild.children) {
...@@ -42,4 +52,13 @@ ...@@ -42,4 +52,13 @@
}, `${el.textContent} (${div.getAttribute('style')})`); }, `${el.textContent} (${div.getAttribute('style')})`);
} }
} }
// crbug.com/1138204. Though the specification doesn't mention this behavior,
// there must be no doubt about the expected behavior.
test(() => {
const fieldset = document.querySelector('table fieldset');
const initialHeight = fieldset.offsetHeight;
document.querySelector('#elm').style.display = 'none';
assert_equals(fieldset.offsetHeight, initialHeight);
}, 'Fieldset with a percentage height should not increase the height on every reflow.');
</script> </script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment