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