<legend> not child of <fieldset> should have 2px padding

RESOLVED FIXED in Firefox 63

Status

()

defect
P3
normal
RESOLVED FIXED
11 months ago
10 months ago

People

(Reporter: zcorpan, Assigned: dholbert)

Tracking

(Blocks 1 bug)

Trunk
mozilla63
Points:
---
Dependency tree / graph
Bug Flags:
qe-verify -

Firefox Tracking Flags

(firefox63 fixed)

Details

Attachments

(1 attachment)

WebKit/Chromium/EdgeHTML always have 2px padding. For Gecko html.css says `fieldset > legend` instead of just `legend`.

See https://github.com/whatwg/html/issues/2729

Test: 
http://web-platform-tests.live/html/rendering/non-replaced-elements/the-fieldset-element-0/legend.html
Simon makes a reasonably compelling argument -- the current "fieldset >" qualifier means that we get different amounts of padding depending on whether the legend is inside of "display:contents" or not.

Kind of a strained scenario to design for, but there's some logic to the idea that there should be consistency there -- and given that plus the consensus of other browsers, it seems reasonable to change here.
Priority: -- → P3
Here's a testcase with the display:contents scenario: https://jsfiddle.net/xmcpsozh/
If you view that in Firefox and look closely [or use devtools to inspect computed style], you can see that the display:contents-nested legend has less padding than the normal legend.
Blocks: fieldset
Mihir might take this -- tentatively assigning this to him.

All we need to do here is:
 (1) Merge this all into a single "legend { ... }" rule (no fieldset > legend):
https://dxr.mozilla.org/mozilla-central/rev/4e56a2f51ad739ca52046723448f3129a58f1666/layout/style/res/forms.css#58-66

 (2) Write a reftest based on my jsfiddle from comment 2, with a display:contents wrapper around <legend> in the testcase and without it in the reference case.
Assignee: nobody → miyer
Status: NEW → ASSIGNED
I'll go ahead and close this out. Note that I'll be leaving behind one "fieldset > legend" declaration here -- that one's covered by bug 1485502.
Assignee: iyermihir → dholbert
Try run w/ reftests, all platforms (to validate that new tests pass everywhere & to catch possible changes in number of fuzzy pixels on platform-specific fuzzy annotations):
  https://treeherder.mozilla.org/#/jobs?repo=try&revision=c739c00aa6d36384cfa2bf66b1c048b242853c88

Try run w/ all layout-relevant tests, linux-only (to catch any other test dependencies on old behavior):
  https://treeherder.mozilla.org/#/jobs?repo=try&revision=4b47c71fd59f319dd46a2d897c8b366a3cb5668f
Hmm, looks like I've got some test expectations to update.
Comment on attachment 9003318 [details]
Bug 1483499: Give <legend> consistent default padding, regardless of whether it's a child of fieldset. r=mats

Mats Palmgren (:mats) has approved the revision.
Attachment #9003318 - Flags: review+
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fc18abb2ea52
Give <legend> consistent default padding, regardless of whether it's a child of fieldset. r=mats
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/12682 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
https://hg.mozilla.org/mozilla-central/rev/fc18abb2ea52
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Upstream PR merged
Marking this as qe-verify -, per comment 12.
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.