RESOLVED FIXED69072
White space between inline blocks should be affected by word-spacing property
https://bugs.webkit.org/show_bug.cgi?id=69072
Summary White space between inline blocks should be affected by word-spacing property
Lev Solntsev
Reported 2011-09-29 01:43:09 PDT
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.
Attachments
white-space processing test (983 bytes, text/html)
2011-09-29 01:43 PDT, Lev Solntsev
no flags
Patch (16.13 KB, patch)
2012-06-23 08:05 PDT, Robert Hogan
no flags
Patch (11.92 KB, patch)
2012-06-25 14:56 PDT, Robert Hogan
no flags
Patch (12.61 KB, patch)
2012-12-10 13:18 PST, Robert Hogan
no flags
Patch (12.38 KB, patch)
2012-12-10 13:33 PST, Robert Hogan
no flags
Robert Hogan
Comment 1 2012-03-11 07:11:24 PDT
It looks like the place to do this with RenderStyle::wordSpacing() is in RenderBlock::computeInlinePreferredLogicalWidths()
Jon Gjengset
Comment 2 2012-06-05 08:57:27 PDT
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/
Robert Hogan
Comment 3 2012-06-23 08:05:56 PDT
Robert Hogan
Comment 4 2012-06-25 14:56:18 PDT
Lev Solntsev
Comment 5 2012-06-25 15:00:57 PDT
Robert Hogan, probably you should change the authorship meta information in tests since you largely reworked those.
Robert Hogan
Comment 6 2012-07-02 11:50:01 PDT
Hi Dan, Could you take a look at this please? Thanks, Robert
Levi Weintraub
Comment 7 2012-12-10 12:29:41 PST
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.
Robert Hogan
Comment 8 2012-12-10 13:09:19 PST
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);
Robert Hogan
Comment 9 2012-12-10 13:18:22 PST
Levi Weintraub
Comment 10 2012-12-10 13:20:24 PST
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?
Levi Weintraub
Comment 11 2012-12-10 13:21:40 PST
(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 :(
Robert Hogan
Comment 12 2012-12-10 13:33:08 PST
WebKit Review Bot
Comment 13 2012-12-12 11:44:47 PST
Comment on attachment 178622 [details] Patch Clearing flags on attachment: 178622 Committed r137494: <http://trac.webkit.org/changeset/137494>
WebKit Review Bot
Comment 14 2012-12-12 11:44:51 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.