Title: [136034] trunk
Revision
136034
Author
m...@apple.com
Date
2012-11-28 11:43:24 -0800 (Wed, 28 Nov 2012)

Log Message

<rdar://problem/12645085> REGRESSION (r130851): With kerning enabled, a white-space: pre-wrap inline starting with tab+space has the wrong width
https://bugs.webkit.org/show_bug.cgi?id=103541

Reviewed by Anders Carlsson.

Source/WebCore: 

Test: fast/text/tab-with-kerning.html

When kerning is enabled, words are measured with their trailing space, then the width of a
space is subtracted. The logic to do this was incorrectly being invoked even when the
trailing whitespace character was a tab or a newline.

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::LineBreaker::nextLineBreak): Changed to check only for the space
character, not other space-like characters.

LayoutTests: 

* fast/text/tab-with-kerning-expected.html: Added.
* fast/text/tab-with-kerning.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (136033 => 136034)


--- trunk/LayoutTests/ChangeLog	2012-11-28 19:37:15 UTC (rev 136033)
+++ trunk/LayoutTests/ChangeLog	2012-11-28 19:43:24 UTC (rev 136034)
@@ -1,3 +1,13 @@
+2012-11-28  Dan Bernstein  <m...@apple.com>
+
+        <rdar://problem/12645085> REGRESSION (r130851): With kerning enabled, a white-space: pre-wrap inline starting with tab+space has the wrong width
+        https://bugs.webkit.org/show_bug.cgi?id=103541
+
+        Reviewed by Anders Carlsson.
+
+        * fast/text/tab-with-kerning-expected.html: Added.
+        * fast/text/tab-with-kerning.html: Added.
+
 2012-11-28  Nate Chapin  <jap...@chromium.org>
 
         Move empty loading to DocumentLoader, simplify FrameLoader::init()

Added: trunk/LayoutTests/fast/text/tab-with-kerning-expected.html (0 => 136034)


--- trunk/LayoutTests/fast/text/tab-with-kerning-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/tab-with-kerning-expected.html	2012-11-28 19:43:24 UTC (rev 136034)
@@ -0,0 +1,3 @@
+<div style="font: 20px ahem; -webkit-font-smoothing: none; color: orange; -webkit-font-kerning: none;">
+    .<span style="white-space: pre-wrap; background-color: blue;">&#9; ab</span>ef
+</div>

Added: trunk/LayoutTests/fast/text/tab-with-kerning.html (0 => 136034)


--- trunk/LayoutTests/fast/text/tab-with-kerning.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/tab-with-kerning.html	2012-11-28 19:43:24 UTC (rev 136034)
@@ -0,0 +1,3 @@
+<div style="font: 20px ahem; -webkit-font-smoothing: none; color: orange; -webkit-font-kerning: auto;">
+    .<span style="white-space: pre-wrap; background-color: blue;">&#9; ab</span>ef
+</div>

Modified: trunk/Source/WebCore/ChangeLog (136033 => 136034)


--- trunk/Source/WebCore/ChangeLog	2012-11-28 19:37:15 UTC (rev 136033)
+++ trunk/Source/WebCore/ChangeLog	2012-11-28 19:43:24 UTC (rev 136034)
@@ -1,3 +1,20 @@
+2012-11-28  Dan Bernstein  <m...@apple.com>
+
+        <rdar://problem/12645085> REGRESSION (r130851): With kerning enabled, a white-space: pre-wrap inline starting with tab+space has the wrong width
+        https://bugs.webkit.org/show_bug.cgi?id=103541
+
+        Reviewed by Anders Carlsson.
+
+        Test: fast/text/tab-with-kerning.html
+
+        When kerning is enabled, words are measured with their trailing space, then the width of a
+        space is subtracted. The logic to do this was incorrectly being invoked even when the
+        trailing whitespace character was a tab or a newline.
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlock::LineBreaker::nextLineBreak): Changed to check only for the space
+        character, not other space-like characters.
+
 2012-11-28  Nate Chapin  <jap...@chromium.org>
 
         Move empty loading to DocumentLoader, simplify FrameLoader::init()

Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (136033 => 136034)


--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2012-11-28 19:37:15 UTC (rev 136033)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2012-11-28 19:43:24 UTC (rev 136034)
@@ -2636,7 +2636,7 @@
                     wordMeasurement.startOffset = lastSpace;
                     
                     float additionalTmpW;
-                    if (wordTrailingSpaceWidth && currentCharacterIsSpace)
+                    if (wordTrailingSpaceWidth && c == ' ')
                         additionalTmpW = textWidth(t, lastSpace, current.m_pos + 1 - lastSpace, f, width.currentWidth(), isFixedPitch, collapseWhiteSpace, &wordMeasurement.fallbackFonts, textLayout) - wordTrailingSpaceWidth;
                     else
                         additionalTmpW = textWidth(t, lastSpace, current.m_pos - lastSpace, f, width.currentWidth(), isFixedPitch, collapseWhiteSpace, &wordMeasurement.fallbackFonts, textLayout);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to