| Differences between
and this patch
- a/Source/WebCore/ChangeLog +18 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2016-09-26  Khaled Hosny  <khaledhosny@eglug.org>
2
3
        [FreeType] Fix vertical glyph positioning
4
        https://bugs.webkit.org/show_bug.cgi?id=161493
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Test: fast/text/YPosTest.html
9
10
        * platform/graphics/GlyphBuffer.h:
11
        (WebCore::GlyphBuffer::clear):
12
        (WebCore::GlyphBuffer::offsetAt):
13
        (WebCore::GlyphBuffer::add):
14
        (WebCore::GlyphBuffer::shrink):
15
        (WebCore::GlyphBuffer::swap):
16
        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
17
        (WebCore::HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun):
18
1
2016-09-25  Antti Koivisto  <antti@apple.com>
19
2016-09-25  Antti Koivisto  <antti@apple.com>
2
20
3
        AuthorStyleSheets shouldn't trigger synchronous style resolutions
21
        AuthorStyleSheets shouldn't trigger synchronous style resolutions
- a/Source/WebCore/platform/graphics/GlyphBuffer.h -7 / +16 lines
Lines 87-93 public: a/Source/WebCore/platform/graphics/GlyphBuffer.h_sec1
87
        m_advances.clear();
87
        m_advances.clear();
88
        if (m_offsetsInString)
88
        if (m_offsetsInString)
89
            m_offsetsInString->clear();
89
            m_offsetsInString->clear();
90
#if PLATFORM(WIN)
90
#if PLATFORM(WIN) || USE(CAIRO)
91
        m_offsets.clear();
91
        m_offsets.clear();
92
#endif
92
#endif
93
    }
93
    }
Lines 121-127 public: a/Source/WebCore/platform/graphics/GlyphBuffer.h_sec2
121
121
122
    FloatSize offsetAt(unsigned index) const
122
    FloatSize offsetAt(unsigned index) const
123
    {
123
    {
124
#if PLATFORM(WIN)
124
#if PLATFORM(WIN) || USE(CAIRO)
125
        return m_offsets[index];
125
        return m_offsets[index];
126
#else
126
#else
127
        UNUSED_PARAM(index);
127
        UNUSED_PARAM(index);
Lines 149-155 public: a/Source/WebCore/platform/graphics/GlyphBuffer.h_sec3
149
        m_advances.append(FloatSize(width, 0));
149
        m_advances.append(FloatSize(width, 0));
150
#endif
150
#endif
151
151
152
#if PLATFORM(WIN)
152
#if PLATFORM(WIN) || USE(CAIRO)
153
        if (offset)
153
        if (offset)
154
            m_offsets.append(*offset);
154
            m_offsets.append(*offset);
155
        else
155
        else
Lines 163-169 public: a/Source/WebCore/platform/graphics/GlyphBuffer.h_sec4
163
    }
163
    }
164
    
164
    
165
#if !USE(WINGDI)
165
#if !USE(WINGDI)
166
    void add(Glyph glyph, const Font* font, GlyphBufferAdvance advance, unsigned offsetInString = noOffset)
166
    void add(Glyph glyph, const Font* font, GlyphBufferAdvance advance, unsigned offsetInString = noOffset, const FloatSize* offset = 0)
167
    {
167
    {
168
        m_font.append(font);
168
        m_font.append(font);
169
#if USE(CAIRO)
169
#if USE(CAIRO)
Lines 176-181 public: a/Source/WebCore/platform/graphics/GlyphBuffer.h_sec5
176
176
177
        m_advances.append(advance);
177
        m_advances.append(advance);
178
        
178
        
179
#if PLATFORM(WIN) || USE(CAIRO)
180
        if (offset)
181
            m_offsets.append(*offset);
182
        else
183
            m_offsets.append(FloatSize());
184
#else
185
        UNUSED_PARAM(offset);
186
#endif
187
179
        if (offsetInString != noOffset && m_offsetsInString)
188
        if (offsetInString != noOffset && m_offsetsInString)
180
            m_offsetsInString->append(offsetInString);
189
            m_offsetsInString->append(offsetInString);
181
    }
190
    }
Lines 212-218 public: a/Source/WebCore/platform/graphics/GlyphBuffer.h_sec6
212
        m_advances.shrink(truncationPoint);
221
        m_advances.shrink(truncationPoint);
213
        if (m_offsetsInString)
222
        if (m_offsetsInString)
214
            m_offsetsInString->shrink(truncationPoint);
223
            m_offsetsInString->shrink(truncationPoint);
215
#if PLATFORM(WIN)
224
#if PLATFORM(WIN) || USE(CAIRO)
216
        m_offsets.shrink(truncationPoint);
225
        m_offsets.shrink(truncationPoint);
217
#endif
226
#endif
218
    }
227
    }
Lines 232-238 private: a/Source/WebCore/platform/graphics/GlyphBuffer.h_sec7
232
        m_advances[index1] = m_advances[index2];
241
        m_advances[index1] = m_advances[index2];
233
        m_advances[index2] = s;
