Bug 1314080 Part 2: Expand GetPartialTextRect with a new text collecting parameter. r?smaug
MozReview-Commit-ID: 6eEDFFwKh0c
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -2893,16 +2893,17 @@ GetTextFrameForContent(nsIContent* aCont
if (frame && frame->GetType() == nsGkAtoms::textFrame) {
return static_cast<nsTextFrame*>(frame);
}
}
return nullptr;
}
static nsresult GetPartialTextRect(nsLayoutUtils::RectCallback* aCallback,
+ mozilla::dom::DOMStringList* aTextList,
nsIContent* aContent, int32_t aStartOffset,
int32_t aEndOffset, bool aClampToEdge,
bool aFlushLayout)
{
nsTextFrame* textFrame = GetTextFrameForContent(aContent, aFlushLayout);
if (textFrame) {
nsIFrame* relativeTo = nsLayoutUtils::GetContainingBlockForClientRect(textFrame);
for (nsTextFrame* f = textFrame; f; f = static_cast<nsTextFrame*>(f->GetNextContinuation())) {
@@ -2989,21 +2990,21 @@ nsRange::CollectClientRectsAndText(nsLay
iter.Next();
nsCOMPtr<nsIContent> content = do_QueryInterface(node);
if (!content)
continue;
if (content->IsNodeOfType(nsINode::eTEXT)) {
if (node == startContainer) {
int32_t offset = startContainer == endContainer ?
aEndOffset : content->GetText()->GetLength();
- GetPartialTextRect(aCollector, content, aStartOffset, offset,
+ GetPartialTextRect(aCollector, aTextList, content, aStartOffset, offset,
aClampToEdge, aFlushLayout);
continue;
} else if (node == endContainer) {
- GetPartialTextRect(aCollector, content, 0, aEndOffset,
+ GetPartialTextRect(aCollector, aTextList, content, 0, aEndOffset,
aClampToEdge, aFlushLayout);
continue;
}
}
nsIFrame* frame = content->GetPrimaryFrame();
if (frame) {
nsLayoutUtils::GetAllInFlowRects(frame,