<rdar://problem/7609268> REGRESSION (r50301): Problem selecting text in a Devanagari website
https://bugs.webkit.org/show_bug.cgi?id=34865

Reviewed by Simon Fraser.

WebCore: 

Test: fast/text/glyph-reordering.html

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
(WebCore::ComplexTextController::ComplexTextRun::setIsNonMonotonic): Added. Sets m_isMonotonic
and populates m_glyphEndOffsets with the end offsets of each glyph’s corresponding character range.
(WebCore::ComplexTextController::advance): For non-monotonic runs, use endOffsetAt() to get
glyphs’ end offsets.
(WebCore::ComplexTextController::adjustGlyphsAndAdvances): Check for monotonicity and call
setIsNonMonotonic() if needed.
* platform/graphics/mac/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::lastIndexAt): Added this getter.
(WebCore::ComplexTextController::ComplexTextRun::isMonotonic): Ditto.
* platform/graphics/mac/ComplexTextControllerATSUI.cpp:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Initialize m_isMonotonic.
* platform/graphics/mac/ComplexTextControllerCoreText.cpp:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Ditto.

LayoutTests: 

* fast/text/glyph-reordering-expected.txt: Added.
* fast/text/glyph-reordering.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
8 files changed