⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243844 in webkit


Ignore:
Timestamp:
Apr 3, 2019, 7:01:07 PM (7 years ago)
Author:
rniwa@webkit.org
Message:

Nullptr crash in InlineTextBox::selectionState via TextIndicator::createWithRange
https://bugs.webkit.org/show_bug.cgi?id=196579

Reviewed by Simon Fraser.

Avoid crashing accessing the unengated optional's value in relese builds for now.

Unfortunately, fixing the underlying cause of the selection states of RenderView & RenderObject
getting out out of sync would require a significant re-architecturing of the whole selection
repainting / state managing mechanism.

  • rendering/SelectionRangeData.h:

(WebCore::SelectionRangeData::startPosition const):
(WebCore::SelectionRangeData::endPosition const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r243841 r243844  
     12019-04-03  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Nullptr crash in InlineTextBox::selectionState via TextIndicator::createWithRange
     4        https://bugs.webkit.org/show_bug.cgi?id=196579
     5
     6        Reviewed by Simon Fraser.
     7
     8        Avoid crashing accessing the unengated optional's value in relese builds for now.
     9
     10        Unfortunately, fixing the underlying cause of the selection states of RenderView & RenderObject
     11        getting out out of sync would require a significant re-architecturing of the whole selection
     12        repainting / state managing mechanism.
     13
     14        * rendering/SelectionRangeData.h:
     15        (WebCore::SelectionRangeData::startPosition const):
     16        (WebCore::SelectionRangeData::endPosition const):
     17
    1182019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
    219
  • trunk/Source/WebCore/rendering/SelectionRangeData.h

    r239427 r243844  
    7979    RenderObject* start() const { return m_selectionContext.start(); }
    8080    RenderObject* end() const { return m_selectionContext.end(); }
    81     unsigned startPosition() const { ASSERT(m_selectionContext.startPosition()); return m_selectionContext.startPosition().value(); }
    82     unsigned endPosition() const { ASSERT(m_selectionContext.endPosition()); return m_selectionContext.endPosition().value(); }
     81
     82    unsigned startPosition() const { ASSERT(m_selectionContext.startPosition()); return m_selectionContext.startPosition().valueOr(0); }
     83    unsigned endPosition() const { ASSERT(m_selectionContext.endPosition()); return m_selectionContext.endPosition().valueOr(0); }
    8384
    8485    void clear();
Note: See TracChangeset for help on using the changeset viewer.