-
Notifications
You must be signed in to change notification settings - Fork 715
[css-backgrounds] Clarify how border-width
and border-style
affect border-image
#655
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
Comments
Boris Zbarsky raised an issue on the "unless there is a border image" wording earlier, and this sentence has now been rewritten. https://drafts.csswg.org/css-backgrounds-3/#the-border-style In any case, the computed value of 'border-width' is very explicitly defined to be zero for 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 Please let me know if that's clear or if you think some further explanation is needed (here or in the spec). |
The only place that uses this terminology, afaict from a grep, is the css-box spec which is unmaintained and outdated. I will remove the sentence. |
@fantasai, thanks for removing the ambiguous phrase! So is it right that if |
Yes, per spec it should be rendered. I suppose making ''border-style: none'' disable the border image is an interesting interpretation, though. |
Chromium supports border-image-repeat: space since version 56 (according to MDN), so other browsers based on corresponding Chromium versions should do also. It also may be worth noting that Blink and Edge seem to have "overfixed" the issue from the first note, reading the exception in the old spec too broad and creating another bug ([spec discussion](w3c/csswg-drafts#655), [Chromium bug](https://bugs.chromium.org/p/chromium/issues/detail?id=767352)). Should it be added to the table?
The specification actually doesn't _require_ `border-style` and/or `border-width` for `border-image` to be rendered (w3c/csswg-drafts#655 (comment)). However, some browsers indeed would not render it without them (although this is technically a bug and is being fixed), so specifying them is a reasonable practical requirement at the moment (and providing fallbacks is a good practice anyway).
The specification actually doesn't _require_ `border-style` and/or `border-width` for `border-image` to be rendered (w3c/csswg-drafts#655 (comment)). However, some browsers indeed would not render it without them (although this is technically a bug and is being fixed), so specifying them is a reasonable practical requirement at the moment (and providing fallbacks is a good practice anyway).
Uh oh!
There was an error while loading. Please reload this page.
There is a confusion about how
border-width
andborder-style
should affectborder-image
(and should they). In the example of border-image with nonzeroborder-image-width
combined with eitherborder-width:0
orborder-style:none
, browsers behave differently. Firefox and IE11 render border-image in all these situations, Edge 14 — only ifborder-style
is notnone
, iOS 10 Safari — only ifborder-width
is not0
, and Chrome requires both to render it.It seems to be a popular assumption that
border-style
should overrideborder-image
(e.g. see the note 1 on the caniuse.com page forborder-image
). However, the current spec clearly says thatborder-style
and its sub-components "set the style of the border, unless there is a border image", implying thatborder-style
shouldn't affectborder-image
if its own sub-components values allow it to be rendered.The test suite for this section (especially tests border-image-width-005, border-image-width-006, and border-image-width-007) marks the current behavior of Firefox (i.e. ignoring both
border-style:none
andborder-width:0
if there is validborder-image
with explicit non-zeroborder-image-width
) as correct.But there seems to be a bit of ambiguity in the spec in relation to
border-width
. The section for this property has the following remark:And there is no clarification if it is about just "regular" border or about image border, too. Should we add such clarification?
The text was updated successfully, but these errors were encountered: