Title: [211865] releases/WebKitGTK/webkit-2.14/Source/WebCore
Revision
211865
Author
[email protected]
Date
2017-02-08 03:51:39 -0800 (Wed, 08 Feb 2017)

Log Message

Merge r211040 - [GTK] asserting on unknown locale for hyphenation is wrong
https://bugs.webkit.org/show_bug.cgi?id=167312

Reviewed by Carlos Garcia Campos.

The fact that we hit the assert on a test called 'hyphenation-unknown-locale' is already
a strong indication we should not have it. In addition to that, Carlos Lopez pointed out
a similar assert was removed from the Mac codepaths when the test was introduced.

* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::lastHyphenLocation): early return when a locale that is not available is provided
for hyphenation, instead of asserting.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (211864 => 211865)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog	2017-02-08 11:49:24 UTC (rev 211864)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog	2017-02-08 11:51:39 UTC (rev 211865)
@@ -1,3 +1,18 @@
+2017-01-23  Gustavo Noronha Silva  <[email protected]>
+
+        [GTK] asserting on unknown locale for hyphenation is wrong
+        https://bugs.webkit.org/show_bug.cgi?id=167312
+
+        Reviewed by Carlos Garcia Campos.
+
+        The fact that we hit the assert on a test called 'hyphenation-unknown-locale' is already
+        a strong indication we should not have it. In addition to that, Carlos Lopez pointed out
+        a similar assert was removed from the Mac codepaths when the test was introduced.
+
+        * platform/text/hyphen/HyphenationLibHyphen.cpp:
+        (WebCore::lastHyphenLocation): early return when a locale that is not available is provided
+        for hyphenation, instead of asserting.
+
 2017-02-03  Enrique Ocaña González  <[email protected]>
 
         [GStreamer] Store preloaded media in webkit's cache

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp (211864 => 211865)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp	2017-02-08 11:49:24 UTC (rev 211864)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp	2017-02-08 11:51:39 UTC (rev 211865)
@@ -247,7 +247,11 @@
     char* hyphenArrayData = hyphenArray.data();
 
     String lowercaseLocaleIdentifier = AtomicString(localeIdentifier.string().convertToASCIILowercase());
-    ASSERT(availableLocales().contains(lowercaseLocaleIdentifier));
+
+    // Web content may specify strings for locales which do not exist or that we do not have.
+    if (!availableLocales().contains(lowercaseLocaleIdentifier))
+        return 0;
+
     for (const auto& dictionaryPath : availableLocales().get(lowercaseLocaleIdentifier)) {
         RefPtr<HyphenationDictionary> dictionary = WTF::TinyLRUCachePolicy<AtomicString, RefPtr<HyphenationDictionary>>::cache().get(AtomicString(dictionaryPath));
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to