Skip to content

Commit aafdb1d

Browse files
dholbertmoz-wptsync-bot
authored andcommitted
Remove nonstandard block-axis 1px margins from textarea default styles.
These 1px margins were added (with no explanation/bug-link) in 1999, here: https://searchfox.org/firefox-main/diff/784c6428b65d9539cc8f5e30d18e59a050740007/layout/html/document/src/html.css#1293 They're not part of the html spec, and Chromium/WebKit don't have them; and at least one web developer has run up against them as a sharp edge (causing a textarea with 'height:100vh' to unexpectedly overflow the viewport). So, let's just remove them. As part of this change, we can also simplify the reference cases for reftest ua-style-sheet-textarea-1.html - it had two reference cases which had two different ways to confirm that we properly interpret these logical block-axis margins. Now that the margins are gone, there's no point in having two different reference cases (they end up ~identical once their margin declarations are removed), so this patch merges the reference cases into a single one with no need to specify margins. Differential Revision: https://phabricator.services.mozilla.com/D286187 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1875156 gecko-commit: 5545120859d3f38c45a1109125481c8fbe84224d gecko-reviewers: layout-reviewers, firefox-style-system-reviewers, emilio
1 parent 07d9718 commit aafdb1d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<title>Test: textarea should default to zero margins</title>
4+
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-textarea-element-2">
5+
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1875156">
6+
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
7+
<script src="/resources/testharness.js"></script>
8+
<script src="/resources/testharnessreport.js"></script>
9+
<body>
10+
<textarea id="myTextarea"></textarea>
11+
<script>
12+
test(function() {
13+
const marginProps = ["margin-top", "margin-right",
14+
"margin-bottom", "margin-left"];
15+
16+
const cs = window.getComputedStyle(myTextarea, "");
17+
marginProps.forEach((prop)=> {
18+
assert_equals(cs[prop], "0px",
19+
`computed value of '${prop}' should default to "0px"`);
20+
});
21+
}, "HTML textarea should default to having 0px as computed value for all margin properties")
22+
</script>

0 commit comments

Comments
 (0)