Home | History | Annotate | Download | only in page

Lines Matching refs:Frame

24 #include "Frame.h"
38 for (Frame* child = firstChild(); child; child = child->tree()->nextSibling())
49 m_uniqueName = AtomicString(); // Remove our old frame name so it's not considered in uniqueChildName.
59 Frame* FrameTree::parent(bool checkForDisconnectedFrame) const
66 bool FrameTree::transferChild(PassRefPtr<Frame> child)
68 Frame* oldParent = child->tree()->parent();
78 // We need to ensure that the child still has a unique frame name with respect to its new parent.
85 void FrameTree::appendChild(PassRefPtr<Frame> child)
92 void FrameTree::actuallyAppendChild(PassRefPtr<Frame> child)
95 Frame* oldLast = m_lastChild;
109 void FrameTree::removeChild(Frame* child)
117 RefPtr<Frame>& newLocationForNext = m_firstChild == child ? m_firstChild : child->tree()->m_previousSibling->tree()->m_nextSibling;
118 Frame*& newLocationForPrevious = m_lastChild == child ? m_lastChild : child->tree()->m_nextSibling->tree()->m_previousSibling;
135 // unique within the frame tree. The string we generate includes a "path" of names
136 // from the root frame down to us. For this path to be unique, each set of siblings must
139 // frame name that can't be set in HTML because it collides with comment syntax.
145 // Find the nearest parent that has a frame with a path in it.
146 Vector<Frame*, 16> chain;
147 Frame* frame;
148 for (frame = m_thisFrame; frame; frame = frame->tree()->parent()) {
149 if (frame->tree()->uniqueName().startsWith(framePathPrefix))
151 chain.append(frame);
155 if (frame)
156 name += frame->tree()->uniqueName().string().substring(framePathPrefixLength,
157 frame->tree()->uniqueName().length() - framePathPrefixLength - framePathSuffixLength);
159 frame = chain[i];
161 name += frame->tree()->uniqueName();
171 snprintf(suffix, sizeof(suffix), "/<!--frame%u-->-->", childCount());
178 Frame* FrameTree::child(unsigned index) const
180 Frame* result = firstChild();
186 Frame* FrameTree::child(const AtomicString& name) const
188 for (Frame* child = firstChild(); child; child = child->tree()->nextSibling())
194 Frame* FrameTree::find(const AtomicString& name) const
205 // Since "_blank" should never be any frame's name, the following just amounts to an optimization.
209 // Search subtree starting with this frame first.
210 for (Frame* frame = m_thisFrame; frame; frame = frame->tree()->traverseNext(m_thisFrame))
211 if (frame->tree()->uniqueName() == name)
212 return frame;
217 // The frame could have been detached from the page, so check it.
221 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
222 if (frame->tree()->uniqueName() == name)
223 return frame;
232 for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
233 if (frame->tree()->uniqueName() == name)
234 return frame;
242 bool FrameTree::isDescendantOf(const Frame* ancestor) const
250 for (Frame* frame = m_thisFrame; frame; frame = frame->tree()->parent())
251 if (frame == ancestor)
256 Frame* FrameTree::traverseNext(const Frame* stayWithin) const
258 Frame* child = firstChild();
267 Frame* sibling = nextSibling();
273 Frame* frame = m_thisFrame;
274 while (!sibling && (!stayWithin || frame->tree()->parent() != stayWithin)) {
275 frame = frame->tree()->parent();
276 if (!frame)
278 sibling = frame->tree()->nextSibling();
281 if (frame) {
289 Frame* FrameTree::traverseNextWithWrap(bool wrap) const
291 if (Frame* result = traverseNext())
300 Frame* FrameTree::traversePreviousWithWrap(bool wrap) const
304 if (Frame* prevSibling = previousSibling())
306 if (Frame* parentFrame = parent())
317 Frame* FrameTree::deepLastChild() const
319 Frame* result = m_thisFrame;
320 for (Frame* last = lastChild(); last; last = last->tree()->lastChild())
326 Frame* FrameTree::top(bool checkForDisconnectedFrame) const
328 Frame* frame = m_thisFrame;
329 for (Frame* parent = m_thisFrame; parent; parent = parent->tree()->parent()) {
330 frame = parent;
331 if (checkForDisconnectedFrame && frame->isDisconnected())
332 return frame;
334 return frame;