Bug 1333366 Part 2 - Update legacy NS_SIDE usage and document.
Delete the "or 0 for no movement in that direction" from the CanAdjustEdges
document in nsMenuPopupFrame.h because the only caller in nsResizerFrame.cpp
never passes 0 to it.
MozReview-Commit-ID: 3A5A8O4MDn1
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -1200,17 +1200,17 @@ public:
* 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.
* Indices into aRadii are the enum HalfCorner constants in gfx/2d/Types.h
- * aSkipSides is a union of SIDE_BIT_LEFT/RIGHT/TOP/BOTTOM bits that says
+ * aSkipSides is a union of eSideBitsLeft/Right/Top/Bottom bits that says
* which side(s) to skip.
*
* Note: GetMarginBoxBorderRadii() and GetShapeBoxBorderRadii() work only
* on frames that establish block formatting contexts since they don't
* participate in margin-collapsing.
*/
virtual bool GetBorderRadii(const nsSize& aFrameSize,
const nsSize& aBorderArea,
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -2709,17 +2709,17 @@ static const nsCSSPropertyID gBorderBott
eCSSProperty_UNKNOWN
};
static_assert(eSideTop == 0 && eSideRight == 1 &&
eSideBottom == 2 && eSideLeft == 3,
"box side constants not top/right/bottom/left == 0/1/2/3");
static const nsCSSPropertyID gBorderColorSubpropTable[] = {
// Code relies on these being in top-right-bottom-left order.
- // Code relies on these matching the NS_SIDE_* constants.
+ // Code relies on these matching the enum Side constants.
eCSSProperty_border_top_color,
eCSSProperty_border_right_color,
eCSSProperty_border_bottom_color,
eCSSProperty_border_left_color,
eCSSProperty_UNKNOWN
};
static const nsCSSPropertyID gBorderInlineEndSubpropTable[] = {
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -1451,17 +1451,17 @@ void nsTableRowFrame::SetContinuousBCBor
return;
case eLogicalSideBStart:
mBStartContBorderWidth = aPixelValue;
return;
case eLogicalSideIStart:
mIStartContBorderWidth = aPixelValue;
return;
default:
- NS_ERROR("invalid NS_SIDE arg");
+ NS_ERROR("invalid LogicalSide arg");
}
}
#ifdef ACCESSIBILITY
a11y::AccType
nsTableRowFrame::AccessibleType()
{
return a11y::eHTMLTableRowType;
}
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -1692,18 +1692,18 @@ nsMenuPopupFrame::GetConstraintRect(cons
screenRectPixels.IntersectRect(screenRectPixels, overrideConstrainRect);
screenRectPixels.x = overrideConstrainRect.x;
screenRectPixels.width = overrideConstrainRect.width;
}
return screenRectPixels;
}
-void nsMenuPopupFrame::CanAdjustEdges(int8_t aHorizontalSide,
- int8_t aVerticalSide,
+void nsMenuPopupFrame::CanAdjustEdges(Side aHorizontalSide,
+ Side aVerticalSide,
LayoutDeviceIntPoint& aChange)
{
int8_t popupAlign(mPopupAlignment);
if (IsDirectionRTL()) {
popupAlign = -popupAlign;
}
if (aHorizontalSide == (mHFlip ? eSideRight : eSideLeft)) {
--- a/layout/xul/nsMenuPopupFrame.h
+++ b/layout/xul/nsMenuPopupFrame.h
@@ -6,16 +6,17 @@
//
// nsMenuPopupFrame
//
#ifndef nsMenuPopupFrame_h__
#define nsMenuPopupFrame_h__
#include "mozilla/Attributes.h"
+#include "mozilla/gfx/Types.h"
#include "nsIAtom.h"
#include "nsGkAtoms.h"
#include "nsCOMPtr.h"
#include "nsMenuFrame.h"
#include "nsBoxFrame.h"
#include "nsMenuParent.h"
@@ -380,27 +381,26 @@ public:
// underneath the taskbar, dock or other fixed OS elements.
// This operates in device pixels.
mozilla::LayoutDeviceIntRect
GetConstraintRect(const mozilla::LayoutDeviceIntRect& aAnchorRect,
const mozilla::LayoutDeviceIntRect& aRootScreenRect,
nsPopupLevel aPopupLevel);
// Determines whether the given edges of the popup may be moved, where
- // aHorizontalSide and aVerticalSide are one of the NS_SIDE_* constants, or
- // 0 for no movement in that direction. aChange is the distance to move on
- // those sides. If will be reset to 0 if the side cannot be adjusted at all
- // in that direction. For example, a popup cannot be moved if it is anchored
- // on a particular side.
+ // aHorizontalSide and aVerticalSide are one of the enum Side constants.
+ // aChange is the distance to move on those sides. If will be reset to 0
+ // if the side cannot be adjusted at all in that direction. For example, a
+ // popup cannot be moved if it is anchored on a particular side.
//
// Later, when bug 357725 is implemented, we can make this adjust aChange by
// the amount that the side can be resized, so that minimums and maximums
// can be taken into account.
- void CanAdjustEdges(int8_t aHorizontalSide,
- int8_t aVerticalSide,
+ void CanAdjustEdges(mozilla::Side aHorizontalSide,
+ mozilla::Side aVerticalSide,
mozilla::LayoutDeviceIntPoint& aChange);
// Return true if the popup is positioned relative to an anchor.
bool IsAnchored() const { return mAnchorType != MenuPopupAnchorType_Point; }
// Return the anchor if there is one.
nsIContent* GetAnchor() const { return mAnchorContent; }