Skip to content

Commit

Permalink
Merge r220746 - Unreviewed, rolling out r219504.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=175580

Broke Arabic text shaping (Requested by mcatanzaro on

Reverted changeset:

"[HarfBuzz] Decomposed Vietnamese characters are rendered
incorrectly"
https://bugs.webkit.org/show_bug.cgi?id=174418
http://trac.webkit.org/changeset/219504
  • Loading branch information
webkit-commit-queue authored and carlosgcampos committed Aug 17, 2017
1 parent 98455aa commit 17c8ea2
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 31 deletions.
15 changes: 15 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
2017-08-15 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r219504.
https://bugs.webkit.org/show_bug.cgi?id=175580

Broke Arabic text shaping (Requested by mcatanzaro on
#webkit).

Reverted changeset:

"[HarfBuzz] Decomposed Vietnamese characters are rendered
incorrectly"
https://bugs.webkit.org/show_bug.cgi?id=174418
http://trac.webkit.org/changeset/219504

2017-08-15 Darin Adler <darin@apple.com>

REGRESSION(r220052): http/tests/appcache/deferred-events-delete-while-raising-timer.html is crashing.
Expand Down
15 changes: 0 additions & 15 deletions LayoutTests/fast/text/international/vietnamese-nfd-expected.html

This file was deleted.

15 changes: 0 additions & 15 deletions LayoutTests/fast/text/international/vietnamese-nfd.html

This file was deleted.

15 changes: 15 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
2017-08-15 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r219504.
https://bugs.webkit.org/show_bug.cgi?id=175580

Broke Arabic text shaping (Requested by mcatanzaro on
#webkit).

Reverted changeset:

"[HarfBuzz] Decomposed Vietnamese characters are rendered
incorrectly"
https://bugs.webkit.org/show_bug.cgi?id=174418
http://trac.webkit.org/changeset/219504

2017-08-16 Antti Koivisto <antti@apple.com>

Move first-letter renderer mutation code out of RenderBlock and into RenderTreeUpdater
Expand Down
31 changes: 30 additions & 1 deletion Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
Expand Up @@ -160,6 +160,33 @@ float HarfBuzzShaper::HarfBuzzRun::xPositionForOffset(unsigned offset)
return position;
}

static void normalizeCharacters(const TextRun& run, UChar* destination, unsigned length)
{
unsigned position = 0;
bool error = false;
const UChar* source;
String stringFor8BitRun;
if (run.is8Bit()) {
stringFor8BitRun = String::make16BitFrom8BitSource(run.characters8(), run.length());
source = stringFor8BitRun.characters16();
} else
source = run.characters16();

while (position < length) {
UChar32 character;
unsigned nextPosition = position;
U16_NEXT(source, nextPosition, length, character);
// Don't normalize tabs as they are not treated as spaces for word-end.
if (FontCascade::treatAsSpace(character) && character != '\t')
character = ' ';
else if (FontCascade::treatAsZeroWidthSpaceInComplexScript(character))
character = zeroWidthSpace;
U16_APPEND(destination, position, length, character, error);
ASSERT_UNUSED(error, !error);
position = nextPosition;
}
}

HarfBuzzShaper::HarfBuzzShaper(const FontCascade* font, const TextRun& run)
: m_font(font)
, m_normalizedBufferLength(0)
Expand All @@ -170,7 +197,9 @@ HarfBuzzShaper::HarfBuzzShaper(const FontCascade* font, const TextRun& run)
, m_padError(0)
, m_letterSpacing(font->letterSpacing())
{
setNormalizedBuffer();
m_normalizedBuffer = std::make_unique<UChar[]>(m_run.length() + 1);
m_normalizedBufferLength = m_run.length();
normalizeCharacters(m_run, m_normalizedBuffer.get(), m_normalizedBufferLength);
setPadding(m_run.expansion());
setFontFeatures();
}
Expand Down

0 comments on commit 17c8ea2

Please sign in to comment.