Closed Bug 1483499 Opened 2 years ago Closed 2 years ago

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


(Core :: Layout, defect, P3)




Tracking Status
firefox63 --- fixed


(Reporter: zcorpan, Assigned: dholbert)


(Blocks 1 open bug)



(1 file)

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


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:
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):

 (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
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):

Try run w/ all layout-relevant tests, linux-only (to catch any other test dependencies on old behavior):
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
Give <legend> consistent default padding, regardless of whether it's a child of fieldset. r=mats
Created web-platform-tests PR for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
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.