242
        m_advances[index2] = s;
234
243
235
#if PLATFORM(WIN)
244
#if PLATFORM(WIN) || USE(CAIRO)
236
        FloatSize offset = m_offsets[index1];
245
        FloatSize offset = m_offsets[index1];
237
        m_offsets[index1] = m_offsets[index2];
246
        m_offsets[index1] = m_offsets[index2];
238
        m_offsets[index2] = offset;
247
        m_offsets[index2] = offset;
Lines 244-250 private: a/Source/WebCore/platform/graphics/GlyphBuffer.h_sec8
244
    Vector<GlyphBufferAdvance, 2048> m_advances;
253
    Vector<GlyphBufferAdvance, 2048> m_advances;
245
    GlyphBufferAdvance m_initialAdvance;
254
    GlyphBufferAdvance m_initialAdvance;
246
    std::unique_ptr<Vector<unsigned, 2048>> m_offsetsInString;
255
    std::unique_ptr<Vector<unsigned, 2048>> m_offsetsInString;
247
#if PLATFORM(WIN)
256
#if PLATFORM(WIN) || USE(CAIRO)
248
    Vector<FloatSize, 2048> m_offsets;
257
    Vector<FloatSize, 2048> m_offsets;
249
#endif
258
#endif
250
    float m_leadingExpansion;
259
    float m_leadingExpansion;
- a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp -2 / +3 lines
Lines 572-585 void HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun(GlyphBuffer* glyphBuffer, Ha a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp_sec1
572
        FloatPoint& nextOffset = (i == numGlyphs - 1) ? firstOffsetOfNextRun : offsets[i + 1];
572
        FloatPoint& nextOffset = (i == numGlyphs - 1) ? firstOffsetOfNextRun : offsets[i + 1];
573
        float glyphAdvanceX = advances[i] + nextOffset.x() - currentOffset.x();
573
        float glyphAdvanceX = advances[i] + nextOffset.x() - currentOffset.x();
574
        float glyphAdvanceY = nextOffset.y() - currentOffset.y();
574
        float glyphAdvanceY = nextOffset.y() - currentOffset.y();
575
        FloatSize offset(currentOffset.x(), currentOffset.y());
575
        if (m_run.rtl()) {
576
        if (m_run.rtl()) {
576
            if (currentCharacterIndex > m_run.length())
577
            if (currentCharacterIndex > m_run.length())
577
                m_startOffset.move(glyphAdvanceX, glyphAdvanceY);
578
                m_startOffset.move(glyphAdvanceX, glyphAdvanceY);
578
            else
579
            else
579
                glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY), currentCharacterIndex);
580
                glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY), currentCharacterIndex, &offset);
580
        } else {
581
        } else {
581
            if (currentCharacterIndex < m_run.length())
582
            if (currentCharacterIndex < m_run.length())
582
                glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY), currentCharacterIndex);
583
                glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY), currentCharacterIndex, &offset);
583
        }
584
        }
584
    }
585
    }
585
}
586
}
- a/LayoutTests/ChangeLog +11 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2016-09-26   Khaled Hosny  <khaledhosny@eglug.org>
2
3
        [FreeType] Fix vertical glyph positioning
4
        https://bugs.webkit.org/show_bug.cgi?id=161493
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * fast/text/YPosTest-expected-mismatch.html: Added.
9
        * fast/text/YPosTest.html: Added.
10
        * fast/text/YPosTest.otf: Added.
11
1
2016-09-25  Chris Dumez  <cdumez@apple.com>
12
2016-09-25  Chris Dumez  <cdumez@apple.com>
2
13
3
        Unviewed, skip slow web-platform test in Debug builds
14
        Unviewed, skip slow web-platform test in Debug builds
- a/LayoutTests/fast/text/YPosTest-expected-mismatch.html +19 lines
Line 0 a/LayoutTests/fast/text/YPosTest-expected-mismatch.html_sec1
1
<html>
2
  <head>
3
    <meta charset="utf8"/>
4
    <style>
5
      @font-face {
6
        font-family: YPosTest;
7
        src: url('YPosTest.otf') format('opentype');
8
      }
9
      p {
10
        font-size: 50px;
11
        font-family: YPosTest;
12
        text-rendering: optimizeLegibility;
13
      }
14
    </style>
15
  </head>
16
  <body>
17
    <p>اا</p>
18
  </body>
19
</html>
- a/LayoutTests/fast/text/YPosTest.html +19 lines
Line 0 a/LayoutTests/fast/text/YPosTest.html_sec1
1
<html>
2
  <head>
3
    <meta charset="utf8"/>
4
    <style>
5
      @font-face {
6
        font-family: YPosTest;
7
        src: url('YPosTest.otf') format('opentype');
8
      }
9
      p {
10
        font-size: 50px;
11
        font-family: YPosTest;
12
        text-rendering: optimizeLegibility;
13
      }
14
    </style>
15
  </head>
16
  <body>
17
    <p>ات</p>
18
  </body>
19
</html>

Return to Bug 161493