RefPtr<Range> selectedRange = focusedFrame->selection()->toNormalizedRange();
- Vector<IntRect> rects, tempRects;
- selectedRange->boundingBoxEx(tempRects, true);
-
- IntRect boundsRect = enclosingIntRect(focusedFrame->selection()->bounds());
- for (size_t i = 0; i < tempRects.size(); i++) {
- if (boundsRect.contains(tempRects[i]))
- rects.append(tempRects[i]);
- else {
- tempRects[i].intersect(boundsRect);
- if (!tempRects[i].isEmpty())
- rects.append(tempRects[i]);
- }
- }
+ Vector<IntRect> rects;
+ selectedRange->boundingBoxEx(rects, true);
unsigned size = rects.size();
if (size > 0) {