1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
3 : /* ***** BEGIN LICENSE BLOCK *****
4 : * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 : *
6 : * The contents of this file are subject to the Mozilla Public License Version
7 : * 1.1 (the "License"); you may not use this file except in compliance with
8 : * the License. You may obtain a copy of the License at
9 : * http://www.mozilla.org/MPL/
10 : *
11 : * Software distributed under the License is distributed on an "AS IS" basis,
12 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 : * for the specific language governing rights and limitations under the
14 : * License.
15 : *
16 : * The Original Code is mozilla.org code.
17 : *
18 : * The Initial Developer of the Original Code is the Mozilla Foundation.
19 : * Portions created by the Initial Developer are Copyright (C) 2011
20 : * the Initial Developer. All Rights Reserved.
21 : *
22 : * Contributor(s):
23 : * Mats Palmgren <matspal@gmail.com> (original author)
24 : *
25 : * Alternatively, the contents of this file may be used under the terms of
26 : * either the GNU General Public License Version 2 or later (the "GPL"), or
27 : * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 : * in which case the provisions of the GPL or the LGPL are applicable instead
29 : * of those above. If you wish to allow use of your version of this file only
30 : * under the terms of either the GPL or the LGPL, and not to allow others to
31 : * use your version of this file under the terms of the MPL, indicate your
32 : * decision by deleting the provisions above and replace them with the notice
33 : * and other provisions required by the GPL or the LGPL. If you do not delete
34 : * the provisions above, a recipient may use your version of this file under
35 : * the terms of any one of the MPL, the GPL or the LGPL.
36 : *
37 : * ***** END LICENSE BLOCK ***** */
38 :
39 : #include "mozilla/layout/FrameChildList.h"
40 :
41 : #include "nsIFrame.h"
42 :
43 : namespace mozilla {
44 : namespace layout {
45 :
46 0 : FrameChildListIterator::FrameChildListIterator(const nsIFrame* aFrame)
47 0 : : FrameChildListArrayIterator(mLists)
48 : {
49 0 : aFrame->GetChildLists(&mLists);
50 : #ifdef DEBUG
51 : // Make sure that there are no duplicate list IDs.
52 0 : FrameChildListIDs ids;
53 0 : PRUint32 count = mLists.Length();
54 0 : for (PRUint32 i = 0; i < count; ++i) {
55 0 : NS_ASSERTION(!ids.Contains(mLists[i].mID),
56 : "Duplicate item found!");
57 0 : ids |= mLists[i].mID;
58 : }
59 : #endif
60 0 : }
61 :
62 : #ifdef DEBUG
63 : const char*
64 0 : ChildListName(FrameChildListID aListID)
65 : {
66 0 : switch (aListID) {
67 0 : case kPrincipalList: return "";
68 0 : case kPopupList: return "PopupList";
69 0 : case kCaptionList: return "CaptionList";
70 0 : case kColGroupList: return "ColGroupList";
71 0 : case kSelectPopupList: return "SelectPopupList";
72 0 : case kAbsoluteList: return "AbsoluteList";
73 0 : case kFixedList: return "FixedList";
74 0 : case kOverflowList: return "OverflowList";
75 0 : case kOverflowContainersList: return "OverflowContainersList";
76 0 : case kExcessOverflowContainersList: return "ExcessOverflowContainersList";
77 0 : case kOverflowOutOfFlowList: return "OverflowOutOfFlowList";
78 0 : case kFloatList: return "FloatList";
79 0 : case kBulletList: return "BulletList";
80 0 : case kPushedFloatsList: return "PushedFloatsList";
81 0 : case kNoReflowPrincipalList: return "NoReflowPrincipalList";
82 : }
83 :
84 0 : NS_NOTREACHED("unknown list");
85 0 : return "UNKNOWN_FRAME_CHILD_LIST";
86 : }
87 : #endif
88 :
89 : } // namespace layout
90 : } // namespace mozilla
|