RE: FW: NoWrap property

Thanks a lot for the explanation. It sounds somewhat more complicated than a simple universal rule (and I expect it is tricky to implement special-case breaking into collapsed whitespace), but I imagine you came up with what you have from looking at how it is used in real world.

Thanks
Alex

From: rocallahan@gmail.com [mailto:rocallahan@gmail.com] On Behalf Of Robert O'Callahan
Sent: Monday, December 08, 2008 1:52 PM
To: Alex Mogilevsky
Cc: fantasai; Bjoern Hoehrmann; www-style@w3.org
Subject: Re: FW: NoWrap property

On Tue, Dec 9, 2008 at 10:31 AM, Alex Mogilevsky <alexmog@microsoft.com<mailto:alexmog@microsoft.com>> wrote:

I was trying to understand the two principles from the previous messageā€¦ Both make sense, but why just using one of them would not be enough?

The practical reason is that I think they match people's expectations. It surprises people if <span style="white-space:pre"> </span> does not behave just like a non-breaking space, and if <span style="white-space:nowrap"> </span> actually creates a break opportunity. But it also surprises people if <span style="white-space:nowrap">A</span> behaves differently from a stand-alone A.

I think these waters have been muddied by the use of a property called 'white-space' to control general line-breaking, but that's not the whole problem. I think it would still be surprising if <span style="line-breaking:nowrap">A</span><span style="line-breaking:nowrap">A</span> did not allow a line break between the elements; the natural intuition is that styles affect behaviour "inside" the element but not "outside" the element and a line break is possible "outside" these elements.

And that's where intuitions about white space are different. People don't think about breaking *after* a space, people think about breaking *at* or *inside* a space since the position of the space is irrelevant to the rendering. People aren't not used to thinking about a break opportunity being after the space and therefore possibly not controlled by the style on the space itself. Only browser implementers think like that :-).

Sorry about being all touchy-feely, but the important thing is the facts of the first paragraph.

 E.g. why did you decide that <nowrap> has to remove break opportunity after space but not after a dash (as in attached example)?
Yes, that discrepancy is a pain, but it's less worrying than the alternatives IMHO.

Rob
--
"He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all." [Isaiah 53:5-6]

Received on Monday, 8 December 2008 23:09:45 UTC