Source/WebCore/ChangeLog

 12017-02-07 Myles C. Maxfield <mmaxfield@apple.com>
 2
 3 [Win] [GTK] [EFL] Compile (but don't use, yet) the platform-independent piece of ComplexTextController
 4 https://bugs.webkit.org/show_bug.cgi?id=167927
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 This patch simply moves some functions around to enable the Win, GTK, and EFL ports to compile the
 9 platform-independent pieces of ComplexTextController. Those parts of ComplexTextController have
 10 some dependencies which were previously only available on the Cocoa ports; however, those
 11 dependencies are easily created or moved from elsewhere. The next step is to populate the
 12 ComplexTextController::collectComplexTextRunsForCharacters() function for DirectWrite and HarfBuzz.
 13 Once that is done, UniscribeController and HarfBuzzShaper can be deleted.
 14
 15 Adds ComplexTextController TestWebKitAPI tests to the Win and GTK ports.
 16
 17 * CMakeLists.txt: Everyone can compile the platform-independent piece of ComplexTextController.
 18 * PlatformEfl.cmake: Add the HarfBuzz-specific piece.
 19 * PlatformGTK.cmake: Ditto.
 20 * PlatformWin.cmake: Add the DirectWrite-specific piece.
 21 * platform/graphics/ComplexTextController.cpp:
 22 (WebCore::TextLayoutDeleter::operator()): ComplexTextController shouldn't be enabled yet for Win,
 23 GTK, or EFL.
 24 (WebCore::FontCascade::createLayout): Ditto.
 25 (WebCore::FontCascade::width): Ditto.
 26 (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Moved shared code to the shared
 27 file.
 28 * platform/graphics/Font.cpp:
 29 (WebCore::Font::noSynthesizableFeaturesFont): Default implementation for other ports.
 30 (WebCore::Font::variantCapsSupportsCharacterForSynthesis): Ditto.
 31 * platform/graphics/FontCascade.cpp:
 32 (WebCore::FontCascade::fontForCombiningCharacterSequence): Ditto.
 33 (WebCore::FontCascade::drawEmphasisMarksForComplexText): Ditto.
 34 (WebCore::FontCascade::createLayout): Deleted. Moved to ComplexTextController.
 35 (WebCore::TextLayoutDeleter::operator()): Deleted. Ditto.
 36 * platform/graphics/FontCascade.h: fontForCombiningCharacterSequence() should exist on all ports.
 37 * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
 38 (WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Shared among all ports.
 39 * platform/graphics/cocoa/FontCascadeCocoa.mm:
 40 (WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Ditto.
 41 * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Added.
 42 (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Empty implementation of
 43 HarfBuzz-specific piece of ComplexTextController.
 44 * platform/graphics/mac/ComplexTextControllerCoreText.mm: Moved constructors to shared file.
 45 * platform/graphics/win/ComplexTextControllerDirectWrite.cpp: Added.
 46 (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Empty implementation of
 47 Direct Write-specific piece of ComplexTextController.
 48 * platform/graphics/win/FontWin.cpp:
 49 (WebCore::FontCascade::drawEmphasisMarksForComplexText): Deleted. Shared among all ports.
 50
1512017-02-07 Yusuke Suzuki <utatane.tea@gmail.com>
252
353 Unreviewed, manual roll out of r211777

Source/WebCore/CMakeLists.txt

@@set(WebCore_SOURCES
21662166
21672167 platform/graphics/BitmapImage.cpp
21682168 platform/graphics/Color.cpp
 2169 platform/graphics/ComplexTextController.cpp
21692170 platform/graphics/CrossfadeGeneratedImage.cpp
21702171 platform/graphics/DisplayRefreshMonitorClient.cpp
21712172 platform/graphics/ExtendedColor.cpp

Source/WebCore/PlatformEfl.cmake

@@list(APPEND WebCore_SOURCES
138138
139139 platform/graphics/gstreamer/ImageGStreamerCairo.cpp
140140
 141 platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp
141142 platform/graphics/harfbuzz/HarfBuzzFace.cpp
142143 platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp
143144 platform/graphics/harfbuzz/HarfBuzzShaper.cpp

Source/WebCore/PlatformGTK.cmake

@@list(APPEND WebCore_SOURCES
119119
120120 platform/graphics/gstreamer/ImageGStreamerCairo.cpp
121121
 122 platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp
122123 platform/graphics/harfbuzz/HarfBuzzFace.cpp
123124 platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp
124125 platform/graphics/harfbuzz/HarfBuzzShaper.cpp

Source/WebCore/PlatformWin.cmake

@@list(APPEND WebCore_SOURCES
8686 platform/graphics/opentype/OpenTypeUtilities.cpp
8787
8888 platform/graphics/win/ColorDirect2D.cpp
 89 platform/graphics/win/ComplexTextControllerDirectWrite.cpp
8990 platform/graphics/win/DIBPixelData.cpp
9091 platform/graphics/win/FloatPointDirect2D.cpp
9192 platform/graphics/win/FloatRectDirect2D.cpp

Source/WebCore/platform/graphics/ComplexTextController.cpp

@@private:
9292
9393void TextLayoutDeleter::operator()(TextLayout* layout) const
9494{
 95#if PLATFORM(COCOA)
9596 delete layout;
 97#else
 98 ASSERT_UNUSED(layout, !layout);
 99#endif
96100}
97101
98102std::unique_ptr<TextLayout, TextLayoutDeleter> FontCascade::createLayout(RenderText& text, float xPos, bool collapseWhiteSpace) const
99103{
 104#if PLATFORM(COCOA)
100105 if (!collapseWhiteSpace || !TextLayout::isNeeded(text, *this))
101106 return nullptr;
102107 return std::unique_ptr<TextLayout, TextLayoutDeleter>(new TextLayout(text, *this, xPos));
 108#else
 109 UNUSED_PARAM(text);
 110 UNUSED_PARAM(xPos);
 111 UNUSED_PARAM(collapseWhiteSpace);
 112 return nullptr;
 113#endif
103114}
104115
105116float FontCascade::width(TextLayout& layout, unsigned from, unsigned len, HashSet<const Font*>* fallbackFonts)
106117{
 118#if PLATFORM(COCOA)
107119 return layout.width(from, len, fallbackFonts);
 120#else
 121 UNUSED_PARAM(layout);
 122 UNUSED_PARAM(from);
 123 UNUSED_PARAM(len);
 124 UNUSED_PARAM(fallbackFonts);
 125 ASSERT_NOT_REACHED();
 126 return 0;
 127#endif
108128}
109129
110130void ComplexTextController::computeExpansionOpportunity()

@@void ComplexTextController::adjustGlyphsAndAdvances()
721741 }
722742 UChar ch = *(cp + characterIndex);
723743 bool lastGlyph = lastRun && i + 1 == glyphCount;
724  UChar nextCh;
725  if (lastGlyph)
726  nextCh = ' ';
727  else if (i + 1 < glyphCount)
728  nextCh = *(cp + complexTextRun.indexAt(i + 1));
729  else
730  nextCh = *(m_complexTextRuns[runIndex + 1]->characters() + m_complexTextRuns[runIndex + 1]->indexAt(0));
731744
732745 bool treatAsSpace = FontCascade::treatAsSpace(ch);
733746 CGGlyph glyph = treatAsSpace ? font.spaceGlyph() : glyphs[i];

@@void ComplexTextController::adjustGlyphsAndAdvances()
830843 m_totalWidth += widthSinceLastCommit;
831844}
832845
 846// Missing glyphs run constructor. Core Text will not generate a run of missing glyphs, instead falling back on
 847// glyphs from LastResort. We want to use the primary font's missing glyph in order to match the fast text code path.
 848ComplexTextController::ComplexTextRun::ComplexTextRun(const Font& font, const UChar* characters, unsigned stringLocation, unsigned stringLength, unsigned indexBegin, unsigned indexEnd, bool ltr)
 849 : m_font(font)
 850 , m_characters(characters)
 851 , m_stringLength(stringLength)
 852 , m_indexBegin(indexBegin)
 853 , m_indexEnd(indexEnd)
 854 , m_stringLocation(stringLocation)
 855 , m_isLTR(ltr)
 856{
 857 auto runLengthInCodeUnits = m_indexEnd - m_indexBegin;
 858 m_coreTextIndices.reserveInitialCapacity(runLengthInCodeUnits);
 859 unsigned r = m_indexBegin;
 860 while (r < m_indexEnd) {
 861 m_coreTextIndices.uncheckedAppend(r);
 862 UChar32 character;
 863 U16_NEXT(m_characters, r, m_stringLength, character);
 864 }
 865 m_glyphCount = m_coreTextIndices.size();
 866 if (!ltr) {
 867 for (unsigned r = 0, end = m_glyphCount - 1; r < m_glyphCount / 2; ++r, --end)
 868 std::swap(m_coreTextIndices[r], m_coreTextIndices[end]);
 869 }
 870
 871 // Synthesize a run of missing glyphs.
 872 m_glyphs.fill(0, m_glyphCount);
 873 m_baseAdvances.fill(FloatSize(m_font.widthForGlyph(0), 0), m_glyphCount);
 874}
 875
 876
 877ComplexTextController::ComplexTextRun::ComplexTextRun(const Vector<FloatSize>& advances, const Vector<FloatPoint>& origins, const Vector<Glyph>& glyphs, const Vector<unsigned>& stringIndices, FloatSize initialAdvance, const Font& font, const UChar* characters, unsigned stringLocation, unsigned stringLength, unsigned indexBegin, unsigned indexEnd, bool ltr)
 878 : m_baseAdvances(advances)
 879 , m_glyphOrigins(origins)
 880 , m_glyphs(glyphs)
 881 , m_coreTextIndices(stringIndices)
 882 , m_initialAdvance(initialAdvance)
 883 , m_font(font)
 884 , m_characters(characters)
 885 , m_stringLength(stringLength)
 886 , m_indexBegin(indexBegin)
 887 , m_indexEnd(indexEnd)
 888 , m_glyphCount(glyphs.size())
 889 , m_stringLocation(stringLocation)
 890 , m_isLTR(ltr)
 891{
 892}
 893
833894} // namespace WebCore

Source/WebCore/platform/graphics/ComplexTextController.h

@@private:
195195 Vector<unsigned, 16> m_runIndices;
196196 Vector<unsigned, 16> m_glyphCountFromStartToIndex;
197197
 198#if PLATFORM(COCOA)
198199 Vector<RetainPtr<CTLineRef>> m_coreTextLines;
 200#endif
199201
200202 Vector<String> m_stringsFor8BitRuns;
201203

Source/WebCore/platform/graphics/Font.cpp

@@const Font* Font::smallCapsFont(const FontDescription& fontDescription) const
293293}
294294
295295#if PLATFORM(COCOA)
 296
296297const Font& Font::noSynthesizableFeaturesFont() const
297298{
298299 if (!m_derivedFontData)

@@const Font& Font::noSynthesizableFeaturesFont() const
302303 ASSERT(m_derivedFontData->noSynthesizableFeatures != this);
303304 return *m_derivedFontData->noSynthesizableFeatures;
304305}
 306
 307#else
 308
 309const Font& Font::noSynthesizableFeaturesFont() const
 310{
 311 return *this;
 312}
 313
305314#endif
306315
307316const Font* Font::emphasisMarkFont(const FontDescription& fontDescription) const

@@void Font::removeFromSystemFallbackCache()
505514 }
506515}
507516
 517#if !PLATFORM(COCOA)
 518bool Font::variantCapsSupportsCharacterForSynthesis(FontVariantCaps, UChar32) const
 519{
 520 return false;
 521}
 522#endif
 523
508524} // namespace WebCore

Source/WebCore/platform/graphics/FontCascade.cpp

@@GlyphData FontCascade::glyphDataForCharacter(UChar32 c, bool mirror, FontVariant
431431 return m_fonts->glyphDataForCharacter(c, m_fontDescription, variant);
432432}
433433
434 #if !PLATFORM(COCOA)
435 
436 std::unique_ptr<TextLayout, TextLayoutDeleter> FontCascade::createLayout(RenderText&, float, bool) const
437 {
438  return nullptr;
439 }
440 
441 void TextLayoutDeleter::operator()(TextLayout*) const
442 {
443 }
444 
445 float FontCascade::width(TextLayout&, unsigned, unsigned, HashSet<const Font*>*)
446 {
447  ASSERT_NOT_REACHED();
448  return 0;
449 }
450 
451 #endif
452 
453434static const char* fontFamiliesWithInvalidCharWidth[] = {
454435 "American Typewriter",
455436 "Arial Hebrew",

@@int FontCascade::offsetForPositionForSimpleText(const TextRun& run, float x, boo
14681449 return offset;
14691450}
14701451
 1452#if !PLATFORM(COCOA)
 1453// FIXME: Unify this with the macOS and iOS implementation.
 1454const Font* FontCascade::fontForCombiningCharacterSequence(const UChar* characters, size_t length) const
 1455{
 1456 UChar32 baseCharacter;
 1457 size_t baseCharacterLength = 0;
 1458 U16_NEXT(characters, baseCharacterLength, length, baseCharacter);
 1459 GlyphData baseCharacterGlyphData = glyphDataForCharacter(baseCharacter, false, NormalVariant);
 1460
 1461 if (!baseCharacterGlyphData.glyph)
 1462 return nullptr;
 1463 return baseCharacterGlyphData.font;
 1464}
 1465#endif
 1466
 1467void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext& context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, unsigned to) const
 1468{
 1469 GlyphBuffer glyphBuffer;
 1470 float initialAdvance = getGlyphsAndAdvancesForComplexText(run, from, to, glyphBuffer, ForTextEmphasis);
 1471
 1472 if (glyphBuffer.isEmpty())
 1473 return;
 1474
 1475 drawEmphasisMarks(context, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
 1476}
14711477
14721478}

Source/WebCore/platform/graphics/FontCascade.h

@@public:
184184 const Font& primaryFont() const;
185185 const FontRanges& fallbackRangesAt(unsigned) const;
186186 GlyphData glyphDataForCharacter(UChar32, bool mirror, FontVariant = AutoVariant) const;
187 
188 #if PLATFORM(COCOA)
 187
189188 const Font* fontForCombiningCharacterSequence(const UChar*, size_t length) const;
190 #endif
191189
192190 static bool isCJKIdeograph(UChar32);
193191 static bool isCJKIdeographOrSymbol(UChar32);

Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp

@@float FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, unsign
5252 return 0;
5353}
5454
55 void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext& /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, unsigned /* from */, unsigned /* to */) const
56 {
57  notImplemented();
58 }
59 
6055bool FontCascade::canReturnFallbackFontsForComplexText()
6156{
6257 return false;

Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm

@@float FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, unsign
531531 return initialAdvance;
532532}
533533
534 void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext& context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, unsigned to) const
535 {
536  GlyphBuffer glyphBuffer;
537  float initialAdvance = getGlyphsAndAdvancesForComplexText(run, from, to, glyphBuffer, ForTextEmphasis);
538 
539  if (glyphBuffer.isEmpty())
540  return;
541 
542  drawEmphasisMarks(context, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
543 }
544 
545534float FontCascade::floatWidthForComplexText(const TextRun& run, HashSet<const Font*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
546535{
547536 ComplexTextController controller(*this, run, true, fallbackFonts);

@@int FontCascade::offsetForPositionForComplexText(const TextRun& run, float x, bo
560549 return controller.offsetForPosition(x, includePartialGlyphs);
561550}
562551
 552// FIXME: Use this on all ports.
563553const Font* FontCascade::fontForCombiningCharacterSequence(const UChar* characters, size_t length) const
564554{
565555 UChar32 baseCharacter;

Source/WebCore/platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp

 1/*
 2* Copyright (C) 2017 Apple Inc. All rights reserved.
 3*
 4* Redistribution and use in source and binary forms, with or without
 5* modification, are permitted provided that the following conditions
 6* are met:
 7* 1. Redistributions of source code must retain the above copyright
 8* notice, this list of conditions and the following disclaimer.
 9* 2. Redistributions in binary form must reproduce the above copyright
 10* notice, this list of conditions and the following disclaimer in the
 11* documentation and/or other materials provided with the distribution.
 12*
 13* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
 14* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 15* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 16* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 17* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 18* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 19* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 20* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 21* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 22* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 23*/
 24
 25#include "config.h"
 26#include "ComplexTextController.h"
 27
 28namespace WebCore {
 29
 30void ComplexTextController::collectComplexTextRunsForCharacters(const UChar*, unsigned, unsigned, const Font*)
 31{
 32 // FIXME: Implement this.
 33 ASSERT_NOT_REACHED();
 34}
 35
 36}

Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm

2323 */
2424
2525#include "config.h"
26 
2726#include "ComplexTextController.h"
2827
2928#include "CoreTextSPI.h"

@@ComplexTextController::ComplexTextRun::ComplexTextRun(CTRunRef ctRun, const Font
165164 }
166165}
167166
168 // Missing glyphs run constructor. Core Text will not generate a run of missing glyphs, instead falling back on
169 // glyphs from LastResort. We want to use the primary font's missing glyph in order to match the fast text code path.
170 ComplexTextController::ComplexTextRun::ComplexTextRun(const Font& font, const UChar* characters, unsigned stringLocation, unsigned stringLength, unsigned indexBegin, unsigned indexEnd, bool ltr)
171  : m_font(font)
172  , m_characters(characters)
173  , m_stringLength(stringLength)
174  , m_indexBegin(indexBegin)
175  , m_indexEnd(indexEnd)
176  , m_stringLocation(stringLocation)
177  , m_isLTR(ltr)
178 {
179  auto runLengthInCodeUnits = m_indexEnd - m_indexBegin;
180  m_coreTextIndices.reserveInitialCapacity(runLengthInCodeUnits);
181  unsigned r = m_indexBegin;
182  while (r < m_indexEnd) {
183  m_coreTextIndices.uncheckedAppend(r);
184  UChar32 character;
185  U16_NEXT(m_characters, r, m_stringLength, character);
186  }
187  m_glyphCount = m_coreTextIndices.size();
188  if (!ltr) {
189  for (unsigned r = 0, end = m_glyphCount - 1; r < m_glyphCount / 2; ++r, --end)
190  std::swap(m_coreTextIndices[r], m_coreTextIndices[end]);
191  }
192 
193  // Synthesize a run of missing glyphs.
194  m_glyphs.fill(0, m_glyphCount);
195  m_baseAdvances.fill(FloatSize(m_font.widthForGlyph(0), 0), m_glyphCount);
196 }
197 
198 
199 ComplexTextController::ComplexTextRun::ComplexTextRun(const Vector<FloatSize>& advances, const Vector<FloatPoint>& origins, const Vector<Glyph>& glyphs, const Vector<unsigned>& stringIndices, FloatSize initialAdvance, const Font& font, const UChar* characters, unsigned stringLocation, unsigned stringLength, unsigned indexBegin, unsigned indexEnd, bool ltr)
200  : m_baseAdvances(advances)
201  , m_glyphOrigins(origins)
202  , m_glyphs(glyphs)
203  , m_coreTextIndices(stringIndices)
204  , m_initialAdvance(initialAdvance)
205  , m_font(font)
206  , m_characters(characters)
207  , m_stringLength(stringLength)
208  , m_indexBegin(indexBegin)
209  , m_indexEnd(indexEnd)
210  , m_glyphCount(glyphs.size())
211  , m_stringLocation(stringLocation)
212  , m_isLTR(ltr)
213 {
214 }
215 
216167struct ProviderInfo {
217168 const UChar* cp;
218169 unsigned length;

Source/WebCore/platform/graphics/win/ComplexTextControllerDirectWrite.cpp

 1/*
 2* Copyright (C) 2017 Apple Inc. All rights reserved.
 3*
 4* Redistribution and use in source and binary forms, with or without
 5* modification, are permitted provided that the following conditions
 6* are met:
 7* 1. Redistributions of source code must retain the above copyright
 8* notice, this list of conditions and the following disclaimer.
 9* 2. Redistributions in binary form must reproduce the above copyright
 10* notice, this list of conditions and the following disclaimer in the
 11* documentation and/or other materials provided with the distribution.
 12*
 13* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
 14* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 15* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 16* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 17* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 18* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 19* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 20* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 21* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 22* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 23*/
 24
 25#include "config.h"
 26#include "ComplexTextController.h"
 27
 28namespace WebCore {
 29
 30void ComplexTextController::collectComplexTextRunsForCharacters(const UChar*, unsigned, unsigned, const Font*)
 31{
 32 // FIXME: Implement this.
 33 ASSERT_NOT_REACHED();
 34}
 35
 36}

Source/WebCore/platform/graphics/win/FontWin.cpp

@@float FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, unsign
9191 return beforeWidth;
9292}
9393
94 void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext& context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, unsigned to) const
95 {
96  GlyphBuffer glyphBuffer;
97  float initialAdvance = getGlyphsAndAdvancesForComplexText(run, from, to, glyphBuffer, ForTextEmphasis);
98 
99  if (glyphBuffer.isEmpty())
100  return;
101 
102  drawEmphasisMarks(context, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
103 }
104 
10594float FontCascade::floatWidthForComplexText(const TextRun& run, HashSet<const Font*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
10695{
10796 UniscribeController controller(this, run, fallbackFonts);

Tools/ChangeLog

 12017-02-07 Myles C. Maxfield <mmaxfield@apple.com>
 2
 3 [Win] [GTK] [EFL] Compile (but don't use, yet) the platform-independent piece of ComplexTextController
 4 https://bugs.webkit.org/show_bug.cgi?id=167927
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Enable ComplexTextController API tests on the Win and GTK ports.
 9
 10 * TestWebKitAPI/PlatformGTK.cmake:
 11 * TestWebKitAPI/PlatformWin.cmake:
 12
1132017-02-07 Olivier Blin <olivier.blin@softathome.com>
214
315 [webkitdirs] remove unused host_processor variable in determineArchitecture()

Tools/TestWebKitAPI/PlatformGTK.cmake

@@add_executable(TestWebCore
131131 ${test_main_SOURCES}
132132 ${TESTWEBKITAPI_DIR}/TestsController.cpp
133133 ${TESTWEBKITAPI_DIR}/Tests/WebCore/CSSParser.cpp
 134 ${TESTWEBKITAPI_DIR}/Tests/WebCore/ComplexTextController.cpp
134135 ${TESTWEBKITAPI_DIR}/Tests/WebCore/FileSystem.cpp
135136 ${TESTWEBKITAPI_DIR}/Tests/WebCore/GridPosition.cpp
136137 ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp

Tools/TestWebKitAPI/PlatformWin.cmake

@@set(TestWebCoreLib_SOURCES
4646 ${TESTWEBKITAPI_DIR}/TestsController.cpp
4747 ${TESTWEBKITAPI_DIR}/Tests/WebCore/AffineTransform.cpp
4848 ${TESTWEBKITAPI_DIR}/Tests/WebCore/CalculationValue.cpp
 49 ${TESTWEBKITAPI_DIR}/Tests/WebCore/ComplexTextController.cpp
4950 ${TESTWEBKITAPI_DIR}/Tests/WebCore/CSSParser.cpp
5051 ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatRect.cpp
5152 ${TESTWEBKITAPI_DIR}/Tests/WebCore/FloatPoint.cpp

Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp

@@TEST_F(ComplexTextControllerTest, InitialAdvanceWithLeftRunInRTL)
7474 runs.append(WTFMove(run2));
7575 ComplexTextController controller(font, textRun, runs);
7676
77  CGFloat totalWidth = 0;
 77 float totalWidth = 0;
7878 for (size_t i = 1; i < advances.size(); ++i)
7979 totalWidth += advances[i].width();
8080 EXPECT_NEAR(controller.totalWidth(), spaceWidth + totalWidth, 0.0001);

@@TEST_F(ComplexTextControllerTest, InitialAdvanceInRTL)
123123 runs.append(WTFMove(run));
124124 ComplexTextController controller(font, textRun, runs);
125125
126  CGFloat totalWidth = 0;
 126 float totalWidth = 0;
127127 for (size_t i = 1; i < advances.size(); ++i)
128128 totalWidth += advances[i].width();
129129 EXPECT_NEAR(controller.totalWidth(), totalWidth, 0.0001);

@@TEST_F(ComplexTextControllerTest, InitialAdvanceInRTLNoOrigins)
258258 runs.append(WTFMove(run3));
259259 ComplexTextController controller(font, textRun, runs);
260260
261  CGFloat totalWidth = 14.0397830018083 + 12.0 + 43.8119349005425;
 261 float totalWidth = 14.0397830018083 + 12.0 + 43.8119349005425;
262262 EXPECT_NEAR(controller.totalWidth(), totalWidth, 0.0001);
263263 GlyphBuffer glyphBuffer;
264264 EXPECT_NEAR(controller.runWidthSoFar(), 0, 0.0001);

@@TEST_F(ComplexTextControllerTest, LeadingExpansion)
298298 runs.append(WTFMove(run));
299299 ComplexTextController controller(font, textRun, runs);
300300
301  CGFloat totalWidth = 100 + 24;
 301 float totalWidth = 100 + 24;
302302 EXPECT_NEAR(controller.totalWidth(), totalWidth, 0.0001);
303303 GlyphBuffer glyphBuffer;
304304 EXPECT_NEAR(controller.runWidthSoFar(), 0, 0.0001);