Title: [172018] trunk/Source/WebCore
Revision
172018
Author
[email protected]
Date
2014-08-04 18:39:24 -0700 (Mon, 04 Aug 2014)

Log Message

Lots of crashes in WebKit1 after r172013.
https://bugs.webkit.org/show_bug.cgi?id=135582
<rdar://problem/17837636>

Reviewed by Enrica Casucci.

* editing/SelectionRectGatherer.cpp:
(WebCore::SelectionRectGatherer::addRect):
(WebCore::SelectionRectGatherer::addGapRects):
Don't try to do local-to-absolute coordinate conversion if we don't have
a repaint container, which happens a lot in WebKit1.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (172017 => 172018)


--- trunk/Source/WebCore/ChangeLog	2014-08-05 01:22:03 UTC (rev 172017)
+++ trunk/Source/WebCore/ChangeLog	2014-08-05 01:39:24 UTC (rev 172018)
@@ -1,3 +1,17 @@
+2014-08-04  Tim Horton  <[email protected]>
+
+        Lots of crashes in WebKit1 after r172013.
+        https://bugs.webkit.org/show_bug.cgi?id=135582
+        <rdar://problem/17837636>
+
+        Reviewed by Enrica Casucci.
+
+        * editing/SelectionRectGatherer.cpp:
+        (WebCore::SelectionRectGatherer::addRect):
+        (WebCore::SelectionRectGatherer::addGapRects):
+        Don't try to do local-to-absolute coordinate conversion if we don't have
+        a repaint container, which happens a lot in WebKit1.
+
 2014-08-04  Alex Christensen  <[email protected]>
 
         Progress towards CMake on Mac.

Modified: trunk/Source/WebCore/editing/SelectionRectGatherer.cpp (172017 => 172018)


--- trunk/Source/WebCore/editing/SelectionRectGatherer.cpp	2014-08-05 01:22:03 UTC (rev 172017)
+++ trunk/Source/WebCore/editing/SelectionRectGatherer.cpp	2014-08-05 01:39:24 UTC (rev 172018)
@@ -43,18 +43,23 @@
 void SelectionRectGatherer::addRect(RenderLayerModelObject *repaintContainer, const LayoutRect& rect)
 {
     if (!rect.isEmpty()) {
-        LayoutRect absoluteRect(repaintContainer->localToAbsoluteQuad(FloatQuad(rect)).boundingBox());
-        m_rects.append(absoluteRect);
+        if (repaintContainer)
+            m_rects.append(LayoutRect(repaintContainer->localToAbsoluteQuad(FloatQuad(rect)).boundingBox()));
+        else
+            m_rects.append(rect);
     }
 }
 
 void SelectionRectGatherer::addGapRects(RenderLayerModelObject *repaintContainer, const GapRects& rects)
 {
-    GapRects absoluteGapRects;
-    absoluteGapRects.uniteLeft(LayoutRect(repaintContainer->localToAbsoluteQuad(FloatQuad(rects.left())).boundingBox()));
-    absoluteGapRects.uniteCenter(LayoutRect(repaintContainer->localToAbsoluteQuad(FloatQuad(rects.center())).boundingBox()));
-    absoluteGapRects.uniteRight(LayoutRect(repaintContainer->localToAbsoluteQuad(FloatQuad(rects.right())).boundingBox()));
-    m_gapRects.append(absoluteGapRects);
+    if (repaintContainer) {
+        GapRects absoluteGapRects;
+        absoluteGapRects.uniteLeft(LayoutRect(repaintContainer->localToAbsoluteQuad(FloatQuad(rects.left())).boundingBox()));
+        absoluteGapRects.uniteCenter(LayoutRect(repaintContainer->localToAbsoluteQuad(FloatQuad(rects.center())).boundingBox()));
+        absoluteGapRects.uniteRight(LayoutRect(repaintContainer->localToAbsoluteQuad(FloatQuad(rects.right())).boundingBox()));
+        m_gapRects.append(absoluteGapRects);
+    } else
+        m_gapRects.append(rects);
 }
 
 SelectionRectGatherer::Notifier::Notifier(SelectionRectGatherer& gatherer)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to