LCOV - code coverage report
Current view: top level - layout/xul - nsStackFrame.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 18 18 100.0 %
Date: 2017-07-14 16:53:18 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       2             : /* This Source Code Form is subject to the terms of the Mozilla Public
       3             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       4             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       5             : 
       6             : //
       7             : // Eric Vaughan
       8             : // Netscape Communications
       9             : //
      10             : // See documentation in associated header file
      11             : //
      12             : 
      13             : #include "nsStackFrame.h"
      14             : #include "nsStyleContext.h"
      15             : #include "nsIContent.h"
      16             : #include "nsCOMPtr.h"
      17             : #include "nsHTMLParts.h"
      18             : #include "nsIPresShell.h"
      19             : #include "nsCSSRendering.h"
      20             : #include "nsBoxLayoutState.h"
      21             : #include "nsStackLayout.h"
      22             : #include "nsDisplayList.h"
      23             : 
      24             : nsIFrame*
      25          11 : NS_NewStackFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
      26             : {
      27          11 :   return new (aPresShell) nsStackFrame(aContext);
      28             : }
      29             : 
      30          11 : NS_IMPL_FRAMEARENA_HELPERS(nsStackFrame)
      31             : 
      32          11 : nsStackFrame::nsStackFrame(nsStyleContext* aContext):
      33          11 :   nsBoxFrame(aContext, kClassID)
      34             : {
      35          22 :   nsCOMPtr<nsBoxLayout> layout;
      36          11 :   NS_NewStackLayout(layout);
      37          11 :   SetXULLayoutManager(layout);
      38          11 : }
      39             : 
      40             : // REVIEW: The old code put everything in the background layer. To be more
      41             : // consistent with the way other frames work, I'm putting everything in the
      42             : // Content() (i.e., foreground) layer (see nsFrame::BuildDisplayListForChild,
      43             : // the case for stacking context but non-positioned, non-floating frames).
      44             : // This could easily be changed back by hacking nsBoxFrame::BuildDisplayListInternal
      45             : // a bit more.
      46             : void
      47         105 : nsStackFrame::BuildDisplayListForChildren(nsDisplayListBuilder*   aBuilder,
      48             :                                           const nsRect&           aDirtyRect,
      49             :                                           const nsDisplayListSet& aLists)
      50             : {
      51             :   // BuildDisplayListForChild puts stacking contexts into the PositionedDescendants
      52             :   // list. So we need to map that list to aLists.Content(). This is an easy way to
      53             :   // do that.
      54         105 :   nsDisplayList* content = aLists.Content();
      55         105 :   nsDisplayListSet kidLists(content, content, content, content, content, content);
      56         105 :   nsIFrame* kid = mFrames.FirstChild();
      57         363 :   while (kid) {
      58             :     // Force each child into its own true stacking context.
      59         129 :     BuildDisplayListForChild(aBuilder, kid, aDirtyRect, kidLists,
      60         129 :                              DISPLAY_CHILD_FORCE_STACKING_CONTEXT);
      61         129 :     kid = kid->GetNextSibling();
      62             :   }
      63         105 : }

Generated by: LCOV version 1.13