OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 25 matching lines...) Expand all Loading... |
36 explicit FrameTree(Frame* thisFrame); | 36 explicit FrameTree(Frame* thisFrame); |
37 ~FrameTree(); | 37 ~FrameTree(); |
38 | 38 |
39 const AtomicString& name() const { return m_name; } | 39 const AtomicString& name() const { return m_name; } |
40 const AtomicString& uniqueName() const { return m_uniqueName; } | 40 const AtomicString& uniqueName() const { return m_uniqueName; } |
41 // If |name| is not empty, |fallbackName| is ignored. Otherwise, | 41 // If |name| is not empty, |fallbackName| is ignored. Otherwise, |
42 // |fallbackName| is used as a source of uniqueName. | 42 // |fallbackName| is used as a source of uniqueName. |
43 void setName(const AtomicString& name, const AtomicString& fallbackName = nu
llAtom); | 43 void setName(const AtomicString& name, const AtomicString& fallbackName = nu
llAtom); |
44 | 44 |
45 // Directly assigns both the name and uniqueName. Should only be used when | 45 // Directly assigns both the name and uniqueName. Should only be used when |
46 // switching between LocalFrames and RemoteFrames for the same logical frame | 46 // replicating the name between LocalFrames and RemoteFrames for the same |
47 // so that the unique name stays unique. | 47 // logical frame so that the unique name stays unique. |
48 void setNameForReplacementFrame(const AtomicString& name, const AtomicString
& uniqueName); | 48 void setReplicatedName(const AtomicString& name, const AtomicString& uniqueN
ame); |
49 | 49 |
50 Frame* parent() const; | 50 Frame* parent() const; |
51 Frame* top() const; | 51 Frame* top() const; |
52 Frame* previousSibling() const; | 52 Frame* previousSibling() const; |
53 Frame* nextSibling() const; | 53 Frame* nextSibling() const; |
54 Frame* firstChild() const; | 54 Frame* firstChild() const; |
55 Frame* lastChild() const; | 55 Frame* lastChild() const; |
56 | 56 |
57 bool isDescendantOf(const Frame* ancestor) const; | 57 bool isDescendantOf(const Frame* ancestor) const; |
58 Frame* traversePreviousWithWrap(bool) const; | 58 Frame* traversePreviousWithWrap(bool) const; |
59 Frame* traverseNext(const Frame* stayWithin = nullptr) const; | 59 Frame* traverseNext(const Frame* stayWithin = nullptr) const; |
60 Frame* traverseNextWithWrap(bool) const; | 60 Frame* traverseNextWithWrap(bool) const; |
61 | 61 |
62 Frame* child(const AtomicString& name) const; | 62 Frame* child(const AtomicString& name) const; |
63 Frame* find(const AtomicString& name) const; | 63 Frame* find(const AtomicString& name) const; |
64 unsigned childCount() const; | 64 unsigned childCount() const; |
65 | 65 |
66 Frame* scopedChild(unsigned index) const; | 66 Frame* scopedChild(unsigned index) const; |
67 Frame* scopedChild(const AtomicString& name) const; | 67 Frame* scopedChild(const AtomicString& name) const; |
68 unsigned scopedChildCount() const; | 68 unsigned scopedChildCount() const; |
69 void invalidateScopedChildCount(); | 69 void invalidateScopedChildCount(); |
70 | 70 |
71 DECLARE_TRACE(); | 71 DECLARE_TRACE(); |
72 | 72 |
| 73 AtomicString calculateUniqueNameForNewChildFrame( |
| 74 const AtomicString& name, |
| 75 const AtomicString& fallbackName = nullAtom) const; |
| 76 |
73 private: | 77 private: |
74 Frame* deepLastChild() const; | 78 Frame* deepLastChild() const; |
75 AtomicString uniqueChildName(const AtomicString& requestedName) const; | 79 AtomicString calculateUniqueNameForChildFrame( |
| 80 bool existingChildFrame, |
| 81 const AtomicString& requestedName, |
| 82 const AtomicString& fallbackName = nullAtom) const; |
76 bool uniqueNameExists(const AtomicString& name) const; | 83 bool uniqueNameExists(const AtomicString& name) const; |
77 | 84 |
78 RawPtrWillBeMember<Frame> m_thisFrame; | 85 RawPtrWillBeMember<Frame> m_thisFrame; |
79 | 86 |
80 AtomicString m_name; // The actual frame name (may be empty). | 87 AtomicString m_name; // The actual frame name (may be empty). |
81 AtomicString m_uniqueName; | 88 AtomicString m_uniqueName; |
82 | 89 |
83 mutable unsigned m_scopedChildCount; | 90 mutable unsigned m_scopedChildCount; |
84 }; | 91 }; |
85 | 92 |
86 } // namespace blink | 93 } // namespace blink |
87 | 94 |
88 #ifndef NDEBUG | 95 #ifndef NDEBUG |
89 // Outside the WebCore namespace for ease of invocation from gdb. | 96 // Outside the WebCore namespace for ease of invocation from gdb. |
90 void showFrameTree(const blink::Frame*); | 97 void showFrameTree(const blink::Frame*); |
91 #endif | 98 #endif |
92 | 99 |
93 #endif // FrameTree_h | 100 #endif // FrameTree_h |
OLD | NEW |