Title: [126310] trunk/Source/WebCore
Revision
126310
Author
[email protected]
Date
2012-08-22 09:07:44 -0700 (Wed, 22 Aug 2012)

Log Message

REGRESSION(r125578): fast/regex/unicodeCaseInsensitive.html crash on Linux Debug Chromium
https://bugs.webkit.org/show_bug.cgi?id=94010

Reviewed by Tony Chang.

r125578 inspected the raw text run for word-end but the index it used to do so was for a normalized
version of the run that could be longer than the raw text run. So to allow proper detection of word-end
in complex text (i) do not normalize tabs to plain white-space and (ii) go back to using the normalized version
of the run for detecting word-end. There is a risk that some fonts may create glyphs for the '\t' character
but this does not turn up in any of our regression tests and the more common risk appears to be the new-line.

Test: fast/regex/unicodeCaseInsensitive.html

* platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp:
(WebCore::normalizeSpacesAndMirrorChars):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (126309 => 126310)


--- trunk/Source/WebCore/ChangeLog	2012-08-22 16:01:10 UTC (rev 126309)
+++ trunk/Source/WebCore/ChangeLog	2012-08-22 16:07:44 UTC (rev 126310)
@@ -1,3 +1,21 @@
+2012-08-22  Robert Hogan  <[email protected]>
+
+        REGRESSION(r125578): fast/regex/unicodeCaseInsensitive.html crash on Linux Debug Chromium
+        https://bugs.webkit.org/show_bug.cgi?id=94010
+
+        Reviewed by Tony Chang.
+
+        r125578 inspected the raw text run for word-end but the index it used to do so was for a normalized
+        version of the run that could be longer than the raw text run. So to allow proper detection of word-end
+        in complex text (i) do not normalize tabs to plain white-space and (ii) go back to using the normalized version
+        of the run for detecting word-end. There is a risk that some fonts may create glyphs for the '\t' character 
+        but this does not turn up in any of our regression tests and the more common risk appears to be the new-line.
+
+        Test: fast/regex/unicodeCaseInsensitive.html
+
+        * platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp:
+        (WebCore::normalizeSpacesAndMirrorChars):
+
 2012-08-22  Andrey Adaikin  <[email protected]>
 
         Web Inspector: [WebGL] Support the communication protocol from the injected script

Modified: trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp (126309 => 126310)


--- trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp	2012-08-22 16:01:10 UTC (rev 126309)
+++ trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp	2012-08-22 16:07:44 UTC (rev 126310)
@@ -61,7 +61,8 @@
         UChar32 character;
         int nextPosition = position;
         U16_NEXT(source, nextPosition, length, character);
-        if (Font::treatAsSpace(character))
+        // Don't normalize tabs as they are not treated as spaces for word-end
+        if (Font::treatAsSpace(character) && character != '\t')
             character = ' ';
         else if (Font::treatAsZeroWidthSpace(character))
             character = zeroWidthSpace;
@@ -121,7 +122,7 @@
 bool HarfBuzzShaperBase::isWordEnd(unsigned index)
 {
     // This could refer a high-surrogate, but should work.
-    return index && isCodepointSpace(m_run[index]);
+    return index && isCodepointSpace(m_normalizedBuffer[index]);
 }
 
 int HarfBuzzShaperBase::determineWordBreakSpacing()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to