/src/mozilla-central/layout/generic/FrameChildList.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #include "mozilla/layout/FrameChildList.h" |
8 | | |
9 | | #include "nsIFrame.h" |
10 | | |
11 | | namespace mozilla { |
12 | | namespace layout { |
13 | | |
14 | | FrameChildListIterator::FrameChildListIterator(const nsIFrame* aFrame) |
15 | | : FrameChildListArrayIterator(mLists) |
16 | 0 | { |
17 | 0 | aFrame->GetChildLists(&mLists); |
18 | | #ifdef DEBUG |
19 | | // Make sure that there are no duplicate list IDs. |
20 | | FrameChildListIDs ids; |
21 | | uint32_t count = mLists.Length(); |
22 | | for (uint32_t i = 0; i < count; ++i) { |
23 | | NS_ASSERTION(!ids.Contains(mLists[i].mID), |
24 | | "Duplicate item found!"); |
25 | | ids |= mLists[i].mID; |
26 | | } |
27 | | #endif |
28 | | } |
29 | | |
30 | | #ifdef DEBUG_FRAME_DUMP |
31 | | const char* |
32 | | ChildListName(FrameChildListID aListID) |
33 | | { |
34 | | switch (aListID) { |
35 | | case kPrincipalList: return ""; |
36 | | case kPopupList: return "PopupList"; |
37 | | case kCaptionList: return "CaptionList"; |
38 | | case kColGroupList: return "ColGroupList"; |
39 | | case kSelectPopupList: return "SelectPopupList"; |
40 | | case kAbsoluteList: return "AbsoluteList"; |
41 | | case kFixedList: return "FixedList"; |
42 | | case kOverflowList: return "OverflowList"; |
43 | | case kOverflowContainersList: return "OverflowContainersList"; |
44 | | case kExcessOverflowContainersList: return "ExcessOverflowContainersList"; |
45 | | case kOverflowOutOfFlowList: return "OverflowOutOfFlowList"; |
46 | | case kFloatList: return "FloatList"; |
47 | | case kBulletList: return "BulletList"; |
48 | | case kPushedFloatsList: return "PushedFloatsList"; |
49 | | case kBackdropList: return "BackdropList"; |
50 | | case kNoReflowPrincipalList: return "NoReflowPrincipalList"; |
51 | | } |
52 | | |
53 | | MOZ_ASSERT_UNREACHABLE("unknown list"); |
54 | | return "UNKNOWN_FRAME_CHILD_LIST"; |
55 | | } |
56 | | #endif |
57 | | |
58 | | } // namespace layout |
59 | | } // namespace mozilla |