1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/generic/FrameChildList.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,58 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "mozilla/layout/FrameChildList.h" 1.11 + 1.12 +#include "nsIFrame.h" 1.13 + 1.14 +namespace mozilla { 1.15 +namespace layout { 1.16 + 1.17 +FrameChildListIterator::FrameChildListIterator(const nsIFrame* aFrame) 1.18 + : FrameChildListArrayIterator(mLists) 1.19 +{ 1.20 + aFrame->GetChildLists(&mLists); 1.21 +#ifdef DEBUG 1.22 + // Make sure that there are no duplicate list IDs. 1.23 + FrameChildListIDs ids; 1.24 + uint32_t count = mLists.Length(); 1.25 + for (uint32_t i = 0; i < count; ++i) { 1.26 + NS_ASSERTION(!ids.Contains(mLists[i].mID), 1.27 + "Duplicate item found!"); 1.28 + ids |= mLists[i].mID; 1.29 + } 1.30 +#endif 1.31 +} 1.32 + 1.33 +#ifdef DEBUG_FRAME_DUMP 1.34 +const char* 1.35 +ChildListName(FrameChildListID aListID) 1.36 +{ 1.37 + switch (aListID) { 1.38 + case kPrincipalList: return ""; 1.39 + case kPopupList: return "PopupList"; 1.40 + case kCaptionList: return "CaptionList"; 1.41 + case kColGroupList: return "ColGroupList"; 1.42 + case kSelectPopupList: return "SelectPopupList"; 1.43 + case kAbsoluteList: return "AbsoluteList"; 1.44 + case kFixedList: return "FixedList"; 1.45 + case kOverflowList: return "OverflowList"; 1.46 + case kOverflowContainersList: return "OverflowContainersList"; 1.47 + case kExcessOverflowContainersList: return "ExcessOverflowContainersList"; 1.48 + case kOverflowOutOfFlowList: return "OverflowOutOfFlowList"; 1.49 + case kFloatList: return "FloatList"; 1.50 + case kBulletList: return "BulletList"; 1.51 + case kPushedFloatsList: return "PushedFloatsList"; 1.52 + case kNoReflowPrincipalList: return "NoReflowPrincipalList"; 1.53 + } 1.54 + 1.55 + NS_NOTREACHED("unknown list"); 1.56 + return "UNKNOWN_FRAME_CHILD_LIST"; 1.57 +} 1.58 +#endif 1.59 + 1.60 +} // namespace layout 1.61 +} // namespace mozilla