diff options
Diffstat (limited to 'WebKit/chromium/src/WebFrameImpl.cpp')
-rw-r--r-- | WebKit/chromium/src/WebFrameImpl.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp index f1c30e2..4375e73 100644 --- a/WebKit/chromium/src/WebFrameImpl.cpp +++ b/WebKit/chromium/src/WebFrameImpl.cpp @@ -234,6 +234,15 @@ static void frameContentAsPlainText(size_t maxChars, Frame* frame, // Recursively walk the children. FrameTree* frameTree = frame->tree(); for (Frame* curChild = frameTree->firstChild(); curChild; curChild = curChild->tree()->nextSibling()) { + // Ignore the text of non-visible frames. + RenderView* contentRenderer = curChild->contentRenderer(); + RenderPart* ownerRenderer = curChild->ownerRenderer(); + if (!contentRenderer || !contentRenderer->width() || !contentRenderer->height() + || (contentRenderer->x() + contentRenderer->width() <= 0) || (contentRenderer->y() + contentRenderer->height() <= 0) + || (ownerRenderer && ownerRenderer->style() && ownerRenderer->style()->visibility() != VISIBLE)) { + continue; + } + // Make sure the frame separator won't fill up the buffer, and give up if // it will. The danger is if the separator will make the buffer longer than // maxChars. This will cause the computation above: @@ -1429,7 +1438,7 @@ void WebFrameImpl::stopFinding(bool clearSelection) cancelPendingScopingEffort(); // Remove all markers for matches found and turn off the highlighting. - frame()->document()->removeMarkers(DocumentMarker::TextMatch); + frame()->document()->markers()->removeMarkers(DocumentMarker::TextMatch); frame()->setMarkedTextMatchesAreHighlighted(false); // Let the frame know that we don't want tickmarks or highlighting anymore. @@ -2060,14 +2069,14 @@ void WebFrameImpl::addMarker(Range* range, bool activeMatch) if (marker.endOffset > marker.startOffset) { // Find the node to add a marker to and add it. Node* node = textPiece->startContainer(exception); - frame()->document()->addMarker(node, marker); + frame()->document()->markers()->addMarker(node, marker); // Rendered rects for markers in WebKit are not populated until each time // the markers are painted. However, we need it to happen sooner, because // the whole purpose of tickmarks on the scrollbar is to show where // matches off-screen are (that haven't been painted yet). - Vector<DocumentMarker> markers = frame()->document()->markersForNode(node); - frame()->document()->setRenderedRectForMarker( + Vector<DocumentMarker> markers = frame()->document()->markers()->markersForNode(node); + frame()->document()->markers()->setRenderedRectForMarker( textPiece->startContainer(exception), markers[markers.size() - 1], range->boundingBox()); @@ -2081,7 +2090,7 @@ void WebFrameImpl::setMarkerActive(Range* range, bool active) if (!range || range->collapsed(ec)) return; - frame()->document()->setMarkersActive(range, active); + frame()->document()->markers()->setMarkersActive(range, active); } int WebFrameImpl::ordinalOfFirstMatchForFrame(WebFrameImpl* frame) const |