mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
7235f6934a
commit
92fe6a5293
@ -22,10 +22,10 @@ public:
|
|||||||
void Display(nsAString& aValue);
|
void Display(nsAString& aValue);
|
||||||
void TextAlign(nsAString& aValue);
|
void TextAlign(nsAString& aValue);
|
||||||
void TextIndent(nsAString& aValue);
|
void TextIndent(nsAString& aValue);
|
||||||
void MarginLeft(nsAString& aValue) { Margin(eSideLeft, aValue); }
|
void MarginLeft(nsAString& aValue) { Margin(css::eSideLeft, aValue); }
|
||||||
void MarginRight(nsAString& aValue) { Margin(eSideRight, aValue); }
|
void MarginRight(nsAString& aValue) { Margin(css::eSideRight, aValue); }
|
||||||
void MarginTop(nsAString& aValue) { Margin(eSideTop, aValue); }
|
void MarginTop(nsAString& aValue) { Margin(css::eSideTop, aValue); }
|
||||||
void MarginBottom(nsAString& aValue) { Margin(eSideBottom, aValue); }
|
void MarginBottom(nsAString& aValue) { Margin(css::eSideBottom, aValue); }
|
||||||
|
|
||||||
static void FormatColor(const nscolor& aValue, nsString& aFormattedValue);
|
static void FormatColor(const nscolor& aValue, nsString& aFormattedValue);
|
||||||
static void FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue);
|
static void FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue);
|
||||||
@ -36,7 +36,7 @@ private:
|
|||||||
StyleInfo(const StyleInfo&) MOZ_DELETE;
|
StyleInfo(const StyleInfo&) MOZ_DELETE;
|
||||||
StyleInfo& operator = (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;
|
dom::Element* mElement;
|
||||||
nsRefPtr<nsStyleContext> mStyleContext;
|
nsRefPtr<nsStyleContext> mStyleContext;
|
||||||
|
@ -9,57 +9,6 @@
|
|||||||
#include "Types.h"
|
#include "Types.h"
|
||||||
|
|
||||||
namespace mozilla {
|
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 {
|
namespace gfx {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -68,7 +17,7 @@ namespace gfx {
|
|||||||
*/
|
*/
|
||||||
template <class T, class Sub>
|
template <class T, class Sub>
|
||||||
struct BaseMargin {
|
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
|
// Do not change the layout of these members; the Side() methods below
|
||||||
// depend on this order.
|
// depend on this order.
|
||||||
@ -96,18 +45,18 @@ struct BaseMargin {
|
|||||||
return *(&top + T(aSide));
|
return *(&top + T(aSide));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplySkipSides(Sides aSkipSides)
|
void ApplySkipSides(int aSkipSides)
|
||||||
{
|
{
|
||||||
if (aSkipSides.Top()) {
|
if (aSkipSides & (1 << mozilla::css::eSideTop)) {
|
||||||
top = 0;
|
top = 0;
|
||||||
}
|
}
|
||||||
if (aSkipSides.Right()) {
|
if (aSkipSides & (1 << mozilla::css::eSideRight)) {
|
||||||
right = 0;
|
right = 0;
|
||||||
}
|
}
|
||||||
if (aSkipSides.Bottom()) {
|
if (aSkipSides & (1 << mozilla::css::eSideBottom)) {
|
||||||
bottom = 0;
|
bottom = 0;
|
||||||
}
|
}
|
||||||
if (aSkipSides.Left()) {
|
if (aSkipSides & (1 << mozilla::css::eSideLeft)) {
|
||||||
left = 0;
|
left = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -264,25 +264,17 @@ struct GradientStop
|
|||||||
#define GFX2D_API
|
#define GFX2D_API
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Side constants for use in various places
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
// Side constants for use in various places.
|
namespace css {
|
||||||
enum Side { eSideTop, eSideRight, eSideBottom, eSideLeft };
|
enum Side {eSideTop, eSideRight, eSideBottom, eSideLeft};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
enum SideBits {
|
// XXX - These don't really belong here. But for now this is where they go.
|
||||||
eSideBitsNone = 0,
|
#define NS_SIDE_TOP mozilla::css::eSideTop
|
||||||
eSideBitsTop = 1 << eSideTop,
|
#define NS_SIDE_RIGHT mozilla::css::eSideRight
|
||||||
eSideBitsRight = 1 << eSideRight,
|
#define NS_SIDE_BOTTOM mozilla::css::eSideBottom
|
||||||
eSideBitsBottom = 1 << eSideBottom,
|
#define NS_SIDE_LEFT mozilla::css::eSideLeft
|
||||||
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
|
|
||||||
|
|
||||||
#endif /* MOZILLA_GFX_TYPES_H_ */
|
#endif /* MOZILLA_GFX_TYPES_H_ */
|
||||||
|
@ -87,7 +87,7 @@ struct gfxRect :
|
|||||||
return gfxPoint(0.0, 0.0);
|
return gfxPoint(0.0, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxPoint CCWCorner(mozilla::Side side) const {
|
gfxPoint CCWCorner(mozilla::css::Side side) const {
|
||||||
switch (side) {
|
switch (side) {
|
||||||
case NS_SIDE_TOP: return TopLeft();
|
case NS_SIDE_TOP: return TopLeft();
|
||||||
case NS_SIDE_RIGHT: return TopRight();
|
case NS_SIDE_RIGHT: return TopRight();
|
||||||
@ -97,7 +97,7 @@ struct gfxRect :
|
|||||||
MOZ_CRASH("Incomplete switch");
|
MOZ_CRASH("Incomplete switch");
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxPoint CWCorner(mozilla::Side side) const {
|
gfxPoint CWCorner(mozilla::css::Side side) const {
|
||||||
switch (side) {
|
switch (side) {
|
||||||
case NS_SIDE_TOP: return TopRight();
|
case NS_SIDE_TOP: return TopRight();
|
||||||
case NS_SIDE_RIGHT: return BottomRight();
|
case NS_SIDE_RIGHT: return BottomRight();
|
||||||
|
@ -303,7 +303,7 @@ protected:
|
|||||||
nsIFrame* inlineFrame = GetPrevContinuation(aFrame);
|
nsIFrame* inlineFrame = GetPrevContinuation(aFrame);
|
||||||
while (inlineFrame) {
|
while (inlineFrame) {
|
||||||
if (!mLeftBorderData.mFrame &&
|
if (!mLeftBorderData.mFrame &&
|
||||||
!inlineFrame->GetSkipSides().Left()) {
|
!(inlineFrame->GetSkipSides() & SIDE_BIT_LEFT)) {
|
||||||
mLeftBorderData.mFrame = inlineFrame;
|
mLeftBorderData.mFrame = inlineFrame;
|
||||||
}
|
}
|
||||||
nsRect rect = inlineFrame->GetRect();
|
nsRect rect = inlineFrame->GetRect();
|
||||||
@ -321,7 +321,7 @@ protected:
|
|||||||
inlineFrame = aFrame;
|
inlineFrame = aFrame;
|
||||||
while (inlineFrame) {
|
while (inlineFrame) {
|
||||||
if (!mLeftBorderData.mFrame &&
|
if (!mLeftBorderData.mFrame &&
|
||||||
!inlineFrame->GetSkipSides().Left()) {
|
!(inlineFrame->GetSkipSides() & SIDE_BIT_LEFT)) {
|
||||||
mLeftBorderData.mFrame = inlineFrame;
|
mLeftBorderData.mFrame = inlineFrame;
|
||||||
}
|
}
|
||||||
nsRect rect = inlineFrame->GetRect();
|
nsRect rect = inlineFrame->GetRect();
|
||||||
@ -362,7 +362,7 @@ static void DrawBorderImage(nsPresContext* aPresContext,
|
|||||||
const nsRect& aBorderArea,
|
const nsRect& aBorderArea,
|
||||||
const nsStyleBorder& aStyleBorder,
|
const nsStyleBorder& aStyleBorder,
|
||||||
const nsRect& aDirtyRect,
|
const nsRect& aDirtyRect,
|
||||||
Sides aSkipSides);
|
int aSkipSides);
|
||||||
|
|
||||||
static nscolor MakeBevelColor(mozilla::css::Side whichSide, uint8_t style,
|
static nscolor MakeBevelColor(mozilla::css::Side whichSide, uint8_t style,
|
||||||
nscolor aBackgroundColor,
|
nscolor aBackgroundColor,
|
||||||
@ -439,10 +439,10 @@ GetRadii(nsIFrame* aForFrame, const nsStyleBorder& aBorder,
|
|||||||
nsSize frameSize = aForFrame->GetSize();
|
nsSize frameSize = aForFrame->GetSize();
|
||||||
if (&aBorder == aForFrame->StyleBorder() &&
|
if (&aBorder == aForFrame->StyleBorder() &&
|
||||||
frameSize == aOrigBorderArea.Size()) {
|
frameSize == aOrigBorderArea.Size()) {
|
||||||
haveRoundedCorners = aForFrame->GetBorderRadii(sz, sz, Sides(), radii);
|
haveRoundedCorners = aForFrame->GetBorderRadii(sz, sz, 0, radii);
|
||||||
} else {
|
} else {
|
||||||
haveRoundedCorners =
|
haveRoundedCorners =
|
||||||
nsIFrame::ComputeBorderRadii(aBorder.mBorderRadius, frameSize, sz, Sides(), radii);
|
nsIFrame::ComputeBorderRadii(aBorder.mBorderRadius, frameSize, sz, 0, radii);
|
||||||
}
|
}
|
||||||
if (haveRoundedCorners) {
|
if (haveRoundedCorners) {
|
||||||
auto d2a = aForFrame->PresContext()->AppUnitsPerDevPixel();
|
auto d2a = aForFrame->PresContext()->AppUnitsPerDevPixel();
|
||||||
@ -561,7 +561,7 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
|
|||||||
const nsRect& aDirtyRect,
|
const nsRect& aDirtyRect,
|
||||||
const nsRect& aBorderArea,
|
const nsRect& aBorderArea,
|
||||||
nsStyleContext* aStyleContext,
|
nsStyleContext* aStyleContext,
|
||||||
Sides aSkipSides)
|
int aSkipSides)
|
||||||
{
|
{
|
||||||
PROFILER_LABEL("nsCSSRendering", "PaintBorder",
|
PROFILER_LABEL("nsCSSRendering", "PaintBorder",
|
||||||
js::ProfileEntry::Category::GRAPHICS);
|
js::ProfileEntry::Category::GRAPHICS);
|
||||||
@ -606,7 +606,7 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
|
|||||||
const nsRect& aBorderArea,
|
const nsRect& aBorderArea,
|
||||||
const nsStyleBorder& aStyleBorder,
|
const nsStyleBorder& aStyleBorder,
|
||||||
nsStyleContext* aStyleContext,
|
nsStyleContext* aStyleContext,
|
||||||
Sides aSkipSides)
|
int aSkipSides)
|
||||||
{
|
{
|
||||||
SN("++ PaintBorder");
|
SN("++ PaintBorder");
|
||||||
|
|
||||||
@ -660,7 +660,7 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
|
|||||||
ctx->Save();
|
ctx->Save();
|
||||||
|
|
||||||
if (::IsBoxDecorationSlice(aStyleBorder)) {
|
if (::IsBoxDecorationSlice(aStyleBorder)) {
|
||||||
if (aSkipSides.IsEmpty()) {
|
if (aSkipSides == 0) {
|
||||||
// No continuations most likely, or ::first-letter that wants all border-
|
// No continuations most likely, or ::first-letter that wants all border-
|
||||||
// sides on the first continuation.
|
// sides on the first continuation.
|
||||||
joinedBorderArea = aBorderArea;
|
joinedBorderArea = aBorderArea;
|
||||||
@ -675,7 +675,7 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
|
|||||||
} else {
|
} else {
|
||||||
MOZ_ASSERT(joinedBorderArea.IsEqualEdges(aBorderArea),
|
MOZ_ASSERT(joinedBorderArea.IsEqualEdges(aBorderArea),
|
||||||
"Should use aBorderArea for box-decoration-break:clone");
|
"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 "
|
"Should not skip sides for box-decoration-break:clone except "
|
||||||
"::first-letter/line continuations or other frame types that "
|
"::first-letter/line continuations or other frame types that "
|
||||||
"don't have borders but those shouldn't reach this point.");
|
"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
|
// get the radius for our outline
|
||||||
nsIFrame::ComputeBorderRadii(ourOutline->mOutlineRadius, aBorderArea.Size(),
|
nsIFrame::ComputeBorderRadii(ourOutline->mOutlineRadius, aBorderArea.Size(),
|
||||||
outerRect.Size(), Sides(), twipsRadii);
|
outerRect.Size(), 0, twipsRadii);
|
||||||
|
|
||||||
// Get our conversion values
|
// Get our conversion values
|
||||||
nscoord twipsPerPixel = aPresContext->DevPixelsToAppUnits(1);
|
nscoord twipsPerPixel = aPresContext->DevPixelsToAppUnits(1);
|
||||||
@ -1201,7 +1201,7 @@ nsCSSRendering::PaintBoxShadowOuter(nsPresContext* aPresContext,
|
|||||||
NS_ASSERTION(aFrameArea.Size() == aForFrame->VisualBorderRectRelativeToSelf().Size(),
|
NS_ASSERTION(aFrameArea.Size() == aForFrame->VisualBorderRectRelativeToSelf().Size(),
|
||||||
"unexpected size");
|
"unexpected size");
|
||||||
nsSize sz = frameRect.Size();
|
nsSize sz = frameRect.Size();
|
||||||
hasBorderRadius = aForFrame->GetBorderRadii(sz, sz, Sides(), twipsRadii);
|
hasBorderRadius = aForFrame->GetBorderRadii(sz, sz, 0, twipsRadii);
|
||||||
if (hasBorderRadius) {
|
if (hasBorderRadius) {
|
||||||
ComputePixelRadii(twipsRadii, twipsPerPixel, &borderRadii);
|
ComputePixelRadii(twipsRadii, twipsPerPixel, &borderRadii);
|
||||||
}
|
}
|
||||||
@ -1230,7 +1230,7 @@ nsCSSRendering::PaintBoxShadowOuter(nsPresContext* aPresContext,
|
|||||||
std::max(borderRadii[C_BL].height, borderRadii[C_BR].height), 0));
|
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) {
|
for (uint32_t i = shadows->Length(); i > 0; --i) {
|
||||||
nsCSSShadowItem* shadowItem = shadows->ShadowAt(i - 1);
|
nsCSSShadowItem* shadowItem = shadows->ShadowAt(i - 1);
|
||||||
if (shadowItem->mInset)
|
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.
|
// Clip the shadow so that we only get the part that applies to aForFrame.
|
||||||
nsRect fragmentClip = shadowRectPlusBlur;
|
nsRect fragmentClip = shadowRectPlusBlur;
|
||||||
if (!skipSides.IsEmpty()) {
|
if (skipSides) {
|
||||||
if (skipSides.Left()) {
|
if (skipSides & SIDE_BIT_LEFT) {
|
||||||
nscoord xmost = fragmentClip.XMost();
|
nscoord xmost = fragmentClip.XMost();
|
||||||
fragmentClip.x = aFrameArea.x;
|
fragmentClip.x = aFrameArea.x;
|
||||||
fragmentClip.width = xmost - fragmentClip.x;
|
fragmentClip.width = xmost - fragmentClip.x;
|
||||||
}
|
}
|
||||||
if (skipSides.Right()) {
|
if (skipSides & SIDE_BIT_RIGHT) {
|
||||||
nscoord xmost = fragmentClip.XMost();
|
nscoord xmost = fragmentClip.XMost();
|
||||||
nscoord overflow = xmost - aFrameArea.XMost();
|
nscoord overflow = xmost - aFrameArea.XMost();
|
||||||
if (overflow > 0) {
|
if (overflow > 0) {
|
||||||
fragmentClip.width -= overflow;
|
fragmentClip.width -= overflow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (skipSides.Top()) {
|
if (skipSides & SIDE_BIT_TOP) {
|
||||||
nscoord ymost = fragmentClip.YMost();
|
nscoord ymost = fragmentClip.YMost();
|
||||||
fragmentClip.y = aFrameArea.y;
|
fragmentClip.y = aFrameArea.y;
|
||||||
fragmentClip.height = ymost - fragmentClip.y;
|
fragmentClip.height = ymost - fragmentClip.y;
|
||||||
}
|
}
|
||||||
if (skipSides.Bottom()) {
|
if (skipSides & SIDE_BIT_BOTTOM) {
|
||||||
nscoord ymost = fragmentClip.YMost();
|
nscoord ymost = fragmentClip.YMost();
|
||||||
nscoord overflow = ymost - aFrameArea.YMost();
|
nscoord overflow = ymost - aFrameArea.YMost();
|
||||||
if (overflow > 0) {
|
if (overflow > 0) {
|
||||||
@ -1414,7 +1414,7 @@ nsCSSRendering::PaintBoxShadowInner(nsPresContext* aPresContext,
|
|||||||
// if the frame does.
|
// if the frame does.
|
||||||
nscoord twipsRadii[8];
|
nscoord twipsRadii[8];
|
||||||
nsSize sz = frameRect.Size();
|
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);
|
const nscoord twipsPerPixel = aPresContext->DevPixelsToAppUnits(1);
|
||||||
|
|
||||||
gfxCornerSizes innerRadii;
|
gfxCornerSizes innerRadii;
|
||||||
@ -3296,7 +3296,7 @@ DrawBorderImage(nsPresContext* aPresContext,
|
|||||||
const nsRect& aBorderArea,
|
const nsRect& aBorderArea,
|
||||||
const nsStyleBorder& aStyleBorder,
|
const nsStyleBorder& aStyleBorder,
|
||||||
const nsRect& aDirtyRect,
|
const nsRect& aDirtyRect,
|
||||||
Sides aSkipSides)
|
int aSkipSides)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(aStyleBorder.IsBorderImageLoaded(),
|
NS_PRECONDITION(aStyleBorder.IsBorderImageLoaded(),
|
||||||
"drawing border image that isn't successfully loaded");
|
"drawing border image that isn't successfully loaded");
|
||||||
@ -3329,7 +3329,7 @@ DrawBorderImage(nsPresContext* aPresContext,
|
|||||||
nsRect borderImgArea;
|
nsRect borderImgArea;
|
||||||
nsMargin borderWidths(aStyleBorder.GetComputedBorder());
|
nsMargin borderWidths(aStyleBorder.GetComputedBorder());
|
||||||
nsMargin imageOutset(aStyleBorder.GetImageOutset());
|
nsMargin imageOutset(aStyleBorder.GetImageOutset());
|
||||||
if (::IsBoxDecorationSlice(aStyleBorder) && !aSkipSides.IsEmpty()) {
|
if (::IsBoxDecorationSlice(aStyleBorder) && aSkipSides != 0) {
|
||||||
borderImgArea =
|
borderImgArea =
|
||||||
::BoxDecorationRectForBorder(aForFrame, aBorderArea, &aStyleBorder);
|
::BoxDecorationRectForBorder(aForFrame, aBorderArea, &aStyleBorder);
|
||||||
if (borderImgArea.IsEqualEdges(aBorderArea)) {
|
if (borderImgArea.IsEqualEdges(aBorderArea)) {
|
||||||
|
@ -279,8 +279,6 @@ struct nsBackgroundLayerState {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct nsCSSRendering {
|
struct nsCSSRendering {
|
||||||
typedef nsIFrame::Sides Sides;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize any static variables used by nsCSSRendering.
|
* Initialize any static variables used by nsCSSRendering.
|
||||||
*/
|
*/
|
||||||
@ -310,8 +308,8 @@ struct nsCSSRendering {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Render the border for an element using css rendering rules
|
* Render the border for an element using css rendering rules
|
||||||
* for borders. aSkipSides says which sides to skip
|
* for borders. aSkipSides is a bitmask of the sides to skip
|
||||||
* when rendering, the default is to skip none.
|
* when rendering. If 0 then no sides are skipped.
|
||||||
*/
|
*/
|
||||||
static void PaintBorder(nsPresContext* aPresContext,
|
static void PaintBorder(nsPresContext* aPresContext,
|
||||||
nsRenderingContext& aRenderingContext,
|
nsRenderingContext& aRenderingContext,
|
||||||
@ -319,12 +317,11 @@ struct nsCSSRendering {
|
|||||||
const nsRect& aDirtyRect,
|
const nsRect& aDirtyRect,
|
||||||
const nsRect& aBorderArea,
|
const nsRect& aBorderArea,
|
||||||
nsStyleContext* aStyleContext,
|
nsStyleContext* aStyleContext,
|
||||||
Sides aSkipSides = Sides());
|
int aSkipSides = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Like PaintBorder, but taking an nsStyleBorder argument instead of
|
* Like PaintBorder, but taking an nsStyleBorder argument instead of
|
||||||
* getting it from aStyleContext. aSkipSides says which sides to skip
|
* getting it from aStyleContext.
|
||||||
* when rendering, the default is to skip none.
|
|
||||||
*/
|
*/
|
||||||
static void PaintBorderWithStyleBorder(nsPresContext* aPresContext,
|
static void PaintBorderWithStyleBorder(nsPresContext* aPresContext,
|
||||||
nsRenderingContext& aRenderingContext,
|
nsRenderingContext& aRenderingContext,
|
||||||
@ -333,12 +330,13 @@ struct nsCSSRendering {
|
|||||||
const nsRect& aBorderArea,
|
const nsRect& aBorderArea,
|
||||||
const nsStyleBorder& aBorderStyle,
|
const nsStyleBorder& aBorderStyle,
|
||||||
nsStyleContext* aStyleContext,
|
nsStyleContext* aStyleContext,
|
||||||
Sides aSkipSides = Sides());
|
int aSkipSides = 0);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render the outline for an element using css rendering rules
|
* 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,
|
static void PaintOutline(nsPresContext* aPresContext,
|
||||||
nsRenderingContext& aRenderingContext,
|
nsRenderingContext& aRenderingContext,
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
#include "nsLayoutUtils.h"
|
#include "nsLayoutUtils.h"
|
||||||
#include "RestyleTracker.h"
|
#include "RestyleTracker.h"
|
||||||
|
|
||||||
|
using namespace mozilla::css;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
void DestroyStickyScrollContainer(void* aPropertyValue)
|
void DestroyStickyScrollContainer(void* aPropertyValue)
|
||||||
|
@ -36,71 +36,14 @@
|
|||||||
#define CHECK_WRITING_MODE(param) \
|
#define CHECK_WRITING_MODE(param) \
|
||||||
NS_ASSERTION(param == mWritingMode, "writing-mode mismatch")
|
NS_ASSERTION(param == mWritingMode, "writing-mode mismatch")
|
||||||
|
|
||||||
namespace mozilla {
|
#define LOGICAL_SIDE_B_START 1
|
||||||
// Logical side constants for use in various places.
|
#define LOGICAL_SIDE_I_START 2
|
||||||
enum LogicalSide { eLogicalSideBStart, eLogicalSideBEnd,
|
#define LOGICAL_SIDE_B_END 4
|
||||||
eLogicalSideIStart, eLogicalSideIEnd };
|
#define LOGICAL_SIDE_I_END 8
|
||||||
|
#define LOGICAL_SIDES_I_BOTH (LOGICAL_SIDE_I_START | LOGICAL_SIDE_I_END)
|
||||||
enum LogicalSideBits {
|
#define LOGICAL_SIDES_B_BOTH (LOGICAL_SIDE_B_START | LOGICAL_SIDE_B_END)
|
||||||
eLogicalSideBitsNone = 0,
|
#define LOGICAL_SIDES_ALL (LOGICAL_SIDE_I_START | LOGICAL_SIDE_I_END | \
|
||||||
eLogicalSideBitsBStart = 1 << eLogicalSideBStart,
|
LOGICAL_SIDE_B_START | LOGICAL_SIDE_B_END)
|
||||||
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mozilla::WritingMode is an immutable class representing a
|
* mozilla::WritingMode is an immutable class representing a
|
||||||
@ -114,6 +57,9 @@ private:
|
|||||||
* See CSS3 Writing Modes for more information
|
* See CSS3 Writing Modes for more information
|
||||||
* http://www.w3.org/TR/css3-writing-modes/
|
* http://www.w3.org/TR/css3-writing-modes/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
namespace mozilla {
|
||||||
|
|
||||||
class WritingMode {
|
class WritingMode {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
@ -896,18 +842,18 @@ public:
|
|||||||
*this : LogicalMargin(aToMode, GetPhysicalMargin(aFromMode));
|
*this : LogicalMargin(aToMode, GetPhysicalMargin(aFromMode));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplySkipSides(LogicalSides aSkipSides)
|
void ApplySkipSides(int aSkipSides)
|
||||||
{
|
{
|
||||||
if (aSkipSides.BStart()) {
|
if (aSkipSides & LOGICAL_SIDE_B_START) {
|
||||||
BStart() = 0;
|
BStart() = 0;
|
||||||
}
|
}
|
||||||
if (aSkipSides.BEnd()) {
|
if (aSkipSides & LOGICAL_SIDE_B_END) {
|
||||||
BEnd() = 0;
|
BEnd() = 0;
|
||||||
}
|
}
|
||||||
if (aSkipSides.IStart()) {
|
if (aSkipSides & LOGICAL_SIDE_I_START) {
|
||||||
IStart() = 0;
|
IStart() = 0;
|
||||||
}
|
}
|
||||||
if (aSkipSides.IEnd()) {
|
if (aSkipSides & LOGICAL_SIDE_I_END) {
|
||||||
IEnd() = 0;
|
IEnd() = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1038,7 +1038,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
aReflowState.ComputedBSize() != NS_AUTOHEIGHT &&
|
aReflowState.ComputedBSize() != NS_AUTOHEIGHT &&
|
||||||
ShouldApplyOverflowClipping(this, aReflowState.mStyleDisplay)) {
|
ShouldApplyOverflowClipping(this, aReflowState.mStyleDisplay)) {
|
||||||
LogicalMargin blockDirExtras = aReflowState.ComputedLogicalBorderPadding();
|
LogicalMargin blockDirExtras = aReflowState.ComputedLogicalBorderPadding();
|
||||||
if (GetLogicalSkipSides().BStart()) {
|
if (GetLogicalSkipSides() & (LOGICAL_SIDE_B_START)) {
|
||||||
blockDirExtras.BStart(wm) = 0;
|
blockDirExtras.BStart(wm) = 0;
|
||||||
} else {
|
} else {
|
||||||
// Bottom margin never causes us to create continuations, so we
|
// Bottom margin never causes us to create continuations, so we
|
||||||
|
@ -48,19 +48,18 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState,
|
|||||||
SetFlag(BRS_ISFIRSTINFLOW, aFrame->GetPrevInFlow() == nullptr);
|
SetFlag(BRS_ISFIRSTINFLOW, aFrame->GetPrevInFlow() == nullptr);
|
||||||
SetFlag(BRS_ISOVERFLOWCONTAINER, IS_TRUE_OVERFLOW_CONTAINER(aFrame));
|
SetFlag(BRS_ISOVERFLOWCONTAINER, IS_TRUE_OVERFLOW_CONTAINER(aFrame));
|
||||||
|
|
||||||
nsIFrame::LogicalSides logicalSkipSides =
|
int logicalSkipSides = aFrame->GetLogicalSkipSides(&aReflowState);
|
||||||
aFrame->GetLogicalSkipSides(&aReflowState);
|
|
||||||
mBorderPadding.ApplySkipSides(logicalSkipSides);
|
mBorderPadding.ApplySkipSides(logicalSkipSides);
|
||||||
|
|
||||||
// Note that mContainerWidth is the physical width!
|
// Note that mContainerWidth is the physical width!
|
||||||
mContainerWidth = aReflowState.ComputedWidth() + mBorderPadding.LeftRight(wm);
|
mContainerWidth = aReflowState.ComputedWidth() + mBorderPadding.LeftRight(wm);
|
||||||
|
|
||||||
if ((aBStartMarginRoot && !logicalSkipSides.BStart()) ||
|
if ((aBStartMarginRoot && !(logicalSkipSides & LOGICAL_SIDE_B_START)) ||
|
||||||
0 != mBorderPadding.BStart(wm)) {
|
0 != mBorderPadding.BStart(wm)) {
|
||||||
SetFlag(BRS_ISBSTARTMARGINROOT, true);
|
SetFlag(BRS_ISBSTARTMARGINROOT, true);
|
||||||
SetFlag(BRS_APPLYBSTARTMARGIN, true);
|
SetFlag(BRS_APPLYBSTARTMARGIN, true);
|
||||||
}
|
}
|
||||||
if ((aBEndMarginRoot && !logicalSkipSides.BEnd()) ||
|
if ((aBEndMarginRoot && !(logicalSkipSides & LOGICAL_SIDE_B_END)) ||
|
||||||
0 != mBorderPadding.BEnd(wm)) {
|
0 != mBorderPadding.BEnd(wm)) {
|
||||||
SetFlag(BRS_ISBENDMARGINROOT, true);
|
SetFlag(BRS_ISBENDMARGINROOT, true);
|
||||||
}
|
}
|
||||||
|
@ -110,12 +110,10 @@ nsColumnSetFrame::PaintColumnRule(nsRenderingContext* aCtx,
|
|||||||
contentRect.y);
|
contentRect.y);
|
||||||
|
|
||||||
nsRect lineRect(linePt, ruleSize);
|
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,
|
nsCSSRendering::PaintBorderWithStyleBorder(presContext, *aCtx, this,
|
||||||
aDirtyRect, lineRect, border, StyleContext(),
|
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;
|
child = nextSibling;
|
||||||
nextSibling = nextSibling->GetNextSibling();
|
nextSibling = nextSibling->GetNextSibling();
|
||||||
|
@ -378,7 +378,7 @@ nsFirstLetterFrame::GetLogicalBaseline(WritingMode aWritingMode) const
|
|||||||
return mBaseline;
|
return mBaseline;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::LogicalSides
|
int
|
||||||
nsFirstLetterFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
nsFirstLetterFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
||||||
{
|
{
|
||||||
if (GetPrevContinuation()) {
|
if (GetPrevContinuation()) {
|
||||||
@ -387,7 +387,7 @@ nsFirstLetterFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) c
|
|||||||
// properties that could trigger a call to GetSkipSides. Then again,
|
// properties that could trigger a call to GetSkipSides. Then again,
|
||||||
// it's not really an error to call GetSkipSides on any frame, so
|
// it's not really an error to call GetSkipSides on any frame, so
|
||||||
// that's why we handle it properly.
|
// 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
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ public:
|
|||||||
|
|
||||||
virtual bool CanContinueTextRun() const MOZ_OVERRIDE;
|
virtual bool CanContinueTextRun() const MOZ_OVERRIDE;
|
||||||
virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) 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
|
//override of nsFrame method
|
||||||
virtual nsresult GetChildFrameContainingOffset(int32_t inContentOffset,
|
virtual nsresult GetChildFrameContainingOffset(int32_t inContentOffset,
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "mozilla/LinkedList.h"
|
#include "mozilla/LinkedList.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
using namespace mozilla::css;
|
||||||
using namespace mozilla::layout;
|
using namespace mozilla::layout;
|
||||||
|
|
||||||
// Convenience typedefs for helper classes that we forward-declare in .h file
|
// 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
|
// This array maps each axis orientation to a pair of corresponding
|
||||||
// [start, end] physical mozilla::Side values.
|
// [start, end] physical mozilla::css::Side values.
|
||||||
static const mozilla::Side
|
static const Side
|
||||||
kAxisOrientationToSidesMap[eNumAxisOrientationTypes][eNumAxisEdges] = {
|
kAxisOrientationToSidesMap[eNumAxisOrientationTypes][eNumAxisEdges] = {
|
||||||
{ eSideLeft, eSideRight }, // eAxis_LR
|
{ eSideLeft, eSideRight }, // eAxis_LR
|
||||||
{ eSideRight, eSideLeft }, // eAxis_RL
|
{ eSideRight, eSideLeft }, // eAxis_RL
|
||||||
@ -154,7 +155,7 @@ PhysicalPosFromLogicalPos(nscoord aLogicalPosn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nscoord
|
static nscoord
|
||||||
MarginComponentForSide(const nsMargin& aMargin, mozilla::Side aSide)
|
MarginComponentForSide(const nsMargin& aMargin, Side aSide)
|
||||||
{
|
{
|
||||||
switch (aSide) {
|
switch (aSide) {
|
||||||
case eSideLeft:
|
case eSideLeft:
|
||||||
@ -173,7 +174,7 @@ MarginComponentForSide(const nsMargin& aMargin, mozilla::Side aSide)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nscoord&
|
static nscoord&
|
||||||
MarginComponentForSide(nsMargin& aMargin, mozilla::Side aSide)
|
MarginComponentForSide(nsMargin& aMargin, Side aSide)
|
||||||
{
|
{
|
||||||
switch (aSide) {
|
switch (aSide) {
|
||||||
case eSideLeft:
|
case eSideLeft:
|
||||||
@ -414,15 +415,15 @@ public:
|
|||||||
// ===================
|
// ===================
|
||||||
const nsMargin& GetMargin() const { return mMargin; }
|
const nsMargin& GetMargin() const { return mMargin; }
|
||||||
|
|
||||||
// Returns the margin component for a given mozilla::Side
|
// Returns the margin component for a given mozilla::css::Side
|
||||||
nscoord GetMarginComponentForSide(mozilla::Side aSide) const
|
nscoord GetMarginComponentForSide(Side aSide) const
|
||||||
{ return MarginComponentForSide(mMargin, aSide); }
|
{ return MarginComponentForSide(mMargin, aSide); }
|
||||||
|
|
||||||
// Returns the total space occupied by this item's margins in the given axis
|
// Returns the total space occupied by this item's margins in the given axis
|
||||||
nscoord GetMarginSizeInAxis(AxisOrientationType aAxis) const
|
nscoord GetMarginSizeInAxis(AxisOrientationType aAxis) const
|
||||||
{
|
{
|
||||||
mozilla::Side startSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_Start];
|
Side startSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_Start];
|
||||||
mozilla::Side endSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_End];
|
Side endSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_End];
|
||||||
return GetMarginComponentForSide(startSide) +
|
return GetMarginComponentForSide(startSide) +
|
||||||
GetMarginComponentForSide(endSide);
|
GetMarginComponentForSide(endSide);
|
||||||
}
|
}
|
||||||
@ -431,16 +432,16 @@ public:
|
|||||||
// ==========================
|
// ==========================
|
||||||
const nsMargin& GetBorderPadding() const { return mBorderPadding; }
|
const nsMargin& GetBorderPadding() const { return mBorderPadding; }
|
||||||
|
|
||||||
// Returns the border+padding component for a given mozilla::Side
|
// Returns the border+padding component for a given mozilla::css::Side
|
||||||
nscoord GetBorderPaddingComponentForSide(mozilla::Side aSide) const
|
nscoord GetBorderPaddingComponentForSide(Side aSide) const
|
||||||
{ return MarginComponentForSide(mBorderPadding, aSide); }
|
{ return MarginComponentForSide(mBorderPadding, aSide); }
|
||||||
|
|
||||||
// Returns the total space occupied by this item's borders and padding in
|
// Returns the total space occupied by this item's borders and padding in
|
||||||
// the given axis
|
// the given axis
|
||||||
nscoord GetBorderPaddingSizeInAxis(AxisOrientationType aAxis) const
|
nscoord GetBorderPaddingSizeInAxis(AxisOrientationType aAxis) const
|
||||||
{
|
{
|
||||||
mozilla::Side startSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_Start];
|
Side startSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_Start];
|
||||||
mozilla::Side endSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_End];
|
Side endSide = kAxisOrientationToSidesMap[aAxis][eAxisEdge_End];
|
||||||
return GetBorderPaddingComponentForSide(startSide) +
|
return GetBorderPaddingComponentForSide(startSide) +
|
||||||
GetBorderPaddingComponentForSide(endSide);
|
GetBorderPaddingComponentForSide(endSide);
|
||||||
}
|
}
|
||||||
@ -550,7 +551,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setter for margin components (for resolving "auto" margins)
|
// 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");
|
MOZ_ASSERT(mIsFrozen, "main size should be resolved before this");
|
||||||
MarginComponentForSide(mMargin, aSide) = aLength;
|
MarginComponentForSide(mMargin, aSide) = aLength;
|
||||||
@ -1272,7 +1273,7 @@ FlexItem::GetBaselineOffsetFromOuterCrossEdge(AxisOrientationType aCrossAxis,
|
|||||||
"Only expecting to be doing baseline computations when the "
|
"Only expecting to be doing baseline computations when the "
|
||||||
"cross axis is vertical");
|
"cross axis is vertical");
|
||||||
|
|
||||||
mozilla::Side sideToMeasureFrom = kAxisOrientationToSidesMap[aCrossAxis][aEdge];
|
Side sideToMeasureFrom = kAxisOrientationToSidesMap[aCrossAxis][aEdge];
|
||||||
|
|
||||||
nscoord marginTopToBaseline = mAscent + mMargin.top;
|
nscoord marginTopToBaseline = mAscent + mMargin.top;
|
||||||
|
|
||||||
@ -1298,7 +1299,7 @@ FlexItem::GetNumAutoMarginsInAxis(AxisOrientationType aAxis) const
|
|||||||
uint32_t numAutoMargins = 0;
|
uint32_t numAutoMargins = 0;
|
||||||
const nsStyleSides& styleMargin = mFrame->StyleMargin()->mMargin;
|
const nsStyleSides& styleMargin = mFrame->StyleMargin()->mMargin;
|
||||||
for (uint32_t i = 0; i < eNumAxisEdges; i++) {
|
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) {
|
if (styleMargin.GetUnit(side) == eStyleUnit_Auto) {
|
||||||
numAutoMargins++;
|
numAutoMargins++;
|
||||||
}
|
}
|
||||||
@ -1326,7 +1327,7 @@ public:
|
|||||||
// axis we're tracking.
|
// axis we're tracking.
|
||||||
void EnterMargin(const nsMargin& aMargin)
|
void EnterMargin(const nsMargin& aMargin)
|
||||||
{
|
{
|
||||||
mozilla::Side side = kAxisOrientationToSidesMap[mAxis][eAxisEdge_Start];
|
Side side = kAxisOrientationToSidesMap[mAxis][eAxisEdge_Start];
|
||||||
mPosition += MarginComponentForSide(aMargin, side);
|
mPosition += MarginComponentForSide(aMargin, side);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1334,7 +1335,7 @@ public:
|
|||||||
// we're tracking.
|
// we're tracking.
|
||||||
void ExitMargin(const nsMargin& aMargin)
|
void ExitMargin(const nsMargin& aMargin)
|
||||||
{
|
{
|
||||||
mozilla::Side side = kAxisOrientationToSidesMap[mAxis][eAxisEdge_End];
|
Side side = kAxisOrientationToSidesMap[mAxis][eAxisEdge_End];
|
||||||
mPosition += MarginComponentForSide(aMargin, side);
|
mPosition += MarginComponentForSide(aMargin, side);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2092,7 +2093,7 @@ MainAxisPositionTracker::ResolveAutoMarginsInMainAxis(FlexItem& aItem)
|
|||||||
if (mNumAutoMarginsInMainAxis) {
|
if (mNumAutoMarginsInMainAxis) {
|
||||||
const nsStyleSides& styleMargin = aItem.Frame()->StyleMargin()->mMargin;
|
const nsStyleSides& styleMargin = aItem.Frame()->StyleMargin()->mMargin;
|
||||||
for (uint32_t i = 0; i < eNumAxisEdges; i++) {
|
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) {
|
if (styleMargin.GetUnit(side) == eStyleUnit_Auto) {
|
||||||
// NOTE: This integer math will skew the distribution of remainder
|
// NOTE: This integer math will skew the distribution of remainder
|
||||||
// app-units towards the end, which is fine.
|
// app-units towards the end, which is fine.
|
||||||
@ -2428,7 +2429,7 @@ SingleLineCrossAxisPositionTracker::
|
|||||||
// Give each auto margin a share of the space.
|
// Give each auto margin a share of the space.
|
||||||
const nsStyleSides& styleMargin = aItem.Frame()->StyleMargin()->mMargin;
|
const nsStyleSides& styleMargin = aItem.Frame()->StyleMargin()->mMargin;
|
||||||
for (uint32_t i = 0; i < eNumAxisEdges; i++) {
|
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) {
|
if (styleMargin.GetUnit(side) == eStyleUnit_Auto) {
|
||||||
MOZ_ASSERT(aItem.GetMarginComponentForSide(side) == 0,
|
MOZ_ASSERT(aItem.GetMarginComponentForSide(side) == 0,
|
||||||
"Expecting auto margins to have value '0' before we "
|
"Expecting auto margins to have value '0' before we "
|
||||||
@ -3112,7 +3113,7 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
// though.)
|
// though.)
|
||||||
nscoord availableHeightForContent = aReflowState.AvailableHeight();
|
nscoord availableHeightForContent = aReflowState.AvailableHeight();
|
||||||
if (availableHeightForContent != NS_UNCONSTRAINEDSIZE &&
|
if (availableHeightForContent != NS_UNCONSTRAINEDSIZE &&
|
||||||
!GetSkipSides().Top()) {
|
!(GetSkipSides() & (1 << NS_SIDE_TOP))) {
|
||||||
availableHeightForContent -= aReflowState.ComputedPhysicalBorderPadding().top;
|
availableHeightForContent -= aReflowState.ComputedPhysicalBorderPadding().top;
|
||||||
// (Don't let that push availableHeightForContent below zero, though):
|
// (Don't let that push availableHeightForContent below zero, though):
|
||||||
availableHeightForContent = std::max(availableHeightForContent, 0);
|
availableHeightForContent = std::max(availableHeightForContent, 0);
|
||||||
|
@ -952,51 +952,52 @@ nsIFrame::GetUsedPadding() const
|
|||||||
return padding;
|
return padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::Sides
|
int
|
||||||
nsIFrame::GetSkipSides(const nsHTMLReflowState* aReflowState) const
|
nsIFrame::GetSkipSides(const nsHTMLReflowState* aReflowState) const
|
||||||
{
|
{
|
||||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
||||||
return Sides();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the logical skip sides to physical sides using the frame's
|
// Convert the logical skip sides to physical sides using the frame's
|
||||||
// writing mode
|
// writing mode
|
||||||
WritingMode writingMode = GetWritingMode();
|
WritingMode writingMode = GetWritingMode();
|
||||||
LogicalSides logicalSkip = GetLogicalSkipSides(aReflowState);
|
int logicalSkip = GetLogicalSkipSides(aReflowState);
|
||||||
Sides skip;
|
int skip = 0;
|
||||||
|
|
||||||
if (logicalSkip.BStart()) {
|
if (logicalSkip & LOGICAL_SIDE_B_START) {
|
||||||
if (writingMode.IsVertical()) {
|
if (writingMode.IsVertical()) {
|
||||||
skip |= writingMode.IsVerticalLR() ? eSideBitsLeft : eSideBitsRight;
|
skip |= 1 << (writingMode.IsVerticalLR() ? NS_SIDE_LEFT : NS_SIDE_RIGHT);
|
||||||
} else {
|
} else {
|
||||||
skip |= eSideBitsTop;
|
skip |= 1 << NS_SIDE_TOP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logicalSkip.BEnd()) {
|
if (logicalSkip & LOGICAL_SIDE_B_END) {
|
||||||
if (writingMode.IsVertical()) {
|
if (writingMode.IsVertical()) {
|
||||||
skip |= writingMode.IsVerticalLR() ? eSideBitsRight : eSideBitsLeft;
|
skip |= 1 << (writingMode.IsVerticalLR() ? NS_SIDE_RIGHT : NS_SIDE_LEFT);
|
||||||
} else {
|
} else {
|
||||||
skip |= eSideBitsBottom;
|
skip |= 1 << NS_SIDE_BOTTOM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logicalSkip.IStart()) {
|
if (logicalSkip & LOGICAL_SIDE_I_START) {
|
||||||
if (writingMode.IsVertical()) {
|
if (writingMode.IsVertical()) {
|
||||||
skip |= eSideBitsTop;
|
skip |= 1 << NS_SIDE_TOP;
|
||||||
} else {
|
} 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()) {
|
if (writingMode.IsVertical()) {
|
||||||
skip |= eSideBitsBottom;
|
skip |= 1 << NS_SIDE_BOTTOM;
|
||||||
} else {
|
} else {
|
||||||
skip |= writingMode.IsBidiLTR() ? eSideBitsRight : eSideBitsLeft;
|
skip |= 1 << (writingMode.IsBidiLTR() ? NS_SIDE_RIGHT : NS_SIDE_LEFT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return skip;
|
return skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1142,7 +1143,7 @@ bool
|
|||||||
nsIFrame::ComputeBorderRadii(const nsStyleCorners& aBorderRadius,
|
nsIFrame::ComputeBorderRadii(const nsStyleCorners& aBorderRadius,
|
||||||
const nsSize& aFrameSize,
|
const nsSize& aFrameSize,
|
||||||
const nsSize& aBorderArea,
|
const nsSize& aBorderArea,
|
||||||
Sides aSkipSides,
|
int aSkipSides,
|
||||||
nscoord aRadii[8])
|
nscoord aRadii[8])
|
||||||
{
|
{
|
||||||
// Percentages are relative to whichever side they're on.
|
// 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_X] = 0;
|
||||||
aRadii[NS_CORNER_TOP_LEFT_Y] = 0;
|
aRadii[NS_CORNER_TOP_LEFT_Y] = 0;
|
||||||
aRadii[NS_CORNER_TOP_RIGHT_X] = 0;
|
aRadii[NS_CORNER_TOP_RIGHT_X] = 0;
|
||||||
aRadii[NS_CORNER_TOP_RIGHT_Y] = 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_X] = 0;
|
||||||
aRadii[NS_CORNER_TOP_RIGHT_Y] = 0;
|
aRadii[NS_CORNER_TOP_RIGHT_Y] = 0;
|
||||||
aRadii[NS_CORNER_BOTTOM_RIGHT_X] = 0;
|
aRadii[NS_CORNER_BOTTOM_RIGHT_X] = 0;
|
||||||
aRadii[NS_CORNER_BOTTOM_RIGHT_Y] = 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_X] = 0;
|
||||||
aRadii[NS_CORNER_BOTTOM_RIGHT_Y] = 0;
|
aRadii[NS_CORNER_BOTTOM_RIGHT_Y] = 0;
|
||||||
aRadii[NS_CORNER_BOTTOM_LEFT_X] = 0;
|
aRadii[NS_CORNER_BOTTOM_LEFT_X] = 0;
|
||||||
aRadii[NS_CORNER_BOTTOM_LEFT_Y] = 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_X] = 0;
|
||||||
aRadii[NS_CORNER_BOTTOM_LEFT_Y] = 0;
|
aRadii[NS_CORNER_BOTTOM_LEFT_Y] = 0;
|
||||||
aRadii[NS_CORNER_TOP_LEFT_X] = 0;
|
aRadii[NS_CORNER_TOP_LEFT_X] = 0;
|
||||||
@ -1245,7 +1246,7 @@ nsIFrame::OutsetBorderRadii(nscoord aRadii[8], const nsMargin &aOffsets)
|
|||||||
|
|
||||||
/* virtual */ bool
|
/* virtual */ bool
|
||||||
nsIFrame::GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
|
nsIFrame::GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
|
||||||
Sides aSkipSides, nscoord aRadii[8]) const
|
int aSkipSides, nscoord aRadii[8]) const
|
||||||
{
|
{
|
||||||
if (IsThemed()) {
|
if (IsThemed()) {
|
||||||
// When we're themed, the native theme code draws the border and
|
// When we're themed, the native theme code draws the border and
|
||||||
|
@ -4338,7 +4338,7 @@ ReduceRadii(nscoord aXBorder, nscoord aYBorder,
|
|||||||
bool
|
bool
|
||||||
ScrollFrameHelper::GetBorderRadii(const nsSize& aFrameSize,
|
ScrollFrameHelper::GetBorderRadii(const nsSize& aFrameSize,
|
||||||
const nsSize& aBorderArea,
|
const nsSize& aBorderArea,
|
||||||
Sides aSkipSides,
|
int aSkipSides,
|
||||||
nscoord aRadii[8]) const
|
nscoord aRadii[8]) const
|
||||||
{
|
{
|
||||||
if (!mOuter->nsContainerFrame::GetBorderRadii(aFrameSize, aBorderArea,
|
if (!mOuter->nsContainerFrame::GetBorderRadii(aFrameSize, aBorderArea,
|
||||||
|
@ -39,7 +39,6 @@ namespace mozilla {
|
|||||||
|
|
||||||
class ScrollFrameHelper : public nsIReflowCallback {
|
class ScrollFrameHelper : public nsIReflowCallback {
|
||||||
public:
|
public:
|
||||||
typedef nsIFrame::Sides Sides;
|
|
||||||
typedef mozilla::CSSIntPoint CSSIntPoint;
|
typedef mozilla::CSSIntPoint CSSIntPoint;
|
||||||
typedef mozilla::layout::ScrollbarActivity ScrollbarActivity;
|
typedef mozilla::layout::ScrollbarActivity ScrollbarActivity;
|
||||||
|
|
||||||
@ -73,7 +72,7 @@ public:
|
|||||||
bool aPositioned);
|
bool aPositioned);
|
||||||
|
|
||||||
bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
|
bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
|
||||||
Sides aSkipSides, nscoord aRadii[8]) const;
|
int aSkipSides, nscoord aRadii[8]) const;
|
||||||
|
|
||||||
// nsIReflowCallback
|
// nsIReflowCallback
|
||||||
virtual bool ReflowFinished() MOZ_OVERRIDE;
|
virtual bool ReflowFinished() MOZ_OVERRIDE;
|
||||||
@ -481,7 +480,7 @@ public:
|
|||||||
nscoord GetIntrinsicVScrollbarWidth(nsRenderingContext *aRenderingContext);
|
nscoord GetIntrinsicVScrollbarWidth(nsRenderingContext *aRenderingContext);
|
||||||
|
|
||||||
virtual bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
|
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);
|
return mHelper.GetBorderRadii(aFrameSize, aBorderArea, aSkipSides, aRadii);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -830,7 +829,7 @@ public:
|
|||||||
virtual nsresult GetPadding(nsMargin& aPadding) MOZ_OVERRIDE;
|
virtual nsresult GetPadding(nsMargin& aPadding) MOZ_OVERRIDE;
|
||||||
|
|
||||||
virtual bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
|
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);
|
return mHelper.GetBorderRadii(aFrameSize, aBorderArea, aSkipSides, aRadii);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,8 +408,6 @@ public:
|
|||||||
typedef mozilla::layout::FrameChildListIterator ChildListIterator;
|
typedef mozilla::layout::FrameChildListIterator ChildListIterator;
|
||||||
typedef mozilla::layout::FrameChildListArrayIterator ChildListArrayIterator;
|
typedef mozilla::layout::FrameChildListArrayIterator ChildListArrayIterator;
|
||||||
typedef mozilla::gfx::Matrix Matrix;
|
typedef mozilla::gfx::Matrix Matrix;
|
||||||
typedef mozilla::Sides Sides;
|
|
||||||
typedef mozilla::LogicalSides LogicalSides;
|
|
||||||
|
|
||||||
NS_DECL_QUERYFRAME_TARGET(nsIFrame)
|
NS_DECL_QUERYFRAME_TARGET(nsIFrame)
|
||||||
|
|
||||||
@ -919,10 +917,10 @@ public:
|
|||||||
* Return whether any radii are nonzero.
|
* Return whether any radii are nonzero.
|
||||||
*/
|
*/
|
||||||
static bool ComputeBorderRadii(const nsStyleCorners& aBorderRadius,
|
static bool ComputeBorderRadii(const nsStyleCorners& aBorderRadius,
|
||||||
const nsSize& aFrameSize,
|
const nsSize& aFrameSize,
|
||||||
const nsSize& aBorderArea,
|
const nsSize& aBorderArea,
|
||||||
Sides aSkipSides,
|
int aSkipSides,
|
||||||
nscoord aRadii[8]);
|
nscoord aRadii[8]);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Given a set of border radii for one box (e.g., border box), convert
|
* 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,
|
virtual bool GetBorderRadii(const nsSize& aFrameSize,
|
||||||
const nsSize& aBorderArea,
|
const nsSize& aBorderArea,
|
||||||
Sides aSkipSides,
|
int aSkipSides,
|
||||||
nscoord aRadii[8]) const;
|
nscoord aRadii[8]) const;
|
||||||
bool GetBorderRadii(nscoord aRadii[8]) const;
|
bool GetBorderRadii(nscoord aRadii[8]) const;
|
||||||
|
|
||||||
@ -2305,10 +2303,8 @@ public:
|
|||||||
bool ClearOverflowRects();
|
bool ClearOverflowRects();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine whether borders, padding, margins etc should NOT be applied
|
* Determine whether borders should not be painted on certain sides of the
|
||||||
* on certain sides of the frame.
|
* frame.
|
||||||
* @see mozilla::Sides in gfx/2d/BaseMargin.h
|
|
||||||
* @see mozilla::LogicalSides in layout/generic/WritingModes.h
|
|
||||||
*
|
*
|
||||||
* @note (See also bug 743402, comment 11) GetSkipSides() checks to see
|
* @note (See also bug 743402, comment 11) GetSkipSides() checks to see
|
||||||
* if this frame has a previous or next continuation to determine
|
* 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
|
* passed in, indicating that it should be used to determine if sides
|
||||||
* should be skipped during reflow.
|
* should be skipped during reflow.
|
||||||
*/
|
*/
|
||||||
Sides GetSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const;
|
int GetSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const;
|
||||||
virtual LogicalSides
|
virtual int
|
||||||
GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const {
|
GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const {
|
||||||
return LogicalSides();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1836,19 +1836,19 @@ nsImageFrame::List(FILE* out, const char* aPrefix, uint32_t aFlags) const
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsIFrame::LogicalSides
|
int
|
||||||
nsImageFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
nsImageFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
||||||
{
|
{
|
||||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
||||||
return LogicalSides();
|
return 0;
|
||||||
}
|
}
|
||||||
LogicalSides skip;
|
int skip = 0;
|
||||||
if (nullptr != GetPrevInFlow()) {
|
if (nullptr != GetPrevInFlow()) {
|
||||||
skip |= eLogicalSideBitsBStart;
|
skip |= LOGICAL_SIDE_B_START;
|
||||||
}
|
}
|
||||||
if (nullptr != GetNextInFlow()) {
|
if (nullptr != GetNextInFlow()) {
|
||||||
skip |= eLogicalSideBitsBEnd;
|
skip |= LOGICAL_SIDE_B_END;
|
||||||
}
|
}
|
||||||
return skip;
|
return skip;
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ public:
|
|||||||
uint32_t aFlags = 0) const MOZ_OVERRIDE;
|
uint32_t aFlags = 0) const MOZ_OVERRIDE;
|
||||||
#endif
|
#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);
|
nsresult GetIntrinsicImageSize(nsSize& aSize);
|
||||||
|
|
||||||
|
@ -880,22 +880,22 @@ nsInlineFrame::PushFrames(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
nsIFrame::LogicalSides
|
int
|
||||||
nsInlineFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
nsInlineFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
||||||
{
|
{
|
||||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
||||||
return LogicalSides();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicalSides skip;
|
int skip = 0;
|
||||||
if (!IsFirst()) {
|
if (!IsFirst()) {
|
||||||
nsInlineFrame* prev = (nsInlineFrame*) GetPrevContinuation();
|
nsInlineFrame* prev = (nsInlineFrame*) GetPrevContinuation();
|
||||||
if ((GetStateBits() & NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET) ||
|
if ((GetStateBits() & NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET) ||
|
||||||
(prev && (prev->mRect.height || prev->mRect.width))) {
|
(prev && (prev->mRect.height || prev->mRect.width))) {
|
||||||
// Prev continuation is not empty therefore we don't render our start
|
// Prev continuation is not empty therefore we don't render our start
|
||||||
// border edge.
|
// border edge.
|
||||||
skip |= eLogicalSideBitsIStart;
|
skip |= LOGICAL_SIDE_I_START;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If the prev continuation is empty, then go ahead and let our start
|
// 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 && (next->mRect.height || next->mRect.width))) {
|
||||||
// Next continuation is not empty therefore we don't render our end
|
// Next continuation is not empty therefore we don't render our end
|
||||||
// border edge.
|
// border edge.
|
||||||
skip |= eLogicalSideBitsIEnd;
|
skip |= LOGICAL_SIDE_I_END;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If the next continuation is empty, then go ahead and let our end
|
// 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
|
// 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
|
// 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.
|
// 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.
|
// 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.
|
// Only get the first continuation once, as an optimization.
|
||||||
nsIFrame* firstContinuation = FirstContinuation();
|
nsIFrame* firstContinuation = FirstContinuation();
|
||||||
if (firstContinuation->FrameIsNonLastInIBSplit()) {
|
if (firstContinuation->FrameIsNonLastInIBSplit()) {
|
||||||
skip |= eLogicalSideBitsIEnd;
|
skip |= LOGICAL_SIDE_I_END;
|
||||||
}
|
}
|
||||||
if (firstContinuation->FrameIsNonFirstInIBSplit()) {
|
if (firstContinuation->FrameIsNonFirstInIBSplit()) {
|
||||||
skip |= eLogicalSideBitsIStart;
|
skip |= LOGICAL_SIDE_I_START;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ protected:
|
|||||||
|
|
||||||
nsInlineFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
|
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,
|
void ReflowFrames(nsPresContext* aPresContext,
|
||||||
const nsHTMLReflowState& aReflowState,
|
const nsHTMLReflowState& aReflowState,
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
#include "nsContainerFrame.h"
|
#include "nsContainerFrame.h"
|
||||||
#include "nsIFrameInlines.h"
|
#include "nsIFrameInlines.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
|
||||||
|
|
||||||
NS_IMPL_FRAMEARENA_HELPERS(nsSplittableFrame)
|
NS_IMPL_FRAMEARENA_HELPERS(nsSplittableFrame)
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -237,21 +235,21 @@ nsSplittableFrame::GetEffectiveComputedBSize(const nsHTMLReflowState& aReflowSta
|
|||||||
return std::max(0, bSize);
|
return std::max(0, bSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::LogicalSides
|
int
|
||||||
nsSplittableFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
nsSplittableFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
||||||
{
|
{
|
||||||
if (IS_TRUE_OVERFLOW_CONTAINER(this)) {
|
if (IS_TRUE_OVERFLOW_CONTAINER(this)) {
|
||||||
return LogicalSides(eLogicalSideBitsBBoth);
|
return LOGICAL_SIDES_B_BOTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
||||||
return LogicalSides();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicalSides skip;
|
int skip = 0;
|
||||||
if (GetPrevInFlow()) {
|
if (GetPrevInFlow()) {
|
||||||
skip |= eLogicalSideBitsBStart;
|
skip |= LOGICAL_SIDE_B_START;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aReflowState) {
|
if (aReflowState) {
|
||||||
@ -266,13 +264,13 @@ nsSplittableFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) co
|
|||||||
effectiveCH > aReflowState->AvailableBSize()) {
|
effectiveCH > aReflowState->AvailableBSize()) {
|
||||||
// Our content height is going to exceed our available height, so we're
|
// Our content height is going to exceed our available height, so we're
|
||||||
// going to need a next-in-flow.
|
// going to need a next-in-flow.
|
||||||
skip |= eLogicalSideBitsBEnd;
|
skip |= LOGICAL_SIDE_B_END;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nsIFrame* nif = GetNextInFlow();
|
nsIFrame* nif = GetNextInFlow();
|
||||||
if (nif && !IS_TRUE_OVERFLOW_CONTAINER(nif)) {
|
if (nif && !IS_TRUE_OVERFLOW_CONTAINER(nif)) {
|
||||||
skip |= eLogicalSideBitsBEnd;
|
skip |= LOGICAL_SIDE_B_END;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ protected:
|
|||||||
/**
|
/**
|
||||||
* @see nsIFrame::GetLogicalSkipSides()
|
* @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
|
#ifdef DEBUG
|
||||||
virtual void DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, int32_t aIndent) MOZ_OVERRIDE;
|
virtual void DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, int32_t aIndent) MOZ_OVERRIDE;
|
||||||
|
@ -1964,7 +1964,7 @@ void nsDisplayMathMLCharDebug::Paint(nsDisplayListBuilder* aBuilder,
|
|||||||
nsRenderingContext* aCtx)
|
nsRenderingContext* aCtx)
|
||||||
{
|
{
|
||||||
// for visual debug
|
// for visual debug
|
||||||
Sides skipSides;
|
int skipSides = 0;
|
||||||
nsPresContext* presContext = mFrame->PresContext();
|
nsPresContext* presContext = mFrame->PresContext();
|
||||||
nsStyleContext* styleContext = mFrame->StyleContext();
|
nsStyleContext* styleContext = mFrame->StyleContext();
|
||||||
nsRect rect = mRect + ToReferenceFrame();
|
nsRect rect = mRect + ToReferenceFrame();
|
||||||
|
@ -95,7 +95,6 @@ COMPUTED_STYLE_PROP(border_top_style, BorderTopStyle)
|
|||||||
COMPUTED_STYLE_PROP(border_top_width, BorderTopWidth)
|
COMPUTED_STYLE_PROP(border_top_width, BorderTopWidth)
|
||||||
//// COMPUTED_STYLE_PROP(border_width, BorderWidth)
|
//// COMPUTED_STYLE_PROP(border_width, BorderWidth)
|
||||||
COMPUTED_STYLE_PROP(bottom, Bottom)
|
COMPUTED_STYLE_PROP(bottom, Bottom)
|
||||||
COMPUTED_STYLE_PROP(box_decoration_break, BoxDecorationBreak)
|
|
||||||
COMPUTED_STYLE_PROP(box_shadow, BoxShadow)
|
COMPUTED_STYLE_PROP(box_shadow, BoxShadow)
|
||||||
COMPUTED_STYLE_PROP(box_sizing, BoxSizing)
|
COMPUTED_STYLE_PROP(box_sizing, BoxSizing)
|
||||||
COMPUTED_STYLE_PROP(caption_side, CaptionSide)
|
COMPUTED_STYLE_PROP(caption_side, CaptionSide)
|
||||||
|
@ -14,11 +14,10 @@
|
|||||||
// XXX fold this into nsStyleContext and group by nsStyleXXX struct
|
// XXX fold this into nsStyleContext and group by nsStyleXXX struct
|
||||||
|
|
||||||
// Indices into border/padding/margin arrays
|
// Indices into border/padding/margin arrays
|
||||||
namespace mozilla {
|
#define NS_SIDE_TOP mozilla::css::eSideTop
|
||||||
namespace css {
|
#define NS_SIDE_RIGHT mozilla::css::eSideRight
|
||||||
typedef mozilla::Side Side;
|
#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_++)
|
#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) {
|
static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
|
||||||
|
@ -201,11 +201,11 @@ public:
|
|||||||
nscoord aSize,
|
nscoord aSize,
|
||||||
bool aStart);
|
bool aStart);
|
||||||
|
|
||||||
BCPixelSize GetCorner(mozilla::Side& aCornerOwner,
|
BCPixelSize GetCorner(mozilla::css::Side& aCornerOwner,
|
||||||
bool& aBevel) const;
|
bool& aBevel) const;
|
||||||
|
|
||||||
void SetCorner(BCPixelSize aSubSize,
|
void SetCorner(BCPixelSize aSubSize,
|
||||||
mozilla::Side aOwner,
|
mozilla::css::Side aOwner,
|
||||||
bool aBevel);
|
bool aBevel);
|
||||||
|
|
||||||
bool IsLeftStart() const;
|
bool IsLeftStart() const;
|
||||||
@ -229,7 +229,7 @@ protected:
|
|||||||
unsigned mTopOwner: 4; // owner of top border
|
unsigned mTopOwner: 4; // owner of top border
|
||||||
unsigned mLeftStart: 1; // set if this is the start of a vertical border segment
|
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 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).
|
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;
|
mTopStart = aStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline BCPixelSize BCData::GetCorner(mozilla::Side& aOwnerSide,
|
inline BCPixelSize BCData::GetCorner(mozilla::css::Side& aOwnerSide,
|
||||||
bool& aBevel) const
|
bool& aBevel) const
|
||||||
{
|
{
|
||||||
aOwnerSide = mozilla::Side(mCornerSide);
|
aOwnerSide = mozilla::css::Side(mCornerSide);
|
||||||
aBevel = (bool)mCornerBevel;
|
aBevel = (bool)mCornerBevel;
|
||||||
return mCornerSubSize;
|
return mCornerSubSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void BCData::SetCorner(BCPixelSize aSubSize,
|
inline void BCData::SetCorner(BCPixelSize aSubSize,
|
||||||
mozilla::Side aOwnerSide,
|
mozilla::css::Side aOwnerSide,
|
||||||
bool aBevel)
|
bool aBevel)
|
||||||
{
|
{
|
||||||
mCornerSubSize = aSubSize;
|
mCornerSubSize = aSubSize;
|
||||||
|
@ -728,7 +728,7 @@ nsTableCellMap::Dump(char* aString) const
|
|||||||
printf("***** bottom borders *****\n");
|
printf("***** bottom borders *****\n");
|
||||||
nscoord size;
|
nscoord size;
|
||||||
BCBorderOwner owner;
|
BCBorderOwner owner;
|
||||||
mozilla::Side side;
|
mozilla::css::Side side;
|
||||||
bool segStart;
|
bool segStart;
|
||||||
bool bevel;
|
bool bevel;
|
||||||
int32_t colIndex;
|
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
|
// 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).
|
// table, then store it one of the special arrays (right most borders, bottom most borders).
|
||||||
void
|
void
|
||||||
nsTableCellMap::SetBCBorderEdge(mozilla::Side aSide,
|
nsTableCellMap::SetBCBorderEdge(mozilla::css::Side aSide,
|
||||||
nsCellMap& aCellMap,
|
nsCellMap& aCellMap,
|
||||||
uint32_t aCellMapStart,
|
uint32_t aCellMapStart,
|
||||||
uint32_t aRowIndex,
|
uint32_t aRowIndex,
|
||||||
@ -1070,7 +1070,7 @@ nsTableCellMap::SetBCBorderCorner(Corner aCorner,
|
|||||||
uint32_t aCellMapStart,
|
uint32_t aCellMapStart,
|
||||||
uint32_t aRowIndex,
|
uint32_t aRowIndex,
|
||||||
uint32_t aColIndex,
|
uint32_t aColIndex,
|
||||||
mozilla::Side aOwner,
|
mozilla::css::Side aOwner,
|
||||||
nscoord aSubSize,
|
nscoord aSubSize,
|
||||||
bool aBevel,
|
bool aBevel,
|
||||||
bool aIsBottomRight)
|
bool aIsBottomRight)
|
||||||
@ -2584,7 +2584,7 @@ void nsCellMap::Dump(bool aIsBorderCollapse) const
|
|||||||
if (aIsBorderCollapse) {
|
if (aIsBorderCollapse) {
|
||||||
nscoord size;
|
nscoord size;
|
||||||
BCBorderOwner owner;
|
BCBorderOwner owner;
|
||||||
mozilla::Side side;
|
mozilla::css::Side side;
|
||||||
bool segStart;
|
bool segStart;
|
||||||
bool bevel;
|
bool bevel;
|
||||||
for (int32_t i = 0; i <= 2; i++) {
|
for (int32_t i = 0; i <= 2; i++) {
|
||||||
|
@ -204,7 +204,7 @@ public:
|
|||||||
uint32_t aXPos,
|
uint32_t aXPos,
|
||||||
bool aIsLowerRight = false);
|
bool aIsLowerRight = false);
|
||||||
|
|
||||||
void SetBCBorderEdge(mozilla::Side aEdge,
|
void SetBCBorderEdge(mozilla::css::Side aEdge,
|
||||||
nsCellMap& aCellMap,
|
nsCellMap& aCellMap,
|
||||||
uint32_t aCellMapStart,
|
uint32_t aCellMapStart,
|
||||||
uint32_t aYPos,
|
uint32_t aYPos,
|
||||||
@ -219,7 +219,7 @@ public:
|
|||||||
uint32_t aCellMapStart,
|
uint32_t aCellMapStart,
|
||||||
uint32_t aYPos,
|
uint32_t aYPos,
|
||||||
uint32_t aXPos,
|
uint32_t aXPos,
|
||||||
mozilla::Side aOwner,
|
mozilla::css::Side aOwner,
|
||||||
nscoord aSubSize,
|
nscoord aSubSize,
|
||||||
bool aBevel,
|
bool aBevel,
|
||||||
bool aIsBottomRight = false);
|
bool aIsBottomRight = false);
|
||||||
|
@ -545,20 +545,20 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||||||
BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
|
BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::LogicalSides
|
int
|
||||||
nsTableCellFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
nsTableCellFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
||||||
{
|
{
|
||||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
||||||
return LogicalSides();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicalSides skip;
|
int skip = 0;
|
||||||
if (nullptr != GetPrevInFlow()) {
|
if (nullptr != GetPrevInFlow()) {
|
||||||
skip |= eLogicalSideBitsBStart;
|
skip |= LOGICAL_SIDE_B_START;
|
||||||
}
|
}
|
||||||
if (nullptr != GetNextInFlow()) {
|
if (nullptr != GetNextInFlow()) {
|
||||||
skip |= eLogicalSideBitsBEnd;
|
skip |= LOGICAL_SIDE_B_END;
|
||||||
}
|
}
|
||||||
return skip;
|
return skip;
|
||||||
}
|
}
|
||||||
@ -1109,7 +1109,7 @@ nsBCTableCellFrame::GetUsedBorder() const
|
|||||||
/* virtual */ bool
|
/* virtual */ bool
|
||||||
nsBCTableCellFrame::GetBorderRadii(const nsSize& aFrameSize,
|
nsBCTableCellFrame::GetBorderRadii(const nsSize& aFrameSize,
|
||||||
const nsSize& aBorderArea,
|
const nsSize& aBorderArea,
|
||||||
Sides aSkipSides,
|
int aSkipSides,
|
||||||
nscoord aRadii[8]) const
|
nscoord aRadii[8]) const
|
||||||
{
|
{
|
||||||
NS_FOR_CSS_HALF_CORNERS(corner) {
|
NS_FOR_CSS_HALF_CORNERS(corner) {
|
||||||
|
@ -222,7 +222,7 @@ public:
|
|||||||
virtual void InvalidateFrameForRemoval() MOZ_OVERRIDE { InvalidateFrameSubtree(); }
|
virtual void InvalidateFrameForRemoval() MOZ_OVERRIDE { InvalidateFrameSubtree(); }
|
||||||
|
|
||||||
protected:
|
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
|
* GetBorderOverflow says how far the cell's own borders extend
|
||||||
@ -301,7 +301,7 @@ public:
|
|||||||
virtual nsMargin GetUsedBorder() const MOZ_OVERRIDE;
|
virtual nsMargin GetUsedBorder() const MOZ_OVERRIDE;
|
||||||
virtual bool GetBorderRadii(const nsSize& aFrameSize,
|
virtual bool GetBorderRadii(const nsSize& aFrameSize,
|
||||||
const nsSize& aBorderArea,
|
const nsSize& aBorderArea,
|
||||||
Sides aSkipSides,
|
int aSkipSides,
|
||||||
nscoord aRadii[8]) const MOZ_OVERRIDE;
|
nscoord aRadii[8]) const MOZ_OVERRIDE;
|
||||||
|
|
||||||
// Get the *inner half of the border only*, in twips.
|
// Get the *inner half of the border only*, in twips.
|
||||||
|
@ -14,8 +14,6 @@
|
|||||||
#include "nsCSSRendering.h"
|
#include "nsCSSRendering.h"
|
||||||
#include "nsIPresShell.h"
|
#include "nsIPresShell.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
|
||||||
|
|
||||||
#define COL_GROUP_TYPE_BITS (NS_FRAME_STATE_BIT(30) | \
|
#define COL_GROUP_TYPE_BITS (NS_FRAME_STATE_BIT(30) | \
|
||||||
NS_FRAME_STATE_BIT(31))
|
NS_FRAME_STATE_BIT(31))
|
||||||
#define COL_GROUP_TYPE_OFFSET 30
|
#define COL_GROUP_TYPE_OFFSET 30
|
||||||
@ -330,20 +328,20 @@ nsTableColGroupFrame::RemoveFrame(ChildListID aListID,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::LogicalSides
|
int
|
||||||
nsTableColGroupFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
nsTableColGroupFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
||||||
{
|
{
|
||||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
||||||
return LogicalSides();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicalSides skip;
|
int skip = 0;
|
||||||
if (nullptr != GetPrevInFlow()) {
|
if (nullptr != GetPrevInFlow()) {
|
||||||
skip |= eLogicalSideBitsBStart;
|
skip |= LOGICAL_SIDE_B_START;
|
||||||
}
|
}
|
||||||
if (nullptr != GetNextInFlow()) {
|
if (nullptr != GetNextInFlow()) {
|
||||||
skip |= eLogicalSideBitsBEnd;
|
skip |= LOGICAL_SIDE_B_END;
|
||||||
}
|
}
|
||||||
return skip;
|
return skip;
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ protected:
|
|||||||
void InsertColsReflow(int32_t aColIndex,
|
void InsertColsReflow(int32_t aColIndex,
|
||||||
const nsFrameList::Slice& aCols);
|
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
|
// data members
|
||||||
int32_t mColCount;
|
int32_t mColCount;
|
||||||
|
@ -1383,7 +1383,7 @@ nsTableFrame::PaintTableBorderBackground(nsRenderingContext& aRenderingContext,
|
|||||||
|
|
||||||
if (StyleVisibility()->IsVisible()) {
|
if (StyleVisibility()->IsVisible()) {
|
||||||
if (!IsBorderCollapse()) {
|
if (!IsBorderCollapse()) {
|
||||||
Sides skipSides = GetSkipSides();
|
int skipSides = GetSkipSides();
|
||||||
nsRect rect(aPt, mRect.Size());
|
nsRect rect(aPt, mRect.Size());
|
||||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||||
aDirtyRect, rect, mStyleContext, skipSides);
|
aDirtyRect, rect, mStyleContext, skipSides);
|
||||||
@ -1397,22 +1397,22 @@ nsTableFrame::PaintTableBorderBackground(nsRenderingContext& aRenderingContext,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::LogicalSides
|
int
|
||||||
nsTableFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
nsTableFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
||||||
{
|
{
|
||||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
||||||
return LogicalSides();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicalSides skip;
|
int skip = 0;
|
||||||
// frame attribute was accounted for in nsHTMLTableElement::MapTableBorderInto
|
// frame attribute was accounted for in nsHTMLTableElement::MapTableBorderInto
|
||||||
// account for pagination
|
// account for pagination
|
||||||
if (nullptr != GetPrevInFlow()) {
|
if (nullptr != GetPrevInFlow()) {
|
||||||
skip |= eLogicalSideBitsBStart;
|
skip |= LOGICAL_SIDE_B_START;
|
||||||
}
|
}
|
||||||
if (nullptr != GetNextInFlow()) {
|
if (nullptr != GetNextInFlow()) {
|
||||||
skip |= eLogicalSideBitsBEnd;
|
skip |= LOGICAL_SIDE_B_END;
|
||||||
}
|
}
|
||||||
return skip;
|
return skip;
|
||||||
}
|
}
|
||||||
|
@ -580,7 +580,7 @@ protected:
|
|||||||
|
|
||||||
void InitChildReflowState(nsHTMLReflowState& aReflowState);
|
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:
|
public:
|
||||||
bool IsRowInserted() const;
|
bool IsRowInserted() const;
|
||||||
|
@ -589,20 +589,20 @@ nsTableRowFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||||||
nsTableFrame::DisplayGenericTablePart(aBuilder, this, aDirtyRect, aLists, item);
|
nsTableFrame::DisplayGenericTablePart(aBuilder, this, aDirtyRect, aLists, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::LogicalSides
|
int
|
||||||
nsTableRowFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
nsTableRowFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
||||||
{
|
{
|
||||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
||||||
return LogicalSides();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicalSides skip;
|
int skip = 0;
|
||||||
if (nullptr != GetPrevInFlow()) {
|
if (nullptr != GetPrevInFlow()) {
|
||||||
skip |= eLogicalSideBitsBStart;
|
skip |= LOGICAL_SIDE_B_START;
|
||||||
}
|
}
|
||||||
if (nullptr != GetNextInFlow()) {
|
if (nullptr != GetNextInFlow()) {
|
||||||
skip |= eLogicalSideBitsBEnd;
|
skip |= LOGICAL_SIDE_B_END;
|
||||||
}
|
}
|
||||||
return skip;
|
return skip;
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ protected:
|
|||||||
bool aBorderCollapse,
|
bool aBorderCollapse,
|
||||||
nsTableCellReflowState& aReflowState);
|
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
|
// row-specific methods
|
||||||
|
|
||||||
|
@ -253,20 +253,20 @@ nsTableRowGroupFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||||||
aLists, item, DisplayRows);
|
aLists, item, DisplayRows);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::LogicalSides
|
int
|
||||||
nsTableRowGroupFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
nsTableRowGroupFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
|
||||||
{
|
{
|
||||||
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
|
||||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
NS_STYLE_BOX_DECORATION_BREAK_CLONE)) {
|
||||||
return LogicalSides();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogicalSides skip;
|
int skip = 0;
|
||||||
if (nullptr != GetPrevInFlow()) {
|
if (nullptr != GetPrevInFlow()) {
|
||||||
skip |= eLogicalSideBitsBStart;
|
skip |= LOGICAL_SIDE_B_START;
|
||||||
}
|
}
|
||||||
if (nullptr != GetNextInFlow()) {
|
if (nullptr != GetNextInFlow()) {
|
||||||
skip |= eLogicalSideBitsBEnd;
|
skip |= LOGICAL_SIDE_B_END;
|
||||||
}
|
}
|
||||||
return skip;
|
return skip;
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ protected:
|
|||||||
bool aBorderCollapse,
|
bool aBorderCollapse,
|
||||||
nsHTMLReflowState& aReflowState);
|
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,
|
void PlaceChild(nsPresContext* aPresContext,
|
||||||
nsRowGroupReflowState& aReflowState,
|
nsRowGroupReflowState& aReflowState,
|
||||||
|
@ -123,7 +123,7 @@ nsGroupBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||||||
void
|
void
|
||||||
nsGroupBoxFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
|
nsGroupBoxFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
|
||||||
nsPoint aPt, const nsRect& aDirtyRect) {
|
nsPoint aPt, const nsRect& aDirtyRect) {
|
||||||
Sides skipSides;
|
int skipSides = 0;
|
||||||
const nsStyleBorder* borderStyleData = StyleBorder();
|
const nsStyleBorder* borderStyleData = StyleBorder();
|
||||||
const nsMargin& border = borderStyleData->GetComputedBorder();
|
const nsMargin& border = borderStyleData->GetComputedBorder();
|
||||||
nscoord yoff = 0;
|
nscoord yoff = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user