Bug 1028460 - part 4, Remove LOGICAL_SIDE* and use the LogicalSideBits enum values instead. r=roc

CLOSED TREE
This commit is contained in:
Mats Palmgren 2014-06-28 10:13:14 +00:00
Родитель 3ffa9baecc
Коммит 0f6c0582fb
10 изменённых файлов: 26 добавлений и 30 удалений

Просмотреть файл

@ -52,14 +52,6 @@ enum LogicalSideBits {
eLogicalSideBitsAll = eLogicalSideBitsBBoth | eLogicalSideBitsIBoth
};
#define LOGICAL_SIDE_B_START mozilla::eLogicalSideBitsBStart
#define LOGICAL_SIDE_I_START mozilla::eLogicalSideBitsIStart
#define LOGICAL_SIDE_B_END mozilla::eLogicalSideBitsBEnd
#define LOGICAL_SIDE_I_END mozilla::eLogicalSideBitsIEnd
#define LOGICAL_SIDES_I_BOTH mozilla::eLogicalSideBitsIBoth
#define LOGICAL_SIDES_B_BOTH mozilla::eLogicalSideBitsBBoth
#define LOGICAL_SIDES_ALL mozilla::eLogicalSideBitsAll
/**
* LogicalSides represents a set of logical sides.
*/

Просмотреть файл

@ -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(LOGICAL_SIDES_ALL);
return LogicalSides(eLogicalSideBitsAll);
}
return LogicalSides(); // first continuation displays all sides
}

Просмотреть файл

@ -1845,10 +1845,10 @@ nsImageFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
}
LogicalSides skip;
if (nullptr != GetPrevInFlow()) {
skip |= LOGICAL_SIDE_B_START;
skip |= eLogicalSideBitsBStart;
}
if (nullptr != GetNextInFlow()) {
skip |= LOGICAL_SIDE_B_END;
skip |= eLogicalSideBitsBEnd;
}
return skip;
}

Просмотреть файл

@ -895,7 +895,7 @@ nsInlineFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
(prev && (prev->mRect.height || prev->mRect.width))) {
// Prev continuation is not empty therefore we don't render our start
// border edge.
skip |= LOGICAL_SIDE_I_START;
skip |= eLogicalSideBitsIStart;
}
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 |= LOGICAL_SIDE_I_END;
skip |= eLogicalSideBitsIEnd;
}
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(LOGICAL_SIDES_I_BOTH)) {
if (skip != LogicalSides(eLogicalSideBitsIBoth)) {
// 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 |= LOGICAL_SIDE_I_END;
skip |= eLogicalSideBitsIEnd;
}
if (firstContinuation->FrameIsNonFirstInIBSplit()) {
skip |= LOGICAL_SIDE_I_START;
skip |= eLogicalSideBitsIStart;
}
}
}

Просмотреть файл

@ -12,6 +12,8 @@
#include "nsContainerFrame.h"
#include "nsIFrameInlines.h"
using namespace mozilla;
NS_IMPL_FRAMEARENA_HELPERS(nsSplittableFrame)
void
@ -239,7 +241,7 @@ nsIFrame::LogicalSides
nsSplittableFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
{
if (IS_TRUE_OVERFLOW_CONTAINER(this)) {
return LogicalSides(LOGICAL_SIDES_B_BOTH);
return LogicalSides(eLogicalSideBitsBBoth);
}
if (MOZ_UNLIKELY(StyleBorder()->mBoxDecorationBreak ==
@ -249,7 +251,7 @@ nsSplittableFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) co
LogicalSides skip;
if (GetPrevInFlow()) {
skip |= LOGICAL_SIDE_B_START;
skip |= eLogicalSideBitsBStart;
}
if (aReflowState) {
@ -264,13 +266,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 |= LOGICAL_SIDE_B_END;
skip |= eLogicalSideBitsBEnd;
}
}
} else {
nsIFrame* nif = GetNextInFlow();
if (nif && !IS_TRUE_OVERFLOW_CONTAINER(nif)) {
skip |= LOGICAL_SIDE_B_END;
skip |= eLogicalSideBitsBEnd;
}
}

Просмотреть файл

@ -555,10 +555,10 @@ nsTableCellFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) con
LogicalSides skip;
if (nullptr != GetPrevInFlow()) {
skip |= LOGICAL_SIDE_B_START;
skip |= eLogicalSideBitsBStart;
}
if (nullptr != GetNextInFlow()) {
skip |= LOGICAL_SIDE_B_END;
skip |= eLogicalSideBitsBEnd;
}
return skip;
}

Просмотреть файл

@ -14,6 +14,8 @@
#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
@ -338,10 +340,10 @@ nsTableColGroupFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState)
LogicalSides skip;
if (nullptr != GetPrevInFlow()) {
skip |= LOGICAL_SIDE_B_START;
skip |= eLogicalSideBitsBStart;
}
if (nullptr != GetNextInFlow()) {
skip |= LOGICAL_SIDE_B_END;
skip |= eLogicalSideBitsBEnd;
}
return skip;
}

Просмотреть файл

@ -1409,10 +1409,10 @@ nsTableFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) const
// frame attribute was accounted for in nsHTMLTableElement::MapTableBorderInto
// account for pagination
if (nullptr != GetPrevInFlow()) {
skip |= LOGICAL_SIDE_B_START;
skip |= eLogicalSideBitsBStart;
}
if (nullptr != GetNextInFlow()) {
skip |= LOGICAL_SIDE_B_END;
skip |= eLogicalSideBitsBEnd;
}
return skip;
}

Просмотреть файл

@ -599,10 +599,10 @@ nsTableRowFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState) cons
LogicalSides skip;
if (nullptr != GetPrevInFlow()) {
skip |= LOGICAL_SIDE_B_START;
skip |= eLogicalSideBitsBStart;
}
if (nullptr != GetNextInFlow()) {
skip |= LOGICAL_SIDE_B_END;
skip |= eLogicalSideBitsBEnd;
}
return skip;
}

Просмотреть файл

@ -263,10 +263,10 @@ nsTableRowGroupFrame::GetLogicalSkipSides(const nsHTMLReflowState* aReflowState)
LogicalSides skip;
if (nullptr != GetPrevInFlow()) {
skip |= LOGICAL_SIDE_B_START;
skip |= eLogicalSideBitsBStart;
}
if (nullptr != GetNextInFlow()) {
skip |= LOGICAL_SIDE_B_END;
skip |= eLogicalSideBitsBEnd;
}
return skip;
}