Re: Shorthands resetting properties they cannot set

Le 2017-11-27 15:09, Daniel Glazman a écrit :
> I would like to come back to some of our shorthands. Let's take
> for example the 'border' shorthand. Section 4.4 of Backgrounds &
> Borders says it resets the 'border-image' property and the reason
> given by the prose is clear and valid.

I see a reason given in section 6, in example 28:

"
Notice that the border shorthand resets border-image. This makes it easy 
to turn off or reset all border effects
"
https://www.w3.org/TR/css-backgrounds-3/#border-image-border-shorthand-example

> 
> But I am seeing a painful side effect in my Wysiwyg editor BlueGriffon,
> and that side effect is triggering MASSIVE feedback from BlueGriffon
> users.

I think BlueGriffon users' reaction is reasonable and understandable.

border-image itself is a shorthand that sets 5 longhand properties.
border-image is a misnomer ("mauvais descriptif"): border-image can 
cover content area, padding belt, border belt, margin belt and even 
beyond. It has little to do with the border belt itself.


> To understand it, use Firefox (preferred) or Chrome to browse the
> following URL:
> 
>   http://glazman.org/tmp/border-shorthand.html
> 
> In that test, I'm using the CSS OM to add 'border-top-color: blue;' to
> the declarations of existing style rule
> 
>   #a { border: thin solid red; }
> 
> Since we had a 'border' shorthand, doing that makes a 'border-image:
> initial' appear.
> 
> For us spec freaks, that's normal and understandable.

Daniel, the resetting of border-image is not what I would expect when 
declaring 'border: thin solid red'.

> If I believe BlueGriffon user feedback, it seems far less normal for
> many web authors... Since the values of 'border' can't set the
> border-image,

... then setting 'border' shorthand should not be resetting 
'border-image'. It makes sense to me. I side with BlueGriffon users.

Gérard


> they just don't get it and find the spec, I quote,
> bizarre, weird, strange, complicated, cryptic, bad, geeky, end of
> quotes, when I send them a link. Only one replied "ah, ok, I
> understand".
> 
> So I really wonder if our choice here of allowing some shorthands to
> reset properties they cannot set was reasonable and if we've not
> sacrificed easiness of authoring for an edge case that was not worth
> it, and if a note in the spec saying a 'border' property will apply the
> desired styles only if 'border-image' is also reset to its initial
> value was not a much better, because more coherent, design. Our current
> design is understandable, but weird.
> 
> </Daniel>

Received on Tuesday, 28 November 2017 02:58:23 UTC