This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to branch geckoview-99.0.1-11.0-1 in repository tor-browser.
commit a22074f009bb4d0f0b466c0fc4d1eeedc09a1b32 Author: Ryan VanderMeulen ryanvm@gmail.com AuthorDate: Fri Apr 8 00:54:59 2022 +0000
Bug 1763368 - Revert upstream commit to fix Bengali text rendering regression. r=jfkthame a=dmeehan
This reverts the fix for upstream issue https://github.com/harfbuzz/harfbuzz/issues/3314
Firefox was unaffected by that bug, so this should be safe to take while the investigation continues upstream: https://github.com/harfbuzz/harfbuzz/issues/3528
Differential Revision: https://phabricator.services.mozilla.com/D143186 --- gfx/harfbuzz/src/hb-aat-layout-morx-table.hh | 4 ++-- gfx/harfbuzz/src/hb-ot-layout.hh | 6 ------ gfx/harfbuzz/src/hb-ot-shape.cc | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/gfx/harfbuzz/src/hb-aat-layout-morx-table.hh b/gfx/harfbuzz/src/hb-aat-layout-morx-table.hh index 2f99510925d03..b77c1f4d449ad 100644 --- a/gfx/harfbuzz/src/hb-aat-layout-morx-table.hh +++ b/gfx/harfbuzz/src/hb-aat-layout-morx-table.hh @@ -1038,12 +1038,12 @@ struct Chain goto skip;
if (reverse) - _hb_ot_layout_reverse_graphemes (c->buffer); + c->buffer->reverse ();
subtable->apply (c);
if (reverse) - _hb_ot_layout_reverse_graphemes (c->buffer); + c->buffer->reverse ();
(void) c->buffer->message (c->font, "end chainsubtable %d", c->lookup_index);
diff --git a/gfx/harfbuzz/src/hb-ot-layout.hh b/gfx/harfbuzz/src/hb-ot-layout.hh index ede8f007dbd53..4612f4dda5bbc 100644 --- a/gfx/harfbuzz/src/hb-ot-layout.hh +++ b/gfx/harfbuzz/src/hb-ot-layout.hh @@ -359,12 +359,6 @@ _hb_grapheme_group_func (const hb_glyph_info_t& a HB_UNUSED, #define foreach_grapheme(buffer, start, end) \ foreach_group (buffer, start, end, _hb_grapheme_group_func)
-static inline void -_hb_ot_layout_reverse_graphemes (hb_buffer_t *buffer) -{ - buffer->reverse_groups (_hb_grapheme_group_func, - buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS); -}
static inline bool _hb_glyph_info_is_unicode_format (const hb_glyph_info_t *info) diff --git a/gfx/harfbuzz/src/hb-ot-shape.cc b/gfx/harfbuzz/src/hb-ot-shape.cc index 4bd8aaf03b40e..a93bc30b88b66 100644 --- a/gfx/harfbuzz/src/hb-ot-shape.cc +++ b/gfx/harfbuzz/src/hb-ot-shape.cc @@ -628,7 +628,20 @@ hb_ensure_native_direction (hb_buffer_t *buffer) (HB_DIRECTION_IS_VERTICAL (direction) && direction != HB_DIRECTION_TTB)) { - _hb_ot_layout_reverse_graphemes (buffer); + + if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS) + foreach_grapheme (buffer, start, end) + { + buffer->merge_clusters (start, end); + buffer->reverse_range (start, end); + } + else + foreach_grapheme (buffer, start, end) + /* form_clusters() merged clusters already, we don't merge. */ + buffer->reverse_range (start, end); + + buffer->reverse (); + buffer->props.direction = HB_DIRECTION_REVERSE (buffer->props.direction); } }