Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-overflow-3] how do overflow: clip/hidden combinations interact with rounded borders? #7434

Closed
dbaron opened this issue Jun 30, 2022 · 7 comments
Labels
css-backgrounds-3 Current Work css-overflow-3 Current Work

Comments

@dbaron
Copy link
Member

dbaron commented Jun 30, 2022

css-overflow-3 allows the possibility that 'overflow' is 'clip' in one axis and 'visible' in the other. css-backgrounds-3 says that when 'overflow' is not 'visible', the clipping is done to the curve.

When the computed value of overflow is 'clip' in one axis and 'visible' in the other axis, is clipping done to the curve, nd if so, how?

I'd suggest that perhaps the easy answer is no: if you specify 'clip' in one axis and 'visible' in the other, then 'border-radius' is ignored when clipping.

(Noticed while trying to write edits for #6212.)

@dbaron dbaron added css-overflow-3 Current Work css-backgrounds-3 Current Work labels Jun 30, 2022
@bradkemper
Copy link
Contributor

Your easy answer makes sense to me. Hard to imagine anything else being reasonable or useful.

@fantasai fantasai changed the title how do overflow: clip/hidden combinations interact with rounded borders? [css-overflow-3] how do overflow: clip/hidden combinations interact with rounded borders? Jun 30, 2022
@Loirooriol
Copy link
Contributor

This is what browsers do https://software.hixie.ch/utilities/js/live-dom-viewer/saved/10438

  • Firefox: the overflowing content gets clipped to its own rounded curve.

  • Chromium: overflow: visible clip behaves as clip if the radius is greater than 0px (so not continuous!)

  • WebKit: bug? The content is not painted at all

@smfr
Copy link
Contributor

smfr commented Feb 7, 2023

Recent WebKit versions match Chromium's behavior above.

@dbaron
Copy link
Member Author

dbaron commented Feb 15, 2023

Here's a modified testcase with a bit more overflow.

@smfr
Copy link
Contributor

smfr commented Feb 15, 2023

New testcase: testcase

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-overflow-3] how do overflow: clip/hidden combinations interact with rounded borders?, and agreed to the following:

  • RESOLVED: border radius doesn't round the clipping region when mixing overflow: visible and clip
The full IRC log of that discussion <emilio> dbaron: I missed oriol's last comment, but I think it's relatively simple
<emilio> ... I noticed that the spec allows overflow to be clip in one axis but visible in other axis
<emilio> ... which is something that was introduced when clip was introduced
<emilio> ... when we introduced clip the question is how it interacts with rounding of borders
<emilio> ... I thought the simple question is that you clip in one axis but not on the other border radius has no effect
<emilio> ... oriol posted screenshots, and I'm not sure browsers are doing this new clip and visible behavior
<emilio> oriol: the behavior in browsers is... webkit has a bug where content is not painted... Chromium if it has overflow: visible clip as just clip only with non-zero radius
<emilio> ... so not continuous
<emilio> ... firefox applies the rounded clip to the bounding rectangle of the overflowing content
<emilio> ... In this particular case it looks kind of nice but it can be strange
<emilio> ... I think I'm leaning towards dbaron's proposal
<fantasai> +1 to dbaron's proposal
<flackr> +1 to dbaron's proposal, it makes sense that allowing visible overflow in the off-axis means there's no rounding
<emilio> smfr: I think I agree. The WebKit bug was fixed and now we behave like Chromium but I think that's just bugs, I'm ok with dbaron's proposal
<emilio> proposed resolution is that when clip and visible are specified, border radius has no effect
<fantasai> (on the content)
<fantasai> emilio: what if some corners have no radius and others do?
<dbaron> s/has no effect/doesn't cause rounded clipping of the contents/
<emilio> dbaron: we're not talking about whether border-radius has an effect, but whether it clips the contents
<emilio> ... border-radius with overflow: visible has an effect but doesn't clip
<emilio> ... my argument is that if you're not clipping in one axis you shouldn't clip to the border radius
<emilio> smfr: so basically everything should render as the first Firefox screenshot right?
<emilio> ... is that right if there's no content to clip?
<emilio> smfr: I'd like to see a test-case with something that overflows only on one side but doesn't fill the content box
<emilio> dbaron: I don't think any engine does what the spec says to me
<emilio> dbaron: oh wait, FF does it
<emilio> dbaron: I'll paste a modified test-case in the issue
<emilio> dbaron: https://github.com//issues/7434#issuecomment-1431669370
<emilio> dbaron: I think it should match up with what FF is doing on the later one
<emilio> ... because the inset rules for the clipping cause that to not have any rounding
<fantasai> emilio: I think I'm fine with dbaron's proposal
<fantasai> emilio: could do something more complicated, but unclear it would be useful
<TabAtkins> ok lol i finally looked at firefox's behavior with dbaron's increased overflow, that's silly
<TabAtkins> i see why that would happen but still
<emilio> Proposed resolution: border radius doesn't round the clipping region when mixing overflow: visible and clip
<emilio> dbaron: I should probably clarify that this is just a bugfix in the spec because nobody thought about it
<emilio> ... but I don't think there's any other sensible behavior here
<emilio> smfr: if you look in Firefox at the penultimate box on the last test-case I just posted (where I just shift the box) is that what you're proposing?
<emilio> astearns: so with this resolution we'd still round the border but the overflowing element isn't clipped
<fantasai> fantasai: afaict, all we're proposing here is that the border/background/etc are still rounded as normal, we just don't clip the content to the radius when there's overflow in one axis
<fantasai> (or both axes)
<fantasai> fantasai: this seems fine, what's the confusion?
<emilio> smfr: I just want to confirm that in my latest test-case FF is correct, except for the rounding on the left side
<emilio> dbaron: rithg
<emilio> right*
<emilio> smfr: sounds good
<emilio> +1 as well
<emilio> RESOLVED: border radius doesn't round the clipping region when mixing overflow: visible and clip

