+2011-08-26 Dan Bernstein <mitz@apple.com>
+
+ RenderText::computePreferredLogicalWidths() should measure words with trailing spaces
+ https://bugs.webkit.org/show_bug.cgi?id=66733
+
+ * fast/text/complex-preferred-logical-widths.html: Added.
+ * platform/mac/fast/text/complex-preferred-logical-widths-expected.txt: Added.
+
2011-08-26 Tony Chang <tony@chromium.org>
Add CSS parsing for -webkit-flex-align
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock (floating) {DIV} at (0,0) size 308x24 [border: (3px solid #0000FF)]
+ RenderText {#text} at (3,3) size 302x18
+ text run at (3,3) width 302: "The number of lines in this box should be one."
+2011-08-26 Ned Holbrook <nholbrook@apple.com>
+
+ RenderText::computePreferredLogicalWidths() should measure words with trailing spaces
+ https://bugs.webkit.org/show_bug.cgi?id=66733
+
+ Reviewed by Dan Bernstein.
+
+ Test: fast/text/complex-preferred-logical-widths.html
+
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::computePreferredLogicalWidths): Apply logic from RenderBlock::LineBreaker::nextLineBreak().
+
2011-08-26 Tony Chang <tony@chromium.org>
Add CSS parsing for -webkit-flex-align
int nextBreakable = -1;
int lastWordBoundary = 0;
+ // Non-zero only when kerning is enabled, in which case we measure words with their trailing
+ // space, then subtract its width.
+ float wordTrailingSpaceWidth = f.typesettingFeatures() & Kerning ? f.width(RenderBlock::constructTextRun(this, f, &space, 1, style())) : 0;
+
int firstGlyphLeftOverflow = -1;
bool breakNBSP = style()->autoWrap() && style()->nbspMode() == SPACE;
int wordLen = j - i;
if (wordLen) {
- float w = widthFromCache(f, i, wordLen, leadWidth + currMaxWidth, &fallbackFonts, &glyphOverflow);
+ bool isSpace = (j < len) && isSpaceAccordingToStyle(c, style());
+ float w;
+ if (wordTrailingSpaceWidth && isSpace)
+ w = widthFromCache(f, i, wordLen + 1, leadWidth + currMaxWidth, &fallbackFonts, &glyphOverflow) - wordTrailingSpaceWidth;
+ else
+ w = widthFromCache(f, i, wordLen, leadWidth + currMaxWidth, &fallbackFonts, &glyphOverflow);
+
if (firstGlyphLeftOverflow < 0)
firstGlyphLeftOverflow = glyphOverflow.left;
currMinWidth += w;
lastWordBoundary = j;
}
- bool isSpace = (j < len) && isSpaceAccordingToStyle(c, style());
bool isCollapsibleWhiteSpace = (j < len) && style()->isCollapsibleWhiteSpace(c);
if (j < len && style()->autoWrap())
m_hasBreakableChar = true;