Title: [248285] trunk
Revision
248285
Author
hironori.fu...@sony.com
Date
2019-08-05 19:07:06 -0700 (Mon, 05 Aug 2019)

Log Message

[Win] Specifying huge font-size causes crashing
https://bugs.webkit.org/show_bug.cgi?id=200340

Reviewed by Don Olmstead.

Source/WebCore:

Covered by existing tests.

* platform/graphics/win/FontPlatformDataWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Use GetTextFace to
get font face names instead of GetOutlineTextMetrics which returns
null for huge size fonts.

LayoutTests:

* platform/win/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (248284 => 248285)


--- trunk/LayoutTests/ChangeLog	2019-08-06 02:00:03 UTC (rev 248284)
+++ trunk/LayoutTests/ChangeLog	2019-08-06 02:07:06 UTC (rev 248285)
@@ -1,3 +1,12 @@
+2019-08-05  Fujii Hironori  <hironori.fu...@sony.com>
+
+        [Win] Specifying huge font-size causes crashing
+        https://bugs.webkit.org/show_bug.cgi?id=200340
+
+        Reviewed by Don Olmstead.
+
+        * platform/win/TestExpectations:
+
 2019-08-05  Youenn Fablet  <you...@apple.com>
 
         Support RTCRtpSender.dtmf

Modified: trunk/LayoutTests/platform/win/TestExpectations (248284 => 248285)


--- trunk/LayoutTests/platform/win/TestExpectations	2019-08-06 02:00:03 UTC (rev 248284)
+++ trunk/LayoutTests/platform/win/TestExpectations	2019-08-06 02:07:06 UTC (rev 248285)
@@ -3002,7 +3002,7 @@
 fast/ruby/ruby-expansion-cjk-3.html [ ImageOnlyFailure ]
 fast/ruby/ruby-expansion-cjk-4.html [ ImageOnlyFailure ]
 fast/ruby/ruby-expansion-cjk-5.html [ ImageOnlyFailure ]
-fast/text/combining-mark-paint.html [ ImageOnlyFailure Crash ]
+fast/text/combining-mark-paint.html [ ImageOnlyFailure ]
 fast/text/synthetic-bold-transformed.html [ ImageOnlyFailure ]
 fast/text/trailing-word-detection.html [ Failure ]
 
@@ -3981,7 +3981,6 @@
 webkit.org/b/182694 fast/events/event-function-toString.html [ Crash ]
 webkit.org/b/182694 fast/html/marquee-reparent-check.html [ Crash ]
 webkit.org/b/182694 fast/loader/document-destruction-within-unload.html [ Crash ]
-webkit.org/b/182694 fast/scrolling/adjust-scroll-offset-on-zoom.html [ Crash ]
 webkit.org/b/182694 fast/text/invalid-positionForPoint-offset.html [ Crash ]
 webkit.org/b/182694 http/tests/security/svg-image-with-cached-remote-image.html [ Crash ]
 webkit.org/b/182694 http/tests/security/xssAuditor/iframe-onload-in-svg-tag.html [ Crash ]
@@ -4335,19 +4334,6 @@
 [ Win10 ] fast/forms/number/number-appearance-spinbutton-disabled-readonly.html [ Failure ]
 [ Win10 ] fast/forms/number/number-appearance-spinbutton-layer.html [ Failure ]
 [ Win10 Release ] accessibility/content-changed-notification-causes-crash.html [ Crash ]
-[ Win10 ] fast/block/float/float-append-child-crash.html [ Crash ]
-[ Win10 ] fast/css/font-size-nan.svg [ Crash ]
-[ Win10 ] fast/css/large-font-size-crash.html [ Crash ]
-[ Win10 ] fast/multicol/assert-on-column-count-when-zoomed-in.html [ Crash ]
-[ Win10 ] fast/shapes/shape-outside-floats/shape-outside-negative-line-height-crash.html [ Crash ]
-[ Win10 ] fast/text/hyphenation-unknown-locale.html [ Crash ]
-[ Win10 ] fast/text/international/spaces-combined-in-vertical-text.html [ Crash ]
-[ Win10 ] imported/blink/svg/zoom/large-zoom-crash.html [ Crash ]
-[ Win10 Release ] legacy-animation-engine/accessibility/content-changed-notification-causes-crash.html [ Crash ]
-[ Win10 ] svg/custom/use-invalidate-click-crash.xhtml [ Crash ]
-[ Win10 ] svg/text/font-size-too-large-crash.svg [ Crash ]
-[ Win10 ] svg/text/svg-zoom-large-value.xhtml [ Crash ]
-[ Win10 ] svg/text/text-style-recalc-crash.html [ Crash ]
 [ Win10 ] fast/dom/crash-with-bad-url.html [ Timeout ]
 
 webkit.org/b/196680 printing/page-with-10mm-left-margin.html [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (248284 => 248285)


--- trunk/Source/WebCore/ChangeLog	2019-08-06 02:00:03 UTC (rev 248284)
+++ trunk/Source/WebCore/ChangeLog	2019-08-06 02:07:06 UTC (rev 248285)
@@ -1,3 +1,17 @@
+2019-08-05  Fujii Hironori  <hironori.fu...@sony.com>
+
+        [Win] Specifying huge font-size causes crashing
+        https://bugs.webkit.org/show_bug.cgi?id=200340
+
+        Reviewed by Don Olmstead.
+
+        Covered by existing tests.
+
+        * platform/graphics/win/FontPlatformDataWin.cpp:
+        (WebCore::FontPlatformData::FontPlatformData): Use GetTextFace to
+        get font face names instead of GetOutlineTextMetrics which returns
+        null for huge size fonts.
+
 2019-08-05  Youenn Fablet  <you...@apple.com>
 
         Response constructor doesn't throw on disturbed ReadableStream

Modified: trunk/Source/WebCore/platform/graphics/win/FontPlatformDataWin.cpp (248284 => 248285)


--- trunk/Source/WebCore/platform/graphics/win/FontPlatformDataWin.cpp	2019-08-06 02:00:03 UTC (rev 248284)
+++ trunk/Source/WebCore/platform/graphics/win/FontPlatformDataWin.cpp	2019-08-06 02:07:06 UTC (rev 248285)
@@ -52,21 +52,11 @@
     SaveDC(hdc);
     
     ::SelectObject(hdc, m_font->get());
-    UINT bufferSize = GetOutlineTextMetrics(hdc, 0, NULL);
 
-    ASSERT_WITH_MESSAGE(bufferSize, "Bitmap fonts not supported with CoreGraphics.");
+    wchar_t faceName[LF_FACESIZE];
+    GetTextFace(hdc, LF_FACESIZE, faceName);
+    platformDataInit(m_font->get(), size, hdc, faceName);
 
-    if (bufferSize) {
-        static const constexpr unsigned InitialBufferSize { 256 };
-        Vector<char, InitialBufferSize> buffer(bufferSize);
-        auto* metrics = reinterpret_cast<OUTLINETEXTMETRICW*>(buffer.data());
-
-        GetOutlineTextMetricsW(hdc, bufferSize, metrics);
-        WCHAR* faceName = (WCHAR*)((uintptr_t)metrics + (uintptr_t)metrics->otmpFaceName);
-
-        platformDataInit(m_font->get(), size, hdc, faceName);
-    }
-
     RestoreDC(hdc, -1);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to