Bug 998535 - Apply GetSkipSides to block border+padding to make it for work for box-decoration-break:clone. r=roc

This commit is contained in:
Mats Palmgren 2014-05-12 11:45:28 +00:00
Родитель a47dae1f05
Коммит bc1ff0e0a3
2 изменённых файлов: 16 добавлений и 22 удалений

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

@ -46,14 +46,14 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState,
SetFlag(BRS_ISOVERFLOWCONTAINER,
IS_TRUE_OVERFLOW_CONTAINER(aFrame));
const nsMargin& borderPadding = BorderPadding();
mContainerWidth = aReflowState.ComputedWidth() +
aReflowState.ComputedPhysicalBorderPadding().LeftRight();
mBorderPadding = mReflowState.ComputedPhysicalBorderPadding();
aFrame->ApplySkipSides(mBorderPadding, &aReflowState);
mContainerWidth = aReflowState.ComputedWidth() + mBorderPadding.LeftRight();
if (aTopMarginRoot || 0 != aReflowState.ComputedPhysicalBorderPadding().top) {
if (aTopMarginRoot || 0 != mBorderPadding.top) {
SetFlag(BRS_ISTOPMARGINROOT, true);
}
if (aBottomMarginRoot || 0 != aReflowState.ComputedPhysicalBorderPadding().bottom) {
if (aBottomMarginRoot || 0 != mBorderPadding.bottom) {
SetFlag(BRS_ISBOTTOMMARGINROOT, true);
}
if (GetFlag(BRS_ISTOPMARGINROOT)) {
@ -93,8 +93,8 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState,
// We are in a paginated situation. The bottom edge is just inside
// the bottom border and padding. The content area height doesn't
// include either border or padding edge.
mBottomEdge = aReflowState.AvailableHeight() - borderPadding.bottom;
mContentArea.height = std::max(0, mBottomEdge - borderPadding.top);
mBottomEdge = aReflowState.AvailableHeight() - mBorderPadding.bottom;
mContentArea.height = std::max(0, mBottomEdge - mBorderPadding.top);
}
else {
// When we are not in a paginated situation then we always use
@ -102,8 +102,8 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState,
SetFlag(BRS_UNCONSTRAINEDHEIGHT, true);
mContentArea.height = mBottomEdge = NS_UNCONSTRAINEDSIZE;
}
mContentArea.x = borderPadding.left;
mY = mContentArea.y = borderPadding.top;
mContentArea.x = mBorderPadding.left;
mY = mContentArea.y = mBorderPadding.top;
mPrevChild = nullptr;
mCurrentLine = aFrame->end_lines();

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

@ -92,23 +92,14 @@ public:
uint32_t aFlags = 0);
bool IsAdjacentWithTop() const {
return mY ==
((mFlags & BRS_ISFIRSTINFLOW) ? mReflowState.ComputedPhysicalBorderPadding().top : 0);
return mY == mBorderPadding.top;
}
/**
* Adjusts the border/padding to return 0 for the top if
* we are not the first in flow.
* Return mBlock's computed physical border+padding with GetSkipSides applied.
*/
nsMargin BorderPadding() const {
nsMargin result = mReflowState.ComputedPhysicalBorderPadding();
if (!(mFlags & BRS_ISFIRSTINFLOW)) {
result.top = 0;
if (mFlags & BRS_ISOVERFLOWCONTAINER) {
result.bottom = 0;
}
}
return result;
const nsMargin& BorderPadding() const {
return mBorderPadding;
}
/**
@ -222,6 +213,9 @@ public:
// The current Y coordinate in the block
nscoord mY;
// mBlock's computed physical border+padding with GetSkipSides applied.
nsMargin mBorderPadding;
// The overflow areas of all floats placed so far
nsOverflowAreas mFloatOverflowAreas;