Home | History | Annotate | Download | only in page

Lines Matching refs:Frame

25 #include "core/frame/FrameClient.h"
26 #include "core/frame/FrameView.h"
27 #include "core/frame/LocalFrame.h"
28 #include "core/frame/RemoteFrame.h"
29 #include "core/frame/RemoteFrameView.h"
45 FrameTree::FrameTree(Frame* thisFrame)
54 for (Frame* child = firstChild(); child; child = child->tree().nextSibling()) {
69 m_uniqueName = AtomicString(); // Remove our old frame name so it's not considered in uniqueChildName.
73 Frame* FrameTree::parent() const
80 Frame* FrameTree::top() const
83 // with EmptyFrameLoaderClient and cases where the frame is detached
87 Frame* candidate = m_thisFrame->client()->top();
91 Frame* FrameTree::previousSibling() const
98 Frame* FrameTree::nextSibling() const
105 Frame* FrameTree::firstChild() const
112 Frame* FrameTree::lastChild() const
121 for (Frame* frame = top(); frame; frame = frame->tree().traverseNext()) {
122 if (frame->tree().uniqueName() == name)
134 // unique within the frame tree. The string we generate includes a "path" of names
135 // from the root frame down to us. For this path to be unique, each set of siblings must
138 // frame name that can't be set in HTML because it collides with comment syntax.
144 // Find the nearest parent that has a frame with a path in it.
145 Vector<Frame*, 16> chain;
146 Frame* frame;
147 for (frame = m_thisFrame; frame; frame = frame->tree().parent()) {
148 if (frame->tree().uniqueName().startsWith(framePathPrefix))
150 chain.append(frame);
154 if (frame) {
155 name.append(frame->tree().uniqueName().string().substring(framePathPrefixLength,
156 frame->tree().uniqueName().length() - framePathPrefixLength - framePathSuffixLength));
159 frame = chain[i];
161 name.append(frame->tree().uniqueName());
164 name.appendLiteral("/<!--frame");
171 Frame* FrameTree::scopedChild(unsigned index) const
180 for (Frame* result = firstChild(); result; result = result->tree().nextSibling()) {
191 Frame* FrameTree::scopedChild(const AtomicString& name) const
200 for (Frame* child = firstChild(); child; child = child->tree().nextSibling())
212 for (Frame* result = firstChild(); result; result = result->tree().nextSibling()) {
235 for (Frame* result = firstChild(); result; result = result->tree().nextSibling())
240 Frame* FrameTree::child(const AtomicString& name) const
242 for (Frame* child = firstChild(); child; child = child->tree().nextSibling())
248 Frame* FrameTree::find(const AtomicString& name) const
259 // Since "_blank" should never be any frame's name, the following just amounts to an optimization.
263 // Search subtree starting with this frame first.
264 for (Frame* frame = m_thisFrame; frame; frame = frame->tree().traverseNext(m_thisFrame))
265 if (frame->tree().name() == name)
266 return frame;
271 // The frame could have been detached from the page, so check it.
275 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext())
276 if (frame->tree().name() == name)
277 return frame;
286 for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree().traverseNext()) {
287 if (frame->tree().name() == name)
288 return frame;
296 bool FrameTree::isDescendantOf(const Frame* ancestor) const
304 for (Frame* frame = m_thisFrame; frame; frame = frame->tree().parent())
305 if (frame == ancestor)
310 Frame* FrameTree::traverseNext(const Frame* stayWithin) const
312 Frame* child = firstChild();
321 Frame* sibling = nextSibling();
327 Frame* frame = m_thisFrame;
328 while (!sibling && (!stayWithin || frame->tree().parent() != stayWithin)) {
329 frame = frame->tree().parent();
330 if (!frame)
332 sibling = frame->tree().nextSibling();
335 if (frame) {
343 Frame* FrameTree::traverseNextWithWrap(bool wrap) const
345 if (Frame* result = traverseNext())
354 Frame* FrameTree::traversePreviousWithWrap(bool wrap) const
358 if (Frame* prevSibling = previousSibling())
360 if (Frame* parentFrame = parent())
371 Frame* FrameTree::deepLastChild() const
373 Frame* result = m_thisFrame;
374 for (Frame* last = lastChild(); last; last = last->tree().lastChild())
390 static void printFrames(const WebCore::Frame* frame, const WebCore::Frame* targetFrame, int indent)
392 if (frame == targetFrame) {
398 WebCore::FrameView* view = frame->isLocalFrame() ? toLocalFrame(frame)->view() : 0;
399 printf("Frame %p %dx%d\n", frame, view ? view->width() : 0, view ? view->height() : 0);
401 printf(" owner=%p\n", frame->owner());
405 printf(" document=%p\n", frame->isLocalFrame() ? toLocalFrame(frame)->document() : 0);
407 printf(" uri=%s\n\n", frame->isLocalFrame() ? toLocalFrame(frame)->document()->url().string().utf8().data() : 0);
409 for (WebCore::Frame* child = frame->tree().firstChild(); child; child = child->tree().nextSibling())
413 void showFrameTree(const WebCore::Frame* frame)
415 if (!frame) {
416 printf("Null input frame\n");
420 printFrames(frame->tree().top(), frame, 0);