commit 63b5105e5a8f8745fad916a507868c21ea6ba1e3
parent 38af2334302a297352086a281458c26178eb0483
Author: Jonathan Kew <jkew@mozilla.com>
Date: Sun, 19 Oct 2025 20:37:36 +0000
Bug 1994921 - Cherry-pick commit b98ec96 from upstream harfbuzz to fix AAT shaping error. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D269165
Diffstat:
4 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/gfx/harfbuzz/src/hb-cache.hh b/gfx/harfbuzz/src/hb-cache.hh
@@ -90,7 +90,7 @@ struct hb_cache_t
{
unsigned int k = key & ((1u<<cache_bits)-1);
unsigned int v = values[k];
- if ((key_bits + value_bits - cache_bits == 8 * sizeof (item_t) && v == (unsigned int) -1) ||
+ if ((key_bits + value_bits - cache_bits == 8 * sizeof (item_t) && (item_t) v == (item_t) -1) ||
(v >> value_bits) != (key >> cache_bits))
return false;
*value = v & ((1u<<value_bits)-1);
diff --git a/layout/reftests/text/kannada-1-notref.html b/layout/reftests/text/kannada-1-notref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<div style="font:24px sans-serif">
+<p>The two following lines should NOT look the same:</p>
+<p>ಕರ‍ನಾಟಕ</p>
+<p>ಕರ‍ನಾಟಕ</p>
+</div>
diff --git a/layout/reftests/text/kannada-1.html b/layout/reftests/text/kannada-1.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<div style="font:24px sans-serif">
+<p>The two following lines should NOT look the same:</p>
+<p>ಕರ್ನಾಟಕ</p>
+<p>ಕರ‍ನಾಟಕ</p>
+</div>
diff --git a/layout/reftests/text/reftest.list b/layout/reftests/text/reftest.list
@@ -368,5 +368,8 @@ pref(intl.icu4x.segmenter.enabled,false) == ethiopic-wordspace.html ethiopic-wor
pref(layout.css.prefers-color-scheme.content-override,0) == utf16-bom.txt utf16-bom-ref.txt
test-pref(layout.css.prefers-color-scheme.content-override,0) ref-pref(layout.css.prefers-color-scheme.content-override,1) != utf16-bom.txt utf16-bom-ref.txt
+# Test for Kannada AAT shaping bug 1994921
+!= kannada-1.html kannada-1-notref.html
+
# Reset default prefs.
defaults