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-backgrounds] Non-visible border-style should prevent border-image from being rendered #26351

Conversation

twilco
Copy link
Contributor

@twilco twilco commented Oct 31, 2020

Given a non-visible border-style such as none and hidden, border-images should not be rendered.

Spec: https://www.w3.org/TR/2017/CR-css-backgrounds-3-20171017/#border-images

Editorial: w3c/csswg-drafts#655 (comment)

(emphasis mine)

So, border images override border-style in the sense that a border-style-specified border will not be drawn if a border image is specified. But to the extent that border-style influences the border-width it can affect whether the border image is visible or not.

Chromium and Gecko currently exhibit this behavior, and WebKit does not.

WebKit erroneously displaying red border-image, Chromium and Gecko not displaying a border-image.

@twilco
Copy link
Contributor Author

twilco commented Nov 1, 2020

Nevermind, this already covered by an existing test.

<meta name="assert" content="If 'border-style' is not declared, then it defaults to 'none' in which case the computed border-widths on all 4 sides is 0 in which case the border area to be painted with the border-image is also 0 because the default border-image-width is 1 which means 1 time the computed border-width. So, we should see no red in this test." />

@twilco twilco closed this Nov 1, 2020
@SelenIT
Copy link

SelenIT commented Sep 14, 2021

Apparently, the emphasized phrase is relevant only for the case when border-image-width has the unitless numeric value, including default 1 (i.e. border image is set to render only over the regular border area), and shouldn't be considered a general rule. Later in the same issue, @fantasai clarifies:

Is it right that if border-image-width is explicitly set in length units and is greater than zero, then the border image should be rendered even if the used value of border-width is 0?

Yes, per spec it should be rendered.

The test referred here is correct since it has border-image-width: 1, but e.g. border-image-width-005.xht expects the border image to be rendered, despite both border-style and border-width are set to none and 0, respectively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants