Reviewed by Eric Seidel.
Chromium Linux: fix assertion when rendering google.com.kh
https://bugs.webkit.org/show_bug.cgi?id=26924
Some shapers (i.e. Khmer) will produce cluster logs which report that
/no/ code points contributed to certain glyphs. Because of this, we
take any code point which contributed to the glyph in question, or any
subsequent glyph. If we run off the end, then we take the last code
point.
Added LayoutTests/fast/text/international/khmar-selection.html
* platform/graphics/chromium/FontLinux.cpp:
(WebCore::Font::offsetForPositionForComplexText):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@45833
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2009-07-13 Adam Langley <agl@google.com>
+
+ Reviewed by Eric Seidel.
+
+ Chromium Linux: fix assertion when rendering google.com.kh
+
+ https://bugs.webkit.org/show_bug.cgi?id=26924
+
+ Some shapers (i.e. Khmer) will produce cluster logs which report that
+ /no/ code points contributed to certain glyphs. Because of this, we
+ take any code point which contributed to the glyph in question, or any
+ subsequent glyph. If we run off the end, then we take the last code
+ point.
+
+ * fast/text/international/khmer-selection.html: Added.
+
2009-07-13 Peter Kasting <pkasting@google.com>
https://bugs.webkit.org/show_bug.cgi?id=19562
--- /dev/null
+<!DOCTYPE html>
+
+<html>
+<head>
+ <title>Testing Khmer selection</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <script>
+ function main() {
+ window.eventSender.mouseMoveTo(5, 8);
+ window.eventSender.mouseDown();
+
+ for (var x = 5; x < 600; x += 5) {
+ window.eventSender.mouseMoveTo(x, 8);
+ }
+
+ window.eventSender.mouseUp();
+ }
+ </script>
+</head>
+
+<body onload="main();">
+ <p>
+ <nobr><b class="gb1">វ៉ែប</b> <a href=
+ "http://images.google.com.kh/imghp?hl=km&tab=wi" class=
+ "gb1">រូបភាព</a> <a href=
+ "http://groups.google.com.kh/grphp?hl=km&tab=wg" class=
+ "gb1">ក្រុម</a> <a href=
+ "http://www.google.com.kh/dirhp?hl=km&tab=wd" class=
+ "gb1">ថតឯកសារ</a></nobr>
+ </p>
+ <p>Some Harfbuzz shapers will output cluster logs which suggest that some glyphs had <i>no</i> contributing code points. This test contains such text and uses <tt>eventSender</tt> to select the text. You should see some of the above text selected and <tt>test_shell</tt> shouldn't trigger any assertions or crash.</p>
+</body>
+</html>
+2009-07-13 Adam Langley <agl@google.com>
+
+ Reviewed by Eric Seidel.
+
+ Chromium Linux: fix assertion when rendering google.com.kh
+
+ https://bugs.webkit.org/show_bug.cgi?id=26924
+
+ Some shapers (i.e. Khmer) will produce cluster logs which report that
+ /no/ code points contributed to certain glyphs. Because of this, we
+ take any code point which contributed to the glyph in question, or any
+ subsequent glyph. If we run off the end, then we take the last code
+ point.
+
+ Added LayoutTests/fast/text/international/khmar-selection.html
+
+ * platform/graphics/chromium/FontLinux.cpp:
+ (WebCore::Font::offsetForPositionForComplexText):
+
2009-07-13 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler.
// code-point index. Because of ligatures, several code-points may
// have gone into a single glyph. We iterate over the clusters log
// and find the first code-point which contributed to the glyph.
+
+ // Some shapers (i.e. Khmer) will produce cluster logs which report
+ // that /no/ code points contributed to certain glyphs. Because of
+ // this, we take any code point which contributed to the glyph in
+ // question, or any subsequent glyph. If we run off the end, then
+ // we take the last code point.
const unsigned short* log = walker.logClusters();
for (unsigned j = 0; j < walker.numCodePoints(); ++j) {
- if (log[j] == glyphIndex)
+ if (log[j] >= glyphIndex)
return basePosition + j;
}
- ASSERT_NOT_REACHED();
+ return basePosition + walker.numCodePoints() - 1;
}
x -= walker.width();