@Loirooriol
Copy link
Contributor

@smfr My testcase is still broken on latest WebKitGTK.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 4, 2024
The CSSWG resolved [1] to not apply rounded border clipping when one of
overflow-x or overflow-y computes to clip and the other computes to
visible (https://drafts.csswg.org/css-overflow/#corner-clipping). This
patch updates our implementation to not create the inner border radius
clip in this mixed clip/visible scenario.

[1] w3c/csswg-drafts#7434

Bug: 1416649
Change-Id: I4d24ac82ecdafba5fa691efb1ce85892c734c717
aarongable pushed a commit to chromium/chromium that referenced this issue Jan 5, 2024
The CSSWG resolved [1] to not apply rounded border clipping when one of
overflow-x or overflow-y computes to clip and the other computes to
visible (https://drafts.csswg.org/css-overflow/#corner-clipping). This
patch updates our implementation to not create the inner border radius
clip in this mixed clip/visible scenario.

[1] w3c/csswg-drafts#7434

Bug: 1416649
Change-Id: I4d24ac82ecdafba5fa691efb1ce85892c734c717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5171405
Reviewed-by: David Baron <dbaron@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243240}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 5, 2024
The CSSWG resolved [1] to not apply rounded border clipping when one of
overflow-x or overflow-y computes to clip and the other computes to
visible (https://drafts.csswg.org/css-overflow/#corner-clipping). This
patch updates our implementation to not create the inner border radius
clip in this mixed clip/visible scenario.

[1] w3c/csswg-drafts#7434

Bug: 1416649
Change-Id: I4d24ac82ecdafba5fa691efb1ce85892c734c717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5171405
Reviewed-by: David Baron <dbaron@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243240}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 5, 2024
The CSSWG resolved [1] to not apply rounded border clipping when one of
overflow-x or overflow-y computes to clip and the other computes to
visible (https://drafts.csswg.org/css-overflow/#corner-clipping). This
patch updates our implementation to not create the inner border radius
clip in this mixed clip/visible scenario.

[1] w3c/csswg-drafts#7434

Bug: 1416649
Change-Id: I4d24ac82ecdafba5fa691efb1ce85892c734c717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5171405
Reviewed-by: David Baron <dbaron@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243240}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Jan 10, 2024
…xed overflow clip, a=testonly

Automatic update from web-platform-tests
Do not round the clipping region with mixed overflow clip

The CSSWG resolved [1] to not apply rounded border clipping when one of
overflow-x or overflow-y computes to clip and the other computes to
visible (https://drafts.csswg.org/css-overflow/#corner-clipping). This
patch updates our implementation to not create the inner border radius
clip in this mixed clip/visible scenario.

[1] w3c/csswg-drafts#7434

Bug: 1416649
Change-Id: I4d24ac82ecdafba5fa691efb1ce85892c734c717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5171405
Reviewed-by: David Baron <dbaron@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243240}

--

wpt-commits: 7e7527ccba8afd472bd49972a4ba0ae0c58208ac
wpt-pr: 43858
ErichDonGubler pushed a commit to ErichDonGubler/firefox that referenced this issue Jan 10, 2024
…xed overflow clip, a=testonly

Automatic update from web-platform-tests
Do not round the clipping region with mixed overflow clip

The CSSWG resolved [1] to not apply rounded border clipping when one of
overflow-x or overflow-y computes to clip and the other computes to
visible (https://drafts.csswg.org/css-overflow/#corner-clipping). This
patch updates our implementation to not create the inner border radius
clip in this mixed clip/visible scenario.

[1] w3c/csswg-drafts#7434

Bug: 1416649
Change-Id: I4d24ac82ecdafba5fa691efb1ce85892c734c717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5171405
Reviewed-by: David Baron <dbaron@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243240}

--

wpt-commits: 7e7527ccba8afd472bd49972a4ba0ae0c58208ac
wpt-pr: 43858
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Jan 16, 2024
…xed overflow clip, a=testonly

Automatic update from web-platform-tests
Do not round the clipping region with mixed overflow clip

The CSSWG resolved [1] to not apply rounded border clipping when one of
overflow-x or overflow-y computes to clip and the other computes to
visible (https://drafts.csswg.org/css-overflow/#corner-clipping). This
patch updates our implementation to not create the inner border radius
clip in this mixed clip/visible scenario.

[1] w3c/csswg-drafts#7434

Bug: 1416649
Change-Id: I4d24ac82ecdafba5fa691efb1ce85892c734c717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5171405
Reviewed-by: David Baron <dbaronchromium.org>
Commit-Queue: Philip Rogers <pdrchromium.org>
Cr-Commit-Position: refs/heads/main{#1243240}

--

wpt-commits: 7e7527ccba8afd472bd49972a4ba0ae0c58208ac
wpt-pr: 43858

UltraBlame original commit: e60370c109d6e6f1b765260a2230504ae6371e89
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Jan 16, 2024
…xed overflow clip, a=testonly

Automatic update from web-platform-tests
Do not round the clipping region with mixed overflow clip

The CSSWG resolved [1] to not apply rounded border clipping when one of
overflow-x or overflow-y computes to clip and the other computes to
visible (https://drafts.csswg.org/css-overflow/#corner-clipping). This
patch updates our implementation to not create the inner border radius
clip in this mixed clip/visible scenario.

[1] w3c/csswg-drafts#7434

Bug: 1416649
Change-Id: I4d24ac82ecdafba5fa691efb1ce85892c734c717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5171405
Reviewed-by: David Baron <dbaronchromium.org>
Commit-Queue: Philip Rogers <pdrchromium.org>
Cr-Commit-Position: refs/heads/main{#1243240}

--

wpt-commits: 7e7527ccba8afd472bd49972a4ba0ae0c58208ac
wpt-pr: 43858

UltraBlame original commit: e60370c109d6e6f1b765260a2230504ae6371e89
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Jan 16, 2024
…xed overflow clip, a=testonly

Automatic update from web-platform-tests
Do not round the clipping region with mixed overflow clip

The CSSWG resolved [1] to not apply rounded border clipping when one of
overflow-x or overflow-y computes to clip and the other computes to
visible (https://drafts.csswg.org/css-overflow/#corner-clipping). This
patch updates our implementation to not create the inner border radius
clip in this mixed clip/visible scenario.

[1] w3c/csswg-drafts#7434

Bug: 1416649
Change-Id: I4d24ac82ecdafba5fa691efb1ce85892c734c717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5171405
Reviewed-by: David Baron <dbaronchromium.org>
Commit-Queue: Philip Rogers <pdrchromium.org>
Cr-Commit-Position: refs/heads/main{#1243240}

--

wpt-commits: 7e7527ccba8afd472bd49972a4ba0ae0c58208ac
wpt-pr: 43858

UltraBlame original commit: e60370c109d6e6f1b765260a2230504ae6371e89
marcoscaceres pushed a commit to web-platform-tests/wpt that referenced this issue Feb 23, 2024
The CSSWG resolved [1] to not apply rounded border clipping when one of
overflow-x or overflow-y computes to clip and the other computes to
visible (https://drafts.csswg.org/css-overflow/#corner-clipping). This
patch updates our implementation to not create the inner border radius
clip in this mixed clip/visible scenario.

[1] w3c/csswg-drafts#7434

Bug: 1416649
Change-Id: I4d24ac82ecdafba5fa691efb1ce85892c734c717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5171405
Reviewed-by: David Baron <dbaron@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243240}
ns-rsilva pushed a commit to ns-rsilva/chromium that referenced this issue Apr 25, 2024
The CSSWG resolved [1] to not apply rounded border clipping when one of
overflow-x or overflow-y computes to clip and the other computes to
visible (https://drafts.csswg.org/css-overflow/#corner-clipping). This
patch updates our implementation to not create the inner border radius
clip in this mixed clip/visible scenario.

[1] w3c/csswg-drafts#7434

Bug: 1416649
Change-Id: I4d24ac82ecdafba5fa691efb1ce85892c734c717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5171405
Reviewed-by: David Baron <dbaron@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243240}

Former-commit-id: 7e006a047e267eb0eefdbd93f11c915590c615cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-backgrounds-3 Current Work css-overflow-3 Current Work
Projects
None yet
Development

No branches or pull requests

6 participants