REGRESSION (r215784): The title of right-to-left pages are empty
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Sep 2017 16:34:23 +0000 (16:34 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Sep 2017 16:34:23 +0000 (16:34 +0000)
commit307979c65e6e4a630b48aaeb374196b09d2549db
treeb6891b4d196e94b64dd3858ccd46ed43356f1663
parent9c9a5bb3329ddccc11ed64b5bb64c2952d041aa9
REGRESSION (r215784): The title of right-to-left pages are empty
https://bugs.webkit.org/show_bug.cgi?id=176746
<rdar://problem/34211419>

Reviewed by Brent Fulgham.

Source/WebCore:

Left truncate a long right-to-left title.

Right-to-left text represents the visual ordering of text. Internally WebKit stores
right-to-left text identically to left-to-right text in memory. So, we can use the
same string operation to truncate right-to-left text as we do to truncate left-to-right
text.

* platform/text/StringWithDirection.h:
(WebCore::truncateFromEnd):

Tools:

Add unit test to ensure we do not regress StringWithDirection.truncateFromEnd().

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/StringWithDirection.cpp: Added.
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/text/StringWithDirection.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebCore/StringWithDirection.cpp [new file with mode: 0644]