Closed Bug 1692380 Opened 4 years ago Closed 4 years ago

marquee tag scrolling overflows when the parent is a flexbox element

Categories

(Core :: Layout, defect)

Firefox 87
Unspecified
Windows 10
defect

Tracking

()

VERIFIED FIXED
87 Branch
Webcompat Priority ?
Tracking Status
firefox-esr78 --- unaffected
firefox85 --- unaffected
firefox86 --- verified
firefox87 --- verified

People

(Reporter: karlcow, Assigned: emilio)

References

(Regression, )

Details

(Keywords: regression)

Attachments

(2 files)

  1. Copy and paste in the url bar of your firefox.
data:text/html,<!doctype html><div style="width:200px;border: 2px solid red;"><div style="display:flex;"><marquee>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Deserunt commodi ratione iste tempore nemo mollitia exercitationem error cum excepturi sit ab eius consectetur quasi possimus facere, iusto est impedit laborum.</marquee></div></div>

Expected:
text scroll in the red border area

Actual:
text scroll on the full page.

Note:
On WebKit and Blink, the marquee text scrolls inside the size of the flexbox parent div.

<div style="width:200px;border: 2px solid red;">
  <div style="display:flex;">
    <marquee>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Deserunt commodi ratione iste tempore nemo mollitia exercitationem error cum excepturi sit ab eius consectetur quasi possimus facere, iusto est impedit laborum.</marquee>
  </div>
</div>

This isn't flex-specific; we have the same rendering if you use display:inline-block instead of display:flex (forcing intrinsic sizing on the marquee):

data:text/html,<!doctype html><div style="width:200px;border: 2px solid red;"><div style="display:inline-block;"><marquee style="border:1px solid black">Lorem, ipsum dolor sit amet consectetur adipisicing elit. Deserunt commodi ratione iste tempore nemo mollitia exercitationem error cum excepturi sit ab eius consectetur quasi possimus facere, iusto est impedit laborum.</marquee></div></div>
Severity: -- → S3
Component: Layout: Flexbox → Layout

Seems like a regression from bug 1618584.

Flags: needinfo?(emilio)
Regressed by: 1618584
Has Regression Range: --- → yes

So what other browsers do is to zero out the min intrinsic size of the scroll frame, effectively: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/layout/ng/ng_block_node.cc;l=332;drc=7553394f9e02446701a93e756360f873361f07bc

Is there a way to do that without more side-effects? contain:size clearly doesn't work here...

I couldn't come up with a way to effectively cause this effect with
regular CSS I could put in marquee.css... But maybe y'all have thoughts?

Can you think of a better way to fix this that doesn't hard-code the marquee in our scrollframe code? It seems quite unfortunate, but I haven't been able to come up with anything particularly better... I would've hoped some combination of overflow-wrap: anywhere would be able to help in this case, but not really...

Flags: needinfo?(emilio) → needinfo?(dholbert)
Assignee: nobody → emilio
Attachment #9202923 - Attachment description: Bug 1692380 - HACK: The intrinsic min isize of the marquee scroller should be zero. → Bug 1692380 - The intrinsic min isize of the marquee scroller should be zero. r=dholbert
Status: NEW → ASSIGNED

Comment on attachment 9202923 [details]
Bug 1692380 - The intrinsic min isize of the marquee scroller should be zero. r=dholbert

Beta/Release Uplift Approval Request

  • User impact if declined: Some sites with marquees might look broken.

Sorry for the super-late uplift request, but I think this is worth taking. It's a very simple fix which matches Chromium and is extremely targeted to marquee.

  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 0, test-cases in the bug.
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Super-targeted fix to fix marquee intrinsic size to match other browsers.
  • String changes made/needed: none
Attachment #9202923 - Flags: approval-mozilla-beta?
Flags: qe-verify+

(In reply to Emilio Cobos Álvarez (:emilio) from comment #6)

Can you think of a better way to fix this that doesn't hard-code the marquee in our scrollframe code?

Per discussion in matrix: no, I can't think of anything better. This seems fine to me.

Flags: needinfo?(dholbert)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6f7e9ff0c23e The intrinsic min isize of the marquee scroller should be zero. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/27614 for changes under testing/web-platform/tests
Keywords: regression
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch

Comment on attachment 9202923 [details]
Bug 1692380 - The intrinsic min isize of the marquee scroller should be zero. r=dholbert

Approved for 86.0rc1.

Attachment #9202923 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Verified as fixed on Firefox Nightly 87.0a1 on Windows 10 x64, macOS 10.15 and on Ubuntu 20.04.

Upstream PR merged by moz-wptsync-bot

Verified as fixed on Firefox 86.0 candidates build 1 on Windows 10 x64, macOS 10.15 and on Ubuntu 20.04.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
Regressions: 1695578
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: