author Lukasz Anforowicz <>
Mon, 09 Apr 2018 14:33:07 +0000
changeset 466985 861650deaddc7dfc160136f40bf3f7c83c504e09
parent 464230 d0cb92a08c3633877917713f7a17d63d73614957
child 505383 6f3709b3878117466168c40affa7bca0b60cf75b
permissions -rw-r--r--
Bug 1452097 [wpt PR 9952] - Make 2 tests immune to legitimate races between cross-origin subframes, a=testonly Automatic update from web-platform-testsMake 2 tests immune to legitimate races between cross-origin subframes Bug: 820589 Change-Id: I16c02746c61f42fafead5f96ae436b331fba4f85 Reviewed-on: Commit-Queue: Ɓukasz Anforowicz <> Reviewed-by: Alex Moshchuk <> Cr-Commit-Position: refs/heads/master@{#542360} wpt-commits: 1f638e87c2b4411c53121108efc7aa19df8bc543 wpt-pr: 9952 wpt-commits: 1f638e87c2b4411c53121108efc7aa19df8bc543 wpt-pr: 9952

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at */

// Eric Vaughan
// Netscape Communications
// See documentation in associated header file

#include "nsStackFrame.h"
#include "mozilla/ComputedStyle.h"
#include "nsIContent.h"
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsIPresShell.h"
#include "nsCSSRendering.h"
#include "nsBoxLayoutState.h"
#include "nsStackLayout.h"
#include "nsDisplayList.h"

using namespace mozilla;

NS_NewStackFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
  return new (aPresShell) nsStackFrame(aStyle);


nsStackFrame::nsStackFrame(ComputedStyle* aStyle):
  nsBoxFrame(aStyle, kClassID)
  nsCOMPtr<nsBoxLayout> layout;

// REVIEW: The old code put everything in the background layer. To be more
// consistent with the way other frames work, I'm putting everything in the
// Content() (i.e., foreground) layer (see nsFrame::BuildDisplayListForChild,
// the case for stacking context but non-positioned, non-floating frames).
// This could easily be changed back by hacking nsBoxFrame::BuildDisplayListInternal
// a bit more.
nsStackFrame::BuildDisplayListForChildren(nsDisplayListBuilder*   aBuilder,
                                          const nsDisplayListSet& aLists)
  // BuildDisplayListForChild puts stacking contexts into the PositionedDescendants
  // list. So we need to map that list to aLists.Content(). This is an easy way to
  // do that.
  nsDisplayList* content = aLists.Content();
  nsDisplayListSet kidLists(content, content, content, content, content, content);
  nsIFrame* kid = mFrames.FirstChild();
  while (kid) {
    // Force each child into its own true stacking context.
    BuildDisplayListForChild(aBuilder, kid, kidLists, DISPLAY_CHILD_FORCE_STACKING_CONTEXT);
    kid = kid->GetNextSibling();