Open Bug 1917395 Opened 1 year ago Updated 1 year ago

`overflow:scroll` doesn't have any effect on the SVG foreignObject element (when it should probably clip and impose scrollbars)

Categories

(Core :: SVG, defect)

Firefox 130
defect

Tracking

()

People

(Reporter: tomlyn, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0

Steps to reproduce:

Please see this codepen
https://codepen.io/tomlyn/pen/KKGdNaR

Actual results:

It shows two foreignObjects. The one on the left has overflow-y set to scroll. In Firefox, the contents below the lower boundary of the foreignObject are visible and cannot be scrolled. In Chrome, the contents are hidden and can be vertically scrolled.

Expected results:

In Firefox, with overflow-y set to scroll or auto for a foreignObject, the contents of the foreignObject outside of its boundary should be hidden and become vertically scrollable.

Summary: A foreignObject with overflow: scroll is not truncating its contents → A foreignObject with overflow-y: scroll is not hiding its contents outside the foreignObject boundary and no scrolling is possible.

The Bugbug bot thinks this bug should belong to the 'Core::Panning and Zooming' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Panning and Zooming
Product: Firefox → Core

From the SVG specification...

Within SVG content, the value auto implies that all rendered content for child elements must be visible, either through a scrolling mechanism, or by rendering with no clip.

So either rendering is valid.

But surely the likelihood is that, if the developer sets overflow-y: scroll, they would expect that the foreignObject becomes vertically scrollable. Right?

Changing component, please correct if this isn't the best component.

Component: Panning and Zooming → SVG

SVG 1.1 didn't do scroll at all. With SVG 2 it seems there is some expectation of scroll but mostly if you want scroll use HTML elements.

(In reply to Robert Longson [:longsonr] from comment #2)

From the SVG specification...

Within SVG content, the value auto implies that all rendered content for child elements must be visible, either through a scrolling mechanism, or by rendering with no clip.

So either rendering is valid.

That's true for auto, but when overflow-y is explicitly set to scroll then AFAICS scrolling is the required result. So I think there's a real bug here.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached file reduced testcase 1

Here's a reduced testcase, just testing whether overflow:scroll has any effect on foreignObject (it doesn't seem to have any effect in Gecko or WebKit, though it works in Chromium).

[clarifying summary slightly to improve searchability -- I just found this bug when investigating a related bug for a WPT failure where this is the root cause, specifically bug 1951531]

Blocks: 1951531
Summary: A foreignObject with overflow-y: scroll is not hiding its contents outside the foreignObject boundary and no scrolling is possible. → `overflow:scroll` doesn't have any effect on the SVG foreignObject element (when it should probably clip and impose scrollbars)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: