On Apr 3, 12:17 pm, Jonas Sicking <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I kinda lean towards always displaying the spaces, just on the grounds > > that preformatted spaces should always be displayed. > > Wouldn't that mean that you could get very ugly margins? Say for markup like > > <div style="white-space:-moz-pre-wrap; border: 5px solid black;"> > <span style="background:yellow"> > Word Word Word Word Word Word... > </span> > </div> > > The spaces between the words might overlap into the margin of the div, > and that overlap will vary from row to row.
That brings up a related question: with pre and pre-wrap, should we still be allowing an arbitrary amount of trailing whitespace at the end of a line, regardless of available width? Or should we break inside the whitespace and allow whitespace to start the next line? I think the latter is actually the simplest and most accurate interpretation of pre-wrap. It would solve this problem with overflow spaces. It would not solve the issue of spaces at the ends of lines showing when selected. I don't much like the solution "don't render the space, but move the cursor". The question is then does the frame size include the trailing spaces or not. If it does, then we have a problem with text- decorations, which are usually painted by container elements --- for example, suppressing underline on trailing spaces will be difficult. If it doesn't, then you'll be able to move the caret arbitrarily far past the visible end of the line by typing, but you won't be able to click there unless we throw in yet more hackery. How about this proposal for pre-wrap: 1) spaces are always displayed 2) a run of spaces at the end of the line can be broken in the middle of the run, allowing spaces to start the next line 3) we only allow a line break after a space, not before (so text with only one space between each word won't get spaces at the start of lines) Then selection will show spaces at the end of lines, but I personally don't think that's a big deal. Rob _______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

