Title: [288327] trunk/Source/WebCore
Revision
288327
Author
wenson_hs...@apple.com
Date
2022-01-20 15:09:16 -0800 (Thu, 20 Jan 2022)

Log Message

[macOS] Various tests hit debug assertions under `SearchBuffer::search` after system ICU changes
https://bugs.webkit.org/show_bug.cgi?id=235413
rdar://87423185

Reviewed by Darin Adler.

After upgrading the system ICU version to ICU 70, many layout tests that attempt to use TextIterator on macOS
(e.g. tests in `accessibility/mac`) hit debug assertions underneath `WebCore::SearchBuffer::search`; this is
because ICU now emits `U_USING_DEFAULT_WARNING` as the error code when calling `usearch_next()`, instead of
`U_ZERO_ERROR`, like it did in previous versions.

This warning is propagated due to ICU falling back to the root locale (`kRootLocaleName`) when creating an
`icu::BreakIterator`, and appears to be benign. We can address this by relaxing the debug assertion in this
method to just check that the error code indicates success (i.e. "warning, or no error"), rather than strictly
being equal to `U_ZERO_ERROR`.

* editing/TextIterator.cpp:
(WebCore::SearchBuffer::search):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (288326 => 288327)


--- trunk/Source/WebCore/ChangeLog	2022-01-20 22:32:57 UTC (rev 288326)
+++ trunk/Source/WebCore/ChangeLog	2022-01-20 23:09:16 UTC (rev 288327)
@@ -1,3 +1,24 @@
+2022-01-20  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        [macOS] Various tests hit debug assertions under `SearchBuffer::search` after system ICU changes
+        https://bugs.webkit.org/show_bug.cgi?id=235413
+        rdar://87423185
+
+        Reviewed by Darin Adler.
+
+        After upgrading the system ICU version to ICU 70, many layout tests that attempt to use TextIterator on macOS
+        (e.g. tests in `accessibility/mac`) hit debug assertions underneath `WebCore::SearchBuffer::search`; this is
+        because ICU now emits `U_USING_DEFAULT_WARNING` as the error code when calling `usearch_next()`, instead of
+        `U_ZERO_ERROR`, like it did in previous versions.
+
+        This warning is propagated due to ICU falling back to the root locale (`kRootLocaleName`) when creating an
+        `icu::BreakIterator`, and appears to be benign. We can address this by relaxing the debug assertion in this
+        method to just check that the error code indicates success (i.e. "warning, or no error"), rather than strictly
+        being equal to `U_ZERO_ERROR`.
+
+        * editing/TextIterator.cpp:
+        (WebCore::SearchBuffer::search):
+
 2022-01-20  Alan Bujtas  <za...@apple.com>
 
         [LFC][IFC] Add "previous line ends with a line break" flag to PreviousLine

Modified: trunk/Source/WebCore/editing/TextIterator.cpp (288326 => 288327)


--- trunk/Source/WebCore/editing/TextIterator.cpp	2022-01-20 22:32:57 UTC (rev 288326)
+++ trunk/Source/WebCore/editing/TextIterator.cpp	2022-01-20 23:09:16 UTC (rev 288327)
@@ -2193,7 +2193,7 @@
     ASSERT(status == U_ZERO_ERROR);
 
     int matchStart = usearch_next(searcher, &status);
-    ASSERT(status == U_ZERO_ERROR);
+    ASSERT(U_SUCCESS(status));
 
 nextMatch:
     if (!(matchStart >= 0 && static_cast<size_t>(matchStart) < size)) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to