layout/generic/nsHTMLReflowMetrics.cpp
author B2G Bumper Bot <release+b2gbumper@mozilla.com>
Mon, 22 Feb 2016 03:49:17 -0800
changeset 325569 0a57b98cd14f933331868d1efdea5ec997f0511f
parent 189503 63a4ad62401ab5b08174e86b80d22b7bdffdc0c9
child 346092 999402eb1b15f1c23038d201036b2578c424fab5
permissions -rw-r--r--
Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/e77f885e5e54 Author: Ricky Chien <rickychien@users.noreply.github.com> Desc: Merge pull request #34073 from rickychien/bug-955989 Bug 955989 - Running additional-extensions.js and download-manager.js on node.js r=@=scottwu ======== https://hg.mozilla.org/integration/gaia-central/rev/f9e8113e2739 Author: Ricky Chien <ricky060709@gmail.com> Desc: Bug 955989 - Running additional-extensions.js and download-manager.js on node.js

/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* 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 http://mozilla.org/MPL/2.0/. */

/* struct containing the output from nsIFrame::Reflow */

#include "nsHTMLReflowMetrics.h"
#include "nsHTMLReflowState.h"

void
nsOverflowAreas::UnionWith(const nsOverflowAreas& aOther)
{
  // FIXME: We should probably change scrollable overflow to use
  // UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
  NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
    mRects[otype].UnionRect(mRects[otype], aOther.mRects[otype]);
  }
}

void
nsOverflowAreas::UnionAllWith(const nsRect& aRect)
{
  // FIXME: We should probably change scrollable overflow to use
  // UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
  NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
    mRects[otype].UnionRect(mRects[otype], aRect);
  }
}

void
nsOverflowAreas::SetAllTo(const nsRect& aRect)
{
  NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
    mRects[otype] = aRect;
  }
}

nsHTMLReflowMetrics::nsHTMLReflowMetrics(const nsHTMLReflowState& aState,
                                         uint32_t aFlags)
  : mISize(0)
  , mBSize(0)
  , mBlockStartAscent(ASK_FOR_BASELINE)
  , mFlags(aFlags)
  , mWritingMode(aState.GetWritingMode())
{
}

void
nsHTMLReflowMetrics::SetOverflowAreasToDesiredBounds()
{
  NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
    mOverflowAreas.Overflow(otype).SetRect(0, 0, Width(), Height());
  }
}

void
nsHTMLReflowMetrics::UnionOverflowAreasWithDesiredBounds()
{
  // FIXME: We should probably change scrollable overflow to use
  // UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
  nsRect rect(0, 0, Width(), Height());
  NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
    nsRect& o = mOverflowAreas.Overflow(otype);
    o.UnionRect(o, rect);
  }
}