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

Changeset 181869 in webkit


Ignore:
Timestamp:
Mar 23, 2015, 1:52:28 PM (11 years ago)
Author:
enrica@apple.com
Message:

[iOS] WebContent crash attempting to select text with a gesture at RenderObject::absoluteBoundingBoxRect.
https://bugs.webkit.org/show_bug.cgi?id=142913
rdar://problem/16400033

Reviewed by Sam Weinig.

When looking for the best candidate range at the given position,
we should skip nodes that don't have a renderer.
This is a speculative fix.

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::rangeForWebSelectionAtPosition):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r181866 r181869  
     12015-03-23  Enrica Casucci  <enrica@apple.com>
     2
     3        [iOS] WebContent crash attempting to select text with a gesture at RenderObject::absoluteBoundingBoxRect.
     4        https://bugs.webkit.org/show_bug.cgi?id=142913
     5        rdar://problem/16400033
     6
     7        Reviewed by Sam Weinig.
     8
     9        When looking for the best candidate range at the given position,
     10        we should skip nodes that don't have a renderer.
     11        This is a speculative fix.
     12
     13        * WebProcess/WebPage/ios/WebPageIOS.mm:
     14        (WebKit::WebPage::rangeForWebSelectionAtPosition):
     15
    1162015-03-23  Alexey Proskuryakov  <ap@apple.com>
    217
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r181505 r181869  
    836836    Node* bestChoice = currentNode;
    837837    while (currentNode) {
    838         boundingRectInScrollViewCoordinates = currentNode->renderer()->absoluteBoundingBoxRect(true);
    839         boundingRectInScrollViewCoordinates.scale(m_page->pageScaleFactor());
    840         if (boundingRectInScrollViewCoordinates.width() > m_blockSelectionDesiredSize.width() && boundingRectInScrollViewCoordinates.height() > m_blockSelectionDesiredSize.height())
    841             break;
    842         bestChoice = currentNode;
     838        if (currentNode->renderer()) {
     839            boundingRectInScrollViewCoordinates = currentNode->renderer()->absoluteBoundingBoxRect(true);
     840            boundingRectInScrollViewCoordinates.scale(m_page->pageScaleFactor());
     841            if (boundingRectInScrollViewCoordinates.width() > m_blockSelectionDesiredSize.width() && boundingRectInScrollViewCoordinates.height() > m_blockSelectionDesiredSize.height())
     842                break;
     843            bestChoice = currentNode;
     844        }
    843845        currentNode = currentNode->parentElement();
    844846    }
Note: See TracChangeset for help on using the changeset viewer.