Changeset 223553 in webkit


Ignore:
Timestamp:
Oct 17, 2017 10:13:56 AM (7 years ago)
Author:
dbates@webkit.org
Message:

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.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r223552 r223553  
     12017-10-17  Daniel Bates  <dabates@apple.com>
     2
     3        ASSERTION FAILED: m_truncation != cFullTruncation in InlineTextBox::clampedOffset()
     4        https://bugs.webkit.org/show_bug.cgi?id=178322
     5
     6        Reviewed by Darin Adler.
     7
     8        Add a test to ensure that clicking on the ellipsis in a truncated text run does not
     9        cause an assertion failure in a debug build.
     10
     11        * fast/text/click-ellipsis-assertion-failure-expected.txt: Added.
     12        * fast/text/click-ellipsis-assertion-failure.html: Added.
     13
    1142017-10-17  Daniel Bates  <dabates@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r223552 r223553  
     12017-10-17  Daniel Bates  <dabates@apple.com>
     2
     3        ASSERTION FAILED: m_truncation != cFullTruncation in InlineTextBox::clampedOffset()
     4        https://bugs.webkit.org/show_bug.cgi?id=178322
     5
     6        Reviewed by Darin Adler.
     7
     8        It is acceptable for InlineTextBox::clampedOffset() to be called for a fully truncated box,
     9        say a person clicks on the ellipsis in a truncated text run. Restore the behavior prior to
     10        r223259 and return the clamped offset.
     11
     12        Test: fast/text/click-ellipsis-assertion-failure.html
     13
     14        * rendering/InlineTextBox.cpp:
     15        (WebCore::InlineTextBox::clampedOffset const):
     16
    1172017-10-17  Daniel Bates  <dabates@apple.com>
    218
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r223552 r223553  
    592592unsigned InlineTextBox::clampedOffset(unsigned x) const
    593593{
    594     ASSERT(m_truncation != cFullTruncation);
    595594    unsigned offset = std::max(std::min(x, m_start + m_len), m_start) - m_start;
     595    if (m_truncation == cFullTruncation)
     596        return offset;
    596597    if (m_truncation != cNoTruncation)
    597598        offset = std::min<unsigned>(offset, m_truncation);
Note: See TracChangeset for help on using the changeset viewer.