Created attachment 109135 [details] white-space processing test According to fantasai message in www-style: > http://www.w3.org/TR/CSS21/text.html#spacing-props > # Word spacing affects each space (U+0020) and non-breaking space (U+00A0), > # left in the text after the white space processing rules have been applied. > > This means that > > <inline-block/><inline-block/> will only be affected by letter-spacing, whereas > <inline-block/> <inline-block/> will be affected by word-spacing. — http://lists.w3.org/Archives/Public/www-style/2011Sep/0493.html For now word-spacing property in Webkit doesn't affect white space between inline blocks but does between usual words. Instead white space between inline-blocks is affected by letter-spacing property. Word-spacing property is widely used to eliminate spaces between inline-blocks produced by code formatting white-spaces.
It looks like the place to do this with RenderStyle::wordSpacing() is in RenderBlock::computeInlinePreferredLogicalWidths()
This seems to be similar to this Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=761645 Simple example of the bug here: http://jon.thesquareplanet.com/inline-block-bug/
Created attachment 149175 [details] Patch
Created attachment 149363 [details] Patch
Robert Hogan, probably you should change the authorship meta information in tests since you largely reworked those.
Hi Dan, Could you take a look at this please? Thanks, Robert
Comment on attachment 149363 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149363&action=review > Source/WebCore/rendering/InlineFlowBox.cpp:428 > + // If we encounter any space after this inline block then ensure it is treated as the space between two words. > + needsWordSpacing = true; Why don't we have to account for this in RenderBlock::computeInlinePreferredLogicalWidths? > LayoutTests/fast/css/word-spacing-between-blocks-expected.html:9 > + <link rel="author" title="Lev Solntsev" href="mailto:grelimail@gmail.com"> > + <link rel="author" title="Robert Hogan"> You may want to address Lev's concerns. > LayoutTests/fast/css/word-spacing-between-blocks-expected.html:28 > +<p>Following strings must be same:</p> Since these are reworked, please give these tests a meaningful description and a link back to this bug.
Comment on attachment 149363 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149363&action=review >> Source/WebCore/rendering/InlineFlowBox.cpp:428 >> + needsWordSpacing = true; > > Why don't we have to account for this in RenderBlock::computeInlinePreferredLogicalWidths? There, the word-spacing between inline blocks is account for by: t->trimmedPrefWidths(inlineMax, beginMin, beginWS, endMin, endWS, hasBreakableChar, hasBreak, beginMax, endMax, childMin, childMax, stripFrontSpaces);
Created attachment 178617 [details] Patch
Comment on attachment 178617 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=178617&action=review > LayoutTests/fast/css/word-spacing-between-blocks-expected.html:30 > +<!-- White space between inline blocks should be affected by the word-spacing property. > + https://bugs.webkit.org/show_bug.cgi?id=69072 --> Is there a reason you made this a comment instead of allowing the description in the output?
(In reply to comment #8) > (From update of attachment 149363 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=149363&action=review > > >> Source/WebCore/rendering/InlineFlowBox.cpp:428 > >> + needsWordSpacing = true; > > > > Why don't we have to account for this in RenderBlock::computeInlinePreferredLogicalWidths? > > There, the word-spacing between inline blocks is account for by: > > t->trimmedPrefWidths(inlineMax, beginMin, beginWS, endMin, endWS, > hasBreakableChar, hasBreak, beginMax, endMax, > childMin, childMax, stripFrontSpaces); So beyond just failing to follow the intention of the spec, we're currently deciding to respect word-spacing for inline blocks *differently* during pref-width-calc and layout? Sadness :(
Created attachment 178622 [details] Patch
Comment on attachment 178622 [details] Patch Clearing flags on attachment: 178622 Committed r137494: <http://trac.webkit.org/changeset/137494>
All reviewed patches have been landed. Closing bug.