W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2011

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 16 May 2011 19:27:54 -0400
Message-ID: <4DD1B2FA.4090903@mit.edu>
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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:33 UTC