Make line breaking obey the -webkit-locale property
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2011 18:02:45 +0000 (18:02 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2011 18:02:45 +0000 (18:02 +0000)
commitdf9281dc20021aac660b0663de1c81dbbaf58f02
treec99e34fc2401e0142458aa893a29e121653701d4
parent3941d524cb91694aefb98c59cc66bee274402ce9
Make line breaking obey the -webkit-locale property
https://bugs.webkit.org/show_bug.cgi?id=63209

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Test: platform/mac/fast/text/line-break-locale.html

* platform/text/TextBreakIterator.h:
(WebCore::LazyLineBreakIterator::LazyLineBreakIterator): Take an optional locale identifier and
initialize the m_locale member.
(WebCore::LazyLineBreakIterator::get): Pass the locale to acquireLineBreakIterator().
(WebCore::LazyLineBreakIterator::reset): Pass the locale to releaseLineBreakIterator() and update
the m_locale member.
* platform/text/TextBreakIteratorICU.cpp:
(WebCore::LineBreakIteratorPool::sharedPool): Return a shared instance.
(WebCore::LineBreakIteratorPool::take): Returns a text iterator for the given locale, either a newly-
created one, or an existing one from the pool.
(WebCore::LineBreakIteratorPool::put): Puts an iterator back into the pool, removing the least-recently used
one if needed.
(WebCore::LineBreakIteratorPool::LineBreakIteratorPool):
(WebCore::acquireLineBreakIterator): Changed to take an optional local identifier, and to use the pool.
(WebCore::releaseLineBreakIterator): Changed to use the pool.
* platform/text/brew/TextBreakIteratorBrew.cpp:
(WebCore::acquireLineBreakIterator): Updated for new parameter.
* platform/text/gtk/TextBreakIteratorGtk.cpp:
(WebCore::acquireLineBreakIterator): Ditto.
* platform/text/qt/TextBreakIteratorQt.cpp:
(WebCore::acquireLineBreakIterator): Ditto.
* platform/text/wince/TextBreakIteratorWinCE.cpp:
(WebCore::acquireLineBreakIterator): Ditto.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::LineBreaker::nextLineBreak): Use the locale from the style for the line break
iterator.
* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths): Ditto.

LayoutTests:

* platform/mac/fast/text/line-break-locale.html: Added.
* platform/mac/platform/mac/fast/text/line-break-locale-expected.png: Added.
* platform/mac/platform/mac/fast/text/line-break-locale-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@89592 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/fast/text/line-break-locale.html [new file with mode: 0644]
LayoutTests/platform/mac/platform/mac/fast/text/line-break-locale-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/platform/mac/fast/text/line-break-locale-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/text/TextBreakIterator.h
Source/WebCore/platform/text/TextBreakIteratorICU.cpp
Source/WebCore/platform/text/brew/TextBreakIteratorBrew.cpp
Source/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp
Source/WebCore/platform/text/qt/TextBreakIteratorQt.cpp
Source/WebCore/platform/text/wince/TextBreakIteratorWinCE.cpp
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderText.cpp