Placing video in fullscreen caused WebKit crash at WebCore::Range::textQuads
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Jul 2015 22:16:16 +0000 (22:16 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Jul 2015 22:16:16 +0000 (22:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147166
<rdar://problem/21928558>

Reviewed by Simon Fraser.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::getClippedVisibleTextRectangles):
Check the Range, as always.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187128 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/editing/FrameSelection.cpp

index b0c1632..e5ccde3 100644 (file)
@@ -1,3 +1,15 @@
+2015-07-21  Tim Horton  <timothy_horton@apple.com>
+
+        Placing video in fullscreen caused WebKit crash at WebCore::Range::textQuads
+        https://bugs.webkit.org/show_bug.cgi?id=147166
+        <rdar://problem/21928558>
+
+        Reviewed by Simon Fraser.
+
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::getClippedVisibleTextRectangles):
+        Check the Range, as always.
+
 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
 
         Safari mis-applies "animation-fill-mode: forwards" when using fractional iteration count
index 3ad84d7..de401c5 100644 (file)
@@ -2081,10 +2081,14 @@ void FrameSelection::getClippedVisibleTextRectangles(Vector<FloatRect>& rectangl
     if (!root)
         return;
 
+    RefPtr<Range> range = toNormalizedRange();
+    if (!range)
+        return;
+
     FloatRect visibleContentRect = m_frame->view()->visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
 
     Vector<FloatQuad> quads;
-    toNormalizedRange()->textQuads(quads, textRectHeight == TextRectangleHeight::SelectionHeight);
+    range->textQuads(quads, textRectHeight == TextRectangleHeight::SelectionHeight);
 
     size_t size = quads.size();
     for (size_t i = 0; i < size; ++i) {