Back out 5 changesets (bug 1028460, bug 1031444) for somehow breaking asmjscache/test/test_cachingBasic.html on Android 2.2

Backed out changeset 0b5918ec6521 (bug 1031444)
Backed out changeset 663ff18cd4a1 (bug 1028460)
Backed out changeset ae01b3919c8c (bug 1028460)
Backed out changeset 316c8dfeca9b (bug 1028460)
Backed out changeset e237b2c61ea2 (bug 1028460)
This commit is contained in:
Phil Ringnalda 2014-06-28 22:01:28 -07:00
parent 7235f6934a
commit 92fe6a5293
41 changed files with 210 additions and 335 deletions

View File

@ -22,10 +22,10 @@ public:
void Display(nsAString& aValue);
void TextAlign(nsAString& aValue);
void TextIndent(nsAString& aValue);
void MarginLeft(nsAString& aValue) { Margin(eSideLeft, aValue); }
void MarginRight(nsAString& aValue) { Margin(eSideRight, aValue); }
void MarginTop(nsAString& aValue) { Margin(eSideTop, aValue); }
void MarginBottom(nsAString& aValue) { Margin(eSideBottom, aValue); }
void MarginLeft(nsAString& aValue) { Margin(css::eSideLeft, aValue); }
void MarginRight(nsAString& aValue) { Margin(css::eSideRight, aValue); }
void MarginTop(nsAString& aValue) { Margin(css::eSideTop, aValue); }
void MarginBottom(nsAString& aValue) { Margin(css::eSideBottom, aValue); }
static void FormatColor(const nscolor& aValue, nsString& aFormattedValue);
static void FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue);
@ -36,7 +36,7 @@ private:
StyleInfo(const StyleInfo&) MOZ_DELETE;
StyleInfo& operator = (const StyleInfo&) MOZ_DELETE;
void Margin(Side aSide, nsAString& aValue);
void Margin(css::Side aSide, nsAString& aValue);
dom::Element* mElement;
nsRefPtr<nsStyleContext> mStyleContext;

View File

