Closed Bug 1488301 Opened 2 years ago Closed 2 years ago

<legend> auto inline margins doesn't work correctly

Categories

(Core :: Layout: Form Controls, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: mats, Assigned: mats)

References

(Blocks 1 open bug)

Details

(Keywords: testcase)

Attachments

(2 files)

Attached file Testcase
Follow-up from bug 1488228 comment 10.

The attached testcase renders the same in Chrome/Safari/Edge.
Firefox seems to handle the last two (right/center) incorrectly
(or at least differently).
Priority: -- → P3
Version: unspecified → Trunk
Attached patch fix + wptSplinter Review
We should use the content size as the available size, as is normal.

(The reason we use ComputedSizeWithPadding for the inner
anonymous block (innerAvailSize) is that it inherits the padding:
https://searchfox.org/mozilla-central/source/layout/style/res/forms.css#22
so we artificially inflate it.)

https://treeherder.mozilla.org/#/jobs?repo=try&revision=b42df657418e4cfbc6d6b3f085cae487ffac3aa3
Assignee: nobody → mats
Attachment #9006500 - Flags: review?(emilio)
Comment on attachment 9006500 [details] [diff] [review]
fix + wpt

Review of attachment 9006500 [details] [diff] [review]:
-----------------------------------------------------------------

Looks great, thanks! And thanks for the comment.

Maybe the comment about the difference between this and innerAvailSize should be in the commit message?

r=me regardless

::: testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/legend-auto-margins.html
@@ +1,3 @@
> +<!DOCTYPE html>
> +<html>
> +<head>

nit: I'd remove <html> / <head> / <body> tags, but your call if you feel strongly about them, or don't want to bother doing that :)

@@ +1,5 @@
> +<!DOCTYPE html>
> +<html>
> +<head>
> +<title>legend inline auto margins</title>
> +<link rel="match" href="legend-auto-margins-ref.html">

nit: Maybe add <link rel="author"> lines with your name and email?
Attachment #9006500 - Flags: review?(emilio) → review+
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5f71217eb8a6
Use the parent's content size as the available size for the rendered legend so we calculate auto-margins correctly.  r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/12859 for changes under testing/web-platform/tests
Flags: in-testsuite+
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
https://hg.mozilla.org/mozilla-central/rev/5f71217eb8a6
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.