author | Mats Palmgren <matspal@gmail.com> |
Thu, 17 Apr 2014 12:11:07 +0000 | |
changeset 179128 | ff492cb2c8824ffd4a82b05191e73a2f2307eb1d |
parent 179127 | 8576639616bb14d0e5bfc88e994333884aeadf96 |
child 179129 | 072817c3a101aea2081006610b33c49be0e099fa |
push id | 26607 |
push user | ryanvm@gmail.com |
push date | Fri, 18 Apr 2014 02:31:26 +0000 |
treeherder | mozilla-central@7fe3ee0cf8be [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | cam |
bugs | 613659 |
milestone | 31.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1272,34 +1272,35 @@ nsIFrame::OutsetBorderRadii(nscoord aRad if (aRadii[hc1] > 0) aRadii[hc1] += offset; if (aRadii[hc2] > 0) aRadii[hc2] += offset; } } /* virtual */ bool -nsIFrame::GetBorderRadii(nscoord aRadii[8]) const +nsIFrame::GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea, + int aSkipSides, nscoord aRadii[8]) const { if (IsThemed()) { // When we're themed, the native theme code draws the border and // background, and therefore it doesn't make sense to tell other // code that's interested in border-radius that we have any radii. // // In an ideal world, we might have a way for the them to tell us an // border radius, but since we don't, we're better off assuming // zero. NS_FOR_CSS_HALF_CORNERS(corner) { aRadii[corner] = 0; } return false; } - nsSize size = GetSize(); - return ComputeBorderRadii(StyleBorder()->mBorderRadius, size, size, - GetSkipSides(), aRadii); + return ComputeBorderRadii(StyleBorder()->mBorderRadius, + aFrameSize, aBorderArea, + aSkipSides, aRadii); } bool nsIFrame::GetPaddingBoxBorderRadii(nscoord aRadii[8]) const { if (!GetBorderRadii(aRadii)) return false; InsetBorderRadii(aRadii, GetUsedBorder());
--- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -4361,20 +4361,25 @@ ReduceRadii(nscoord aXBorder, nscoord aY * Implement an override for nsIFrame::GetBorderRadii to ensure that * the clipping region for the border radius does not clip the scrollbars. * * In other words, we require that the border radius be reduced until the * inner border radius at the inner edge of the border is 0 wherever we * have scrollbars. */ bool -ScrollFrameHelper::GetBorderRadii(nscoord aRadii[8]) const +ScrollFrameHelper::GetBorderRadii(const nsSize& aFrameSize, + const nsSize& aBorderArea, + int aSkipSides, + nscoord aRadii[8]) const { - if (!mOuter->nsContainerFrame::GetBorderRadii(aRadii)) + if (!mOuter->nsContainerFrame::GetBorderRadii(aFrameSize, aBorderArea, + aSkipSides, aRadii)) { return false; + } // Since we can use GetActualScrollbarSizes (rather than // GetDesiredScrollbarSizes) since this doesn't affect reflow, we // probably should. nsMargin sb = GetActualScrollbarSizes(); nsMargin border = mOuter->GetUsedBorder(); if (sb.left > 0 || sb.top > 0) {
--- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -66,17 +66,18 @@ public: const nsDisplayListSet& aLists); void AppendScrollPartsTo(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, const nsDisplayListSet& aLists, bool& aCreateLayer, bool aPositioned); - bool GetBorderRadii(nscoord aRadii[8]) const; + bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea, + int aSkipSides, nscoord aRadii[8]) const; // nsIReflowCallback virtual bool ReflowFinished() MOZ_OVERRIDE; virtual void ReflowCallbackCanceled() MOZ_OVERRIDE; /** * @note This method might destroy the frame, pres shell and other objects. * Called when the 'curpos' attribute on one of the scrollbars changes. @@ -466,18 +467,19 @@ public: nsHTMLReflowMetrics* aMetrics, bool aFirstPass); nsresult ReflowContents(ScrollReflowState* aState, const nsHTMLReflowMetrics& aDesiredSize); void PlaceScrollArea(const ScrollReflowState& aState, const nsPoint& aScrollPosition); nscoord GetIntrinsicVScrollbarWidth(nsRenderingContext *aRenderingContext); - virtual bool GetBorderRadii(nscoord aRadii[8]) const MOZ_OVERRIDE { - return mHelper.GetBorderRadii(aRadii); + virtual bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea, + int aSkipSides, nscoord aRadii[8]) const MOZ_OVERRIDE { + return mHelper.GetBorderRadii(aFrameSize, aBorderArea, aSkipSides, aRadii); } virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; virtual nsresult GetPadding(nsMargin& aPadding) MOZ_OVERRIDE; virtual bool IsCollapsed() MOZ_OVERRIDE; virtual nsresult Reflow(nsPresContext* aPresContext, @@ -803,18 +805,19 @@ public: virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; virtual nsresult GetPadding(nsMargin& aPadding) MOZ_OVERRIDE; - virtual bool GetBorderRadii(nscoord aRadii[8]) const MOZ_OVERRIDE { - return mHelper.GetBorderRadii(aRadii); + virtual bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea, + int aSkipSides, nscoord aRadii[8]) const MOZ_OVERRIDE { + return mHelper.GetBorderRadii(aFrameSize, aBorderArea, aSkipSides, aRadii); } nsresult Layout(nsBoxLayoutState& aState); void LayoutScrollArea(nsBoxLayoutState& aState, const nsPoint& aScrollPosition); static bool AddRemoveScrollbar(bool& aHasScrollbar, nscoord& aXY, nscoord& aSize,
--- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -1037,22 +1037,29 @@ public: * radii into zero, and OutsetBorderRadii does not inflate zero radii. * Therefore, callers should always inset or outset directly from the * original value coming from style. */ static void InsetBorderRadii(nscoord aRadii[8], const nsMargin &aOffsets); static void OutsetBorderRadii(nscoord aRadii[8], const nsMargin &aOffsets); /** - * Fill in border radii for this frame. Return whether any are - * nonzero. - * + * Fill in border radii for this frame. Return whether any are nonzero. * Indices into aRadii are the NS_CORNER_* constants in nsStyleConsts.h + * aSkipSides is a union of SIDE_BIT_LEFT/RIGHT/TOP/BOTTOM bits that says + * which side(s) to skip. */ - virtual bool GetBorderRadii(nscoord aRadii[8]) const; + virtual bool GetBorderRadii(const nsSize& aFrameSize, + const nsSize& aBorderArea, + int aSkipSides, + nscoord aRadii[8]) const; + bool GetBorderRadii(nscoord aRadii[8]) const { + nsSize sz = GetSize(); + return GetBorderRadii(sz, sz, GetSkipSides(), aRadii); + } bool GetPaddingBoxBorderRadii(nscoord aRadii[8]) const; bool GetContentBoxBorderRadii(nscoord aRadii[8]) const; /** * Get the position of the frame's baseline, relative to the top of * the frame (its top border edge). Only valid when Reflow is not * needed.
--- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -1098,17 +1098,20 @@ nsBCTableCellFrame::GetType() const nsBCTableCellFrame::GetUsedBorder() const { nsMargin result; GetBorderWidth(result); return result; } /* virtual */ bool -nsBCTableCellFrame::GetBorderRadii(nscoord aRadii[8]) const +nsBCTableCellFrame::GetBorderRadii(const nsSize& aFrameSize, + const nsSize& aBorderArea, + int aSkipSides, + nscoord aRadii[8]) const { NS_FOR_CSS_HALF_CORNERS(corner) { aRadii[corner] = 0; } return false; } #ifdef DEBUG_FRAME_DUMP
--- a/layout/tables/nsTableCellFrame.h +++ b/layout/tables/nsTableCellFrame.h @@ -293,17 +293,20 @@ public: nsBCTableCellFrame(nsStyleContext* aContext); ~nsBCTableCellFrame(); virtual nsIAtom* GetType() const MOZ_OVERRIDE; virtual nsMargin GetUsedBorder() const MOZ_OVERRIDE; - virtual bool GetBorderRadii(nscoord aRadii[8]) const MOZ_OVERRIDE; + virtual bool GetBorderRadii(const nsSize& aFrameSize, + const nsSize& aBorderArea, + int aSkipSides, + nscoord aRadii[8]) const MOZ_OVERRIDE; // Get the *inner half of the border only*, in twips. virtual nsMargin* GetBorderWidth(nsMargin& aBorder) const MOZ_OVERRIDE; // Get the *inner half of the border only*, in pixels. BCPixelSize GetBorderWidth(mozilla::css::Side aSide) const; // Set the full (both halves) width of the border