Modified: trunk/Source/WebCore/ChangeLog (234447 => 234448)
--- trunk/Source/WebCore/ChangeLog 2018-08-01 03:57:07 UTC (rev 234447)
+++ trunk/Source/WebCore/ChangeLog 2018-08-01 05:11:38 UTC (rev 234448)
@@ -1,3 +1,19 @@
+2018-07-31 Myles C. Maxfield <[email protected]>
+
+ [WIN] Fix tests for text with initial advances
+ https://bugs.webkit.org/show_bug.cgi?id=188099
+
+ Reviewed by Darin Adler.
+
+ Fixup after r234318.
+
+ Tests: fast/text/complex-first-glyph-with-initial-advance.html
+ fast/text/initial-advance-in-intermediate-run-complex.html
+
+ * platform/graphics/ComplexTextController.cpp:
+ * platform/graphics/FontCascade.cpp:
+ (WebCore::FontCascade::drawGlyphBuffer const):
+
2018-07-31 Alex Christensen <[email protected]>
REGRESSION (r231107): MoviStar+ launches to a blank black screen
Modified: trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp (234447 => 234448)
--- trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp 2018-08-01 03:57:07 UTC (rev 234447)
+++ trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp 2018-08-01 05:11:38 UTC (rev 234448)
@@ -43,7 +43,29 @@
namespace WebCore {
+#if PLATFORM(WIN)
+
class TextLayout {
+};
+
+void TextLayoutDeleter::operator()(TextLayout*) const
+{
+}
+
+std::unique_ptr<TextLayout, TextLayoutDeleter> FontCascade::createLayout(RenderText&, float, bool) const
+{
+ return nullptr;
+}
+
+float FontCascade::width(TextLayout&, unsigned, unsigned, HashSet<const Font*>*)
+{
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
+#else
+
+class TextLayout {
WTF_MAKE_FAST_ALLOCATED;
public:
static bool isNeeded(RenderText& text, const FontCascade& font)
@@ -86,39 +108,19 @@
void TextLayoutDeleter::operator()(TextLayout* layout) const
{
-#if !PLATFORM(WIN)
delete layout;
-#else
- ASSERT_UNUSED(layout, !layout);
-#endif
}
std::unique_ptr<TextLayout, TextLayoutDeleter> FontCascade::createLayout(RenderText& text, float xPos, bool collapseWhiteSpace) const
{
-#if !PLATFORM(WIN)
if (!collapseWhiteSpace || !TextLayout::isNeeded(text, *this))
return nullptr;
return std::unique_ptr<TextLayout, TextLayoutDeleter>(new TextLayout(text, *this, xPos));
-#else
- UNUSED_PARAM(text);
- UNUSED_PARAM(xPos);
- UNUSED_PARAM(collapseWhiteSpace);
- return nullptr;
-#endif
}
float FontCascade::width(TextLayout& layout, unsigned from, unsigned len, HashSet<const Font*>* fallbackFonts)
{
-#if !PLATFORM(WIN)
return layout.width(from, len, fallbackFonts);
-#else
- UNUSED_PARAM(layout);
- UNUSED_PARAM(from);
- UNUSED_PARAM(len);
- UNUSED_PARAM(fallbackFonts);
- ASSERT_NOT_REACHED();
- return 0;
-#endif
}
void ComplexTextController::computeExpansionOpportunity()
@@ -885,4 +887,6 @@
{
}
+#endif
+
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (234447 => 234448)
--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2018-08-01 03:57:07 UTC (rev 234447)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2018-08-01 05:11:38 UTC (rev 234448)
@@ -1432,8 +1432,13 @@
{
// Draw each contiguous run of glyphs that use the same font data.
const Font* fontData = glyphBuffer.fontAt(0);
+#if PLATFORM(WIN)
+ FloatPoint startPoint(point.x() + glyphBuffer.initialAdvance().width(), point.y() + glyphBuffer.initialAdvance().height());
+#else
// FIXME: Why do we subtract the initial advance's height but not its width???
+ // We should use the line above from Windows instead.
FloatPoint startPoint(point.x(), point.y() - glyphBuffer.initialAdvance().height());
+#endif
float nextX = startPoint.x() + glyphBuffer.advanceAt(0).width();
float nextY = startPoint.y() + glyphBuffer.advanceAt(0).height();
unsigned lastFrom = 0;
Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp (234447 => 234448)
--- trunk/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp 2018-08-01 03:57:07 UTC (rev 234447)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp 2018-08-01 05:11:38 UTC (rev 234448)
@@ -25,6 +25,8 @@
#include "config.h"
+#if !PLATFORM(WIN)
+
#include <_javascript_Core/InitializeThreading.h>
#include <WebCore/ComplexTextController.h>
#include <WebCore/FontCascade.h>
@@ -365,3 +367,5 @@
}
}
+
+#endif