void visibleTextQuads(const VisibleSelection& selection, Vector<FloatQuad>& quads) { if (!selection.isRange()) return; ASSERT(selection.firstRange()); visibleTextQuads(*(selection.firstRange()), quads, true /* useSelectionHeight */); }
void visibleTextQuads(const VisibleSelection& selection, Vector<FloatQuad>& quads) { if (!selection.isRange()) return; // Make sure that both start and end have valid nodes associated otherwise // this can crash. See PR 220628. if (!selection.start().anchorNode() || !selection.end().anchorNode()) return; visibleTextQuads(*(selection.firstRange()), quads, true /* useSelectionHeight */); }
IntRect transformedBoundingBoxForRange(const Range& range) { // Based on Range::boundingBox, which does not handle transforms, and // RenderObject::absoluteBoundingBoxRect, which does. IntRect result; Vector<FloatQuad> quads; visibleTextQuads(range, quads); const size_t n = quads.size(); for (size_t i = 0; i < n; ++i) result.unite(quads[i].enclosingBoundingBox()); return result; }