Commit 6079da9
<marquee> stretches a table and causes layout issues
https://bugs.webkit.org/show_bug.cgi?id=41562
rdar://problem/99826593
Reviewed by Alan Baradlay.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.
The special case in RenderBlockFlow::computeIntrinsicLogicalWidths() that
sets minLogicalWidth to 0 for horizontal marquees was incorrectly gated
behind a childrenInline() check. This caused marquees containing block
children (e.g., a <div>) to use their content's preferred width instead
of being treated as having no minimum width.
Horizontal marquees scroll their content and should not constrain their
container's width, regardless of whether their children are inline or
block elements. The autoWrap() check already ensures this code only runs
for marquees (which set white-space: nowrap).
This fixes tables with fixed widths being incorrectly expanded when they
contain marquees with block children.
While here, we also wrapped the logic into `resetMinimumWidthForMarqueeIfApplicable`
lambda (thanks to Alan).
Test: fast/table/marquee-block-child-table-width.html
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths const):
Remove the childrenInline() check from the horizontal marquee special
case, and update the comment to reflect that this applies to all
horizontal marquees and wrap the logic in lambda.
Canonical link: https://commits.webkit.org/306059@main1 parent 7300a75 commit 6079da9
File tree
3 files changed
+41
-7
lines changed- LayoutTests/fast/table
- Source/WebCore/rendering
3 files changed
+41
-7
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
367 | 371 | | |
368 | 372 | | |
369 | 373 | | |
| |||
0 commit comments