Re: FW: NoWrap property

On Tue, Dec 9, 2008 at 10:31 AM, Alex Mogilevsky <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 21:52:45 UTC