layout/generic/FrameChildList.cpp

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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 /* 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/. */
     7 #include "mozilla/layout/FrameChildList.h"
     9 #include "nsIFrame.h"
    11 namespace mozilla {
    12 namespace layout {
    14 FrameChildListIterator::FrameChildListIterator(const nsIFrame* aFrame)
    15   : FrameChildListArrayIterator(mLists)
    16 {
    17   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 }
    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 kNoReflowPrincipalList: return "NoReflowPrincipalList";
    50   }
    52   NS_NOTREACHED("unknown list");
    53   return "UNKNOWN_FRAME_CHILD_LIST";
    54 }
    55 #endif
    57 } // namespace layout
    58 } // namespace mozilla

mercurial