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)
commitea32d09bfaf89e3374fbe22807c19a656c22f1b1
treeb6891b4d196e94b64dd3858ccd46ed43356f1663
parent89791adfce062c5d242973142e30f2ad57baa5a9
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: http://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]