Bug 245794 - Column break is affected by outline
Summary: Column break is affected by outline
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 15
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2022-09-28 12:22 PDT by Ken
Modified: 2022-10-03 12:11 PDT (History)
4 users (show)

See Also:


Attachments
Screenshot of multi-column list with unwanted layout shift caused by outlines (24.45 KB, image/png)
2022-09-28 12:22 PDT, Ken
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ken 2022-09-28 12:22:38 PDT
Created attachment 462690 [details]
Screenshot of multi-column list with unwanted layout shift caused by outlines

This bug concerns CSS columns. Adding an outline to an element should not effect the layout, however, adding an outline to an element inside of a multi-column layout can cause a layout shift in Safari. This behavior is not desirable and does not occur in Chrome or Firefox.

Below is a link with an example. An outline is used as the :focus style for each link. Make sure you have tab navigation enabled in your preferences, and see what happens when each element receives keyboard focus.

https://codepen.io/ksugi/pen/zYjRWvG
Comment 1 Karl Dubost 2022-09-28 18:54:28 PDT
another way to demonstrate the issue is to open the Web Inspector and add by hand an outline to the 3rd element and it shifts the layout.

Compare this in Safari, Firefox, Chrome
https://codepen.io/webcompat/pen/poVaOgy
it illustrates the issue.

The culprit here is:
https://developer.mozilla.org/en-US/docs/Web/CSS/outline-offset
https://w3c.github.io/csswg-drafts/css-ui-4/#outline-offset

if I deactivate this, the outline does not influence the layout.
a {outline-offset: 2px;}


It probably needs a web-platform-test for this case.
https://wpt.fyi/results/css/css-ui?label=master&label=experimental&aligned&view=subtest&q=outline
Comment 2 Radar WebKit Bug Importer 2022-09-28 18:54:39 PDT
<rdar://problem/100538552>