Lines Matching full:frame
23 #include "Frame.h"
38 for (Frame* child = firstChild(); child; child = child->tree()->nextSibling())
48 m_name = AtomicString(); // Remove our old frame name so it's not considered in uniqueChildName.
57 Frame* FrameTree::parent(bool checkForDisconnectedFrame) const
64 void FrameTree::appendChild(PassRefPtr<Frame> child)
69 Frame* oldLast = m_lastChild;
83 void FrameTree::removeChild(Frame* child)
91 RefPtr<Frame>& newLocationForNext = m_firstChild == child ? m_firstChild : child->tree()->m_previousSibling->tree()->m_nextSibling;
92 Frame*& newLocationForPrevious = m_lastChild == child ? m_lastChild : child->tree()->m_nextSibling->tree()->m_previousSibling;
109 // unique within the frame tree. The string we generate includes a "path" of names
110 // from the root frame down to us. For this path to be unique, each set of siblings must
113 // frame name that can't be set in HTML because it collides with comment syntax.
119 // Find the nearest parent that has a frame with a path in it.
120 Vector<Frame*, 16> chain;
121 Frame* frame;
122 for (frame = m_thisFrame; frame; frame = frame->tree()->parent()) {
123 if (frame->tree()->name().startsWith(framePathPrefix))
125 chain.append(frame);
129 if (frame)
130 name += frame->tree()->name().string().substring(framePathPrefixLength,
131 frame->tree()->name().length() - framePathPrefixLength - framePathSuffixLength);
133 frame = chain[i];
135 name += frame->tree()->name();
145 snprintf(suffix, sizeof(suffix), "/<!--frame%u-->-->", childCount());
152 Frame* FrameTree::child(unsigned index) const
154 Frame* result = firstChild();
160 Frame* FrameTree::child(const AtomicString& name) const
162 for (Frame* child = firstChild(); child; child = child->tree()->nextSibling())
168 Frame* FrameTree::find(const AtomicString& name) const
179 // Since "_blank" should never be any frame's name, the following just amounts to an optimization.
183 // Search subtree starting with this frame first.
184 for (Frame* frame = m_thisFrame; frame; frame = frame->tree()->traverseNext(m_thisFrame))
185 if (frame->tree()->name() == name)
186 return frame;
191 // The frame could have been detached from the page, so check it.
195 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
196 if (frame->tree()->name() == name)
197 return frame;
206 for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
207 if (frame->tree()->name() == name)
208 return frame;
216 bool FrameTree::isDescendantOf(const Frame* ancestor) const
224 for (Frame* frame = m_thisFrame; frame; frame = frame->tree()->parent())
225 if (frame == ancestor)
230 Frame* FrameTree::traverseNext(const Frame* stayWithin) const
232 Frame* child = firstChild();
241 Frame* sibling = nextSibling();
247 Frame* frame = m_thisFrame;
248 while (!sibling && (!stayWithin || frame->tree()->parent() != stayWithin)) {
249 frame = frame->tree()->parent();
250 if (!frame)
252 sibling = frame->tree()->nextSibling();
255 if (frame) {
263 Frame* FrameTree::traverseNextWithWrap(bool wrap) const
265 if (Frame* result = traverseNext())
274 Frame* FrameTree::traversePreviousWithWrap(bool wrap) const
278 if (Frame* prevSibling = previousSibling())
280 if (Frame* parentFrame = parent())
291 Frame* FrameTree::deepLastChild() const
293 Frame* result = m_thisFrame;
294 for (Frame* last = lastChild(); last; last = last->tree()->lastChild())
300 Frame* FrameTree::top(bool checkForDisconnectedFrame) const
302 Frame* frame = m_thisFrame;
303 for (Frame* parent = m_thisFrame; parent; parent = parent->tree()->parent()) {
304 frame = parent;
305 if (checkForDisconnectedFrame && frame->isDisconnected())
306 return frame;
308 return frame;