Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2725)

Unified Diff: Source/web/WebLocalFrameImpl.cpp

Issue 317493002: Change FrameTree to return Frames instead of LocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed conflicts Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/web/WebLocalFrameImpl.cpp
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
index a965aa37cf5b068e202a22bba86bf1cc4dfa2beb..34b6f7e7520e2b4d966515bb7a6223c66942a44f 100644
--- a/Source/web/WebLocalFrameImpl.cpp
+++ b/Source/web/WebLocalFrameImpl.cpp
@@ -236,10 +236,13 @@ static void frameContentAsPlainText(size_t maxChars, LocalFrame* frame, StringBu
// Recursively walk the children.
const FrameTree& frameTree = frame->tree();
- for (LocalFrame* curChild = frameTree.firstChild(); curChild; curChild = curChild->tree().nextSibling()) {
+ for (Frame* curChild = frameTree.firstChild(); curChild; curChild = curChild->tree().nextSibling()) {
+ if (!curChild->isLocalFrame())
+ continue;
+ LocalFrame* curLocalChild = toLocalFrame(curChild);
// Ignore the text of non-visible frames.
- RenderView* contentRenderer = curChild->contentRenderer();
- RenderPart* ownerRenderer = curChild->ownerRenderer();
+ RenderView* contentRenderer = curLocalChild->contentRenderer();
+ RenderPart* ownerRenderer = curLocalChild->ownerRenderer();
if (!contentRenderer || !contentRenderer->width() || !contentRenderer->height()
|| (contentRenderer->x() + contentRenderer->width() <= 0) || (contentRenderer->y() + contentRenderer->height() <= 0)
|| (ownerRenderer && ownerRenderer->style() && ownerRenderer->style()->visibility() != VISIBLE)) {
@@ -255,7 +258,7 @@ static void frameContentAsPlainText(size_t maxChars, LocalFrame* frame, StringBu
return;
output.append(frameSeparator, frameSeparatorLength);
- frameContentAsPlainText(maxChars, curChild, output);
+ frameContentAsPlainText(maxChars, curLocalChild, output);
if (output.length() >= maxChars)
return; // Filled up the buffer.
}
@@ -654,23 +657,23 @@ void WebLocalFrameImpl::removeChild(WebFrame* child)
WebFrame* WebLocalFrameImpl::traversePrevious(bool wrap) const
{
- if (!frame())
+ if (!frame() || !frame()->tree().traversePreviousWithWrap(wrap)->isLocalFrame())
dcheng 2014/06/04 18:06:37 Put a FIXME here--this should move to WebFrame any
kenrb 2014/06/04 20:34:47 Ok, I figured this was going to change pretty soon
return 0;
- return fromFrame(frame()->tree().traversePreviousWithWrap(wrap));
+ return fromFrame(toLocalFrame(frame()->tree().traversePreviousWithWrap(wrap)));
}
WebFrame* WebLocalFrameImpl::traverseNext(bool wrap) const
{
- if (!frame())
+ if (!frame() || !frame()->tree().traverseNextWithWrap(wrap)->isLocalFrame())
return 0;
- return fromFrame(frame()->tree().traverseNextWithWrap(wrap));
+ return fromFrame(toLocalFrame(frame()->tree().traverseNextWithWrap(wrap)));
}
WebFrame* WebLocalFrameImpl::findChildByName(const WebString& name) const
{
- if (!frame())
+ if (!frame() || !frame()->tree().child(name)->isLocalFrame())
return 0;
- return fromFrame(frame()->tree().child(name));
+ return fromFrame(toLocalFrame(frame()->tree().child(name)));
}
WebDocument WebLocalFrameImpl::document() const

Powered by Google App Engine
This is Rietveld 408576698