WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-161493-20160926140712.patch (text/plain), 11.36 KB, created by
Frédéric Wang Nélar
on 2016-09-26 05:10:09 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Wang Nélar
Created:
2016-09-26 05:10:09 PDT
Size:
11.36 KB
patch
obsolete
>Subversion Revision: 206367 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e22079c27cf2340ed19324e02cee64054871c8f5..01c857a66291c0a705532d14fb512e15e654ef79 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2016-09-26 Frederic Wang <fred.wang@free.fr> >+ >+ [FreeType] Incorrect application of glyph positioning in the Y direction >+ https://bugs.webkit.org/show_bug.cgi?id=161493 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: fast/text/YPosTest.html >+ >+ * platform/graphics/GlyphBuffer.h: >+ (WebCore::GlyphBuffer::clear): >+ (WebCore::GlyphBuffer::offsetAt): >+ (WebCore::GlyphBuffer::add): >+ (WebCore::GlyphBuffer::shrink): >+ (WebCore::GlyphBuffer::swap): >+ * platform/graphics/harfbuzz/HarfBuzzShaper.cpp: >+ (WebCore::HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun): >+ > 2016-09-25 Antti Koivisto <antti@apple.com> > > AuthorStyleSheets shouldn't trigger synchronous style resolutions >diff --git a/Source/WebCore/platform/graphics/GlyphBuffer.h b/Source/WebCore/platform/graphics/GlyphBuffer.h >index 0b243b2ad832fe4078c329ef75249725ae960d99..57b9969d74db31df0046f2e561c12624b221e83a 100644 >--- a/Source/WebCore/platform/graphics/GlyphBuffer.h >+++ b/Source/WebCore/platform/graphics/GlyphBuffer.h >@@ -87,7 +87,7 @@ public: > m_advances.clear(); > if (m_offsetsInString) > m_offsetsInString->clear(); >-#if PLATFORM(WIN) >+#if PLATFORM(WIN) || USE(CAIRO) > m_offsets.clear(); > #endif > } >@@ -121,7 +121,7 @@ public: > > FloatSize offsetAt(unsigned index) const > { >-#if PLATFORM(WIN) >+#if PLATFORM(WIN) || USE(CAIRO) > return m_offsets[index]; > #else > UNUSED_PARAM(index); >@@ -149,7 +149,7 @@ public: > m_advances.append(FloatSize(width, 0)); > #endif > >-#if PLATFORM(WIN) >+#if PLATFORM(WIN) || USE(CAIRO) > if (offset) > m_offsets.append(*offset); > else >@@ -163,7 +163,7 @@ public: > } > > #if !USE(WINGDI) >- void add(Glyph glyph, const Font* font, GlyphBufferAdvance advance, unsigned offsetInString = noOffset) >+ void add(Glyph glyph, const Font* font, GlyphBufferAdvance advance, unsigned offsetInString = noOffset, const FloatSize* offset = 0) > { > m_font.append(font); > #if USE(CAIRO) >@@ -176,6 +176,15 @@ public: > > m_advances.append(advance); > >+#if PLATFORM(WIN) || USE(CAIRO) >+ if (offset) >+ m_offsets.append(*offset); >+ else >+ m_offsets.append(FloatSize()); >+#else >+ UNUSED_PARAM(offset); >+#endif >+ > if (offsetInString != noOffset && m_offsetsInString) > m_offsetsInString->append(offsetInString); > } >@@ -212,7 +221,7 @@ public: > m_advances.shrink(truncationPoint); > if (m_offsetsInString) > m_offsetsInString->shrink(truncationPoint); >-#if PLATFORM(WIN) >+#if PLATFORM(WIN) || USE(CAIRO) > m_offsets.shrink(truncationPoint); > #endif > } >@@ -232,7 +241,7 @@ private: > m_advances[index1] = m_advances[index2]; > m_advances[index2] = s; > >-#if PLATFORM(WIN) >+#if PLATFORM(WIN) || USE(CAIRO) > FloatSize offset = m_offsets[index1]; > m_offsets[index1] = m_offsets[index2]; > m_offsets[index2] = offset; >@@ -244,7 +253,7 @@ private: > Vector<GlyphBufferAdvance, 2048> m_advances; > GlyphBufferAdvance m_initialAdvance; > std::unique_ptr<Vector<unsigned, 2048>> m_offsetsInString; >-#if PLATFORM(WIN) >+#if PLATFORM(WIN) || USE(CAIRO) > Vector<FloatSize, 2048> m_offsets; > #endif > float m_leadingExpansion; >diff --git a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp b/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp >index 55d59e2693dbf44483d112392bae80e110ca6e3d..3dc6e3d448131e0c9f7c22e0cb0360ca66d26c6a 100644 >--- a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp >+++ b/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp >@@ -572,14 +572,15 @@ void HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun(GlyphBuffer* glyphBuffer, Ha > FloatPoint& nextOffset = (i == numGlyphs - 1) ? firstOffsetOfNextRun : offsets[i + 1]; > float glyphAdvanceX = advances[i] + nextOffset.x() - currentOffset.x(); > float glyphAdvanceY = nextOffset.y() - currentOffset.y(); >+ FloatSize offset(currentOffset.x(), currentOffset.y()); > if (m_run.rtl()) { > if (currentCharacterIndex > m_run.length()) > m_startOffset.move(glyphAdvanceX, glyphAdvanceY); > else >- glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY), currentCharacterIndex); >+ glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY), currentCharacterIndex, &offset); > } else { > if (currentCharacterIndex < m_run.length()) >- glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY), currentCharacterIndex); >+ glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY), currentCharacterIndex, &offset); > } > } > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index fe2c3169d89d668c6f0cb9ade162f3829f31003a..34d889d3dca873e6b941132b09095edc1bdbd71c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2016-09-26 Frederic Wang <fred.wang@free.fr> >+ >+ [FreeType] Incorrect application of glyph positioning in the Y direction >+ https://bugs.webkit.org/show_bug.cgi?id=161493 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/text/YPosTest.html: Added. >+ * fast/text/YPosTest.otf: Added. >+ * platform/gtk/fast/text/YPosTest-expected.png: Added. >+ * platform/gtk/fast/text/YPosTest-expected.txt: Added. >+ * platform/ios-simulator/TestExpectations: >+ * platform/mac/TestExpectations: >+ > 2016-09-25 Chris Dumez <cdumez@apple.com> > > Unviewed, skip slow web-platform test in Debug builds >diff --git a/LayoutTests/fast/text/YPosTest.html b/LayoutTests/fast/text/YPosTest.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2a6f2dac7266c62f97705cc8794e1a5d2626a274 >--- /dev/null >+++ b/LayoutTests/fast/text/YPosTest.html >@@ -0,0 +1,21 @@ >+<html> >+ <head> >+ <meta charset="utf8"/> >+ <style> >+ @font-face { >+ font-family: YPosTest; >+ src: url('YPosTest.otf') format('opentype'); >+ } >+ p { >+ font-size: 50px; >+ font-family: YPosTest; >+ text-rendering: optimizeLegibility; >+ } >+ </style> >+ </head> >+ <body> >+ <p>ab ac</p> >+ <p>a a</p> >+ <p>اب ات</p> >+ </body> >+</html> >diff --git a/LayoutTests/fast/text/YPosTest.otf b/LayoutTests/fast/text/YPosTest.otf >new file mode 100644 >index 0000000000000000000000000000000000000000..d5b74006edc15570b1ed569c747e1c6717c46d97 >GIT binary patch >literal 2300 >zcmd5-O>7%Q6#iy+vvCsF2_*>^D~wVjstPBzBSIRbRcR6jp+<IPQ`D+bx{jULiX9t! >zLsEfIC8YA>rm8>!j&Oqu>b<oTapBS%*Mi`N;80Y7vK3LxH|uo>QRt;YVrFOFH*e<s >z%-flHiF7)FBe(_~$?14pu7`GGfEfbBC-HcCK4f<E1HO9zf^##oar9yc=)BAE&|ET+ >zdU$V_&=+KPdoK0b*`pr~f5!Ry9G^*~Mq_KurA_KO!||2Hl2z$?*!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GY|(Xv-@++7d%mbmBh0HUa?r5msCmEA8t?8-;><Xbk|Iu09YE4k__ >z0wt@u0+rd@-U*c+5%9e3^E?lc4!YU}{G8KwD=^qpCev8^*qC*9E2@!a@EtIyr?aj3 >V?dNV^Bi^6qXH-V@vZ|VL%U@=Kjidko > >literal 0 >HcmV?d00001 > >diff --git a/LayoutTests/platform/gtk/fast/text/YPosTest-expected.png b/LayoutTests/platform/gtk/fast/text/YPosTest-expected.png >new file mode 100644 >index 0000000000000000000000000000000000000000..168644a4c97bd969ffa3c58a79bcc1868df7c754 >GIT binary patch >literal 2951 >zcmeAS@N?(olHy`uVBq!ia0y~yU{+vYV2a>i0*Z)=h^hlA%@Ws$lH`ok<m}?oTn3ZG >zRD)!LWOJjmRHHNlBa;*}%QQ2~<YaS06Z2%t6qB7F_cH@Eu_bxCyD<C*!3BGlPiA1? >zX7_Y)45^s&_Ku<7Q3oCe$DX49+Oy>ZIbHdgej2~cGS{0QlT!Abm!aX@@4G+~Y<dqc >zF?4Y1Ff`1-&A3rmW?(#B{%d&!!-J_e6Brqeu!u1@_)wG4x10S(PMY5RyLStO7#gy3 >zHZU+GF>x~}s8N$~{N}-T|DMS(F!U!jvoZ(>M=&rLHd2u>`|jRqHiicGjRy&bDW2dS >z)>5+R?8e1EFW%i-^L^cWCWa8&#PsIf<>wg~K4_RxJBq2EW(XL#@$oxGFJOSZd)Efc >z-RsY=Q9Dn7GMU-#+xAvKJN(almi=Ft#_%A26HQX^*>`od2EfSQY|h9K*T_rlG6Ym8 >z<&=GYC&|Ddca$apMb*-X>c!irfwZVJMniQpRH@qx8BI|%Pf_0(n`8|ad=%Le32Y=Y >Nc)I$ztaD0e0szDDNl5?z > >literal 0 >HcmV?d00001 > >diff --git a/LayoutTests/platform/gtk/fast/text/YPosTest-expected.txt b/LayoutTests/platform/gtk/fast/text/YPosTest-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..ac90f576ae38f1ad20ea390b2fa3bb7ca3a92478 >--- /dev/null >+++ b/LayoutTests/platform/gtk/fast/text/YPosTest-expected.txt >@@ -0,0 +1,14 @@ >+layer at (0,0) size 800x600 >+ RenderView at (0,0) size 800x600 >+layer at (0,0) size 800x600 >+ RenderBlock {HTML} at (0,0) size 800x600 >+ RenderBody {BODY} at (8,8) size 784x542 >+ RenderBlock {P} at (0,0) size 784x54 >+ RenderText {#text} at (0,2) size 100x50 >+ text run at (0,2) width 100: "ab ac" >+ RenderBlock {P} at (0,104) size 784x54 >+ RenderText {#text} at (0,2) size 60x50 >+ text run at (0,2) width 60: "a a" >+ RenderBlock {P} at (0,208) size 784x54 >+ RenderText {#text} at (0,2) size 100x50 >+ text run at (0,2) width 100 RTL: "\x{627}\x{628} \x{627}\x{62A}" >diff --git a/LayoutTests/platform/ios-simulator/TestExpectations b/LayoutTests/platform/ios-simulator/TestExpectations >index 06793d52cebb53eb02fc81dec0478a09754a7ab5..1e224ad0b38e288c5c8e42a398e34a952079c313 100644 >--- a/LayoutTests/platform/ios-simulator/TestExpectations >+++ b/LayoutTests/platform/ios-simulator/TestExpectations >@@ -2659,3 +2659,5 @@ css3/font-variant-small-caps-synthesis.html [ ImageOnlyFailure ] > webkit.org/b/161949 imported/w3c/web-platform-tests/XMLHttpRequest/response-method.htm [ Failure ] > > webkit.org/b/130972 transitions/3d/interrupted-transition.html [ Pass Timeout ] >+ >+fast/text/YPosTest.html [ Skip ] >diff --git a/LayoutTests/platform/mac/TestExpectations b/LayoutTests/platform/mac/TestExpectations >index 4b7edb88f4267770f16c8fbb93fcb44956a4c31a..ecd6c9125bbaee26e4259c05df457f7b6770cbfc 100644 >--- a/LayoutTests/platform/mac/TestExpectations >+++ b/LayoutTests/platform/mac/TestExpectations >@@ -1450,3 +1450,5 @@ webkit.org/b/162308 imported/w3c/web-platform-tests/media-source/mediasource-dur > webkit.org/b/162497 media/media-source/media-source-duplicate-seeked.html [ Skip ] > > webkit.org/b/162523 [ Sierra+ ] imported/w3c/web-platform-tests/media-source/mediasource-preload.html [ Pass Failure ] >+ >+fast/text/YPosTest.html [ Skip ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 161493
:
287632
|
287633
|
287634
|
287860
|
289820
|
289849
|
334733
|
366166
|
366167