2 * Copyright (C) 2006 Apple Computer, Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
23 #include "platform/heap/Handle.h"
24 #include "wtf/text/AtomicString.h"
31 class FrameTree FINAL {
32 WTF_MAKE_NONCOPYABLE(FrameTree);
33 DISALLOW_ALLOCATION();
35 explicit FrameTree(Frame* thisFrame);
38 const AtomicString& name() const { return m_name; }
39 const AtomicString& uniqueName() const { return m_uniqueName; }
40 // If |name| is not empty, |fallbackName| is ignored. Otherwise,
41 // |fallbackName| is used as a source of uniqueName.
42 void setName(const AtomicString& name, const AtomicString& fallbackName = nullAtom);
44 Frame* parent() const;
46 Frame* previousSibling() const;
47 Frame* nextSibling() const;
48 Frame* firstChild() const;
49 Frame* lastChild() const;
51 bool isDescendantOf(const Frame* ancestor) const;
52 Frame* traversePreviousWithWrap(bool) const;
53 Frame* traverseNext(const Frame* stayWithin = 0) const;
54 Frame* traverseNextWithWrap(bool) const;
56 Frame* child(const AtomicString& name) const;
57 Frame* find(const AtomicString& name) const;
58 unsigned childCount() const;
60 Frame* scopedChild(unsigned index) const;
61 Frame* scopedChild(const AtomicString& name) const;
62 unsigned scopedChildCount() const;
63 void invalidateScopedChildCount();
68 Frame* deepLastChild() const;
69 AtomicString uniqueChildName(const AtomicString& requestedName) const;
70 bool uniqueNameExists(const AtomicString& name) const;
71 unsigned scopedChildCount(TreeScope*) const;
73 RawPtrWillBeMember<Frame> m_thisFrame;
75 AtomicString m_name; // The actual frame name (may be empty).
76 AtomicString m_uniqueName;
78 mutable unsigned m_scopedChildCount;
84 // Outside the WebCore namespace for ease of invocation from gdb.
85 void showFrameTree(const blink::Frame*);