+2014-08-04 Tim Horton <timothy_horton@apple.com>
+
+ 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 <achristensen@webkit.org>
Progress towards CMake on Mac.
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)