When placing two <span> elements with white-space:nowrap next to each other but separated by whitespace, under some conditions the whitespace is ignored and the two <span> elements will not wrap together when space is constrained.
A test case is available, showing how minor changes can change this behavior.
Created attachment 19585 [details]
Test case showing incorrect behavior
In all the three cases, both the spans should be on separate lines .... rite ? Thats how firefox and IE display this file. Case 2 should be incorrect as well ?
Created attachment 191544 [details]
Comment on attachment 191544 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=191544&action=review
> + // If we allow whitespace collapsing 'word ' and 'word' are equivalent when before a whitespace
> + // character, so treat both as a potential linebreak.
Nit: I would insert a comma after "If we allow whitespace collapsing" and get rid of "when" in "when before a whitespace".
> + checkForBreak = (ignoringSpaces || !currentCharacterIsSpace) && (c == ' ' || c == '\t' || (c == '\n' && !next->preservesNewline()));
We should extract c == ' ' || c == '\t' || (c == '\n' && !next->preservesNewline() as a helper function at some point.
> + <span class="nowrap">xx </span>
> + <span class="nowrap">xx</span>
Please add a test case for bidirectional text.
Created attachment 197947 [details]
Committed r148367: <http://trac.webkit.org/changeset/148367>
This caused bug 117284.