Closed Bug 1334403 Opened 3 years ago Closed 3 years ago

Captions do not take 100% of table's width if inside flexbox

Categories

(Core :: Layout, defect, P1)

52 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox51 --- unaffected
firefox52 --- fixed
firefox53 --- fixed
firefox54 --- fixed

People

(Reporter: mail, Assigned: mats)

References

Details

(Keywords: regression, testcase)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36

Steps to reproduce:

See https://codepen.io/anon/pen/rjGgoj.

I put a table inside a div with display: flex; and a caption inside the table.

This works fine with Firefox < 52, and Chrome.




Actual results:

The second table's caption does not take the whole width (display: block won't work either).


Expected results:

The second table's caption should take 100% of the table's width, like the first table.
Has Regression Range: --- → yes
Has STR: --- → yes
Has Regression Range: yes → no
Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core
It's a regression from that bug.  Thanks for catching this Nicolas!
Assignee: nobody → mats
Blocks: 1316051
Status: UNCONFIRMED → ASSIGNED
Has Regression Range: no → yes
Component: CSS Parsing and Computation → Layout
Ever confirmed: true
Flags: needinfo?(mats)
Keywords: regression, testcase
OS: Unspecified → All
Priority: -- → P1
Hardware: Unspecified → All
Looks like an easy fix.  I guess we don't have many tests for table flex items
due to bug 799725, but I'll write one that covers this bug at least.
https://hg.mozilla.org/try/rev/1d6efc4fb572b8dbc7e4adc9c39e106a22251e78
Attached patch fixSplinter Review
This reverts the ReflowInput change in https://bugzilla.mozilla.org/attachment.cgi?id=8810261&action=diff#a/layout/generic/ReflowInput.cpp_sec2 for anything but Grid for now.  (I think this patch can be reverted
once we fix bug 799725.)
Attachment #8831360 - Flags: review?(dholbert)
Attached patch reftestSplinter Review
Based on layout/reftests/css-grid/grid-item-table-stretch-004.html,
although I had to remove the vertical writing-mode cases due to
bug 1334714 for now.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=4134f9f2c3e597d9c67948e6ddb82c333e880b43
Comment on attachment 8831360 [details] [diff] [review]
fix

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

Maybe add an XXX comment here to explain the exclusion?

e.g.:
  // XXX grid-specific for now; maybe remove this check after we address bug 799725
Attachment #8831360 - Flags: review?(dholbert) → review+
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ca810c416600
Make <caption> inline size stretch again for table flex items.  r=dholbert
https://hg.mozilla.org/integration/mozilla-inbound/rev/410a33e2a95e
Some <caption> size tests for table flex items.
https://hg.mozilla.org/mozilla-central/rev/ca810c416600
https://hg.mozilla.org/mozilla-central/rev/410a33e2a95e
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Comment on attachment 8831360 [details] [diff] [review]
fix

Approval Request Comment
[Feature/Bug causing the regression]: bug 1316051
[User impact if declined]: minor layout error of <caption> in <table> flex items
[Is this code covered by automated tests?]:yes
[Has the fix been verified in Nightly?]:yes
[Needs manual test from QE? If yes, steps to reproduce]: no
[List of other uplifts needed for the feature/fix]:
[Is the change risky?]:no
[Why is the change risky/not risky?]:reverts to the old behavior for non-grid frames
[String changes made/needed]:none
Attachment #8831360 - Flags: approval-mozilla-beta?
Attachment #8831360 - Flags: approval-mozilla-aurora?
Flags: in-testsuite+
Comment on attachment 8831360 [details] [diff] [review]
fix

fix regression from css grid changes, beta52+, aurora53+
Attachment #8831360 - Flags: approval-mozilla-beta?
Attachment #8831360 - Flags: approval-mozilla-beta+
Attachment #8831360 - Flags: approval-mozilla-aurora?
Attachment #8831360 - Flags: approval-mozilla-aurora+
Pushed by tlin@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/74edf47a8ccd
followup - Correct the path of the reftest test page. rs=dholbert
You need to log in before you can comment on or make changes to this bug.