Changeset 125575 in webkit
- Timestamp:
- Aug 14, 2012 10:16:19 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r125572 r125575 1 2012-08-14 Christophe Dumez <christophe.dumez@intel.com> 2 3 Fix LayoutTests/canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html 4 https://bugs.webkit.org/show_bug.cgi?id=92974 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Unskip canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html for 9 all the ports now that space characters are correctly replaced in 10 the text passed to fillText() and strokeText(). 11 12 * platform/chromium/TestExpectations: 13 * platform/efl/Skipped: 14 * platform/gtk/TestExpectations: 15 * platform/mac/canvas/philip/tests/2d.text.draw.space.collapse.nonspace-expected.txt: Removed. 16 * platform/qt/Skipped: 17 1 18 2012-08-14 Zan Dobersek <zandobersek@gmail.com> 2 19 -
trunk/LayoutTests/platform/chromium/TestExpectations
r125566 r125575 1889 1889 1890 1890 BUGWK45991 : canvas/philip/tests/2d.text.draw.space.collapse.end.html = TEXT 1891 BUGWK45991 : canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html = TEXT1892 1891 BUGWK45991 : canvas/philip/tests/2d.text.draw.space.collapse.other.html = TEXT 1893 1892 BUGWK45991 : canvas/philip/tests/2d.text.draw.space.collapse.space.html = TEXT 1894 1893 BUGWK45991 : canvas/philip/tests/2d.text.draw.space.collapse.start.html = TEXT 1895 1894 BUGWK45991 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.draw.space.collapse.end.html = TEXT 1896 BUGWK45991 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html = TEXT1897 1895 BUGWK45991 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.draw.space.collapse.other.html = TEXT 1898 1896 BUGWK45991 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.draw.space.collapse.space.html = TEXT -
trunk/LayoutTests/platform/efl/Skipped
r125450 r125575 322 322 canvas/philip/tests/2d.text.draw.baseline.top.html 323 323 canvas/philip/tests/2d.text.draw.space.collapse.end.html 324 canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html325 324 canvas/philip/tests/2d.text.draw.space.collapse.other.html 326 325 canvas/philip/tests/2d.text.draw.space.collapse.space.html -
trunk/LayoutTests/platform/gtk/TestExpectations
r125572 r125575 903 903 BUGWKGTK : canvas/philip/tests/2d.text.draw.baseline.top.html = TEXT 904 904 BUGWKGTK : canvas/philip/tests/2d.text.draw.space.collapse.end.html = TEXT 905 BUGWKGTK : canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html = TEXT906 905 BUGWKGTK : canvas/philip/tests/2d.text.draw.space.collapse.other.html = TEXT 907 906 BUGWKGTK : canvas/philip/tests/2d.text.draw.space.collapse.space.html = TEXT -
trunk/LayoutTests/platform/qt/Skipped
r125517 r125575 2108 2108 canvas/philip/tests/2d.text.draw.fontface.notinpage.html 2109 2109 canvas/philip/tests/2d.text.draw.space.collapse.end.html 2110 canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html2111 2110 canvas/philip/tests/2d.text.draw.space.collapse.other.html 2112 2111 canvas/philip/tests/2d.text.draw.space.collapse.space.html -
trunk/Source/WebCore/ChangeLog
r125570 r125575 1 2012-08-14 Christophe Dumez <christophe.dumez@intel.com> 2 3 Fix LayoutTests/canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html 4 https://bugs.webkit.org/show_bug.cgi?id=92974 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Replace space characters by U+0020 SPACE characters in 9 CanvasRenderingContext2D::drawTextInternal() in order to 10 comply with the HTML Canvas 2D Context specification: 11 - http://www.w3.org/TR/2dcontext/#drawing-text-to-the-canvas 12 13 No new tests, already tested by canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html. 14 15 * html/canvas/CanvasRenderingContext2D.cpp: 16 (WebCore::replaceCharacterInString): 17 (WebCore): 18 (WebCore::CanvasRenderingContext2D::drawTextInternal): 19 1 20 2012-08-14 George Staikos <staikos@webkit.org> 2 21 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r125450 r125575 2133 2133 } 2134 2134 2135 static void replaceCharacterInString(String& text, WTF::CharacterMatchFunctionPtr matchFunction, const String& replacement) 2136 { 2137 const size_t replacementLength = replacement.length(); 2138 size_t index = 0; 2139 while ((index = text.find(matchFunction, index)) != notFound) { 2140 text.replace(index, 1, replacement); 2141 index += replacementLength; 2142 } 2143 } 2144 2135 2145 void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, float y, bool fill, float maxWidth, bool useMaxWidth) 2136 2146 { … … 2149 2159 const Font& font = accessFont(); 2150 2160 const FontMetrics& fontMetrics = font.fontMetrics(); 2161 // According to spec, all the space characters must be replaced with U+0020 SPACE characters. 2162 String normalizedText = text; 2163 replaceCharacterInString(normalizedText, isSpaceOrNewline, " "); 2151 2164 2152 2165 // FIXME: Need to turn off font smoothing. … … 2157 2170 bool override = computedStyle ? isOverride(computedStyle->unicodeBidi()) : false; 2158 2171 2159 TextRun textRun( text, 0, 0, TextRun::AllowTrailingExpansion, direction, override, true, TextRun::NoRounding);2172 TextRun textRun(normalizedText, 0, 0, TextRun::AllowTrailingExpansion, direction, override, true, TextRun::NoRounding); 2160 2173 // Draw the item text at the correct point. 2161 2174 FloatPoint location(x, y); … … 2178 2191 } 2179 2192 2180 float fontWidth = font.width(TextRun( text, 0, 0, TextRun::AllowTrailingExpansion, direction, override));2193 float fontWidth = font.width(TextRun(normalizedText, 0, 0, TextRun::AllowTrailingExpansion, direction, override)); 2181 2194 2182 2195 useMaxWidth = (useMaxWidth && maxWidth < fontWidth);
Note: See TracChangeset
for help on using the changeset viewer.