[whatwg] Interaction of <wbr> and CSS white-space

On 5/16/11 5:26 PM, fantasai wrote:
>>> No, because browsers treat a large number of non-whitespace characters
>>> as allowing line breaks after them. Authors need something to prevent
>>> ridiculous and distorting line breaks in, say, "-1", "%5", and "f(1)".
>>
>> OK. I think that something belongs in CSS (or, going out on a limb,
>> should just be considered a quality-of-implementation issue). This
>> is not an HTML-specific problem.
>
> CSS3 Text does recommend doing some kind of prioritization when allowing
> breaks at punctuation other than spaces, so it is both a CSS issue and
> a quality-of-implementation issue. :)

Whether to prioritize is a CSS issue.  Whether there's a breakpoint at 
all after the 'f' in the string "y = f(1)" is a quality of 
implementation issue, imo.

>> Another thing to ponder: I accept that <wbr> inside <nobr> should allow
>> breaking. Should <wbr> inside <pre> allow breaking?
>
> That's an interesting one. I'd have to test like Netscape 4 to find out.
>
> If <wbr> doesn't break in <pre>, then it seems the rule we want is either
> wbr { content: '\8203' /* zwsp */ }
> nobr wbr { text-wrap: normal; }
> or
> wbr { content: '\8203' /* zwsp */; text-wrap: normal; }
> pre wbr { content: none; }
>
> I'm leaning somewhat towards the second option.

Well, it doesn't interact well with replacing <pre> with <div> and some 
styles....  Hence the question, in fact.

-Boris

Received on Monday, 16 May 2011 16:27:54 UTC