ASSERTION FAILED: m_truncation != cFullTruncation in InlineTextBox::clampedOffset()
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Oct 2017 17:13:56 +0000 (17:13 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Oct 2017 17:13:56 +0000 (17:13 +0000)
commit4a60069584f4c3383a3432bd105d73f5169151ce
treeb31568356b38b114dd851791bd2d7617e70d3a5c
parent6f0c4404e653f2666fbb04e1b401ecb1280275f4
ASSERTION FAILED: m_truncation != cFullTruncation in InlineTextBox::clampedOffset()
https://bugs.webkit.org/show_bug.cgi?id=178322

Reviewed by Darin Adler.

Source/WebCore:

It is acceptable for InlineTextBox::clampedOffset() to be called for a fully truncated box,
say a person clicks on the ellipsis in a truncated text run. Restore the behavior prior to
r223259 and return the clamped offset.

Test: fast/text/click-ellipsis-assertion-failure.html

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::clampedOffset const):

LayoutTests:

Add a test to ensure that clicking on the ellipsis in a truncated text run does not
cause an assertion failure in a debug build.

* fast/text/click-ellipsis-assertion-failure-expected.txt: Added.
* fast/text/click-ellipsis-assertion-failure.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@223553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/click-ellipsis-assertion-failure-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/click-ellipsis-assertion-failure.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/InlineTextBox.cpp