@ -9,57 +9,6 @@
#include "Types.h"
namespace mozilla {
/**
* Sides represents a set of physical sides.
*/
struct Sides MOZ_FINAL {
Sides() : mBits(0) {}
explicit Sides(SideBits aSideBits)
{
MOZ_ASSERT((aSideBits & ~eSideBitsAll) == 0, "illegal side bits");
mBits = aSideBits;
}
bool IsEmpty() const { return mBits == 0; }
bool Top() const { return mBits & eSideBitsTop; }
bool Right() const { return mBits & eSideBitsRight; }
bool Bottom() const { return mBits & eSideBitsBottom; }
bool Left() const { return mBits & eSideBitsLeft; }
bool Contains(SideBits aSideBits) const
{
MOZ_ASSERT((aSideBits & ~eSideBitsAll) == 0, "illegal side bits");
return (mBits & aSideBits) == aSideBits;
}
Sides operator|(Sides aOther) const
{
return Sides(SideBits(mBits | aOther.mBits));
}
Sides operator|(SideBits aSideBits) const
{
return *this | Sides(aSideBits);
}
Sides& operator|=(Sides aOther)
{
mBits |= aOther.mBits;
return *this;
}
Sides& operator|=(SideBits aSideBits)
{
return *this |= Sides(aSideBits);
}
bool operator==(Sides aOther) const
{
return mBits == aOther.mBits;
}
bool operator!=(Sides aOther) const
{
return !(*this == aOther);
}
private:
uint8_t mBits;
};
namespace gfx {
/**
@ -68,7 +17,7 @@ namespace gfx {
*/
template <class T, class Sub>
struct BaseMargin {
typedef mozilla::Side SideT; // because we have a method named Side
typedef mozilla::css::Side SideT;
// Do not change the layout of these members; the Side() methods below
// depend on this order.
@ -96,18 +45,18 @@ struct BaseMargin {
return *(&top + T(aSide));
}
void ApplySkipSides(Sides aSkipSides)
void ApplySkipSides(int aSkipSides)
{
if (aSkipSides.Top()) {
if (aSkipSides & (1 << mozilla::css::eSideTop)) {
top = 0;
}
if (aSkipSides.Right()) {
if (aSkipSides & (1 << mozilla::css::eSideRight)) {
right = 0;
}
if (aSkipSides.Bottom()) {
if (aSkipSides & (1 << mozilla::css::eSideBottom)) {
bottom = 0;
}
if (aSkipSides.Left()) {
if (aSkipSides & (1 << mozilla::css::eSideLeft)) {
left = 0;
}
}

View File

@ -264,25 +264,17 @@ struct GradientStop
#define GFX2D_API
#endif
// Side constants for use in various places
namespace mozilla {
// Side constants for use in various places.
enum Side { eSideTop, eSideRight, eSideBottom, eSideLeft };
namespace css {
enum Side {eSideTop, eSideRight, eSideBottom, eSideLeft};
}
}
enum SideBits {
eSideBitsNone = 0,
eSideBitsTop = 1 << eSideTop,
eSideBitsRight = 1 << eSideRight,
eSideBitsBottom = 1 << eSideBottom,
eSideBitsLeft = 1 << eSideLeft,
eSideBitsTopBottom = eSideBitsTop | eSideBitsBottom,
eSideBitsLeftRight = eSideBitsLeft | eSideBitsRight,
eSideBitsAll = eSideBitsTopBottom | eSideBitsLeftRight
};
} // namespace mozilla
#define NS_SIDE_TOP mozilla::eSideTop
#define NS_SIDE_RIGHT mozilla::eSideRight
#define NS_SIDE_BOTTOM mozilla::eSideBottom
#define NS_SIDE_LEFT mozilla::eSideLeft
// XXX - These don't really belong here. But for now this is where they go.
#define NS_SIDE_TOP mozilla::css::eSideTop
#define NS_SIDE_RIGHT mozilla::css::eSideRight
#define NS_SIDE_BOTTOM mozilla::css::eSideBottom
#define NS_SIDE_LEFT mozilla::css::eSideLeft
#endif /* MOZILLA_GFX_TYPES_H_ */

View File

@ -87,7 +87,7 @@ struct gfxRect :
return gfxPoint(0.0, 0.0);
}
gfxPoint CCWCorner(mozilla::Side side) const {
gfxPoint CCWCorner(mozilla::css::Side side) const {
switch (side) {
case NS_SIDE_TOP: return TopLeft();
case NS_SIDE_RIGHT: return TopRight();
@ -97,7 +97,7 @@ struct gfxRect :
MOZ_CRASH("Incomplete switch");
}
gfxPoint CWCorner(mozilla::Side side) const {
gfxPoint CWCorner(mozilla::css::Side side) const {
switch (side) {
case NS_SIDE_TOP: return TopRight();
case NS_SIDE_RIGHT: return BottomRight();

View File

@ -303,7 +303,7 @@ protected:
nsIFrame* inlineFrame = GetPrevContinuation(aFrame);
while (inlineFrame) {
if (!mLeftBorderData.mFrame &&
!inlineFrame->GetSkipSides().Left()) {
!(inlineFrame->GetSkipSides() & SIDE_BIT_LEFT)) {
mLeftBorderData.mFrame = inlineFrame;
}
nsRect rect = inlineFrame->GetRect();
@ -321,7 +321,7 @@ protected:
inlineFrame = aFrame;
while (inlineFrame) {
if (!mLeftBorderData.mFrame &&
!inlineFrame->GetSkipSides().Left()) {
!(inlineFrame->GetSkipSides() & SIDE_BIT_LEFT)) {
mLeftBorderData.mFrame = inlineFrame;
}
nsRect rect = inlineFrame->GetRect();
@ -362,7 +362,7 @@ static void DrawBorderImage(nsPresContext* aPresContext,
const nsRect& aBorderArea,
const nsStyleBorder& aStyleBorder,
const nsRect& aDirtyRect,
Sides aSkipSides);
int aSkipSides);
static nscolor MakeBevelColor(mozilla::css::Side whichSide, uint8_t style,
nscolor aBackgroundColor,
@ -439,10 +439,10 @@ GetRadii(nsIFrame* aForFrame, const nsStyleBorder& aBorder,
nsSize frameSize = aForFrame->GetSize();
if (&aBorder == aForFrame->StyleBorder() &&
frameSize == aOrigBorderArea.Size()) {
haveRoundedCorners = aForFrame->GetBorderRadii(sz, sz, Sides(), radii);
haveRoundedCorners = aForFrame->GetBorderRadii(sz, sz, 0, radii);
} else {
haveRoundedCorners =
nsIFrame::ComputeBorderRadii(aBorder.mBorderRadius, frameSize, sz, Sides(), radii);
nsIFrame::ComputeBorderRadii(aBorder.mBorderRadius, frameSize, sz, 0, radii);
}
if (haveRoundedCorners) {
auto d2a = aForFrame->PresContext()->AppUnitsPerDevPixel();
@ -561,7 +561,7 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
const nsRect& aDirtyRect,
const nsRect& aBorderArea,
nsStyleContext* aStyleContext,
Sides aSkipSides)
int aSkipSides)
{
PROFILER_LABEL("nsCSSRendering", "PaintBorder",
js::ProfileEntry::Category::GRAPHICS);
@ -606,7 +606,7 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
const nsRect& aBorderArea,
const nsStyleBorder& aStyleBorder,
nsStyleContext* aStyleContext,
Sides aSkipSides)
int aSkipSides)
{
SN("++ PaintBorder");
@ -660,7 +660,7 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
ctx->Save();
if (::IsBoxDecorationSlice(aStyleBorder)) {
if (aSkipSides.IsEmpty()) {
if (aSkipSides == 0) {
// No continuations most likely, or ::first-letter that wants all border-
// sides on the first continuation.
joinedBorderArea = aBorderArea;
@ -675,7 +675,7 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
} else {
MOZ_ASSERT(joinedBorderArea.IsEqualEdges(aBorderArea),
"Should use aBorderArea for box-decoration-break:clone");
MOZ_ASSERT(aForFrame->GetSkipSides().IsEmpty(),
MOZ_ASSERT(aForFrame->GetSkipSides() == 0,
"Should not skip sides for box-decoration-break:clone except "
"::first-letter/line continuations or other frame types that "
"don't have borders but those shouldn't reach this point.");
@ -801,7 +801,7 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
// get the radius for our outline
nsIFrame::ComputeBorderRadii(ourOutline->mOutlineRadius, aBorderArea.Size(),
outerRect.Size(), Sides(), twipsRadii);
outerRect.Size(), 0, twipsRadii);
// Get our conversion values
nscoord twipsPerPixel = aPresContext->DevPixelsToAppUnits(1);
@ -1201,7 +1201,7 @@ nsCSSRendering::PaintBoxShadowOuter(nsPresContext* aPresContext,
NS_ASSERTION(aFrameArea.Size() == aForFrame->VisualBorderRectRelativeToSelf().Size(),
"unexpected size");
nsSize sz = frameRect.Size();
hasBorderRadius = aForFrame->GetBorderRadii(sz, sz, Sides(), twipsRadii);
hasBorderRadius = aForFrame->GetBorderRadii(sz, sz, 0, twipsRadii);
if (hasBorderRadius) {
ComputePixelRadii(twipsRadii, twipsPerPixel, &borderRadii);
}
@ -1230,7 +1230,7 @@ nsCSSRendering::PaintBoxShadowOuter(nsPresContext* aPresContext,
std::max(borderRadii[C_BL].height, borderRadii[C_BR].height), 0));
}
Sides skipSides = aForFrame->GetSkipSides();
int skipSides = aForFrame->GetSkipSides();
for (uint32_t i = shadows->Length(); i > 0; --i) {
nsCSSShadowItem* shadowItem = shadows->ShadowAt(i - 1);
if (shadowItem->mInset)
@ -1325,25 +1325,25 @@ nsCSSRendering::PaintBoxShadowOuter(nsPresContext* aPresContext,
// Clip the shadow so that we only get the part that applies to aForFrame.
nsRect fragmentClip = shadowRectPlusBlur;
if (!skipSides.IsEmpty()) {
if (skipSides.Left()) {
if (skipSides) {
if (skipSides & SIDE_BIT_LEFT) {
nscoord xmost = fragmentClip.XMost();
fragmentClip.x = aFrameArea.x;
fragmentClip.width = xmost - fragmentClip.x;
}
if (skipSides.Right()) {
if (skipSides & SIDE_BIT_RIGHT) {
nscoord xmost = fragmentClip.XMost();
nscoord overflow = xmost - aFrameArea.XMost();
if (overflow > 0) {
fragmentClip.width -= overflow;
}
}
if (skipSides.Top()) {
if (skipSides & SIDE_BIT_TOP) {
nscoord ymost = fragmentClip.YMost();
fragmentClip.y = aFrameArea.y;
fragmentClip.height = ymost - fragmentClip.y;
}
if (skipSides.Bottom()) {
if (skipSides & SIDE_BIT_BOTTOM) {
nscoord ymost = fragmentClip.YMost();
nscoord overflow = ymost - aFrameArea.YMost();
if (overflow > 0) {
@ -1414,7 +1414,7 @@ nsCSSRendering::PaintBoxShadowInner(nsPresContext* aPresContext,
// if the frame does.
nscoord twipsRadii[8];
nsSize sz = frameRect.Size();
bool hasBorderRadius = aForFrame->GetBorderRadii(sz, sz, Sides(), twipsRadii);
bool hasBorderRadius = aForFrame->GetBorderRadii(sz, sz, 0, twipsRadii);
const nscoord twipsPerPixel = aPresContext->DevPixelsToAppUnits(1);
gfxCornerSizes innerRadii;
@ -3296,7 +3296,7 @@ DrawBorderImage(nsPresContext* aPresContext,
const nsRect& aBorderArea,
const nsStyleBorder& aStyleBorder,
const nsRect& aDirtyRect,
Sides aSkipSides)
int aSkipSides)
{
NS_PRECONDITION(aStyleBorder.IsBorderImageLoaded(),
"drawing border image that isn't successfully loaded");
@ -3329,7 +3329,7 @@ DrawBorderImage(nsPresContext* aPresContext,
nsRect borderImgArea;
nsMargin borderWidths(aStyleBorder.GetComputedBorder());
nsMargin imageOutset(aStyleBorder.GetImageOutset());
if (::IsBoxDecorationSlice(aStyleBorder) && !aSkipSides.IsEmpty()) {
if (::IsBoxDecorationSlice(aStyleBorder) && aSkipSides != 0) {
borderImgArea =
::BoxDecorationRectForBorder(aForFrame, aBorderArea, &aStyleBorder);
if (borderImgArea.IsEqualEdges(aBorderArea)) {

View File

@ -279,8 +279,6 @@ struct nsBackgroundLayerState {
};
struct nsCSSRendering {
typedef nsIFrame::Sides Sides;
/**
* Initialize any static variables used by nsCSSRendering.
*/
@ -310,8 +308,8 @@ struct nsCSSRendering {
/**
* Render the border for an element using css rendering rules
* for borders. aSkipSides says which sides to skip
* when rendering, the default is to skip none.
* for borders. aSkipSides is a bitmask of the sides to skip
* when rendering. If 0 then no sides are skipped.
*/
static void PaintBorder(nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext,
@ -319,12 +317,11 @@ struct nsCSSRendering {
const nsRect& aDirtyRect,
const nsRect& aBorderArea,
nsStyleContext* aStyleContext,
Sides aSkipSides = Sides());
int aSkipSides = 0);
/**
* Like PaintBorder, but taking an nsStyleBorder argument instead of
* getting it from aStyleContext. aSkipSides says which sides to skip
* when rendering, the default is to skip none.
* getting it from aStyleContext.
*/
static void PaintBorderWithStyleBorder(nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext,
@ -333,12 +330,13 @@ struct nsCSSRendering {
const nsRect& aBorderArea,
const nsStyleBorder& aBorderStyle,
nsStyleContext* aStyleContext,
Sides aSkipSides = Sides());
int aSkipSides = 0);
/**
* Render the outline for an element using css rendering rules
* for borders.
* for borders. aSkipSides is a bitmask of the sides to skip
* when rendering. If 0 then no sides are skipped.
*/
static void PaintOutline(nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext,

View File

@ -15,6 +15,8 @@
#include "nsLayoutUtils.h"
#include "RestyleTracker.h"
using namespace mozilla::css;
namespace mozilla {
void DestroyStickyScrollContainer(void* aPropertyValue)

View File

@ -36,71 +36,14 @@
#define CHECK_WRITING_MODE(param) \
NS_ASSERTION(param == mWritingMode, "writing-mode mismatch")
namespace mozilla {
// Logical side constants for use in various places.
enum LogicalSide { eLogicalSideBStart, eLogicalSideBEnd,
eLogicalSideIStart, eLogicalSideIEnd };
enum LogicalSideBits {
eLogicalSideBitsNone = 0,
eLogicalSideBitsBStart = 1 << eLogicalSideBStart,
eLogicalSideBitsBEnd = 1 << eLogicalSideBEnd,
eLogicalSideBitsIEnd = 1 << eLogicalSideIEnd,
eLogicalSideBitsIStart = 1 << eLogicalSideIStart,
eLogicalSideBitsBBoth = eLogicalSideBitsBStart | eLogicalSideBitsBEnd,
eLogicalSideBitsIBoth = eLogicalSideBitsIStart | eLogicalSideBitsIEnd,
eLogicalSideBitsAll = eLogicalSideBitsBBoth | eLogicalSideBitsIBoth
};
/**
* LogicalSides represents a set of logical sides.
*/
struct LogicalSides MOZ_FINAL {
LogicalSides() : mBits(0) {}
explicit LogicalSides(LogicalSideBits aSideBits)
{
MOZ_ASSERT((aSideBits & ~eLogicalSideBitsAll) == 0, "illegal side bits");
mBits = aSideBits;
}
bool IsEmpty() const { return mBits == 0; }
bool BStart() const { return mBits & eLogicalSideBitsBStart; }
bool BEnd() const { return mBits & eLogicalSideBitsBEnd; }
bool IStart() const { return mBits & eLogicalSideBitsIStart; }
bool IEnd() const { return mBits & eLogicalSideBitsIEnd; }
bool Contains(LogicalSideBits aSideBits) const
{
MOZ_ASSERT((aSideBits & ~eLogicalSideBitsAll) == 0, "illegal side bits");
return (mBits & aSideBits) == aSideBits;
}
LogicalSides operator|(LogicalSides aOther) const
{
return LogicalSides(LogicalSideBits(mBits | aOther.mBits));
}
LogicalSides operator|(LogicalSideBits aSideBits) const
{
return *this | LogicalSides(aSideBits);
}
LogicalSides& operator|=(LogicalSides aOther)
{
mBits |= aOther.mBits;
return *this;
}
LogicalSides& operator|=(LogicalSideBits aSideBits)
{
return *this |= LogicalSides(aSideBits);
}
bool operator==(LogicalSides aOther) const
{
return mBits == aOther.mBits;
}
bool operator!=(LogicalSides aOther) const
{
return !(*this == aOther);
}
private:
uint8_t mBits;
};
#define LOGICAL_SIDE_B_START 1
#define LOGICAL_SIDE_I_START 2
#define LOGICAL_SIDE_B_END 4
#define LOGICAL_SIDE_I_END 8
#define LOGICAL_SIDES_I_BOTH (LOGICAL_SIDE_I_START | LOGICAL_SIDE_I_END)
#define LOGICAL_SIDES_B_BOTH (LOGICAL_SIDE_B_START | LOGICAL_SIDE_B_END)
#define LOGICAL_SIDES_ALL (LOGICAL_SIDE_I_START | LOGICAL_SIDE_I_END | \
LOGICAL_SIDE_B_START | LOGICAL_SIDE_B_END)
/**
* mozilla::WritingMode is an immutable class representing a
@ -114,6 +57,9 @@ private:
* See CSS3 Writing Modes for more information
* http://www.w3.org/TR/css3-writing-modes/
*/
namespace mozilla {
class WritingMode {
public:
/**
@ -896,18 +842,18 @@ public:
*this : LogicalMargin(aToMode, GetPhysicalMargin(aFromMode));
}
void ApplySkipSides(LogicalSides aSkipSides)
void ApplySkipSides(int aSkipSides)
{
if (aSkipSides.BStart()) {
if (aSkipSides & LOGICAL_SIDE_B_START) {
BStart() = 0;
}
if (aSkipSides.BEnd()) {
if (aSkipSides & LOGICAL_SIDE_B_END) {
BEnd() = 0;
}
if (aSkipSides.IStart()) {
if (aSkipSides & LOGICAL_SIDE_I_START) {
IStart() = 0;
}
if (aSkipSides.IEnd()) {
if (aSkipSides & LOGICAL_SIDE_I_END) {
IEnd() = 0;
}
}

View File

@ -1038,7 +1038,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
aReflowState.ComputedBSize() != NS_AUTOHEIGHT &&
ShouldApplyOverflowClipping(this, aReflowState.mStyleDisplay)) {
LogicalMargin blockDirExtras = aReflowState.ComputedLogicalBorderPadding();
if (GetLogicalSkipSides().BStart()) {
if (GetLogicalSkipSides() & (LOGICAL_SIDE_B_START)) {
blockDirExtras.BStart(wm) = 0;
} else {
// Bottom margin never causes us to create continuations, so we

View File

@ -48,19 +48,18 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState,
SetFlag(BRS_ISFIRSTINFLOW, aFrame->GetPrevInFlow() == nullptr);
SetFlag(BRS_ISOVERFLOWCONTAINER, IS_TRUE_OVERFLOW_CONTAINER(aFrame));
nsIFrame::LogicalSides logicalSkipSides =
aFrame->GetLogicalSkipSides(&aReflowState);
int logicalSkipSides = aFrame->GetLogicalSkipSides(&aReflowState);
mBorderPadding.ApplySkipSides(logicalSkipSides);
// Note that mContainerWidth is the physical width!
mContainerWidth = aReflowState.ComputedWidth() + mBorderPadding.LeftRight(wm);
if ((aBStartMarginRoot && !logicalSkipSides.BStart()) ||
if ((aBStartMarginRoot && !(logicalSkipSides & LOGICAL_SIDE_B_START)) ||
0 != mBorderPadding.BStart(wm)) {
SetFlag(BRS_ISBSTARTMARGINROOT, true);
SetFlag(BRS_APPLYBSTARTMARGIN, true);
}
if ((aBEndMarginRoot && !logicalSkipSides.BEnd()) ||
if ((aBEndMarginRoot && !(logicalSkipSides & LOGICAL_SIDE_B_END)) ||
0 != mBorderPadding.BEnd(wm)) {
SetFlag(BRS_ISBENDMARGINROOT, true);
}

View File

@ -110,12 +110,10 @@ nsColumnSetFrame::PaintColumnRule(nsRenderingContext* aCtx,
contentRect.y);
nsRect lineRect(linePt, ruleSize);
// Remember, we only have the "left" "border". Skip everything else.
Sides skipSides(mozilla::eSideBitsTopBottom);
skipSides |= mozilla::eSideBitsRight;
nsCSSRendering::PaintBorderWithStyleBorder(presContext, *aCtx, this,
aDirtyRect, lineRect, border, StyleContext(),
skipSides);
// Remember, we only have the "left" "border". Skip everything else
(1 << NS_SIDE_TOP | 1 << NS_SIDE_RIGHT | 1 << NS_SIDE_BOTTOM));
child = nextSibling;
nextSibling = nextSibling->GetNextSibling();

View File

@ -378,7 +378,7 @@ nsFirstLetterFrame::GetLogicalBaseline(WritingMode aWritingMode) const
return mBaseline;
}
nsIFrame::LogicalSides
int
nsFirstLetterFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
{
if (GetPrevContinuation()) {
@ -387,7 +387,7 @@ nsFirstLetterFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) c
// properties that could trigger a call to GetSkipSides. Then again,
// it's not really an error to call GetSkipSides on any frame, so
// that's why we handle it properly.
return LogicalSides(eLogicalSideBitsAll);
return LOGICAL_SIDES_ALL;
}
return LogicalSides(); // first continuation displays all sides
return 0; // first continuation displays all sides
}

View File

@ -60,7 +60,7 @@ public:
virtual bool CanContinueTextRun() const MOZ_OVERRIDE;
virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const MOZ_OVERRIDE;
virtual LogicalSides GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
virtual int GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
//override of nsFrame method
virtual nsresult GetChildFrameContainingOffset(int32_t inContentOffset,

View File

@ -21,6 +21,7 @@
#include "mozilla/LinkedList.h"
using namespace mozilla;
using namespace mozilla::css;
using namespace mozilla::layout;
// Convenience typedefs for helper classes that we forward-declare in .h file
@ -73,8 +74,8 @@ enum AxisEdgeType {
};
// This array maps each axis orientation to a pair of corresponding
// [start, end] physical mozilla::Side values.
static const mozilla::Side
// [start, end] physical mozilla::css::Side values.
static const Side
kAxisOrientationToSidesMap[eNumAxisOrientationTypes][eNumAxisEdges] = {
{ eSideLeft, eSideRight }, // eAxis_LR
{ eSideRight, eSideLeft }, // eAxis_RL
@ -154,7 +155,7 @@ PhysicalPosFromLogicalPos(nscoord aLogicalPosn,
}
static nscoord
MarginComponentForSide(const nsMargin& aMargin, mozilla::Side aSide)
MarginComponentForSide(const nsMargin& aMargin, Side aSide)
{
switch (aSide) {
case eSideLeft:
@ -173,7 +174,7 @@ MarginComponentForSide(const nsMargin& aMargin, mozilla::Side aSide)
}
static nscoord&
MarginComponentForSide(nsMargin& aMargin, mozilla::Side aSide)
MarginComponentForSide(nsMargin& aMargin, Side aSide)
{
switch (aSide) {
case eSideLeft:
@ -414,15 +415,15 @@ public:
// ===================
const nsMargin& GetMargin() const { return mMargin; }
// Returns the margin component for a given mozilla::Side
nscoord GetMarginComponentForSide(mozilla::Side aSide) const
// Returns the margin component for a given mozilla::css::Side
nscoord GetMarginComponentForSide(Side aSide) const
{ return MarginComponentForSide(mMargin, aSide); }
// Returns the total space occupied by this item's margins in the given axis
nscoord GetMarginSizeInAxis(AxisOrientationType aAxis) const
{
mozilla::Side startSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_Start];
mozilla::Side endSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_End];
Side startSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_Start];
Side endSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_End];
return GetMarginComponentForSide(startSide) +
GetMarginComponentForSide(endSide);
}
@ -431,16 +432,16 @@ public:
// ==========================
const nsMargin& GetBorderPadding() const { return mBorderPadding; }
// Returns the border+padding component for a given mozilla::Side
nscoord GetBorderPaddingComponentForSide(mozilla::Side aSide) const
// Returns the border+padding component for a given mozilla::css::Side
nscoord GetBorderPaddingComponentForSide(Side aSide) const
{ return MarginComponentForSide(mBorderPadding, aSide); }
// Returns the total space occupied by this item's borders and padding in
// the given axis
nscoord GetBorderPaddingSizeInAxis(AxisOrientationType aAxis) const
{
mozilla::Side startSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_Start];
mozilla::Side endSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_End];
Side startSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_Start];
Side endSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_End];
return GetBorderPaddingComponentForSide(startSide) +
GetBorderPaddingComponentForSide(endSide);
}
@ -550,7 +551,7 @@ public:
}
// Setter for margin components (for resolving "auto" margins)
void SetMarginComponentForSide(mozilla::Side aSide, nscoord aLength)
void SetMarginComponentForSide(Side aSide, nscoord aLength)
{
MOZ_ASSERT(mIsFrozen, "main size should be resolved before this");
MarginComponentForSide(mMargin, aSide) = aLength;
@ -1272,7 +1273,7 @@ FlexItem::GetBaselineOffsetFromOuterCrossEdge(AxisOrientationType aCrossAxis,
"Only expecting to be doing baseline computations when the "
"cross axis is vertical");
mozilla::Side sideToMeasureFrom = kAxisOrientationToSidesMap[aCrossAxis][aEdge];
Side sideToMeasureFrom = kAxisOrientationToSidesMap[aCrossAxis][aEdge];
nscoord marginTopToBaseline = mAscent + mMargin.top;
@ -1298,7 +1299,7 @@ FlexItem::GetNumAutoMarginsInAxis(AxisOrientationType aAxis) const
uint32_t numAutoMargins = 0;
const nsStyleSides& styleMargin = mFrame->StyleMargin()->mMargin;
for (uint32_t i = 0; i < eNumAxisEdges; i++) {
mozilla::Side side = kAxisOrientationToSidesMap[aAxis][i];
Side side = kAxisOrientationToSidesMap[aAxis][i];
if (styleMargin.GetUnit(side) == eStyleUnit_Auto) {
numAutoMargins++;
}
@ -1326,7 +1327,7 @@ public:
// axis we're tracking.
void EnterMargin(const nsMargin& aMargin)
{
mozilla::Side side = kAxisOrientationToSidesMap[mAxis][eAxisEdge_Start];
Side side = kAxisOrientationToSidesMap[mAxis][eAxisEdge_Start];
mPosition += MarginComponentForSide(aMargin, side);
}
@ -1334,7 +1335,7 @@ public:
// we're tracking.
void ExitMargin(const nsMargin& aMargin)
{
mozilla::Side side = kAxisOrientationToSidesMap[mAxis][eAxisEdge_End];
Side side = kAxisOrientationToSidesMap[mAxis][eAxisEdge_End];
mPosition += MarginComponentForSide(aMargin, side);
}
@ -2092,7 +2093,7 @@ MainAxisPositionTracker::ResolveAutoMarginsInMainAxis(FlexItem& aItem)
if (mNumAutoMarginsInMainAxis) {
const nsStyleSides& styleMargin = aItem.Frame()->StyleMargin()->mMargin;
for (uint32_t i = 0; i < eNumAxisEdges; i++) {
mozilla::Side side = kAxisOrientationToSidesMap[mAxis][i];
Side side = kAxisOrientationToSidesMap[mAxis][i];
if (styleMargin.GetUnit(side) == eStyleUnit_Auto) {
// NOTE: This integer math will skew the distribution of remainder
// app-units towards the end, which is fine.
@ -2428,7 +2429,7 @@ SingleLineCrossAxisPositionTracker::
// Give each auto margin a share of the space.
const nsStyleSides& styleMargin = aItem.Frame()->StyleMargin()->mMargin;
for (uint32_t i = 0; i < eNumAxisEdges; i++) {
mozilla::Side side = kAxisOrientationToSidesMap[mAxis][i];
Side side = kAxisOrientationToSidesMap[mAxis][i];
if (styleMargin.GetUnit(side) == eStyleUnit_Auto) {
MOZ_ASSERT(aItem.GetMarginComponentForSide(side) == 0,
"Expecting auto margins to have value '0' before we "
@ -3112,7 +3113,7 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
// though.)
nscoord availableHeightForContent = aReflowState.AvailableHeight();
if (availableHeightForContent != NS_UNCONSTRAINEDSIZE &&
!GetSkipSides().Top()) {
!(GetSkipSides() & (1 << NS_SIDE_TOP))) {
availableHeightForContent -= aReflowState.ComputedPhysicalBorderPadding().top;
// (Don't let that push availableHeightForContent below zero, though):
availableHeightForContent = std::max(availableHeightForContent, 0);

View File

@ -952,51 +952,52 @@ nsIFrame::GetUsedPadding() const
return padding;
}
nsIFrame::Sides
int
nsIFrame::GetSkipSides(const nsHTMLReflowState* aReflowState) const
{
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
return Sides();
return 0;
}
// Convert the logical skip sides to physical sides using the frame's
// writing mode
WritingMode writingMode = GetWritingMode();
LogicalSides logicalSkip = GetLogicalSkipSides(aReflowState);
Sides skip;
int logicalSkip = GetLogicalSkipSides(aReflowState);
int skip = 0;
if (logicalSkip.BStart()) {
if (logicalSkip & LOGICAL_SIDE_B_START) {
if (writingMode.IsVertical()) {
skip |= writingMode.IsVerticalLR() ? eSideBitsLeft : eSideBitsRight;
skip |= 1 << (writingMode.IsVerticalLR() ? NS_SIDE_LEFT : NS_SIDE_RIGHT);
} else {
skip |= eSideBitsTop;
skip |= 1 << NS_SIDE_TOP;
}
}
if (logicalSkip.BEnd()) {
if (logicalSkip & LOGICAL_SIDE_B_END) {
if (writingMode.IsVertical()) {
skip |= writingMode.IsVerticalLR() ? eSideBitsRight : eSideBitsLeft;
skip |= 1 << (writingMode.IsVerticalLR() ? NS_SIDE_RIGHT : NS_SIDE_LEFT);
} else {
skip |= eSideBitsBottom;
skip |= 1 << NS_SIDE_BOTTOM;
}
}
if (logicalSkip.IStart()) {
if (logicalSkip & LOGICAL_SIDE_I_START) {
if (writingMode.IsVertical()) {
skip |= eSideBitsTop;
skip |= 1 << NS_SIDE_TOP;
} else {
skip |= writingMode.IsBidiLTR() ? eSideBitsLeft : eSideBitsRight;
skip |= 1 << (writingMode.IsBidiLTR() ? NS_SIDE_LEFT : NS_SIDE_RIGHT);
}
}
if (logicalSkip.IEnd()) {
if (logicalSkip & LOGICAL_SIDE_I_END) {
if (writingMode.IsVertical()) {
skip |= eSideBitsBottom;
skip |= 1 << NS_SIDE_BOTTOM;
} else {
skip |= writingMode.IsBidiLTR() ? eSideBitsRight : eSideBitsLeft;
skip |= 1 << (writingMode.IsBidiLTR() ? NS_SIDE_RIGHT : NS_SIDE_LEFT);
}
}
return skip;
}
@ -1142,7 +1143,7 @@ bool
nsIFrame::ComputeBorderRadii(const nsStyleCorners& aBorderRadius,
const nsSize& aFrameSize,
const nsSize& aBorderArea,
Sides aSkipSides,
int aSkipSides,
nscoord aRadii[8])
{
// Percentages are relative to whichever side they're on.
@ -1163,28 +1164,28 @@ nsIFrame::ComputeBorderRadii(const nsStyleCorners& aBorderRadius,
}
}
if (aSkipSides.Top()) {
if (aSkipSides & (1 << NS_SIDE_TOP)) {
aRadii[NS_CORNER_TOP_LEFT_X] = 0;
aRadii[NS_CORNER_TOP_LEFT_Y] = 0;
aRadii[NS_CORNER_TOP_RIGHT_X] = 0;
aRadii[NS_CORNER_TOP_RIGHT_Y] = 0;
}
if (aSkipSides.Right()) {
if (aSkipSides & (1 << NS_SIDE_RIGHT)) {
aRadii[NS_CORNER_TOP_RIGHT_X] = 0;
aRadii[NS_CORNER_TOP_RIGHT_Y] = 0;
aRadii[NS_CORNER_BOTTOM_RIGHT_X] = 0;
aRadii[NS_CORNER_BOTTOM_RIGHT_Y] = 0;
}
if (aSkipSides.Bottom()) {
if (aSkipSides & (1 << NS_SIDE_BOTTOM)) {
aRadii[NS_CORNER_BOTTOM_RIGHT_X] = 0;
aRadii[NS_CORNER_BOTTOM_RIGHT_Y] = 0;
aRadii[NS_CORNER_BOTTOM_LEFT_X] = 0;
aRadii[NS_CORNER_BOTTOM_LEFT_Y] = 0;
}
if (aSkipSides.Left()) {
if (aSkipSides & (1 << NS_SIDE_LEFT)) {
aRadii[NS_CORNER_BOTTOM_LEFT_X] = 0;
aRadii[NS_CORNER_BOTTOM_LEFT_Y] = 0;
aRadii[NS_CORNER_TOP_LEFT_X] = 0;
@ -1245,7 +1246,7 @@ nsIFrame::OutsetBorderRadii(nscoord aRadii[8], const nsMargin &aOffsets)
/* virtual */ bool
nsIFrame::GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
Sides aSkipSides, nscoord aRadii[8]) const
int aSkipSides, nscoord aRadii[8]) const
{
if (IsThemed()) {
// When we're themed, the native theme code draws the border and

View File

@ -4338,7 +4338,7 @@ ReduceRadii(nscoord aXBorder, nscoord aYBorder,
bool
ScrollFrameHelper::GetBorderRadii(const nsSize& aFrameSize,
const nsSize& aBorderArea,
Sides aSkipSides,
int aSkipSides,
nscoord aRadii[8]) const
{
if (!mOuter->nsContainerFrame::GetBorderRadii(aFrameSize, aBorderArea,

View File

@ -39,7 +39,6 @@ namespace mozilla {
class ScrollFrameHelper : public nsIReflowCallback {
public:
typedef nsIFrame::Sides Sides;
typedef mozilla::CSSIntPoint CSSIntPoint;
typedef mozilla::layout::ScrollbarActivity ScrollbarActivity;
@ -73,7 +72,7 @@ public:
bool aPositioned);
bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
Sides aSkipSides, nscoord aRadii[8]) const;
int aSkipSides, nscoord aRadii[8]) const;
// nsIReflowCallback
virtual bool ReflowFinished() MOZ_OVERRIDE;
@ -481,7 +480,7 @@ public:
nscoord GetIntrinsicVScrollbarWidth(nsRenderingContext *aRenderingContext);
virtual bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
Sides aSkipSides, nscoord aRadii[8]) const MOZ_OVERRIDE {
int aSkipSides, nscoord aRadii[8]) const MOZ_OVERRIDE {
return mHelper.GetBorderRadii(aFrameSize, aBorderArea, aSkipSides, aRadii);
}
@ -830,7 +829,7 @@ public:
virtual nsresult GetPadding(nsMargin& aPadding) MOZ_OVERRIDE;
virtual bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
Sides aSkipSides, nscoord aRadii[8]) const MOZ_OVERRIDE {
int aSkipSides, nscoord aRadii[8]) const MOZ_OVERRIDE {
return mHelper.GetBorderRadii(aFrameSize, aBorderArea, aSkipSides, aRadii);
}

View File

@ -408,8 +408,6 @@ public:
typedef mozilla::layout::FrameChildListIterator ChildListIterator;
typedef mozilla::layout::FrameChildListArrayIterator ChildListArrayIterator;
typedef mozilla::gfx::Matrix Matrix;
typedef mozilla::Sides Sides;
typedef mozilla::LogicalSides LogicalSides;
NS_DECL_QUERYFRAME_TARGET(nsIFrame)
@ -919,10 +917,10 @@ public:
* Return whether any radii are nonzero.
*/
static bool ComputeBorderRadii(const nsStyleCorners& aBorderRadius,
const nsSize& aFrameSize,
const nsSize& aBorderArea,
Sides aSkipSides,
nscoord aRadii[8]);
const nsSize& aFrameSize,
const nsSize& aBorderArea,
int aSkipSides,
nscoord aRadii[8]);
/*
* Given a set of border radii for one box (e.g., border box), convert
@ -948,7 +946,7 @@ public:
*/
virtual bool GetBorderRadii(const nsSize& aFrameSize,
const nsSize& aBorderArea,
Sides aSkipSides,
int aSkipSides,
nscoord aRadii[8]) const;
bool GetBorderRadii(nscoord aRadii[8]) const;
@ -2305,10 +2303,8 @@ public:
bool ClearOverflowRects();
/**
* Determine whether borders, padding, margins etc should NOT be applied
* on certain sides of the frame.
* @see mozilla::Sides in gfx/2d/BaseMargin.h
* @see mozilla::LogicalSides in layout/generic/WritingModes.h
* Determine whether borders should not be painted on certain sides of the
* frame.
*
* @note (See also bug 743402, comment 11) GetSkipSides() checks to see
* if this frame has a previous or next continuation to determine
@ -2318,10 +2314,10 @@ public:
* passed in, indicating that it should be used to determine if sides
* should be skipped during reflow.
*/
Sides GetSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const;
virtual LogicalSides
int GetSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const;
virtual int
GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const {
return LogicalSides();
return 0;
}
/**

View File

@ -1836,19 +1836,19 @@ nsImageFrame::List(FILE* out, const char* aPrefix, uint32_t aFlags) const
}
#endif
nsIFrame::LogicalSides
int
nsImageFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
{
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
return LogicalSides();
return 0;
}
LogicalSides skip;
int skip = 0;
if (nullptr != GetPrevInFlow()) {
skip |= eLogicalSideBitsBStart;
skip |= LOGICAL_SIDE_B_START;
}
if (nullptr != GetNextInFlow()) {
skip |= eLogicalSideBitsBEnd;
skip |= LOGICAL_SIDE_B_END;
}
return skip;
}

View File

@ -118,7 +118,7 @@ public:
uint32_t aFlags = 0) const MOZ_OVERRIDE;
#endif
virtual LogicalSides GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
virtual int GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
nsresult GetIntrinsicImageSize(nsSize& aSize);

View File

@ -880,22 +880,22 @@ nsInlineFrame::PushFrames(nsPresContext* aPresContext,
//////////////////////////////////////////////////////////////////////
nsIFrame::LogicalSides
int
nsInlineFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
{
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
return LogicalSides();
return 0;
}
LogicalSides skip;
int skip = 0;
if (!IsFirst()) {
nsInlineFrame* prev = (nsInlineFrame*) GetPrevContinuation();
if ((GetStateBits() & NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET) ||
(prev && (prev->mRect.height || prev->mRect.width))) {
// Prev continuation is not empty therefore we don't render our start
// border edge.
skip |= eLogicalSideBitsIStart;
skip |= LOGICAL_SIDE_I_START;
}
else {
// If the prev continuation is empty, then go ahead and let our start
@ -908,7 +908,7 @@ nsInlineFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
(next && (next->mRect.height || next->mRect.width))) {
// Next continuation is not empty therefore we don't render our end
// border edge.
skip |= eLogicalSideBitsIEnd;
skip |= LOGICAL_SIDE_I_END;
}
else {
// If the next continuation is empty, then go ahead and let our end
@ -922,15 +922,15 @@ nsInlineFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
// a split should skip the "start" side. But figuring out which part of
// the split we are involves getting our first continuation, which might be
// expensive. So don't bother if we already have the relevant bits set.
if (skip != LogicalSides(eLogicalSideBitsIBoth)) {
if (skip != LOGICAL_SIDES_I_BOTH) {
// We're missing one of the skip bits, so check whether we need to set it.
// Only get the first continuation once, as an optimization.
nsIFrame* firstContinuation = FirstContinuation();
if (firstContinuation->FrameIsNonLastInIBSplit()) {
skip |= eLogicalSideBitsIEnd;
skip |= LOGICAL_SIDE_I_END;
}
if (firstContinuation->FrameIsNonFirstInIBSplit()) {
skip |= eLogicalSideBitsIStart;
skip |= LOGICAL_SIDE_I_START;
}
}
}

View File

@ -127,7 +127,7 @@ protected:
nsInlineFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
virtual LogicalSides GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
virtual int GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
void ReflowFrames(nsPresContext* aPresContext,
const nsHTMLReflowState& aReflowState,

View File

@ -12,8 +12,6 @@
#include "nsContainerFrame.h"
#include "nsIFrameInlines.h"
using namespace mozilla;
NS_IMPL_FRAMEARENA_HELPERS(nsSplittableFrame)
void
@ -237,21 +235,21 @@ nsSplittableFrame::GetEffectiveComputedBSize(const nsHTMLReflowState& aReflowSta
return std::max(0, bSize);
}
nsIFrame::LogicalSides
int
nsSplittableFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
{
if (IS_TRUE_OVERFLOW_CONTAINER(this)) {
return LogicalSides(eLogicalSideBitsBBoth);
return LOGICAL_SIDES_B_BOTH;
}
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
return LogicalSides();
return 0;
}
LogicalSides skip;
int skip = 0;
if (GetPrevInFlow()) {
skip |= eLogicalSideBitsBStart;
skip |= LOGICAL_SIDE_B_START;
}
if (aReflowState) {
@ -266,13 +264,13 @@ nsSplittableFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) co
effectiveCH > aReflowState->AvailableBSize()) {
// Our content height is going to exceed our available height, so we're
// going to need a next-in-flow.
skip |= eLogicalSideBitsBEnd;
skip |= LOGICAL_SIDE_B_END;
}
}
} else {
nsIFrame* nif = GetNextInFlow();
if (nif && !IS_TRUE_OVERFLOW_CONTAINER(nif)) {
skip |= eLogicalSideBitsBEnd;
skip |= LOGICAL_SIDE_B_END;
}
}

View File

@ -95,7 +95,7 @@ protected:
/**
* @see nsIFrame::GetLogicalSkipSides()
*/
virtual LogicalSides GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
virtual int GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
#ifdef DEBUG
virtual void DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, int32_t aIndent) MOZ_OVERRIDE;

View File

@ -1964,7 +1964,7 @@ void nsDisplayMathMLCharDebug::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx)
{
// for visual debug
Sides skipSides;
int skipSides = 0;
nsPresContext* presContext = mFrame->PresContext();
nsStyleContext* styleContext = mFrame->StyleContext();
nsRect rect = mRect + ToReferenceFrame();

View File

@ -95,7 +95,6 @@ COMPUTED_STYLE_PROP(border_top_style, BorderTopStyle)
COMPUTED_STYLE_PROP(border_top_width, BorderTopWidth)
//// COMPUTED_STYLE_PROP(border_width, BorderWidth)
COMPUTED_STYLE_PROP(bottom, Bottom)
COMPUTED_STYLE_PROP(box_decoration_break, BoxDecorationBreak)
COMPUTED_STYLE_PROP(box_shadow, BoxShadow)
COMPUTED_STYLE_PROP(box_sizing, BoxSizing)
COMPUTED_STYLE_PROP(caption_side, CaptionSide)

View File

@ -14,11 +14,10 @@
// XXX fold this into nsStyleContext and group by nsStyleXXX struct
// Indices into border/padding/margin arrays
namespace mozilla {
namespace css {
typedef mozilla::Side Side;
}
}
#define NS_SIDE_TOP mozilla::css::eSideTop
#define NS_SIDE_RIGHT mozilla::css::eSideRight
#define NS_SIDE_BOTTOM mozilla::css::eSideBottom
#define NS_SIDE_LEFT mozilla::css::eSideLeft
#define NS_FOR_CSS_SIDES(var_) for (mozilla::css::Side var_ = NS_SIDE_TOP; var_ <= NS_SIDE_LEFT; var_++)
static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {

View File

@ -201,11 +201,11 @@ public:
nscoord aSize,
bool aStart);
BCPixelSize GetCorner(mozilla::Side& aCornerOwner,
BCPixelSize GetCorner(mozilla::css::Side& aCornerOwner,
bool& aBevel) const;
void SetCorner(BCPixelSize aSubSize,
mozilla::Side aOwner,
mozilla::css::Side aOwner,
bool aBevel);
bool IsLeftStart() const;
@ -229,7 +229,7 @@ protected:
unsigned mTopOwner: 4; // owner of top border
unsigned mLeftStart: 1; // set if this is the start of a vertical border segment
unsigned mTopStart: 1; // set if this is the start of a horizontal border segment
unsigned mCornerSide: 2; // mozilla::Side of the owner of the upper left corner relative to the corner
unsigned mCornerSide: 2; // mozilla::css::Side of the owner of the upper left corner relative to the corner
unsigned mCornerBevel: 1; // is the corner beveled (only two segments, perpendicular, not dashed or dotted).
};
@ -449,16 +449,16 @@ inline void BCData::SetTopEdge(BCBorderOwner aOwner,
mTopStart = aStart;
}
inline BCPixelSize BCData::GetCorner(mozilla::Side& aOwnerSide,
inline BCPixelSize BCData::GetCorner(mozilla::css::Side& aOwnerSide,
bool& aBevel) const
{
aOwnerSide = mozilla::Side(mCornerSide);
aOwnerSide = mozilla::css::Side(mCornerSide);
aBevel = (bool)mCornerBevel;
return mCornerSubSize;
}
inline void BCData::SetCorner(BCPixelSize aSubSize,
mozilla::Side aOwnerSide,
mozilla::css::Side aOwnerSide,
bool aBevel)
{
mCornerSubSize = aSubSize;

View File

@ -728,7 +728,7 @@ nsTableCellMap::Dump(char* aString) const
printf("***** bottom borders *****\n");
nscoord size;
BCBorderOwner owner;
mozilla::Side side;
mozilla::css::Side side;
bool segStart;
bool bevel;
int32_t colIndex;
@ -970,7 +970,7 @@ nsTableCellMap::ResetTopStart(uint8_t aSide,
// top/left at that location. If the new location is at the right or bottom edge of the
// table, then store it one of the special arrays (right most borders, bottom most borders).
void
nsTableCellMap::SetBCBorderEdge(mozilla::Side aSide,
nsTableCellMap::SetBCBorderEdge(mozilla::css::Side aSide,
nsCellMap& aCellMap,
uint32_t aCellMapStart,
uint32_t aRowIndex,
@ -1070,7 +1070,7 @@ nsTableCellMap::SetBCBorderCorner(Corner aCorner,
uint32_t aCellMapStart,
uint32_t aRowIndex,
uint32_t aColIndex,
mozilla::Side aOwner,
mozilla::css::Side aOwner,
nscoord aSubSize,
bool aBevel,
bool aIsBottomRight)
@ -2584,7 +2584,7 @@ void nsCellMap::Dump(bool aIsBorderCollapse) const
if (aIsBorderCollapse) {
nscoord size;
BCBorderOwner owner;
mozilla::Side side;
mozilla::css::Side side;
bool segStart;
bool bevel;
for (int32_t i = 0; i <= 2; i++) {

View File

@ -204,7 +204,7 @@ public:
uint32_t aXPos,
bool aIsLowerRight = false);
void SetBCBorderEdge(mozilla::Side aEdge,
void SetBCBorderEdge(mozilla::css::Side aEdge,
nsCellMap& aCellMap,
uint32_t aCellMapStart,
uint32_t aYPos,
@ -219,7 +219,7 @@ public:
uint32_t aCellMapStart,
uint32_t aYPos,
uint32_t aXPos,
mozilla::Side aOwner,
mozilla::css::Side aOwner,
nscoord aSubSize,
bool aBevel,
bool aIsBottomRight = false);

View File

@ -545,20 +545,20 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
}
nsIFrame::LogicalSides
int
nsTableCellFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
{
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
return LogicalSides();
return 0;
}
LogicalSides skip;
int skip = 0;
if (nullptr != GetPrevInFlow()) {
skip |= eLogicalSideBitsBStart;
skip |= LOGICAL_SIDE_B_START;
}
if (nullptr != GetNextInFlow()) {
skip |= eLogicalSideBitsBEnd;
skip |= LOGICAL_SIDE_B_END;
}
return skip;
}
@ -1109,7 +1109,7 @@ nsBCTableCellFrame::GetUsedBorder() const
/* virtual */ bool
nsBCTableCellFrame::GetBorderRadii(const nsSize& aFrameSize,
const nsSize& aBorderArea,
Sides aSkipSides,
int aSkipSides,
nscoord aRadii[8]) const
{
NS_FOR_CSS_HALF_CORNERS(corner) {

View File

@ -222,7 +222,7 @@ public:
virtual void InvalidateFrameForRemoval() MOZ_OVERRIDE { InvalidateFrameSubtree(); }
protected:
virtual LogicalSides GetLogicalSkipSides(const nsHTMLReflowState* aReflowState= nullptr) const MOZ_OVERRIDE;
virtual int GetLogicalSkipSides(const nsHTMLReflowState* aReflowState= nullptr) const MOZ_OVERRIDE;
/**
* GetBorderOverflow says how far the cell's own borders extend
@ -301,7 +301,7 @@ public:
virtual nsMargin GetUsedBorder() const MOZ_OVERRIDE;
virtual bool GetBorderRadii(const nsSize& aFrameSize,
const nsSize& aBorderArea,
Sides aSkipSides,
int aSkipSides,
nscoord aRadii[8]) const MOZ_OVERRIDE;
// Get the *inner half of the border only*, in twips.

View File

@ -14,8 +14,6 @@
#include "nsCSSRendering.h"
#include "nsIPresShell.h"
using namespace mozilla;
#define COL_GROUP_TYPE_BITS (NS_FRAME_STATE_BIT(30) | \
NS_FRAME_STATE_BIT(31))
#define COL_GROUP_TYPE_OFFSET 30
@ -330,20 +328,20 @@ nsTableColGroupFrame::RemoveFrame(ChildListID aListID,
}
}
nsIFrame::LogicalSides
int
nsTableColGroupFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
{
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
return LogicalSides();
return 0;
}
LogicalSides skip;
int skip = 0;
if (nullptr != GetPrevInFlow()) {
skip |= eLogicalSideBitsBStart;
skip |= LOGICAL_SIDE_B_START;
}
if (nullptr != GetNextInFlow()) {
skip |= eLogicalSideBitsBEnd;
skip |= LOGICAL_SIDE_B_END;
}
return skip;
}

View File

@ -207,7 +207,7 @@ protected:
void InsertColsReflow(int32_t aColIndex,
const nsFrameList::Slice& aCols);
virtual LogicalSides GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
virtual int GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
// data members
int32_t mColCount;

View File

@ -1383,7 +1383,7 @@ nsTableFrame::PaintTableBorderBackground(nsRenderingContext& aRenderingContext,
if (StyleVisibility()->IsVisible()) {
if (!IsBorderCollapse()) {
Sides skipSides = GetSkipSides();
int skipSides = GetSkipSides();
nsRect rect(aPt, mRect.Size());
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
aDirtyRect, rect, mStyleContext, skipSides);
@ -1397,22 +1397,22 @@ nsTableFrame::PaintTableBorderBackground(nsRenderingContext& aRenderingContext,
}
}
nsIFrame::LogicalSides
int
nsTableFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
{
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
return LogicalSides();
return 0;
}
LogicalSides skip;
int skip = 0;
// frame attribute was accounted for in nsHTMLTableElement::MapTableBorderInto
// account for pagination
if (nullptr != GetPrevInFlow()) {
skip |= eLogicalSideBitsBStart;
skip |= LOGICAL_SIDE_B_START;
}
if (nullptr != GetNextInFlow()) {
skip |= eLogicalSideBitsBEnd;
skip |= LOGICAL_SIDE_B_END;
}
return skip;
}

View File

@ -580,7 +580,7 @@ protected:
void InitChildReflowState(nsHTMLReflowState& aReflowState);
virtual LogicalSides GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
virtual int GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
public:
bool IsRowInserted() const;

View File

@ -589,20 +589,20 @@ nsTableRowFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsTableFrame::DisplayGenericTablePart(aBuilder, this, aDirtyRect, aLists, item);
}
nsIFrame::LogicalSides
int
nsTableRowFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
{
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
return LogicalSides();
return 0;
}
LogicalSides skip;
int skip = 0;
if (nullptr != GetPrevInFlow()) {
skip |= eLogicalSideBitsBStart;
skip |= LOGICAL_SIDE_B_START;
}
if (nullptr != GetNextInFlow()) {
skip |= eLogicalSideBitsBEnd;
skip |= LOGICAL_SIDE_B_END;
}
return skip;
}

View File

@ -244,7 +244,7 @@ protected:
bool aBorderCollapse,
nsTableCellReflowState& aReflowState);
virtual LogicalSides GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
virtual int GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
// row-specific methods

View File

@ -253,20 +253,20 @@ nsTableRowGroupFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
aLists, item, DisplayRows);
}
nsIFrame::LogicalSides
int
nsTableRowGroupFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
{
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
return LogicalSides();
return 0;
}
LogicalSides skip;
int skip = 0;
if (nullptr != GetPrevInFlow()) {
skip |= eLogicalSideBitsBStart;
skip |= LOGICAL_SIDE_B_START;
}
if (nullptr != GetNextInFlow()) {
skip |= eLogicalSideBitsBEnd;
skip |= LOGICAL_SIDE_B_END;
}
return skip;
}

View File

@ -334,7 +334,7 @@ protected:
bool aBorderCollapse,
nsHTMLReflowState& aReflowState);
virtual LogicalSides GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
virtual int GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE;
void PlaceChild(nsPresContext* aPresContext,
nsRowGroupReflowState& aReflowState,

View File

@ -123,7 +123,7 @@ nsGroupBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
void
nsGroupBoxFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
nsPoint aPt, const nsRect& aDirtyRect) {
Sides skipSides;
int skipSides = 0;
const nsStyleBorder* borderStyleData = StyleBorder();
const nsMargin& border = borderStyleData->GetComputedBorder();
nscoord yoff = 0;