Closed Bug 1488301 Opened 3 years ago Closed 3 years ago

<legend> auto inline margins doesn't work correctly


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




Tracking Status
firefox64 --- fixed


(Reporter: mats, Assigned: mats)


(Blocks 1 open bug)


(Keywords: testcase)


(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:
so we artificially inflate it.)
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
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 for changes under testing/web-platform/tests
Flags: in-testsuite+
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.