Re: [css-text-decor] not underlining trailing spaces

> On 12 Mar 2015, at 14:35, Florian Rivoal <florian@rivoal.net> wrote:
> 
> 
>> On 09 Mar 2015, at 17:45, Florian Rivoal <florian@rivoal.net> wrote:
>> 
>> If you have "text-decoration: underline;" and "white-space: pre-wrap;" (or pre)
>> all the (non collapsed) white space is underlined, including the spaces at the end of the line that are followed by a break/wrap point.
>> 
>> http://jsbin.com/bedefu/1/watch?html,css,output
>> 
>> That is what I'd expect based on the spec, but it may not be the ideal behavior in all cases. For instance, word processors / rich text editors don't do this, and if you're making a web based rich text editor using contenteditable and the like, you would want to match.
>> 
>> MS Word, LibreOffice, Apple Page or Apple TextEdit all do the same in this case: underline the spaces between the words, but not those at the end of the line.
>> 
>> We should probably not try to change the default behavior, given that:
>> - We have interop on the current behavior
>> - In other contexts, the current behavior may actually be what you want (for example, underlines caused by syntax highlighting in vim matches what we currently do).
>> 
>> However, I do think this would be worth supporting. Adding "trailing-spaces" as a new value to the text-decoration-skip would be ideal for this.
> 
> We've resolved to do this, so here's a pull request to make it happen:
> 
> https://github.com/w3c/csswg-drafts/pull/13
> 
> Since specifying trailing-spaces together with spaces doesn't do anything different from just adding spaces, I've added the new value as:
> 
> text-decoration-skip: none | [ objects || [ spaces | trailing-spaces ] || ink || edges || box-decoration ]
> 
> rather than
> 
> text-decoration-skip: none | [ objects || spaces || trailing-spaces || ink || edges || box-decoration ]
> 
> 
> Also, should we consider making the initial value ''objects trailing-spaces'' rather than just ''objects''? Or maybe ''auto'' which let's UAs pick between the two depending on what they doing with properties like 'white-space', 'word-wrap', etc?

Fantasai has rejected this pull request, saying it should be added to level 4 since level 3 is in CR.

I sent it to L3 because:
- L4 doesn't have an official draft yet (maybe it's time it got one?)
- text-decoration-skip isn't implemented anywhere yet, so I am not sure I see the point in splitting it into a basic L3 version and an extended L4 version. Doing so when there are implementations for the basic version but not the extended one makes sense, but this is not the case here.

If the entire property is pulled into level 4 (it is at risk after all), I'm fine with extending it there, but as it stands now, I think amending Level 3 makes more sense.

This is especially true if we also change the initial value, as I suggested above that we may want to do.

Thoughts?

 - Florian

Received on Friday, 13 March 2015 10:32:18 UTC