layout/generic/nsHTMLReflowMetrics.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

michael@0 1 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /* struct containing the output from nsIFrame::Reflow */
michael@0 7
michael@0 8 #include "nsHTMLReflowMetrics.h"
michael@0 9 #include "nsHTMLReflowState.h"
michael@0 10
michael@0 11 void
michael@0 12 nsOverflowAreas::UnionWith(const nsOverflowAreas& aOther)
michael@0 13 {
michael@0 14 // FIXME: We should probably change scrollable overflow to use
michael@0 15 // UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
michael@0 16 NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
michael@0 17 mRects[otype].UnionRect(mRects[otype], aOther.mRects[otype]);
michael@0 18 }
michael@0 19 }
michael@0 20
michael@0 21 void
michael@0 22 nsOverflowAreas::UnionAllWith(const nsRect& aRect)
michael@0 23 {
michael@0 24 // FIXME: We should probably change scrollable overflow to use
michael@0 25 // UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
michael@0 26 NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
michael@0 27 mRects[otype].UnionRect(mRects[otype], aRect);
michael@0 28 }
michael@0 29 }
michael@0 30
michael@0 31 void
michael@0 32 nsOverflowAreas::SetAllTo(const nsRect& aRect)
michael@0 33 {
michael@0 34 NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
michael@0 35 mRects[otype] = aRect;
michael@0 36 }
michael@0 37 }
michael@0 38
michael@0 39 nsHTMLReflowMetrics::nsHTMLReflowMetrics(const nsHTMLReflowState& aState,
michael@0 40 uint32_t aFlags)
michael@0 41 : mISize(0)
michael@0 42 , mBSize(0)
michael@0 43 , mBlockStartAscent(ASK_FOR_BASELINE)
michael@0 44 , mFlags(aFlags)
michael@0 45 , mWritingMode(aState.GetWritingMode())
michael@0 46 {
michael@0 47 }
michael@0 48
michael@0 49 void
michael@0 50 nsHTMLReflowMetrics::SetOverflowAreasToDesiredBounds()
michael@0 51 {
michael@0 52 NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
michael@0 53 mOverflowAreas.Overflow(otype).SetRect(0, 0, Width(), Height());
michael@0 54 }
michael@0 55 }
michael@0 56
michael@0 57 void
michael@0 58 nsHTMLReflowMetrics::UnionOverflowAreasWithDesiredBounds()
michael@0 59 {
michael@0 60 // FIXME: We should probably change scrollable overflow to use
michael@0 61 // UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
michael@0 62 nsRect rect(0, 0, Width(), Height());
michael@0 63 NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
michael@0 64 nsRect& o = mOverflowAreas.Overflow(otype);
michael@0 65 o.UnionRect(o, rect);
michael@0 66 }
michael@0 67 }

mercurial