Changeset 254323 in webkit
- Timestamp:
- Jan 9, 2020 7:50:58 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r254322 r254323 1 2020-01-09 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [Win] Use ComplexTextController instead of UniscribeController 4 https://bugs.webkit.org/show_bug.cgi?id=204884 5 6 Reviewed by Brent Fulgham. 7 8 * platform/win/TestExpectations: 9 * platform/win/fast/text/justify-ideograph-complex-expected.txt: Rebaselined. 10 * platform/wincairo/TestExpectations: 11 1 12 2020-01-09 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/LayoutTests/platform/win/TestExpectations
r254127 r254323 2965 2965 2966 2966 webkit.org/b/152009 fast/canvas/canvas-too-large-to-draw.html [ Skip ] 2967 2968 fast/text/arabic-zwj-and-zwnj.html [ ImageOnlyFailure ] 2967 2969 2968 2970 ################################################################################ … … 3427 3429 fast/text/emoji-single-parent-family-2.html [ ImageOnlyFailure ] 3428 3430 fast/text/emoji-single-parent-family.html [ ImageOnlyFailure ] 3431 fast/text/emoji-with-joiner.html [ Failure ] 3429 3432 http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed-ref-test.html [ ImageOnlyFailure ] 3430 3433 mathml/presentation/non-bmp-operators-stretching.html [ ImageOnlyFailure ] … … 4508 4511 webkit.org/b/205273 imported/blink/fast/sub-pixel/negative-composited-offset.html [ Pass ImageOnlyFailure ] 4509 4512 4513 webkit.org/b/205487 fast/text/selection-in-initial-advance-region.html [ Failure ] 4514 webkit.org/b/205485 fast/text/stale-TextLayout-from-first-line.html [ ImageOnlyFailure ] 4515 4510 4516 webkit.org/b/205855 http/wpt/css/css-highlight-api/highlight-text-across-elements.html [ ImageOnlyFailure ] 4511 4517 webkit.org/b/205855 http/wpt/css/css-highlight-api/highlight-text-cascade.html [ ImageOnlyFailure ] -
trunk/LayoutTests/platform/win/fast/text/justify-ideograph-complex-expected.txt
r149090 r254323 17 17 RenderBlock {P} at (0,129) size 550x45 18 18 RenderText {#text} at (0,0) size 550x45 19 text run at (0,0) width 550: "EA Mobile \x{7684} Worldwide Studios \x{526F}\x{7E3D}\x{88C1} Travis Boatman \x{6307}\x{51FA}\x{FF1A}\x{300C}App Store \x{4E0D}\x{50C5}\x{5FB9}\x{5E95}\x{6539}\x{8B8A}\x{4E86}\x{884C}\x{52D5}\x{904A} \x{6232}"20 text run at (0,15) width 550: "\x{ 7522}\x{696D}\x{7684}\x{751F}\x{614B}\x{FF0C}\x{800C}\x{4E14}\x{9084}\x{5728}\x{6301}\x{7E8C}\x{6F14}\x{9032}\x{3002}\x{6709}\x{4E86}\x{5168}\x{7403} 5 \x{5343}\x{591A}\x{842C}\x{7684} iPhone \x{548C} iPod touch \x{5BA2}\x{6236}\x{70BA}\x{57FA}\x{790E}\x{FF0C}App Store"19 text run at (0,0) width 550: "EA Mobile \x{7684} Worldwide Studios \x{526F}\x{7E3D}\x{88C1} Travis Boatman \x{6307}\x{51FA}\x{FF1A}\x{300C}App Store \x{4E0D}\x{50C5}\x{5FB9}\x{5E95}\x{6539}\x{8B8A}\x{4E86}\x{884C}\x{52D5}\x{904A}" 20 text run at (0,15) width 550: "\x{6232}\x{7522}\x{696D}\x{7684}\x{751F}\x{614B}\x{FF0C}\x{800C}\x{4E14}\x{9084}\x{5728}\x{6301}\x{7E8C}\x{6F14}\x{9032}\x{3002}\x{6709}\x{4E86}\x{5168}\x{7403} 5 \x{5343}\x{591A}\x{842C}\x{7684} iPhone \x{548C} iPod touch \x{5BA2}\x{6236}\x{70BA}\x{57FA}\x{790E}\x{FF0C}App Store" 21 21 text run at (0,30) width 301: "\x{8B93}\x{6211}\x{5011}\x{80FD}\x{5920}\x{958B}\x{767C}\x{53D7}\x{5230}\x{5EE3}\x{5927}\x{7684}\x{5BA2}\x{6236}\x{559C}\x{611B}\x{7684}\x{9AD8}\x{54C1}\x{8CEA} EA \x{904A}\x{6232}\x{3002}\x{300D}" 22 22 RenderBlock {P} at (0,186) size 550x45 -
trunk/LayoutTests/platform/wincairo/TestExpectations
r254190 r254323 830 830 imported/blink/fast/dom/Window/open-window-features-fuzz.html [ Pass Timeout ] 831 831 832 webkit.org/b/205487 fast/text/selection-in-initial-advance-region.html [ Failure ] 833 webkit.org/b/205485 fast/text/stale-TextLayout-from-first-line.html [ ImageOnlyFailure ] 834 832 835 #////////////////////////////////////////////////////////////////////////////////////////// 833 836 # http … … 1120 1123 1121 1124 webkit.org/b/117322 fast/css/text-indent-first-line-006.html [ ImageOnlyFailure ] 1122 webkit.org/b/117322 fast/css/word-spacing-characters-complex-text.html [ ImageOnlyFailure ]1123 1125 fast/css/getComputedStyle/getComputedStyle-outline-shorthand.html [ Pass Timeout ] 1124 1126 webkit.org/b/136484 fast/css-generated-content/initial-letter-basic.html [ Pass Failure ] … … 1720 1722 fast/text/ellipsis-text-rtl.html [ ImageOnlyFailure ] 1721 1723 fast/text/emoji-overlap.html [ ImageOnlyFailure ] 1722 fast/text/emoji-single-parent-family-2.html [ ImageOnlyFailure ]1723 fast/text/emoji-single-parent-family.html [ ImageOnlyFailure ]1724 1724 fast/text/emoji-variation-selector.html [ ImageOnlyFailure ] 1725 1725 fast/text/emoji-with-joiner.html [ Failure ] … … 1728 1728 fast/text/fallback-language-han-2.html [ ImageOnlyFailure ] 1729 1729 fast/text/fallback-traits-fixup.html [ Failure ] 1730 fast/text/fitzpatrick-combination.html [ ImageOnlyFailure ]1731 1730 fast/text/font-cursive-italic-cjk.html [ ImageOnlyFailure ] 1732 1731 fast/text/font-kerning.html [ ImageOnlyFailure ] … … 1758 1757 fast/text/justify-ideograph-vertical.html [ Failure ] 1759 1758 fast/text/justify-nbsp.html [ Failure ] 1760 fast/text/kerning-with-TextLayout.html [ ImageOnlyFailure ]1761 1759 fast/text/khmer-lao-font.html [ Failure ] 1762 1760 fast/text/line-break-between-text-nodes-latin1.html [ ImageOnlyFailure ] … … 1786 1784 fast/text/soft-hyphen-min-preferred-width.html [ ImageOnlyFailure ] 1787 1785 fast/text/space-width.html [ ImageOnlyFailure ] 1788 fast/text/stale-TextLayout-from-first-line.html [ ImageOnlyFailure ]1789 1786 fast/text/svg-font-face-with-kerning.html [ Failure ] 1790 1787 fast/text/synthetic-bold-transformed.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r254322 r254323 1 2020-01-09 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [Win] Use ComplexTextController instead of UniscribeController 4 https://bugs.webkit.org/show_bug.cgi?id=204884 5 6 Reviewed by Brent Fulgham. 7 8 UniscribeController doesn't support surrogate pairs and has 9 rendering glitches of partially selected a combining character. 10 11 Remove UniscribeController, and use ComplexTextController by 12 implementing `collectComplexTextRunsForCharacters` with Uniscribe. 13 14 Covered by existing tests. 15 16 * PlatformWin.cmake: 17 * platform/graphics/ComplexTextController.cpp: 18 (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Deleted. 19 * platform/graphics/FontCascade.cpp: 20 (WebCore::FontCascade::widthOfTextRange const): 21 (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): 22 (WebCore::FontCascade::drawGlyphBuffer const): 23 (WebCore::FontCascade::floatWidthForComplexText const): 24 (WebCore::FontCascade::adjustSelectionRectForComplexText const): 25 (WebCore::FontCascade::offsetForPositionForComplexText const): 26 * platform/graphics/win/ComplexTextControllerUniscribe.cpp: Added. 27 (WebCore::shapeByUniscribe): 28 (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): 29 * platform/graphics/win/FontCGWin.cpp: 30 * platform/graphics/win/FontCascadeDirect2D.cpp: 31 * platform/graphics/win/FontWin.cpp: 32 (WebCore::FontCascade::adjustSelectionRectForComplexText const): Deleted. 33 (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Deleted. 34 (WebCore::FontCascade::floatWidthForComplexText const): Deleted. 35 (WebCore::FontCascade::offsetForPositionForComplexText const): Deleted. 36 * platform/graphics/win/UniscribeController.cpp: Removed. 37 * platform/graphics/win/UniscribeController.h: Removed. 38 1 39 2020-01-09 Chris Dumez <cdumez@apple.com> 2 40 -
trunk/Source/WebCore/PlatformWin.cmake
r254064 r254323 51 51 platform/graphics/win/ColorDirect2D.cpp 52 52 platform/graphics/win/ComplexTextControllerDirectWrite.cpp 53 platform/graphics/win/ComplexTextControllerUniscribe.cpp 53 54 platform/graphics/win/DIBPixelData.cpp 54 55 platform/graphics/win/FloatPointDirect2D.cpp … … 69 70 platform/graphics/win/TransformationMatrixDirect2D.cpp 70 71 platform/graphics/win/TransformationMatrixWin.cpp 71 platform/graphics/win/UniscribeController.cpp72 72 73 73 platform/network/win/DownloadBundleWin.cpp -
trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp
r254114 r254323 43 43 44 44 namespace WebCore { 45 46 #if PLATFORM(WIN) && !USE(DIRECT2D)47 48 class TextLayout {49 };50 51 void TextLayoutDeleter::operator()(TextLayout*) const52 {53 }54 55 std::unique_ptr<TextLayout, TextLayoutDeleter> FontCascade::createLayout(RenderText&, float, bool) const56 {57 return nullptr;58 }59 60 float FontCascade::width(TextLayout&, unsigned, unsigned, HashSet<const Font*>*)61 {62 ASSERT_NOT_REACHED();63 return 0;64 }65 66 void ComplexTextController::collectComplexTextRunsForCharacters(const UChar*, unsigned, unsigned, const Font*)67 {68 ASSERT_NOT_REACHED();69 }70 71 #else72 45 73 46 class TextLayout { … … 907 880 } 908 881 909 #endif910 911 882 } // namespace WebCore -
trunk/Source/WebCore/platform/graphics/FontCascade.cpp
r253916 r254323 42 42 #include <wtf/text/StringBuilder.h> 43 43 44 #if PLATFORM(WIN) && !USE(DIRECT2D)45 #include "UniscribeController.h"46 #endif47 48 44 namespace WebCore { 49 45 … … 351 347 auto codePathToUse = codePath(run); 352 348 if (codePathToUse == Complex) { 353 #if PLATFORM(WIN) && !USE(DIRECT2D)354 UniscribeController it(this, run);355 it.advance(from);356 offsetBeforeRange = it.runWidthSoFar();357 it.advance(to);358 offsetAfterRange = it.runWidthSoFar();359 it.advance(to);360 totalWidth = it.runWidthSoFar();361 #else362 349 ComplexTextController complexIterator(*this, run, false, fallbackFonts); 363 350 complexIterator.advance(from, nullptr, IncludePartialGlyphs, fallbackFonts); … … 367 354 complexIterator.advance(run.length(), nullptr, IncludePartialGlyphs, fallbackFonts); 368 355 totalWidth = complexIterator.runWidthSoFar(); 369 #endif370 356 } else { 371 357 WidthIterator simpleIterator(this, run, fallbackFonts); … … 1398 1384 } 1399 1385 1400 #if !PLATFORM(WIN) || USE(DIRECT2D)1401 1386 float FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, unsigned from, unsigned to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const 1402 1387 { … … 1428 1413 return initialAdvance; 1429 1414 } 1430 #endif1431 1415 1432 1416 void FontCascade::drawEmphasisMarksForSimpleText(GraphicsContext& context, const TextRun& run, const AtomString& mark, const FloatPoint& point, unsigned from, unsigned to) const … … 1453 1437 // Draw each contiguous run of glyphs that use the same font data. 1454 1438 const Font* fontData = glyphBuffer.fontAt(0); 1455 #if PLATFORM(WIN)1456 FloatPoint startPoint(point.x() + glyphBuffer.initialAdvance().width(), point.y() + glyphBuffer.initialAdvance().height());1457 #else1458 // FIXME: Why do we subtract the initial advance's height but not its width???1459 // We should use the line above from Windows instead.1460 1439 FloatPoint startPoint(point.x(), point.y() - glyphBuffer.initialAdvance().height()); 1461 #endif1462 1440 float nextX = startPoint.x() + glyphBuffer.advanceAt(0).width(); 1463 1441 float nextY = startPoint.y() + glyphBuffer.advanceAt(0).height(); … … 1546 1524 } 1547 1525 1548 #if !PLATFORM(WIN) || USE(DIRECT2D)1549 1526 float FontCascade::floatWidthForComplexText(const TextRun& run, HashSet<const Font*>* fallbackFonts, GlyphOverflow* glyphOverflow) const 1550 1527 { … … 1558 1535 return controller.totalWidth(); 1559 1536 } 1560 #endif1561 1537 1562 1538 void FontCascade::adjustSelectionRectForSimpleText(const TextRun& run, LayoutRect& selectionRect, unsigned from, unsigned to) const … … 1579 1555 } 1580 1556 1581 #if !PLATFORM(WIN) || USE(DIRECT2D)1582 1557 void FontCascade::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, unsigned from, unsigned to) const 1583 1558 { … … 1594 1569 selectionRect.setWidth(LayoutUnit::fromFloatCeil(afterWidth - beforeWidth)); 1595 1570 } 1596 #endif1597 1571 1598 1572 int FontCascade::offsetForPositionForSimpleText(const TextRun& run, float x, bool includePartialGlyphs) const … … 1639 1613 } 1640 1614 1641 #if !PLATFORM(WIN) || USE(DIRECT2D)1642 1615 int FontCascade::offsetForPositionForComplexText(const TextRun& run, float x, bool includePartialGlyphs) const 1643 1616 { … … 1645 1618 return controller.offsetForPosition(x, includePartialGlyphs); 1646 1619 } 1647 #endif1648 1620 1649 1621 #if !PLATFORM(COCOA) && !USE(HARFBUZZ) -
trunk/Source/WebCore/platform/graphics/win/FontCGWin.cpp
r238253 r254323 35 35 #include "GraphicsContext.h" 36 36 #include "IntRect.h" 37 #include "UniscribeController.h"38 37 #include "WebCoreTextRenderer.h" 39 38 #include <pal/spi/cg/CoreGraphicsSPI.h> -
trunk/Source/WebCore/platform/graphics/win/FontCascadeDirect2D.cpp
r248748 r254323 38 38 #include "IntRect.h" 39 39 #include "PlatformContextDirect2D.h" 40 #include "UniscribeController.h"41 40 #include "WebCoreTextRenderer.h" 42 41 #include <d2d1.h> -
trunk/Source/WebCore/platform/graphics/win/FontWin.cpp
r251900 r254323 36 36 #include <wtf/MathExtras.h> 37 37 38 #if !USE(DIRECT2D)39 #include "UniscribeController.h"40 #endif41 42 38 namespace WebCore { 43 39 … … 52 48 } 53 49 54 #if !USE(DIRECT2D)55 56 void FontCascade::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, unsigned from, unsigned to) const57 {58 UniscribeController it(this, run);59 it.advance(from);60 float beforeWidth = it.runWidthSoFar();61 it.advance(to);62 float afterWidth = it.runWidthSoFar();63 64 if (run.rtl()) {65 it.advance(run.length());66 selectionRect.move(it.runWidthSoFar() - afterWidth, 0);67 } else68 selectionRect.move(beforeWidth, 0);69 selectionRect.setWidth(afterWidth - beforeWidth);70 50 } 71 72 float FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, unsigned from, unsigned to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const73 {74 if (forTextEmphasis) {75 // FIXME: Add forTextEmphasis paremeter to UniscribeController and use it.76 LOG_ERROR("Not implemented for text emphasis.");77 return 0;78 }79 80 UniscribeController controller(this, run);81 controller.advance(from);82 float beforeWidth = controller.runWidthSoFar();83 controller.advance(to, &glyphBuffer);84 85 if (glyphBuffer.isEmpty())86 return 0;87 88 float afterWidth = controller.runWidthSoFar();89 90 if (run.rtl()) {91 controller.advance(run.length());92 return controller.runWidthSoFar() - afterWidth;93 }94 return beforeWidth;95 }96 97 float FontCascade::floatWidthForComplexText(const TextRun& run, HashSet<const Font*>* fallbackFonts, GlyphOverflow* glyphOverflow) const98 {99 UniscribeController controller(this, run, fallbackFonts);100 controller.advance(run.length());101 if (glyphOverflow) {102 glyphOverflow->top = std::max<int>(glyphOverflow->top, ceilf(-controller.minGlyphBoundingBoxY()) - (glyphOverflow->computeBounds ? 0 : fontMetrics().ascent()));103 glyphOverflow->bottom = std::max<int>(glyphOverflow->bottom, ceilf(controller.maxGlyphBoundingBoxY()) - (glyphOverflow->computeBounds ? 0 : fontMetrics().descent()));104 glyphOverflow->left = std::max<int>(0, ceilf(-controller.minGlyphBoundingBoxX()));105 glyphOverflow->right = std::max<int>(0, ceilf(controller.maxGlyphBoundingBoxX() - controller.runWidthSoFar()));106 }107 return controller.runWidthSoFar();108 }109 110 int FontCascade::offsetForPositionForComplexText(const TextRun& run, float xFloat, bool includePartialGlyphs) const111 {112 // FIXME: This truncation is not a problem for HTML, but only affects SVG, which passes floating-point numbers113 // to FontCascade::offsetForPosition(). Bug http://webkit.org/b/40673 tracks fixing this problem.114 int x = static_cast<int>(xFloat);115 116 UniscribeController controller(this, run);117 return controller.offsetForPosition(x, includePartialGlyphs);118 }119 120 #endif121 122 } -
trunk/Tools/ChangeLog
r254318 r254323 1 2020-01-09 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [Win] Use ComplexTextController instead of UniscribeController 4 https://bugs.webkit.org/show_bug.cgi?id=204884 5 6 Reviewed by Brent Fulgham. 7 8 * TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp: Enabled these tests for PLATFORM(WIN). 9 1 10 2020-01-09 David Kilzer <ddkilzer@apple.com> 2 11 -
trunk/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp
r234808 r254323 26 26 #include "config.h" 27 27 28 #if !PLATFORM(WIN)29 30 28 #include <JavaScriptCore/InitializeThreading.h> 31 29 #include <WebCore/ComplexTextController.h> … … 368 366 369 367 } 370 371 #endif
Note: See TracChangeset
for help on using the changeset viewer.